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 ## Remove internal wires and edges from the given object (face).
6000 # @param theObject Shape to be processed.
6001 # @param theWires Indices of wires to be removed, if EMPTY then the method
6002 # removes ALL internal wires of the given object.
6003 # @param theName Object name; when specified, this parameter is used
6004 # for result publication in the study. Otherwise, if automatic
6005 # publication is switched on, default value is used for result name.
6007 # @return New GEOM.GEOM_Object, containing processed shape.
6009 # @ref tui_suppress_internal_wires "Example"
6010 def SuppressInternalWires(self, theObject, theWires, theName=None):
6012 Remove internal wires and edges from the given object (face).
6015 theObject Shape to be processed.
6016 theWires Indices of wires to be removed, if EMPTY then the method
6017 removes ALL internal wires of the given object.
6018 theName Object name; when specified, this parameter is used
6019 for result publication in the study. Otherwise, if automatic
6020 publication is switched on, default value is used for result name.
6023 New GEOM.GEOM_Object, containing processed shape.
6025 # Example: see GEOM_TestHealing.py
6026 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6027 RaiseIfFailed("RemoveIntWires", self.HealOp)
6028 self._autoPublish(anObj, theName, "suppressWires")
6031 ## Remove internal closed contours (holes) from the given object.
6032 # @param theObject Shape to be processed.
6033 # @param theWires Indices of wires to be removed, if EMPTY then the method
6034 # removes ALL internal holes of the given object
6035 # @param theName Object name; when specified, this parameter is used
6036 # for result publication in the study. Otherwise, if automatic
6037 # publication is switched on, default value is used for result name.
6039 # @return New GEOM.GEOM_Object, containing processed shape.
6041 # @ref tui_suppress_holes "Example"
6042 def SuppressHoles(self, theObject, theWires, theName=None):
6044 Remove internal closed contours (holes) from the given object.
6047 theObject Shape to be processed.
6048 theWires Indices of wires to be removed, if EMPTY then the method
6049 removes ALL internal holes of the given object
6050 theName Object name; when specified, this parameter is used
6051 for result publication in the study. Otherwise, if automatic
6052 publication is switched on, default value is used for result name.
6055 New GEOM.GEOM_Object, containing processed shape.
6057 # Example: see GEOM_TestHealing.py
6058 anObj = self.HealOp.FillHoles(theObject, theWires)
6059 RaiseIfFailed("FillHoles", self.HealOp)
6060 self._autoPublish(anObj, theName, "suppressHoles")
6063 ## Close an open wire.
6064 # @param theObject Shape to be processed.
6065 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6066 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6067 # @param isCommonVertex If True : closure by creation of a common vertex,
6068 # If False : closure by creation of an edge between ends.
6069 # @param theName Object name; when specified, this parameter is used
6070 # for result publication in the study. Otherwise, if automatic
6071 # publication is switched on, default value is used for result name.
6073 # @return New GEOM.GEOM_Object, containing processed shape.
6075 # @ref tui_close_contour "Example"
6076 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6081 theObject Shape to be processed.
6082 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6083 if [ ], then theObject itself is a wire.
6084 isCommonVertex If True : closure by creation of a common vertex,
6085 If False : closure by creation of an edge between ends.
6086 theName Object name; when specified, this parameter is used
6087 for result publication in the study. Otherwise, if automatic
6088 publication is switched on, default value is used for result name.
6091 New GEOM.GEOM_Object, containing processed shape.
6093 # Example: see GEOM_TestHealing.py
6094 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6095 RaiseIfFailed("CloseContour", self.HealOp)
6096 self._autoPublish(anObj, theName, "closeContour")
6099 ## Addition of a point to a given edge object.
6100 # @param theObject Shape to be processed.
6101 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6102 # if -1, then theObject itself is the edge.
6103 # @param theValue Value of parameter on edge or length parameter,
6104 # depending on \a isByParameter.
6105 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6106 # if FALSE : \a theValue is treated as a length parameter [0..1]
6107 # @param theName Object name; when specified, this parameter is used
6108 # for result publication in the study. Otherwise, if automatic
6109 # publication is switched on, default value is used for result name.
6111 # @return New GEOM.GEOM_Object, containing processed shape.
6113 # @ref tui_add_point_on_edge "Example"
6114 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6116 Addition of a point to a given edge object.
6119 theObject Shape to be processed.
6120 theEdgeIndex Index of edge to be divided within theObject's shape,
6121 if -1, then theObject itself is the edge.
6122 theValue Value of parameter on edge or length parameter,
6123 depending on isByParameter.
6124 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6125 if FALSE : theValue is treated as a length parameter [0..1]
6126 theName Object name; when specified, this parameter is used
6127 for result publication in the study. Otherwise, if automatic
6128 publication is switched on, default value is used for result name.
6131 New GEOM.GEOM_Object, containing processed shape.
6133 # Example: see GEOM_TestHealing.py
6134 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6135 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6136 RaiseIfFailed("DivideEdge", self.HealOp)
6137 anObj.SetParameters(Parameters)
6138 self._autoPublish(anObj, theName, "divideEdge")
6141 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6142 # @param theWire Wire to minimize the number of C1 continuous edges in.
6143 # @param theVertices A list of vertices to suppress. If the list
6144 # is empty, all vertices in a wire will be assumed.
6145 # @param theName Object name; when specified, this parameter is used
6146 # for result publication in the study. Otherwise, if automatic
6147 # publication is switched on, default value is used for result name.
6149 # @return New GEOM.GEOM_Object with modified wire.
6151 # @ref tui_fuse_collinear_edges "Example"
6152 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6154 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6157 theWire Wire to minimize the number of C1 continuous edges in.
6158 theVertices A list of vertices to suppress. If the list
6159 is empty, all vertices in a wire will be assumed.
6160 theName Object name; when specified, this parameter is used
6161 for result publication in the study. Otherwise, if automatic
6162 publication is switched on, default value is used for result name.
6165 New GEOM.GEOM_Object with modified wire.
6167 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6168 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6169 self._autoPublish(anObj, theName, "fuseEdges")
6172 ## Change orientation of the given object. Updates given shape.
6173 # @param theObject Shape to be processed.
6174 # @return Updated <var>theObject</var>
6176 # @ref swig_todo "Example"
6177 def ChangeOrientationShell(self,theObject):
6179 Change orientation of the given object. Updates given shape.
6182 theObject Shape to be processed.
6187 theObject = self.HealOp.ChangeOrientation(theObject)
6188 RaiseIfFailed("ChangeOrientation", self.HealOp)
6191 ## Change orientation of the given object.
6192 # @param theObject Shape to be processed.
6193 # @param theName Object name; when specified, this parameter is used
6194 # for result publication in the study. Otherwise, if automatic
6195 # publication is switched on, default value is used for result name.
6197 # @return New GEOM.GEOM_Object, containing processed shape.
6199 # @ref swig_todo "Example"
6200 def ChangeOrientationShellCopy(self, theObject, theName=None):
6202 Change orientation of the given object.
6205 theObject Shape to be processed.
6206 theName Object name; when specified, this parameter is used
6207 for result publication in the study. Otherwise, if automatic
6208 publication is switched on, default value is used for result name.
6211 New GEOM.GEOM_Object, containing processed shape.
6213 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6214 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6215 self._autoPublish(anObj, theName, "reversed")
6218 ## Try to limit tolerance of the given object by value \a theTolerance.
6219 # @param theObject Shape to be processed.
6220 # @param theTolerance Required tolerance value.
6221 # @param theName Object name; when specified, this parameter is used
6222 # for result publication in the study. Otherwise, if automatic
6223 # publication is switched on, default value is used for result name.
6225 # @return New GEOM.GEOM_Object, containing processed shape.
6227 # @ref tui_limit_tolerance "Example"
6228 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6230 Try to limit tolerance of the given object by value theTolerance.
6233 theObject Shape to be processed.
6234 theTolerance Required tolerance value.
6235 theName Object name; when specified, this parameter is used
6236 for result publication in the study. Otherwise, if automatic
6237 publication is switched on, default value is used for result name.
6240 New GEOM.GEOM_Object, containing processed shape.
6242 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6243 RaiseIfFailed("LimitTolerance", self.HealOp)
6244 self._autoPublish(anObj, theName, "limitTolerance")
6247 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6248 # that constitute a free boundary of the given shape.
6249 # @param theObject Shape to get free boundary of.
6250 # @param theName Object name; when specified, this parameter is used
6251 # for result publication in the study. Otherwise, if automatic
6252 # publication is switched on, default value is used for result name.
6254 # @return [\a status, \a theClosedWires, \a theOpenWires]
6255 # \n \a status: FALSE, if an error(s) occured during the method execution.
6256 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6257 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6259 # @ref tui_measurement_tools_page "Example"
6260 def GetFreeBoundary(self, theObject, theName=None):
6262 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6263 that constitute a free boundary of the given shape.
6266 theObject Shape to get free boundary of.
6267 theName Object name; when specified, this parameter is used
6268 for result publication in the study. Otherwise, if automatic
6269 publication is switched on, default value is used for result name.
6272 [status, theClosedWires, theOpenWires]
6273 status: FALSE, if an error(s) occured during the method execution.
6274 theClosedWires: Closed wires on the free boundary of the given shape.
6275 theOpenWires: Open wires on the free boundary of the given shape.
6277 # Example: see GEOM_TestHealing.py
6278 anObj = self.HealOp.GetFreeBoundary(theObject)
6279 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6280 self._autoPublish(anObj[1], theName, "closedWire")
6281 self._autoPublish(anObj[2], theName, "openWire")
6284 ## Replace coincident faces in theShape by one face.
6285 # @param theShape Initial shape.
6286 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6287 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6288 # otherwise all initial shapes.
6289 # @param theName Object name; when specified, this parameter is used
6290 # for result publication in the study. Otherwise, if automatic
6291 # publication is switched on, default value is used for result name.
6293 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6295 # @ref tui_glue_faces "Example"
6296 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6298 Replace coincident faces in theShape by one face.
6301 theShape Initial shape.
6302 theTolerance Maximum distance between faces, which can be considered as coincident.
6303 doKeepNonSolids If FALSE, only solids will present in the result,
6304 otherwise all initial shapes.
6305 theName Object name; when specified, this parameter is used
6306 for result publication in the study. Otherwise, if automatic
6307 publication is switched on, default value is used for result name.
6310 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6312 # Example: see GEOM_Spanner.py
6313 theTolerance,Parameters = ParseParameters(theTolerance)
6314 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6316 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6317 anObj.SetParameters(Parameters)
6318 self._autoPublish(anObj, theName, "glueFaces")
6321 ## Find coincident faces in theShape for possible gluing.
6322 # @param theShape Initial shape.
6323 # @param theTolerance Maximum distance between faces,
6324 # which can be considered as coincident.
6325 # @param theName Object name; when specified, this parameter is used
6326 # for result publication in the study. Otherwise, if automatic
6327 # publication is switched on, default value is used for result name.
6329 # @return GEOM.ListOfGO
6331 # @ref tui_glue_faces "Example"
6332 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6334 Find coincident faces in theShape for possible gluing.
6337 theShape Initial shape.
6338 theTolerance Maximum distance between faces,
6339 which can be considered as coincident.
6340 theName Object name; when specified, this parameter is used
6341 for result publication in the study. Otherwise, if automatic
6342 publication is switched on, default value is used for result name.
6347 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6348 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6349 self._autoPublish(anObj, theName, "facesToGlue")
6352 ## Replace coincident faces in theShape by one face
6353 # in compliance with given list of faces
6354 # @param theShape Initial shape.
6355 # @param theTolerance Maximum distance between faces,
6356 # which can be considered as coincident.
6357 # @param theFaces List of faces for gluing.
6358 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6359 # otherwise all initial shapes.
6360 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6361 # will be glued, otherwise only the edges,
6362 # belonging to <VAR>theFaces</VAR>.
6363 # @param theName Object name; when specified, this parameter is used
6364 # for result publication in the study. Otherwise, if automatic
6365 # publication is switched on, default value is used for result name.
6367 # @return New GEOM.GEOM_Object, containing a copy of theShape
6368 # without some faces.
6370 # @ref tui_glue_faces "Example"
6371 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6372 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6374 Replace coincident faces in theShape by one face
6375 in compliance with given list of faces
6378 theShape Initial shape.
6379 theTolerance Maximum distance between faces,
6380 which can be considered as coincident.
6381 theFaces List of faces for gluing.
6382 doKeepNonSolids If FALSE, only solids will present in the result,
6383 otherwise all initial shapes.
6384 doGlueAllEdges If TRUE, all coincident edges of theShape
6385 will be glued, otherwise only the edges,
6386 belonging to theFaces.
6387 theName Object name; when specified, this parameter is used
6388 for result publication in the study. Otherwise, if automatic
6389 publication is switched on, default value is used for result name.
6392 New GEOM.GEOM_Object, containing a copy of theShape
6395 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6396 doKeepNonSolids, doGlueAllEdges)
6398 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6399 self._autoPublish(anObj, theName, "glueFaces")
6402 ## Replace coincident edges in theShape by one edge.
6403 # @param theShape Initial shape.
6404 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6405 # @param theName Object name; when specified, this parameter is used
6406 # for result publication in the study. Otherwise, if automatic
6407 # publication is switched on, default value is used for result name.
6409 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6411 # @ref tui_glue_edges "Example"
6412 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6414 Replace coincident edges in theShape by one edge.
6417 theShape Initial shape.
6418 theTolerance Maximum distance between edges, which can be considered as coincident.
6419 theName Object name; when specified, this parameter is used
6420 for result publication in the study. Otherwise, if automatic
6421 publication is switched on, default value is used for result name.
6424 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6426 theTolerance,Parameters = ParseParameters(theTolerance)
6427 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6429 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6430 anObj.SetParameters(Parameters)
6431 self._autoPublish(anObj, theName, "glueEdges")
6434 ## Find coincident edges in theShape for possible gluing.
6435 # @param theShape Initial shape.
6436 # @param theTolerance Maximum distance between edges,
6437 # which can be considered as coincident.
6438 # @param theName Object name; when specified, this parameter is used
6439 # for result publication in the study. Otherwise, if automatic
6440 # publication is switched on, default value is used for result name.
6442 # @return GEOM.ListOfGO
6444 # @ref tui_glue_edges "Example"
6445 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6447 Find coincident edges in theShape for possible gluing.
6450 theShape Initial shape.
6451 theTolerance Maximum distance between edges,
6452 which can be considered as coincident.
6453 theName Object name; when specified, this parameter is used
6454 for result publication in the study. Otherwise, if automatic
6455 publication is switched on, default value is used for result name.
6460 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6461 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6462 self._autoPublish(anObj, theName, "edgesToGlue")
6465 ## Replace coincident edges in theShape by one edge
6466 # in compliance with given list of edges.
6467 # @param theShape Initial shape.
6468 # @param theTolerance Maximum distance between edges,
6469 # which can be considered as coincident.
6470 # @param theEdges List of edges for gluing.
6471 # @param theName Object name; when specified, this parameter is used
6472 # for result publication in the study. Otherwise, if automatic
6473 # publication is switched on, default value is used for result name.
6475 # @return New GEOM.GEOM_Object, containing a copy of theShape
6476 # without some edges.
6478 # @ref tui_glue_edges "Example"
6479 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6481 Replace coincident edges in theShape by one edge
6482 in compliance with given list of edges.
6485 theShape Initial shape.
6486 theTolerance Maximum distance between edges,
6487 which can be considered as coincident.
6488 theEdges List of edges for gluing.
6489 theName Object name; when specified, this parameter is used
6490 for result publication in the study. Otherwise, if automatic
6491 publication is switched on, default value is used for result name.
6494 New GEOM.GEOM_Object, containing a copy of theShape
6497 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6499 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6500 self._autoPublish(anObj, theName, "glueEdges")
6506 ## @addtogroup l3_boolean Boolean Operations
6509 # -----------------------------------------------------------------------------
6510 # Boolean (Common, Cut, Fuse, Section)
6511 # -----------------------------------------------------------------------------
6513 ## Perform one of boolean operations on two given shapes.
6514 # @param theShape1 First argument for boolean operation.
6515 # @param theShape2 Second argument for boolean operation.
6516 # @param theOperation Indicates the operation to be done:\n
6517 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6518 # @param theName Object name; when specified, this parameter is used
6519 # for result publication in the study. Otherwise, if automatic
6520 # publication is switched on, default value is used for result name.
6522 # @return New GEOM.GEOM_Object, containing the result shape.
6524 # @ref tui_fuse "Example"
6525 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6527 Perform one of boolean operations on two given shapes.
6530 theShape1 First argument for boolean operation.
6531 theShape2 Second argument for boolean operation.
6532 theOperation Indicates the operation to be done:
6533 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6534 theName Object name; when specified, this parameter is used
6535 for result publication in the study. Otherwise, if automatic
6536 publication is switched on, default value is used for result name.
6539 New GEOM.GEOM_Object, containing the result shape.
6541 # Example: see GEOM_TestAll.py
6542 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6543 RaiseIfFailed("MakeBoolean", self.BoolOp)
6544 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6545 self._autoPublish(anObj, theName, def_names[theOperation])
6548 ## Perform Common boolean operation on two given shapes.
6549 # @param theShape1 First argument for boolean operation.
6550 # @param theShape2 Second argument for boolean operation.
6551 # @param theName Object name; when specified, this parameter is used
6552 # for result publication in the study. Otherwise, if automatic
6553 # publication is switched on, default value is used for result name.
6555 # @return New GEOM.GEOM_Object, containing the result shape.
6557 # @ref tui_common "Example 1"
6558 # \n @ref swig_MakeCommon "Example 2"
6559 def MakeCommon(self, theShape1, theShape2, theName=None):
6561 Perform Common boolean operation on two given shapes.
6564 theShape1 First argument for boolean operation.
6565 theShape2 Second argument for boolean operation.
6566 theName Object name; when specified, this parameter is used
6567 for result publication in the study. Otherwise, if automatic
6568 publication is switched on, default value is used for result name.
6571 New GEOM.GEOM_Object, containing the result shape.
6573 # Example: see GEOM_TestOthers.py
6574 # note: auto-publishing is done in self.MakeBoolean()
6575 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6577 ## Perform Cut boolean operation on two given shapes.
6578 # @param theShape1 First argument for boolean operation.
6579 # @param theShape2 Second argument for boolean operation.
6580 # @param theName Object name; when specified, this parameter is used
6581 # for result publication in the study. Otherwise, if automatic
6582 # publication is switched on, default value is used for result name.
6584 # @return New GEOM.GEOM_Object, containing the result shape.
6586 # @ref tui_cut "Example 1"
6587 # \n @ref swig_MakeCommon "Example 2"
6588 def MakeCut(self, theShape1, theShape2, theName=None):
6590 Perform Cut boolean operation on two given shapes.
6593 theShape1 First argument for boolean operation.
6594 theShape2 Second argument for boolean operation.
6595 theName Object name; when specified, this parameter is used
6596 for result publication in the study. Otherwise, if automatic
6597 publication is switched on, default value is used for result name.
6600 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, 2, theName)
6607 ## Perform Fuse 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_fuse "Example 1"
6617 # \n @ref swig_MakeCommon "Example 2"
6618 def MakeFuse(self, theShape1, theShape2, theName=None):
6620 Perform Fuse 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, 3, theName)
6637 ## Perform Section 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_section "Example 1"
6647 # \n @ref swig_MakeCommon "Example 2"
6648 def MakeSection(self, theShape1, theShape2, theName=None):
6650 Perform Section 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, 4, theName)
6667 ## Perform Fuse boolean operation on the list of shapes.
6668 # @param theShapesList Shapes to be fused.
6669 # @param theName Object name; when specified, this parameter is used
6670 # for result publication in the study. Otherwise, if automatic
6671 # publication is switched on, default value is used for result name.
6673 # @return New GEOM.GEOM_Object, containing the result shape.
6675 # @ref tui_fuse "Example 1"
6676 # \n @ref swig_MakeCommon "Example 2"
6677 def MakeFuseList(self, theShapesList, theName=None):
6679 Perform Fuse boolean operation on the list of shapes.
6682 theShapesList Shapes to be fused.
6683 theName Object name; when specified, this parameter is used
6684 for result publication in the study. Otherwise, if automatic
6685 publication is switched on, default value is used for result name.
6688 New GEOM.GEOM_Object, containing the result shape.
6691 # Example: see GEOM_TestOthers.py
6692 anObj = self.BoolOp.MakeFuseList(theShapesList)
6693 RaiseIfFailed("MakeFuseList", self.BoolOp)
6694 self._autoPublish(anObj, theName, "fuse")
6697 ## Perform Common boolean operation on the list of shapes.
6698 # @param theShapesList Shapes for Common operation.
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_common "Example 1"
6706 # \n @ref swig_MakeCommon "Example 2"
6707 def MakeCommonList(self, theShapesList, theName=None):
6709 Perform Common boolean operation on the list of shapes.
6712 theShapesList Shapes for Common operation.
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.MakeCommonList(theShapesList)
6723 RaiseIfFailed("MakeCommonList", self.BoolOp)
6724 self._autoPublish(anObj, theName, "common")
6727 ## Perform Cut boolean operation on one object and the list of tools.
6728 # @param theMainShape The object of the operation.
6729 # @param theShapesList The list of tools of the operation.
6730 # @param theName Object name; when specified, this parameter is used
6731 # for result publication in the study. Otherwise, if automatic
6732 # publication is switched on, default value is used for result name.
6734 # @return New GEOM.GEOM_Object, containing the result shape.
6736 # @ref tui_cut "Example 1"
6737 # \n @ref swig_MakeCommon "Example 2"
6738 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6740 Perform Cut boolean operation on one object and the list of tools.
6743 theMainShape The object of the operation.
6744 theShapesList The list of tools of the operation.
6745 theName Object name; when specified, this parameter is used
6746 for result publication in the study. Otherwise, if automatic
6747 publication is switched on, default value is used for result name.
6750 New GEOM.GEOM_Object, containing the result shape.
6753 # Example: see GEOM_TestOthers.py
6754 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6755 RaiseIfFailed("MakeCutList", self.BoolOp)
6756 self._autoPublish(anObj, theName, "cut")
6762 ## @addtogroup l3_basic_op
6765 ## Perform partition operation.
6766 # @param ListShapes Shapes to be intersected.
6767 # @param ListTools Shapes to intersect theShapes.
6768 # @param Limit Type of resulting shapes (see ShapeType()).\n
6769 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6770 # type will be detected automatically.
6771 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6772 # target type (equal to Limit) are kept in the result,
6773 # else standalone shapes of lower dimension
6774 # are kept also (if they exist).
6775 # @param 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.
6779 # @note Each compound from ListShapes and ListTools will be exploded
6780 # in order to avoid possible intersection between shapes from this compound.
6782 # After implementation new version of PartitionAlgo (October 2006)
6783 # other parameters are ignored by current functionality. They are kept
6784 # in this function only for support old versions.
6785 # @param ListKeepInside Shapes, outside which the results will be deleted.
6786 # Each shape from theKeepInside must belong to theShapes also.
6787 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6788 # Each shape from theRemoveInside must belong to theShapes also.
6789 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6790 # @param ListMaterials Material indices for each shape. Make sence,
6791 # only if theRemoveWebs is TRUE.
6793 # @return New GEOM.GEOM_Object, containing the result shapes.
6795 # @ref tui_partition "Example"
6796 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6797 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6798 KeepNonlimitShapes=0, theName=None):
6800 Perform partition operation.
6803 ListShapes Shapes to be intersected.
6804 ListTools Shapes to intersect theShapes.
6805 Limit Type of resulting shapes (see geompy.ShapeType)
6806 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6807 type will be detected automatically.
6808 KeepNonlimitShapes if this parameter == 0, then only shapes of
6809 target type (equal to Limit) are kept in the result,
6810 else standalone shapes of lower dimension
6811 are kept also (if they exist).
6812 theName Object name; when specified, this parameter is used
6813 for result publication in the study. Otherwise, if automatic
6814 publication is switched on, default value is used for result name.
6816 Each compound from ListShapes and ListTools will be exploded
6817 in order to avoid possible intersection between shapes from
6820 After implementation new version of PartitionAlgo (October 2006) other
6821 parameters are ignored by current functionality. They are kept in this
6822 function only for support old versions.
6825 ListKeepInside Shapes, outside which the results will be deleted.
6826 Each shape from theKeepInside must belong to theShapes also.
6827 ListRemoveInside Shapes, inside which the results will be deleted.
6828 Each shape from theRemoveInside must belong to theShapes also.
6829 RemoveWebs If TRUE, perform Glue 3D algorithm.
6830 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6833 New GEOM.GEOM_Object, containing the result shapes.
6835 # Example: see GEOM_TestAll.py
6836 if Limit == self.ShapeType["AUTO"]:
6837 # automatic detection of the most appropriate shape limit type
6839 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6840 Limit = EnumToLong(lim)
6842 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6843 ListKeepInside, ListRemoveInside,
6844 Limit, RemoveWebs, ListMaterials,
6845 KeepNonlimitShapes);
6846 RaiseIfFailed("MakePartition", self.BoolOp)
6847 self._autoPublish(anObj, theName, "partition")
6850 ## Perform partition operation.
6851 # This method may be useful if it is needed to make a partition for
6852 # compound contains nonintersected shapes. Performance will be better
6853 # since intersection between shapes from compound is not performed.
6855 # Description of all parameters as in previous method MakePartition()
6857 # @note Passed compounds (via ListShapes or via ListTools)
6858 # have to consist of nonintersecting shapes.
6860 # @return New GEOM.GEOM_Object, containing the result shapes.
6862 # @ref swig_todo "Example"
6863 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6864 ListKeepInside=[], ListRemoveInside=[],
6865 Limit=ShapeType["AUTO"], RemoveWebs=0,
6866 ListMaterials=[], KeepNonlimitShapes=0,
6869 Perform partition operation.
6870 This method may be useful if it is needed to make a partition for
6871 compound contains nonintersected shapes. Performance will be better
6872 since intersection between shapes from compound is not performed.
6875 Description of all parameters as in method geompy.MakePartition
6878 Passed compounds (via ListShapes or via ListTools)
6879 have to consist of nonintersecting shapes.
6882 New GEOM.GEOM_Object, containing the result shapes.
6884 if Limit == self.ShapeType["AUTO"]:
6885 # automatic detection of the most appropriate shape limit type
6887 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6888 Limit = EnumToLong(lim)
6890 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6891 ListKeepInside, ListRemoveInside,
6892 Limit, RemoveWebs, ListMaterials,
6893 KeepNonlimitShapes);
6894 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6895 self._autoPublish(anObj, theName, "partition")
6898 ## See method MakePartition() for more information.
6900 # @ref tui_partition "Example 1"
6901 # \n @ref swig_Partition "Example 2"
6902 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6903 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6904 KeepNonlimitShapes=0, theName=None):
6906 See method geompy.MakePartition for more information.
6908 # Example: see GEOM_TestOthers.py
6909 # note: auto-publishing is done in self.MakePartition()
6910 anObj = self.MakePartition(ListShapes, ListTools,
6911 ListKeepInside, ListRemoveInside,
6912 Limit, RemoveWebs, ListMaterials,
6913 KeepNonlimitShapes, theName);
6916 ## Perform partition of the Shape with the Plane
6917 # @param theShape Shape to be intersected.
6918 # @param thePlane Tool shape, to intersect theShape.
6919 # @param theName Object name; when specified, this parameter is used
6920 # for result publication in the study. Otherwise, if automatic
6921 # publication is switched on, default value is used for result name.
6923 # @return New GEOM.GEOM_Object, containing the result shape.
6925 # @ref tui_partition "Example"
6926 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6928 Perform partition of the Shape with the Plane
6931 theShape Shape to be intersected.
6932 thePlane Tool shape, to intersect theShape.
6933 theName Object name; when specified, this parameter is used
6934 for result publication in the study. Otherwise, if automatic
6935 publication is switched on, default value is used for result name.
6938 New GEOM.GEOM_Object, containing the result shape.
6940 # Example: see GEOM_TestAll.py
6941 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6942 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6943 self._autoPublish(anObj, theName, "partition")
6946 # end of l3_basic_op
6949 ## @addtogroup l3_transform
6952 ## Translate the given object along the vector, specified
6953 # by its end points.
6954 # @param theObject The object to be translated.
6955 # @param thePoint1 Start point of translation vector.
6956 # @param thePoint2 End point of translation vector.
6957 # @param theCopy Flag used to translate object itself or create a copy.
6958 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6959 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6960 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6962 Translate the given object along the vector, specified by its end points.
6965 theObject The object to be translated.
6966 thePoint1 Start point of translation vector.
6967 thePoint2 End point of translation vector.
6968 theCopy Flag used to translate object itself or create a copy.
6971 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6972 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6975 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6977 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
6978 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
6981 ## Translate the given object along the vector, specified
6982 # by its end points, creating its copy before the translation.
6983 # @param theObject The object to be translated.
6984 # @param thePoint1 Start point of translation vector.
6985 # @param thePoint2 End point of translation vector.
6986 # @param theName Object name; when specified, this parameter is used
6987 # for result publication in the study. Otherwise, if automatic
6988 # publication is switched on, default value is used for result name.
6990 # @return New GEOM.GEOM_Object, containing the translated object.
6992 # @ref tui_translation "Example 1"
6993 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
6994 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
6996 Translate the given object along the vector, specified
6997 by its end points, creating its copy before the translation.
7000 theObject The object to be translated.
7001 thePoint1 Start point of translation vector.
7002 thePoint2 End point of translation vector.
7003 theName Object name; when specified, this parameter is used
7004 for result publication in the study. Otherwise, if automatic
7005 publication is switched on, default value is used for result name.
7008 New GEOM.GEOM_Object, containing the translated object.
7010 # Example: see GEOM_TestAll.py
7011 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7012 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7013 self._autoPublish(anObj, theName, "translated")
7016 ## Translate the given object along the vector, specified by its components.
7017 # @param theObject The object to be translated.
7018 # @param theDX,theDY,theDZ Components of translation vector.
7019 # @param theCopy Flag used to translate object itself or create a copy.
7020 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7021 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7023 # @ref tui_translation "Example"
7024 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7026 Translate the given object along the vector, specified by its components.
7029 theObject The object to be translated.
7030 theDX,theDY,theDZ Components of translation vector.
7031 theCopy Flag used to translate object itself or create a copy.
7034 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7035 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7037 # Example: see GEOM_TestAll.py
7038 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7040 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7042 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7043 anObj.SetParameters(Parameters)
7044 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7047 ## Translate the given object along the vector, specified
7048 # by its components, creating its copy before the translation.
7049 # @param theObject The object to be translated.
7050 # @param theDX,theDY,theDZ Components of translation vector.
7051 # @param theName Object name; when specified, this parameter is used
7052 # for result publication in the study. Otherwise, if automatic
7053 # publication is switched on, default value is used for result name.
7055 # @return New GEOM.GEOM_Object, containing the translated object.
7057 # @ref tui_translation "Example"
7058 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7060 Translate the given object along the vector, specified
7061 by its components, creating its copy before the translation.
7064 theObject The object to be translated.
7065 theDX,theDY,theDZ Components of translation vector.
7066 theName Object name; when specified, this parameter is used
7067 for result publication in the study. Otherwise, if automatic
7068 publication is switched on, default value is used for result name.
7071 New GEOM.GEOM_Object, containing the translated object.
7073 # Example: see GEOM_TestAll.py
7074 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7075 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7076 anObj.SetParameters(Parameters)
7077 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7078 self._autoPublish(anObj, theName, "translated")
7081 ## Translate the given object along the given vector.
7082 # @param theObject The object to be translated.
7083 # @param theVector The translation vector.
7084 # @param theCopy Flag used to translate object itself or create a copy.
7085 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7086 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7087 def TranslateVector(self, theObject, theVector, theCopy=False):
7089 Translate the given object along the given vector.
7092 theObject The object to be translated.
7093 theVector The translation vector.
7094 theCopy Flag used to translate object itself or create a copy.
7097 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7098 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7101 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7103 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7104 RaiseIfFailed("TranslateVector", self.TrsfOp)
7107 ## Translate the given object along the given vector,
7108 # creating its copy before the translation.
7109 # @param theObject The object to be translated.
7110 # @param theVector The translation vector.
7111 # @param theName Object name; when specified, this parameter is used
7112 # for result publication in the study. Otherwise, if automatic
7113 # publication is switched on, default value is used for result name.
7115 # @return New GEOM.GEOM_Object, containing the translated object.
7117 # @ref tui_translation "Example"
7118 def MakeTranslationVector(self, theObject, theVector, theName=None):
7120 Translate the given object along the given vector,
7121 creating its copy before the translation.
7124 theObject The object to be translated.
7125 theVector The translation vector.
7126 theName Object name; when specified, this parameter is used
7127 for result publication in the study. Otherwise, if automatic
7128 publication is switched on, default value is used for result name.
7131 New GEOM.GEOM_Object, containing the translated object.
7133 # Example: see GEOM_TestAll.py
7134 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7135 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7136 self._autoPublish(anObj, theName, "translated")
7139 ## Translate the given object along the given vector on given distance.
7140 # @param theObject The object to be translated.
7141 # @param theVector The translation vector.
7142 # @param theDistance The translation distance.
7143 # @param theCopy Flag used to translate object itself or create a copy.
7144 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7145 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7147 # @ref tui_translation "Example"
7148 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7150 Translate the given object along the given vector on given distance.
7153 theObject The object to be translated.
7154 theVector The translation vector.
7155 theDistance The translation distance.
7156 theCopy Flag used to translate object itself or create a copy.
7159 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7160 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7162 # Example: see GEOM_TestAll.py
7163 theDistance,Parameters = ParseParameters(theDistance)
7164 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7165 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7166 anObj.SetParameters(Parameters)
7169 ## Translate the given object along the given vector on given distance,
7170 # creating its copy before the translation.
7171 # @param theObject The object to be translated.
7172 # @param theVector The translation vector.
7173 # @param theDistance The translation distance.
7174 # @param theName Object name; when specified, this parameter is used
7175 # for result publication in the study. Otherwise, if automatic
7176 # publication is switched on, default value is used for result name.
7178 # @return New GEOM.GEOM_Object, containing the translated object.
7180 # @ref tui_translation "Example"
7181 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7183 Translate the given object along the given vector on given distance,
7184 creating its copy before the translation.
7187 theObject The object to be translated.
7188 theVector The translation vector.
7189 theDistance The translation distance.
7190 theName Object name; when specified, this parameter is used
7191 for result publication in the study. Otherwise, if automatic
7192 publication is switched on, default value is used for result name.
7195 New GEOM.GEOM_Object, containing the translated object.
7197 # Example: see GEOM_TestAll.py
7198 theDistance,Parameters = ParseParameters(theDistance)
7199 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7200 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7201 anObj.SetParameters(Parameters)
7202 self._autoPublish(anObj, theName, "translated")
7205 ## Rotate the given object around the given axis on the given angle.
7206 # @param theObject The object to be rotated.
7207 # @param theAxis Rotation axis.
7208 # @param theAngle Rotation angle in radians.
7209 # @param theCopy Flag used to rotate object itself or create a copy.
7211 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7212 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7214 # @ref tui_rotation "Example"
7215 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7217 Rotate the given object around the given axis on the given angle.
7220 theObject The object to be rotated.
7221 theAxis Rotation axis.
7222 theAngle Rotation angle in radians.
7223 theCopy Flag used to rotate object itself or create a copy.
7226 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7227 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7229 # Example: see GEOM_TestAll.py
7231 if isinstance(theAngle,str):
7233 theAngle, Parameters = ParseParameters(theAngle)
7235 theAngle = theAngle*math.pi/180.0
7237 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7239 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7240 RaiseIfFailed("Rotate", self.TrsfOp)
7241 anObj.SetParameters(Parameters)
7244 ## Rotate the given object around the given axis
7245 # on the given angle, creating its copy before the rotatation.
7246 # @param theObject The object to be rotated.
7247 # @param theAxis Rotation axis.
7248 # @param theAngle Rotation angle in radians.
7249 # @param theName Object name; when specified, this parameter is used
7250 # for result publication in the study. Otherwise, if automatic
7251 # publication is switched on, default value is used for result name.
7253 # @return New GEOM.GEOM_Object, containing the rotated object.
7255 # @ref tui_rotation "Example"
7256 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7258 Rotate the given object around the given axis
7259 on the given angle, creating its copy before the rotatation.
7262 theObject The object to be rotated.
7263 theAxis Rotation axis.
7264 theAngle Rotation angle in radians.
7265 theName Object name; when specified, this parameter is used
7266 for result publication in the study. Otherwise, if automatic
7267 publication is switched on, default value is used for result name.
7270 New GEOM.GEOM_Object, containing the rotated object.
7272 # Example: see GEOM_TestAll.py
7274 if isinstance(theAngle,str):
7276 theAngle, Parameters = ParseParameters(theAngle)
7278 theAngle = theAngle*math.pi/180.0
7279 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7280 RaiseIfFailed("RotateCopy", self.TrsfOp)
7281 anObj.SetParameters(Parameters)
7282 self._autoPublish(anObj, theName, "rotated")
7285 ## Rotate given object around vector perpendicular to plane
7286 # containing three points.
7287 # @param theObject The object to be rotated.
7288 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7289 # containing the three points.
7290 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7291 # @param theCopy Flag used to rotate object itself or create a copy.
7292 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7293 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7294 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7296 Rotate given object around vector perpendicular to plane
7297 containing three points.
7300 theObject The object to be rotated.
7301 theCentPoint central point the axis is the vector perpendicular to the plane
7302 containing the three points.
7303 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7304 theCopy Flag used to rotate object itself or create a copy.
7307 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7308 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7311 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7313 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7314 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7317 ## Rotate given object around vector perpendicular to plane
7318 # containing three points, creating its copy before the rotatation.
7319 # @param theObject The object to be rotated.
7320 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7321 # containing the three points.
7322 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7323 # @param theName Object name; when specified, this parameter is used
7324 # for result publication in the study. Otherwise, if automatic
7325 # publication is switched on, default value is used for result name.
7327 # @return New GEOM.GEOM_Object, containing the rotated object.
7329 # @ref tui_rotation "Example"
7330 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7332 Rotate given object around vector perpendicular to plane
7333 containing three points, creating its copy before the rotatation.
7336 theObject The object to be rotated.
7337 theCentPoint central point the axis is the vector perpendicular to the plane
7338 containing the three points.
7339 thePoint1,thePoint2 in a perpendicular plane of the axis.
7340 theName Object name; when specified, this parameter is used
7341 for result publication in the study. Otherwise, if automatic
7342 publication is switched on, default value is used for result name.
7345 New GEOM.GEOM_Object, containing the rotated object.
7347 # Example: see GEOM_TestAll.py
7348 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7349 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7350 self._autoPublish(anObj, theName, "rotated")
7353 ## Scale the given object by the specified factor.
7354 # @param theObject The object to be scaled.
7355 # @param thePoint Center point for scaling.
7356 # Passing None for it means scaling relatively the origin of global CS.
7357 # @param theFactor Scaling factor value.
7358 # @param theCopy Flag used to scale object itself or create a copy.
7359 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7360 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7361 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7363 Scale the given object by the specified factor.
7366 theObject The object to be scaled.
7367 thePoint Center point for scaling.
7368 Passing None for it means scaling relatively the origin of global CS.
7369 theFactor Scaling factor value.
7370 theCopy Flag used to scale object itself or create a copy.
7373 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7374 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7376 # Example: see GEOM_TestAll.py
7377 theFactor, Parameters = ParseParameters(theFactor)
7379 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7381 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7382 RaiseIfFailed("Scale", self.TrsfOp)
7383 anObj.SetParameters(Parameters)
7386 ## Scale the given object by the factor, creating its copy before the scaling.
7387 # @param theObject The object to be scaled.
7388 # @param thePoint Center point for scaling.
7389 # Passing None for it means scaling relatively the origin of global CS.
7390 # @param theFactor Scaling factor value.
7391 # @param theName Object name; when specified, this parameter is used
7392 # for result publication in the study. Otherwise, if automatic
7393 # publication is switched on, default value is used for result name.
7395 # @return New GEOM.GEOM_Object, containing the scaled shape.
7397 # @ref tui_scale "Example"
7398 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7400 Scale the given object by the factor, creating its copy before the scaling.
7403 theObject The object to be scaled.
7404 thePoint Center point for scaling.
7405 Passing None for it means scaling relatively the origin of global CS.
7406 theFactor Scaling factor value.
7407 theName Object name; when specified, this parameter is used
7408 for result publication in the study. Otherwise, if automatic
7409 publication is switched on, default value is used for result name.
7412 New GEOM.GEOM_Object, containing the scaled shape.
7414 # Example: see GEOM_TestAll.py
7415 theFactor, Parameters = ParseParameters(theFactor)
7416 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7417 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7418 anObj.SetParameters(Parameters)
7419 self._autoPublish(anObj, theName, "scaled")
7422 ## Scale the given object by different factors along coordinate axes.
7423 # @param theObject The object to be scaled.
7424 # @param thePoint Center point for scaling.
7425 # Passing None for it means scaling relatively the origin of global CS.
7426 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7427 # @param theCopy Flag used to scale object itself or create a copy.
7428 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7429 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7430 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7432 Scale the given object by different factors along coordinate axes.
7435 theObject The object to be scaled.
7436 thePoint Center point for scaling.
7437 Passing None for it means scaling relatively the origin of global CS.
7438 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7439 theCopy Flag used to scale object itself or create a copy.
7442 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7443 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7445 # Example: see GEOM_TestAll.py
7446 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7448 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7449 theFactorX, theFactorY, theFactorZ)
7451 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7452 theFactorX, theFactorY, theFactorZ)
7453 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7454 anObj.SetParameters(Parameters)
7457 ## Scale the given object by different factors along coordinate axes,
7458 # creating its copy before the scaling.
7459 # @param theObject The object to be scaled.
7460 # @param thePoint Center point for scaling.
7461 # Passing None for it means scaling relatively the origin of global CS.
7462 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7463 # @param theName Object name; when specified, this parameter is used
7464 # for result publication in the study. Otherwise, if automatic
7465 # publication is switched on, default value is used for result name.
7467 # @return New GEOM.GEOM_Object, containing the scaled shape.
7469 # @ref swig_scale "Example"
7470 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7472 Scale the given object by different factors along coordinate axes,
7473 creating its copy before the scaling.
7476 theObject The object to be scaled.
7477 thePoint Center point for scaling.
7478 Passing None for it means scaling relatively the origin of global CS.
7479 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7480 theName Object name; when specified, this parameter is used
7481 for result publication in the study. Otherwise, if automatic
7482 publication is switched on, default value is used for result name.
7485 New GEOM.GEOM_Object, containing the scaled shape.
7487 # Example: see GEOM_TestAll.py
7488 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7489 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7490 theFactorX, theFactorY, theFactorZ)
7491 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7492 anObj.SetParameters(Parameters)
7493 self._autoPublish(anObj, theName, "scaled")
7496 ## Mirror an object relatively the given plane.
7497 # @param theObject The object to be mirrored.
7498 # @param thePlane Plane of symmetry.
7499 # @param theCopy Flag used to mirror object itself or create a copy.
7500 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7501 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7502 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7504 Mirror an object relatively the given plane.
7507 theObject The object to be mirrored.
7508 thePlane Plane of symmetry.
7509 theCopy Flag used to mirror object itself or create a copy.
7512 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7513 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7516 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7518 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7519 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7522 ## Create an object, symmetrical
7523 # to the given one relatively the given plane.
7524 # @param theObject The object to be mirrored.
7525 # @param thePlane Plane of symmetry.
7526 # @param theName Object name; when specified, this parameter is used
7527 # for result publication in the study. Otherwise, if automatic
7528 # publication is switched on, default value is used for result name.
7530 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7532 # @ref tui_mirror "Example"
7533 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7535 Create an object, symmetrical to the given one relatively the given plane.
7538 theObject The object to be mirrored.
7539 thePlane Plane of symmetry.
7540 theName Object name; when specified, this parameter is used
7541 for result publication in the study. Otherwise, if automatic
7542 publication is switched on, default value is used for result name.
7545 New GEOM.GEOM_Object, containing the mirrored shape.
7547 # Example: see GEOM_TestAll.py
7548 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7549 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7550 self._autoPublish(anObj, theName, "mirrored")
7553 ## Mirror an object relatively the given axis.
7554 # @param theObject The object to be mirrored.
7555 # @param theAxis Axis of symmetry.
7556 # @param theCopy Flag used to mirror object itself or create a copy.
7557 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7558 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7559 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7561 Mirror an object relatively the given axis.
7564 theObject The object to be mirrored.
7565 theAxis Axis of symmetry.
7566 theCopy Flag used to mirror object itself or create a copy.
7569 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7570 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7573 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7575 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7576 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7579 ## Create an object, symmetrical
7580 # to the given one relatively the given axis.
7581 # @param theObject The object to be mirrored.
7582 # @param theAxis Axis of symmetry.
7583 # @param theName Object name; when specified, this parameter is used
7584 # for result publication in the study. Otherwise, if automatic
7585 # publication is switched on, default value is used for result name.
7587 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7589 # @ref tui_mirror "Example"
7590 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7592 Create an object, symmetrical to the given one relatively the given axis.
7595 theObject The object to be mirrored.
7596 theAxis Axis of symmetry.
7597 theName Object name; when specified, this parameter is used
7598 for result publication in the study. Otherwise, if automatic
7599 publication is switched on, default value is used for result name.
7602 New GEOM.GEOM_Object, containing the mirrored shape.
7604 # Example: see GEOM_TestAll.py
7605 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7606 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7607 self._autoPublish(anObj, theName, "mirrored")
7610 ## Mirror an object relatively the given point.
7611 # @param theObject The object to be mirrored.
7612 # @param thePoint Point of symmetry.
7613 # @param theCopy Flag used to mirror object itself or create a copy.
7614 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7615 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7616 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7618 Mirror an object relatively the given point.
7621 theObject The object to be mirrored.
7622 thePoint Point of symmetry.
7623 theCopy Flag used to mirror object itself or create a copy.
7626 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7627 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7629 # Example: see GEOM_TestAll.py
7631 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7633 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7634 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7637 ## Create an object, symmetrical
7638 # to the given one relatively the given point.
7639 # @param theObject The object to be mirrored.
7640 # @param thePoint Point of symmetry.
7641 # @param theName Object name; when specified, this parameter is used
7642 # for result publication in the study. Otherwise, if automatic
7643 # publication is switched on, default value is used for result name.
7645 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7647 # @ref tui_mirror "Example"
7648 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7650 Create an object, symmetrical
7651 to the given one relatively the given point.
7654 theObject The object to be mirrored.
7655 thePoint Point of symmetry.
7656 theName Object name; when specified, this parameter is used
7657 for result publication in the study. Otherwise, if automatic
7658 publication is switched on, default value is used for result name.
7661 New GEOM.GEOM_Object, containing the mirrored shape.
7663 # Example: see GEOM_TestAll.py
7664 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7665 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7666 self._autoPublish(anObj, theName, "mirrored")
7669 ## Modify the location of the given object.
7670 # @param theObject The object to be displaced.
7671 # @param theStartLCS Coordinate system to perform displacement from it.\n
7672 # If \a theStartLCS is NULL, displacement
7673 # will be performed from global CS.\n
7674 # If \a theObject itself is used as \a theStartLCS,
7675 # its location will be changed to \a theEndLCS.
7676 # @param theEndLCS Coordinate system to perform displacement to it.
7677 # @param theCopy Flag used to displace object itself or create a copy.
7678 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7679 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7680 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7682 Modify the Location of the given object by LCS, creating its copy before the setting.
7685 theObject The object to be displaced.
7686 theStartLCS Coordinate system to perform displacement from it.
7687 If theStartLCS is NULL, displacement
7688 will be performed from global CS.
7689 If theObject itself is used as theStartLCS,
7690 its location will be changed to theEndLCS.
7691 theEndLCS Coordinate system to perform displacement to it.
7692 theCopy Flag used to displace object itself or create a copy.
7695 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7696 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7698 # Example: see GEOM_TestAll.py
7700 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7702 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7703 RaiseIfFailed("Displace", self.TrsfOp)
7706 ## Modify the Location of the given object by LCS,
7707 # creating its copy before the setting.
7708 # @param theObject The object to be displaced.
7709 # @param theStartLCS Coordinate system to perform displacement from it.\n
7710 # If \a theStartLCS is NULL, displacement
7711 # will be performed from global CS.\n
7712 # If \a theObject itself is used as \a theStartLCS,
7713 # its location will be changed to \a theEndLCS.
7714 # @param theEndLCS Coordinate system to perform displacement to it.
7715 # @param theName Object name; when specified, this parameter is used
7716 # for result publication in the study. Otherwise, if automatic
7717 # publication is switched on, default value is used for result name.
7719 # @return New GEOM.GEOM_Object, containing the displaced shape.
7721 # @ref tui_modify_location "Example"
7722 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7724 Modify the Location of the given object by LCS, creating its copy before the setting.
7727 theObject The object to be displaced.
7728 theStartLCS Coordinate system to perform displacement from it.
7729 If theStartLCS is NULL, displacement
7730 will be performed from global CS.
7731 If theObject itself is used as theStartLCS,
7732 its location will be changed to theEndLCS.
7733 theEndLCS Coordinate system to perform displacement to it.
7734 theName Object name; when specified, this parameter is used
7735 for result publication in the study. Otherwise, if automatic
7736 publication is switched on, default value is used for result name.
7739 New GEOM.GEOM_Object, containing the displaced shape.
7742 # create local coordinate systems
7743 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7744 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7745 # modify the location of the given object
7746 position = geompy.MakePosition(cylinder, cs1, cs2)
7748 # Example: see GEOM_TestAll.py
7749 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7750 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7751 self._autoPublish(anObj, theName, "displaced")
7754 ## Modify the Location of the given object by Path.
7755 # @param theObject The object to be displaced.
7756 # @param thePath Wire or Edge along that the object will be translated.
7757 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7758 # @param theCopy is to create a copy objects if true.
7759 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7760 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7761 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7763 # @ref tui_modify_location "Example"
7764 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7766 Modify the Location of the given object by Path.
7769 theObject The object to be displaced.
7770 thePath Wire or Edge along that the object will be translated.
7771 theDistance progress of Path (0 = start location, 1 = end of path location).
7772 theCopy is to create a copy objects if true.
7773 theReverse 0 - for usual direction, 1 - to reverse path direction.
7776 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7777 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7780 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7782 # Example: see GEOM_TestAll.py
7783 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7784 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7787 ## Modify the Location of the given object by Path, creating its copy before the operation.
7788 # @param theObject The object to be displaced.
7789 # @param thePath Wire or Edge along that the object will be translated.
7790 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7791 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7792 # @param theName Object name; when specified, this parameter is used
7793 # for result publication in the study. Otherwise, if automatic
7794 # publication is switched on, default value is used for result name.
7796 # @return New GEOM.GEOM_Object, containing the displaced shape.
7797 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7799 Modify the Location of the given object by Path, creating its copy before the operation.
7802 theObject The object to be displaced.
7803 thePath Wire or Edge along that the object will be translated.
7804 theDistance progress of Path (0 = start location, 1 = end of path location).
7805 theReverse 0 - for usual direction, 1 - to reverse path direction.
7806 theName Object name; when specified, this parameter is used
7807 for result publication in the study. Otherwise, if automatic
7808 publication is switched on, default value is used for result name.
7811 New GEOM.GEOM_Object, containing the displaced shape.
7813 # Example: see GEOM_TestAll.py
7814 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7815 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7816 self._autoPublish(anObj, theName, "displaced")
7819 ## Offset given shape.
7820 # @param theObject The base object for the offset.
7821 # @param theOffset Offset value.
7822 # @param theCopy Flag used to offset object itself or create a copy.
7823 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7824 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7825 def Offset(self, theObject, theOffset, theCopy=False):
7830 theObject The base object for the offset.
7831 theOffset Offset value.
7832 theCopy Flag used to offset object itself or create a copy.
7835 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7836 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7838 theOffset, Parameters = ParseParameters(theOffset)
7840 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7842 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7843 RaiseIfFailed("Offset", self.TrsfOp)
7844 anObj.SetParameters(Parameters)
7847 ## Create new object as offset of the given one.
7848 # @param theObject The base object for the offset.
7849 # @param theOffset Offset value.
7850 # @param theName Object name; when specified, this parameter is used
7851 # for result publication in the study. Otherwise, if automatic
7852 # publication is switched on, default value is used for result name.
7854 # @return New GEOM.GEOM_Object, containing the offset object.
7856 # @ref tui_offset "Example"
7857 def MakeOffset(self, theObject, theOffset, theName=None):
7859 Create new object as offset of the given one.
7862 theObject The base object for the offset.
7863 theOffset Offset value.
7864 theName Object name; when specified, this parameter is used
7865 for result publication in the study. Otherwise, if automatic
7866 publication is switched on, default value is used for result name.
7869 New GEOM.GEOM_Object, containing the offset object.
7872 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7873 # create a new object as offset of the given object
7874 offset = geompy.MakeOffset(box, 70.)
7876 # Example: see GEOM_TestAll.py
7877 theOffset, Parameters = ParseParameters(theOffset)
7878 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7879 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7880 anObj.SetParameters(Parameters)
7881 self._autoPublish(anObj, theName, "offset")
7884 ## Create new object as projection of the given one on a 2D surface.
7885 # @param theSource The source object for the projection. It can be a point, edge or wire.
7886 # @param theTarget The target object. It can be planar or cylindrical face.
7887 # @param theName Object name; when specified, this parameter is used
7888 # for result publication in the study. Otherwise, if automatic
7889 # publication is switched on, default value is used for result name.
7891 # @return New GEOM.GEOM_Object, containing the projection.
7893 # @ref tui_projection "Example"
7894 def MakeProjection(self, theSource, theTarget, theName=None):
7896 Create new object as projection of the given one on a 2D surface.
7899 theSource The source object for the projection. It can be a point, edge or wire.
7900 theTarget The target object. It can be planar or cylindrical face.
7901 theName Object name; when specified, this parameter is used
7902 for result publication in the study. Otherwise, if automatic
7903 publication is switched on, default value is used for result name.
7906 New GEOM.GEOM_Object, containing the projection.
7908 # Example: see GEOM_TestAll.py
7909 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7910 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7911 self._autoPublish(anObj, theName, "projection")
7914 # -----------------------------------------------------------------------------
7916 # -----------------------------------------------------------------------------
7918 ## Translate the given object along the given vector a given number times
7919 # @param theObject The object to be translated.
7920 # @param theVector Direction of the translation. DX if None.
7921 # @param theStep Distance to translate on.
7922 # @param theNbTimes Quantity of translations to be done.
7923 # @param theName Object name; when specified, this parameter is used
7924 # for result publication in the study. Otherwise, if automatic
7925 # publication is switched on, default value is used for result name.
7927 # @return New GEOM.GEOM_Object, containing compound of all
7928 # the shapes, obtained after each translation.
7930 # @ref tui_multi_translation "Example"
7931 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7933 Translate the given object along the given vector a given number times
7936 theObject The object to be translated.
7937 theVector Direction of the translation. DX if None.
7938 theStep Distance to translate on.
7939 theNbTimes Quantity of translations to be done.
7940 theName Object name; when specified, this parameter is used
7941 for result publication in the study. Otherwise, if automatic
7942 publication is switched on, default value is used for result name.
7945 New GEOM.GEOM_Object, containing compound of all
7946 the shapes, obtained after each translation.
7949 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7951 # Example: see GEOM_TestAll.py
7952 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7953 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7954 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7955 anObj.SetParameters(Parameters)
7956 self._autoPublish(anObj, theName, "multitranslation")
7959 ## Conseqently apply two specified translations to theObject specified number of times.
7960 # @param theObject The object to be translated.
7961 # @param theVector1 Direction of the first translation. DX if None.
7962 # @param theStep1 Step of the first translation.
7963 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7964 # @param theVector2 Direction of the second translation. DY if None.
7965 # @param theStep2 Step of the second translation.
7966 # @param theNbTimes2 Quantity of translations to be done along theVector2.
7967 # @param theName Object name; when specified, this parameter is used
7968 # for result publication in the study. Otherwise, if automatic
7969 # publication is switched on, default value is used for result name.
7971 # @return New GEOM.GEOM_Object, containing compound of all
7972 # the shapes, obtained after each translation.
7974 # @ref tui_multi_translation "Example"
7975 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
7976 theVector2, theStep2, theNbTimes2, theName=None):
7978 Conseqently apply two specified translations to theObject specified number of times.
7981 theObject The object to be translated.
7982 theVector1 Direction of the first translation. DX if None.
7983 theStep1 Step of the first translation.
7984 theNbTimes1 Quantity of translations to be done along theVector1.
7985 theVector2 Direction of the second translation. DY if None.
7986 theStep2 Step of the second translation.
7987 theNbTimes2 Quantity of translations to be done along theVector2.
7988 theName Object name; when specified, this parameter is used
7989 for result publication in the study. Otherwise, if automatic
7990 publication is switched on, default value is used for result name.
7993 New GEOM.GEOM_Object, containing compound of all
7994 the shapes, obtained after each translation.
7997 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
7999 # Example: see GEOM_TestAll.py
8000 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8001 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8002 theVector2, theStep2, theNbTimes2)
8003 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8004 anObj.SetParameters(Parameters)
8005 self._autoPublish(anObj, theName, "multitranslation")
8008 ## Rotate the given object around the given axis a given number times.
8009 # Rotation angle will be 2*PI/theNbTimes.
8010 # @param theObject The object to be rotated.
8011 # @param theAxis The rotation axis. DZ if None.
8012 # @param theNbTimes Quantity of rotations to be done.
8013 # @param theName Object name; when specified, this parameter is used
8014 # for result publication in the study. Otherwise, if automatic
8015 # publication is switched on, default value is used for result name.
8017 # @return New GEOM.GEOM_Object, containing compound of all the
8018 # shapes, obtained after each rotation.
8020 # @ref tui_multi_rotation "Example"
8021 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8023 Rotate the given object around the given axis a given number times.
8024 Rotation angle will be 2*PI/theNbTimes.
8027 theObject The object to be rotated.
8028 theAxis The rotation axis. DZ if None.
8029 theNbTimes Quantity of rotations to be done.
8030 theName Object name; when specified, this parameter is used
8031 for result publication in the study. Otherwise, if automatic
8032 publication is switched on, default value is used for result name.
8035 New GEOM.GEOM_Object, containing compound of all the
8036 shapes, obtained after each rotation.
8039 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8041 # Example: see GEOM_TestAll.py
8042 theNbTimes, Parameters = ParseParameters(theNbTimes)
8043 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8044 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8045 anObj.SetParameters(Parameters)
8046 self._autoPublish(anObj, theName, "multirotation")
8049 ## Rotate the given object around the given axis
8050 # a given number times on the given angle.
8051 # @param theObject The object to be rotated.
8052 # @param theAxis The rotation axis. DZ if None.
8053 # @param theAngleStep Rotation angle in radians.
8054 # @param theNbTimes Quantity of rotations to be done.
8055 # @param theName Object name; when specified, this parameter is used
8056 # for result publication in the study. Otherwise, if automatic
8057 # publication is switched on, default value is used for result name.
8059 # @return New GEOM.GEOM_Object, containing compound of all the
8060 # shapes, obtained after each rotation.
8062 # @ref tui_multi_rotation "Example"
8063 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8065 Rotate the given object around the given axis
8066 a given number times on the given angle.
8069 theObject The object to be rotated.
8070 theAxis The rotation axis. DZ if None.
8071 theAngleStep Rotation angle in radians.
8072 theNbTimes Quantity of rotations to be done.
8073 theName Object name; when specified, this parameter is used
8074 for result publication in the study. Otherwise, if automatic
8075 publication is switched on, default value is used for result name.
8078 New GEOM.GEOM_Object, containing compound of all the
8079 shapes, obtained after each rotation.
8082 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8084 # Example: see GEOM_TestAll.py
8085 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8086 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8087 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8088 anObj.SetParameters(Parameters)
8089 self._autoPublish(anObj, theName, "multirotation")
8092 ## Rotate the given object around the given axis a given
8093 # number times and multi-translate each rotation result.
8094 # Rotation angle will be 2*PI/theNbTimes1.
8095 # Translation direction passes through center of gravity
8096 # of rotated shape and its projection on the rotation axis.
8097 # @param theObject The object to be rotated.
8098 # @param theAxis Rotation axis. DZ if None.
8099 # @param theNbTimes1 Quantity of rotations to be done.
8100 # @param theRadialStep Translation distance.
8101 # @param theNbTimes2 Quantity of translations to be done.
8102 # @param theName Object name; when specified, this parameter is used
8103 # for result publication in the study. Otherwise, if automatic
8104 # publication is switched on, default value is used for result name.
8106 # @return New GEOM.GEOM_Object, containing compound of all the
8107 # shapes, obtained after each transformation.
8109 # @ref tui_multi_rotation "Example"
8110 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8112 Rotate the given object around the
8113 given axis on the given angle a given number
8114 times and multi-translate each rotation result.
8115 Translation direction passes through center of gravity
8116 of rotated shape and its projection on the rotation axis.
8119 theObject The object to be rotated.
8120 theAxis Rotation axis. DZ if None.
8121 theNbTimes1 Quantity of rotations to be done.
8122 theRadialStep Translation distance.
8123 theNbTimes2 Quantity of translations to be done.
8124 theName Object name; when specified, this parameter is used
8125 for result publication in the study. Otherwise, if automatic
8126 publication is switched on, default value is used for result name.
8129 New GEOM.GEOM_Object, containing compound of all the
8130 shapes, obtained after each transformation.
8133 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8135 # Example: see GEOM_TestAll.py
8136 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8137 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8138 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8139 anObj.SetParameters(Parameters)
8140 self._autoPublish(anObj, theName, "multirotation")
8143 ## Rotate the given object around the
8144 # given axis on the given angle a given number
8145 # times and multi-translate each rotation result.
8146 # Translation direction passes through center of gravity
8147 # of rotated shape and its projection on the rotation axis.
8148 # @param theObject The object to be rotated.
8149 # @param theAxis Rotation axis. DZ if None.
8150 # @param theAngleStep Rotation angle in radians.
8151 # @param theNbTimes1 Quantity of rotations to be done.
8152 # @param theRadialStep Translation distance.
8153 # @param theNbTimes2 Quantity of translations to be done.
8154 # @param 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.
8158 # @return New GEOM.GEOM_Object, containing compound of all the
8159 # shapes, obtained after each transformation.
8161 # @ref tui_multi_rotation "Example"
8162 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8164 Rotate the given object around the
8165 given axis on the given angle a given number
8166 times and multi-translate each rotation result.
8167 Translation direction passes through center of gravity
8168 of rotated shape and its projection on the rotation axis.
8171 theObject The object to be rotated.
8172 theAxis Rotation axis. DZ if None.
8173 theAngleStep Rotation angle in radians.
8174 theNbTimes1 Quantity of rotations to be done.
8175 theRadialStep Translation distance.
8176 theNbTimes2 Quantity of translations to be done.
8177 theName Object name; when specified, this parameter is used
8178 for result publication in the study. Otherwise, if automatic
8179 publication is switched on, default value is used for result name.
8182 New GEOM.GEOM_Object, containing compound of all the
8183 shapes, obtained after each transformation.
8186 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8188 # Example: see GEOM_TestAll.py
8189 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8190 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8191 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8192 anObj.SetParameters(Parameters)
8193 self._autoPublish(anObj, theName, "multirotation")
8196 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8198 # @ref swig_MakeMultiRotation "Example"
8199 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8201 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8204 pz = geompy.MakeVertex(0, 0, 100)
8205 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8206 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8208 # Example: see GEOM_TestOthers.py
8209 aVec = self.MakeLine(aPoint,aDir)
8210 # note: auto-publishing is done in self.MultiRotate1D()
8211 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8214 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8216 # @ref swig_MakeMultiRotation "Example"
8217 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8219 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8222 pz = geompy.MakeVertex(0, 0, 100)
8223 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8224 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8226 # Example: see GEOM_TestOthers.py
8227 aVec = self.MakeLine(aPoint,aDir)
8228 # note: auto-publishing is done in self.MultiRotate1D()
8229 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8232 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8234 # @ref swig_MakeMultiRotation "Example"
8235 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8237 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8240 pz = geompy.MakeVertex(0, 0, 100)
8241 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8242 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8244 # Example: see GEOM_TestOthers.py
8245 aVec = self.MakeLine(aPoint,aDir)
8246 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8247 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8250 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8252 # @ref swig_MakeMultiRotation "Example"
8253 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8255 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8258 pz = geompy.MakeVertex(0, 0, 100)
8259 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8260 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8262 # Example: see GEOM_TestOthers.py
8263 aVec = self.MakeLine(aPoint,aDir)
8264 # note: auto-publishing is done in self.MultiRotate2D()
8265 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8268 # end of l3_transform
8271 ## @addtogroup l3_transform_d
8274 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8275 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8277 Deprecated method. Use MultiRotate1DNbTimes instead.
8279 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8280 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8282 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8283 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8284 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8286 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8287 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8290 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8292 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8293 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8294 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8295 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8296 anObj.SetParameters(Parameters)
8297 self._autoPublish(anObj, theName, "multirotation")
8300 ## The same, as MultiRotate1D(), but axis is given by direction and point
8301 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8302 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8304 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8305 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8308 pz = geompy.MakeVertex(0, 0, 100)
8309 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8310 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8312 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8313 aVec = self.MakeLine(aPoint,aDir)
8314 # note: auto-publishing is done in self.MultiRotate1D()
8315 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8318 ## The same, as MultiRotate2D(), but axis is given by direction and point
8319 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8320 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8322 The same, as MultiRotate2D(), but axis is given by direction and point
8323 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8326 pz = geompy.MakeVertex(0, 0, 100)
8327 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8328 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8330 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8331 aVec = self.MakeLine(aPoint,aDir)
8332 # note: auto-publishing is done in self.MultiRotate2D()
8333 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8336 # end of l3_transform_d
8339 ## @addtogroup l3_local
8342 ## Perform a fillet on all edges of the given shape.
8343 # @param theShape Shape, to perform fillet on.
8344 # @param theR Fillet radius.
8345 # @param theName Object name; when specified, this parameter is used
8346 # for result publication in the study. Otherwise, if automatic
8347 # publication is switched on, default value is used for result name.
8349 # @return New GEOM.GEOM_Object, containing the result shape.
8351 # @ref tui_fillet "Example 1"
8352 # \n @ref swig_MakeFilletAll "Example 2"
8353 def MakeFilletAll(self, theShape, theR, theName=None):
8355 Perform a fillet on all edges of the given shape.
8358 theShape Shape, to perform fillet on.
8360 theName Object name; when specified, this parameter is used
8361 for result publication in the study. Otherwise, if automatic
8362 publication is switched on, default value is used for result name.
8365 New GEOM.GEOM_Object, containing the result shape.
8368 filletall = geompy.MakeFilletAll(prism, 10.)
8370 # Example: see GEOM_TestOthers.py
8371 theR,Parameters = ParseParameters(theR)
8372 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8373 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8374 anObj.SetParameters(Parameters)
8375 self._autoPublish(anObj, theName, "fillet")
8378 ## Perform a fillet on the specified edges/faces of the given shape
8379 # @param theShape Shape, to perform fillet on.
8380 # @param theR Fillet radius.
8381 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8382 # @param theListShapes Global indices of edges/faces to perform fillet on.
8383 # @param theName Object name; when specified, this parameter is used
8384 # for result publication in the study. Otherwise, if automatic
8385 # publication is switched on, default value is used for result name.
8387 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8389 # @return New GEOM.GEOM_Object, containing the result shape.
8391 # @ref tui_fillet "Example"
8392 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8394 Perform a fillet on the specified edges/faces of the given shape
8397 theShape Shape, to perform fillet on.
8399 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8400 theListShapes Global indices of edges/faces to perform fillet on.
8401 theName Object name; when specified, this parameter is used
8402 for result publication in the study. Otherwise, if automatic
8403 publication is switched on, default value is used for result name.
8406 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8409 New GEOM.GEOM_Object, containing the result shape.
8412 # get the list of IDs (IDList) for the fillet
8413 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8415 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8416 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8417 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8418 # make a fillet on the specified edges of the given shape
8419 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8421 # Example: see GEOM_TestAll.py
8422 theR,Parameters = ParseParameters(theR)
8424 if theShapeType == self.ShapeType["EDGE"]:
8425 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8426 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8428 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8429 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8430 anObj.SetParameters(Parameters)
8431 self._autoPublish(anObj, theName, "fillet")
8434 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8435 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8437 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8440 # get the list of IDs (IDList) for the fillet
8441 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8443 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8444 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8445 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8446 # make a fillet on the specified edges of the given shape
8447 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8449 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8451 if theShapeType == self.ShapeType["EDGE"]:
8452 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8453 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8455 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8456 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8457 anObj.SetParameters(Parameters)
8458 self._autoPublish(anObj, theName, "fillet")
8461 ## Perform a fillet on the specified edges of the given shape
8462 # @param theShape Wire Shape to perform fillet on.
8463 # @param theR Fillet radius.
8464 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8465 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8466 # \note The list of vertices could be empty,
8467 # in this case fillet will done done at all vertices in wire
8468 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8469 # by the length of the edges, nearest to the fillet vertex.
8470 # But sometimes the next edge is C1 continuous with the one, nearest to
8471 # the fillet point, and such two (or more) edges can be united to allow
8472 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8473 # thus ignoring the secant vertex (vertices).
8474 # @param theName Object name; when specified, this parameter is used
8475 # for result publication in the study. Otherwise, if automatic
8476 # publication is switched on, default value is used for result name.
8478 # @return New GEOM.GEOM_Object, containing the result shape.
8480 # @ref tui_fillet2d "Example"
8481 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8483 Perform a fillet on the specified edges of the given shape
8486 theShape Wire Shape to perform fillet on.
8488 theListOfVertexes Global indices of vertexes to perform fillet on.
8489 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8490 by the length of the edges, nearest to the fillet vertex.
8491 But sometimes the next edge is C1 continuous with the one, nearest to
8492 the fillet point, and such two (or more) edges can be united to allow
8493 bigger radius. Set this flag to TRUE to allow collinear edges union,
8494 thus ignoring the secant vertex (vertices).
8495 theName Object name; when specified, this parameter is used
8496 for result publication in the study. Otherwise, if automatic
8497 publication is switched on, default value is used for result name.
8499 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8501 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8504 New GEOM.GEOM_Object, containing the result shape.
8508 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8509 # make fillet at given wire vertices with giver radius
8510 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8512 # Example: see GEOM_TestAll.py
8513 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8514 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8515 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8516 anObj.SetParameters(Parameters)
8517 self._autoPublish(anObj, theName, "fillet")
8520 ## Perform a fillet at the specified vertices of the given face/shell.
8521 # @param theShape Face or Shell shape to perform fillet on.
8522 # @param theR Fillet radius.
8523 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8524 # @param theName Object name; when specified, this parameter is used
8525 # for result publication in the study. Otherwise, if automatic
8526 # publication is switched on, default value is used for result name.
8528 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8530 # @return New GEOM.GEOM_Object, containing the result shape.
8532 # @ref tui_fillet2d "Example"
8533 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8535 Perform a fillet at the specified vertices of the given face/shell.
8538 theShape Face or Shell shape to perform fillet on.
8540 theListOfVertexes Global indices of vertexes to perform fillet on.
8541 theName Object name; when specified, this parameter is used
8542 for result publication in the study. Otherwise, if automatic
8543 publication is switched on, default value is used for result name.
8545 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8548 New GEOM.GEOM_Object, containing the result shape.
8551 face = geompy.MakeFaceHW(100, 100, 1)
8552 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8554 # Example: see GEOM_TestAll.py
8555 theR,Parameters = ParseParameters(theR)
8556 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8557 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8558 anObj.SetParameters(Parameters)
8559 self._autoPublish(anObj, theName, "fillet")
8562 ## Perform a symmetric chamfer on all edges of the given shape.
8563 # @param theShape Shape, to perform chamfer on.
8564 # @param theD Chamfer size along each face.
8565 # @param theName Object name; when specified, this parameter is used
8566 # for result publication in the study. Otherwise, if automatic
8567 # publication is switched on, default value is used for result name.
8569 # @return New GEOM.GEOM_Object, containing the result shape.
8571 # @ref tui_chamfer "Example 1"
8572 # \n @ref swig_MakeChamferAll "Example 2"
8573 def MakeChamferAll(self, theShape, theD, theName=None):
8575 Perform a symmetric chamfer on all edges of the given shape.
8578 theShape Shape, to perform chamfer on.
8579 theD Chamfer size along each face.
8580 theName Object name; when specified, this parameter is used
8581 for result publication in the study. Otherwise, if automatic
8582 publication is switched on, default value is used for result name.
8585 New GEOM.GEOM_Object, containing the result shape.
8588 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8590 # Example: see GEOM_TestOthers.py
8591 theD,Parameters = ParseParameters(theD)
8592 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8593 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8594 anObj.SetParameters(Parameters)
8595 self._autoPublish(anObj, theName, "chamfer")
8598 ## Perform a chamfer on edges, common to the specified faces,
8599 # with distance D1 on the Face1
8600 # @param theShape Shape, to perform chamfer on.
8601 # @param theD1 Chamfer size along \a theFace1.
8602 # @param theD2 Chamfer size along \a theFace2.
8603 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8604 # @param theName Object name; when specified, this parameter is used
8605 # for result publication in the study. Otherwise, if automatic
8606 # publication is switched on, default value is used for result name.
8608 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8610 # @return New GEOM.GEOM_Object, containing the result shape.
8612 # @ref tui_chamfer "Example"
8613 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8615 Perform a chamfer on edges, common to the specified faces,
8616 with distance D1 on the Face1
8619 theShape Shape, to perform chamfer on.
8620 theD1 Chamfer size along theFace1.
8621 theD2 Chamfer size along theFace2.
8622 theFace1,theFace2 Global indices of two faces of theShape.
8623 theName Object name; when specified, this parameter is used
8624 for result publication in the study. Otherwise, if automatic
8625 publication is switched on, default value is used for result name.
8628 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8631 New GEOM.GEOM_Object, containing the result shape.
8634 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8635 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8636 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8637 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8639 # Example: see GEOM_TestAll.py
8640 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8641 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8642 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8643 anObj.SetParameters(Parameters)
8644 self._autoPublish(anObj, theName, "chamfer")
8647 ## Perform a chamfer on edges
8648 # @param theShape Shape, to perform chamfer on.
8649 # @param theD Chamfer length
8650 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8651 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8652 # @param theName Object name; when specified, this parameter is used
8653 # for result publication in the study. Otherwise, if automatic
8654 # publication is switched on, default value is used for result name.
8656 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8658 # @return New GEOM.GEOM_Object, containing the result shape.
8659 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8661 Perform a chamfer on edges
8664 theShape Shape, to perform chamfer on.
8665 theD1 Chamfer size along theFace1.
8666 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8667 theFace1,theFace2 Global indices of two faces of theShape.
8668 theName Object name; when specified, this parameter is used
8669 for result publication in the study. Otherwise, if automatic
8670 publication is switched on, default value is used for result name.
8673 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8676 New GEOM.GEOM_Object, containing the result shape.
8679 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8680 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8681 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8683 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8686 if isinstance(theAngle,str):
8688 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8690 theAngle = theAngle*math.pi/180.0
8691 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8692 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8693 anObj.SetParameters(Parameters)
8694 self._autoPublish(anObj, theName, "chamfer")
8697 ## Perform a chamfer on all edges of the specified faces,
8698 # with distance D1 on the first specified face (if several for one edge)
8699 # @param theShape Shape, to perform chamfer on.
8700 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8701 # connected to the edge, are in \a theFaces, \a theD1
8702 # will be get along face, which is nearer to \a theFaces beginning.
8703 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8704 # @param theFaces Sequence of global indices of faces of \a theShape.
8705 # @param theName Object name; when specified, this parameter is used
8706 # for result publication in the study. Otherwise, if automatic
8707 # publication is switched on, default value is used for result name.
8709 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8711 # @return New GEOM.GEOM_Object, containing the result shape.
8713 # @ref tui_chamfer "Example"
8714 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8716 Perform a chamfer on all edges of the specified faces,
8717 with distance D1 on the first specified face (if several for one edge)
8720 theShape Shape, to perform chamfer on.
8721 theD1 Chamfer size along face from theFaces. If both faces,
8722 connected to the edge, are in theFaces, theD1
8723 will be get along face, which is nearer to theFaces beginning.
8724 theD2 Chamfer size along another of two faces, connected to the edge.
8725 theFaces Sequence of global indices of faces of theShape.
8726 theName Object name; when specified, this parameter is used
8727 for result publication in the study. Otherwise, if automatic
8728 publication is switched on, default value is used for result name.
8730 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8733 New GEOM.GEOM_Object, containing the result shape.
8735 # Example: see GEOM_TestAll.py
8736 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8737 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8738 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8739 anObj.SetParameters(Parameters)
8740 self._autoPublish(anObj, theName, "chamfer")
8743 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8744 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8746 # @ref swig_FilletChamfer "Example"
8747 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8749 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8750 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8753 if isinstance(theAngle,str):
8755 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8757 theAngle = theAngle*math.pi/180.0
8758 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8759 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8760 anObj.SetParameters(Parameters)
8761 self._autoPublish(anObj, theName, "chamfer")
8764 ## Perform a chamfer on edges,
8765 # with distance D1 on the first specified face (if several for one edge)
8766 # @param theShape Shape, to perform chamfer on.
8767 # @param theD1,theD2 Chamfer size
8768 # @param theEdges Sequence of edges of \a theShape.
8769 # @param theName Object name; when specified, this parameter is used
8770 # for result publication in the study. Otherwise, if automatic
8771 # publication is switched on, default value is used for result name.
8773 # @return New GEOM.GEOM_Object, containing the result shape.
8775 # @ref swig_FilletChamfer "Example"
8776 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8778 Perform a chamfer on edges,
8779 with distance D1 on the first specified face (if several for one edge)
8782 theShape Shape, to perform chamfer on.
8783 theD1,theD2 Chamfer size
8784 theEdges Sequence of edges of theShape.
8785 theName Object name; when specified, this parameter is used
8786 for result publication in the study. Otherwise, if automatic
8787 publication is switched on, default value is used for result name.
8790 New GEOM.GEOM_Object, containing the result shape.
8792 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8793 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8794 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8795 anObj.SetParameters(Parameters)
8796 self._autoPublish(anObj, theName, "chamfer")
8799 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8800 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8801 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8803 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8804 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8807 if isinstance(theAngle,str):
8809 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8811 theAngle = theAngle*math.pi/180.0
8812 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8813 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8814 anObj.SetParameters(Parameters)
8815 self._autoPublish(anObj, theName, "chamfer")
8818 ## @sa MakeChamferEdge(), MakeChamferFaces()
8820 # @ref swig_MakeChamfer "Example"
8821 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8823 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8825 # Example: see GEOM_TestOthers.py
8827 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8828 if aShapeType == self.ShapeType["EDGE"]:
8829 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8831 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8834 ## Remove material from a solid by extrusion of the base shape on the given distance.
8835 # @param theInit Shape to remove material from. It must be a solid or
8836 # a compound made of a single solid.
8837 # @param theBase Closed edge or wire defining the base shape to be extruded.
8838 # @param theH Prism dimension along the normal to theBase
8839 # @param theAngle Draft angle in degrees.
8840 # @param theName Object name; when specified, this parameter is used
8841 # for result publication in the study. Otherwise, if automatic
8842 # publication is switched on, default value is used for result name.
8844 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8846 # @ref tui_creation_prism "Example"
8847 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8849 Add material to a solid by extrusion of the base shape on the given distance.
8852 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8853 theBase Closed edge or wire defining the base shape to be extruded.
8854 theH Prism dimension along the normal to theBase
8855 theAngle Draft angle in degrees.
8856 theName Object name; when specified, this parameter is used
8857 for result publication in the study. Otherwise, if automatic
8858 publication is switched on, default value is used for result name.
8861 New GEOM.GEOM_Object, containing the initial shape with removed material.
8863 # Example: see GEOM_TestAll.py
8864 #theH,Parameters = ParseParameters(theH)
8865 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8866 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8867 #anObj.SetParameters(Parameters)
8868 self._autoPublish(anObj, theName, "extrudedCut")
8871 ## Add material to a solid by extrusion of the base shape on the given distance.
8872 # @param theInit Shape to add material to. It must be a solid or
8873 # a compound made of a single solid.
8874 # @param theBase Closed edge or wire defining the base shape to be extruded.
8875 # @param theH Prism dimension along the normal to theBase
8876 # @param theAngle Draft angle in degrees.
8877 # @param theName Object name; when specified, this parameter is used
8878 # for result publication in the study. Otherwise, if automatic
8879 # publication is switched on, default value is used for result name.
8881 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8883 # @ref tui_creation_prism "Example"
8884 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8886 Add material to a solid by extrusion of the base shape on the given distance.
8889 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8890 theBase Closed edge or wire defining the base shape to be extruded.
8891 theH Prism dimension along the normal to theBase
8892 theAngle Draft angle in degrees.
8893 theName Object name; when specified, this parameter is used
8894 for result publication in the study. Otherwise, if automatic
8895 publication is switched on, default value is used for result name.
8898 New GEOM.GEOM_Object, containing the initial shape with added material.
8900 # Example: see GEOM_TestAll.py
8901 #theH,Parameters = ParseParameters(theH)
8902 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8903 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8904 #anObj.SetParameters(Parameters)
8905 self._autoPublish(anObj, theName, "extrudedBoss")
8911 ## @addtogroup l3_basic_op
8914 ## Perform an Archimde operation on the given shape with given parameters.
8915 # The object presenting the resulting face is returned.
8916 # @param theShape Shape to be put in water.
8917 # @param theWeight Weight og the shape.
8918 # @param theWaterDensity Density of the water.
8919 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8920 # @param theName Object name; when specified, this parameter is used
8921 # for result publication in the study. Otherwise, if automatic
8922 # publication is switched on, default value is used for result name.
8924 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8925 # by a plane, corresponding to water level.
8927 # @ref tui_archimede "Example"
8928 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8930 Perform an Archimde operation on the given shape with given parameters.
8931 The object presenting the resulting face is returned.
8934 theShape Shape to be put in water.
8935 theWeight Weight og the shape.
8936 theWaterDensity Density of the water.
8937 theMeshDeflection Deflection of the mesh, using to compute the section.
8938 theName Object name; when specified, this parameter is used
8939 for result publication in the study. Otherwise, if automatic
8940 publication is switched on, default value is used for result name.
8943 New GEOM.GEOM_Object, containing a section of theShape
8944 by a plane, corresponding to water level.
8946 # Example: see GEOM_TestAll.py
8947 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8948 theWeight,theWaterDensity,theMeshDeflection)
8949 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8950 RaiseIfFailed("MakeArchimede", self.LocalOp)
8951 anObj.SetParameters(Parameters)
8952 self._autoPublish(anObj, theName, "archimede")
8955 # end of l3_basic_op
8958 ## @addtogroup l2_measure
8961 ## Get point coordinates
8964 # @ref tui_measurement_tools_page "Example"
8965 def PointCoordinates(self,Point):
8967 Get point coordinates
8972 # Example: see GEOM_TestMeasures.py
8973 aTuple = self.MeasuOp.PointCoordinates(Point)
8974 RaiseIfFailed("PointCoordinates", self.MeasuOp)
8977 ## Get vector coordinates
8980 # @ref tui_measurement_tools_page "Example"
8981 def VectorCoordinates(self,Vector):
8983 Get vector coordinates
8989 p1=self.GetFirstVertex(Vector)
8990 p2=self.GetLastVertex(Vector)
8992 X1=self.PointCoordinates(p1)
8993 X2=self.PointCoordinates(p2)
8995 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
8998 ## Compute cross product
8999 # @return vector w=u^v
9001 # @ref tui_measurement_tools_page "Example"
9002 def CrossProduct(self, Vector1, Vector2):
9004 Compute cross product
9006 Returns: vector w=u^v
9008 u=self.VectorCoordinates(Vector1)
9009 v=self.VectorCoordinates(Vector2)
9010 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])
9014 ## Compute cross product
9015 # @return dot product p=u.v
9017 # @ref tui_measurement_tools_page "Example"
9018 def DotProduct(self, Vector1, Vector2):
9020 Compute cross product
9022 Returns: dot product p=u.v
9024 u=self.VectorCoordinates(Vector1)
9025 v=self.VectorCoordinates(Vector2)
9026 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9031 ## Get summarized length of all wires,
9032 # area of surface and volume of the given shape.
9033 # @param theShape Shape to define properties of.
9034 # @return [theLength, theSurfArea, theVolume]\n
9035 # theLength: Summarized length of all wires of the given shape.\n
9036 # theSurfArea: Area of surface of the given shape.\n
9037 # theVolume: Volume of the given shape.
9039 # @ref tui_measurement_tools_page "Example"
9040 def BasicProperties(self,theShape):
9042 Get summarized length of all wires,
9043 area of surface and volume of the given shape.
9046 theShape Shape to define properties of.
9049 [theLength, theSurfArea, theVolume]
9050 theLength: Summarized length of all wires of the given shape.
9051 theSurfArea: Area of surface of the given shape.
9052 theVolume: Volume of the given shape.
9054 # Example: see GEOM_TestMeasures.py
9055 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9056 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9059 ## Get parameters of bounding box of the given shape
9060 # @param theShape Shape to obtain bounding box of.
9061 # @param precise TRUE for precise computation; FALSE for fast one.
9062 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9063 # Xmin,Xmax: Limits of shape along OX axis.
9064 # Ymin,Ymax: Limits of shape along OY axis.
9065 # Zmin,Zmax: Limits of shape along OZ axis.
9067 # @ref tui_measurement_tools_page "Example"
9068 def BoundingBox (self, theShape, precise=False):
9070 Get parameters of bounding box of the given shape
9073 theShape Shape to obtain bounding box of.
9074 precise TRUE for precise computation; FALSE for fast one.
9077 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9078 Xmin,Xmax: Limits of shape along OX axis.
9079 Ymin,Ymax: Limits of shape along OY axis.
9080 Zmin,Zmax: Limits of shape along OZ axis.
9082 # Example: see GEOM_TestMeasures.py
9083 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9084 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9087 ## Get bounding box of the given shape
9088 # @param theShape Shape to obtain bounding box of.
9089 # @param precise TRUE for precise computation; FALSE for fast one.
9090 # @param theName Object name; when specified, this parameter is used
9091 # for result publication in the study. Otherwise, if automatic
9092 # publication is switched on, default value is used for result name.
9094 # @return New GEOM.GEOM_Object, containing the created box.
9096 # @ref tui_measurement_tools_page "Example"
9097 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9099 Get bounding box of the given shape
9102 theShape Shape to obtain bounding box of.
9103 precise TRUE for precise computation; FALSE for fast one.
9104 theName Object name; when specified, this parameter is used
9105 for result publication in the study. Otherwise, if automatic
9106 publication is switched on, default value is used for result name.
9109 New GEOM.GEOM_Object, containing the created box.
9111 # Example: see GEOM_TestMeasures.py
9112 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9113 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9114 self._autoPublish(anObj, theName, "bndbox")
9117 ## Get inertia matrix and moments of inertia of theShape.
9118 # @param theShape Shape to calculate inertia of.
9119 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9120 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9121 # Ix,Iy,Iz: Moments of inertia of the given shape.
9123 # @ref tui_measurement_tools_page "Example"
9124 def Inertia(self,theShape):
9126 Get inertia matrix and moments of inertia of theShape.
9129 theShape Shape to calculate inertia of.
9132 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9133 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9134 Ix,Iy,Iz: Moments of inertia of the given shape.
9136 # Example: see GEOM_TestMeasures.py
9137 aTuple = self.MeasuOp.GetInertia(theShape)
9138 RaiseIfFailed("GetInertia", self.MeasuOp)
9141 ## Get if coords are included in the shape (ST_IN or ST_ON)
9142 # @param theShape Shape
9143 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9144 # @param tolerance to be used (default is 1.0e-7)
9145 # @return list_of_boolean = [res1, res2, ...]
9146 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9148 Get if coords are included in the shape (ST_IN or ST_ON)
9152 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9153 tolerance to be used (default is 1.0e-7)
9156 list_of_boolean = [res1, res2, ...]
9158 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9160 ## Get minimal distance between the given shapes.
9161 # @param theShape1,theShape2 Shapes to find minimal distance between.
9162 # @return Value of the minimal distance between the given shapes.
9164 # @ref tui_measurement_tools_page "Example"
9165 def MinDistance(self, theShape1, theShape2):
9167 Get minimal distance between the given shapes.
9170 theShape1,theShape2 Shapes to find minimal distance between.
9173 Value of the minimal distance between the given shapes.
9175 # Example: see GEOM_TestMeasures.py
9176 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9177 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9180 ## Get minimal distance between the given shapes.
9181 # @param theShape1,theShape2 Shapes to find minimal distance between.
9182 # @return Value of the minimal distance between the given shapes, in form of list
9183 # [Distance, DX, DY, DZ].
9185 # @ref swig_all_measure "Example"
9186 def MinDistanceComponents(self, theShape1, theShape2):
9188 Get minimal distance between the given shapes.
9191 theShape1,theShape2 Shapes to find minimal distance between.
9194 Value of the minimal distance between the given shapes, in form of list
9195 [Distance, DX, DY, DZ]
9197 # Example: see GEOM_TestMeasures.py
9198 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9199 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9200 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9203 ## Get closest points of the given shapes.
9204 # @param theShape1,theShape2 Shapes to find closest points of.
9205 # @return The number of found solutions (-1 in case of infinite number of
9206 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9208 # @ref tui_measurement_tools_page "Example"
9209 def ClosestPoints (self, theShape1, theShape2):
9211 Get closest points of the given shapes.
9214 theShape1,theShape2 Shapes to find closest points of.
9217 The number of found solutions (-1 in case of infinite number of
9218 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9220 # Example: see GEOM_TestMeasures.py
9221 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9222 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9225 ## Get angle between the given shapes in degrees.
9226 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9227 # @note If both arguments are vectors, the angle is computed in accordance
9228 # with their orientations, otherwise the minimum angle is computed.
9229 # @return Value of the angle between the given shapes in degrees.
9231 # @ref tui_measurement_tools_page "Example"
9232 def GetAngle(self, theShape1, theShape2):
9234 Get angle between the given shapes in degrees.
9237 theShape1,theShape2 Lines or linear edges to find angle between.
9240 If both arguments are vectors, the angle is computed in accordance
9241 with their orientations, otherwise the minimum angle is computed.
9244 Value of the angle between the given shapes in degrees.
9246 # Example: see GEOM_TestMeasures.py
9247 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9248 RaiseIfFailed("GetAngle", self.MeasuOp)
9251 ## Get angle between the given shapes in radians.
9252 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9253 # @note If both arguments are vectors, the angle is computed in accordance
9254 # with their orientations, otherwise the minimum angle is computed.
9255 # @return Value of the angle between the given shapes in radians.
9257 # @ref tui_measurement_tools_page "Example"
9258 def GetAngleRadians(self, theShape1, theShape2):
9260 Get angle between the given shapes in radians.
9263 theShape1,theShape2 Lines or linear edges to find angle between.
9267 If both arguments are vectors, the angle is computed in accordance
9268 with their orientations, otherwise the minimum angle is computed.
9271 Value of the angle between the given shapes in radians.
9273 # Example: see GEOM_TestMeasures.py
9274 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9275 RaiseIfFailed("GetAngle", self.MeasuOp)
9278 ## Get angle between the given vectors in degrees.
9279 # @param theShape1,theShape2 Vectors to find angle between.
9280 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9281 # if False, the opposite vector to the normal vector is used.
9282 # @return Value of the angle between the given vectors in degrees.
9284 # @ref tui_measurement_tools_page "Example"
9285 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9287 Get angle between the given vectors in degrees.
9290 theShape1,theShape2 Vectors to find angle between.
9291 theFlag If True, the normal vector is defined by the two vectors cross,
9292 if False, the opposite vector to the normal vector is used.
9295 Value of the angle between the given vectors in degrees.
9297 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9299 anAngle = 360. - anAngle
9300 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9303 ## The same as GetAngleVectors, but the result is in radians.
9304 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9306 Get angle between the given vectors in radians.
9309 theShape1,theShape2 Vectors to find angle between.
9310 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.
9314 Value of the angle between the given vectors in radians.
9316 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9319 ## @name Curve Curvature Measurement
9320 # Methods for receiving radius of curvature of curves
9321 # in the given point
9324 ## Measure curvature of a curve at a point, set by parameter.
9325 # @param theCurve a curve.
9326 # @param theParam parameter.
9327 # @return radius of curvature of \a theCurve.
9329 # @ref swig_todo "Example"
9330 def CurveCurvatureByParam(self, theCurve, theParam):
9332 Measure curvature of a curve at a point, set by parameter.
9339 radius of curvature of theCurve.
9341 # Example: see GEOM_TestMeasures.py
9342 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9343 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9346 ## Measure curvature of a curve at a point.
9347 # @param theCurve a curve.
9348 # @param thePoint given point.
9349 # @return radius of curvature of \a theCurve.
9351 # @ref swig_todo "Example"
9352 def CurveCurvatureByPoint(self, theCurve, thePoint):
9354 Measure curvature of a curve at a point.
9358 thePoint given point.
9361 radius of curvature of theCurve.
9363 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9364 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9368 ## @name Surface Curvature Measurement
9369 # Methods for receiving max and min radius of curvature of surfaces
9370 # in the given point
9373 ## Measure max radius of curvature of surface.
9374 # @param theSurf the given surface.
9375 # @param theUParam Value of U-parameter on the referenced surface.
9376 # @param theVParam Value of V-parameter on the referenced surface.
9377 # @return max radius of curvature of theSurf.
9379 ## @ref swig_todo "Example"
9380 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9382 Measure max radius of curvature of surface.
9385 theSurf the given surface.
9386 theUParam Value of U-parameter on the referenced surface.
9387 theVParam Value of V-parameter on the referenced surface.
9390 max radius of curvature of theSurf.
9392 # Example: see GEOM_TestMeasures.py
9393 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9394 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9397 ## Measure max radius of curvature of surface in the given point
9398 # @param theSurf the given surface.
9399 # @param thePoint given point.
9400 # @return max radius of curvature of theSurf.
9402 ## @ref swig_todo "Example"
9403 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9405 Measure max radius of curvature of surface in the given point.
9408 theSurf the given surface.
9409 thePoint given point.
9412 max radius of curvature of theSurf.
9414 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9415 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9418 ## Measure min radius of curvature of surface.
9419 # @param theSurf the given surface.
9420 # @param theUParam Value of U-parameter on the referenced surface.
9421 # @param theVParam Value of V-parameter on the referenced surface.
9422 # @return min radius of curvature of theSurf.
9424 ## @ref swig_todo "Example"
9425 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9427 Measure min radius of curvature of surface.
9430 theSurf the given surface.
9431 theUParam Value of U-parameter on the referenced surface.
9432 theVParam Value of V-parameter on the referenced surface.
9435 Min radius of curvature of theSurf.
9437 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9438 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9441 ## Measure min radius of curvature of surface in the given point
9442 # @param theSurf the given surface.
9443 # @param thePoint given point.
9444 # @return min radius of curvature of theSurf.
9446 ## @ref swig_todo "Example"
9447 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9449 Measure min radius of curvature of surface in the given point.
9452 theSurf the given surface.
9453 thePoint given point.
9456 Min radius of curvature of theSurf.
9458 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9459 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9463 ## Get min and max tolerances of sub-shapes of theShape
9464 # @param theShape Shape, to get tolerances of.
9465 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9466 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9467 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9468 # VertMin,VertMax: Min and max tolerances of the vertices.
9470 # @ref tui_measurement_tools_page "Example"
9471 def Tolerance(self,theShape):
9473 Get min and max tolerances of sub-shapes of theShape
9476 theShape Shape, to get tolerances of.
9479 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9480 FaceMin,FaceMax: Min and max tolerances of the faces.
9481 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9482 VertMin,VertMax: Min and max tolerances of the vertices.
9484 # Example: see GEOM_TestMeasures.py
9485 aTuple = self.MeasuOp.GetTolerance(theShape)
9486 RaiseIfFailed("GetTolerance", self.MeasuOp)
9489 ## Obtain description of the given shape (number of sub-shapes of each type)
9490 # @param theShape Shape to be described.
9491 # @return Description of the given shape.
9493 # @ref tui_measurement_tools_page "Example"
9494 def WhatIs(self,theShape):
9496 Obtain description of the given shape (number of sub-shapes of each type)
9499 theShape Shape to be described.
9502 Description of the given shape.
9504 # Example: see GEOM_TestMeasures.py
9505 aDescr = self.MeasuOp.WhatIs(theShape)
9506 RaiseIfFailed("WhatIs", self.MeasuOp)
9509 ## Obtain quantity of shapes of the given type in \a theShape.
9510 # If \a theShape is of type \a theType, it is also counted.
9511 # @param theShape Shape to be described.
9512 # @param theType the given ShapeType().
9513 # @return Quantity of shapes of type \a theType in \a theShape.
9515 # @ref tui_measurement_tools_page "Example"
9516 def NbShapes (self, theShape, theType):
9518 Obtain quantity of shapes of the given type in theShape.
9519 If theShape is of type theType, it is also counted.
9522 theShape Shape to be described.
9523 theType the given geompy.ShapeType
9526 Quantity of shapes of type theType in theShape.
9528 # Example: see GEOM_TestMeasures.py
9529 listSh = self.SubShapeAllIDs(theShape, theType)
9531 t = EnumToLong(theShape.GetShapeType())
9532 theType = EnumToLong(theType)
9538 ## Obtain quantity of shapes of each type in \a theShape.
9539 # The \a theShape is also counted.
9540 # @param theShape Shape to be described.
9541 # @return Dictionary of ShapeType() with bound quantities of shapes.
9543 # @ref tui_measurement_tools_page "Example"
9544 def ShapeInfo (self, theShape):
9546 Obtain quantity of shapes of each type in theShape.
9547 The theShape is also counted.
9550 theShape Shape to be described.
9553 Dictionary of geompy.ShapeType with bound quantities of shapes.
9555 # Example: see GEOM_TestMeasures.py
9557 for typeSh in self.ShapeType:
9558 if typeSh in ( "AUTO", "SHAPE" ): continue
9559 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9561 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9568 ## Get a point, situated at the centre of mass of theShape.
9569 # @param theShape Shape to define centre of mass of.
9570 # @param theName Object name; when specified, this parameter is used
9571 # for result publication in the study. Otherwise, if automatic
9572 # publication is switched on, default value is used for result name.
9574 # @return New GEOM.GEOM_Object, containing the created point.
9576 # @ref tui_measurement_tools_page "Example"
9577 def MakeCDG(self, theShape, theName=None):
9579 Get a point, situated at the centre of mass of theShape.
9582 theShape Shape to define centre of mass of.
9583 theName Object name; when specified, this parameter is used
9584 for result publication in the study. Otherwise, if automatic
9585 publication is switched on, default value is used for result name.
9588 New GEOM.GEOM_Object, containing the created point.
9590 # Example: see GEOM_TestMeasures.py
9591 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9592 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9593 self._autoPublish(anObj, theName, "centerOfMass")
9596 ## Get a vertex sub-shape by index depended with orientation.
9597 # @param theShape Shape to find sub-shape.
9598 # @param theIndex Index to find vertex by this index (starting from zero)
9599 # @param theName Object name; when specified, this parameter is used
9600 # for result publication in the study. Otherwise, if automatic
9601 # publication is switched on, default value is used for result name.
9603 # @return New GEOM.GEOM_Object, containing the created vertex.
9605 # @ref tui_measurement_tools_page "Example"
9606 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9608 Get a vertex sub-shape by index depended with orientation.
9611 theShape Shape to find sub-shape.
9612 theIndex Index to find vertex by this index (starting from zero)
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 vertex.
9620 # Example: see GEOM_TestMeasures.py
9621 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9622 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9623 self._autoPublish(anObj, theName, "vertex")
9626 ## Get the first vertex of wire/edge depended orientation.
9627 # @param theShape Shape to find first vertex.
9628 # @param theName Object name; when specified, this parameter is used
9629 # for result publication in the study. Otherwise, if automatic
9630 # publication is switched on, default value is used for result name.
9632 # @return New GEOM.GEOM_Object, containing the created vertex.
9634 # @ref tui_measurement_tools_page "Example"
9635 def GetFirstVertex(self, theShape, theName=None):
9637 Get the first vertex of wire/edge depended orientation.
9640 theShape Shape to find first vertex.
9641 theName Object name; when specified, this parameter is used
9642 for result publication in the study. Otherwise, if automatic
9643 publication is switched on, default value is used for result name.
9646 New GEOM.GEOM_Object, containing the created vertex.
9648 # Example: see GEOM_TestMeasures.py
9649 # note: auto-publishing is done in self.GetVertexByIndex()
9650 anObj = self.GetVertexByIndex(theShape, 0, theName)
9651 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9654 ## Get the last vertex of wire/edge depended orientation.
9655 # @param theShape Shape to find last vertex.
9656 # @param theName Object name; when specified, this parameter is used
9657 # for result publication in the study. Otherwise, if automatic
9658 # publication is switched on, default value is used for result name.
9660 # @return New GEOM.GEOM_Object, containing the created vertex.
9662 # @ref tui_measurement_tools_page "Example"
9663 def GetLastVertex(self, theShape, theName=None):
9665 Get the last vertex of wire/edge depended orientation.
9668 theShape Shape to find last vertex.
9669 theName Object name; when specified, this parameter is used
9670 for result publication in the study. Otherwise, if automatic
9671 publication is switched on, default value is used for result name.
9674 New GEOM.GEOM_Object, containing the created vertex.
9676 # Example: see GEOM_TestMeasures.py
9677 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9678 # note: auto-publishing is done in self.GetVertexByIndex()
9679 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9680 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9683 ## Get a normale to the given face. If the point is not given,
9684 # the normale is calculated at the center of mass.
9685 # @param theFace Face to define normale of.
9686 # @param theOptionalPoint Point to compute the normale at.
9687 # @param theName Object name; when specified, this parameter is used
9688 # for result publication in the study. Otherwise, if automatic
9689 # publication is switched on, default value is used for result name.
9691 # @return New GEOM.GEOM_Object, containing the created vector.
9693 # @ref swig_todo "Example"
9694 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9696 Get a normale to the given face. If the point is not given,
9697 the normale is calculated at the center of mass.
9700 theFace Face to define normale of.
9701 theOptionalPoint Point to compute the normale at.
9702 theName Object name; when specified, this parameter is used
9703 for result publication in the study. Otherwise, if automatic
9704 publication is switched on, default value is used for result name.
9707 New GEOM.GEOM_Object, containing the created vector.
9709 # Example: see GEOM_TestMeasures.py
9710 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9711 RaiseIfFailed("GetNormal", self.MeasuOp)
9712 self._autoPublish(anObj, theName, "normal")
9715 ## Check a topology of the given shape.
9716 # @param theShape Shape to check validity of.
9717 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9718 # if TRUE, the shape's geometry will be checked also.
9719 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9720 # of problem is printed.
9721 # if TRUE and if theShape is invalid, the description
9722 # of problem is also returned.
9723 # @return TRUE, if the shape "seems to be valid".
9725 # @ref tui_measurement_tools_page "Example"
9726 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9728 Check a topology of the given shape.
9731 theShape Shape to check validity of.
9732 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9733 if TRUE, the shape's geometry will be checked also.
9734 theReturnStatus If FALSE and if theShape is invalid, a description
9735 of problem is printed.
9736 if TRUE and if theShape is invalid, the description
9737 of problem is returned.
9740 TRUE, if the shape "seems to be valid".
9741 If theShape is invalid, prints a description of problem.
9742 This description can also be returned.
9744 # Example: see GEOM_TestMeasures.py
9746 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9747 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9749 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9750 RaiseIfFailed("CheckShape", self.MeasuOp)
9752 if theReturnStatus == 0:
9754 if theReturnStatus == 1:
9755 return (IsValid, Status)
9758 ## Detect self-intersections in the given shape.
9759 # @param theShape Shape to check.
9760 # @return TRUE, if the shape contains no self-intersections.
9762 # @ref tui_measurement_tools_page "Example"
9763 def CheckSelfIntersections(self, theShape):
9765 Detect self-intersections in the given shape.
9768 theShape Shape to check.
9771 TRUE, if the shape contains no self-intersections.
9773 # Example: see GEOM_TestMeasures.py
9774 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9775 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9778 ## Get position (LCS) of theShape.
9780 # Origin of the LCS is situated at the shape's center of mass.
9781 # Axes of the LCS are obtained from shape's location or,
9782 # if the shape is a planar face, from position of its plane.
9784 # @param theShape Shape to calculate position of.
9785 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9786 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9787 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9788 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9790 # @ref swig_todo "Example"
9791 def GetPosition(self,theShape):
9793 Get position (LCS) of theShape.
9794 Origin of the LCS is situated at the shape's center of mass.
9795 Axes of the LCS are obtained from shape's location or,
9796 if the shape is a planar face, from position of its plane.
9799 theShape Shape to calculate position of.
9802 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9803 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9804 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9805 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9807 # Example: see GEOM_TestMeasures.py
9808 aTuple = self.MeasuOp.GetPosition(theShape)
9809 RaiseIfFailed("GetPosition", self.MeasuOp)
9812 ## Get kind of theShape.
9814 # @param theShape Shape to get a kind of.
9815 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9816 # and a list of parameters, describing the shape.
9817 # @note Concrete meaning of each value, returned via \a theIntegers
9818 # or \a theDoubles list depends on the kind() of the shape.
9820 # @ref swig_todo "Example"
9821 def KindOfShape(self,theShape):
9823 Get kind of theShape.
9826 theShape Shape to get a kind of.
9829 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9830 and a list of parameters, describing the shape.
9832 Concrete meaning of each value, returned via theIntegers
9833 or theDoubles list depends on the geompy.kind of the shape
9835 # Example: see GEOM_TestMeasures.py
9836 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9837 RaiseIfFailed("KindOfShape", self.MeasuOp)
9839 aKind = aRoughTuple[0]
9840 anInts = aRoughTuple[1]
9841 aDbls = aRoughTuple[2]
9843 # Now there is no exception from this rule:
9844 aKindTuple = [aKind] + aDbls + anInts
9846 # If they are we will regroup parameters for such kind of shape.
9848 #if aKind == kind.SOME_KIND:
9849 # # SOME_KIND int int double int double double
9850 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9857 ## @addtogroup l2_import_export
9860 ## Import a shape from the BREP or IGES or STEP file
9861 # (depends on given format) with given name.
9862 # @param theFileName The file, containing the shape.
9863 # @param theFormatName Specify format for the file reading.
9864 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9865 # If format 'IGES_SCALE' is used instead of 'IGES' or
9866 # format 'STEP_SCALE' is used instead of 'STEP',
9867 # length unit will be set to 'meter' and result model will be scaled.
9868 # @param theName Object name; when specified, this parameter is used
9869 # for result publication in the study. Otherwise, if automatic
9870 # publication is switched on, default value is used for result name.
9872 # @return New GEOM.GEOM_Object, containing the imported shape.
9874 # @ref swig_Import_Export "Example"
9875 def ImportFile(self, theFileName, theFormatName, theName=None):
9877 Import a shape from the BREP or IGES or STEP file
9878 (depends on given format) with given name.
9881 theFileName The file, containing the shape.
9882 theFormatName Specify format for the file reading.
9883 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9884 If format 'IGES_SCALE' is used instead of 'IGES' or
9885 format 'STEP_SCALE' is used instead of 'STEP',
9886 length unit will be set to 'meter' and result model will be scaled.
9887 theName Object name; when specified, this parameter is used
9888 for result publication in the study. Otherwise, if automatic
9889 publication is switched on, default value is used for result name.
9892 New GEOM.GEOM_Object, containing the imported shape.
9894 # Example: see GEOM_TestOthers.py
9895 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9896 RaiseIfFailed("ImportFile", self.InsertOp)
9897 self._autoPublish(anObj, theName, "imported")
9900 ## Deprecated analog of ImportFile()
9901 def Import(self, theFileName, theFormatName, theName=None):
9903 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9905 print "WARNING: Function Import is deprecated, use ImportFile instead"
9906 # note: auto-publishing is done in self.ImportFile()
9907 return self.ImportFile(theFileName, theFormatName, theName)
9909 ## Shortcut to ImportFile() for BREP format.
9910 # Import a shape from the BREP file with given name.
9911 # @param theFileName The file, containing the shape.
9912 # @param theName Object name; when specified, this parameter is used
9913 # for result publication in the study. Otherwise, if automatic
9914 # publication is switched on, default value is used for result name.
9916 # @return New GEOM.GEOM_Object, containing the imported shape.
9918 # @ref swig_Import_Export "Example"
9919 def ImportBREP(self, theFileName, theName=None):
9921 geompy.ImportFile(...) function for BREP format
9922 Import a shape from the BREP file with given name.
9925 theFileName The file, containing the shape.
9926 theName Object name; when specified, this parameter is used
9927 for result publication in the study. Otherwise, if automatic
9928 publication is switched on, default value is used for result name.
9931 New GEOM.GEOM_Object, containing the imported shape.
9933 # Example: see GEOM_TestOthers.py
9934 # note: auto-publishing is done in self.ImportFile()
9935 return self.ImportFile(theFileName, "BREP", theName)
9937 ## Shortcut to ImportFile() for IGES format
9938 # Import a shape from the IGES file with given name.
9939 # @param theFileName The file, containing the shape.
9940 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9941 # and result model will be scaled, if its units are not meters.
9942 # If False (default), file length units will be taken into account.
9943 # @param theName Object name; when specified, this parameter is used
9944 # for result publication in the study. Otherwise, if automatic
9945 # publication is switched on, default value is used for result name.
9947 # @return New GEOM.GEOM_Object, containing the imported shape.
9949 # @ref swig_Import_Export "Example"
9950 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9952 geompy.ImportFile(...) function for IGES format
9955 theFileName The file, containing the shape.
9956 ignoreUnits If True, file length units will be ignored (set to 'meter')
9957 and result model will be scaled, if its units are not meters.
9958 If False (default), file length units will be taken into account.
9959 theName Object name; when specified, this parameter is used
9960 for result publication in the study. Otherwise, if automatic
9961 publication is switched on, default value is used for result name.
9964 New GEOM.GEOM_Object, containing the imported shape.
9966 # Example: see GEOM_TestOthers.py
9967 # note: auto-publishing is done in self.ImportFile()
9969 return self.ImportFile(theFileName, "IGES_SCALE", theName)
9970 return self.ImportFile(theFileName, "IGES", theName)
9972 ## Return length unit from given IGES file
9973 # @param theFileName The file, containing the shape.
9974 # @return String, containing the units name.
9976 # @ref swig_Import_Export "Example"
9977 def GetIGESUnit(self, theFileName):
9979 Return length units from given IGES file
9982 theFileName The file, containing the shape.
9985 String, containing the units name.
9987 # Example: see GEOM_TestOthers.py
9988 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
9991 ## Shortcut to ImportFile() for STEP format
9992 # Import a shape from the STEP file with given name.
9993 # @param theFileName The file, containing the shape.
9994 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9995 # and result model will be scaled, if its units are not meters.
9996 # If False (default), file length units will be taken into account.
9997 # @param theName Object name; when specified, this parameter is used
9998 # for result publication in the study. Otherwise, if automatic
9999 # publication is switched on, default value is used for result name.
10001 # @return New GEOM.GEOM_Object, containing the imported shape.
10003 # @ref swig_Import_Export "Example"
10004 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10006 geompy.ImportFile(...) function for STEP format
10009 theFileName The file, containing the shape.
10010 ignoreUnits If True, file length units will be ignored (set to 'meter')
10011 and result model will be scaled, if its units are not meters.
10012 If False (default), file length units will be taken into account.
10013 theName Object name; when specified, this parameter is used
10014 for result publication in the study. Otherwise, if automatic
10015 publication is switched on, default value is used for result name.
10018 New GEOM.GEOM_Object, containing the imported shape.
10020 # Example: see GEOM_TestOthers.py
10021 # note: auto-publishing is done in self.ImportFile()
10023 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10024 return self.ImportFile(theFileName, "STEP", theName)
10026 ## Return length unit from given IGES or STEP file
10027 # @param theFileName The file, containing the shape.
10028 # @return String, containing the units name.
10030 # @ref swig_Import_Export "Example"
10031 def GetSTEPUnit(self, theFileName):
10033 Return length units from given STEP file
10036 theFileName The file, containing the shape.
10039 String, containing the units name.
10041 # Example: see GEOM_TestOthers.py
10042 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10045 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10046 # @note This method will not be dumped to the python script by DumpStudy functionality.
10047 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10048 # @param theStream The BRep binary stream.
10049 # @param theName Object name; when specified, this parameter is used
10050 # for result publication in the study. Otherwise, if automatic
10051 # publication is switched on, default value is used for result name.
10053 # @return New GEOM_Object, containing the shape, read from theStream.
10055 # @ref swig_Import_Export "Example"
10056 def RestoreShape (self, theStream, theName=None):
10058 Read a shape from the binary stream, containing its bounding representation (BRep).
10061 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10064 theStream The BRep binary stream.
10065 theName Object name; when specified, this parameter is used
10066 for result publication in the study. Otherwise, if automatic
10067 publication is switched on, default value is used for result name.
10070 New GEOM_Object, containing the shape, read from theStream.
10072 # Example: see GEOM_TestOthers.py
10073 anObj = self.InsertOp.RestoreShape(theStream)
10074 RaiseIfFailed("RestoreShape", self.InsertOp)
10075 self._autoPublish(anObj, theName, "restored")
10078 ## Export the given shape into a file with given name.
10079 # @param theObject Shape to be stored in the file.
10080 # @param theFileName Name of the file to store the given shape in.
10081 # @param theFormatName Specify format for the shape storage.
10082 # Available formats can be obtained with
10083 # geompy.InsertOp.ExportTranslators()[0] method.
10085 # @ref swig_Import_Export "Example"
10086 def Export(self, theObject, theFileName, theFormatName):
10088 Export the given shape into a file with given name.
10091 theObject Shape to be stored in the file.
10092 theFileName Name of the file to store the given shape in.
10093 theFormatName Specify format for the shape storage.
10094 Available formats can be obtained with
10095 geompy.InsertOp.ExportTranslators()[0] method.
10097 # Example: see GEOM_TestOthers.py
10098 self.InsertOp.Export(theObject, theFileName, theFormatName)
10099 if self.InsertOp.IsDone() == 0:
10100 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10104 ## Shortcut to Export() for BREP format
10106 # @ref swig_Import_Export "Example"
10107 def ExportBREP(self,theObject, theFileName):
10109 geompy.Export(...) function for BREP format
10111 # Example: see GEOM_TestOthers.py
10112 return self.Export(theObject, theFileName, "BREP")
10114 ## Shortcut to Export() for IGES format
10116 # @ref swig_Import_Export "Example"
10117 def ExportIGES(self,theObject, theFileName):
10119 geompy.Export(...) function for IGES format
10121 # Example: see GEOM_TestOthers.py
10122 return self.Export(theObject, theFileName, "IGES")
10124 ## Shortcut to Export() for STEP format
10126 # @ref swig_Import_Export "Example"
10127 def ExportSTEP(self,theObject, theFileName):
10129 geompy.Export(...) function for STEP format
10131 # Example: see GEOM_TestOthers.py
10132 return self.Export(theObject, theFileName, "STEP")
10134 # end of l2_import_export
10137 ## @addtogroup l3_blocks
10140 ## Create a quadrangle face from four edges. Order of Edges is not
10141 # important. It is not necessary that edges share the same vertex.
10142 # @param E1,E2,E3,E4 Edges for the face bound.
10143 # @param theName Object name; when specified, this parameter is used
10144 # for result publication in the study. Otherwise, if automatic
10145 # publication is switched on, default value is used for result name.
10147 # @return New GEOM.GEOM_Object, containing the created face.
10149 # @ref tui_building_by_blocks_page "Example"
10150 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10152 Create a quadrangle face from four edges. Order of Edges is not
10153 important. It is not necessary that edges share the same vertex.
10156 E1,E2,E3,E4 Edges for the face bound.
10157 theName Object name; when specified, this parameter is used
10158 for result publication in the study. Otherwise, if automatic
10159 publication is switched on, default value is used for result name.
10162 New GEOM.GEOM_Object, containing the created face.
10165 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10167 # Example: see GEOM_Spanner.py
10168 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10169 RaiseIfFailed("MakeQuad", self.BlocksOp)
10170 self._autoPublish(anObj, theName, "quad")
10173 ## Create a quadrangle face on two edges.
10174 # The missing edges will be built by creating the shortest ones.
10175 # @param E1,E2 Two opposite edges for the face.
10176 # @param theName Object name; when specified, this parameter is used
10177 # for result publication in the study. Otherwise, if automatic
10178 # publication is switched on, default value is used for result name.
10180 # @return New GEOM.GEOM_Object, containing the created face.
10182 # @ref tui_building_by_blocks_page "Example"
10183 def MakeQuad2Edges(self, E1, E2, theName=None):
10185 Create a quadrangle face on two edges.
10186 The missing edges will be built by creating the shortest ones.
10189 E1,E2 Two opposite edges for the face.
10190 theName Object name; when specified, this parameter is used
10191 for result publication in the study. Otherwise, if automatic
10192 publication is switched on, default value is used for result name.
10195 New GEOM.GEOM_Object, containing the created face.
10199 p1 = geompy.MakeVertex( 0., 0., 0.)
10200 p2 = geompy.MakeVertex(150., 30., 0.)
10201 p3 = geompy.MakeVertex( 0., 120., 50.)
10202 p4 = geompy.MakeVertex( 0., 40., 70.)
10204 edge1 = geompy.MakeEdge(p1, p2)
10205 edge2 = geompy.MakeEdge(p3, p4)
10206 # create a quadrangle face from two edges
10207 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10209 # Example: see GEOM_Spanner.py
10210 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10211 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10212 self._autoPublish(anObj, theName, "quad")
10215 ## Create a quadrangle face with specified corners.
10216 # The missing edges will be built by creating the shortest ones.
10217 # @param V1,V2,V3,V4 Corner vertices for the face.
10218 # @param theName Object name; when specified, this parameter is used
10219 # for result publication in the study. Otherwise, if automatic
10220 # publication is switched on, default value is used for result name.
10222 # @return New GEOM.GEOM_Object, containing the created face.
10224 # @ref tui_building_by_blocks_page "Example 1"
10225 # \n @ref swig_MakeQuad4Vertices "Example 2"
10226 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10228 Create a quadrangle face with specified corners.
10229 The missing edges will be built by creating the shortest ones.
10232 V1,V2,V3,V4 Corner vertices for the face.
10233 theName Object name; when specified, this parameter is used
10234 for result publication in the study. Otherwise, if automatic
10235 publication is switched on, default value is used for result name.
10238 New GEOM.GEOM_Object, containing the created face.
10242 p1 = geompy.MakeVertex( 0., 0., 0.)
10243 p2 = geompy.MakeVertex(150., 30., 0.)
10244 p3 = geompy.MakeVertex( 0., 120., 50.)
10245 p4 = geompy.MakeVertex( 0., 40., 70.)
10246 # create a quadrangle from four points in its corners
10247 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10249 # Example: see GEOM_Spanner.py
10250 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10251 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10252 self._autoPublish(anObj, theName, "quad")
10255 ## Create a hexahedral solid, bounded by the six given faces. Order of
10256 # faces is not important. It is not necessary that Faces share the same edge.
10257 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10258 # @param theName Object name; when specified, this parameter is used
10259 # for result publication in the study. Otherwise, if automatic
10260 # publication is switched on, default value is used for result name.
10262 # @return New GEOM.GEOM_Object, containing the created solid.
10264 # @ref tui_building_by_blocks_page "Example 1"
10265 # \n @ref swig_MakeHexa "Example 2"
10266 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10268 Create a hexahedral solid, bounded by the six given faces. Order of
10269 faces is not important. It is not necessary that Faces share the same edge.
10272 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10273 theName Object name; when specified, this parameter is used
10274 for result publication in the study. Otherwise, if automatic
10275 publication is switched on, default value is used for result name.
10278 New GEOM.GEOM_Object, containing the created solid.
10281 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10283 # Example: see GEOM_Spanner.py
10284 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10285 RaiseIfFailed("MakeHexa", self.BlocksOp)
10286 self._autoPublish(anObj, theName, "hexa")
10289 ## Create a hexahedral solid between two given faces.
10290 # The missing faces will be built by creating the smallest ones.
10291 # @param F1,F2 Two opposite faces for the hexahedral solid.
10292 # @param theName Object name; when specified, this parameter is used
10293 # for result publication in the study. Otherwise, if automatic
10294 # publication is switched on, default value is used for result name.
10296 # @return New GEOM.GEOM_Object, containing the created solid.
10298 # @ref tui_building_by_blocks_page "Example 1"
10299 # \n @ref swig_MakeHexa2Faces "Example 2"
10300 def MakeHexa2Faces(self, F1, F2, theName=None):
10302 Create a hexahedral solid between two given faces.
10303 The missing faces will be built by creating the smallest ones.
10306 F1,F2 Two opposite faces for the hexahedral solid.
10307 theName Object name; when specified, this parameter is used
10308 for result publication in the study. Otherwise, if automatic
10309 publication is switched on, default value is used for result name.
10312 New GEOM.GEOM_Object, containing the created solid.
10315 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10317 # Example: see GEOM_Spanner.py
10318 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10319 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10320 self._autoPublish(anObj, theName, "hexa")
10326 ## @addtogroup l3_blocks_op
10329 ## Get a vertex, found in the given shape by its coordinates.
10330 # @param theShape Block or a compound of blocks.
10331 # @param theX,theY,theZ Coordinates of the sought vertex.
10332 # @param theEpsilon Maximum allowed distance between the resulting
10333 # vertex and point with the given coordinates.
10334 # @param theName Object name; when specified, this parameter is used
10335 # for result publication in the study. Otherwise, if automatic
10336 # publication is switched on, default value is used for result name.
10338 # @return New GEOM.GEOM_Object, containing the found vertex.
10340 # @ref swig_GetPoint "Example"
10341 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10343 Get a vertex, found in the given shape by its coordinates.
10346 theShape Block or a compound of blocks.
10347 theX,theY,theZ Coordinates of the sought vertex.
10348 theEpsilon Maximum allowed distance between the resulting
10349 vertex and point with the given coordinates.
10350 theName Object name; when specified, this parameter is used
10351 for result publication in the study. Otherwise, if automatic
10352 publication is switched on, default value is used for result name.
10355 New GEOM.GEOM_Object, containing the found vertex.
10358 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10360 # Example: see GEOM_TestOthers.py
10361 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10362 RaiseIfFailed("GetPoint", self.BlocksOp)
10363 self._autoPublish(anObj, theName, "vertex")
10366 ## Find a vertex of the given shape, which has minimal distance to the given point.
10367 # @param theShape Any shape.
10368 # @param thePoint Point, close to the desired vertex.
10369 # @param theName Object name; when specified, this parameter is used
10370 # for result publication in the study. Otherwise, if automatic
10371 # publication is switched on, default value is used for result name.
10373 # @return New GEOM.GEOM_Object, containing the found vertex.
10375 # @ref swig_GetVertexNearPoint "Example"
10376 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10378 Find a vertex of the given shape, which has minimal distance to the given point.
10381 theShape Any shape.
10382 thePoint Point, close to the desired vertex.
10383 theName Object name; when specified, this parameter is used
10384 for result publication in the study. Otherwise, if automatic
10385 publication is switched on, default value is used for result name.
10388 New GEOM.GEOM_Object, containing the found vertex.
10391 pmidle = geompy.MakeVertex(50, 0, 50)
10392 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10394 # Example: see GEOM_TestOthers.py
10395 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10396 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10397 self._autoPublish(anObj, theName, "vertex")
10400 ## Get an edge, found in the given shape by two given vertices.
10401 # @param theShape Block or a compound of blocks.
10402 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10403 # @param theName Object name; when specified, this parameter is used
10404 # for result publication in the study. Otherwise, if automatic
10405 # publication is switched on, default value is used for result name.
10407 # @return New GEOM.GEOM_Object, containing the found edge.
10409 # @ref swig_GetEdge "Example"
10410 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10412 Get an edge, found in the given shape by two given vertices.
10415 theShape Block or a compound of blocks.
10416 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10417 theName Object name; when specified, this parameter is used
10418 for result publication in the study. Otherwise, if automatic
10419 publication is switched on, default value is used for result name.
10422 New GEOM.GEOM_Object, containing the found edge.
10424 # Example: see GEOM_Spanner.py
10425 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10426 RaiseIfFailed("GetEdge", self.BlocksOp)
10427 self._autoPublish(anObj, theName, "edge")
10430 ## Find an edge of the given shape, which has minimal distance to the given point.
10431 # @param theShape Block or a compound of blocks.
10432 # @param thePoint Point, close to 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_GetEdgeNearPoint "Example"
10440 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10442 Find an edge of the given shape, which has minimal distance to the given point.
10445 theShape Block or a compound of blocks.
10446 thePoint Point, close to 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_TestOthers.py
10455 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10456 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10457 self._autoPublish(anObj, theName, "edge")
10460 ## Returns a face, found in the given shape by four given corner vertices.
10461 # @param theShape Block or a compound of blocks.
10462 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
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 face.
10469 # @ref swig_todo "Example"
10470 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10472 Returns a face, found in the given shape by four given corner vertices.
10475 theShape Block or a compound of blocks.
10476 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
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 face.
10484 # Example: see GEOM_Spanner.py
10485 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10486 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10487 self._autoPublish(anObj, theName, "face")
10490 ## Get a face of block, found in the given shape by two given edges.
10491 # @param theShape Block or a compound of blocks.
10492 # @param theEdge1,theEdge2 Edges, close to the edges 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 GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10502 Get a face of block, found in the given shape by two given edges.
10505 theShape Block or a compound of blocks.
10506 theEdge1,theEdge2 Edges, close to the edges 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.GetFaceByEdges(theShape, theEdge1, theEdge2)
10516 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10517 self._autoPublish(anObj, theName, "face")
10520 ## Find a face, opposite to the given one in the given block.
10521 # @param theBlock Must be a hexahedral solid.
10522 # @param theFace Face of \a theBlock, opposite to 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_GetOppositeFace "Example"
10530 def GetOppositeFace(self, theBlock, theFace, theName=None):
10532 Find a face, opposite to the given one in the given block.
10535 theBlock Must be a hexahedral solid.
10536 theFace Face of theBlock, opposite to 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.GetOppositeFace(theBlock, theFace)
10546 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10547 self._autoPublish(anObj, theName, "face")
10550 ## Find a face of the given shape, which has minimal distance to the given point.
10551 # @param theShape Block or a compound of blocks.
10552 # @param thePoint Point, close 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_GetFaceNearPoint "Example"
10560 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10562 Find a face of the given shape, which has minimal distance to the given point.
10565 theShape Block or a compound of blocks.
10566 thePoint Point, close 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.GetFaceNearPoint(theShape, thePoint)
10576 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10577 self._autoPublish(anObj, theName, "face")
10580 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10581 # @param theBlock Block or a compound of blocks.
10582 # @param theVector Vector, close to the normale of 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_todo "Example"
10590 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10592 Find a face of block, whose outside normale has minimal angle with the given vector.
10595 theBlock Block or a compound of blocks.
10596 theVector Vector, close to the normale of 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.GetFaceByNormale(theBlock, theVector)
10606 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10607 self._autoPublish(anObj, theName, "face")
10610 ## Find all sub-shapes of type \a theShapeType of the given shape,
10611 # which have minimal distance to the given point.
10612 # @param theShape Any shape.
10613 # @param thePoint Point, close to the desired shape.
10614 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10615 # @param theTolerance The tolerance for distances comparison. All shapes
10616 # with distances to the given point in interval
10617 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10618 # @param theName Object name; when specified, this parameter is used
10619 # for result publication in the study. Otherwise, if automatic
10620 # publication is switched on, default value is used for result name.
10622 # @return New GEOM_Object, containing a group of all found shapes.
10624 # @ref swig_GetShapesNearPoint "Example"
10625 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10627 Find all sub-shapes of type theShapeType of the given shape,
10628 which have minimal distance to the given point.
10631 theShape Any shape.
10632 thePoint Point, close to the desired shape.
10633 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10634 theTolerance The tolerance for distances comparison. All shapes
10635 with distances to the given point in interval
10636 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10637 theName Object name; when specified, this parameter is used
10638 for result publication in the study. Otherwise, if automatic
10639 publication is switched on, default value is used for result name.
10642 New GEOM_Object, containing a group of all found shapes.
10644 # Example: see GEOM_TestOthers.py
10645 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10646 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10647 self._autoPublish(anObj, theName, "group")
10650 # end of l3_blocks_op
10653 ## @addtogroup l4_blocks_measure
10656 ## Check, if the compound of blocks is given.
10657 # To be considered as a compound of blocks, the
10658 # given shape must satisfy the following conditions:
10659 # - Each element of the compound should be a Block (6 faces and 12 edges).
10660 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10661 # - The compound should be connexe.
10662 # - The glue between two quadrangle faces should be applied.
10663 # @param theCompound The compound to check.
10664 # @return TRUE, if the given shape is a compound of blocks.
10665 # If theCompound is not valid, prints all discovered errors.
10667 # @ref tui_measurement_tools_page "Example 1"
10668 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10669 def CheckCompoundOfBlocks(self,theCompound):
10671 Check, if the compound of blocks is given.
10672 To be considered as a compound of blocks, the
10673 given shape must satisfy the following conditions:
10674 - Each element of the compound should be a Block (6 faces and 12 edges).
10675 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10676 - The compound should be connexe.
10677 - The glue between two quadrangle faces should be applied.
10680 theCompound The compound to check.
10683 TRUE, if the given shape is a compound of blocks.
10684 If theCompound is not valid, prints all discovered errors.
10686 # Example: see GEOM_Spanner.py
10687 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10688 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10690 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10694 ## Retrieve all non blocks solids and faces from \a theShape.
10695 # @param theShape The shape to explore.
10696 # @param theName Object name; when specified, this parameter is used
10697 # for result publication in the study. Otherwise, if automatic
10698 # publication is switched on, default value is used for result name.
10700 # @return A tuple of two GEOM_Objects. The first object is a group of all
10701 # non block solids (= not 6 faces, or with 6 faces, but with the
10702 # presence of non-quadrangular faces). The second object is a
10703 # group of all non quadrangular faces.
10705 # @ref tui_measurement_tools_page "Example 1"
10706 # \n @ref swig_GetNonBlocks "Example 2"
10707 def GetNonBlocks (self, theShape, theName=None):
10709 Retrieve all non blocks solids and faces from theShape.
10712 theShape The shape to explore.
10713 theName Object name; when specified, this parameter is used
10714 for result publication in the study. Otherwise, if automatic
10715 publication is switched on, default value is used for result name.
10718 A tuple of two GEOM_Objects. The first object is a group of all
10719 non block solids (= not 6 faces, or with 6 faces, but with the
10720 presence of non-quadrangular faces). The second object is a
10721 group of all non quadrangular faces.
10724 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10726 # Example: see GEOM_Spanner.py
10727 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10728 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10729 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10732 ## Remove all seam and degenerated edges from \a theShape.
10733 # Unite faces and edges, sharing one surface. It means that
10734 # this faces must have references to one C++ surface object (handle).
10735 # @param theShape The compound or single solid to remove irregular edges from.
10736 # @param doUnionFaces If True, then unite faces. If False (the default value),
10737 # do not unite faces.
10738 # @param theName Object name; when specified, this parameter is used
10739 # for result publication in the study. Otherwise, if automatic
10740 # publication is switched on, default value is used for result name.
10742 # @return Improved shape.
10744 # @ref swig_RemoveExtraEdges "Example"
10745 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10747 Remove all seam and degenerated edges from theShape.
10748 Unite faces and edges, sharing one surface. It means that
10749 this faces must have references to one C++ surface object (handle).
10752 theShape The compound or single solid to remove irregular edges from.
10753 doUnionFaces If True, then unite faces. If False (the default value),
10754 do not unite faces.
10755 theName Object name; when specified, this parameter is used
10756 for result publication in the study. Otherwise, if automatic
10757 publication is switched on, default value is used for result name.
10762 # Example: see GEOM_TestOthers.py
10763 nbFacesOptimum = -1 # -1 means do not unite faces
10764 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10765 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10766 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10767 self._autoPublish(anObj, theName, "removeExtraEdges")
10770 ## Performs union faces of \a theShape
10771 # Unite faces sharing one surface. It means that
10772 # these faces must have references to one C++ surface object (handle).
10773 # @param theShape The compound or single solid that contains faces
10774 # to perform union.
10775 # @param theName Object name; when specified, this parameter is used
10776 # for result publication in the study. Otherwise, if automatic
10777 # publication is switched on, default value is used for result name.
10779 # @return Improved shape.
10781 # @ref swig_UnionFaces "Example"
10782 def UnionFaces(self, theShape, theName=None):
10784 Performs union faces of theShape.
10785 Unite faces sharing one surface. It means that
10786 these faces must have references to one C++ surface object (handle).
10789 theShape The compound or single solid that contains faces
10791 theName Object name; when specified, this parameter is used
10792 for result publication in the study. Otherwise, if automatic
10793 publication is switched on, default value is used for result name.
10798 # Example: see GEOM_TestOthers.py
10799 anObj = self.BlocksOp.UnionFaces(theShape)
10800 RaiseIfFailed("UnionFaces", self.BlocksOp)
10801 self._autoPublish(anObj, theName, "unionFaces")
10804 ## Check, if the given shape is a blocks compound.
10805 # Fix all detected errors.
10806 # \note Single block can be also fixed by this method.
10807 # @param theShape The compound to check and improve.
10808 # @param theName Object name; when specified, this parameter is used
10809 # for result publication in the study. Otherwise, if automatic
10810 # publication is switched on, default value is used for result name.
10812 # @return Improved compound.
10814 # @ref swig_CheckAndImprove "Example"
10815 def CheckAndImprove(self, theShape, theName=None):
10817 Check, if the given shape is a blocks compound.
10818 Fix all detected errors.
10821 Single block can be also fixed by this method.
10824 theShape The compound to check and improve.
10825 theName Object name; when specified, this parameter is used
10826 for result publication in the study. Otherwise, if automatic
10827 publication is switched on, default value is used for result name.
10832 # Example: see GEOM_TestOthers.py
10833 anObj = self.BlocksOp.CheckAndImprove(theShape)
10834 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10835 self._autoPublish(anObj, theName, "improved")
10838 # end of l4_blocks_measure
10841 ## @addtogroup l3_blocks_op
10844 ## Get all the blocks, contained in the given compound.
10845 # @param theCompound The compound to explode.
10846 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10847 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10848 # @param theName Object name; when specified, this parameter is used
10849 # for result publication in the study. Otherwise, if automatic
10850 # publication is switched on, default value is used for result name.
10852 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10854 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10856 # @ref tui_explode_on_blocks "Example 1"
10857 # \n @ref swig_MakeBlockExplode "Example 2"
10858 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10860 Get all the blocks, contained in the given compound.
10863 theCompound The compound to explode.
10864 theMinNbFaces If solid has lower number of faces, it is not a block.
10865 theMaxNbFaces If solid has higher number of faces, it is not a block.
10866 theName Object name; when specified, this parameter is used
10867 for result publication in the study. Otherwise, if automatic
10868 publication is switched on, default value is used for result name.
10871 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10874 List of GEOM.GEOM_Object, containing the retrieved blocks.
10876 # Example: see GEOM_TestOthers.py
10877 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10878 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10879 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10880 for anObj in aList:
10881 anObj.SetParameters(Parameters)
10883 self._autoPublish(aList, theName, "block")
10886 ## Find block, containing the given point inside its volume or on boundary.
10887 # @param theCompound Compound, to find block in.
10888 # @param thePoint Point, close to the desired block. If the point lays on
10889 # boundary between some blocks, we return block with nearest center.
10890 # @param theName Object name; when specified, this parameter is used
10891 # for result publication in the study. Otherwise, if automatic
10892 # publication is switched on, default value is used for result name.
10894 # @return New GEOM.GEOM_Object, containing the found block.
10896 # @ref swig_todo "Example"
10897 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10899 Find block, containing the given point inside its volume or on boundary.
10902 theCompound Compound, to find block in.
10903 thePoint Point, close to the desired block. If the point lays on
10904 boundary between some blocks, we return block with nearest center.
10905 theName Object name; when specified, this parameter is used
10906 for result publication in the study. Otherwise, if automatic
10907 publication is switched on, default value is used for result name.
10910 New GEOM.GEOM_Object, containing the found block.
10912 # Example: see GEOM_Spanner.py
10913 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10914 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10915 self._autoPublish(anObj, theName, "block")
10918 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10919 # @param theCompound Compound, to find block in.
10920 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10921 # @param theName Object name; when specified, this parameter is used
10922 # for result publication in the study. Otherwise, if automatic
10923 # publication is switched on, default value is used for result name.
10925 # @return New GEOM.GEOM_Object, containing the found block.
10927 # @ref swig_GetBlockByParts "Example"
10928 def GetBlockByParts(self, theCompound, theParts, theName=None):
10930 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10933 theCompound Compound, to find block in.
10934 theParts List of faces and/or edges and/or vertices to be parts of the found block.
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_Object, containing the found block.
10942 # Example: see GEOM_TestOthers.py
10943 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10944 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10945 self._autoPublish(anObj, theName, "block")
10948 ## Return all blocks, containing all the elements, passed as the parts.
10949 # @param theCompound Compound, to find blocks in.
10950 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
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 List of GEOM.GEOM_Object, containing the found blocks.
10957 # @ref swig_todo "Example"
10958 def GetBlocksByParts(self, theCompound, theParts, theName=None):
10960 Return all blocks, containing all the elements, passed as the parts.
10963 theCompound Compound, to find blocks in.
10964 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
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 List of GEOM.GEOM_Object, containing the found blocks.
10972 # Example: see GEOM_Spanner.py
10973 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
10974 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
10975 self._autoPublish(aList, theName, "block")
10978 ## Multi-transformate block and glue the result.
10979 # Transformation is defined so, as to superpose direction faces.
10980 # @param Block Hexahedral solid to be multi-transformed.
10981 # @param DirFace1 ID of First direction face.
10982 # @param DirFace2 ID of Second direction face.
10983 # @param NbTimes Quantity of transformations to be done.
10984 # @param theName Object name; when specified, this parameter is used
10985 # for result publication in the study. Otherwise, if automatic
10986 # publication is switched on, default value is used for result name.
10988 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10990 # @return New GEOM.GEOM_Object, containing the result shape.
10992 # @ref tui_multi_transformation "Example"
10993 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
10995 Multi-transformate block and glue the result.
10996 Transformation is defined so, as to superpose direction faces.
10999 Block Hexahedral solid to be multi-transformed.
11000 DirFace1 ID of First direction face.
11001 DirFace2 ID of Second direction face.
11002 NbTimes Quantity of transformations to be done.
11003 theName Object name; when specified, this parameter is used
11004 for result publication in the study. Otherwise, if automatic
11005 publication is switched on, default value is used for result name.
11008 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11011 New GEOM.GEOM_Object, containing the result shape.
11013 # Example: see GEOM_Spanner.py
11014 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11015 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11016 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11017 anObj.SetParameters(Parameters)
11018 self._autoPublish(anObj, theName, "transformed")
11021 ## Multi-transformate block and glue the result.
11022 # @param Block Hexahedral solid to be multi-transformed.
11023 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11024 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11025 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11026 # @param theName Object name; when specified, this parameter is used
11027 # for result publication in the study. Otherwise, if automatic
11028 # publication is switched on, default value is used for result name.
11030 # @return New GEOM.GEOM_Object, containing the result shape.
11032 # @ref tui_multi_transformation "Example"
11033 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11034 DirFace1V, DirFace2V, NbTimesV, theName=None):
11036 Multi-transformate block and glue the result.
11039 Block Hexahedral solid to be multi-transformed.
11040 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11041 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11042 NbTimesU,NbTimesV Quantity of transformations to be done.
11043 theName Object name; when specified, this parameter is used
11044 for result publication in the study. Otherwise, if automatic
11045 publication is switched on, default value is used for result name.
11048 New GEOM.GEOM_Object, containing the result shape.
11050 # Example: see GEOM_Spanner.py
11051 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11052 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11053 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11054 DirFace1V, DirFace2V, NbTimesV)
11055 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11056 anObj.SetParameters(Parameters)
11057 self._autoPublish(anObj, theName, "transformed")
11060 ## Build all possible propagation groups.
11061 # Propagation group is a set of all edges, opposite to one (main)
11062 # edge of this group directly or through other opposite edges.
11063 # Notion of Opposite Edge make sence only on quadrangle face.
11064 # @param theShape Shape to build propagation groups on.
11065 # @param theName Object name; when specified, this parameter is used
11066 # for result publication in the study. Otherwise, if automatic
11067 # publication is switched on, default value is used for result name.
11069 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11071 # @ref swig_Propagate "Example"
11072 def Propagate(self, theShape, theName=None):
11074 Build all possible propagation groups.
11075 Propagation group is a set of all edges, opposite to one (main)
11076 edge of this group directly or through other opposite edges.
11077 Notion of Opposite Edge make sence only on quadrangle face.
11080 theShape Shape to build propagation groups on.
11081 theName Object name; when specified, this parameter is used
11082 for result publication in the study. Otherwise, if automatic
11083 publication is switched on, default value is used for result name.
11086 List of GEOM.GEOM_Object, each of them is a propagation group.
11088 # Example: see GEOM_TestOthers.py
11089 listChains = self.BlocksOp.Propagate(theShape)
11090 RaiseIfFailed("Propagate", self.BlocksOp)
11091 self._autoPublish(listChains, theName, "propagate")
11094 # end of l3_blocks_op
11097 ## @addtogroup l3_groups
11100 ## Creates a new group which will store sub-shapes of theMainShape
11101 # @param theMainShape is a GEOM object on which the group is selected
11102 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11103 # @param theName Object name; when specified, this parameter is used
11104 # for result publication in the study. Otherwise, if automatic
11105 # publication is switched on, default value is used for result name.
11107 # @return a newly created GEOM group (GEOM.GEOM_Object)
11109 # @ref tui_working_with_groups_page "Example 1"
11110 # \n @ref swig_CreateGroup "Example 2"
11111 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11113 Creates a new group which will store sub-shapes of theMainShape
11116 theMainShape is a GEOM object on which the group is selected
11117 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11118 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11119 theName Object name; when specified, this parameter is used
11120 for result publication in the study. Otherwise, if automatic
11121 publication is switched on, default value is used for result name.
11124 a newly created GEOM group
11127 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11130 # Example: see GEOM_TestOthers.py
11131 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11132 RaiseIfFailed("CreateGroup", self.GroupOp)
11133 self._autoPublish(anObj, theName, "group")
11136 ## Adds a sub-object with ID theSubShapeId to the group
11137 # @param theGroup is a GEOM group to which the new sub-shape is added
11138 # @param theSubShapeID is a sub-shape ID in the main object.
11139 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11141 # @ref tui_working_with_groups_page "Example"
11142 def AddObject(self,theGroup, theSubShapeID):
11144 Adds a sub-object with ID theSubShapeId to the group
11147 theGroup is a GEOM group to which the new sub-shape is added
11148 theSubShapeID is a sub-shape ID in the main object.
11151 Use method GetSubShapeID() to get an unique ID of the sub-shape
11153 # Example: see GEOM_TestOthers.py
11154 self.GroupOp.AddObject(theGroup, theSubShapeID)
11155 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11156 RaiseIfFailed("AddObject", self.GroupOp)
11160 ## Removes a sub-object with ID \a theSubShapeId from the group
11161 # @param theGroup is a GEOM group from which the new sub-shape is removed
11162 # @param theSubShapeID is a sub-shape ID in the main object.
11163 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11165 # @ref tui_working_with_groups_page "Example"
11166 def RemoveObject(self,theGroup, theSubShapeID):
11168 Removes a sub-object with ID theSubShapeId from the group
11171 theGroup is a GEOM group from which the new sub-shape is removed
11172 theSubShapeID is a sub-shape ID in the main object.
11175 Use method GetSubShapeID() to get an unique ID of the sub-shape
11177 # Example: see GEOM_TestOthers.py
11178 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11179 RaiseIfFailed("RemoveObject", self.GroupOp)
11182 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11183 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11184 # @param theSubShapes is a list of sub-shapes to be added.
11186 # @ref tui_working_with_groups_page "Example"
11187 def UnionList (self,theGroup, theSubShapes):
11189 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11192 theGroup is a GEOM group to which the new sub-shapes are added.
11193 theSubShapes is a list of sub-shapes to be added.
11195 # Example: see GEOM_TestOthers.py
11196 self.GroupOp.UnionList(theGroup, theSubShapes)
11197 RaiseIfFailed("UnionList", self.GroupOp)
11200 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11201 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11202 # @param theSubShapes is a list of indices of sub-shapes to be added.
11204 # @ref swig_UnionIDs "Example"
11205 def UnionIDs(self,theGroup, theSubShapes):
11207 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11210 theGroup is a GEOM group to which the new sub-shapes are added.
11211 theSubShapes is a list of indices of sub-shapes to be added.
11213 # Example: see GEOM_TestOthers.py
11214 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11215 RaiseIfFailed("UnionIDs", self.GroupOp)
11218 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11219 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11220 # @param theSubShapes is a list of sub-shapes to be removed.
11222 # @ref tui_working_with_groups_page "Example"
11223 def DifferenceList (self,theGroup, theSubShapes):
11225 Removes from the group all the given shapes. No errors, if some shapes are not included.
11228 theGroup is a GEOM group from which the sub-shapes are removed.
11229 theSubShapes is a list of sub-shapes to be removed.
11231 # Example: see GEOM_TestOthers.py
11232 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11233 RaiseIfFailed("DifferenceList", self.GroupOp)
11236 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11237 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11238 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11240 # @ref swig_DifferenceIDs "Example"
11241 def DifferenceIDs(self,theGroup, theSubShapes):
11243 Removes from the group all the given shapes. No errors, if some shapes are not included.
11246 theGroup is a GEOM group from which the sub-shapes are removed.
11247 theSubShapes is a list of indices of sub-shapes to be removed.
11249 # Example: see GEOM_TestOthers.py
11250 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11251 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11254 ## Union of two groups.
11255 # New group is created. It will contain all entities
11256 # which are present in groups theGroup1 and theGroup2.
11257 # @param theGroup1, theGroup2 are the initial GEOM groups
11258 # to create the united group from.
11259 # @param theName Object name; when specified, this parameter is used
11260 # for result publication in the study. Otherwise, if automatic
11261 # publication is switched on, default value is used for result name.
11263 # @return a newly created GEOM group.
11265 # @ref tui_union_groups_anchor "Example"
11266 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11268 Union of two groups.
11269 New group is created. It will contain all entities
11270 which are present in groups theGroup1 and theGroup2.
11273 theGroup1, theGroup2 are the initial GEOM groups
11274 to create the united group from.
11275 theName Object name; when specified, this parameter is used
11276 for result publication in the study. Otherwise, if automatic
11277 publication is switched on, default value is used for result name.
11280 a newly created GEOM group.
11282 # Example: see GEOM_TestOthers.py
11283 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11284 RaiseIfFailed("UnionGroups", self.GroupOp)
11285 self._autoPublish(aGroup, theName, "group")
11288 ## Intersection of two groups.
11289 # New group is created. It will contain only those entities
11290 # which are present in both groups theGroup1 and theGroup2.
11291 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11292 # @param theName Object name; when specified, this parameter is used
11293 # for result publication in the study. Otherwise, if automatic
11294 # publication is switched on, default value is used for result name.
11296 # @return a newly created GEOM group.
11298 # @ref tui_intersect_groups_anchor "Example"
11299 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11301 Intersection of two groups.
11302 New group is created. It will contain only those entities
11303 which are present in both groups theGroup1 and theGroup2.
11306 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11307 theName Object name; when specified, this parameter is used
11308 for result publication in the study. Otherwise, if automatic
11309 publication is switched on, default value is used for result name.
11312 a newly created GEOM group.
11314 # Example: see GEOM_TestOthers.py
11315 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11316 RaiseIfFailed("IntersectGroups", self.GroupOp)
11317 self._autoPublish(aGroup, theName, "group")
11320 ## Cut of two groups.
11321 # New group is created. It will contain entities which are
11322 # present in group theGroup1 but are not present in group theGroup2.
11323 # @param theGroup1 is a GEOM group to include elements of.
11324 # @param theGroup2 is a GEOM group to exclude elements of.
11325 # @param theName Object name; when specified, this parameter is used
11326 # for result publication in the study. Otherwise, if automatic
11327 # publication is switched on, default value is used for result name.
11329 # @return a newly created GEOM group.
11331 # @ref tui_cut_groups_anchor "Example"
11332 def CutGroups (self, theGroup1, theGroup2, theName=None):
11335 New group is created. It will contain entities which are
11336 present in group theGroup1 but are not present in group theGroup2.
11339 theGroup1 is a GEOM group to include elements of.
11340 theGroup2 is a GEOM group to exclude elements of.
11341 theName Object name; when specified, this parameter is used
11342 for result publication in the study. Otherwise, if automatic
11343 publication is switched on, default value is used for result name.
11346 a newly created GEOM group.
11348 # Example: see GEOM_TestOthers.py
11349 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11350 RaiseIfFailed("CutGroups", self.GroupOp)
11351 self._autoPublish(aGroup, theName, "group")
11354 ## Union of list of groups.
11355 # New group is created. It will contain all entities that are
11356 # present in groups listed in theGList.
11357 # @param theGList is a list of GEOM groups to create the united group from.
11358 # @param theName Object name; when specified, this parameter is used
11359 # for result publication in the study. Otherwise, if automatic
11360 # publication is switched on, default value is used for result name.
11362 # @return a newly created GEOM group.
11364 # @ref tui_union_groups_anchor "Example"
11365 def UnionListOfGroups (self, theGList, theName=None):
11367 Union of list of groups.
11368 New group is created. It will contain all entities that are
11369 present in groups listed in theGList.
11372 theGList is a list of GEOM groups to create the united group from.
11373 theName Object name; when specified, this parameter is used
11374 for result publication in the study. Otherwise, if automatic
11375 publication is switched on, default value is used for result name.
11378 a newly created GEOM group.
11380 # Example: see GEOM_TestOthers.py
11381 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11382 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11383 self._autoPublish(aGroup, theName, "group")
11386 ## Cut of lists of groups.
11387 # New group is created. It will contain only entities
11388 # which are present in groups listed in theGList1 but
11389 # are not present in groups from theGList2.
11390 # @param theGList1 is a list of GEOM groups to include elements of.
11391 # @param theGList2 is a list of GEOM groups to exclude elements of.
11392 # @param theName Object name; when specified, this parameter is used
11393 # for result publication in the study. Otherwise, if automatic
11394 # publication is switched on, default value is used for result name.
11396 # @return a newly created GEOM group.
11398 # @ref tui_intersect_groups_anchor "Example"
11399 def IntersectListOfGroups (self, theGList, theName=None):
11401 Cut of lists of groups.
11402 New group is created. It will contain only entities
11403 which are present in groups listed in theGList1 but
11404 are not present in groups from theGList2.
11407 theGList1 is a list of GEOM groups to include elements of.
11408 theGList2 is a list of GEOM groups to exclude elements of.
11409 theName Object name; when specified, this parameter is used
11410 for result publication in the study. Otherwise, if automatic
11411 publication is switched on, default value is used for result name.
11414 a newly created GEOM group.
11416 # Example: see GEOM_TestOthers.py
11417 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11418 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11419 self._autoPublish(aGroup, theName, "group")
11422 ## Cut of lists of groups.
11423 # New group is created. It will contain only entities
11424 # which are present in groups listed in theGList1 but
11425 # are not present in groups from theGList2.
11426 # @param theGList1 is a list of GEOM groups to include elements of.
11427 # @param theGList2 is a list of GEOM groups to exclude elements of.
11428 # @param theName Object name; when specified, this parameter is used
11429 # for result publication in the study. Otherwise, if automatic
11430 # publication is switched on, default value is used for result name.
11432 # @return a newly created GEOM group.
11434 # @ref tui_cut_groups_anchor "Example"
11435 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11437 Cut of lists of groups.
11438 New group is created. It will contain only entities
11439 which are present in groups listed in theGList1 but
11440 are not present in groups from theGList2.
11443 theGList1 is a list of GEOM groups to include elements of.
11444 theGList2 is a list of GEOM groups to exclude elements of.
11445 theName Object name; when specified, this parameter is used
11446 for result publication in the study. Otherwise, if automatic
11447 publication is switched on, default value is used for result name.
11450 a newly created GEOM group.
11452 # Example: see GEOM_TestOthers.py
11453 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11454 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11455 self._autoPublish(aGroup, theName, "group")
11458 ## Returns a list of sub-objects ID stored in the group
11459 # @param theGroup is a GEOM group for which a list of IDs is requested
11461 # @ref swig_GetObjectIDs "Example"
11462 def GetObjectIDs(self,theGroup):
11464 Returns a list of sub-objects ID stored in the group
11467 theGroup is a GEOM group for which a list of IDs is requested
11469 # Example: see GEOM_TestOthers.py
11470 ListIDs = self.GroupOp.GetObjects(theGroup)
11471 RaiseIfFailed("GetObjects", self.GroupOp)
11474 ## Returns a type of sub-objects stored in the group
11475 # @param theGroup is a GEOM group which type is returned.
11477 # @ref swig_GetType "Example"
11478 def GetType(self,theGroup):
11480 Returns a type of sub-objects stored in the group
11483 theGroup is a GEOM group which type is returned.
11485 # Example: see GEOM_TestOthers.py
11486 aType = self.GroupOp.GetType(theGroup)
11487 RaiseIfFailed("GetType", self.GroupOp)
11490 ## Convert a type of geom object from id to string value
11491 # @param theId is a GEOM obect type id.
11492 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11493 # @ref swig_GetType "Example"
11494 def ShapeIdToType(self, theId):
11496 Convert a type of geom object from id to string value
11499 theId is a GEOM obect type id.
11502 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11529 return "REVOLUTION"
11577 return "FREE_BOUNDS"
11585 return "THRUSECTIONS"
11587 return "COMPOUNDFILTER"
11589 return "SHAPES_ON_SHAPE"
11591 return "ELLIPSE_ARC"
11593 return "3DSKETCHER"
11599 return "PIPETSHAPE"
11600 return "Shape Id not exist."
11602 ## Returns a main shape associated with the group
11603 # @param theGroup is a GEOM group for which a main shape object is requested
11604 # @return a GEOM object which is a main shape for theGroup
11606 # @ref swig_GetMainShape "Example"
11607 def GetMainShape(self,theGroup):
11609 Returns a main shape associated with the group
11612 theGroup is a GEOM group for which a main shape object is requested
11615 a GEOM object which is a main shape for theGroup
11617 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11619 # Example: see GEOM_TestOthers.py
11620 anObj = self.GroupOp.GetMainShape(theGroup)
11621 RaiseIfFailed("GetMainShape", self.GroupOp)
11624 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11625 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11626 # @param theShape given shape (see GEOM.GEOM_Object)
11627 # @param min_length minimum length of edges of theShape
11628 # @param max_length maximum length of edges of theShape
11629 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11630 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11631 # @param theName Object name; when specified, this parameter is used
11632 # for result publication in the study. Otherwise, if automatic
11633 # publication is switched on, default value is used for result name.
11635 # @return a newly created GEOM group of edges
11637 # @@ref swig_todo "Example"
11638 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11640 Create group of edges of theShape, whose length is in range [min_length, max_length].
11641 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11644 theShape given shape
11645 min_length minimum length of edges of theShape
11646 max_length maximum length of edges of theShape
11647 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11648 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11649 theName Object name; when specified, this parameter is used
11650 for result publication in the study. Otherwise, if automatic
11651 publication is switched on, default value is used for result name.
11654 a newly created GEOM group of edges.
11656 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11657 edges_in_range = []
11659 Props = self.BasicProperties(edge)
11660 if min_length <= Props[0] and Props[0] <= max_length:
11661 if (not include_min) and (min_length == Props[0]):
11664 if (not include_max) and (Props[0] == max_length):
11667 edges_in_range.append(edge)
11669 if len(edges_in_range) <= 0:
11670 print "No edges found by given criteria"
11673 # note: auto-publishing is done in self.CreateGroup()
11674 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11675 self.UnionList(group_edges, edges_in_range)
11679 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11680 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11681 # @param min_length minimum length of edges of selected shape
11682 # @param max_length maximum length of edges of selected shape
11683 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11684 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11685 # @return a newly created GEOM group of edges
11686 # @ref swig_todo "Example"
11687 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11689 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11690 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11693 min_length minimum length of edges of selected shape
11694 max_length maximum length of edges of selected shape
11695 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11696 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11699 a newly created GEOM group of edges.
11701 nb_selected = sg.SelectedCount()
11702 if nb_selected < 1:
11703 print "Select a shape before calling this function, please."
11705 if nb_selected > 1:
11706 print "Only one shape must be selected"
11709 id_shape = sg.getSelected(0)
11710 shape = IDToObject( id_shape )
11712 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11716 if include_min: left_str = " <= "
11717 if include_max: right_str = " <= "
11719 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11720 + left_str + "length" + right_str + `max_length`)
11722 sg.updateObjBrowser(1)
11729 ## @addtogroup l4_advanced
11732 ## Create a T-shape object with specified caracteristics for the main
11733 # and the incident pipes (radius, width, half-length).
11734 # The extremities of the main pipe are located on junctions points P1 and P2.
11735 # The extremity of the incident pipe is located on junction point P3.
11736 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11737 # the main plane of the T-shape is XOY.
11739 # @param theR1 Internal radius of main pipe
11740 # @param theW1 Width of main pipe
11741 # @param theL1 Half-length of main pipe
11742 # @param theR2 Internal radius of incident pipe (R2 < R1)
11743 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11744 # @param theL2 Half-length of incident pipe
11746 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11747 # @param theP1 1st junction point of main pipe
11748 # @param theP2 2nd junction point of main pipe
11749 # @param theP3 Junction point of incident pipe
11751 # @param theRL Internal radius of left thickness reduction
11752 # @param theWL Width of left thickness reduction
11753 # @param theLtransL Length of left transition part
11754 # @param theLthinL Length of left thin part
11756 # @param theRR Internal radius of right thickness reduction
11757 # @param theWR Width of right thickness reduction
11758 # @param theLtransR Length of right transition part
11759 # @param theLthinR Length of right thin part
11761 # @param theRI Internal radius of incident thickness reduction
11762 # @param theWI Width of incident thickness reduction
11763 # @param theLtransI Length of incident transition part
11764 # @param theLthinI Length of incident thin part
11766 # @param theName Object name; when specified, this parameter is used
11767 # for result publication in the study. Otherwise, if automatic
11768 # publication is switched on, default value is used for result name.
11770 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11772 # @ref tui_creation_pipetshape "Example"
11773 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11774 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11775 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11776 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11777 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11780 Create a T-shape object with specified caracteristics for the main
11781 and the incident pipes (radius, width, half-length).
11782 The extremities of the main pipe are located on junctions points P1 and P2.
11783 The extremity of the incident pipe is located on junction point P3.
11784 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11785 the main plane of the T-shape is XOY.
11788 theR1 Internal radius of main pipe
11789 theW1 Width of main pipe
11790 theL1 Half-length of main pipe
11791 theR2 Internal radius of incident pipe (R2 < R1)
11792 theW2 Width of incident pipe (R2+W2 < R1+W1)
11793 theL2 Half-length of incident pipe
11794 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11795 theP1 1st junction point of main pipe
11796 theP2 2nd junction point of main pipe
11797 theP3 Junction point of incident pipe
11799 theRL Internal radius of left thickness reduction
11800 theWL Width of left thickness reduction
11801 theLtransL Length of left transition part
11802 theLthinL Length of left thin part
11804 theRR Internal radius of right thickness reduction
11805 theWR Width of right thickness reduction
11806 theLtransR Length of right transition part
11807 theLthinR Length of right thin part
11809 theRI Internal radius of incident thickness reduction
11810 theWI Width of incident thickness reduction
11811 theLtransI Length of incident transition part
11812 theLthinI Length of incident thin part
11814 theName Object name; when specified, this parameter is used
11815 for result publication in the study. Otherwise, if automatic
11816 publication is switched on, default value is used for result name.
11819 List of GEOM_Object, containing the created shape and propagation groups.
11822 # create PipeTShape object
11823 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11824 # create PipeTShape object with position
11825 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11826 # create PipeTShape object with left thickness reduction
11827 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11829 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)
11830 if (theP1 and theP2 and theP3):
11831 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11832 theRL, theWL, theLtransL, theLthinL,
11833 theRR, theWR, theLtransR, theLthinR,
11834 theRI, theWI, theLtransI, theLthinI,
11835 theHexMesh, theP1, theP2, theP3)
11837 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11838 theRL, theWL, theLtransL, theLthinL,
11839 theRR, theWR, theLtransR, theLthinR,
11840 theRI, theWI, theLtransI, theLthinI,
11842 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11843 if Parameters: anObj[0].SetParameters(Parameters)
11844 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11845 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11848 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11849 # and the incident pipes (radius, width, half-length). The chamfer is
11850 # created on the junction of the pipes.
11851 # The extremities of the main pipe are located on junctions points P1 and P2.
11852 # The extremity of the incident pipe is located on junction point P3.
11853 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11854 # the main plane of the T-shape is XOY.
11855 # @param theR1 Internal radius of main pipe
11856 # @param theW1 Width of main pipe
11857 # @param theL1 Half-length of main pipe
11858 # @param theR2 Internal radius of incident pipe (R2 < R1)
11859 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11860 # @param theL2 Half-length of incident pipe
11861 # @param theH Height of the chamfer.
11862 # @param theW Width of the chamfer.
11863 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11864 # @param theP1 1st junction point of main pipe
11865 # @param theP2 2nd junction point of main pipe
11866 # @param theP3 Junction point of incident pipe
11868 # @param theRL Internal radius of left thickness reduction
11869 # @param theWL Width of left thickness reduction
11870 # @param theLtransL Length of left transition part
11871 # @param theLthinL Length of left thin part
11873 # @param theRR Internal radius of right thickness reduction
11874 # @param theWR Width of right thickness reduction
11875 # @param theLtransR Length of right transition part
11876 # @param theLthinR Length of right thin part
11878 # @param theRI Internal radius of incident thickness reduction
11879 # @param theWI Width of incident thickness reduction
11880 # @param theLtransI Length of incident transition part
11881 # @param theLthinI Length of incident thin part
11883 # @param theName Object name; when specified, this parameter is used
11884 # for result publication in the study. Otherwise, if automatic
11885 # publication is switched on, default value is used for result name.
11887 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11889 # @ref tui_creation_pipetshape "Example"
11890 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11891 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11892 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11893 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11894 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11897 Create a T-shape object with chamfer and with specified caracteristics for the main
11898 and the incident pipes (radius, width, half-length). The chamfer is
11899 created on the junction of the pipes.
11900 The extremities of the main pipe are located on junctions points P1 and P2.
11901 The extremity of the incident pipe is located on junction point P3.
11902 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11903 the main plane of the T-shape is XOY.
11906 theR1 Internal radius of main pipe
11907 theW1 Width of main pipe
11908 theL1 Half-length of main pipe
11909 theR2 Internal radius of incident pipe (R2 < R1)
11910 theW2 Width of incident pipe (R2+W2 < R1+W1)
11911 theL2 Half-length of incident pipe
11912 theH Height of the chamfer.
11913 theW Width of the chamfer.
11914 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11915 theP1 1st junction point of main pipe
11916 theP2 2nd junction point of main pipe
11917 theP3 Junction point of incident pipe
11919 theRL Internal radius of left thickness reduction
11920 theWL Width of left thickness reduction
11921 theLtransL Length of left transition part
11922 theLthinL Length of left thin part
11924 theRR Internal radius of right thickness reduction
11925 theWR Width of right thickness reduction
11926 theLtransR Length of right transition part
11927 theLthinR Length of right thin part
11929 theRI Internal radius of incident thickness reduction
11930 theWI Width of incident thickness reduction
11931 theLtransI Length of incident transition part
11932 theLthinI Length of incident thin part
11934 theName Object name; when specified, this parameter is used
11935 for result publication in the study. Otherwise, if automatic
11936 publication is switched on, default value is used for result name.
11939 List of GEOM_Object, containing the created shape and propagation groups.
11942 # create PipeTShape with chamfer object
11943 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11944 # create PipeTShape with chamfer object with position
11945 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11946 # create PipeTShape with chamfer object with left thickness reduction
11947 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)
11949 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)
11950 if (theP1 and theP2 and theP3):
11951 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11952 theRL, theWL, theLtransL, theLthinL,
11953 theRR, theWR, theLtransR, theLthinR,
11954 theRI, theWI, theLtransI, theLthinI,
11955 theH, theW, theHexMesh, theP1, theP2, theP3)
11957 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
11958 theRL, theWL, theLtransL, theLthinL,
11959 theRR, theWR, theLtransR, theLthinR,
11960 theRI, theWI, theLtransI, theLthinI,
11961 theH, theW, theHexMesh)
11962 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
11963 if Parameters: anObj[0].SetParameters(Parameters)
11964 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11965 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11968 ## Create a T-shape object with fillet and with specified caracteristics for the main
11969 # and the incident pipes (radius, width, half-length). The fillet is
11970 # created on the junction of the pipes.
11971 # The extremities of the main pipe are located on junctions points P1 and P2.
11972 # The extremity of the incident pipe is located on junction point P3.
11973 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11974 # the main plane of the T-shape is XOY.
11975 # @param theR1 Internal radius of main pipe
11976 # @param theW1 Width of main pipe
11977 # @param theL1 Half-length of main pipe
11978 # @param theR2 Internal radius of incident pipe (R2 < R1)
11979 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11980 # @param theL2 Half-length of incident pipe
11981 # @param theRF Radius of curvature of fillet.
11982 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11983 # @param theP1 1st junction point of main pipe
11984 # @param theP2 2nd junction point of main pipe
11985 # @param theP3 Junction point of incident pipe
11987 # @param theRL Internal radius of left thickness reduction
11988 # @param theWL Width of left thickness reduction
11989 # @param theLtransL Length of left transition part
11990 # @param theLthinL Length of left thin part
11992 # @param theRR Internal radius of right thickness reduction
11993 # @param theWR Width of right thickness reduction
11994 # @param theLtransR Length of right transition part
11995 # @param theLthinR Length of right thin part
11997 # @param theRI Internal radius of incident thickness reduction
11998 # @param theWI Width of incident thickness reduction
11999 # @param theLtransI Length of incident transition part
12000 # @param theLthinI Length of incident thin part
12002 # @param theName Object name; when specified, this parameter is used
12003 # for result publication in the study. Otherwise, if automatic
12004 # publication is switched on, default value is used for result name.
12006 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12008 # @ref tui_creation_pipetshape "Example"
12009 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12010 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12011 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12012 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12013 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12016 Create a T-shape object with fillet and with specified caracteristics for the main
12017 and the incident pipes (radius, width, half-length). The fillet is
12018 created on the junction of the pipes.
12019 The extremities of the main pipe are located on junctions points P1 and P2.
12020 The extremity of the incident pipe is located on junction point P3.
12023 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12024 the main plane of the T-shape is XOY.
12025 theR1 Internal radius of main pipe
12026 theW1 Width of main pipe
12027 heL1 Half-length of main pipe
12028 theR2 Internal radius of incident pipe (R2 < R1)
12029 theW2 Width of incident pipe (R2+W2 < R1+W1)
12030 theL2 Half-length of incident pipe
12031 theRF Radius of curvature of fillet.
12032 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12033 theP1 1st junction point of main pipe
12034 theP2 2nd junction point of main pipe
12035 theP3 Junction point of incident pipe
12037 theRL Internal radius of left thickness reduction
12038 theWL Width of left thickness reduction
12039 theLtransL Length of left transition part
12040 theLthinL Length of left thin part
12042 theRR Internal radius of right thickness reduction
12043 theWR Width of right thickness reduction
12044 theLtransR Length of right transition part
12045 theLthinR Length of right thin part
12047 theRI Internal radius of incident thickness reduction
12048 theWI Width of incident thickness reduction
12049 theLtransI Length of incident transition part
12050 theLthinI Length of incident thin part
12052 theName Object name; when specified, this parameter is used
12053 for result publication in the study. Otherwise, if automatic
12054 publication is switched on, default value is used for result name.
12057 List of GEOM_Object, containing the created shape and propagation groups.
12060 # create PipeTShape with fillet object
12061 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12062 # create PipeTShape with fillet object with position
12063 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12064 # create PipeTShape with fillet object with left thickness reduction
12065 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)
12067 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)
12068 if (theP1 and theP2 and theP3):
12069 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12070 theRL, theWL, theLtransL, theLthinL,
12071 theRR, theWR, theLtransR, theLthinR,
12072 theRI, theWI, theLtransI, theLthinI,
12073 theRF, theHexMesh, theP1, theP2, theP3)
12075 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12076 theRL, theWL, theLtransL, theLthinL,
12077 theRR, theWR, theLtransR, theLthinR,
12078 theRI, theWI, theLtransI, theLthinI,
12080 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12081 if Parameters: anObj[0].SetParameters(Parameters)
12082 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12083 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12086 ## This function allows creating a disk already divided into blocks. It
12087 # can be used to create divided pipes for later meshing in hexaedra.
12088 # @param theR Radius of the disk
12089 # @param theOrientation Orientation of the plane on which the disk will be built
12090 # 1 = XOY, 2 = OYZ, 3 = OZX
12091 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12092 # @param theName Object name; when specified, this parameter is used
12093 # for result publication in the study. Otherwise, if automatic
12094 # publication is switched on, default value is used for result name.
12096 # @return New GEOM_Object, containing the created shape.
12098 # @ref tui_creation_divideddisk "Example"
12099 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12101 Creates a disk, divided into blocks. It can be used to create divided pipes
12102 for later meshing in hexaedra.
12105 theR Radius of the disk
12106 theOrientation Orientation of the plane on which the disk will be built:
12107 1 = XOY, 2 = OYZ, 3 = OZX
12108 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12109 theName Object name; when specified, this parameter is used
12110 for result publication in the study. Otherwise, if automatic
12111 publication is switched on, default value is used for result name.
12114 New GEOM_Object, containing the created shape.
12116 theR, Parameters = ParseParameters(theR)
12117 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12118 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12119 if Parameters: anObj.SetParameters(Parameters)
12120 self._autoPublish(anObj, theName, "dividedDisk")
12123 ## This function allows creating a disk already divided into blocks. It
12124 # can be used to create divided pipes for later meshing in hexaedra.
12125 # @param theCenter Center of the disk
12126 # @param theVector Normal vector to the plane of the created disk
12127 # @param theRadius Radius of the disk
12128 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12129 # @param theName Object name; when specified, this parameter is used
12130 # for result publication in the study. Otherwise, if automatic
12131 # publication is switched on, default value is used for result name.
12133 # @return New GEOM_Object, containing the created shape.
12135 # @ref tui_creation_divideddisk "Example"
12136 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12138 Creates a disk already divided into blocks. It can be used to create divided pipes
12139 for later meshing in hexaedra.
12142 theCenter Center of the disk
12143 theVector Normal vector to the plane of the created disk
12144 theRadius Radius of the disk
12145 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12146 theName Object name; when specified, this parameter is used
12147 for result publication in the study. Otherwise, if automatic
12148 publication is switched on, default value is used for result name.
12151 New GEOM_Object, containing the created shape.
12153 theRadius, Parameters = ParseParameters(theRadius)
12154 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12155 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12156 if Parameters: anObj.SetParameters(Parameters)
12157 self._autoPublish(anObj, theName, "dividedDisk")
12160 ## Builds a cylinder prepared for hexa meshes
12161 # @param theR Radius of the cylinder
12162 # @param theH Height of the cylinder
12163 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12164 # @param theName Object name; when specified, this parameter is used
12165 # for result publication in the study. Otherwise, if automatic
12166 # publication is switched on, default value is used for result name.
12168 # @return New GEOM_Object, containing the created shape.
12170 # @ref tui_creation_dividedcylinder "Example"
12171 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12173 Builds a cylinder prepared for hexa meshes
12176 theR Radius of the cylinder
12177 theH Height of the cylinder
12178 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12179 theName Object name; when specified, this parameter is used
12180 for result publication in the study. Otherwise, if automatic
12181 publication is switched on, default value is used for result name.
12184 New GEOM_Object, containing the created shape.
12186 theR, theH, Parameters = ParseParameters(theR, theH)
12187 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12188 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12189 if Parameters: anObj.SetParameters(Parameters)
12190 self._autoPublish(anObj, theName, "dividedCylinder")
12194 # @param thelPoints list of points
12195 # @return New GEOM_Object, containing the created shape.
12197 # @ref tui_creation_smoothingsurface "Example"
12198 def MakeSmoothingSurface(self, thelPoints):
12199 thelPoints, Parameters = ParseParameters(thelPoints)
12200 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12201 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12202 if Parameters: anObj.SetParameters(Parameters)
12205 #@@ insert new functions before this line @@ do not remove this line @@#
12207 # end of l4_advanced
12210 ## Create a copy of the given object
12212 # @param theOriginal geometry object for copy
12213 # @param theName Object name; when specified, this parameter is used
12214 # for result publication in the study. Otherwise, if automatic
12215 # publication is switched on, default value is used for result name.
12217 # @return New GEOM_Object, containing the copied shape.
12219 # @ingroup l1_geomBuilder_auxiliary
12220 # @ref swig_MakeCopy "Example"
12221 def MakeCopy(self, theOriginal, theName=None):
12223 Create a copy of the given object
12226 theOriginal geometry object for copy
12227 theName Object name; when specified, this parameter is used
12228 for result publication in the study. Otherwise, if automatic
12229 publication is switched on, default value is used for result name.
12232 New GEOM_Object, containing the copied shape.
12234 Example of usage: Copy = geompy.MakeCopy(Box)
12236 # Example: see GEOM_TestAll.py
12237 anObj = self.InsertOp.MakeCopy(theOriginal)
12238 RaiseIfFailed("MakeCopy", self.InsertOp)
12239 self._autoPublish(anObj, theName, "copy")
12242 ## Add Path to load python scripts from
12243 # @param Path a path to load python scripts from
12244 # @ingroup l1_geomBuilder_auxiliary
12245 def addPath(self,Path):
12247 Add Path to load python scripts from
12250 Path a path to load python scripts from
12252 if (sys.path.count(Path) < 1):
12253 sys.path.append(Path)
12257 ## Load marker texture from the file
12258 # @param Path a path to the texture file
12259 # @return unique texture identifier
12260 # @ingroup l1_geomBuilder_auxiliary
12261 def LoadTexture(self, Path):
12263 Load marker texture from the file
12266 Path a path to the texture file
12269 unique texture identifier
12271 # Example: see GEOM_TestAll.py
12272 ID = self.InsertOp.LoadTexture(Path)
12273 RaiseIfFailed("LoadTexture", self.InsertOp)
12276 ## Get internal name of the object based on its study entry
12277 # @note This method does not provide an unique identifier of the geometry object.
12278 # @note This is internal function of GEOM component, though it can be used outside it for
12279 # appropriate reason (e.g. for identification of geometry object).
12280 # @param obj geometry object
12281 # @return unique object identifier
12282 # @ingroup l1_geomBuilder_auxiliary
12283 def getObjectID(self, obj):
12285 Get internal name of the object based on its study entry.
12286 Note: this method does not provide an unique identifier of the geometry object.
12287 It is an internal function of GEOM component, though it can be used outside GEOM for
12288 appropriate reason (e.g. for identification of geometry object).
12291 obj geometry object
12294 unique object identifier
12297 entry = salome.ObjectToID(obj)
12298 if entry is not None:
12299 lst = entry.split(":")
12301 ID = lst[-1] # -1 means last item in the list
12302 return "GEOM_" + ID
12307 ## Add marker texture. @a Width and @a Height parameters
12308 # specify width and height of the texture in pixels.
12309 # If @a RowData is @c True, @a Texture parameter should represent texture data
12310 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12311 # parameter should be unpacked string, in which '1' symbols represent opaque
12312 # pixels and '0' represent transparent pixels of the texture bitmap.
12314 # @param Width texture width in pixels
12315 # @param Height texture height in pixels
12316 # @param Texture texture data
12317 # @param RowData if @c True, @a Texture data are packed in the byte stream
12318 # @return unique texture identifier
12319 # @ingroup l1_geomBuilder_auxiliary
12320 def AddTexture(self, Width, Height, Texture, RowData=False):
12322 Add marker texture. Width and Height parameters
12323 specify width and height of the texture in pixels.
12324 If RowData is True, Texture parameter should represent texture data
12325 packed into the byte array. If RowData is False (default), Texture
12326 parameter should be unpacked string, in which '1' symbols represent opaque
12327 pixels and '0' represent transparent pixels of the texture bitmap.
12330 Width texture width in pixels
12331 Height texture height in pixels
12332 Texture texture data
12333 RowData if True, Texture data are packed in the byte stream
12336 return unique texture identifier
12338 if not RowData: Texture = PackData(Texture)
12339 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12340 RaiseIfFailed("AddTexture", self.InsertOp)
12344 # Register the new proxy for GEOM_Gen
12345 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12347 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12348 # interface to GEOM operations.
12353 # salome.salome_init()
12354 # from salome.geom import geomBuilder
12355 # geompy = geomBuilder.New(salome.myStudy)
12357 # @param study SALOME study, generally obtained by salome.myStudy.
12358 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12359 # @return geomBuilder instance
12360 def New( study, instance=None):
12362 Create a new geomBuilder instance.The geomBuilder class provides the Python
12363 interface to GEOM operations.
12367 salome.salome_init()
12368 from salome.geom import geomBuilder
12369 geompy = geomBuilder.New(salome.myStudy)
12372 study SALOME study, generally obtained by salome.myStudy.
12373 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12375 geomBuilder instance
12377 #print "New geomBuilder ", study, instance
12384 geom = geomBuilder()
12385 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12386 geom.init_geom(study)