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 geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Not that some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## @theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
150 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
152 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
154 ## @defgroup l2_import_export Importing/exporting geometrical objects
155 ## @defgroup l2_creating Creating geometrical objects
157 ## @defgroup l3_basic_go Creating Basic Geometric Objects
159 ## @defgroup l4_curves Creating Curves
162 ## @defgroup l3_3d_primitives Creating 3D Primitives
163 ## @defgroup l3_complex Creating Complex Objects
164 ## @defgroup l3_groups Working with groups
165 ## @defgroup l3_blocks Building by blocks
167 ## @defgroup l4_blocks_measure Check and Improve
170 ## @defgroup l3_sketcher Sketcher
171 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
173 ## @defgroup l4_decompose Decompose objects
174 ## @defgroup l4_decompose_d Decompose objects deprecated methods
175 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
176 ## @defgroup l4_obtain Access to sub-shapes by a criteria
177 ## @defgroup l4_advanced Advanced objects creation functions
182 ## @defgroup l2_transforming Transforming geometrical objects
184 ## @defgroup l3_basic_op Basic Operations
185 ## @defgroup l3_boolean Boolean Operations
186 ## @defgroup l3_transform Transformation Operations
187 ## @defgroup l3_transform_d Transformation Operations deprecated methods
188 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
189 ## @defgroup l3_blocks_op Blocks Operations
190 ## @defgroup l3_healing Repairing Operations
191 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
194 ## @defgroup l2_measure Using measurement tools
198 # initialize SALOME session in try/except block
199 # to avoid problems in some cases, e.g. when generating documentation
207 from salome_notebook import *
213 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
216 def _toListOfNames(_names, _size=-1):
219 if type(_names) in [types.ListType, types.TupleType]:
220 for i in _names: l.append(i)
223 if l and len(l) < _size:
224 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
227 ## Raise an Error, containing the Method_name, if Operation is Failed
228 ## @ingroup l1_geomBuilder_auxiliary
229 def RaiseIfFailed (Method_name, Operation):
230 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
231 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
233 ## Return list of variables value from salome notebook
234 ## @ingroup l1_geomBuilder_auxiliary
235 def ParseParameters(*parameters):
238 for parameter in parameters:
239 if isinstance(parameter, list):
240 lResults = ParseParameters(*parameter)
241 if len(lResults) > 0:
242 Result.append(lResults[:-1])
243 StringResult += lResults[-1].split(":")
247 if isinstance(parameter,str):
248 if notebook.isVariable(parameter):
249 Result.append(notebook.get(parameter))
251 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
254 Result.append(parameter)
256 StringResult.append(str(parameter))
260 Result.append(":".join(StringResult))
262 Result = ":".join(StringResult)
265 ## Return list of variables value from salome notebook
266 ## @ingroup l1_geomBuilder_auxiliary
270 for parameter in list:
271 if isinstance(parameter,str) and notebook.isVariable(parameter):
272 Result.append(str(notebook.get(parameter)))
275 Result.append(str(parameter))
278 StringResult = StringResult + str(parameter)
279 StringResult = StringResult + ":"
281 StringResult = StringResult[:len(StringResult)-1]
282 return Result, StringResult
284 ## Return list of variables value from salome notebook
285 ## @ingroup l1_geomBuilder_auxiliary
286 def ParseSketcherCommand(command):
289 sections = command.split(":")
290 for section in sections:
291 parameters = section.split(" ")
293 for parameter in parameters:
294 if paramIndex > 1 and parameter.find("'") != -1:
295 parameter = parameter.replace("'","")
296 if notebook.isVariable(parameter):
297 Result = Result + str(notebook.get(parameter)) + " "
300 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
304 Result = Result + str(parameter) + " "
307 StringResult = StringResult + parameter
308 StringResult = StringResult + ":"
310 paramIndex = paramIndex + 1
312 Result = Result[:len(Result)-1] + ":"
314 Result = Result[:len(Result)-1]
315 return Result, StringResult
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 ## val = PackData("10001110") # val = 0xAE
323 ## val = PackData("1") # val = 0x80
325 ## @param data unpacked data - a string containing '1' and '0' symbols
326 ## @return data packed to the byte stream
327 ## @ingroup l1_geomBuilder_auxiliary
330 Helper function which can be used to pack the passed string to the byte data.
331 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
332 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
335 data unpacked data - a string containing '1' and '0' symbols
338 data packed to the byte stream
341 val = PackData("10001110") # val = 0xAE
342 val = PackData("1") # val = 0x80
345 if len(data)%8: bytes += 1
347 for b in range(bytes):
348 d = data[b*8:(b+1)*8]
353 if d[i] == "1": val += 1
355 raise "Invalid symbol %s" % d[i]
362 ## Read bitmap texture from the text file.
363 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
364 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
365 ## The function returns width and height of the pixmap in pixels and byte stream representing
366 ## texture bitmap itself.
368 ## This function can be used to read the texture to the byte stream in order to pass it to
369 ## the AddTexture() function of geomBuilder class.
372 ## from salome.geom import geomBuilder
373 ## geompy = geomBuilder.New(salome.myStudy)
374 ## texture = geompy.readtexture('mytexture.dat')
375 ## texture = geompy.AddTexture(*texture)
376 ## obj.SetMarkerTexture(texture)
378 ## @param fname texture file name
379 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
380 ## @ingroup l1_geomBuilder_auxiliary
381 def ReadTexture(fname):
383 Read bitmap texture from the text file.
384 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
385 A zero symbol ('0') represents transparent pixel of the texture bitmap.
386 The function returns width and height of the pixmap in pixels and byte stream representing
387 texture bitmap itself.
388 This function can be used to read the texture to the byte stream in order to pass it to
389 the AddTexture() function of geomBuilder class.
392 fname texture file name
395 sequence of tree values: texture's width, height in pixels and its byte stream
398 from salome.geom import geomBuilder
399 geompy = geomBuilder.New(salome.myStudy)
400 texture = geompy.readtexture('mytexture.dat')
401 texture = geompy.AddTexture(*texture)
402 obj.SetMarkerTexture(texture)
406 lines = [ l.strip() for l in f.readlines()]
409 if lines: maxlen = max([len(x) for x in lines])
411 if maxlen%8: lenbytes += 1
415 lenline = (len(line)/8+1)*8
418 lenline = (len(line)/8)*8
420 for i in range(lenline/8):
423 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
426 bytedata += PackData(byte)
428 for i in range(lenline/8, lenbytes):
429 bytedata += PackData("0")
431 return lenbytes*8, len(lines), bytedata
436 ## Returns a long value from enumeration type
437 # Can be used for CORBA enumerator types like GEOM.shape_type
438 # @param theItem enumeration type
439 # @ingroup l1_geomBuilder_auxiliary
440 def EnumToLong(theItem):
442 Returns a long value from enumeration type
443 Can be used for CORBA enumerator types like geomBuilder.ShapeType
446 theItem enumeration type
449 if hasattr(theItem, "_v"): ret = theItem._v
452 ## Information about closed/unclosed state of shell or wire
453 # @ingroup l1_geomBuilder_auxiliary
456 Information about closed/unclosed state of shell or wire
462 # Warning: geom is a singleton
468 class geomBuilder(object, GEOM._objref_GEOM_Gen):
470 ## Enumeration ShapeType as a dictionary. \n
471 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
472 # @ingroup l1_geomBuilder_auxiliary
473 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
475 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
476 # and a list of parameters, describing the shape.
477 # List of parameters, describing the shape:
478 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
479 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
481 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
483 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
485 # - SPHERE: [xc yc zc R]
486 # - CYLINDER: [xb yb zb dx dy dz R H]
487 # - BOX: [xc yc zc ax ay az]
488 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
489 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
490 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
491 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
492 # - SOLID: [nb_faces nb_edges nb_vertices]
494 # - SPHERE2D: [xc yc zc R]
495 # - CYLINDER2D: [xb yb zb dx dy dz R H]
496 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
497 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
498 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
499 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
500 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
501 # - PLANE: [xo yo zo dx dy dz]
502 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
503 # - FACE: [nb_edges nb_vertices]
505 # - CIRCLE: [xc yc zc dx dy dz R]
506 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
507 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
508 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
509 # - LINE: [xo yo zo dx dy dz]
510 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
511 # - EDGE: [nb_vertices]
514 # @ingroup l1_geomBuilder_auxiliary
515 kind = GEOM.GEOM_IKindOfShape
522 #print "==== __new__ ", engine, geom, doLcc, created
524 # geom engine is either retrieved from engine, or created
526 # Following test avoids a recursive loop
529 # geom engine not created: existing engine found
531 if doLcc and not created:
533 # FindOrLoadComponent called:
534 # 1. CORBA resolution of server
535 # 2. the __new__ method is called again
536 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
537 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
540 # FindOrLoadComponent not called
542 # geomBuilder instance is created from lcc.FindOrLoadComponent
543 #print "==== super ", engine, geom, doLcc, created
544 geom = super(geomBuilder,cls).__new__(cls)
547 # geom engine not created: existing engine found
548 #print "==== existing ", engine, geom, doLcc, created
550 #print "return geom 1 ", geom
553 #print "return geom 2 ", geom
558 #print "-------- geomBuilder __init__ --- ", created, self
561 GEOM._objref_GEOM_Gen.__init__(self)
562 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
563 self.myBuilder = None
582 ## Process object publication in the study, as follows:
583 # - if @a theName is specified (not None), the object is published in the study
584 # with this name, not taking into account "auto-publishing" option;
585 # - if @a theName is NOT specified, the object is published in the study
586 # (using default name, which can be customized using @a theDefaultName parameter)
587 # only if auto-publishing is switched on.
589 # @param theObj object, a subject for publishing
590 # @param theName object name for study
591 # @param theDefaultName default name for the auto-publishing
593 # @sa addToStudyAuto()
594 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
596 def _item_name(_names, _defname, _idx=-1):
597 if not _names: _names = _defname
598 if type(_names) in [types.ListType, types.TupleType]:
600 if _idx >= len(_names) or not _names[_idx]:
601 if type(_defname) not in [types.ListType, types.TupleType]:
602 _name = "%s_%d"%(_defname, _idx+1)
603 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
604 _name = _defname[_idx]
606 _name = "%noname_%d"%(dn, _idx+1)
612 # must be wrong usage
617 _name = "%s_%d"%(_names, _idx+1)
625 if not theName and not self.myMaxNbSubShapesAllowed:
626 return # nothing to do: auto-publishing is disabled
627 if not theName and not theDefaultName:
628 return # neither theName nor theDefaultName is given
630 if type(theObj) in [types.ListType, types.TupleType]:
631 # list of objects is being published
634 if not obj: continue # bad object
635 ###if obj.GetStudyEntry(): continue # already published
636 name = _item_name(theName, theDefaultName, idx)
637 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
638 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
640 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
643 if not theName and idx == self.myMaxNbSubShapesAllowed: break
647 # single object is published
648 ###if theObj.GetStudyEntry(): return # already published
649 name = _item_name(theName, theDefaultName)
650 if theObj.IsMainShape():
651 self.addToStudy(theObj, name)
653 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
658 ## @addtogroup l1_geomBuilder_auxiliary
660 def init_geom(self,theStudy):
661 self.myStudy = theStudy
662 self.myStudyId = self.myStudy._get_StudyId()
663 self.myBuilder = self.myStudy.NewBuilder()
664 self.father = self.myStudy.FindComponent("GEOM")
665 if self.father is None:
666 self.father = self.myBuilder.NewComponent("GEOM")
667 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
668 FName = A1._narrow(SALOMEDS.AttributeName)
669 FName.SetValue("Geometry")
670 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
671 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
672 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
673 self.myBuilder.DefineComponentInstance(self.father,self)
675 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
676 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
677 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
678 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
679 self.HealOp = self.GetIHealingOperations (self.myStudyId)
680 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
681 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
682 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
683 self.LocalOp = self.GetILocalOperations (self.myStudyId)
684 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
685 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
686 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
687 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
690 ## Enable / disable results auto-publishing
692 # The automatic publishing is managed in the following way:
693 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
694 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
695 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
696 # value passed as parameter has the same effect.
697 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
698 # maximum number of sub-shapes allowed for publishing is set to specified value.
700 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
701 # @ingroup l1_publish_data
702 def addToStudyAuto(self, maxNbSubShapes=-1):
704 Enable / disable results auto-publishing
706 The automatic publishing is managed in the following way:
707 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
708 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
709 maximum number of sub-shapes allowed for publishing is unlimited; any negative
710 value passed as parameter has the same effect.
711 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
712 maximum number of sub-shapes allowed for publishing is set to this value.
715 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
718 geompy.addToStudyAuto() # enable auto-publishing
719 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
720 geompy.addToStudyAuto(0) # disable auto-publishing
722 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
725 ## Dump component to the Python script
726 # This method overrides IDL function to allow default values for the parameters.
727 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
729 Dump component to the Python script
730 This method overrides IDL function to allow default values for the parameters.
732 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
734 ## Get name for sub-shape aSubObj of shape aMainObj
736 # @ref swig_SubShapeName "Example"
737 def SubShapeName(self,aSubObj, aMainObj):
739 Get name for sub-shape aSubObj of shape aMainObj
741 # Example: see GEOM_TestAll.py
743 #aSubId = orb.object_to_string(aSubObj)
744 #aMainId = orb.object_to_string(aMainObj)
745 #index = gg.getIndexTopology(aSubId, aMainId)
746 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
747 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
748 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
751 ## Publish in study aShape with name aName
753 # \param aShape the shape to be published
754 # \param aName the name for the shape
755 # \param doRestoreSubShapes if True, finds and publishes also
756 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
757 # and published sub-shapes of arguments
758 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
759 # these arguments description
760 # \return study entry of the published shape in form of string
762 # @ingroup l1_publish_data
763 # @ref swig_all_addtostudy "Example"
764 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
765 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
767 Publish in study aShape with name aName
770 aShape the shape to be published
771 aName the name for the shape
772 doRestoreSubShapes if True, finds and publishes also
773 sub-shapes of aShape, corresponding to its arguments
774 and published sub-shapes of arguments
775 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
776 these arguments description
779 study entry of the published shape in form of string
782 id_block1 = geompy.addToStudy(Block1, "Block 1")
784 # Example: see GEOM_TestAll.py
786 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
787 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
788 if doRestoreSubShapes:
789 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
790 theFindMethod, theInheritFirstArg, True )
792 print "addToStudy() failed"
794 return aShape.GetStudyEntry()
796 ## Publish in study aShape with name aName as sub-object of previously published aFather
797 # \param aFather previously published object
798 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
799 # \param aName the name for the shape
801 # \return study entry of the published shape in form of string
803 # @ingroup l1_publish_data
804 # @ref swig_all_addtostudyInFather "Example"
805 def addToStudyInFather(self, aFather, aShape, aName):
807 Publish in study aShape with name aName as sub-object of previously published aFather
810 aFather previously published object
811 aShape the shape to be published as sub-object of aFather
812 aName the name for the shape
815 study entry of the published shape in form of string
817 # Example: see GEOM_TestAll.py
819 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
820 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
822 print "addToStudyInFather() failed"
824 return aShape.GetStudyEntry()
826 ## Unpublish object in study
828 # \param obj the object to be unpublished
829 def hideInStudy(self, obj):
831 Unpublish object in study
834 obj the object to be unpublished
836 ior = salome.orb.object_to_string(obj)
837 aSObject = self.myStudy.FindObjectIOR(ior)
838 if aSObject is not None:
839 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
840 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
841 drwAttribute.SetDrawable(False)
844 # end of l1_geomBuilder_auxiliary
847 ## @addtogroup l3_restore_ss
850 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
851 # To be used from python scripts out of addToStudy() (non-default usage)
852 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
853 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
854 # If this list is empty, all operation arguments will be published
855 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
856 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
857 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
858 # Do not publish sub-shapes in place of arguments, but only
859 # in place of sub-shapes of the first argument,
860 # because the whole shape corresponds to the first argument.
861 # Mainly to be used after transformations, but it also can be
862 # usefull after partition with one object shape, and some other
863 # operations, where only the first argument has to be considered.
864 # If theObject has only one argument shape, this flag is automatically
865 # considered as True, not regarding really passed value.
866 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
867 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
868 # \return list of published sub-shapes
870 # @ref tui_restore_prs_params "Example"
871 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
872 theInheritFirstArg=False, theAddPrefix=True):
874 Publish sub-shapes, standing for arguments and sub-shapes of arguments
875 To be used from python scripts out of geompy.addToStudy (non-default usage)
878 theObject published GEOM.GEOM_Object, arguments of which will be published
879 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
880 If this list is empty, all operation arguments will be published
881 theFindMethod method to search sub-shapes, corresponding to arguments and
882 their sub-shapes. Value from enumeration GEOM.find_shape_method.
883 theInheritFirstArg set properties of the first argument for theObject.
884 Do not publish sub-shapes in place of arguments, but only
885 in place of sub-shapes of the first argument,
886 because the whole shape corresponds to the first argument.
887 Mainly to be used after transformations, but it also can be
888 usefull after partition with one object shape, and some other
889 operations, where only the first argument has to be considered.
890 If theObject has only one argument shape, this flag is automatically
891 considered as True, not regarding really passed value.
892 theAddPrefix add prefix "from_" to names of restored sub-shapes,
893 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
895 list of published sub-shapes
897 # Example: see GEOM_TestAll.py
898 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
899 theFindMethod, theInheritFirstArg, theAddPrefix)
901 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
902 # To be used from python scripts out of addToStudy() (non-default usage)
903 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
904 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
905 # If this list is empty, all operation arguments will be published
906 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
907 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
908 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
909 # Do not publish sub-shapes in place of arguments, but only
910 # in place of sub-shapes of the first argument,
911 # because the whole shape corresponds to the first argument.
912 # Mainly to be used after transformations, but it also can be
913 # usefull after partition with one object shape, and some other
914 # operations, where only the first argument has to be considered.
915 # If theObject has only one argument shape, this flag is automatically
916 # considered as True, not regarding really passed value.
917 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
918 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
919 # \return list of published sub-shapes
921 # @ref tui_restore_prs_params "Example"
922 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
923 theInheritFirstArg=False, theAddPrefix=True):
925 Publish sub-shapes, standing for arguments and sub-shapes of arguments
926 To be used from python scripts out of geompy.addToStudy() (non-default usage)
929 theObject published GEOM.GEOM_Object, arguments of which will be published
930 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
931 If this list is empty, all operation arguments will be published
932 theFindMethod method to search sub-shapes, corresponding to arguments and
933 their sub-shapes. Value from enumeration GEOM::find_shape_method.
934 theInheritFirstArg set properties of the first argument for theObject.
935 Do not publish sub-shapes in place of arguments, but only
936 in place of sub-shapes of the first argument,
937 because the whole shape corresponds to the first argument.
938 Mainly to be used after transformations, but it also can be
939 usefull after partition with one object shape, and some other
940 operations, where only the first argument has to be considered.
941 If theObject has only one argument shape, this flag is automatically
942 considered as True, not regarding really passed value.
943 theAddPrefix add prefix "from_" to names of restored sub-shapes,
944 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
947 list of published sub-shapes
949 # Example: see GEOM_TestAll.py
950 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
951 theFindMethod, theInheritFirstArg, theAddPrefix)
953 # end of l3_restore_ss
956 ## @addtogroup l3_basic_go
959 ## Create point by three coordinates.
960 # @param theX The X coordinate of the point.
961 # @param theY The Y coordinate of the point.
962 # @param theZ The Z coordinate of the point.
963 # @param theName Object name; when specified, this parameter is used
964 # for result publication in the study. Otherwise, if automatic
965 # publication is switched on, default value is used for result name.
967 # @return New GEOM.GEOM_Object, containing the created point.
969 # @ref tui_creation_point "Example"
970 def MakeVertex(self, theX, theY, theZ, theName=None):
972 Create point by three coordinates.
975 theX The X coordinate of the point.
976 theY The Y coordinate of the point.
977 theZ The Z coordinate of the point.
978 theName Object name; when specified, this parameter is used
979 for result publication in the study. Otherwise, if automatic
980 publication is switched on, default value is used for result name.
983 New GEOM.GEOM_Object, containing the created point.
985 # Example: see GEOM_TestAll.py
986 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
987 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
988 RaiseIfFailed("MakePointXYZ", self.BasicOp)
989 anObj.SetParameters(Parameters)
990 self._autoPublish(anObj, theName, "vertex")
993 ## Create a point, distant from the referenced point
994 # on the given distances along the coordinate axes.
995 # @param theReference The referenced point.
996 # @param theX Displacement from the referenced point along OX axis.
997 # @param theY Displacement from the referenced point along OY axis.
998 # @param theZ Displacement from the referenced point along OZ axis.
999 # @param theName Object name; when specified, this parameter is used
1000 # for result publication in the study. Otherwise, if automatic
1001 # publication is switched on, default value is used for result name.
1003 # @return New GEOM.GEOM_Object, containing the created point.
1005 # @ref tui_creation_point "Example"
1006 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1008 Create a point, distant from the referenced point
1009 on the given distances along the coordinate axes.
1012 theReference The referenced point.
1013 theX Displacement from the referenced point along OX axis.
1014 theY Displacement from the referenced point along OY axis.
1015 theZ Displacement from the referenced point along OZ axis.
1016 theName Object name; when specified, this parameter is used
1017 for result publication in the study. Otherwise, if automatic
1018 publication is switched on, default value is used for result name.
1021 New GEOM.GEOM_Object, containing the created point.
1023 # Example: see GEOM_TestAll.py
1024 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1025 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1026 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1027 anObj.SetParameters(Parameters)
1028 self._autoPublish(anObj, theName, "vertex")
1031 ## Create a point, corresponding to the given parameter on the given curve.
1032 # @param theRefCurve The referenced curve.
1033 # @param theParameter Value of parameter on the referenced curve.
1034 # @param theName Object name; when specified, this parameter is used
1035 # for result publication in the study. Otherwise, if automatic
1036 # publication is switched on, default value is used for result name.
1038 # @return New GEOM.GEOM_Object, containing the created point.
1040 # @ref tui_creation_point "Example"
1041 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1043 Create a point, corresponding to the given parameter on the given curve.
1046 theRefCurve The referenced curve.
1047 theParameter Value of parameter on the referenced curve.
1048 theName Object name; when specified, this parameter is used
1049 for result publication in the study. Otherwise, if automatic
1050 publication is switched on, default value is used for result name.
1053 New GEOM.GEOM_Object, containing the created point.
1056 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1058 # Example: see GEOM_TestAll.py
1059 theParameter, Parameters = ParseParameters(theParameter)
1060 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1061 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1062 anObj.SetParameters(Parameters)
1063 self._autoPublish(anObj, theName, "vertex")
1066 ## Create a point by projection give coordinates on the given curve
1067 # @param theRefCurve The referenced curve.
1068 # @param theX X-coordinate in 3D space
1069 # @param theY Y-coordinate in 3D space
1070 # @param theZ Z-coordinate in 3D space
1071 # @param 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.
1075 # @return New GEOM.GEOM_Object, containing the created point.
1077 # @ref tui_creation_point "Example"
1078 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1080 Create a point by projection give coordinates on the given curve
1083 theRefCurve The referenced curve.
1084 theX X-coordinate in 3D space
1085 theY Y-coordinate in 3D space
1086 theZ Z-coordinate in 3D space
1087 theName Object name; when specified, this parameter is used
1088 for result publication in the study. Otherwise, if automatic
1089 publication is switched on, default value is used for result name.
1092 New GEOM.GEOM_Object, containing the created point.
1095 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1097 # Example: see GEOM_TestAll.py
1098 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1099 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1100 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1101 anObj.SetParameters(Parameters)
1102 self._autoPublish(anObj, theName, "vertex")
1105 ## Create a point, corresponding to the given length on the given curve.
1106 # @param theRefCurve The referenced curve.
1107 # @param theLength Length on the referenced curve. It can be negative.
1108 # @param theStartPoint Point allowing to choose the direction for the calculation
1109 # of the length. If None, start from the first point of theRefCurve.
1110 # @param 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.
1114 # @return New GEOM.GEOM_Object, containing the created point.
1116 # @ref tui_creation_point "Example"
1117 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1119 Create a point, corresponding to the given length on the given curve.
1122 theRefCurve The referenced curve.
1123 theLength Length on the referenced curve. It can be negative.
1124 theStartPoint Point allowing to choose the direction for the calculation
1125 of the length. If None, start from the first point of theRefCurve.
1126 theName Object name; when specified, this parameter is used
1127 for result publication in the study. Otherwise, if automatic
1128 publication is switched on, default value is used for result name.
1131 New GEOM.GEOM_Object, containing the created point.
1133 # Example: see GEOM_TestAll.py
1134 theLength, Parameters = ParseParameters(theLength)
1135 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1136 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1137 anObj.SetParameters(Parameters)
1138 self._autoPublish(anObj, theName, "vertex")
1141 ## Create a point, corresponding to the given parameters on the
1143 # @param theRefSurf The referenced surface.
1144 # @param theUParameter Value of U-parameter on the referenced surface.
1145 # @param theVParameter Value of V-parameter on the referenced surface.
1146 # @param 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.
1150 # @return New GEOM.GEOM_Object, containing the created point.
1152 # @ref swig_MakeVertexOnSurface "Example"
1153 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1155 Create a point, corresponding to the given parameters on the
1159 theRefSurf The referenced surface.
1160 theUParameter Value of U-parameter on the referenced surface.
1161 theVParameter Value of V-parameter on the referenced surface.
1162 theName Object name; when specified, this parameter is used
1163 for result publication in the study. Otherwise, if automatic
1164 publication is switched on, default value is used for result name.
1167 New GEOM.GEOM_Object, containing the created point.
1170 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1172 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1173 # Example: see GEOM_TestAll.py
1174 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1175 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1176 anObj.SetParameters(Parameters);
1177 self._autoPublish(anObj, theName, "vertex")
1180 ## Create a point by projection give coordinates on the given surface
1181 # @param theRefSurf The referenced surface.
1182 # @param theX X-coordinate in 3D space
1183 # @param theY Y-coordinate in 3D space
1184 # @param theZ Z-coordinate in 3D space
1185 # @param 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.
1189 # @return New GEOM.GEOM_Object, containing the created point.
1191 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1192 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1194 Create a point by projection give coordinates on the given surface
1197 theRefSurf The referenced surface.
1198 theX X-coordinate in 3D space
1199 theY Y-coordinate in 3D space
1200 theZ Z-coordinate in 3D space
1201 theName Object name; when specified, this parameter is used
1202 for result publication in the study. Otherwise, if automatic
1203 publication is switched on, default value is used for result name.
1206 New GEOM.GEOM_Object, containing the created point.
1209 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1211 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1212 # Example: see GEOM_TestAll.py
1213 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1214 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1215 anObj.SetParameters(Parameters);
1216 self._autoPublish(anObj, theName, "vertex")
1219 ## Create a point, which lays on the given face.
1220 # The point will lay in arbitrary place of the face.
1221 # The only condition on it is a non-zero distance to the face boundary.
1222 # Such point can be used to uniquely identify the face inside any
1223 # shape in case, when the shape does not contain overlapped faces.
1224 # @param theFace The referenced face.
1225 # @param theName Object name; when specified, this parameter is used
1226 # for result publication in the study. Otherwise, if automatic
1227 # publication is switched on, default value is used for result name.
1229 # @return New GEOM.GEOM_Object, containing the created point.
1231 # @ref swig_MakeVertexInsideFace "Example"
1232 def MakeVertexInsideFace (self, theFace, theName=None):
1234 Create a point, which lays on the given face.
1235 The point will lay in arbitrary place of the face.
1236 The only condition on it is a non-zero distance to the face boundary.
1237 Such point can be used to uniquely identify the face inside any
1238 shape in case, when the shape does not contain overlapped faces.
1241 theFace The referenced face.
1242 theName Object name; when specified, this parameter is used
1243 for result publication in the study. Otherwise, if automatic
1244 publication is switched on, default value is used for result name.
1247 New GEOM.GEOM_Object, containing the created point.
1250 p_on_face = geompy.MakeVertexInsideFace(Face)
1252 # Example: see GEOM_TestAll.py
1253 anObj = self.BasicOp.MakePointOnFace(theFace)
1254 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1255 self._autoPublish(anObj, theName, "vertex")
1258 ## Create a point on intersection of two lines.
1259 # @param theRefLine1, theRefLine2 The referenced lines.
1260 # @param theName Object name; when specified, this parameter is used
1261 # for result publication in the study. Otherwise, if automatic
1262 # publication is switched on, default value is used for result name.
1264 # @return New GEOM.GEOM_Object, containing the created point.
1266 # @ref swig_MakeVertexOnLinesIntersection "Example"
1267 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1269 Create a point on intersection of two lines.
1272 theRefLine1, theRefLine2 The referenced lines.
1273 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.
1278 New GEOM.GEOM_Object, containing the created point.
1280 # Example: see GEOM_TestAll.py
1281 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1282 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1283 self._autoPublish(anObj, theName, "vertex")
1286 ## Create a tangent, corresponding to the given parameter on the given curve.
1287 # @param theRefCurve The referenced curve.
1288 # @param theParameter Value of parameter on the referenced curve.
1289 # @param theName Object name; when specified, this parameter is used
1290 # for result publication in the study. Otherwise, if automatic
1291 # publication is switched on, default value is used for result name.
1293 # @return New GEOM.GEOM_Object, containing the created tangent.
1295 # @ref swig_MakeTangentOnCurve "Example"
1296 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1298 Create a tangent, corresponding to the given parameter on the given curve.
1301 theRefCurve The referenced curve.
1302 theParameter Value of parameter on the referenced curve.
1303 theName Object name; when specified, this parameter is used
1304 for result publication in the study. Otherwise, if automatic
1305 publication is switched on, default value is used for result name.
1308 New GEOM.GEOM_Object, containing the created tangent.
1311 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1313 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1314 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1315 self._autoPublish(anObj, theName, "tangent")
1318 ## Create a tangent plane, corresponding to the given parameter on the given face.
1319 # @param theFace The face for which tangent plane should be built.
1320 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1321 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1322 # @param theTrimSize the size of plane.
1323 # @param theName Object name; when specified, this parameter is used
1324 # for result publication in the study. Otherwise, if automatic
1325 # publication is switched on, default value is used for result name.
1327 # @return New GEOM.GEOM_Object, containing the created tangent.
1329 # @ref swig_MakeTangentPlaneOnFace "Example"
1330 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1332 Create a tangent plane, corresponding to the given parameter on the given face.
1335 theFace The face for which tangent plane should be built.
1336 theParameterV vertical value of the center point (0.0 - 1.0).
1337 theParameterU horisontal value of the center point (0.0 - 1.0).
1338 theTrimSize the size of plane.
1339 theName Object name; when specified, this parameter is used
1340 for result publication in the study. Otherwise, if automatic
1341 publication is switched on, default value is used for result name.
1344 New GEOM.GEOM_Object, containing the created tangent.
1347 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1349 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1350 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1351 self._autoPublish(anObj, theName, "tangent")
1354 ## Create a vector with the given components.
1355 # @param theDX X component of the vector.
1356 # @param theDY Y component of the vector.
1357 # @param theDZ Z component of the vector.
1358 # @param theName Object name; when specified, this parameter is used
1359 # for result publication in the study. Otherwise, if automatic
1360 # publication is switched on, default value is used for result name.
1362 # @return New GEOM.GEOM_Object, containing the created vector.
1364 # @ref tui_creation_vector "Example"
1365 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1367 Create a vector with the given components.
1370 theDX X component of the vector.
1371 theDY Y component of the vector.
1372 theDZ Z component of the vector.
1373 theName Object name; when specified, this parameter is used
1374 for result publication in the study. Otherwise, if automatic
1375 publication is switched on, default value is used for result name.
1378 New GEOM.GEOM_Object, containing the created vector.
1380 # Example: see GEOM_TestAll.py
1381 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1382 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1383 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1384 anObj.SetParameters(Parameters)
1385 self._autoPublish(anObj, theName, "vector")
1388 ## Create a vector between two points.
1389 # @param thePnt1 Start point for the vector.
1390 # @param thePnt2 End point for the vector.
1391 # @param theName Object name; when specified, this parameter is used
1392 # for result publication in the study. Otherwise, if automatic
1393 # publication is switched on, default value is used for result name.
1395 # @return New GEOM.GEOM_Object, containing the created vector.
1397 # @ref tui_creation_vector "Example"
1398 def MakeVector(self, thePnt1, thePnt2, theName=None):
1400 Create a vector between two points.
1403 thePnt1 Start point for the vector.
1404 thePnt2 End point for the vector.
1405 theName Object name; when specified, this parameter is used
1406 for result publication in the study. Otherwise, if automatic
1407 publication is switched on, default value is used for result name.
1410 New GEOM.GEOM_Object, containing the created vector.
1412 # Example: see GEOM_TestAll.py
1413 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1414 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1415 self._autoPublish(anObj, theName, "vector")
1418 ## Create a line, passing through the given point
1419 # and parrallel to the given direction
1420 # @param thePnt Point. The resulting line will pass through it.
1421 # @param theDir Direction. The resulting line will be parallel to it.
1422 # @param theName Object name; when specified, this parameter is used
1423 # for result publication in the study. Otherwise, if automatic
1424 # publication is switched on, default value is used for result name.
1426 # @return New GEOM.GEOM_Object, containing the created line.
1428 # @ref tui_creation_line "Example"
1429 def MakeLine(self, thePnt, theDir, theName=None):
1431 Create a line, passing through the given point
1432 and parrallel to the given direction
1435 thePnt Point. The resulting line will pass through it.
1436 theDir Direction. The resulting line will be parallel to it.
1437 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.
1442 New GEOM.GEOM_Object, containing the created line.
1444 # Example: see GEOM_TestAll.py
1445 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1446 RaiseIfFailed("MakeLine", self.BasicOp)
1447 self._autoPublish(anObj, theName, "line")
1450 ## Create a line, passing through the given points
1451 # @param thePnt1 First of two points, defining the line.
1452 # @param thePnt2 Second of two points, defining the line.
1453 # @param theName Object name; when specified, this parameter is used
1454 # for result publication in the study. Otherwise, if automatic
1455 # publication is switched on, default value is used for result name.
1457 # @return New GEOM.GEOM_Object, containing the created line.
1459 # @ref tui_creation_line "Example"
1460 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1462 Create a line, passing through the given points
1465 thePnt1 First of two points, defining the line.
1466 thePnt2 Second of two points, defining the line.
1467 theName Object name; when specified, this parameter is used
1468 for result publication in the study. Otherwise, if automatic
1469 publication is switched on, default value is used for result name.
1472 New GEOM.GEOM_Object, containing the created line.
1474 # Example: see GEOM_TestAll.py
1475 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1476 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1477 self._autoPublish(anObj, theName, "line")
1480 ## Create a line on two faces intersection.
1481 # @param theFace1 First of two faces, defining the line.
1482 # @param theFace2 Second of two faces, defining the line.
1483 # @param theName Object name; when specified, this parameter is used
1484 # for result publication in the study. Otherwise, if automatic
1485 # publication is switched on, default value is used for result name.
1487 # @return New GEOM.GEOM_Object, containing the created line.
1489 # @ref swig_MakeLineTwoFaces "Example"
1490 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1492 Create a line on two faces intersection.
1495 theFace1 First of two faces, defining the line.
1496 theFace2 Second of two faces, defining the line.
1497 theName Object name; when specified, this parameter is used
1498 for result publication in the study. Otherwise, if automatic
1499 publication is switched on, default value is used for result name.
1502 New GEOM.GEOM_Object, containing the created line.
1504 # Example: see GEOM_TestAll.py
1505 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1506 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1507 self._autoPublish(anObj, theName, "line")
1510 ## Create a plane, passing through the given point
1511 # and normal to the given vector.
1512 # @param thePnt Point, the plane has to pass through.
1513 # @param theVec Vector, defining the plane normal direction.
1514 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1515 # @param 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.
1519 # @return New GEOM.GEOM_Object, containing the created plane.
1521 # @ref tui_creation_plane "Example"
1522 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1524 Create a plane, passing through the given point
1525 and normal to the given vector.
1528 thePnt Point, the plane has to pass through.
1529 theVec Vector, defining the plane normal direction.
1530 theTrimSize Half size of a side of quadrangle face, representing the plane.
1531 theName Object name; when specified, this parameter is used
1532 for result publication in the study. Otherwise, if automatic
1533 publication is switched on, default value is used for result name.
1536 New GEOM.GEOM_Object, containing the created plane.
1538 # Example: see GEOM_TestAll.py
1539 theTrimSize, Parameters = ParseParameters(theTrimSize);
1540 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1541 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1542 anObj.SetParameters(Parameters)
1543 self._autoPublish(anObj, theName, "plane")
1546 ## Create a plane, passing through the three given points
1547 # @param thePnt1 First of three points, defining the plane.
1548 # @param thePnt2 Second of three points, defining the plane.
1549 # @param thePnt3 Fird of three points, defining the plane.
1550 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1551 # @param 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.
1555 # @return New GEOM.GEOM_Object, containing the created plane.
1557 # @ref tui_creation_plane "Example"
1558 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1560 Create a plane, passing through the three given points
1563 thePnt1 First of three points, defining the plane.
1564 thePnt2 Second of three points, defining the plane.
1565 thePnt3 Fird of three points, defining the plane.
1566 theTrimSize Half size of a side of quadrangle face, representing the plane.
1567 theName Object name; when specified, this parameter is used
1568 for result publication in the study. Otherwise, if automatic
1569 publication is switched on, default value is used for result name.
1572 New GEOM.GEOM_Object, containing the created plane.
1574 # Example: see GEOM_TestAll.py
1575 theTrimSize, Parameters = ParseParameters(theTrimSize);
1576 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1577 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1578 anObj.SetParameters(Parameters)
1579 self._autoPublish(anObj, theName, "plane")
1582 ## Create a plane, similar to the existing one, but with another size of representing face.
1583 # @param theFace Referenced plane or LCS(Marker).
1584 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1585 # @param theName Object name; when specified, this parameter is used
1586 # for result publication in the study. Otherwise, if automatic
1587 # publication is switched on, default value is used for result name.
1589 # @return New GEOM.GEOM_Object, containing the created plane.
1591 # @ref tui_creation_plane "Example"
1592 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1594 Create a plane, similar to the existing one, but with another size of representing face.
1597 theFace Referenced plane or LCS(Marker).
1598 theTrimSize New half size of a side of quadrangle face, representing the plane.
1599 theName Object name; when specified, this parameter is used
1600 for result publication in the study. Otherwise, if automatic
1601 publication is switched on, default value is used for result name.
1604 New GEOM.GEOM_Object, containing the created plane.
1606 # Example: see GEOM_TestAll.py
1607 theTrimSize, Parameters = ParseParameters(theTrimSize);
1608 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1609 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1610 anObj.SetParameters(Parameters)
1611 self._autoPublish(anObj, theName, "plane")
1614 ## Create a plane, passing through the 2 vectors
1615 # with center in a start point of the first vector.
1616 # @param theVec1 Vector, defining center point and plane direction.
1617 # @param theVec2 Vector, defining the plane normal direction.
1618 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1619 # @param 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.
1623 # @return New GEOM.GEOM_Object, containing the created plane.
1625 # @ref tui_creation_plane "Example"
1626 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1628 Create a plane, passing through the 2 vectors
1629 with center in a start point of the first vector.
1632 theVec1 Vector, defining center point and plane direction.
1633 theVec2 Vector, defining the plane normal direction.
1634 theTrimSize Half size of a side of quadrangle face, representing the plane.
1635 theName Object name; when specified, this parameter is used
1636 for result publication in the study. Otherwise, if automatic
1637 publication is switched on, default value is used for result name.
1640 New GEOM.GEOM_Object, containing the created plane.
1642 # Example: see GEOM_TestAll.py
1643 theTrimSize, Parameters = ParseParameters(theTrimSize);
1644 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1645 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1646 anObj.SetParameters(Parameters)
1647 self._autoPublish(anObj, theName, "plane")
1650 ## Create a plane, based on a Local coordinate system.
1651 # @param theLCS coordinate system, defining plane.
1652 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1653 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1654 # @param theName Object name; when specified, this parameter is used
1655 # for result publication in the study. Otherwise, if automatic
1656 # publication is switched on, default value is used for result name.
1658 # @return New GEOM.GEOM_Object, containing the created plane.
1660 # @ref tui_creation_plane "Example"
1661 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1663 Create a plane, based on a Local coordinate system.
1666 theLCS coordinate system, defining plane.
1667 theTrimSize Half size of a side of quadrangle face, representing the plane.
1668 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1669 theName Object name; when specified, this parameter is used
1670 for result publication in the study. Otherwise, if automatic
1671 publication is switched on, default value is used for result name.
1674 New GEOM.GEOM_Object, containing the created plane.
1676 # Example: see GEOM_TestAll.py
1677 theTrimSize, Parameters = ParseParameters(theTrimSize);
1678 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1679 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1680 anObj.SetParameters(Parameters)
1681 self._autoPublish(anObj, theName, "plane")
1684 ## Create a local coordinate system.
1685 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1686 # @param XDX,XDY,XDZ Three components of OX direction
1687 # @param YDX,YDY,YDZ Three components of OY direction
1688 # @param theName Object name; when specified, this parameter is used
1689 # for result publication in the study. Otherwise, if automatic
1690 # publication is switched on, default value is used for result name.
1692 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1694 # @ref swig_MakeMarker "Example"
1695 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1697 Create a local coordinate system.
1700 OX,OY,OZ Three coordinates of coordinate system origin.
1701 XDX,XDY,XDZ Three components of OX direction
1702 YDX,YDY,YDZ Three components of OY direction
1703 theName Object name; when specified, this parameter is used
1704 for result publication in the study. Otherwise, if automatic
1705 publication is switched on, default value is used for result name.
1708 New GEOM.GEOM_Object, containing the created coordinate system.
1710 # Example: see GEOM_TestAll.py
1711 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1712 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1713 RaiseIfFailed("MakeMarker", self.BasicOp)
1714 anObj.SetParameters(Parameters)
1715 self._autoPublish(anObj, theName, "lcs")
1718 ## Create a local coordinate system from shape.
1719 # @param theShape The initial shape to detect the coordinate system.
1720 # @param theName Object name; when specified, this parameter is used
1721 # for result publication in the study. Otherwise, if automatic
1722 # publication is switched on, default value is used for result name.
1724 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1726 # @ref tui_creation_lcs "Example"
1727 def MakeMarkerFromShape(self, theShape, theName=None):
1729 Create a local coordinate system from shape.
1732 theShape The initial shape to detect the coordinate system.
1733 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.
1738 New GEOM.GEOM_Object, containing the created coordinate system.
1740 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1741 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1742 self._autoPublish(anObj, theName, "lcs")
1745 ## Create a local coordinate system from point and two vectors.
1746 # @param theOrigin Point of coordinate system origin.
1747 # @param theXVec Vector of X direction
1748 # @param theYVec Vector of Y direction
1749 # @param theName Object name; when specified, this parameter is used
1750 # for result publication in the study. Otherwise, if automatic
1751 # publication is switched on, default value is used for result name.
1753 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1755 # @ref tui_creation_lcs "Example"
1756 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1758 Create a local coordinate system from point and two vectors.
1761 theOrigin Point of coordinate system origin.
1762 theXVec Vector of X direction
1763 theYVec Vector of Y direction
1764 theName Object name; when specified, this parameter is used
1765 for result publication in the study. Otherwise, if automatic
1766 publication is switched on, default value is used for result name.
1769 New GEOM.GEOM_Object, containing the created coordinate system.
1772 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1773 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1774 self._autoPublish(anObj, theName, "lcs")
1777 # end of l3_basic_go
1780 ## @addtogroup l4_curves
1783 ## Create an arc of circle, passing through three given points.
1784 # @param thePnt1 Start point of the arc.
1785 # @param thePnt2 Middle point of the arc.
1786 # @param thePnt3 End point of the arc.
1787 # @param theName Object name; when specified, this parameter is used
1788 # for result publication in the study. Otherwise, if automatic
1789 # publication is switched on, default value is used for result name.
1791 # @return New GEOM.GEOM_Object, containing the created arc.
1793 # @ref swig_MakeArc "Example"
1794 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1796 Create an arc of circle, passing through three given points.
1799 thePnt1 Start point of the arc.
1800 thePnt2 Middle point of the arc.
1801 thePnt3 End point of the arc.
1802 theName Object name; when specified, this parameter is used
1803 for result publication in the study. Otherwise, if automatic
1804 publication is switched on, default value is used for result name.
1807 New GEOM.GEOM_Object, containing the created arc.
1809 # Example: see GEOM_TestAll.py
1810 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1811 RaiseIfFailed("MakeArc", self.CurvesOp)
1812 self._autoPublish(anObj, theName, "arc")
1815 ## Create an arc of circle from a center and 2 points.
1816 # @param thePnt1 Center of the arc
1817 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1818 # @param thePnt3 End point of the arc (Gives also a direction)
1819 # @param theSense Orientation of the arc
1820 # @param 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.
1824 # @return New GEOM.GEOM_Object, containing the created arc.
1826 # @ref swig_MakeArc "Example"
1827 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1829 Create an arc of circle from a center and 2 points.
1832 thePnt1 Center of the arc
1833 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1834 thePnt3 End point of the arc (Gives also a direction)
1835 theSense Orientation of the arc
1836 theName Object name; when specified, this parameter is used
1837 for result publication in the study. Otherwise, if automatic
1838 publication is switched on, default value is used for result name.
1841 New GEOM.GEOM_Object, containing the created arc.
1843 # Example: see GEOM_TestAll.py
1844 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1845 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1846 self._autoPublish(anObj, theName, "arc")
1849 ## Create an arc of ellipse, of center and two points.
1850 # @param theCenter Center of the arc.
1851 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1852 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1853 # @param theName Object name; when specified, this parameter is used
1854 # for result publication in the study. Otherwise, if automatic
1855 # publication is switched on, default value is used for result name.
1857 # @return New GEOM.GEOM_Object, containing the created arc.
1859 # @ref swig_MakeArc "Example"
1860 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1862 Create an arc of ellipse, of center and two points.
1865 theCenter Center of the arc.
1866 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1867 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1868 theName Object name; when specified, this parameter is used
1869 for result publication in the study. Otherwise, if automatic
1870 publication is switched on, default value is used for result name.
1873 New GEOM.GEOM_Object, containing the created arc.
1875 # Example: see GEOM_TestAll.py
1876 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1877 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1878 self._autoPublish(anObj, theName, "arc")
1881 ## Create a circle with given center, normal vector and radius.
1882 # @param thePnt Circle center.
1883 # @param theVec Vector, normal to the plane of the circle.
1884 # @param theR Circle radius.
1885 # @param theName Object name; when specified, this parameter is used
1886 # for result publication in the study. Otherwise, if automatic
1887 # publication is switched on, default value is used for result name.
1889 # @return New GEOM.GEOM_Object, containing the created circle.
1891 # @ref tui_creation_circle "Example"
1892 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1894 Create a circle with given center, normal vector and radius.
1897 thePnt Circle center.
1898 theVec Vector, normal to the plane of the circle.
1900 theName Object name; when specified, this parameter is used
1901 for result publication in the study. Otherwise, if automatic
1902 publication is switched on, default value is used for result name.
1905 New GEOM.GEOM_Object, containing the created circle.
1907 # Example: see GEOM_TestAll.py
1908 theR, Parameters = ParseParameters(theR)
1909 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1910 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1911 anObj.SetParameters(Parameters)
1912 self._autoPublish(anObj, theName, "circle")
1915 ## Create a circle with given radius.
1916 # Center of the circle will be in the origin of global
1917 # coordinate system and normal vector will be codirected with Z axis
1918 # @param theR Circle radius.
1919 # @param theName Object name; when specified, this parameter is used
1920 # for result publication in the study. Otherwise, if automatic
1921 # publication is switched on, default value is used for result name.
1923 # @return New GEOM.GEOM_Object, containing the created circle.
1924 def MakeCircleR(self, theR, theName=None):
1926 Create a circle with given radius.
1927 Center of the circle will be in the origin of global
1928 coordinate system and normal vector will be codirected with Z axis
1932 theName Object name; when specified, this parameter is used
1933 for result publication in the study. Otherwise, if automatic
1934 publication is switched on, default value is used for result name.
1937 New GEOM.GEOM_Object, containing the created circle.
1939 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1940 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1941 self._autoPublish(anObj, theName, "circle")
1944 ## Create a circle, passing through three given points
1945 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1946 # @param theName Object name; when specified, this parameter is used
1947 # for result publication in the study. Otherwise, if automatic
1948 # publication is switched on, default value is used for result name.
1950 # @return New GEOM.GEOM_Object, containing the created circle.
1952 # @ref tui_creation_circle "Example"
1953 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1955 Create a circle, passing through three given points
1958 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1959 theName Object name; when specified, this parameter is used
1960 for result publication in the study. Otherwise, if automatic
1961 publication is switched on, default value is used for result name.
1964 New GEOM.GEOM_Object, containing the created circle.
1966 # Example: see GEOM_TestAll.py
1967 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1968 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1969 self._autoPublish(anObj, theName, "circle")
1972 ## Create a circle, with given point1 as center,
1973 # passing through the point2 as radius and laying in the plane,
1974 # defined by all three given points.
1975 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1976 # @param theName Object name; when specified, this parameter is used
1977 # for result publication in the study. Otherwise, if automatic
1978 # publication is switched on, default value is used for result name.
1980 # @return New GEOM.GEOM_Object, containing the created circle.
1982 # @ref swig_MakeCircle "Example"
1983 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1985 Create a circle, with given point1 as center,
1986 passing through the point2 as radius and laying in the plane,
1987 defined by all three given points.
1990 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1991 theName Object name; when specified, this parameter is used
1992 for result publication in the study. Otherwise, if automatic
1993 publication is switched on, default value is used for result name.
1996 New GEOM.GEOM_Object, containing the created circle.
1998 # Example: see GEOM_example6.py
1999 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2000 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2001 self._autoPublish(anObj, theName, "circle")
2004 ## Create an ellipse with given center, normal vector and radiuses.
2005 # @param thePnt Ellipse center.
2006 # @param theVec Vector, normal to the plane of the ellipse.
2007 # @param theRMajor Major ellipse radius.
2008 # @param theRMinor Minor ellipse radius.
2009 # @param theVecMaj Vector, direction of the ellipse's main axis.
2010 # @param theName Object name; when specified, this parameter is used
2011 # for result publication in the study. Otherwise, if automatic
2012 # publication is switched on, default value is used for result name.
2014 # @return New GEOM.GEOM_Object, containing the created ellipse.
2016 # @ref tui_creation_ellipse "Example"
2017 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2019 Create an ellipse with given center, normal vector and radiuses.
2022 thePnt Ellipse center.
2023 theVec Vector, normal to the plane of the ellipse.
2024 theRMajor Major ellipse radius.
2025 theRMinor Minor ellipse radius.
2026 theVecMaj Vector, direction of the ellipse's main axis.
2027 theName Object name; when specified, this parameter is used
2028 for result publication in the study. Otherwise, if automatic
2029 publication is switched on, default value is used for result name.
2032 New GEOM.GEOM_Object, containing the created ellipse.
2034 # Example: see GEOM_TestAll.py
2035 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2036 if theVecMaj is not None:
2037 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2039 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2041 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2042 anObj.SetParameters(Parameters)
2043 self._autoPublish(anObj, theName, "ellipse")
2046 ## Create an ellipse with given radiuses.
2047 # Center of the ellipse will be in the origin of global
2048 # coordinate system and normal vector will be codirected with Z axis
2049 # @param theRMajor Major ellipse radius.
2050 # @param theRMinor Minor ellipse radius.
2051 # @param theName Object name; when specified, this parameter is used
2052 # for result publication in the study. Otherwise, if automatic
2053 # publication is switched on, default value is used for result name.
2055 # @return New GEOM.GEOM_Object, containing the created ellipse.
2056 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2058 Create an ellipse with given radiuses.
2059 Center of the ellipse will be in the origin of global
2060 coordinate system and normal vector will be codirected with Z axis
2063 theRMajor Major ellipse radius.
2064 theRMinor Minor ellipse radius.
2065 theName Object name; when specified, this parameter is used
2066 for result publication in the study. Otherwise, if automatic
2067 publication is switched on, default value is used for result name.
2070 New GEOM.GEOM_Object, containing the created ellipse.
2072 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2073 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2074 self._autoPublish(anObj, theName, "ellipse")
2077 ## Create a polyline on the set of points.
2078 # @param thePoints Sequence of points for the polyline.
2079 # @param theIsClosed If True, build a closed wire.
2080 # @param theName Object name; when specified, this parameter is used
2081 # for result publication in the study. Otherwise, if automatic
2082 # publication is switched on, default value is used for result name.
2084 # @return New GEOM.GEOM_Object, containing the created polyline.
2086 # @ref tui_creation_curve "Example"
2087 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2089 Create a polyline on the set of points.
2092 thePoints Sequence of points for the polyline.
2093 theIsClosed If True, build a closed wire.
2094 theName Object name; when specified, this parameter is used
2095 for result publication in the study. Otherwise, if automatic
2096 publication is switched on, default value is used for result name.
2099 New GEOM.GEOM_Object, containing the created polyline.
2101 # Example: see GEOM_TestAll.py
2102 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2103 RaiseIfFailed("MakePolyline", self.CurvesOp)
2104 self._autoPublish(anObj, theName, "polyline")
2107 ## Create bezier curve on the set of points.
2108 # @param thePoints Sequence of points for the bezier curve.
2109 # @param theIsClosed If True, build a closed curve.
2110 # @param theName Object name; when specified, this parameter is used
2111 # for result publication in the study. Otherwise, if automatic
2112 # publication is switched on, default value is used for result name.
2114 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2116 # @ref tui_creation_curve "Example"
2117 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2119 Create bezier curve on the set of points.
2122 thePoints Sequence of points for the bezier curve.
2123 theIsClosed If True, build a closed curve.
2124 theName Object name; when specified, this parameter is used
2125 for result publication in the study. Otherwise, if automatic
2126 publication is switched on, default value is used for result name.
2129 New GEOM.GEOM_Object, containing the created bezier curve.
2131 # Example: see GEOM_TestAll.py
2132 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2133 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2134 self._autoPublish(anObj, theName, "bezier")
2137 ## Create B-Spline curve on the set of points.
2138 # @param thePoints Sequence of points for the B-Spline curve.
2139 # @param theIsClosed If True, build a closed curve.
2140 # @param theDoReordering If TRUE, the algo does not follow the order of
2141 # \a thePoints but searches for the closest vertex.
2142 # @param 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.
2146 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2148 # @ref tui_creation_curve "Example"
2149 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2151 Create B-Spline curve on the set of points.
2154 thePoints Sequence of points for the B-Spline curve.
2155 theIsClosed If True, build a closed curve.
2156 theDoReordering If True, the algo does not follow the order of
2157 thePoints but searches for the closest vertex.
2158 theName Object name; when specified, this parameter is used
2159 for result publication in the study. Otherwise, if automatic
2160 publication is switched on, default value is used for result name.
2163 New GEOM.GEOM_Object, containing the created B-Spline curve.
2165 # Example: see GEOM_TestAll.py
2166 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2167 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2168 self._autoPublish(anObj, theName, "bspline")
2171 ## Create B-Spline curve on the set of points.
2172 # @param thePoints Sequence of points for the B-Spline curve.
2173 # @param theFirstVec Vector object, defining the curve direction at its first point.
2174 # @param theLastVec Vector object, defining the curve direction at its last point.
2175 # @param theName Object name; when specified, this parameter is used
2176 # for result publication in the study. Otherwise, if automatic
2177 # publication is switched on, default value is used for result name.
2179 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2181 # @ref tui_creation_curve "Example"
2182 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2184 Create B-Spline curve on the set of points.
2187 thePoints Sequence of points for the B-Spline curve.
2188 theFirstVec Vector object, defining the curve direction at its first point.
2189 theLastVec Vector object, defining the curve direction at its last point.
2190 theName Object name; when specified, this parameter is used
2191 for result publication in the study. Otherwise, if automatic
2192 publication is switched on, default value is used for result name.
2195 New GEOM.GEOM_Object, containing the created B-Spline curve.
2197 # Example: see GEOM_TestAll.py
2198 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2199 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2200 self._autoPublish(anObj, theName, "bspline")
2203 ## Creates a curve using the parametric definition of the basic points.
2204 # @param thexExpr parametric equation of the coordinates X.
2205 # @param theyExpr parametric equation of the coordinates Y.
2206 # @param thezExpr parametric equation of the coordinates Z.
2207 # @param theParamMin the minimal value of the parameter.
2208 # @param theParamMax the maximum value of the parameter.
2209 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2210 # @param theCurveType the type of the curve.
2211 # @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.
2212 # @param theName Object name; when specified, this parameter is used
2213 # for result publication in the study. Otherwise, if automatic
2214 # publication is switched on, default value is used for result name.
2216 # @return New GEOM.GEOM_Object, containing the created curve.
2218 # @ref tui_creation_curve "Example"
2219 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2220 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2222 Creates a curve using the parametric definition of the basic points.
2225 thexExpr parametric equation of the coordinates X.
2226 theyExpr parametric equation of the coordinates Y.
2227 thezExpr parametric equation of the coordinates Z.
2228 theParamMin the minimal value of the parameter.
2229 theParamMax the maximum value of the parameter.
2230 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2231 theCurveType the type of the curve.
2232 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2233 method is used which can lead to a bug.
2234 theName Object name; when specified, this parameter is used
2235 for result publication in the study. Otherwise, if automatic
2236 publication is switched on, default value is used for result name.
2239 New GEOM.GEOM_Object, containing the created curve.
2241 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2243 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2245 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2246 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2247 anObj.SetParameters(Parameters)
2248 self._autoPublish(anObj, theName, "curve")
2254 ## @addtogroup l3_sketcher
2257 ## Create a sketcher (wire or face), following the textual description,
2258 # passed through <VAR>theCommand</VAR> argument. \n
2259 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2260 # Format of the description string have to be the following:
2262 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2265 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2267 # - "R angle" : Set the direction by angle
2268 # - "D dx dy" : Set the direction by DX & DY
2271 # - "TT x y" : Create segment by point at X & Y
2272 # - "T dx dy" : Create segment by point with DX & DY
2273 # - "L length" : Create segment by direction & Length
2274 # - "IX x" : Create segment by direction & Intersect. X
2275 # - "IY y" : Create segment by direction & Intersect. Y
2278 # - "C radius length" : Create arc by direction, radius and length(in degree)
2279 # - "AA x y": Create arc by point at X & Y
2280 # - "A dx dy" : Create arc by point with DX & DY
2281 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2282 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2283 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2284 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2287 # - "WW" : Close Wire (to finish)
2288 # - "WF" : Close Wire and build face (to finish)
2291 # - Flag1 (= reverse) is 0 or 2 ...
2292 # - if 0 the drawn arc is the one of lower angle (< Pi)
2293 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2296 # - Flag2 (= control tolerance) is 0 or 1 ...
2297 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2298 # - if 1 the wire is built only if the end point is on the arc
2299 # with a tolerance of 10^-7 on the distance else the creation fails
2301 # @param theCommand String, defining the sketcher in local
2302 # coordinates of the working plane.
2303 # @param theWorkingPlane Nine double values, defining origin,
2304 # OZ and OX directions of the working plane.
2305 # @param theName Object name; when specified, this parameter is used
2306 # for result publication in the study. Otherwise, if automatic
2307 # publication is switched on, default value is used for result name.
2309 # @return New GEOM.GEOM_Object, containing the created wire.
2311 # @ref tui_sketcher_page "Example"
2312 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2314 Create a sketcher (wire or face), following the textual description, passed
2315 through theCommand argument.
2316 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2317 Format of the description string have to be the following:
2318 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2320 - x1, y1 are coordinates of the first sketcher point (zero by default),
2322 - "R angle" : Set the direction by angle
2323 - "D dx dy" : Set the direction by DX & DY
2325 - "TT x y" : Create segment by point at X & Y
2326 - "T dx dy" : Create segment by point with DX & DY
2327 - "L length" : Create segment by direction & Length
2328 - "IX x" : Create segment by direction & Intersect. X
2329 - "IY y" : Create segment by direction & Intersect. Y
2331 - "C radius length" : Create arc by direction, radius and length(in degree)
2332 - "AA x y": Create arc by point at X & Y
2333 - "A dx dy" : Create arc by point with DX & DY
2334 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2335 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2336 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2337 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2339 - "WW" : Close Wire (to finish)
2340 - "WF" : Close Wire and build face (to finish)
2342 - Flag1 (= reverse) is 0 or 2 ...
2343 - if 0 the drawn arc is the one of lower angle (< Pi)
2344 - if 2 the drawn arc ius the one of greater angle (> Pi)
2346 - Flag2 (= control tolerance) is 0 or 1 ...
2347 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2348 - if 1 the wire is built only if the end point is on the arc
2349 with a tolerance of 10^-7 on the distance else the creation fails
2352 theCommand String, defining the sketcher in local
2353 coordinates of the working plane.
2354 theWorkingPlane Nine double values, defining origin,
2355 OZ and OX directions of the working plane.
2356 theName Object name; when specified, this parameter is used
2357 for result publication in the study. Otherwise, if automatic
2358 publication is switched on, default value is used for result name.
2361 New GEOM.GEOM_Object, containing the created wire.
2363 # Example: see GEOM_TestAll.py
2364 theCommand,Parameters = ParseSketcherCommand(theCommand)
2365 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2366 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2367 anObj.SetParameters(Parameters)
2368 self._autoPublish(anObj, theName, "wire")
2371 ## Create a sketcher (wire or face), following the textual description,
2372 # passed through <VAR>theCommand</VAR> argument. \n
2373 # For format of the description string see MakeSketcher() method.\n
2374 # @param theCommand String, defining the sketcher in local
2375 # coordinates of the working plane.
2376 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2377 # @param theName Object name; when specified, this parameter is used
2378 # for result publication in the study. Otherwise, if automatic
2379 # publication is switched on, default value is used for result name.
2381 # @return New GEOM.GEOM_Object, containing the created wire.
2383 # @ref tui_sketcher_page "Example"
2384 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2386 Create a sketcher (wire or face), following the textual description,
2387 passed through theCommand argument.
2388 For format of the description string see geompy.MakeSketcher() method.
2391 theCommand String, defining the sketcher in local
2392 coordinates of the working plane.
2393 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2394 theName Object name; when specified, this parameter is used
2395 for result publication in the study. Otherwise, if automatic
2396 publication is switched on, default value is used for result name.
2399 New GEOM.GEOM_Object, containing the created wire.
2401 theCommand,Parameters = ParseSketcherCommand(theCommand)
2402 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2403 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2404 anObj.SetParameters(Parameters)
2405 self._autoPublish(anObj, theName, "wire")
2408 ## Obtain a 2D sketcher interface
2409 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2410 def Sketcher2D (self):
2412 Obtain a 2D sketcher interface.
2415 sk = geompy.Sketcher2D()
2417 sk.addSegmentRelative(15, 70)
2418 sk.addSegmentPerpY(50)
2419 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2420 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2421 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2423 Sketch_1 = sk.wire(geomObj_1)
2425 sk = Sketcher2D (self)
2428 ## Create a sketcher wire, following the numerical description,
2429 # passed through <VAR>theCoordinates</VAR> argument. \n
2430 # @param theCoordinates double values, defining points to create a wire,
2432 # @param theName Object name; when specified, this parameter is used
2433 # for result publication in the study. Otherwise, if automatic
2434 # publication is switched on, default value is used for result name.
2436 # @return New GEOM.GEOM_Object, containing the created wire.
2438 # @ref tui_3dsketcher_page "Example"
2439 def Make3DSketcher(self, theCoordinates, theName=None):
2441 Create a sketcher wire, following the numerical description,
2442 passed through theCoordinates argument.
2445 theCoordinates double values, defining points to create a wire,
2447 theName Object name; when specified, this parameter is used
2448 for result publication in the study. Otherwise, if automatic
2449 publication is switched on, default value is used for result name.
2452 New GEOM_Object, containing the created wire.
2454 theCoordinates,Parameters = ParseParameters(theCoordinates)
2455 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2456 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2457 anObj.SetParameters(Parameters)
2458 self._autoPublish(anObj, theName, "wire")
2461 ## Obtain a 3D sketcher interface
2462 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2464 # @ref tui_3dsketcher_page "Example"
2465 def Sketcher3D (self):
2467 Obtain a 3D sketcher interface.
2470 sk = geompy.Sketcher3D()
2471 sk.addPointsAbsolute(0,0,0, 70,0,0)
2472 sk.addPointsRelative(0, 0, 130)
2473 sk.addPointAnglesLength("OXY", 50, 0, 100)
2474 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2476 a3D_Sketcher_1 = sk.wire()
2478 sk = Sketcher3D (self)
2481 # end of l3_sketcher
2484 ## @addtogroup l3_3d_primitives
2487 ## Create a box by coordinates of two opposite vertices.
2489 # @param x1,y1,z1 double values, defining first point it.
2490 # @param x2,y2,z2 double values, defining first point it.
2491 # @param theName Object name; when specified, this parameter is used
2492 # for result publication in the study. Otherwise, if automatic
2493 # publication is switched on, default value is used for result name.
2495 # @return New GEOM.GEOM_Object, containing the created box.
2497 # @ref tui_creation_box "Example"
2498 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2500 Create a box by coordinates of two opposite vertices.
2503 x1,y1,z1 double values, defining first point.
2504 x2,y2,z2 double values, defining second point.
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 pnt1 = self.MakeVertex(x1,y1,z1)
2514 pnt2 = self.MakeVertex(x2,y2,z2)
2515 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2516 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2518 ## Create a box with specified dimensions along the coordinate axes
2519 # and with edges, parallel to the coordinate axes.
2520 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2521 # @param theDX Length of Box edges, parallel to OX axis.
2522 # @param theDY Length of Box edges, parallel to OY axis.
2523 # @param theDZ Length of Box edges, parallel to OZ axis.
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 MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2533 Create a box with specified dimensions along the coordinate axes
2534 and with edges, parallel to the coordinate axes.
2535 Center of the box will be at point (DX/2, DY/2, DZ/2).
2538 theDX Length of Box edges, parallel to OX axis.
2539 theDY Length of Box edges, parallel to OY axis.
2540 theDZ Length of Box edges, parallel to OZ axis.
2541 theName Object name; when specified, this parameter is used
2542 for result publication in the study. Otherwise, if automatic
2543 publication is switched on, default value is used for result name.
2546 New GEOM.GEOM_Object, containing the created box.
2548 # Example: see GEOM_TestAll.py
2549 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2550 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2551 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2552 anObj.SetParameters(Parameters)
2553 self._autoPublish(anObj, theName, "box")
2556 ## Create a box with two specified opposite vertices,
2557 # and with edges, parallel to the coordinate axes
2558 # @param thePnt1 First of two opposite vertices.
2559 # @param thePnt2 Second of two opposite vertices.
2560 # @param theName Object name; when specified, this parameter is used
2561 # for result publication in the study. Otherwise, if automatic
2562 # publication is switched on, default value is used for result name.
2564 # @return New GEOM.GEOM_Object, containing the created box.
2566 # @ref tui_creation_box "Example"
2567 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2569 Create a box with two specified opposite vertices,
2570 and with edges, parallel to the coordinate axes
2573 thePnt1 First of two opposite vertices.
2574 thePnt2 Second of two opposite vertices.
2575 theName Object name; when specified, this parameter is used
2576 for result publication in the study. Otherwise, if automatic
2577 publication is switched on, default value is used for result name.
2580 New GEOM.GEOM_Object, containing the created box.
2582 # Example: see GEOM_TestAll.py
2583 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2584 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2585 self._autoPublish(anObj, theName, "box")
2588 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2589 # @param theH height of Face.
2590 # @param theW width of Face.
2591 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
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 MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2601 Create a face with specified dimensions with edges parallel to coordinate axes.
2604 theH height of Face.
2606 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2607 theName Object name; when specified, this parameter is used
2608 for result publication in the study. Otherwise, if automatic
2609 publication is switched on, default value is used for result name.
2612 New GEOM.GEOM_Object, containing the created face.
2614 # Example: see GEOM_TestAll.py
2615 theH,theW,Parameters = ParseParameters(theH, theW)
2616 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2617 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2618 anObj.SetParameters(Parameters)
2619 self._autoPublish(anObj, theName, "rectangle")
2622 ## Create a face from another plane and two sizes,
2623 # vertical size and horisontal size.
2624 # @param theObj Normale vector to the creating face or
2626 # @param theH Height (vertical size).
2627 # @param theW Width (horisontal size).
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 face.
2634 # @ref tui_creation_face "Example"
2635 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2637 Create a face from another plane and two sizes,
2638 vertical size and horisontal size.
2641 theObj Normale vector to the creating face or
2643 theH Height (vertical size).
2644 theW Width (horisontal size).
2645 theName Object name; when specified, this parameter is used
2646 for result publication in the study. Otherwise, if automatic
2647 publication is switched on, default value is used for result name.
2650 New GEOM_Object, containing the created face.
2652 # Example: see GEOM_TestAll.py
2653 theH,theW,Parameters = ParseParameters(theH, theW)
2654 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2655 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2656 anObj.SetParameters(Parameters)
2657 self._autoPublish(anObj, theName, "rectangle")
2660 ## Create a disk with given center, normal vector and radius.
2661 # @param thePnt Disk center.
2662 # @param theVec Vector, normal to the plane of the disk.
2663 # @param theR Disk radius.
2664 # @param theName Object name; when specified, this parameter is used
2665 # for result publication in the study. Otherwise, if automatic
2666 # publication is switched on, default value is used for result name.
2668 # @return New GEOM.GEOM_Object, containing the created disk.
2670 # @ref tui_creation_disk "Example"
2671 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2673 Create a disk with given center, normal vector and radius.
2677 theVec Vector, normal to the plane of the disk.
2679 theName Object name; when specified, this parameter is used
2680 for result publication in the study. Otherwise, if automatic
2681 publication is switched on, default value is used for result name.
2684 New GEOM.GEOM_Object, containing the created disk.
2686 # Example: see GEOM_TestAll.py
2687 theR,Parameters = ParseParameters(theR)
2688 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2689 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2690 anObj.SetParameters(Parameters)
2691 self._autoPublish(anObj, theName, "disk")
2694 ## Create a disk, passing through three given points
2695 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2696 # @param theName Object name; when specified, this parameter is used
2697 # for result publication in the study. Otherwise, if automatic
2698 # publication is switched on, default value is used for result name.
2700 # @return New GEOM.GEOM_Object, containing the created disk.
2702 # @ref tui_creation_disk "Example"
2703 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2705 Create a disk, passing through three given points
2708 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2709 theName Object name; when specified, this parameter is used
2710 for result publication in the study. Otherwise, if automatic
2711 publication is switched on, default value is used for result name.
2714 New GEOM.GEOM_Object, containing the created disk.
2716 # Example: see GEOM_TestAll.py
2717 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2718 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2719 self._autoPublish(anObj, theName, "disk")
2722 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2723 # @param theR Radius of Face.
2724 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2725 # @param theName Object name; when specified, this parameter is used
2726 # for result publication in the study. Otherwise, if automatic
2727 # publication is switched on, default value is used for result name.
2729 # @return New GEOM.GEOM_Object, containing the created disk.
2731 # @ref tui_creation_face "Example"
2732 def MakeDiskR(self, theR, theOrientation, theName=None):
2734 Create a disk with specified dimensions along OX-OY coordinate axes.
2737 theR Radius of Face.
2738 theOrientation set the orientation belong axis OXY or OYZ or OZX
2739 theName Object name; when specified, this parameter is used
2740 for result publication in the study. Otherwise, if automatic
2741 publication is switched on, default value is used for result name.
2744 New GEOM.GEOM_Object, containing the created disk.
2747 Disk3 = geompy.MakeDiskR(100., 1)
2749 # Example: see GEOM_TestAll.py
2750 theR,Parameters = ParseParameters(theR)
2751 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2752 RaiseIfFailed("MakeDiskR", self.PrimOp)
2753 anObj.SetParameters(Parameters)
2754 self._autoPublish(anObj, theName, "disk")
2757 ## Create a cylinder with given base point, axis, radius and height.
2758 # @param thePnt Central point of cylinder base.
2759 # @param theAxis Cylinder axis.
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 MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2771 Create a cylinder with given base point, axis, radius and height.
2774 thePnt Central point of cylinder base.
2775 theAxis Cylinder axis.
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.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2788 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2789 anObj.SetParameters(Parameters)
2790 self._autoPublish(anObj, theName, "cylinder")
2793 ## Create a cylinder with given radius and height at
2794 # the origin of coordinate system. Axis of the cylinder
2795 # will be collinear to the OZ axis of the coordinate system.
2796 # @param theR Cylinder radius.
2797 # @param theH Cylinder height.
2798 # @param theName Object name; when specified, this parameter is used
2799 # for result publication in the study. Otherwise, if automatic
2800 # publication is switched on, default value is used for result name.
2802 # @return New GEOM.GEOM_Object, containing the created cylinder.
2804 # @ref tui_creation_cylinder "Example"
2805 def MakeCylinderRH(self, theR, theH, theName=None):
2807 Create a cylinder with given radius and height at
2808 the origin of coordinate system. Axis of the cylinder
2809 will be collinear to the OZ axis of the coordinate system.
2812 theR Cylinder radius.
2813 theH Cylinder height.
2814 theName Object name; when specified, this parameter is used
2815 for result publication in the study. Otherwise, if automatic
2816 publication is switched on, default value is used for result name.
2819 New GEOM.GEOM_Object, containing the created cylinder.
2821 # Example: see GEOM_TestAll.py
2822 theR,theH,Parameters = ParseParameters(theR, theH)
2823 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2824 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2825 anObj.SetParameters(Parameters)
2826 self._autoPublish(anObj, theName, "cylinder")
2829 ## Create a sphere with given center and radius.
2830 # @param thePnt Sphere center.
2831 # @param theR Sphere radius.
2832 # @param theName Object name; when specified, this parameter is used
2833 # for result publication in the study. Otherwise, if automatic
2834 # publication is switched on, default value is used for result name.
2836 # @return New GEOM.GEOM_Object, containing the created sphere.
2838 # @ref tui_creation_sphere "Example"
2839 def MakeSpherePntR(self, thePnt, theR, theName=None):
2841 Create a sphere with given center and radius.
2844 thePnt Sphere center.
2846 theName Object name; when specified, this parameter is used
2847 for result publication in the study. Otherwise, if automatic
2848 publication is switched on, default value is used for result name.
2851 New GEOM.GEOM_Object, containing the created sphere.
2853 # Example: see GEOM_TestAll.py
2854 theR,Parameters = ParseParameters(theR)
2855 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2856 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2857 anObj.SetParameters(Parameters)
2858 self._autoPublish(anObj, theName, "sphere")
2861 ## Create a sphere with given center and radius.
2862 # @param x,y,z Coordinates of sphere center.
2863 # @param theR Sphere radius.
2864 # @param theName Object name; when specified, this parameter is used
2865 # for result publication in the study. Otherwise, if automatic
2866 # publication is switched on, default value is used for result name.
2868 # @return New GEOM.GEOM_Object, containing the created sphere.
2870 # @ref tui_creation_sphere "Example"
2871 def MakeSphere(self, x, y, z, theR, theName=None):
2873 Create a sphere with given center and radius.
2876 x,y,z Coordinates of sphere center.
2878 theName Object name; when specified, this parameter is used
2879 for result publication in the study. Otherwise, if automatic
2880 publication is switched on, default value is used for result name.
2883 New GEOM.GEOM_Object, containing the created sphere.
2885 # Example: see GEOM_TestAll.py
2886 point = self.MakeVertex(x, y, z)
2887 # note: auto-publishing is done in self.MakeSpherePntR()
2888 anObj = self.MakeSpherePntR(point, theR, theName)
2891 ## Create a sphere with given radius at the origin of coordinate system.
2892 # @param theR Sphere radius.
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 sphere.
2899 # @ref tui_creation_sphere "Example"
2900 def MakeSphereR(self, theR, theName=None):
2902 Create a sphere with given radius at the origin of coordinate system.
2906 theName Object name; when specified, this parameter is used
2907 for result publication in the study. Otherwise, if automatic
2908 publication is switched on, default value is used for result name.
2911 New GEOM.GEOM_Object, containing the created sphere.
2913 # Example: see GEOM_TestAll.py
2914 theR,Parameters = ParseParameters(theR)
2915 anObj = self.PrimOp.MakeSphereR(theR)
2916 RaiseIfFailed("MakeSphereR", self.PrimOp)
2917 anObj.SetParameters(Parameters)
2918 self._autoPublish(anObj, theName, "sphere")
2921 ## Create a cone with given base point, axis, height and radiuses.
2922 # @param thePnt Central point of the first cone base.
2923 # @param theAxis Cone axis.
2924 # @param theR1 Radius of the first cone base.
2925 # @param theR2 Radius of the second cone base.
2926 # \note If both radiuses are non-zero, the cone will be truncated.
2927 # \note If the radiuses are equal, a cylinder will be created instead.
2928 # @param theH Cone height.
2929 # @param theName Object name; when specified, this parameter is used
2930 # for result publication in the study. Otherwise, if automatic
2931 # publication is switched on, default value is used for result name.
2933 # @return New GEOM.GEOM_Object, containing the created cone.
2935 # @ref tui_creation_cone "Example"
2936 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2938 Create a cone with given base point, axis, height and radiuses.
2941 thePnt Central point of the first cone base.
2943 theR1 Radius of the first cone base.
2944 theR2 Radius of the second cone base.
2946 theName Object name; when specified, this parameter is used
2947 for result publication in the study. Otherwise, if automatic
2948 publication is switched on, default value is used for result name.
2951 If both radiuses are non-zero, the cone will be truncated.
2952 If the radiuses are equal, a cylinder will be created instead.
2955 New GEOM.GEOM_Object, containing the created cone.
2957 # Example: see GEOM_TestAll.py
2958 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2959 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2960 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2961 anObj.SetParameters(Parameters)
2962 self._autoPublish(anObj, theName, "cone")
2965 ## Create a cone with given height and radiuses at
2966 # the origin of coordinate system. Axis of the cone will
2967 # be collinear to the OZ axis of the coordinate system.
2968 # @param theR1 Radius of the first cone base.
2969 # @param theR2 Radius of the second cone base.
2970 # \note If both radiuses are non-zero, the cone will be truncated.
2971 # \note If the radiuses are equal, a cylinder will be created instead.
2972 # @param theH Cone height.
2973 # @param theName Object name; when specified, this parameter is used
2974 # for result publication in the study. Otherwise, if automatic
2975 # publication is switched on, default value is used for result name.
2977 # @return New GEOM.GEOM_Object, containing the created cone.
2979 # @ref tui_creation_cone "Example"
2980 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
2982 Create a cone with given height and radiuses at
2983 the origin of coordinate system. Axis of the cone will
2984 be collinear to the OZ axis of the coordinate system.
2987 theR1 Radius of the first cone base.
2988 theR2 Radius of the second cone base.
2990 theName Object name; when specified, this parameter is used
2991 for result publication in the study. Otherwise, if automatic
2992 publication is switched on, default value is used for result name.
2995 If both radiuses are non-zero, the cone will be truncated.
2996 If the radiuses are equal, a cylinder will be created instead.
2999 New GEOM.GEOM_Object, containing the created cone.
3001 # Example: see GEOM_TestAll.py
3002 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3003 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3004 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3005 anObj.SetParameters(Parameters)
3006 self._autoPublish(anObj, theName, "cone")
3009 ## Create a torus with given center, normal vector and radiuses.
3010 # @param thePnt Torus central point.
3011 # @param theVec Torus axis of symmetry.
3012 # @param theRMajor Torus major radius.
3013 # @param theRMinor Torus minor radius.
3014 # @param theName Object name; when specified, this parameter is used
3015 # for result publication in the study. Otherwise, if automatic
3016 # publication is switched on, default value is used for result name.
3018 # @return New GEOM.GEOM_Object, containing the created torus.
3020 # @ref tui_creation_torus "Example"
3021 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3023 Create a torus with given center, normal vector and radiuses.
3026 thePnt Torus central point.
3027 theVec Torus axis of symmetry.
3028 theRMajor Torus major radius.
3029 theRMinor Torus minor radius.
3030 theName Object name; when specified, this parameter is used
3031 for result publication in the study. Otherwise, if automatic
3032 publication is switched on, default value is used for result name.
3035 New GEOM.GEOM_Object, containing the created torus.
3037 # Example: see GEOM_TestAll.py
3038 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3039 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3040 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3041 anObj.SetParameters(Parameters)
3042 self._autoPublish(anObj, theName, "torus")
3045 ## Create a torus with given radiuses at the origin of coordinate system.
3046 # @param theRMajor Torus major radius.
3047 # @param theRMinor Torus minor radius.
3048 # @param theName Object name; when specified, this parameter is used
3049 # for result publication in the study. Otherwise, if automatic
3050 # publication is switched on, default value is used for result name.
3052 # @return New GEOM.GEOM_Object, containing the created torus.
3054 # @ref tui_creation_torus "Example"
3055 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3057 Create a torus with given radiuses at the origin of coordinate system.
3060 theRMajor Torus major radius.
3061 theRMinor Torus minor radius.
3062 theName Object name; when specified, this parameter is used
3063 for result publication in the study. Otherwise, if automatic
3064 publication is switched on, default value is used for result name.
3067 New GEOM.GEOM_Object, containing the created torus.
3069 # Example: see GEOM_TestAll.py
3070 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3071 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3072 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3073 anObj.SetParameters(Parameters)
3074 self._autoPublish(anObj, theName, "torus")
3077 # end of l3_3d_primitives
3080 ## @addtogroup l3_complex
3083 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3084 # @param theBase Base shape to be extruded.
3085 # @param thePoint1 First end of extrusion vector.
3086 # @param thePoint2 Second end of extrusion vector.
3087 # @param theScaleFactor Use it to make prism with scaled second base.
3088 # Nagative value means not scaled second base.
3089 # @param theName Object name; when specified, this parameter is used
3090 # for result publication in the study. Otherwise, if automatic
3091 # publication is switched on, default value is used for result name.
3093 # @return New GEOM.GEOM_Object, containing the created prism.
3095 # @ref tui_creation_prism "Example"
3096 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3098 Create a shape by extrusion of the base shape along a vector, defined by two points.
3101 theBase Base shape to be extruded.
3102 thePoint1 First end of extrusion vector.
3103 thePoint2 Second end of extrusion vector.
3104 theScaleFactor Use it to make prism with scaled second base.
3105 Nagative value means not scaled second base.
3106 theName Object name; when specified, this parameter is used
3107 for result publication in the study. Otherwise, if automatic
3108 publication is switched on, default value is used for result name.
3111 New GEOM.GEOM_Object, containing the created prism.
3113 # Example: see GEOM_TestAll.py
3116 if theScaleFactor > 0:
3117 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3118 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3120 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3121 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3122 anObj.SetParameters(Parameters)
3123 self._autoPublish(anObj, theName, "prism")
3126 ## Create a shape by extrusion of the base shape along a
3127 # vector, defined by two points, in 2 Ways (forward/backward).
3128 # @param theBase Base shape to be extruded.
3129 # @param thePoint1 First end of extrusion vector.
3130 # @param thePoint2 Second end of extrusion vector.
3131 # @param theName Object name; when specified, this parameter is used
3132 # for result publication in the study. Otherwise, if automatic
3133 # publication is switched on, default value is used for result name.
3135 # @return New GEOM.GEOM_Object, containing the created prism.
3137 # @ref tui_creation_prism "Example"
3138 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3140 Create a shape by extrusion of the base shape along a
3141 vector, defined by two points, in 2 Ways (forward/backward).
3144 theBase Base shape to be extruded.
3145 thePoint1 First end of extrusion vector.
3146 thePoint2 Second end of extrusion vector.
3147 theName Object name; when specified, this parameter is used
3148 for result publication in the study. Otherwise, if automatic
3149 publication is switched on, default value is used for result name.
3152 New GEOM.GEOM_Object, containing the created prism.
3154 # Example: see GEOM_TestAll.py
3155 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3156 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3157 self._autoPublish(anObj, theName, "prism")
3160 ## Create a shape by extrusion of the base shape along the vector,
3161 # i.e. all the space, transfixed by the base shape during its translation
3162 # along the vector on the given distance.
3163 # @param theBase Base shape to be extruded.
3164 # @param theVec Direction of extrusion.
3165 # @param theH Prism dimension along theVec.
3166 # @param theScaleFactor Use it to make prism with scaled second base.
3167 # Negative value means not scaled second base.
3168 # @param theName Object name; when specified, this parameter is used
3169 # for result publication in the study. Otherwise, if automatic
3170 # publication is switched on, default value is used for result name.
3172 # @return New GEOM.GEOM_Object, containing the created prism.
3174 # @ref tui_creation_prism "Example"
3175 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3177 Create a shape by extrusion of the base shape along the vector,
3178 i.e. all the space, transfixed by the base shape during its translation
3179 along the vector on the given distance.
3182 theBase Base shape to be extruded.
3183 theVec Direction of extrusion.
3184 theH Prism dimension along theVec.
3185 theScaleFactor Use it to make prism with scaled second base.
3186 Negative value means not scaled second base.
3187 theName Object name; when specified, this parameter is used
3188 for result publication in the study. Otherwise, if automatic
3189 publication is switched on, default value is used for result name.
3192 New GEOM.GEOM_Object, containing the created prism.
3194 # Example: see GEOM_TestAll.py
3197 if theScaleFactor > 0:
3198 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3199 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3201 theH,Parameters = ParseParameters(theH)
3202 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3203 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3204 anObj.SetParameters(Parameters)
3205 self._autoPublish(anObj, theName, "prism")
3208 ## Create a shape by extrusion of the base shape along the vector,
3209 # i.e. all the space, transfixed by the base shape during its translation
3210 # along the vector on the given distance in 2 Ways (forward/backward).
3211 # @param theBase Base shape to be extruded.
3212 # @param theVec Direction of extrusion.
3213 # @param theH Prism dimension along theVec in forward direction.
3214 # @param theName Object name; when specified, this parameter is used
3215 # for result publication in the study. Otherwise, if automatic
3216 # publication is switched on, default value is used for result name.
3218 # @return New GEOM.GEOM_Object, containing the created prism.
3220 # @ref tui_creation_prism "Example"
3221 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3223 Create a shape by extrusion of the base shape along the vector,
3224 i.e. all the space, transfixed by the base shape during its translation
3225 along the vector on the given distance in 2 Ways (forward/backward).
3228 theBase Base shape to be extruded.
3229 theVec Direction of extrusion.
3230 theH Prism dimension along theVec in forward direction.
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
3239 theH,Parameters = ParseParameters(theH)
3240 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3241 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3242 anObj.SetParameters(Parameters)
3243 self._autoPublish(anObj, theName, "prism")
3246 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3247 # @param theBase Base shape to be extruded.
3248 # @param theDX, theDY, theDZ Directions of extrusion.
3249 # @param theScaleFactor Use it to make prism with scaled second base.
3250 # Nagative value means not scaled second base.
3251 # @param theName Object name; when specified, this parameter is used
3252 # for result publication in the study. Otherwise, if automatic
3253 # publication is switched on, default value is used for result name.
3255 # @return New GEOM.GEOM_Object, containing the created prism.
3257 # @ref tui_creation_prism "Example"
3258 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3260 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3263 theBase Base shape to be extruded.
3264 theDX, theDY, theDZ Directions of extrusion.
3265 theScaleFactor Use it to make prism with scaled second base.
3266 Nagative value means not scaled second base.
3267 theName Object name; when specified, this parameter is used
3268 for result publication in the study. Otherwise, if automatic
3269 publication is switched on, default value is used for result name.
3272 New GEOM.GEOM_Object, containing the created prism.
3274 # Example: see GEOM_TestAll.py
3277 if theScaleFactor > 0:
3278 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3279 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3281 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3282 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3283 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3284 anObj.SetParameters(Parameters)
3285 self._autoPublish(anObj, theName, "prism")
3288 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3289 # i.e. all the space, transfixed by the base shape during its translation
3290 # along the vector on the given distance in 2 Ways (forward/backward).
3291 # @param theBase Base shape to be extruded.
3292 # @param theDX, theDY, theDZ Directions of extrusion.
3293 # @param theName Object name; when specified, this parameter is used
3294 # for result publication in the study. Otherwise, if automatic
3295 # publication is switched on, default value is used for result name.
3297 # @return New GEOM.GEOM_Object, containing the created prism.
3299 # @ref tui_creation_prism "Example"
3300 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3302 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3303 i.e. all the space, transfixed by the base shape during its translation
3304 along the vector on the given distance in 2 Ways (forward/backward).
3307 theBase Base shape to be extruded.
3308 theDX, theDY, theDZ Directions of extrusion.
3309 theName Object name; when specified, this parameter is used
3310 for result publication in the study. Otherwise, if automatic
3311 publication is switched on, default value is used for result name.
3314 New GEOM.GEOM_Object, containing the created prism.
3316 # Example: see GEOM_TestAll.py
3317 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3318 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3319 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3320 anObj.SetParameters(Parameters)
3321 self._autoPublish(anObj, theName, "prism")
3324 ## Create a shape by revolution of the base shape around the axis
3325 # on the given angle, i.e. all the space, transfixed by the base
3326 # shape during its rotation around the axis on the given angle.
3327 # @param theBase Base shape to be rotated.
3328 # @param theAxis Rotation axis.
3329 # @param theAngle Rotation angle in radians.
3330 # @param theName Object name; when specified, this parameter is used
3331 # for result publication in the study. Otherwise, if automatic
3332 # publication is switched on, default value is used for result name.
3334 # @return New GEOM.GEOM_Object, containing the created revolution.
3336 # @ref tui_creation_revolution "Example"
3337 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3339 Create a shape by revolution of the base shape around the axis
3340 on the given angle, i.e. all the space, transfixed by the base
3341 shape during its rotation around the axis on the given angle.
3344 theBase Base shape to be rotated.
3345 theAxis Rotation axis.
3346 theAngle Rotation angle in radians.
3347 theName Object name; when specified, this parameter is used
3348 for result publication in the study. Otherwise, if automatic
3349 publication is switched on, default value is used for result name.
3352 New GEOM.GEOM_Object, containing the created revolution.
3354 # Example: see GEOM_TestAll.py
3355 theAngle,Parameters = ParseParameters(theAngle)
3356 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3357 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3358 anObj.SetParameters(Parameters)
3359 self._autoPublish(anObj, theName, "revolution")
3362 ## Create a shape by revolution of the base shape around the axis
3363 # on the given angle, i.e. all the space, transfixed by the base
3364 # shape during its rotation around the axis on the given angle in
3365 # both directions (forward/backward)
3366 # @param theBase Base shape to be rotated.
3367 # @param theAxis Rotation axis.
3368 # @param theAngle Rotation angle in radians.
3369 # @param theName Object name; when specified, this parameter is used
3370 # for result publication in the study. Otherwise, if automatic
3371 # publication is switched on, default value is used for result name.
3373 # @return New GEOM.GEOM_Object, containing the created revolution.
3375 # @ref tui_creation_revolution "Example"
3376 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3378 Create a shape by revolution of the base shape around the axis
3379 on the given angle, i.e. all the space, transfixed by the base
3380 shape during its rotation around the axis on the given angle in
3381 both directions (forward/backward).
3384 theBase Base shape to be rotated.
3385 theAxis Rotation axis.
3386 theAngle Rotation angle in radians.
3387 theName Object name; when specified, this parameter is used
3388 for result publication in the study. Otherwise, if automatic
3389 publication is switched on, default value is used for result name.
3392 New GEOM.GEOM_Object, containing the created revolution.
3394 theAngle,Parameters = ParseParameters(theAngle)
3395 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3396 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3397 anObj.SetParameters(Parameters)
3398 self._autoPublish(anObj, theName, "revolution")
3401 ## Create a filling from the given compound of contours.
3402 # @param theShape the compound of contours
3403 # @param theMinDeg a minimal degree of BSpline surface to create
3404 # @param theMaxDeg a maximal degree of BSpline surface to create
3405 # @param theTol2D a 2d tolerance to be reached
3406 # @param theTol3D a 3d tolerance to be reached
3407 # @param theNbIter a number of iteration of approximation algorithm
3408 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3409 # @param isApprox if True, BSpline curves are generated in the process
3410 # of surface construction. By default it is False, that means
3411 # the surface is created using given curves. The usage of
3412 # Approximation makes the algorithm work slower, but allows
3413 # building the surface for rather complex cases.
3414 # @param theName Object name; when specified, this parameter is used
3415 # for result publication in the study. Otherwise, if automatic
3416 # publication is switched on, default value is used for result name.
3418 # @return New GEOM.GEOM_Object, containing the created filling surface.
3420 # @ref tui_creation_filling "Example"
3421 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3422 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3424 Create a filling from the given compound of contours.
3427 theShape the compound of contours
3428 theMinDeg a minimal degree of BSpline surface to create
3429 theMaxDeg a maximal degree of BSpline surface to create
3430 theTol2D a 2d tolerance to be reached
3431 theTol3D a 3d tolerance to be reached
3432 theNbIter a number of iteration of approximation algorithm
3433 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3434 isApprox if True, BSpline curves are generated in the process
3435 of surface construction. By default it is False, that means
3436 the surface is created using given curves. The usage of
3437 Approximation makes the algorithm work slower, but allows
3438 building the surface for rather complex cases
3439 theName Object name; when specified, this parameter is used
3440 for result publication in the study. Otherwise, if automatic
3441 publication is switched on, default value is used for result name.
3444 New GEOM.GEOM_Object, containing the created filling surface.
3447 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3449 # Example: see GEOM_TestAll.py
3450 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3451 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3452 theTol2D, theTol3D, theNbIter,
3453 theMethod, isApprox)
3454 RaiseIfFailed("MakeFilling", self.PrimOp)
3455 anObj.SetParameters(Parameters)
3456 self._autoPublish(anObj, theName, "filling")
3460 ## Create a filling from the given compound of contours.
3461 # This method corresponds to MakeFilling with isApprox=True
3462 # @param theShape the compound of contours
3463 # @param theMinDeg a minimal degree of BSpline surface to create
3464 # @param theMaxDeg a maximal degree of BSpline surface to create
3465 # @param theTol3D a 3d tolerance to be reached
3466 # @param theName Object name; when specified, this parameter is used
3467 # for result publication in the study. Otherwise, if automatic
3468 # publication is switched on, default value is used for result name.
3470 # @return New GEOM.GEOM_Object, containing the created filling surface.
3472 # @ref tui_creation_filling "Example"
3473 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3475 Create a filling from the given compound of contours.
3476 This method corresponds to MakeFilling with isApprox=True
3479 theShape the compound of contours
3480 theMinDeg a minimal degree of BSpline surface to create
3481 theMaxDeg a maximal degree of BSpline surface to create
3482 theTol3D a 3d tolerance to be reached
3483 theName Object name; when specified, this parameter is used
3484 for result publication in the study. Otherwise, if automatic
3485 publication is switched on, default value is used for result name.
3488 New GEOM.GEOM_Object, containing the created filling surface.
3491 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3493 # Example: see GEOM_TestAll.py
3494 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3495 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3496 0, theTol3D, 0, GEOM.FOM_Default, True)
3497 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3498 anObj.SetParameters(Parameters)
3499 self._autoPublish(anObj, theName, "filling")
3502 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3503 # @param theSeqSections - set of specified sections.
3504 # @param theModeSolid - mode defining building solid or shell
3505 # @param thePreci - precision 3D used for smoothing
3506 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3507 # @param theName Object name; when specified, this parameter is used
3508 # for result publication in the study. Otherwise, if automatic
3509 # publication is switched on, default value is used for result name.
3511 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3513 # @ref swig_todo "Example"
3514 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3516 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3519 theSeqSections - set of specified sections.
3520 theModeSolid - mode defining building solid or shell
3521 thePreci - precision 3D used for smoothing
3522 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3523 theName Object name; when specified, this parameter is used
3524 for result publication in the study. Otherwise, if automatic
3525 publication is switched on, default value is used for result name.
3528 New GEOM.GEOM_Object, containing the created shell or solid.
3530 # Example: see GEOM_TestAll.py
3531 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3532 RaiseIfFailed("MakeThruSections", self.PrimOp)
3533 self._autoPublish(anObj, theName, "filling")
3536 ## Create a shape by extrusion of the base shape along
3537 # the path shape. The path shape can be a wire or an edge.
3538 # @param theBase Base shape to be extruded.
3539 # @param thePath Path shape to extrude the base shape along it.
3540 # @param theName Object name; when specified, this parameter is used
3541 # for result publication in the study. Otherwise, if automatic
3542 # publication is switched on, default value is used for result name.
3544 # @return New GEOM.GEOM_Object, containing the created pipe.
3546 # @ref tui_creation_pipe "Example"
3547 def MakePipe(self, theBase, thePath, theName=None):
3549 Create a shape by extrusion of the base shape along
3550 the path shape. The path shape can be a wire or an edge.
3553 theBase Base shape to be extruded.
3554 thePath Path shape to extrude the base shape along it.
3555 theName Object name; when specified, this parameter is used
3556 for result publication in the study. Otherwise, if automatic
3557 publication is switched on, default value is used for result name.
3560 New GEOM.GEOM_Object, containing the created pipe.
3562 # Example: see GEOM_TestAll.py
3563 anObj = self.PrimOp.MakePipe(theBase, thePath)
3564 RaiseIfFailed("MakePipe", self.PrimOp)
3565 self._autoPublish(anObj, theName, "pipe")
3568 ## Create a shape by extrusion of the profile shape along
3569 # the path shape. The path shape can be a wire or an edge.
3570 # the several profiles can be specified in the several locations of path.
3571 # @param theSeqBases - list of Bases shape to be extruded.
3572 # @param theLocations - list of locations on the path corresponding
3573 # specified list of the Bases shapes. Number of locations
3574 # should be equal to number of bases or list of locations can be empty.
3575 # @param thePath - Path shape to extrude the base shape along it.
3576 # @param theWithContact - the mode defining that the section is translated to be in
3577 # contact with the spine.
3578 # @param theWithCorrection - defining that the section is rotated to be
3579 # orthogonal to the spine tangent in the correspondent point
3580 # @param theName Object name; when specified, this parameter is used
3581 # for result publication in the study. Otherwise, if automatic
3582 # publication is switched on, default value is used for result name.
3584 # @return New GEOM.GEOM_Object, containing the created pipe.
3586 # @ref tui_creation_pipe_with_diff_sec "Example"
3587 def MakePipeWithDifferentSections(self, theSeqBases,
3588 theLocations, thePath,
3589 theWithContact, theWithCorrection, theName=None):
3591 Create a shape by extrusion of the profile shape along
3592 the path shape. The path shape can be a wire or an edge.
3593 the several profiles can be specified in the several locations of path.
3596 theSeqBases - list of Bases shape to be extruded.
3597 theLocations - list of locations on the path corresponding
3598 specified list of the Bases shapes. Number of locations
3599 should be equal to number of bases or list of locations can be empty.
3600 thePath - Path shape to extrude the base shape along it.
3601 theWithContact - the mode defining that the section is translated to be in
3602 contact with the spine(0/1)
3603 theWithCorrection - defining that the section is rotated to be
3604 orthogonal to the spine tangent in the correspondent point (0/1)
3605 theName Object name; when specified, this parameter is used
3606 for result publication in the study. Otherwise, if automatic
3607 publication is switched on, default value is used for result name.
3610 New GEOM.GEOM_Object, containing the created pipe.
3612 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3613 theLocations, thePath,
3614 theWithContact, theWithCorrection)
3615 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3616 self._autoPublish(anObj, theName, "pipe")
3619 ## Create a shape by extrusion of the profile shape along
3620 # the path shape. The path shape can be a wire or a edge.
3621 # the several profiles can be specified in the several locations of path.
3622 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3623 # shell or face. If number of faces in neighbour sections
3624 # aren't coincided result solid between such sections will
3625 # be created using external boundaries of this shells.
3626 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3627 # This list is used for searching correspondences between
3628 # faces in the sections. Size of this list must be equal
3629 # to size of list of base shapes.
3630 # @param theLocations - list of locations on the path corresponding
3631 # specified list of the Bases shapes. Number of locations
3632 # should be equal to number of bases. First and last
3633 # locations must be coincided with first and last vertexes
3634 # of path correspondingly.
3635 # @param thePath - Path shape to extrude the base shape along it.
3636 # @param theWithContact - the mode defining that the section is translated to be in
3637 # contact with the spine.
3638 # @param theWithCorrection - defining that the section is rotated to be
3639 # orthogonal to the spine tangent in the correspondent point
3640 # @param theName Object name; when specified, this parameter is used
3641 # for result publication in the study. Otherwise, if automatic
3642 # publication is switched on, default value is used for result name.
3644 # @return New GEOM.GEOM_Object, containing the created solids.
3646 # @ref tui_creation_pipe_with_shell_sec "Example"
3647 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3648 theLocations, thePath,
3649 theWithContact, theWithCorrection, theName=None):
3651 Create a shape by extrusion of the profile shape along
3652 the path shape. The path shape can be a wire or a edge.
3653 the several profiles can be specified in the several locations of path.
3656 theSeqBases - list of Bases shape to be extruded. Base shape must be
3657 shell or face. If number of faces in neighbour sections
3658 aren't coincided result solid between such sections will
3659 be created using external boundaries of this shells.
3660 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3661 This list is used for searching correspondences between
3662 faces in the sections. Size of this list must be equal
3663 to size of list of base shapes.
3664 theLocations - list of locations on the path corresponding
3665 specified list of the Bases shapes. Number of locations
3666 should be equal to number of bases. First and last
3667 locations must be coincided with first and last vertexes
3668 of path correspondingly.
3669 thePath - Path shape to extrude the base shape along it.
3670 theWithContact - the mode defining that the section is translated to be in
3671 contact with the spine (0/1)
3672 theWithCorrection - defining that the section is rotated to be
3673 orthogonal to the spine tangent in the correspondent point (0/1)
3674 theName Object name; when specified, this parameter is used
3675 for result publication in the study. Otherwise, if automatic
3676 publication is switched on, default value is used for result name.
3679 New GEOM.GEOM_Object, containing the created solids.
3681 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3682 theLocations, thePath,
3683 theWithContact, theWithCorrection)
3684 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3685 self._autoPublish(anObj, theName, "pipe")
3688 ## Create a shape by extrusion of the profile shape along
3689 # the path shape. This function is used only for debug pipe
3690 # functionality - it is a version of function MakePipeWithShellSections()
3691 # which give a possibility to recieve information about
3692 # creating pipe between each pair of sections step by step.
3693 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3694 theLocations, thePath,
3695 theWithContact, theWithCorrection, theName=None):
3697 Create a shape by extrusion of the profile shape along
3698 the path shape. This function is used only for debug pipe
3699 functionality - it is a version of previous function
3700 geompy.MakePipeWithShellSections() which give a possibility to
3701 recieve information about creating pipe between each pair of
3702 sections step by step.
3705 nbsect = len(theSeqBases)
3706 nbsubsect = len(theSeqSubBases)
3707 #print "nbsect = ",nbsect
3708 for i in range(1,nbsect):
3710 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3711 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3713 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3714 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3715 tmpLocations, thePath,
3716 theWithContact, theWithCorrection)
3717 if self.PrimOp.IsDone() == 0:
3718 print "Problems with pipe creation between ",i," and ",i+1," sections"
3719 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3722 print "Pipe between ",i," and ",i+1," sections is OK"
3727 resc = self.MakeCompound(res)
3728 #resc = self.MakeSewing(res, 0.001)
3729 #print "resc: ",resc
3730 self._autoPublish(resc, theName, "pipe")
3733 ## Create solids between given sections
3734 # @param theSeqBases - list of sections (shell or face).
3735 # @param theLocations - list of corresponding vertexes
3736 # @param theName Object name; when specified, this parameter is used
3737 # for result publication in the study. Otherwise, if automatic
3738 # publication is switched on, default value is used for result name.
3740 # @return New GEOM.GEOM_Object, containing the created solids.
3742 # @ref tui_creation_pipe_without_path "Example"
3743 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3745 Create solids between given sections
3748 theSeqBases - list of sections (shell or face).
3749 theLocations - list of corresponding vertexes
3750 theName Object name; when specified, this parameter is used
3751 for result publication in the study. Otherwise, if automatic
3752 publication is switched on, default value is used for result name.
3755 New GEOM.GEOM_Object, containing the created solids.
3757 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3758 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3759 self._autoPublish(anObj, theName, "pipe")
3762 ## Create a shape by extrusion of the base shape along
3763 # the path shape with constant bi-normal direction along the given vector.
3764 # The path shape can be a wire or an edge.
3765 # @param theBase Base shape to be extruded.
3766 # @param thePath Path shape to extrude the base shape along it.
3767 # @param theVec Vector defines a constant binormal direction to keep the
3768 # same angle beetween the direction and the sections
3769 # along the sweep surface.
3770 # @param theName Object name; when specified, this parameter is used
3771 # for result publication in the study. Otherwise, if automatic
3772 # publication is switched on, default value is used for result name.
3774 # @return New GEOM.GEOM_Object, containing the created pipe.
3776 # @ref tui_creation_pipe "Example"
3777 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3779 Create a shape by extrusion of the base shape along
3780 the path shape with constant bi-normal direction along the given vector.
3781 The path shape can be a wire or an edge.
3784 theBase Base shape to be extruded.
3785 thePath Path shape to extrude the base shape along it.
3786 theVec Vector defines a constant binormal direction to keep the
3787 same angle beetween the direction and the sections
3788 along the sweep surface.
3789 theName Object name; when specified, this parameter is used
3790 for result publication in the study. Otherwise, if automatic
3791 publication is switched on, default value is used for result name.
3794 New GEOM.GEOM_Object, containing the created pipe.
3796 # Example: see GEOM_TestAll.py
3797 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3798 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3799 self._autoPublish(anObj, theName, "pipe")
3802 ## Makes a thick solid from a face or a shell
3803 # @param theShape Face or Shell to be thicken
3804 # @param theThickness Thickness of the resulting solid
3805 # @param theName Object name; when specified, this parameter is used
3806 # for result publication in the study. Otherwise, if automatic
3807 # publication is switched on, default value is used for result name.
3809 # @return New GEOM.GEOM_Object, containing the created solid
3811 def MakeThickSolid(self, theShape, theThickness, theName=None):
3813 Make a thick solid from a face or a shell
3816 theShape Face or Shell to be thicken
3817 theThickness Thickness of the resulting solid
3818 theName Object name; when specified, this parameter is used
3819 for result publication in the study. Otherwise, if automatic
3820 publication is switched on, default value is used for result name.
3823 New GEOM.GEOM_Object, containing the created solid
3825 # Example: see GEOM_TestAll.py
3826 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3827 RaiseIfFailed("MakeThickening", self.PrimOp)
3828 self._autoPublish(anObj, theName, "pipe")
3832 ## Modifies a face or a shell to make it a thick solid
3833 # @param theShape Face or Shell to be thicken
3834 # @param theThickness Thickness of the resulting solid
3836 # @return The modified shape
3838 def Thicken(self, theShape, theThickness):
3840 Modifies a face or a shell to make it a thick solid
3843 theBase Base shape to be extruded.
3844 thePath Path shape to extrude the base shape along it.
3845 theName Object name; when specified, this parameter is used
3846 for result publication in the study. Otherwise, if automatic
3847 publication is switched on, default value is used for result name.
3852 # Example: see GEOM_TestAll.py
3853 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3854 RaiseIfFailed("MakeThickening", self.PrimOp)
3857 ## Build a middle path of a pipe-like shape.
3858 # The path shape can be a wire or an edge.
3859 # @param theShape It can be closed or unclosed pipe-like shell
3860 # or a pipe-like solid.
3861 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3862 # should be wires or faces of theShape.
3863 # @param theName Object name; when specified, this parameter is used
3864 # for result publication in the study. Otherwise, if automatic
3865 # publication is switched on, default value is used for result name.
3867 # @note It is not assumed that exact or approximate copy of theShape
3868 # can be obtained by applying existing Pipe operation on the
3869 # resulting "Path" wire taking theBase1 as the base - it is not
3870 # always possible; though in some particular cases it might work
3871 # it is not guaranteed. Thus, RestorePath function should not be
3872 # considered as an exact reverse operation of the Pipe.
3874 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3875 # source pipe's "path".
3877 # @ref tui_creation_pipe_path "Example"
3878 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3880 Build a middle path of a pipe-like shape.
3881 The path shape can be a wire or an edge.
3884 theShape It can be closed or unclosed pipe-like shell
3885 or a pipe-like solid.
3886 theBase1, theBase2 Two bases of the supposed pipe. This
3887 should be wires or faces of theShape.
3888 theName Object name; when specified, this parameter is used
3889 for result publication in the study. Otherwise, if automatic
3890 publication is switched on, default value is used for result name.
3893 New GEOM_Object, containing an edge or wire that represent
3896 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3897 RaiseIfFailed("RestorePath", self.PrimOp)
3898 self._autoPublish(anObj, theName, "path")
3901 ## Build a middle path of a pipe-like shape.
3902 # The path shape can be a wire or an edge.
3903 # @param theShape It can be closed or unclosed pipe-like shell
3904 # or a pipe-like solid.
3905 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3906 # should be lists of edges of theShape.
3907 # @param theName Object name; when specified, this parameter is used
3908 # for result publication in the study. Otherwise, if automatic
3909 # publication is switched on, default value is used for result name.
3911 # @note It is not assumed that exact or approximate copy of theShape
3912 # can be obtained by applying existing Pipe operation on the
3913 # resulting "Path" wire taking theBase1 as the base - it is not
3914 # always possible; though in some particular cases it might work
3915 # it is not guaranteed. Thus, RestorePath function should not be
3916 # considered as an exact reverse operation of the Pipe.
3918 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3919 # source pipe's "path".
3921 # @ref tui_creation_pipe_path "Example"
3922 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3924 Build a middle path of a pipe-like shape.
3925 The path shape can be a wire or an edge.
3928 theShape It can be closed or unclosed pipe-like shell
3929 or a pipe-like solid.
3930 listEdges1, listEdges2 Two bases of the supposed pipe. This
3931 should be lists of edges of theShape.
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_Object, containing an edge or wire that represent
3940 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3941 RaiseIfFailed("RestorePath", self.PrimOp)
3942 self._autoPublish(anObj, theName, "path")
3948 ## @addtogroup l3_advanced
3951 ## Create a linear edge with specified ends.
3952 # @param thePnt1 Point for the first end of edge.
3953 # @param thePnt2 Point for the second end of edge.
3954 # @param theName Object name; when specified, this parameter is used
3955 # for result publication in the study. Otherwise, if automatic
3956 # publication is switched on, default value is used for result name.
3958 # @return New GEOM.GEOM_Object, containing the created edge.
3960 # @ref tui_creation_edge "Example"
3961 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3963 Create a linear edge with specified ends.
3966 thePnt1 Point for the first end of edge.
3967 thePnt2 Point for the second end of edge.
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 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3977 RaiseIfFailed("MakeEdge", self.ShapesOp)
3978 self._autoPublish(anObj, theName, "edge")
3981 ## Create a new edge, corresponding to the given length on the given curve.
3982 # @param theRefCurve The referenced curve (edge).
3983 # @param theLength Length on the referenced curve. It can be negative.
3984 # @param theStartPoint Any point can be selected for it, the new edge will begin
3985 # at the end of \a theRefCurve, close to the selected point.
3986 # If None, start from the first point of \a theRefCurve.
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 MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
3996 Create a new edge, corresponding to the given length on the given curve.
3999 theRefCurve The referenced curve (edge).
4000 theLength Length on the referenced curve. It can be negative.
4001 theStartPoint Any point can be selected for it, the new edge will begin
4002 at the end of theRefCurve, close to the selected point.
4003 If None, start from the first point of theRefCurve.
4004 theName Object name; when specified, this parameter is used
4005 for result publication in the study. Otherwise, if automatic
4006 publication is switched on, default value is used for result name.
4009 New GEOM.GEOM_Object, containing the created edge.
4011 # Example: see GEOM_TestAll.py
4012 theLength, Parameters = ParseParameters(theLength)
4013 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4014 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4015 anObj.SetParameters(Parameters)
4016 self._autoPublish(anObj, theName, "edge")
4019 ## Create an edge from specified wire.
4020 # @param theWire source Wire
4021 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4022 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4023 # @param theName Object name; when specified, this parameter is used
4024 # for result publication in the study. Otherwise, if automatic
4025 # publication is switched on, default value is used for result name.
4027 # @return New GEOM.GEOM_Object, containing the created edge.
4029 # @ref tui_creation_edge "Example"
4030 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4032 Create an edge from specified wire.
4036 theLinearTolerance linear tolerance value (default = 1e-07)
4037 theAngularTolerance angular tolerance value (default = 1e-12)
4038 theName Object name; when specified, this parameter is used
4039 for result publication in the study. Otherwise, if automatic
4040 publication is switched on, default value is used for result name.
4043 New GEOM.GEOM_Object, containing the created edge.
4045 # Example: see GEOM_TestAll.py
4046 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4047 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4048 self._autoPublish(anObj, theName, "edge")
4051 ## Create a wire from the set of edges and wires.
4052 # @param theEdgesAndWires List of edges and/or wires.
4053 # @param theTolerance Maximum distance between vertices, that will be merged.
4054 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4055 # @param theName Object name; when specified, this parameter is used
4056 # for result publication in the study. Otherwise, if automatic
4057 # publication is switched on, default value is used for result name.
4059 # @return New GEOM.GEOM_Object, containing the created wire.
4061 # @ref tui_creation_wire "Example"
4062 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4064 Create a wire from the set of edges and wires.
4067 theEdgesAndWires List of edges and/or wires.
4068 theTolerance Maximum distance between vertices, that will be merged.
4069 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4070 theName Object name; when specified, this parameter is used
4071 for result publication in the study. Otherwise, if automatic
4072 publication is switched on, default value is used for result name.
4075 New GEOM.GEOM_Object, containing the created wire.
4077 # Example: see GEOM_TestAll.py
4078 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4079 RaiseIfFailed("MakeWire", self.ShapesOp)
4080 self._autoPublish(anObj, theName, "wire")
4083 ## Create a face on the given wire.
4084 # @param theWire closed Wire or Edge to build the face on.
4085 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4086 # If the tolerance of the obtained planar face is less
4087 # than 1e-06, this face will be returned, otherwise the
4088 # algorithm tries to build any suitable face on the given
4089 # wire and prints a warning message.
4090 # @param theName Object name; when specified, this parameter is used
4091 # for result publication in the study. Otherwise, if automatic
4092 # publication is switched on, default value is used for result name.
4094 # @return New GEOM.GEOM_Object, containing the created face.
4096 # @ref tui_creation_face "Example"
4097 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4099 Create a face on the given wire.
4102 theWire closed Wire or Edge to build the face on.
4103 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4104 If the tolerance of the obtained planar face is less
4105 than 1e-06, this face will be returned, otherwise the
4106 algorithm tries to build any suitable face on the given
4107 wire and prints a warning message.
4108 theName Object name; when specified, this parameter is used
4109 for result publication in the study. Otherwise, if automatic
4110 publication is switched on, default value is used for result name.
4113 New GEOM.GEOM_Object, containing the created face.
4115 # Example: see GEOM_TestAll.py
4116 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4117 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4118 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4120 RaiseIfFailed("MakeFace", self.ShapesOp)
4121 self._autoPublish(anObj, theName, "face")
4124 ## Create a face on the given wires set.
4125 # @param theWires List of closed wires or edges to build the face on.
4126 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4127 # If the tolerance of the obtained planar face is less
4128 # than 1e-06, this face will be returned, otherwise the
4129 # algorithm tries to build any suitable face on the given
4130 # wire and prints a warning message.
4131 # @param theName Object name; when specified, this parameter is used
4132 # for result publication in the study. Otherwise, if automatic
4133 # publication is switched on, default value is used for result name.
4135 # @return New GEOM.GEOM_Object, containing the created face.
4137 # @ref tui_creation_face "Example"
4138 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4140 Create a face on the given wires set.
4143 theWires List of closed wires or edges to build the face on.
4144 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4145 If the tolerance of the obtained planar face is less
4146 than 1e-06, this face will be returned, otherwise the
4147 algorithm tries to build any suitable face on the given
4148 wire and prints a warning message.
4149 theName Object name; when specified, this parameter is used
4150 for result publication in the study. Otherwise, if automatic
4151 publication is switched on, default value is used for result name.
4154 New GEOM.GEOM_Object, containing the created face.
4156 # Example: see GEOM_TestAll.py
4157 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4158 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4159 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4161 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4162 self._autoPublish(anObj, theName, "face")
4165 ## See MakeFaceWires() method for details.
4167 # @ref tui_creation_face "Example 1"
4168 # \n @ref swig_MakeFaces "Example 2"
4169 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4171 See geompy.MakeFaceWires() method for details.
4173 # Example: see GEOM_TestOthers.py
4174 # note: auto-publishing is done in self.MakeFaceWires()
4175 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4178 ## Create a shell from the set of faces and shells.
4179 # @param theFacesAndShells List of faces and/or shells.
4180 # @param theName Object name; when specified, this parameter is used
4181 # for result publication in the study. Otherwise, if automatic
4182 # publication is switched on, default value is used for result name.
4184 # @return New GEOM.GEOM_Object, containing the created shell.
4186 # @ref tui_creation_shell "Example"
4187 def MakeShell(self, theFacesAndShells, theName=None):
4189 Create a shell from the set of faces and shells.
4192 theFacesAndShells List of faces and/or shells.
4193 theName Object name; when specified, this parameter is used
4194 for result publication in the study. Otherwise, if automatic
4195 publication is switched on, default value is used for result name.
4198 New GEOM.GEOM_Object, containing the created shell.
4200 # Example: see GEOM_TestAll.py
4201 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4202 RaiseIfFailed("MakeShell", self.ShapesOp)
4203 self._autoPublish(anObj, theName, "shell")
4206 ## Create a solid, bounded by the given shells.
4207 # @param theShells Sequence of bounding shells.
4208 # @param theName Object name; when specified, this parameter is used
4209 # for result publication in the study. Otherwise, if automatic
4210 # publication is switched on, default value is used for result name.
4212 # @return New GEOM.GEOM_Object, containing the created solid.
4214 # @ref tui_creation_solid "Example"
4215 def MakeSolid(self, theShells, theName=None):
4217 Create a solid, bounded by the given shells.
4220 theShells Sequence of bounding shells.
4221 theName Object name; when specified, this parameter is used
4222 for result publication in the study. Otherwise, if automatic
4223 publication is switched on, default value is used for result name.
4226 New GEOM.GEOM_Object, containing the created solid.
4228 # Example: see GEOM_TestAll.py
4229 if len(theShells) == 1:
4230 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4232 # raise RuntimeError, "MakeSolidShells : " + descr
4233 if descr == "WRN_SHAPE_UNCLOSED":
4234 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4235 anObj = self.ShapesOp.MakeSolidShells(theShells)
4236 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4237 self._autoPublish(anObj, theName, "solid")
4240 ## Create a compound of the given shapes.
4241 # @param theShapes List of shapes to put in compound.
4242 # @param theName Object name; when specified, this parameter is used
4243 # for result publication in the study. Otherwise, if automatic
4244 # publication is switched on, default value is used for result name.
4246 # @return New GEOM.GEOM_Object, containing the created compound.
4248 # @ref tui_creation_compound "Example"
4249 def MakeCompound(self, theShapes, theName=None):
4251 Create a compound of the given shapes.
4254 theShapes List of shapes to put in compound.
4255 theName Object name; when specified, this parameter is used
4256 for result publication in the study. Otherwise, if automatic
4257 publication is switched on, default value is used for result name.
4260 New GEOM.GEOM_Object, containing the created compound.
4262 # Example: see GEOM_TestAll.py
4263 anObj = self.ShapesOp.MakeCompound(theShapes)
4264 RaiseIfFailed("MakeCompound", self.ShapesOp)
4265 self._autoPublish(anObj, theName, "compound")
4268 # end of l3_advanced
4271 ## @addtogroup l2_measure
4274 ## Gives quantity of faces in the given shape.
4275 # @param theShape Shape to count faces of.
4276 # @return Quantity of faces.
4278 # @ref swig_NumberOf "Example"
4279 def NumberOfFaces(self, theShape):
4281 Gives quantity of faces in the given shape.
4284 theShape Shape to count faces of.
4289 # Example: see GEOM_TestOthers.py
4290 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4291 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4294 ## Gives quantity of edges in the given shape.
4295 # @param theShape Shape to count edges of.
4296 # @return Quantity of edges.
4298 # @ref swig_NumberOf "Example"
4299 def NumberOfEdges(self, theShape):
4301 Gives quantity of edges in the given shape.
4304 theShape Shape to count edges of.
4309 # Example: see GEOM_TestOthers.py
4310 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4311 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4314 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4315 # @param theShape Shape to count sub-shapes of.
4316 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4317 # @return Quantity of sub-shapes of given type.
4319 # @ref swig_NumberOf "Example"
4320 def NumberOfSubShapes(self, theShape, theShapeType):
4322 Gives quantity of sub-shapes of type theShapeType in the given shape.
4325 theShape Shape to count sub-shapes of.
4326 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4329 Quantity of sub-shapes of given type.
4331 # Example: see GEOM_TestOthers.py
4332 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4333 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4336 ## Gives quantity of solids in the given shape.
4337 # @param theShape Shape to count solids in.
4338 # @return Quantity of solids.
4340 # @ref swig_NumberOf "Example"
4341 def NumberOfSolids(self, theShape):
4343 Gives quantity of solids in the given shape.
4346 theShape Shape to count solids in.
4351 # Example: see GEOM_TestOthers.py
4352 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4353 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4359 ## @addtogroup l3_healing
4362 ## Reverses an orientation the given shape.
4363 # @param theShape Shape to be reversed.
4364 # @param theName Object name; when specified, this parameter is used
4365 # for result publication in the study. Otherwise, if automatic
4366 # publication is switched on, default value is used for result name.
4368 # @return The reversed copy of theShape.
4370 # @ref swig_ChangeOrientation "Example"
4371 def ChangeOrientation(self, theShape, theName=None):
4373 Reverses an orientation the given shape.
4376 theShape Shape to be reversed.
4377 theName Object name; when specified, this parameter is used
4378 for result publication in the study. Otherwise, if automatic
4379 publication is switched on, default value is used for result name.
4382 The reversed copy of theShape.
4384 # Example: see GEOM_TestAll.py
4385 anObj = self.ShapesOp.ChangeOrientation(theShape)
4386 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4387 self._autoPublish(anObj, theName, "reversed")
4390 ## See ChangeOrientation() method for details.
4392 # @ref swig_OrientationChange "Example"
4393 def OrientationChange(self, theShape, theName=None):
4395 See geompy.ChangeOrientation method for details.
4397 # Example: see GEOM_TestOthers.py
4398 # note: auto-publishing is done in self.ChangeOrientation()
4399 anObj = self.ChangeOrientation(theShape, theName)
4405 ## @addtogroup l4_obtain
4408 ## Retrieve all free faces from the given shape.
4409 # Free face is a face, which is not shared between two shells of the shape.
4410 # @param theShape Shape to find free faces in.
4411 # @return List of IDs of all free faces, contained in theShape.
4413 # @ref tui_measurement_tools_page "Example"
4414 def GetFreeFacesIDs(self,theShape):
4416 Retrieve all free faces from the given shape.
4417 Free face is a face, which is not shared between two shells of the shape.
4420 theShape Shape to find free faces in.
4423 List of IDs of all free faces, contained in theShape.
4425 # Example: see GEOM_TestOthers.py
4426 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4427 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4430 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4431 # @param theShape1 Shape to find sub-shapes in.
4432 # @param theShape2 Shape to find shared sub-shapes with.
4433 # @param theShapeType Type of sub-shapes to be retrieved.
4434 # @param theName Object name; when specified, this parameter is used
4435 # for result publication in the study. Otherwise, if automatic
4436 # publication is switched on, default value is used for result name.
4438 # @return List of sub-shapes of theShape1, shared with theShape2.
4440 # @ref swig_GetSharedShapes "Example"
4441 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4443 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4446 theShape1 Shape to find sub-shapes in.
4447 theShape2 Shape to find shared sub-shapes with.
4448 theShapeType Type of sub-shapes to be retrieved.
4449 theName Object name; when specified, this parameter is used
4450 for result publication in the study. Otherwise, if automatic
4451 publication is switched on, default value is used for result name.
4454 List of sub-shapes of theShape1, shared with theShape2.
4456 # Example: see GEOM_TestOthers.py
4457 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4458 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4459 self._autoPublish(aList, theName, "shared")
4462 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4463 # @param theShapes Shapes to find common sub-shapes of.
4464 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4465 # @param theName Object name; when specified, this parameter is used
4466 # for result publication in the study. Otherwise, if automatic
4467 # publication is switched on, default value is used for result name.
4469 # @return List of objects, that are sub-shapes of all given shapes.
4471 # @ref swig_GetSharedShapes "Example"
4472 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4474 Get all sub-shapes, shared by all shapes in the list theShapes.
4477 theShapes Shapes to find common sub-shapes of.
4478 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4479 theName Object name; when specified, this parameter is used
4480 for result publication in the study. Otherwise, if automatic
4481 publication is switched on, default value is used for result name.
4484 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4486 # Example: see GEOM_TestOthers.py
4487 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4488 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4489 self._autoPublish(aList, theName, "shared")
4492 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4493 # situated relatively the specified plane by the certain way,
4494 # defined through <VAR>theState</VAR> parameter.
4495 # @param theShape Shape to find sub-shapes of.
4496 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4497 # @param theAx1 Vector (or line, or linear edge), specifying normal
4498 # direction and location of the plane to find shapes on.
4499 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4500 # @param theName Object name; when specified, this parameter is used
4501 # for result publication in the study. Otherwise, if automatic
4502 # publication is switched on, default value is used for result name.
4504 # @return List of all found sub-shapes.
4506 # @ref swig_GetShapesOnPlane "Example"
4507 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4509 Find in theShape all sub-shapes of type theShapeType,
4510 situated relatively the specified plane by the certain way,
4511 defined through theState parameter.
4514 theShape Shape to find sub-shapes of.
4515 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4516 theAx1 Vector (or line, or linear edge), specifying normal
4517 direction and location of the plane to find shapes on.
4518 theState The state of the sub-shapes to find (see GEOM::shape_state)
4519 theName Object name; when specified, this parameter is used
4520 for result publication in the study. Otherwise, if automatic
4521 publication is switched on, default value is used for result name.
4524 List of all found sub-shapes.
4526 # Example: see GEOM_TestOthers.py
4527 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4528 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4529 self._autoPublish(aList, theName, "shapeOnPlane")
4532 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4533 # situated relatively the specified plane by the certain way,
4534 # defined through <VAR>theState</VAR> parameter.
4535 # @param theShape Shape to find sub-shapes of.
4536 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4537 # @param theAx1 Vector (or line, or linear edge), specifying normal
4538 # direction and location of the plane to find shapes on.
4539 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4541 # @return List of all found sub-shapes indices.
4543 # @ref swig_GetShapesOnPlaneIDs "Example"
4544 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4546 Find in theShape all sub-shapes of type theShapeType,
4547 situated relatively the specified plane by the certain way,
4548 defined through theState parameter.
4551 theShape Shape to find sub-shapes of.
4552 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4553 theAx1 Vector (or line, or linear edge), specifying normal
4554 direction and location of the plane to find shapes on.
4555 theState The state of the sub-shapes to find (see GEOM::shape_state)
4558 List of all found sub-shapes indices.
4560 # Example: see GEOM_TestOthers.py
4561 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4562 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4565 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4566 # situated relatively the specified plane by the certain way,
4567 # defined through <VAR>theState</VAR> parameter.
4568 # @param theShape Shape to find sub-shapes of.
4569 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4570 # @param theAx1 Vector (or line, or linear edge), specifying normal
4571 # direction of the plane to find shapes on.
4572 # @param thePnt Point specifying location of the plane to find shapes on.
4573 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4574 # @param theName Object name; when specified, this parameter is used
4575 # for result publication in the study. Otherwise, if automatic
4576 # publication is switched on, default value is used for result name.
4578 # @return List of all found sub-shapes.
4580 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4581 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4583 Find in theShape all sub-shapes of type theShapeType,
4584 situated relatively the specified plane by the certain way,
4585 defined through theState parameter.
4588 theShape Shape to find sub-shapes of.
4589 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4590 theAx1 Vector (or line, or linear edge), specifying normal
4591 direction and location of the plane to find shapes on.
4592 thePnt Point specifying location of the plane to find shapes on.
4593 theState The state of the sub-shapes to find (see GEOM::shape_state)
4594 theName Object name; when specified, this parameter is used
4595 for result publication in the study. Otherwise, if automatic
4596 publication is switched on, default value is used for result name.
4599 List of all found sub-shapes.
4601 # Example: see GEOM_TestOthers.py
4602 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4603 theAx1, thePnt, theState)
4604 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4605 self._autoPublish(aList, theName, "shapeOnPlane")
4608 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4609 # situated relatively the specified plane by the certain way,
4610 # defined through <VAR>theState</VAR> parameter.
4611 # @param theShape Shape to find sub-shapes of.
4612 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4613 # @param theAx1 Vector (or line, or linear edge), specifying normal
4614 # direction of the plane to find shapes on.
4615 # @param thePnt Point specifying location of the plane to find shapes on.
4616 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4618 # @return List of all found sub-shapes indices.
4620 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4621 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4623 Find in theShape all sub-shapes of type theShapeType,
4624 situated relatively the specified plane by the certain way,
4625 defined through theState parameter.
4628 theShape Shape to find sub-shapes of.
4629 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4630 theAx1 Vector (or line, or linear edge), specifying normal
4631 direction and location of the plane to find shapes on.
4632 thePnt Point specifying location of the plane to find shapes on.
4633 theState The state of the sub-shapes to find (see GEOM::shape_state)
4636 List of all found sub-shapes indices.
4638 # Example: see GEOM_TestOthers.py
4639 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4640 theAx1, thePnt, theState)
4641 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4644 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4645 # the specified cylinder by the certain way, defined through \a theState parameter.
4646 # @param theShape Shape to find sub-shapes of.
4647 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4648 # @param theAxis Vector (or line, or linear edge), specifying
4649 # axis of the cylinder to find shapes on.
4650 # @param theRadius Radius of the cylinder to find shapes on.
4651 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4652 # @param theName Object name; when specified, this parameter is used
4653 # for result publication in the study. Otherwise, if automatic
4654 # publication is switched on, default value is used for result name.
4656 # @return List of all found sub-shapes.
4658 # @ref swig_GetShapesOnCylinder "Example"
4659 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4661 Find in theShape all sub-shapes of type theShapeType, situated relatively
4662 the specified cylinder by the certain way, defined through theState parameter.
4665 theShape Shape to find sub-shapes of.
4666 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4667 theAxis Vector (or line, or linear edge), specifying
4668 axis of the cylinder to find shapes on.
4669 theRadius Radius of the cylinder to find shapes on.
4670 theState The state of the sub-shapes to find (see GEOM::shape_state)
4671 theName Object name; when specified, this parameter is used
4672 for result publication in the study. Otherwise, if automatic
4673 publication is switched on, default value is used for result name.
4676 List of all found sub-shapes.
4678 # Example: see GEOM_TestOthers.py
4679 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4680 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4681 self._autoPublish(aList, theName, "shapeOnCylinder")
4684 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4685 # the specified cylinder by the certain way, defined through \a theState parameter.
4686 # @param theShape Shape to find sub-shapes of.
4687 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4688 # @param theAxis Vector (or line, or linear edge), specifying
4689 # axis of the cylinder to find shapes on.
4690 # @param theRadius Radius of the cylinder to find shapes on.
4691 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4693 # @return List of all found sub-shapes indices.
4695 # @ref swig_GetShapesOnCylinderIDs "Example"
4696 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4698 Find in theShape all sub-shapes of type theShapeType, situated relatively
4699 the specified cylinder by the certain way, defined through theState parameter.
4702 theShape Shape to find sub-shapes of.
4703 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4704 theAxis Vector (or line, or linear edge), specifying
4705 axis of the cylinder to find shapes on.
4706 theRadius Radius of the cylinder to find shapes on.
4707 theState The state of the sub-shapes to find (see GEOM::shape_state)
4710 List of all found sub-shapes indices.
4712 # Example: see GEOM_TestOthers.py
4713 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4714 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4717 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4718 # the specified cylinder by the certain way, defined through \a theState parameter.
4719 # @param theShape Shape to find sub-shapes of.
4720 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4721 # @param theAxis Vector (or line, or linear edge), specifying
4722 # axis of the cylinder to find shapes on.
4723 # @param thePnt Point specifying location of the bottom of the cylinder.
4724 # @param theRadius Radius of the cylinder to find shapes on.
4725 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4726 # @param theName Object name; when specified, this parameter is used
4727 # for result publication in the study. Otherwise, if automatic
4728 # publication is switched on, default value is used for result name.
4730 # @return List of all found sub-shapes.
4732 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4733 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4735 Find in theShape all sub-shapes of type theShapeType, situated relatively
4736 the specified cylinder by the certain way, defined through theState parameter.
4739 theShape Shape to find sub-shapes of.
4740 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4741 theAxis Vector (or line, or linear edge), specifying
4742 axis of the cylinder to find shapes on.
4743 theRadius Radius of the cylinder to find shapes on.
4744 theState The state of the sub-shapes to find (see GEOM::shape_state)
4745 theName Object name; when specified, this parameter is used
4746 for result publication in the study. Otherwise, if automatic
4747 publication is switched on, default value is used for result name.
4750 List of all found sub-shapes.
4752 # Example: see GEOM_TestOthers.py
4753 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4754 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4755 self._autoPublish(aList, theName, "shapeOnCylinder")
4758 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4759 # the specified cylinder by the certain way, defined through \a theState parameter.
4760 # @param theShape Shape to find sub-shapes of.
4761 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4762 # @param theAxis Vector (or line, or linear edge), specifying
4763 # axis of the cylinder to find shapes on.
4764 # @param thePnt Point specifying location of the bottom of the cylinder.
4765 # @param theRadius Radius of the cylinder to find shapes on.
4766 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4768 # @return List of all found sub-shapes indices
4770 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4771 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4773 Find in theShape all sub-shapes of type theShapeType, situated relatively
4774 the specified cylinder by the certain way, defined through theState parameter.
4777 theShape Shape to find sub-shapes of.
4778 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4779 theAxis Vector (or line, or linear edge), specifying
4780 axis of the cylinder to find shapes on.
4781 theRadius Radius of the cylinder to find shapes on.
4782 theState The state of the sub-shapes to find (see GEOM::shape_state)
4785 List of all found sub-shapes indices.
4787 # Example: see GEOM_TestOthers.py
4788 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4789 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4792 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4793 # the specified sphere by the certain way, defined through \a theState parameter.
4794 # @param theShape Shape to find sub-shapes of.
4795 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4796 # @param theCenter Point, specifying center of the sphere to find shapes on.
4797 # @param theRadius Radius of the sphere to find shapes on.
4798 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4799 # @param theName Object name; when specified, this parameter is used
4800 # for result publication in the study. Otherwise, if automatic
4801 # publication is switched on, default value is used for result name.
4803 # @return List of all found sub-shapes.
4805 # @ref swig_GetShapesOnSphere "Example"
4806 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4808 Find in theShape all sub-shapes of type theShapeType, situated relatively
4809 the specified sphere by the certain way, defined through theState parameter.
4812 theShape Shape to find sub-shapes of.
4813 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4814 theCenter Point, specifying center of the sphere to find shapes on.
4815 theRadius Radius of the sphere to find shapes on.
4816 theState The state of the sub-shapes to find (see GEOM::shape_state)
4817 theName Object name; when specified, this parameter is used
4818 for result publication in the study. Otherwise, if automatic
4819 publication is switched on, default value is used for result name.
4822 List of all found sub-shapes.
4824 # Example: see GEOM_TestOthers.py
4825 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4826 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4827 self._autoPublish(aList, theName, "shapeOnSphere")
4830 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4831 # the specified sphere by the certain way, defined through \a theState parameter.
4832 # @param theShape Shape to find sub-shapes of.
4833 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4834 # @param theCenter Point, specifying center of the sphere to find shapes on.
4835 # @param theRadius Radius of the sphere to find shapes on.
4836 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4838 # @return List of all found sub-shapes indices.
4840 # @ref swig_GetShapesOnSphereIDs "Example"
4841 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4843 Find in theShape all sub-shapes of type theShapeType, situated relatively
4844 the specified sphere by the certain way, defined through theState parameter.
4847 theShape Shape to find sub-shapes of.
4848 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4849 theCenter Point, specifying center of the sphere to find shapes on.
4850 theRadius Radius of the sphere to find shapes on.
4851 theState The state of the sub-shapes to find (see GEOM::shape_state)
4854 List of all found sub-shapes indices.
4856 # Example: see GEOM_TestOthers.py
4857 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4858 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4861 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4862 # the specified quadrangle by the certain way, defined through \a theState parameter.
4863 # @param theShape Shape to find sub-shapes of.
4864 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4865 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4866 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4867 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4868 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4869 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4870 # @param theName Object name; when specified, this parameter is used
4871 # for result publication in the study. Otherwise, if automatic
4872 # publication is switched on, default value is used for result name.
4874 # @return List of all found sub-shapes.
4876 # @ref swig_GetShapesOnQuadrangle "Example"
4877 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4878 theTopLeftPoint, theTopRigthPoint,
4879 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4881 Find in theShape all sub-shapes of type theShapeType, situated relatively
4882 the specified quadrangle by the certain way, defined through theState parameter.
4885 theShape Shape to find sub-shapes of.
4886 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4887 theTopLeftPoint Point, specifying top left corner of a quadrangle
4888 theTopRigthPoint Point, specifying top right corner of a quadrangle
4889 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4890 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4891 theState The state of the sub-shapes to find (see GEOM::shape_state)
4892 theName Object name; when specified, this parameter is used
4893 for result publication in the study. Otherwise, if automatic
4894 publication is switched on, default value is used for result name.
4897 List of all found sub-shapes.
4899 # Example: see GEOM_TestOthers.py
4900 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4901 theTopLeftPoint, theTopRigthPoint,
4902 theBottomLeftPoint, theBottomRigthPoint, theState)
4903 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4904 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4907 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4908 # the specified quadrangle by the certain way, defined through \a theState parameter.
4909 # @param theShape Shape to find sub-shapes of.
4910 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4911 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4912 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4913 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4914 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4915 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4917 # @return List of all found sub-shapes indices.
4919 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4920 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4921 theTopLeftPoint, theTopRigthPoint,
4922 theBottomLeftPoint, theBottomRigthPoint, theState):
4924 Find in theShape all sub-shapes of type theShapeType, situated relatively
4925 the specified quadrangle by the certain way, defined through theState parameter.
4928 theShape Shape to find sub-shapes of.
4929 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4930 theTopLeftPoint Point, specifying top left corner of a quadrangle
4931 theTopRigthPoint Point, specifying top right corner of a quadrangle
4932 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4933 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4934 theState The state of the sub-shapes to find (see GEOM::shape_state)
4937 List of all found sub-shapes indices.
4940 # Example: see GEOM_TestOthers.py
4941 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4942 theTopLeftPoint, theTopRigthPoint,
4943 theBottomLeftPoint, theBottomRigthPoint, theState)
4944 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
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)
4953 # @param theName Object name; when specified, this parameter is used
4954 # for result publication in the study. Otherwise, if automatic
4955 # publication is switched on, default value is used for result name.
4957 # @return List of all found sub-shapes.
4959 # @ref swig_GetShapesOnBox "Example"
4960 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4962 Find in theShape all sub-shapes of type theShapeType, situated relatively
4963 the specified theBox by the certain way, defined through theState parameter.
4966 theBox Shape for relative comparing.
4967 theShape Shape to find sub-shapes of.
4968 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4969 theState The state of the sub-shapes to find (see GEOM::shape_state)
4970 theName Object name; when specified, this parameter is used
4971 for result publication in the study. Otherwise, if automatic
4972 publication is switched on, default value is used for result name.
4975 List of all found sub-shapes.
4977 # Example: see GEOM_TestOthers.py
4978 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
4979 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
4980 self._autoPublish(aList, theName, "shapeOnBox")
4983 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4984 # the specified \a theBox by the certain way, defined through \a theState parameter.
4985 # @param theBox Shape for relative comparing.
4986 # @param theShape Shape to find sub-shapes of.
4987 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4988 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4990 # @return List of all found sub-shapes indices.
4992 # @ref swig_GetShapesOnBoxIDs "Example"
4993 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
4995 Find in theShape all sub-shapes of type theShapeType, situated relatively
4996 the specified theBox by the certain way, defined through theState parameter.
4999 theBox Shape for relative comparing.
5000 theShape Shape to find sub-shapes of.
5001 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5002 theState The state of the sub-shapes to find (see GEOM::shape_state)
5005 List of all found sub-shapes indices.
5007 # Example: see GEOM_TestOthers.py
5008 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5009 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5012 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5013 # situated relatively the specified \a theCheckShape by the
5014 # certain way, defined through \a theState parameter.
5015 # @param theCheckShape Shape for relative comparing. It must be a solid.
5016 # @param theShape Shape to find sub-shapes of.
5017 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5018 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5019 # @param theName Object name; when specified, this parameter is used
5020 # for result publication in the study. Otherwise, if automatic
5021 # publication is switched on, default value is used for result name.
5023 # @return List of all found sub-shapes.
5025 # @ref swig_GetShapesOnShape "Example"
5026 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5028 Find in theShape all sub-shapes of type theShapeType,
5029 situated relatively the specified theCheckShape by the
5030 certain way, defined through theState parameter.
5033 theCheckShape Shape for relative comparing. It must be a solid.
5034 theShape Shape to find sub-shapes of.
5035 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5036 theState The state of the sub-shapes to find (see GEOM::shape_state)
5037 theName Object name; when specified, this parameter is used
5038 for result publication in the study. Otherwise, if automatic
5039 publication is switched on, default value is used for result name.
5042 List of all found sub-shapes.
5044 # Example: see GEOM_TestOthers.py
5045 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5046 theShapeType, theState)
5047 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5048 self._autoPublish(aList, theName, "shapeOnShape")
5051 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5052 # situated relatively the specified \a theCheckShape by the
5053 # certain way, defined through \a theState parameter.
5054 # @param theCheckShape Shape for relative comparing. It must be a solid.
5055 # @param theShape Shape to find sub-shapes of.
5056 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5057 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5058 # @param theName Object name; when specified, this parameter is used
5059 # for result publication in the study. Otherwise, if automatic
5060 # publication is switched on, default value is used for result name.
5062 # @return All found sub-shapes as compound.
5064 # @ref swig_GetShapesOnShapeAsCompound "Example"
5065 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
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)
5076 theName Object name; when specified, this parameter is used
5077 for result publication in the study. Otherwise, if automatic
5078 publication is switched on, default value is used for result name.
5081 All found sub-shapes as compound.
5083 # Example: see GEOM_TestOthers.py
5084 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5085 theShapeType, theState)
5086 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5087 self._autoPublish(anObj, theName, "shapeOnShape")
5090 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5091 # situated relatively the specified \a theCheckShape by the
5092 # certain way, defined through \a theState parameter.
5093 # @param theCheckShape Shape for relative comparing. It must be a solid.
5094 # @param theShape Shape to find sub-shapes of.
5095 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5096 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5098 # @return List of all found sub-shapes indices.
5100 # @ref swig_GetShapesOnShapeIDs "Example"
5101 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5103 Find in theShape all sub-shapes of type theShapeType,
5104 situated relatively the specified theCheckShape by the
5105 certain way, defined through theState parameter.
5108 theCheckShape Shape for relative comparing. It must be a solid.
5109 theShape Shape to find sub-shapes of.
5110 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5111 theState The state of the sub-shapes to find (see GEOM::shape_state)
5114 List of all found sub-shapes indices.
5116 # Example: see GEOM_TestOthers.py
5117 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5118 theShapeType, theState)
5119 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5122 ## Get sub-shape(s) of theShapeWhere, which are
5123 # coincident with \a theShapeWhat or could be a part of it.
5124 # @param theShapeWhere Shape to find sub-shapes of.
5125 # @param theShapeWhat Shape, specifying what to find.
5126 # @param isNewImplementation implementation of GetInPlace functionality
5127 # (default = False, old alghorithm based on shape properties)
5128 # @param theName Object name; when specified, this parameter is used
5129 # for result publication in the study. Otherwise, if automatic
5130 # publication is switched on, default value is used for result name.
5132 # @return Group of all found sub-shapes or a single found sub-shape.
5134 # @note This function has a restriction on argument shapes.
5135 # If \a theShapeWhere has curved parts with significantly
5136 # outstanding centres (i.e. the mass centre of a part is closer to
5137 # \a theShapeWhat than to the part), such parts will not be found.
5138 # @image html get_in_place_lost_part.png
5140 # @ref swig_GetInPlace "Example"
5141 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5143 Get sub-shape(s) of theShapeWhere, which are
5144 coincident with theShapeWhat or could be a part of it.
5147 theShapeWhere Shape to find sub-shapes of.
5148 theShapeWhat Shape, specifying what to find.
5149 isNewImplementation Implementation of GetInPlace functionality
5150 (default = False, old alghorithm based on shape properties)
5151 theName Object name; when specified, this parameter is used
5152 for result publication in the study. Otherwise, if automatic
5153 publication is switched on, default value is used for result name.
5156 Group of all found sub-shapes or a single found sub-shape.
5160 This function has a restriction on argument shapes.
5161 If theShapeWhere has curved parts with significantly
5162 outstanding centres (i.e. the mass centre of a part is closer to
5163 theShapeWhat than to the part), such parts will not be found.
5165 # Example: see GEOM_TestOthers.py
5167 if isNewImplementation:
5168 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5170 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5172 RaiseIfFailed("GetInPlace", self.ShapesOp)
5173 self._autoPublish(anObj, theName, "inplace")
5176 ## Get sub-shape(s) of \a theShapeWhere, which are
5177 # coincident with \a theShapeWhat or could be a part of it.
5179 # Implementation of this method is based on a saved history of an operation,
5180 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5181 # arguments (an argument shape or a sub-shape of an argument shape).
5182 # The operation could be the Partition or one of boolean operations,
5183 # performed on simple shapes (not on compounds).
5185 # @param theShapeWhere Shape to find sub-shapes of.
5186 # @param theShapeWhat Shape, specifying what to find (must be in the
5187 # building history of the ShapeWhere).
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 Group of all found sub-shapes or a single found sub-shape.
5194 # @ref swig_GetInPlace "Example"
5195 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5197 Implementation of this method is based on a saved history of an operation,
5198 produced theShapeWhere. The theShapeWhat must be among this operation's
5199 arguments (an argument shape or a sub-shape of an argument shape).
5200 The operation could be the Partition or one of boolean operations,
5201 performed on simple shapes (not on compounds).
5204 theShapeWhere Shape to find sub-shapes of.
5205 theShapeWhat Shape, specifying what to find (must be in the
5206 building history of the ShapeWhere).
5207 theName Object name; when specified, this parameter is used
5208 for result publication in the study. Otherwise, if automatic
5209 publication is switched on, default value is used for result name.
5212 Group of all found sub-shapes or a single found sub-shape.
5214 # Example: see GEOM_TestOthers.py
5215 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5216 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5217 self._autoPublish(anObj, theName, "inplace")
5220 ## Get sub-shape of theShapeWhere, which is
5221 # equal to \a theShapeWhat.
5222 # @param theShapeWhere Shape to find sub-shape of.
5223 # @param theShapeWhat Shape, specifying what to find.
5224 # @param theName Object name; when specified, this parameter is used
5225 # for result publication in the study. Otherwise, if automatic
5226 # publication is switched on, default value is used for result name.
5228 # @return New GEOM.GEOM_Object for found sub-shape.
5230 # @ref swig_GetSame "Example"
5231 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5233 Get sub-shape of theShapeWhere, which is
5234 equal to theShapeWhat.
5237 theShapeWhere Shape to find sub-shape of.
5238 theShapeWhat Shape, specifying what to find.
5239 theName Object name; when specified, this parameter is used
5240 for result publication in the study. Otherwise, if automatic
5241 publication is switched on, default value is used for result name.
5244 New GEOM.GEOM_Object for found sub-shape.
5246 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5247 RaiseIfFailed("GetSame", self.ShapesOp)
5248 self._autoPublish(anObj, theName, "sameShape")
5252 ## Get sub-shape indices of theShapeWhere, which is
5253 # equal to \a theShapeWhat.
5254 # @param theShapeWhere Shape to find sub-shape of.
5255 # @param theShapeWhat Shape, specifying what to find.
5256 # @return List of all found sub-shapes indices.
5258 # @ref swig_GetSame "Example"
5259 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5261 Get sub-shape indices of theShapeWhere, which is
5262 equal to theShapeWhat.
5265 theShapeWhere Shape to find sub-shape of.
5266 theShapeWhat Shape, specifying what to find.
5269 List of all found sub-shapes indices.
5271 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5272 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5279 ## @addtogroup l4_access
5282 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5283 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5284 # @param aShape Shape to get sub-shape of.
5285 # @param ListOfID List of sub-shapes indices.
5286 # @param theName Object name; when specified, this parameter is used
5287 # for result publication in the study. Otherwise, if automatic
5288 # publication is switched on, default value is used for result name.
5290 # @return Found sub-shape.
5292 # @ref swig_all_decompose "Example"
5293 def GetSubShape(self, aShape, ListOfID, theName=None):
5295 Obtain a composite sub-shape of aShape, composed from sub-shapes
5296 of aShape, selected by their unique IDs inside aShape
5299 aShape Shape to get sub-shape of.
5300 ListOfID List of sub-shapes indices.
5301 theName Object name; when specified, this parameter is used
5302 for result publication in the study. Otherwise, if automatic
5303 publication is switched on, default value is used for result name.
5308 # Example: see GEOM_TestAll.py
5309 anObj = self.AddSubShape(aShape,ListOfID)
5310 self._autoPublish(anObj, theName, "subshape")
5313 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5314 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5315 # @param aShape Shape to get sub-shape of.
5316 # @param aSubShape Sub-shapes of aShape.
5317 # @return ID of found sub-shape.
5319 # @ref swig_all_decompose "Example"
5320 def GetSubShapeID(self, aShape, aSubShape):
5322 Obtain unique ID of sub-shape aSubShape inside aShape
5323 of aShape, selected by their unique IDs inside aShape
5326 aShape Shape to get sub-shape of.
5327 aSubShape Sub-shapes of aShape.
5330 ID of found sub-shape.
5332 # Example: see GEOM_TestAll.py
5333 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5334 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5337 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5338 # This function is provided for performance purpose. The complexity is O(n) with n
5339 # the number of subobjects of aShape
5340 # @param aShape Shape to get sub-shape of.
5341 # @param aSubShapes Sub-shapes of aShape.
5342 # @return list of IDs of found sub-shapes.
5344 # @ref swig_all_decompose "Example"
5345 def GetSubShapesIDs(self, aShape, aSubShapes):
5347 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5348 This function is provided for performance purpose. The complexity is O(n) with n
5349 the number of subobjects of aShape
5352 aShape Shape to get sub-shape of.
5353 aSubShapes Sub-shapes of aShape.
5356 List of IDs of found sub-shape.
5358 # Example: see GEOM_TestAll.py
5359 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5360 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5366 ## @addtogroup l4_decompose
5369 ## Get all sub-shapes and groups of \a theShape,
5370 # that were created already by any other methods.
5371 # @param theShape Any shape.
5372 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5373 # returned, else all found sub-shapes and groups.
5374 # @return List of existing sub-objects of \a theShape.
5376 # @ref swig_all_decompose "Example"
5377 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5379 Get all sub-shapes and groups of theShape,
5380 that were created already by any other methods.
5384 theGroupsOnly If this parameter is TRUE, only groups will be
5385 returned, else all found sub-shapes and groups.
5388 List of existing sub-objects of theShape.
5390 # Example: see GEOM_TestAll.py
5391 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5392 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5395 ## Get all groups of \a theShape,
5396 # that were created already by any other methods.
5397 # @param theShape Any shape.
5398 # @return List of existing groups of \a theShape.
5400 # @ref swig_all_decompose "Example"
5401 def GetGroups(self, theShape):
5403 Get all groups of theShape,
5404 that were created already by any other methods.
5410 List of existing groups of theShape.
5412 # Example: see GEOM_TestAll.py
5413 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5414 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5417 ## Explode a shape on sub-shapes of a given type.
5418 # If the shape itself matches the type, it is also returned.
5419 # @param aShape Shape to be exploded.
5420 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5421 # @param theName Object name; when specified, this parameter is used
5422 # for result publication in the study. Otherwise, if automatic
5423 # publication is switched on, default value is used for result name.
5425 # @return List of sub-shapes of type theShapeType, contained in theShape.
5427 # @ref swig_all_decompose "Example"
5428 def SubShapeAll(self, aShape, aType, theName=None):
5430 Explode a shape on sub-shapes of a given type.
5431 If the shape itself matches the type, it is also returned.
5434 aShape Shape to be exploded.
5435 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5436 theName Object name; when specified, this parameter is used
5437 for result publication in the study. Otherwise, if automatic
5438 publication is switched on, default value is used for result name.
5441 List of sub-shapes of type theShapeType, contained in theShape.
5443 # Example: see GEOM_TestAll.py
5444 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5445 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5446 self._autoPublish(ListObj, theName, "subshape")
5449 ## Explode a shape on sub-shapes of a given type.
5450 # @param aShape Shape to be exploded.
5451 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5452 # @return List of IDs of sub-shapes.
5454 # @ref swig_all_decompose "Example"
5455 def SubShapeAllIDs(self, aShape, aType):
5457 Explode a shape on sub-shapes of a given type.
5460 aShape Shape to be exploded (see geompy.ShapeType)
5461 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5464 List of IDs of sub-shapes.
5466 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5467 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5470 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5471 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
5472 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5473 # @param aShape Shape to get sub-shape of.
5474 # @param ListOfInd List of sub-shapes indices.
5475 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5476 # @param theName Object name; when specified, this parameter is used
5477 # for result publication in the study. Otherwise, if automatic
5478 # publication is switched on, default value is used for result name.
5480 # @return A compound of sub-shapes of aShape.
5482 # @ref swig_all_decompose "Example"
5483 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5485 Obtain a compound of sub-shapes of aShape,
5486 selected by they indices in list of all sub-shapes of type aType.
5487 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5490 aShape Shape to get sub-shape of.
5491 ListOfID List of sub-shapes indices.
5492 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5493 theName Object name; when specified, this parameter is used
5494 for result publication in the study. Otherwise, if automatic
5495 publication is switched on, default value is used for result name.
5498 A compound of sub-shapes of aShape.
5500 # Example: see GEOM_TestAll.py
5502 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5503 for ind in ListOfInd:
5504 ListOfIDs.append(AllShapeIDsList[ind - 1])
5505 # note: auto-publishing is done in self.GetSubShape()
5506 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5509 ## Explode a shape on sub-shapes of a given type.
5510 # Sub-shapes will be sorted by coordinates of their gravity centers.
5511 # If the shape itself matches the type, it is also returned.
5512 # @param aShape Shape to be exploded.
5513 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5514 # @param theName Object name; when specified, this parameter is used
5515 # for result publication in the study. Otherwise, if automatic
5516 # publication is switched on, default value is used for result name.
5518 # @return List of sub-shapes of type theShapeType, contained in theShape.
5520 # @ref swig_SubShapeAllSorted "Example"
5521 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5523 Explode a shape on sub-shapes of a given type.
5524 Sub-shapes will be sorted by coordinates of their gravity centers.
5525 If the shape itself matches the type, it is also returned.
5528 aShape Shape to be exploded.
5529 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5530 theName Object name; when specified, this parameter is used
5531 for result publication in the study. Otherwise, if automatic
5532 publication is switched on, default value is used for result name.
5535 List of sub-shapes of type theShapeType, contained in theShape.
5537 # Example: see GEOM_TestAll.py
5538 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5539 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5540 self._autoPublish(ListObj, theName, "subshape")
5543 ## Explode a shape on sub-shapes of a given type.
5544 # Sub-shapes will be sorted by coordinates of their gravity centers.
5545 # @param aShape Shape to be exploded.
5546 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5547 # @return List of IDs of sub-shapes.
5549 # @ref swig_all_decompose "Example"
5550 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5552 Explode a shape on sub-shapes of a given type.
5553 Sub-shapes will be sorted by coordinates of their gravity centers.
5556 aShape Shape to be exploded.
5557 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5560 List of IDs of sub-shapes.
5562 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5563 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5566 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5567 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5568 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5569 # @param aShape Shape to get sub-shape of.
5570 # @param ListOfInd List of sub-shapes indices.
5571 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5572 # @param theName Object name; when specified, this parameter is used
5573 # for result publication in the study. Otherwise, if automatic
5574 # publication is switched on, default value is used for result name.
5576 # @return A compound of sub-shapes of aShape.
5578 # @ref swig_all_decompose "Example"
5579 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5581 Obtain a compound of sub-shapes of aShape,
5582 selected by they indices in sorted list of all sub-shapes of type aType.
5583 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5586 aShape Shape to get sub-shape of.
5587 ListOfID List of sub-shapes indices.
5588 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5589 theName Object name; when specified, this parameter is used
5590 for result publication in the study. Otherwise, if automatic
5591 publication is switched on, default value is used for result name.
5594 A compound of sub-shapes of aShape.
5596 # Example: see GEOM_TestAll.py
5598 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5599 for ind in ListOfInd:
5600 ListOfIDs.append(AllShapeIDsList[ind - 1])
5601 # note: auto-publishing is done in self.GetSubShape()
5602 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5605 ## Extract shapes (excluding the main shape) of given type.
5606 # @param aShape The shape.
5607 # @param aType The shape type (see ShapeType())
5608 # @param isSorted Boolean flag to switch sorting on/off.
5609 # @param theName Object name; when specified, this parameter is used
5610 # for result publication in the study. Otherwise, if automatic
5611 # publication is switched on, default value is used for result name.
5613 # @return List of sub-shapes of type aType, contained in aShape.
5615 # @ref swig_FilletChamfer "Example"
5616 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5618 Extract shapes (excluding the main shape) of given type.
5622 aType The shape type (see geompy.ShapeType)
5623 isSorted Boolean flag to switch sorting on/off.
5624 theName Object name; when specified, this parameter is used
5625 for result publication in the study. Otherwise, if automatic
5626 publication is switched on, default value is used for result name.
5629 List of sub-shapes of type aType, contained in aShape.
5631 # Example: see GEOM_TestAll.py
5632 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5633 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5634 self._autoPublish(ListObj, theName, "subshape")
5637 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5638 # @param aShape Main shape.
5639 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5640 # @param theName Object name; when specified, this parameter is used
5641 # for result publication in the study. Otherwise, if automatic
5642 # publication is switched on, default value is used for result name.
5643 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5645 # @ref swig_all_decompose "Example"
5646 def SubShapes(self, aShape, anIDs, theName=None):
5648 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5652 anIDs List of unique IDs of sub-shapes inside theMainShape.
5653 theName Object name; when specified, this parameter is used
5654 for result publication in the study. Otherwise, if automatic
5655 publication is switched on, default value is used for result name.
5658 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5660 # Example: see GEOM_TestAll.py
5661 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5662 RaiseIfFailed("SubShapes", self.ShapesOp)
5663 self._autoPublish(ListObj, theName, "subshape")
5666 # end of l4_decompose
5669 ## @addtogroup l4_decompose_d
5672 ## Deprecated method
5673 # It works like SubShapeAllSortedCentres(), but wrongly
5674 # defines centres of faces, shells and solids.
5675 def SubShapeAllSorted(self, aShape, aType, theName=None):
5678 It works like geompy.SubShapeAllSortedCentres, but wrongly
5679 defines centres of faces, shells and solids.
5681 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5682 RaiseIfFailed("MakeExplode", self.ShapesOp)
5683 self._autoPublish(ListObj, theName, "subshape")
5686 ## Deprecated method
5687 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5688 # defines centres of faces, shells and solids.
5689 def SubShapeAllSortedIDs(self, aShape, aType):
5692 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5693 defines centres of faces, shells and solids.
5695 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5696 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5699 ## Deprecated method
5700 # It works like SubShapeSortedCentres(), but has a bug
5701 # (wrongly defines centres of faces, shells and solids).
5702 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5705 It works like geompy.SubShapeSortedCentres, but has a bug
5706 (wrongly defines centres of faces, shells and solids).
5709 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5710 for ind in ListOfInd:
5711 ListOfIDs.append(AllShapeIDsList[ind - 1])
5712 # note: auto-publishing is done in self.GetSubShape()
5713 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5716 # end of l4_decompose_d
5719 ## @addtogroup l3_healing
5722 ## Apply a sequence of Shape Healing operators to the given object.
5723 # @param theShape Shape to be processed.
5724 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5725 # @param theParameters List of names of parameters
5726 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5727 # @param theValues List of values of parameters, in the same order
5728 # as parameters are listed in <VAR>theParameters</VAR> list.
5729 # @param theName Object name; when specified, this parameter is used
5730 # for result publication in the study. Otherwise, if automatic
5731 # publication is switched on, default value is used for result name.
5733 # <b> Operators and Parameters: </b> \n
5735 # * \b FixShape - corrects invalid shapes. \n
5736 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5737 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5739 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5740 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5741 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5742 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5744 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5745 # surfaces in segments using a certain angle. \n
5746 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5747 # if Angle=180, four if Angle=90, etc). \n
5748 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5750 # * \b SplitClosedFaces - splits closed faces in segments.
5751 # The number of segments depends on the number of splitting points.\n
5752 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5754 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5755 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5756 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5757 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5758 # This and the previous parameters can take the following values:\n
5759 # \b Parametric \b Continuity \n
5760 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5761 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5762 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5763 # ruling out sharp edges).\n
5764 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5765 # are of the same magnitude).\n
5766 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5767 # or surfaces (d/du C(u)) are the same at junction. \n
5768 # \b Geometric \b Continuity \n
5769 # \b G1: first derivatives are proportional at junction.\n
5770 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5771 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5772 # \b G2: first and second derivatives are proportional at junction.
5773 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5774 # continuity requires that the underlying parameterization was continuous as well.
5775 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5777 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5778 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5779 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5780 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5781 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5782 # with the specified parameters.\n
5783 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5784 # with the specified parameters.\n
5785 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5786 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5787 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5788 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5790 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5791 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5792 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5793 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5794 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5796 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5797 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5800 # @return New GEOM.GEOM_Object, containing processed shape.
5802 # \n @ref tui_shape_processing "Example"
5803 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5805 Apply a sequence of Shape Healing operators to the given object.
5808 theShape Shape to be processed.
5809 theValues List of values of parameters, in the same order
5810 as parameters are listed in theParameters list.
5811 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5812 theParameters List of names of parameters
5813 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5814 theName Object name; when specified, this parameter is used
5815 for result publication in the study. Otherwise, if automatic
5816 publication is switched on, default value is used for result name.
5818 Operators and Parameters:
5820 * FixShape - corrects invalid shapes.
5821 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5822 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5823 * FixFaceSize - removes small faces, such as spots and strips.
5824 * FixFaceSize.Tolerance - defines minimum possible face size.
5825 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5826 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5827 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5828 in segments using a certain angle.
5829 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5830 if Angle=180, four if Angle=90, etc).
5831 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5832 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5834 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5835 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5836 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5837 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5838 * SplitContinuity.CurveContinuity - required continuity for curves.
5839 This and the previous parameters can take the following values:
5841 Parametric Continuity:
5842 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5843 coincidental. The curves or surfaces may still meet at an angle,
5844 giving rise to a sharp corner or edge).
5845 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5846 are parallel, ruling out sharp edges).
5847 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5848 or surfaces are of the same magnitude).
5849 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5850 curves or surfaces (d/du C(u)) are the same at junction.
5852 Geometric Continuity:
5853 G1: first derivatives are proportional at junction.
5854 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5855 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5856 G2: first and second derivatives are proportional at junction. As the names imply,
5857 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5858 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5859 geometric continuity of order n, but not vice-versa.
5860 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5861 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5862 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5863 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5864 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5865 the specified parameters.
5866 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5867 the specified parameters.
5868 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5869 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5870 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5871 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5872 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5873 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5874 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5875 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5876 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5877 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5878 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5881 New GEOM.GEOM_Object, containing processed shape.
5883 Note: For more information look through SALOME Geometry User's Guide->
5884 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5886 # Example: see GEOM_TestHealing.py
5887 theValues,Parameters = ParseList(theValues)
5888 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5889 # To avoid script failure in case of good argument shape
5890 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5892 RaiseIfFailed("ProcessShape", self.HealOp)
5893 for string in (theOperators + theParameters):
5894 Parameters = ":" + Parameters
5896 anObj.SetParameters(Parameters)
5897 self._autoPublish(anObj, theName, "healed")
5900 ## Remove faces from the given object (shape).
5901 # @param theObject Shape to be processed.
5902 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5903 # removes ALL faces of the given object.
5904 # @param theName Object name; when specified, this parameter is used
5905 # for result publication in the study. Otherwise, if automatic
5906 # publication is switched on, default value is used for result name.
5908 # @return New GEOM.GEOM_Object, containing processed shape.
5910 # @ref tui_suppress_faces "Example"
5911 def SuppressFaces(self, theObject, theFaces, theName=None):
5913 Remove faces from the given object (shape).
5916 theObject Shape to be processed.
5917 theFaces Indices of faces to be removed, if EMPTY then the method
5918 removes ALL faces of the given object.
5919 theName Object name; when specified, this parameter is used
5920 for result publication in the study. Otherwise, if automatic
5921 publication is switched on, default value is used for result name.
5924 New GEOM.GEOM_Object, containing processed shape.
5926 # Example: see GEOM_TestHealing.py
5927 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5928 RaiseIfFailed("SuppressFaces", self.HealOp)
5929 self._autoPublish(anObj, theName, "suppressFaces")
5932 ## Sewing of some shapes into single shape.
5933 # @param ListShape Shapes to be processed.
5934 # @param theTolerance Required tolerance value.
5935 # @param AllowNonManifold Flag that allows non-manifold sewing.
5936 # @param theName Object name; when specified, this parameter is used
5937 # for result publication in the study. Otherwise, if automatic
5938 # publication is switched on, default value is used for result name.
5940 # @return New GEOM.GEOM_Object, containing processed shape.
5942 # @ref tui_sewing "Example"
5943 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5945 Sewing of some shapes into single shape.
5948 ListShape Shapes to be processed.
5949 theTolerance Required tolerance value.
5950 AllowNonManifold Flag that allows non-manifold sewing.
5951 theName Object name; when specified, this parameter is used
5952 for result publication in the study. Otherwise, if automatic
5953 publication is switched on, default value is used for result name.
5956 New GEOM.GEOM_Object, containing processed shape.
5958 # Example: see GEOM_TestHealing.py
5959 comp = self.MakeCompound(ListShape)
5960 # note: auto-publishing is done in self.Sew()
5961 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
5964 ## Sewing of the given object.
5965 # @param theObject Shape to be processed.
5966 # @param theTolerance Required tolerance value.
5967 # @param AllowNonManifold Flag that allows non-manifold sewing.
5968 # @param theName Object name; when specified, this parameter is used
5969 # for result publication in the study. Otherwise, if automatic
5970 # publication is switched on, default value is used for result name.
5972 # @return New GEOM.GEOM_Object, containing processed shape.
5973 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
5975 Sewing of the given object.
5978 theObject Shape to be processed.
5979 theTolerance Required tolerance value.
5980 AllowNonManifold Flag that allows non-manifold sewing.
5981 theName Object name; when specified, this parameter is used
5982 for result publication in the study. Otherwise, if automatic
5983 publication is switched on, default value is used for result name.
5986 New GEOM.GEOM_Object, containing processed shape.
5988 # Example: see MakeSewing() above
5989 theTolerance,Parameters = ParseParameters(theTolerance)
5990 if AllowNonManifold:
5991 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
5993 anObj = self.HealOp.Sew(theObject, theTolerance)
5994 RaiseIfFailed("Sew", self.HealOp)
5995 anObj.SetParameters(Parameters)
5996 self._autoPublish(anObj, theName, "sewed")
5999 ## Rebuild the topology of theCompound of solids by removing
6000 # of the faces that are shared by several solids.
6001 # @param theCompound Shape to be processed.
6002 # @param theName Object name; when specified, this parameter is used
6003 # for result publication in the study. Otherwise, if automatic
6004 # publication is switched on, default value is used for result name.
6006 # @return New GEOM.GEOM_Object, containing processed shape.
6008 # @ref tui_remove_webs "Example"
6009 def RemoveInternalFaces (self, theCompound, theName=None):
6011 Rebuild the topology of theCompound of solids by removing
6012 of the faces that are shared by several solids.
6015 theCompound Shape to be processed.
6016 theName Object name; when specified, this parameter is used
6017 for result publication in the study. Otherwise, if automatic
6018 publication is switched on, default value is used for result name.
6021 New GEOM.GEOM_Object, containing processed shape.
6023 # Example: see GEOM_TestHealing.py
6024 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6025 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6026 self._autoPublish(anObj, theName, "removeWebs")
6029 ## Remove internal wires and edges from the given object (face).
6030 # @param theObject Shape to be processed.
6031 # @param theWires Indices of wires to be removed, if EMPTY then the method
6032 # removes ALL internal wires of the given object.
6033 # @param theName Object name; when specified, this parameter is used
6034 # for result publication in the study. Otherwise, if automatic
6035 # publication is switched on, default value is used for result name.
6037 # @return New GEOM.GEOM_Object, containing processed shape.
6039 # @ref tui_suppress_internal_wires "Example"
6040 def SuppressInternalWires(self, theObject, theWires, theName=None):
6042 Remove internal wires and edges from the given object (face).
6045 theObject Shape to be processed.
6046 theWires Indices of wires to be removed, if EMPTY then the method
6047 removes ALL internal wires of the given object.
6048 theName Object name; when specified, this parameter is used
6049 for result publication in the study. Otherwise, if automatic
6050 publication is switched on, default value is used for result name.
6053 New GEOM.GEOM_Object, containing processed shape.
6055 # Example: see GEOM_TestHealing.py
6056 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6057 RaiseIfFailed("RemoveIntWires", self.HealOp)
6058 self._autoPublish(anObj, theName, "suppressWires")
6061 ## Remove internal closed contours (holes) from the given object.
6062 # @param theObject Shape to be processed.
6063 # @param theWires Indices of wires to be removed, if EMPTY then the method
6064 # removes ALL internal holes of the given object
6065 # @param theName Object name; when specified, this parameter is used
6066 # for result publication in the study. Otherwise, if automatic
6067 # publication is switched on, default value is used for result name.
6069 # @return New GEOM.GEOM_Object, containing processed shape.
6071 # @ref tui_suppress_holes "Example"
6072 def SuppressHoles(self, theObject, theWires, theName=None):
6074 Remove internal closed contours (holes) from the given object.
6077 theObject Shape to be processed.
6078 theWires Indices of wires to be removed, if EMPTY then the method
6079 removes ALL internal holes of the given object
6080 theName Object name; when specified, this parameter is used
6081 for result publication in the study. Otherwise, if automatic
6082 publication is switched on, default value is used for result name.
6085 New GEOM.GEOM_Object, containing processed shape.
6087 # Example: see GEOM_TestHealing.py
6088 anObj = self.HealOp.FillHoles(theObject, theWires)
6089 RaiseIfFailed("FillHoles", self.HealOp)
6090 self._autoPublish(anObj, theName, "suppressHoles")
6093 ## Close an open wire.
6094 # @param theObject Shape to be processed.
6095 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6096 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6097 # @param isCommonVertex If True : closure by creation of a common vertex,
6098 # If False : closure by creation of an edge between ends.
6099 # @param theName Object name; when specified, this parameter is used
6100 # for result publication in the study. Otherwise, if automatic
6101 # publication is switched on, default value is used for result name.
6103 # @return New GEOM.GEOM_Object, containing processed shape.
6105 # @ref tui_close_contour "Example"
6106 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6111 theObject Shape to be processed.
6112 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6113 if [ ], then theObject itself is a wire.
6114 isCommonVertex If True : closure by creation of a common vertex,
6115 If False : closure by creation of an edge between ends.
6116 theName Object name; when specified, this parameter is used
6117 for result publication in the study. Otherwise, if automatic
6118 publication is switched on, default value is used for result name.
6121 New GEOM.GEOM_Object, containing processed shape.
6123 # Example: see GEOM_TestHealing.py
6124 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6125 RaiseIfFailed("CloseContour", self.HealOp)
6126 self._autoPublish(anObj, theName, "closeContour")
6129 ## Addition of a point to a given edge object.
6130 # @param theObject Shape to be processed.
6131 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6132 # if -1, then theObject itself is the edge.
6133 # @param theValue Value of parameter on edge or length parameter,
6134 # depending on \a isByParameter.
6135 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6136 # if FALSE : \a theValue is treated as a length parameter [0..1]
6137 # @param theName Object name; when specified, this parameter is used
6138 # for result publication in the study. Otherwise, if automatic
6139 # publication is switched on, default value is used for result name.
6141 # @return New GEOM.GEOM_Object, containing processed shape.
6143 # @ref tui_add_point_on_edge "Example"
6144 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6146 Addition of a point to a given edge object.
6149 theObject Shape to be processed.
6150 theEdgeIndex Index of edge to be divided within theObject's shape,
6151 if -1, then theObject itself is the edge.
6152 theValue Value of parameter on edge or length parameter,
6153 depending on isByParameter.
6154 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6155 if FALSE : theValue is treated as a length parameter [0..1]
6156 theName Object name; when specified, this parameter is used
6157 for result publication in the study. Otherwise, if automatic
6158 publication is switched on, default value is used for result name.
6161 New GEOM.GEOM_Object, containing processed shape.
6163 # Example: see GEOM_TestHealing.py
6164 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6165 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6166 RaiseIfFailed("DivideEdge", self.HealOp)
6167 anObj.SetParameters(Parameters)
6168 self._autoPublish(anObj, theName, "divideEdge")
6171 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6172 # @param theWire Wire to minimize the number of C1 continuous edges in.
6173 # @param theVertices A list of vertices to suppress. If the list
6174 # is empty, all vertices in a wire will be assumed.
6175 # @param theName Object name; when specified, this parameter is used
6176 # for result publication in the study. Otherwise, if automatic
6177 # publication is switched on, default value is used for result name.
6179 # @return New GEOM.GEOM_Object with modified wire.
6181 # @ref tui_fuse_collinear_edges "Example"
6182 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6184 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6187 theWire Wire to minimize the number of C1 continuous edges in.
6188 theVertices A list of vertices to suppress. If the list
6189 is empty, all vertices in a wire will be assumed.
6190 theName Object name; when specified, this parameter is used
6191 for result publication in the study. Otherwise, if automatic
6192 publication is switched on, default value is used for result name.
6195 New GEOM.GEOM_Object with modified wire.
6197 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6198 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6199 self._autoPublish(anObj, theName, "fuseEdges")
6202 ## Change orientation of the given object. Updates given shape.
6203 # @param theObject Shape to be processed.
6204 # @return Updated <var>theObject</var>
6206 # @ref swig_todo "Example"
6207 def ChangeOrientationShell(self,theObject):
6209 Change orientation of the given object. Updates given shape.
6212 theObject Shape to be processed.
6217 theObject = self.HealOp.ChangeOrientation(theObject)
6218 RaiseIfFailed("ChangeOrientation", self.HealOp)
6221 ## Change orientation of the given object.
6222 # @param theObject Shape to be processed.
6223 # @param theName Object name; when specified, this parameter is used
6224 # for result publication in the study. Otherwise, if automatic
6225 # publication is switched on, default value is used for result name.
6227 # @return New GEOM.GEOM_Object, containing processed shape.
6229 # @ref swig_todo "Example"
6230 def ChangeOrientationShellCopy(self, theObject, theName=None):
6232 Change orientation of the given object.
6235 theObject Shape to be processed.
6236 theName Object name; when specified, this parameter is used
6237 for result publication in the study. Otherwise, if automatic
6238 publication is switched on, default value is used for result name.
6241 New GEOM.GEOM_Object, containing processed shape.
6243 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6244 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6245 self._autoPublish(anObj, theName, "reversed")
6248 ## Try to limit tolerance of the given object by value \a theTolerance.
6249 # @param theObject Shape to be processed.
6250 # @param theTolerance Required tolerance value.
6251 # @param theName Object name; when specified, this parameter is used
6252 # for result publication in the study. Otherwise, if automatic
6253 # publication is switched on, default value is used for result name.
6255 # @return New GEOM.GEOM_Object, containing processed shape.
6257 # @ref tui_limit_tolerance "Example"
6258 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6260 Try to limit tolerance of the given object by value theTolerance.
6263 theObject Shape to be processed.
6264 theTolerance Required tolerance value.
6265 theName Object name; when specified, this parameter is used
6266 for result publication in the study. Otherwise, if automatic
6267 publication is switched on, default value is used for result name.
6270 New GEOM.GEOM_Object, containing processed shape.
6272 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6273 RaiseIfFailed("LimitTolerance", self.HealOp)
6274 self._autoPublish(anObj, theName, "limitTolerance")
6277 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6278 # that constitute a free boundary of the given shape.
6279 # @param theObject Shape to get free boundary of.
6280 # @param theName Object name; when specified, this parameter is used
6281 # for result publication in the study. Otherwise, if automatic
6282 # publication is switched on, default value is used for result name.
6284 # @return [\a status, \a theClosedWires, \a theOpenWires]
6285 # \n \a status: FALSE, if an error(s) occured during the method execution.
6286 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6287 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6289 # @ref tui_measurement_tools_page "Example"
6290 def GetFreeBoundary(self, theObject, theName=None):
6292 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6293 that constitute a free boundary of the given shape.
6296 theObject Shape to get free boundary of.
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.
6302 [status, theClosedWires, theOpenWires]
6303 status: FALSE, if an error(s) occured during the method execution.
6304 theClosedWires: Closed wires on the free boundary of the given shape.
6305 theOpenWires: Open wires on the free boundary of the given shape.
6307 # Example: see GEOM_TestHealing.py
6308 anObj = self.HealOp.GetFreeBoundary(theObject)
6309 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6310 self._autoPublish(anObj[1], theName, "closedWire")
6311 self._autoPublish(anObj[2], theName, "openWire")
6314 ## Replace coincident faces in theShape by one face.
6315 # @param theShape Initial shape.
6316 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6317 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6318 # otherwise all initial shapes.
6319 # @param theName Object name; when specified, this parameter is used
6320 # for result publication in the study. Otherwise, if automatic
6321 # publication is switched on, default value is used for result name.
6323 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6325 # @ref tui_glue_faces "Example"
6326 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6328 Replace coincident faces in theShape by one face.
6331 theShape Initial shape.
6332 theTolerance Maximum distance between faces, which can be considered as coincident.
6333 doKeepNonSolids If FALSE, only solids will present in the result,
6334 otherwise all initial shapes.
6335 theName Object name; when specified, this parameter is used
6336 for result publication in the study. Otherwise, if automatic
6337 publication is switched on, default value is used for result name.
6340 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6342 # Example: see GEOM_Spanner.py
6343 theTolerance,Parameters = ParseParameters(theTolerance)
6344 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6346 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6347 anObj.SetParameters(Parameters)
6348 self._autoPublish(anObj, theName, "glueFaces")
6351 ## Find coincident faces in theShape for possible gluing.
6352 # @param theShape Initial shape.
6353 # @param theTolerance Maximum distance between faces,
6354 # which can be considered as coincident.
6355 # @param theName Object name; when specified, this parameter is used
6356 # for result publication in the study. Otherwise, if automatic
6357 # publication is switched on, default value is used for result name.
6359 # @return GEOM.ListOfGO
6361 # @ref tui_glue_faces "Example"
6362 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6364 Find coincident faces in theShape for possible gluing.
6367 theShape Initial shape.
6368 theTolerance Maximum distance between faces,
6369 which can be considered as coincident.
6370 theName Object name; when specified, this parameter is used
6371 for result publication in the study. Otherwise, if automatic
6372 publication is switched on, default value is used for result name.
6377 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6378 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6379 self._autoPublish(anObj, theName, "facesToGlue")
6382 ## Replace coincident faces in theShape by one face
6383 # in compliance with given list of faces
6384 # @param theShape Initial shape.
6385 # @param theTolerance Maximum distance between faces,
6386 # which can be considered as coincident.
6387 # @param theFaces List of faces for gluing.
6388 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6389 # otherwise all initial shapes.
6390 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6391 # will be glued, otherwise only the edges,
6392 # belonging to <VAR>theFaces</VAR>.
6393 # @param theName Object name; when specified, this parameter is used
6394 # for result publication in the study. Otherwise, if automatic
6395 # publication is switched on, default value is used for result name.
6397 # @return New GEOM.GEOM_Object, containing a copy of theShape
6398 # without some faces.
6400 # @ref tui_glue_faces "Example"
6401 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6402 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6404 Replace coincident faces in theShape by one face
6405 in compliance with given list of faces
6408 theShape Initial shape.
6409 theTolerance Maximum distance between faces,
6410 which can be considered as coincident.
6411 theFaces List of faces for gluing.
6412 doKeepNonSolids If FALSE, only solids will present in the result,
6413 otherwise all initial shapes.
6414 doGlueAllEdges If TRUE, all coincident edges of theShape
6415 will be glued, otherwise only the edges,
6416 belonging to theFaces.
6417 theName Object name; when specified, this parameter is used
6418 for result publication in the study. Otherwise, if automatic
6419 publication is switched on, default value is used for result name.
6422 New GEOM.GEOM_Object, containing a copy of theShape
6425 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6426 doKeepNonSolids, doGlueAllEdges)
6428 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6429 self._autoPublish(anObj, theName, "glueFaces")
6432 ## Replace coincident edges in theShape by one edge.
6433 # @param theShape Initial shape.
6434 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6435 # @param theName Object name; when specified, this parameter is used
6436 # for result publication in the study. Otherwise, if automatic
6437 # publication is switched on, default value is used for result name.
6439 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6441 # @ref tui_glue_edges "Example"
6442 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6444 Replace coincident edges in theShape by one edge.
6447 theShape Initial shape.
6448 theTolerance Maximum distance between edges, which can be considered as coincident.
6449 theName Object name; when specified, this parameter is used
6450 for result publication in the study. Otherwise, if automatic
6451 publication is switched on, default value is used for result name.
6454 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6456 theTolerance,Parameters = ParseParameters(theTolerance)
6457 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6459 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6460 anObj.SetParameters(Parameters)
6461 self._autoPublish(anObj, theName, "glueEdges")
6464 ## Find coincident edges in theShape for possible gluing.
6465 # @param theShape Initial shape.
6466 # @param theTolerance Maximum distance between edges,
6467 # which can be considered as coincident.
6468 # @param theName Object name; when specified, this parameter is used
6469 # for result publication in the study. Otherwise, if automatic
6470 # publication is switched on, default value is used for result name.
6472 # @return GEOM.ListOfGO
6474 # @ref tui_glue_edges "Example"
6475 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6477 Find coincident edges in theShape for possible gluing.
6480 theShape Initial shape.
6481 theTolerance Maximum distance between edges,
6482 which can be considered as coincident.
6483 theName Object name; when specified, this parameter is used
6484 for result publication in the study. Otherwise, if automatic
6485 publication is switched on, default value is used for result name.
6490 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6491 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6492 self._autoPublish(anObj, theName, "edgesToGlue")
6495 ## Replace coincident edges in theShape by one edge
6496 # in compliance with given list of edges.
6497 # @param theShape Initial shape.
6498 # @param theTolerance Maximum distance between edges,
6499 # which can be considered as coincident.
6500 # @param theEdges List of edges for gluing.
6501 # @param theName Object name; when specified, this parameter is used
6502 # for result publication in the study. Otherwise, if automatic
6503 # publication is switched on, default value is used for result name.
6505 # @return New GEOM.GEOM_Object, containing a copy of theShape
6506 # without some edges.
6508 # @ref tui_glue_edges "Example"
6509 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6511 Replace coincident edges in theShape by one edge
6512 in compliance with given list of edges.
6515 theShape Initial shape.
6516 theTolerance Maximum distance between edges,
6517 which can be considered as coincident.
6518 theEdges List of edges for gluing.
6519 theName Object name; when specified, this parameter is used
6520 for result publication in the study. Otherwise, if automatic
6521 publication is switched on, default value is used for result name.
6524 New GEOM.GEOM_Object, containing a copy of theShape
6527 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6529 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6530 self._autoPublish(anObj, theName, "glueEdges")
6536 ## @addtogroup l3_boolean Boolean Operations
6539 # -----------------------------------------------------------------------------
6540 # Boolean (Common, Cut, Fuse, Section)
6541 # -----------------------------------------------------------------------------
6543 ## Perform one of boolean operations on two given shapes.
6544 # @param theShape1 First argument for boolean operation.
6545 # @param theShape2 Second argument for boolean operation.
6546 # @param theOperation Indicates the operation to be done:\n
6547 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6548 # @param theName Object name; when specified, this parameter is used
6549 # for result publication in the study. Otherwise, if automatic
6550 # publication is switched on, default value is used for result name.
6552 # @return New GEOM.GEOM_Object, containing the result shape.
6554 # @ref tui_fuse "Example"
6555 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6557 Perform one of boolean operations on two given shapes.
6560 theShape1 First argument for boolean operation.
6561 theShape2 Second argument for boolean operation.
6562 theOperation Indicates the operation to be done:
6563 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6564 theName Object name; when specified, this parameter is used
6565 for result publication in the study. Otherwise, if automatic
6566 publication is switched on, default value is used for result name.
6569 New GEOM.GEOM_Object, containing the result shape.
6571 # Example: see GEOM_TestAll.py
6572 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6573 RaiseIfFailed("MakeBoolean", self.BoolOp)
6574 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6575 self._autoPublish(anObj, theName, def_names[theOperation])
6578 ## Perform Common boolean operation on two given shapes.
6579 # @param theShape1 First argument for boolean operation.
6580 # @param theShape2 Second argument for boolean operation.
6581 # @param theName Object name; when specified, this parameter is used
6582 # for result publication in the study. Otherwise, if automatic
6583 # publication is switched on, default value is used for result name.
6585 # @return New GEOM.GEOM_Object, containing the result shape.
6587 # @ref tui_common "Example 1"
6588 # \n @ref swig_MakeCommon "Example 2"
6589 def MakeCommon(self, theShape1, theShape2, theName=None):
6591 Perform Common boolean operation on two given shapes.
6594 theShape1 First argument for boolean operation.
6595 theShape2 Second argument for boolean operation.
6596 theName Object name; when specified, this parameter is used
6597 for result publication in the study. Otherwise, if automatic
6598 publication is switched on, default value is used for result name.
6601 New GEOM.GEOM_Object, containing the result shape.
6603 # Example: see GEOM_TestOthers.py
6604 # note: auto-publishing is done in self.MakeBoolean()
6605 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6607 ## Perform Cut boolean operation on two given shapes.
6608 # @param theShape1 First argument for boolean operation.
6609 # @param theShape2 Second argument for boolean operation.
6610 # @param theName Object name; when specified, this parameter is used
6611 # for result publication in the study. Otherwise, if automatic
6612 # publication is switched on, default value is used for result name.
6614 # @return New GEOM.GEOM_Object, containing the result shape.
6616 # @ref tui_cut "Example 1"
6617 # \n @ref swig_MakeCommon "Example 2"
6618 def MakeCut(self, theShape1, theShape2, theName=None):
6620 Perform Cut boolean operation on two given shapes.
6623 theShape1 First argument for boolean operation.
6624 theShape2 Second argument for boolean operation.
6625 theName Object name; when specified, this parameter is used
6626 for result publication in the study. Otherwise, if automatic
6627 publication is switched on, default value is used for result name.
6630 New GEOM.GEOM_Object, containing the result shape.
6633 # Example: see GEOM_TestOthers.py
6634 # note: auto-publishing is done in self.MakeBoolean()
6635 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6637 ## Perform Fuse boolean operation on two given shapes.
6638 # @param theShape1 First argument for boolean operation.
6639 # @param theShape2 Second argument for boolean operation.
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 # @return New GEOM.GEOM_Object, containing the result shape.
6646 # @ref tui_fuse "Example 1"
6647 # \n @ref swig_MakeCommon "Example 2"
6648 def MakeFuse(self, theShape1, theShape2, theName=None):
6650 Perform Fuse boolean operation on two given shapes.
6653 theShape1 First argument for boolean operation.
6654 theShape2 Second argument for boolean operation.
6655 theName Object name; when specified, this parameter is used
6656 for result publication in the study. Otherwise, if automatic
6657 publication is switched on, default value is used for result name.
6660 New GEOM.GEOM_Object, containing the result shape.
6663 # Example: see GEOM_TestOthers.py
6664 # note: auto-publishing is done in self.MakeBoolean()
6665 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6667 ## Perform Section boolean operation on two given shapes.
6668 # @param theShape1 First argument for boolean operation.
6669 # @param theShape2 Second argument for boolean operation.
6670 # @param theName Object name; when specified, this parameter is used
6671 # for result publication in the study. Otherwise, if automatic
6672 # publication is switched on, default value is used for result name.
6674 # @return New GEOM.GEOM_Object, containing the result shape.
6676 # @ref tui_section "Example 1"
6677 # \n @ref swig_MakeCommon "Example 2"
6678 def MakeSection(self, theShape1, theShape2, theName=None):
6680 Perform Section boolean operation on two given shapes.
6683 theShape1 First argument for boolean operation.
6684 theShape2 Second argument for boolean operation.
6685 theName Object name; when specified, this parameter is used
6686 for result publication in the study. Otherwise, if automatic
6687 publication is switched on, default value is used for result name.
6690 New GEOM.GEOM_Object, containing the result shape.
6693 # Example: see GEOM_TestOthers.py
6694 # note: auto-publishing is done in self.MakeBoolean()
6695 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6697 ## Perform Fuse boolean operation on the list of shapes.
6698 # @param theShapesList Shapes to be fused.
6699 # @param theName Object name; when specified, this parameter is used
6700 # for result publication in the study. Otherwise, if automatic
6701 # publication is switched on, default value is used for result name.
6703 # @return New GEOM.GEOM_Object, containing the result shape.
6705 # @ref tui_fuse "Example 1"
6706 # \n @ref swig_MakeCommon "Example 2"
6707 def MakeFuseList(self, theShapesList, theName=None):
6709 Perform Fuse boolean operation on the list of shapes.
6712 theShapesList Shapes to be fused.
6713 theName Object name; when specified, this parameter is used
6714 for result publication in the study. Otherwise, if automatic
6715 publication is switched on, default value is used for result name.
6718 New GEOM.GEOM_Object, containing the result shape.
6721 # Example: see GEOM_TestOthers.py
6722 anObj = self.BoolOp.MakeFuseList(theShapesList)
6723 RaiseIfFailed("MakeFuseList", self.BoolOp)
6724 self._autoPublish(anObj, theName, "fuse")
6727 ## Perform Common boolean operation on the list of shapes.
6728 # @param theShapesList Shapes for Common operation.
6729 # @param theName Object name; when specified, this parameter is used
6730 # for result publication in the study. Otherwise, if automatic
6731 # publication is switched on, default value is used for result name.
6733 # @return New GEOM.GEOM_Object, containing the result shape.
6735 # @ref tui_common "Example 1"
6736 # \n @ref swig_MakeCommon "Example 2"
6737 def MakeCommonList(self, theShapesList, theName=None):
6739 Perform Common boolean operation on the list of shapes.
6742 theShapesList Shapes for Common operation.
6743 theName Object name; when specified, this parameter is used
6744 for result publication in the study. Otherwise, if automatic
6745 publication is switched on, default value is used for result name.
6748 New GEOM.GEOM_Object, containing the result shape.
6751 # Example: see GEOM_TestOthers.py
6752 anObj = self.BoolOp.MakeCommonList(theShapesList)
6753 RaiseIfFailed("MakeCommonList", self.BoolOp)
6754 self._autoPublish(anObj, theName, "common")
6757 ## Perform Cut boolean operation on one object and the list of tools.
6758 # @param theMainShape The object of the operation.
6759 # @param theShapesList The list of tools of the operation.
6760 # @param theName Object name; when specified, this parameter is used
6761 # for result publication in the study. Otherwise, if automatic
6762 # publication is switched on, default value is used for result name.
6764 # @return New GEOM.GEOM_Object, containing the result shape.
6766 # @ref tui_cut "Example 1"
6767 # \n @ref swig_MakeCommon "Example 2"
6768 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6770 Perform Cut boolean operation on one object and the list of tools.
6773 theMainShape The object of the operation.
6774 theShapesList The list of tools of the operation.
6775 theName Object name; when specified, this parameter is used
6776 for result publication in the study. Otherwise, if automatic
6777 publication is switched on, default value is used for result name.
6780 New GEOM.GEOM_Object, containing the result shape.
6783 # Example: see GEOM_TestOthers.py
6784 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6785 RaiseIfFailed("MakeCutList", self.BoolOp)
6786 self._autoPublish(anObj, theName, "cut")
6792 ## @addtogroup l3_basic_op
6795 ## Perform partition operation.
6796 # @param ListShapes Shapes to be intersected.
6797 # @param ListTools Shapes to intersect theShapes.
6798 # @param Limit Type of resulting shapes (see ShapeType()).\n
6799 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6800 # type will be detected automatically.
6801 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6802 # target type (equal to Limit) are kept in the result,
6803 # else standalone shapes of lower dimension
6804 # are kept also (if they exist).
6805 # @param theName Object name; when specified, this parameter is used
6806 # for result publication in the study. Otherwise, if automatic
6807 # publication is switched on, default value is used for result name.
6809 # @note Each compound from ListShapes and ListTools will be exploded
6810 # in order to avoid possible intersection between shapes from this compound.
6812 # After implementation new version of PartitionAlgo (October 2006)
6813 # other parameters are ignored by current functionality. They are kept
6814 # in this function only for support old versions.
6815 # @param ListKeepInside Shapes, outside which the results will be deleted.
6816 # Each shape from theKeepInside must belong to theShapes also.
6817 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6818 # Each shape from theRemoveInside must belong to theShapes also.
6819 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6820 # @param ListMaterials Material indices for each shape. Make sence,
6821 # only if theRemoveWebs is TRUE.
6823 # @return New GEOM.GEOM_Object, containing the result shapes.
6825 # @ref tui_partition "Example"
6826 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6827 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6828 KeepNonlimitShapes=0, theName=None):
6830 Perform partition operation.
6833 ListShapes Shapes to be intersected.
6834 ListTools Shapes to intersect theShapes.
6835 Limit Type of resulting shapes (see geompy.ShapeType)
6836 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6837 type will be detected automatically.
6838 KeepNonlimitShapes if this parameter == 0, then only shapes of
6839 target type (equal to Limit) are kept in the result,
6840 else standalone shapes of lower dimension
6841 are kept also (if they exist).
6842 theName Object name; when specified, this parameter is used
6843 for result publication in the study. Otherwise, if automatic
6844 publication is switched on, default value is used for result name.
6846 Each compound from ListShapes and ListTools will be exploded
6847 in order to avoid possible intersection between shapes from
6850 After implementation new version of PartitionAlgo (October 2006) other
6851 parameters are ignored by current functionality. They are kept in this
6852 function only for support old versions.
6855 ListKeepInside Shapes, outside which the results will be deleted.
6856 Each shape from theKeepInside must belong to theShapes also.
6857 ListRemoveInside Shapes, inside which the results will be deleted.
6858 Each shape from theRemoveInside must belong to theShapes also.
6859 RemoveWebs If TRUE, perform Glue 3D algorithm.
6860 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6863 New GEOM.GEOM_Object, containing the result shapes.
6865 # Example: see GEOM_TestAll.py
6866 if Limit == self.ShapeType["AUTO"]:
6867 # automatic detection of the most appropriate shape limit type
6869 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6870 Limit = EnumToLong(lim)
6872 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6873 ListKeepInside, ListRemoveInside,
6874 Limit, RemoveWebs, ListMaterials,
6875 KeepNonlimitShapes);
6876 RaiseIfFailed("MakePartition", self.BoolOp)
6877 self._autoPublish(anObj, theName, "partition")
6880 ## Perform partition operation.
6881 # This method may be useful if it is needed to make a partition for
6882 # compound contains nonintersected shapes. Performance will be better
6883 # since intersection between shapes from compound is not performed.
6885 # Description of all parameters as in previous method MakePartition()
6887 # @note Passed compounds (via ListShapes or via ListTools)
6888 # have to consist of nonintersecting shapes.
6890 # @return New GEOM.GEOM_Object, containing the result shapes.
6892 # @ref swig_todo "Example"
6893 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6894 ListKeepInside=[], ListRemoveInside=[],
6895 Limit=ShapeType["AUTO"], RemoveWebs=0,
6896 ListMaterials=[], KeepNonlimitShapes=0,
6899 Perform partition operation.
6900 This method may be useful if it is needed to make a partition for
6901 compound contains nonintersected shapes. Performance will be better
6902 since intersection between shapes from compound is not performed.
6905 Description of all parameters as in method geompy.MakePartition
6908 Passed compounds (via ListShapes or via ListTools)
6909 have to consist of nonintersecting shapes.
6912 New GEOM.GEOM_Object, containing the result shapes.
6914 if Limit == self.ShapeType["AUTO"]:
6915 # automatic detection of the most appropriate shape limit type
6917 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6918 Limit = EnumToLong(lim)
6920 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6921 ListKeepInside, ListRemoveInside,
6922 Limit, RemoveWebs, ListMaterials,
6923 KeepNonlimitShapes);
6924 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6925 self._autoPublish(anObj, theName, "partition")
6928 ## See method MakePartition() for more information.
6930 # @ref tui_partition "Example 1"
6931 # \n @ref swig_Partition "Example 2"
6932 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6933 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6934 KeepNonlimitShapes=0, theName=None):
6936 See method geompy.MakePartition for more information.
6938 # Example: see GEOM_TestOthers.py
6939 # note: auto-publishing is done in self.MakePartition()
6940 anObj = self.MakePartition(ListShapes, ListTools,
6941 ListKeepInside, ListRemoveInside,
6942 Limit, RemoveWebs, ListMaterials,
6943 KeepNonlimitShapes, theName);
6946 ## Perform partition of the Shape with the Plane
6947 # @param theShape Shape to be intersected.
6948 # @param thePlane Tool shape, to intersect theShape.
6949 # @param theName Object name; when specified, this parameter is used
6950 # for result publication in the study. Otherwise, if automatic
6951 # publication is switched on, default value is used for result name.
6953 # @return New GEOM.GEOM_Object, containing the result shape.
6955 # @ref tui_partition "Example"
6956 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6958 Perform partition of the Shape with the Plane
6961 theShape Shape to be intersected.
6962 thePlane Tool shape, to intersect theShape.
6963 theName Object name; when specified, this parameter is used
6964 for result publication in the study. Otherwise, if automatic
6965 publication is switched on, default value is used for result name.
6968 New GEOM.GEOM_Object, containing the result shape.
6970 # Example: see GEOM_TestAll.py
6971 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6972 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6973 self._autoPublish(anObj, theName, "partition")
6976 # end of l3_basic_op
6979 ## @addtogroup l3_transform
6982 ## Translate the given object along the vector, specified
6983 # by its end points.
6984 # @param theObject The object to be translated.
6985 # @param thePoint1 Start point of translation vector.
6986 # @param thePoint2 End point of translation vector.
6987 # @param theCopy Flag used to translate object itself or create a copy.
6988 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6989 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6990 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6992 Translate the given object along the vector, specified by its end points.
6995 theObject The object to be translated.
6996 thePoint1 Start point of translation vector.
6997 thePoint2 End point of translation vector.
6998 theCopy Flag used to translate object itself or create a copy.
7001 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7002 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7005 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7007 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7008 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7011 ## Translate the given object along the vector, specified
7012 # by its end points, creating its copy before the translation.
7013 # @param theObject The object to be translated.
7014 # @param thePoint1 Start point of translation vector.
7015 # @param thePoint2 End point of translation vector.
7016 # @param theName Object name; when specified, this parameter is used
7017 # for result publication in the study. Otherwise, if automatic
7018 # publication is switched on, default value is used for result name.
7020 # @return New GEOM.GEOM_Object, containing the translated object.
7022 # @ref tui_translation "Example 1"
7023 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7024 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7026 Translate the given object along the vector, specified
7027 by its end points, creating its copy before the translation.
7030 theObject The object to be translated.
7031 thePoint1 Start point of translation vector.
7032 thePoint2 End point of translation vector.
7033 theName Object name; when specified, this parameter is used
7034 for result publication in the study. Otherwise, if automatic
7035 publication is switched on, default value is used for result name.
7038 New GEOM.GEOM_Object, containing the translated object.
7040 # Example: see GEOM_TestAll.py
7041 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7042 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7043 self._autoPublish(anObj, theName, "translated")
7046 ## Translate the given object along the vector, specified by its components.
7047 # @param theObject The object to be translated.
7048 # @param theDX,theDY,theDZ Components of translation vector.
7049 # @param theCopy Flag used to translate object itself or create a copy.
7050 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7051 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7053 # @ref tui_translation "Example"
7054 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7056 Translate the given object along the vector, specified by its components.
7059 theObject The object to be translated.
7060 theDX,theDY,theDZ Components of translation vector.
7061 theCopy Flag used to translate object itself or create a copy.
7064 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7065 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7067 # Example: see GEOM_TestAll.py
7068 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7070 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7072 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7073 anObj.SetParameters(Parameters)
7074 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7077 ## Translate the given object along the vector, specified
7078 # by its components, creating its copy before the translation.
7079 # @param theObject The object to be translated.
7080 # @param theDX,theDY,theDZ Components of translation vector.
7081 # @param theName Object name; when specified, this parameter is used
7082 # for result publication in the study. Otherwise, if automatic
7083 # publication is switched on, default value is used for result name.
7085 # @return New GEOM.GEOM_Object, containing the translated object.
7087 # @ref tui_translation "Example"
7088 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7090 Translate the given object along the vector, specified
7091 by its components, creating its copy before the translation.
7094 theObject The object to be translated.
7095 theDX,theDY,theDZ Components of translation vector.
7096 theName Object name; when specified, this parameter is used
7097 for result publication in the study. Otherwise, if automatic
7098 publication is switched on, default value is used for result name.
7101 New GEOM.GEOM_Object, containing the translated object.
7103 # Example: see GEOM_TestAll.py
7104 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7105 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7106 anObj.SetParameters(Parameters)
7107 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7108 self._autoPublish(anObj, theName, "translated")
7111 ## Translate the given object along the given vector.
7112 # @param theObject The object to be translated.
7113 # @param theVector The translation vector.
7114 # @param theCopy Flag used to translate object itself or create a copy.
7115 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7116 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7117 def TranslateVector(self, theObject, theVector, theCopy=False):
7119 Translate the given object along the given vector.
7122 theObject The object to be translated.
7123 theVector The translation vector.
7124 theCopy Flag used to translate object itself or create a copy.
7127 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7128 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7131 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7133 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7134 RaiseIfFailed("TranslateVector", self.TrsfOp)
7137 ## Translate the given object along the given vector,
7138 # creating its copy before the translation.
7139 # @param theObject The object to be translated.
7140 # @param theVector The translation vector.
7141 # @param theName Object name; when specified, this parameter is used
7142 # for result publication in the study. Otherwise, if automatic
7143 # publication is switched on, default value is used for result name.
7145 # @return New GEOM.GEOM_Object, containing the translated object.
7147 # @ref tui_translation "Example"
7148 def MakeTranslationVector(self, theObject, theVector, theName=None):
7150 Translate the given object along the given vector,
7151 creating its copy before the translation.
7154 theObject The object to be translated.
7155 theVector The translation vector.
7156 theName Object name; when specified, this parameter is used
7157 for result publication in the study. Otherwise, if automatic
7158 publication is switched on, default value is used for result name.
7161 New GEOM.GEOM_Object, containing the translated object.
7163 # Example: see GEOM_TestAll.py
7164 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7165 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7166 self._autoPublish(anObj, theName, "translated")
7169 ## Translate the given object along the given vector on given distance.
7170 # @param theObject The object to be translated.
7171 # @param theVector The translation vector.
7172 # @param theDistance The translation distance.
7173 # @param theCopy Flag used to translate object itself or create a copy.
7174 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7175 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7177 # @ref tui_translation "Example"
7178 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7180 Translate the given object along the given vector on given distance.
7183 theObject The object to be translated.
7184 theVector The translation vector.
7185 theDistance The translation distance.
7186 theCopy Flag used to translate object itself or create a copy.
7189 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7190 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7192 # Example: see GEOM_TestAll.py
7193 theDistance,Parameters = ParseParameters(theDistance)
7194 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7195 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7196 anObj.SetParameters(Parameters)
7199 ## Translate the given object along the given vector on given distance,
7200 # creating its copy before the translation.
7201 # @param theObject The object to be translated.
7202 # @param theVector The translation vector.
7203 # @param theDistance The translation distance.
7204 # @param theName Object name; when specified, this parameter is used
7205 # for result publication in the study. Otherwise, if automatic
7206 # publication is switched on, default value is used for result name.
7208 # @return New GEOM.GEOM_Object, containing the translated object.
7210 # @ref tui_translation "Example"
7211 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7213 Translate the given object along the given vector on given distance,
7214 creating its copy before the translation.
7217 theObject The object to be translated.
7218 theVector The translation vector.
7219 theDistance The translation distance.
7220 theName Object name; when specified, this parameter is used
7221 for result publication in the study. Otherwise, if automatic
7222 publication is switched on, default value is used for result name.
7225 New GEOM.GEOM_Object, containing the translated object.
7227 # Example: see GEOM_TestAll.py
7228 theDistance,Parameters = ParseParameters(theDistance)
7229 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7230 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7231 anObj.SetParameters(Parameters)
7232 self._autoPublish(anObj, theName, "translated")
7235 ## Rotate the given object around the given axis on the given angle.
7236 # @param theObject The object to be rotated.
7237 # @param theAxis Rotation axis.
7238 # @param theAngle Rotation angle in radians.
7239 # @param theCopy Flag used to rotate object itself or create a copy.
7241 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7242 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7244 # @ref tui_rotation "Example"
7245 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7247 Rotate the given object around the given axis on the given angle.
7250 theObject The object to be rotated.
7251 theAxis Rotation axis.
7252 theAngle Rotation angle in radians.
7253 theCopy Flag used to rotate object itself or create a copy.
7256 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7257 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7259 # Example: see GEOM_TestAll.py
7261 if isinstance(theAngle,str):
7263 theAngle, Parameters = ParseParameters(theAngle)
7265 theAngle = theAngle*math.pi/180.0
7267 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7269 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7270 RaiseIfFailed("Rotate", self.TrsfOp)
7271 anObj.SetParameters(Parameters)
7274 ## Rotate the given object around the given axis
7275 # on the given angle, creating its copy before the rotatation.
7276 # @param theObject The object to be rotated.
7277 # @param theAxis Rotation axis.
7278 # @param theAngle Rotation angle in radians.
7279 # @param theName Object name; when specified, this parameter is used
7280 # for result publication in the study. Otherwise, if automatic
7281 # publication is switched on, default value is used for result name.
7283 # @return New GEOM.GEOM_Object, containing the rotated object.
7285 # @ref tui_rotation "Example"
7286 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7288 Rotate the given object around the given axis
7289 on the given angle, creating its copy before the rotatation.
7292 theObject The object to be rotated.
7293 theAxis Rotation axis.
7294 theAngle Rotation angle in radians.
7295 theName Object name; when specified, this parameter is used
7296 for result publication in the study. Otherwise, if automatic
7297 publication is switched on, default value is used for result name.
7300 New GEOM.GEOM_Object, containing the rotated object.
7302 # Example: see GEOM_TestAll.py
7304 if isinstance(theAngle,str):
7306 theAngle, Parameters = ParseParameters(theAngle)
7308 theAngle = theAngle*math.pi/180.0
7309 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7310 RaiseIfFailed("RotateCopy", self.TrsfOp)
7311 anObj.SetParameters(Parameters)
7312 self._autoPublish(anObj, theName, "rotated")
7315 ## Rotate given object around vector perpendicular to plane
7316 # containing three points.
7317 # @param theObject The object to be rotated.
7318 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7319 # containing the three points.
7320 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7321 # @param theCopy Flag used to rotate object itself or create a copy.
7322 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7323 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7324 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7326 Rotate given object around vector perpendicular to plane
7327 containing three points.
7330 theObject The object to be rotated.
7331 theCentPoint central point the axis is the vector perpendicular to the plane
7332 containing the three points.
7333 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7334 theCopy Flag used to rotate object itself or create a copy.
7337 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7338 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7341 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7343 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7344 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7347 ## Rotate given object around vector perpendicular to plane
7348 # containing three points, creating its copy before the rotatation.
7349 # @param theObject The object to be rotated.
7350 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7351 # containing the three points.
7352 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7353 # @param theName Object name; when specified, this parameter is used
7354 # for result publication in the study. Otherwise, if automatic
7355 # publication is switched on, default value is used for result name.
7357 # @return New GEOM.GEOM_Object, containing the rotated object.
7359 # @ref tui_rotation "Example"
7360 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7362 Rotate given object around vector perpendicular to plane
7363 containing three points, creating its copy before the rotatation.
7366 theObject The object to be rotated.
7367 theCentPoint central point the axis is the vector perpendicular to the plane
7368 containing the three points.
7369 thePoint1,thePoint2 in a perpendicular plane of the axis.
7370 theName Object name; when specified, this parameter is used
7371 for result publication in the study. Otherwise, if automatic
7372 publication is switched on, default value is used for result name.
7375 New GEOM.GEOM_Object, containing the rotated object.
7377 # Example: see GEOM_TestAll.py
7378 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7379 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7380 self._autoPublish(anObj, theName, "rotated")
7383 ## Scale the given object by the specified factor.
7384 # @param theObject The object to be scaled.
7385 # @param thePoint Center point for scaling.
7386 # Passing None for it means scaling relatively the origin of global CS.
7387 # @param theFactor Scaling factor value.
7388 # @param theCopy Flag used to scale object itself or create a copy.
7389 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7390 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7391 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7393 Scale the given object by the specified factor.
7396 theObject The object to be scaled.
7397 thePoint Center point for scaling.
7398 Passing None for it means scaling relatively the origin of global CS.
7399 theFactor Scaling factor value.
7400 theCopy Flag used to scale object itself or create a copy.
7403 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7404 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7406 # Example: see GEOM_TestAll.py
7407 theFactor, Parameters = ParseParameters(theFactor)
7409 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7411 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7412 RaiseIfFailed("Scale", self.TrsfOp)
7413 anObj.SetParameters(Parameters)
7416 ## Scale the given object by the factor, creating its copy before the scaling.
7417 # @param theObject The object to be scaled.
7418 # @param thePoint Center point for scaling.
7419 # Passing None for it means scaling relatively the origin of global CS.
7420 # @param theFactor Scaling factor value.
7421 # @param theName Object name; when specified, this parameter is used
7422 # for result publication in the study. Otherwise, if automatic
7423 # publication is switched on, default value is used for result name.
7425 # @return New GEOM.GEOM_Object, containing the scaled shape.
7427 # @ref tui_scale "Example"
7428 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7430 Scale the given object by the factor, creating its copy before the scaling.
7433 theObject The object to be scaled.
7434 thePoint Center point for scaling.
7435 Passing None for it means scaling relatively the origin of global CS.
7436 theFactor Scaling factor value.
7437 theName Object name; when specified, this parameter is used
7438 for result publication in the study. Otherwise, if automatic
7439 publication is switched on, default value is used for result name.
7442 New GEOM.GEOM_Object, containing the scaled shape.
7444 # Example: see GEOM_TestAll.py
7445 theFactor, Parameters = ParseParameters(theFactor)
7446 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7447 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7448 anObj.SetParameters(Parameters)
7449 self._autoPublish(anObj, theName, "scaled")
7452 ## Scale the given object by different factors along coordinate axes.
7453 # @param theObject The object to be scaled.
7454 # @param thePoint Center point for scaling.
7455 # Passing None for it means scaling relatively the origin of global CS.
7456 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7457 # @param theCopy Flag used to scale object itself or create a copy.
7458 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7459 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7460 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7462 Scale the given object by different factors along coordinate axes.
7465 theObject The object to be scaled.
7466 thePoint Center point for scaling.
7467 Passing None for it means scaling relatively the origin of global CS.
7468 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7469 theCopy Flag used to scale object itself or create a copy.
7472 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7473 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7475 # Example: see GEOM_TestAll.py
7476 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7478 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7479 theFactorX, theFactorY, theFactorZ)
7481 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7482 theFactorX, theFactorY, theFactorZ)
7483 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7484 anObj.SetParameters(Parameters)
7487 ## Scale the given object by different factors along coordinate axes,
7488 # creating its copy before the scaling.
7489 # @param theObject The object to be scaled.
7490 # @param thePoint Center point for scaling.
7491 # Passing None for it means scaling relatively the origin of global CS.
7492 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7493 # @param theName Object name; when specified, this parameter is used
7494 # for result publication in the study. Otherwise, if automatic
7495 # publication is switched on, default value is used for result name.
7497 # @return New GEOM.GEOM_Object, containing the scaled shape.
7499 # @ref swig_scale "Example"
7500 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7502 Scale the given object by different factors along coordinate axes,
7503 creating its copy before the scaling.
7506 theObject The object to be scaled.
7507 thePoint Center point for scaling.
7508 Passing None for it means scaling relatively the origin of global CS.
7509 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7510 theName Object name; when specified, this parameter is used
7511 for result publication in the study. Otherwise, if automatic
7512 publication is switched on, default value is used for result name.
7515 New GEOM.GEOM_Object, containing the scaled shape.
7517 # Example: see GEOM_TestAll.py
7518 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7519 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7520 theFactorX, theFactorY, theFactorZ)
7521 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7522 anObj.SetParameters(Parameters)
7523 self._autoPublish(anObj, theName, "scaled")
7526 ## Mirror an object relatively the given plane.
7527 # @param theObject The object to be mirrored.
7528 # @param thePlane Plane of symmetry.
7529 # @param theCopy Flag used to mirror object itself or create a copy.
7530 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7531 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7532 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7534 Mirror an object relatively the given plane.
7537 theObject The object to be mirrored.
7538 thePlane Plane of symmetry.
7539 theCopy Flag used to mirror object itself or create a copy.
7542 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7543 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7546 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7548 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7549 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7552 ## Create an object, symmetrical
7553 # to the given one relatively the given plane.
7554 # @param theObject The object to be mirrored.
7555 # @param thePlane Plane of symmetry.
7556 # @param theName Object name; when specified, this parameter is used
7557 # for result publication in the study. Otherwise, if automatic
7558 # publication is switched on, default value is used for result name.
7560 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7562 # @ref tui_mirror "Example"
7563 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7565 Create an object, symmetrical to the given one relatively the given plane.
7568 theObject The object to be mirrored.
7569 thePlane Plane of symmetry.
7570 theName Object name; when specified, this parameter is used
7571 for result publication in the study. Otherwise, if automatic
7572 publication is switched on, default value is used for result name.
7575 New GEOM.GEOM_Object, containing the mirrored shape.
7577 # Example: see GEOM_TestAll.py
7578 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7579 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7580 self._autoPublish(anObj, theName, "mirrored")
7583 ## Mirror an object relatively the given axis.
7584 # @param theObject The object to be mirrored.
7585 # @param theAxis Axis of symmetry.
7586 # @param theCopy Flag used to mirror object itself or create a copy.
7587 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7588 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7589 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7591 Mirror an object relatively the given axis.
7594 theObject The object to be mirrored.
7595 theAxis Axis of symmetry.
7596 theCopy Flag used to mirror object itself or create a copy.
7599 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7600 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7603 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7605 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7606 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7609 ## Create an object, symmetrical
7610 # to the given one relatively the given axis.
7611 # @param theObject The object to be mirrored.
7612 # @param theAxis Axis of symmetry.
7613 # @param theName Object name; when specified, this parameter is used
7614 # for result publication in the study. Otherwise, if automatic
7615 # publication is switched on, default value is used for result name.
7617 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7619 # @ref tui_mirror "Example"
7620 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7622 Create an object, symmetrical to the given one relatively the given axis.
7625 theObject The object to be mirrored.
7626 theAxis Axis of symmetry.
7627 theName Object name; when specified, this parameter is used
7628 for result publication in the study. Otherwise, if automatic
7629 publication is switched on, default value is used for result name.
7632 New GEOM.GEOM_Object, containing the mirrored shape.
7634 # Example: see GEOM_TestAll.py
7635 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7636 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7637 self._autoPublish(anObj, theName, "mirrored")
7640 ## Mirror an object relatively the given point.
7641 # @param theObject The object to be mirrored.
7642 # @param thePoint Point of symmetry.
7643 # @param theCopy Flag used to mirror object itself or create a copy.
7644 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7645 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7646 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7648 Mirror an object relatively the given point.
7651 theObject The object to be mirrored.
7652 thePoint Point of symmetry.
7653 theCopy Flag used to mirror object itself or create a copy.
7656 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7657 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7659 # Example: see GEOM_TestAll.py
7661 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7663 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7664 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7667 ## Create an object, symmetrical
7668 # to the given one relatively the given point.
7669 # @param theObject The object to be mirrored.
7670 # @param thePoint Point of symmetry.
7671 # @param 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.
7675 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7677 # @ref tui_mirror "Example"
7678 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7680 Create an object, symmetrical
7681 to the given one relatively the given point.
7684 theObject The object to be mirrored.
7685 thePoint Point of symmetry.
7686 theName Object name; when specified, this parameter is used
7687 for result publication in the study. Otherwise, if automatic
7688 publication is switched on, default value is used for result name.
7691 New GEOM.GEOM_Object, containing the mirrored shape.
7693 # Example: see GEOM_TestAll.py
7694 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7695 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7696 self._autoPublish(anObj, theName, "mirrored")
7699 ## Modify the location of the given object.
7700 # @param theObject The object to be displaced.
7701 # @param theStartLCS Coordinate system to perform displacement from it.\n
7702 # If \a theStartLCS is NULL, displacement
7703 # will be performed from global CS.\n
7704 # If \a theObject itself is used as \a theStartLCS,
7705 # its location will be changed to \a theEndLCS.
7706 # @param theEndLCS Coordinate system to perform displacement to it.
7707 # @param theCopy Flag used to displace object itself or create a copy.
7708 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7709 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7710 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7712 Modify the Location of the given object by LCS, creating its copy before the setting.
7715 theObject The object to be displaced.
7716 theStartLCS Coordinate system to perform displacement from it.
7717 If theStartLCS is NULL, displacement
7718 will be performed from global CS.
7719 If theObject itself is used as theStartLCS,
7720 its location will be changed to theEndLCS.
7721 theEndLCS Coordinate system to perform displacement to it.
7722 theCopy Flag used to displace object itself or create a copy.
7725 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7726 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7728 # Example: see GEOM_TestAll.py
7730 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7732 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7733 RaiseIfFailed("Displace", self.TrsfOp)
7736 ## Modify the Location of the given object by LCS,
7737 # creating its copy before the setting.
7738 # @param theObject The object to be displaced.
7739 # @param theStartLCS Coordinate system to perform displacement from it.\n
7740 # If \a theStartLCS is NULL, displacement
7741 # will be performed from global CS.\n
7742 # If \a theObject itself is used as \a theStartLCS,
7743 # its location will be changed to \a theEndLCS.
7744 # @param theEndLCS Coordinate system to perform displacement to it.
7745 # @param theName Object name; when specified, this parameter is used
7746 # for result publication in the study. Otherwise, if automatic
7747 # publication is switched on, default value is used for result name.
7749 # @return New GEOM.GEOM_Object, containing the displaced shape.
7751 # @ref tui_modify_location "Example"
7752 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7754 Modify the Location of the given object by LCS, creating its copy before the setting.
7757 theObject The object to be displaced.
7758 theStartLCS Coordinate system to perform displacement from it.
7759 If theStartLCS is NULL, displacement
7760 will be performed from global CS.
7761 If theObject itself is used as theStartLCS,
7762 its location will be changed to theEndLCS.
7763 theEndLCS Coordinate system to perform displacement to it.
7764 theName Object name; when specified, this parameter is used
7765 for result publication in the study. Otherwise, if automatic
7766 publication is switched on, default value is used for result name.
7769 New GEOM.GEOM_Object, containing the displaced shape.
7772 # create local coordinate systems
7773 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7774 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7775 # modify the location of the given object
7776 position = geompy.MakePosition(cylinder, cs1, cs2)
7778 # Example: see GEOM_TestAll.py
7779 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7780 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7781 self._autoPublish(anObj, theName, "displaced")
7784 ## Modify the Location of the given object by Path.
7785 # @param theObject The object to be displaced.
7786 # @param thePath Wire or Edge along that the object will be translated.
7787 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7788 # @param theCopy is to create a copy objects if true.
7789 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7790 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7791 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7793 # @ref tui_modify_location "Example"
7794 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7796 Modify the Location of the given object by Path.
7799 theObject The object to be displaced.
7800 thePath Wire or Edge along that the object will be translated.
7801 theDistance progress of Path (0 = start location, 1 = end of path location).
7802 theCopy is to create a copy objects if true.
7803 theReverse 0 - for usual direction, 1 - to reverse path direction.
7806 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7807 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7810 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7812 # Example: see GEOM_TestAll.py
7813 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7814 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7817 ## Modify the Location of the given object by Path, creating its copy before the operation.
7818 # @param theObject The object to be displaced.
7819 # @param thePath Wire or Edge along that the object will be translated.
7820 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7821 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7822 # @param theName Object name; when specified, this parameter is used
7823 # for result publication in the study. Otherwise, if automatic
7824 # publication is switched on, default value is used for result name.
7826 # @return New GEOM.GEOM_Object, containing the displaced shape.
7827 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7829 Modify the Location of the given object by Path, creating its copy before the operation.
7832 theObject The object to be displaced.
7833 thePath Wire or Edge along that the object will be translated.
7834 theDistance progress of Path (0 = start location, 1 = end of path location).
7835 theReverse 0 - for usual direction, 1 - to reverse path direction.
7836 theName Object name; when specified, this parameter is used
7837 for result publication in the study. Otherwise, if automatic
7838 publication is switched on, default value is used for result name.
7841 New GEOM.GEOM_Object, containing the displaced shape.
7843 # Example: see GEOM_TestAll.py
7844 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7845 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7846 self._autoPublish(anObj, theName, "displaced")
7849 ## Offset given shape.
7850 # @param theObject The base object for the offset.
7851 # @param theOffset Offset value.
7852 # @param theCopy Flag used to offset object itself or create a copy.
7853 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7854 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7855 def Offset(self, theObject, theOffset, theCopy=False):
7860 theObject The base object for the offset.
7861 theOffset Offset value.
7862 theCopy Flag used to offset object itself or create a copy.
7865 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7866 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7868 theOffset, Parameters = ParseParameters(theOffset)
7870 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7872 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7873 RaiseIfFailed("Offset", self.TrsfOp)
7874 anObj.SetParameters(Parameters)
7877 ## Create new object as offset of the given one.
7878 # @param theObject The base object for the offset.
7879 # @param theOffset Offset value.
7880 # @param theName Object name; when specified, this parameter is used
7881 # for result publication in the study. Otherwise, if automatic
7882 # publication is switched on, default value is used for result name.
7884 # @return New GEOM.GEOM_Object, containing the offset object.
7886 # @ref tui_offset "Example"
7887 def MakeOffset(self, theObject, theOffset, theName=None):
7889 Create new object as offset of the given one.
7892 theObject The base object for the offset.
7893 theOffset Offset value.
7894 theName Object name; when specified, this parameter is used
7895 for result publication in the study. Otherwise, if automatic
7896 publication is switched on, default value is used for result name.
7899 New GEOM.GEOM_Object, containing the offset object.
7902 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7903 # create a new object as offset of the given object
7904 offset = geompy.MakeOffset(box, 70.)
7906 # Example: see GEOM_TestAll.py
7907 theOffset, Parameters = ParseParameters(theOffset)
7908 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7909 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7910 anObj.SetParameters(Parameters)
7911 self._autoPublish(anObj, theName, "offset")
7914 ## Create new object as projection of the given one on a 2D surface.
7915 # @param theSource The source object for the projection. It can be a point, edge or wire.
7916 # @param theTarget The target object. It can be planar or cylindrical face.
7917 # @param theName Object name; when specified, this parameter is used
7918 # for result publication in the study. Otherwise, if automatic
7919 # publication is switched on, default value is used for result name.
7921 # @return New GEOM.GEOM_Object, containing the projection.
7923 # @ref tui_projection "Example"
7924 def MakeProjection(self, theSource, theTarget, theName=None):
7926 Create new object as projection of the given one on a 2D surface.
7929 theSource The source object for the projection. It can be a point, edge or wire.
7930 theTarget The target object. It can be planar or cylindrical face.
7931 theName Object name; when specified, this parameter is used
7932 for result publication in the study. Otherwise, if automatic
7933 publication is switched on, default value is used for result name.
7936 New GEOM.GEOM_Object, containing the projection.
7938 # Example: see GEOM_TestAll.py
7939 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7940 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7941 self._autoPublish(anObj, theName, "projection")
7944 # -----------------------------------------------------------------------------
7946 # -----------------------------------------------------------------------------
7948 ## Translate the given object along the given vector a given number times
7949 # @param theObject The object to be translated.
7950 # @param theVector Direction of the translation. DX if None.
7951 # @param theStep Distance to translate on.
7952 # @param theNbTimes Quantity of translations to be done.
7953 # @param theName Object name; when specified, this parameter is used
7954 # for result publication in the study. Otherwise, if automatic
7955 # publication is switched on, default value is used for result name.
7957 # @return New GEOM.GEOM_Object, containing compound of all
7958 # the shapes, obtained after each translation.
7960 # @ref tui_multi_translation "Example"
7961 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7963 Translate the given object along the given vector a given number times
7966 theObject The object to be translated.
7967 theVector Direction of the translation. DX if None.
7968 theStep Distance to translate on.
7969 theNbTimes Quantity of translations to be done.
7970 theName Object name; when specified, this parameter is used
7971 for result publication in the study. Otherwise, if automatic
7972 publication is switched on, default value is used for result name.
7975 New GEOM.GEOM_Object, containing compound of all
7976 the shapes, obtained after each translation.
7979 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7981 # Example: see GEOM_TestAll.py
7982 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7983 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7984 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7985 anObj.SetParameters(Parameters)
7986 self._autoPublish(anObj, theName, "multitranslation")
7989 ## Conseqently apply two specified translations to theObject specified number of times.
7990 # @param theObject The object to be translated.
7991 # @param theVector1 Direction of the first translation. DX if None.
7992 # @param theStep1 Step of the first translation.
7993 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7994 # @param theVector2 Direction of the second translation. DY if None.
7995 # @param theStep2 Step of the second translation.
7996 # @param theNbTimes2 Quantity of translations to be done along theVector2.
7997 # @param theName Object name; when specified, this parameter is used
7998 # for result publication in the study. Otherwise, if automatic
7999 # publication is switched on, default value is used for result name.
8001 # @return New GEOM.GEOM_Object, containing compound of all
8002 # the shapes, obtained after each translation.
8004 # @ref tui_multi_translation "Example"
8005 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8006 theVector2, theStep2, theNbTimes2, theName=None):
8008 Conseqently apply two specified translations to theObject specified number of times.
8011 theObject The object to be translated.
8012 theVector1 Direction of the first translation. DX if None.
8013 theStep1 Step of the first translation.
8014 theNbTimes1 Quantity of translations to be done along theVector1.
8015 theVector2 Direction of the second translation. DY if None.
8016 theStep2 Step of the second translation.
8017 theNbTimes2 Quantity of translations to be done along theVector2.
8018 theName Object name; when specified, this parameter is used
8019 for result publication in the study. Otherwise, if automatic
8020 publication is switched on, default value is used for result name.
8023 New GEOM.GEOM_Object, containing compound of all
8024 the shapes, obtained after each translation.
8027 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8029 # Example: see GEOM_TestAll.py
8030 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8031 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8032 theVector2, theStep2, theNbTimes2)
8033 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8034 anObj.SetParameters(Parameters)
8035 self._autoPublish(anObj, theName, "multitranslation")
8038 ## Rotate the given object around the given axis a given number times.
8039 # Rotation angle will be 2*PI/theNbTimes.
8040 # @param theObject The object to be rotated.
8041 # @param theAxis The rotation axis. DZ if None.
8042 # @param theNbTimes Quantity of rotations to be done.
8043 # @param theName Object name; when specified, this parameter is used
8044 # for result publication in the study. Otherwise, if automatic
8045 # publication is switched on, default value is used for result name.
8047 # @return New GEOM.GEOM_Object, containing compound of all the
8048 # shapes, obtained after each rotation.
8050 # @ref tui_multi_rotation "Example"
8051 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8053 Rotate the given object around the given axis a given number times.
8054 Rotation angle will be 2*PI/theNbTimes.
8057 theObject The object to be rotated.
8058 theAxis The rotation axis. DZ if None.
8059 theNbTimes Quantity of rotations to be done.
8060 theName Object name; when specified, this parameter is used
8061 for result publication in the study. Otherwise, if automatic
8062 publication is switched on, default value is used for result name.
8065 New GEOM.GEOM_Object, containing compound of all the
8066 shapes, obtained after each rotation.
8069 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8071 # Example: see GEOM_TestAll.py
8072 theNbTimes, Parameters = ParseParameters(theNbTimes)
8073 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8074 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8075 anObj.SetParameters(Parameters)
8076 self._autoPublish(anObj, theName, "multirotation")
8079 ## Rotate the given object around the given axis
8080 # a given number times on the given angle.
8081 # @param theObject The object to be rotated.
8082 # @param theAxis The rotation axis. DZ if None.
8083 # @param theAngleStep Rotation angle in radians.
8084 # @param theNbTimes Quantity of rotations to be done.
8085 # @param theName Object name; when specified, this parameter is used
8086 # for result publication in the study. Otherwise, if automatic
8087 # publication is switched on, default value is used for result name.
8089 # @return New GEOM.GEOM_Object, containing compound of all the
8090 # shapes, obtained after each rotation.
8092 # @ref tui_multi_rotation "Example"
8093 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8095 Rotate the given object around the given axis
8096 a given number times on the given angle.
8099 theObject The object to be rotated.
8100 theAxis The rotation axis. DZ if None.
8101 theAngleStep Rotation angle in radians.
8102 theNbTimes Quantity of rotations to be done.
8103 theName Object name; when specified, this parameter is used
8104 for result publication in the study. Otherwise, if automatic
8105 publication is switched on, default value is used for result name.
8108 New GEOM.GEOM_Object, containing compound of all the
8109 shapes, obtained after each rotation.
8112 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8114 # Example: see GEOM_TestAll.py
8115 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8116 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8117 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8118 anObj.SetParameters(Parameters)
8119 self._autoPublish(anObj, theName, "multirotation")
8122 ## Rotate the given object around the given axis a given
8123 # number times and multi-translate each rotation result.
8124 # Rotation angle will be 2*PI/theNbTimes1.
8125 # Translation direction passes through center of gravity
8126 # of rotated shape and its projection on the rotation axis.
8127 # @param theObject The object to be rotated.
8128 # @param theAxis Rotation axis. DZ if None.
8129 # @param theNbTimes1 Quantity of rotations to be done.
8130 # @param theRadialStep Translation distance.
8131 # @param theNbTimes2 Quantity of translations to be done.
8132 # @param theName Object name; when specified, this parameter is used
8133 # for result publication in the study. Otherwise, if automatic
8134 # publication is switched on, default value is used for result name.
8136 # @return New GEOM.GEOM_Object, containing compound of all the
8137 # shapes, obtained after each transformation.
8139 # @ref tui_multi_rotation "Example"
8140 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8142 Rotate the given object around the
8143 given axis on the given angle a given number
8144 times and multi-translate each rotation result.
8145 Translation direction passes through center of gravity
8146 of rotated shape and its projection on the rotation axis.
8149 theObject The object to be rotated.
8150 theAxis Rotation axis. DZ if None.
8151 theNbTimes1 Quantity of rotations to be done.
8152 theRadialStep Translation distance.
8153 theNbTimes2 Quantity of translations to be done.
8154 theName Object name; when specified, this parameter is used
8155 for result publication in the study. Otherwise, if automatic
8156 publication is switched on, default value is used for result name.
8159 New GEOM.GEOM_Object, containing compound of all the
8160 shapes, obtained after each transformation.
8163 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8165 # Example: see GEOM_TestAll.py
8166 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8167 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8168 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8169 anObj.SetParameters(Parameters)
8170 self._autoPublish(anObj, theName, "multirotation")
8173 ## Rotate the given object around the
8174 # given axis on the given angle a given number
8175 # times and multi-translate each rotation result.
8176 # Translation direction passes through center of gravity
8177 # of rotated shape and its projection on the rotation axis.
8178 # @param theObject The object to be rotated.
8179 # @param theAxis Rotation axis. DZ if None.
8180 # @param theAngleStep Rotation angle in radians.
8181 # @param theNbTimes1 Quantity of rotations to be done.
8182 # @param theRadialStep Translation distance.
8183 # @param theNbTimes2 Quantity of translations to be done.
8184 # @param theName Object name; when specified, this parameter is used
8185 # for result publication in the study. Otherwise, if automatic
8186 # publication is switched on, default value is used for result name.
8188 # @return New GEOM.GEOM_Object, containing compound of all the
8189 # shapes, obtained after each transformation.
8191 # @ref tui_multi_rotation "Example"
8192 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8194 Rotate the given object around the
8195 given axis on the given angle a given number
8196 times and multi-translate each rotation result.
8197 Translation direction passes through center of gravity
8198 of rotated shape and its projection on the rotation axis.
8201 theObject The object to be rotated.
8202 theAxis Rotation axis. DZ if None.
8203 theAngleStep Rotation angle in radians.
8204 theNbTimes1 Quantity of rotations to be done.
8205 theRadialStep Translation distance.
8206 theNbTimes2 Quantity of translations to be done.
8207 theName Object name; when specified, this parameter is used
8208 for result publication in the study. Otherwise, if automatic
8209 publication is switched on, default value is used for result name.
8212 New GEOM.GEOM_Object, containing compound of all the
8213 shapes, obtained after each transformation.
8216 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8218 # Example: see GEOM_TestAll.py
8219 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8220 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8221 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8222 anObj.SetParameters(Parameters)
8223 self._autoPublish(anObj, theName, "multirotation")
8226 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8228 # @ref swig_MakeMultiRotation "Example"
8229 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8231 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8234 pz = geompy.MakeVertex(0, 0, 100)
8235 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8236 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8238 # Example: see GEOM_TestOthers.py
8239 aVec = self.MakeLine(aPoint,aDir)
8240 # note: auto-publishing is done in self.MultiRotate1D()
8241 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8244 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8246 # @ref swig_MakeMultiRotation "Example"
8247 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8249 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8252 pz = geompy.MakeVertex(0, 0, 100)
8253 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8254 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8256 # Example: see GEOM_TestOthers.py
8257 aVec = self.MakeLine(aPoint,aDir)
8258 # note: auto-publishing is done in self.MultiRotate1D()
8259 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8262 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8264 # @ref swig_MakeMultiRotation "Example"
8265 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8267 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8270 pz = geompy.MakeVertex(0, 0, 100)
8271 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8272 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8274 # Example: see GEOM_TestOthers.py
8275 aVec = self.MakeLine(aPoint,aDir)
8276 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8277 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8280 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8282 # @ref swig_MakeMultiRotation "Example"
8283 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8285 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8288 pz = geompy.MakeVertex(0, 0, 100)
8289 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8290 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8292 # Example: see GEOM_TestOthers.py
8293 aVec = self.MakeLine(aPoint,aDir)
8294 # note: auto-publishing is done in self.MultiRotate2D()
8295 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8298 # end of l3_transform
8301 ## @addtogroup l3_transform_d
8304 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8305 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8307 Deprecated method. Use MultiRotate1DNbTimes instead.
8309 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8310 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8312 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8313 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8314 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8316 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8317 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8320 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8322 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8323 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8324 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8325 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8326 anObj.SetParameters(Parameters)
8327 self._autoPublish(anObj, theName, "multirotation")
8330 ## The same, as MultiRotate1D(), but axis is given by direction and point
8331 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8332 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8334 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8335 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8338 pz = geompy.MakeVertex(0, 0, 100)
8339 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8340 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8342 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8343 aVec = self.MakeLine(aPoint,aDir)
8344 # note: auto-publishing is done in self.MultiRotate1D()
8345 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8348 ## The same, as MultiRotate2D(), but axis is given by direction and point
8349 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8350 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8352 The same, as MultiRotate2D(), but axis is given by direction and point
8353 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8356 pz = geompy.MakeVertex(0, 0, 100)
8357 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8358 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8360 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8361 aVec = self.MakeLine(aPoint,aDir)
8362 # note: auto-publishing is done in self.MultiRotate2D()
8363 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8366 # end of l3_transform_d
8369 ## @addtogroup l3_local
8372 ## Perform a fillet on all edges of the given shape.
8373 # @param theShape Shape, to perform fillet on.
8374 # @param theR Fillet radius.
8375 # @param theName Object name; when specified, this parameter is used
8376 # for result publication in the study. Otherwise, if automatic
8377 # publication is switched on, default value is used for result name.
8379 # @return New GEOM.GEOM_Object, containing the result shape.
8381 # @ref tui_fillet "Example 1"
8382 # \n @ref swig_MakeFilletAll "Example 2"
8383 def MakeFilletAll(self, theShape, theR, theName=None):
8385 Perform a fillet on all edges of the given shape.
8388 theShape Shape, to perform fillet on.
8390 theName Object name; when specified, this parameter is used
8391 for result publication in the study. Otherwise, if automatic
8392 publication is switched on, default value is used for result name.
8395 New GEOM.GEOM_Object, containing the result shape.
8398 filletall = geompy.MakeFilletAll(prism, 10.)
8400 # Example: see GEOM_TestOthers.py
8401 theR,Parameters = ParseParameters(theR)
8402 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8403 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8404 anObj.SetParameters(Parameters)
8405 self._autoPublish(anObj, theName, "fillet")
8408 ## Perform a fillet on the specified edges/faces of the given shape
8409 # @param theShape Shape, to perform fillet on.
8410 # @param theR Fillet radius.
8411 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8412 # @param theListShapes Global indices of edges/faces to perform fillet on.
8413 # @param theName Object name; when specified, this parameter is used
8414 # for result publication in the study. Otherwise, if automatic
8415 # publication is switched on, default value is used for result name.
8417 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8419 # @return New GEOM.GEOM_Object, containing the result shape.
8421 # @ref tui_fillet "Example"
8422 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8424 Perform a fillet on the specified edges/faces of the given shape
8427 theShape Shape, to perform fillet on.
8429 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8430 theListShapes Global indices of edges/faces to perform fillet on.
8431 theName Object name; when specified, this parameter is used
8432 for result publication in the study. Otherwise, if automatic
8433 publication is switched on, default value is used for result name.
8436 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8439 New GEOM.GEOM_Object, containing the result shape.
8442 # get the list of IDs (IDList) for the fillet
8443 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8445 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8446 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8447 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8448 # make a fillet on the specified edges of the given shape
8449 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8451 # Example: see GEOM_TestAll.py
8452 theR,Parameters = ParseParameters(theR)
8454 if theShapeType == self.ShapeType["EDGE"]:
8455 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8456 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8458 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8459 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8460 anObj.SetParameters(Parameters)
8461 self._autoPublish(anObj, theName, "fillet")
8464 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8465 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8467 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8470 # get the list of IDs (IDList) for the fillet
8471 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8473 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8474 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8475 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8476 # make a fillet on the specified edges of the given shape
8477 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8479 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8481 if theShapeType == self.ShapeType["EDGE"]:
8482 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8483 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8485 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8486 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8487 anObj.SetParameters(Parameters)
8488 self._autoPublish(anObj, theName, "fillet")
8491 ## Perform a fillet on the specified edges of the given shape
8492 # @param theShape Wire Shape to perform fillet on.
8493 # @param theR Fillet radius.
8494 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8495 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8496 # \note The list of vertices could be empty,
8497 # in this case fillet will done done at all vertices in wire
8498 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8499 # by the length of the edges, nearest to the fillet vertex.
8500 # But sometimes the next edge is C1 continuous with the one, nearest to
8501 # the fillet point, and such two (or more) edges can be united to allow
8502 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8503 # thus ignoring the secant vertex (vertices).
8504 # @param theName Object name; when specified, this parameter is used
8505 # for result publication in the study. Otherwise, if automatic
8506 # publication is switched on, default value is used for result name.
8508 # @return New GEOM.GEOM_Object, containing the result shape.
8510 # @ref tui_fillet2d "Example"
8511 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8513 Perform a fillet on the specified edges of the given shape
8516 theShape Wire Shape to perform fillet on.
8518 theListOfVertexes Global indices of vertexes to perform fillet on.
8519 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8520 by the length of the edges, nearest to the fillet vertex.
8521 But sometimes the next edge is C1 continuous with the one, nearest to
8522 the fillet point, and such two (or more) edges can be united to allow
8523 bigger radius. Set this flag to TRUE to allow collinear edges union,
8524 thus ignoring the secant vertex (vertices).
8525 theName Object name; when specified, this parameter is used
8526 for result publication in the study. Otherwise, if automatic
8527 publication is switched on, default value is used for result name.
8529 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8531 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8534 New GEOM.GEOM_Object, containing the result shape.
8538 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8539 # make fillet at given wire vertices with giver radius
8540 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8542 # Example: see GEOM_TestAll.py
8543 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8544 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8545 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8546 anObj.SetParameters(Parameters)
8547 self._autoPublish(anObj, theName, "fillet")
8550 ## Perform a fillet at the specified vertices of the given face/shell.
8551 # @param theShape Face or Shell shape to perform fillet on.
8552 # @param theR Fillet radius.
8553 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8554 # @param theName Object name; when specified, this parameter is used
8555 # for result publication in the study. Otherwise, if automatic
8556 # publication is switched on, default value is used for result name.
8558 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8560 # @return New GEOM.GEOM_Object, containing the result shape.
8562 # @ref tui_fillet2d "Example"
8563 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8565 Perform a fillet at the specified vertices of the given face/shell.
8568 theShape Face or Shell shape to perform fillet on.
8570 theListOfVertexes Global indices of vertexes to perform fillet on.
8571 theName Object name; when specified, this parameter is used
8572 for result publication in the study. Otherwise, if automatic
8573 publication is switched on, default value is used for result name.
8575 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8578 New GEOM.GEOM_Object, containing the result shape.
8581 face = geompy.MakeFaceHW(100, 100, 1)
8582 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8584 # Example: see GEOM_TestAll.py
8585 theR,Parameters = ParseParameters(theR)
8586 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8587 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8588 anObj.SetParameters(Parameters)
8589 self._autoPublish(anObj, theName, "fillet")
8592 ## Perform a symmetric chamfer on all edges of the given shape.
8593 # @param theShape Shape, to perform chamfer on.
8594 # @param theD Chamfer size along each face.
8595 # @param theName Object name; when specified, this parameter is used
8596 # for result publication in the study. Otherwise, if automatic
8597 # publication is switched on, default value is used for result name.
8599 # @return New GEOM.GEOM_Object, containing the result shape.
8601 # @ref tui_chamfer "Example 1"
8602 # \n @ref swig_MakeChamferAll "Example 2"
8603 def MakeChamferAll(self, theShape, theD, theName=None):
8605 Perform a symmetric chamfer on all edges of the given shape.
8608 theShape Shape, to perform chamfer on.
8609 theD Chamfer size along each face.
8610 theName Object name; when specified, this parameter is used
8611 for result publication in the study. Otherwise, if automatic
8612 publication is switched on, default value is used for result name.
8615 New GEOM.GEOM_Object, containing the result shape.
8618 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8620 # Example: see GEOM_TestOthers.py
8621 theD,Parameters = ParseParameters(theD)
8622 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8623 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8624 anObj.SetParameters(Parameters)
8625 self._autoPublish(anObj, theName, "chamfer")
8628 ## Perform a chamfer on edges, common to the specified faces,
8629 # with distance D1 on the Face1
8630 # @param theShape Shape, to perform chamfer on.
8631 # @param theD1 Chamfer size along \a theFace1.
8632 # @param theD2 Chamfer size along \a theFace2.
8633 # @param theFace1,theFace2 Global indices of two faces 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 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8640 # @return New GEOM.GEOM_Object, containing the result shape.
8642 # @ref tui_chamfer "Example"
8643 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8645 Perform a chamfer on edges, common to the specified faces,
8646 with distance D1 on the Face1
8649 theShape Shape, to perform chamfer on.
8650 theD1 Chamfer size along theFace1.
8651 theD2 Chamfer size along theFace2.
8652 theFace1,theFace2 Global indices of two faces of theShape.
8653 theName Object name; when specified, this parameter is used
8654 for result publication in the study. Otherwise, if automatic
8655 publication is switched on, default value is used for result name.
8658 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8661 New GEOM.GEOM_Object, containing the result shape.
8664 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8665 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8666 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8667 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8669 # Example: see GEOM_TestAll.py
8670 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8671 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8672 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8673 anObj.SetParameters(Parameters)
8674 self._autoPublish(anObj, theName, "chamfer")
8677 ## Perform a chamfer on edges
8678 # @param theShape Shape, to perform chamfer on.
8679 # @param theD Chamfer length
8680 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8681 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8682 # @param theName Object name; when specified, this parameter is used
8683 # for result publication in the study. Otherwise, if automatic
8684 # publication is switched on, default value is used for result name.
8686 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8688 # @return New GEOM.GEOM_Object, containing the result shape.
8689 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8691 Perform a chamfer on edges
8694 theShape Shape, to perform chamfer on.
8695 theD1 Chamfer size along theFace1.
8696 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8697 theFace1,theFace2 Global indices of two faces of theShape.
8698 theName Object name; when specified, this parameter is used
8699 for result publication in the study. Otherwise, if automatic
8700 publication is switched on, default value is used for result name.
8703 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8706 New GEOM.GEOM_Object, containing the result shape.
8709 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8710 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8711 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8713 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8716 if isinstance(theAngle,str):
8718 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8720 theAngle = theAngle*math.pi/180.0
8721 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8722 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8723 anObj.SetParameters(Parameters)
8724 self._autoPublish(anObj, theName, "chamfer")
8727 ## Perform a chamfer on all edges of the specified faces,
8728 # with distance D1 on the first specified face (if several for one edge)
8729 # @param theShape Shape, to perform chamfer on.
8730 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8731 # connected to the edge, are in \a theFaces, \a theD1
8732 # will be get along face, which is nearer to \a theFaces beginning.
8733 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8734 # @param theFaces Sequence of global indices of faces of \a theShape.
8735 # @param theName Object name; when specified, this parameter is used
8736 # for result publication in the study. Otherwise, if automatic
8737 # publication is switched on, default value is used for result name.
8739 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8741 # @return New GEOM.GEOM_Object, containing the result shape.
8743 # @ref tui_chamfer "Example"
8744 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8746 Perform a chamfer on all edges of the specified faces,
8747 with distance D1 on the first specified face (if several for one edge)
8750 theShape Shape, to perform chamfer on.
8751 theD1 Chamfer size along face from theFaces. If both faces,
8752 connected to the edge, are in theFaces, theD1
8753 will be get along face, which is nearer to theFaces beginning.
8754 theD2 Chamfer size along another of two faces, connected to the edge.
8755 theFaces Sequence of global indices of faces of theShape.
8756 theName Object name; when specified, this parameter is used
8757 for result publication in the study. Otherwise, if automatic
8758 publication is switched on, default value is used for result name.
8760 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8763 New GEOM.GEOM_Object, containing the result shape.
8765 # Example: see GEOM_TestAll.py
8766 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8767 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8768 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8769 anObj.SetParameters(Parameters)
8770 self._autoPublish(anObj, theName, "chamfer")
8773 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8774 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8776 # @ref swig_FilletChamfer "Example"
8777 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8779 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8780 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8783 if isinstance(theAngle,str):
8785 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8787 theAngle = theAngle*math.pi/180.0
8788 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8789 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8790 anObj.SetParameters(Parameters)
8791 self._autoPublish(anObj, theName, "chamfer")
8794 ## Perform a chamfer on edges,
8795 # with distance D1 on the first specified face (if several for one edge)
8796 # @param theShape Shape, to perform chamfer on.
8797 # @param theD1,theD2 Chamfer size
8798 # @param theEdges Sequence of edges of \a theShape.
8799 # @param theName Object name; when specified, this parameter is used
8800 # for result publication in the study. Otherwise, if automatic
8801 # publication is switched on, default value is used for result name.
8803 # @return New GEOM.GEOM_Object, containing the result shape.
8805 # @ref swig_FilletChamfer "Example"
8806 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8808 Perform a chamfer on edges,
8809 with distance D1 on the first specified face (if several for one edge)
8812 theShape Shape, to perform chamfer on.
8813 theD1,theD2 Chamfer size
8814 theEdges Sequence of edges of theShape.
8815 theName Object name; when specified, this parameter is used
8816 for result publication in the study. Otherwise, if automatic
8817 publication is switched on, default value is used for result name.
8820 New GEOM.GEOM_Object, containing the result shape.
8822 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8823 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8824 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8825 anObj.SetParameters(Parameters)
8826 self._autoPublish(anObj, theName, "chamfer")
8829 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8830 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8831 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8833 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8834 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8837 if isinstance(theAngle,str):
8839 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8841 theAngle = theAngle*math.pi/180.0
8842 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8843 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8844 anObj.SetParameters(Parameters)
8845 self._autoPublish(anObj, theName, "chamfer")
8848 ## @sa MakeChamferEdge(), MakeChamferFaces()
8850 # @ref swig_MakeChamfer "Example"
8851 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8853 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8855 # Example: see GEOM_TestOthers.py
8857 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8858 if aShapeType == self.ShapeType["EDGE"]:
8859 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8861 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8864 ## Remove material from a solid by extrusion of the base shape on the given distance.
8865 # @param theInit Shape to remove material from. It must be a solid or
8866 # a compound made of a single solid.
8867 # @param theBase Closed edge or wire defining the base shape to be extruded.
8868 # @param theH Prism dimension along the normal to theBase
8869 # @param theAngle Draft angle in degrees.
8870 # @param theName Object name; when specified, this parameter is used
8871 # for result publication in the study. Otherwise, if automatic
8872 # publication is switched on, default value is used for result name.
8874 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8876 # @ref tui_creation_prism "Example"
8877 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8879 Add material to a solid by extrusion of the base shape on the given distance.
8882 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8883 theBase Closed edge or wire defining the base shape to be extruded.
8884 theH Prism dimension along the normal to theBase
8885 theAngle Draft angle in degrees.
8886 theName Object name; when specified, this parameter is used
8887 for result publication in the study. Otherwise, if automatic
8888 publication is switched on, default value is used for result name.
8891 New GEOM.GEOM_Object, containing the initial shape with removed material.
8893 # Example: see GEOM_TestAll.py
8894 #theH,Parameters = ParseParameters(theH)
8895 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8896 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8897 #anObj.SetParameters(Parameters)
8898 self._autoPublish(anObj, theName, "extrudedCut")
8901 ## Add material to a solid by extrusion of the base shape on the given distance.
8902 # @param theInit Shape to add material to. It must be a solid or
8903 # a compound made of a single solid.
8904 # @param theBase Closed edge or wire defining the base shape to be extruded.
8905 # @param theH Prism dimension along the normal to theBase
8906 # @param theAngle Draft angle in degrees.
8907 # @param theName Object name; when specified, this parameter is used
8908 # for result publication in the study. Otherwise, if automatic
8909 # publication is switched on, default value is used for result name.
8911 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8913 # @ref tui_creation_prism "Example"
8914 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8916 Add material to a solid by extrusion of the base shape on the given distance.
8919 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8920 theBase Closed edge or wire defining the base shape to be extruded.
8921 theH Prism dimension along the normal to theBase
8922 theAngle Draft angle in degrees.
8923 theName Object name; when specified, this parameter is used
8924 for result publication in the study. Otherwise, if automatic
8925 publication is switched on, default value is used for result name.
8928 New GEOM.GEOM_Object, containing the initial shape with added material.
8930 # Example: see GEOM_TestAll.py
8931 #theH,Parameters = ParseParameters(theH)
8932 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8933 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8934 #anObj.SetParameters(Parameters)
8935 self._autoPublish(anObj, theName, "extrudedBoss")
8941 ## @addtogroup l3_basic_op
8944 ## Perform an Archimde operation on the given shape with given parameters.
8945 # The object presenting the resulting face is returned.
8946 # @param theShape Shape to be put in water.
8947 # @param theWeight Weight og the shape.
8948 # @param theWaterDensity Density of the water.
8949 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8950 # @param theName Object name; when specified, this parameter is used
8951 # for result publication in the study. Otherwise, if automatic
8952 # publication is switched on, default value is used for result name.
8954 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8955 # by a plane, corresponding to water level.
8957 # @ref tui_archimede "Example"
8958 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8960 Perform an Archimde operation on the given shape with given parameters.
8961 The object presenting the resulting face is returned.
8964 theShape Shape to be put in water.
8965 theWeight Weight og the shape.
8966 theWaterDensity Density of the water.
8967 theMeshDeflection Deflection of the mesh, using to compute the section.
8968 theName Object name; when specified, this parameter is used
8969 for result publication in the study. Otherwise, if automatic
8970 publication is switched on, default value is used for result name.
8973 New GEOM.GEOM_Object, containing a section of theShape
8974 by a plane, corresponding to water level.
8976 # Example: see GEOM_TestAll.py
8977 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8978 theWeight,theWaterDensity,theMeshDeflection)
8979 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8980 RaiseIfFailed("MakeArchimede", self.LocalOp)
8981 anObj.SetParameters(Parameters)
8982 self._autoPublish(anObj, theName, "archimede")
8985 # end of l3_basic_op
8988 ## @addtogroup l2_measure
8991 ## Get point coordinates
8994 # @ref tui_measurement_tools_page "Example"
8995 def PointCoordinates(self,Point):
8997 Get point coordinates
9002 # Example: see GEOM_TestMeasures.py
9003 aTuple = self.MeasuOp.PointCoordinates(Point)
9004 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9007 ## Get vector coordinates
9010 # @ref tui_measurement_tools_page "Example"
9011 def VectorCoordinates(self,Vector):
9013 Get vector coordinates
9019 p1=self.GetFirstVertex(Vector)
9020 p2=self.GetLastVertex(Vector)
9022 X1=self.PointCoordinates(p1)
9023 X2=self.PointCoordinates(p2)
9025 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9028 ## Compute cross product
9029 # @return vector w=u^v
9031 # @ref tui_measurement_tools_page "Example"
9032 def CrossProduct(self, Vector1, Vector2):
9034 Compute cross product
9036 Returns: vector w=u^v
9038 u=self.VectorCoordinates(Vector1)
9039 v=self.VectorCoordinates(Vector2)
9040 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])
9044 ## Compute cross product
9045 # @return dot product p=u.v
9047 # @ref tui_measurement_tools_page "Example"
9048 def DotProduct(self, Vector1, Vector2):
9050 Compute cross product
9052 Returns: dot product p=u.v
9054 u=self.VectorCoordinates(Vector1)
9055 v=self.VectorCoordinates(Vector2)
9056 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9061 ## Get summarized length of all wires,
9062 # area of surface and volume of the given shape.
9063 # @param theShape Shape to define properties of.
9064 # @return [theLength, theSurfArea, theVolume]\n
9065 # theLength: Summarized length of all wires of the given shape.\n
9066 # theSurfArea: Area of surface of the given shape.\n
9067 # theVolume: Volume of the given shape.
9069 # @ref tui_measurement_tools_page "Example"
9070 def BasicProperties(self,theShape):
9072 Get summarized length of all wires,
9073 area of surface and volume of the given shape.
9076 theShape Shape to define properties of.
9079 [theLength, theSurfArea, theVolume]
9080 theLength: Summarized length of all wires of the given shape.
9081 theSurfArea: Area of surface of the given shape.
9082 theVolume: Volume of the given shape.
9084 # Example: see GEOM_TestMeasures.py
9085 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9086 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9089 ## Get parameters of bounding box of the given shape
9090 # @param theShape Shape to obtain bounding box of.
9091 # @param precise TRUE for precise computation; FALSE for fast one.
9092 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9093 # Xmin,Xmax: Limits of shape along OX axis.
9094 # Ymin,Ymax: Limits of shape along OY axis.
9095 # Zmin,Zmax: Limits of shape along OZ axis.
9097 # @ref tui_measurement_tools_page "Example"
9098 def BoundingBox (self, theShape, precise=False):
9100 Get parameters of bounding box of the given shape
9103 theShape Shape to obtain bounding box of.
9104 precise TRUE for precise computation; FALSE for fast one.
9107 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9108 Xmin,Xmax: Limits of shape along OX axis.
9109 Ymin,Ymax: Limits of shape along OY axis.
9110 Zmin,Zmax: Limits of shape along OZ axis.
9112 # Example: see GEOM_TestMeasures.py
9113 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9114 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9117 ## Get bounding box of the given shape
9118 # @param theShape Shape to obtain bounding box of.
9119 # @param precise TRUE for precise computation; FALSE for fast one.
9120 # @param theName Object name; when specified, this parameter is used
9121 # for result publication in the study. Otherwise, if automatic
9122 # publication is switched on, default value is used for result name.
9124 # @return New GEOM.GEOM_Object, containing the created box.
9126 # @ref tui_measurement_tools_page "Example"
9127 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9129 Get bounding box of the given shape
9132 theShape Shape to obtain bounding box of.
9133 precise TRUE for precise computation; FALSE for fast one.
9134 theName Object name; when specified, this parameter is used
9135 for result publication in the study. Otherwise, if automatic
9136 publication is switched on, default value is used for result name.
9139 New GEOM.GEOM_Object, containing the created box.
9141 # Example: see GEOM_TestMeasures.py
9142 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9143 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9144 self._autoPublish(anObj, theName, "bndbox")
9147 ## Get inertia matrix and moments of inertia of theShape.
9148 # @param theShape Shape to calculate inertia of.
9149 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9150 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9151 # Ix,Iy,Iz: Moments of inertia of the given shape.
9153 # @ref tui_measurement_tools_page "Example"
9154 def Inertia(self,theShape):
9156 Get inertia matrix and moments of inertia of theShape.
9159 theShape Shape to calculate inertia of.
9162 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9163 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9164 Ix,Iy,Iz: Moments of inertia of the given shape.
9166 # Example: see GEOM_TestMeasures.py
9167 aTuple = self.MeasuOp.GetInertia(theShape)
9168 RaiseIfFailed("GetInertia", self.MeasuOp)
9171 ## Get if coords are included in the shape (ST_IN or ST_ON)
9172 # @param theShape Shape
9173 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9174 # @param tolerance to be used (default is 1.0e-7)
9175 # @return list_of_boolean = [res1, res2, ...]
9176 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9178 Get if coords are included in the shape (ST_IN or ST_ON)
9182 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9183 tolerance to be used (default is 1.0e-7)
9186 list_of_boolean = [res1, res2, ...]
9188 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9190 ## Get minimal distance between the given shapes.
9191 # @param theShape1,theShape2 Shapes to find minimal distance between.
9192 # @return Value of the minimal distance between the given shapes.
9194 # @ref tui_measurement_tools_page "Example"
9195 def MinDistance(self, theShape1, theShape2):
9197 Get minimal distance between the given shapes.
9200 theShape1,theShape2 Shapes to find minimal distance between.
9203 Value of the minimal distance between the given shapes.
9205 # Example: see GEOM_TestMeasures.py
9206 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9207 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9210 ## Get minimal distance between the given shapes.
9211 # @param theShape1,theShape2 Shapes to find minimal distance between.
9212 # @return Value of the minimal distance between the given shapes, in form of list
9213 # [Distance, DX, DY, DZ].
9215 # @ref swig_all_measure "Example"
9216 def MinDistanceComponents(self, theShape1, theShape2):
9218 Get minimal distance between the given shapes.
9221 theShape1,theShape2 Shapes to find minimal distance between.
9224 Value of the minimal distance between the given shapes, in form of list
9225 [Distance, DX, DY, DZ]
9227 # Example: see GEOM_TestMeasures.py
9228 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9229 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9230 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9233 ## Get closest points of the given shapes.
9234 # @param theShape1,theShape2 Shapes to find closest points of.
9235 # @return The number of found solutions (-1 in case of infinite number of
9236 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9238 # @ref tui_measurement_tools_page "Example"
9239 def ClosestPoints (self, theShape1, theShape2):
9241 Get closest points of the given shapes.
9244 theShape1,theShape2 Shapes to find closest points of.
9247 The number of found solutions (-1 in case of infinite number of
9248 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9250 # Example: see GEOM_TestMeasures.py
9251 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9252 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9255 ## Get angle between the given shapes in degrees.
9256 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9257 # @note If both arguments are vectors, the angle is computed in accordance
9258 # with their orientations, otherwise the minimum angle is computed.
9259 # @return Value of the angle between the given shapes in degrees.
9261 # @ref tui_measurement_tools_page "Example"
9262 def GetAngle(self, theShape1, theShape2):
9264 Get angle between the given shapes in degrees.
9267 theShape1,theShape2 Lines or linear edges to find angle between.
9270 If both arguments are vectors, the angle is computed in accordance
9271 with their orientations, otherwise the minimum angle is computed.
9274 Value of the angle between the given shapes in degrees.
9276 # Example: see GEOM_TestMeasures.py
9277 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9278 RaiseIfFailed("GetAngle", self.MeasuOp)
9281 ## Get angle between the given shapes in radians.
9282 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9283 # @note If both arguments are vectors, the angle is computed in accordance
9284 # with their orientations, otherwise the minimum angle is computed.
9285 # @return Value of the angle between the given shapes in radians.
9287 # @ref tui_measurement_tools_page "Example"
9288 def GetAngleRadians(self, theShape1, theShape2):
9290 Get angle between the given shapes in radians.
9293 theShape1,theShape2 Lines or linear edges to find angle between.
9297 If both arguments are vectors, the angle is computed in accordance
9298 with their orientations, otherwise the minimum angle is computed.
9301 Value of the angle between the given shapes in radians.
9303 # Example: see GEOM_TestMeasures.py
9304 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9305 RaiseIfFailed("GetAngle", self.MeasuOp)
9308 ## Get angle between the given vectors in degrees.
9309 # @param theShape1,theShape2 Vectors to find angle between.
9310 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9311 # if False, the opposite vector to the normal vector is used.
9312 # @return Value of the angle between the given vectors in degrees.
9314 # @ref tui_measurement_tools_page "Example"
9315 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9317 Get angle between the given vectors in degrees.
9320 theShape1,theShape2 Vectors to find angle between.
9321 theFlag If True, the normal vector is defined by the two vectors cross,
9322 if False, the opposite vector to the normal vector is used.
9325 Value of the angle between the given vectors in degrees.
9327 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9329 anAngle = 360. - anAngle
9330 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9333 ## The same as GetAngleVectors, but the result is in radians.
9334 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9336 Get angle between the given vectors in radians.
9339 theShape1,theShape2 Vectors to find angle between.
9340 theFlag If True, the normal vector is defined by the two vectors cross,
9341 if False, the opposite vector to the normal vector is used.
9344 Value of the angle between the given vectors in radians.
9346 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9349 ## @name Curve Curvature Measurement
9350 # Methods for receiving radius of curvature of curves
9351 # in the given point
9354 ## Measure curvature of a curve at a point, set by parameter.
9355 # @param theCurve a curve.
9356 # @param theParam parameter.
9357 # @return radius of curvature of \a theCurve.
9359 # @ref swig_todo "Example"
9360 def CurveCurvatureByParam(self, theCurve, theParam):
9362 Measure curvature of a curve at a point, set by parameter.
9369 radius of curvature of theCurve.
9371 # Example: see GEOM_TestMeasures.py
9372 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9373 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9376 ## Measure curvature of a curve at a point.
9377 # @param theCurve a curve.
9378 # @param thePoint given point.
9379 # @return radius of curvature of \a theCurve.
9381 # @ref swig_todo "Example"
9382 def CurveCurvatureByPoint(self, theCurve, thePoint):
9384 Measure curvature of a curve at a point.
9388 thePoint given point.
9391 radius of curvature of theCurve.
9393 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9394 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9398 ## @name Surface Curvature Measurement
9399 # Methods for receiving max and min radius of curvature of surfaces
9400 # in the given point
9403 ## Measure max radius of curvature of surface.
9404 # @param theSurf the given surface.
9405 # @param theUParam Value of U-parameter on the referenced surface.
9406 # @param theVParam Value of V-parameter on the referenced surface.
9407 # @return max radius of curvature of theSurf.
9409 ## @ref swig_todo "Example"
9410 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9412 Measure max radius of curvature of surface.
9415 theSurf the given surface.
9416 theUParam Value of U-parameter on the referenced surface.
9417 theVParam Value of V-parameter on the referenced surface.
9420 max radius of curvature of theSurf.
9422 # Example: see GEOM_TestMeasures.py
9423 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9424 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9427 ## Measure max radius of curvature of surface in the given point
9428 # @param theSurf the given surface.
9429 # @param thePoint given point.
9430 # @return max radius of curvature of theSurf.
9432 ## @ref swig_todo "Example"
9433 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9435 Measure max radius of curvature of surface in the given point.
9438 theSurf the given surface.
9439 thePoint given point.
9442 max radius of curvature of theSurf.
9444 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9445 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9448 ## Measure min radius of curvature of surface.
9449 # @param theSurf the given surface.
9450 # @param theUParam Value of U-parameter on the referenced surface.
9451 # @param theVParam Value of V-parameter on the referenced surface.
9452 # @return min radius of curvature of theSurf.
9454 ## @ref swig_todo "Example"
9455 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9457 Measure min radius of curvature of surface.
9460 theSurf the given surface.
9461 theUParam Value of U-parameter on the referenced surface.
9462 theVParam Value of V-parameter on the referenced surface.
9465 Min radius of curvature of theSurf.
9467 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9468 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9471 ## Measure min radius of curvature of surface in the given point
9472 # @param theSurf the given surface.
9473 # @param thePoint given point.
9474 # @return min radius of curvature of theSurf.
9476 ## @ref swig_todo "Example"
9477 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9479 Measure min radius of curvature of surface in the given point.
9482 theSurf the given surface.
9483 thePoint given point.
9486 Min radius of curvature of theSurf.
9488 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9489 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9493 ## Get min and max tolerances of sub-shapes of theShape
9494 # @param theShape Shape, to get tolerances of.
9495 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9496 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9497 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9498 # VertMin,VertMax: Min and max tolerances of the vertices.
9500 # @ref tui_measurement_tools_page "Example"
9501 def Tolerance(self,theShape):
9503 Get min and max tolerances of sub-shapes of theShape
9506 theShape Shape, to get tolerances of.
9509 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9510 FaceMin,FaceMax: Min and max tolerances of the faces.
9511 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9512 VertMin,VertMax: Min and max tolerances of the vertices.
9514 # Example: see GEOM_TestMeasures.py
9515 aTuple = self.MeasuOp.GetTolerance(theShape)
9516 RaiseIfFailed("GetTolerance", self.MeasuOp)
9519 ## Obtain description of the given shape (number of sub-shapes of each type)
9520 # @param theShape Shape to be described.
9521 # @return Description of the given shape.
9523 # @ref tui_measurement_tools_page "Example"
9524 def WhatIs(self,theShape):
9526 Obtain description of the given shape (number of sub-shapes of each type)
9529 theShape Shape to be described.
9532 Description of the given shape.
9534 # Example: see GEOM_TestMeasures.py
9535 aDescr = self.MeasuOp.WhatIs(theShape)
9536 RaiseIfFailed("WhatIs", self.MeasuOp)
9539 ## Obtain quantity of shapes of the given type in \a theShape.
9540 # If \a theShape is of type \a theType, it is also counted.
9541 # @param theShape Shape to be described.
9542 # @param theType the given ShapeType().
9543 # @return Quantity of shapes of type \a theType in \a theShape.
9545 # @ref tui_measurement_tools_page "Example"
9546 def NbShapes (self, theShape, theType):
9548 Obtain quantity of shapes of the given type in theShape.
9549 If theShape is of type theType, it is also counted.
9552 theShape Shape to be described.
9553 theType the given geompy.ShapeType
9556 Quantity of shapes of type theType in theShape.
9558 # Example: see GEOM_TestMeasures.py
9559 listSh = self.SubShapeAllIDs(theShape, theType)
9561 t = EnumToLong(theShape.GetShapeType())
9562 theType = EnumToLong(theType)
9568 ## Obtain quantity of shapes of each type in \a theShape.
9569 # The \a theShape is also counted.
9570 # @param theShape Shape to be described.
9571 # @return Dictionary of ShapeType() with bound quantities of shapes.
9573 # @ref tui_measurement_tools_page "Example"
9574 def ShapeInfo (self, theShape):
9576 Obtain quantity of shapes of each type in theShape.
9577 The theShape is also counted.
9580 theShape Shape to be described.
9583 Dictionary of geompy.ShapeType with bound quantities of shapes.
9585 # Example: see GEOM_TestMeasures.py
9587 for typeSh in self.ShapeType:
9588 if typeSh in ( "AUTO", "SHAPE" ): continue
9589 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9591 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9598 ## Get a point, situated at the centre of mass of theShape.
9599 # @param theShape Shape to define centre of mass of.
9600 # @param theName Object name; when specified, this parameter is used
9601 # for result publication in the study. Otherwise, if automatic
9602 # publication is switched on, default value is used for result name.
9604 # @return New GEOM.GEOM_Object, containing the created point.
9606 # @ref tui_measurement_tools_page "Example"
9607 def MakeCDG(self, theShape, theName=None):
9609 Get a point, situated at the centre of mass of theShape.
9612 theShape Shape to define centre of mass of.
9613 theName Object name; when specified, this parameter is used
9614 for result publication in the study. Otherwise, if automatic
9615 publication is switched on, default value is used for result name.
9618 New GEOM.GEOM_Object, containing the created point.
9620 # Example: see GEOM_TestMeasures.py
9621 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9622 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9623 self._autoPublish(anObj, theName, "centerOfMass")
9626 ## Get a vertex sub-shape by index depended with orientation.
9627 # @param theShape Shape to find sub-shape.
9628 # @param theIndex Index to find vertex by this index (starting from zero)
9629 # @param theName Object name; when specified, this parameter is used
9630 # for result publication in the study. Otherwise, if automatic
9631 # publication is switched on, default value is used for result name.
9633 # @return New GEOM.GEOM_Object, containing the created vertex.
9635 # @ref tui_measurement_tools_page "Example"
9636 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9638 Get a vertex sub-shape by index depended with orientation.
9641 theShape Shape to find sub-shape.
9642 theIndex Index to find vertex by this index (starting from zero)
9643 theName Object name; when specified, this parameter is used
9644 for result publication in the study. Otherwise, if automatic
9645 publication is switched on, default value is used for result name.
9648 New GEOM.GEOM_Object, containing the created vertex.
9650 # Example: see GEOM_TestMeasures.py
9651 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9652 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9653 self._autoPublish(anObj, theName, "vertex")
9656 ## Get the first vertex of wire/edge depended orientation.
9657 # @param theShape Shape to find first vertex.
9658 # @param theName Object name; when specified, this parameter is used
9659 # for result publication in the study. Otherwise, if automatic
9660 # publication is switched on, default value is used for result name.
9662 # @return New GEOM.GEOM_Object, containing the created vertex.
9664 # @ref tui_measurement_tools_page "Example"
9665 def GetFirstVertex(self, theShape, theName=None):
9667 Get the first vertex of wire/edge depended orientation.
9670 theShape Shape to find first vertex.
9671 theName Object name; when specified, this parameter is used
9672 for result publication in the study. Otherwise, if automatic
9673 publication is switched on, default value is used for result name.
9676 New GEOM.GEOM_Object, containing the created vertex.
9678 # Example: see GEOM_TestMeasures.py
9679 # note: auto-publishing is done in self.GetVertexByIndex()
9680 anObj = self.GetVertexByIndex(theShape, 0, theName)
9681 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9684 ## Get the last vertex of wire/edge depended orientation.
9685 # @param theShape Shape to find last vertex.
9686 # @param theName Object name; when specified, this parameter is used
9687 # for result publication in the study. Otherwise, if automatic
9688 # publication is switched on, default value is used for result name.
9690 # @return New GEOM.GEOM_Object, containing the created vertex.
9692 # @ref tui_measurement_tools_page "Example"
9693 def GetLastVertex(self, theShape, theName=None):
9695 Get the last vertex of wire/edge depended orientation.
9698 theShape Shape to find last vertex.
9699 theName Object name; when specified, this parameter is used
9700 for result publication in the study. Otherwise, if automatic
9701 publication is switched on, default value is used for result name.
9704 New GEOM.GEOM_Object, containing the created vertex.
9706 # Example: see GEOM_TestMeasures.py
9707 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9708 # note: auto-publishing is done in self.GetVertexByIndex()
9709 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9710 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9713 ## Get a normale to the given face. If the point is not given,
9714 # the normale is calculated at the center of mass.
9715 # @param theFace Face to define normale of.
9716 # @param theOptionalPoint Point to compute the normale at.
9717 # @param theName Object name; when specified, this parameter is used
9718 # for result publication in the study. Otherwise, if automatic
9719 # publication is switched on, default value is used for result name.
9721 # @return New GEOM.GEOM_Object, containing the created vector.
9723 # @ref swig_todo "Example"
9724 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9726 Get a normale to the given face. If the point is not given,
9727 the normale is calculated at the center of mass.
9730 theFace Face to define normale of.
9731 theOptionalPoint Point to compute the normale at.
9732 theName Object name; when specified, this parameter is used
9733 for result publication in the study. Otherwise, if automatic
9734 publication is switched on, default value is used for result name.
9737 New GEOM.GEOM_Object, containing the created vector.
9739 # Example: see GEOM_TestMeasures.py
9740 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9741 RaiseIfFailed("GetNormal", self.MeasuOp)
9742 self._autoPublish(anObj, theName, "normal")
9745 ## Check a topology of the given shape.
9746 # @param theShape Shape to check validity of.
9747 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9748 # if TRUE, the shape's geometry will be checked also.
9749 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9750 # of problem is printed.
9751 # if TRUE and if theShape is invalid, the description
9752 # of problem is also returned.
9753 # @return TRUE, if the shape "seems to be valid".
9755 # @ref tui_measurement_tools_page "Example"
9756 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9758 Check a topology of the given shape.
9761 theShape Shape to check validity of.
9762 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9763 if TRUE, the shape's geometry will be checked also.
9764 theReturnStatus If FALSE and if theShape is invalid, a description
9765 of problem is printed.
9766 if TRUE and if theShape is invalid, the description
9767 of problem is returned.
9770 TRUE, if the shape "seems to be valid".
9771 If theShape is invalid, prints a description of problem.
9772 This description can also be returned.
9774 # Example: see GEOM_TestMeasures.py
9776 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9777 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9779 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9780 RaiseIfFailed("CheckShape", self.MeasuOp)
9782 if theReturnStatus == 0:
9784 if theReturnStatus == 1:
9785 return (IsValid, Status)
9788 ## Detect self-intersections in the given shape.
9789 # @param theShape Shape to check.
9790 # @return TRUE, if the shape contains no self-intersections.
9792 # @ref tui_measurement_tools_page "Example"
9793 def CheckSelfIntersections(self, theShape):
9795 Detect self-intersections in the given shape.
9798 theShape Shape to check.
9801 TRUE, if the shape contains no self-intersections.
9803 # Example: see GEOM_TestMeasures.py
9804 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9805 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9808 ## Get position (LCS) of theShape.
9810 # Origin of the LCS is situated at the shape's center of mass.
9811 # Axes of the LCS are obtained from shape's location or,
9812 # if the shape is a planar face, from position of its plane.
9814 # @param theShape Shape to calculate position of.
9815 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9816 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9817 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9818 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9820 # @ref swig_todo "Example"
9821 def GetPosition(self,theShape):
9823 Get position (LCS) of theShape.
9824 Origin of the LCS is situated at the shape's center of mass.
9825 Axes of the LCS are obtained from shape's location or,
9826 if the shape is a planar face, from position of its plane.
9829 theShape Shape to calculate position of.
9832 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9833 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9834 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9835 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9837 # Example: see GEOM_TestMeasures.py
9838 aTuple = self.MeasuOp.GetPosition(theShape)
9839 RaiseIfFailed("GetPosition", self.MeasuOp)
9842 ## Get kind of theShape.
9844 # @param theShape Shape to get a kind of.
9845 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9846 # and a list of parameters, describing the shape.
9847 # @note Concrete meaning of each value, returned via \a theIntegers
9848 # or \a theDoubles list depends on the kind() of the shape.
9850 # @ref swig_todo "Example"
9851 def KindOfShape(self,theShape):
9853 Get kind of theShape.
9856 theShape Shape to get a kind of.
9859 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9860 and a list of parameters, describing the shape.
9862 Concrete meaning of each value, returned via theIntegers
9863 or theDoubles list depends on the geompy.kind of the shape
9865 # Example: see GEOM_TestMeasures.py
9866 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9867 RaiseIfFailed("KindOfShape", self.MeasuOp)
9869 aKind = aRoughTuple[0]
9870 anInts = aRoughTuple[1]
9871 aDbls = aRoughTuple[2]
9873 # Now there is no exception from this rule:
9874 aKindTuple = [aKind] + aDbls + anInts
9876 # If they are we will regroup parameters for such kind of shape.
9878 #if aKind == kind.SOME_KIND:
9879 # # SOME_KIND int int double int double double
9880 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9887 ## @addtogroup l2_import_export
9890 ## Import a shape from the BREP or IGES or STEP file
9891 # (depends on given format) with given name.
9892 # @param theFileName The file, containing the shape.
9893 # @param theFormatName Specify format for the file reading.
9894 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9895 # If format 'IGES_SCALE' is used instead of 'IGES' or
9896 # format 'STEP_SCALE' is used instead of 'STEP',
9897 # length unit will be set to 'meter' and result model will be scaled.
9898 # @param theName Object name; when specified, this parameter is used
9899 # for result publication in the study. Otherwise, if automatic
9900 # publication is switched on, default value is used for result name.
9902 # @return New GEOM.GEOM_Object, containing the imported shape.
9904 # @ref swig_Import_Export "Example"
9905 def ImportFile(self, theFileName, theFormatName, theName=None):
9907 Import a shape from the BREP or IGES or STEP file
9908 (depends on given format) with given name.
9911 theFileName The file, containing the shape.
9912 theFormatName Specify format for the file reading.
9913 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9914 If format 'IGES_SCALE' is used instead of 'IGES' or
9915 format 'STEP_SCALE' is used instead of 'STEP',
9916 length unit will be set to 'meter' and result model will be scaled.
9917 theName Object name; when specified, this parameter is used
9918 for result publication in the study. Otherwise, if automatic
9919 publication is switched on, default value is used for result name.
9922 New GEOM.GEOM_Object, containing the imported shape.
9924 # Example: see GEOM_TestOthers.py
9925 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9926 RaiseIfFailed("ImportFile", self.InsertOp)
9927 self._autoPublish(anObj, theName, "imported")
9930 ## Deprecated analog of ImportFile()
9931 def Import(self, theFileName, theFormatName, theName=None):
9933 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9935 print "WARNING: Function Import is deprecated, use ImportFile instead"
9936 # note: auto-publishing is done in self.ImportFile()
9937 return self.ImportFile(theFileName, theFormatName, theName)
9939 ## Shortcut to ImportFile() for BREP format.
9940 # Import a shape from the BREP file with given name.
9941 # @param theFileName The file, containing the shape.
9942 # @param theName Object name; when specified, this parameter is used
9943 # for result publication in the study. Otherwise, if automatic
9944 # publication is switched on, default value is used for result name.
9946 # @return New GEOM.GEOM_Object, containing the imported shape.
9948 # @ref swig_Import_Export "Example"
9949 def ImportBREP(self, theFileName, theName=None):
9951 geompy.ImportFile(...) function for BREP format
9952 Import a shape from the BREP file with given name.
9955 theFileName The file, containing the shape.
9956 theName Object name; when specified, this parameter is used
9957 for result publication in the study. Otherwise, if automatic
9958 publication is switched on, default value is used for result name.
9961 New GEOM.GEOM_Object, containing the imported shape.
9963 # Example: see GEOM_TestOthers.py
9964 # note: auto-publishing is done in self.ImportFile()
9965 return self.ImportFile(theFileName, "BREP", theName)
9967 ## Shortcut to ImportFile() for IGES format
9968 # Import a shape from the IGES file with given name.
9969 # @param theFileName The file, containing the shape.
9970 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9971 # and result model will be scaled, if its units are not meters.
9972 # If False (default), file length units will be taken into account.
9973 # @param theName Object name; when specified, this parameter is used
9974 # for result publication in the study. Otherwise, if automatic
9975 # publication is switched on, default value is used for result name.
9977 # @return New GEOM.GEOM_Object, containing the imported shape.
9979 # @ref swig_Import_Export "Example"
9980 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9982 geompy.ImportFile(...) function for IGES format
9985 theFileName The file, containing the shape.
9986 ignoreUnits If True, file length units will be ignored (set to 'meter')
9987 and result model will be scaled, if its units are not meters.
9988 If False (default), file length units will be taken into account.
9989 theName Object name; when specified, this parameter is used
9990 for result publication in the study. Otherwise, if automatic
9991 publication is switched on, default value is used for result name.
9994 New GEOM.GEOM_Object, containing the imported shape.
9996 # Example: see GEOM_TestOthers.py
9997 # note: auto-publishing is done in self.ImportFile()
9999 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10000 return self.ImportFile(theFileName, "IGES", theName)
10002 ## Return length unit from given IGES file
10003 # @param theFileName The file, containing the shape.
10004 # @return String, containing the units name.
10006 # @ref swig_Import_Export "Example"
10007 def GetIGESUnit(self, theFileName):
10009 Return length units from given IGES file
10012 theFileName The file, containing the shape.
10015 String, containing the units name.
10017 # Example: see GEOM_TestOthers.py
10018 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10021 ## Shortcut to ImportFile() for STEP format
10022 # Import a shape from the STEP file with given name.
10023 # @param theFileName The file, containing the shape.
10024 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10025 # and result model will be scaled, if its units are not meters.
10026 # If False (default), file length units will be taken into account.
10027 # @param theName Object name; when specified, this parameter is used
10028 # for result publication in the study. Otherwise, if automatic
10029 # publication is switched on, default value is used for result name.
10031 # @return New GEOM.GEOM_Object, containing the imported shape.
10033 # @ref swig_Import_Export "Example"
10034 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10036 geompy.ImportFile(...) function for STEP format
10039 theFileName The file, containing the shape.
10040 ignoreUnits If True, file length units will be ignored (set to 'meter')
10041 and result model will be scaled, if its units are not meters.
10042 If False (default), file length units will be taken into account.
10043 theName Object name; when specified, this parameter is used
10044 for result publication in the study. Otherwise, if automatic
10045 publication is switched on, default value is used for result name.
10048 New GEOM.GEOM_Object, containing the imported shape.
10050 # Example: see GEOM_TestOthers.py
10051 # note: auto-publishing is done in self.ImportFile()
10053 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10054 return self.ImportFile(theFileName, "STEP", theName)
10056 ## Return length unit from given IGES or STEP file
10057 # @param theFileName The file, containing the shape.
10058 # @return String, containing the units name.
10060 # @ref swig_Import_Export "Example"
10061 def GetSTEPUnit(self, theFileName):
10063 Return length units from given STEP file
10066 theFileName The file, containing the shape.
10069 String, containing the units name.
10071 # Example: see GEOM_TestOthers.py
10072 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10075 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10076 # @note This method will not be dumped to the python script by DumpStudy functionality.
10077 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10078 # @param theStream The BRep binary stream.
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_Object, containing the shape, read from theStream.
10085 # @ref swig_Import_Export "Example"
10086 def RestoreShape (self, theStream, theName=None):
10088 Read a shape from the binary stream, containing its bounding representation (BRep).
10091 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10094 theStream The BRep binary stream.
10095 theName Object name; when specified, this parameter is used
10096 for result publication in the study. Otherwise, if automatic
10097 publication is switched on, default value is used for result name.
10100 New GEOM_Object, containing the shape, read from theStream.
10102 # Example: see GEOM_TestOthers.py
10103 anObj = self.InsertOp.RestoreShape(theStream)
10104 RaiseIfFailed("RestoreShape", self.InsertOp)
10105 self._autoPublish(anObj, theName, "restored")
10108 ## Export the given shape into a file with given name.
10109 # @param theObject Shape to be stored in the file.
10110 # @param theFileName Name of the file to store the given shape in.
10111 # @param theFormatName Specify format for the shape storage.
10112 # Available formats can be obtained with
10113 # geompy.InsertOp.ExportTranslators()[0] method.
10115 # @ref swig_Import_Export "Example"
10116 def Export(self, theObject, theFileName, theFormatName):
10118 Export the given shape into a file with given name.
10121 theObject Shape to be stored in the file.
10122 theFileName Name of the file to store the given shape in.
10123 theFormatName Specify format for the shape storage.
10124 Available formats can be obtained with
10125 geompy.InsertOp.ExportTranslators()[0] method.
10127 # Example: see GEOM_TestOthers.py
10128 self.InsertOp.Export(theObject, theFileName, theFormatName)
10129 if self.InsertOp.IsDone() == 0:
10130 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10134 ## Shortcut to Export() for BREP format
10136 # @ref swig_Import_Export "Example"
10137 def ExportBREP(self,theObject, theFileName):
10139 geompy.Export(...) function for BREP format
10141 # Example: see GEOM_TestOthers.py
10142 return self.Export(theObject, theFileName, "BREP")
10144 ## Shortcut to Export() for IGES format
10146 # @ref swig_Import_Export "Example"
10147 def ExportIGES(self,theObject, theFileName):
10149 geompy.Export(...) function for IGES format
10151 # Example: see GEOM_TestOthers.py
10152 return self.Export(theObject, theFileName, "IGES")
10154 ## Shortcut to Export() for STEP format
10156 # @ref swig_Import_Export "Example"
10157 def ExportSTEP(self,theObject, theFileName):
10159 geompy.Export(...) function for STEP format
10161 # Example: see GEOM_TestOthers.py
10162 return self.Export(theObject, theFileName, "STEP")
10164 # end of l2_import_export
10167 ## @addtogroup l3_blocks
10170 ## Create a quadrangle face from four edges. Order of Edges is not
10171 # important. It is not necessary that edges share the same vertex.
10172 # @param E1,E2,E3,E4 Edges for the face bound.
10173 # @param theName Object name; when specified, this parameter is used
10174 # for result publication in the study. Otherwise, if automatic
10175 # publication is switched on, default value is used for result name.
10177 # @return New GEOM.GEOM_Object, containing the created face.
10179 # @ref tui_building_by_blocks_page "Example"
10180 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10182 Create a quadrangle face from four edges. Order of Edges is not
10183 important. It is not necessary that edges share the same vertex.
10186 E1,E2,E3,E4 Edges for the face bound.
10187 theName Object name; when specified, this parameter is used
10188 for result publication in the study. Otherwise, if automatic
10189 publication is switched on, default value is used for result name.
10192 New GEOM.GEOM_Object, containing the created face.
10195 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10197 # Example: see GEOM_Spanner.py
10198 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10199 RaiseIfFailed("MakeQuad", self.BlocksOp)
10200 self._autoPublish(anObj, theName, "quad")
10203 ## Create a quadrangle face on two edges.
10204 # The missing edges will be built by creating the shortest ones.
10205 # @param E1,E2 Two opposite edges for the face.
10206 # @param theName Object name; when specified, this parameter is used
10207 # for result publication in the study. Otherwise, if automatic
10208 # publication is switched on, default value is used for result name.
10210 # @return New GEOM.GEOM_Object, containing the created face.
10212 # @ref tui_building_by_blocks_page "Example"
10213 def MakeQuad2Edges(self, E1, E2, theName=None):
10215 Create a quadrangle face on two edges.
10216 The missing edges will be built by creating the shortest ones.
10219 E1,E2 Two opposite edges for the face.
10220 theName Object name; when specified, this parameter is used
10221 for result publication in the study. Otherwise, if automatic
10222 publication is switched on, default value is used for result name.
10225 New GEOM.GEOM_Object, containing the created face.
10229 p1 = geompy.MakeVertex( 0., 0., 0.)
10230 p2 = geompy.MakeVertex(150., 30., 0.)
10231 p3 = geompy.MakeVertex( 0., 120., 50.)
10232 p4 = geompy.MakeVertex( 0., 40., 70.)
10234 edge1 = geompy.MakeEdge(p1, p2)
10235 edge2 = geompy.MakeEdge(p3, p4)
10236 # create a quadrangle face from two edges
10237 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10239 # Example: see GEOM_Spanner.py
10240 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10241 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10242 self._autoPublish(anObj, theName, "quad")
10245 ## Create a quadrangle face with specified corners.
10246 # The missing edges will be built by creating the shortest ones.
10247 # @param V1,V2,V3,V4 Corner vertices for the face.
10248 # @param theName Object name; when specified, this parameter is used
10249 # for result publication in the study. Otherwise, if automatic
10250 # publication is switched on, default value is used for result name.
10252 # @return New GEOM.GEOM_Object, containing the created face.
10254 # @ref tui_building_by_blocks_page "Example 1"
10255 # \n @ref swig_MakeQuad4Vertices "Example 2"
10256 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10258 Create a quadrangle face with specified corners.
10259 The missing edges will be built by creating the shortest ones.
10262 V1,V2,V3,V4 Corner vertices for the face.
10263 theName Object name; when specified, this parameter is used
10264 for result publication in the study. Otherwise, if automatic
10265 publication is switched on, default value is used for result name.
10268 New GEOM.GEOM_Object, containing the created face.
10272 p1 = geompy.MakeVertex( 0., 0., 0.)
10273 p2 = geompy.MakeVertex(150., 30., 0.)
10274 p3 = geompy.MakeVertex( 0., 120., 50.)
10275 p4 = geompy.MakeVertex( 0., 40., 70.)
10276 # create a quadrangle from four points in its corners
10277 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10279 # Example: see GEOM_Spanner.py
10280 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10281 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10282 self._autoPublish(anObj, theName, "quad")
10285 ## Create a hexahedral solid, bounded by the six given faces. Order of
10286 # faces is not important. It is not necessary that Faces share the same edge.
10287 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10288 # @param theName Object name; when specified, this parameter is used
10289 # for result publication in the study. Otherwise, if automatic
10290 # publication is switched on, default value is used for result name.
10292 # @return New GEOM.GEOM_Object, containing the created solid.
10294 # @ref tui_building_by_blocks_page "Example 1"
10295 # \n @ref swig_MakeHexa "Example 2"
10296 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10298 Create a hexahedral solid, bounded by the six given faces. Order of
10299 faces is not important. It is not necessary that Faces share the same edge.
10302 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10303 theName Object name; when specified, this parameter is used
10304 for result publication in the study. Otherwise, if automatic
10305 publication is switched on, default value is used for result name.
10308 New GEOM.GEOM_Object, containing the created solid.
10311 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10313 # Example: see GEOM_Spanner.py
10314 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10315 RaiseIfFailed("MakeHexa", self.BlocksOp)
10316 self._autoPublish(anObj, theName, "hexa")
10319 ## Create a hexahedral solid between two given faces.
10320 # The missing faces will be built by creating the smallest ones.
10321 # @param F1,F2 Two opposite faces for the hexahedral solid.
10322 # @param theName Object name; when specified, this parameter is used
10323 # for result publication in the study. Otherwise, if automatic
10324 # publication is switched on, default value is used for result name.
10326 # @return New GEOM.GEOM_Object, containing the created solid.
10328 # @ref tui_building_by_blocks_page "Example 1"
10329 # \n @ref swig_MakeHexa2Faces "Example 2"
10330 def MakeHexa2Faces(self, F1, F2, theName=None):
10332 Create a hexahedral solid between two given faces.
10333 The missing faces will be built by creating the smallest ones.
10336 F1,F2 Two opposite faces for the hexahedral solid.
10337 theName Object name; when specified, this parameter is used
10338 for result publication in the study. Otherwise, if automatic
10339 publication is switched on, default value is used for result name.
10342 New GEOM.GEOM_Object, containing the created solid.
10345 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10347 # Example: see GEOM_Spanner.py
10348 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10349 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10350 self._autoPublish(anObj, theName, "hexa")
10356 ## @addtogroup l3_blocks_op
10359 ## Get a vertex, found in the given shape by its coordinates.
10360 # @param theShape Block or a compound of blocks.
10361 # @param theX,theY,theZ Coordinates of the sought vertex.
10362 # @param theEpsilon Maximum allowed distance between the resulting
10363 # vertex and point with the given coordinates.
10364 # @param theName Object name; when specified, this parameter is used
10365 # for result publication in the study. Otherwise, if automatic
10366 # publication is switched on, default value is used for result name.
10368 # @return New GEOM.GEOM_Object, containing the found vertex.
10370 # @ref swig_GetPoint "Example"
10371 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10373 Get a vertex, found in the given shape by its coordinates.
10376 theShape Block or a compound of blocks.
10377 theX,theY,theZ Coordinates of the sought vertex.
10378 theEpsilon Maximum allowed distance between the resulting
10379 vertex and point with the given coordinates.
10380 theName Object name; when specified, this parameter is used
10381 for result publication in the study. Otherwise, if automatic
10382 publication is switched on, default value is used for result name.
10385 New GEOM.GEOM_Object, containing the found vertex.
10388 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10390 # Example: see GEOM_TestOthers.py
10391 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10392 RaiseIfFailed("GetPoint", self.BlocksOp)
10393 self._autoPublish(anObj, theName, "vertex")
10396 ## Find a vertex of the given shape, which has minimal distance to the given point.
10397 # @param theShape Any shape.
10398 # @param thePoint Point, close to the desired vertex.
10399 # @param theName Object name; when specified, this parameter is used
10400 # for result publication in the study. Otherwise, if automatic
10401 # publication is switched on, default value is used for result name.
10403 # @return New GEOM.GEOM_Object, containing the found vertex.
10405 # @ref swig_GetVertexNearPoint "Example"
10406 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10408 Find a vertex of the given shape, which has minimal distance to the given point.
10411 theShape Any shape.
10412 thePoint Point, close to the desired vertex.
10413 theName Object name; when specified, this parameter is used
10414 for result publication in the study. Otherwise, if automatic
10415 publication is switched on, default value is used for result name.
10418 New GEOM.GEOM_Object, containing the found vertex.
10421 pmidle = geompy.MakeVertex(50, 0, 50)
10422 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10424 # Example: see GEOM_TestOthers.py
10425 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10426 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10427 self._autoPublish(anObj, theName, "vertex")
10430 ## Get an edge, found in the given shape by two given vertices.
10431 # @param theShape Block or a compound of blocks.
10432 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10433 # @param theName Object name; when specified, this parameter is used
10434 # for result publication in the study. Otherwise, if automatic
10435 # publication is switched on, default value is used for result name.
10437 # @return New GEOM.GEOM_Object, containing the found edge.
10439 # @ref swig_GetEdge "Example"
10440 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10442 Get an edge, found in the given shape by two given vertices.
10445 theShape Block or a compound of blocks.
10446 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10447 theName Object name; when specified, this parameter is used
10448 for result publication in the study. Otherwise, if automatic
10449 publication is switched on, default value is used for result name.
10452 New GEOM.GEOM_Object, containing the found edge.
10454 # Example: see GEOM_Spanner.py
10455 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10456 RaiseIfFailed("GetEdge", self.BlocksOp)
10457 self._autoPublish(anObj, theName, "edge")
10460 ## Find an edge of the given shape, which has minimal distance to the given point.
10461 # @param theShape Block or a compound of blocks.
10462 # @param thePoint Point, close to the desired edge.
10463 # @param theName Object name; when specified, this parameter is used
10464 # for result publication in the study. Otherwise, if automatic
10465 # publication is switched on, default value is used for result name.
10467 # @return New GEOM.GEOM_Object, containing the found edge.
10469 # @ref swig_GetEdgeNearPoint "Example"
10470 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10472 Find an edge of the given shape, which has minimal distance to the given point.
10475 theShape Block or a compound of blocks.
10476 thePoint Point, close to the desired edge.
10477 theName Object name; when specified, this parameter is used
10478 for result publication in the study. Otherwise, if automatic
10479 publication is switched on, default value is used for result name.
10482 New GEOM.GEOM_Object, containing the found edge.
10484 # Example: see GEOM_TestOthers.py
10485 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10486 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10487 self._autoPublish(anObj, theName, "edge")
10490 ## Returns a face, found in the given shape by four given corner vertices.
10491 # @param theShape Block or a compound of blocks.
10492 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10493 # @param theName Object name; when specified, this parameter is used
10494 # for result publication in the study. Otherwise, if automatic
10495 # publication is switched on, default value is used for result name.
10497 # @return New GEOM.GEOM_Object, containing the found face.
10499 # @ref swig_todo "Example"
10500 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10502 Returns a face, found in the given shape by four given corner vertices.
10505 theShape Block or a compound of blocks.
10506 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10507 theName Object name; when specified, this parameter is used
10508 for result publication in the study. Otherwise, if automatic
10509 publication is switched on, default value is used for result name.
10512 New GEOM.GEOM_Object, containing the found face.
10514 # Example: see GEOM_Spanner.py
10515 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10516 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10517 self._autoPublish(anObj, theName, "face")
10520 ## Get a face of block, found in the given shape by two given edges.
10521 # @param theShape Block or a compound of blocks.
10522 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10523 # @param theName Object name; when specified, this parameter is used
10524 # for result publication in the study. Otherwise, if automatic
10525 # publication is switched on, default value is used for result name.
10527 # @return New GEOM.GEOM_Object, containing the found face.
10529 # @ref swig_todo "Example"
10530 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10532 Get a face of block, found in the given shape by two given edges.
10535 theShape Block or a compound of blocks.
10536 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10537 theName Object name; when specified, this parameter is used
10538 for result publication in the study. Otherwise, if automatic
10539 publication is switched on, default value is used for result name.
10542 New GEOM.GEOM_Object, containing the found face.
10544 # Example: see GEOM_Spanner.py
10545 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10546 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10547 self._autoPublish(anObj, theName, "face")
10550 ## Find a face, opposite to the given one in the given block.
10551 # @param theBlock Must be a hexahedral solid.
10552 # @param theFace Face of \a theBlock, opposite to the desired face.
10553 # @param theName Object name; when specified, this parameter is used
10554 # for result publication in the study. Otherwise, if automatic
10555 # publication is switched on, default value is used for result name.
10557 # @return New GEOM.GEOM_Object, containing the found face.
10559 # @ref swig_GetOppositeFace "Example"
10560 def GetOppositeFace(self, theBlock, theFace, theName=None):
10562 Find a face, opposite to the given one in the given block.
10565 theBlock Must be a hexahedral solid.
10566 theFace Face of theBlock, opposite to the desired face.
10567 theName Object name; when specified, this parameter is used
10568 for result publication in the study. Otherwise, if automatic
10569 publication is switched on, default value is used for result name.
10572 New GEOM.GEOM_Object, containing the found face.
10574 # Example: see GEOM_Spanner.py
10575 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10576 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10577 self._autoPublish(anObj, theName, "face")
10580 ## Find a face of the given shape, which has minimal distance to the given point.
10581 # @param theShape Block or a compound of blocks.
10582 # @param thePoint Point, close to the desired face.
10583 # @param theName Object name; when specified, this parameter is used
10584 # for result publication in the study. Otherwise, if automatic
10585 # publication is switched on, default value is used for result name.
10587 # @return New GEOM.GEOM_Object, containing the found face.
10589 # @ref swig_GetFaceNearPoint "Example"
10590 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10592 Find a face of the given shape, which has minimal distance to the given point.
10595 theShape Block or a compound of blocks.
10596 thePoint Point, close to the desired face.
10597 theName Object name; when specified, this parameter is used
10598 for result publication in the study. Otherwise, if automatic
10599 publication is switched on, default value is used for result name.
10602 New GEOM.GEOM_Object, containing the found face.
10604 # Example: see GEOM_Spanner.py
10605 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10606 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10607 self._autoPublish(anObj, theName, "face")
10610 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10611 # @param theBlock Block or a compound of blocks.
10612 # @param theVector Vector, close to the normale of the desired face.
10613 # @param theName Object name; when specified, this parameter is used
10614 # for result publication in the study. Otherwise, if automatic
10615 # publication is switched on, default value is used for result name.
10617 # @return New GEOM.GEOM_Object, containing the found face.
10619 # @ref swig_todo "Example"
10620 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10622 Find a face of block, whose outside normale has minimal angle with the given vector.
10625 theBlock Block or a compound of blocks.
10626 theVector Vector, close to the normale of the desired face.
10627 theName Object name; when specified, this parameter is used
10628 for result publication in the study. Otherwise, if automatic
10629 publication is switched on, default value is used for result name.
10632 New GEOM.GEOM_Object, containing the found face.
10634 # Example: see GEOM_Spanner.py
10635 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10636 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10637 self._autoPublish(anObj, theName, "face")
10640 ## Find all sub-shapes of type \a theShapeType of the given shape,
10641 # which have minimal distance to the given point.
10642 # @param theShape Any shape.
10643 # @param thePoint Point, close to the desired shape.
10644 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10645 # @param theTolerance The tolerance for distances comparison. All shapes
10646 # with distances to the given point in interval
10647 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10648 # @param theName Object name; when specified, this parameter is used
10649 # for result publication in the study. Otherwise, if automatic
10650 # publication is switched on, default value is used for result name.
10652 # @return New GEOM_Object, containing a group of all found shapes.
10654 # @ref swig_GetShapesNearPoint "Example"
10655 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10657 Find all sub-shapes of type theShapeType of the given shape,
10658 which have minimal distance to the given point.
10661 theShape Any shape.
10662 thePoint Point, close to the desired shape.
10663 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10664 theTolerance The tolerance for distances comparison. All shapes
10665 with distances to the given point in interval
10666 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10667 theName Object name; when specified, this parameter is used
10668 for result publication in the study. Otherwise, if automatic
10669 publication is switched on, default value is used for result name.
10672 New GEOM_Object, containing a group of all found shapes.
10674 # Example: see GEOM_TestOthers.py
10675 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10676 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10677 self._autoPublish(anObj, theName, "group")
10680 # end of l3_blocks_op
10683 ## @addtogroup l4_blocks_measure
10686 ## Check, if the compound of blocks is given.
10687 # To be considered as a compound of blocks, the
10688 # given shape must satisfy the following conditions:
10689 # - Each element of the compound should be a Block (6 faces and 12 edges).
10690 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10691 # - The compound should be connexe.
10692 # - The glue between two quadrangle faces should be applied.
10693 # @param theCompound The compound to check.
10694 # @return TRUE, if the given shape is a compound of blocks.
10695 # If theCompound is not valid, prints all discovered errors.
10697 # @ref tui_measurement_tools_page "Example 1"
10698 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10699 def CheckCompoundOfBlocks(self,theCompound):
10701 Check, if the compound of blocks is given.
10702 To be considered as a compound of blocks, the
10703 given shape must satisfy the following conditions:
10704 - Each element of the compound should be a Block (6 faces and 12 edges).
10705 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10706 - The compound should be connexe.
10707 - The glue between two quadrangle faces should be applied.
10710 theCompound The compound to check.
10713 TRUE, if the given shape is a compound of blocks.
10714 If theCompound is not valid, prints all discovered errors.
10716 # Example: see GEOM_Spanner.py
10717 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10718 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10720 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10724 ## Retrieve all non blocks solids and faces from \a theShape.
10725 # @param theShape The shape to explore.
10726 # @param theName Object name; when specified, this parameter is used
10727 # for result publication in the study. Otherwise, if automatic
10728 # publication is switched on, default value is used for result name.
10730 # @return A tuple of two GEOM_Objects. The first object is a group of all
10731 # non block solids (= not 6 faces, or with 6 faces, but with the
10732 # presence of non-quadrangular faces). The second object is a
10733 # group of all non quadrangular faces.
10735 # @ref tui_measurement_tools_page "Example 1"
10736 # \n @ref swig_GetNonBlocks "Example 2"
10737 def GetNonBlocks (self, theShape, theName=None):
10739 Retrieve all non blocks solids and faces from theShape.
10742 theShape The shape to explore.
10743 theName Object name; when specified, this parameter is used
10744 for result publication in the study. Otherwise, if automatic
10745 publication is switched on, default value is used for result name.
10748 A tuple of two GEOM_Objects. The first object is a group of all
10749 non block solids (= not 6 faces, or with 6 faces, but with the
10750 presence of non-quadrangular faces). The second object is a
10751 group of all non quadrangular faces.
10754 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10756 # Example: see GEOM_Spanner.py
10757 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10758 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10759 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10762 ## Remove all seam and degenerated edges from \a theShape.
10763 # Unite faces and edges, sharing one surface. It means that
10764 # this faces must have references to one C++ surface object (handle).
10765 # @param theShape The compound or single solid to remove irregular edges from.
10766 # @param doUnionFaces If True, then unite faces. If False (the default value),
10767 # do not unite faces.
10768 # @param theName Object name; when specified, this parameter is used
10769 # for result publication in the study. Otherwise, if automatic
10770 # publication is switched on, default value is used for result name.
10772 # @return Improved shape.
10774 # @ref swig_RemoveExtraEdges "Example"
10775 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10777 Remove all seam and degenerated edges from theShape.
10778 Unite faces and edges, sharing one surface. It means that
10779 this faces must have references to one C++ surface object (handle).
10782 theShape The compound or single solid to remove irregular edges from.
10783 doUnionFaces If True, then unite faces. If False (the default value),
10784 do not unite faces.
10785 theName Object name; when specified, this parameter is used
10786 for result publication in the study. Otherwise, if automatic
10787 publication is switched on, default value is used for result name.
10792 # Example: see GEOM_TestOthers.py
10793 nbFacesOptimum = -1 # -1 means do not unite faces
10794 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10795 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10796 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10797 self._autoPublish(anObj, theName, "removeExtraEdges")
10800 ## Performs union faces of \a theShape
10801 # Unite faces sharing one surface. It means that
10802 # these faces must have references to one C++ surface object (handle).
10803 # @param theShape The compound or single solid that contains faces
10804 # to perform union.
10805 # @param theName Object name; when specified, this parameter is used
10806 # for result publication in the study. Otherwise, if automatic
10807 # publication is switched on, default value is used for result name.
10809 # @return Improved shape.
10811 # @ref swig_UnionFaces "Example"
10812 def UnionFaces(self, theShape, theName=None):
10814 Performs union faces of theShape.
10815 Unite faces sharing one surface. It means that
10816 these faces must have references to one C++ surface object (handle).
10819 theShape The compound or single solid that contains faces
10821 theName Object name; when specified, this parameter is used
10822 for result publication in the study. Otherwise, if automatic
10823 publication is switched on, default value is used for result name.
10828 # Example: see GEOM_TestOthers.py
10829 anObj = self.BlocksOp.UnionFaces(theShape)
10830 RaiseIfFailed("UnionFaces", self.BlocksOp)
10831 self._autoPublish(anObj, theName, "unionFaces")
10834 ## Check, if the given shape is a blocks compound.
10835 # Fix all detected errors.
10836 # \note Single block can be also fixed by this method.
10837 # @param theShape The compound to check and improve.
10838 # @param theName Object name; when specified, this parameter is used
10839 # for result publication in the study. Otherwise, if automatic
10840 # publication is switched on, default value is used for result name.
10842 # @return Improved compound.
10844 # @ref swig_CheckAndImprove "Example"
10845 def CheckAndImprove(self, theShape, theName=None):
10847 Check, if the given shape is a blocks compound.
10848 Fix all detected errors.
10851 Single block can be also fixed by this method.
10854 theShape The compound to check and improve.
10855 theName Object name; when specified, this parameter is used
10856 for result publication in the study. Otherwise, if automatic
10857 publication is switched on, default value is used for result name.
10862 # Example: see GEOM_TestOthers.py
10863 anObj = self.BlocksOp.CheckAndImprove(theShape)
10864 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10865 self._autoPublish(anObj, theName, "improved")
10868 # end of l4_blocks_measure
10871 ## @addtogroup l3_blocks_op
10874 ## Get all the blocks, contained in the given compound.
10875 # @param theCompound The compound to explode.
10876 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10877 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10878 # @param theName Object name; when specified, this parameter is used
10879 # for result publication in the study. Otherwise, if automatic
10880 # publication is switched on, default value is used for result name.
10882 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10884 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10886 # @ref tui_explode_on_blocks "Example 1"
10887 # \n @ref swig_MakeBlockExplode "Example 2"
10888 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10890 Get all the blocks, contained in the given compound.
10893 theCompound The compound to explode.
10894 theMinNbFaces If solid has lower number of faces, it is not a block.
10895 theMaxNbFaces If solid has higher number of faces, it is not a block.
10896 theName Object name; when specified, this parameter is used
10897 for result publication in the study. Otherwise, if automatic
10898 publication is switched on, default value is used for result name.
10901 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10904 List of GEOM.GEOM_Object, containing the retrieved blocks.
10906 # Example: see GEOM_TestOthers.py
10907 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10908 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10909 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10910 for anObj in aList:
10911 anObj.SetParameters(Parameters)
10913 self._autoPublish(aList, theName, "block")
10916 ## Find block, containing the given point inside its volume or on boundary.
10917 # @param theCompound Compound, to find block in.
10918 # @param thePoint Point, close to the desired block. If the point lays on
10919 # boundary between some blocks, we return block with nearest center.
10920 # @param theName Object name; when specified, this parameter is used
10921 # for result publication in the study. Otherwise, if automatic
10922 # publication is switched on, default value is used for result name.
10924 # @return New GEOM.GEOM_Object, containing the found block.
10926 # @ref swig_todo "Example"
10927 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10929 Find block, containing the given point inside its volume or on boundary.
10932 theCompound Compound, to find block in.
10933 thePoint Point, close to the desired block. If the point lays on
10934 boundary between some blocks, we return block with nearest center.
10935 theName Object name; when specified, this parameter is used
10936 for result publication in the study. Otherwise, if automatic
10937 publication is switched on, default value is used for result name.
10940 New GEOM.GEOM_Object, containing the found block.
10942 # Example: see GEOM_Spanner.py
10943 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10944 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10945 self._autoPublish(anObj, theName, "block")
10948 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10949 # @param theCompound Compound, to find block in.
10950 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10951 # @param theName Object name; when specified, this parameter is used
10952 # for result publication in the study. Otherwise, if automatic
10953 # publication is switched on, default value is used for result name.
10955 # @return New GEOM.GEOM_Object, containing the found block.
10957 # @ref swig_GetBlockByParts "Example"
10958 def GetBlockByParts(self, theCompound, theParts, theName=None):
10960 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10963 theCompound Compound, to find block in.
10964 theParts List of faces and/or edges and/or vertices to be parts of the found block.
10965 theName Object name; when specified, this parameter is used
10966 for result publication in the study. Otherwise, if automatic
10967 publication is switched on, default value is used for result name.
10970 New GEOM_Object, containing the found block.
10972 # Example: see GEOM_TestOthers.py
10973 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10974 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10975 self._autoPublish(anObj, theName, "block")
10978 ## Return all blocks, containing all the elements, passed as the parts.
10979 # @param theCompound Compound, to find blocks in.
10980 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10981 # @param theName Object name; when specified, this parameter is used
10982 # for result publication in the study. Otherwise, if automatic
10983 # publication is switched on, default value is used for result name.
10985 # @return List of GEOM.GEOM_Object, containing the found blocks.
10987 # @ref swig_todo "Example"
10988 def GetBlocksByParts(self, theCompound, theParts, theName=None):
10990 Return all blocks, containing all the elements, passed as the parts.
10993 theCompound Compound, to find blocks in.
10994 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10995 theName Object name; when specified, this parameter is used
10996 for result publication in the study. Otherwise, if automatic
10997 publication is switched on, default value is used for result name.
11000 List of GEOM.GEOM_Object, containing the found blocks.
11002 # Example: see GEOM_Spanner.py
11003 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11004 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11005 self._autoPublish(aList, theName, "block")
11008 ## Multi-transformate block and glue the result.
11009 # Transformation is defined so, as to superpose direction faces.
11010 # @param Block Hexahedral solid to be multi-transformed.
11011 # @param DirFace1 ID of First direction face.
11012 # @param DirFace2 ID of Second direction face.
11013 # @param NbTimes Quantity of transformations to be done.
11014 # @param theName Object name; when specified, this parameter is used
11015 # for result publication in the study. Otherwise, if automatic
11016 # publication is switched on, default value is used for result name.
11018 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11020 # @return New GEOM.GEOM_Object, containing the result shape.
11022 # @ref tui_multi_transformation "Example"
11023 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11025 Multi-transformate block and glue the result.
11026 Transformation is defined so, as to superpose direction faces.
11029 Block Hexahedral solid to be multi-transformed.
11030 DirFace1 ID of First direction face.
11031 DirFace2 ID of Second direction face.
11032 NbTimes Quantity of transformations to be done.
11033 theName Object name; when specified, this parameter is used
11034 for result publication in the study. Otherwise, if automatic
11035 publication is switched on, default value is used for result name.
11038 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11041 New GEOM.GEOM_Object, containing the result shape.
11043 # Example: see GEOM_Spanner.py
11044 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11045 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11046 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11047 anObj.SetParameters(Parameters)
11048 self._autoPublish(anObj, theName, "transformed")
11051 ## Multi-transformate block and glue the result.
11052 # @param Block Hexahedral solid to be multi-transformed.
11053 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11054 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11055 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11056 # @param theName Object name; when specified, this parameter is used
11057 # for result publication in the study. Otherwise, if automatic
11058 # publication is switched on, default value is used for result name.
11060 # @return New GEOM.GEOM_Object, containing the result shape.
11062 # @ref tui_multi_transformation "Example"
11063 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11064 DirFace1V, DirFace2V, NbTimesV, theName=None):
11066 Multi-transformate block and glue the result.
11069 Block Hexahedral solid to be multi-transformed.
11070 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11071 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11072 NbTimesU,NbTimesV Quantity of transformations to be done.
11073 theName Object name; when specified, this parameter is used
11074 for result publication in the study. Otherwise, if automatic
11075 publication is switched on, default value is used for result name.
11078 New GEOM.GEOM_Object, containing the result shape.
11080 # Example: see GEOM_Spanner.py
11081 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11082 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11083 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11084 DirFace1V, DirFace2V, NbTimesV)
11085 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11086 anObj.SetParameters(Parameters)
11087 self._autoPublish(anObj, theName, "transformed")
11090 ## Build all possible propagation groups.
11091 # Propagation group is a set of all edges, opposite to one (main)
11092 # edge of this group directly or through other opposite edges.
11093 # Notion of Opposite Edge make sence only on quadrangle face.
11094 # @param theShape Shape to build propagation groups on.
11095 # @param theName Object name; when specified, this parameter is used
11096 # for result publication in the study. Otherwise, if automatic
11097 # publication is switched on, default value is used for result name.
11099 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11101 # @ref swig_Propagate "Example"
11102 def Propagate(self, theShape, theName=None):
11104 Build all possible propagation groups.
11105 Propagation group is a set of all edges, opposite to one (main)
11106 edge of this group directly or through other opposite edges.
11107 Notion of Opposite Edge make sence only on quadrangle face.
11110 theShape Shape to build propagation groups on.
11111 theName Object name; when specified, this parameter is used
11112 for result publication in the study. Otherwise, if automatic
11113 publication is switched on, default value is used for result name.
11116 List of GEOM.GEOM_Object, each of them is a propagation group.
11118 # Example: see GEOM_TestOthers.py
11119 listChains = self.BlocksOp.Propagate(theShape)
11120 RaiseIfFailed("Propagate", self.BlocksOp)
11121 self._autoPublish(listChains, theName, "propagate")
11124 # end of l3_blocks_op
11127 ## @addtogroup l3_groups
11130 ## Creates a new group which will store sub-shapes of theMainShape
11131 # @param theMainShape is a GEOM object on which the group is selected
11132 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11133 # @param theName Object name; when specified, this parameter is used
11134 # for result publication in the study. Otherwise, if automatic
11135 # publication is switched on, default value is used for result name.
11137 # @return a newly created GEOM group (GEOM.GEOM_Object)
11139 # @ref tui_working_with_groups_page "Example 1"
11140 # \n @ref swig_CreateGroup "Example 2"
11141 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11143 Creates a new group which will store sub-shapes of theMainShape
11146 theMainShape is a GEOM object on which the group is selected
11147 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11148 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11149 theName Object name; when specified, this parameter is used
11150 for result publication in the study. Otherwise, if automatic
11151 publication is switched on, default value is used for result name.
11154 a newly created GEOM group
11157 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11160 # Example: see GEOM_TestOthers.py
11161 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11162 RaiseIfFailed("CreateGroup", self.GroupOp)
11163 self._autoPublish(anObj, theName, "group")
11166 ## Adds a sub-object with ID theSubShapeId to the group
11167 # @param theGroup is a GEOM group to which the new sub-shape is added
11168 # @param theSubShapeID is a sub-shape ID in the main object.
11169 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11171 # @ref tui_working_with_groups_page "Example"
11172 def AddObject(self,theGroup, theSubShapeID):
11174 Adds a sub-object with ID theSubShapeId to the group
11177 theGroup is a GEOM group to which the new sub-shape is added
11178 theSubShapeID is a sub-shape ID in the main object.
11181 Use method GetSubShapeID() to get an unique ID of the sub-shape
11183 # Example: see GEOM_TestOthers.py
11184 self.GroupOp.AddObject(theGroup, theSubShapeID)
11185 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11186 RaiseIfFailed("AddObject", self.GroupOp)
11190 ## Removes a sub-object with ID \a theSubShapeId from the group
11191 # @param theGroup is a GEOM group from which the new sub-shape is removed
11192 # @param theSubShapeID is a sub-shape ID in the main object.
11193 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11195 # @ref tui_working_with_groups_page "Example"
11196 def RemoveObject(self,theGroup, theSubShapeID):
11198 Removes a sub-object with ID theSubShapeId from the group
11201 theGroup is a GEOM group from which the new sub-shape is removed
11202 theSubShapeID is a sub-shape ID in the main object.
11205 Use method GetSubShapeID() to get an unique ID of the sub-shape
11207 # Example: see GEOM_TestOthers.py
11208 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11209 RaiseIfFailed("RemoveObject", self.GroupOp)
11212 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11213 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11214 # @param theSubShapes is a list of sub-shapes to be added.
11216 # @ref tui_working_with_groups_page "Example"
11217 def UnionList (self,theGroup, theSubShapes):
11219 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11222 theGroup is a GEOM group to which the new sub-shapes are added.
11223 theSubShapes is a list of sub-shapes to be added.
11225 # Example: see GEOM_TestOthers.py
11226 self.GroupOp.UnionList(theGroup, theSubShapes)
11227 RaiseIfFailed("UnionList", self.GroupOp)
11230 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11231 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11232 # @param theSubShapes is a list of indices of sub-shapes to be added.
11234 # @ref swig_UnionIDs "Example"
11235 def UnionIDs(self,theGroup, theSubShapes):
11237 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11240 theGroup is a GEOM group to which the new sub-shapes are added.
11241 theSubShapes is a list of indices of sub-shapes to be added.
11243 # Example: see GEOM_TestOthers.py
11244 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11245 RaiseIfFailed("UnionIDs", self.GroupOp)
11248 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11249 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11250 # @param theSubShapes is a list of sub-shapes to be removed.
11252 # @ref tui_working_with_groups_page "Example"
11253 def DifferenceList (self,theGroup, theSubShapes):
11255 Removes from the group all the given shapes. No errors, if some shapes are not included.
11258 theGroup is a GEOM group from which the sub-shapes are removed.
11259 theSubShapes is a list of sub-shapes to be removed.
11261 # Example: see GEOM_TestOthers.py
11262 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11263 RaiseIfFailed("DifferenceList", self.GroupOp)
11266 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11267 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11268 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11270 # @ref swig_DifferenceIDs "Example"
11271 def DifferenceIDs(self,theGroup, theSubShapes):
11273 Removes from the group all the given shapes. No errors, if some shapes are not included.
11276 theGroup is a GEOM group from which the sub-shapes are removed.
11277 theSubShapes is a list of indices of sub-shapes to be removed.
11279 # Example: see GEOM_TestOthers.py
11280 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11281 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11284 ## Union of two groups.
11285 # New group is created. It will contain all entities
11286 # which are present in groups theGroup1 and theGroup2.
11287 # @param theGroup1, theGroup2 are the initial GEOM groups
11288 # to create the united group from.
11289 # @param theName Object name; when specified, this parameter is used
11290 # for result publication in the study. Otherwise, if automatic
11291 # publication is switched on, default value is used for result name.
11293 # @return a newly created GEOM group.
11295 # @ref tui_union_groups_anchor "Example"
11296 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11298 Union of two groups.
11299 New group is created. It will contain all entities
11300 which are present in groups theGroup1 and theGroup2.
11303 theGroup1, theGroup2 are the initial GEOM groups
11304 to create the united group from.
11305 theName Object name; when specified, this parameter is used
11306 for result publication in the study. Otherwise, if automatic
11307 publication is switched on, default value is used for result name.
11310 a newly created GEOM group.
11312 # Example: see GEOM_TestOthers.py
11313 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11314 RaiseIfFailed("UnionGroups", self.GroupOp)
11315 self._autoPublish(aGroup, theName, "group")
11318 ## Intersection of two groups.
11319 # New group is created. It will contain only those entities
11320 # which are present in both groups theGroup1 and theGroup2.
11321 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11322 # @param theName Object name; when specified, this parameter is used
11323 # for result publication in the study. Otherwise, if automatic
11324 # publication is switched on, default value is used for result name.
11326 # @return a newly created GEOM group.
11328 # @ref tui_intersect_groups_anchor "Example"
11329 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11331 Intersection of two groups.
11332 New group is created. It will contain only those entities
11333 which are present in both groups theGroup1 and theGroup2.
11336 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11337 theName Object name; when specified, this parameter is used
11338 for result publication in the study. Otherwise, if automatic
11339 publication is switched on, default value is used for result name.
11342 a newly created GEOM group.
11344 # Example: see GEOM_TestOthers.py
11345 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11346 RaiseIfFailed("IntersectGroups", self.GroupOp)
11347 self._autoPublish(aGroup, theName, "group")
11350 ## Cut of two groups.
11351 # New group is created. It will contain entities which are
11352 # present in group theGroup1 but are not present in group theGroup2.
11353 # @param theGroup1 is a GEOM group to include elements of.
11354 # @param theGroup2 is a GEOM group to exclude elements of.
11355 # @param theName Object name; when specified, this parameter is used
11356 # for result publication in the study. Otherwise, if automatic
11357 # publication is switched on, default value is used for result name.
11359 # @return a newly created GEOM group.
11361 # @ref tui_cut_groups_anchor "Example"
11362 def CutGroups (self, theGroup1, theGroup2, theName=None):
11365 New group is created. It will contain entities which are
11366 present in group theGroup1 but are not present in group theGroup2.
11369 theGroup1 is a GEOM group to include elements of.
11370 theGroup2 is a GEOM group to exclude elements of.
11371 theName Object name; when specified, this parameter is used
11372 for result publication in the study. Otherwise, if automatic
11373 publication is switched on, default value is used for result name.
11376 a newly created GEOM group.
11378 # Example: see GEOM_TestOthers.py
11379 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11380 RaiseIfFailed("CutGroups", self.GroupOp)
11381 self._autoPublish(aGroup, theName, "group")
11384 ## Union of list of groups.
11385 # New group is created. It will contain all entities that are
11386 # present in groups listed in theGList.
11387 # @param theGList is a list of GEOM groups to create the united group from.
11388 # @param theName Object name; when specified, this parameter is used
11389 # for result publication in the study. Otherwise, if automatic
11390 # publication is switched on, default value is used for result name.
11392 # @return a newly created GEOM group.
11394 # @ref tui_union_groups_anchor "Example"
11395 def UnionListOfGroups (self, theGList, theName=None):
11397 Union of list of groups.
11398 New group is created. It will contain all entities that are
11399 present in groups listed in theGList.
11402 theGList is a list of GEOM groups to create the united group from.
11403 theName Object name; when specified, this parameter is used
11404 for result publication in the study. Otherwise, if automatic
11405 publication is switched on, default value is used for result name.
11408 a newly created GEOM group.
11410 # Example: see GEOM_TestOthers.py
11411 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11412 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11413 self._autoPublish(aGroup, theName, "group")
11416 ## Cut of lists of groups.
11417 # New group is created. It will contain only entities
11418 # which are present in groups listed in theGList1 but
11419 # are not present in groups from theGList2.
11420 # @param theGList1 is a list of GEOM groups to include elements of.
11421 # @param theGList2 is a list of GEOM groups to exclude elements of.
11422 # @param theName Object name; when specified, this parameter is used
11423 # for result publication in the study. Otherwise, if automatic
11424 # publication is switched on, default value is used for result name.
11426 # @return a newly created GEOM group.
11428 # @ref tui_intersect_groups_anchor "Example"
11429 def IntersectListOfGroups (self, theGList, theName=None):
11431 Cut of lists of groups.
11432 New group is created. It will contain only entities
11433 which are present in groups listed in theGList1 but
11434 are not present in groups from theGList2.
11437 theGList1 is a list of GEOM groups to include elements of.
11438 theGList2 is a list of GEOM groups to exclude elements of.
11439 theName Object name; when specified, this parameter is used
11440 for result publication in the study. Otherwise, if automatic
11441 publication is switched on, default value is used for result name.
11444 a newly created GEOM group.
11446 # Example: see GEOM_TestOthers.py
11447 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11448 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11449 self._autoPublish(aGroup, theName, "group")
11452 ## Cut of lists of groups.
11453 # New group is created. It will contain only entities
11454 # which are present in groups listed in theGList1 but
11455 # are not present in groups from theGList2.
11456 # @param theGList1 is a list of GEOM groups to include elements of.
11457 # @param theGList2 is a list of GEOM groups to exclude elements of.
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.
11464 # @ref tui_cut_groups_anchor "Example"
11465 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11467 Cut of lists of groups.
11468 New group is created. It will contain only entities
11469 which are present in groups listed in theGList1 but
11470 are not present in groups from theGList2.
11473 theGList1 is a list of GEOM groups to include elements of.
11474 theGList2 is a list of GEOM groups to exclude elements of.
11475 theName Object name; when specified, this parameter is used
11476 for result publication in the study. Otherwise, if automatic
11477 publication is switched on, default value is used for result name.
11480 a newly created GEOM group.
11482 # Example: see GEOM_TestOthers.py
11483 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11484 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11485 self._autoPublish(aGroup, theName, "group")
11488 ## Returns a list of sub-objects ID stored in the group
11489 # @param theGroup is a GEOM group for which a list of IDs is requested
11491 # @ref swig_GetObjectIDs "Example"
11492 def GetObjectIDs(self,theGroup):
11494 Returns a list of sub-objects ID stored in the group
11497 theGroup is a GEOM group for which a list of IDs is requested
11499 # Example: see GEOM_TestOthers.py
11500 ListIDs = self.GroupOp.GetObjects(theGroup)
11501 RaiseIfFailed("GetObjects", self.GroupOp)
11504 ## Returns a type of sub-objects stored in the group
11505 # @param theGroup is a GEOM group which type is returned.
11507 # @ref swig_GetType "Example"
11508 def GetType(self,theGroup):
11510 Returns a type of sub-objects stored in the group
11513 theGroup is a GEOM group which type is returned.
11515 # Example: see GEOM_TestOthers.py
11516 aType = self.GroupOp.GetType(theGroup)
11517 RaiseIfFailed("GetType", self.GroupOp)
11520 ## Convert a type of geom object from id to string value
11521 # @param theId is a GEOM obect type id.
11522 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11523 # @ref swig_GetType "Example"
11524 def ShapeIdToType(self, theId):
11526 Convert a type of geom object from id to string value
11529 theId is a GEOM obect type id.
11532 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11559 return "REVOLUTION"
11607 return "FREE_BOUNDS"
11615 return "THRUSECTIONS"
11617 return "COMPOUNDFILTER"
11619 return "SHAPES_ON_SHAPE"
11621 return "ELLIPSE_ARC"
11623 return "3DSKETCHER"
11629 return "PIPETSHAPE"
11630 return "Shape Id not exist."
11632 ## Returns a main shape associated with the group
11633 # @param theGroup is a GEOM group for which a main shape object is requested
11634 # @return a GEOM object which is a main shape for theGroup
11636 # @ref swig_GetMainShape "Example"
11637 def GetMainShape(self,theGroup):
11639 Returns a main shape associated with the group
11642 theGroup is a GEOM group for which a main shape object is requested
11645 a GEOM object which is a main shape for theGroup
11647 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11649 # Example: see GEOM_TestOthers.py
11650 anObj = self.GroupOp.GetMainShape(theGroup)
11651 RaiseIfFailed("GetMainShape", self.GroupOp)
11654 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11655 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11656 # @param theShape given shape (see GEOM.GEOM_Object)
11657 # @param min_length minimum length of edges of theShape
11658 # @param max_length maximum length of edges of theShape
11659 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11660 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11661 # @param theName Object name; when specified, this parameter is used
11662 # for result publication in the study. Otherwise, if automatic
11663 # publication is switched on, default value is used for result name.
11665 # @return a newly created GEOM group of edges
11667 # @@ref swig_todo "Example"
11668 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11670 Create group of edges of theShape, whose length is in range [min_length, max_length].
11671 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11674 theShape given shape
11675 min_length minimum length of edges of theShape
11676 max_length maximum length of edges of theShape
11677 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11678 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11679 theName Object name; when specified, this parameter is used
11680 for result publication in the study. Otherwise, if automatic
11681 publication is switched on, default value is used for result name.
11684 a newly created GEOM group of edges.
11686 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11687 edges_in_range = []
11689 Props = self.BasicProperties(edge)
11690 if min_length <= Props[0] and Props[0] <= max_length:
11691 if (not include_min) and (min_length == Props[0]):
11694 if (not include_max) and (Props[0] == max_length):
11697 edges_in_range.append(edge)
11699 if len(edges_in_range) <= 0:
11700 print "No edges found by given criteria"
11703 # note: auto-publishing is done in self.CreateGroup()
11704 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11705 self.UnionList(group_edges, edges_in_range)
11709 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11710 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11711 # @param min_length minimum length of edges of selected shape
11712 # @param max_length maximum length of edges of selected shape
11713 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11714 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11715 # @return a newly created GEOM group of edges
11716 # @ref swig_todo "Example"
11717 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11719 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11720 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11723 min_length minimum length of edges of selected shape
11724 max_length maximum length of edges of selected shape
11725 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11726 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11729 a newly created GEOM group of edges.
11731 nb_selected = sg.SelectedCount()
11732 if nb_selected < 1:
11733 print "Select a shape before calling this function, please."
11735 if nb_selected > 1:
11736 print "Only one shape must be selected"
11739 id_shape = sg.getSelected(0)
11740 shape = IDToObject( id_shape )
11742 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11746 if include_min: left_str = " <= "
11747 if include_max: right_str = " <= "
11749 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11750 + left_str + "length" + right_str + `max_length`)
11752 sg.updateObjBrowser(1)
11759 ## @addtogroup l4_advanced
11762 ## Create a T-shape object with specified caracteristics for the main
11763 # and the incident pipes (radius, width, half-length).
11764 # The extremities of the main pipe are located on junctions points P1 and P2.
11765 # The extremity of the incident pipe is located on junction point P3.
11766 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11767 # the main plane of the T-shape is XOY.
11769 # @param theR1 Internal radius of main pipe
11770 # @param theW1 Width of main pipe
11771 # @param theL1 Half-length of main pipe
11772 # @param theR2 Internal radius of incident pipe (R2 < R1)
11773 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11774 # @param theL2 Half-length of incident pipe
11776 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11777 # @param theP1 1st junction point of main pipe
11778 # @param theP2 2nd junction point of main pipe
11779 # @param theP3 Junction point of incident pipe
11781 # @param theRL Internal radius of left thickness reduction
11782 # @param theWL Width of left thickness reduction
11783 # @param theLtransL Length of left transition part
11784 # @param theLthinL Length of left thin part
11786 # @param theRR Internal radius of right thickness reduction
11787 # @param theWR Width of right thickness reduction
11788 # @param theLtransR Length of right transition part
11789 # @param theLthinR Length of right thin part
11791 # @param theRI Internal radius of incident thickness reduction
11792 # @param theWI Width of incident thickness reduction
11793 # @param theLtransI Length of incident transition part
11794 # @param theLthinI Length of incident thin part
11796 # @param theName Object name; when specified, this parameter is used
11797 # for result publication in the study. Otherwise, if automatic
11798 # publication is switched on, default value is used for result name.
11800 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11802 # @ref tui_creation_pipetshape "Example"
11803 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11804 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11805 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11806 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11807 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11810 Create a T-shape object with specified caracteristics for the main
11811 and the incident pipes (radius, width, half-length).
11812 The extremities of the main pipe are located on junctions points P1 and P2.
11813 The extremity of the incident pipe is located on junction point P3.
11814 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11815 the main plane of the T-shape is XOY.
11818 theR1 Internal radius of main pipe
11819 theW1 Width of main pipe
11820 theL1 Half-length of main pipe
11821 theR2 Internal radius of incident pipe (R2 < R1)
11822 theW2 Width of incident pipe (R2+W2 < R1+W1)
11823 theL2 Half-length of incident pipe
11824 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11825 theP1 1st junction point of main pipe
11826 theP2 2nd junction point of main pipe
11827 theP3 Junction point of incident pipe
11829 theRL Internal radius of left thickness reduction
11830 theWL Width of left thickness reduction
11831 theLtransL Length of left transition part
11832 theLthinL Length of left thin part
11834 theRR Internal radius of right thickness reduction
11835 theWR Width of right thickness reduction
11836 theLtransR Length of right transition part
11837 theLthinR Length of right thin part
11839 theRI Internal radius of incident thickness reduction
11840 theWI Width of incident thickness reduction
11841 theLtransI Length of incident transition part
11842 theLthinI Length of incident thin part
11844 theName Object name; when specified, this parameter is used
11845 for result publication in the study. Otherwise, if automatic
11846 publication is switched on, default value is used for result name.
11849 List of GEOM_Object, containing the created shape and propagation groups.
11852 # create PipeTShape object
11853 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11854 # create PipeTShape object with position
11855 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11856 # create PipeTShape object with left thickness reduction
11857 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11859 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)
11860 if (theP1 and theP2 and theP3):
11861 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11862 theRL, theWL, theLtransL, theLthinL,
11863 theRR, theWR, theLtransR, theLthinR,
11864 theRI, theWI, theLtransI, theLthinI,
11865 theHexMesh, theP1, theP2, theP3)
11867 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11868 theRL, theWL, theLtransL, theLthinL,
11869 theRR, theWR, theLtransR, theLthinR,
11870 theRI, theWI, theLtransI, theLthinI,
11872 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11873 if Parameters: anObj[0].SetParameters(Parameters)
11874 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11875 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11878 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11879 # and the incident pipes (radius, width, half-length). The chamfer is
11880 # created on the junction of the pipes.
11881 # The extremities of the main pipe are located on junctions points P1 and P2.
11882 # The extremity of the incident pipe is located on junction point P3.
11883 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11884 # the main plane of the T-shape is XOY.
11885 # @param theR1 Internal radius of main pipe
11886 # @param theW1 Width of main pipe
11887 # @param theL1 Half-length of main pipe
11888 # @param theR2 Internal radius of incident pipe (R2 < R1)
11889 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11890 # @param theL2 Half-length of incident pipe
11891 # @param theH Height of the chamfer.
11892 # @param theW Width of the chamfer.
11893 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11894 # @param theP1 1st junction point of main pipe
11895 # @param theP2 2nd junction point of main pipe
11896 # @param theP3 Junction point of incident pipe
11898 # @param theRL Internal radius of left thickness reduction
11899 # @param theWL Width of left thickness reduction
11900 # @param theLtransL Length of left transition part
11901 # @param theLthinL Length of left thin part
11903 # @param theRR Internal radius of right thickness reduction
11904 # @param theWR Width of right thickness reduction
11905 # @param theLtransR Length of right transition part
11906 # @param theLthinR Length of right thin part
11908 # @param theRI Internal radius of incident thickness reduction
11909 # @param theWI Width of incident thickness reduction
11910 # @param theLtransI Length of incident transition part
11911 # @param theLthinI Length of incident thin part
11913 # @param theName Object name; when specified, this parameter is used
11914 # for result publication in the study. Otherwise, if automatic
11915 # publication is switched on, default value is used for result name.
11917 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11919 # @ref tui_creation_pipetshape "Example"
11920 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11921 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11922 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11923 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11924 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11927 Create a T-shape object with chamfer and with specified caracteristics for the main
11928 and the incident pipes (radius, width, half-length). The chamfer is
11929 created on the junction of the pipes.
11930 The extremities of the main pipe are located on junctions points P1 and P2.
11931 The extremity of the incident pipe is located on junction point P3.
11932 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11933 the main plane of the T-shape is XOY.
11936 theR1 Internal radius of main pipe
11937 theW1 Width of main pipe
11938 theL1 Half-length of main pipe
11939 theR2 Internal radius of incident pipe (R2 < R1)
11940 theW2 Width of incident pipe (R2+W2 < R1+W1)
11941 theL2 Half-length of incident pipe
11942 theH Height of the chamfer.
11943 theW Width of the chamfer.
11944 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11945 theP1 1st junction point of main pipe
11946 theP2 2nd junction point of main pipe
11947 theP3 Junction point of incident pipe
11949 theRL Internal radius of left thickness reduction
11950 theWL Width of left thickness reduction
11951 theLtransL Length of left transition part
11952 theLthinL Length of left thin part
11954 theRR Internal radius of right thickness reduction
11955 theWR Width of right thickness reduction
11956 theLtransR Length of right transition part
11957 theLthinR Length of right thin part
11959 theRI Internal radius of incident thickness reduction
11960 theWI Width of incident thickness reduction
11961 theLtransI Length of incident transition part
11962 theLthinI Length of incident thin part
11964 theName Object name; when specified, this parameter is used
11965 for result publication in the study. Otherwise, if automatic
11966 publication is switched on, default value is used for result name.
11969 List of GEOM_Object, containing the created shape and propagation groups.
11972 # create PipeTShape with chamfer object
11973 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11974 # create PipeTShape with chamfer object with position
11975 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11976 # create PipeTShape with chamfer object with left thickness reduction
11977 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)
11979 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)
11980 if (theP1 and theP2 and theP3):
11981 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11982 theRL, theWL, theLtransL, theLthinL,
11983 theRR, theWR, theLtransR, theLthinR,
11984 theRI, theWI, theLtransI, theLthinI,
11985 theH, theW, theHexMesh, theP1, theP2, theP3)
11987 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
11988 theRL, theWL, theLtransL, theLthinL,
11989 theRR, theWR, theLtransR, theLthinR,
11990 theRI, theWI, theLtransI, theLthinI,
11991 theH, theW, theHexMesh)
11992 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
11993 if Parameters: anObj[0].SetParameters(Parameters)
11994 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11995 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11998 ## Create a T-shape object with fillet and with specified caracteristics for the main
11999 # and the incident pipes (radius, width, half-length). The fillet is
12000 # created on the junction of the pipes.
12001 # The extremities of the main pipe are located on junctions points P1 and P2.
12002 # The extremity of the incident pipe is located on junction point P3.
12003 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12004 # the main plane of the T-shape is XOY.
12005 # @param theR1 Internal radius of main pipe
12006 # @param theW1 Width of main pipe
12007 # @param theL1 Half-length of main pipe
12008 # @param theR2 Internal radius of incident pipe (R2 < R1)
12009 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12010 # @param theL2 Half-length of incident pipe
12011 # @param theRF Radius of curvature of fillet.
12012 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12013 # @param theP1 1st junction point of main pipe
12014 # @param theP2 2nd junction point of main pipe
12015 # @param theP3 Junction point of incident pipe
12017 # @param theRL Internal radius of left thickness reduction
12018 # @param theWL Width of left thickness reduction
12019 # @param theLtransL Length of left transition part
12020 # @param theLthinL Length of left thin part
12022 # @param theRR Internal radius of right thickness reduction
12023 # @param theWR Width of right thickness reduction
12024 # @param theLtransR Length of right transition part
12025 # @param theLthinR Length of right thin part
12027 # @param theRI Internal radius of incident thickness reduction
12028 # @param theWI Width of incident thickness reduction
12029 # @param theLtransI Length of incident transition part
12030 # @param theLthinI Length of incident thin part
12032 # @param theName Object name; when specified, this parameter is used
12033 # for result publication in the study. Otherwise, if automatic
12034 # publication is switched on, default value is used for result name.
12036 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12038 # @ref tui_creation_pipetshape "Example"
12039 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12040 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12041 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12042 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12043 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12046 Create a T-shape object with fillet and with specified caracteristics for the main
12047 and the incident pipes (radius, width, half-length). The fillet is
12048 created on the junction of the pipes.
12049 The extremities of the main pipe are located on junctions points P1 and P2.
12050 The extremity of the incident pipe is located on junction point P3.
12053 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12054 the main plane of the T-shape is XOY.
12055 theR1 Internal radius of main pipe
12056 theW1 Width of main pipe
12057 heL1 Half-length of main pipe
12058 theR2 Internal radius of incident pipe (R2 < R1)
12059 theW2 Width of incident pipe (R2+W2 < R1+W1)
12060 theL2 Half-length of incident pipe
12061 theRF Radius of curvature of fillet.
12062 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12063 theP1 1st junction point of main pipe
12064 theP2 2nd junction point of main pipe
12065 theP3 Junction point of incident pipe
12067 theRL Internal radius of left thickness reduction
12068 theWL Width of left thickness reduction
12069 theLtransL Length of left transition part
12070 theLthinL Length of left thin part
12072 theRR Internal radius of right thickness reduction
12073 theWR Width of right thickness reduction
12074 theLtransR Length of right transition part
12075 theLthinR Length of right thin part
12077 theRI Internal radius of incident thickness reduction
12078 theWI Width of incident thickness reduction
12079 theLtransI Length of incident transition part
12080 theLthinI Length of incident thin part
12082 theName Object name; when specified, this parameter is used
12083 for result publication in the study. Otherwise, if automatic
12084 publication is switched on, default value is used for result name.
12087 List of GEOM_Object, containing the created shape and propagation groups.
12090 # create PipeTShape with fillet object
12091 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12092 # create PipeTShape with fillet object with position
12093 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12094 # create PipeTShape with fillet object with left thickness reduction
12095 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)
12097 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)
12098 if (theP1 and theP2 and theP3):
12099 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12100 theRL, theWL, theLtransL, theLthinL,
12101 theRR, theWR, theLtransR, theLthinR,
12102 theRI, theWI, theLtransI, theLthinI,
12103 theRF, theHexMesh, theP1, theP2, theP3)
12105 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12106 theRL, theWL, theLtransL, theLthinL,
12107 theRR, theWR, theLtransR, theLthinR,
12108 theRI, theWI, theLtransI, theLthinI,
12110 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12111 if Parameters: anObj[0].SetParameters(Parameters)
12112 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12113 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12116 ## This function allows creating a disk already divided into blocks. It
12117 # can be used to create divided pipes for later meshing in hexaedra.
12118 # @param theR Radius of the disk
12119 # @param theOrientation Orientation of the plane on which the disk will be built
12120 # 1 = XOY, 2 = OYZ, 3 = OZX
12121 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12122 # @param theName Object name; when specified, this parameter is used
12123 # for result publication in the study. Otherwise, if automatic
12124 # publication is switched on, default value is used for result name.
12126 # @return New GEOM_Object, containing the created shape.
12128 # @ref tui_creation_divideddisk "Example"
12129 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12131 Creates a disk, divided into blocks. It can be used to create divided pipes
12132 for later meshing in hexaedra.
12135 theR Radius of the disk
12136 theOrientation Orientation of the plane on which the disk will be built:
12137 1 = XOY, 2 = OYZ, 3 = OZX
12138 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12139 theName Object name; when specified, this parameter is used
12140 for result publication in the study. Otherwise, if automatic
12141 publication is switched on, default value is used for result name.
12144 New GEOM_Object, containing the created shape.
12146 theR, Parameters = ParseParameters(theR)
12147 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12148 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12149 if Parameters: anObj.SetParameters(Parameters)
12150 self._autoPublish(anObj, theName, "dividedDisk")
12153 ## This function allows creating a disk already divided into blocks. It
12154 # can be used to create divided pipes for later meshing in hexaedra.
12155 # @param theCenter Center of the disk
12156 # @param theVector Normal vector to the plane of the created disk
12157 # @param theRadius Radius of the disk
12158 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12159 # @param theName Object name; when specified, this parameter is used
12160 # for result publication in the study. Otherwise, if automatic
12161 # publication is switched on, default value is used for result name.
12163 # @return New GEOM_Object, containing the created shape.
12165 # @ref tui_creation_divideddisk "Example"
12166 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12168 Creates a disk already divided into blocks. It can be used to create divided pipes
12169 for later meshing in hexaedra.
12172 theCenter Center of the disk
12173 theVector Normal vector to the plane of the created disk
12174 theRadius Radius of the disk
12175 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12176 theName Object name; when specified, this parameter is used
12177 for result publication in the study. Otherwise, if automatic
12178 publication is switched on, default value is used for result name.
12181 New GEOM_Object, containing the created shape.
12183 theRadius, Parameters = ParseParameters(theRadius)
12184 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12185 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12186 if Parameters: anObj.SetParameters(Parameters)
12187 self._autoPublish(anObj, theName, "dividedDisk")
12190 ## Builds a cylinder prepared for hexa meshes
12191 # @param theR Radius of the cylinder
12192 # @param theH Height of the cylinder
12193 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12194 # @param theName Object name; when specified, this parameter is used
12195 # for result publication in the study. Otherwise, if automatic
12196 # publication is switched on, default value is used for result name.
12198 # @return New GEOM_Object, containing the created shape.
12200 # @ref tui_creation_dividedcylinder "Example"
12201 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12203 Builds a cylinder prepared for hexa meshes
12206 theR Radius of the cylinder
12207 theH Height of the cylinder
12208 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12209 theName Object name; when specified, this parameter is used
12210 for result publication in the study. Otherwise, if automatic
12211 publication is switched on, default value is used for result name.
12214 New GEOM_Object, containing the created shape.
12216 theR, theH, Parameters = ParseParameters(theR, theH)
12217 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12218 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12219 if Parameters: anObj.SetParameters(Parameters)
12220 self._autoPublish(anObj, theName, "dividedCylinder")
12224 # @param thelPoints list of points
12225 # @return New GEOM_Object, containing the created shape.
12227 # @ref tui_creation_smoothingsurface "Example"
12228 def MakeSmoothingSurface(self, thelPoints):
12229 thelPoints, Parameters = ParseParameters(thelPoints)
12230 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12231 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12232 if Parameters: anObj.SetParameters(Parameters)
12235 #@@ insert new functions before this line @@ do not remove this line @@#
12237 # end of l4_advanced
12240 ## Create a copy of the given object
12242 # @param theOriginal geometry object for copy
12243 # @param theName Object name; when specified, this parameter is used
12244 # for result publication in the study. Otherwise, if automatic
12245 # publication is switched on, default value is used for result name.
12247 # @return New GEOM_Object, containing the copied shape.
12249 # @ingroup l1_geomBuilder_auxiliary
12250 # @ref swig_MakeCopy "Example"
12251 def MakeCopy(self, theOriginal, theName=None):
12253 Create a copy of the given object
12256 theOriginal geometry object for copy
12257 theName Object name; when specified, this parameter is used
12258 for result publication in the study. Otherwise, if automatic
12259 publication is switched on, default value is used for result name.
12262 New GEOM_Object, containing the copied shape.
12264 Example of usage: Copy = geompy.MakeCopy(Box)
12266 # Example: see GEOM_TestAll.py
12267 anObj = self.InsertOp.MakeCopy(theOriginal)
12268 RaiseIfFailed("MakeCopy", self.InsertOp)
12269 self._autoPublish(anObj, theName, "copy")
12272 ## Add Path to load python scripts from
12273 # @param Path a path to load python scripts from
12274 # @ingroup l1_geomBuilder_auxiliary
12275 def addPath(self,Path):
12277 Add Path to load python scripts from
12280 Path a path to load python scripts from
12282 if (sys.path.count(Path) < 1):
12283 sys.path.append(Path)
12287 ## Load marker texture from the file
12288 # @param Path a path to the texture file
12289 # @return unique texture identifier
12290 # @ingroup l1_geomBuilder_auxiliary
12291 def LoadTexture(self, Path):
12293 Load marker texture from the file
12296 Path a path to the texture file
12299 unique texture identifier
12301 # Example: see GEOM_TestAll.py
12302 ID = self.InsertOp.LoadTexture(Path)
12303 RaiseIfFailed("LoadTexture", self.InsertOp)
12306 ## Get internal name of the object based on its study entry
12307 # @note This method does not provide an unique identifier of the geometry object.
12308 # @note This is internal function of GEOM component, though it can be used outside it for
12309 # appropriate reason (e.g. for identification of geometry object).
12310 # @param obj geometry object
12311 # @return unique object identifier
12312 # @ingroup l1_geomBuilder_auxiliary
12313 def getObjectID(self, obj):
12315 Get internal name of the object based on its study entry.
12316 Note: this method does not provide an unique identifier of the geometry object.
12317 It is an internal function of GEOM component, though it can be used outside GEOM for
12318 appropriate reason (e.g. for identification of geometry object).
12321 obj geometry object
12324 unique object identifier
12327 entry = salome.ObjectToID(obj)
12328 if entry is not None:
12329 lst = entry.split(":")
12331 ID = lst[-1] # -1 means last item in the list
12332 return "GEOM_" + ID
12337 ## Add marker texture. @a Width and @a Height parameters
12338 # specify width and height of the texture in pixels.
12339 # If @a RowData is @c True, @a Texture parameter should represent texture data
12340 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12341 # parameter should be unpacked string, in which '1' symbols represent opaque
12342 # pixels and '0' represent transparent pixels of the texture bitmap.
12344 # @param Width texture width in pixels
12345 # @param Height texture height in pixels
12346 # @param Texture texture data
12347 # @param RowData if @c True, @a Texture data are packed in the byte stream
12348 # @return unique texture identifier
12349 # @ingroup l1_geomBuilder_auxiliary
12350 def AddTexture(self, Width, Height, Texture, RowData=False):
12352 Add marker texture. Width and Height parameters
12353 specify width and height of the texture in pixels.
12354 If RowData is True, Texture parameter should represent texture data
12355 packed into the byte array. If RowData is False (default), Texture
12356 parameter should be unpacked string, in which '1' symbols represent opaque
12357 pixels and '0' represent transparent pixels of the texture bitmap.
12360 Width texture width in pixels
12361 Height texture height in pixels
12362 Texture texture data
12363 RowData if True, Texture data are packed in the byte stream
12366 return unique texture identifier
12368 if not RowData: Texture = PackData(Texture)
12369 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12370 RaiseIfFailed("AddTexture", self.InsertOp)
12374 # Register the new proxy for GEOM_Gen
12375 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12377 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12378 # interface to GEOM operations.
12383 # salome.salome_init()
12384 # from salome.geom import geomBuilder
12385 # geompy = geomBuilder.New(salome.myStudy)
12387 # @param study SALOME study, generally obtained by salome.myStudy.
12388 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12389 # @return geomBuilder instance
12390 def New( study, instance=None):
12392 Create a new geomBuilder instance.The geomBuilder class provides the Python
12393 interface to GEOM operations.
12397 salome.salome_init()
12398 from salome.geom import geomBuilder
12399 geompy = geomBuilder.New(salome.myStudy)
12402 study SALOME study, generally obtained by salome.myStudy.
12403 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12405 geomBuilder instance
12407 #print "New geomBuilder ", study, instance
12414 geom = geomBuilder()
12415 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12416 geom.init_geom(study)