1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup l1_publish_data Publishing results in SALOME study
37 ## By default, all functions of geompy.py Python interface do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of geompy.addToStudy() or geompy.addToStudyInFather()
42 ## However, it is possible to publish result data in the study
43 ## automatically. For this, almost each function of geompy.py module has
44 ## an additional @a theName parameter (@c None by default).
45 ## As soon as non-empty string value is passed to this parameter,
46 ## the result object is published in the study automatically.
51 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
52 ## geompy.addToStudy(box, "box") # explicit publishing
55 ## can be replaced by one-line instruction
58 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
64 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
67 ## Note, that some functions produce more than one geometrical objects. For example,
68 ## geompy.GetNonBlocks() function returns two objects: group of all non-hexa solids and group of
69 ## all non-quad faces. For such functions it is possible to specify separate names for results.
74 ## # create and publish cylinder
75 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
76 ## # get non blocks from cylinder
77 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
80 ## Above example will publish both result compounds (first with non-hexa solids and
81 ## second with non-quad faces) as two items, both named "nonblock".
82 ## However, if second command is invoked as
85 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
88 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
90 ## Automatic publication of all results can be also enabled/disabled by means of the function
91 ## geompy.addToStudyAuto(). The automatic publishing is managed by the numeric parameter passed
93 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
94 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
95 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
96 ## value passed as parameter has the same effect.
97 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
98 ## maximum number of sub-shapes allowed for publishing is set to specified value.
100 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
101 ## to the functions creating objects, instead default names will be used. However, you
102 ## can always change the behavior, by passing explicit name to the @a theName parameter
103 ## and it will be used instead default one.
104 ## The publishing of the collections of objects will be done according to the above
105 ## mentioned rules (maximum allowed number of sub-shapes).
110 ## geompy.addToStudyAuto() # enable automatic publication
111 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
112 ## # the box is created and published in the study with default name
113 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
114 ## vertices = geompy.SubShapeAll(box, geompy.ShapeType['VERTEX'])
115 ## # only 5 first vertices will be published, with default names
116 ## print len(vertices)
117 ## # note, that result value still containes all 8 vertices
118 ## geompy.addToStudyAuto(-1) # disable automatic publication
121 ## This feature can be used, for example, for debugging purposes.
124 ## - Use automatic publication feature with caution. When it is enabled, any function of geompy.py module
125 ## publishes the results in the study, that can lead to the huge size of the study data tree.
126 ## For example, repeating call of geompy.SubShapeAll() command on the same main shape each time will
127 ## publish all child objects, that will lead to a lot of duplicated items in the study.
128 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
129 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
130 ## - Not that some functions of geompy.py module do not have @theName parameter (and, thus, do not support
131 ## automatic publication). For example, some transformation operations like geompy.TranslateDXDYDZ().
132 ## Refer to the documentation to check if some function has such possibility.
137 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
139 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
141 ## @defgroup l2_import_export Importing/exporting geometrical objects
142 ## @defgroup l2_creating Creating geometrical objects
144 ## @defgroup l3_basic_go Creating Basic Geometric Objects
146 ## @defgroup l4_curves Creating Curves
149 ## @defgroup l3_3d_primitives Creating 3D Primitives
150 ## @defgroup l3_complex Creating Complex Objects
151 ## @defgroup l3_groups Working with groups
152 ## @defgroup l3_blocks Building by blocks
154 ## @defgroup l4_blocks_measure Check and Improve
157 ## @defgroup l3_sketcher Sketcher
158 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
160 ## @defgroup l4_decompose Decompose objects
161 ## @defgroup l4_decompose_d Decompose objects deprecated methods
162 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
163 ## @defgroup l4_obtain Access to sub-shapes by a criteria
164 ## @defgroup l4_advanced Advanced objects creation functions
169 ## @defgroup l2_transforming Transforming geometrical objects
171 ## @defgroup l3_basic_op Basic Operations
172 ## @defgroup l3_boolean Boolean Operations
173 ## @defgroup l3_transform Transformation Operations
174 ## @defgroup l3_transform_d Transformation Operations deprecated methods
175 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
176 ## @defgroup l3_blocks_op Blocks Operations
177 ## @defgroup l3_healing Repairing Operations
178 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
181 ## @defgroup l2_measure Using measurement tools
185 # initialize SALOME session in try/except block
186 # to avoid problems in some cases, e.g. when generating documentation
194 from salome_notebook import *
200 from salome.geom.gsketcher import Sketcher3D
203 def _toListOfNames(_names, _size=-1):
206 if type(_names) in [types.ListType, types.TupleType]:
207 for i in _names: l.append(i)
210 if l and len(l) < _size:
211 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
214 ## Raise an Error, containing the Method_name, if Operation is Failed
215 ## @ingroup l1_geomBuilder_auxiliary
216 def RaiseIfFailed (Method_name, Operation):
217 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
218 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
220 ## Return list of variables value from salome notebook
221 ## @ingroup l1_geomBuilder_auxiliary
222 def ParseParameters(*parameters):
225 for parameter in parameters:
226 if isinstance(parameter, list):
227 lResults = ParseParameters(*parameter)
228 if len(lResults) > 0:
229 Result.append(lResults[:-1])
230 StringResult += lResults[-1].split(":")
234 if isinstance(parameter,str):
235 if notebook.isVariable(parameter):
236 Result.append(notebook.get(parameter))
238 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
241 Result.append(parameter)
243 StringResult.append(str(parameter))
247 Result.append(":".join(StringResult))
249 Result = ":".join(StringResult)
252 ## Return list of variables value from salome notebook
253 ## @ingroup l1_geomBuilder_auxiliary
257 for parameter in list:
258 if isinstance(parameter,str) and notebook.isVariable(parameter):
259 Result.append(str(notebook.get(parameter)))
262 Result.append(str(parameter))
265 StringResult = StringResult + str(parameter)
266 StringResult = StringResult + ":"
268 StringResult = StringResult[:len(StringResult)-1]
269 return Result, StringResult
271 ## Return list of variables value from salome notebook
272 ## @ingroup l1_geomBuilder_auxiliary
273 def ParseSketcherCommand(command):
276 sections = command.split(":")
277 for section in sections:
278 parameters = section.split(" ")
280 for parameter in parameters:
281 if paramIndex > 1 and parameter.find("'") != -1:
282 parameter = parameter.replace("'","")
283 if notebook.isVariable(parameter):
284 Result = Result + str(notebook.get(parameter)) + " "
287 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
291 Result = Result + str(parameter) + " "
294 StringResult = StringResult + parameter
295 StringResult = StringResult + ":"
297 paramIndex = paramIndex + 1
299 Result = Result[:len(Result)-1] + ":"
301 Result = Result[:len(Result)-1]
302 return Result, StringResult
304 ## Helper function which can be used to pack the passed string to the byte data.
305 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
306 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
309 ## val = PackData("10001110") # val = 0xAE
310 ## val = PackData("1") # val = 0x80
312 ## @param data unpacked data - a string containing '1' and '0' symbols
313 ## @return data packed to the byte stream
314 ## @ingroup l1_geomBuilder_auxiliary
317 Helper function which can be used to pack the passed string to the byte data.
318 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
319 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
322 data unpacked data - a string containing '1' and '0' symbols
325 data packed to the byte stream
328 val = PackData("10001110") # val = 0xAE
329 val = PackData("1") # val = 0x80
332 if len(data)%8: bytes += 1
334 for b in range(bytes):
335 d = data[b*8:(b+1)*8]
340 if d[i] == "1": val += 1
342 raise "Invalid symbol %s" % d[i]
349 ## Read bitmap texture from the text file.
350 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
351 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
352 ## The function returns width and height of the pixmap in pixels and byte stream representing
353 ## texture bitmap itself.
355 ## This function can be used to read the texture to the byte stream in order to pass it to
356 ## the AddTexture() function of geomBuilder class.
359 ## from salome.geom import geomBuilder
360 ## geompy = geomBuilder.New(salome.myStudy)
361 ## texture = geompy.readtexture('mytexture.dat')
362 ## texture = geompy.AddTexture(*texture)
363 ## obj.SetMarkerTexture(texture)
365 ## @param fname texture file name
366 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
367 ## @ingroup l1_geomBuilder_auxiliary
368 def ReadTexture(fname):
370 Read bitmap texture from the text file.
371 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
372 A zero symbol ('0') represents transparent pixel of the texture bitmap.
373 The function returns width and height of the pixmap in pixels and byte stream representing
374 texture bitmap itself.
375 This function can be used to read the texture to the byte stream in order to pass it to
376 the AddTexture() function of geomBuilder class.
379 fname texture file name
382 sequence of tree values: texture's width, height in pixels and its byte stream
385 from salome.geom import geomBuilder
386 geompy = geomBuilder.New(salome.myStudy)
387 texture = geompy.readtexture('mytexture.dat')
388 texture = geompy.AddTexture(*texture)
389 obj.SetMarkerTexture(texture)
393 lines = [ l.strip() for l in f.readlines()]
396 if lines: maxlen = max([len(x) for x in lines])
398 if maxlen%8: lenbytes += 1
402 lenline = (len(line)/8+1)*8
405 lenline = (len(line)/8)*8
407 for i in range(lenline/8):
410 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
413 bytedata += PackData(byte)
415 for i in range(lenline/8, lenbytes):
416 bytedata += PackData("0")
418 return lenbytes*8, len(lines), bytedata
423 ## Returns a long value from enumeration type
424 # Can be used for CORBA enumerator types like GEOM.shape_type
425 # @param theItem enumeration type
426 # @ingroup l1_geomBuilder_auxiliary
427 def EnumToLong(theItem):
429 Returns a long value from enumeration type
430 Can be used for CORBA enumerator types like geomBuilder.ShapeType
433 theItem enumeration type
436 if hasattr(theItem, "_v"): ret = theItem._v
439 ## Information about closed/unclosed state of shell or wire
440 # @ingroup l1_geomBuilder_auxiliary
443 Information about closed/unclosed state of shell or wire
449 # Warning: geom is a singleton
455 class geomBuilder(object, GEOM._objref_GEOM_Gen):
457 ## Enumeration ShapeType as a dictionary. \n
458 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
459 # @ingroup l1_geomBuilder_auxiliary
460 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
462 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
463 # and a list of parameters, describing the shape.
464 # List of parameters, describing the shape:
465 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
466 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
468 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
470 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
472 # - SPHERE: [xc yc zc R]
473 # - CYLINDER: [xb yb zb dx dy dz R H]
474 # - BOX: [xc yc zc ax ay az]
475 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
476 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
477 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
478 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
479 # - SOLID: [nb_faces nb_edges nb_vertices]
481 # - SPHERE2D: [xc yc zc R]
482 # - CYLINDER2D: [xb yb zb dx dy dz R H]
483 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
484 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
485 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
486 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
487 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
488 # - PLANE: [xo yo zo dx dy dz]
489 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
490 # - FACE: [nb_edges nb_vertices]
492 # - CIRCLE: [xc yc zc dx dy dz R]
493 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
494 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
495 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
496 # - LINE: [xo yo zo dx dy dz]
497 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
498 # - EDGE: [nb_vertices]
501 # @ingroup l1_geomBuilder_auxiliary
502 kind = GEOM.GEOM_IKindOfShape
509 #print "__new__ ", engine, geom, doLcc, created
511 # geom engine is either retrieved from engine, or created
513 # Following test avoids a recursive loop
516 # geom engine not created: existing engine found
518 if doLcc and not created:
521 # FindOrLoadComponent called:
522 # 1. CORBA resolution of server
523 # 2. the __new__ method is called again
524 #print "FindOrLoadComponent ", engine, geom, doLcc, created
525 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
527 # FindOrLoadComponent not called
529 # geomBuilder instance is created from lcc.FindOrLoadComponent
531 #print "super ", engine, geom, doLcc, created
532 geom = super(geomBuilder,cls).__new__(cls)
534 # geom engine not created: existing engine found
535 #print "existing ", engine, geom, doLcc, created
544 #print "-------- geomBuilder __init__ --- ", created, self
545 GEOM._objref_GEOM_Gen.__init__(self)
546 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
547 self.myBuilder = None
566 ## Process object publication in the study, as follows:
567 # - if @a theName is specified (not None), the object is published in the study
568 # with this name, not taking into account "auto-publishing" option;
569 # - if @a theName is NOT specified, the object is published in the study
570 # (using default name, which can be customized using @a theDefaultName parameter)
571 # only if auto-publishing is switched on.
573 # @param theObj object, a subject for publishing
574 # @param theName object name for study
575 # @param theDefaultName default name for the auto-publishing
577 # @sa addToStudyAuto()
578 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
580 def _item_name(_names, _defname, _idx=-1):
581 if not _names: _names = _defname
582 if type(_names) in [types.ListType, types.TupleType]:
584 if _idx >= len(_names) or not _names[_idx]:
585 if type(_defname) not in [types.ListType, types.TupleType]:
586 _name = "%s_%d"%(_defname, _idx+1)
587 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
588 _name = _defname[_idx]
590 _name = "%noname_%d"%(dn, _idx+1)
596 # must be wrong usage
601 _name = "%s_%d"%(_names, _idx+1)
609 if not theName and not self.myMaxNbSubShapesAllowed:
610 return # nothing to do: auto-publishing is disabled
611 if not theName and not theDefaultName:
612 return # neither theName nor theDefaultName is given
614 if type(theObj) in [types.ListType, types.TupleType]:
615 # list of objects is being published
618 if not obj: continue # bad object
619 ###if obj.GetStudyEntry(): continue # already published
620 name = _item_name(theName, theDefaultName, idx)
621 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
622 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
624 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
627 if not theName and idx == self.myMaxNbSubShapesAllowed: break
631 # single object is published
632 ###if theObj.GetStudyEntry(): return # already published
633 name = _item_name(theName, theDefaultName)
634 if theObj.IsMainShape():
635 self.addToStudy(theObj, name)
637 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
642 ## @addtogroup l1_geompy_auxiliary
644 def init_geom(self,theStudy):
645 self.myStudy = theStudy
646 self.myStudyId = self.myStudy._get_StudyId()
647 self.myBuilder = self.myStudy.NewBuilder()
648 self.father = self.myStudy.FindComponent("GEOM")
649 if self.father is None:
650 self.father = self.myBuilder.NewComponent("GEOM")
651 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
652 FName = A1._narrow(SALOMEDS.AttributeName)
653 FName.SetValue("Geometry")
654 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
655 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
656 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
657 self.myBuilder.DefineComponentInstance(self.father,self)
659 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
660 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
661 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
662 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
663 self.HealOp = self.GetIHealingOperations (self.myStudyId)
664 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
665 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
666 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
667 self.LocalOp = self.GetILocalOperations (self.myStudyId)
668 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
669 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
670 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
671 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
674 ## Enable / disable results auto-publishing
676 # The automatic publishing is managed in the following way:
677 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
678 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
679 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
680 # value passed as parameter has the same effect.
681 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
682 # maximum number of sub-shapes allowed for publishing is set to specified value.
684 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
685 # @ingroup l1_publish_data
686 def addToStudyAuto(self, maxNbSubShapes=-1):
688 Enable / disable results auto-publishing
690 The automatic publishing is managed in the following way:
691 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
692 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
693 maximum number of sub-shapes allowed for publishing is unlimited; any negative
694 value passed as parameter has the same effect.
695 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
696 maximum number of sub-shapes allowed for publishing is set to this value.
699 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
702 geompy.addToStudyAuto() # enable auto-publishing
703 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
704 geompy.addToStudyAuto(0) # disable auto-publishing
706 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
709 ## Dump component to the Python script
710 # This method overrides IDL function to allow default values for the parameters.
711 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
713 Dump component to the Python script
714 This method overrides IDL function to allow default values for the parameters.
716 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
718 ## Get name for sub-shape aSubObj of shape aMainObj
720 # @ref swig_SubShapeName "Example"
721 def SubShapeName(self,aSubObj, aMainObj):
723 Get name for sub-shape aSubObj of shape aMainObj
725 # Example: see GEOM_TestAll.py
727 #aSubId = orb.object_to_string(aSubObj)
728 #aMainId = orb.object_to_string(aMainObj)
729 #index = gg.getIndexTopology(aSubId, aMainId)
730 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
731 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
732 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
735 ## Publish in study aShape with name aName
737 # \param aShape the shape to be published
738 # \param aName the name for the shape
739 # \param doRestoreSubShapes if True, finds and publishes also
740 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
741 # and published sub-shapes of arguments
742 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
743 # these arguments description
744 # \return study entry of the published shape in form of string
746 # @ingroup l1_publish_data
747 # @ref swig_all_addtostudy "Example"
748 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
749 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
751 Publish in study aShape with name aName
754 aShape the shape to be published
755 aName the name for the shape
756 doRestoreSubShapes if True, finds and publishes also
757 sub-shapes of aShape, corresponding to its arguments
758 and published sub-shapes of arguments
759 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
760 these arguments description
763 study entry of the published shape in form of string
766 id_block1 = geompy.addToStudy(Block1, "Block 1")
768 # Example: see GEOM_TestAll.py
770 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
771 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
772 if doRestoreSubShapes:
773 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
774 theFindMethod, theInheritFirstArg, True )
776 print "addToStudy() failed"
778 return aShape.GetStudyEntry()
780 ## Publish in study aShape with name aName as sub-object of previously published aFather
781 # \param aFather previously published object
782 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
783 # \param aName the name for the shape
785 # \return study entry of the published shape in form of string
787 # @ingroup l1_publish_data
788 # @ref swig_all_addtostudyInFather "Example"
789 def addToStudyInFather(self, aFather, aShape, aName):
791 Publish in study aShape with name aName as sub-object of previously published aFather
794 aFather previously published object
795 aShape the shape to be published as sub-object of aFather
796 aName the name for the shape
799 study entry of the published shape in form of string
801 # Example: see GEOM_TestAll.py
803 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
804 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
806 print "addToStudyInFather() failed"
808 return aShape.GetStudyEntry()
810 ## Unpublish object in study
812 # \param obj the object to be unpublished
813 def hideInStudy(self, obj):
815 Unpublish object in study
818 obj the object to be unpublished
820 ior = salome.orb.object_to_string(obj)
821 aSObject = self.myStudy.FindObjectIOR(ior)
822 if aSObject is not None:
823 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
824 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
825 drwAttribute.SetDrawable(False)
828 # end of l1_geompy_auxiliary
831 ## @addtogroup l3_restore_ss
834 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
835 # To be used from python scripts out of addToStudy() (non-default usage)
836 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
837 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
838 # If this list is empty, all operation arguments will be published
839 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
840 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
841 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
842 # Do not publish sub-shapes in place of arguments, but only
843 # in place of sub-shapes of the first argument,
844 # because the whole shape corresponds to the first argument.
845 # Mainly to be used after transformations, but it also can be
846 # usefull after partition with one object shape, and some other
847 # operations, where only the first argument has to be considered.
848 # If theObject has only one argument shape, this flag is automatically
849 # considered as True, not regarding really passed value.
850 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
851 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
852 # \return list of published sub-shapes
854 # @ref tui_restore_prs_params "Example"
855 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
856 theInheritFirstArg=False, theAddPrefix=True):
858 Publish sub-shapes, standing for arguments and sub-shapes of arguments
859 To be used from python scripts out of geompy.addToStudy (non-default usage)
862 theObject published GEOM.GEOM_Object, arguments of which will be published
863 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
864 If this list is empty, all operation arguments will be published
865 theFindMethod method to search sub-shapes, corresponding to arguments and
866 their sub-shapes. Value from enumeration GEOM.find_shape_method.
867 theInheritFirstArg set properties of the first argument for theObject.
868 Do not publish sub-shapes in place of arguments, but only
869 in place of sub-shapes of the first argument,
870 because the whole shape corresponds to the first argument.
871 Mainly to be used after transformations, but it also can be
872 usefull after partition with one object shape, and some other
873 operations, where only the first argument has to be considered.
874 If theObject has only one argument shape, this flag is automatically
875 considered as True, not regarding really passed value.
876 theAddPrefix add prefix "from_" to names of restored sub-shapes,
877 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
879 list of published sub-shapes
881 # Example: see GEOM_TestAll.py
882 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
883 theFindMethod, theInheritFirstArg, theAddPrefix)
885 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
886 # To be used from python scripts out of addToStudy() (non-default usage)
887 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
888 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
889 # If this list is empty, all operation arguments will be published
890 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
891 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
892 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
893 # Do not publish sub-shapes in place of arguments, but only
894 # in place of sub-shapes of the first argument,
895 # because the whole shape corresponds to the first argument.
896 # Mainly to be used after transformations, but it also can be
897 # usefull after partition with one object shape, and some other
898 # operations, where only the first argument has to be considered.
899 # If theObject has only one argument shape, this flag is automatically
900 # considered as True, not regarding really passed value.
901 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
902 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
903 # \return list of published sub-shapes
905 # @ref tui_restore_prs_params "Example"
906 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
907 theInheritFirstArg=False, theAddPrefix=True):
909 Publish sub-shapes, standing for arguments and sub-shapes of arguments
910 To be used from python scripts out of geompy.addToStudy() (non-default usage)
913 theObject published GEOM.GEOM_Object, arguments of which will be published
914 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
915 If this list is empty, all operation arguments will be published
916 theFindMethod method to search sub-shapes, corresponding to arguments and
917 their sub-shapes. Value from enumeration GEOM::find_shape_method.
918 theInheritFirstArg set properties of the first argument for theObject.
919 Do not publish sub-shapes in place of arguments, but only
920 in place of sub-shapes of the first argument,
921 because the whole shape corresponds to the first argument.
922 Mainly to be used after transformations, but it also can be
923 usefull after partition with one object shape, and some other
924 operations, where only the first argument has to be considered.
925 If theObject has only one argument shape, this flag is automatically
926 considered as True, not regarding really passed value.
927 theAddPrefix add prefix "from_" to names of restored sub-shapes,
928 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
931 list of published sub-shapes
933 # Example: see GEOM_TestAll.py
934 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
935 theFindMethod, theInheritFirstArg, theAddPrefix)
937 # end of l3_restore_ss
940 ## @addtogroup l3_basic_go
943 ## Create point by three coordinates.
944 # @param theX The X coordinate of the point.
945 # @param theY The Y coordinate of the point.
946 # @param theZ The Z coordinate of the point.
947 # @param theName Object name; when specified, this parameter is used
948 # for result publication in the study. Otherwise, if automatic
949 # publication is switched on, default value is used for result name.
951 # @return New GEOM.GEOM_Object, containing the created point.
953 # @ref tui_creation_point "Example"
954 def MakeVertex(self, theX, theY, theZ, theName=None):
956 Create point by three coordinates.
959 theX The X coordinate of the point.
960 theY The Y coordinate of the point.
961 theZ The Z coordinate of the point.
962 theName Object name; when specified, this parameter is used
963 for result publication in the study. Otherwise, if automatic
964 publication is switched on, default value is used for result name.
967 New GEOM.GEOM_Object, containing the created point.
969 # Example: see GEOM_TestAll.py
970 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
971 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
972 RaiseIfFailed("MakePointXYZ", self.BasicOp)
973 anObj.SetParameters(Parameters)
974 self._autoPublish(anObj, theName, "vertex")
977 ## Create a point, distant from the referenced point
978 # on the given distances along the coordinate axes.
979 # @param theReference The referenced point.
980 # @param theX Displacement from the referenced point along OX axis.
981 # @param theY Displacement from the referenced point along OY axis.
982 # @param theZ Displacement from the referenced point along OZ axis.
983 # @param theName Object name; when specified, this parameter is used
984 # for result publication in the study. Otherwise, if automatic
985 # publication is switched on, default value is used for result name.
987 # @return New GEOM.GEOM_Object, containing the created point.
989 # @ref tui_creation_point "Example"
990 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
992 Create a point, distant from the referenced point
993 on the given distances along the coordinate axes.
996 theReference The referenced point.
997 theX Displacement from the referenced point along OX axis.
998 theY Displacement from the referenced point along OY axis.
999 theZ Displacement from the referenced point along OZ axis.
1000 theName Object name; when specified, this parameter is used
1001 for result publication in the study. Otherwise, if automatic
1002 publication is switched on, default value is used for result name.
1005 New GEOM.GEOM_Object, containing the created point.
1007 # Example: see GEOM_TestAll.py
1008 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1009 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1010 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1011 anObj.SetParameters(Parameters)
1012 self._autoPublish(anObj, theName, "vertex")
1015 ## Create a point, corresponding to the given parameter on the given curve.
1016 # @param theRefCurve The referenced curve.
1017 # @param theParameter Value of parameter on the referenced curve.
1018 # @param theName Object name; when specified, this parameter is used
1019 # for result publication in the study. Otherwise, if automatic
1020 # publication is switched on, default value is used for result name.
1022 # @return New GEOM.GEOM_Object, containing the created point.
1024 # @ref tui_creation_point "Example"
1025 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1027 Create a point, corresponding to the given parameter on the given curve.
1030 theRefCurve The referenced curve.
1031 theParameter Value of parameter on the referenced curve.
1032 theName Object name; when specified, this parameter is used
1033 for result publication in the study. Otherwise, if automatic
1034 publication is switched on, default value is used for result name.
1037 New GEOM.GEOM_Object, containing the created point.
1040 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1042 # Example: see GEOM_TestAll.py
1043 theParameter, Parameters = ParseParameters(theParameter)
1044 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1045 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1046 anObj.SetParameters(Parameters)
1047 self._autoPublish(anObj, theName, "vertex")
1050 ## Create a point by projection give coordinates on the given curve
1051 # @param theRefCurve The referenced curve.
1052 # @param theX X-coordinate in 3D space
1053 # @param theY Y-coordinate in 3D space
1054 # @param theZ Z-coordinate in 3D space
1055 # @param theName Object name; when specified, this parameter is used
1056 # for result publication in the study. Otherwise, if automatic
1057 # publication is switched on, default value is used for result name.
1059 # @return New GEOM.GEOM_Object, containing the created point.
1061 # @ref tui_creation_point "Example"
1062 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1064 Create a point by projection give coordinates on the given curve
1067 theRefCurve The referenced curve.
1068 theX X-coordinate in 3D space
1069 theY Y-coordinate in 3D space
1070 theZ Z-coordinate in 3D space
1071 theName Object name; when specified, this parameter is used
1072 for result publication in the study. Otherwise, if automatic
1073 publication is switched on, default value is used for result name.
1076 New GEOM.GEOM_Object, containing the created point.
1079 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1081 # Example: see GEOM_TestAll.py
1082 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1083 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1084 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1085 anObj.SetParameters(Parameters)
1086 self._autoPublish(anObj, theName, "vertex")
1089 ## Create a point, corresponding to the given length on the given curve.
1090 # @param theRefCurve The referenced curve.
1091 # @param theLength Length on the referenced curve. It can be negative.
1092 # @param theStartPoint Point allowing to choose the direction for the calculation
1093 # of the length. If None, start from the first point of theRefCurve.
1094 # @param theName Object name; when specified, this parameter is used
1095 # for result publication in the study. Otherwise, if automatic
1096 # publication is switched on, default value is used for result name.
1098 # @return New GEOM.GEOM_Object, containing the created point.
1100 # @ref tui_creation_point "Example"
1101 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1103 Create a point, corresponding to the given length on the given curve.
1106 theRefCurve The referenced curve.
1107 theLength Length on the referenced curve. It can be negative.
1108 theStartPoint Point allowing to choose the direction for the calculation
1109 of the length. If None, start from the first point of theRefCurve.
1110 theName Object name; when specified, this parameter is used
1111 for result publication in the study. Otherwise, if automatic
1112 publication is switched on, default value is used for result name.
1115 New GEOM.GEOM_Object, containing the created point.
1117 # Example: see GEOM_TestAll.py
1118 theLength, Parameters = ParseParameters(theLength)
1119 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1120 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1121 anObj.SetParameters(Parameters)
1122 self._autoPublish(anObj, theName, "vertex")
1125 ## Create a point, corresponding to the given parameters on the
1127 # @param theRefSurf The referenced surface.
1128 # @param theUParameter Value of U-parameter on the referenced surface.
1129 # @param theVParameter Value of V-parameter on the referenced surface.
1130 # @param theName Object name; when specified, this parameter is used
1131 # for result publication in the study. Otherwise, if automatic
1132 # publication is switched on, default value is used for result name.
1134 # @return New GEOM.GEOM_Object, containing the created point.
1136 # @ref swig_MakeVertexOnSurface "Example"
1137 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1139 Create a point, corresponding to the given parameters on the
1143 theRefSurf The referenced surface.
1144 theUParameter Value of U-parameter on the referenced surface.
1145 theVParameter Value of V-parameter on the referenced surface.
1146 theName Object name; when specified, this parameter is used
1147 for result publication in the study. Otherwise, if automatic
1148 publication is switched on, default value is used for result name.
1151 New GEOM.GEOM_Object, containing the created point.
1154 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1156 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1157 # Example: see GEOM_TestAll.py
1158 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1159 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1160 anObj.SetParameters(Parameters);
1161 self._autoPublish(anObj, theName, "vertex")
1164 ## Create a point by projection give coordinates on the given surface
1165 # @param theRefSurf The referenced surface.
1166 # @param theX X-coordinate in 3D space
1167 # @param theY Y-coordinate in 3D space
1168 # @param theZ Z-coordinate in 3D space
1169 # @param theName Object name; when specified, this parameter is used
1170 # for result publication in the study. Otherwise, if automatic
1171 # publication is switched on, default value is used for result name.
1173 # @return New GEOM.GEOM_Object, containing the created point.
1175 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1176 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1178 Create a point by projection give coordinates on the given surface
1181 theRefSurf The referenced surface.
1182 theX X-coordinate in 3D space
1183 theY Y-coordinate in 3D space
1184 theZ Z-coordinate in 3D space
1185 theName Object name; when specified, this parameter is used
1186 for result publication in the study. Otherwise, if automatic
1187 publication is switched on, default value is used for result name.
1190 New GEOM.GEOM_Object, containing the created point.
1193 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1195 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1196 # Example: see GEOM_TestAll.py
1197 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1198 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1199 anObj.SetParameters(Parameters);
1200 self._autoPublish(anObj, theName, "vertex")
1203 ## Create a point, which lays on the given face.
1204 # The point will lay in arbitrary place of the face.
1205 # The only condition on it is a non-zero distance to the face boundary.
1206 # Such point can be used to uniquely identify the face inside any
1207 # shape in case, when the shape does not contain overlapped faces.
1208 # @param theFace The referenced face.
1209 # @param 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.
1213 # @return New GEOM.GEOM_Object, containing the created point.
1215 # @ref swig_MakeVertexInsideFace "Example"
1216 def MakeVertexInsideFace (self, theFace, theName=None):
1218 Create a point, which lays on the given face.
1219 The point will lay in arbitrary place of the face.
1220 The only condition on it is a non-zero distance to the face boundary.
1221 Such point can be used to uniquely identify the face inside any
1222 shape in case, when the shape does not contain overlapped faces.
1225 theFace The referenced face.
1226 theName Object name; when specified, this parameter is used
1227 for result publication in the study. Otherwise, if automatic
1228 publication is switched on, default value is used for result name.
1231 New GEOM.GEOM_Object, containing the created point.
1234 p_on_face = geompy.MakeVertexInsideFace(Face)
1236 # Example: see GEOM_TestAll.py
1237 anObj = self.BasicOp.MakePointOnFace(theFace)
1238 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1239 self._autoPublish(anObj, theName, "vertex")
1242 ## Create a point on intersection of two lines.
1243 # @param theRefLine1, theRefLine2 The referenced lines.
1244 # @param theName Object name; when specified, this parameter is used
1245 # for result publication in the study. Otherwise, if automatic
1246 # publication is switched on, default value is used for result name.
1248 # @return New GEOM.GEOM_Object, containing the created point.
1250 # @ref swig_MakeVertexOnLinesIntersection "Example"
1251 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1253 Create a point on intersection of two lines.
1256 theRefLine1, theRefLine2 The referenced lines.
1257 theName Object name; when specified, this parameter is used
1258 for result publication in the study. Otherwise, if automatic
1259 publication is switched on, default value is used for result name.
1262 New GEOM.GEOM_Object, containing the created point.
1264 # Example: see GEOM_TestAll.py
1265 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1266 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1267 self._autoPublish(anObj, theName, "vertex")
1270 ## Create a tangent, corresponding to the given parameter on the given curve.
1271 # @param theRefCurve The referenced curve.
1272 # @param theParameter Value of parameter on the referenced curve.
1273 # @param theName Object name; when specified, this parameter is used
1274 # for result publication in the study. Otherwise, if automatic
1275 # publication is switched on, default value is used for result name.
1277 # @return New GEOM.GEOM_Object, containing the created tangent.
1279 # @ref swig_MakeTangentOnCurve "Example"
1280 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1282 Create a tangent, corresponding to the given parameter on the given curve.
1285 theRefCurve The referenced curve.
1286 theParameter Value of parameter on the referenced curve.
1287 theName Object name; when specified, this parameter is used
1288 for result publication in the study. Otherwise, if automatic
1289 publication is switched on, default value is used for result name.
1292 New GEOM.GEOM_Object, containing the created tangent.
1295 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1297 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1298 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1299 self._autoPublish(anObj, theName, "tangent")
1302 ## Create a tangent plane, corresponding to the given parameter on the given face.
1303 # @param theFace The face for which tangent plane should be built.
1304 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1305 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1306 # @param theTrimSize the size of plane.
1307 # @param theName Object name; when specified, this parameter is used
1308 # for result publication in the study. Otherwise, if automatic
1309 # publication is switched on, default value is used for result name.
1311 # @return New GEOM.GEOM_Object, containing the created tangent.
1313 # @ref swig_MakeTangentPlaneOnFace "Example"
1314 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1316 Create a tangent plane, corresponding to the given parameter on the given face.
1319 theFace The face for which tangent plane should be built.
1320 theParameterV vertical value of the center point (0.0 - 1.0).
1321 theParameterU horisontal value of the center point (0.0 - 1.0).
1322 theTrimSize the size of plane.
1323 theName Object name; when specified, this parameter is used
1324 for result publication in the study. Otherwise, if automatic
1325 publication is switched on, default value is used for result name.
1328 New GEOM.GEOM_Object, containing the created tangent.
1331 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1333 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1334 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1335 self._autoPublish(anObj, theName, "tangent")
1338 ## Create a vector with the given components.
1339 # @param theDX X component of the vector.
1340 # @param theDY Y component of the vector.
1341 # @param theDZ Z component of the vector.
1342 # @param theName Object name; when specified, this parameter is used
1343 # for result publication in the study. Otherwise, if automatic
1344 # publication is switched on, default value is used for result name.
1346 # @return New GEOM.GEOM_Object, containing the created vector.
1348 # @ref tui_creation_vector "Example"
1349 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1351 Create a vector with the given components.
1354 theDX X component of the vector.
1355 theDY Y component of the vector.
1356 theDZ Z component of the vector.
1357 theName Object name; when specified, this parameter is used
1358 for result publication in the study. Otherwise, if automatic
1359 publication is switched on, default value is used for result name.
1362 New GEOM.GEOM_Object, containing the created vector.
1364 # Example: see GEOM_TestAll.py
1365 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1366 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1367 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1368 anObj.SetParameters(Parameters)
1369 self._autoPublish(anObj, theName, "vector")
1372 ## Create a vector between two points.
1373 # @param thePnt1 Start point for the vector.
1374 # @param thePnt2 End point for the vector.
1375 # @param theName Object name; when specified, this parameter is used
1376 # for result publication in the study. Otherwise, if automatic
1377 # publication is switched on, default value is used for result name.
1379 # @return New GEOM.GEOM_Object, containing the created vector.
1381 # @ref tui_creation_vector "Example"
1382 def MakeVector(self, thePnt1, thePnt2, theName=None):
1384 Create a vector between two points.
1387 thePnt1 Start point for the vector.
1388 thePnt2 End point for the vector.
1389 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.
1394 New GEOM.GEOM_Object, containing the created vector.
1396 # Example: see GEOM_TestAll.py
1397 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1398 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1399 self._autoPublish(anObj, theName, "vector")
1402 ## Create a line, passing through the given point
1403 # and parrallel to the given direction
1404 # @param thePnt Point. The resulting line will pass through it.
1405 # @param theDir Direction. The resulting line will be parallel to it.
1406 # @param theName Object name; when specified, this parameter is used
1407 # for result publication in the study. Otherwise, if automatic
1408 # publication is switched on, default value is used for result name.
1410 # @return New GEOM.GEOM_Object, containing the created line.
1412 # @ref tui_creation_line "Example"
1413 def MakeLine(self, thePnt, theDir, theName=None):
1415 Create a line, passing through the given point
1416 and parrallel to the given direction
1419 thePnt Point. The resulting line will pass through it.
1420 theDir Direction. The resulting line will be parallel to it.
1421 theName Object name; when specified, this parameter is used
1422 for result publication in the study. Otherwise, if automatic
1423 publication is switched on, default value is used for result name.
1426 New GEOM.GEOM_Object, containing the created line.
1428 # Example: see GEOM_TestAll.py
1429 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1430 RaiseIfFailed("MakeLine", self.BasicOp)
1431 self._autoPublish(anObj, theName, "line")
1434 ## Create a line, passing through the given points
1435 # @param thePnt1 First of two points, defining the line.
1436 # @param thePnt2 Second of two points, defining the line.
1437 # @param theName Object name; when specified, this parameter is used
1438 # for result publication in the study. Otherwise, if automatic
1439 # publication is switched on, default value is used for result name.
1441 # @return New GEOM.GEOM_Object, containing the created line.
1443 # @ref tui_creation_line "Example"
1444 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1446 Create a line, passing through the given points
1449 thePnt1 First of two points, defining the line.
1450 thePnt2 Second of two points, defining the line.
1451 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.
1456 New GEOM.GEOM_Object, containing the created line.
1458 # Example: see GEOM_TestAll.py
1459 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1460 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1461 self._autoPublish(anObj, theName, "line")
1464 ## Create a line on two faces intersection.
1465 # @param theFace1 First of two faces, defining the line.
1466 # @param theFace2 Second of two faces, defining the line.
1467 # @param 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.
1471 # @return New GEOM.GEOM_Object, containing the created line.
1473 # @ref swig_MakeLineTwoFaces "Example"
1474 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1476 Create a line on two faces intersection.
1479 theFace1 First of two faces, defining the line.
1480 theFace2 Second of two faces, defining the line.
1481 theName Object name; when specified, this parameter is used
1482 for result publication in the study. Otherwise, if automatic
1483 publication is switched on, default value is used for result name.
1486 New GEOM.GEOM_Object, containing the created line.
1488 # Example: see GEOM_TestAll.py
1489 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1490 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1491 self._autoPublish(anObj, theName, "line")
1494 ## Create a plane, passing through the given point
1495 # and normal to the given vector.
1496 # @param thePnt Point, the plane has to pass through.
1497 # @param theVec Vector, defining the plane normal direction.
1498 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1499 # @param theName Object name; when specified, this parameter is used
1500 # for result publication in the study. Otherwise, if automatic
1501 # publication is switched on, default value is used for result name.
1503 # @return New GEOM.GEOM_Object, containing the created plane.
1505 # @ref tui_creation_plane "Example"
1506 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1508 Create a plane, passing through the given point
1509 and normal to the given vector.
1512 thePnt Point, the plane has to pass through.
1513 theVec Vector, defining the plane normal direction.
1514 theTrimSize Half size of a side of quadrangle face, representing the plane.
1515 theName Object name; when specified, this parameter is used
1516 for result publication in the study. Otherwise, if automatic
1517 publication is switched on, default value is used for result name.
1520 New GEOM.GEOM_Object, containing the created plane.
1522 # Example: see GEOM_TestAll.py
1523 theTrimSize, Parameters = ParseParameters(theTrimSize);
1524 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1525 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1526 anObj.SetParameters(Parameters)
1527 self._autoPublish(anObj, theName, "plane")
1530 ## Create a plane, passing through the three given points
1531 # @param thePnt1 First of three points, defining the plane.
1532 # @param thePnt2 Second of three points, defining the plane.
1533 # @param thePnt3 Fird of three points, defining the plane.
1534 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1535 # @param 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.
1539 # @return New GEOM.GEOM_Object, containing the created plane.
1541 # @ref tui_creation_plane "Example"
1542 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1544 Create a plane, passing through the three given points
1547 thePnt1 First of three points, defining the plane.
1548 thePnt2 Second of three points, defining the plane.
1549 thePnt3 Fird of three points, defining the plane.
1550 theTrimSize Half size of a side of quadrangle face, representing the plane.
1551 theName Object name; when specified, this parameter is used
1552 for result publication in the study. Otherwise, if automatic
1553 publication is switched on, default value is used for result name.
1556 New GEOM.GEOM_Object, containing the created plane.
1558 # Example: see GEOM_TestAll.py
1559 theTrimSize, Parameters = ParseParameters(theTrimSize);
1560 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1561 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1562 anObj.SetParameters(Parameters)
1563 self._autoPublish(anObj, theName, "plane")
1566 ## Create a plane, similar to the existing one, but with another size of representing face.
1567 # @param theFace Referenced plane or LCS(Marker).
1568 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1569 # @param theName Object name; when specified, this parameter is used
1570 # for result publication in the study. Otherwise, if automatic
1571 # publication is switched on, default value is used for result name.
1573 # @return New GEOM.GEOM_Object, containing the created plane.
1575 # @ref tui_creation_plane "Example"
1576 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1578 Create a plane, similar to the existing one, but with another size of representing face.
1581 theFace Referenced plane or LCS(Marker).
1582 theTrimSize New half size of a side of quadrangle face, representing the plane.
1583 theName Object name; when specified, this parameter is used
1584 for result publication in the study. Otherwise, if automatic
1585 publication is switched on, default value is used for result name.
1588 New GEOM.GEOM_Object, containing the created plane.
1590 # Example: see GEOM_TestAll.py
1591 theTrimSize, Parameters = ParseParameters(theTrimSize);
1592 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1593 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1594 anObj.SetParameters(Parameters)
1595 self._autoPublish(anObj, theName, "plane")
1598 ## Create a plane, passing through the 2 vectors
1599 # with center in a start point of the first vector.
1600 # @param theVec1 Vector, defining center point and plane direction.
1601 # @param theVec2 Vector, defining the plane normal direction.
1602 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1603 # @param theName Object name; when specified, this parameter is used
1604 # for result publication in the study. Otherwise, if automatic
1605 # publication is switched on, default value is used for result name.
1607 # @return New GEOM.GEOM_Object, containing the created plane.
1609 # @ref tui_creation_plane "Example"
1610 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1612 Create a plane, passing through the 2 vectors
1613 with center in a start point of the first vector.
1616 theVec1 Vector, defining center point and plane direction.
1617 theVec2 Vector, defining the plane normal direction.
1618 theTrimSize Half size of a side of quadrangle face, representing the plane.
1619 theName Object name; when specified, this parameter is used
1620 for result publication in the study. Otherwise, if automatic
1621 publication is switched on, default value is used for result name.
1624 New GEOM.GEOM_Object, containing the created plane.
1626 # Example: see GEOM_TestAll.py
1627 theTrimSize, Parameters = ParseParameters(theTrimSize);
1628 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1629 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1630 anObj.SetParameters(Parameters)
1631 self._autoPublish(anObj, theName, "plane")
1634 ## Create a plane, based on a Local coordinate system.
1635 # @param theLCS coordinate system, defining plane.
1636 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1637 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1638 # @param theName Object name; when specified, this parameter is used
1639 # for result publication in the study. Otherwise, if automatic
1640 # publication is switched on, default value is used for result name.
1642 # @return New GEOM.GEOM_Object, containing the created plane.
1644 # @ref tui_creation_plane "Example"
1645 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1647 Create a plane, based on a Local coordinate system.
1650 theLCS coordinate system, defining plane.
1651 theTrimSize Half size of a side of quadrangle face, representing the plane.
1652 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1653 theName Object name; when specified, this parameter is used
1654 for result publication in the study. Otherwise, if automatic
1655 publication is switched on, default value is used for result name.
1658 New GEOM.GEOM_Object, containing the created plane.
1660 # Example: see GEOM_TestAll.py
1661 theTrimSize, Parameters = ParseParameters(theTrimSize);
1662 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1663 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1664 anObj.SetParameters(Parameters)
1665 self._autoPublish(anObj, theName, "plane")
1668 ## Create a local coordinate system.
1669 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1670 # @param XDX,XDY,XDZ Three components of OX direction
1671 # @param YDX,YDY,YDZ Three components of OY direction
1672 # @param theName Object name; when specified, this parameter is used
1673 # for result publication in the study. Otherwise, if automatic
1674 # publication is switched on, default value is used for result name.
1676 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1678 # @ref swig_MakeMarker "Example"
1679 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1681 Create a local coordinate system.
1684 OX,OY,OZ Three coordinates of coordinate system origin.
1685 XDX,XDY,XDZ Three components of OX direction
1686 YDX,YDY,YDZ Three components of OY direction
1687 theName Object name; when specified, this parameter is used
1688 for result publication in the study. Otherwise, if automatic
1689 publication is switched on, default value is used for result name.
1692 New GEOM.GEOM_Object, containing the created coordinate system.
1694 # Example: see GEOM_TestAll.py
1695 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1696 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1697 RaiseIfFailed("MakeMarker", self.BasicOp)
1698 anObj.SetParameters(Parameters)
1699 self._autoPublish(anObj, theName, "lcs")
1702 ## Create a local coordinate system from shape.
1703 # @param theShape The initial shape to detect the coordinate system.
1704 # @param theName Object name; when specified, this parameter is used
1705 # for result publication in the study. Otherwise, if automatic
1706 # publication is switched on, default value is used for result name.
1708 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1710 # @ref tui_creation_lcs "Example"
1711 def MakeMarkerFromShape(self, theShape, theName=None):
1713 Create a local coordinate system from shape.
1716 theShape The initial shape to detect the coordinate system.
1717 theName Object name; when specified, this parameter is used
1718 for result publication in the study. Otherwise, if automatic
1719 publication is switched on, default value is used for result name.
1722 New GEOM.GEOM_Object, containing the created coordinate system.
1724 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1725 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1726 self._autoPublish(anObj, theName, "lcs")
1729 ## Create a local coordinate system from point and two vectors.
1730 # @param theOrigin Point of coordinate system origin.
1731 # @param theXVec Vector of X direction
1732 # @param theYVec Vector of Y direction
1733 # @param theName Object name; when specified, this parameter is used
1734 # for result publication in the study. Otherwise, if automatic
1735 # publication is switched on, default value is used for result name.
1737 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1739 # @ref tui_creation_lcs "Example"
1740 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1742 Create a local coordinate system from point and two vectors.
1745 theOrigin Point of coordinate system origin.
1746 theXVec Vector of X direction
1747 theYVec Vector of Y direction
1748 theName Object name; when specified, this parameter is used
1749 for result publication in the study. Otherwise, if automatic
1750 publication is switched on, default value is used for result name.
1753 New GEOM.GEOM_Object, containing the created coordinate system.
1756 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1757 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1758 self._autoPublish(anObj, theName, "lcs")
1761 # end of l3_basic_go
1764 ## @addtogroup l4_curves
1767 ## Create an arc of circle, passing through three given points.
1768 # @param thePnt1 Start point of the arc.
1769 # @param thePnt2 Middle point of the arc.
1770 # @param thePnt3 End point of the arc.
1771 # @param theName Object name; when specified, this parameter is used
1772 # for result publication in the study. Otherwise, if automatic
1773 # publication is switched on, default value is used for result name.
1775 # @return New GEOM.GEOM_Object, containing the created arc.
1777 # @ref swig_MakeArc "Example"
1778 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1780 Create an arc of circle, passing through three given points.
1783 thePnt1 Start point of the arc.
1784 thePnt2 Middle point of the arc.
1785 thePnt3 End point of the arc.
1786 theName Object name; when specified, this parameter is used
1787 for result publication in the study. Otherwise, if automatic
1788 publication is switched on, default value is used for result name.
1791 New GEOM.GEOM_Object, containing the created arc.
1793 # Example: see GEOM_TestAll.py
1794 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1795 RaiseIfFailed("MakeArc", self.CurvesOp)
1796 self._autoPublish(anObj, theName, "arc")
1799 ## Create an arc of circle from a center and 2 points.
1800 # @param thePnt1 Center of the arc
1801 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1802 # @param thePnt3 End point of the arc (Gives also a direction)
1803 # @param theSense Orientation of the arc
1804 # @param 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.
1808 # @return New GEOM.GEOM_Object, containing the created arc.
1810 # @ref swig_MakeArc "Example"
1811 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1813 Create an arc of circle from a center and 2 points.
1816 thePnt1 Center of the arc
1817 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1818 thePnt3 End point of the arc (Gives also a direction)
1819 theSense Orientation of the arc
1820 theName Object name; when specified, this parameter is used
1821 for result publication in the study. Otherwise, if automatic
1822 publication is switched on, default value is used for result name.
1825 New GEOM.GEOM_Object, containing the created arc.
1827 # Example: see GEOM_TestAll.py
1828 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1829 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1830 self._autoPublish(anObj, theName, "arc")
1833 ## Create an arc of ellipse, of center and two points.
1834 # @param theCenter Center of the arc.
1835 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1836 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1837 # @param theName Object name; when specified, this parameter is used
1838 # for result publication in the study. Otherwise, if automatic
1839 # publication is switched on, default value is used for result name.
1841 # @return New GEOM.GEOM_Object, containing the created arc.
1843 # @ref swig_MakeArc "Example"
1844 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1846 Create an arc of ellipse, of center and two points.
1849 theCenter Center of the arc.
1850 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1851 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1852 theName Object name; when specified, this parameter is used
1853 for result publication in the study. Otherwise, if automatic
1854 publication is switched on, default value is used for result name.
1857 New GEOM.GEOM_Object, containing the created arc.
1859 # Example: see GEOM_TestAll.py
1860 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1861 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1862 self._autoPublish(anObj, theName, "arc")
1865 ## Create a circle with given center, normal vector and radius.
1866 # @param thePnt Circle center.
1867 # @param theVec Vector, normal to the plane of the circle.
1868 # @param theR Circle radius.
1869 # @param theName Object name; when specified, this parameter is used
1870 # for result publication in the study. Otherwise, if automatic
1871 # publication is switched on, default value is used for result name.
1873 # @return New GEOM.GEOM_Object, containing the created circle.
1875 # @ref tui_creation_circle "Example"
1876 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1878 Create a circle with given center, normal vector and radius.
1881 thePnt Circle center.
1882 theVec Vector, normal to the plane of the circle.
1884 theName Object name; when specified, this parameter is used
1885 for result publication in the study. Otherwise, if automatic
1886 publication is switched on, default value is used for result name.
1889 New GEOM.GEOM_Object, containing the created circle.
1891 # Example: see GEOM_TestAll.py
1892 theR, Parameters = ParseParameters(theR)
1893 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1894 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1895 anObj.SetParameters(Parameters)
1896 self._autoPublish(anObj, theName, "circle")
1899 ## Create a circle with given radius.
1900 # Center of the circle will be in the origin of global
1901 # coordinate system and normal vector will be codirected with Z axis
1902 # @param theR Circle radius.
1903 # @param theName Object name; when specified, this parameter is used
1904 # for result publication in the study. Otherwise, if automatic
1905 # publication is switched on, default value is used for result name.
1907 # @return New GEOM.GEOM_Object, containing the created circle.
1908 def MakeCircleR(self, theR, theName=None):
1910 Create a circle with given radius.
1911 Center of the circle will be in the origin of global
1912 coordinate system and normal vector will be codirected with Z axis
1916 theName Object name; when specified, this parameter is used
1917 for result publication in the study. Otherwise, if automatic
1918 publication is switched on, default value is used for result name.
1921 New GEOM.GEOM_Object, containing the created circle.
1923 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1924 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1925 self._autoPublish(anObj, theName, "circle")
1928 ## Create a circle, passing through three given points
1929 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1930 # @param theName Object name; when specified, this parameter is used
1931 # for result publication in the study. Otherwise, if automatic
1932 # publication is switched on, default value is used for result name.
1934 # @return New GEOM.GEOM_Object, containing the created circle.
1936 # @ref tui_creation_circle "Example"
1937 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1939 Create a circle, passing through three given points
1942 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1943 theName Object name; when specified, this parameter is used
1944 for result publication in the study. Otherwise, if automatic
1945 publication is switched on, default value is used for result name.
1948 New GEOM.GEOM_Object, containing the created circle.
1950 # Example: see GEOM_TestAll.py
1951 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1952 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1953 self._autoPublish(anObj, theName, "circle")
1956 ## Create a circle, with given point1 as center,
1957 # passing through the point2 as radius and laying in the plane,
1958 # defined by all three given points.
1959 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1960 # @param theName Object name; when specified, this parameter is used
1961 # for result publication in the study. Otherwise, if automatic
1962 # publication is switched on, default value is used for result name.
1964 # @return New GEOM.GEOM_Object, containing the created circle.
1966 # @ref swig_MakeCircle "Example"
1967 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1969 Create a circle, with given point1 as center,
1970 passing through the point2 as radius and laying in the plane,
1971 defined by all three given points.
1974 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1975 theName Object name; when specified, this parameter is used
1976 for result publication in the study. Otherwise, if automatic
1977 publication is switched on, default value is used for result name.
1980 New GEOM.GEOM_Object, containing the created circle.
1982 # Example: see GEOM_example6.py
1983 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1984 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1985 self._autoPublish(anObj, theName, "circle")
1988 ## Create an ellipse with given center, normal vector and radiuses.
1989 # @param thePnt Ellipse center.
1990 # @param theVec Vector, normal to the plane of the ellipse.
1991 # @param theRMajor Major ellipse radius.
1992 # @param theRMinor Minor ellipse radius.
1993 # @param theVecMaj Vector, direction of the ellipse's main axis.
1994 # @param theName Object name; when specified, this parameter is used
1995 # for result publication in the study. Otherwise, if automatic
1996 # publication is switched on, default value is used for result name.
1998 # @return New GEOM.GEOM_Object, containing the created ellipse.
2000 # @ref tui_creation_ellipse "Example"
2001 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2003 Create an ellipse with given center, normal vector and radiuses.
2006 thePnt Ellipse center.
2007 theVec Vector, normal to the plane of the ellipse.
2008 theRMajor Major ellipse radius.
2009 theRMinor Minor ellipse radius.
2010 theVecMaj Vector, direction of the ellipse's main axis.
2011 theName Object name; when specified, this parameter is used
2012 for result publication in the study. Otherwise, if automatic
2013 publication is switched on, default value is used for result name.
2016 New GEOM.GEOM_Object, containing the created ellipse.
2018 # Example: see GEOM_TestAll.py
2019 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2020 if theVecMaj is not None:
2021 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2023 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2025 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2026 anObj.SetParameters(Parameters)
2027 self._autoPublish(anObj, theName, "ellipse")
2030 ## Create an ellipse with given radiuses.
2031 # Center of the ellipse will be in the origin of global
2032 # coordinate system and normal vector will be codirected with Z axis
2033 # @param theRMajor Major ellipse radius.
2034 # @param theRMinor Minor ellipse radius.
2035 # @param theName Object name; when specified, this parameter is used
2036 # for result publication in the study. Otherwise, if automatic
2037 # publication is switched on, default value is used for result name.
2039 # @return New GEOM.GEOM_Object, containing the created ellipse.
2040 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2042 Create an ellipse with given radiuses.
2043 Center of the ellipse will be in the origin of global
2044 coordinate system and normal vector will be codirected with Z axis
2047 theRMajor Major ellipse radius.
2048 theRMinor Minor ellipse radius.
2049 theName Object name; when specified, this parameter is used
2050 for result publication in the study. Otherwise, if automatic
2051 publication is switched on, default value is used for result name.
2054 New GEOM.GEOM_Object, containing the created ellipse.
2056 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2057 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2058 self._autoPublish(anObj, theName, "ellipse")
2061 ## Create a polyline on the set of points.
2062 # @param thePoints Sequence of points for the polyline.
2063 # @param theIsClosed If True, build a closed wire.
2064 # @param theName Object name; when specified, this parameter is used
2065 # for result publication in the study. Otherwise, if automatic
2066 # publication is switched on, default value is used for result name.
2068 # @return New GEOM.GEOM_Object, containing the created polyline.
2070 # @ref tui_creation_curve "Example"
2071 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2073 Create a polyline on the set of points.
2076 thePoints Sequence of points for the polyline.
2077 theIsClosed If True, build a closed wire.
2078 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.
2083 New GEOM.GEOM_Object, containing the created polyline.
2085 # Example: see GEOM_TestAll.py
2086 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2087 RaiseIfFailed("MakePolyline", self.CurvesOp)
2088 self._autoPublish(anObj, theName, "polyline")
2091 ## Create bezier curve on the set of points.
2092 # @param thePoints Sequence of points for the bezier curve.
2093 # @param theIsClosed If True, build a closed curve.
2094 # @param 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.
2098 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2100 # @ref tui_creation_curve "Example"
2101 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2103 Create bezier curve on the set of points.
2106 thePoints Sequence of points for the bezier curve.
2107 theIsClosed If True, build a closed curve.
2108 theName Object name; when specified, this parameter is used
2109 for result publication in the study. Otherwise, if automatic
2110 publication is switched on, default value is used for result name.
2113 New GEOM.GEOM_Object, containing the created bezier curve.
2115 # Example: see GEOM_TestAll.py
2116 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2117 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2118 self._autoPublish(anObj, theName, "bezier")
2121 ## Create B-Spline curve on the set of points.
2122 # @param thePoints Sequence of points for the B-Spline curve.
2123 # @param theIsClosed If True, build a closed curve.
2124 # @param theDoReordering If TRUE, the algo does not follow the order of
2125 # \a thePoints but searches for the closest vertex.
2126 # @param 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.
2130 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2132 # @ref tui_creation_curve "Example"
2133 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2135 Create B-Spline curve on the set of points.
2138 thePoints Sequence of points for the B-Spline curve.
2139 theIsClosed If True, build a closed curve.
2140 theDoReordering If True, the algo does not follow the order of
2141 thePoints but searches for the closest vertex.
2142 theName Object name; when specified, this parameter is used
2143 for result publication in the study. Otherwise, if automatic
2144 publication is switched on, default value is used for result name.
2147 New GEOM.GEOM_Object, containing the created B-Spline curve.
2149 # Example: see GEOM_TestAll.py
2150 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2151 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2152 self._autoPublish(anObj, theName, "bspline")
2155 ## Create B-Spline curve on the set of points.
2156 # @param thePoints Sequence of points for the B-Spline curve.
2157 # @param theFirstVec Vector object, defining the curve direction at its first point.
2158 # @param theLastVec Vector object, defining the curve direction at its last point.
2159 # @param theName Object name; when specified, this parameter is used
2160 # for result publication in the study. Otherwise, if automatic
2161 # publication is switched on, default value is used for result name.
2163 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2165 # @ref tui_creation_curve "Example"
2166 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2168 Create B-Spline curve on the set of points.
2171 thePoints Sequence of points for the B-Spline curve.
2172 theFirstVec Vector object, defining the curve direction at its first point.
2173 theLastVec Vector object, defining the curve direction at its last point.
2174 theName Object name; when specified, this parameter is used
2175 for result publication in the study. Otherwise, if automatic
2176 publication is switched on, default value is used for result name.
2179 New GEOM.GEOM_Object, containing the created B-Spline curve.
2181 # Example: see GEOM_TestAll.py
2182 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2183 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2184 self._autoPublish(anObj, theName, "bspline")
2187 ## Creates a curve using the parametric definition of the basic points.
2188 # @param thexExpr parametric equation of the coordinates X.
2189 # @param theyExpr parametric equation of the coordinates Y.
2190 # @param thezExpr parametric equation of the coordinates Z.
2191 # @param theParamMin the minimal value of the parameter.
2192 # @param theParamMax the maximum value of the parameter.
2193 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2194 # @param theCurveType the type of the curve.
2195 # @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.
2196 # @param theName Object name; when specified, this parameter is used
2197 # for result publication in the study. Otherwise, if automatic
2198 # publication is switched on, default value is used for result name.
2200 # @return New GEOM.GEOM_Object, containing the created curve.
2202 # @ref tui_creation_curve "Example"
2203 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2204 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2206 Creates a curve using the parametric definition of the basic points.
2209 thexExpr parametric equation of the coordinates X.
2210 theyExpr parametric equation of the coordinates Y.
2211 thezExpr parametric equation of the coordinates Z.
2212 theParamMin the minimal value of the parameter.
2213 theParamMax the maximum value of the parameter.
2214 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2215 theCurveType the type of the curve.
2216 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2217 method is used which can lead to a bug.
2218 theName Object name; when specified, this parameter is used
2219 for result publication in the study. Otherwise, if automatic
2220 publication is switched on, default value is used for result name.
2223 New GEOM.GEOM_Object, containing the created curve.
2225 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2227 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2229 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2230 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2231 anObj.SetParameters(Parameters)
2232 self._autoPublish(anObj, theName, "curve")
2238 ## @addtogroup l3_sketcher
2241 ## Create a sketcher (wire or face), following the textual description,
2242 # passed through <VAR>theCommand</VAR> argument. \n
2243 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2244 # Format of the description string have to be the following:
2246 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2249 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2251 # - "R angle" : Set the direction by angle
2252 # - "D dx dy" : Set the direction by DX & DY
2255 # - "TT x y" : Create segment by point at X & Y
2256 # - "T dx dy" : Create segment by point with DX & DY
2257 # - "L length" : Create segment by direction & Length
2258 # - "IX x" : Create segment by direction & Intersect. X
2259 # - "IY y" : Create segment by direction & Intersect. Y
2262 # - "C radius length" : Create arc by direction, radius and length(in degree)
2263 # - "AA x y": Create arc by point at X & Y
2264 # - "A dx dy" : Create arc by point with DX & DY
2265 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2266 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2267 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2268 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2271 # - "WW" : Close Wire (to finish)
2272 # - "WF" : Close Wire and build face (to finish)
2275 # - Flag1 (= reverse) is 0 or 2 ...
2276 # - if 0 the drawn arc is the one of lower angle (< Pi)
2277 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2280 # - Flag2 (= control tolerance) is 0 or 1 ...
2281 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2282 # - if 1 the wire is built only if the end point is on the arc
2283 # with a tolerance of 10^-7 on the distance else the creation fails
2285 # @param theCommand String, defining the sketcher in local
2286 # coordinates of the working plane.
2287 # @param theWorkingPlane Nine double values, defining origin,
2288 # OZ and OX directions of the working plane.
2289 # @param theName Object name; when specified, this parameter is used
2290 # for result publication in the study. Otherwise, if automatic
2291 # publication is switched on, default value is used for result name.
2293 # @return New GEOM.GEOM_Object, containing the created wire.
2295 # @ref tui_sketcher_page "Example"
2296 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2298 Create a sketcher (wire or face), following the textual description, passed
2299 through theCommand argument.
2300 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2301 Format of the description string have to be the following:
2302 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2304 - x1, y1 are coordinates of the first sketcher point (zero by default),
2306 - "R angle" : Set the direction by angle
2307 - "D dx dy" : Set the direction by DX & DY
2309 - "TT x y" : Create segment by point at X & Y
2310 - "T dx dy" : Create segment by point with DX & DY
2311 - "L length" : Create segment by direction & Length
2312 - "IX x" : Create segment by direction & Intersect. X
2313 - "IY y" : Create segment by direction & Intersect. Y
2315 - "C radius length" : Create arc by direction, radius and length(in degree)
2316 - "AA x y": Create arc by point at X & Y
2317 - "A dx dy" : Create arc by point with DX & DY
2318 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2319 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2320 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2321 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2323 - "WW" : Close Wire (to finish)
2324 - "WF" : Close Wire and build face (to finish)
2326 - Flag1 (= reverse) is 0 or 2 ...
2327 - if 0 the drawn arc is the one of lower angle (< Pi)
2328 - if 2 the drawn arc ius the one of greater angle (> Pi)
2330 - Flag2 (= control tolerance) is 0 or 1 ...
2331 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2332 - if 1 the wire is built only if the end point is on the arc
2333 with a tolerance of 10^-7 on the distance else the creation fails
2336 theCommand String, defining the sketcher in local
2337 coordinates of the working plane.
2338 theWorkingPlane Nine double values, defining origin,
2339 OZ and OX directions of the working plane.
2340 theName Object name; when specified, this parameter is used
2341 for result publication in the study. Otherwise, if automatic
2342 publication is switched on, default value is used for result name.
2345 New GEOM.GEOM_Object, containing the created wire.
2347 # Example: see GEOM_TestAll.py
2348 theCommand,Parameters = ParseSketcherCommand(theCommand)
2349 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2350 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2351 anObj.SetParameters(Parameters)
2352 self._autoPublish(anObj, theName, "wire")
2355 ## Create a sketcher (wire or face), following the textual description,
2356 # passed through <VAR>theCommand</VAR> argument. \n
2357 # For format of the description string see MakeSketcher() method.\n
2358 # @param theCommand String, defining the sketcher in local
2359 # coordinates of the working plane.
2360 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2361 # @param theName Object name; when specified, this parameter is used
2362 # for result publication in the study. Otherwise, if automatic
2363 # publication is switched on, default value is used for result name.
2365 # @return New GEOM.GEOM_Object, containing the created wire.
2367 # @ref tui_sketcher_page "Example"
2368 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2370 Create a sketcher (wire or face), following the textual description,
2371 passed through theCommand argument.
2372 For format of the description string see geompy.MakeSketcher() method.
2375 theCommand String, defining the sketcher in local
2376 coordinates of the working plane.
2377 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2378 theName Object name; when specified, this parameter is used
2379 for result publication in the study. Otherwise, if automatic
2380 publication is switched on, default value is used for result name.
2383 New GEOM.GEOM_Object, containing the created wire.
2385 theCommand,Parameters = ParseSketcherCommand(theCommand)
2386 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2387 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2388 anObj.SetParameters(Parameters)
2389 self._autoPublish(anObj, theName, "wire")
2392 ## Create a sketcher wire, following the numerical description,
2393 # passed through <VAR>theCoordinates</VAR> argument. \n
2394 # @param theCoordinates double values, defining points to create a wire,
2396 # @param theName Object name; when specified, this parameter is used
2397 # for result publication in the study. Otherwise, if automatic
2398 # publication is switched on, default value is used for result name.
2400 # @return New GEOM.GEOM_Object, containing the created wire.
2402 # @ref tui_3dsketcher_page "Example"
2403 def Make3DSketcher(self, theCoordinates, theName=None):
2405 Create a sketcher wire, following the numerical description,
2406 passed through theCoordinates argument.
2409 theCoordinates double values, defining points to create a wire,
2411 theName Object name; when specified, this parameter is used
2412 for result publication in the study. Otherwise, if automatic
2413 publication is switched on, default value is used for result name.
2416 New GEOM_Object, containing the created wire.
2418 theCoordinates,Parameters = ParseParameters(theCoordinates)
2419 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2420 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2421 anObj.SetParameters(Parameters)
2422 self._autoPublish(anObj, theName, "wire")
2425 ## Obtain a 3D sketcher interface
2426 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2428 # @ref tui_3dsketcher_page "Example"
2429 def Sketcher3D (self):
2431 Obtain a 3D sketcher interface.
2434 sk = geompy.Sketcher3D()
2435 sk.addPointsAbsolute(0,0,0, 70,0,0)
2436 sk.addPointsRelative(0, 0, 130)
2437 sk.addPointAnglesLength("OXY", 50, 0, 100)
2438 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2440 a3D_Sketcher_1 = sk.wire()
2442 sk = Sketcher3D (self)
2445 # end of l3_sketcher
2448 ## @addtogroup l3_3d_primitives
2451 ## Create a box by coordinates of two opposite vertices.
2453 # @param x1,y1,z1 double values, defining first point it.
2454 # @param x2,y2,z2 double values, defining first point it.
2455 # @param theName Object name; when specified, this parameter is used
2456 # for result publication in the study. Otherwise, if automatic
2457 # publication is switched on, default value is used for result name.
2459 # @return New GEOM.GEOM_Object, containing the created box.
2461 # @ref tui_creation_box "Example"
2462 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2464 Create a box by coordinates of two opposite vertices.
2467 x1,y1,z1 double values, defining first point.
2468 x2,y2,z2 double values, defining second point.
2469 theName Object name; when specified, this parameter is used
2470 for result publication in the study. Otherwise, if automatic
2471 publication is switched on, default value is used for result name.
2474 New GEOM.GEOM_Object, containing the created box.
2476 # Example: see GEOM_TestAll.py
2477 pnt1 = self.MakeVertex(x1,y1,z1)
2478 pnt2 = self.MakeVertex(x2,y2,z2)
2479 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2480 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2482 ## Create a box with specified dimensions along the coordinate axes
2483 # and with edges, parallel to the coordinate axes.
2484 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2485 # @param theDX Length of Box edges, parallel to OX axis.
2486 # @param theDY Length of Box edges, parallel to OY axis.
2487 # @param theDZ Length of Box edges, parallel to OZ axis.
2488 # @param theName Object name; when specified, this parameter is used
2489 # for result publication in the study. Otherwise, if automatic
2490 # publication is switched on, default value is used for result name.
2492 # @return New GEOM.GEOM_Object, containing the created box.
2494 # @ref tui_creation_box "Example"
2495 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2497 Create a box with specified dimensions along the coordinate axes
2498 and with edges, parallel to the coordinate axes.
2499 Center of the box will be at point (DX/2, DY/2, DZ/2).
2502 theDX Length of Box edges, parallel to OX axis.
2503 theDY Length of Box edges, parallel to OY axis.
2504 theDZ Length of Box edges, parallel to OZ axis.
2505 theName Object name; when specified, this parameter is used
2506 for result publication in the study. Otherwise, if automatic
2507 publication is switched on, default value is used for result name.
2510 New GEOM.GEOM_Object, containing the created box.
2512 # Example: see GEOM_TestAll.py
2513 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2514 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2515 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2516 anObj.SetParameters(Parameters)
2517 self._autoPublish(anObj, theName, "box")
2520 ## Create a box with two specified opposite vertices,
2521 # and with edges, parallel to the coordinate axes
2522 # @param thePnt1 First of two opposite vertices.
2523 # @param thePnt2 Second of two opposite vertices.
2524 # @param theName Object name; when specified, this parameter is used
2525 # for result publication in the study. Otherwise, if automatic
2526 # publication is switched on, default value is used for result name.
2528 # @return New GEOM.GEOM_Object, containing the created box.
2530 # @ref tui_creation_box "Example"
2531 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2533 Create a box with two specified opposite vertices,
2534 and with edges, parallel to the coordinate axes
2537 thePnt1 First of two opposite vertices.
2538 thePnt2 Second of two opposite vertices.
2539 theName Object name; when specified, this parameter is used
2540 for result publication in the study. Otherwise, if automatic
2541 publication is switched on, default value is used for result name.
2544 New GEOM.GEOM_Object, containing the created box.
2546 # Example: see GEOM_TestAll.py
2547 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2548 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2549 self._autoPublish(anObj, theName, "box")
2552 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2553 # @param theH height of Face.
2554 # @param theW width of Face.
2555 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2556 # @param theName Object name; when specified, this parameter is used
2557 # for result publication in the study. Otherwise, if automatic
2558 # publication is switched on, default value is used for result name.
2560 # @return New GEOM.GEOM_Object, containing the created face.
2562 # @ref tui_creation_face "Example"
2563 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2565 Create a face with specified dimensions with edges parallel to coordinate axes.
2568 theH height of Face.
2570 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2571 theName Object name; when specified, this parameter is used
2572 for result publication in the study. Otherwise, if automatic
2573 publication is switched on, default value is used for result name.
2576 New GEOM.GEOM_Object, containing the created face.
2578 # Example: see GEOM_TestAll.py
2579 theH,theW,Parameters = ParseParameters(theH, theW)
2580 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2581 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2582 anObj.SetParameters(Parameters)
2583 self._autoPublish(anObj, theName, "rectangle")
2586 ## Create a face from another plane and two sizes,
2587 # vertical size and horisontal size.
2588 # @param theObj Normale vector to the creating face or
2590 # @param theH Height (vertical size).
2591 # @param theW Width (horisontal size).
2592 # @param theName Object name; when specified, this parameter is used
2593 # for result publication in the study. Otherwise, if automatic
2594 # publication is switched on, default value is used for result name.
2596 # @return New GEOM.GEOM_Object, containing the created face.
2598 # @ref tui_creation_face "Example"
2599 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2601 Create a face from another plane and two sizes,
2602 vertical size and horisontal size.
2605 theObj Normale vector to the creating face or
2607 theH Height (vertical size).
2608 theW Width (horisontal size).
2609 theName Object name; when specified, this parameter is used
2610 for result publication in the study. Otherwise, if automatic
2611 publication is switched on, default value is used for result name.
2614 New GEOM_Object, containing the created face.
2616 # Example: see GEOM_TestAll.py
2617 theH,theW,Parameters = ParseParameters(theH, theW)
2618 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2619 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2620 anObj.SetParameters(Parameters)
2621 self._autoPublish(anObj, theName, "rectangle")
2624 ## Create a disk with given center, normal vector and radius.
2625 # @param thePnt Disk center.
2626 # @param theVec Vector, normal to the plane of the disk.
2627 # @param theR Disk radius.
2628 # @param theName Object name; when specified, this parameter is used
2629 # for result publication in the study. Otherwise, if automatic
2630 # publication is switched on, default value is used for result name.
2632 # @return New GEOM.GEOM_Object, containing the created disk.
2634 # @ref tui_creation_disk "Example"
2635 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2637 Create a disk with given center, normal vector and radius.
2641 theVec Vector, normal to the plane of the disk.
2643 theName Object name; when specified, this parameter is used
2644 for result publication in the study. Otherwise, if automatic
2645 publication is switched on, default value is used for result name.
2648 New GEOM.GEOM_Object, containing the created disk.
2650 # Example: see GEOM_TestAll.py
2651 theR,Parameters = ParseParameters(theR)
2652 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2653 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2654 anObj.SetParameters(Parameters)
2655 self._autoPublish(anObj, theName, "disk")
2658 ## Create a disk, passing through three given points
2659 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2660 # @param theName Object name; when specified, this parameter is used
2661 # for result publication in the study. Otherwise, if automatic
2662 # publication is switched on, default value is used for result name.
2664 # @return New GEOM.GEOM_Object, containing the created disk.
2666 # @ref tui_creation_disk "Example"
2667 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2669 Create a disk, passing through three given points
2672 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2673 theName Object name; when specified, this parameter is used
2674 for result publication in the study. Otherwise, if automatic
2675 publication is switched on, default value is used for result name.
2678 New GEOM.GEOM_Object, containing the created disk.
2680 # Example: see GEOM_TestAll.py
2681 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2682 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2683 self._autoPublish(anObj, theName, "disk")
2686 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2687 # @param theR Radius of Face.
2688 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2689 # @param theName Object name; when specified, this parameter is used
2690 # for result publication in the study. Otherwise, if automatic
2691 # publication is switched on, default value is used for result name.
2693 # @return New GEOM.GEOM_Object, containing the created disk.
2695 # @ref tui_creation_face "Example"
2696 def MakeDiskR(self, theR, theOrientation, theName=None):
2698 Create a disk with specified dimensions along OX-OY coordinate axes.
2701 theR Radius of Face.
2702 theOrientation set the orientation belong axis OXY or OYZ or OZX
2703 theName Object name; when specified, this parameter is used
2704 for result publication in the study. Otherwise, if automatic
2705 publication is switched on, default value is used for result name.
2708 New GEOM.GEOM_Object, containing the created disk.
2711 Disk3 = geompy.MakeDiskR(100., 1)
2713 # Example: see GEOM_TestAll.py
2714 theR,Parameters = ParseParameters(theR)
2715 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2716 RaiseIfFailed("MakeDiskR", self.PrimOp)
2717 anObj.SetParameters(Parameters)
2718 self._autoPublish(anObj, theName, "disk")
2721 ## Create a cylinder with given base point, axis, radius and height.
2722 # @param thePnt Central point of cylinder base.
2723 # @param theAxis Cylinder axis.
2724 # @param theR Cylinder radius.
2725 # @param theH Cylinder height.
2726 # @param theName Object name; when specified, this parameter is used
2727 # for result publication in the study. Otherwise, if automatic
2728 # publication is switched on, default value is used for result name.
2730 # @return New GEOM.GEOM_Object, containing the created cylinder.
2732 # @ref tui_creation_cylinder "Example"
2733 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2735 Create a cylinder with given base point, axis, radius and height.
2738 thePnt Central point of cylinder base.
2739 theAxis Cylinder axis.
2740 theR Cylinder radius.
2741 theH Cylinder height.
2742 theName Object name; when specified, this parameter is used
2743 for result publication in the study. Otherwise, if automatic
2744 publication is switched on, default value is used for result name.
2747 New GEOM.GEOM_Object, containing the created cylinder.
2749 # Example: see GEOM_TestAll.py
2750 theR,theH,Parameters = ParseParameters(theR, theH)
2751 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2752 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2753 anObj.SetParameters(Parameters)
2754 self._autoPublish(anObj, theName, "cylinder")
2757 ## Create a cylinder with given radius and height at
2758 # the origin of coordinate system. Axis of the cylinder
2759 # will be collinear to the OZ axis of the coordinate system.
2760 # @param theR Cylinder radius.
2761 # @param theH Cylinder height.
2762 # @param 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.
2766 # @return New GEOM.GEOM_Object, containing the created cylinder.
2768 # @ref tui_creation_cylinder "Example"
2769 def MakeCylinderRH(self, theR, theH, theName=None):
2771 Create a cylinder with given radius and height at
2772 the origin of coordinate system. Axis of the cylinder
2773 will be collinear to the OZ axis of the coordinate system.
2776 theR Cylinder radius.
2777 theH Cylinder height.
2778 theName Object name; when specified, this parameter is used
2779 for result publication in the study. Otherwise, if automatic
2780 publication is switched on, default value is used for result name.
2783 New GEOM.GEOM_Object, containing the created cylinder.
2785 # Example: see GEOM_TestAll.py
2786 theR,theH,Parameters = ParseParameters(theR, theH)
2787 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2788 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2789 anObj.SetParameters(Parameters)
2790 self._autoPublish(anObj, theName, "cylinder")
2793 ## Create a sphere with given center and radius.
2794 # @param thePnt Sphere center.
2795 # @param theR Sphere radius.
2796 # @param theName Object name; when specified, this parameter is used
2797 # for result publication in the study. Otherwise, if automatic
2798 # publication is switched on, default value is used for result name.
2800 # @return New GEOM.GEOM_Object, containing the created sphere.
2802 # @ref tui_creation_sphere "Example"
2803 def MakeSpherePntR(self, thePnt, theR, theName=None):
2805 Create a sphere with given center and radius.
2808 thePnt Sphere center.
2810 theName Object name; when specified, this parameter is used
2811 for result publication in the study. Otherwise, if automatic
2812 publication is switched on, default value is used for result name.
2815 New GEOM.GEOM_Object, containing the created sphere.
2817 # Example: see GEOM_TestAll.py
2818 theR,Parameters = ParseParameters(theR)
2819 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2820 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2821 anObj.SetParameters(Parameters)
2822 self._autoPublish(anObj, theName, "sphere")
2825 ## Create a sphere with given center and radius.
2826 # @param x,y,z Coordinates of sphere center.
2827 # @param theR Sphere radius.
2828 # @param theName Object name; when specified, this parameter is used
2829 # for result publication in the study. Otherwise, if automatic
2830 # publication is switched on, default value is used for result name.
2832 # @return New GEOM.GEOM_Object, containing the created sphere.
2834 # @ref tui_creation_sphere "Example"
2835 def MakeSphere(self, x, y, z, theR, theName=None):
2837 Create a sphere with given center and radius.
2840 x,y,z Coordinates of sphere center.
2842 theName Object name; when specified, this parameter is used
2843 for result publication in the study. Otherwise, if automatic
2844 publication is switched on, default value is used for result name.
2847 New GEOM.GEOM_Object, containing the created sphere.
2849 # Example: see GEOM_TestAll.py
2850 point = self.MakeVertex(x, y, z)
2851 # note: auto-publishing is done in self.MakeSpherePntR()
2852 anObj = self.MakeSpherePntR(point, theR, theName)
2855 ## Create a sphere with given radius at the origin of coordinate system.
2856 # @param theR Sphere radius.
2857 # @param theName Object name; when specified, this parameter is used
2858 # for result publication in the study. Otherwise, if automatic
2859 # publication is switched on, default value is used for result name.
2861 # @return New GEOM.GEOM_Object, containing the created sphere.
2863 # @ref tui_creation_sphere "Example"
2864 def MakeSphereR(self, theR, theName=None):
2866 Create a sphere with given radius at the origin of coordinate system.
2870 theName Object name; when specified, this parameter is used
2871 for result publication in the study. Otherwise, if automatic
2872 publication is switched on, default value is used for result name.
2875 New GEOM.GEOM_Object, containing the created sphere.
2877 # Example: see GEOM_TestAll.py
2878 theR,Parameters = ParseParameters(theR)
2879 anObj = self.PrimOp.MakeSphereR(theR)
2880 RaiseIfFailed("MakeSphereR", self.PrimOp)
2881 anObj.SetParameters(Parameters)
2882 self._autoPublish(anObj, theName, "sphere")
2885 ## Create a cone with given base point, axis, height and radiuses.
2886 # @param thePnt Central point of the first cone base.
2887 # @param theAxis Cone axis.
2888 # @param theR1 Radius of the first cone base.
2889 # @param theR2 Radius of the second cone base.
2890 # \note If both radiuses are non-zero, the cone will be truncated.
2891 # \note If the radiuses are equal, a cylinder will be created instead.
2892 # @param theH Cone height.
2893 # @param theName Object name; when specified, this parameter is used
2894 # for result publication in the study. Otherwise, if automatic
2895 # publication is switched on, default value is used for result name.
2897 # @return New GEOM.GEOM_Object, containing the created cone.
2899 # @ref tui_creation_cone "Example"
2900 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2902 Create a cone with given base point, axis, height and radiuses.
2905 thePnt Central point of the first cone base.
2907 theR1 Radius of the first cone base.
2908 theR2 Radius of the second cone base.
2910 theName Object name; when specified, this parameter is used
2911 for result publication in the study. Otherwise, if automatic
2912 publication is switched on, default value is used for result name.
2915 If both radiuses are non-zero, the cone will be truncated.
2916 If the radiuses are equal, a cylinder will be created instead.
2919 New GEOM.GEOM_Object, containing the created cone.
2921 # Example: see GEOM_TestAll.py
2922 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2923 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2924 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2925 anObj.SetParameters(Parameters)
2926 self._autoPublish(anObj, theName, "cone")
2929 ## Create a cone with given height and radiuses at
2930 # the origin of coordinate system. Axis of the cone will
2931 # be collinear to the OZ axis of the coordinate system.
2932 # @param theR1 Radius of the first cone base.
2933 # @param theR2 Radius of the second cone base.
2934 # \note If both radiuses are non-zero, the cone will be truncated.
2935 # \note If the radiuses are equal, a cylinder will be created instead.
2936 # @param theH Cone height.
2937 # @param theName Object name; when specified, this parameter is used
2938 # for result publication in the study. Otherwise, if automatic
2939 # publication is switched on, default value is used for result name.
2941 # @return New GEOM.GEOM_Object, containing the created cone.
2943 # @ref tui_creation_cone "Example"
2944 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
2946 Create a cone with given height and radiuses at
2947 the origin of coordinate system. Axis of the cone will
2948 be collinear to the OZ axis of the coordinate system.
2951 theR1 Radius of the first cone base.
2952 theR2 Radius of the second cone base.
2954 theName Object name; when specified, this parameter is used
2955 for result publication in the study. Otherwise, if automatic
2956 publication is switched on, default value is used for result name.
2959 If both radiuses are non-zero, the cone will be truncated.
2960 If the radiuses are equal, a cylinder will be created instead.
2963 New GEOM.GEOM_Object, containing the created cone.
2965 # Example: see GEOM_TestAll.py
2966 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2967 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2968 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2969 anObj.SetParameters(Parameters)
2970 self._autoPublish(anObj, theName, "cone")
2973 ## Create a torus with given center, normal vector and radiuses.
2974 # @param thePnt Torus central point.
2975 # @param theVec Torus axis of symmetry.
2976 # @param theRMajor Torus major radius.
2977 # @param theRMinor Torus minor radius.
2978 # @param 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.
2982 # @return New GEOM.GEOM_Object, containing the created torus.
2984 # @ref tui_creation_torus "Example"
2985 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
2987 Create a torus with given center, normal vector and radiuses.
2990 thePnt Torus central point.
2991 theVec Torus axis of symmetry.
2992 theRMajor Torus major radius.
2993 theRMinor Torus minor radius.
2994 theName Object name; when specified, this parameter is used
2995 for result publication in the study. Otherwise, if automatic
2996 publication is switched on, default value is used for result name.
2999 New GEOM.GEOM_Object, containing the created torus.
3001 # Example: see GEOM_TestAll.py
3002 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3003 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3004 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3005 anObj.SetParameters(Parameters)
3006 self._autoPublish(anObj, theName, "torus")
3009 ## Create a torus with given radiuses at the origin of coordinate system.
3010 # @param theRMajor Torus major radius.
3011 # @param theRMinor Torus minor radius.
3012 # @param theName Object name; when specified, this parameter is used
3013 # for result publication in the study. Otherwise, if automatic
3014 # publication is switched on, default value is used for result name.
3016 # @return New GEOM.GEOM_Object, containing the created torus.
3018 # @ref tui_creation_torus "Example"
3019 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3021 Create a torus with given radiuses at the origin of coordinate system.
3024 theRMajor Torus major radius.
3025 theRMinor Torus minor radius.
3026 theName Object name; when specified, this parameter is used
3027 for result publication in the study. Otherwise, if automatic
3028 publication is switched on, default value is used for result name.
3031 New GEOM.GEOM_Object, containing the created torus.
3033 # Example: see GEOM_TestAll.py
3034 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3035 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3036 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3037 anObj.SetParameters(Parameters)
3038 self._autoPublish(anObj, theName, "torus")
3041 # end of l3_3d_primitives
3044 ## @addtogroup l3_complex
3047 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3048 # @param theBase Base shape to be extruded.
3049 # @param thePoint1 First end of extrusion vector.
3050 # @param thePoint2 Second end of extrusion vector.
3051 # @param theScaleFactor Use it to make prism with scaled second base.
3052 # Nagative value means not scaled second base.
3053 # @param theName Object name; when specified, this parameter is used
3054 # for result publication in the study. Otherwise, if automatic
3055 # publication is switched on, default value is used for result name.
3057 # @return New GEOM.GEOM_Object, containing the created prism.
3059 # @ref tui_creation_prism "Example"
3060 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3062 Create a shape by extrusion of the base shape along a vector, defined by two points.
3065 theBase Base shape to be extruded.
3066 thePoint1 First end of extrusion vector.
3067 thePoint2 Second end of extrusion vector.
3068 theScaleFactor Use it to make prism with scaled second base.
3069 Nagative value means not scaled second base.
3070 theName Object name; when specified, this parameter is used
3071 for result publication in the study. Otherwise, if automatic
3072 publication is switched on, default value is used for result name.
3075 New GEOM.GEOM_Object, containing the created prism.
3077 # Example: see GEOM_TestAll.py
3080 if theScaleFactor > 0:
3081 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3082 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3084 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3085 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3086 anObj.SetParameters(Parameters)
3087 self._autoPublish(anObj, theName, "prism")
3090 ## Create a shape by extrusion of the base shape along a
3091 # vector, defined by two points, in 2 Ways (forward/backward).
3092 # @param theBase Base shape to be extruded.
3093 # @param thePoint1 First end of extrusion vector.
3094 # @param thePoint2 Second end of extrusion vector.
3095 # @param theName Object name; when specified, this parameter is used
3096 # for result publication in the study. Otherwise, if automatic
3097 # publication is switched on, default value is used for result name.
3099 # @return New GEOM.GEOM_Object, containing the created prism.
3101 # @ref tui_creation_prism "Example"
3102 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3104 Create a shape by extrusion of the base shape along a
3105 vector, defined by two points, in 2 Ways (forward/backward).
3108 theBase Base shape to be extruded.
3109 thePoint1 First end of extrusion vector.
3110 thePoint2 Second end of extrusion vector.
3111 theName Object name; when specified, this parameter is used
3112 for result publication in the study. Otherwise, if automatic
3113 publication is switched on, default value is used for result name.
3116 New GEOM.GEOM_Object, containing the created prism.
3118 # Example: see GEOM_TestAll.py
3119 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3120 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
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.
3127 # @param theBase Base shape to be extruded.
3128 # @param theVec Direction of extrusion.
3129 # @param theH Prism dimension along theVec.
3130 # @param theScaleFactor Use it to make prism with scaled second base.
3131 # Negative value means not scaled second base.
3132 # @param theName Object name; when specified, this parameter is used
3133 # for result publication in the study. Otherwise, if automatic
3134 # publication is switched on, default value is used for result name.
3136 # @return New GEOM.GEOM_Object, containing the created prism.
3138 # @ref tui_creation_prism "Example"
3139 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3141 Create a shape by extrusion of the base shape along the vector,
3142 i.e. all the space, transfixed by the base shape during its translation
3143 along the vector on the given distance.
3146 theBase Base shape to be extruded.
3147 theVec Direction of extrusion.
3148 theH Prism dimension along theVec.
3149 theScaleFactor Use it to make prism with scaled second base.
3150 Negative value means not scaled second base.
3151 theName Object name; when specified, this parameter is used
3152 for result publication in the study. Otherwise, if automatic
3153 publication is switched on, default value is used for result name.
3156 New GEOM.GEOM_Object, containing the created prism.
3158 # Example: see GEOM_TestAll.py
3161 if theScaleFactor > 0:
3162 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3163 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3165 theH,Parameters = ParseParameters(theH)
3166 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3167 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3168 anObj.SetParameters(Parameters)
3169 self._autoPublish(anObj, theName, "prism")
3172 ## Create a shape by extrusion of the base shape along the vector,
3173 # i.e. all the space, transfixed by the base shape during its translation
3174 # along the vector on the given distance in 2 Ways (forward/backward).
3175 # @param theBase Base shape to be extruded.
3176 # @param theVec Direction of extrusion.
3177 # @param theH Prism dimension along theVec in forward direction.
3178 # @param theName Object name; when specified, this parameter is used
3179 # for result publication in the study. Otherwise, if automatic
3180 # publication is switched on, default value is used for result name.
3182 # @return New GEOM.GEOM_Object, containing the created prism.
3184 # @ref tui_creation_prism "Example"
3185 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3187 Create a shape by extrusion of the base shape along the vector,
3188 i.e. all the space, transfixed by the base shape during its translation
3189 along the vector on the given distance in 2 Ways (forward/backward).
3192 theBase Base shape to be extruded.
3193 theVec Direction of extrusion.
3194 theH Prism dimension along theVec in forward direction.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created prism.
3202 # Example: see GEOM_TestAll.py
3203 theH,Parameters = ParseParameters(theH)
3204 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3205 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3206 anObj.SetParameters(Parameters)
3207 self._autoPublish(anObj, theName, "prism")
3210 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3211 # @param theBase Base shape to be extruded.
3212 # @param theDX, theDY, theDZ Directions of extrusion.
3213 # @param theScaleFactor Use it to make prism with scaled second base.
3214 # Nagative value means not scaled second base.
3215 # @param theName Object name; when specified, this parameter is used
3216 # for result publication in the study. Otherwise, if automatic
3217 # publication is switched on, default value is used for result name.
3219 # @return New GEOM.GEOM_Object, containing the created prism.
3221 # @ref tui_creation_prism "Example"
3222 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3224 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3227 theBase Base shape to be extruded.
3228 theDX, theDY, theDZ Directions of extrusion.
3229 theScaleFactor Use it to make prism with scaled second base.
3230 Nagative value means not scaled second base.
3231 theName Object name; when specified, this parameter is used
3232 for result publication in the study. Otherwise, if automatic
3233 publication is switched on, default value is used for result name.
3236 New GEOM.GEOM_Object, containing the created prism.
3238 # Example: see GEOM_TestAll.py
3241 if theScaleFactor > 0:
3242 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3243 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3245 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3246 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3247 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3248 anObj.SetParameters(Parameters)
3249 self._autoPublish(anObj, theName, "prism")
3252 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3253 # i.e. all the space, transfixed by the base shape during its translation
3254 # along the vector on the given distance in 2 Ways (forward/backward).
3255 # @param theBase Base shape to be extruded.
3256 # @param theDX, theDY, theDZ Directions of extrusion.
3257 # @param theName Object name; when specified, this parameter is used
3258 # for result publication in the study. Otherwise, if automatic
3259 # publication is switched on, default value is used for result name.
3261 # @return New GEOM.GEOM_Object, containing the created prism.
3263 # @ref tui_creation_prism "Example"
3264 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3266 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3267 i.e. all the space, transfixed by the base shape during its translation
3268 along the vector on the given distance in 2 Ways (forward/backward).
3271 theBase Base shape to be extruded.
3272 theDX, theDY, theDZ Directions of extrusion.
3273 theName Object name; when specified, this parameter is used
3274 for result publication in the study. Otherwise, if automatic
3275 publication is switched on, default value is used for result name.
3278 New GEOM.GEOM_Object, containing the created prism.
3280 # Example: see GEOM_TestAll.py
3281 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3282 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3283 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3284 anObj.SetParameters(Parameters)
3285 self._autoPublish(anObj, theName, "prism")
3288 ## Create a shape by revolution of the base shape around the axis
3289 # on the given angle, i.e. all the space, transfixed by the base
3290 # shape during its rotation around the axis on the given angle.
3291 # @param theBase Base shape to be rotated.
3292 # @param theAxis Rotation axis.
3293 # @param theAngle Rotation angle in radians.
3294 # @param theName Object name; when specified, this parameter is used
3295 # for result publication in the study. Otherwise, if automatic
3296 # publication is switched on, default value is used for result name.
3298 # @return New GEOM.GEOM_Object, containing the created revolution.
3300 # @ref tui_creation_revolution "Example"
3301 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3303 Create a shape by revolution of the base shape around the axis
3304 on the given angle, i.e. all the space, transfixed by the base
3305 shape during its rotation around the axis on the given angle.
3308 theBase Base shape to be rotated.
3309 theAxis Rotation axis.
3310 theAngle Rotation angle in radians.
3311 theName Object name; when specified, this parameter is used
3312 for result publication in the study. Otherwise, if automatic
3313 publication is switched on, default value is used for result name.
3316 New GEOM.GEOM_Object, containing the created revolution.
3318 # Example: see GEOM_TestAll.py
3319 theAngle,Parameters = ParseParameters(theAngle)
3320 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3321 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3322 anObj.SetParameters(Parameters)
3323 self._autoPublish(anObj, theName, "revolution")
3326 ## Create a shape by revolution of the base shape around the axis
3327 # on the given angle, i.e. all the space, transfixed by the base
3328 # shape during its rotation around the axis on the given angle in
3329 # both directions (forward/backward)
3330 # @param theBase Base shape to be rotated.
3331 # @param theAxis Rotation axis.
3332 # @param theAngle Rotation angle in radians.
3333 # @param theName Object name; when specified, this parameter is used
3334 # for result publication in the study. Otherwise, if automatic
3335 # publication is switched on, default value is used for result name.
3337 # @return New GEOM.GEOM_Object, containing the created revolution.
3339 # @ref tui_creation_revolution "Example"
3340 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3342 Create a shape by revolution of the base shape around the axis
3343 on the given angle, i.e. all the space, transfixed by the base
3344 shape during its rotation around the axis on the given angle in
3345 both directions (forward/backward).
3348 theBase Base shape to be rotated.
3349 theAxis Rotation axis.
3350 theAngle Rotation angle in radians.
3351 theName Object name; when specified, this parameter is used
3352 for result publication in the study. Otherwise, if automatic
3353 publication is switched on, default value is used for result name.
3356 New GEOM.GEOM_Object, containing the created revolution.
3358 theAngle,Parameters = ParseParameters(theAngle)
3359 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3360 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3361 anObj.SetParameters(Parameters)
3362 self._autoPublish(anObj, theName, "revolution")
3365 ## Create a filling from the given compound of contours.
3366 # @param theShape the compound of contours
3367 # @param theMinDeg a minimal degree of BSpline surface to create
3368 # @param theMaxDeg a maximal degree of BSpline surface to create
3369 # @param theTol2D a 2d tolerance to be reached
3370 # @param theTol3D a 3d tolerance to be reached
3371 # @param theNbIter a number of iteration of approximation algorithm
3372 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3373 # @param isApprox if True, BSpline curves are generated in the process
3374 # of surface construction. By default it is False, that means
3375 # the surface is created using given curves. The usage of
3376 # Approximation makes the algorithm work slower, but allows
3377 # building the surface for rather complex cases.
3378 # @param theName Object name; when specified, this parameter is used
3379 # for result publication in the study. Otherwise, if automatic
3380 # publication is switched on, default value is used for result name.
3382 # @return New GEOM.GEOM_Object, containing the created filling surface.
3384 # @ref tui_creation_filling "Example"
3385 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3386 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3388 Create a filling from the given compound of contours.
3391 theShape the compound of contours
3392 theMinDeg a minimal degree of BSpline surface to create
3393 theMaxDeg a maximal degree of BSpline surface to create
3394 theTol2D a 2d tolerance to be reached
3395 theTol3D a 3d tolerance to be reached
3396 theNbIter a number of iteration of approximation algorithm
3397 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3398 isApprox if True, BSpline curves are generated in the process
3399 of surface construction. By default it is False, that means
3400 the surface is created using given curves. The usage of
3401 Approximation makes the algorithm work slower, but allows
3402 building the surface for rather complex cases
3403 theName Object name; when specified, this parameter is used
3404 for result publication in the study. Otherwise, if automatic
3405 publication is switched on, default value is used for result name.
3408 New GEOM.GEOM_Object, containing the created filling surface.
3411 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3413 # Example: see GEOM_TestAll.py
3414 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3415 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3416 theTol2D, theTol3D, theNbIter,
3417 theMethod, isApprox)
3418 RaiseIfFailed("MakeFilling", self.PrimOp)
3419 anObj.SetParameters(Parameters)
3420 self._autoPublish(anObj, theName, "filling")
3424 ## Create a filling from the given compound of contours.
3425 # This method corresponds to MakeFilling with isApprox=True
3426 # @param theShape the compound of contours
3427 # @param theMinDeg a minimal degree of BSpline surface to create
3428 # @param theMaxDeg a maximal degree of BSpline surface to create
3429 # @param theTol3D a 3d tolerance to be reached
3430 # @param theName Object name; when specified, this parameter is used
3431 # for result publication in the study. Otherwise, if automatic
3432 # publication is switched on, default value is used for result name.
3434 # @return New GEOM.GEOM_Object, containing the created filling surface.
3436 # @ref tui_creation_filling "Example"
3437 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3439 Create a filling from the given compound of contours.
3440 This method corresponds to MakeFilling with isApprox=True
3443 theShape the compound of contours
3444 theMinDeg a minimal degree of BSpline surface to create
3445 theMaxDeg a maximal degree of BSpline surface to create
3446 theTol3D a 3d tolerance to be reached
3447 theName Object name; when specified, this parameter is used
3448 for result publication in the study. Otherwise, if automatic
3449 publication is switched on, default value is used for result name.
3452 New GEOM.GEOM_Object, containing the created filling surface.
3455 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3457 # Example: see GEOM_TestAll.py
3458 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3459 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3460 0, theTol3D, 0, GEOM.FOM_Default, True)
3461 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3462 anObj.SetParameters(Parameters)
3463 self._autoPublish(anObj, theName, "filling")
3466 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3467 # @param theSeqSections - set of specified sections.
3468 # @param theModeSolid - mode defining building solid or shell
3469 # @param thePreci - precision 3D used for smoothing
3470 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3471 # @param 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.
3475 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3477 # @ref swig_todo "Example"
3478 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3480 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3483 theSeqSections - set of specified sections.
3484 theModeSolid - mode defining building solid or shell
3485 thePreci - precision 3D used for smoothing
3486 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3487 theName Object name; when specified, this parameter is used
3488 for result publication in the study. Otherwise, if automatic
3489 publication is switched on, default value is used for result name.
3492 New GEOM.GEOM_Object, containing the created shell or solid.
3494 # Example: see GEOM_TestAll.py
3495 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3496 RaiseIfFailed("MakeThruSections", self.PrimOp)
3497 self._autoPublish(anObj, theName, "filling")
3500 ## Create a shape by extrusion of the base shape along
3501 # the path shape. The path shape can be a wire or an edge.
3502 # @param theBase Base shape to be extruded.
3503 # @param thePath Path shape to extrude the base shape along it.
3504 # @param theName Object name; when specified, this parameter is used
3505 # for result publication in the study. Otherwise, if automatic
3506 # publication is switched on, default value is used for result name.
3508 # @return New GEOM.GEOM_Object, containing the created pipe.
3510 # @ref tui_creation_pipe "Example"
3511 def MakePipe(self, theBase, thePath, theName=None):
3513 Create a shape by extrusion of the base shape along
3514 the path shape. The path shape can be a wire or an edge.
3517 theBase Base shape to be extruded.
3518 thePath Path shape to extrude the base shape along it.
3519 theName Object name; when specified, this parameter is used
3520 for result publication in the study. Otherwise, if automatic
3521 publication is switched on, default value is used for result name.
3524 New GEOM.GEOM_Object, containing the created pipe.
3526 # Example: see GEOM_TestAll.py
3527 anObj = self.PrimOp.MakePipe(theBase, thePath)
3528 RaiseIfFailed("MakePipe", self.PrimOp)
3529 self._autoPublish(anObj, theName, "pipe")
3532 ## Create a shape by extrusion of the profile shape along
3533 # the path shape. The path shape can be a wire or an edge.
3534 # the several profiles can be specified in the several locations of path.
3535 # @param theSeqBases - list of Bases shape to be extruded.
3536 # @param theLocations - list of locations on the path corresponding
3537 # specified list of the Bases shapes. Number of locations
3538 # should be equal to number of bases or list of locations can be empty.
3539 # @param thePath - Path shape to extrude the base shape along it.
3540 # @param theWithContact - the mode defining that the section is translated to be in
3541 # contact with the spine.
3542 # @param theWithCorrection - defining that the section is rotated to be
3543 # orthogonal to the spine tangent in the correspondent point
3544 # @param theName Object name; when specified, this parameter is used
3545 # for result publication in the study. Otherwise, if automatic
3546 # publication is switched on, default value is used for result name.
3548 # @return New GEOM.GEOM_Object, containing the created pipe.
3550 # @ref tui_creation_pipe_with_diff_sec "Example"
3551 def MakePipeWithDifferentSections(self, theSeqBases,
3552 theLocations, thePath,
3553 theWithContact, theWithCorrection, theName=None):
3555 Create a shape by extrusion of the profile shape along
3556 the path shape. The path shape can be a wire or an edge.
3557 the several profiles can be specified in the several locations of path.
3560 theSeqBases - list of Bases shape to be extruded.
3561 theLocations - list of locations on the path corresponding
3562 specified list of the Bases shapes. Number of locations
3563 should be equal to number of bases or list of locations can be empty.
3564 thePath - Path shape to extrude the base shape along it.
3565 theWithContact - the mode defining that the section is translated to be in
3566 contact with the spine(0/1)
3567 theWithCorrection - defining that the section is rotated to be
3568 orthogonal to the spine tangent in the correspondent point (0/1)
3569 theName Object name; when specified, this parameter is used
3570 for result publication in the study. Otherwise, if automatic
3571 publication is switched on, default value is used for result name.
3574 New GEOM.GEOM_Object, containing the created pipe.
3576 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3577 theLocations, thePath,
3578 theWithContact, theWithCorrection)
3579 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3580 self._autoPublish(anObj, theName, "pipe")
3583 ## Create a shape by extrusion of the profile shape along
3584 # the path shape. The path shape can be a wire or a edge.
3585 # the several profiles can be specified in the several locations of path.
3586 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3587 # shell or face. If number of faces in neighbour sections
3588 # aren't coincided result solid between such sections will
3589 # be created using external boundaries of this shells.
3590 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3591 # This list is used for searching correspondences between
3592 # faces in the sections. Size of this list must be equal
3593 # to size of list of base shapes.
3594 # @param theLocations - list of locations on the path corresponding
3595 # specified list of the Bases shapes. Number of locations
3596 # should be equal to number of bases. First and last
3597 # locations must be coincided with first and last vertexes
3598 # of path correspondingly.
3599 # @param thePath - Path shape to extrude the base shape along it.
3600 # @param theWithContact - the mode defining that the section is translated to be in
3601 # contact with the spine.
3602 # @param theWithCorrection - defining that the section is rotated to be
3603 # orthogonal to the spine tangent in the correspondent point
3604 # @param theName Object name; when specified, this parameter is used
3605 # for result publication in the study. Otherwise, if automatic
3606 # publication is switched on, default value is used for result name.
3608 # @return New GEOM.GEOM_Object, containing the created solids.
3610 # @ref tui_creation_pipe_with_shell_sec "Example"
3611 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3612 theLocations, thePath,
3613 theWithContact, theWithCorrection, theName=None):
3615 Create a shape by extrusion of the profile shape along
3616 the path shape. The path shape can be a wire or a edge.
3617 the several profiles can be specified in the several locations of path.
3620 theSeqBases - list of Bases shape to be extruded. Base shape must be
3621 shell or face. If number of faces in neighbour sections
3622 aren't coincided result solid between such sections will
3623 be created using external boundaries of this shells.
3624 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3625 This list is used for searching correspondences between
3626 faces in the sections. Size of this list must be equal
3627 to size of list of base shapes.
3628 theLocations - list of locations on the path corresponding
3629 specified list of the Bases shapes. Number of locations
3630 should be equal to number of bases. First and last
3631 locations must be coincided with first and last vertexes
3632 of path correspondingly.
3633 thePath - Path shape to extrude the base shape along it.
3634 theWithContact - the mode defining that the section is translated to be in
3635 contact with the spine (0/1)
3636 theWithCorrection - defining that the section is rotated to be
3637 orthogonal to the spine tangent in the correspondent point (0/1)
3638 theName Object name; when specified, this parameter is used
3639 for result publication in the study. Otherwise, if automatic
3640 publication is switched on, default value is used for result name.
3643 New GEOM.GEOM_Object, containing the created solids.
3645 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3646 theLocations, thePath,
3647 theWithContact, theWithCorrection)
3648 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3649 self._autoPublish(anObj, theName, "pipe")
3652 ## Create a shape by extrusion of the profile shape along
3653 # the path shape. This function is used only for debug pipe
3654 # functionality - it is a version of function MakePipeWithShellSections()
3655 # which give a possibility to recieve information about
3656 # creating pipe between each pair of sections step by step.
3657 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3658 theLocations, thePath,
3659 theWithContact, theWithCorrection, theName=None):
3661 Create a shape by extrusion of the profile shape along
3662 the path shape. This function is used only for debug pipe
3663 functionality - it is a version of previous function
3664 geompy.MakePipeWithShellSections() which give a possibility to
3665 recieve information about creating pipe between each pair of
3666 sections step by step.
3669 nbsect = len(theSeqBases)
3670 nbsubsect = len(theSeqSubBases)
3671 #print "nbsect = ",nbsect
3672 for i in range(1,nbsect):
3674 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3675 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3677 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3678 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3679 tmpLocations, thePath,
3680 theWithContact, theWithCorrection)
3681 if self.PrimOp.IsDone() == 0:
3682 print "Problems with pipe creation between ",i," and ",i+1," sections"
3683 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3686 print "Pipe between ",i," and ",i+1," sections is OK"
3691 resc = self.MakeCompound(res)
3692 #resc = self.MakeSewing(res, 0.001)
3693 #print "resc: ",resc
3694 self._autoPublish(resc, theName, "pipe")
3697 ## Create solids between given sections
3698 # @param theSeqBases - list of sections (shell or face).
3699 # @param theLocations - list of corresponding vertexes
3700 # @param theName Object name; when specified, this parameter is used
3701 # for result publication in the study. Otherwise, if automatic
3702 # publication is switched on, default value is used for result name.
3704 # @return New GEOM.GEOM_Object, containing the created solids.
3706 # @ref tui_creation_pipe_without_path "Example"
3707 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3709 Create solids between given sections
3712 theSeqBases - list of sections (shell or face).
3713 theLocations - list of corresponding vertexes
3714 theName Object name; when specified, this parameter is used
3715 for result publication in the study. Otherwise, if automatic
3716 publication is switched on, default value is used for result name.
3719 New GEOM.GEOM_Object, containing the created solids.
3721 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3722 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3723 self._autoPublish(anObj, theName, "pipe")
3726 ## Create a shape by extrusion of the base shape along
3727 # the path shape with constant bi-normal direction along the given vector.
3728 # The path shape can be a wire or an edge.
3729 # @param theBase Base shape to be extruded.
3730 # @param thePath Path shape to extrude the base shape along it.
3731 # @param theVec Vector defines a constant binormal direction to keep the
3732 # same angle beetween the direction and the sections
3733 # along the sweep surface.
3734 # @param 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.
3738 # @return New GEOM.GEOM_Object, containing the created pipe.
3740 # @ref tui_creation_pipe "Example"
3741 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3743 Create a shape by extrusion of the base shape along
3744 the path shape with constant bi-normal direction along the given vector.
3745 The path shape can be a wire or an edge.
3748 theBase Base shape to be extruded.
3749 thePath Path shape to extrude the base shape along it.
3750 theVec Vector defines a constant binormal direction to keep the
3751 same angle beetween the direction and the sections
3752 along the sweep surface.
3753 theName Object name; when specified, this parameter is used
3754 for result publication in the study. Otherwise, if automatic
3755 publication is switched on, default value is used for result name.
3758 New GEOM.GEOM_Object, containing the created pipe.
3760 # Example: see GEOM_TestAll.py
3761 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3762 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3763 self._autoPublish(anObj, theName, "pipe")
3766 ## Makes a thick solid from a face or a shell
3767 # @param theShape Face or Shell to be thicken
3768 # @param theThickness Thickness of the resulting solid
3769 # @param theName Object name; when specified, this parameter is used
3770 # for result publication in the study. Otherwise, if automatic
3771 # publication is switched on, default value is used for result name.
3773 # @return New GEOM.GEOM_Object, containing the created solid
3775 def MakeThickSolid(self, theShape, theThickness, theName=None):
3777 Make a thick solid from a face or a shell
3780 theShape Face or Shell to be thicken
3781 theThickness Thickness of the resulting solid
3782 theName Object name; when specified, this parameter is used
3783 for result publication in the study. Otherwise, if automatic
3784 publication is switched on, default value is used for result name.
3787 New GEOM.GEOM_Object, containing the created solid
3789 # Example: see GEOM_TestAll.py
3790 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3791 RaiseIfFailed("MakeThickening", self.PrimOp)
3792 self._autoPublish(anObj, theName, "pipe")
3796 ## Modifies a face or a shell to make it a thick solid
3797 # @param theShape Face or Shell to be thicken
3798 # @param theThickness Thickness of the resulting solid
3800 # @return The modified shape
3802 def Thicken(self, theShape, theThickness):
3804 Modifies a face or a shell to make it a thick solid
3807 theBase Base shape to be extruded.
3808 thePath Path shape to extrude the base shape along it.
3809 theName Object name; when specified, this parameter is used
3810 for result publication in the study. Otherwise, if automatic
3811 publication is switched on, default value is used for result name.
3816 # Example: see GEOM_TestAll.py
3817 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3818 RaiseIfFailed("MakeThickening", self.PrimOp)
3821 ## Build a middle path of a pipe-like shape.
3822 # The path shape can be a wire or an edge.
3823 # @param theShape It can be closed or unclosed pipe-like shell
3824 # or a pipe-like solid.
3825 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3826 # should be wires or faces of theShape.
3827 # @param theName Object name; when specified, this parameter is used
3828 # for result publication in the study. Otherwise, if automatic
3829 # publication is switched on, default value is used for result name.
3831 # @note It is not assumed that exact or approximate copy of theShape
3832 # can be obtained by applying existing Pipe operation on the
3833 # resulting "Path" wire taking theBase1 as the base - it is not
3834 # always possible; though in some particular cases it might work
3835 # it is not guaranteed. Thus, RestorePath function should not be
3836 # considered as an exact reverse operation of the Pipe.
3838 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3839 # source pipe's "path".
3841 # @ref tui_creation_pipe_path "Example"
3842 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3844 Build a middle path of a pipe-like shape.
3845 The path shape can be a wire or an edge.
3848 theShape It can be closed or unclosed pipe-like shell
3849 or a pipe-like solid.
3850 theBase1, theBase2 Two bases of the supposed pipe. This
3851 should be wires or faces of theShape.
3852 theName Object name; when specified, this parameter is used
3853 for result publication in the study. Otherwise, if automatic
3854 publication is switched on, default value is used for result name.
3857 New GEOM_Object, containing an edge or wire that represent
3860 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3861 RaiseIfFailed("RestorePath", self.PrimOp)
3862 self._autoPublish(anObj, theName, "path")
3865 ## Build a middle path of a pipe-like shape.
3866 # The path shape can be a wire or an edge.
3867 # @param theShape It can be closed or unclosed pipe-like shell
3868 # or a pipe-like solid.
3869 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3870 # should be lists of edges of theShape.
3871 # @param theName Object name; when specified, this parameter is used
3872 # for result publication in the study. Otherwise, if automatic
3873 # publication is switched on, default value is used for result name.
3875 # @note It is not assumed that exact or approximate copy of theShape
3876 # can be obtained by applying existing Pipe operation on the
3877 # resulting "Path" wire taking theBase1 as the base - it is not
3878 # always possible; though in some particular cases it might work
3879 # it is not guaranteed. Thus, RestorePath function should not be
3880 # considered as an exact reverse operation of the Pipe.
3882 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3883 # source pipe's "path".
3885 # @ref tui_creation_pipe_path "Example"
3886 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3888 Build a middle path of a pipe-like shape.
3889 The path shape can be a wire or an edge.
3892 theShape It can be closed or unclosed pipe-like shell
3893 or a pipe-like solid.
3894 listEdges1, listEdges2 Two bases of the supposed pipe. This
3895 should be lists of edges of theShape.
3896 theName Object name; when specified, this parameter is used
3897 for result publication in the study. Otherwise, if automatic
3898 publication is switched on, default value is used for result name.
3901 New GEOM_Object, containing an edge or wire that represent
3904 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3905 RaiseIfFailed("RestorePath", self.PrimOp)
3906 self._autoPublish(anObj, theName, "path")
3912 ## @addtogroup l3_advanced
3915 ## Create a linear edge with specified ends.
3916 # @param thePnt1 Point for the first end of edge.
3917 # @param thePnt2 Point for the second end of edge.
3918 # @param theName Object name; when specified, this parameter is used
3919 # for result publication in the study. Otherwise, if automatic
3920 # publication is switched on, default value is used for result name.
3922 # @return New GEOM.GEOM_Object, containing the created edge.
3924 # @ref tui_creation_edge "Example"
3925 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3927 Create a linear edge with specified ends.
3930 thePnt1 Point for the first end of edge.
3931 thePnt2 Point for the second end of edge.
3932 theName Object name; when specified, this parameter is used
3933 for result publication in the study. Otherwise, if automatic
3934 publication is switched on, default value is used for result name.
3937 New GEOM.GEOM_Object, containing the created edge.
3939 # Example: see GEOM_TestAll.py
3940 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3941 RaiseIfFailed("MakeEdge", self.ShapesOp)
3942 self._autoPublish(anObj, theName, "edge")
3945 ## Create a new edge, corresponding to the given length on the given curve.
3946 # @param theRefCurve The referenced curve (edge).
3947 # @param theLength Length on the referenced curve. It can be negative.
3948 # @param theStartPoint Any point can be selected for it, the new edge will begin
3949 # at the end of \a theRefCurve, close to the selected point.
3950 # If None, start from the first point of \a theRefCurve.
3951 # @param theName Object name; when specified, this parameter is used
3952 # for result publication in the study. Otherwise, if automatic
3953 # publication is switched on, default value is used for result name.
3955 # @return New GEOM.GEOM_Object, containing the created edge.
3957 # @ref tui_creation_edge "Example"
3958 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
3960 Create a new edge, corresponding to the given length on the given curve.
3963 theRefCurve The referenced curve (edge).
3964 theLength Length on the referenced curve. It can be negative.
3965 theStartPoint Any point can be selected for it, the new edge will begin
3966 at the end of theRefCurve, close to the selected point.
3967 If None, start from the first point of theRefCurve.
3968 theName Object name; when specified, this parameter is used
3969 for result publication in the study. Otherwise, if automatic
3970 publication is switched on, default value is used for result name.
3973 New GEOM.GEOM_Object, containing the created edge.
3975 # Example: see GEOM_TestAll.py
3976 theLength, Parameters = ParseParameters(theLength)
3977 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
3978 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
3979 anObj.SetParameters(Parameters)
3980 self._autoPublish(anObj, theName, "edge")
3983 ## Create an edge from specified wire.
3984 # @param theWire source Wire
3985 # @param theLinearTolerance linear tolerance value (default = 1e-07)
3986 # @param theAngularTolerance angular tolerance value (default = 1e-12)
3987 # @param theName Object name; when specified, this parameter is used
3988 # for result publication in the study. Otherwise, if automatic
3989 # publication is switched on, default value is used for result name.
3991 # @return New GEOM.GEOM_Object, containing the created edge.
3993 # @ref tui_creation_edge "Example"
3994 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
3996 Create an edge from specified wire.
4000 theLinearTolerance linear tolerance value (default = 1e-07)
4001 theAngularTolerance angular tolerance value (default = 1e-12)
4002 theName Object name; when specified, this parameter is used
4003 for result publication in the study. Otherwise, if automatic
4004 publication is switched on, default value is used for result name.
4007 New GEOM.GEOM_Object, containing the created edge.
4009 # Example: see GEOM_TestAll.py
4010 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4011 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4012 self._autoPublish(anObj, theName, "edge")
4015 ## Create a wire from the set of edges and wires.
4016 # @param theEdgesAndWires List of edges and/or wires.
4017 # @param theTolerance Maximum distance between vertices, that will be merged.
4018 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4019 # @param theName Object name; when specified, this parameter is used
4020 # for result publication in the study. Otherwise, if automatic
4021 # publication is switched on, default value is used for result name.
4023 # @return New GEOM.GEOM_Object, containing the created wire.
4025 # @ref tui_creation_wire "Example"
4026 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4028 Create a wire from the set of edges and wires.
4031 theEdgesAndWires List of edges and/or wires.
4032 theTolerance Maximum distance between vertices, that will be merged.
4033 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4034 theName Object name; when specified, this parameter is used
4035 for result publication in the study. Otherwise, if automatic
4036 publication is switched on, default value is used for result name.
4039 New GEOM.GEOM_Object, containing the created wire.
4041 # Example: see GEOM_TestAll.py
4042 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4043 RaiseIfFailed("MakeWire", self.ShapesOp)
4044 self._autoPublish(anObj, theName, "wire")
4047 ## Create a face on the given wire.
4048 # @param theWire closed Wire or Edge to build the face on.
4049 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4050 # If the tolerance of the obtained planar face is less
4051 # than 1e-06, this face will be returned, otherwise the
4052 # algorithm tries to build any suitable face on the given
4053 # wire and prints a warning message.
4054 # @param theName Object name; when specified, this parameter is used
4055 # for result publication in the study. Otherwise, if automatic
4056 # publication is switched on, default value is used for result name.
4058 # @return New GEOM.GEOM_Object, containing the created face.
4060 # @ref tui_creation_face "Example"
4061 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4063 Create a face on the given wire.
4066 theWire closed Wire or Edge to build the face on.
4067 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4068 If the tolerance of the obtained planar face is less
4069 than 1e-06, this face will be returned, otherwise the
4070 algorithm tries to build any suitable face on the given
4071 wire and prints a warning message.
4072 theName Object name; when specified, this parameter is used
4073 for result publication in the study. Otherwise, if automatic
4074 publication is switched on, default value is used for result name.
4077 New GEOM.GEOM_Object, containing the created face.
4079 # Example: see GEOM_TestAll.py
4080 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4081 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4082 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4084 RaiseIfFailed("MakeFace", self.ShapesOp)
4085 self._autoPublish(anObj, theName, "face")
4088 ## Create a face on the given wires set.
4089 # @param theWires List of closed wires or edges to build the face on.
4090 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4091 # If the tolerance of the obtained planar face is less
4092 # than 1e-06, this face will be returned, otherwise the
4093 # algorithm tries to build any suitable face on the given
4094 # wire and prints a warning message.
4095 # @param theName Object name; when specified, this parameter is used
4096 # for result publication in the study. Otherwise, if automatic
4097 # publication is switched on, default value is used for result name.
4099 # @return New GEOM.GEOM_Object, containing the created face.
4101 # @ref tui_creation_face "Example"
4102 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4104 Create a face on the given wires set.
4107 theWires List of closed wires or edges to build the face on.
4108 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4109 If the tolerance of the obtained planar face is less
4110 than 1e-06, this face will be returned, otherwise the
4111 algorithm tries to build any suitable face on the given
4112 wire and prints a warning message.
4113 theName Object name; when specified, this parameter is used
4114 for result publication in the study. Otherwise, if automatic
4115 publication is switched on, default value is used for result name.
4118 New GEOM.GEOM_Object, containing the created face.
4120 # Example: see GEOM_TestAll.py
4121 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4122 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4123 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4125 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4126 self._autoPublish(anObj, theName, "face")
4129 ## See MakeFaceWires() method for details.
4131 # @ref tui_creation_face "Example 1"
4132 # \n @ref swig_MakeFaces "Example 2"
4133 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4135 See geompy.MakeFaceWires() method for details.
4137 # Example: see GEOM_TestOthers.py
4138 # note: auto-publishing is done in self.MakeFaceWires()
4139 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4142 ## Create a shell from the set of faces and shells.
4143 # @param theFacesAndShells List of faces and/or shells.
4144 # @param theName Object name; when specified, this parameter is used
4145 # for result publication in the study. Otherwise, if automatic
4146 # publication is switched on, default value is used for result name.
4148 # @return New GEOM.GEOM_Object, containing the created shell.
4150 # @ref tui_creation_shell "Example"
4151 def MakeShell(self, theFacesAndShells, theName=None):
4153 Create a shell from the set of faces and shells.
4156 theFacesAndShells List of faces and/or shells.
4157 theName Object name; when specified, this parameter is used
4158 for result publication in the study. Otherwise, if automatic
4159 publication is switched on, default value is used for result name.
4162 New GEOM.GEOM_Object, containing the created shell.
4164 # Example: see GEOM_TestAll.py
4165 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4166 RaiseIfFailed("MakeShell", self.ShapesOp)
4167 self._autoPublish(anObj, theName, "shell")
4170 ## Create a solid, bounded by the given shells.
4171 # @param theShells Sequence of bounding shells.
4172 # @param theName Object name; when specified, this parameter is used
4173 # for result publication in the study. Otherwise, if automatic
4174 # publication is switched on, default value is used for result name.
4176 # @return New GEOM.GEOM_Object, containing the created solid.
4178 # @ref tui_creation_solid "Example"
4179 def MakeSolid(self, theShells, theName=None):
4181 Create a solid, bounded by the given shells.
4184 theShells Sequence of bounding shells.
4185 theName Object name; when specified, this parameter is used
4186 for result publication in the study. Otherwise, if automatic
4187 publication is switched on, default value is used for result name.
4190 New GEOM.GEOM_Object, containing the created solid.
4192 # Example: see GEOM_TestAll.py
4193 if len(theShells) == 1:
4194 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4196 # raise RuntimeError, "MakeSolidShells : " + descr
4197 if descr == "WRN_SHAPE_UNCLOSED":
4198 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4199 anObj = self.ShapesOp.MakeSolidShells(theShells)
4200 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4201 self._autoPublish(anObj, theName, "solid")
4204 ## Create a compound of the given shapes.
4205 # @param theShapes List of shapes to put in compound.
4206 # @param theName Object name; when specified, this parameter is used
4207 # for result publication in the study. Otherwise, if automatic
4208 # publication is switched on, default value is used for result name.
4210 # @return New GEOM.GEOM_Object, containing the created compound.
4212 # @ref tui_creation_compound "Example"
4213 def MakeCompound(self, theShapes, theName=None):
4215 Create a compound of the given shapes.
4218 theShapes List of shapes to put in compound.
4219 theName Object name; when specified, this parameter is used
4220 for result publication in the study. Otherwise, if automatic
4221 publication is switched on, default value is used for result name.
4224 New GEOM.GEOM_Object, containing the created compound.
4226 # Example: see GEOM_TestAll.py
4227 anObj = self.ShapesOp.MakeCompound(theShapes)
4228 RaiseIfFailed("MakeCompound", self.ShapesOp)
4229 self._autoPublish(anObj, theName, "compound")
4232 # end of l3_advanced
4235 ## @addtogroup l2_measure
4238 ## Gives quantity of faces in the given shape.
4239 # @param theShape Shape to count faces of.
4240 # @return Quantity of faces.
4242 # @ref swig_NumberOf "Example"
4243 def NumberOfFaces(self, theShape):
4245 Gives quantity of faces in the given shape.
4248 theShape Shape to count faces of.
4253 # Example: see GEOM_TestOthers.py
4254 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4255 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4258 ## Gives quantity of edges in the given shape.
4259 # @param theShape Shape to count edges of.
4260 # @return Quantity of edges.
4262 # @ref swig_NumberOf "Example"
4263 def NumberOfEdges(self, theShape):
4265 Gives quantity of edges in the given shape.
4268 theShape Shape to count edges of.
4273 # Example: see GEOM_TestOthers.py
4274 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4275 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4278 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4279 # @param theShape Shape to count sub-shapes of.
4280 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4281 # @return Quantity of sub-shapes of given type.
4283 # @ref swig_NumberOf "Example"
4284 def NumberOfSubShapes(self, theShape, theShapeType):
4286 Gives quantity of sub-shapes of type theShapeType in the given shape.
4289 theShape Shape to count sub-shapes of.
4290 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4293 Quantity of sub-shapes of given type.
4295 # Example: see GEOM_TestOthers.py
4296 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4297 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4300 ## Gives quantity of solids in the given shape.
4301 # @param theShape Shape to count solids in.
4302 # @return Quantity of solids.
4304 # @ref swig_NumberOf "Example"
4305 def NumberOfSolids(self, theShape):
4307 Gives quantity of solids in the given shape.
4310 theShape Shape to count solids in.
4315 # Example: see GEOM_TestOthers.py
4316 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4317 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4323 ## @addtogroup l3_healing
4326 ## Reverses an orientation the given shape.
4327 # @param theShape Shape to be reversed.
4328 # @param theName Object name; when specified, this parameter is used
4329 # for result publication in the study. Otherwise, if automatic
4330 # publication is switched on, default value is used for result name.
4332 # @return The reversed copy of theShape.
4334 # @ref swig_ChangeOrientation "Example"
4335 def ChangeOrientation(self, theShape, theName=None):
4337 Reverses an orientation the given shape.
4340 theShape Shape to be reversed.
4341 theName Object name; when specified, this parameter is used
4342 for result publication in the study. Otherwise, if automatic
4343 publication is switched on, default value is used for result name.
4346 The reversed copy of theShape.
4348 # Example: see GEOM_TestAll.py
4349 anObj = self.ShapesOp.ChangeOrientation(theShape)
4350 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4351 self._autoPublish(anObj, theName, "reversed")
4354 ## See ChangeOrientation() method for details.
4356 # @ref swig_OrientationChange "Example"
4357 def OrientationChange(self, theShape, theName=None):
4359 See geompy.ChangeOrientation method for details.
4361 # Example: see GEOM_TestOthers.py
4362 # note: auto-publishing is done in self.ChangeOrientation()
4363 anObj = self.ChangeOrientation(theShape, theName)
4369 ## @addtogroup l4_obtain
4372 ## Retrieve all free faces from the given shape.
4373 # Free face is a face, which is not shared between two shells of the shape.
4374 # @param theShape Shape to find free faces in.
4375 # @return List of IDs of all free faces, contained in theShape.
4377 # @ref tui_measurement_tools_page "Example"
4378 def GetFreeFacesIDs(self,theShape):
4380 Retrieve all free faces from the given shape.
4381 Free face is a face, which is not shared between two shells of the shape.
4384 theShape Shape to find free faces in.
4387 List of IDs of all free faces, contained in theShape.
4389 # Example: see GEOM_TestOthers.py
4390 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4391 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4394 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4395 # @param theShape1 Shape to find sub-shapes in.
4396 # @param theShape2 Shape to find shared sub-shapes with.
4397 # @param theShapeType Type of sub-shapes to be retrieved.
4398 # @param theName Object name; when specified, this parameter is used
4399 # for result publication in the study. Otherwise, if automatic
4400 # publication is switched on, default value is used for result name.
4402 # @return List of sub-shapes of theShape1, shared with theShape2.
4404 # @ref swig_GetSharedShapes "Example"
4405 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4407 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4410 theShape1 Shape to find sub-shapes in.
4411 theShape2 Shape to find shared sub-shapes with.
4412 theShapeType Type of sub-shapes to be retrieved.
4413 theName Object name; when specified, this parameter is used
4414 for result publication in the study. Otherwise, if automatic
4415 publication is switched on, default value is used for result name.
4418 List of sub-shapes of theShape1, shared with theShape2.
4420 # Example: see GEOM_TestOthers.py
4421 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4422 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4423 self._autoPublish(aList, theName, "shared")
4426 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4427 # @param theShapes Shapes to find common sub-shapes of.
4428 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4429 # @param theName Object name; when specified, this parameter is used
4430 # for result publication in the study. Otherwise, if automatic
4431 # publication is switched on, default value is used for result name.
4433 # @return List of objects, that are sub-shapes of all given shapes.
4435 # @ref swig_GetSharedShapes "Example"
4436 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4438 Get all sub-shapes, shared by all shapes in the list theShapes.
4441 theShapes Shapes to find common sub-shapes of.
4442 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4443 theName Object name; when specified, this parameter is used
4444 for result publication in the study. Otherwise, if automatic
4445 publication is switched on, default value is used for result name.
4448 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4450 # Example: see GEOM_TestOthers.py
4451 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4452 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4453 self._autoPublish(aList, theName, "shared")
4456 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4457 # situated relatively the specified plane by the certain way,
4458 # defined through <VAR>theState</VAR> parameter.
4459 # @param theShape Shape to find sub-shapes of.
4460 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4461 # @param theAx1 Vector (or line, or linear edge), specifying normal
4462 # direction and location of the plane to find shapes on.
4463 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4464 # @param theName Object name; when specified, this parameter is used
4465 # for result publication in the study. Otherwise, if automatic
4466 # publication is switched on, default value is used for result name.
4468 # @return List of all found sub-shapes.
4470 # @ref swig_GetShapesOnPlane "Example"
4471 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4473 Find in theShape all sub-shapes of type theShapeType,
4474 situated relatively the specified plane by the certain way,
4475 defined through theState parameter.
4478 theShape Shape to find sub-shapes of.
4479 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4480 theAx1 Vector (or line, or linear edge), specifying normal
4481 direction and location of the plane to find shapes on.
4482 theState The state of the sub-shapes to find (see GEOM::shape_state)
4483 theName Object name; when specified, this parameter is used
4484 for result publication in the study. Otherwise, if automatic
4485 publication is switched on, default value is used for result name.
4488 List of all found sub-shapes.
4490 # Example: see GEOM_TestOthers.py
4491 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4492 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4493 self._autoPublish(aList, theName, "shapeOnPlane")
4496 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4497 # situated relatively the specified plane by the certain way,
4498 # defined through <VAR>theState</VAR> parameter.
4499 # @param theShape Shape to find sub-shapes of.
4500 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4501 # @param theAx1 Vector (or line, or linear edge), specifying normal
4502 # direction and location of the plane to find shapes on.
4503 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4505 # @return List of all found sub-shapes indices.
4507 # @ref swig_GetShapesOnPlaneIDs "Example"
4508 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4510 Find in theShape all sub-shapes of type theShapeType,
4511 situated relatively the specified plane by the certain way,
4512 defined through theState parameter.
4515 theShape Shape to find sub-shapes of.
4516 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4517 theAx1 Vector (or line, or linear edge), specifying normal
4518 direction and location of the plane to find shapes on.
4519 theState The state of the sub-shapes to find (see GEOM::shape_state)
4522 List of all found sub-shapes indices.
4524 # Example: see GEOM_TestOthers.py
4525 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4526 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4529 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4530 # situated relatively the specified plane by the certain way,
4531 # defined through <VAR>theState</VAR> parameter.
4532 # @param theShape Shape to find sub-shapes of.
4533 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4534 # @param theAx1 Vector (or line, or linear edge), specifying normal
4535 # direction of the plane to find shapes on.
4536 # @param thePnt Point specifying location of the plane to find shapes on.
4537 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4538 # @param theName Object name; when specified, this parameter is used
4539 # for result publication in the study. Otherwise, if automatic
4540 # publication is switched on, default value is used for result name.
4542 # @return List of all found sub-shapes.
4544 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4545 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4547 Find in theShape all sub-shapes of type theShapeType,
4548 situated relatively the specified plane by the certain way,
4549 defined through theState parameter.
4552 theShape Shape to find sub-shapes of.
4553 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4554 theAx1 Vector (or line, or linear edge), specifying normal
4555 direction and location of the plane to find shapes on.
4556 thePnt Point specifying location of the plane to find shapes on.
4557 theState The state of the sub-shapes to find (see GEOM::shape_state)
4558 theName Object name; when specified, this parameter is used
4559 for result publication in the study. Otherwise, if automatic
4560 publication is switched on, default value is used for result name.
4563 List of all found sub-shapes.
4565 # Example: see GEOM_TestOthers.py
4566 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4567 theAx1, thePnt, theState)
4568 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4569 self._autoPublish(aList, theName, "shapeOnPlane")
4572 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4573 # situated relatively the specified plane by the certain way,
4574 # defined through <VAR>theState</VAR> parameter.
4575 # @param theShape Shape to find sub-shapes of.
4576 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4577 # @param theAx1 Vector (or line, or linear edge), specifying normal
4578 # direction of the plane to find shapes on.
4579 # @param thePnt Point specifying location of the plane to find shapes on.
4580 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4582 # @return List of all found sub-shapes indices.
4584 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4585 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4587 Find in theShape all sub-shapes of type theShapeType,
4588 situated relatively the specified plane by the certain way,
4589 defined through theState parameter.
4592 theShape Shape to find sub-shapes of.
4593 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4594 theAx1 Vector (or line, or linear edge), specifying normal
4595 direction and location of the plane to find shapes on.
4596 thePnt Point specifying location of the plane to find shapes on.
4597 theState The state of the sub-shapes to find (see GEOM::shape_state)
4600 List of all found sub-shapes indices.
4602 # Example: see GEOM_TestOthers.py
4603 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4604 theAx1, thePnt, theState)
4605 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4608 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4609 # the specified cylinder by the certain way, defined through \a theState parameter.
4610 # @param theShape Shape to find sub-shapes of.
4611 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4612 # @param theAxis Vector (or line, or linear edge), specifying
4613 # axis of the cylinder to find shapes on.
4614 # @param theRadius Radius of the cylinder to find shapes on.
4615 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4616 # @param theName Object name; when specified, this parameter is used
4617 # for result publication in the study. Otherwise, if automatic
4618 # publication is switched on, default value is used for result name.
4620 # @return List of all found sub-shapes.
4622 # @ref swig_GetShapesOnCylinder "Example"
4623 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4625 Find in theShape all sub-shapes of type theShapeType, situated relatively
4626 the specified cylinder by the certain way, defined through theState parameter.
4629 theShape Shape to find sub-shapes of.
4630 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4631 theAxis Vector (or line, or linear edge), specifying
4632 axis of the cylinder to find shapes on.
4633 theRadius Radius of the cylinder to find shapes on.
4634 theState The state of the sub-shapes to find (see GEOM::shape_state)
4635 theName Object name; when specified, this parameter is used
4636 for result publication in the study. Otherwise, if automatic
4637 publication is switched on, default value is used for result name.
4640 List of all found sub-shapes.
4642 # Example: see GEOM_TestOthers.py
4643 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4644 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4645 self._autoPublish(aList, theName, "shapeOnCylinder")
4648 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4649 # the specified cylinder by the certain way, defined through \a theState parameter.
4650 # @param theShape Shape to find sub-shapes of.
4651 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4652 # @param theAxis Vector (or line, or linear edge), specifying
4653 # axis of the cylinder to find shapes on.
4654 # @param theRadius Radius of the cylinder to find shapes on.
4655 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4657 # @return List of all found sub-shapes indices.
4659 # @ref swig_GetShapesOnCylinderIDs "Example"
4660 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4662 Find in theShape all sub-shapes of type theShapeType, situated relatively
4663 the specified cylinder by the certain way, defined through theState parameter.
4666 theShape Shape to find sub-shapes of.
4667 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4668 theAxis Vector (or line, or linear edge), specifying
4669 axis of the cylinder to find shapes on.
4670 theRadius Radius of the cylinder to find shapes on.
4671 theState The state of the sub-shapes to find (see GEOM::shape_state)
4674 List of all found sub-shapes indices.
4676 # Example: see GEOM_TestOthers.py
4677 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4678 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4681 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4682 # the specified cylinder by the certain way, defined through \a theState parameter.
4683 # @param theShape Shape to find sub-shapes of.
4684 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4685 # @param theAxis Vector (or line, or linear edge), specifying
4686 # axis of the cylinder to find shapes on.
4687 # @param thePnt Point specifying location of the bottom of the cylinder.
4688 # @param theRadius Radius of the cylinder to find shapes on.
4689 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4690 # @param theName Object name; when specified, this parameter is used
4691 # for result publication in the study. Otherwise, if automatic
4692 # publication is switched on, default value is used for result name.
4694 # @return List of all found sub-shapes.
4696 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4697 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4699 Find in theShape all sub-shapes of type theShapeType, situated relatively
4700 the specified cylinder by the certain way, defined through theState parameter.
4703 theShape Shape to find sub-shapes of.
4704 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4705 theAxis Vector (or line, or linear edge), specifying
4706 axis of the cylinder to find shapes on.
4707 theRadius Radius of the cylinder to find shapes on.
4708 theState The state of the sub-shapes to find (see GEOM::shape_state)
4709 theName Object name; when specified, this parameter is used
4710 for result publication in the study. Otherwise, if automatic
4711 publication is switched on, default value is used for result name.
4714 List of all found sub-shapes.
4716 # Example: see GEOM_TestOthers.py
4717 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4718 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4719 self._autoPublish(aList, theName, "shapeOnCylinder")
4722 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4723 # the specified cylinder by the certain way, defined through \a theState parameter.
4724 # @param theShape Shape to find sub-shapes of.
4725 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4726 # @param theAxis Vector (or line, or linear edge), specifying
4727 # axis of the cylinder to find shapes on.
4728 # @param thePnt Point specifying location of the bottom of the cylinder.
4729 # @param theRadius Radius of the cylinder to find shapes on.
4730 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4732 # @return List of all found sub-shapes indices
4734 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4735 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4737 Find in theShape all sub-shapes of type theShapeType, situated relatively
4738 the specified cylinder by the certain way, defined through theState parameter.
4741 theShape Shape to find sub-shapes of.
4742 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4743 theAxis Vector (or line, or linear edge), specifying
4744 axis of the cylinder to find shapes on.
4745 theRadius Radius of the cylinder to find shapes on.
4746 theState The state of the sub-shapes to find (see GEOM::shape_state)
4749 List of all found sub-shapes indices.
4751 # Example: see GEOM_TestOthers.py
4752 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4753 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4756 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4757 # the specified sphere by the certain way, defined through \a theState parameter.
4758 # @param theShape Shape to find sub-shapes of.
4759 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4760 # @param theCenter Point, specifying center of the sphere to find shapes on.
4761 # @param theRadius Radius of the sphere to find shapes on.
4762 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4763 # @param theName Object name; when specified, this parameter is used
4764 # for result publication in the study. Otherwise, if automatic
4765 # publication is switched on, default value is used for result name.
4767 # @return List of all found sub-shapes.
4769 # @ref swig_GetShapesOnSphere "Example"
4770 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4772 Find in theShape all sub-shapes of type theShapeType, situated relatively
4773 the specified sphere by the certain way, defined through theState parameter.
4776 theShape Shape to find sub-shapes of.
4777 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4778 theCenter Point, specifying center of the sphere to find shapes on.
4779 theRadius Radius of the sphere to find shapes on.
4780 theState The state of the sub-shapes to find (see GEOM::shape_state)
4781 theName Object name; when specified, this parameter is used
4782 for result publication in the study. Otherwise, if automatic
4783 publication is switched on, default value is used for result name.
4786 List of all found sub-shapes.
4788 # Example: see GEOM_TestOthers.py
4789 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4790 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4791 self._autoPublish(aList, theName, "shapeOnSphere")
4794 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4795 # the specified sphere by the certain way, defined through \a theState parameter.
4796 # @param theShape Shape to find sub-shapes of.
4797 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4798 # @param theCenter Point, specifying center of the sphere to find shapes on.
4799 # @param theRadius Radius of the sphere to find shapes on.
4800 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4802 # @return List of all found sub-shapes indices.
4804 # @ref swig_GetShapesOnSphereIDs "Example"
4805 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4807 Find in theShape all sub-shapes of type theShapeType, situated relatively
4808 the specified sphere by the certain way, defined through theState parameter.
4811 theShape Shape to find sub-shapes of.
4812 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4813 theCenter Point, specifying center of the sphere to find shapes on.
4814 theRadius Radius of the sphere to find shapes on.
4815 theState The state of the sub-shapes to find (see GEOM::shape_state)
4818 List of all found sub-shapes indices.
4820 # Example: see GEOM_TestOthers.py
4821 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4822 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4825 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4826 # the specified quadrangle by the certain way, defined through \a theState parameter.
4827 # @param theShape Shape to find sub-shapes of.
4828 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4829 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4830 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4831 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4832 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4833 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4834 # @param theName Object name; when specified, this parameter is used
4835 # for result publication in the study. Otherwise, if automatic
4836 # publication is switched on, default value is used for result name.
4838 # @return List of all found sub-shapes.
4840 # @ref swig_GetShapesOnQuadrangle "Example"
4841 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4842 theTopLeftPoint, theTopRigthPoint,
4843 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4845 Find in theShape all sub-shapes of type theShapeType, situated relatively
4846 the specified quadrangle by the certain way, defined through theState parameter.
4849 theShape Shape to find sub-shapes of.
4850 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4851 theTopLeftPoint Point, specifying top left corner of a quadrangle
4852 theTopRigthPoint Point, specifying top right corner of a quadrangle
4853 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4854 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4855 theState The state of the sub-shapes to find (see GEOM::shape_state)
4856 theName Object name; when specified, this parameter is used
4857 for result publication in the study. Otherwise, if automatic
4858 publication is switched on, default value is used for result name.
4861 List of all found sub-shapes.
4863 # Example: see GEOM_TestOthers.py
4864 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4865 theTopLeftPoint, theTopRigthPoint,
4866 theBottomLeftPoint, theBottomRigthPoint, theState)
4867 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4868 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4871 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4872 # the specified quadrangle by the certain way, defined through \a theState parameter.
4873 # @param theShape Shape to find sub-shapes of.
4874 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4875 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4876 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4877 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4878 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4879 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4881 # @return List of all found sub-shapes indices.
4883 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4884 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4885 theTopLeftPoint, theTopRigthPoint,
4886 theBottomLeftPoint, theBottomRigthPoint, theState):
4888 Find in theShape all sub-shapes of type theShapeType, situated relatively
4889 the specified quadrangle by the certain way, defined through theState parameter.
4892 theShape Shape to find sub-shapes of.
4893 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4894 theTopLeftPoint Point, specifying top left corner of a quadrangle
4895 theTopRigthPoint Point, specifying top right corner of a quadrangle
4896 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4897 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4898 theState The state of the sub-shapes to find (see GEOM::shape_state)
4901 List of all found sub-shapes indices.
4904 # Example: see GEOM_TestOthers.py
4905 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4906 theTopLeftPoint, theTopRigthPoint,
4907 theBottomLeftPoint, theBottomRigthPoint, theState)
4908 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4911 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4912 # the specified \a theBox by the certain way, defined through \a theState parameter.
4913 # @param theBox Shape for relative comparing.
4914 # @param theShape Shape to find sub-shapes of.
4915 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4916 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4917 # @param theName Object name; when specified, this parameter is used
4918 # for result publication in the study. Otherwise, if automatic
4919 # publication is switched on, default value is used for result name.
4921 # @return List of all found sub-shapes.
4923 # @ref swig_GetShapesOnBox "Example"
4924 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4926 Find in theShape all sub-shapes of type theShapeType, situated relatively
4927 the specified theBox by the certain way, defined through theState parameter.
4930 theBox Shape for relative comparing.
4931 theShape Shape to find sub-shapes of.
4932 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4933 theState The state of the sub-shapes to find (see GEOM::shape_state)
4934 theName Object name; when specified, this parameter is used
4935 for result publication in the study. Otherwise, if automatic
4936 publication is switched on, default value is used for result name.
4939 List of all found sub-shapes.
4941 # Example: see GEOM_TestOthers.py
4942 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
4943 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
4944 self._autoPublish(aList, theName, "shapeOnBox")
4947 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4948 # the specified \a theBox by the certain way, defined through \a theState parameter.
4949 # @param theBox Shape for relative comparing.
4950 # @param theShape Shape to find sub-shapes of.
4951 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4952 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4954 # @return List of all found sub-shapes indices.
4956 # @ref swig_GetShapesOnBoxIDs "Example"
4957 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
4959 Find in theShape all sub-shapes of type theShapeType, situated relatively
4960 the specified theBox by the certain way, defined through theState parameter.
4963 theBox Shape for relative comparing.
4964 theShape Shape to find sub-shapes of.
4965 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4966 theState The state of the sub-shapes to find (see GEOM::shape_state)
4969 List of all found sub-shapes indices.
4971 # Example: see GEOM_TestOthers.py
4972 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
4973 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
4976 ## Find in \a theShape all sub-shapes of type \a theShapeType,
4977 # situated relatively the specified \a theCheckShape by the
4978 # certain way, defined through \a theState parameter.
4979 # @param theCheckShape Shape for relative comparing. It must be a solid.
4980 # @param theShape Shape to find sub-shapes of.
4981 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4982 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4983 # @param theName Object name; when specified, this parameter is used
4984 # for result publication in the study. Otherwise, if automatic
4985 # publication is switched on, default value is used for result name.
4987 # @return List of all found sub-shapes.
4989 # @ref swig_GetShapesOnShape "Example"
4990 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
4992 Find in theShape all sub-shapes of type theShapeType,
4993 situated relatively the specified theCheckShape by the
4994 certain way, defined through theState parameter.
4997 theCheckShape Shape for relative comparing. It must be a solid.
4998 theShape Shape to find sub-shapes of.
4999 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5000 theState The state of the sub-shapes to find (see GEOM::shape_state)
5001 theName Object name; when specified, this parameter is used
5002 for result publication in the study. Otherwise, if automatic
5003 publication is switched on, default value is used for result name.
5006 List of all found sub-shapes.
5008 # Example: see GEOM_TestOthers.py
5009 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5010 theShapeType, theState)
5011 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5012 self._autoPublish(aList, theName, "shapeOnShape")
5015 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5016 # situated relatively the specified \a theCheckShape by the
5017 # certain way, defined through \a theState parameter.
5018 # @param theCheckShape Shape for relative comparing. It must be a solid.
5019 # @param theShape Shape to find sub-shapes of.
5020 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5021 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5022 # @param theName Object name; when specified, this parameter is used
5023 # for result publication in the study. Otherwise, if automatic
5024 # publication is switched on, default value is used for result name.
5026 # @return All found sub-shapes as compound.
5028 # @ref swig_GetShapesOnShapeAsCompound "Example"
5029 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5031 Find in theShape all sub-shapes of type theShapeType,
5032 situated relatively the specified theCheckShape by the
5033 certain way, defined through theState parameter.
5036 theCheckShape Shape for relative comparing. It must be a solid.
5037 theShape Shape to find sub-shapes of.
5038 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5039 theState The state of the sub-shapes to find (see GEOM::shape_state)
5040 theName Object name; when specified, this parameter is used
5041 for result publication in the study. Otherwise, if automatic
5042 publication is switched on, default value is used for result name.
5045 All found sub-shapes as compound.
5047 # Example: see GEOM_TestOthers.py
5048 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5049 theShapeType, theState)
5050 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5051 self._autoPublish(anObj, theName, "shapeOnShape")
5054 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5055 # situated relatively the specified \a theCheckShape by the
5056 # certain way, defined through \a theState parameter.
5057 # @param theCheckShape Shape for relative comparing. It must be a solid.
5058 # @param theShape Shape to find sub-shapes of.
5059 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5060 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5062 # @return List of all found sub-shapes indices.
5064 # @ref swig_GetShapesOnShapeIDs "Example"
5065 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5067 Find in theShape all sub-shapes of type theShapeType,
5068 situated relatively the specified theCheckShape by the
5069 certain way, defined through theState parameter.
5072 theCheckShape Shape for relative comparing. It must be a solid.
5073 theShape Shape to find sub-shapes of.
5074 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5075 theState The state of the sub-shapes to find (see GEOM::shape_state)
5078 List of all found sub-shapes indices.
5080 # Example: see GEOM_TestOthers.py
5081 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5082 theShapeType, theState)
5083 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5086 ## Get sub-shape(s) of theShapeWhere, which are
5087 # coincident with \a theShapeWhat or could be a part of it.
5088 # @param theShapeWhere Shape to find sub-shapes of.
5089 # @param theShapeWhat Shape, specifying what to find.
5090 # @param isNewImplementation implementation of GetInPlace functionality
5091 # (default = False, old alghorithm based on shape properties)
5092 # @param theName Object name; when specified, this parameter is used
5093 # for result publication in the study. Otherwise, if automatic
5094 # publication is switched on, default value is used for result name.
5096 # @return Group of all found sub-shapes or a single found sub-shape.
5098 # @note This function has a restriction on argument shapes.
5099 # If \a theShapeWhere has curved parts with significantly
5100 # outstanding centres (i.e. the mass centre of a part is closer to
5101 # \a theShapeWhat than to the part), such parts will not be found.
5102 # @image html get_in_place_lost_part.png
5104 # @ref swig_GetInPlace "Example"
5105 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5107 Get sub-shape(s) of theShapeWhere, which are
5108 coincident with theShapeWhat or could be a part of it.
5111 theShapeWhere Shape to find sub-shapes of.
5112 theShapeWhat Shape, specifying what to find.
5113 isNewImplementation Implementation of GetInPlace functionality
5114 (default = False, old alghorithm based on shape properties)
5115 theName Object name; when specified, this parameter is used
5116 for result publication in the study. Otherwise, if automatic
5117 publication is switched on, default value is used for result name.
5120 Group of all found sub-shapes or a single found sub-shape.
5124 This function has a restriction on argument shapes.
5125 If theShapeWhere has curved parts with significantly
5126 outstanding centres (i.e. the mass centre of a part is closer to
5127 theShapeWhat than to the part), such parts will not be found.
5129 # Example: see GEOM_TestOthers.py
5131 if isNewImplementation:
5132 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5134 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5136 RaiseIfFailed("GetInPlace", self.ShapesOp)
5137 self._autoPublish(anObj, theName, "inplace")
5140 ## Get sub-shape(s) of \a theShapeWhere, which are
5141 # coincident with \a theShapeWhat or could be a part of it.
5143 # Implementation of this method is based on a saved history of an operation,
5144 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5145 # arguments (an argument shape or a sub-shape of an argument shape).
5146 # The operation could be the Partition or one of boolean operations,
5147 # performed on simple shapes (not on compounds).
5149 # @param theShapeWhere Shape to find sub-shapes of.
5150 # @param theShapeWhat Shape, specifying what to find (must be in the
5151 # building history of the ShapeWhere).
5152 # @param theName Object name; when specified, this parameter is used
5153 # for result publication in the study. Otherwise, if automatic
5154 # publication is switched on, default value is used for result name.
5156 # @return Group of all found sub-shapes or a single found sub-shape.
5158 # @ref swig_GetInPlace "Example"
5159 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5161 Implementation of this method is based on a saved history of an operation,
5162 produced theShapeWhere. The theShapeWhat must be among this operation's
5163 arguments (an argument shape or a sub-shape of an argument shape).
5164 The operation could be the Partition or one of boolean operations,
5165 performed on simple shapes (not on compounds).
5168 theShapeWhere Shape to find sub-shapes of.
5169 theShapeWhat Shape, specifying what to find (must be in the
5170 building history of the ShapeWhere).
5171 theName Object name; when specified, this parameter is used
5172 for result publication in the study. Otherwise, if automatic
5173 publication is switched on, default value is used for result name.
5176 Group of all found sub-shapes or a single found sub-shape.
5178 # Example: see GEOM_TestOthers.py
5179 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5180 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5181 self._autoPublish(anObj, theName, "inplace")
5184 ## Get sub-shape of theShapeWhere, which is
5185 # equal to \a theShapeWhat.
5186 # @param theShapeWhere Shape to find sub-shape of.
5187 # @param theShapeWhat Shape, specifying what to find.
5188 # @param theName Object name; when specified, this parameter is used
5189 # for result publication in the study. Otherwise, if automatic
5190 # publication is switched on, default value is used for result name.
5192 # @return New GEOM.GEOM_Object for found sub-shape.
5194 # @ref swig_GetSame "Example"
5195 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5197 Get sub-shape of theShapeWhere, which is
5198 equal to theShapeWhat.
5201 theShapeWhere Shape to find sub-shape of.
5202 theShapeWhat Shape, specifying what to find.
5203 theName Object name; when specified, this parameter is used
5204 for result publication in the study. Otherwise, if automatic
5205 publication is switched on, default value is used for result name.
5208 New GEOM.GEOM_Object for found sub-shape.
5210 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5211 RaiseIfFailed("GetSame", self.ShapesOp)
5212 self._autoPublish(anObj, theName, "sameShape")
5216 ## Get sub-shape indices of theShapeWhere, which is
5217 # equal to \a theShapeWhat.
5218 # @param theShapeWhere Shape to find sub-shape of.
5219 # @param theShapeWhat Shape, specifying what to find.
5220 # @return List of all found sub-shapes indices.
5222 # @ref swig_GetSame "Example"
5223 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5225 Get sub-shape indices of theShapeWhere, which is
5226 equal to theShapeWhat.
5229 theShapeWhere Shape to find sub-shape of.
5230 theShapeWhat Shape, specifying what to find.
5233 List of all found sub-shapes indices.
5235 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5236 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5243 ## @addtogroup l4_access
5246 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5247 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5248 # @param aShape Shape to get sub-shape of.
5249 # @param ListOfID List of sub-shapes indices.
5250 # @param theName Object name; when specified, this parameter is used
5251 # for result publication in the study. Otherwise, if automatic
5252 # publication is switched on, default value is used for result name.
5254 # @return Found sub-shape.
5256 # @ref swig_all_decompose "Example"
5257 def GetSubShape(self, aShape, ListOfID, theName=None):
5259 Obtain a composite sub-shape of aShape, composed from sub-shapes
5260 of aShape, selected by their unique IDs inside aShape
5263 aShape Shape to get sub-shape of.
5264 ListOfID List of sub-shapes indices.
5265 theName Object name; when specified, this parameter is used
5266 for result publication in the study. Otherwise, if automatic
5267 publication is switched on, default value is used for result name.
5272 # Example: see GEOM_TestAll.py
5273 anObj = self.AddSubShape(aShape,ListOfID)
5274 self._autoPublish(anObj, theName, "subshape")
5277 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5278 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5279 # @param aShape Shape to get sub-shape of.
5280 # @param aSubShape Sub-shapes of aShape.
5281 # @return ID of found sub-shape.
5283 # @ref swig_all_decompose "Example"
5284 def GetSubShapeID(self, aShape, aSubShape):
5286 Obtain unique ID of sub-shape aSubShape inside aShape
5287 of aShape, selected by their unique IDs inside aShape
5290 aShape Shape to get sub-shape of.
5291 aSubShape Sub-shapes of aShape.
5294 ID of found sub-shape.
5296 # Example: see GEOM_TestAll.py
5297 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5298 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5301 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5302 # This function is provided for performance purpose. The complexity is O(n) with n
5303 # the number of subobjects of aShape
5304 # @param aShape Shape to get sub-shape of.
5305 # @param aSubShapes Sub-shapes of aShape.
5306 # @return list of IDs of found sub-shapes.
5308 # @ref swig_all_decompose "Example"
5309 def GetSubShapesIDs(self, aShape, aSubShapes):
5311 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5312 This function is provided for performance purpose. The complexity is O(n) with n
5313 the number of subobjects of aShape
5316 aShape Shape to get sub-shape of.
5317 aSubShapes Sub-shapes of aShape.
5320 List of IDs of found sub-shape.
5322 # Example: see GEOM_TestAll.py
5323 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5324 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5330 ## @addtogroup l4_decompose
5333 ## Get all sub-shapes and groups of \a theShape,
5334 # that were created already by any other methods.
5335 # @param theShape Any shape.
5336 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5337 # returned, else all found sub-shapes and groups.
5338 # @return List of existing sub-objects of \a theShape.
5340 # @ref swig_all_decompose "Example"
5341 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5343 Get all sub-shapes and groups of theShape,
5344 that were created already by any other methods.
5348 theGroupsOnly If this parameter is TRUE, only groups will be
5349 returned, else all found sub-shapes and groups.
5352 List of existing sub-objects of theShape.
5354 # Example: see GEOM_TestAll.py
5355 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5356 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5359 ## Get all groups of \a theShape,
5360 # that were created already by any other methods.
5361 # @param theShape Any shape.
5362 # @return List of existing groups of \a theShape.
5364 # @ref swig_all_decompose "Example"
5365 def GetGroups(self, theShape):
5367 Get all groups of theShape,
5368 that were created already by any other methods.
5374 List of existing groups of theShape.
5376 # Example: see GEOM_TestAll.py
5377 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5378 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5381 ## Explode a shape on sub-shapes of a given type.
5382 # If the shape itself matches the type, it is also returned.
5383 # @param aShape Shape to be exploded.
5384 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5385 # @param theName Object name; when specified, this parameter is used
5386 # for result publication in the study. Otherwise, if automatic
5387 # publication is switched on, default value is used for result name.
5389 # @return List of sub-shapes of type theShapeType, contained in theShape.
5391 # @ref swig_all_decompose "Example"
5392 def SubShapeAll(self, aShape, aType, theName=None):
5394 Explode a shape on sub-shapes of a given type.
5395 If the shape itself matches the type, it is also returned.
5398 aShape Shape to be exploded.
5399 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5400 theName Object name; when specified, this parameter is used
5401 for result publication in the study. Otherwise, if automatic
5402 publication is switched on, default value is used for result name.
5405 List of sub-shapes of type theShapeType, contained in theShape.
5407 # Example: see GEOM_TestAll.py
5408 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5409 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5410 self._autoPublish(ListObj, theName, "subshape")
5413 ## Explode a shape on sub-shapes of a given type.
5414 # @param aShape Shape to be exploded.
5415 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5416 # @return List of IDs of sub-shapes.
5418 # @ref swig_all_decompose "Example"
5419 def SubShapeAllIDs(self, aShape, aType):
5421 Explode a shape on sub-shapes of a given type.
5424 aShape Shape to be exploded (see geompy.ShapeType)
5425 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5428 List of IDs of sub-shapes.
5430 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5431 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5434 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5435 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
5436 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5437 # @param aShape Shape to get sub-shape of.
5438 # @param ListOfInd List of sub-shapes indices.
5439 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5440 # @param theName Object name; when specified, this parameter is used
5441 # for result publication in the study. Otherwise, if automatic
5442 # publication is switched on, default value is used for result name.
5444 # @return A compound of sub-shapes of aShape.
5446 # @ref swig_all_decompose "Example"
5447 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5449 Obtain a compound of sub-shapes of aShape,
5450 selected by they indices in list of all sub-shapes of type aType.
5451 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5454 aShape Shape to get sub-shape of.
5455 ListOfID List of sub-shapes indices.
5456 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5457 theName Object name; when specified, this parameter is used
5458 for result publication in the study. Otherwise, if automatic
5459 publication is switched on, default value is used for result name.
5462 A compound of sub-shapes of aShape.
5464 # Example: see GEOM_TestAll.py
5466 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5467 for ind in ListOfInd:
5468 ListOfIDs.append(AllShapeIDsList[ind - 1])
5469 # note: auto-publishing is done in self.GetSubShape()
5470 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5473 ## Explode a shape on sub-shapes of a given type.
5474 # Sub-shapes will be sorted by coordinates of their gravity centers.
5475 # If the shape itself matches the type, it is also returned.
5476 # @param aShape Shape to be exploded.
5477 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5478 # @param theName Object name; when specified, this parameter is used
5479 # for result publication in the study. Otherwise, if automatic
5480 # publication is switched on, default value is used for result name.
5482 # @return List of sub-shapes of type theShapeType, contained in theShape.
5484 # @ref swig_SubShapeAllSorted "Example"
5485 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5487 Explode a shape on sub-shapes of a given type.
5488 Sub-shapes will be sorted by coordinates of their gravity centers.
5489 If the shape itself matches the type, it is also returned.
5492 aShape Shape to be exploded.
5493 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5494 theName Object name; when specified, this parameter is used
5495 for result publication in the study. Otherwise, if automatic
5496 publication is switched on, default value is used for result name.
5499 List of sub-shapes of type theShapeType, contained in theShape.
5501 # Example: see GEOM_TestAll.py
5502 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5503 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5504 self._autoPublish(ListObj, theName, "subshape")
5507 ## Explode a shape on sub-shapes of a given type.
5508 # Sub-shapes will be sorted by coordinates of their gravity centers.
5509 # @param aShape Shape to be exploded.
5510 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5511 # @return List of IDs of sub-shapes.
5513 # @ref swig_all_decompose "Example"
5514 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5516 Explode a shape on sub-shapes of a given type.
5517 Sub-shapes will be sorted by coordinates of their gravity centers.
5520 aShape Shape to be exploded.
5521 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5524 List of IDs of sub-shapes.
5526 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5527 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5530 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5531 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5532 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5533 # @param aShape Shape to get sub-shape of.
5534 # @param ListOfInd List of sub-shapes indices.
5535 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5536 # @param theName Object name; when specified, this parameter is used
5537 # for result publication in the study. Otherwise, if automatic
5538 # publication is switched on, default value is used for result name.
5540 # @return A compound of sub-shapes of aShape.
5542 # @ref swig_all_decompose "Example"
5543 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5545 Obtain a compound of sub-shapes of aShape,
5546 selected by they indices in sorted list of all sub-shapes of type aType.
5547 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5550 aShape Shape to get sub-shape of.
5551 ListOfID List of sub-shapes indices.
5552 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5553 theName Object name; when specified, this parameter is used
5554 for result publication in the study. Otherwise, if automatic
5555 publication is switched on, default value is used for result name.
5558 A compound of sub-shapes of aShape.
5560 # Example: see GEOM_TestAll.py
5562 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5563 for ind in ListOfInd:
5564 ListOfIDs.append(AllShapeIDsList[ind - 1])
5565 # note: auto-publishing is done in self.GetSubShape()
5566 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5569 ## Extract shapes (excluding the main shape) of given type.
5570 # @param aShape The shape.
5571 # @param aType The shape type (see ShapeType())
5572 # @param isSorted Boolean flag to switch sorting on/off.
5573 # @param theName Object name; when specified, this parameter is used
5574 # for result publication in the study. Otherwise, if automatic
5575 # publication is switched on, default value is used for result name.
5577 # @return List of sub-shapes of type aType, contained in aShape.
5579 # @ref swig_FilletChamfer "Example"
5580 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5582 Extract shapes (excluding the main shape) of given type.
5586 aType The shape type (see geompy.ShapeType)
5587 isSorted Boolean flag to switch sorting on/off.
5588 theName Object name; when specified, this parameter is used
5589 for result publication in the study. Otherwise, if automatic
5590 publication is switched on, default value is used for result name.
5593 List of sub-shapes of type aType, contained in aShape.
5595 # Example: see GEOM_TestAll.py
5596 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5597 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5598 self._autoPublish(ListObj, theName, "subshape")
5601 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5602 # @param aShape Main shape.
5603 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5604 # @param theName Object name; when specified, this parameter is used
5605 # for result publication in the study. Otherwise, if automatic
5606 # publication is switched on, default value is used for result name.
5607 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5609 # @ref swig_all_decompose "Example"
5610 def SubShapes(self, aShape, anIDs, theName=None):
5612 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5616 anIDs List of unique IDs of sub-shapes inside theMainShape.
5617 theName Object name; when specified, this parameter is used
5618 for result publication in the study. Otherwise, if automatic
5619 publication is switched on, default value is used for result name.
5622 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5624 # Example: see GEOM_TestAll.py
5625 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5626 RaiseIfFailed("SubShapes", self.ShapesOp)
5627 self._autoPublish(ListObj, theName, "subshape")
5630 # end of l4_decompose
5633 ## @addtogroup l4_decompose_d
5636 ## Deprecated method
5637 # It works like SubShapeAllSortedCentres(), but wrongly
5638 # defines centres of faces, shells and solids.
5639 def SubShapeAllSorted(self, aShape, aType, theName=None):
5642 It works like geompy.SubShapeAllSortedCentres, but wrongly
5643 defines centres of faces, shells and solids.
5645 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5646 RaiseIfFailed("MakeExplode", self.ShapesOp)
5647 self._autoPublish(ListObj, theName, "subshape")
5650 ## Deprecated method
5651 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5652 # defines centres of faces, shells and solids.
5653 def SubShapeAllSortedIDs(self, aShape, aType):
5656 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5657 defines centres of faces, shells and solids.
5659 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5660 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5663 ## Deprecated method
5664 # It works like SubShapeSortedCentres(), but has a bug
5665 # (wrongly defines centres of faces, shells and solids).
5666 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5669 It works like geompy.SubShapeSortedCentres, but has a bug
5670 (wrongly defines centres of faces, shells and solids).
5673 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5674 for ind in ListOfInd:
5675 ListOfIDs.append(AllShapeIDsList[ind - 1])
5676 # note: auto-publishing is done in self.GetSubShape()
5677 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5680 # end of l4_decompose_d
5683 ## @addtogroup l3_healing
5686 ## Apply a sequence of Shape Healing operators to the given object.
5687 # @param theShape Shape to be processed.
5688 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5689 # @param theParameters List of names of parameters
5690 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5691 # @param theValues List of values of parameters, in the same order
5692 # as parameters are listed in <VAR>theParameters</VAR> list.
5693 # @param theName Object name; when specified, this parameter is used
5694 # for result publication in the study. Otherwise, if automatic
5695 # publication is switched on, default value is used for result name.
5697 # <b> Operators and Parameters: </b> \n
5699 # * \b FixShape - corrects invalid shapes. \n
5700 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5701 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5703 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5704 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5705 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5706 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5708 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5709 # surfaces in segments using a certain angle. \n
5710 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5711 # if Angle=180, four if Angle=90, etc). \n
5712 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5714 # * \b SplitClosedFaces - splits closed faces in segments.
5715 # The number of segments depends on the number of splitting points.\n
5716 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5718 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5719 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5720 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5721 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5722 # This and the previous parameters can take the following values:\n
5723 # \b Parametric \b Continuity \n
5724 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5725 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5726 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5727 # ruling out sharp edges).\n
5728 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5729 # are of the same magnitude).\n
5730 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5731 # or surfaces (d/du C(u)) are the same at junction. \n
5732 # \b Geometric \b Continuity \n
5733 # \b G1: first derivatives are proportional at junction.\n
5734 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5735 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5736 # \b G2: first and second derivatives are proportional at junction.
5737 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5738 # continuity requires that the underlying parameterization was continuous as well.
5739 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5741 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5742 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5743 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5744 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5745 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5746 # with the specified parameters.\n
5747 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5748 # with the specified parameters.\n
5749 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5750 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5751 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5752 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5754 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5755 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5756 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5757 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5758 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5760 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5761 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5764 # @return New GEOM.GEOM_Object, containing processed shape.
5766 # \n @ref tui_shape_processing "Example"
5767 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5769 Apply a sequence of Shape Healing operators to the given object.
5772 theShape Shape to be processed.
5773 theValues List of values of parameters, in the same order
5774 as parameters are listed in theParameters list.
5775 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5776 theParameters List of names of parameters
5777 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5778 theName Object name; when specified, this parameter is used
5779 for result publication in the study. Otherwise, if automatic
5780 publication is switched on, default value is used for result name.
5782 Operators and Parameters:
5784 * FixShape - corrects invalid shapes.
5785 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5786 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5787 * FixFaceSize - removes small faces, such as spots and strips.
5788 * FixFaceSize.Tolerance - defines minimum possible face size.
5789 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5790 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5791 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5792 in segments using a certain angle.
5793 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5794 if Angle=180, four if Angle=90, etc).
5795 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5796 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5798 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5799 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5800 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5801 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5802 * SplitContinuity.CurveContinuity - required continuity for curves.
5803 This and the previous parameters can take the following values:
5805 Parametric Continuity:
5806 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5807 coincidental. The curves or surfaces may still meet at an angle,
5808 giving rise to a sharp corner or edge).
5809 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5810 are parallel, ruling out sharp edges).
5811 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5812 or surfaces are of the same magnitude).
5813 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5814 curves or surfaces (d/du C(u)) are the same at junction.
5816 Geometric Continuity:
5817 G1: first derivatives are proportional at junction.
5818 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5819 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5820 G2: first and second derivatives are proportional at junction. As the names imply,
5821 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5822 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5823 geometric continuity of order n, but not vice-versa.
5824 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5825 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5826 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5827 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5828 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5829 the specified parameters.
5830 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5831 the specified parameters.
5832 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5833 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5834 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5835 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5836 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5837 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5838 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5839 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5840 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5841 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5842 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5845 New GEOM.GEOM_Object, containing processed shape.
5847 Note: For more information look through SALOME Geometry User's Guide->
5848 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5850 # Example: see GEOM_TestHealing.py
5851 theValues,Parameters = ParseList(theValues)
5852 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5853 # To avoid script failure in case of good argument shape
5854 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5856 RaiseIfFailed("ProcessShape", self.HealOp)
5857 for string in (theOperators + theParameters):
5858 Parameters = ":" + Parameters
5860 anObj.SetParameters(Parameters)
5861 self._autoPublish(anObj, theName, "healed")
5864 ## Remove faces from the given object (shape).
5865 # @param theObject Shape to be processed.
5866 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5867 # removes ALL faces of the given object.
5868 # @param theName Object name; when specified, this parameter is used
5869 # for result publication in the study. Otherwise, if automatic
5870 # publication is switched on, default value is used for result name.
5872 # @return New GEOM.GEOM_Object, containing processed shape.
5874 # @ref tui_suppress_faces "Example"
5875 def SuppressFaces(self, theObject, theFaces, theName=None):
5877 Remove faces from the given object (shape).
5880 theObject Shape to be processed.
5881 theFaces Indices of faces to be removed, if EMPTY then the method
5882 removes ALL faces of the given object.
5883 theName Object name; when specified, this parameter is used
5884 for result publication in the study. Otherwise, if automatic
5885 publication is switched on, default value is used for result name.
5888 New GEOM.GEOM_Object, containing processed shape.
5890 # Example: see GEOM_TestHealing.py
5891 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5892 RaiseIfFailed("SuppressFaces", self.HealOp)
5893 self._autoPublish(anObj, theName, "suppressFaces")
5896 ## Sewing of some shapes into single shape.
5897 # @param ListShape Shapes to be processed.
5898 # @param theTolerance Required tolerance value.
5899 # @param theName Object name; when specified, this parameter is used
5900 # for result publication in the study. Otherwise, if automatic
5901 # publication is switched on, default value is used for result name.
5903 # @return New GEOM.GEOM_Object, containing processed shape.
5905 # @ref tui_sewing "Example"
5906 def MakeSewing(self, ListShape, theTolerance, theName=None):
5908 Sewing of some shapes into single shape.
5911 ListShape Shapes to be processed.
5912 theTolerance Required tolerance value.
5913 theName Object name; when specified, this parameter is used
5914 for result publication in the study. Otherwise, if automatic
5915 publication is switched on, default value is used for result name.
5918 New GEOM.GEOM_Object, containing processed shape.
5920 # Example: see GEOM_TestHealing.py
5921 comp = self.MakeCompound(ListShape)
5922 # note: auto-publishing is done in self.Sew()
5923 anObj = self.Sew(comp, theTolerance, theName)
5926 ## Sewing of the given object.
5927 # @param theObject Shape to be processed.
5928 # @param theTolerance Required tolerance value.
5929 # @param theName Object name; when specified, this parameter is used
5930 # for result publication in the study. Otherwise, if automatic
5931 # publication is switched on, default value is used for result name.
5933 # @return New GEOM.GEOM_Object, containing processed shape.
5934 def Sew(self, theObject, theTolerance, theName=None):
5936 Sewing of the given object.
5939 theObject Shape to be processed.
5940 theTolerance Required tolerance value.
5941 theName Object name; when specified, this parameter is used
5942 for result publication in the study. Otherwise, if automatic
5943 publication is switched on, default value is used for result name.
5946 New GEOM.GEOM_Object, containing processed shape.
5948 # Example: see MakeSewing() above
5949 theTolerance,Parameters = ParseParameters(theTolerance)
5950 anObj = self.HealOp.Sew(theObject, theTolerance)
5951 RaiseIfFailed("Sew", self.HealOp)
5952 anObj.SetParameters(Parameters)
5953 self._autoPublish(anObj, theName, "sewed")
5956 ## Remove internal wires and edges from the given object (face).
5957 # @param theObject Shape to be processed.
5958 # @param theWires Indices of wires to be removed, if EMPTY then the method
5959 # removes ALL internal wires of the given object.
5960 # @param theName Object name; when specified, this parameter is used
5961 # for result publication in the study. Otherwise, if automatic
5962 # publication is switched on, default value is used for result name.
5964 # @return New GEOM.GEOM_Object, containing processed shape.
5966 # @ref tui_suppress_internal_wires "Example"
5967 def SuppressInternalWires(self, theObject, theWires, theName=None):
5969 Remove internal wires and edges from the given object (face).
5972 theObject Shape to be processed.
5973 theWires Indices of wires to be removed, if EMPTY then the method
5974 removes ALL internal wires of the given object.
5975 theName Object name; when specified, this parameter is used
5976 for result publication in the study. Otherwise, if automatic
5977 publication is switched on, default value is used for result name.
5980 New GEOM.GEOM_Object, containing processed shape.
5982 # Example: see GEOM_TestHealing.py
5983 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
5984 RaiseIfFailed("RemoveIntWires", self.HealOp)
5985 self._autoPublish(anObj, theName, "suppressWires")
5988 ## Remove internal closed contours (holes) from the given object.
5989 # @param theObject Shape to be processed.
5990 # @param theWires Indices of wires to be removed, if EMPTY then the method
5991 # removes ALL internal holes of the given object
5992 # @param theName Object name; when specified, this parameter is used
5993 # for result publication in the study. Otherwise, if automatic
5994 # publication is switched on, default value is used for result name.
5996 # @return New GEOM.GEOM_Object, containing processed shape.
5998 # @ref tui_suppress_holes "Example"
5999 def SuppressHoles(self, theObject, theWires, theName=None):
6001 Remove internal closed contours (holes) from the given object.
6004 theObject Shape to be processed.
6005 theWires Indices of wires to be removed, if EMPTY then the method
6006 removes ALL internal holes of the given object
6007 theName Object name; when specified, this parameter is used
6008 for result publication in the study. Otherwise, if automatic
6009 publication is switched on, default value is used for result name.
6012 New GEOM.GEOM_Object, containing processed shape.
6014 # Example: see GEOM_TestHealing.py
6015 anObj = self.HealOp.FillHoles(theObject, theWires)
6016 RaiseIfFailed("FillHoles", self.HealOp)
6017 self._autoPublish(anObj, theName, "suppressHoles")
6020 ## Close an open wire.
6021 # @param theObject Shape to be processed.
6022 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6023 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6024 # @param isCommonVertex If True : closure by creation of a common vertex,
6025 # If False : closure by creation of an edge between ends.
6026 # @param theName Object name; when specified, this parameter is used
6027 # for result publication in the study. Otherwise, if automatic
6028 # publication is switched on, default value is used for result name.
6030 # @return New GEOM.GEOM_Object, containing processed shape.
6032 # @ref tui_close_contour "Example"
6033 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6038 theObject Shape to be processed.
6039 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6040 if [ ], then theObject itself is a wire.
6041 isCommonVertex If True : closure by creation of a common vertex,
6042 If False : closure by creation of an edge between ends.
6043 theName Object name; when specified, this parameter is used
6044 for result publication in the study. Otherwise, if automatic
6045 publication is switched on, default value is used for result name.
6048 New GEOM.GEOM_Object, containing processed shape.
6050 # Example: see GEOM_TestHealing.py
6051 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6052 RaiseIfFailed("CloseContour", self.HealOp)
6053 self._autoPublish(anObj, theName, "closeContour")
6056 ## Addition of a point to a given edge object.
6057 # @param theObject Shape to be processed.
6058 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6059 # if -1, then theObject itself is the edge.
6060 # @param theValue Value of parameter on edge or length parameter,
6061 # depending on \a isByParameter.
6062 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6063 # if FALSE : \a theValue is treated as a length parameter [0..1]
6064 # @param theName Object name; when specified, this parameter is used
6065 # for result publication in the study. Otherwise, if automatic
6066 # publication is switched on, default value is used for result name.
6068 # @return New GEOM.GEOM_Object, containing processed shape.
6070 # @ref tui_add_point_on_edge "Example"
6071 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6073 Addition of a point to a given edge object.
6076 theObject Shape to be processed.
6077 theEdgeIndex Index of edge to be divided within theObject's shape,
6078 if -1, then theObject itself is the edge.
6079 theValue Value of parameter on edge or length parameter,
6080 depending on isByParameter.
6081 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6082 if FALSE : theValue is treated as a length parameter [0..1]
6083 theName Object name; when specified, this parameter is used
6084 for result publication in the study. Otherwise, if automatic
6085 publication is switched on, default value is used for result name.
6088 New GEOM.GEOM_Object, containing processed shape.
6090 # Example: see GEOM_TestHealing.py
6091 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6092 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6093 RaiseIfFailed("DivideEdge", self.HealOp)
6094 anObj.SetParameters(Parameters)
6095 self._autoPublish(anObj, theName, "divideEdge")
6098 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6099 # @param theWire Wire to minimize the number of C1 continuous edges in.
6100 # @param theVertices A list of vertices to suppress. If the list
6101 # is empty, all vertices in a wire will be assumed.
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 with modified wire.
6108 # @ref tui_fuse_collinear_edges "Example"
6109 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6111 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6114 theWire Wire to minimize the number of C1 continuous edges in.
6115 theVertices A list of vertices to suppress. If the list
6116 is empty, all vertices in a wire will be assumed.
6117 theName Object name; when specified, this parameter is used
6118 for result publication in the study. Otherwise, if automatic
6119 publication is switched on, default value is used for result name.
6122 New GEOM.GEOM_Object with modified wire.
6124 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6125 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6126 self._autoPublish(anObj, theName, "fuseEdges")
6129 ## Change orientation of the given object. Updates given shape.
6130 # @param theObject Shape to be processed.
6131 # @return Updated <var>theObject</var>
6133 # @ref swig_todo "Example"
6134 def ChangeOrientationShell(self,theObject):
6136 Change orientation of the given object. Updates given shape.
6139 theObject Shape to be processed.
6144 theObject = self.HealOp.ChangeOrientation(theObject)
6145 RaiseIfFailed("ChangeOrientation", self.HealOp)
6148 ## Change orientation of the given object.
6149 # @param theObject Shape to be processed.
6150 # @param theName Object name; when specified, this parameter is used
6151 # for result publication in the study. Otherwise, if automatic
6152 # publication is switched on, default value is used for result name.
6154 # @return New GEOM.GEOM_Object, containing processed shape.
6156 # @ref swig_todo "Example"
6157 def ChangeOrientationShellCopy(self, theObject, theName=None):
6159 Change orientation of the given object.
6162 theObject Shape to be processed.
6163 theName Object name; when specified, this parameter is used
6164 for result publication in the study. Otherwise, if automatic
6165 publication is switched on, default value is used for result name.
6168 New GEOM.GEOM_Object, containing processed shape.
6170 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6171 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6172 self._autoPublish(anObj, theName, "reversed")
6175 ## Try to limit tolerance of the given object by value \a theTolerance.
6176 # @param theObject Shape to be processed.
6177 # @param theTolerance Required tolerance value.
6178 # @param theName Object name; when specified, this parameter is used
6179 # for result publication in the study. Otherwise, if automatic
6180 # publication is switched on, default value is used for result name.
6182 # @return New GEOM.GEOM_Object, containing processed shape.
6184 # @ref tui_limit_tolerance "Example"
6185 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6187 Try to limit tolerance of the given object by value theTolerance.
6190 theObject Shape to be processed.
6191 theTolerance Required tolerance value.
6192 theName Object name; when specified, this parameter is used
6193 for result publication in the study. Otherwise, if automatic
6194 publication is switched on, default value is used for result name.
6197 New GEOM.GEOM_Object, containing processed shape.
6199 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6200 RaiseIfFailed("LimitTolerance", self.HealOp)
6201 self._autoPublish(anObj, theName, "limitTolerance")
6204 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6205 # that constitute a free boundary of the given shape.
6206 # @param theObject Shape to get free boundary of.
6207 # @param theName Object name; when specified, this parameter is used
6208 # for result publication in the study. Otherwise, if automatic
6209 # publication is switched on, default value is used for result name.
6211 # @return [\a status, \a theClosedWires, \a theOpenWires]
6212 # \n \a status: FALSE, if an error(s) occured during the method execution.
6213 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6214 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6216 # @ref tui_measurement_tools_page "Example"
6217 def GetFreeBoundary(self, theObject, theName=None):
6219 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6220 that constitute a free boundary of the given shape.
6223 theObject Shape to get free boundary of.
6224 theName Object name; when specified, this parameter is used
6225 for result publication in the study. Otherwise, if automatic
6226 publication is switched on, default value is used for result name.
6229 [status, theClosedWires, theOpenWires]
6230 status: FALSE, if an error(s) occured during the method execution.
6231 theClosedWires: Closed wires on the free boundary of the given shape.
6232 theOpenWires: Open wires on the free boundary of the given shape.
6234 # Example: see GEOM_TestHealing.py
6235 anObj = self.HealOp.GetFreeBoundary(theObject)
6236 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6237 self._autoPublish(anObj[1], theName, "closedWire")
6238 self._autoPublish(anObj[2], theName, "openWire")
6241 ## Replace coincident faces in theShape by one face.
6242 # @param theShape Initial shape.
6243 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6244 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6245 # otherwise all initial shapes.
6246 # @param theName Object name; when specified, this parameter is used
6247 # for result publication in the study. Otherwise, if automatic
6248 # publication is switched on, default value is used for result name.
6250 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6252 # @ref tui_glue_faces "Example"
6253 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6255 Replace coincident faces in theShape by one face.
6258 theShape Initial shape.
6259 theTolerance Maximum distance between faces, which can be considered as coincident.
6260 doKeepNonSolids If FALSE, only solids will present in the result,
6261 otherwise all initial shapes.
6262 theName Object name; when specified, this parameter is used
6263 for result publication in the study. Otherwise, if automatic
6264 publication is switched on, default value is used for result name.
6267 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6269 # Example: see GEOM_Spanner.py
6270 theTolerance,Parameters = ParseParameters(theTolerance)
6271 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6273 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6274 anObj.SetParameters(Parameters)
6275 self._autoPublish(anObj, theName, "glueFaces")
6278 ## Find coincident faces in theShape for possible gluing.
6279 # @param theShape Initial shape.
6280 # @param theTolerance Maximum distance between faces,
6281 # which can be considered as coincident.
6282 # @param theName Object name; when specified, this parameter is used
6283 # for result publication in the study. Otherwise, if automatic
6284 # publication is switched on, default value is used for result name.
6286 # @return GEOM.ListOfGO
6288 # @ref tui_glue_faces "Example"
6289 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6291 Find coincident faces in theShape for possible gluing.
6294 theShape Initial shape.
6295 theTolerance Maximum distance between faces,
6296 which can be considered as coincident.
6297 theName Object name; when specified, this parameter is used
6298 for result publication in the study. Otherwise, if automatic
6299 publication is switched on, default value is used for result name.
6304 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6305 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6306 self._autoPublish(anObj, theName, "facesToGlue")
6309 ## Replace coincident faces in theShape by one face
6310 # in compliance with given list of faces
6311 # @param theShape Initial shape.
6312 # @param theTolerance Maximum distance between faces,
6313 # which can be considered as coincident.
6314 # @param theFaces List of faces for gluing.
6315 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6316 # otherwise all initial shapes.
6317 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6318 # will be glued, otherwise only the edges,
6319 # belonging to <VAR>theFaces</VAR>.
6320 # @param theName Object name; when specified, this parameter is used
6321 # for result publication in the study. Otherwise, if automatic
6322 # publication is switched on, default value is used for result name.
6324 # @return New GEOM.GEOM_Object, containing a copy of theShape
6325 # without some faces.
6327 # @ref tui_glue_faces "Example"
6328 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6329 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6331 Replace coincident faces in theShape by one face
6332 in compliance with given list of faces
6335 theShape Initial shape.
6336 theTolerance Maximum distance between faces,
6337 which can be considered as coincident.
6338 theFaces List of faces for gluing.
6339 doKeepNonSolids If FALSE, only solids will present in the result,
6340 otherwise all initial shapes.
6341 doGlueAllEdges If TRUE, all coincident edges of theShape
6342 will be glued, otherwise only the edges,
6343 belonging to theFaces.
6344 theName Object name; when specified, this parameter is used
6345 for result publication in the study. Otherwise, if automatic
6346 publication is switched on, default value is used for result name.
6349 New GEOM.GEOM_Object, containing a copy of theShape
6352 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6353 doKeepNonSolids, doGlueAllEdges)
6355 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6356 self._autoPublish(anObj, theName, "glueFaces")
6359 ## Replace coincident edges in theShape by one edge.
6360 # @param theShape Initial shape.
6361 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6362 # @param 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.
6366 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6368 # @ref tui_glue_edges "Example"
6369 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6371 Replace coincident edges in theShape by one edge.
6374 theShape Initial shape.
6375 theTolerance Maximum distance between edges, which can be considered as coincident.
6376 theName Object name; when specified, this parameter is used
6377 for result publication in the study. Otherwise, if automatic
6378 publication is switched on, default value is used for result name.
6381 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6383 theTolerance,Parameters = ParseParameters(theTolerance)
6384 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6386 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6387 anObj.SetParameters(Parameters)
6388 self._autoPublish(anObj, theName, "glueEdges")
6391 ## Find coincident edges in theShape for possible gluing.
6392 # @param theShape Initial shape.
6393 # @param theTolerance Maximum distance between edges,
6394 # which can be considered as coincident.
6395 # @param theName Object name; when specified, this parameter is used
6396 # for result publication in the study. Otherwise, if automatic
6397 # publication is switched on, default value is used for result name.
6399 # @return GEOM.ListOfGO
6401 # @ref tui_glue_edges "Example"
6402 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6404 Find coincident edges in theShape for possible gluing.
6407 theShape Initial shape.
6408 theTolerance Maximum distance between edges,
6409 which can be considered as coincident.
6410 theName Object name; when specified, this parameter is used
6411 for result publication in the study. Otherwise, if automatic
6412 publication is switched on, default value is used for result name.
6417 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6418 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6419 self._autoPublish(anObj, theName, "edgesToGlue")
6422 ## Replace coincident edges in theShape by one edge
6423 # in compliance with given list of edges.
6424 # @param theShape Initial shape.
6425 # @param theTolerance Maximum distance between edges,
6426 # which can be considered as coincident.
6427 # @param theEdges List of edges for gluing.
6428 # @param theName Object name; when specified, this parameter is used
6429 # for result publication in the study. Otherwise, if automatic
6430 # publication is switched on, default value is used for result name.
6432 # @return New GEOM.GEOM_Object, containing a copy of theShape
6433 # without some edges.
6435 # @ref tui_glue_edges "Example"
6436 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6438 Replace coincident edges in theShape by one edge
6439 in compliance with given list of edges.
6442 theShape Initial shape.
6443 theTolerance Maximum distance between edges,
6444 which can be considered as coincident.
6445 theEdges List of edges for gluing.
6446 theName Object name; when specified, this parameter is used
6447 for result publication in the study. Otherwise, if automatic
6448 publication is switched on, default value is used for result name.
6451 New GEOM.GEOM_Object, containing a copy of theShape
6454 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6456 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6457 self._autoPublish(anObj, theName, "glueEdges")
6463 ## @addtogroup l3_boolean Boolean Operations
6466 # -----------------------------------------------------------------------------
6467 # Boolean (Common, Cut, Fuse, Section)
6468 # -----------------------------------------------------------------------------
6470 ## Perform one of boolean operations on two given shapes.
6471 # @param theShape1 First argument for boolean operation.
6472 # @param theShape2 Second argument for boolean operation.
6473 # @param theOperation Indicates the operation to be done:\n
6474 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6475 # @param 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.
6479 # @return New GEOM.GEOM_Object, containing the result shape.
6481 # @ref tui_fuse "Example"
6482 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6484 Perform one of boolean operations on two given shapes.
6487 theShape1 First argument for boolean operation.
6488 theShape2 Second argument for boolean operation.
6489 theOperation Indicates the operation to be done:
6490 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6491 theName Object name; when specified, this parameter is used
6492 for result publication in the study. Otherwise, if automatic
6493 publication is switched on, default value is used for result name.
6496 New GEOM.GEOM_Object, containing the result shape.
6498 # Example: see GEOM_TestAll.py
6499 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6500 RaiseIfFailed("MakeBoolean", self.BoolOp)
6501 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6502 self._autoPublish(anObj, theName, def_names[theOperation])
6505 ## Perform Common boolean operation on two given shapes.
6506 # @param theShape1 First argument for boolean operation.
6507 # @param theShape2 Second argument for boolean operation.
6508 # @param theName Object name; when specified, this parameter is used
6509 # for result publication in the study. Otherwise, if automatic
6510 # publication is switched on, default value is used for result name.
6512 # @return New GEOM.GEOM_Object, containing the result shape.
6514 # @ref tui_common "Example 1"
6515 # \n @ref swig_MakeCommon "Example 2"
6516 def MakeCommon(self, theShape1, theShape2, theName=None):
6518 Perform Common boolean operation on two given shapes.
6521 theShape1 First argument for boolean operation.
6522 theShape2 Second argument for boolean operation.
6523 theName Object name; when specified, this parameter is used
6524 for result publication in the study. Otherwise, if automatic
6525 publication is switched on, default value is used for result name.
6528 New GEOM.GEOM_Object, containing the result shape.
6530 # Example: see GEOM_TestOthers.py
6531 # note: auto-publishing is done in self.MakeBoolean()
6532 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6534 ## Perform Cut boolean operation on two given shapes.
6535 # @param theShape1 First argument for boolean operation.
6536 # @param theShape2 Second argument for boolean operation.
6537 # @param theName Object name; when specified, this parameter is used
6538 # for result publication in the study. Otherwise, if automatic
6539 # publication is switched on, default value is used for result name.
6541 # @return New GEOM.GEOM_Object, containing the result shape.
6543 # @ref tui_cut "Example 1"
6544 # \n @ref swig_MakeCommon "Example 2"
6545 def MakeCut(self, theShape1, theShape2, theName=None):
6547 Perform Cut boolean operation on two given shapes.
6550 theShape1 First argument for boolean operation.
6551 theShape2 Second argument for boolean operation.
6552 theName Object name; when specified, this parameter is used
6553 for result publication in the study. Otherwise, if automatic
6554 publication is switched on, default value is used for result name.
6557 New GEOM.GEOM_Object, containing the result shape.
6560 # Example: see GEOM_TestOthers.py
6561 # note: auto-publishing is done in self.MakeBoolean()
6562 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6564 ## Perform Fuse boolean operation on two given shapes.
6565 # @param theShape1 First argument for boolean operation.
6566 # @param theShape2 Second argument for boolean operation.
6567 # @param theName Object name; when specified, this parameter is used
6568 # for result publication in the study. Otherwise, if automatic
6569 # publication is switched on, default value is used for result name.
6571 # @return New GEOM.GEOM_Object, containing the result shape.
6573 # @ref tui_fuse "Example 1"
6574 # \n @ref swig_MakeCommon "Example 2"
6575 def MakeFuse(self, theShape1, theShape2, theName=None):
6577 Perform Fuse boolean operation on two given shapes.
6580 theShape1 First argument for boolean operation.
6581 theShape2 Second argument for boolean operation.
6582 theName Object name; when specified, this parameter is used
6583 for result publication in the study. Otherwise, if automatic
6584 publication is switched on, default value is used for result name.
6587 New GEOM.GEOM_Object, containing the result shape.
6590 # Example: see GEOM_TestOthers.py
6591 # note: auto-publishing is done in self.MakeBoolean()
6592 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6594 ## Perform Section boolean operation on two given shapes.
6595 # @param theShape1 First argument for boolean operation.
6596 # @param theShape2 Second argument for boolean operation.
6597 # @param theName Object name; when specified, this parameter is used
6598 # for result publication in the study. Otherwise, if automatic
6599 # publication is switched on, default value is used for result name.
6601 # @return New GEOM.GEOM_Object, containing the result shape.
6603 # @ref tui_section "Example 1"
6604 # \n @ref swig_MakeCommon "Example 2"
6605 def MakeSection(self, theShape1, theShape2, theName=None):
6607 Perform Section boolean operation on two given shapes.
6610 theShape1 First argument for boolean operation.
6611 theShape2 Second argument for boolean operation.
6612 theName Object name; when specified, this parameter is used
6613 for result publication in the study. Otherwise, if automatic
6614 publication is switched on, default value is used for result name.
6617 New GEOM.GEOM_Object, containing the result shape.
6620 # Example: see GEOM_TestOthers.py
6621 # note: auto-publishing is done in self.MakeBoolean()
6622 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6627 ## @addtogroup l3_basic_op
6630 ## Perform partition operation.
6631 # @param ListShapes Shapes to be intersected.
6632 # @param ListTools Shapes to intersect theShapes.
6633 # @param Limit Type of resulting shapes (see ShapeType()).\n
6634 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6635 # type will be detected automatically.
6636 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6637 # target type (equal to Limit) are kept in the result,
6638 # else standalone shapes of lower dimension
6639 # are kept also (if they exist).
6640 # @param theName Object name; when specified, this parameter is used
6641 # for result publication in the study. Otherwise, if automatic
6642 # publication is switched on, default value is used for result name.
6644 # @note Each compound from ListShapes and ListTools will be exploded
6645 # in order to avoid possible intersection between shapes from this compound.
6647 # After implementation new version of PartitionAlgo (October 2006)
6648 # other parameters are ignored by current functionality. They are kept
6649 # in this function only for support old versions.
6650 # @param ListKeepInside Shapes, outside which the results will be deleted.
6651 # Each shape from theKeepInside must belong to theShapes also.
6652 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6653 # Each shape from theRemoveInside must belong to theShapes also.
6654 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6655 # @param ListMaterials Material indices for each shape. Make sence,
6656 # only if theRemoveWebs is TRUE.
6658 # @return New GEOM.GEOM_Object, containing the result shapes.
6660 # @ref tui_partition "Example"
6661 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6662 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6663 KeepNonlimitShapes=0, theName=None):
6665 Perform partition operation.
6668 ListShapes Shapes to be intersected.
6669 ListTools Shapes to intersect theShapes.
6670 Limit Type of resulting shapes (see geompy.ShapeType)
6671 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6672 type will be detected automatically.
6673 KeepNonlimitShapes if this parameter == 0, then only shapes of
6674 target type (equal to Limit) are kept in the result,
6675 else standalone shapes of lower dimension
6676 are kept also (if they exist).
6677 theName Object name; when specified, this parameter is used
6678 for result publication in the study. Otherwise, if automatic
6679 publication is switched on, default value is used for result name.
6681 Each compound from ListShapes and ListTools will be exploded
6682 in order to avoid possible intersection between shapes from
6685 After implementation new version of PartitionAlgo (October 2006) other
6686 parameters are ignored by current functionality. They are kept in this
6687 function only for support old versions.
6690 ListKeepInside Shapes, outside which the results will be deleted.
6691 Each shape from theKeepInside must belong to theShapes also.
6692 ListRemoveInside Shapes, inside which the results will be deleted.
6693 Each shape from theRemoveInside must belong to theShapes also.
6694 RemoveWebs If TRUE, perform Glue 3D algorithm.
6695 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6698 New GEOM.GEOM_Object, containing the result shapes.
6700 # Example: see GEOM_TestAll.py
6701 if Limit == self.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.MakePartition(ListShapes, ListTools,
6708 ListKeepInside, ListRemoveInside,
6709 Limit, RemoveWebs, ListMaterials,
6710 KeepNonlimitShapes);
6711 RaiseIfFailed("MakePartition", self.BoolOp)
6712 self._autoPublish(anObj, theName, "partition")
6715 ## Perform partition operation.
6716 # This method may be useful if it is needed to make a partition for
6717 # compound contains nonintersected shapes. Performance will be better
6718 # since intersection between shapes from compound is not performed.
6720 # Description of all parameters as in previous method MakePartition()
6722 # @note Passed compounds (via ListShapes or via ListTools)
6723 # have to consist of nonintersecting shapes.
6725 # @return New GEOM.GEOM_Object, containing the result shapes.
6727 # @ref swig_todo "Example"
6728 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6729 ListKeepInside=[], ListRemoveInside=[],
6730 Limit=ShapeType["AUTO"], RemoveWebs=0,
6731 ListMaterials=[], KeepNonlimitShapes=0,
6734 Perform partition operation.
6735 This method may be useful if it is needed to make a partition for
6736 compound contains nonintersected shapes. Performance will be better
6737 since intersection between shapes from compound is not performed.
6740 Description of all parameters as in method geompy.MakePartition
6743 Passed compounds (via ListShapes or via ListTools)
6744 have to consist of nonintersecting shapes.
6747 New GEOM.GEOM_Object, containing the result shapes.
6749 if Limit == self.ShapeType["AUTO"]:
6750 # automatic detection of the most appropriate shape limit type
6752 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6753 Limit = EnumToLong(lim)
6755 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6756 ListKeepInside, ListRemoveInside,
6757 Limit, RemoveWebs, ListMaterials,
6758 KeepNonlimitShapes);
6759 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6760 self._autoPublish(anObj, theName, "partition")
6763 ## See method MakePartition() for more information.
6765 # @ref tui_partition "Example 1"
6766 # \n @ref swig_Partition "Example 2"
6767 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6768 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6769 KeepNonlimitShapes=0, theName=None):
6771 See method geompy.MakePartition for more information.
6773 # Example: see GEOM_TestOthers.py
6774 # note: auto-publishing is done in self.MakePartition()
6775 anObj = self.MakePartition(ListShapes, ListTools,
6776 ListKeepInside, ListRemoveInside,
6777 Limit, RemoveWebs, ListMaterials,
6778 KeepNonlimitShapes, theName);
6781 ## Perform partition of the Shape with the Plane
6782 # @param theShape Shape to be intersected.
6783 # @param thePlane Tool shape, to intersect theShape.
6784 # @param theName Object name; when specified, this parameter is used
6785 # for result publication in the study. Otherwise, if automatic
6786 # publication is switched on, default value is used for result name.
6788 # @return New GEOM.GEOM_Object, containing the result shape.
6790 # @ref tui_partition "Example"
6791 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6793 Perform partition of the Shape with the Plane
6796 theShape Shape to be intersected.
6797 thePlane Tool shape, to intersect theShape.
6798 theName Object name; when specified, this parameter is used
6799 for result publication in the study. Otherwise, if automatic
6800 publication is switched on, default value is used for result name.
6803 New GEOM.GEOM_Object, containing the result shape.
6805 # Example: see GEOM_TestAll.py
6806 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6807 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6808 self._autoPublish(anObj, theName, "partition")
6811 # end of l3_basic_op
6814 ## @addtogroup l3_transform
6817 ## Translate the given object along the vector, specified
6818 # by its end points.
6819 # @param theObject The object to be translated.
6820 # @param thePoint1 Start point of translation vector.
6821 # @param thePoint2 End point of translation vector.
6822 # @param theCopy Flag used to translate object itself or create a copy.
6823 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6824 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6825 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6827 Translate the given object along the vector, specified by its end points.
6830 theObject The object to be translated.
6831 thePoint1 Start point of translation vector.
6832 thePoint2 End point of translation vector.
6833 theCopy Flag used to translate object itself or create a copy.
6836 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6837 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6840 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6842 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
6843 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
6846 ## Translate the given object along the vector, specified
6847 # by its end points, creating its copy before the translation.
6848 # @param theObject The object to be translated.
6849 # @param thePoint1 Start point of translation vector.
6850 # @param thePoint2 End point of translation vector.
6851 # @param theName Object name; when specified, this parameter is used
6852 # for result publication in the study. Otherwise, if automatic
6853 # publication is switched on, default value is used for result name.
6855 # @return New GEOM.GEOM_Object, containing the translated object.
6857 # @ref tui_translation "Example 1"
6858 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
6859 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
6861 Translate the given object along the vector, specified
6862 by its end points, creating its copy before the translation.
6865 theObject The object to be translated.
6866 thePoint1 Start point of translation vector.
6867 thePoint2 End point of translation vector.
6868 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.
6873 New GEOM.GEOM_Object, containing the translated object.
6875 # Example: see GEOM_TestAll.py
6876 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6877 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
6878 self._autoPublish(anObj, theName, "translated")
6881 ## Translate the given object along the vector, specified by its components.
6882 # @param theObject The object to be translated.
6883 # @param theDX,theDY,theDZ Components of translation vector.
6884 # @param theCopy Flag used to translate object itself or create a copy.
6885 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6886 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6888 # @ref tui_translation "Example"
6889 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
6891 Translate the given object along the vector, specified by its components.
6894 theObject The object to be translated.
6895 theDX,theDY,theDZ Components of translation vector.
6896 theCopy Flag used to translate object itself or create a copy.
6899 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6900 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6902 # Example: see GEOM_TestAll.py
6903 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
6905 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
6907 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
6908 anObj.SetParameters(Parameters)
6909 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
6912 ## Translate the given object along the vector, specified
6913 # by its components, creating its copy before the translation.
6914 # @param theObject The object to be translated.
6915 # @param theDX,theDY,theDZ Components of translation vector.
6916 # @param theName Object name; when specified, this parameter is used
6917 # for result publication in the study. Otherwise, if automatic
6918 # publication is switched on, default value is used for result name.
6920 # @return New GEOM.GEOM_Object, containing the translated object.
6922 # @ref tui_translation "Example"
6923 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
6925 Translate the given object along the vector, specified
6926 by its components, creating its copy before the translation.
6929 theObject The object to be translated.
6930 theDX,theDY,theDZ Components of translation vector.
6931 theName Object name; when specified, this parameter is used
6932 for result publication in the study. Otherwise, if automatic
6933 publication is switched on, default value is used for result name.
6936 New GEOM.GEOM_Object, containing the translated object.
6938 # Example: see GEOM_TestAll.py
6939 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
6940 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
6941 anObj.SetParameters(Parameters)
6942 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
6943 self._autoPublish(anObj, theName, "translated")
6946 ## Translate the given object along the given vector.
6947 # @param theObject The object to be translated.
6948 # @param theVector The translation vector.
6949 # @param theCopy Flag used to translate object itself or create a copy.
6950 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6951 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6952 def TranslateVector(self, theObject, theVector, theCopy=False):
6954 Translate the given object along the given vector.
6957 theObject The object to be translated.
6958 theVector The translation vector.
6959 theCopy Flag used to translate object itself or create a copy.
6962 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6963 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6966 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
6968 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
6969 RaiseIfFailed("TranslateVector", self.TrsfOp)
6972 ## Translate the given object along the given vector,
6973 # creating its copy before the translation.
6974 # @param theObject The object to be translated.
6975 # @param theVector The translation vector.
6976 # @param theName Object name; when specified, this parameter is used
6977 # for result publication in the study. Otherwise, if automatic
6978 # publication is switched on, default value is used for result name.
6980 # @return New GEOM.GEOM_Object, containing the translated object.
6982 # @ref tui_translation "Example"
6983 def MakeTranslationVector(self, theObject, theVector, theName=None):
6985 Translate the given object along the given vector,
6986 creating its copy before the translation.
6989 theObject The object to be translated.
6990 theVector The translation vector.
6991 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.
6996 New GEOM.GEOM_Object, containing the translated object.
6998 # Example: see GEOM_TestAll.py
6999 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7000 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7001 self._autoPublish(anObj, theName, "translated")
7004 ## Translate the given object along the given vector on given distance.
7005 # @param theObject The object to be translated.
7006 # @param theVector The translation vector.
7007 # @param theDistance The translation distance.
7008 # @param theCopy Flag used to translate object itself or create a copy.
7009 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7010 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7012 # @ref tui_translation "Example"
7013 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7015 Translate the given object along the given vector on given distance.
7018 theObject The object to be translated.
7019 theVector The translation vector.
7020 theDistance The translation distance.
7021 theCopy Flag used to translate object itself or create a copy.
7024 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7025 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7027 # Example: see GEOM_TestAll.py
7028 theDistance,Parameters = ParseParameters(theDistance)
7029 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7030 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7031 anObj.SetParameters(Parameters)
7034 ## Translate the given object along the given vector on given distance,
7035 # creating its copy before the translation.
7036 # @param theObject The object to be translated.
7037 # @param theVector The translation vector.
7038 # @param theDistance The translation distance.
7039 # @param theName Object name; when specified, this parameter is used
7040 # for result publication in the study. Otherwise, if automatic
7041 # publication is switched on, default value is used for result name.
7043 # @return New GEOM.GEOM_Object, containing the translated object.
7045 # @ref tui_translation "Example"
7046 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7048 Translate the given object along the given vector on given distance,
7049 creating its copy before the translation.
7052 theObject The object to be translated.
7053 theVector The translation vector.
7054 theDistance The translation distance.
7055 theName Object name; when specified, this parameter is used
7056 for result publication in the study. Otherwise, if automatic
7057 publication is switched on, default value is used for result name.
7060 New GEOM.GEOM_Object, containing the translated object.
7062 # Example: see GEOM_TestAll.py
7063 theDistance,Parameters = ParseParameters(theDistance)
7064 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7065 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7066 anObj.SetParameters(Parameters)
7067 self._autoPublish(anObj, theName, "translated")
7070 ## Rotate the given object around the given axis on the given angle.
7071 # @param theObject The object to be rotated.
7072 # @param theAxis Rotation axis.
7073 # @param theAngle Rotation angle in radians.
7074 # @param theCopy Flag used to rotate object itself or create a copy.
7076 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7077 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7079 # @ref tui_rotation "Example"
7080 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7082 Rotate the given object around the given axis on the given angle.
7085 theObject The object to be rotated.
7086 theAxis Rotation axis.
7087 theAngle Rotation angle in radians.
7088 theCopy Flag used to rotate object itself or create a copy.
7091 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7092 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7094 # Example: see GEOM_TestAll.py
7096 if isinstance(theAngle,str):
7098 theAngle, Parameters = ParseParameters(theAngle)
7100 theAngle = theAngle*math.pi/180.0
7102 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7104 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7105 RaiseIfFailed("Rotate", self.TrsfOp)
7106 anObj.SetParameters(Parameters)
7109 ## Rotate the given object around the given axis
7110 # on the given angle, creating its copy before the rotatation.
7111 # @param theObject The object to be rotated.
7112 # @param theAxis Rotation axis.
7113 # @param theAngle Rotation angle in radians.
7114 # @param theName Object name; when specified, this parameter is used
7115 # for result publication in the study. Otherwise, if automatic
7116 # publication is switched on, default value is used for result name.
7118 # @return New GEOM.GEOM_Object, containing the rotated object.
7120 # @ref tui_rotation "Example"
7121 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7123 Rotate the given object around the given axis
7124 on the given angle, creating its copy before the rotatation.
7127 theObject The object to be rotated.
7128 theAxis Rotation axis.
7129 theAngle Rotation angle in radians.
7130 theName Object name; when specified, this parameter is used
7131 for result publication in the study. Otherwise, if automatic
7132 publication is switched on, default value is used for result name.
7135 New GEOM.GEOM_Object, containing the rotated object.
7137 # Example: see GEOM_TestAll.py
7139 if isinstance(theAngle,str):
7141 theAngle, Parameters = ParseParameters(theAngle)
7143 theAngle = theAngle*math.pi/180.0
7144 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7145 RaiseIfFailed("RotateCopy", self.TrsfOp)
7146 anObj.SetParameters(Parameters)
7147 self._autoPublish(anObj, theName, "rotated")
7150 ## Rotate given object around vector perpendicular to plane
7151 # containing three points.
7152 # @param theObject The object to be rotated.
7153 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7154 # containing the three points.
7155 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7156 # @param theCopy Flag used to rotate object itself or create a copy.
7157 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7158 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7159 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7161 Rotate given object around vector perpendicular to plane
7162 containing three points.
7165 theObject The object to be rotated.
7166 theCentPoint central point the axis is the vector perpendicular to the plane
7167 containing the three points.
7168 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7169 theCopy Flag used to rotate object itself or create a copy.
7172 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7173 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7176 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7178 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7179 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7182 ## Rotate given object around vector perpendicular to plane
7183 # containing three points, creating its copy before the rotatation.
7184 # @param theObject The object to be rotated.
7185 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7186 # containing the three points.
7187 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7188 # @param theName Object name; when specified, this parameter is used
7189 # for result publication in the study. Otherwise, if automatic
7190 # publication is switched on, default value is used for result name.
7192 # @return New GEOM.GEOM_Object, containing the rotated object.
7194 # @ref tui_rotation "Example"
7195 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7197 Rotate given object around vector perpendicular to plane
7198 containing three points, creating its copy before the rotatation.
7201 theObject The object to be rotated.
7202 theCentPoint central point the axis is the vector perpendicular to the plane
7203 containing the three points.
7204 thePoint1,thePoint2 in a perpendicular plane of the axis.
7205 theName Object name; when specified, this parameter is used
7206 for result publication in the study. Otherwise, if automatic
7207 publication is switched on, default value is used for result name.
7210 New GEOM.GEOM_Object, containing the rotated object.
7212 # Example: see GEOM_TestAll.py
7213 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7214 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7215 self._autoPublish(anObj, theName, "rotated")
7218 ## Scale the given object by the specified factor.
7219 # @param theObject The object to be scaled.
7220 # @param thePoint Center point for scaling.
7221 # Passing None for it means scaling relatively the origin of global CS.
7222 # @param theFactor Scaling factor value.
7223 # @param theCopy Flag used to scale object itself or create a copy.
7224 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7225 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7226 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7228 Scale the given object by the specified factor.
7231 theObject The object to be scaled.
7232 thePoint Center point for scaling.
7233 Passing None for it means scaling relatively the origin of global CS.
7234 theFactor Scaling factor value.
7235 theCopy Flag used to scale object itself or create a copy.
7238 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7239 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7241 # Example: see GEOM_TestAll.py
7242 theFactor, Parameters = ParseParameters(theFactor)
7244 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7246 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7247 RaiseIfFailed("Scale", self.TrsfOp)
7248 anObj.SetParameters(Parameters)
7251 ## Scale the given object by the factor, creating its copy before the scaling.
7252 # @param theObject The object to be scaled.
7253 # @param thePoint Center point for scaling.
7254 # Passing None for it means scaling relatively the origin of global CS.
7255 # @param theFactor Scaling factor value.
7256 # @param theName Object name; when specified, this parameter is used
7257 # for result publication in the study. Otherwise, if automatic
7258 # publication is switched on, default value is used for result name.
7260 # @return New GEOM.GEOM_Object, containing the scaled shape.
7262 # @ref tui_scale "Example"
7263 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7265 Scale the given object by the factor, creating its copy before the scaling.
7268 theObject The object to be scaled.
7269 thePoint Center point for scaling.
7270 Passing None for it means scaling relatively the origin of global CS.
7271 theFactor Scaling factor value.
7272 theName Object name; when specified, this parameter is used
7273 for result publication in the study. Otherwise, if automatic
7274 publication is switched on, default value is used for result name.
7277 New GEOM.GEOM_Object, containing the scaled shape.
7279 # Example: see GEOM_TestAll.py
7280 theFactor, Parameters = ParseParameters(theFactor)
7281 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7282 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7283 anObj.SetParameters(Parameters)
7284 self._autoPublish(anObj, theName, "scaled")
7287 ## Scale the given object by different factors along coordinate axes.
7288 # @param theObject The object to be scaled.
7289 # @param thePoint Center point for scaling.
7290 # Passing None for it means scaling relatively the origin of global CS.
7291 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7292 # @param theCopy Flag used to scale object itself or create a copy.
7293 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7294 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7295 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7297 Scale the given object by different factors along coordinate axes.
7300 theObject The object to be scaled.
7301 thePoint Center point for scaling.
7302 Passing None for it means scaling relatively the origin of global CS.
7303 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7304 theCopy Flag used to scale object itself or create a copy.
7307 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7308 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7310 # Example: see GEOM_TestAll.py
7311 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7313 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7314 theFactorX, theFactorY, theFactorZ)
7316 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7317 theFactorX, theFactorY, theFactorZ)
7318 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7319 anObj.SetParameters(Parameters)
7322 ## Scale the given object by different factors along coordinate axes,
7323 # creating its copy before the scaling.
7324 # @param theObject The object to be scaled.
7325 # @param thePoint Center point for scaling.
7326 # Passing None for it means scaling relatively the origin of global CS.
7327 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7328 # @param theName Object name; when specified, this parameter is used
7329 # for result publication in the study. Otherwise, if automatic
7330 # publication is switched on, default value is used for result name.
7332 # @return New GEOM.GEOM_Object, containing the scaled shape.
7334 # @ref swig_scale "Example"
7335 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7337 Scale the given object by different factors along coordinate axes,
7338 creating its copy before the scaling.
7341 theObject The object to be scaled.
7342 thePoint Center point for scaling.
7343 Passing None for it means scaling relatively the origin of global CS.
7344 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7345 theName Object name; when specified, this parameter is used
7346 for result publication in the study. Otherwise, if automatic
7347 publication is switched on, default value is used for result name.
7350 New GEOM.GEOM_Object, containing the scaled shape.
7352 # Example: see GEOM_TestAll.py
7353 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7354 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7355 theFactorX, theFactorY, theFactorZ)
7356 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7357 anObj.SetParameters(Parameters)
7358 self._autoPublish(anObj, theName, "scaled")
7361 ## Mirror an object relatively the given plane.
7362 # @param theObject The object to be mirrored.
7363 # @param thePlane Plane of symmetry.
7364 # @param theCopy Flag used to mirror object itself or create a copy.
7365 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7366 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7367 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7369 Mirror an object relatively the given plane.
7372 theObject The object to be mirrored.
7373 thePlane Plane of symmetry.
7374 theCopy Flag used to mirror object itself or create a copy.
7377 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7378 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7381 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7383 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7384 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7387 ## Create an object, symmetrical
7388 # to the given one relatively the given plane.
7389 # @param theObject The object to be mirrored.
7390 # @param thePlane Plane of symmetry.
7391 # @param theName Object name; when specified, this parameter is used
7392 # for result publication in the study. Otherwise, if automatic
7393 # publication is switched on, default value is used for result name.
7395 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7397 # @ref tui_mirror "Example"
7398 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7400 Create an object, symmetrical to the given one relatively the given plane.
7403 theObject The object to be mirrored.
7404 thePlane Plane of symmetry.
7405 theName Object name; when specified, this parameter is used
7406 for result publication in the study. Otherwise, if automatic
7407 publication is switched on, default value is used for result name.
7410 New GEOM.GEOM_Object, containing the mirrored shape.
7412 # Example: see GEOM_TestAll.py
7413 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7414 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7415 self._autoPublish(anObj, theName, "mirrored")
7418 ## Mirror an object relatively the given axis.
7419 # @param theObject The object to be mirrored.
7420 # @param theAxis Axis of symmetry.
7421 # @param theCopy Flag used to mirror object itself or create a copy.
7422 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7423 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7424 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7426 Mirror an object relatively the given axis.
7429 theObject The object to be mirrored.
7430 theAxis Axis of symmetry.
7431 theCopy Flag used to mirror object itself or create a copy.
7434 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7435 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7438 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7440 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7441 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7444 ## Create an object, symmetrical
7445 # to the given one relatively the given axis.
7446 # @param theObject The object to be mirrored.
7447 # @param theAxis Axis of symmetry.
7448 # @param theName Object name; when specified, this parameter is used
7449 # for result publication in the study. Otherwise, if automatic
7450 # publication is switched on, default value is used for result name.
7452 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7454 # @ref tui_mirror "Example"
7455 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7457 Create an object, symmetrical to the given one relatively the given axis.
7460 theObject The object to be mirrored.
7461 theAxis Axis of symmetry.
7462 theName Object name; when specified, this parameter is used
7463 for result publication in the study. Otherwise, if automatic
7464 publication is switched on, default value is used for result name.
7467 New GEOM.GEOM_Object, containing the mirrored shape.
7469 # Example: see GEOM_TestAll.py
7470 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7471 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7472 self._autoPublish(anObj, theName, "mirrored")
7475 ## Mirror an object relatively the given point.
7476 # @param theObject The object to be mirrored.
7477 # @param thePoint Point of symmetry.
7478 # @param theCopy Flag used to mirror object itself or create a copy.
7479 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7480 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7481 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7483 Mirror an object relatively the given point.
7486 theObject The object to be mirrored.
7487 thePoint Point of symmetry.
7488 theCopy Flag used to mirror object itself or create a copy.
7491 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7492 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7494 # Example: see GEOM_TestAll.py
7496 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7498 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7499 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7502 ## Create an object, symmetrical
7503 # to the given one relatively the given point.
7504 # @param theObject The object to be mirrored.
7505 # @param thePoint Point of symmetry.
7506 # @param theName Object name; when specified, this parameter is used
7507 # for result publication in the study. Otherwise, if automatic
7508 # publication is switched on, default value is used for result name.
7510 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7512 # @ref tui_mirror "Example"
7513 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7515 Create an object, symmetrical
7516 to the given one relatively the given point.
7519 theObject The object to be mirrored.
7520 thePoint Point of symmetry.
7521 theName Object name; when specified, this parameter is used
7522 for result publication in the study. Otherwise, if automatic
7523 publication is switched on, default value is used for result name.
7526 New GEOM.GEOM_Object, containing the mirrored shape.
7528 # Example: see GEOM_TestAll.py
7529 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7530 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7531 self._autoPublish(anObj, theName, "mirrored")
7534 ## Modify the location of the given object.
7535 # @param theObject The object to be displaced.
7536 # @param theStartLCS Coordinate system to perform displacement from it.\n
7537 # If \a theStartLCS is NULL, displacement
7538 # will be performed from global CS.\n
7539 # If \a theObject itself is used as \a theStartLCS,
7540 # its location will be changed to \a theEndLCS.
7541 # @param theEndLCS Coordinate system to perform displacement to it.
7542 # @param theCopy Flag used to displace object itself or create a copy.
7543 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7544 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7545 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7547 Modify the Location of the given object by LCS, creating its copy before the setting.
7550 theObject The object to be displaced.
7551 theStartLCS Coordinate system to perform displacement from it.
7552 If theStartLCS is NULL, displacement
7553 will be performed from global CS.
7554 If theObject itself is used as theStartLCS,
7555 its location will be changed to theEndLCS.
7556 theEndLCS Coordinate system to perform displacement to it.
7557 theCopy Flag used to displace object itself or create a copy.
7560 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7561 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7563 # Example: see GEOM_TestAll.py
7565 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7567 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7568 RaiseIfFailed("Displace", self.TrsfOp)
7571 ## Modify the Location of the given object by LCS,
7572 # creating its copy before the setting.
7573 # @param theObject The object to be displaced.
7574 # @param theStartLCS Coordinate system to perform displacement from it.\n
7575 # If \a theStartLCS is NULL, displacement
7576 # will be performed from global CS.\n
7577 # If \a theObject itself is used as \a theStartLCS,
7578 # its location will be changed to \a theEndLCS.
7579 # @param theEndLCS Coordinate system to perform displacement to it.
7580 # @param theName Object name; when specified, this parameter is used
7581 # for result publication in the study. Otherwise, if automatic
7582 # publication is switched on, default value is used for result name.
7584 # @return New GEOM.GEOM_Object, containing the displaced shape.
7586 # @ref tui_modify_location "Example"
7587 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7589 Modify the Location of the given object by LCS, creating its copy before the setting.
7592 theObject The object to be displaced.
7593 theStartLCS Coordinate system to perform displacement from it.
7594 If theStartLCS is NULL, displacement
7595 will be performed from global CS.
7596 If theObject itself is used as theStartLCS,
7597 its location will be changed to theEndLCS.
7598 theEndLCS Coordinate system to perform displacement to it.
7599 theName Object name; when specified, this parameter is used
7600 for result publication in the study. Otherwise, if automatic
7601 publication is switched on, default value is used for result name.
7604 New GEOM.GEOM_Object, containing the displaced shape.
7607 # create local coordinate systems
7608 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7609 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7610 # modify the location of the given object
7611 position = geompy.MakePosition(cylinder, cs1, cs2)
7613 # Example: see GEOM_TestAll.py
7614 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7615 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7616 self._autoPublish(anObj, theName, "displaced")
7619 ## Modify the Location of the given object by Path.
7620 # @param theObject The object to be displaced.
7621 # @param thePath Wire or Edge along that the object will be translated.
7622 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7623 # @param theCopy is to create a copy objects if true.
7624 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7625 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7626 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7628 # @ref tui_modify_location "Example"
7629 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7631 Modify the Location of the given object by Path.
7634 theObject The object to be displaced.
7635 thePath Wire or Edge along that the object will be translated.
7636 theDistance progress of Path (0 = start location, 1 = end of path location).
7637 theCopy is to create a copy objects if true.
7638 theReverse 0 - for usual direction, 1 - to reverse path direction.
7641 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7642 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7645 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7647 # Example: see GEOM_TestAll.py
7648 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7649 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7652 ## Modify the Location of the given object by Path, creating its copy before the operation.
7653 # @param theObject The object to be displaced.
7654 # @param thePath Wire or Edge along that the object will be translated.
7655 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7656 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7657 # @param theName Object name; when specified, this parameter is used
7658 # for result publication in the study. Otherwise, if automatic
7659 # publication is switched on, default value is used for result name.
7661 # @return New GEOM.GEOM_Object, containing the displaced shape.
7662 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7664 Modify the Location of the given object by Path, creating its copy before the operation.
7667 theObject The object to be displaced.
7668 thePath Wire or Edge along that the object will be translated.
7669 theDistance progress of Path (0 = start location, 1 = end of path location).
7670 theReverse 0 - for usual direction, 1 - to reverse path direction.
7671 theName Object name; when specified, this parameter is used
7672 for result publication in the study. Otherwise, if automatic
7673 publication is switched on, default value is used for result name.
7676 New GEOM.GEOM_Object, containing the displaced shape.
7678 # Example: see GEOM_TestAll.py
7679 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7680 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7681 self._autoPublish(anObj, theName, "displaced")
7684 ## Offset given shape.
7685 # @param theObject The base object for the offset.
7686 # @param theOffset Offset value.
7687 # @param theCopy Flag used to offset object itself or create a copy.
7688 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7689 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7690 def Offset(self, theObject, theOffset, theCopy=False):
7695 theObject The base object for the offset.
7696 theOffset Offset value.
7697 theCopy Flag used to offset object itself or create a copy.
7700 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7701 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7703 theOffset, Parameters = ParseParameters(theOffset)
7705 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7707 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7708 RaiseIfFailed("Offset", self.TrsfOp)
7709 anObj.SetParameters(Parameters)
7712 ## Create new object as offset of the given one.
7713 # @param theObject The base object for the offset.
7714 # @param theOffset Offset value.
7715 # @param theName Object name; when specified, this parameter is used
7716 # for result publication in the study. Otherwise, if automatic
7717 # publication is switched on, default value is used for result name.
7719 # @return New GEOM.GEOM_Object, containing the offset object.
7721 # @ref tui_offset "Example"
7722 def MakeOffset(self, theObject, theOffset, theName=None):
7724 Create new object as offset of the given one.
7727 theObject The base object for the offset.
7728 theOffset Offset value.
7729 theName Object name; when specified, this parameter is used
7730 for result publication in the study. Otherwise, if automatic
7731 publication is switched on, default value is used for result name.
7734 New GEOM.GEOM_Object, containing the offset object.
7737 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7738 # create a new object as offset of the given object
7739 offset = geompy.MakeOffset(box, 70.)
7741 # Example: see GEOM_TestAll.py
7742 theOffset, Parameters = ParseParameters(theOffset)
7743 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7744 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7745 anObj.SetParameters(Parameters)
7746 self._autoPublish(anObj, theName, "offset")
7749 ## Create new object as projection of the given one on a 2D surface.
7750 # @param theSource The source object for the projection. It can be a point, edge or wire.
7751 # @param theTarget The target object. It can be planar or cylindrical face.
7752 # @param theName Object name; when specified, this parameter is used
7753 # for result publication in the study. Otherwise, if automatic
7754 # publication is switched on, default value is used for result name.
7756 # @return New GEOM.GEOM_Object, containing the projection.
7758 # @ref tui_projection "Example"
7759 def MakeProjection(self, theSource, theTarget, theName=None):
7761 Create new object as projection of the given one on a 2D surface.
7764 theSource The source object for the projection. It can be a point, edge or wire.
7765 theTarget The target object. It can be planar or cylindrical face.
7766 theName Object name; when specified, this parameter is used
7767 for result publication in the study. Otherwise, if automatic
7768 publication is switched on, default value is used for result name.
7771 New GEOM.GEOM_Object, containing the projection.
7773 # Example: see GEOM_TestAll.py
7774 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7775 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7776 self._autoPublish(anObj, theName, "projection")
7779 # -----------------------------------------------------------------------------
7781 # -----------------------------------------------------------------------------
7783 ## Translate the given object along the given vector a given number times
7784 # @param theObject The object to be translated.
7785 # @param theVector Direction of the translation. DX if None.
7786 # @param theStep Distance to translate on.
7787 # @param theNbTimes Quantity of translations to be done.
7788 # @param theName Object name; when specified, this parameter is used
7789 # for result publication in the study. Otherwise, if automatic
7790 # publication is switched on, default value is used for result name.
7792 # @return New GEOM.GEOM_Object, containing compound of all
7793 # the shapes, obtained after each translation.
7795 # @ref tui_multi_translation "Example"
7796 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7798 Translate the given object along the given vector a given number times
7801 theObject The object to be translated.
7802 theVector Direction of the translation. DX if None.
7803 theStep Distance to translate on.
7804 theNbTimes Quantity of translations to be done.
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 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7816 # Example: see GEOM_TestAll.py
7817 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7818 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7819 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7820 anObj.SetParameters(Parameters)
7821 self._autoPublish(anObj, theName, "multitranslation")
7824 ## Conseqently apply two specified translations to theObject specified number of times.
7825 # @param theObject The object to be translated.
7826 # @param theVector1 Direction of the first translation. DX if None.
7827 # @param theStep1 Step of the first translation.
7828 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7829 # @param theVector2 Direction of the second translation. DY if None.
7830 # @param theStep2 Step of the second translation.
7831 # @param theNbTimes2 Quantity of translations to be done along theVector2.
7832 # @param theName Object name; when specified, this parameter is used
7833 # for result publication in the study. Otherwise, if automatic
7834 # publication is switched on, default value is used for result name.
7836 # @return New GEOM.GEOM_Object, containing compound of all
7837 # the shapes, obtained after each translation.
7839 # @ref tui_multi_translation "Example"
7840 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
7841 theVector2, theStep2, theNbTimes2, theName=None):
7843 Conseqently apply two specified translations to theObject specified number of times.
7846 theObject The object to be translated.
7847 theVector1 Direction of the first translation. DX if None.
7848 theStep1 Step of the first translation.
7849 theNbTimes1 Quantity of translations to be done along theVector1.
7850 theVector2 Direction of the second translation. DY if None.
7851 theStep2 Step of the second translation.
7852 theNbTimes2 Quantity of translations to be done along theVector2.
7853 theName Object name; when specified, this parameter is used
7854 for result publication in the study. Otherwise, if automatic
7855 publication is switched on, default value is used for result name.
7858 New GEOM.GEOM_Object, containing compound of all
7859 the shapes, obtained after each translation.
7862 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
7864 # Example: see GEOM_TestAll.py
7865 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
7866 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
7867 theVector2, theStep2, theNbTimes2)
7868 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
7869 anObj.SetParameters(Parameters)
7870 self._autoPublish(anObj, theName, "multitranslation")
7873 ## Rotate the given object around the given axis a given number times.
7874 # Rotation angle will be 2*PI/theNbTimes.
7875 # @param theObject The object to be rotated.
7876 # @param theAxis The rotation axis. DZ if None.
7877 # @param theNbTimes Quantity of rotations to be done.
7878 # @param theName Object name; when specified, this parameter is used
7879 # for result publication in the study. Otherwise, if automatic
7880 # publication is switched on, default value is used for result name.
7882 # @return New GEOM.GEOM_Object, containing compound of all the
7883 # shapes, obtained after each rotation.
7885 # @ref tui_multi_rotation "Example"
7886 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
7888 Rotate the given object around the given axis a given number times.
7889 Rotation angle will be 2*PI/theNbTimes.
7892 theObject The object to be rotated.
7893 theAxis The rotation axis. DZ if None.
7894 theNbTimes Quantity of rotations to be done.
7895 theName Object name; when specified, this parameter is used
7896 for result publication in the study. Otherwise, if automatic
7897 publication is switched on, default value is used for result name.
7900 New GEOM.GEOM_Object, containing compound of all the
7901 shapes, obtained after each rotation.
7904 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
7906 # Example: see GEOM_TestAll.py
7907 theNbTimes, Parameters = ParseParameters(theNbTimes)
7908 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
7909 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
7910 anObj.SetParameters(Parameters)
7911 self._autoPublish(anObj, theName, "multirotation")
7914 ## Rotate the given object around the given axis
7915 # a given number times on the given angle.
7916 # @param theObject The object to be rotated.
7917 # @param theAxis The rotation axis. DZ if None.
7918 # @param theAngleStep Rotation angle in radians.
7919 # @param theNbTimes Quantity of rotations to be done.
7920 # @param theName Object name; when specified, this parameter is used
7921 # for result publication in the study. Otherwise, if automatic
7922 # publication is switched on, default value is used for result name.
7924 # @return New GEOM.GEOM_Object, containing compound of all the
7925 # shapes, obtained after each rotation.
7927 # @ref tui_multi_rotation "Example"
7928 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
7930 Rotate the given object around the given axis
7931 a given number times on the given angle.
7934 theObject The object to be rotated.
7935 theAxis The rotation axis. DZ if None.
7936 theAngleStep Rotation angle in radians.
7937 theNbTimes Quantity of rotations to be done.
7938 theName Object name; when specified, this parameter is used
7939 for result publication in the study. Otherwise, if automatic
7940 publication is switched on, default value is used for result name.
7943 New GEOM.GEOM_Object, containing compound of all the
7944 shapes, obtained after each rotation.
7947 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
7949 # Example: see GEOM_TestAll.py
7950 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
7951 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
7952 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
7953 anObj.SetParameters(Parameters)
7954 self._autoPublish(anObj, theName, "multirotation")
7957 ## Rotate the given object around the given axis a given
7958 # number times and multi-translate each rotation result.
7959 # Rotation angle will be 2*PI/theNbTimes1.
7960 # Translation direction passes through center of gravity
7961 # of rotated shape and its projection on the rotation axis.
7962 # @param theObject The object to be rotated.
7963 # @param theAxis Rotation axis. DZ if None.
7964 # @param theNbTimes1 Quantity of rotations to be done.
7965 # @param theRadialStep Translation distance.
7966 # @param theNbTimes2 Quantity of translations to be done.
7967 # @param theName Object name; when specified, this parameter is used
7968 # for result publication in the study. Otherwise, if automatic
7969 # publication is switched on, default value is used for result name.
7971 # @return New GEOM.GEOM_Object, containing compound of all the
7972 # shapes, obtained after each transformation.
7974 # @ref tui_multi_rotation "Example"
7975 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
7977 Rotate the given object around the
7978 given axis on the given angle a given number
7979 times and multi-translate each rotation result.
7980 Translation direction passes through center of gravity
7981 of rotated shape and its projection on the rotation axis.
7984 theObject The object to be rotated.
7985 theAxis Rotation axis. DZ if None.
7986 theNbTimes1 Quantity of rotations to be done.
7987 theRadialStep Translation distance.
7988 theNbTimes2 Quantity of translations to be done.
7989 theName Object name; when specified, this parameter is used
7990 for result publication in the study. Otherwise, if automatic
7991 publication is switched on, default value is used for result name.
7994 New GEOM.GEOM_Object, containing compound of all the
7995 shapes, obtained after each transformation.
7998 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8000 # Example: see GEOM_TestAll.py
8001 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8002 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8003 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8004 anObj.SetParameters(Parameters)
8005 self._autoPublish(anObj, theName, "multirotation")
8008 ## Rotate the given object around the
8009 # given axis on the given angle a given number
8010 # times and multi-translate each rotation result.
8011 # Translation direction passes through center of gravity
8012 # of rotated shape and its projection on the rotation axis.
8013 # @param theObject The object to be rotated.
8014 # @param theAxis Rotation axis. DZ if None.
8015 # @param theAngleStep Rotation angle in radians.
8016 # @param theNbTimes1 Quantity of rotations to be done.
8017 # @param theRadialStep Translation distance.
8018 # @param theNbTimes2 Quantity of translations to be done.
8019 # @param theName Object name; when specified, this parameter is used
8020 # for result publication in the study. Otherwise, if automatic
8021 # publication is switched on, default value is used for result name.
8023 # @return New GEOM.GEOM_Object, containing compound of all the
8024 # shapes, obtained after each transformation.
8026 # @ref tui_multi_rotation "Example"
8027 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8029 Rotate the given object around the
8030 given axis on the given angle a given number
8031 times and multi-translate each rotation result.
8032 Translation direction passes through center of gravity
8033 of rotated shape and its projection on the rotation axis.
8036 theObject The object to be rotated.
8037 theAxis Rotation axis. DZ if None.
8038 theAngleStep Rotation angle in radians.
8039 theNbTimes1 Quantity of rotations to be done.
8040 theRadialStep Translation distance.
8041 theNbTimes2 Quantity of translations to be done.
8042 theName Object name; when specified, this parameter is used
8043 for result publication in the study. Otherwise, if automatic
8044 publication is switched on, default value is used for result name.
8047 New GEOM.GEOM_Object, containing compound of all the
8048 shapes, obtained after each transformation.
8051 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8053 # Example: see GEOM_TestAll.py
8054 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8055 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8056 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8057 anObj.SetParameters(Parameters)
8058 self._autoPublish(anObj, theName, "multirotation")
8061 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8063 # @ref swig_MakeMultiRotation "Example"
8064 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8066 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8069 pz = geompy.MakeVertex(0, 0, 100)
8070 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8071 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8073 # Example: see GEOM_TestOthers.py
8074 aVec = self.MakeLine(aPoint,aDir)
8075 # note: auto-publishing is done in self.MultiRotate1D()
8076 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8079 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8081 # @ref swig_MakeMultiRotation "Example"
8082 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8084 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8087 pz = geompy.MakeVertex(0, 0, 100)
8088 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8089 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8091 # Example: see GEOM_TestOthers.py
8092 aVec = self.MakeLine(aPoint,aDir)
8093 # note: auto-publishing is done in self.MultiRotate1D()
8094 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8097 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8099 # @ref swig_MakeMultiRotation "Example"
8100 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8102 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8105 pz = geompy.MakeVertex(0, 0, 100)
8106 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8107 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8109 # Example: see GEOM_TestOthers.py
8110 aVec = self.MakeLine(aPoint,aDir)
8111 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8112 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8115 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8117 # @ref swig_MakeMultiRotation "Example"
8118 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8120 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8123 pz = geompy.MakeVertex(0, 0, 100)
8124 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8125 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8127 # Example: see GEOM_TestOthers.py
8128 aVec = self.MakeLine(aPoint,aDir)
8129 # note: auto-publishing is done in self.MultiRotate2D()
8130 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8133 # end of l3_transform
8136 ## @addtogroup l3_transform_d
8139 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8140 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8142 Deprecated method. Use MultiRotate1DNbTimes instead.
8144 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8145 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8147 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8148 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8149 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8151 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8152 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8155 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8157 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8158 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8159 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8160 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8161 anObj.SetParameters(Parameters)
8162 self._autoPublish(anObj, theName, "multirotation")
8165 ## The same, as MultiRotate1D(), but axis is given by direction and point
8166 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8167 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8169 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8170 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8173 pz = geompy.MakeVertex(0, 0, 100)
8174 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8175 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8177 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8178 aVec = self.MakeLine(aPoint,aDir)
8179 # note: auto-publishing is done in self.MultiRotate1D()
8180 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8183 ## The same, as MultiRotate2D(), but axis is given by direction and point
8184 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8185 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8187 The same, as MultiRotate2D(), but axis is given by direction and point
8188 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8191 pz = geompy.MakeVertex(0, 0, 100)
8192 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8193 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8195 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8196 aVec = self.MakeLine(aPoint,aDir)
8197 # note: auto-publishing is done in self.MultiRotate2D()
8198 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8201 # end of l3_transform_d
8204 ## @addtogroup l3_local
8207 ## Perform a fillet on all edges of the given shape.
8208 # @param theShape Shape, to perform fillet on.
8209 # @param theR Fillet radius.
8210 # @param theName Object name; when specified, this parameter is used
8211 # for result publication in the study. Otherwise, if automatic
8212 # publication is switched on, default value is used for result name.
8214 # @return New GEOM.GEOM_Object, containing the result shape.
8216 # @ref tui_fillet "Example 1"
8217 # \n @ref swig_MakeFilletAll "Example 2"
8218 def MakeFilletAll(self, theShape, theR, theName=None):
8220 Perform a fillet on all edges of the given shape.
8223 theShape Shape, to perform fillet on.
8225 theName Object name; when specified, this parameter is used
8226 for result publication in the study. Otherwise, if automatic
8227 publication is switched on, default value is used for result name.
8230 New GEOM.GEOM_Object, containing the result shape.
8233 filletall = geompy.MakeFilletAll(prism, 10.)
8235 # Example: see GEOM_TestOthers.py
8236 theR,Parameters = ParseParameters(theR)
8237 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8238 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8239 anObj.SetParameters(Parameters)
8240 self._autoPublish(anObj, theName, "fillet")
8243 ## Perform a fillet on the specified edges/faces of the given shape
8244 # @param theShape Shape, to perform fillet on.
8245 # @param theR Fillet radius.
8246 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8247 # @param theListShapes Global indices of edges/faces to perform fillet on.
8248 # @param theName Object name; when specified, this parameter is used
8249 # for result publication in the study. Otherwise, if automatic
8250 # publication is switched on, default value is used for result name.
8252 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8254 # @return New GEOM.GEOM_Object, containing the result shape.
8256 # @ref tui_fillet "Example"
8257 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8259 Perform a fillet on the specified edges/faces of the given shape
8262 theShape Shape, to perform fillet on.
8264 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8265 theListShapes Global indices of edges/faces to perform fillet on.
8266 theName Object name; when specified, this parameter is used
8267 for result publication in the study. Otherwise, if automatic
8268 publication is switched on, default value is used for result name.
8271 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8274 New GEOM.GEOM_Object, containing the result shape.
8277 # get the list of IDs (IDList) for the fillet
8278 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8280 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8281 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8282 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8283 # make a fillet on the specified edges of the given shape
8284 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8286 # Example: see GEOM_TestAll.py
8287 theR,Parameters = ParseParameters(theR)
8289 if theShapeType == self.ShapeType["EDGE"]:
8290 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8291 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8293 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8294 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8295 anObj.SetParameters(Parameters)
8296 self._autoPublish(anObj, theName, "fillet")
8299 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8300 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8302 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8305 # get the list of IDs (IDList) for the fillet
8306 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8308 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8309 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8310 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8311 # make a fillet on the specified edges of the given shape
8312 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8314 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8316 if theShapeType == self.ShapeType["EDGE"]:
8317 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8318 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8320 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8321 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8322 anObj.SetParameters(Parameters)
8323 self._autoPublish(anObj, theName, "fillet")
8326 ## Perform a fillet on the specified edges of the given shape
8327 # @param theShape Wire Shape to perform fillet on.
8328 # @param theR Fillet radius.
8329 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8330 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8331 # \note The list of vertices could be empty,
8332 # in this case fillet will done done at all vertices in wire
8333 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8334 # by the length of the edges, nearest to the fillet vertex.
8335 # But sometimes the next edge is C1 continuous with the one, nearest to
8336 # the fillet point, and such two (or more) edges can be united to allow
8337 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8338 # thus ignoring the secant vertex (vertices).
8339 # @param theName Object name; when specified, this parameter is used
8340 # for result publication in the study. Otherwise, if automatic
8341 # publication is switched on, default value is used for result name.
8343 # @return New GEOM.GEOM_Object, containing the result shape.
8345 # @ref tui_fillet2d "Example"
8346 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8348 Perform a fillet on the specified edges of the given shape
8351 theShape Wire Shape to perform fillet on.
8353 theListOfVertexes Global indices of vertexes to perform fillet on.
8354 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8355 by the length of the edges, nearest to the fillet vertex.
8356 But sometimes the next edge is C1 continuous with the one, nearest to
8357 the fillet point, and such two (or more) edges can be united to allow
8358 bigger radius. Set this flag to TRUE to allow collinear edges union,
8359 thus ignoring the secant vertex (vertices).
8360 theName Object name; when specified, this parameter is used
8361 for result publication in the study. Otherwise, if automatic
8362 publication is switched on, default value is used for result name.
8364 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8366 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8369 New GEOM.GEOM_Object, containing the result shape.
8373 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8374 # make fillet at given wire vertices with giver radius
8375 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8377 # Example: see GEOM_TestAll.py
8378 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8379 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8380 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8381 anObj.SetParameters(Parameters)
8382 self._autoPublish(anObj, theName, "fillet")
8385 ## Perform a fillet at the specified vertices of the given face/shell.
8386 # @param theShape Face or Shell shape to perform fillet on.
8387 # @param theR Fillet radius.
8388 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8389 # @param theName Object name; when specified, this parameter is used
8390 # for result publication in the study. Otherwise, if automatic
8391 # publication is switched on, default value is used for result name.
8393 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8395 # @return New GEOM.GEOM_Object, containing the result shape.
8397 # @ref tui_fillet2d "Example"
8398 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8400 Perform a fillet at the specified vertices of the given face/shell.
8403 theShape Face or Shell shape to perform fillet on.
8405 theListOfVertexes Global indices of vertexes to perform fillet on.
8406 theName Object name; when specified, this parameter is used
8407 for result publication in the study. Otherwise, if automatic
8408 publication is switched on, default value is used for result name.
8410 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8413 New GEOM.GEOM_Object, containing the result shape.
8416 face = geompy.MakeFaceHW(100, 100, 1)
8417 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8419 # Example: see GEOM_TestAll.py
8420 theR,Parameters = ParseParameters(theR)
8421 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8422 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8423 anObj.SetParameters(Parameters)
8424 self._autoPublish(anObj, theName, "fillet")
8427 ## Perform a symmetric chamfer on all edges of the given shape.
8428 # @param theShape Shape, to perform chamfer on.
8429 # @param theD Chamfer size along each face.
8430 # @param theName Object name; when specified, this parameter is used
8431 # for result publication in the study. Otherwise, if automatic
8432 # publication is switched on, default value is used for result name.
8434 # @return New GEOM.GEOM_Object, containing the result shape.
8436 # @ref tui_chamfer "Example 1"
8437 # \n @ref swig_MakeChamferAll "Example 2"
8438 def MakeChamferAll(self, theShape, theD, theName=None):
8440 Perform a symmetric chamfer on all edges of the given shape.
8443 theShape Shape, to perform chamfer on.
8444 theD Chamfer size along each face.
8445 theName Object name; when specified, this parameter is used
8446 for result publication in the study. Otherwise, if automatic
8447 publication is switched on, default value is used for result name.
8450 New GEOM.GEOM_Object, containing the result shape.
8453 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8455 # Example: see GEOM_TestOthers.py
8456 theD,Parameters = ParseParameters(theD)
8457 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8458 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8459 anObj.SetParameters(Parameters)
8460 self._autoPublish(anObj, theName, "chamfer")
8463 ## Perform a chamfer on edges, common to the specified faces,
8464 # with distance D1 on the Face1
8465 # @param theShape Shape, to perform chamfer on.
8466 # @param theD1 Chamfer size along \a theFace1.
8467 # @param theD2 Chamfer size along \a theFace2.
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.
8477 # @ref tui_chamfer "Example"
8478 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8480 Perform a chamfer on edges, common to the specified faces,
8481 with distance D1 on the Face1
8484 theShape Shape, to perform chamfer on.
8485 theD1 Chamfer size along theFace1.
8486 theD2 Chamfer size along theFace2.
8487 theFace1,theFace2 Global indices of two faces of theShape.
8488 theName Object name; when specified, this parameter is used
8489 for result publication in the study. Otherwise, if automatic
8490 publication is switched on, default value is used for result name.
8493 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8496 New GEOM.GEOM_Object, containing the result shape.
8499 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8500 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8501 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8502 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8504 # Example: see GEOM_TestAll.py
8505 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8506 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8507 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8508 anObj.SetParameters(Parameters)
8509 self._autoPublish(anObj, theName, "chamfer")
8512 ## Perform a chamfer on edges
8513 # @param theShape Shape, to perform chamfer on.
8514 # @param theD Chamfer length
8515 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8516 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8517 # @param theName Object name; when specified, this parameter is used
8518 # for result publication in the study. Otherwise, if automatic
8519 # publication is switched on, default value is used for result name.
8521 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8523 # @return New GEOM.GEOM_Object, containing the result shape.
8524 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8526 Perform a chamfer on edges
8529 theShape Shape, to perform chamfer on.
8530 theD1 Chamfer size along theFace1.
8531 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8532 theFace1,theFace2 Global indices of two faces of theShape.
8533 theName Object name; when specified, this parameter is used
8534 for result publication in the study. Otherwise, if automatic
8535 publication is switched on, default value is used for result name.
8538 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8541 New GEOM.GEOM_Object, containing the result shape.
8544 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8545 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8546 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8548 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8551 if isinstance(theAngle,str):
8553 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8555 theAngle = theAngle*math.pi/180.0
8556 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8557 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8558 anObj.SetParameters(Parameters)
8559 self._autoPublish(anObj, theName, "chamfer")
8562 ## Perform a chamfer on all edges of the specified faces,
8563 # with distance D1 on the first specified face (if several for one edge)
8564 # @param theShape Shape, to perform chamfer on.
8565 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8566 # connected to the edge, are in \a theFaces, \a theD1
8567 # will be get along face, which is nearer to \a theFaces beginning.
8568 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8569 # @param theFaces Sequence of global indices of faces of \a theShape.
8570 # @param theName Object name; when specified, this parameter is used
8571 # for result publication in the study. Otherwise, if automatic
8572 # publication is switched on, default value is used for result name.
8574 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8576 # @return New GEOM.GEOM_Object, containing the result shape.
8578 # @ref tui_chamfer "Example"
8579 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8581 Perform a chamfer on all edges of the specified faces,
8582 with distance D1 on the first specified face (if several for one edge)
8585 theShape Shape, to perform chamfer on.
8586 theD1 Chamfer size along face from theFaces. If both faces,
8587 connected to the edge, are in theFaces, theD1
8588 will be get along face, which is nearer to theFaces beginning.
8589 theD2 Chamfer size along another of two faces, connected to the edge.
8590 theFaces Sequence of global indices of faces of theShape.
8591 theName Object name; when specified, this parameter is used
8592 for result publication in the study. Otherwise, if automatic
8593 publication is switched on, default value is used for result name.
8595 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8598 New GEOM.GEOM_Object, containing the result shape.
8600 # Example: see GEOM_TestAll.py
8601 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8602 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8603 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8604 anObj.SetParameters(Parameters)
8605 self._autoPublish(anObj, theName, "chamfer")
8608 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8609 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8611 # @ref swig_FilletChamfer "Example"
8612 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8614 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8615 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8618 if isinstance(theAngle,str):
8620 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8622 theAngle = theAngle*math.pi/180.0
8623 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8624 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8625 anObj.SetParameters(Parameters)
8626 self._autoPublish(anObj, theName, "chamfer")
8629 ## Perform a chamfer on edges,
8630 # with distance D1 on the first specified face (if several for one edge)
8631 # @param theShape Shape, to perform chamfer on.
8632 # @param theD1,theD2 Chamfer size
8633 # @param theEdges Sequence of edges of \a theShape.
8634 # @param theName Object name; when specified, this parameter is used
8635 # for result publication in the study. Otherwise, if automatic
8636 # publication is switched on, default value is used for result name.
8638 # @return New GEOM.GEOM_Object, containing the result shape.
8640 # @ref swig_FilletChamfer "Example"
8641 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8643 Perform a chamfer on edges,
8644 with distance D1 on the first specified face (if several for one edge)
8647 theShape Shape, to perform chamfer on.
8648 theD1,theD2 Chamfer size
8649 theEdges Sequence of edges of theShape.
8650 theName Object name; when specified, this parameter is used
8651 for result publication in the study. Otherwise, if automatic
8652 publication is switched on, default value is used for result name.
8655 New GEOM.GEOM_Object, containing the result shape.
8657 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8658 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8659 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8660 anObj.SetParameters(Parameters)
8661 self._autoPublish(anObj, theName, "chamfer")
8664 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8665 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8666 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8668 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8669 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8672 if isinstance(theAngle,str):
8674 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8676 theAngle = theAngle*math.pi/180.0
8677 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8678 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8679 anObj.SetParameters(Parameters)
8680 self._autoPublish(anObj, theName, "chamfer")
8683 ## @sa MakeChamferEdge(), MakeChamferFaces()
8685 # @ref swig_MakeChamfer "Example"
8686 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8688 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8690 # Example: see GEOM_TestOthers.py
8692 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8693 if aShapeType == self.ShapeType["EDGE"]:
8694 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8696 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8699 ## Remove material from a solid by extrusion of the base shape on the given distance.
8700 # @param theInit Shape to remove material from. It must be a solid or
8701 # a compound made of a single solid.
8702 # @param theBase Closed edge or wire defining the base shape to be extruded.
8703 # @param theH Prism dimension along the normal to theBase
8704 # @param theAngle Draft angle in degrees.
8705 # @param theName Object name; when specified, this parameter is used
8706 # for result publication in the study. Otherwise, if automatic
8707 # publication is switched on, default value is used for result name.
8709 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8711 # @ref tui_creation_prism "Example"
8712 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8714 Add material to a solid by extrusion of the base shape on the given distance.
8717 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8718 theBase Closed edge or wire defining the base shape to be extruded.
8719 theH Prism dimension along the normal to theBase
8720 theAngle Draft angle in degrees.
8721 theName Object name; when specified, this parameter is used
8722 for result publication in the study. Otherwise, if automatic
8723 publication is switched on, default value is used for result name.
8726 New GEOM.GEOM_Object, containing the initial shape with removed material.
8728 # Example: see GEOM_TestAll.py
8729 #theH,Parameters = ParseParameters(theH)
8730 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8731 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8732 #anObj.SetParameters(Parameters)
8733 self._autoPublish(anObj, theName, "extrudedCut")
8736 ## Add material to a solid by extrusion of the base shape on the given distance.
8737 # @param theInit Shape to add material to. It must be a solid or
8738 # a compound made of a single solid.
8739 # @param theBase Closed edge or wire defining the base shape to be extruded.
8740 # @param theH Prism dimension along the normal to theBase
8741 # @param theAngle Draft angle in degrees.
8742 # @param theName Object name; when specified, this parameter is used
8743 # for result publication in the study. Otherwise, if automatic
8744 # publication is switched on, default value is used for result name.
8746 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8748 # @ref tui_creation_prism "Example"
8749 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8751 Add material to a solid by extrusion of the base shape on the given distance.
8754 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8755 theBase Closed edge or wire defining the base shape to be extruded.
8756 theH Prism dimension along the normal to theBase
8757 theAngle Draft angle in degrees.
8758 theName Object name; when specified, this parameter is used
8759 for result publication in the study. Otherwise, if automatic
8760 publication is switched on, default value is used for result name.
8763 New GEOM.GEOM_Object, containing the initial shape with added material.
8765 # Example: see GEOM_TestAll.py
8766 #theH,Parameters = ParseParameters(theH)
8767 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8768 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8769 #anObj.SetParameters(Parameters)
8770 self._autoPublish(anObj, theName, "extrudedBoss")
8776 ## @addtogroup l3_basic_op
8779 ## Perform an Archimde operation on the given shape with given parameters.
8780 # The object presenting the resulting face is returned.
8781 # @param theShape Shape to be put in water.
8782 # @param theWeight Weight og the shape.
8783 # @param theWaterDensity Density of the water.
8784 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8785 # @param theName Object name; when specified, this parameter is used
8786 # for result publication in the study. Otherwise, if automatic
8787 # publication is switched on, default value is used for result name.
8789 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8790 # by a plane, corresponding to water level.
8792 # @ref tui_archimede "Example"
8793 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8795 Perform an Archimde operation on the given shape with given parameters.
8796 The object presenting the resulting face is returned.
8799 theShape Shape to be put in water.
8800 theWeight Weight og the shape.
8801 theWaterDensity Density of the water.
8802 theMeshDeflection Deflection of the mesh, using to compute the section.
8803 theName Object name; when specified, this parameter is used
8804 for result publication in the study. Otherwise, if automatic
8805 publication is switched on, default value is used for result name.
8808 New GEOM.GEOM_Object, containing a section of theShape
8809 by a plane, corresponding to water level.
8811 # Example: see GEOM_TestAll.py
8812 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8813 theWeight,theWaterDensity,theMeshDeflection)
8814 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8815 RaiseIfFailed("MakeArchimede", self.LocalOp)
8816 anObj.SetParameters(Parameters)
8817 self._autoPublish(anObj, theName, "archimede")
8820 # end of l3_basic_op
8823 ## @addtogroup l2_measure
8826 ## Get point coordinates
8829 # @ref tui_measurement_tools_page "Example"
8830 def PointCoordinates(self,Point):
8832 Get point coordinates
8837 # Example: see GEOM_TestMeasures.py
8838 aTuple = self.MeasuOp.PointCoordinates(Point)
8839 RaiseIfFailed("PointCoordinates", self.MeasuOp)
8842 ## Get vector coordinates
8845 # @ref tui_measurement_tools_page "Example"
8846 def VectorCoordinates(self,Vector):
8848 Get vector coordinates
8854 p1=self.GetFirstVertex(Vector)
8855 p2=self.GetLastVertex(Vector)
8857 X1=self.PointCoordinates(p1)
8858 X2=self.PointCoordinates(p2)
8860 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
8863 ## Compute cross product
8864 # @return vector w=u^v
8866 # @ref tui_measurement_tools_page "Example"
8867 def CrossProduct(self, Vector1, Vector2):
8869 Compute cross product
8871 Returns: vector w=u^v
8873 u=self.VectorCoordinates(Vector1)
8874 v=self.VectorCoordinates(Vector2)
8875 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])
8879 ## Compute cross product
8880 # @return dot product p=u.v
8882 # @ref tui_measurement_tools_page "Example"
8883 def DotProduct(self, Vector1, Vector2):
8885 Compute cross product
8887 Returns: dot product p=u.v
8889 u=self.VectorCoordinates(Vector1)
8890 v=self.VectorCoordinates(Vector2)
8891 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
8896 ## Get summarized length of all wires,
8897 # area of surface and volume of the given shape.
8898 # @param theShape Shape to define properties of.
8899 # @return [theLength, theSurfArea, theVolume]\n
8900 # theLength: Summarized length of all wires of the given shape.\n
8901 # theSurfArea: Area of surface of the given shape.\n
8902 # theVolume: Volume of the given shape.
8904 # @ref tui_measurement_tools_page "Example"
8905 def BasicProperties(self,theShape):
8907 Get summarized length of all wires,
8908 area of surface and volume of the given shape.
8911 theShape Shape to define properties of.
8914 [theLength, theSurfArea, theVolume]
8915 theLength: Summarized length of all wires of the given shape.
8916 theSurfArea: Area of surface of the given shape.
8917 theVolume: Volume of the given shape.
8919 # Example: see GEOM_TestMeasures.py
8920 aTuple = self.MeasuOp.GetBasicProperties(theShape)
8921 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
8924 ## Get parameters of bounding box of the given shape
8925 # @param theShape Shape to obtain bounding box of.
8926 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
8927 # Xmin,Xmax: Limits of shape along OX axis.
8928 # Ymin,Ymax: Limits of shape along OY axis.
8929 # Zmin,Zmax: Limits of shape along OZ axis.
8931 # @ref tui_measurement_tools_page "Example"
8932 def BoundingBox (self, theShape):
8934 Get parameters of bounding box of the given shape
8937 theShape Shape to obtain bounding box of.
8940 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
8941 Xmin,Xmax: Limits of shape along OX axis.
8942 Ymin,Ymax: Limits of shape along OY axis.
8943 Zmin,Zmax: Limits of shape along OZ axis.
8945 # Example: see GEOM_TestMeasures.py
8946 aTuple = self.MeasuOp.GetBoundingBox(theShape)
8947 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
8950 ## Get bounding box of the given shape
8951 # @param theShape Shape to obtain bounding box of.
8952 # @param theName Object name; when specified, this parameter is used
8953 # for result publication in the study. Otherwise, if automatic
8954 # publication is switched on, default value is used for result name.
8956 # @return New GEOM.GEOM_Object, containing the created box.
8958 # @ref tui_measurement_tools_page "Example"
8959 def MakeBoundingBox (self, theShape, theName=None):
8961 Get bounding box of the given shape
8964 theShape Shape to obtain bounding box of.
8965 theName Object name; when specified, this parameter is used
8966 for result publication in the study. Otherwise, if automatic
8967 publication is switched on, default value is used for result name.
8970 New GEOM.GEOM_Object, containing the created box.
8972 # Example: see GEOM_TestMeasures.py
8973 anObj = self.MeasuOp.MakeBoundingBox(theShape)
8974 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
8975 self._autoPublish(anObj, theName, "bndbox")
8978 ## Get inertia matrix and moments of inertia of theShape.
8979 # @param theShape Shape to calculate inertia of.
8980 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
8981 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
8982 # Ix,Iy,Iz: Moments of inertia of the given shape.
8984 # @ref tui_measurement_tools_page "Example"
8985 def Inertia(self,theShape):
8987 Get inertia matrix and moments of inertia of theShape.
8990 theShape Shape to calculate inertia of.
8993 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
8994 I(1-3)(1-3): Components of the inertia matrix of the given shape.
8995 Ix,Iy,Iz: Moments of inertia of the given shape.
8997 # Example: see GEOM_TestMeasures.py
8998 aTuple = self.MeasuOp.GetInertia(theShape)
8999 RaiseIfFailed("GetInertia", self.MeasuOp)
9002 ## Get if coords are included in the shape (ST_IN or ST_ON)
9003 # @param theShape Shape
9004 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9005 # @param tolerance to be used (default is 1.0e-7)
9006 # @return list_of_boolean = [res1, res2, ...]
9007 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9009 Get if coords are included in the shape (ST_IN or ST_ON)
9013 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9014 tolerance to be used (default is 1.0e-7)
9017 list_of_boolean = [res1, res2, ...]
9019 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9021 ## Get minimal distance between the given shapes.
9022 # @param theShape1,theShape2 Shapes to find minimal distance between.
9023 # @return Value of the minimal distance between the given shapes.
9025 # @ref tui_measurement_tools_page "Example"
9026 def MinDistance(self, theShape1, theShape2):
9028 Get minimal distance between the given shapes.
9031 theShape1,theShape2 Shapes to find minimal distance between.
9034 Value of the minimal distance between the given shapes.
9036 # Example: see GEOM_TestMeasures.py
9037 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9038 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9041 ## Get minimal distance between the given shapes.
9042 # @param theShape1,theShape2 Shapes to find minimal distance between.
9043 # @return Value of the minimal distance between the given shapes, in form of list
9044 # [Distance, DX, DY, DZ].
9046 # @ref swig_all_measure "Example"
9047 def MinDistanceComponents(self, theShape1, theShape2):
9049 Get minimal distance between the given shapes.
9052 theShape1,theShape2 Shapes to find minimal distance between.
9055 Value of the minimal distance between the given shapes, in form of list
9056 [Distance, DX, DY, DZ]
9058 # Example: see GEOM_TestMeasures.py
9059 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9060 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9061 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9064 ## Get closest points of the given shapes.
9065 # @param theShape1,theShape2 Shapes to find closest points of.
9066 # @return The number of found solutions (-1 in case of infinite number of
9067 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9069 # @ref tui_measurement_tools_page "Example"
9070 def ClosestPoints (self, theShape1, theShape2):
9072 Get closest points of the given shapes.
9075 theShape1,theShape2 Shapes to find closest points of.
9078 The number of found solutions (-1 in case of infinite number of
9079 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9081 # Example: see GEOM_TestMeasures.py
9082 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9083 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9086 ## Get angle between the given shapes in degrees.
9087 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9088 # @note If both arguments are vectors, the angle is computed in accordance
9089 # with their orientations, otherwise the minimum angle is computed.
9090 # @return Value of the angle between the given shapes in degrees.
9092 # @ref tui_measurement_tools_page "Example"
9093 def GetAngle(self, theShape1, theShape2):
9095 Get angle between the given shapes in degrees.
9098 theShape1,theShape2 Lines or linear edges to find angle between.
9101 If both arguments are vectors, the angle is computed in accordance
9102 with their orientations, otherwise the minimum angle is computed.
9105 Value of the angle between the given shapes in degrees.
9107 # Example: see GEOM_TestMeasures.py
9108 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9109 RaiseIfFailed("GetAngle", self.MeasuOp)
9112 ## Get angle between the given shapes in radians.
9113 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9114 # @note If both arguments are vectors, the angle is computed in accordance
9115 # with their orientations, otherwise the minimum angle is computed.
9116 # @return Value of the angle between the given shapes in radians.
9118 # @ref tui_measurement_tools_page "Example"
9119 def GetAngleRadians(self, theShape1, theShape2):
9121 Get angle between the given shapes in radians.
9124 theShape1,theShape2 Lines or linear edges to find angle between.
9128 If both arguments are vectors, the angle is computed in accordance
9129 with their orientations, otherwise the minimum angle is computed.
9132 Value of the angle between the given shapes in radians.
9134 # Example: see GEOM_TestMeasures.py
9135 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9136 RaiseIfFailed("GetAngle", self.MeasuOp)
9139 ## Get angle between the given vectors in degrees.
9140 # @param theShape1,theShape2 Vectors to find angle between.
9141 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9142 # if False, the opposite vector to the normal vector is used.
9143 # @return Value of the angle between the given vectors in degrees.
9145 # @ref tui_measurement_tools_page "Example"
9146 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9148 Get angle between the given vectors in degrees.
9151 theShape1,theShape2 Vectors to find angle between.
9152 theFlag If True, the normal vector is defined by the two vectors cross,
9153 if False, the opposite vector to the normal vector is used.
9156 Value of the angle between the given vectors in degrees.
9158 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9160 anAngle = 360. - anAngle
9161 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9164 ## The same as GetAngleVectors, but the result is in radians.
9165 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9167 Get angle between the given vectors in radians.
9170 theShape1,theShape2 Vectors to find angle between.
9171 theFlag If True, the normal vector is defined by the two vectors cross,
9172 if False, the opposite vector to the normal vector is used.
9175 Value of the angle between the given vectors in radians.
9177 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9180 ## @name Curve Curvature Measurement
9181 # Methods for receiving radius of curvature of curves
9182 # in the given point
9185 ## Measure curvature of a curve at a point, set by parameter.
9186 # @param theCurve a curve.
9187 # @param theParam parameter.
9188 # @return radius of curvature of \a theCurve.
9190 # @ref swig_todo "Example"
9191 def CurveCurvatureByParam(self, theCurve, theParam):
9193 Measure curvature of a curve at a point, set by parameter.
9200 radius of curvature of theCurve.
9202 # Example: see GEOM_TestMeasures.py
9203 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9204 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9207 ## Measure curvature of a curve at a point.
9208 # @param theCurve a curve.
9209 # @param thePoint given point.
9210 # @return radius of curvature of \a theCurve.
9212 # @ref swig_todo "Example"
9213 def CurveCurvatureByPoint(self, theCurve, thePoint):
9215 Measure curvature of a curve at a point.
9219 thePoint given point.
9222 radius of curvature of theCurve.
9224 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9225 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9229 ## @name Surface Curvature Measurement
9230 # Methods for receiving max and min radius of curvature of surfaces
9231 # in the given point
9234 ## Measure max radius of curvature of surface.
9235 # @param theSurf the given surface.
9236 # @param theUParam Value of U-parameter on the referenced surface.
9237 # @param theVParam Value of V-parameter on the referenced surface.
9238 # @return max radius of curvature of theSurf.
9240 ## @ref swig_todo "Example"
9241 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9243 Measure max radius of curvature of surface.
9246 theSurf the given surface.
9247 theUParam Value of U-parameter on the referenced surface.
9248 theVParam Value of V-parameter on the referenced surface.
9251 max radius of curvature of theSurf.
9253 # Example: see GEOM_TestMeasures.py
9254 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9255 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9258 ## Measure max radius of curvature of surface in the given point
9259 # @param theSurf the given surface.
9260 # @param thePoint given point.
9261 # @return max radius of curvature of theSurf.
9263 ## @ref swig_todo "Example"
9264 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9266 Measure max radius of curvature of surface in the given point.
9269 theSurf the given surface.
9270 thePoint given point.
9273 max radius of curvature of theSurf.
9275 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9276 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9279 ## Measure min radius of curvature of surface.
9280 # @param theSurf the given surface.
9281 # @param theUParam Value of U-parameter on the referenced surface.
9282 # @param theVParam Value of V-parameter on the referenced surface.
9283 # @return min radius of curvature of theSurf.
9285 ## @ref swig_todo "Example"
9286 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9288 Measure min radius of curvature of surface.
9291 theSurf the given surface.
9292 theUParam Value of U-parameter on the referenced surface.
9293 theVParam Value of V-parameter on the referenced surface.
9296 Min radius of curvature of theSurf.
9298 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9299 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9302 ## Measure min radius of curvature of surface in the given point
9303 # @param theSurf the given surface.
9304 # @param thePoint given point.
9305 # @return min radius of curvature of theSurf.
9307 ## @ref swig_todo "Example"
9308 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9310 Measure min radius of curvature of surface in the given point.
9313 theSurf the given surface.
9314 thePoint given point.
9317 Min radius of curvature of theSurf.
9319 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9320 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9324 ## Get min and max tolerances of sub-shapes of theShape
9325 # @param theShape Shape, to get tolerances of.
9326 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9327 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9328 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9329 # VertMin,VertMax: Min and max tolerances of the vertices.
9331 # @ref tui_measurement_tools_page "Example"
9332 def Tolerance(self,theShape):
9334 Get min and max tolerances of sub-shapes of theShape
9337 theShape Shape, to get tolerances of.
9340 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9341 FaceMin,FaceMax: Min and max tolerances of the faces.
9342 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9343 VertMin,VertMax: Min and max tolerances of the vertices.
9345 # Example: see GEOM_TestMeasures.py
9346 aTuple = self.MeasuOp.GetTolerance(theShape)
9347 RaiseIfFailed("GetTolerance", self.MeasuOp)
9350 ## Obtain description of the given shape (number of sub-shapes of each type)
9351 # @param theShape Shape to be described.
9352 # @return Description of the given shape.
9354 # @ref tui_measurement_tools_page "Example"
9355 def WhatIs(self,theShape):
9357 Obtain description of the given shape (number of sub-shapes of each type)
9360 theShape Shape to be described.
9363 Description of the given shape.
9365 # Example: see GEOM_TestMeasures.py
9366 aDescr = self.MeasuOp.WhatIs(theShape)
9367 RaiseIfFailed("WhatIs", self.MeasuOp)
9370 ## Obtain quantity of shapes of the given type in \a theShape.
9371 # If \a theShape is of type \a theType, it is also counted.
9372 # @param theShape Shape to be described.
9373 # @param theType the given ShapeType().
9374 # @return Quantity of shapes of type \a theType in \a theShape.
9376 # @ref tui_measurement_tools_page "Example"
9377 def NbShapes (self, theShape, theType):
9379 Obtain quantity of shapes of the given type in theShape.
9380 If theShape is of type theType, it is also counted.
9383 theShape Shape to be described.
9384 theType the given geompy.ShapeType
9387 Quantity of shapes of type theType in theShape.
9389 # Example: see GEOM_TestMeasures.py
9390 listSh = self.SubShapeAllIDs(theShape, theType)
9392 t = EnumToLong(theShape.GetShapeType())
9393 theType = EnumToLong(theType)
9399 ## Obtain quantity of shapes of each type in \a theShape.
9400 # The \a theShape is also counted.
9401 # @param theShape Shape to be described.
9402 # @return Dictionary of ShapeType() with bound quantities of shapes.
9404 # @ref tui_measurement_tools_page "Example"
9405 def ShapeInfo (self, theShape):
9407 Obtain quantity of shapes of each type in theShape.
9408 The theShape is also counted.
9411 theShape Shape to be described.
9414 Dictionary of geompy.ShapeType with bound quantities of shapes.
9416 # Example: see GEOM_TestMeasures.py
9418 for typeSh in self.ShapeType:
9419 if typeSh in ( "AUTO", "SHAPE" ): continue
9420 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9422 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9429 ## Get a point, situated at the centre of mass of theShape.
9430 # @param theShape Shape to define centre of mass of.
9431 # @param theName Object name; when specified, this parameter is used
9432 # for result publication in the study. Otherwise, if automatic
9433 # publication is switched on, default value is used for result name.
9435 # @return New GEOM.GEOM_Object, containing the created point.
9437 # @ref tui_measurement_tools_page "Example"
9438 def MakeCDG(self, theShape, theName=None):
9440 Get a point, situated at the centre of mass of theShape.
9443 theShape Shape to define centre of mass of.
9444 theName Object name; when specified, this parameter is used
9445 for result publication in the study. Otherwise, if automatic
9446 publication is switched on, default value is used for result name.
9449 New GEOM.GEOM_Object, containing the created point.
9451 # Example: see GEOM_TestMeasures.py
9452 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9453 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9454 self._autoPublish(anObj, theName, "centerOfMass")
9457 ## Get a vertex sub-shape by index depended with orientation.
9458 # @param theShape Shape to find sub-shape.
9459 # @param theIndex Index to find vertex by this index (starting from zero)
9460 # @param theName Object name; when specified, this parameter is used
9461 # for result publication in the study. Otherwise, if automatic
9462 # publication is switched on, default value is used for result name.
9464 # @return New GEOM.GEOM_Object, containing the created vertex.
9466 # @ref tui_measurement_tools_page "Example"
9467 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9469 Get a vertex sub-shape by index depended with orientation.
9472 theShape Shape to find sub-shape.
9473 theIndex Index to find vertex by this index (starting from zero)
9474 theName Object name; when specified, this parameter is used
9475 for result publication in the study. Otherwise, if automatic
9476 publication is switched on, default value is used for result name.
9479 New GEOM.GEOM_Object, containing the created vertex.
9481 # Example: see GEOM_TestMeasures.py
9482 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9483 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9484 self._autoPublish(anObj, theName, "vertex")
9487 ## Get the first vertex of wire/edge depended orientation.
9488 # @param theShape Shape to find first vertex.
9489 # @param theName Object name; when specified, this parameter is used
9490 # for result publication in the study. Otherwise, if automatic
9491 # publication is switched on, default value is used for result name.
9493 # @return New GEOM.GEOM_Object, containing the created vertex.
9495 # @ref tui_measurement_tools_page "Example"
9496 def GetFirstVertex(self, theShape, theName=None):
9498 Get the first vertex of wire/edge depended orientation.
9501 theShape Shape to find first vertex.
9502 theName Object name; when specified, this parameter is used
9503 for result publication in the study. Otherwise, if automatic
9504 publication is switched on, default value is used for result name.
9507 New GEOM.GEOM_Object, containing the created vertex.
9509 # Example: see GEOM_TestMeasures.py
9510 # note: auto-publishing is done in self.GetVertexByIndex()
9511 anObj = self.GetVertexByIndex(theShape, 0, theName)
9512 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9515 ## Get the last vertex of wire/edge depended orientation.
9516 # @param theShape Shape to find last vertex.
9517 # @param theName Object name; when specified, this parameter is used
9518 # for result publication in the study. Otherwise, if automatic
9519 # publication is switched on, default value is used for result name.
9521 # @return New GEOM.GEOM_Object, containing the created vertex.
9523 # @ref tui_measurement_tools_page "Example"
9524 def GetLastVertex(self, theShape, theName=None):
9526 Get the last vertex of wire/edge depended orientation.
9529 theShape Shape to find last vertex.
9530 theName Object name; when specified, this parameter is used
9531 for result publication in the study. Otherwise, if automatic
9532 publication is switched on, default value is used for result name.
9535 New GEOM.GEOM_Object, containing the created vertex.
9537 # Example: see GEOM_TestMeasures.py
9538 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9539 # note: auto-publishing is done in self.GetVertexByIndex()
9540 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9541 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9544 ## Get a normale to the given face. If the point is not given,
9545 # the normale is calculated at the center of mass.
9546 # @param theFace Face to define normale of.
9547 # @param theOptionalPoint Point to compute the normale at.
9548 # @param theName Object name; when specified, this parameter is used
9549 # for result publication in the study. Otherwise, if automatic
9550 # publication is switched on, default value is used for result name.
9552 # @return New GEOM.GEOM_Object, containing the created vector.
9554 # @ref swig_todo "Example"
9555 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9557 Get a normale to the given face. If the point is not given,
9558 the normale is calculated at the center of mass.
9561 theFace Face to define normale of.
9562 theOptionalPoint Point to compute the normale at.
9563 theName Object name; when specified, this parameter is used
9564 for result publication in the study. Otherwise, if automatic
9565 publication is switched on, default value is used for result name.
9568 New GEOM.GEOM_Object, containing the created vector.
9570 # Example: see GEOM_TestMeasures.py
9571 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9572 RaiseIfFailed("GetNormal", self.MeasuOp)
9573 self._autoPublish(anObj, theName, "normal")
9576 ## Check a topology of the given shape.
9577 # @param theShape Shape to check validity of.
9578 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9579 # if TRUE, the shape's geometry will be checked also.
9580 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9581 # of problem is printed.
9582 # if TRUE and if theShape is invalid, the description
9583 # of problem is also returned.
9584 # @return TRUE, if the shape "seems to be valid".
9586 # @ref tui_measurement_tools_page "Example"
9587 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9589 Check a topology of the given shape.
9592 theShape Shape to check validity of.
9593 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9594 if TRUE, the shape's geometry will be checked also.
9595 theReturnStatus If FALSE and if theShape is invalid, a description
9596 of problem is printed.
9597 if TRUE and if theShape is invalid, the description
9598 of problem is returned.
9601 TRUE, if the shape "seems to be valid".
9602 If theShape is invalid, prints a description of problem.
9603 This description can also be returned.
9605 # Example: see GEOM_TestMeasures.py
9607 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9608 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9610 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9611 RaiseIfFailed("CheckShape", self.MeasuOp)
9613 if theReturnStatus == 0:
9615 if theReturnStatus == 1:
9616 return (IsValid, Status)
9619 ## Detect self-intersections in the given shape.
9620 # @param theShape Shape to check.
9621 # @return TRUE, if the shape contains no self-intersections.
9623 # @ref tui_measurement_tools_page "Example"
9624 def CheckSelfIntersections(self, theShape):
9626 Detect self-intersections in the given shape.
9629 theShape Shape to check.
9632 TRUE, if the shape contains no self-intersections.
9634 # Example: see GEOM_TestMeasures.py
9635 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9636 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9639 ## Get position (LCS) of theShape.
9641 # Origin of the LCS is situated at the shape's center of mass.
9642 # Axes of the LCS are obtained from shape's location or,
9643 # if the shape is a planar face, from position of its plane.
9645 # @param theShape Shape to calculate position of.
9646 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9647 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9648 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9649 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9651 # @ref swig_todo "Example"
9652 def GetPosition(self,theShape):
9654 Get position (LCS) of theShape.
9655 Origin of the LCS is situated at the shape's center of mass.
9656 Axes of the LCS are obtained from shape's location or,
9657 if the shape is a planar face, from position of its plane.
9660 theShape Shape to calculate position of.
9663 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9664 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9665 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9666 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9668 # Example: see GEOM_TestMeasures.py
9669 aTuple = self.MeasuOp.GetPosition(theShape)
9670 RaiseIfFailed("GetPosition", self.MeasuOp)
9673 ## Get kind of theShape.
9675 # @param theShape Shape to get a kind of.
9676 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9677 # and a list of parameters, describing the shape.
9678 # @note Concrete meaning of each value, returned via \a theIntegers
9679 # or \a theDoubles list depends on the kind() of the shape.
9681 # @ref swig_todo "Example"
9682 def KindOfShape(self,theShape):
9684 Get kind of theShape.
9687 theShape Shape to get a kind of.
9690 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9691 and a list of parameters, describing the shape.
9693 Concrete meaning of each value, returned via theIntegers
9694 or theDoubles list depends on the geompy.kind of the shape
9696 # Example: see GEOM_TestMeasures.py
9697 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9698 RaiseIfFailed("KindOfShape", self.MeasuOp)
9700 aKind = aRoughTuple[0]
9701 anInts = aRoughTuple[1]
9702 aDbls = aRoughTuple[2]
9704 # Now there is no exception from this rule:
9705 aKindTuple = [aKind] + aDbls + anInts
9707 # If they are we will regroup parameters for such kind of shape.
9709 #if aKind == kind.SOME_KIND:
9710 # # SOME_KIND int int double int double double
9711 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9718 ## @addtogroup l2_import_export
9721 ## Import a shape from the BREP or IGES or STEP file
9722 # (depends on given format) with given name.
9723 # @param theFileName The file, containing the shape.
9724 # @param theFormatName Specify format for the file reading.
9725 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9726 # If format 'IGES_SCALE' is used instead of 'IGES' or
9727 # format 'STEP_SCALE' is used instead of 'STEP',
9728 # length unit will be set to 'meter' and result model will be scaled.
9729 # @param theName Object name; when specified, this parameter is used
9730 # for result publication in the study. Otherwise, if automatic
9731 # publication is switched on, default value is used for result name.
9733 # @return New GEOM.GEOM_Object, containing the imported shape.
9735 # @ref swig_Import_Export "Example"
9736 def ImportFile(self, theFileName, theFormatName, theName=None):
9738 Import a shape from the BREP or IGES or STEP file
9739 (depends on given format) with given name.
9742 theFileName The file, containing the shape.
9743 theFormatName Specify format for the file reading.
9744 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9745 If format 'IGES_SCALE' is used instead of 'IGES' or
9746 format 'STEP_SCALE' is used instead of 'STEP',
9747 length unit will be set to 'meter' and result model will be scaled.
9748 theName Object name; when specified, this parameter is used
9749 for result publication in the study. Otherwise, if automatic
9750 publication is switched on, default value is used for result name.
9753 New GEOM.GEOM_Object, containing the imported shape.
9755 # Example: see GEOM_TestOthers.py
9756 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9757 RaiseIfFailed("ImportFile", self.InsertOp)
9758 self._autoPublish(anObj, theName, "imported")
9761 ## Deprecated analog of ImportFile()
9762 def Import(self, theFileName, theFormatName, theName=None):
9764 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9766 print "WARNING: Function Import is deprecated, use ImportFile instead"
9767 # note: auto-publishing is done in self.ImportFile()
9768 return self.ImportFile(theFileName, theFormatName, theName)
9770 ## Shortcut to ImportFile() for BREP format.
9771 # Import a shape from the BREP file with given name.
9772 # @param theFileName The file, containing the shape.
9773 # @param theName Object name; when specified, this parameter is used
9774 # for result publication in the study. Otherwise, if automatic
9775 # publication is switched on, default value is used for result name.
9777 # @return New GEOM.GEOM_Object, containing the imported shape.
9779 # @ref swig_Import_Export "Example"
9780 def ImportBREP(self, theFileName, theName=None):
9782 geompy.ImportFile(...) function for BREP format
9783 Import a shape from the BREP file with given name.
9786 theFileName The file, containing the shape.
9787 theName Object name; when specified, this parameter is used
9788 for result publication in the study. Otherwise, if automatic
9789 publication is switched on, default value is used for result name.
9792 New GEOM.GEOM_Object, containing the imported shape.
9794 # Example: see GEOM_TestOthers.py
9795 # note: auto-publishing is done in self.ImportFile()
9796 return self.ImportFile(theFileName, "BREP", theName)
9798 ## Shortcut to ImportFile() for IGES format
9799 # Import a shape from the IGES file with given name.
9800 # @param theFileName The file, containing the shape.
9801 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9802 # and result model will be scaled, if its units are not meters.
9803 # If False (default), file length units will be taken into account.
9804 # @param theName Object name; when specified, this parameter is used
9805 # for result publication in the study. Otherwise, if automatic
9806 # publication is switched on, default value is used for result name.
9808 # @return New GEOM.GEOM_Object, containing the imported shape.
9810 # @ref swig_Import_Export "Example"
9811 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9813 geompy.ImportFile(...) function for IGES format
9816 theFileName The file, containing the shape.
9817 ignoreUnits If True, file length units will be ignored (set to 'meter')
9818 and result model will be scaled, if its units are not meters.
9819 If False (default), file length units will be taken into account.
9820 theName Object name; when specified, this parameter is used
9821 for result publication in the study. Otherwise, if automatic
9822 publication is switched on, default value is used for result name.
9825 New GEOM.GEOM_Object, containing the imported shape.
9827 # Example: see GEOM_TestOthers.py
9828 # note: auto-publishing is done in self.ImportFile()
9830 return self.ImportFile(theFileName, "IGES_SCALE", theName)
9831 return self.ImportFile(theFileName, "IGES", theName)
9833 ## Return length unit from given IGES file
9834 # @param theFileName The file, containing the shape.
9835 # @return String, containing the units name.
9837 # @ref swig_Import_Export "Example"
9838 def GetIGESUnit(self, theFileName):
9840 Return length units from given IGES file
9843 theFileName The file, containing the shape.
9846 String, containing the units name.
9848 # Example: see GEOM_TestOthers.py
9849 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
9852 ## Shortcut to ImportFile() for STEP format
9853 # Import a shape from the STEP file with given name.
9854 # @param theFileName The file, containing the shape.
9855 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9856 # and result model will be scaled, if its units are not meters.
9857 # If False (default), file length units will be taken into account.
9858 # @param theName Object name; when specified, this parameter is used
9859 # for result publication in the study. Otherwise, if automatic
9860 # publication is switched on, default value is used for result name.
9862 # @return New GEOM.GEOM_Object, containing the imported shape.
9864 # @ref swig_Import_Export "Example"
9865 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
9867 geompy.ImportFile(...) function for STEP format
9870 theFileName The file, containing the shape.
9871 ignoreUnits If True, file length units will be ignored (set to 'meter')
9872 and result model will be scaled, if its units are not meters.
9873 If False (default), file length units will be taken into account.
9874 theName Object name; when specified, this parameter is used
9875 for result publication in the study. Otherwise, if automatic
9876 publication is switched on, default value is used for result name.
9879 New GEOM.GEOM_Object, containing the imported shape.
9881 # Example: see GEOM_TestOthers.py
9882 # note: auto-publishing is done in self.ImportFile()
9884 return self.ImportFile(theFileName, "STEP_SCALE", theName)
9885 return self.ImportFile(theFileName, "STEP", theName)
9887 ## Return length unit from given IGES or STEP file
9888 # @param theFileName The file, containing the shape.
9889 # @return String, containing the units name.
9891 # @ref swig_Import_Export "Example"
9892 def GetSTEPUnit(self, theFileName):
9894 Return length units from given STEP file
9897 theFileName The file, containing the shape.
9900 String, containing the units name.
9902 # Example: see GEOM_TestOthers.py
9903 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
9906 ## Read a shape from the binary stream, containing its bounding representation (BRep).
9907 # @note This method will not be dumped to the python script by DumpStudy functionality.
9908 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
9909 # @param theStream The BRep binary stream.
9910 # @param theName Object name; when specified, this parameter is used
9911 # for result publication in the study. Otherwise, if automatic
9912 # publication is switched on, default value is used for result name.
9914 # @return New GEOM_Object, containing the shape, read from theStream.
9916 # @ref swig_Import_Export "Example"
9917 def RestoreShape (self, theStream, theName=None):
9919 Read a shape from the binary stream, containing its bounding representation (BRep).
9922 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
9925 theStream The BRep binary stream.
9926 theName Object name; when specified, this parameter is used
9927 for result publication in the study. Otherwise, if automatic
9928 publication is switched on, default value is used for result name.
9931 New GEOM_Object, containing the shape, read from theStream.
9933 # Example: see GEOM_TestOthers.py
9934 anObj = self.InsertOp.RestoreShape(theStream)
9935 RaiseIfFailed("RestoreShape", self.InsertOp)
9936 self._autoPublish(anObj, theName, "restored")
9939 ## Export the given shape into a file with given name.
9940 # @param theObject Shape to be stored in the file.
9941 # @param theFileName Name of the file to store the given shape in.
9942 # @param theFormatName Specify format for the shape storage.
9943 # Available formats can be obtained with
9944 # geompy.InsertOp.ExportTranslators()[0] method.
9946 # @ref swig_Import_Export "Example"
9947 def Export(self, theObject, theFileName, theFormatName):
9949 Export the given shape into a file with given name.
9952 theObject Shape to be stored in the file.
9953 theFileName Name of the file to store the given shape in.
9954 theFormatName Specify format for the shape storage.
9955 Available formats can be obtained with
9956 geompy.InsertOp.ExportTranslators()[0] method.
9958 # Example: see GEOM_TestOthers.py
9959 self.InsertOp.Export(theObject, theFileName, theFormatName)
9960 if self.InsertOp.IsDone() == 0:
9961 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
9965 ## Shortcut to Export() for BREP format
9967 # @ref swig_Import_Export "Example"
9968 def ExportBREP(self,theObject, theFileName):
9970 geompy.Export(...) function for BREP format
9972 # Example: see GEOM_TestOthers.py
9973 return self.Export(theObject, theFileName, "BREP")
9975 ## Shortcut to Export() for IGES format
9977 # @ref swig_Import_Export "Example"
9978 def ExportIGES(self,theObject, theFileName):
9980 geompy.Export(...) function for IGES format
9982 # Example: see GEOM_TestOthers.py
9983 return self.Export(theObject, theFileName, "IGES")
9985 ## Shortcut to Export() for STEP format
9987 # @ref swig_Import_Export "Example"
9988 def ExportSTEP(self,theObject, theFileName):
9990 geompy.Export(...) function for STEP format
9992 # Example: see GEOM_TestOthers.py
9993 return self.Export(theObject, theFileName, "STEP")
9995 # end of l2_import_export
9998 ## @addtogroup l3_blocks
10001 ## Create a quadrangle face from four edges. Order of Edges is not
10002 # important. It is not necessary that edges share the same vertex.
10003 # @param E1,E2,E3,E4 Edges for the face bound.
10004 # @param theName Object name; when specified, this parameter is used
10005 # for result publication in the study. Otherwise, if automatic
10006 # publication is switched on, default value is used for result name.
10008 # @return New GEOM.GEOM_Object, containing the created face.
10010 # @ref tui_building_by_blocks_page "Example"
10011 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10013 Create a quadrangle face from four edges. Order of Edges is not
10014 important. It is not necessary that edges share the same vertex.
10017 E1,E2,E3,E4 Edges for the face bound.
10018 theName Object name; when specified, this parameter is used
10019 for result publication in the study. Otherwise, if automatic
10020 publication is switched on, default value is used for result name.
10023 New GEOM.GEOM_Object, containing the created face.
10026 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10028 # Example: see GEOM_Spanner.py
10029 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10030 RaiseIfFailed("MakeQuad", self.BlocksOp)
10031 self._autoPublish(anObj, theName, "quad")
10034 ## Create a quadrangle face on two edges.
10035 # The missing edges will be built by creating the shortest ones.
10036 # @param E1,E2 Two opposite edges for the face.
10037 # @param theName Object name; when specified, this parameter is used
10038 # for result publication in the study. Otherwise, if automatic
10039 # publication is switched on, default value is used for result name.
10041 # @return New GEOM.GEOM_Object, containing the created face.
10043 # @ref tui_building_by_blocks_page "Example"
10044 def MakeQuad2Edges(self, E1, E2, theName=None):
10046 Create a quadrangle face on two edges.
10047 The missing edges will be built by creating the shortest ones.
10050 E1,E2 Two opposite edges for the face.
10051 theName Object name; when specified, this parameter is used
10052 for result publication in the study. Otherwise, if automatic
10053 publication is switched on, default value is used for result name.
10056 New GEOM.GEOM_Object, containing the created face.
10060 p1 = geompy.MakeVertex( 0., 0., 0.)
10061 p2 = geompy.MakeVertex(150., 30., 0.)
10062 p3 = geompy.MakeVertex( 0., 120., 50.)
10063 p4 = geompy.MakeVertex( 0., 40., 70.)
10065 edge1 = geompy.MakeEdge(p1, p2)
10066 edge2 = geompy.MakeEdge(p3, p4)
10067 # create a quadrangle face from two edges
10068 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10070 # Example: see GEOM_Spanner.py
10071 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10072 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10073 self._autoPublish(anObj, theName, "quad")
10076 ## Create a quadrangle face with specified corners.
10077 # The missing edges will be built by creating the shortest ones.
10078 # @param V1,V2,V3,V4 Corner vertices for the face.
10079 # @param theName Object name; when specified, this parameter is used
10080 # for result publication in the study. Otherwise, if automatic
10081 # publication is switched on, default value is used for result name.
10083 # @return New GEOM.GEOM_Object, containing the created face.
10085 # @ref tui_building_by_blocks_page "Example 1"
10086 # \n @ref swig_MakeQuad4Vertices "Example 2"
10087 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10089 Create a quadrangle face with specified corners.
10090 The missing edges will be built by creating the shortest ones.
10093 V1,V2,V3,V4 Corner vertices for the face.
10094 theName Object name; when specified, this parameter is used
10095 for result publication in the study. Otherwise, if automatic
10096 publication is switched on, default value is used for result name.
10099 New GEOM.GEOM_Object, containing the created face.
10103 p1 = geompy.MakeVertex( 0., 0., 0.)
10104 p2 = geompy.MakeVertex(150., 30., 0.)
10105 p3 = geompy.MakeVertex( 0., 120., 50.)
10106 p4 = geompy.MakeVertex( 0., 40., 70.)
10107 # create a quadrangle from four points in its corners
10108 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10110 # Example: see GEOM_Spanner.py
10111 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10112 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10113 self._autoPublish(anObj, theName, "quad")
10116 ## Create a hexahedral solid, bounded by the six given faces. Order of
10117 # faces is not important. It is not necessary that Faces share the same edge.
10118 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10119 # @param theName Object name; when specified, this parameter is used
10120 # for result publication in the study. Otherwise, if automatic
10121 # publication is switched on, default value is used for result name.
10123 # @return New GEOM.GEOM_Object, containing the created solid.
10125 # @ref tui_building_by_blocks_page "Example 1"
10126 # \n @ref swig_MakeHexa "Example 2"
10127 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10129 Create a hexahedral solid, bounded by the six given faces. Order of
10130 faces is not important. It is not necessary that Faces share the same edge.
10133 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10134 theName Object name; when specified, this parameter is used
10135 for result publication in the study. Otherwise, if automatic
10136 publication is switched on, default value is used for result name.
10139 New GEOM.GEOM_Object, containing the created solid.
10142 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10144 # Example: see GEOM_Spanner.py
10145 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10146 RaiseIfFailed("MakeHexa", self.BlocksOp)
10147 self._autoPublish(anObj, theName, "hexa")
10150 ## Create a hexahedral solid between two given faces.
10151 # The missing faces will be built by creating the smallest ones.
10152 # @param F1,F2 Two opposite faces for the hexahedral solid.
10153 # @param theName Object name; when specified, this parameter is used
10154 # for result publication in the study. Otherwise, if automatic
10155 # publication is switched on, default value is used for result name.
10157 # @return New GEOM.GEOM_Object, containing the created solid.
10159 # @ref tui_building_by_blocks_page "Example 1"
10160 # \n @ref swig_MakeHexa2Faces "Example 2"
10161 def MakeHexa2Faces(self, F1, F2, theName=None):
10163 Create a hexahedral solid between two given faces.
10164 The missing faces will be built by creating the smallest ones.
10167 F1,F2 Two opposite faces for the hexahedral solid.
10168 theName Object name; when specified, this parameter is used
10169 for result publication in the study. Otherwise, if automatic
10170 publication is switched on, default value is used for result name.
10173 New GEOM.GEOM_Object, containing the created solid.
10176 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10178 # Example: see GEOM_Spanner.py
10179 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10180 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10181 self._autoPublish(anObj, theName, "hexa")
10187 ## @addtogroup l3_blocks_op
10190 ## Get a vertex, found in the given shape by its coordinates.
10191 # @param theShape Block or a compound of blocks.
10192 # @param theX,theY,theZ Coordinates of the sought vertex.
10193 # @param theEpsilon Maximum allowed distance between the resulting
10194 # vertex and point with the given coordinates.
10195 # @param theName Object name; when specified, this parameter is used
10196 # for result publication in the study. Otherwise, if automatic
10197 # publication is switched on, default value is used for result name.
10199 # @return New GEOM.GEOM_Object, containing the found vertex.
10201 # @ref swig_GetPoint "Example"
10202 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10204 Get a vertex, found in the given shape by its coordinates.
10207 theShape Block or a compound of blocks.
10208 theX,theY,theZ Coordinates of the sought vertex.
10209 theEpsilon Maximum allowed distance between the resulting
10210 vertex and point with the given coordinates.
10211 theName Object name; when specified, this parameter is used
10212 for result publication in the study. Otherwise, if automatic
10213 publication is switched on, default value is used for result name.
10216 New GEOM.GEOM_Object, containing the found vertex.
10219 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10221 # Example: see GEOM_TestOthers.py
10222 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10223 RaiseIfFailed("GetPoint", self.BlocksOp)
10224 self._autoPublish(anObj, theName, "vertex")
10227 ## Find a vertex of the given shape, which has minimal distance to the given point.
10228 # @param theShape Any shape.
10229 # @param thePoint Point, close to the desired vertex.
10230 # @param 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.
10234 # @return New GEOM.GEOM_Object, containing the found vertex.
10236 # @ref swig_GetVertexNearPoint "Example"
10237 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10239 Find a vertex of the given shape, which has minimal distance to the given point.
10242 theShape Any shape.
10243 thePoint Point, close to the desired vertex.
10244 theName Object name; when specified, this parameter is used
10245 for result publication in the study. Otherwise, if automatic
10246 publication is switched on, default value is used for result name.
10249 New GEOM.GEOM_Object, containing the found vertex.
10252 pmidle = geompy.MakeVertex(50, 0, 50)
10253 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10255 # Example: see GEOM_TestOthers.py
10256 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10257 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10258 self._autoPublish(anObj, theName, "vertex")
10261 ## Get an edge, found in the given shape by two given vertices.
10262 # @param theShape Block or a compound of blocks.
10263 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10264 # @param theName Object name; when specified, this parameter is used
10265 # for result publication in the study. Otherwise, if automatic
10266 # publication is switched on, default value is used for result name.
10268 # @return New GEOM.GEOM_Object, containing the found edge.
10270 # @ref swig_GetEdge "Example"
10271 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10273 Get an edge, found in the given shape by two given vertices.
10276 theShape Block or a compound of blocks.
10277 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10278 theName Object name; when specified, this parameter is used
10279 for result publication in the study. Otherwise, if automatic
10280 publication is switched on, default value is used for result name.
10283 New GEOM.GEOM_Object, containing the found edge.
10285 # Example: see GEOM_Spanner.py
10286 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10287 RaiseIfFailed("GetEdge", self.BlocksOp)
10288 self._autoPublish(anObj, theName, "edge")
10291 ## Find an edge of the given shape, which has minimal distance to the given point.
10292 # @param theShape Block or a compound of blocks.
10293 # @param thePoint Point, close to the desired edge.
10294 # @param theName Object name; when specified, this parameter is used
10295 # for result publication in the study. Otherwise, if automatic
10296 # publication is switched on, default value is used for result name.
10298 # @return New GEOM.GEOM_Object, containing the found edge.
10300 # @ref swig_GetEdgeNearPoint "Example"
10301 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10303 Find an edge of the given shape, which has minimal distance to the given point.
10306 theShape Block or a compound of blocks.
10307 thePoint Point, close to the desired edge.
10308 theName Object name; when specified, this parameter is used
10309 for result publication in the study. Otherwise, if automatic
10310 publication is switched on, default value is used for result name.
10313 New GEOM.GEOM_Object, containing the found edge.
10315 # Example: see GEOM_TestOthers.py
10316 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10317 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10318 self._autoPublish(anObj, theName, "edge")
10321 ## Returns a face, found in the given shape by four given corner vertices.
10322 # @param theShape Block or a compound of blocks.
10323 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10324 # @param theName Object name; when specified, this parameter is used
10325 # for result publication in the study. Otherwise, if automatic
10326 # publication is switched on, default value is used for result name.
10328 # @return New GEOM.GEOM_Object, containing the found face.
10330 # @ref swig_todo "Example"
10331 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10333 Returns a face, found in the given shape by four given corner vertices.
10336 theShape Block or a compound of blocks.
10337 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10338 theName Object name; when specified, this parameter is used
10339 for result publication in the study. Otherwise, if automatic
10340 publication is switched on, default value is used for result name.
10343 New GEOM.GEOM_Object, containing the found face.
10345 # Example: see GEOM_Spanner.py
10346 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10347 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10348 self._autoPublish(anObj, theName, "face")
10351 ## Get a face of block, found in the given shape by two given edges.
10352 # @param theShape Block or a compound of blocks.
10353 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10354 # @param theName Object name; when specified, this parameter is used
10355 # for result publication in the study. Otherwise, if automatic
10356 # publication is switched on, default value is used for result name.
10358 # @return New GEOM.GEOM_Object, containing the found face.
10360 # @ref swig_todo "Example"
10361 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10363 Get a face of block, found in the given shape by two given edges.
10366 theShape Block or a compound of blocks.
10367 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10368 theName Object name; when specified, this parameter is used
10369 for result publication in the study. Otherwise, if automatic
10370 publication is switched on, default value is used for result name.
10373 New GEOM.GEOM_Object, containing the found face.
10375 # Example: see GEOM_Spanner.py
10376 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10377 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10378 self._autoPublish(anObj, theName, "face")
10381 ## Find a face, opposite to the given one in the given block.
10382 # @param theBlock Must be a hexahedral solid.
10383 # @param theFace Face of \a theBlock, opposite to the desired face.
10384 # @param theName Object name; when specified, this parameter is used
10385 # for result publication in the study. Otherwise, if automatic
10386 # publication is switched on, default value is used for result name.
10388 # @return New GEOM.GEOM_Object, containing the found face.
10390 # @ref swig_GetOppositeFace "Example"
10391 def GetOppositeFace(self, theBlock, theFace, theName=None):
10393 Find a face, opposite to the given one in the given block.
10396 theBlock Must be a hexahedral solid.
10397 theFace Face of theBlock, opposite to the desired face.
10398 theName Object name; when specified, this parameter is used
10399 for result publication in the study. Otherwise, if automatic
10400 publication is switched on, default value is used for result name.
10403 New GEOM.GEOM_Object, containing the found face.
10405 # Example: see GEOM_Spanner.py
10406 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10407 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10408 self._autoPublish(anObj, theName, "face")
10411 ## Find a face of the given shape, which has minimal distance to the given point.
10412 # @param theShape Block or a compound of blocks.
10413 # @param thePoint Point, close to the desired face.
10414 # @param theName Object name; when specified, this parameter is used
10415 # for result publication in the study. Otherwise, if automatic
10416 # publication is switched on, default value is used for result name.
10418 # @return New GEOM.GEOM_Object, containing the found face.
10420 # @ref swig_GetFaceNearPoint "Example"
10421 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10423 Find a face of the given shape, which has minimal distance to the given point.
10426 theShape Block or a compound of blocks.
10427 thePoint Point, close to the desired face.
10428 theName Object name; when specified, this parameter is used
10429 for result publication in the study. Otherwise, if automatic
10430 publication is switched on, default value is used for result name.
10433 New GEOM.GEOM_Object, containing the found face.
10435 # Example: see GEOM_Spanner.py
10436 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10437 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10438 self._autoPublish(anObj, theName, "face")
10441 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10442 # @param theBlock Block or a compound of blocks.
10443 # @param theVector Vector, close to the normale of the desired face.
10444 # @param theName Object name; when specified, this parameter is used
10445 # for result publication in the study. Otherwise, if automatic
10446 # publication is switched on, default value is used for result name.
10448 # @return New GEOM.GEOM_Object, containing the found face.
10450 # @ref swig_todo "Example"
10451 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10453 Find a face of block, whose outside normale has minimal angle with the given vector.
10456 theBlock Block or a compound of blocks.
10457 theVector Vector, close to the normale of the desired face.
10458 theName Object name; when specified, this parameter is used
10459 for result publication in the study. Otherwise, if automatic
10460 publication is switched on, default value is used for result name.
10463 New GEOM.GEOM_Object, containing the found face.
10465 # Example: see GEOM_Spanner.py
10466 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10467 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10468 self._autoPublish(anObj, theName, "face")
10471 ## Find all sub-shapes of type \a theShapeType of the given shape,
10472 # which have minimal distance to the given point.
10473 # @param theShape Any shape.
10474 # @param thePoint Point, close to the desired shape.
10475 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10476 # @param theTolerance The tolerance for distances comparison. All shapes
10477 # with distances to the given point in interval
10478 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10479 # @param theName Object name; when specified, this parameter is used
10480 # for result publication in the study. Otherwise, if automatic
10481 # publication is switched on, default value is used for result name.
10483 # @return New GEOM_Object, containing a group of all found shapes.
10485 # @ref swig_GetShapesNearPoint "Example"
10486 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10488 Find all sub-shapes of type theShapeType of the given shape,
10489 which have minimal distance to the given point.
10492 theShape Any shape.
10493 thePoint Point, close to the desired shape.
10494 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10495 theTolerance The tolerance for distances comparison. All shapes
10496 with distances to the given point in interval
10497 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10498 theName Object name; when specified, this parameter is used
10499 for result publication in the study. Otherwise, if automatic
10500 publication is switched on, default value is used for result name.
10503 New GEOM_Object, containing a group of all found shapes.
10505 # Example: see GEOM_TestOthers.py
10506 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10507 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10508 self._autoPublish(anObj, theName, "group")
10511 # end of l3_blocks_op
10514 ## @addtogroup l4_blocks_measure
10517 ## Check, if the compound of blocks is given.
10518 # To be considered as a compound of blocks, the
10519 # given shape must satisfy the following conditions:
10520 # - Each element of the compound should be a Block (6 faces and 12 edges).
10521 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10522 # - The compound should be connexe.
10523 # - The glue between two quadrangle faces should be applied.
10524 # @param theCompound The compound to check.
10525 # @return TRUE, if the given shape is a compound of blocks.
10526 # If theCompound is not valid, prints all discovered errors.
10528 # @ref tui_measurement_tools_page "Example 1"
10529 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10530 def CheckCompoundOfBlocks(self,theCompound):
10532 Check, if the compound of blocks is given.
10533 To be considered as a compound of blocks, the
10534 given shape must satisfy the following conditions:
10535 - Each element of the compound should be a Block (6 faces and 12 edges).
10536 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10537 - The compound should be connexe.
10538 - The glue between two quadrangle faces should be applied.
10541 theCompound The compound to check.
10544 TRUE, if the given shape is a compound of blocks.
10545 If theCompound is not valid, prints all discovered errors.
10547 # Example: see GEOM_Spanner.py
10548 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10549 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10551 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10555 ## Retrieve all non blocks solids and faces from \a theShape.
10556 # @param theShape The shape to explore.
10557 # @param theName Object name; when specified, this parameter is used
10558 # for result publication in the study. Otherwise, if automatic
10559 # publication is switched on, default value is used for result name.
10561 # @return A tuple of two GEOM_Objects. The first object is a group of all
10562 # non block solids (= not 6 faces, or with 6 faces, but with the
10563 # presence of non-quadrangular faces). The second object is a
10564 # group of all non quadrangular faces.
10566 # @ref tui_measurement_tools_page "Example 1"
10567 # \n @ref swig_GetNonBlocks "Example 2"
10568 def GetNonBlocks (self, theShape, theName=None):
10570 Retrieve all non blocks solids and faces from theShape.
10573 theShape The shape to explore.
10574 theName Object name; when specified, this parameter is used
10575 for result publication in the study. Otherwise, if automatic
10576 publication is switched on, default value is used for result name.
10579 A tuple of two GEOM_Objects. The first object is a group of all
10580 non block solids (= not 6 faces, or with 6 faces, but with the
10581 presence of non-quadrangular faces). The second object is a
10582 group of all non quadrangular faces.
10585 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10587 # Example: see GEOM_Spanner.py
10588 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10589 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10590 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10593 ## Remove all seam and degenerated edges from \a theShape.
10594 # Unite faces and edges, sharing one surface. It means that
10595 # this faces must have references to one C++ surface object (handle).
10596 # @param theShape The compound or single solid to remove irregular edges from.
10597 # @param doUnionFaces If True, then unite faces. If False (the default value),
10598 # do not unite faces.
10599 # @param theName Object name; when specified, this parameter is used
10600 # for result publication in the study. Otherwise, if automatic
10601 # publication is switched on, default value is used for result name.
10603 # @return Improved shape.
10605 # @ref swig_RemoveExtraEdges "Example"
10606 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10608 Remove all seam and degenerated edges from theShape.
10609 Unite faces and edges, sharing one surface. It means that
10610 this faces must have references to one C++ surface object (handle).
10613 theShape The compound or single solid to remove irregular edges from.
10614 doUnionFaces If True, then unite faces. If False (the default value),
10615 do not unite faces.
10616 theName Object name; when specified, this parameter is used
10617 for result publication in the study. Otherwise, if automatic
10618 publication is switched on, default value is used for result name.
10623 # Example: see GEOM_TestOthers.py
10624 nbFacesOptimum = -1 # -1 means do not unite faces
10625 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10626 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10627 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10628 self._autoPublish(anObj, theName, "removeExtraEdges")
10631 ## Check, if the given shape is a blocks compound.
10632 # Fix all detected errors.
10633 # \note Single block can be also fixed by this method.
10634 # @param theShape The compound to check and improve.
10635 # @param theName Object name; when specified, this parameter is used
10636 # for result publication in the study. Otherwise, if automatic
10637 # publication is switched on, default value is used for result name.
10639 # @return Improved compound.
10641 # @ref swig_CheckAndImprove "Example"
10642 def CheckAndImprove(self, theShape, theName=None):
10644 Check, if the given shape is a blocks compound.
10645 Fix all detected errors.
10648 Single block can be also fixed by this method.
10651 theShape The compound to check and improve.
10652 theName Object name; when specified, this parameter is used
10653 for result publication in the study. Otherwise, if automatic
10654 publication is switched on, default value is used for result name.
10659 # Example: see GEOM_TestOthers.py
10660 anObj = self.BlocksOp.CheckAndImprove(theShape)
10661 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10662 self._autoPublish(anObj, theName, "improved")
10665 # end of l4_blocks_measure
10668 ## @addtogroup l3_blocks_op
10671 ## Get all the blocks, contained in the given compound.
10672 # @param theCompound The compound to explode.
10673 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10674 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10675 # @param theName Object name; when specified, this parameter is used
10676 # for result publication in the study. Otherwise, if automatic
10677 # publication is switched on, default value is used for result name.
10679 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10681 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10683 # @ref tui_explode_on_blocks "Example 1"
10684 # \n @ref swig_MakeBlockExplode "Example 2"
10685 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10687 Get all the blocks, contained in the given compound.
10690 theCompound The compound to explode.
10691 theMinNbFaces If solid has lower number of faces, it is not a block.
10692 theMaxNbFaces If solid has higher number of faces, it is not a block.
10693 theName Object name; when specified, this parameter is used
10694 for result publication in the study. Otherwise, if automatic
10695 publication is switched on, default value is used for result name.
10698 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10701 List of GEOM.GEOM_Object, containing the retrieved blocks.
10703 # Example: see GEOM_TestOthers.py
10704 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10705 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10706 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10707 for anObj in aList:
10708 anObj.SetParameters(Parameters)
10710 self._autoPublish(aList, theName, "block")
10713 ## Find block, containing the given point inside its volume or on boundary.
10714 # @param theCompound Compound, to find block in.
10715 # @param thePoint Point, close to the desired block. If the point lays on
10716 # boundary between some blocks, we return block with nearest center.
10717 # @param theName Object name; when specified, this parameter is used
10718 # for result publication in the study. Otherwise, if automatic
10719 # publication is switched on, default value is used for result name.
10721 # @return New GEOM.GEOM_Object, containing the found block.
10723 # @ref swig_todo "Example"
10724 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10726 Find block, containing the given point inside its volume or on boundary.
10729 theCompound Compound, to find block in.
10730 thePoint Point, close to the desired block. If the point lays on
10731 boundary between some blocks, we return block with nearest center.
10732 theName Object name; when specified, this parameter is used
10733 for result publication in the study. Otherwise, if automatic
10734 publication is switched on, default value is used for result name.
10737 New GEOM.GEOM_Object, containing the found block.
10739 # Example: see GEOM_Spanner.py
10740 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10741 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10742 self._autoPublish(anObj, theName, "block")
10745 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10746 # @param theCompound Compound, to find block in.
10747 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10748 # @param theName Object name; when specified, this parameter is used
10749 # for result publication in the study. Otherwise, if automatic
10750 # publication is switched on, default value is used for result name.
10752 # @return New GEOM.GEOM_Object, containing the found block.
10754 # @ref swig_GetBlockByParts "Example"
10755 def GetBlockByParts(self, theCompound, theParts, theName=None):
10757 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10760 theCompound Compound, to find block in.
10761 theParts List of faces and/or edges and/or vertices to be parts of the found block.
10762 theName Object name; when specified, this parameter is used
10763 for result publication in the study. Otherwise, if automatic
10764 publication is switched on, default value is used for result name.
10767 New GEOM_Object, containing the found block.
10769 # Example: see GEOM_TestOthers.py
10770 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10771 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10772 self._autoPublish(anObj, theName, "block")
10775 ## Return all blocks, containing all the elements, passed as the parts.
10776 # @param theCompound Compound, to find blocks in.
10777 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10778 # @param theName Object name; when specified, this parameter is used
10779 # for result publication in the study. Otherwise, if automatic
10780 # publication is switched on, default value is used for result name.
10782 # @return List of GEOM.GEOM_Object, containing the found blocks.
10784 # @ref swig_todo "Example"
10785 def GetBlocksByParts(self, theCompound, theParts, theName=None):
10787 Return all blocks, containing all the elements, passed as the parts.
10790 theCompound Compound, to find blocks in.
10791 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10792 theName Object name; when specified, this parameter is used
10793 for result publication in the study. Otherwise, if automatic
10794 publication is switched on, default value is used for result name.
10797 List of GEOM.GEOM_Object, containing the found blocks.
10799 # Example: see GEOM_Spanner.py
10800 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
10801 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
10802 self._autoPublish(aList, theName, "block")
10805 ## Multi-transformate block and glue the result.
10806 # Transformation is defined so, as to superpose direction faces.
10807 # @param Block Hexahedral solid to be multi-transformed.
10808 # @param DirFace1 ID of First direction face.
10809 # @param DirFace2 ID of Second direction face.
10810 # @param NbTimes Quantity of transformations to be done.
10811 # @param theName Object name; when specified, this parameter is used
10812 # for result publication in the study. Otherwise, if automatic
10813 # publication is switched on, default value is used for result name.
10815 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10817 # @return New GEOM.GEOM_Object, containing the result shape.
10819 # @ref tui_multi_transformation "Example"
10820 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
10822 Multi-transformate block and glue the result.
10823 Transformation is defined so, as to superpose direction faces.
10826 Block Hexahedral solid to be multi-transformed.
10827 DirFace1 ID of First direction face.
10828 DirFace2 ID of Second direction face.
10829 NbTimes Quantity of transformations to be done.
10830 theName Object name; when specified, this parameter is used
10831 for result publication in the study. Otherwise, if automatic
10832 publication is switched on, default value is used for result name.
10835 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10838 New GEOM.GEOM_Object, containing the result shape.
10840 # Example: see GEOM_Spanner.py
10841 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
10842 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
10843 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
10844 anObj.SetParameters(Parameters)
10845 self._autoPublish(anObj, theName, "transformed")
10848 ## Multi-transformate block and glue the result.
10849 # @param Block Hexahedral solid to be multi-transformed.
10850 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
10851 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
10852 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
10853 # @param theName Object name; when specified, this parameter is used
10854 # for result publication in the study. Otherwise, if automatic
10855 # publication is switched on, default value is used for result name.
10857 # @return New GEOM.GEOM_Object, containing the result shape.
10859 # @ref tui_multi_transformation "Example"
10860 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
10861 DirFace1V, DirFace2V, NbTimesV, theName=None):
10863 Multi-transformate block and glue the result.
10866 Block Hexahedral solid to be multi-transformed.
10867 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
10868 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
10869 NbTimesU,NbTimesV Quantity of transformations to be done.
10870 theName Object name; when specified, this parameter is used
10871 for result publication in the study. Otherwise, if automatic
10872 publication is switched on, default value is used for result name.
10875 New GEOM.GEOM_Object, containing the result shape.
10877 # Example: see GEOM_Spanner.py
10878 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
10879 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
10880 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
10881 DirFace1V, DirFace2V, NbTimesV)
10882 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
10883 anObj.SetParameters(Parameters)
10884 self._autoPublish(anObj, theName, "transformed")
10887 ## Build all possible propagation groups.
10888 # Propagation group is a set of all edges, opposite to one (main)
10889 # edge of this group directly or through other opposite edges.
10890 # Notion of Opposite Edge make sence only on quadrangle face.
10891 # @param theShape Shape to build propagation groups on.
10892 # @param theName Object name; when specified, this parameter is used
10893 # for result publication in the study. Otherwise, if automatic
10894 # publication is switched on, default value is used for result name.
10896 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
10898 # @ref swig_Propagate "Example"
10899 def Propagate(self, theShape, theName=None):
10901 Build all possible propagation groups.
10902 Propagation group is a set of all edges, opposite to one (main)
10903 edge of this group directly or through other opposite edges.
10904 Notion of Opposite Edge make sence only on quadrangle face.
10907 theShape Shape to build propagation groups on.
10908 theName Object name; when specified, this parameter is used
10909 for result publication in the study. Otherwise, if automatic
10910 publication is switched on, default value is used for result name.
10913 List of GEOM.GEOM_Object, each of them is a propagation group.
10915 # Example: see GEOM_TestOthers.py
10916 listChains = self.BlocksOp.Propagate(theShape)
10917 RaiseIfFailed("Propagate", self.BlocksOp)
10918 self._autoPublish(listChains, theName, "propagate")
10921 # end of l3_blocks_op
10924 ## @addtogroup l3_groups
10927 ## Creates a new group which will store sub-shapes of theMainShape
10928 # @param theMainShape is a GEOM object on which the group is selected
10929 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
10930 # @param theName Object name; when specified, this parameter is used
10931 # for result publication in the study. Otherwise, if automatic
10932 # publication is switched on, default value is used for result name.
10934 # @return a newly created GEOM group (GEOM.GEOM_Object)
10936 # @ref tui_working_with_groups_page "Example 1"
10937 # \n @ref swig_CreateGroup "Example 2"
10938 def CreateGroup(self, theMainShape, theShapeType, theName=None):
10940 Creates a new group which will store sub-shapes of theMainShape
10943 theMainShape is a GEOM object on which the group is selected
10944 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
10945 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
10946 theName Object name; when specified, this parameter is used
10947 for result publication in the study. Otherwise, if automatic
10948 publication is switched on, default value is used for result name.
10951 a newly created GEOM group
10954 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
10957 # Example: see GEOM_TestOthers.py
10958 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
10959 RaiseIfFailed("CreateGroup", self.GroupOp)
10960 self._autoPublish(anObj, theName, "group")
10963 ## Adds a sub-object with ID theSubShapeId to the group
10964 # @param theGroup is a GEOM group to which the new sub-shape is added
10965 # @param theSubShapeID is a sub-shape ID in the main object.
10966 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
10968 # @ref tui_working_with_groups_page "Example"
10969 def AddObject(self,theGroup, theSubShapeID):
10971 Adds a sub-object with ID theSubShapeId to the group
10974 theGroup is a GEOM group to which the new sub-shape is added
10975 theSubShapeID is a sub-shape ID in the main object.
10978 Use method GetSubShapeID() to get an unique ID of the sub-shape
10980 # Example: see GEOM_TestOthers.py
10981 self.GroupOp.AddObject(theGroup, theSubShapeID)
10982 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
10983 RaiseIfFailed("AddObject", self.GroupOp)
10987 ## Removes a sub-object with ID \a theSubShapeId from the group
10988 # @param theGroup is a GEOM group from which the new sub-shape is removed
10989 # @param theSubShapeID is a sub-shape ID in the main object.
10990 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
10992 # @ref tui_working_with_groups_page "Example"
10993 def RemoveObject(self,theGroup, theSubShapeID):
10995 Removes a sub-object with ID theSubShapeId from the group
10998 theGroup is a GEOM group from which the new sub-shape is removed
10999 theSubShapeID is a sub-shape ID in the main object.
11002 Use method GetSubShapeID() to get an unique ID of the sub-shape
11004 # Example: see GEOM_TestOthers.py
11005 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11006 RaiseIfFailed("RemoveObject", self.GroupOp)
11009 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11010 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11011 # @param theSubShapes is a list of sub-shapes to be added.
11013 # @ref tui_working_with_groups_page "Example"
11014 def UnionList (self,theGroup, theSubShapes):
11016 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11019 theGroup is a GEOM group to which the new sub-shapes are added.
11020 theSubShapes is a list of sub-shapes to be added.
11022 # Example: see GEOM_TestOthers.py
11023 self.GroupOp.UnionList(theGroup, theSubShapes)
11024 RaiseIfFailed("UnionList", self.GroupOp)
11027 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11028 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11029 # @param theSubShapes is a list of indices of sub-shapes to be added.
11031 # @ref swig_UnionIDs "Example"
11032 def UnionIDs(self,theGroup, theSubShapes):
11034 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11037 theGroup is a GEOM group to which the new sub-shapes are added.
11038 theSubShapes is a list of indices of sub-shapes to be added.
11040 # Example: see GEOM_TestOthers.py
11041 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11042 RaiseIfFailed("UnionIDs", self.GroupOp)
11045 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11046 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11047 # @param theSubShapes is a list of sub-shapes to be removed.
11049 # @ref tui_working_with_groups_page "Example"
11050 def DifferenceList (self,theGroup, theSubShapes):
11052 Removes from the group all the given shapes. No errors, if some shapes are not included.
11055 theGroup is a GEOM group from which the sub-shapes are removed.
11056 theSubShapes is a list of sub-shapes to be removed.
11058 # Example: see GEOM_TestOthers.py
11059 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11060 RaiseIfFailed("DifferenceList", self.GroupOp)
11063 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11064 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11065 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11067 # @ref swig_DifferenceIDs "Example"
11068 def DifferenceIDs(self,theGroup, theSubShapes):
11070 Removes from the group all the given shapes. No errors, if some shapes are not included.
11073 theGroup is a GEOM group from which the sub-shapes are removed.
11074 theSubShapes is a list of indices of sub-shapes to be removed.
11076 # Example: see GEOM_TestOthers.py
11077 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11078 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11081 ## Union of two groups.
11082 # New group is created. It will contain all entities
11083 # which are present in groups theGroup1 and theGroup2.
11084 # @param theGroup1, theGroup2 are the initial GEOM groups
11085 # to create the united group from.
11086 # @param 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.
11090 # @return a newly created GEOM group.
11092 # @ref tui_union_groups_anchor "Example"
11093 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11095 Union of two groups.
11096 New group is created. It will contain all entities
11097 which are present in groups theGroup1 and theGroup2.
11100 theGroup1, theGroup2 are the initial GEOM groups
11101 to create the united group from.
11102 theName Object name; when specified, this parameter is used
11103 for result publication in the study. Otherwise, if automatic
11104 publication is switched on, default value is used for result name.
11107 a newly created GEOM group.
11109 # Example: see GEOM_TestOthers.py
11110 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11111 RaiseIfFailed("UnionGroups", self.GroupOp)
11112 self._autoPublish(aGroup, theName, "group")
11115 ## Intersection of two groups.
11116 # New group is created. It will contain only those entities
11117 # which are present in both groups theGroup1 and theGroup2.
11118 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11119 # @param theName Object name; when specified, this parameter is used
11120 # for result publication in the study. Otherwise, if automatic
11121 # publication is switched on, default value is used for result name.
11123 # @return a newly created GEOM group.
11125 # @ref tui_intersect_groups_anchor "Example"
11126 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11128 Intersection of two groups.
11129 New group is created. It will contain only those entities
11130 which are present in both groups theGroup1 and theGroup2.
11133 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11134 theName Object name; when specified, this parameter is used
11135 for result publication in the study. Otherwise, if automatic
11136 publication is switched on, default value is used for result name.
11139 a newly created GEOM group.
11141 # Example: see GEOM_TestOthers.py
11142 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11143 RaiseIfFailed("IntersectGroups", self.GroupOp)
11144 self._autoPublish(aGroup, theName, "group")
11147 ## Cut of two groups.
11148 # New group is created. It will contain entities which are
11149 # present in group theGroup1 but are not present in group theGroup2.
11150 # @param theGroup1 is a GEOM group to include elements of.
11151 # @param theGroup2 is a GEOM group to exclude elements of.
11152 # @param 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.
11156 # @return a newly created GEOM group.
11158 # @ref tui_cut_groups_anchor "Example"
11159 def CutGroups (self, theGroup1, theGroup2, theName=None):
11162 New group is created. It will contain entities which are
11163 present in group theGroup1 but are not present in group theGroup2.
11166 theGroup1 is a GEOM group to include elements of.
11167 theGroup2 is a GEOM group to exclude elements of.
11168 theName Object name; when specified, this parameter is used
11169 for result publication in the study. Otherwise, if automatic
11170 publication is switched on, default value is used for result name.
11173 a newly created GEOM group.
11175 # Example: see GEOM_TestOthers.py
11176 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11177 RaiseIfFailed("CutGroups", self.GroupOp)
11178 self._autoPublish(aGroup, theName, "group")
11181 ## Union of list of groups.
11182 # New group is created. It will contain all entities that are
11183 # present in groups listed in theGList.
11184 # @param theGList is a list of GEOM groups to create the united group from.
11185 # @param theName Object name; when specified, this parameter is used
11186 # for result publication in the study. Otherwise, if automatic
11187 # publication is switched on, default value is used for result name.
11189 # @return a newly created GEOM group.
11191 # @ref tui_union_groups_anchor "Example"
11192 def UnionListOfGroups (self, theGList, theName=None):
11194 Union of list of groups.
11195 New group is created. It will contain all entities that are
11196 present in groups listed in theGList.
11199 theGList is a list of GEOM groups to create the united group from.
11200 theName Object name; when specified, this parameter is used
11201 for result publication in the study. Otherwise, if automatic
11202 publication is switched on, default value is used for result name.
11205 a newly created GEOM group.
11207 # Example: see GEOM_TestOthers.py
11208 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11209 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11210 self._autoPublish(aGroup, theName, "group")
11213 ## Cut of lists of groups.
11214 # New group is created. It will contain only entities
11215 # which are present in groups listed in theGList1 but
11216 # are not present in groups from theGList2.
11217 # @param theGList1 is a list of GEOM groups to include elements of.
11218 # @param theGList2 is a list of GEOM groups to exclude elements of.
11219 # @param theName Object name; when specified, this parameter is used
11220 # for result publication in the study. Otherwise, if automatic
11221 # publication is switched on, default value is used for result name.
11223 # @return a newly created GEOM group.
11225 # @ref tui_intersect_groups_anchor "Example"
11226 def IntersectListOfGroups (self, theGList, theName=None):
11228 Cut of lists of groups.
11229 New group is created. It will contain only entities
11230 which are present in groups listed in theGList1 but
11231 are not present in groups from theGList2.
11234 theGList1 is a list of GEOM groups to include elements of.
11235 theGList2 is a list of GEOM groups to exclude elements of.
11236 theName Object name; when specified, this parameter is used
11237 for result publication in the study. Otherwise, if automatic
11238 publication is switched on, default value is used for result name.
11241 a newly created GEOM group.
11243 # Example: see GEOM_TestOthers.py
11244 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11245 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11246 self._autoPublish(aGroup, theName, "group")
11249 ## Cut of lists of groups.
11250 # New group is created. It will contain only entities
11251 # which are present in groups listed in theGList1 but
11252 # are not present in groups from theGList2.
11253 # @param theGList1 is a list of GEOM groups to include elements of.
11254 # @param theGList2 is a list of GEOM groups to exclude elements of.
11255 # @param theName Object name; when specified, this parameter is used
11256 # for result publication in the study. Otherwise, if automatic
11257 # publication is switched on, default value is used for result name.
11259 # @return a newly created GEOM group.
11261 # @ref tui_cut_groups_anchor "Example"
11262 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11264 Cut of lists of groups.
11265 New group is created. It will contain only entities
11266 which are present in groups listed in theGList1 but
11267 are not present in groups from theGList2.
11270 theGList1 is a list of GEOM groups to include elements of.
11271 theGList2 is a list of GEOM groups to exclude elements of.
11272 theName Object name; when specified, this parameter is used
11273 for result publication in the study. Otherwise, if automatic
11274 publication is switched on, default value is used for result name.
11277 a newly created GEOM group.
11279 # Example: see GEOM_TestOthers.py
11280 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11281 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11282 self._autoPublish(aGroup, theName, "group")
11285 ## Returns a list of sub-objects ID stored in the group
11286 # @param theGroup is a GEOM group for which a list of IDs is requested
11288 # @ref swig_GetObjectIDs "Example"
11289 def GetObjectIDs(self,theGroup):
11291 Returns a list of sub-objects ID stored in the group
11294 theGroup is a GEOM group for which a list of IDs is requested
11296 # Example: see GEOM_TestOthers.py
11297 ListIDs = self.GroupOp.GetObjects(theGroup)
11298 RaiseIfFailed("GetObjects", self.GroupOp)
11301 ## Returns a type of sub-objects stored in the group
11302 # @param theGroup is a GEOM group which type is returned.
11304 # @ref swig_GetType "Example"
11305 def GetType(self,theGroup):
11307 Returns a type of sub-objects stored in the group
11310 theGroup is a GEOM group which type is returned.
11312 # Example: see GEOM_TestOthers.py
11313 aType = self.GroupOp.GetType(theGroup)
11314 RaiseIfFailed("GetType", self.GroupOp)
11317 ## Convert a type of geom object from id to string value
11318 # @param theId is a GEOM obect type id.
11319 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11320 # @ref swig_GetType "Example"
11321 def ShapeIdToType(self, theId):
11323 Convert a type of geom object from id to string value
11326 theId is a GEOM obect type id.
11329 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11356 return "REVOLUTION"
11404 return "FREE_BOUNDS"
11412 return "THRUSECTIONS"
11414 return "COMPOUNDFILTER"
11416 return "SHAPES_ON_SHAPE"
11418 return "ELLIPSE_ARC"
11420 return "3DSKETCHER"
11426 return "PIPETSHAPE"
11427 return "Shape Id not exist."
11429 ## Returns a main shape associated with the group
11430 # @param theGroup is a GEOM group for which a main shape object is requested
11431 # @return a GEOM object which is a main shape for theGroup
11433 # @ref swig_GetMainShape "Example"
11434 def GetMainShape(self,theGroup):
11436 Returns a main shape associated with the group
11439 theGroup is a GEOM group for which a main shape object is requested
11442 a GEOM object which is a main shape for theGroup
11444 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11446 # Example: see GEOM_TestOthers.py
11447 anObj = self.GroupOp.GetMainShape(theGroup)
11448 RaiseIfFailed("GetMainShape", self.GroupOp)
11451 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11452 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11453 # @param theShape given shape (see GEOM.GEOM_Object)
11454 # @param min_length minimum length of edges of theShape
11455 # @param max_length maximum length of edges of theShape
11456 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11457 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11458 # @param theName Object name; when specified, this parameter is used
11459 # for result publication in the study. Otherwise, if automatic
11460 # publication is switched on, default value is used for result name.
11462 # @return a newly created GEOM group of edges
11464 # @@ref swig_todo "Example"
11465 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11467 Create group of edges of theShape, whose length is in range [min_length, max_length].
11468 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11471 theShape given shape
11472 min_length minimum length of edges of theShape
11473 max_length maximum length of edges of theShape
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)
11476 theName Object name; when specified, this parameter is used
11477 for result publication in the study. Otherwise, if automatic
11478 publication is switched on, default value is used for result name.
11481 a newly created GEOM group of edges.
11483 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11484 edges_in_range = []
11486 Props = self.BasicProperties(edge)
11487 if min_length <= Props[0] and Props[0] <= max_length:
11488 if (not include_min) and (min_length == Props[0]):
11491 if (not include_max) and (Props[0] == max_length):
11494 edges_in_range.append(edge)
11496 if len(edges_in_range) <= 0:
11497 print "No edges found by given criteria"
11500 # note: auto-publishing is done in self.CreateGroup()
11501 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11502 self.UnionList(group_edges, edges_in_range)
11506 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11507 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11508 # @param min_length minimum length of edges of selected shape
11509 # @param max_length maximum length of edges of selected shape
11510 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11511 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11512 # @return a newly created GEOM group of edges
11513 # @ref swig_todo "Example"
11514 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11516 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11517 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11520 min_length minimum length of edges of selected shape
11521 max_length maximum length of edges of selected shape
11522 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11523 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11526 a newly created GEOM group of edges.
11528 nb_selected = sg.SelectedCount()
11529 if nb_selected < 1:
11530 print "Select a shape before calling this function, please."
11532 if nb_selected > 1:
11533 print "Only one shape must be selected"
11536 id_shape = sg.getSelected(0)
11537 shape = IDToObject( id_shape )
11539 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11543 if include_min: left_str = " <= "
11544 if include_max: right_str = " <= "
11546 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11547 + left_str + "length" + right_str + `max_length`)
11549 sg.updateObjBrowser(1)
11556 ## @addtogroup l4_advanced
11559 ## Create a T-shape object with specified caracteristics for the main
11560 # and the incident pipes (radius, width, half-length).
11561 # The extremities of the main pipe are located on junctions points P1 and P2.
11562 # The extremity of the incident pipe is located on junction point P3.
11563 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11564 # the main plane of the T-shape is XOY.
11566 # @param theR1 Internal radius of main pipe
11567 # @param theW1 Width of main pipe
11568 # @param theL1 Half-length of main pipe
11569 # @param theR2 Internal radius of incident pipe (R2 < R1)
11570 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11571 # @param theL2 Half-length of incident pipe
11573 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11574 # @param theP1 1st junction point of main pipe
11575 # @param theP2 2nd junction point of main pipe
11576 # @param theP3 Junction point of incident pipe
11578 # @param theRL Internal radius of left thickness reduction
11579 # @param theWL Width of left thickness reduction
11580 # @param theLtransL Length of left transition part
11581 # @param theLthinL Length of left thin part
11583 # @param theRR Internal radius of right thickness reduction
11584 # @param theWR Width of right thickness reduction
11585 # @param theLtransR Length of right transition part
11586 # @param theLthinR Length of right thin part
11588 # @param theRI Internal radius of incident thickness reduction
11589 # @param theWI Width of incident thickness reduction
11590 # @param theLtransI Length of incident transition part
11591 # @param theLthinI Length of incident thin part
11593 # @param theName Object name; when specified, this parameter is used
11594 # for result publication in the study. Otherwise, if automatic
11595 # publication is switched on, default value is used for result name.
11597 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11599 # @ref tui_creation_pipetshape "Example"
11600 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11601 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11602 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11603 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11604 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11607 Create a T-shape object with specified caracteristics for the main
11608 and the incident pipes (radius, width, half-length).
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 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11622 theP1 1st junction point of main pipe
11623 theP2 2nd junction point of main pipe
11624 theP3 Junction point of incident pipe
11626 theRL Internal radius of left thickness reduction
11627 theWL Width of left thickness reduction
11628 theLtransL Length of left transition part
11629 theLthinL Length of left thin part
11631 theRR Internal radius of right thickness reduction
11632 theWR Width of right thickness reduction
11633 theLtransR Length of right transition part
11634 theLthinR Length of right thin part
11636 theRI Internal radius of incident thickness reduction
11637 theWI Width of incident thickness reduction
11638 theLtransI Length of incident transition part
11639 theLthinI Length of incident thin part
11641 theName Object name; when specified, this parameter is used
11642 for result publication in the study. Otherwise, if automatic
11643 publication is switched on, default value is used for result name.
11646 List of GEOM_Object, containing the created shape and propagation groups.
11649 # create PipeTShape object
11650 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11651 # create PipeTShape object with position
11652 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11653 # create PipeTShape object with left thickness reduction
11654 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11656 theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
11657 if (theP1 and theP2 and theP3):
11658 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11659 theRL, theWL, theLtransL, theLthinL,
11660 theRR, theWR, theLtransR, theLthinR,
11661 theRI, theWI, theLtransI, theLthinI,
11662 theHexMesh, theP1, theP2, theP3)
11664 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11665 theRL, theWL, theLtransL, theLthinL,
11666 theRR, theWR, theLtransR, theLthinR,
11667 theRI, theWI, theLtransI, theLthinI,
11669 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11670 if Parameters: anObj[0].SetParameters(Parameters)
11671 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11672 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11675 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11676 # and the incident pipes (radius, width, half-length). The chamfer is
11677 # created on the junction of the pipes.
11678 # The extremities of the main pipe are located on junctions points P1 and P2.
11679 # The extremity of the incident pipe is located on junction point P3.
11680 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11681 # the main plane of the T-shape is XOY.
11682 # @param theR1 Internal radius of main pipe
11683 # @param theW1 Width of main pipe
11684 # @param theL1 Half-length of main pipe
11685 # @param theR2 Internal radius of incident pipe (R2 < R1)
11686 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11687 # @param theL2 Half-length of incident pipe
11688 # @param theH Height of the chamfer.
11689 # @param theW Width of the chamfer.
11690 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11691 # @param theP1 1st junction point of main pipe
11692 # @param theP2 2nd junction point of main pipe
11693 # @param theP3 Junction point of incident pipe
11695 # @param theRL Internal radius of left thickness reduction
11696 # @param theWL Width of left thickness reduction
11697 # @param theLtransL Length of left transition part
11698 # @param theLthinL Length of left thin part
11700 # @param theRR Internal radius of right thickness reduction
11701 # @param theWR Width of right thickness reduction
11702 # @param theLtransR Length of right transition part
11703 # @param theLthinR Length of right thin part
11705 # @param theRI Internal radius of incident thickness reduction
11706 # @param theWI Width of incident thickness reduction
11707 # @param theLtransI Length of incident transition part
11708 # @param theLthinI Length of incident thin part
11710 # @param theName Object name; when specified, this parameter is used
11711 # for result publication in the study. Otherwise, if automatic
11712 # publication is switched on, default value is used for result name.
11714 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11716 # @ref tui_creation_pipetshape "Example"
11717 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11718 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11719 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11720 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11721 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11724 Create a T-shape object with chamfer and with specified caracteristics for the main
11725 and the incident pipes (radius, width, half-length). The chamfer is
11726 created on the junction of the pipes.
11727 The extremities of the main pipe are located on junctions points P1 and P2.
11728 The extremity of the incident pipe is located on junction point P3.
11729 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11730 the main plane of the T-shape is XOY.
11733 theR1 Internal radius of main pipe
11734 theW1 Width of main pipe
11735 theL1 Half-length of main pipe
11736 theR2 Internal radius of incident pipe (R2 < R1)
11737 theW2 Width of incident pipe (R2+W2 < R1+W1)
11738 theL2 Half-length of incident pipe
11739 theH Height of the chamfer.
11740 theW Width of the chamfer.
11741 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11742 theP1 1st junction point of main pipe
11743 theP2 2nd junction point of main pipe
11744 theP3 Junction point of incident pipe
11746 theRL Internal radius of left thickness reduction
11747 theWL Width of left thickness reduction
11748 theLtransL Length of left transition part
11749 theLthinL Length of left thin part
11751 theRR Internal radius of right thickness reduction
11752 theWR Width of right thickness reduction
11753 theLtransR Length of right transition part
11754 theLthinR Length of right thin part
11756 theRI Internal radius of incident thickness reduction
11757 theWI Width of incident thickness reduction
11758 theLtransI Length of incident transition part
11759 theLthinI Length of incident thin part
11761 theName Object name; when specified, this parameter is used
11762 for result publication in the study. Otherwise, if automatic
11763 publication is switched on, default value is used for result name.
11766 List of GEOM_Object, containing the created shape and propagation groups.
11769 # create PipeTShape with chamfer object
11770 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11771 # create PipeTShape with chamfer object with position
11772 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11773 # create PipeTShape with chamfer object with left thickness reduction
11774 pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11776 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
11777 if (theP1 and theP2 and theP3):
11778 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11779 theRL, theWL, theLtransL, theLthinL,
11780 theRR, theWR, theLtransR, theLthinR,
11781 theRI, theWI, theLtransI, theLthinI,
11782 theH, theW, theHexMesh, theP1, theP2, theP3)
11784 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
11785 theRL, theWL, theLtransL, theLthinL,
11786 theRR, theWR, theLtransR, theLthinR,
11787 theRI, theWI, theLtransI, theLthinI,
11788 theH, theW, theHexMesh)
11789 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
11790 if Parameters: anObj[0].SetParameters(Parameters)
11791 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11792 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11795 ## Create a T-shape object with fillet and with specified caracteristics for the main
11796 # and the incident pipes (radius, width, half-length). The fillet is
11797 # created on the junction of the pipes.
11798 # The extremities of the main pipe are located on junctions points P1 and P2.
11799 # The extremity of the incident pipe is located on junction point P3.
11800 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11801 # the main plane of the T-shape is XOY.
11802 # @param theR1 Internal radius of main pipe
11803 # @param theW1 Width of main pipe
11804 # @param theL1 Half-length of main pipe
11805 # @param theR2 Internal radius of incident pipe (R2 < R1)
11806 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11807 # @param theL2 Half-length of incident pipe
11808 # @param theRF Radius of curvature of fillet.
11809 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11810 # @param theP1 1st junction point of main pipe
11811 # @param theP2 2nd junction point of main pipe
11812 # @param theP3 Junction point of incident pipe
11814 # @param theRL Internal radius of left thickness reduction
11815 # @param theWL Width of left thickness reduction
11816 # @param theLtransL Length of left transition part
11817 # @param theLthinL Length of left thin part
11819 # @param theRR Internal radius of right thickness reduction
11820 # @param theWR Width of right thickness reduction
11821 # @param theLtransR Length of right transition part
11822 # @param theLthinR Length of right thin part
11824 # @param theRI Internal radius of incident thickness reduction
11825 # @param theWI Width of incident thickness reduction
11826 # @param theLtransI Length of incident transition part
11827 # @param theLthinI Length of incident thin part
11829 # @param theName Object name; when specified, this parameter is used
11830 # for result publication in the study. Otherwise, if automatic
11831 # publication is switched on, default value is used for result name.
11833 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11835 # @ref tui_creation_pipetshape "Example"
11836 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
11837 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11838 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11839 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11840 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11843 Create a T-shape object with fillet and with specified caracteristics for the main
11844 and the incident pipes (radius, width, half-length). The fillet is
11845 created on the junction of the pipes.
11846 The extremities of the main pipe are located on junctions points P1 and P2.
11847 The extremity of the incident pipe is located on junction point P3.
11850 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11851 the main plane of the T-shape is XOY.
11852 theR1 Internal radius of main pipe
11853 theW1 Width of main pipe
11854 heL1 Half-length of main pipe
11855 theR2 Internal radius of incident pipe (R2 < R1)
11856 theW2 Width of incident pipe (R2+W2 < R1+W1)
11857 theL2 Half-length of incident pipe
11858 theRF Radius of curvature of fillet.
11859 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11860 theP1 1st junction point of main pipe
11861 theP2 2nd junction point of main pipe
11862 theP3 Junction point of incident pipe
11864 theRL Internal radius of left thickness reduction
11865 theWL Width of left thickness reduction
11866 theLtransL Length of left transition part
11867 theLthinL Length of left thin part
11869 theRR Internal radius of right thickness reduction
11870 theWR Width of right thickness reduction
11871 theLtransR Length of right transition part
11872 theLthinR Length of right thin part
11874 theRI Internal radius of incident thickness reduction
11875 theWI Width of incident thickness reduction
11876 theLtransI Length of incident transition part
11877 theLthinI Length of incident thin part
11879 theName Object name; when specified, this parameter is used
11880 for result publication in the study. Otherwise, if automatic
11881 publication is switched on, default value is used for result name.
11884 List of GEOM_Object, containing the created shape and propagation groups.
11887 # create PipeTShape with fillet object
11888 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
11889 # create PipeTShape with fillet object with position
11890 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
11891 # create PipeTShape with fillet object with left thickness reduction
11892 pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11894 theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
11895 if (theP1 and theP2 and theP3):
11896 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11897 theRL, theWL, theLtransL, theLthinL,
11898 theRR, theWR, theLtransR, theLthinR,
11899 theRI, theWI, theLtransI, theLthinI,
11900 theRF, theHexMesh, theP1, theP2, theP3)
11902 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
11903 theRL, theWL, theLtransL, theLthinL,
11904 theRR, theWR, theLtransR, theLthinR,
11905 theRI, theWI, theLtransI, theLthinI,
11907 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
11908 if Parameters: anObj[0].SetParameters(Parameters)
11909 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11910 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11913 ## This function allows creating a disk already divided into blocks. It
11914 # can be used to create divided pipes for later meshing in hexaedra.
11915 # @param theR Radius of the disk
11916 # @param theOrientation Orientation of the plane on which the disk will be built
11917 # 1 = XOY, 2 = OYZ, 3 = OZX
11918 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11919 # @param theName Object name; when specified, this parameter is used
11920 # for result publication in the study. Otherwise, if automatic
11921 # publication is switched on, default value is used for result name.
11923 # @return New GEOM_Object, containing the created shape.
11925 # @ref tui_creation_divideddisk "Example"
11926 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
11928 Creates a disk, divided into blocks. It can be used to create divided pipes
11929 for later meshing in hexaedra.
11932 theR Radius of the disk
11933 theOrientation Orientation of the plane on which the disk will be built:
11934 1 = XOY, 2 = OYZ, 3 = OZX
11935 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11936 theName Object name; when specified, this parameter is used
11937 for result publication in the study. Otherwise, if automatic
11938 publication is switched on, default value is used for result name.
11941 New GEOM_Object, containing the created shape.
11943 theR, Parameters = ParseParameters(theR)
11944 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
11945 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
11946 if Parameters: anObj.SetParameters(Parameters)
11947 self._autoPublish(anObj, theName, "dividedDisk")
11950 ## This function allows creating a disk already divided into blocks. It
11951 # can be used to create divided pipes for later meshing in hexaedra.
11952 # @param theCenter Center of the disk
11953 # @param theVector Normal vector to the plane of the created disk
11954 # @param theRadius Radius of the disk
11955 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11956 # @param theName Object name; when specified, this parameter is used
11957 # for result publication in the study. Otherwise, if automatic
11958 # publication is switched on, default value is used for result name.
11960 # @return New GEOM_Object, containing the created shape.
11962 # @ref tui_creation_divideddisk "Example"
11963 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
11965 Creates a disk already divided into blocks. It can be used to create divided pipes
11966 for later meshing in hexaedra.
11969 theCenter Center of the disk
11970 theVector Normal vector to the plane of the created disk
11971 theRadius Radius of the disk
11972 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11973 theName Object name; when specified, this parameter is used
11974 for result publication in the study. Otherwise, if automatic
11975 publication is switched on, default value is used for result name.
11978 New GEOM_Object, containing the created shape.
11980 theRadius, Parameters = ParseParameters(theRadius)
11981 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
11982 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
11983 if Parameters: anObj.SetParameters(Parameters)
11984 self._autoPublish(anObj, theName, "dividedDisk")
11987 ## Builds a cylinder prepared for hexa meshes
11988 # @param theR Radius of the cylinder
11989 # @param theH Height of the cylinder
11990 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11991 # @param theName Object name; when specified, this parameter is used
11992 # for result publication in the study. Otherwise, if automatic
11993 # publication is switched on, default value is used for result name.
11995 # @return New GEOM_Object, containing the created shape.
11997 # @ref tui_creation_dividedcylinder "Example"
11998 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12000 Builds a cylinder prepared for hexa meshes
12003 theR Radius of the cylinder
12004 theH Height of the cylinder
12005 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12006 theName Object name; when specified, this parameter is used
12007 for result publication in the study. Otherwise, if automatic
12008 publication is switched on, default value is used for result name.
12011 New GEOM_Object, containing the created shape.
12013 theR, theH, Parameters = ParseParameters(theR, theH)
12014 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12015 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12016 if Parameters: anObj.SetParameters(Parameters)
12017 self._autoPublish(anObj, theName, "dividedCylinder")
12020 #@@ insert new functions before this line @@ do not remove this line @@#
12022 # end of l4_advanced
12025 ## Create a copy of the given object
12027 # @param theOriginal geometry object for copy
12028 # @param theName Object name; when specified, this parameter is used
12029 # for result publication in the study. Otherwise, if automatic
12030 # publication is switched on, default value is used for result name.
12032 # @return New GEOM_Object, containing the copied shape.
12034 # @ingroup l1_geompy_auxiliary
12035 # @ref swig_MakeCopy "Example"
12036 def MakeCopy(self, theOriginal, theName=None):
12038 Create a copy of the given object
12041 theOriginal geometry object for copy
12042 theName Object name; when specified, this parameter is used
12043 for result publication in the study. Otherwise, if automatic
12044 publication is switched on, default value is used for result name.
12047 New GEOM_Object, containing the copied shape.
12049 Example of usage: Copy = geompy.MakeCopy(Box)
12051 # Example: see GEOM_TestAll.py
12052 anObj = self.InsertOp.MakeCopy(theOriginal)
12053 RaiseIfFailed("MakeCopy", self.InsertOp)
12054 self._autoPublish(anObj, theName, "copy")
12057 ## Add Path to load python scripts from
12058 # @param Path a path to load python scripts from
12059 # @ingroup l1_geomBuilder_auxiliary
12060 def addPath(self,Path):
12062 Add Path to load python scripts from
12065 Path a path to load python scripts from
12067 if (sys.path.count(Path) < 1):
12068 sys.path.append(Path)
12072 ## Load marker texture from the file
12073 # @param Path a path to the texture file
12074 # @return unique texture identifier
12075 # @ingroup l1_geomBuilder_auxiliary
12076 def LoadTexture(self, Path):
12078 Load marker texture from the file
12081 Path a path to the texture file
12084 unique texture identifier
12086 # Example: see GEOM_TestAll.py
12087 ID = self.InsertOp.LoadTexture(Path)
12088 RaiseIfFailed("LoadTexture", self.InsertOp)
12091 ## Get internal name of the object based on its study entry
12092 # @note This method does not provide an unique identifier of the geometry object.
12093 # @note This is internal function of GEOM component, though it can be used outside it for
12094 # appropriate reason (e.g. for identification of geometry object).
12095 # @param obj geometry object
12096 # @return unique object identifier
12097 # @ingroup l1_geomBuilder_auxiliary
12098 def getObjectID(self, obj):
12100 Get internal name of the object based on its study entry.
12101 Note: this method does not provide an unique identifier of the geometry object.
12102 It is an internal function of GEOM component, though it can be used outside GEOM for
12103 appropriate reason (e.g. for identification of geometry object).
12106 obj geometry object
12109 unique object identifier
12112 entry = salome.ObjectToID(obj)
12113 if entry is not None:
12114 lst = entry.split(":")
12116 ID = lst[-1] # -1 means last item in the list
12117 return "GEOM_" + ID
12122 ## Add marker texture. @a Width and @a Height parameters
12123 # specify width and height of the texture in pixels.
12124 # If @a RowData is @c True, @a Texture parameter should represent texture data
12125 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12126 # parameter should be unpacked string, in which '1' symbols represent opaque
12127 # pixels and '0' represent transparent pixels of the texture bitmap.
12129 # @param Width texture width in pixels
12130 # @param Height texture height in pixels
12131 # @param Texture texture data
12132 # @param RowData if @c True, @a Texture data are packed in the byte stream
12133 # @return unique texture identifier
12134 # @ingroup l1_geomBuilder_auxiliary
12135 def AddTexture(self, Width, Height, Texture, RowData=False):
12137 Add marker texture. Width and Height parameters
12138 specify width and height of the texture in pixels.
12139 If RowData is True, Texture parameter should represent texture data
12140 packed into the byte array. If RowData is False (default), Texture
12141 parameter should be unpacked string, in which '1' symbols represent opaque
12142 pixels and '0' represent transparent pixels of the texture bitmap.
12145 Width texture width in pixels
12146 Height texture height in pixels
12147 Texture texture data
12148 RowData if True, Texture data are packed in the byte stream
12151 return unique texture identifier
12153 if not RowData: Texture = PackData(Texture)
12154 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12155 RaiseIfFailed("AddTexture", self.InsertOp)
12159 # Register the new proxy for GEOM_Gen
12160 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12162 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12163 # interface to GEOM operations.
12168 # salome.salome_init()
12169 # from salome.geom import geomBuilder
12170 # geompy = geomBuilder.New(salome.myStudy)
12172 # @param study SALOME study, generally obtained by salome.myStudy.
12173 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12174 # @return geomBuilder instance
12175 def New( study, instance=None):
12177 Create a new geomBuilder instance.The geomBuilder class provides the Python
12178 interface to GEOM operations.
12182 salome.salome_init()
12183 from salome.geom import geomBuilder
12184 geompy = geomBuilder.New(salome.myStudy)
12187 study SALOME study, generally obtained by salome.myStudy.
12188 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12190 geomBuilder instance
12192 #print "New geomBuilder ", study, instance
12199 geom = geomBuilder()
12200 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12201 geom.init_geom(study)