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
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 ## Create a sketcher wire, following the numerical description,
2409 # passed through <VAR>theCoordinates</VAR> argument. \n
2410 # @param theCoordinates double values, defining points to create a wire,
2412 # @param theName Object name; when specified, this parameter is used
2413 # for result publication in the study. Otherwise, if automatic
2414 # publication is switched on, default value is used for result name.
2416 # @return New GEOM.GEOM_Object, containing the created wire.
2418 # @ref tui_3dsketcher_page "Example"
2419 def Make3DSketcher(self, theCoordinates, theName=None):
2421 Create a sketcher wire, following the numerical description,
2422 passed through theCoordinates argument.
2425 theCoordinates double values, defining points to create a wire,
2427 theName Object name; when specified, this parameter is used
2428 for result publication in the study. Otherwise, if automatic
2429 publication is switched on, default value is used for result name.
2432 New GEOM_Object, containing the created wire.
2434 theCoordinates,Parameters = ParseParameters(theCoordinates)
2435 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2436 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2437 anObj.SetParameters(Parameters)
2438 self._autoPublish(anObj, theName, "wire")
2441 ## Obtain a 3D sketcher interface
2442 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2444 # @ref tui_3dsketcher_page "Example"
2445 def Sketcher3D (self):
2447 Obtain a 3D sketcher interface.
2450 sk = geompy.Sketcher3D()
2451 sk.addPointsAbsolute(0,0,0, 70,0,0)
2452 sk.addPointsRelative(0, 0, 130)
2453 sk.addPointAnglesLength("OXY", 50, 0, 100)
2454 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2456 a3D_Sketcher_1 = sk.wire()
2458 sk = Sketcher3D (self)
2461 # end of l3_sketcher
2464 ## @addtogroup l3_3d_primitives
2467 ## Create a box by coordinates of two opposite vertices.
2469 # @param x1,y1,z1 double values, defining first point it.
2470 # @param x2,y2,z2 double values, defining first point it.
2471 # @param theName Object name; when specified, this parameter is used
2472 # for result publication in the study. Otherwise, if automatic
2473 # publication is switched on, default value is used for result name.
2475 # @return New GEOM.GEOM_Object, containing the created box.
2477 # @ref tui_creation_box "Example"
2478 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2480 Create a box by coordinates of two opposite vertices.
2483 x1,y1,z1 double values, defining first point.
2484 x2,y2,z2 double values, defining second point.
2485 theName Object name; when specified, this parameter is used
2486 for result publication in the study. Otherwise, if automatic
2487 publication is switched on, default value is used for result name.
2490 New GEOM.GEOM_Object, containing the created box.
2492 # Example: see GEOM_TestAll.py
2493 pnt1 = self.MakeVertex(x1,y1,z1)
2494 pnt2 = self.MakeVertex(x2,y2,z2)
2495 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2496 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2498 ## Create a box with specified dimensions along the coordinate axes
2499 # and with edges, parallel to the coordinate axes.
2500 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2501 # @param theDX Length of Box edges, parallel to OX axis.
2502 # @param theDY Length of Box edges, parallel to OY axis.
2503 # @param theDZ Length of Box edges, parallel to OZ axis.
2504 # @param theName Object name; when specified, this parameter is used
2505 # for result publication in the study. Otherwise, if automatic
2506 # publication is switched on, default value is used for result name.
2508 # @return New GEOM.GEOM_Object, containing the created box.
2510 # @ref tui_creation_box "Example"
2511 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2513 Create a box with specified dimensions along the coordinate axes
2514 and with edges, parallel to the coordinate axes.
2515 Center of the box will be at point (DX/2, DY/2, DZ/2).
2518 theDX Length of Box edges, parallel to OX axis.
2519 theDY Length of Box edges, parallel to OY axis.
2520 theDZ Length of Box edges, parallel to OZ axis.
2521 theName Object name; when specified, this parameter is used
2522 for result publication in the study. Otherwise, if automatic
2523 publication is switched on, default value is used for result name.
2526 New GEOM.GEOM_Object, containing the created box.
2528 # Example: see GEOM_TestAll.py
2529 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2530 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2531 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2532 anObj.SetParameters(Parameters)
2533 self._autoPublish(anObj, theName, "box")
2536 ## Create a box with two specified opposite vertices,
2537 # and with edges, parallel to the coordinate axes
2538 # @param thePnt1 First of two opposite vertices.
2539 # @param thePnt2 Second of two opposite vertices.
2540 # @param theName Object name; when specified, this parameter is used
2541 # for result publication in the study. Otherwise, if automatic
2542 # publication is switched on, default value is used for result name.
2544 # @return New GEOM.GEOM_Object, containing the created box.
2546 # @ref tui_creation_box "Example"
2547 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2549 Create a box with two specified opposite vertices,
2550 and with edges, parallel to the coordinate axes
2553 thePnt1 First of two opposite vertices.
2554 thePnt2 Second of two opposite vertices.
2555 theName Object name; when specified, this parameter is used
2556 for result publication in the study. Otherwise, if automatic
2557 publication is switched on, default value is used for result name.
2560 New GEOM.GEOM_Object, containing the created box.
2562 # Example: see GEOM_TestAll.py
2563 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2564 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2565 self._autoPublish(anObj, theName, "box")
2568 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2569 # @param theH height of Face.
2570 # @param theW width of Face.
2571 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2572 # @param theName Object name; when specified, this parameter is used
2573 # for result publication in the study. Otherwise, if automatic
2574 # publication is switched on, default value is used for result name.
2576 # @return New GEOM.GEOM_Object, containing the created face.
2578 # @ref tui_creation_face "Example"
2579 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2581 Create a face with specified dimensions with edges parallel to coordinate axes.
2584 theH height of Face.
2586 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2587 theName Object name; when specified, this parameter is used
2588 for result publication in the study. Otherwise, if automatic
2589 publication is switched on, default value is used for result name.
2592 New GEOM.GEOM_Object, containing the created face.
2594 # Example: see GEOM_TestAll.py
2595 theH,theW,Parameters = ParseParameters(theH, theW)
2596 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2597 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2598 anObj.SetParameters(Parameters)
2599 self._autoPublish(anObj, theName, "rectangle")
2602 ## Create a face from another plane and two sizes,
2603 # vertical size and horisontal size.
2604 # @param theObj Normale vector to the creating face or
2606 # @param theH Height (vertical size).
2607 # @param theW Width (horisontal size).
2608 # @param theName Object name; when specified, this parameter is used
2609 # for result publication in the study. Otherwise, if automatic
2610 # publication is switched on, default value is used for result name.
2612 # @return New GEOM.GEOM_Object, containing the created face.
2614 # @ref tui_creation_face "Example"
2615 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2617 Create a face from another plane and two sizes,
2618 vertical size and horisontal size.
2621 theObj Normale vector to the creating face or
2623 theH Height (vertical size).
2624 theW Width (horisontal size).
2625 theName Object name; when specified, this parameter is used
2626 for result publication in the study. Otherwise, if automatic
2627 publication is switched on, default value is used for result name.
2630 New GEOM_Object, containing the created face.
2632 # Example: see GEOM_TestAll.py
2633 theH,theW,Parameters = ParseParameters(theH, theW)
2634 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2635 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2636 anObj.SetParameters(Parameters)
2637 self._autoPublish(anObj, theName, "rectangle")
2640 ## Create a disk with given center, normal vector and radius.
2641 # @param thePnt Disk center.
2642 # @param theVec Vector, normal to the plane of the disk.
2643 # @param theR Disk radius.
2644 # @param theName Object name; when specified, this parameter is used
2645 # for result publication in the study. Otherwise, if automatic
2646 # publication is switched on, default value is used for result name.
2648 # @return New GEOM.GEOM_Object, containing the created disk.
2650 # @ref tui_creation_disk "Example"
2651 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2653 Create a disk with given center, normal vector and radius.
2657 theVec Vector, normal to the plane of the disk.
2659 theName Object name; when specified, this parameter is used
2660 for result publication in the study. Otherwise, if automatic
2661 publication is switched on, default value is used for result name.
2664 New GEOM.GEOM_Object, containing the created disk.
2666 # Example: see GEOM_TestAll.py
2667 theR,Parameters = ParseParameters(theR)
2668 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2669 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2670 anObj.SetParameters(Parameters)
2671 self._autoPublish(anObj, theName, "disk")
2674 ## Create a disk, passing through three given points
2675 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2676 # @param theName Object name; when specified, this parameter is used
2677 # for result publication in the study. Otherwise, if automatic
2678 # publication is switched on, default value is used for result name.
2680 # @return New GEOM.GEOM_Object, containing the created disk.
2682 # @ref tui_creation_disk "Example"
2683 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2685 Create a disk, passing through three given points
2688 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2689 theName Object name; when specified, this parameter is used
2690 for result publication in the study. Otherwise, if automatic
2691 publication is switched on, default value is used for result name.
2694 New GEOM.GEOM_Object, containing the created disk.
2696 # Example: see GEOM_TestAll.py
2697 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2698 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2699 self._autoPublish(anObj, theName, "disk")
2702 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2703 # @param theR Radius of Face.
2704 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2705 # @param theName Object name; when specified, this parameter is used
2706 # for result publication in the study. Otherwise, if automatic
2707 # publication is switched on, default value is used for result name.
2709 # @return New GEOM.GEOM_Object, containing the created disk.
2711 # @ref tui_creation_face "Example"
2712 def MakeDiskR(self, theR, theOrientation, theName=None):
2714 Create a disk with specified dimensions along OX-OY coordinate axes.
2717 theR Radius of Face.
2718 theOrientation set the orientation belong axis OXY or OYZ or OZX
2719 theName Object name; when specified, this parameter is used
2720 for result publication in the study. Otherwise, if automatic
2721 publication is switched on, default value is used for result name.
2724 New GEOM.GEOM_Object, containing the created disk.
2727 Disk3 = geompy.MakeDiskR(100., 1)
2729 # Example: see GEOM_TestAll.py
2730 theR,Parameters = ParseParameters(theR)
2731 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2732 RaiseIfFailed("MakeDiskR", self.PrimOp)
2733 anObj.SetParameters(Parameters)
2734 self._autoPublish(anObj, theName, "disk")
2737 ## Create a cylinder with given base point, axis, radius and height.
2738 # @param thePnt Central point of cylinder base.
2739 # @param theAxis Cylinder axis.
2740 # @param theR Cylinder radius.
2741 # @param theH Cylinder height.
2742 # @param theName Object name; when specified, this parameter is used
2743 # for result publication in the study. Otherwise, if automatic
2744 # publication is switched on, default value is used for result name.
2746 # @return New GEOM.GEOM_Object, containing the created cylinder.
2748 # @ref tui_creation_cylinder "Example"
2749 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2751 Create a cylinder with given base point, axis, radius and height.
2754 thePnt Central point of cylinder base.
2755 theAxis Cylinder axis.
2756 theR Cylinder radius.
2757 theH Cylinder height.
2758 theName Object name; when specified, this parameter is used
2759 for result publication in the study. Otherwise, if automatic
2760 publication is switched on, default value is used for result name.
2763 New GEOM.GEOM_Object, containing the created cylinder.
2765 # Example: see GEOM_TestAll.py
2766 theR,theH,Parameters = ParseParameters(theR, theH)
2767 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2768 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2769 anObj.SetParameters(Parameters)
2770 self._autoPublish(anObj, theName, "cylinder")
2773 ## Create a cylinder with given radius and height at
2774 # the origin of coordinate system. Axis of the cylinder
2775 # will be collinear to the OZ axis of the coordinate system.
2776 # @param theR Cylinder radius.
2777 # @param theH Cylinder height.
2778 # @param 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.
2782 # @return New GEOM.GEOM_Object, containing the created cylinder.
2784 # @ref tui_creation_cylinder "Example"
2785 def MakeCylinderRH(self, theR, theH, theName=None):
2787 Create a cylinder with given radius and height at
2788 the origin of coordinate system. Axis of the cylinder
2789 will be collinear to the OZ axis of the coordinate system.
2792 theR Cylinder radius.
2793 theH Cylinder height.
2794 theName Object name; when specified, this parameter is used
2795 for result publication in the study. Otherwise, if automatic
2796 publication is switched on, default value is used for result name.
2799 New GEOM.GEOM_Object, containing the created cylinder.
2801 # Example: see GEOM_TestAll.py
2802 theR,theH,Parameters = ParseParameters(theR, theH)
2803 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2804 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2805 anObj.SetParameters(Parameters)
2806 self._autoPublish(anObj, theName, "cylinder")
2809 ## Create a sphere with given center and radius.
2810 # @param thePnt Sphere center.
2811 # @param theR Sphere radius.
2812 # @param theName Object name; when specified, this parameter is used
2813 # for result publication in the study. Otherwise, if automatic
2814 # publication is switched on, default value is used for result name.
2816 # @return New GEOM.GEOM_Object, containing the created sphere.
2818 # @ref tui_creation_sphere "Example"
2819 def MakeSpherePntR(self, thePnt, theR, theName=None):
2821 Create a sphere with given center and radius.
2824 thePnt Sphere center.
2826 theName Object name; when specified, this parameter is used
2827 for result publication in the study. Otherwise, if automatic
2828 publication is switched on, default value is used for result name.
2831 New GEOM.GEOM_Object, containing the created sphere.
2833 # Example: see GEOM_TestAll.py
2834 theR,Parameters = ParseParameters(theR)
2835 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2836 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2837 anObj.SetParameters(Parameters)
2838 self._autoPublish(anObj, theName, "sphere")
2841 ## Create a sphere with given center and radius.
2842 # @param x,y,z Coordinates of sphere center.
2843 # @param theR Sphere radius.
2844 # @param theName Object name; when specified, this parameter is used
2845 # for result publication in the study. Otherwise, if automatic
2846 # publication is switched on, default value is used for result name.
2848 # @return New GEOM.GEOM_Object, containing the created sphere.
2850 # @ref tui_creation_sphere "Example"
2851 def MakeSphere(self, x, y, z, theR, theName=None):
2853 Create a sphere with given center and radius.
2856 x,y,z Coordinates of sphere center.
2858 theName Object name; when specified, this parameter is used
2859 for result publication in the study. Otherwise, if automatic
2860 publication is switched on, default value is used for result name.
2863 New GEOM.GEOM_Object, containing the created sphere.
2865 # Example: see GEOM_TestAll.py
2866 point = self.MakeVertex(x, y, z)
2867 # note: auto-publishing is done in self.MakeSpherePntR()
2868 anObj = self.MakeSpherePntR(point, theR, theName)
2871 ## Create a sphere with given radius at the origin of coordinate system.
2872 # @param theR Sphere radius.
2873 # @param theName Object name; when specified, this parameter is used
2874 # for result publication in the study. Otherwise, if automatic
2875 # publication is switched on, default value is used for result name.
2877 # @return New GEOM.GEOM_Object, containing the created sphere.
2879 # @ref tui_creation_sphere "Example"
2880 def MakeSphereR(self, theR, theName=None):
2882 Create a sphere with given radius at the origin of coordinate system.
2886 theName Object name; when specified, this parameter is used
2887 for result publication in the study. Otherwise, if automatic
2888 publication is switched on, default value is used for result name.
2891 New GEOM.GEOM_Object, containing the created sphere.
2893 # Example: see GEOM_TestAll.py
2894 theR,Parameters = ParseParameters(theR)
2895 anObj = self.PrimOp.MakeSphereR(theR)
2896 RaiseIfFailed("MakeSphereR", self.PrimOp)
2897 anObj.SetParameters(Parameters)
2898 self._autoPublish(anObj, theName, "sphere")
2901 ## Create a cone with given base point, axis, height and radiuses.
2902 # @param thePnt Central point of the first cone base.
2903 # @param theAxis Cone axis.
2904 # @param theR1 Radius of the first cone base.
2905 # @param theR2 Radius of the second cone base.
2906 # \note If both radiuses are non-zero, the cone will be truncated.
2907 # \note If the radiuses are equal, a cylinder will be created instead.
2908 # @param theH Cone height.
2909 # @param theName Object name; when specified, this parameter is used
2910 # for result publication in the study. Otherwise, if automatic
2911 # publication is switched on, default value is used for result name.
2913 # @return New GEOM.GEOM_Object, containing the created cone.
2915 # @ref tui_creation_cone "Example"
2916 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2918 Create a cone with given base point, axis, height and radiuses.
2921 thePnt Central point of the first cone base.
2923 theR1 Radius of the first cone base.
2924 theR2 Radius of the second cone base.
2926 theName Object name; when specified, this parameter is used
2927 for result publication in the study. Otherwise, if automatic
2928 publication is switched on, default value is used for result name.
2931 If both radiuses are non-zero, the cone will be truncated.
2932 If the radiuses are equal, a cylinder will be created instead.
2935 New GEOM.GEOM_Object, containing the created cone.
2937 # Example: see GEOM_TestAll.py
2938 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2939 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2940 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2941 anObj.SetParameters(Parameters)
2942 self._autoPublish(anObj, theName, "cone")
2945 ## Create a cone with given height and radiuses at
2946 # the origin of coordinate system. Axis of the cone will
2947 # be collinear to the OZ axis of the coordinate system.
2948 # @param theR1 Radius of the first cone base.
2949 # @param theR2 Radius of the second cone base.
2950 # \note If both radiuses are non-zero, the cone will be truncated.
2951 # \note If the radiuses are equal, a cylinder will be created instead.
2952 # @param theH Cone height.
2953 # @param theName Object name; when specified, this parameter is used
2954 # for result publication in the study. Otherwise, if automatic
2955 # publication is switched on, default value is used for result name.
2957 # @return New GEOM.GEOM_Object, containing the created cone.
2959 # @ref tui_creation_cone "Example"
2960 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
2962 Create a cone with given height and radiuses at
2963 the origin of coordinate system. Axis of the cone will
2964 be collinear to the OZ axis of the coordinate system.
2967 theR1 Radius of the first cone base.
2968 theR2 Radius of the second cone base.
2970 theName Object name; when specified, this parameter is used
2971 for result publication in the study. Otherwise, if automatic
2972 publication is switched on, default value is used for result name.
2975 If both radiuses are non-zero, the cone will be truncated.
2976 If the radiuses are equal, a cylinder will be created instead.
2979 New GEOM.GEOM_Object, containing the created cone.
2981 # Example: see GEOM_TestAll.py
2982 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2983 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2984 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2985 anObj.SetParameters(Parameters)
2986 self._autoPublish(anObj, theName, "cone")
2989 ## Create a torus with given center, normal vector and radiuses.
2990 # @param thePnt Torus central point.
2991 # @param theVec Torus axis of symmetry.
2992 # @param theRMajor Torus major radius.
2993 # @param theRMinor Torus minor radius.
2994 # @param theName Object name; when specified, this parameter is used
2995 # for result publication in the study. Otherwise, if automatic
2996 # publication is switched on, default value is used for result name.
2998 # @return New GEOM.GEOM_Object, containing the created torus.
3000 # @ref tui_creation_torus "Example"
3001 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3003 Create a torus with given center, normal vector and radiuses.
3006 thePnt Torus central point.
3007 theVec Torus axis of symmetry.
3008 theRMajor Torus major radius.
3009 theRMinor Torus minor radius.
3010 theName Object name; when specified, this parameter is used
3011 for result publication in the study. Otherwise, if automatic
3012 publication is switched on, default value is used for result name.
3015 New GEOM.GEOM_Object, containing the created torus.
3017 # Example: see GEOM_TestAll.py
3018 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3019 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3020 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3021 anObj.SetParameters(Parameters)
3022 self._autoPublish(anObj, theName, "torus")
3025 ## Create a torus with given radiuses at the origin of coordinate system.
3026 # @param theRMajor Torus major radius.
3027 # @param theRMinor Torus minor radius.
3028 # @param theName Object name; when specified, this parameter is used
3029 # for result publication in the study. Otherwise, if automatic
3030 # publication is switched on, default value is used for result name.
3032 # @return New GEOM.GEOM_Object, containing the created torus.
3034 # @ref tui_creation_torus "Example"
3035 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3037 Create a torus with given radiuses at the origin of coordinate system.
3040 theRMajor Torus major radius.
3041 theRMinor Torus minor radius.
3042 theName Object name; when specified, this parameter is used
3043 for result publication in the study. Otherwise, if automatic
3044 publication is switched on, default value is used for result name.
3047 New GEOM.GEOM_Object, containing the created torus.
3049 # Example: see GEOM_TestAll.py
3050 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3051 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3052 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3053 anObj.SetParameters(Parameters)
3054 self._autoPublish(anObj, theName, "torus")
3057 # end of l3_3d_primitives
3060 ## @addtogroup l3_complex
3063 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3064 # @param theBase Base shape to be extruded.
3065 # @param thePoint1 First end of extrusion vector.
3066 # @param thePoint2 Second end of extrusion vector.
3067 # @param theScaleFactor Use it to make prism with scaled second base.
3068 # Nagative value means not scaled second base.
3069 # @param theName Object name; when specified, this parameter is used
3070 # for result publication in the study. Otherwise, if automatic
3071 # publication is switched on, default value is used for result name.
3073 # @return New GEOM.GEOM_Object, containing the created prism.
3075 # @ref tui_creation_prism "Example"
3076 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3078 Create a shape by extrusion of the base shape along a vector, defined by two points.
3081 theBase Base shape to be extruded.
3082 thePoint1 First end of extrusion vector.
3083 thePoint2 Second end of extrusion vector.
3084 theScaleFactor Use it to make prism with scaled second base.
3085 Nagative value means not scaled second base.
3086 theName Object name; when specified, this parameter is used
3087 for result publication in the study. Otherwise, if automatic
3088 publication is switched on, default value is used for result name.
3091 New GEOM.GEOM_Object, containing the created prism.
3093 # Example: see GEOM_TestAll.py
3096 if theScaleFactor > 0:
3097 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3098 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3100 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3101 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3102 anObj.SetParameters(Parameters)
3103 self._autoPublish(anObj, theName, "prism")
3106 ## Create a shape by extrusion of the base shape along a
3107 # vector, defined by two points, in 2 Ways (forward/backward).
3108 # @param theBase Base shape to be extruded.
3109 # @param thePoint1 First end of extrusion vector.
3110 # @param thePoint2 Second end of extrusion vector.
3111 # @param theName Object name; when specified, this parameter is used
3112 # for result publication in the study. Otherwise, if automatic
3113 # publication is switched on, default value is used for result name.
3115 # @return New GEOM.GEOM_Object, containing the created prism.
3117 # @ref tui_creation_prism "Example"
3118 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3120 Create a shape by extrusion of the base shape along a
3121 vector, defined by two points, in 2 Ways (forward/backward).
3124 theBase Base shape to be extruded.
3125 thePoint1 First end of extrusion vector.
3126 thePoint2 Second end of extrusion vector.
3127 theName Object name; when specified, this parameter is used
3128 for result publication in the study. Otherwise, if automatic
3129 publication is switched on, default value is used for result name.
3132 New GEOM.GEOM_Object, containing the created prism.
3134 # Example: see GEOM_TestAll.py
3135 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3136 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3137 self._autoPublish(anObj, theName, "prism")
3140 ## Create a shape by extrusion of the base shape along the vector,
3141 # i.e. all the space, transfixed by the base shape during its translation
3142 # along the vector on the given distance.
3143 # @param theBase Base shape to be extruded.
3144 # @param theVec Direction of extrusion.
3145 # @param theH Prism dimension along theVec.
3146 # @param theScaleFactor Use it to make prism with scaled second base.
3147 # Negative value means not scaled second base.
3148 # @param theName Object name; when specified, this parameter is used
3149 # for result publication in the study. Otherwise, if automatic
3150 # publication is switched on, default value is used for result name.
3152 # @return New GEOM.GEOM_Object, containing the created prism.
3154 # @ref tui_creation_prism "Example"
3155 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3157 Create a shape by extrusion of the base shape along the vector,
3158 i.e. all the space, transfixed by the base shape during its translation
3159 along the vector on the given distance.
3162 theBase Base shape to be extruded.
3163 theVec Direction of extrusion.
3164 theH Prism dimension along theVec.
3165 theScaleFactor Use it to make prism with scaled second base.
3166 Negative value means not scaled second base.
3167 theName Object name; when specified, this parameter is used
3168 for result publication in the study. Otherwise, if automatic
3169 publication is switched on, default value is used for result name.
3172 New GEOM.GEOM_Object, containing the created prism.
3174 # Example: see GEOM_TestAll.py
3177 if theScaleFactor > 0:
3178 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3179 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3181 theH,Parameters = ParseParameters(theH)
3182 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3183 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3184 anObj.SetParameters(Parameters)
3185 self._autoPublish(anObj, theName, "prism")
3188 ## Create a shape by extrusion of the base shape along the vector,
3189 # i.e. all the space, transfixed by the base shape during its translation
3190 # along the vector on the given distance in 2 Ways (forward/backward).
3191 # @param theBase Base shape to be extruded.
3192 # @param theVec Direction of extrusion.
3193 # @param theH Prism dimension along theVec in forward direction.
3194 # @param theName Object name; when specified, this parameter is used
3195 # for result publication in the study. Otherwise, if automatic
3196 # publication is switched on, default value is used for result name.
3198 # @return New GEOM.GEOM_Object, containing the created prism.
3200 # @ref tui_creation_prism "Example"
3201 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3203 Create a shape by extrusion of the base shape along the vector,
3204 i.e. all the space, transfixed by the base shape during its translation
3205 along the vector on the given distance in 2 Ways (forward/backward).
3208 theBase Base shape to be extruded.
3209 theVec Direction of extrusion.
3210 theH Prism dimension along theVec in forward direction.
3211 theName Object name; when specified, this parameter is used
3212 for result publication in the study. Otherwise, if automatic
3213 publication is switched on, default value is used for result name.
3216 New GEOM.GEOM_Object, containing the created prism.
3218 # Example: see GEOM_TestAll.py
3219 theH,Parameters = ParseParameters(theH)
3220 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3221 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3222 anObj.SetParameters(Parameters)
3223 self._autoPublish(anObj, theName, "prism")
3226 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3227 # @param theBase Base shape to be extruded.
3228 # @param theDX, theDY, theDZ Directions of extrusion.
3229 # @param theScaleFactor Use it to make prism with scaled second base.
3230 # Nagative value means not scaled second base.
3231 # @param 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.
3235 # @return New GEOM.GEOM_Object, containing the created prism.
3237 # @ref tui_creation_prism "Example"
3238 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3240 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3243 theBase Base shape to be extruded.
3244 theDX, theDY, theDZ Directions of extrusion.
3245 theScaleFactor Use it to make prism with scaled second base.
3246 Nagative value means not scaled second base.
3247 theName Object name; when specified, this parameter is used
3248 for result publication in the study. Otherwise, if automatic
3249 publication is switched on, default value is used for result name.
3252 New GEOM.GEOM_Object, containing the created prism.
3254 # Example: see GEOM_TestAll.py
3257 if theScaleFactor > 0:
3258 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3259 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3261 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3262 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3263 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3264 anObj.SetParameters(Parameters)
3265 self._autoPublish(anObj, theName, "prism")
3268 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3269 # i.e. all the space, transfixed by the base shape during its translation
3270 # along the vector on the given distance in 2 Ways (forward/backward).
3271 # @param theBase Base shape to be extruded.
3272 # @param theDX, theDY, theDZ Directions of extrusion.
3273 # @param theName Object name; when specified, this parameter is used
3274 # for result publication in the study. Otherwise, if automatic
3275 # publication is switched on, default value is used for result name.
3277 # @return New GEOM.GEOM_Object, containing the created prism.
3279 # @ref tui_creation_prism "Example"
3280 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3282 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3283 i.e. all the space, transfixed by the base shape during its translation
3284 along the vector on the given distance in 2 Ways (forward/backward).
3287 theBase Base shape to be extruded.
3288 theDX, theDY, theDZ Directions of extrusion.
3289 theName Object name; when specified, this parameter is used
3290 for result publication in the study. Otherwise, if automatic
3291 publication is switched on, default value is used for result name.
3294 New GEOM.GEOM_Object, containing the created prism.
3296 # Example: see GEOM_TestAll.py
3297 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3298 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3299 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3300 anObj.SetParameters(Parameters)
3301 self._autoPublish(anObj, theName, "prism")
3304 ## Create a shape by revolution of the base shape around the axis
3305 # on the given angle, i.e. all the space, transfixed by the base
3306 # shape during its rotation around the axis on the given angle.
3307 # @param theBase Base shape to be rotated.
3308 # @param theAxis Rotation axis.
3309 # @param theAngle Rotation angle in radians.
3310 # @param theName Object name; when specified, this parameter is used
3311 # for result publication in the study. Otherwise, if automatic
3312 # publication is switched on, default value is used for result name.
3314 # @return New GEOM.GEOM_Object, containing the created revolution.
3316 # @ref tui_creation_revolution "Example"
3317 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3319 Create a shape by revolution of the base shape around the axis
3320 on the given angle, i.e. all the space, transfixed by the base
3321 shape during its rotation around the axis on the given angle.
3324 theBase Base shape to be rotated.
3325 theAxis Rotation axis.
3326 theAngle Rotation angle in radians.
3327 theName Object name; when specified, this parameter is used
3328 for result publication in the study. Otherwise, if automatic
3329 publication is switched on, default value is used for result name.
3332 New GEOM.GEOM_Object, containing the created revolution.
3334 # Example: see GEOM_TestAll.py
3335 theAngle,Parameters = ParseParameters(theAngle)
3336 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3337 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3338 anObj.SetParameters(Parameters)
3339 self._autoPublish(anObj, theName, "revolution")
3342 ## Create a shape by revolution of the base shape around the axis
3343 # on the given angle, i.e. all the space, transfixed by the base
3344 # shape during its rotation around the axis on the given angle in
3345 # both directions (forward/backward)
3346 # @param theBase Base shape to be rotated.
3347 # @param theAxis Rotation axis.
3348 # @param theAngle Rotation angle in radians.
3349 # @param theName Object name; when specified, this parameter is used
3350 # for result publication in the study. Otherwise, if automatic
3351 # publication is switched on, default value is used for result name.
3353 # @return New GEOM.GEOM_Object, containing the created revolution.
3355 # @ref tui_creation_revolution "Example"
3356 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3358 Create a shape by revolution of the base shape around the axis
3359 on the given angle, i.e. all the space, transfixed by the base
3360 shape during its rotation around the axis on the given angle in
3361 both directions (forward/backward).
3364 theBase Base shape to be rotated.
3365 theAxis Rotation axis.
3366 theAngle Rotation angle in radians.
3367 theName Object name; when specified, this parameter is used
3368 for result publication in the study. Otherwise, if automatic
3369 publication is switched on, default value is used for result name.
3372 New GEOM.GEOM_Object, containing the created revolution.
3374 theAngle,Parameters = ParseParameters(theAngle)
3375 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3376 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3377 anObj.SetParameters(Parameters)
3378 self._autoPublish(anObj, theName, "revolution")
3381 ## Create a filling from the given compound of contours.
3382 # @param theShape the compound of contours
3383 # @param theMinDeg a minimal degree of BSpline surface to create
3384 # @param theMaxDeg a maximal degree of BSpline surface to create
3385 # @param theTol2D a 2d tolerance to be reached
3386 # @param theTol3D a 3d tolerance to be reached
3387 # @param theNbIter a number of iteration of approximation algorithm
3388 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3389 # @param isApprox if True, BSpline curves are generated in the process
3390 # of surface construction. By default it is False, that means
3391 # the surface is created using given curves. The usage of
3392 # Approximation makes the algorithm work slower, but allows
3393 # building the surface for rather complex cases.
3394 # @param theName Object name; when specified, this parameter is used
3395 # for result publication in the study. Otherwise, if automatic
3396 # publication is switched on, default value is used for result name.
3398 # @return New GEOM.GEOM_Object, containing the created filling surface.
3400 # @ref tui_creation_filling "Example"
3401 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3402 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3404 Create a filling from the given compound of contours.
3407 theShape the compound of contours
3408 theMinDeg a minimal degree of BSpline surface to create
3409 theMaxDeg a maximal degree of BSpline surface to create
3410 theTol2D a 2d tolerance to be reached
3411 theTol3D a 3d tolerance to be reached
3412 theNbIter a number of iteration of approximation algorithm
3413 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3414 isApprox if True, BSpline curves are generated in the process
3415 of surface construction. By default it is False, that means
3416 the surface is created using given curves. The usage of
3417 Approximation makes the algorithm work slower, but allows
3418 building the surface for rather complex cases
3419 theName Object name; when specified, this parameter is used
3420 for result publication in the study. Otherwise, if automatic
3421 publication is switched on, default value is used for result name.
3424 New GEOM.GEOM_Object, containing the created filling surface.
3427 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3429 # Example: see GEOM_TestAll.py
3430 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3431 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3432 theTol2D, theTol3D, theNbIter,
3433 theMethod, isApprox)
3434 RaiseIfFailed("MakeFilling", self.PrimOp)
3435 anObj.SetParameters(Parameters)
3436 self._autoPublish(anObj, theName, "filling")
3440 ## Create a filling from the given compound of contours.
3441 # This method corresponds to MakeFilling with isApprox=True
3442 # @param theShape the compound of contours
3443 # @param theMinDeg a minimal degree of BSpline surface to create
3444 # @param theMaxDeg a maximal degree of BSpline surface to create
3445 # @param theTol3D a 3d tolerance to be reached
3446 # @param theName Object name; when specified, this parameter is used
3447 # for result publication in the study. Otherwise, if automatic
3448 # publication is switched on, default value is used for result name.
3450 # @return New GEOM.GEOM_Object, containing the created filling surface.
3452 # @ref tui_creation_filling "Example"
3453 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3455 Create a filling from the given compound of contours.
3456 This method corresponds to MakeFilling with isApprox=True
3459 theShape the compound of contours
3460 theMinDeg a minimal degree of BSpline surface to create
3461 theMaxDeg a maximal degree of BSpline surface to create
3462 theTol3D a 3d tolerance to be reached
3463 theName Object name; when specified, this parameter is used
3464 for result publication in the study. Otherwise, if automatic
3465 publication is switched on, default value is used for result name.
3468 New GEOM.GEOM_Object, containing the created filling surface.
3471 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3473 # Example: see GEOM_TestAll.py
3474 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3475 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3476 0, theTol3D, 0, GEOM.FOM_Default, True)
3477 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3478 anObj.SetParameters(Parameters)
3479 self._autoPublish(anObj, theName, "filling")
3482 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3483 # @param theSeqSections - set of specified sections.
3484 # @param theModeSolid - mode defining building solid or shell
3485 # @param thePreci - precision 3D used for smoothing
3486 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3487 # @param theName Object name; when specified, this parameter is used
3488 # for result publication in the study. Otherwise, if automatic
3489 # publication is switched on, default value is used for result name.
3491 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3493 # @ref swig_todo "Example"
3494 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3496 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3499 theSeqSections - set of specified sections.
3500 theModeSolid - mode defining building solid or shell
3501 thePreci - precision 3D used for smoothing
3502 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3503 theName Object name; when specified, this parameter is used
3504 for result publication in the study. Otherwise, if automatic
3505 publication is switched on, default value is used for result name.
3508 New GEOM.GEOM_Object, containing the created shell or solid.
3510 # Example: see GEOM_TestAll.py
3511 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3512 RaiseIfFailed("MakeThruSections", self.PrimOp)
3513 self._autoPublish(anObj, theName, "filling")
3516 ## Create a shape by extrusion of the base shape along
3517 # the path shape. The path shape can be a wire or an edge.
3518 # @param theBase Base shape to be extruded.
3519 # @param thePath Path shape to extrude the base shape along it.
3520 # @param theName Object name; when specified, this parameter is used
3521 # for result publication in the study. Otherwise, if automatic
3522 # publication is switched on, default value is used for result name.
3524 # @return New GEOM.GEOM_Object, containing the created pipe.
3526 # @ref tui_creation_pipe "Example"
3527 def MakePipe(self, theBase, thePath, theName=None):
3529 Create a shape by extrusion of the base shape along
3530 the path shape. The path shape can be a wire or an edge.
3533 theBase Base shape to be extruded.
3534 thePath Path shape to extrude the base shape along it.
3535 theName Object name; when specified, this parameter is used
3536 for result publication in the study. Otherwise, if automatic
3537 publication is switched on, default value is used for result name.
3540 New GEOM.GEOM_Object, containing the created pipe.
3542 # Example: see GEOM_TestAll.py
3543 anObj = self.PrimOp.MakePipe(theBase, thePath)
3544 RaiseIfFailed("MakePipe", self.PrimOp)
3545 self._autoPublish(anObj, theName, "pipe")
3548 ## Create a shape by extrusion of the profile shape along
3549 # the path shape. The path shape can be a wire or an edge.
3550 # the several profiles can be specified in the several locations of path.
3551 # @param theSeqBases - list of Bases shape to be extruded.
3552 # @param theLocations - list of locations on the path corresponding
3553 # specified list of the Bases shapes. Number of locations
3554 # should be equal to number of bases or list of locations can be empty.
3555 # @param thePath - Path shape to extrude the base shape along it.
3556 # @param theWithContact - the mode defining that the section is translated to be in
3557 # contact with the spine.
3558 # @param theWithCorrection - defining that the section is rotated to be
3559 # orthogonal to the spine tangent in the correspondent point
3560 # @param theName Object name; when specified, this parameter is used
3561 # for result publication in the study. Otherwise, if automatic
3562 # publication is switched on, default value is used for result name.
3564 # @return New GEOM.GEOM_Object, containing the created pipe.
3566 # @ref tui_creation_pipe_with_diff_sec "Example"
3567 def MakePipeWithDifferentSections(self, theSeqBases,
3568 theLocations, thePath,
3569 theWithContact, theWithCorrection, theName=None):
3571 Create a shape by extrusion of the profile shape along
3572 the path shape. The path shape can be a wire or an edge.
3573 the several profiles can be specified in the several locations of path.
3576 theSeqBases - list of Bases shape to be extruded.
3577 theLocations - list of locations on the path corresponding
3578 specified list of the Bases shapes. Number of locations
3579 should be equal to number of bases or list of locations can be empty.
3580 thePath - Path shape to extrude the base shape along it.
3581 theWithContact - the mode defining that the section is translated to be in
3582 contact with the spine(0/1)
3583 theWithCorrection - defining that the section is rotated to be
3584 orthogonal to the spine tangent in the correspondent point (0/1)
3585 theName Object name; when specified, this parameter is used
3586 for result publication in the study. Otherwise, if automatic
3587 publication is switched on, default value is used for result name.
3590 New GEOM.GEOM_Object, containing the created pipe.
3592 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3593 theLocations, thePath,
3594 theWithContact, theWithCorrection)
3595 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3596 self._autoPublish(anObj, theName, "pipe")
3599 ## Create a shape by extrusion of the profile shape along
3600 # the path shape. The path shape can be a wire or a edge.
3601 # the several profiles can be specified in the several locations of path.
3602 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3603 # shell or face. If number of faces in neighbour sections
3604 # aren't coincided result solid between such sections will
3605 # be created using external boundaries of this shells.
3606 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3607 # This list is used for searching correspondences between
3608 # faces in the sections. Size of this list must be equal
3609 # to size of list of base shapes.
3610 # @param theLocations - list of locations on the path corresponding
3611 # specified list of the Bases shapes. Number of locations
3612 # should be equal to number of bases. First and last
3613 # locations must be coincided with first and last vertexes
3614 # of path correspondingly.
3615 # @param thePath - Path shape to extrude the base shape along it.
3616 # @param theWithContact - the mode defining that the section is translated to be in
3617 # contact with the spine.
3618 # @param theWithCorrection - defining that the section is rotated to be
3619 # orthogonal to the spine tangent in the correspondent point
3620 # @param theName Object name; when specified, this parameter is used
3621 # for result publication in the study. Otherwise, if automatic
3622 # publication is switched on, default value is used for result name.
3624 # @return New GEOM.GEOM_Object, containing the created solids.
3626 # @ref tui_creation_pipe_with_shell_sec "Example"
3627 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3628 theLocations, thePath,
3629 theWithContact, theWithCorrection, theName=None):
3631 Create a shape by extrusion of the profile shape along
3632 the path shape. The path shape can be a wire or a edge.
3633 the several profiles can be specified in the several locations of path.
3636 theSeqBases - list of Bases shape to be extruded. Base shape must be
3637 shell or face. If number of faces in neighbour sections
3638 aren't coincided result solid between such sections will
3639 be created using external boundaries of this shells.
3640 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3641 This list is used for searching correspondences between
3642 faces in the sections. Size of this list must be equal
3643 to size of list of base shapes.
3644 theLocations - list of locations on the path corresponding
3645 specified list of the Bases shapes. Number of locations
3646 should be equal to number of bases. First and last
3647 locations must be coincided with first and last vertexes
3648 of path correspondingly.
3649 thePath - Path shape to extrude the base shape along it.
3650 theWithContact - the mode defining that the section is translated to be in
3651 contact with the spine (0/1)
3652 theWithCorrection - defining that the section is rotated to be
3653 orthogonal to the spine tangent in the correspondent point (0/1)
3654 theName Object name; when specified, this parameter is used
3655 for result publication in the study. Otherwise, if automatic
3656 publication is switched on, default value is used for result name.
3659 New GEOM.GEOM_Object, containing the created solids.
3661 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3662 theLocations, thePath,
3663 theWithContact, theWithCorrection)
3664 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3665 self._autoPublish(anObj, theName, "pipe")
3668 ## Create a shape by extrusion of the profile shape along
3669 # the path shape. This function is used only for debug pipe
3670 # functionality - it is a version of function MakePipeWithShellSections()
3671 # which give a possibility to recieve information about
3672 # creating pipe between each pair of sections step by step.
3673 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3674 theLocations, thePath,
3675 theWithContact, theWithCorrection, theName=None):
3677 Create a shape by extrusion of the profile shape along
3678 the path shape. This function is used only for debug pipe
3679 functionality - it is a version of previous function
3680 geompy.MakePipeWithShellSections() which give a possibility to
3681 recieve information about creating pipe between each pair of
3682 sections step by step.
3685 nbsect = len(theSeqBases)
3686 nbsubsect = len(theSeqSubBases)
3687 #print "nbsect = ",nbsect
3688 for i in range(1,nbsect):
3690 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3691 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3693 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3694 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3695 tmpLocations, thePath,
3696 theWithContact, theWithCorrection)
3697 if self.PrimOp.IsDone() == 0:
3698 print "Problems with pipe creation between ",i," and ",i+1," sections"
3699 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3702 print "Pipe between ",i," and ",i+1," sections is OK"
3707 resc = self.MakeCompound(res)
3708 #resc = self.MakeSewing(res, 0.001)
3709 #print "resc: ",resc
3710 self._autoPublish(resc, theName, "pipe")
3713 ## Create solids between given sections
3714 # @param theSeqBases - list of sections (shell or face).
3715 # @param theLocations - list of corresponding vertexes
3716 # @param theName Object name; when specified, this parameter is used
3717 # for result publication in the study. Otherwise, if automatic
3718 # publication is switched on, default value is used for result name.
3720 # @return New GEOM.GEOM_Object, containing the created solids.
3722 # @ref tui_creation_pipe_without_path "Example"
3723 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3725 Create solids between given sections
3728 theSeqBases - list of sections (shell or face).
3729 theLocations - list of corresponding vertexes
3730 theName Object name; when specified, this parameter is used
3731 for result publication in the study. Otherwise, if automatic
3732 publication is switched on, default value is used for result name.
3735 New GEOM.GEOM_Object, containing the created solids.
3737 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3738 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3739 self._autoPublish(anObj, theName, "pipe")
3742 ## Create a shape by extrusion of the base shape along
3743 # the path shape with constant bi-normal direction along the given vector.
3744 # The path shape can be a wire or an edge.
3745 # @param theBase Base shape to be extruded.
3746 # @param thePath Path shape to extrude the base shape along it.
3747 # @param theVec Vector defines a constant binormal direction to keep the
3748 # same angle beetween the direction and the sections
3749 # along the sweep surface.
3750 # @param 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.
3754 # @return New GEOM.GEOM_Object, containing the created pipe.
3756 # @ref tui_creation_pipe "Example"
3757 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3759 Create a shape by extrusion of the base shape along
3760 the path shape with constant bi-normal direction along the given vector.
3761 The path shape can be a wire or an edge.
3764 theBase Base shape to be extruded.
3765 thePath Path shape to extrude the base shape along it.
3766 theVec Vector defines a constant binormal direction to keep the
3767 same angle beetween the direction and the sections
3768 along the sweep surface.
3769 theName Object name; when specified, this parameter is used
3770 for result publication in the study. Otherwise, if automatic
3771 publication is switched on, default value is used for result name.
3774 New GEOM.GEOM_Object, containing the created pipe.
3776 # Example: see GEOM_TestAll.py
3777 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3778 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3779 self._autoPublish(anObj, theName, "pipe")
3782 ## Makes a thick solid from a face or a shell
3783 # @param theShape Face or Shell to be thicken
3784 # @param theThickness Thickness of the resulting solid
3785 # @param theName Object name; when specified, this parameter is used
3786 # for result publication in the study. Otherwise, if automatic
3787 # publication is switched on, default value is used for result name.
3789 # @return New GEOM.GEOM_Object, containing the created solid
3791 def MakeThickSolid(self, theShape, theThickness, theName=None):
3793 Make a thick solid from a face or a shell
3796 theShape Face or Shell to be thicken
3797 theThickness Thickness of the resulting solid
3798 theName Object name; when specified, this parameter is used
3799 for result publication in the study. Otherwise, if automatic
3800 publication is switched on, default value is used for result name.
3803 New GEOM.GEOM_Object, containing the created solid
3805 # Example: see GEOM_TestAll.py
3806 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3807 RaiseIfFailed("MakeThickening", self.PrimOp)
3808 self._autoPublish(anObj, theName, "pipe")
3812 ## Modifies a face or a shell to make it a thick solid
3813 # @param theShape Face or Shell to be thicken
3814 # @param theThickness Thickness of the resulting solid
3816 # @return The modified shape
3818 def Thicken(self, theShape, theThickness):
3820 Modifies a face or a shell to make it a thick solid
3823 theBase Base shape to be extruded.
3824 thePath Path shape to extrude the base shape along it.
3825 theName Object name; when specified, this parameter is used
3826 for result publication in the study. Otherwise, if automatic
3827 publication is switched on, default value is used for result name.
3832 # Example: see GEOM_TestAll.py
3833 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3834 RaiseIfFailed("MakeThickening", self.PrimOp)
3837 ## Build a middle path of a pipe-like shape.
3838 # The path shape can be a wire or an edge.
3839 # @param theShape It can be closed or unclosed pipe-like shell
3840 # or a pipe-like solid.
3841 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3842 # should be wires or faces of theShape.
3843 # @param theName Object name; when specified, this parameter is used
3844 # for result publication in the study. Otherwise, if automatic
3845 # publication is switched on, default value is used for result name.
3847 # @note It is not assumed that exact or approximate copy of theShape
3848 # can be obtained by applying existing Pipe operation on the
3849 # resulting "Path" wire taking theBase1 as the base - it is not
3850 # always possible; though in some particular cases it might work
3851 # it is not guaranteed. Thus, RestorePath function should not be
3852 # considered as an exact reverse operation of the Pipe.
3854 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3855 # source pipe's "path".
3857 # @ref tui_creation_pipe_path "Example"
3858 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3860 Build a middle path of a pipe-like shape.
3861 The path shape can be a wire or an edge.
3864 theShape It can be closed or unclosed pipe-like shell
3865 or a pipe-like solid.
3866 theBase1, theBase2 Two bases of the supposed pipe. This
3867 should be wires or faces of theShape.
3868 theName Object name; when specified, this parameter is used
3869 for result publication in the study. Otherwise, if automatic
3870 publication is switched on, default value is used for result name.
3873 New GEOM_Object, containing an edge or wire that represent
3876 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3877 RaiseIfFailed("RestorePath", self.PrimOp)
3878 self._autoPublish(anObj, theName, "path")
3881 ## Build a middle path of a pipe-like shape.
3882 # The path shape can be a wire or an edge.
3883 # @param theShape It can be closed or unclosed pipe-like shell
3884 # or a pipe-like solid.
3885 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3886 # should be lists of edges of theShape.
3887 # @param theName Object name; when specified, this parameter is used
3888 # for result publication in the study. Otherwise, if automatic
3889 # publication is switched on, default value is used for result name.
3891 # @note It is not assumed that exact or approximate copy of theShape
3892 # can be obtained by applying existing Pipe operation on the
3893 # resulting "Path" wire taking theBase1 as the base - it is not
3894 # always possible; though in some particular cases it might work
3895 # it is not guaranteed. Thus, RestorePath function should not be
3896 # considered as an exact reverse operation of the Pipe.
3898 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3899 # source pipe's "path".
3901 # @ref tui_creation_pipe_path "Example"
3902 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3904 Build a middle path of a pipe-like shape.
3905 The path shape can be a wire or an edge.
3908 theShape It can be closed or unclosed pipe-like shell
3909 or a pipe-like solid.
3910 listEdges1, listEdges2 Two bases of the supposed pipe. This
3911 should be lists of edges of theShape.
3912 theName Object name; when specified, this parameter is used
3913 for result publication in the study. Otherwise, if automatic
3914 publication is switched on, default value is used for result name.
3917 New GEOM_Object, containing an edge or wire that represent
3920 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3921 RaiseIfFailed("RestorePath", self.PrimOp)
3922 self._autoPublish(anObj, theName, "path")
3928 ## @addtogroup l3_advanced
3931 ## Create a linear edge with specified ends.
3932 # @param thePnt1 Point for the first end of edge.
3933 # @param thePnt2 Point for the second end of edge.
3934 # @param theName Object name; when specified, this parameter is used
3935 # for result publication in the study. Otherwise, if automatic
3936 # publication is switched on, default value is used for result name.
3938 # @return New GEOM.GEOM_Object, containing the created edge.
3940 # @ref tui_creation_edge "Example"
3941 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3943 Create a linear edge with specified ends.
3946 thePnt1 Point for the first end of edge.
3947 thePnt2 Point for the second end of edge.
3948 theName Object name; when specified, this parameter is used
3949 for result publication in the study. Otherwise, if automatic
3950 publication is switched on, default value is used for result name.
3953 New GEOM.GEOM_Object, containing the created edge.
3955 # Example: see GEOM_TestAll.py
3956 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3957 RaiseIfFailed("MakeEdge", self.ShapesOp)
3958 self._autoPublish(anObj, theName, "edge")
3961 ## Create a new edge, corresponding to the given length on the given curve.
3962 # @param theRefCurve The referenced curve (edge).
3963 # @param theLength Length on the referenced curve. It can be negative.
3964 # @param theStartPoint Any point can be selected for it, the new edge will begin
3965 # at the end of \a theRefCurve, close to the selected point.
3966 # If None, start from the first point of \a theRefCurve.
3967 # @param theName Object name; when specified, this parameter is used
3968 # for result publication in the study. Otherwise, if automatic
3969 # publication is switched on, default value is used for result name.
3971 # @return New GEOM.GEOM_Object, containing the created edge.
3973 # @ref tui_creation_edge "Example"
3974 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
3976 Create a new edge, corresponding to the given length on the given curve.
3979 theRefCurve The referenced curve (edge).
3980 theLength Length on the referenced curve. It can be negative.
3981 theStartPoint Any point can be selected for it, the new edge will begin
3982 at the end of theRefCurve, close to the selected point.
3983 If None, start from the first point of theRefCurve.
3984 theName Object name; when specified, this parameter is used
3985 for result publication in the study. Otherwise, if automatic
3986 publication is switched on, default value is used for result name.
3989 New GEOM.GEOM_Object, containing the created edge.
3991 # Example: see GEOM_TestAll.py
3992 theLength, Parameters = ParseParameters(theLength)
3993 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
3994 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
3995 anObj.SetParameters(Parameters)
3996 self._autoPublish(anObj, theName, "edge")
3999 ## Create an edge from specified wire.
4000 # @param theWire source Wire
4001 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4002 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4003 # @param theName Object name; when specified, this parameter is used
4004 # for result publication in the study. Otherwise, if automatic
4005 # publication is switched on, default value is used for result name.
4007 # @return New GEOM.GEOM_Object, containing the created edge.
4009 # @ref tui_creation_edge "Example"
4010 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4012 Create an edge from specified wire.
4016 theLinearTolerance linear tolerance value (default = 1e-07)
4017 theAngularTolerance angular tolerance value (default = 1e-12)
4018 theName Object name; when specified, this parameter is used
4019 for result publication in the study. Otherwise, if automatic
4020 publication is switched on, default value is used for result name.
4023 New GEOM.GEOM_Object, containing the created edge.
4025 # Example: see GEOM_TestAll.py
4026 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4027 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4028 self._autoPublish(anObj, theName, "edge")
4031 ## Create a wire from the set of edges and wires.
4032 # @param theEdgesAndWires List of edges and/or wires.
4033 # @param theTolerance Maximum distance between vertices, that will be merged.
4034 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4035 # @param theName Object name; when specified, this parameter is used
4036 # for result publication in the study. Otherwise, if automatic
4037 # publication is switched on, default value is used for result name.
4039 # @return New GEOM.GEOM_Object, containing the created wire.
4041 # @ref tui_creation_wire "Example"
4042 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4044 Create a wire from the set of edges and wires.
4047 theEdgesAndWires List of edges and/or wires.
4048 theTolerance Maximum distance between vertices, that will be merged.
4049 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4050 theName Object name; when specified, this parameter is used
4051 for result publication in the study. Otherwise, if automatic
4052 publication is switched on, default value is used for result name.
4055 New GEOM.GEOM_Object, containing the created wire.
4057 # Example: see GEOM_TestAll.py
4058 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4059 RaiseIfFailed("MakeWire", self.ShapesOp)
4060 self._autoPublish(anObj, theName, "wire")
4063 ## Create a face on the given wire.
4064 # @param theWire closed Wire or Edge to build the face on.
4065 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4066 # If the tolerance of the obtained planar face is less
4067 # than 1e-06, this face will be returned, otherwise the
4068 # algorithm tries to build any suitable face on the given
4069 # wire and prints a warning message.
4070 # @param 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.
4074 # @return New GEOM.GEOM_Object, containing the created face.
4076 # @ref tui_creation_face "Example"
4077 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4079 Create a face on the given wire.
4082 theWire closed Wire or Edge to build the face on.
4083 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4084 If the tolerance of the obtained planar face is less
4085 than 1e-06, this face will be returned, otherwise the
4086 algorithm tries to build any suitable face on the given
4087 wire and prints a warning message.
4088 theName Object name; when specified, this parameter is used
4089 for result publication in the study. Otherwise, if automatic
4090 publication is switched on, default value is used for result name.
4093 New GEOM.GEOM_Object, containing the created face.
4095 # Example: see GEOM_TestAll.py
4096 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4097 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4098 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4100 RaiseIfFailed("MakeFace", self.ShapesOp)
4101 self._autoPublish(anObj, theName, "face")
4104 ## Create a face on the given wires set.
4105 # @param theWires List of closed wires or edges to build the face on.
4106 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4107 # If the tolerance of the obtained planar face is less
4108 # than 1e-06, this face will be returned, otherwise the
4109 # algorithm tries to build any suitable face on the given
4110 # wire and prints a warning message.
4111 # @param theName Object name; when specified, this parameter is used
4112 # for result publication in the study. Otherwise, if automatic
4113 # publication is switched on, default value is used for result name.
4115 # @return New GEOM.GEOM_Object, containing the created face.
4117 # @ref tui_creation_face "Example"
4118 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4120 Create a face on the given wires set.
4123 theWires List of closed wires or edges to build the face on.
4124 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4125 If the tolerance of the obtained planar face is less
4126 than 1e-06, this face will be returned, otherwise the
4127 algorithm tries to build any suitable face on the given
4128 wire and prints a warning message.
4129 theName Object name; when specified, this parameter is used
4130 for result publication in the study. Otherwise, if automatic
4131 publication is switched on, default value is used for result name.
4134 New GEOM.GEOM_Object, containing the created face.
4136 # Example: see GEOM_TestAll.py
4137 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4138 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4139 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4141 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4142 self._autoPublish(anObj, theName, "face")
4145 ## See MakeFaceWires() method for details.
4147 # @ref tui_creation_face "Example 1"
4148 # \n @ref swig_MakeFaces "Example 2"
4149 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4151 See geompy.MakeFaceWires() method for details.
4153 # Example: see GEOM_TestOthers.py
4154 # note: auto-publishing is done in self.MakeFaceWires()
4155 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4158 ## Create a shell from the set of faces and shells.
4159 # @param theFacesAndShells List of faces and/or shells.
4160 # @param theName Object name; when specified, this parameter is used
4161 # for result publication in the study. Otherwise, if automatic
4162 # publication is switched on, default value is used for result name.
4164 # @return New GEOM.GEOM_Object, containing the created shell.
4166 # @ref tui_creation_shell "Example"
4167 def MakeShell(self, theFacesAndShells, theName=None):
4169 Create a shell from the set of faces and shells.
4172 theFacesAndShells List of faces and/or shells.
4173 theName Object name; when specified, this parameter is used
4174 for result publication in the study. Otherwise, if automatic
4175 publication is switched on, default value is used for result name.
4178 New GEOM.GEOM_Object, containing the created shell.
4180 # Example: see GEOM_TestAll.py
4181 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4182 RaiseIfFailed("MakeShell", self.ShapesOp)
4183 self._autoPublish(anObj, theName, "shell")
4186 ## Create a solid, bounded by the given shells.
4187 # @param theShells Sequence of bounding shells.
4188 # @param theName Object name; when specified, this parameter is used
4189 # for result publication in the study. Otherwise, if automatic
4190 # publication is switched on, default value is used for result name.
4192 # @return New GEOM.GEOM_Object, containing the created solid.
4194 # @ref tui_creation_solid "Example"
4195 def MakeSolid(self, theShells, theName=None):
4197 Create a solid, bounded by the given shells.
4200 theShells Sequence of bounding shells.
4201 theName Object name; when specified, this parameter is used
4202 for result publication in the study. Otherwise, if automatic
4203 publication is switched on, default value is used for result name.
4206 New GEOM.GEOM_Object, containing the created solid.
4208 # Example: see GEOM_TestAll.py
4209 if len(theShells) == 1:
4210 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4212 # raise RuntimeError, "MakeSolidShells : " + descr
4213 if descr == "WRN_SHAPE_UNCLOSED":
4214 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4215 anObj = self.ShapesOp.MakeSolidShells(theShells)
4216 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4217 self._autoPublish(anObj, theName, "solid")
4220 ## Create a compound of the given shapes.
4221 # @param theShapes List of shapes to put in compound.
4222 # @param theName Object name; when specified, this parameter is used
4223 # for result publication in the study. Otherwise, if automatic
4224 # publication is switched on, default value is used for result name.
4226 # @return New GEOM.GEOM_Object, containing the created compound.
4228 # @ref tui_creation_compound "Example"
4229 def MakeCompound(self, theShapes, theName=None):
4231 Create a compound of the given shapes.
4234 theShapes List of shapes to put in compound.
4235 theName Object name; when specified, this parameter is used
4236 for result publication in the study. Otherwise, if automatic
4237 publication is switched on, default value is used for result name.
4240 New GEOM.GEOM_Object, containing the created compound.
4242 # Example: see GEOM_TestAll.py
4243 anObj = self.ShapesOp.MakeCompound(theShapes)
4244 RaiseIfFailed("MakeCompound", self.ShapesOp)
4245 self._autoPublish(anObj, theName, "compound")
4248 # end of l3_advanced
4251 ## @addtogroup l2_measure
4254 ## Gives quantity of faces in the given shape.
4255 # @param theShape Shape to count faces of.
4256 # @return Quantity of faces.
4258 # @ref swig_NumberOf "Example"
4259 def NumberOfFaces(self, theShape):
4261 Gives quantity of faces in the given shape.
4264 theShape Shape to count faces of.
4269 # Example: see GEOM_TestOthers.py
4270 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4271 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4274 ## Gives quantity of edges in the given shape.
4275 # @param theShape Shape to count edges of.
4276 # @return Quantity of edges.
4278 # @ref swig_NumberOf "Example"
4279 def NumberOfEdges(self, theShape):
4281 Gives quantity of edges in the given shape.
4284 theShape Shape to count edges of.
4289 # Example: see GEOM_TestOthers.py
4290 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4291 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4294 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4295 # @param theShape Shape to count sub-shapes of.
4296 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4297 # @return Quantity of sub-shapes of given type.
4299 # @ref swig_NumberOf "Example"
4300 def NumberOfSubShapes(self, theShape, theShapeType):
4302 Gives quantity of sub-shapes of type theShapeType in the given shape.
4305 theShape Shape to count sub-shapes of.
4306 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4309 Quantity of sub-shapes of given type.
4311 # Example: see GEOM_TestOthers.py
4312 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4313 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4316 ## Gives quantity of solids in the given shape.
4317 # @param theShape Shape to count solids in.
4318 # @return Quantity of solids.
4320 # @ref swig_NumberOf "Example"
4321 def NumberOfSolids(self, theShape):
4323 Gives quantity of solids in the given shape.
4326 theShape Shape to count solids in.
4331 # Example: see GEOM_TestOthers.py
4332 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4333 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4339 ## @addtogroup l3_healing
4342 ## Reverses an orientation the given shape.
4343 # @param theShape Shape to be reversed.
4344 # @param theName Object name; when specified, this parameter is used
4345 # for result publication in the study. Otherwise, if automatic
4346 # publication is switched on, default value is used for result name.
4348 # @return The reversed copy of theShape.
4350 # @ref swig_ChangeOrientation "Example"
4351 def ChangeOrientation(self, theShape, theName=None):
4353 Reverses an orientation the given shape.
4356 theShape Shape to be reversed.
4357 theName Object name; when specified, this parameter is used
4358 for result publication in the study. Otherwise, if automatic
4359 publication is switched on, default value is used for result name.
4362 The reversed copy of theShape.
4364 # Example: see GEOM_TestAll.py
4365 anObj = self.ShapesOp.ChangeOrientation(theShape)
4366 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4367 self._autoPublish(anObj, theName, "reversed")
4370 ## See ChangeOrientation() method for details.
4372 # @ref swig_OrientationChange "Example"
4373 def OrientationChange(self, theShape, theName=None):
4375 See geompy.ChangeOrientation method for details.
4377 # Example: see GEOM_TestOthers.py
4378 # note: auto-publishing is done in self.ChangeOrientation()
4379 anObj = self.ChangeOrientation(theShape, theName)
4385 ## @addtogroup l4_obtain
4388 ## Retrieve all free faces from the given shape.
4389 # Free face is a face, which is not shared between two shells of the shape.
4390 # @param theShape Shape to find free faces in.
4391 # @return List of IDs of all free faces, contained in theShape.
4393 # @ref tui_measurement_tools_page "Example"
4394 def GetFreeFacesIDs(self,theShape):
4396 Retrieve all free faces from the given shape.
4397 Free face is a face, which is not shared between two shells of the shape.
4400 theShape Shape to find free faces in.
4403 List of IDs of all free faces, contained in theShape.
4405 # Example: see GEOM_TestOthers.py
4406 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4407 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4410 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4411 # @param theShape1 Shape to find sub-shapes in.
4412 # @param theShape2 Shape to find shared sub-shapes with.
4413 # @param theShapeType Type of sub-shapes to be retrieved.
4414 # @param theName Object name; when specified, this parameter is used
4415 # for result publication in the study. Otherwise, if automatic
4416 # publication is switched on, default value is used for result name.
4418 # @return List of sub-shapes of theShape1, shared with theShape2.
4420 # @ref swig_GetSharedShapes "Example"
4421 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4423 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4426 theShape1 Shape to find sub-shapes in.
4427 theShape2 Shape to find shared sub-shapes with.
4428 theShapeType Type of sub-shapes to be retrieved.
4429 theName Object name; when specified, this parameter is used
4430 for result publication in the study. Otherwise, if automatic
4431 publication is switched on, default value is used for result name.
4434 List of sub-shapes of theShape1, shared with theShape2.
4436 # Example: see GEOM_TestOthers.py
4437 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4438 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4439 self._autoPublish(aList, theName, "shared")
4442 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4443 # @param theShapes Shapes to find common sub-shapes of.
4444 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4445 # @param theName Object name; when specified, this parameter is used
4446 # for result publication in the study. Otherwise, if automatic
4447 # publication is switched on, default value is used for result name.
4449 # @return List of objects, that are sub-shapes of all given shapes.
4451 # @ref swig_GetSharedShapes "Example"
4452 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4454 Get all sub-shapes, shared by all shapes in the list theShapes.
4457 theShapes Shapes to find common sub-shapes of.
4458 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4459 theName Object name; when specified, this parameter is used
4460 for result publication in the study. Otherwise, if automatic
4461 publication is switched on, default value is used for result name.
4464 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4466 # Example: see GEOM_TestOthers.py
4467 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4468 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4469 self._autoPublish(aList, theName, "shared")
4472 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4473 # situated relatively the specified plane by the certain way,
4474 # defined through <VAR>theState</VAR> parameter.
4475 # @param theShape Shape to find sub-shapes of.
4476 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4477 # @param theAx1 Vector (or line, or linear edge), specifying normal
4478 # direction and location of the plane to find shapes on.
4479 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4480 # @param theName Object name; when specified, this parameter is used
4481 # for result publication in the study. Otherwise, if automatic
4482 # publication is switched on, default value is used for result name.
4484 # @return List of all found sub-shapes.
4486 # @ref swig_GetShapesOnPlane "Example"
4487 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4489 Find in theShape all sub-shapes of type theShapeType,
4490 situated relatively the specified plane by the certain way,
4491 defined through theState parameter.
4494 theShape Shape to find sub-shapes of.
4495 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4496 theAx1 Vector (or line, or linear edge), specifying normal
4497 direction and location of the plane to find shapes on.
4498 theState The state of the sub-shapes to find (see GEOM::shape_state)
4499 theName Object name; when specified, this parameter is used
4500 for result publication in the study. Otherwise, if automatic
4501 publication is switched on, default value is used for result name.
4504 List of all found sub-shapes.
4506 # Example: see GEOM_TestOthers.py
4507 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4508 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4509 self._autoPublish(aList, theName, "shapeOnPlane")
4512 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4513 # situated relatively the specified plane by the certain way,
4514 # defined through <VAR>theState</VAR> parameter.
4515 # @param theShape Shape to find sub-shapes of.
4516 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4517 # @param theAx1 Vector (or line, or linear edge), specifying normal
4518 # direction and location of the plane to find shapes on.
4519 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4521 # @return List of all found sub-shapes indices.
4523 # @ref swig_GetShapesOnPlaneIDs "Example"
4524 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4526 Find in theShape all sub-shapes of type theShapeType,
4527 situated relatively the specified plane by the certain way,
4528 defined through theState parameter.
4531 theShape Shape to find sub-shapes of.
4532 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4533 theAx1 Vector (or line, or linear edge), specifying normal
4534 direction and location of the plane to find shapes on.
4535 theState The state of the sub-shapes to find (see GEOM::shape_state)
4538 List of all found sub-shapes indices.
4540 # Example: see GEOM_TestOthers.py
4541 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4542 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4545 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4546 # situated relatively the specified plane by the certain way,
4547 # defined through <VAR>theState</VAR> parameter.
4548 # @param theShape Shape to find sub-shapes of.
4549 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4550 # @param theAx1 Vector (or line, or linear edge), specifying normal
4551 # direction of the plane to find shapes on.
4552 # @param thePnt Point specifying location of the plane to find shapes on.
4553 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4554 # @param theName Object name; when specified, this parameter is used
4555 # for result publication in the study. Otherwise, if automatic
4556 # publication is switched on, default value is used for result name.
4558 # @return List of all found sub-shapes.
4560 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4561 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4563 Find in theShape all sub-shapes of type theShapeType,
4564 situated relatively the specified plane by the certain way,
4565 defined through theState parameter.
4568 theShape Shape to find sub-shapes of.
4569 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4570 theAx1 Vector (or line, or linear edge), specifying normal
4571 direction and location of the plane to find shapes on.
4572 thePnt Point specifying location of the plane to find shapes on.
4573 theState The state of the sub-shapes to find (see GEOM::shape_state)
4574 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.
4579 List of all found sub-shapes.
4581 # Example: see GEOM_TestOthers.py
4582 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4583 theAx1, thePnt, theState)
4584 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4585 self._autoPublish(aList, theName, "shapeOnPlane")
4588 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4589 # situated relatively the specified plane by the certain way,
4590 # defined through <VAR>theState</VAR> parameter.
4591 # @param theShape Shape to find sub-shapes of.
4592 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4593 # @param theAx1 Vector (or line, or linear edge), specifying normal
4594 # direction of the plane to find shapes on.
4595 # @param thePnt Point specifying location of the plane to find shapes on.
4596 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4598 # @return List of all found sub-shapes indices.
4600 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4601 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4603 Find in theShape all sub-shapes of type theShapeType,
4604 situated relatively the specified plane by the certain way,
4605 defined through theState parameter.
4608 theShape Shape to find sub-shapes of.
4609 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4610 theAx1 Vector (or line, or linear edge), specifying normal
4611 direction and location of the plane to find shapes on.
4612 thePnt Point specifying location of the plane to find shapes on.
4613 theState The state of the sub-shapes to find (see GEOM::shape_state)
4616 List of all found sub-shapes indices.
4618 # Example: see GEOM_TestOthers.py
4619 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4620 theAx1, thePnt, theState)
4621 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4624 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4625 # the specified cylinder by the certain way, defined through \a theState parameter.
4626 # @param theShape Shape to find sub-shapes of.
4627 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4628 # @param theAxis Vector (or line, or linear edge), specifying
4629 # axis of the cylinder to find shapes on.
4630 # @param theRadius Radius of the cylinder to find shapes on.
4631 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4632 # @param theName Object name; when specified, this parameter is used
4633 # for result publication in the study. Otherwise, if automatic
4634 # publication is switched on, default value is used for result name.
4636 # @return List of all found sub-shapes.
4638 # @ref swig_GetShapesOnCylinder "Example"
4639 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4641 Find in theShape all sub-shapes of type theShapeType, situated relatively
4642 the specified cylinder by the certain way, defined through theState parameter.
4645 theShape Shape to find sub-shapes of.
4646 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4647 theAxis Vector (or line, or linear edge), specifying
4648 axis of the cylinder to find shapes on.
4649 theRadius Radius of the cylinder to find shapes on.
4650 theState The state of the sub-shapes to find (see GEOM::shape_state)
4651 theName Object name; when specified, this parameter is used
4652 for result publication in the study. Otherwise, if automatic
4653 publication is switched on, default value is used for result name.
4656 List of all found sub-shapes.
4658 # Example: see GEOM_TestOthers.py
4659 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4660 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4661 self._autoPublish(aList, theName, "shapeOnCylinder")
4664 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4665 # the specified cylinder by the certain way, defined through \a theState parameter.
4666 # @param theShape Shape to find sub-shapes of.
4667 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4668 # @param theAxis Vector (or line, or linear edge), specifying
4669 # axis of the cylinder to find shapes on.
4670 # @param theRadius Radius of the cylinder to find shapes on.
4671 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4673 # @return List of all found sub-shapes indices.
4675 # @ref swig_GetShapesOnCylinderIDs "Example"
4676 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4678 Find in theShape all sub-shapes of type theShapeType, situated relatively
4679 the specified cylinder by the certain way, defined through theState parameter.
4682 theShape Shape to find sub-shapes of.
4683 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4684 theAxis Vector (or line, or linear edge), specifying
4685 axis of the cylinder to find shapes on.
4686 theRadius Radius of the cylinder to find shapes on.
4687 theState The state of the sub-shapes to find (see GEOM::shape_state)
4690 List of all found sub-shapes indices.
4692 # Example: see GEOM_TestOthers.py
4693 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4694 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4697 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4698 # the specified cylinder by the certain way, defined through \a theState parameter.
4699 # @param theShape Shape to find sub-shapes of.
4700 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4701 # @param theAxis Vector (or line, or linear edge), specifying
4702 # axis of the cylinder to find shapes on.
4703 # @param thePnt Point specifying location of the bottom of the cylinder.
4704 # @param theRadius Radius of the cylinder to find shapes on.
4705 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4706 # @param theName Object name; when specified, this parameter is used
4707 # for result publication in the study. Otherwise, if automatic
4708 # publication is switched on, default value is used for result name.
4710 # @return List of all found sub-shapes.
4712 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4713 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4715 Find in theShape all sub-shapes of type theShapeType, situated relatively
4716 the specified cylinder by the certain way, defined through theState parameter.
4719 theShape Shape to find sub-shapes of.
4720 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4721 theAxis Vector (or line, or linear edge), specifying
4722 axis of the cylinder to find shapes on.
4723 theRadius Radius of the cylinder to find shapes on.
4724 theState The state of the sub-shapes to find (see GEOM::shape_state)
4725 theName Object name; when specified, this parameter is used
4726 for result publication in the study. Otherwise, if automatic
4727 publication is switched on, default value is used for result name.
4730 List of all found sub-shapes.
4732 # Example: see GEOM_TestOthers.py
4733 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4734 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4735 self._autoPublish(aList, theName, "shapeOnCylinder")
4738 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4739 # the specified cylinder by the certain way, defined through \a theState parameter.
4740 # @param theShape Shape to find sub-shapes of.
4741 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4742 # @param theAxis Vector (or line, or linear edge), specifying
4743 # axis of the cylinder to find shapes on.
4744 # @param thePnt Point specifying location of the bottom of the cylinder.
4745 # @param theRadius Radius of the cylinder to find shapes on.
4746 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4748 # @return List of all found sub-shapes indices
4750 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4751 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4753 Find in theShape all sub-shapes of type theShapeType, situated relatively
4754 the specified cylinder by the certain way, defined through theState parameter.
4757 theShape Shape to find sub-shapes of.
4758 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4759 theAxis Vector (or line, or linear edge), specifying
4760 axis of the cylinder to find shapes on.
4761 theRadius Radius of the cylinder to find shapes on.
4762 theState The state of the sub-shapes to find (see GEOM::shape_state)
4765 List of all found sub-shapes indices.
4767 # Example: see GEOM_TestOthers.py
4768 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4769 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4772 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4773 # the specified sphere by the certain way, defined through \a theState parameter.
4774 # @param theShape Shape to find sub-shapes of.
4775 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4776 # @param theCenter Point, specifying center of the sphere to find shapes on.
4777 # @param theRadius Radius of the sphere to find shapes on.
4778 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4779 # @param theName Object name; when specified, this parameter is used
4780 # for result publication in the study. Otherwise, if automatic
4781 # publication is switched on, default value is used for result name.
4783 # @return List of all found sub-shapes.
4785 # @ref swig_GetShapesOnSphere "Example"
4786 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4788 Find in theShape all sub-shapes of type theShapeType, situated relatively
4789 the specified sphere by the certain way, defined through theState parameter.
4792 theShape Shape to find sub-shapes of.
4793 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4794 theCenter Point, specifying center of the sphere to find shapes on.
4795 theRadius Radius of the sphere to find shapes on.
4796 theState The state of the sub-shapes to find (see GEOM::shape_state)
4797 theName Object name; when specified, this parameter is used
4798 for result publication in the study. Otherwise, if automatic
4799 publication is switched on, default value is used for result name.
4802 List of all found sub-shapes.
4804 # Example: see GEOM_TestOthers.py
4805 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4806 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4807 self._autoPublish(aList, theName, "shapeOnSphere")
4810 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4811 # the specified sphere by the certain way, defined through \a theState parameter.
4812 # @param theShape Shape to find sub-shapes of.
4813 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4814 # @param theCenter Point, specifying center of the sphere to find shapes on.
4815 # @param theRadius Radius of the sphere to find shapes on.
4816 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4818 # @return List of all found sub-shapes indices.
4820 # @ref swig_GetShapesOnSphereIDs "Example"
4821 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4823 Find in theShape all sub-shapes of type theShapeType, situated relatively
4824 the specified sphere by the certain way, defined through theState parameter.
4827 theShape Shape to find sub-shapes of.
4828 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4829 theCenter Point, specifying center of the sphere to find shapes on.
4830 theRadius Radius of the sphere to find shapes on.
4831 theState The state of the sub-shapes to find (see GEOM::shape_state)
4834 List of all found sub-shapes indices.
4836 # Example: see GEOM_TestOthers.py
4837 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4838 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4841 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4842 # the specified quadrangle by the certain way, defined through \a theState parameter.
4843 # @param theShape Shape to find sub-shapes of.
4844 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4845 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4846 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4847 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4848 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4849 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4850 # @param theName Object name; when specified, this parameter is used
4851 # for result publication in the study. Otherwise, if automatic
4852 # publication is switched on, default value is used for result name.
4854 # @return List of all found sub-shapes.
4856 # @ref swig_GetShapesOnQuadrangle "Example"
4857 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4858 theTopLeftPoint, theTopRigthPoint,
4859 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4861 Find in theShape all sub-shapes of type theShapeType, situated relatively
4862 the specified quadrangle by the certain way, defined through theState parameter.
4865 theShape Shape to find sub-shapes of.
4866 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4867 theTopLeftPoint Point, specifying top left corner of a quadrangle
4868 theTopRigthPoint Point, specifying top right corner of a quadrangle
4869 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4870 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4871 theState The state of the sub-shapes to find (see GEOM::shape_state)
4872 theName Object name; when specified, this parameter is used
4873 for result publication in the study. Otherwise, if automatic
4874 publication is switched on, default value is used for result name.
4877 List of all found sub-shapes.
4879 # Example: see GEOM_TestOthers.py
4880 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4881 theTopLeftPoint, theTopRigthPoint,
4882 theBottomLeftPoint, theBottomRigthPoint, theState)
4883 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4884 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4887 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4888 # the specified quadrangle by the certain way, defined through \a theState parameter.
4889 # @param theShape Shape to find sub-shapes of.
4890 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4891 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4892 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4893 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4894 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4895 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4897 # @return List of all found sub-shapes indices.
4899 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4900 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4901 theTopLeftPoint, theTopRigthPoint,
4902 theBottomLeftPoint, theBottomRigthPoint, theState):
4904 Find in theShape all sub-shapes of type theShapeType, situated relatively
4905 the specified quadrangle by the certain way, defined through theState parameter.
4908 theShape Shape to find sub-shapes of.
4909 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4910 theTopLeftPoint Point, specifying top left corner of a quadrangle
4911 theTopRigthPoint Point, specifying top right corner of a quadrangle
4912 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4913 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4914 theState The state of the sub-shapes to find (see GEOM::shape_state)
4917 List of all found sub-shapes indices.
4920 # Example: see GEOM_TestOthers.py
4921 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4922 theTopLeftPoint, theTopRigthPoint,
4923 theBottomLeftPoint, theBottomRigthPoint, theState)
4924 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4927 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4928 # the specified \a theBox by the certain way, defined through \a theState parameter.
4929 # @param theBox Shape for relative comparing.
4930 # @param theShape Shape to find sub-shapes of.
4931 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4932 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4933 # @param theName Object name; when specified, this parameter is used
4934 # for result publication in the study. Otherwise, if automatic
4935 # publication is switched on, default value is used for result name.
4937 # @return List of all found sub-shapes.
4939 # @ref swig_GetShapesOnBox "Example"
4940 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4942 Find in theShape all sub-shapes of type theShapeType, situated relatively
4943 the specified theBox by the certain way, defined through theState parameter.
4946 theBox Shape for relative comparing.
4947 theShape Shape to find sub-shapes of.
4948 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4949 theState The state of the sub-shapes to find (see GEOM::shape_state)
4950 theName Object name; when specified, this parameter is used
4951 for result publication in the study. Otherwise, if automatic
4952 publication is switched on, default value is used for result name.
4955 List of all found sub-shapes.
4957 # Example: see GEOM_TestOthers.py
4958 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
4959 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
4960 self._autoPublish(aList, theName, "shapeOnBox")
4963 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4964 # the specified \a theBox by the certain way, defined through \a theState parameter.
4965 # @param theBox Shape for relative comparing.
4966 # @param theShape Shape to find sub-shapes of.
4967 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4968 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4970 # @return List of all found sub-shapes indices.
4972 # @ref swig_GetShapesOnBoxIDs "Example"
4973 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
4975 Find in theShape all sub-shapes of type theShapeType, situated relatively
4976 the specified theBox by the certain way, defined through theState parameter.
4979 theBox Shape for relative comparing.
4980 theShape Shape to find sub-shapes of.
4981 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4982 theState The state of the sub-shapes to find (see GEOM::shape_state)
4985 List of all found sub-shapes indices.
4987 # Example: see GEOM_TestOthers.py
4988 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
4989 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
4992 ## Find in \a theShape all sub-shapes of type \a theShapeType,
4993 # situated relatively the specified \a theCheckShape by the
4994 # certain way, defined through \a theState parameter.
4995 # @param theCheckShape Shape for relative comparing. It must be a solid.
4996 # @param theShape Shape to find sub-shapes of.
4997 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4998 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4999 # @param theName Object name; when specified, this parameter is used
5000 # for result publication in the study. Otherwise, if automatic
5001 # publication is switched on, default value is used for result name.
5003 # @return List of all found sub-shapes.
5005 # @ref swig_GetShapesOnShape "Example"
5006 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5008 Find in theShape all sub-shapes of type theShapeType,
5009 situated relatively the specified theCheckShape by the
5010 certain way, defined through theState parameter.
5013 theCheckShape Shape for relative comparing. It must be a solid.
5014 theShape Shape to find sub-shapes of.
5015 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5016 theState The state of the sub-shapes to find (see GEOM::shape_state)
5017 theName Object name; when specified, this parameter is used
5018 for result publication in the study. Otherwise, if automatic
5019 publication is switched on, default value is used for result name.
5022 List of all found sub-shapes.
5024 # Example: see GEOM_TestOthers.py
5025 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5026 theShapeType, theState)
5027 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5028 self._autoPublish(aList, theName, "shapeOnShape")
5031 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5032 # situated relatively the specified \a theCheckShape by the
5033 # certain way, defined through \a theState parameter.
5034 # @param theCheckShape Shape for relative comparing. It must be a solid.
5035 # @param theShape Shape to find sub-shapes of.
5036 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5037 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5038 # @param theName Object name; when specified, this parameter is used
5039 # for result publication in the study. Otherwise, if automatic
5040 # publication is switched on, default value is used for result name.
5042 # @return All found sub-shapes as compound.
5044 # @ref swig_GetShapesOnShapeAsCompound "Example"
5045 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5047 Find in theShape all sub-shapes of type theShapeType,
5048 situated relatively the specified theCheckShape by the
5049 certain way, defined through theState parameter.
5052 theCheckShape Shape for relative comparing. It must be a solid.
5053 theShape Shape to find sub-shapes of.
5054 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5055 theState The state of the sub-shapes to find (see GEOM::shape_state)
5056 theName Object name; when specified, this parameter is used
5057 for result publication in the study. Otherwise, if automatic
5058 publication is switched on, default value is used for result name.
5061 All found sub-shapes as compound.
5063 # Example: see GEOM_TestOthers.py
5064 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5065 theShapeType, theState)
5066 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5067 self._autoPublish(anObj, theName, "shapeOnShape")
5070 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5071 # situated relatively the specified \a theCheckShape by the
5072 # certain way, defined through \a theState parameter.
5073 # @param theCheckShape Shape for relative comparing. It must be a solid.
5074 # @param theShape Shape to find sub-shapes of.
5075 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5076 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5078 # @return List of all found sub-shapes indices.
5080 # @ref swig_GetShapesOnShapeIDs "Example"
5081 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5083 Find in theShape all sub-shapes of type theShapeType,
5084 situated relatively the specified theCheckShape by the
5085 certain way, defined through theState parameter.
5088 theCheckShape Shape for relative comparing. It must be a solid.
5089 theShape Shape to find sub-shapes of.
5090 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5091 theState The state of the sub-shapes to find (see GEOM::shape_state)
5094 List of all found sub-shapes indices.
5096 # Example: see GEOM_TestOthers.py
5097 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5098 theShapeType, theState)
5099 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5102 ## Get sub-shape(s) of theShapeWhere, which are
5103 # coincident with \a theShapeWhat or could be a part of it.
5104 # @param theShapeWhere Shape to find sub-shapes of.
5105 # @param theShapeWhat Shape, specifying what to find.
5106 # @param isNewImplementation implementation of GetInPlace functionality
5107 # (default = False, old alghorithm based on shape properties)
5108 # @param theName Object name; when specified, this parameter is used
5109 # for result publication in the study. Otherwise, if automatic
5110 # publication is switched on, default value is used for result name.
5112 # @return Group of all found sub-shapes or a single found sub-shape.
5114 # @note This function has a restriction on argument shapes.
5115 # If \a theShapeWhere has curved parts with significantly
5116 # outstanding centres (i.e. the mass centre of a part is closer to
5117 # \a theShapeWhat than to the part), such parts will not be found.
5118 # @image html get_in_place_lost_part.png
5120 # @ref swig_GetInPlace "Example"
5121 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5123 Get sub-shape(s) of theShapeWhere, which are
5124 coincident with theShapeWhat or could be a part of it.
5127 theShapeWhere Shape to find sub-shapes of.
5128 theShapeWhat Shape, specifying what to find.
5129 isNewImplementation Implementation of GetInPlace functionality
5130 (default = False, old alghorithm based on shape properties)
5131 theName Object name; when specified, this parameter is used
5132 for result publication in the study. Otherwise, if automatic
5133 publication is switched on, default value is used for result name.
5136 Group of all found sub-shapes or a single found sub-shape.
5140 This function has a restriction on argument shapes.
5141 If theShapeWhere has curved parts with significantly
5142 outstanding centres (i.e. the mass centre of a part is closer to
5143 theShapeWhat than to the part), such parts will not be found.
5145 # Example: see GEOM_TestOthers.py
5147 if isNewImplementation:
5148 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5150 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5152 RaiseIfFailed("GetInPlace", self.ShapesOp)
5153 self._autoPublish(anObj, theName, "inplace")
5156 ## Get sub-shape(s) of \a theShapeWhere, which are
5157 # coincident with \a theShapeWhat or could be a part of it.
5159 # Implementation of this method is based on a saved history of an operation,
5160 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5161 # arguments (an argument shape or a sub-shape of an argument shape).
5162 # The operation could be the Partition or one of boolean operations,
5163 # performed on simple shapes (not on compounds).
5165 # @param theShapeWhere Shape to find sub-shapes of.
5166 # @param theShapeWhat Shape, specifying what to find (must be in the
5167 # building history of the ShapeWhere).
5168 # @param theName Object name; when specified, this parameter is used
5169 # for result publication in the study. Otherwise, if automatic
5170 # publication is switched on, default value is used for result name.
5172 # @return Group of all found sub-shapes or a single found sub-shape.
5174 # @ref swig_GetInPlace "Example"
5175 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5177 Implementation of this method is based on a saved history of an operation,
5178 produced theShapeWhere. The theShapeWhat must be among this operation's
5179 arguments (an argument shape or a sub-shape of an argument shape).
5180 The operation could be the Partition or one of boolean operations,
5181 performed on simple shapes (not on compounds).
5184 theShapeWhere Shape to find sub-shapes of.
5185 theShapeWhat Shape, specifying what to find (must be in the
5186 building history of the ShapeWhere).
5187 theName Object name; when specified, this parameter is used
5188 for result publication in the study. Otherwise, if automatic
5189 publication is switched on, default value is used for result name.
5192 Group of all found sub-shapes or a single found sub-shape.
5194 # Example: see GEOM_TestOthers.py
5195 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5196 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5197 self._autoPublish(anObj, theName, "inplace")
5200 ## Get sub-shape of theShapeWhere, which is
5201 # equal to \a theShapeWhat.
5202 # @param theShapeWhere Shape to find sub-shape of.
5203 # @param theShapeWhat Shape, specifying what to find.
5204 # @param theName Object name; when specified, this parameter is used
5205 # for result publication in the study. Otherwise, if automatic
5206 # publication is switched on, default value is used for result name.
5208 # @return New GEOM.GEOM_Object for found sub-shape.
5210 # @ref swig_GetSame "Example"
5211 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5213 Get sub-shape of theShapeWhere, which is
5214 equal to theShapeWhat.
5217 theShapeWhere Shape to find sub-shape of.
5218 theShapeWhat Shape, specifying what to find.
5219 theName Object name; when specified, this parameter is used
5220 for result publication in the study. Otherwise, if automatic
5221 publication is switched on, default value is used for result name.
5224 New GEOM.GEOM_Object for found sub-shape.
5226 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5227 RaiseIfFailed("GetSame", self.ShapesOp)
5228 self._autoPublish(anObj, theName, "sameShape")
5232 ## Get sub-shape indices of theShapeWhere, which is
5233 # equal to \a theShapeWhat.
5234 # @param theShapeWhere Shape to find sub-shape of.
5235 # @param theShapeWhat Shape, specifying what to find.
5236 # @return List of all found sub-shapes indices.
5238 # @ref swig_GetSame "Example"
5239 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5241 Get sub-shape indices of theShapeWhere, which is
5242 equal to theShapeWhat.
5245 theShapeWhere Shape to find sub-shape of.
5246 theShapeWhat Shape, specifying what to find.
5249 List of all found sub-shapes indices.
5251 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5252 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5259 ## @addtogroup l4_access
5262 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5263 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5264 # @param aShape Shape to get sub-shape of.
5265 # @param ListOfID List of sub-shapes indices.
5266 # @param theName Object name; when specified, this parameter is used
5267 # for result publication in the study. Otherwise, if automatic
5268 # publication is switched on, default value is used for result name.
5270 # @return Found sub-shape.
5272 # @ref swig_all_decompose "Example"
5273 def GetSubShape(self, aShape, ListOfID, theName=None):
5275 Obtain a composite sub-shape of aShape, composed from sub-shapes
5276 of aShape, selected by their unique IDs inside aShape
5279 aShape Shape to get sub-shape of.
5280 ListOfID List of sub-shapes indices.
5281 theName Object name; when specified, this parameter is used
5282 for result publication in the study. Otherwise, if automatic
5283 publication is switched on, default value is used for result name.
5288 # Example: see GEOM_TestAll.py
5289 anObj = self.AddSubShape(aShape,ListOfID)
5290 self._autoPublish(anObj, theName, "subshape")
5293 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5294 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5295 # @param aShape Shape to get sub-shape of.
5296 # @param aSubShape Sub-shapes of aShape.
5297 # @return ID of found sub-shape.
5299 # @ref swig_all_decompose "Example"
5300 def GetSubShapeID(self, aShape, aSubShape):
5302 Obtain unique ID of sub-shape aSubShape inside aShape
5303 of aShape, selected by their unique IDs inside aShape
5306 aShape Shape to get sub-shape of.
5307 aSubShape Sub-shapes of aShape.
5310 ID of found sub-shape.
5312 # Example: see GEOM_TestAll.py
5313 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5314 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5317 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5318 # This function is provided for performance purpose. The complexity is O(n) with n
5319 # the number of subobjects of aShape
5320 # @param aShape Shape to get sub-shape of.
5321 # @param aSubShapes Sub-shapes of aShape.
5322 # @return list of IDs of found sub-shapes.
5324 # @ref swig_all_decompose "Example"
5325 def GetSubShapesIDs(self, aShape, aSubShapes):
5327 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5328 This function is provided for performance purpose. The complexity is O(n) with n
5329 the number of subobjects of aShape
5332 aShape Shape to get sub-shape of.
5333 aSubShapes Sub-shapes of aShape.
5336 List of IDs of found sub-shape.
5338 # Example: see GEOM_TestAll.py
5339 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5340 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5346 ## @addtogroup l4_decompose
5349 ## Get all sub-shapes and groups of \a theShape,
5350 # that were created already by any other methods.
5351 # @param theShape Any shape.
5352 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5353 # returned, else all found sub-shapes and groups.
5354 # @return List of existing sub-objects of \a theShape.
5356 # @ref swig_all_decompose "Example"
5357 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5359 Get all sub-shapes and groups of theShape,
5360 that were created already by any other methods.
5364 theGroupsOnly If this parameter is TRUE, only groups will be
5365 returned, else all found sub-shapes and groups.
5368 List of existing sub-objects of theShape.
5370 # Example: see GEOM_TestAll.py
5371 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5372 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5375 ## Get all groups of \a theShape,
5376 # that were created already by any other methods.
5377 # @param theShape Any shape.
5378 # @return List of existing groups of \a theShape.
5380 # @ref swig_all_decompose "Example"
5381 def GetGroups(self, theShape):
5383 Get all groups of theShape,
5384 that were created already by any other methods.
5390 List of existing groups of theShape.
5392 # Example: see GEOM_TestAll.py
5393 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5394 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5397 ## Explode a shape on sub-shapes of a given type.
5398 # If the shape itself matches the type, it is also returned.
5399 # @param aShape Shape to be exploded.
5400 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5401 # @param theName Object name; when specified, this parameter is used
5402 # for result publication in the study. Otherwise, if automatic
5403 # publication is switched on, default value is used for result name.
5405 # @return List of sub-shapes of type theShapeType, contained in theShape.
5407 # @ref swig_all_decompose "Example"
5408 def SubShapeAll(self, aShape, aType, theName=None):
5410 Explode a shape on sub-shapes of a given type.
5411 If the shape itself matches the type, it is also returned.
5414 aShape Shape to be exploded.
5415 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5416 theName Object name; when specified, this parameter is used
5417 for result publication in the study. Otherwise, if automatic
5418 publication is switched on, default value is used for result name.
5421 List of sub-shapes of type theShapeType, contained in theShape.
5423 # Example: see GEOM_TestAll.py
5424 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5425 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5426 self._autoPublish(ListObj, theName, "subshape")
5429 ## Explode a shape on sub-shapes of a given type.
5430 # @param aShape Shape to be exploded.
5431 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5432 # @return List of IDs of sub-shapes.
5434 # @ref swig_all_decompose "Example"
5435 def SubShapeAllIDs(self, aShape, aType):
5437 Explode a shape on sub-shapes of a given type.
5440 aShape Shape to be exploded (see geompy.ShapeType)
5441 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5444 List of IDs of sub-shapes.
5446 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5447 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5450 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5451 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
5452 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5453 # @param aShape Shape to get sub-shape of.
5454 # @param ListOfInd List of sub-shapes indices.
5455 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5456 # @param theName Object name; when specified, this parameter is used
5457 # for result publication in the study. Otherwise, if automatic
5458 # publication is switched on, default value is used for result name.
5460 # @return A compound of sub-shapes of aShape.
5462 # @ref swig_all_decompose "Example"
5463 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5465 Obtain a compound of sub-shapes of aShape,
5466 selected by they indices in list of all sub-shapes of type aType.
5467 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5470 aShape Shape to get sub-shape of.
5471 ListOfID List of sub-shapes indices.
5472 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5473 theName Object name; when specified, this parameter is used
5474 for result publication in the study. Otherwise, if automatic
5475 publication is switched on, default value is used for result name.
5478 A compound of sub-shapes of aShape.
5480 # Example: see GEOM_TestAll.py
5482 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5483 for ind in ListOfInd:
5484 ListOfIDs.append(AllShapeIDsList[ind - 1])
5485 # note: auto-publishing is done in self.GetSubShape()
5486 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5489 ## Explode a shape on sub-shapes of a given type.
5490 # Sub-shapes will be sorted by coordinates of their gravity centers.
5491 # If the shape itself matches the type, it is also returned.
5492 # @param aShape Shape to be exploded.
5493 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5494 # @param theName Object name; when specified, this parameter is used
5495 # for result publication in the study. Otherwise, if automatic
5496 # publication is switched on, default value is used for result name.
5498 # @return List of sub-shapes of type theShapeType, contained in theShape.
5500 # @ref swig_SubShapeAllSorted "Example"
5501 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5503 Explode a shape on sub-shapes of a given type.
5504 Sub-shapes will be sorted by coordinates of their gravity centers.
5505 If the shape itself matches the type, it is also returned.
5508 aShape Shape to be exploded.
5509 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5510 theName Object name; when specified, this parameter is used
5511 for result publication in the study. Otherwise, if automatic
5512 publication is switched on, default value is used for result name.
5515 List of sub-shapes of type theShapeType, contained in theShape.
5517 # Example: see GEOM_TestAll.py
5518 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5519 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5520 self._autoPublish(ListObj, theName, "subshape")
5523 ## Explode a shape on sub-shapes of a given type.
5524 # Sub-shapes will be sorted by coordinates of their gravity centers.
5525 # @param aShape Shape to be exploded.
5526 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5527 # @return List of IDs of sub-shapes.
5529 # @ref swig_all_decompose "Example"
5530 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5532 Explode a shape on sub-shapes of a given type.
5533 Sub-shapes will be sorted by coordinates of their gravity centers.
5536 aShape Shape to be exploded.
5537 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5540 List of IDs of sub-shapes.
5542 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5543 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5546 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5547 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5548 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5549 # @param aShape Shape to get sub-shape of.
5550 # @param ListOfInd List of sub-shapes indices.
5551 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5552 # @param theName Object name; when specified, this parameter is used
5553 # for result publication in the study. Otherwise, if automatic
5554 # publication is switched on, default value is used for result name.
5556 # @return A compound of sub-shapes of aShape.
5558 # @ref swig_all_decompose "Example"
5559 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5561 Obtain a compound of sub-shapes of aShape,
5562 selected by they indices in sorted list of all sub-shapes of type aType.
5563 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5566 aShape Shape to get sub-shape of.
5567 ListOfID List of sub-shapes indices.
5568 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5569 theName Object name; when specified, this parameter is used
5570 for result publication in the study. Otherwise, if automatic
5571 publication is switched on, default value is used for result name.
5574 A compound of sub-shapes of aShape.
5576 # Example: see GEOM_TestAll.py
5578 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5579 for ind in ListOfInd:
5580 ListOfIDs.append(AllShapeIDsList[ind - 1])
5581 # note: auto-publishing is done in self.GetSubShape()
5582 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5585 ## Extract shapes (excluding the main shape) of given type.
5586 # @param aShape The shape.
5587 # @param aType The shape type (see ShapeType())
5588 # @param isSorted Boolean flag to switch sorting on/off.
5589 # @param 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.
5593 # @return List of sub-shapes of type aType, contained in aShape.
5595 # @ref swig_FilletChamfer "Example"
5596 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5598 Extract shapes (excluding the main shape) of given type.
5602 aType The shape type (see geompy.ShapeType)
5603 isSorted Boolean flag to switch sorting on/off.
5604 theName Object name; when specified, this parameter is used
5605 for result publication in the study. Otherwise, if automatic
5606 publication is switched on, default value is used for result name.
5609 List of sub-shapes of type aType, contained in aShape.
5611 # Example: see GEOM_TestAll.py
5612 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5613 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5614 self._autoPublish(ListObj, theName, "subshape")
5617 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5618 # @param aShape Main shape.
5619 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5620 # @param theName Object name; when specified, this parameter is used
5621 # for result publication in the study. Otherwise, if automatic
5622 # publication is switched on, default value is used for result name.
5623 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5625 # @ref swig_all_decompose "Example"
5626 def SubShapes(self, aShape, anIDs, theName=None):
5628 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5632 anIDs List of unique IDs of sub-shapes inside theMainShape.
5633 theName Object name; when specified, this parameter is used
5634 for result publication in the study. Otherwise, if automatic
5635 publication is switched on, default value is used for result name.
5638 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5640 # Example: see GEOM_TestAll.py
5641 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5642 RaiseIfFailed("SubShapes", self.ShapesOp)
5643 self._autoPublish(ListObj, theName, "subshape")
5646 # end of l4_decompose
5649 ## @addtogroup l4_decompose_d
5652 ## Deprecated method
5653 # It works like SubShapeAllSortedCentres(), but wrongly
5654 # defines centres of faces, shells and solids.
5655 def SubShapeAllSorted(self, aShape, aType, theName=None):
5658 It works like geompy.SubShapeAllSortedCentres, but wrongly
5659 defines centres of faces, shells and solids.
5661 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5662 RaiseIfFailed("MakeExplode", self.ShapesOp)
5663 self._autoPublish(ListObj, theName, "subshape")
5666 ## Deprecated method
5667 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5668 # defines centres of faces, shells and solids.
5669 def SubShapeAllSortedIDs(self, aShape, aType):
5672 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5673 defines centres of faces, shells and solids.
5675 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5676 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5679 ## Deprecated method
5680 # It works like SubShapeSortedCentres(), but has a bug
5681 # (wrongly defines centres of faces, shells and solids).
5682 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5685 It works like geompy.SubShapeSortedCentres, but has a bug
5686 (wrongly defines centres of faces, shells and solids).
5689 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5690 for ind in ListOfInd:
5691 ListOfIDs.append(AllShapeIDsList[ind - 1])
5692 # note: auto-publishing is done in self.GetSubShape()
5693 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5696 # end of l4_decompose_d
5699 ## @addtogroup l3_healing
5702 ## Apply a sequence of Shape Healing operators to the given object.
5703 # @param theShape Shape to be processed.
5704 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5705 # @param theParameters List of names of parameters
5706 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5707 # @param theValues List of values of parameters, in the same order
5708 # as parameters are listed in <VAR>theParameters</VAR> list.
5709 # @param theName Object name; when specified, this parameter is used
5710 # for result publication in the study. Otherwise, if automatic
5711 # publication is switched on, default value is used for result name.
5713 # <b> Operators and Parameters: </b> \n
5715 # * \b FixShape - corrects invalid shapes. \n
5716 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5717 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5719 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5720 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5721 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5722 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5724 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5725 # surfaces in segments using a certain angle. \n
5726 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5727 # if Angle=180, four if Angle=90, etc). \n
5728 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5730 # * \b SplitClosedFaces - splits closed faces in segments.
5731 # The number of segments depends on the number of splitting points.\n
5732 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5734 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5735 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5736 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5737 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5738 # This and the previous parameters can take the following values:\n
5739 # \b Parametric \b Continuity \n
5740 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5741 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5742 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5743 # ruling out sharp edges).\n
5744 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5745 # are of the same magnitude).\n
5746 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5747 # or surfaces (d/du C(u)) are the same at junction. \n
5748 # \b Geometric \b Continuity \n
5749 # \b G1: first derivatives are proportional at junction.\n
5750 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5751 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5752 # \b G2: first and second derivatives are proportional at junction.
5753 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5754 # continuity requires that the underlying parameterization was continuous as well.
5755 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5757 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5758 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5759 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5760 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5761 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5762 # with the specified parameters.\n
5763 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5764 # with the specified parameters.\n
5765 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5766 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5767 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5768 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5770 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5771 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5772 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5773 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5774 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5776 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5777 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5780 # @return New GEOM.GEOM_Object, containing processed shape.
5782 # \n @ref tui_shape_processing "Example"
5783 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5785 Apply a sequence of Shape Healing operators to the given object.
5788 theShape Shape to be processed.
5789 theValues List of values of parameters, in the same order
5790 as parameters are listed in theParameters list.
5791 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5792 theParameters List of names of parameters
5793 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5794 theName Object name; when specified, this parameter is used
5795 for result publication in the study. Otherwise, if automatic
5796 publication is switched on, default value is used for result name.
5798 Operators and Parameters:
5800 * FixShape - corrects invalid shapes.
5801 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5802 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5803 * FixFaceSize - removes small faces, such as spots and strips.
5804 * FixFaceSize.Tolerance - defines minimum possible face size.
5805 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5806 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5807 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5808 in segments using a certain angle.
5809 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5810 if Angle=180, four if Angle=90, etc).
5811 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5812 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5814 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5815 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5816 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5817 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5818 * SplitContinuity.CurveContinuity - required continuity for curves.
5819 This and the previous parameters can take the following values:
5821 Parametric Continuity:
5822 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5823 coincidental. The curves or surfaces may still meet at an angle,
5824 giving rise to a sharp corner or edge).
5825 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5826 are parallel, ruling out sharp edges).
5827 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5828 or surfaces are of the same magnitude).
5829 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5830 curves or surfaces (d/du C(u)) are the same at junction.
5832 Geometric Continuity:
5833 G1: first derivatives are proportional at junction.
5834 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5835 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5836 G2: first and second derivatives are proportional at junction. As the names imply,
5837 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5838 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5839 geometric continuity of order n, but not vice-versa.
5840 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5841 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5842 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5843 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5844 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5845 the specified parameters.
5846 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5847 the specified parameters.
5848 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5849 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5850 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5851 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5852 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5853 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5854 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5855 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5856 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5857 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5858 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5861 New GEOM.GEOM_Object, containing processed shape.
5863 Note: For more information look through SALOME Geometry User's Guide->
5864 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5866 # Example: see GEOM_TestHealing.py
5867 theValues,Parameters = ParseList(theValues)
5868 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5869 # To avoid script failure in case of good argument shape
5870 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5872 RaiseIfFailed("ProcessShape", self.HealOp)
5873 for string in (theOperators + theParameters):
5874 Parameters = ":" + Parameters
5876 anObj.SetParameters(Parameters)
5877 self._autoPublish(anObj, theName, "healed")
5880 ## Remove faces from the given object (shape).
5881 # @param theObject Shape to be processed.
5882 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5883 # removes ALL faces of the given object.
5884 # @param theName Object name; when specified, this parameter is used
5885 # for result publication in the study. Otherwise, if automatic
5886 # publication is switched on, default value is used for result name.
5888 # @return New GEOM.GEOM_Object, containing processed shape.
5890 # @ref tui_suppress_faces "Example"
5891 def SuppressFaces(self, theObject, theFaces, theName=None):
5893 Remove faces from the given object (shape).
5896 theObject Shape to be processed.
5897 theFaces Indices of faces to be removed, if EMPTY then the method
5898 removes ALL faces of the given object.
5899 theName Object name; when specified, this parameter is used
5900 for result publication in the study. Otherwise, if automatic
5901 publication is switched on, default value is used for result name.
5904 New GEOM.GEOM_Object, containing processed shape.
5906 # Example: see GEOM_TestHealing.py
5907 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5908 RaiseIfFailed("SuppressFaces", self.HealOp)
5909 self._autoPublish(anObj, theName, "suppressFaces")
5912 ## Sewing of some shapes into single shape.
5913 # @param ListShape Shapes to be processed.
5914 # @param theTolerance Required tolerance value.
5915 # @param AllowNonManifold Flag that allows non-manifold sewing.
5916 # @param theName Object name; when specified, this parameter is used
5917 # for result publication in the study. Otherwise, if automatic
5918 # publication is switched on, default value is used for result name.
5920 # @return New GEOM.GEOM_Object, containing processed shape.
5922 # @ref tui_sewing "Example"
5923 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5925 Sewing of some shapes into single shape.
5928 ListShape Shapes to be processed.
5929 theTolerance Required tolerance value.
5930 AllowNonManifold Flag that allows non-manifold sewing.
5931 theName Object name; when specified, this parameter is used
5932 for result publication in the study. Otherwise, if automatic
5933 publication is switched on, default value is used for result name.
5936 New GEOM.GEOM_Object, containing processed shape.
5938 # Example: see GEOM_TestHealing.py
5939 comp = self.MakeCompound(ListShape)
5940 # note: auto-publishing is done in self.Sew()
5941 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
5944 ## Sewing of the given object.
5945 # @param theObject Shape to be processed.
5946 # @param theTolerance Required tolerance value.
5947 # @param AllowNonManifold Flag that allows non-manifold sewing.
5948 # @param theName Object name; when specified, this parameter is used
5949 # for result publication in the study. Otherwise, if automatic
5950 # publication is switched on, default value is used for result name.
5952 # @return New GEOM.GEOM_Object, containing processed shape.
5953 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
5955 Sewing of the given object.
5958 theObject Shape to be processed.
5959 theTolerance Required tolerance value.
5960 AllowNonManifold Flag that allows non-manifold sewing.
5961 theName Object name; when specified, this parameter is used
5962 for result publication in the study. Otherwise, if automatic
5963 publication is switched on, default value is used for result name.
5966 New GEOM.GEOM_Object, containing processed shape.
5968 # Example: see MakeSewing() above
5969 theTolerance,Parameters = ParseParameters(theTolerance)
5970 if AllowNonManifold:
5971 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
5973 anObj = self.HealOp.Sew(theObject, theTolerance)
5974 RaiseIfFailed("Sew", self.HealOp)
5975 anObj.SetParameters(Parameters)
5976 self._autoPublish(anObj, theName, "sewed")
5979 ## Remove internal wires and edges from the given object (face).
5980 # @param theObject Shape to be processed.
5981 # @param theWires Indices of wires to be removed, if EMPTY then the method
5982 # removes ALL internal wires of the given object.
5983 # @param theName Object name; when specified, this parameter is used
5984 # for result publication in the study. Otherwise, if automatic
5985 # publication is switched on, default value is used for result name.
5987 # @return New GEOM.GEOM_Object, containing processed shape.
5989 # @ref tui_suppress_internal_wires "Example"
5990 def SuppressInternalWires(self, theObject, theWires, theName=None):
5992 Remove internal wires and edges from the given object (face).
5995 theObject Shape to be processed.
5996 theWires Indices of wires to be removed, if EMPTY then the method
5997 removes ALL internal wires of the given object.
5998 theName Object name; when specified, this parameter is used
5999 for result publication in the study. Otherwise, if automatic
6000 publication is switched on, default value is used for result name.
6003 New GEOM.GEOM_Object, containing processed shape.
6005 # Example: see GEOM_TestHealing.py
6006 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6007 RaiseIfFailed("RemoveIntWires", self.HealOp)
6008 self._autoPublish(anObj, theName, "suppressWires")
6011 ## Remove internal closed contours (holes) from the given object.
6012 # @param theObject Shape to be processed.
6013 # @param theWires Indices of wires to be removed, if EMPTY then the method
6014 # removes ALL internal holes of the given object
6015 # @param theName Object name; when specified, this parameter is used
6016 # for result publication in the study. Otherwise, if automatic
6017 # publication is switched on, default value is used for result name.
6019 # @return New GEOM.GEOM_Object, containing processed shape.
6021 # @ref tui_suppress_holes "Example"
6022 def SuppressHoles(self, theObject, theWires, theName=None):
6024 Remove internal closed contours (holes) from the given object.
6027 theObject Shape to be processed.
6028 theWires Indices of wires to be removed, if EMPTY then the method
6029 removes ALL internal holes of the given object
6030 theName Object name; when specified, this parameter is used
6031 for result publication in the study. Otherwise, if automatic
6032 publication is switched on, default value is used for result name.
6035 New GEOM.GEOM_Object, containing processed shape.
6037 # Example: see GEOM_TestHealing.py
6038 anObj = self.HealOp.FillHoles(theObject, theWires)
6039 RaiseIfFailed("FillHoles", self.HealOp)
6040 self._autoPublish(anObj, theName, "suppressHoles")
6043 ## Close an open wire.
6044 # @param theObject Shape to be processed.
6045 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6046 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6047 # @param isCommonVertex If True : closure by creation of a common vertex,
6048 # If False : closure by creation of an edge between ends.
6049 # @param theName Object name; when specified, this parameter is used
6050 # for result publication in the study. Otherwise, if automatic
6051 # publication is switched on, default value is used for result name.
6053 # @return New GEOM.GEOM_Object, containing processed shape.
6055 # @ref tui_close_contour "Example"
6056 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6061 theObject Shape to be processed.
6062 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6063 if [ ], then theObject itself is a wire.
6064 isCommonVertex If True : closure by creation of a common vertex,
6065 If False : closure by creation of an edge between ends.
6066 theName Object name; when specified, this parameter is used
6067 for result publication in the study. Otherwise, if automatic
6068 publication is switched on, default value is used for result name.
6071 New GEOM.GEOM_Object, containing processed shape.
6073 # Example: see GEOM_TestHealing.py
6074 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6075 RaiseIfFailed("CloseContour", self.HealOp)
6076 self._autoPublish(anObj, theName, "closeContour")
6079 ## Addition of a point to a given edge object.
6080 # @param theObject Shape to be processed.
6081 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6082 # if -1, then theObject itself is the edge.
6083 # @param theValue Value of parameter on edge or length parameter,
6084 # depending on \a isByParameter.
6085 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6086 # if FALSE : \a theValue is treated as a length parameter [0..1]
6087 # @param theName Object name; when specified, this parameter is used
6088 # for result publication in the study. Otherwise, if automatic
6089 # publication is switched on, default value is used for result name.
6091 # @return New GEOM.GEOM_Object, containing processed shape.
6093 # @ref tui_add_point_on_edge "Example"
6094 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6096 Addition of a point to a given edge object.
6099 theObject Shape to be processed.
6100 theEdgeIndex Index of edge to be divided within theObject's shape,
6101 if -1, then theObject itself is the edge.
6102 theValue Value of parameter on edge or length parameter,
6103 depending on isByParameter.
6104 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6105 if FALSE : theValue is treated as a length parameter [0..1]
6106 theName Object name; when specified, this parameter is used
6107 for result publication in the study. Otherwise, if automatic
6108 publication is switched on, default value is used for result name.
6111 New GEOM.GEOM_Object, containing processed shape.
6113 # Example: see GEOM_TestHealing.py
6114 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6115 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6116 RaiseIfFailed("DivideEdge", self.HealOp)
6117 anObj.SetParameters(Parameters)
6118 self._autoPublish(anObj, theName, "divideEdge")
6121 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6122 # @param theWire Wire to minimize the number of C1 continuous edges in.
6123 # @param theVertices A list of vertices to suppress. If the list
6124 # is empty, all vertices in a wire will be assumed.
6125 # @param theName Object name; when specified, this parameter is used
6126 # for result publication in the study. Otherwise, if automatic
6127 # publication is switched on, default value is used for result name.
6129 # @return New GEOM.GEOM_Object with modified wire.
6131 # @ref tui_fuse_collinear_edges "Example"
6132 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6134 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6137 theWire Wire to minimize the number of C1 continuous edges in.
6138 theVertices A list of vertices to suppress. If the list
6139 is empty, all vertices in a wire will be assumed.
6140 theName Object name; when specified, this parameter is used
6141 for result publication in the study. Otherwise, if automatic
6142 publication is switched on, default value is used for result name.
6145 New GEOM.GEOM_Object with modified wire.
6147 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6148 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6149 self._autoPublish(anObj, theName, "fuseEdges")
6152 ## Change orientation of the given object. Updates given shape.
6153 # @param theObject Shape to be processed.
6154 # @return Updated <var>theObject</var>
6156 # @ref swig_todo "Example"
6157 def ChangeOrientationShell(self,theObject):
6159 Change orientation of the given object. Updates given shape.
6162 theObject Shape to be processed.
6167 theObject = self.HealOp.ChangeOrientation(theObject)
6168 RaiseIfFailed("ChangeOrientation", self.HealOp)
6171 ## Change orientation of the given object.
6172 # @param theObject Shape to be processed.
6173 # @param theName Object name; when specified, this parameter is used
6174 # for result publication in the study. Otherwise, if automatic
6175 # publication is switched on, default value is used for result name.
6177 # @return New GEOM.GEOM_Object, containing processed shape.
6179 # @ref swig_todo "Example"
6180 def ChangeOrientationShellCopy(self, theObject, theName=None):
6182 Change orientation of the given object.
6185 theObject Shape to be processed.
6186 theName Object name; when specified, this parameter is used
6187 for result publication in the study. Otherwise, if automatic
6188 publication is switched on, default value is used for result name.
6191 New GEOM.GEOM_Object, containing processed shape.
6193 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6194 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6195 self._autoPublish(anObj, theName, "reversed")
6198 ## Try to limit tolerance of the given object by value \a theTolerance.
6199 # @param theObject Shape to be processed.
6200 # @param theTolerance Required tolerance value.
6201 # @param theName Object name; when specified, this parameter is used
6202 # for result publication in the study. Otherwise, if automatic
6203 # publication is switched on, default value is used for result name.
6205 # @return New GEOM.GEOM_Object, containing processed shape.
6207 # @ref tui_limit_tolerance "Example"
6208 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6210 Try to limit tolerance of the given object by value theTolerance.
6213 theObject Shape to be processed.
6214 theTolerance Required tolerance value.
6215 theName Object name; when specified, this parameter is used
6216 for result publication in the study. Otherwise, if automatic
6217 publication is switched on, default value is used for result name.
6220 New GEOM.GEOM_Object, containing processed shape.
6222 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6223 RaiseIfFailed("LimitTolerance", self.HealOp)
6224 self._autoPublish(anObj, theName, "limitTolerance")
6227 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6228 # that constitute a free boundary of the given shape.
6229 # @param theObject Shape to get free boundary of.
6230 # @param theName Object name; when specified, this parameter is used
6231 # for result publication in the study. Otherwise, if automatic
6232 # publication is switched on, default value is used for result name.
6234 # @return [\a status, \a theClosedWires, \a theOpenWires]
6235 # \n \a status: FALSE, if an error(s) occured during the method execution.
6236 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6237 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6239 # @ref tui_measurement_tools_page "Example"
6240 def GetFreeBoundary(self, theObject, theName=None):
6242 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6243 that constitute a free boundary of the given shape.
6246 theObject Shape to get free boundary of.
6247 theName Object name; when specified, this parameter is used
6248 for result publication in the study. Otherwise, if automatic
6249 publication is switched on, default value is used for result name.
6252 [status, theClosedWires, theOpenWires]
6253 status: FALSE, if an error(s) occured during the method execution.
6254 theClosedWires: Closed wires on the free boundary of the given shape.
6255 theOpenWires: Open wires on the free boundary of the given shape.
6257 # Example: see GEOM_TestHealing.py
6258 anObj = self.HealOp.GetFreeBoundary(theObject)
6259 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6260 self._autoPublish(anObj[1], theName, "closedWire")
6261 self._autoPublish(anObj[2], theName, "openWire")
6264 ## Replace coincident faces in theShape by one face.
6265 # @param theShape Initial shape.
6266 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6267 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6268 # otherwise all initial shapes.
6269 # @param theName Object name; when specified, this parameter is used
6270 # for result publication in the study. Otherwise, if automatic
6271 # publication is switched on, default value is used for result name.
6273 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6275 # @ref tui_glue_faces "Example"
6276 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6278 Replace coincident faces in theShape by one face.
6281 theShape Initial shape.
6282 theTolerance Maximum distance between faces, which can be considered as coincident.
6283 doKeepNonSolids If FALSE, only solids will present in the result,
6284 otherwise all initial shapes.
6285 theName Object name; when specified, this parameter is used
6286 for result publication in the study. Otherwise, if automatic
6287 publication is switched on, default value is used for result name.
6290 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6292 # Example: see GEOM_Spanner.py
6293 theTolerance,Parameters = ParseParameters(theTolerance)
6294 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6296 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6297 anObj.SetParameters(Parameters)
6298 self._autoPublish(anObj, theName, "glueFaces")
6301 ## Find coincident faces in theShape for possible gluing.
6302 # @param theShape Initial shape.
6303 # @param theTolerance Maximum distance between faces,
6304 # which can be considered as coincident.
6305 # @param 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.
6309 # @return GEOM.ListOfGO
6311 # @ref tui_glue_faces "Example"
6312 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6314 Find coincident faces in theShape for possible gluing.
6317 theShape Initial shape.
6318 theTolerance Maximum distance between faces,
6319 which can be considered as coincident.
6320 theName Object name; when specified, this parameter is used
6321 for result publication in the study. Otherwise, if automatic
6322 publication is switched on, default value is used for result name.
6327 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6328 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6329 self._autoPublish(anObj, theName, "facesToGlue")
6332 ## Replace coincident faces in theShape by one face
6333 # in compliance with given list of faces
6334 # @param theShape Initial shape.
6335 # @param theTolerance Maximum distance between faces,
6336 # which can be considered as coincident.
6337 # @param theFaces List of faces for gluing.
6338 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6339 # otherwise all initial shapes.
6340 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6341 # will be glued, otherwise only the edges,
6342 # belonging to <VAR>theFaces</VAR>.
6343 # @param theName Object name; when specified, this parameter is used
6344 # for result publication in the study. Otherwise, if automatic
6345 # publication is switched on, default value is used for result name.
6347 # @return New GEOM.GEOM_Object, containing a copy of theShape
6348 # without some faces.
6350 # @ref tui_glue_faces "Example"
6351 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6352 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6354 Replace coincident faces in theShape by one face
6355 in compliance with given list of faces
6358 theShape Initial shape.
6359 theTolerance Maximum distance between faces,
6360 which can be considered as coincident.
6361 theFaces List of faces for gluing.
6362 doKeepNonSolids If FALSE, only solids will present in the result,
6363 otherwise all initial shapes.
6364 doGlueAllEdges If TRUE, all coincident edges of theShape
6365 will be glued, otherwise only the edges,
6366 belonging to theFaces.
6367 theName Object name; when specified, this parameter is used
6368 for result publication in the study. Otherwise, if automatic
6369 publication is switched on, default value is used for result name.
6372 New GEOM.GEOM_Object, containing a copy of theShape
6375 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6376 doKeepNonSolids, doGlueAllEdges)
6378 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6379 self._autoPublish(anObj, theName, "glueFaces")
6382 ## Replace coincident edges in theShape by one edge.
6383 # @param theShape Initial shape.
6384 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6385 # @param theName Object name; when specified, this parameter is used
6386 # for result publication in the study. Otherwise, if automatic
6387 # publication is switched on, default value is used for result name.
6389 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6391 # @ref tui_glue_edges "Example"
6392 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6394 Replace coincident edges in theShape by one edge.
6397 theShape Initial shape.
6398 theTolerance Maximum distance between edges, which can be considered as coincident.
6399 theName Object name; when specified, this parameter is used
6400 for result publication in the study. Otherwise, if automatic
6401 publication is switched on, default value is used for result name.
6404 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6406 theTolerance,Parameters = ParseParameters(theTolerance)
6407 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6409 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6410 anObj.SetParameters(Parameters)
6411 self._autoPublish(anObj, theName, "glueEdges")
6414 ## Find coincident edges in theShape for possible gluing.
6415 # @param theShape Initial shape.
6416 # @param theTolerance Maximum distance between edges,
6417 # which can be considered as coincident.
6418 # @param theName Object name; when specified, this parameter is used
6419 # for result publication in the study. Otherwise, if automatic
6420 # publication is switched on, default value is used for result name.
6422 # @return GEOM.ListOfGO
6424 # @ref tui_glue_edges "Example"
6425 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6427 Find coincident edges in theShape for possible gluing.
6430 theShape Initial shape.
6431 theTolerance Maximum distance between edges,
6432 which can be considered as coincident.
6433 theName Object name; when specified, this parameter is used
6434 for result publication in the study. Otherwise, if automatic
6435 publication is switched on, default value is used for result name.
6440 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6441 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6442 self._autoPublish(anObj, theName, "edgesToGlue")
6445 ## Replace coincident edges in theShape by one edge
6446 # in compliance with given list of edges.
6447 # @param theShape Initial shape.
6448 # @param theTolerance Maximum distance between edges,
6449 # which can be considered as coincident.
6450 # @param theEdges List of edges for gluing.
6451 # @param theName Object name; when specified, this parameter is used
6452 # for result publication in the study. Otherwise, if automatic
6453 # publication is switched on, default value is used for result name.
6455 # @return New GEOM.GEOM_Object, containing a copy of theShape
6456 # without some edges.
6458 # @ref tui_glue_edges "Example"
6459 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6461 Replace coincident edges in theShape by one edge
6462 in compliance with given list of edges.
6465 theShape Initial shape.
6466 theTolerance Maximum distance between edges,
6467 which can be considered as coincident.
6468 theEdges List of edges for gluing.
6469 theName Object name; when specified, this parameter is used
6470 for result publication in the study. Otherwise, if automatic
6471 publication is switched on, default value is used for result name.
6474 New GEOM.GEOM_Object, containing a copy of theShape
6477 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6479 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6480 self._autoPublish(anObj, theName, "glueEdges")
6486 ## @addtogroup l3_boolean Boolean Operations
6489 # -----------------------------------------------------------------------------
6490 # Boolean (Common, Cut, Fuse, Section)
6491 # -----------------------------------------------------------------------------
6493 ## Perform one of boolean operations on two given shapes.
6494 # @param theShape1 First argument for boolean operation.
6495 # @param theShape2 Second argument for boolean operation.
6496 # @param theOperation Indicates the operation to be done:\n
6497 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6498 # @param theName Object name; when specified, this parameter is used
6499 # for result publication in the study. Otherwise, if automatic
6500 # publication is switched on, default value is used for result name.
6502 # @return New GEOM.GEOM_Object, containing the result shape.
6504 # @ref tui_fuse "Example"
6505 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6507 Perform one of boolean operations on two given shapes.
6510 theShape1 First argument for boolean operation.
6511 theShape2 Second argument for boolean operation.
6512 theOperation Indicates the operation to be done:
6513 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6514 theName Object name; when specified, this parameter is used
6515 for result publication in the study. Otherwise, if automatic
6516 publication is switched on, default value is used for result name.
6519 New GEOM.GEOM_Object, containing the result shape.
6521 # Example: see GEOM_TestAll.py
6522 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6523 RaiseIfFailed("MakeBoolean", self.BoolOp)
6524 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6525 self._autoPublish(anObj, theName, def_names[theOperation])
6528 ## Perform Common boolean operation on two given shapes.
6529 # @param theShape1 First argument for boolean operation.
6530 # @param theShape2 Second argument for boolean operation.
6531 # @param theName Object name; when specified, this parameter is used
6532 # for result publication in the study. Otherwise, if automatic
6533 # publication is switched on, default value is used for result name.
6535 # @return New GEOM.GEOM_Object, containing the result shape.
6537 # @ref tui_common "Example 1"
6538 # \n @ref swig_MakeCommon "Example 2"
6539 def MakeCommon(self, theShape1, theShape2, theName=None):
6541 Perform Common boolean operation on two given shapes.
6544 theShape1 First argument for boolean operation.
6545 theShape2 Second argument for boolean operation.
6546 theName Object name; when specified, this parameter is used
6547 for result publication in the study. Otherwise, if automatic
6548 publication is switched on, default value is used for result name.
6551 New GEOM.GEOM_Object, containing the result shape.
6553 # Example: see GEOM_TestOthers.py
6554 # note: auto-publishing is done in self.MakeBoolean()
6555 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6557 ## Perform Cut boolean operation on two given shapes.
6558 # @param theShape1 First argument for boolean operation.
6559 # @param theShape2 Second argument for boolean operation.
6560 # @param theName Object name; when specified, this parameter is used
6561 # for result publication in the study. Otherwise, if automatic
6562 # publication is switched on, default value is used for result name.
6564 # @return New GEOM.GEOM_Object, containing the result shape.
6566 # @ref tui_cut "Example 1"
6567 # \n @ref swig_MakeCommon "Example 2"
6568 def MakeCut(self, theShape1, theShape2, theName=None):
6570 Perform Cut boolean operation on two given shapes.
6573 theShape1 First argument for boolean operation.
6574 theShape2 Second argument for boolean operation.
6575 theName Object name; when specified, this parameter is used
6576 for result publication in the study. Otherwise, if automatic
6577 publication is switched on, default value is used for result name.
6580 New GEOM.GEOM_Object, containing the result shape.
6583 # Example: see GEOM_TestOthers.py
6584 # note: auto-publishing is done in self.MakeBoolean()
6585 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6587 ## Perform Fuse boolean operation on two given shapes.
6588 # @param theShape1 First argument for boolean operation.
6589 # @param theShape2 Second argument for boolean operation.
6590 # @param theName Object name; when specified, this parameter is used
6591 # for result publication in the study. Otherwise, if automatic
6592 # publication is switched on, default value is used for result name.
6594 # @return New GEOM.GEOM_Object, containing the result shape.
6596 # @ref tui_fuse "Example 1"
6597 # \n @ref swig_MakeCommon "Example 2"
6598 def MakeFuse(self, theShape1, theShape2, theName=None):
6600 Perform Fuse boolean operation on two given shapes.
6603 theShape1 First argument for boolean operation.
6604 theShape2 Second argument for boolean operation.
6605 theName Object name; when specified, this parameter is used
6606 for result publication in the study. Otherwise, if automatic
6607 publication is switched on, default value is used for result name.
6610 New GEOM.GEOM_Object, containing the result shape.
6613 # Example: see GEOM_TestOthers.py
6614 # note: auto-publishing is done in self.MakeBoolean()
6615 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6617 ## Perform Section boolean operation on two given shapes.
6618 # @param theShape1 First argument for boolean operation.
6619 # @param theShape2 Second argument for boolean operation.
6620 # @param theName Object name; when specified, this parameter is used
6621 # for result publication in the study. Otherwise, if automatic
6622 # publication is switched on, default value is used for result name.
6624 # @return New GEOM.GEOM_Object, containing the result shape.
6626 # @ref tui_section "Example 1"
6627 # \n @ref swig_MakeCommon "Example 2"
6628 def MakeSection(self, theShape1, theShape2, theName=None):
6630 Perform Section boolean operation on two given shapes.
6633 theShape1 First argument for boolean operation.
6634 theShape2 Second argument for boolean operation.
6635 theName Object name; when specified, this parameter is used
6636 for result publication in the study. Otherwise, if automatic
6637 publication is switched on, default value is used for result name.
6640 New GEOM.GEOM_Object, containing the result shape.
6643 # Example: see GEOM_TestOthers.py
6644 # note: auto-publishing is done in self.MakeBoolean()
6645 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6647 ## Perform Fuse boolean operation on the list of shapes.
6648 # @param theShapesList Shapes to be fused.
6649 # @param theName Object name; when specified, this parameter is used
6650 # for result publication in the study. Otherwise, if automatic
6651 # publication is switched on, default value is used for result name.
6653 # @return New GEOM.GEOM_Object, containing the result shape.
6655 # @ref tui_fuse "Example 1"
6656 # \n @ref swig_MakeCommon "Example 2"
6657 def MakeFuseList(self, theShapesList, theName=None):
6659 Perform Fuse boolean operation on the list of shapes.
6662 theShapesList Shapes to be fused.
6663 theName Object name; when specified, this parameter is used
6664 for result publication in the study. Otherwise, if automatic
6665 publication is switched on, default value is used for result name.
6668 New GEOM.GEOM_Object, containing the result shape.
6671 # Example: see GEOM_TestOthers.py
6672 anObj = self.BoolOp.MakeFuseList(theShapesList)
6673 RaiseIfFailed("MakeFuseList", self.BoolOp)
6674 self._autoPublish(anObj, theName, "fuse")
6677 ## Perform Common boolean operation on the list of shapes.
6678 # @param theShapesList Shapes for Common operation.
6679 # @param theName Object name; when specified, this parameter is used
6680 # for result publication in the study. Otherwise, if automatic
6681 # publication is switched on, default value is used for result name.
6683 # @return New GEOM.GEOM_Object, containing the result shape.
6685 # @ref tui_common "Example 1"
6686 # \n @ref swig_MakeCommon "Example 2"
6687 def MakeCommonList(self, theShapesList, theName=None):
6689 Perform Common boolean operation on the list of shapes.
6692 theShapesList Shapes for Common operation.
6693 theName Object name; when specified, this parameter is used
6694 for result publication in the study. Otherwise, if automatic
6695 publication is switched on, default value is used for result name.
6698 New GEOM.GEOM_Object, containing the result shape.
6701 # Example: see GEOM_TestOthers.py
6702 anObj = self.BoolOp.MakeCommonList(theShapesList)
6703 RaiseIfFailed("MakeCommonList", self.BoolOp)
6704 self._autoPublish(anObj, theName, "common")
6707 ## Perform Cut boolean operation on one object and the list of tools.
6708 # @param theMainShape The object of the operation.
6709 # @param theShapesList The list of tools of the operation.
6710 # @param theName Object name; when specified, this parameter is used
6711 # for result publication in the study. Otherwise, if automatic
6712 # publication is switched on, default value is used for result name.
6714 # @return New GEOM.GEOM_Object, containing the result shape.
6716 # @ref tui_cut "Example 1"
6717 # \n @ref swig_MakeCommon "Example 2"
6718 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6720 Perform Cut boolean operation on one object and the list of tools.
6723 theMainShape The object of the operation.
6724 theShapesList The list of tools of the operation.
6725 theName Object name; when specified, this parameter is used
6726 for result publication in the study. Otherwise, if automatic
6727 publication is switched on, default value is used for result name.
6730 New GEOM.GEOM_Object, containing the result shape.
6733 # Example: see GEOM_TestOthers.py
6734 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6735 RaiseIfFailed("MakeCutList", self.BoolOp)
6736 self._autoPublish(anObj, theName, "cut")
6742 ## @addtogroup l3_basic_op
6745 ## Perform partition operation.
6746 # @param ListShapes Shapes to be intersected.
6747 # @param ListTools Shapes to intersect theShapes.
6748 # @param Limit Type of resulting shapes (see ShapeType()).\n
6749 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6750 # type will be detected automatically.
6751 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6752 # target type (equal to Limit) are kept in the result,
6753 # else standalone shapes of lower dimension
6754 # are kept also (if they exist).
6755 # @param theName Object name; when specified, this parameter is used
6756 # for result publication in the study. Otherwise, if automatic
6757 # publication is switched on, default value is used for result name.
6759 # @note Each compound from ListShapes and ListTools will be exploded
6760 # in order to avoid possible intersection between shapes from this compound.
6762 # After implementation new version of PartitionAlgo (October 2006)
6763 # other parameters are ignored by current functionality. They are kept
6764 # in this function only for support old versions.
6765 # @param ListKeepInside Shapes, outside which the results will be deleted.
6766 # Each shape from theKeepInside must belong to theShapes also.
6767 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6768 # Each shape from theRemoveInside must belong to theShapes also.
6769 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6770 # @param ListMaterials Material indices for each shape. Make sence,
6771 # only if theRemoveWebs is TRUE.
6773 # @return New GEOM.GEOM_Object, containing the result shapes.
6775 # @ref tui_partition "Example"
6776 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6777 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6778 KeepNonlimitShapes=0, theName=None):
6780 Perform partition operation.
6783 ListShapes Shapes to be intersected.
6784 ListTools Shapes to intersect theShapes.
6785 Limit Type of resulting shapes (see geompy.ShapeType)
6786 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6787 type will be detected automatically.
6788 KeepNonlimitShapes if this parameter == 0, then only shapes of
6789 target type (equal to Limit) are kept in the result,
6790 else standalone shapes of lower dimension
6791 are kept also (if they exist).
6792 theName Object name; when specified, this parameter is used
6793 for result publication in the study. Otherwise, if automatic
6794 publication is switched on, default value is used for result name.
6796 Each compound from ListShapes and ListTools will be exploded
6797 in order to avoid possible intersection between shapes from
6800 After implementation new version of PartitionAlgo (October 2006) other
6801 parameters are ignored by current functionality. They are kept in this
6802 function only for support old versions.
6805 ListKeepInside Shapes, outside which the results will be deleted.
6806 Each shape from theKeepInside must belong to theShapes also.
6807 ListRemoveInside Shapes, inside which the results will be deleted.
6808 Each shape from theRemoveInside must belong to theShapes also.
6809 RemoveWebs If TRUE, perform Glue 3D algorithm.
6810 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6813 New GEOM.GEOM_Object, containing the result shapes.
6815 # Example: see GEOM_TestAll.py
6816 if Limit == self.ShapeType["AUTO"]:
6817 # automatic detection of the most appropriate shape limit type
6819 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6820 Limit = EnumToLong(lim)
6822 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6823 ListKeepInside, ListRemoveInside,
6824 Limit, RemoveWebs, ListMaterials,
6825 KeepNonlimitShapes);
6826 RaiseIfFailed("MakePartition", self.BoolOp)
6827 self._autoPublish(anObj, theName, "partition")
6830 ## Perform partition operation.
6831 # This method may be useful if it is needed to make a partition for
6832 # compound contains nonintersected shapes. Performance will be better
6833 # since intersection between shapes from compound is not performed.
6835 # Description of all parameters as in previous method MakePartition()
6837 # @note Passed compounds (via ListShapes or via ListTools)
6838 # have to consist of nonintersecting shapes.
6840 # @return New GEOM.GEOM_Object, containing the result shapes.
6842 # @ref swig_todo "Example"
6843 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6844 ListKeepInside=[], ListRemoveInside=[],
6845 Limit=ShapeType["AUTO"], RemoveWebs=0,
6846 ListMaterials=[], KeepNonlimitShapes=0,
6849 Perform partition operation.
6850 This method may be useful if it is needed to make a partition for
6851 compound contains nonintersected shapes. Performance will be better
6852 since intersection between shapes from compound is not performed.
6855 Description of all parameters as in method geompy.MakePartition
6858 Passed compounds (via ListShapes or via ListTools)
6859 have to consist of nonintersecting shapes.
6862 New GEOM.GEOM_Object, containing the result shapes.
6864 if Limit == self.ShapeType["AUTO"]:
6865 # automatic detection of the most appropriate shape limit type
6867 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6868 Limit = EnumToLong(lim)
6870 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6871 ListKeepInside, ListRemoveInside,
6872 Limit, RemoveWebs, ListMaterials,
6873 KeepNonlimitShapes);
6874 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6875 self._autoPublish(anObj, theName, "partition")
6878 ## See method MakePartition() for more information.
6880 # @ref tui_partition "Example 1"
6881 # \n @ref swig_Partition "Example 2"
6882 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6883 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6884 KeepNonlimitShapes=0, theName=None):
6886 See method geompy.MakePartition for more information.
6888 # Example: see GEOM_TestOthers.py
6889 # note: auto-publishing is done in self.MakePartition()
6890 anObj = self.MakePartition(ListShapes, ListTools,
6891 ListKeepInside, ListRemoveInside,
6892 Limit, RemoveWebs, ListMaterials,
6893 KeepNonlimitShapes, theName);
6896 ## Perform partition of the Shape with the Plane
6897 # @param theShape Shape to be intersected.
6898 # @param thePlane Tool shape, to intersect theShape.
6899 # @param theName Object name; when specified, this parameter is used
6900 # for result publication in the study. Otherwise, if automatic
6901 # publication is switched on, default value is used for result name.
6903 # @return New GEOM.GEOM_Object, containing the result shape.
6905 # @ref tui_partition "Example"
6906 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6908 Perform partition of the Shape with the Plane
6911 theShape Shape to be intersected.
6912 thePlane Tool shape, to intersect theShape.
6913 theName Object name; when specified, this parameter is used
6914 for result publication in the study. Otherwise, if automatic
6915 publication is switched on, default value is used for result name.
6918 New GEOM.GEOM_Object, containing the result shape.
6920 # Example: see GEOM_TestAll.py
6921 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6922 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6923 self._autoPublish(anObj, theName, "partition")
6926 # end of l3_basic_op
6929 ## @addtogroup l3_transform
6932 ## Translate the given object along the vector, specified
6933 # by its end points.
6934 # @param theObject The object to be translated.
6935 # @param thePoint1 Start point of translation vector.
6936 # @param thePoint2 End point of translation vector.
6937 # @param theCopy Flag used to translate object itself or create a copy.
6938 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6939 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6940 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6942 Translate the given object along the vector, specified by its end points.
6945 theObject The object to be translated.
6946 thePoint1 Start point of translation vector.
6947 thePoint2 End point of translation vector.
6948 theCopy Flag used to translate object itself or create a copy.
6951 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6952 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6955 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6957 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
6958 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
6961 ## Translate the given object along the vector, specified
6962 # by its end points, creating its copy before the translation.
6963 # @param theObject The object to be translated.
6964 # @param thePoint1 Start point of translation vector.
6965 # @param thePoint2 End point of translation vector.
6966 # @param theName Object name; when specified, this parameter is used
6967 # for result publication in the study. Otherwise, if automatic
6968 # publication is switched on, default value is used for result name.
6970 # @return New GEOM.GEOM_Object, containing the translated object.
6972 # @ref tui_translation "Example 1"
6973 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
6974 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
6976 Translate the given object along the vector, specified
6977 by its end points, creating its copy before the translation.
6980 theObject The object to be translated.
6981 thePoint1 Start point of translation vector.
6982 thePoint2 End point of translation vector.
6983 theName Object name; when specified, this parameter is used
6984 for result publication in the study. Otherwise, if automatic
6985 publication is switched on, default value is used for result name.
6988 New GEOM.GEOM_Object, containing the translated object.
6990 # Example: see GEOM_TestAll.py
6991 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6992 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
6993 self._autoPublish(anObj, theName, "translated")
6996 ## Translate the given object along the vector, specified by its components.
6997 # @param theObject The object to be translated.
6998 # @param theDX,theDY,theDZ Components of translation vector.
6999 # @param theCopy Flag used to translate object itself or create a copy.
7000 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7001 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7003 # @ref tui_translation "Example"
7004 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7006 Translate the given object along the vector, specified by its components.
7009 theObject The object to be translated.
7010 theDX,theDY,theDZ Components of translation vector.
7011 theCopy Flag used to translate object itself or create a copy.
7014 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7015 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7017 # Example: see GEOM_TestAll.py
7018 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7020 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7022 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7023 anObj.SetParameters(Parameters)
7024 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7027 ## Translate the given object along the vector, specified
7028 # by its components, creating its copy before the translation.
7029 # @param theObject The object to be translated.
7030 # @param theDX,theDY,theDZ Components of translation vector.
7031 # @param theName Object name; when specified, this parameter is used
7032 # for result publication in the study. Otherwise, if automatic
7033 # publication is switched on, default value is used for result name.
7035 # @return New GEOM.GEOM_Object, containing the translated object.
7037 # @ref tui_translation "Example"
7038 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7040 Translate the given object along the vector, specified
7041 by its components, creating its copy before the translation.
7044 theObject The object to be translated.
7045 theDX,theDY,theDZ Components of translation vector.
7046 theName Object name; when specified, this parameter is used
7047 for result publication in the study. Otherwise, if automatic
7048 publication is switched on, default value is used for result name.
7051 New GEOM.GEOM_Object, containing the translated object.
7053 # Example: see GEOM_TestAll.py
7054 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7055 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7056 anObj.SetParameters(Parameters)
7057 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7058 self._autoPublish(anObj, theName, "translated")
7061 ## Translate the given object along the given vector.
7062 # @param theObject The object to be translated.
7063 # @param theVector The translation vector.
7064 # @param theCopy Flag used to translate object itself or create a copy.
7065 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7066 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7067 def TranslateVector(self, theObject, theVector, theCopy=False):
7069 Translate the given object along the given vector.
7072 theObject The object to be translated.
7073 theVector The translation vector.
7074 theCopy Flag used to translate object itself or create a copy.
7077 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7078 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7081 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7083 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7084 RaiseIfFailed("TranslateVector", self.TrsfOp)
7087 ## Translate the given object along the given vector,
7088 # creating its copy before the translation.
7089 # @param theObject The object to be translated.
7090 # @param theVector The translation vector.
7091 # @param theName Object name; when specified, this parameter is used
7092 # for result publication in the study. Otherwise, if automatic
7093 # publication is switched on, default value is used for result name.
7095 # @return New GEOM.GEOM_Object, containing the translated object.
7097 # @ref tui_translation "Example"
7098 def MakeTranslationVector(self, theObject, theVector, theName=None):
7100 Translate the given object along the given vector,
7101 creating its copy before the translation.
7104 theObject The object to be translated.
7105 theVector The translation vector.
7106 theName Object name; when specified, this parameter is used
7107 for result publication in the study. Otherwise, if automatic
7108 publication is switched on, default value is used for result name.
7111 New GEOM.GEOM_Object, containing the translated object.
7113 # Example: see GEOM_TestAll.py
7114 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7115 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7116 self._autoPublish(anObj, theName, "translated")
7119 ## Translate the given object along the given vector on given distance.
7120 # @param theObject The object to be translated.
7121 # @param theVector The translation vector.
7122 # @param theDistance The translation distance.
7123 # @param theCopy Flag used to translate object itself or create a copy.
7124 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7125 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7127 # @ref tui_translation "Example"
7128 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7130 Translate the given object along the given vector on given distance.
7133 theObject The object to be translated.
7134 theVector The translation vector.
7135 theDistance The translation distance.
7136 theCopy Flag used to translate object itself or create a copy.
7139 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7140 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7142 # Example: see GEOM_TestAll.py
7143 theDistance,Parameters = ParseParameters(theDistance)
7144 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7145 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7146 anObj.SetParameters(Parameters)
7149 ## Translate the given object along the given vector on given distance,
7150 # creating its copy before the translation.
7151 # @param theObject The object to be translated.
7152 # @param theVector The translation vector.
7153 # @param theDistance The translation distance.
7154 # @param theName Object name; when specified, this parameter is used
7155 # for result publication in the study. Otherwise, if automatic
7156 # publication is switched on, default value is used for result name.
7158 # @return New GEOM.GEOM_Object, containing the translated object.
7160 # @ref tui_translation "Example"
7161 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7163 Translate the given object along the given vector on given distance,
7164 creating its copy before the translation.
7167 theObject The object to be translated.
7168 theVector The translation vector.
7169 theDistance The translation distance.
7170 theName Object name; when specified, this parameter is used
7171 for result publication in the study. Otherwise, if automatic
7172 publication is switched on, default value is used for result name.
7175 New GEOM.GEOM_Object, containing the translated object.
7177 # Example: see GEOM_TestAll.py
7178 theDistance,Parameters = ParseParameters(theDistance)
7179 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7180 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7181 anObj.SetParameters(Parameters)
7182 self._autoPublish(anObj, theName, "translated")
7185 ## Rotate the given object around the given axis on the given angle.
7186 # @param theObject The object to be rotated.
7187 # @param theAxis Rotation axis.
7188 # @param theAngle Rotation angle in radians.
7189 # @param theCopy Flag used to rotate object itself or create a copy.
7191 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7192 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7194 # @ref tui_rotation "Example"
7195 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7197 Rotate the given object around the given axis on the given angle.
7200 theObject The object to be rotated.
7201 theAxis Rotation axis.
7202 theAngle Rotation angle in radians.
7203 theCopy Flag used to rotate object itself or create a copy.
7206 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7207 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7209 # Example: see GEOM_TestAll.py
7211 if isinstance(theAngle,str):
7213 theAngle, Parameters = ParseParameters(theAngle)
7215 theAngle = theAngle*math.pi/180.0
7217 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7219 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7220 RaiseIfFailed("Rotate", self.TrsfOp)
7221 anObj.SetParameters(Parameters)
7224 ## Rotate the given object around the given axis
7225 # on the given angle, creating its copy before the rotatation.
7226 # @param theObject The object to be rotated.
7227 # @param theAxis Rotation axis.
7228 # @param theAngle Rotation angle in radians.
7229 # @param theName Object name; when specified, this parameter is used
7230 # for result publication in the study. Otherwise, if automatic
7231 # publication is switched on, default value is used for result name.
7233 # @return New GEOM.GEOM_Object, containing the rotated object.
7235 # @ref tui_rotation "Example"
7236 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7238 Rotate the given object around the given axis
7239 on the given angle, creating its copy before the rotatation.
7242 theObject The object to be rotated.
7243 theAxis Rotation axis.
7244 theAngle Rotation angle in radians.
7245 theName Object name; when specified, this parameter is used
7246 for result publication in the study. Otherwise, if automatic
7247 publication is switched on, default value is used for result name.
7250 New GEOM.GEOM_Object, containing the rotated object.
7252 # Example: see GEOM_TestAll.py
7254 if isinstance(theAngle,str):
7256 theAngle, Parameters = ParseParameters(theAngle)
7258 theAngle = theAngle*math.pi/180.0
7259 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7260 RaiseIfFailed("RotateCopy", self.TrsfOp)
7261 anObj.SetParameters(Parameters)
7262 self._autoPublish(anObj, theName, "rotated")
7265 ## Rotate given object around vector perpendicular to plane
7266 # containing three points.
7267 # @param theObject The object to be rotated.
7268 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7269 # containing the three points.
7270 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7271 # @param theCopy Flag used to rotate object itself or create a copy.
7272 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7273 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7274 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7276 Rotate given object around vector perpendicular to plane
7277 containing three points.
7280 theObject The object to be rotated.
7281 theCentPoint central point the axis is the vector perpendicular to the plane
7282 containing the three points.
7283 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7284 theCopy Flag used to rotate object itself or create a copy.
7287 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7288 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7291 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7293 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7294 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7297 ## Rotate given object around vector perpendicular to plane
7298 # containing three points, creating its copy before the rotatation.
7299 # @param theObject The object to be rotated.
7300 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7301 # containing the three points.
7302 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7303 # @param theName Object name; when specified, this parameter is used
7304 # for result publication in the study. Otherwise, if automatic
7305 # publication is switched on, default value is used for result name.
7307 # @return New GEOM.GEOM_Object, containing the rotated object.
7309 # @ref tui_rotation "Example"
7310 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7312 Rotate given object around vector perpendicular to plane
7313 containing three points, creating its copy before the rotatation.
7316 theObject The object to be rotated.
7317 theCentPoint central point the axis is the vector perpendicular to the plane
7318 containing the three points.
7319 thePoint1,thePoint2 in a perpendicular plane of the axis.
7320 theName Object name; when specified, this parameter is used
7321 for result publication in the study. Otherwise, if automatic
7322 publication is switched on, default value is used for result name.
7325 New GEOM.GEOM_Object, containing the rotated object.
7327 # Example: see GEOM_TestAll.py
7328 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7329 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7330 self._autoPublish(anObj, theName, "rotated")
7333 ## Scale the given object by the specified factor.
7334 # @param theObject The object to be scaled.
7335 # @param thePoint Center point for scaling.
7336 # Passing None for it means scaling relatively the origin of global CS.
7337 # @param theFactor Scaling factor value.
7338 # @param theCopy Flag used to scale object itself or create a copy.
7339 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7340 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7341 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7343 Scale the given object by the specified factor.
7346 theObject The object to be scaled.
7347 thePoint Center point for scaling.
7348 Passing None for it means scaling relatively the origin of global CS.
7349 theFactor Scaling factor value.
7350 theCopy Flag used to scale object itself or create a copy.
7353 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7354 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7356 # Example: see GEOM_TestAll.py
7357 theFactor, Parameters = ParseParameters(theFactor)
7359 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7361 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7362 RaiseIfFailed("Scale", self.TrsfOp)
7363 anObj.SetParameters(Parameters)
7366 ## Scale the given object by the factor, creating its copy before the scaling.
7367 # @param theObject The object to be scaled.
7368 # @param thePoint Center point for scaling.
7369 # Passing None for it means scaling relatively the origin of global CS.
7370 # @param theFactor Scaling factor value.
7371 # @param theName Object name; when specified, this parameter is used
7372 # for result publication in the study. Otherwise, if automatic
7373 # publication is switched on, default value is used for result name.
7375 # @return New GEOM.GEOM_Object, containing the scaled shape.
7377 # @ref tui_scale "Example"
7378 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7380 Scale the given object by the factor, creating its copy before the scaling.
7383 theObject The object to be scaled.
7384 thePoint Center point for scaling.
7385 Passing None for it means scaling relatively the origin of global CS.
7386 theFactor Scaling factor value.
7387 theName Object name; when specified, this parameter is used
7388 for result publication in the study. Otherwise, if automatic
7389 publication is switched on, default value is used for result name.
7392 New GEOM.GEOM_Object, containing the scaled shape.
7394 # Example: see GEOM_TestAll.py
7395 theFactor, Parameters = ParseParameters(theFactor)
7396 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7397 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7398 anObj.SetParameters(Parameters)
7399 self._autoPublish(anObj, theName, "scaled")
7402 ## Scale the given object by different factors along coordinate axes.
7403 # @param theObject The object to be scaled.
7404 # @param thePoint Center point for scaling.
7405 # Passing None for it means scaling relatively the origin of global CS.
7406 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7407 # @param theCopy Flag used to scale object itself or create a copy.
7408 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7409 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7410 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7412 Scale the given object by different factors along coordinate axes.
7415 theObject The object to be scaled.
7416 thePoint Center point for scaling.
7417 Passing None for it means scaling relatively the origin of global CS.
7418 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7419 theCopy Flag used to scale object itself or create a copy.
7422 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7423 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7425 # Example: see GEOM_TestAll.py
7426 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7428 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7429 theFactorX, theFactorY, theFactorZ)
7431 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7432 theFactorX, theFactorY, theFactorZ)
7433 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7434 anObj.SetParameters(Parameters)
7437 ## Scale the given object by different factors along coordinate axes,
7438 # creating its copy before the scaling.
7439 # @param theObject The object to be scaled.
7440 # @param thePoint Center point for scaling.
7441 # Passing None for it means scaling relatively the origin of global CS.
7442 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7443 # @param theName Object name; when specified, this parameter is used
7444 # for result publication in the study. Otherwise, if automatic
7445 # publication is switched on, default value is used for result name.
7447 # @return New GEOM.GEOM_Object, containing the scaled shape.
7449 # @ref swig_scale "Example"
7450 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7452 Scale the given object by different factors along coordinate axes,
7453 creating its copy before the scaling.
7456 theObject The object to be scaled.
7457 thePoint Center point for scaling.
7458 Passing None for it means scaling relatively the origin of global CS.
7459 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7460 theName Object name; when specified, this parameter is used
7461 for result publication in the study. Otherwise, if automatic
7462 publication is switched on, default value is used for result name.
7465 New GEOM.GEOM_Object, containing the scaled shape.
7467 # Example: see GEOM_TestAll.py
7468 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7469 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7470 theFactorX, theFactorY, theFactorZ)
7471 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7472 anObj.SetParameters(Parameters)
7473 self._autoPublish(anObj, theName, "scaled")
7476 ## Mirror an object relatively the given plane.
7477 # @param theObject The object to be mirrored.
7478 # @param thePlane Plane of symmetry.
7479 # @param theCopy Flag used to mirror object itself or create a copy.
7480 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7481 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7482 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7484 Mirror an object relatively the given plane.
7487 theObject The object to be mirrored.
7488 thePlane Plane of symmetry.
7489 theCopy Flag used to mirror object itself or create a copy.
7492 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7493 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7496 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7498 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7499 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7502 ## Create an object, symmetrical
7503 # to the given one relatively the given plane.
7504 # @param theObject The object to be mirrored.
7505 # @param thePlane Plane of symmetry.
7506 # @param theName Object name; when specified, this parameter is used
7507 # for result publication in the study. Otherwise, if automatic
7508 # publication is switched on, default value is used for result name.
7510 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7512 # @ref tui_mirror "Example"
7513 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7515 Create an object, symmetrical to the given one relatively the given plane.
7518 theObject The object to be mirrored.
7519 thePlane Plane of symmetry.
7520 theName Object name; when specified, this parameter is used
7521 for result publication in the study. Otherwise, if automatic
7522 publication is switched on, default value is used for result name.
7525 New GEOM.GEOM_Object, containing the mirrored shape.
7527 # Example: see GEOM_TestAll.py
7528 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7529 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7530 self._autoPublish(anObj, theName, "mirrored")
7533 ## Mirror an object relatively the given axis.
7534 # @param theObject The object to be mirrored.
7535 # @param theAxis Axis of symmetry.
7536 # @param theCopy Flag used to mirror object itself or create a copy.
7537 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7538 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7539 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7541 Mirror an object relatively the given axis.
7544 theObject The object to be mirrored.
7545 theAxis Axis of symmetry.
7546 theCopy Flag used to mirror object itself or create a copy.
7549 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7550 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7553 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7555 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7556 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7559 ## Create an object, symmetrical
7560 # to the given one relatively the given axis.
7561 # @param theObject The object to be mirrored.
7562 # @param theAxis Axis of symmetry.
7563 # @param theName Object name; when specified, this parameter is used
7564 # for result publication in the study. Otherwise, if automatic
7565 # publication is switched on, default value is used for result name.
7567 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7569 # @ref tui_mirror "Example"
7570 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7572 Create an object, symmetrical to the given one relatively the given axis.
7575 theObject The object to be mirrored.
7576 theAxis Axis of symmetry.
7577 theName Object name; when specified, this parameter is used
7578 for result publication in the study. Otherwise, if automatic
7579 publication is switched on, default value is used for result name.
7582 New GEOM.GEOM_Object, containing the mirrored shape.
7584 # Example: see GEOM_TestAll.py
7585 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7586 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7587 self._autoPublish(anObj, theName, "mirrored")
7590 ## Mirror an object relatively the given point.
7591 # @param theObject The object to be mirrored.
7592 # @param thePoint Point of symmetry.
7593 # @param theCopy Flag used to mirror object itself or create a copy.
7594 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7595 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7596 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7598 Mirror an object relatively the given point.
7601 theObject The object to be mirrored.
7602 thePoint Point of symmetry.
7603 theCopy Flag used to mirror object itself or create a copy.
7606 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7607 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7609 # Example: see GEOM_TestAll.py
7611 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7613 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7614 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7617 ## Create an object, symmetrical
7618 # to the given one relatively the given point.
7619 # @param theObject The object to be mirrored.
7620 # @param thePoint Point of symmetry.
7621 # @param theName Object name; when specified, this parameter is used
7622 # for result publication in the study. Otherwise, if automatic
7623 # publication is switched on, default value is used for result name.
7625 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7627 # @ref tui_mirror "Example"
7628 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7630 Create an object, symmetrical
7631 to the given one relatively the given point.
7634 theObject The object to be mirrored.
7635 thePoint Point of symmetry.
7636 theName Object name; when specified, this parameter is used
7637 for result publication in the study. Otherwise, if automatic
7638 publication is switched on, default value is used for result name.
7641 New GEOM.GEOM_Object, containing the mirrored shape.
7643 # Example: see GEOM_TestAll.py
7644 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7645 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7646 self._autoPublish(anObj, theName, "mirrored")
7649 ## Modify the location of the given object.
7650 # @param theObject The object to be displaced.
7651 # @param theStartLCS Coordinate system to perform displacement from it.\n
7652 # If \a theStartLCS is NULL, displacement
7653 # will be performed from global CS.\n
7654 # If \a theObject itself is used as \a theStartLCS,
7655 # its location will be changed to \a theEndLCS.
7656 # @param theEndLCS Coordinate system to perform displacement to it.
7657 # @param theCopy Flag used to displace object itself or create a copy.
7658 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7659 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7660 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7662 Modify the Location of the given object by LCS, creating its copy before the setting.
7665 theObject The object to be displaced.
7666 theStartLCS Coordinate system to perform displacement from it.
7667 If theStartLCS is NULL, displacement
7668 will be performed from global CS.
7669 If theObject itself is used as theStartLCS,
7670 its location will be changed to theEndLCS.
7671 theEndLCS Coordinate system to perform displacement to it.
7672 theCopy Flag used to displace object itself or create a copy.
7675 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7676 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7678 # Example: see GEOM_TestAll.py
7680 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7682 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7683 RaiseIfFailed("Displace", self.TrsfOp)
7686 ## Modify the Location of the given object by LCS,
7687 # creating its copy before the setting.
7688 # @param theObject The object to be displaced.
7689 # @param theStartLCS Coordinate system to perform displacement from it.\n
7690 # If \a theStartLCS is NULL, displacement
7691 # will be performed from global CS.\n
7692 # If \a theObject itself is used as \a theStartLCS,
7693 # its location will be changed to \a theEndLCS.
7694 # @param theEndLCS Coordinate system to perform displacement to it.
7695 # @param theName Object name; when specified, this parameter is used
7696 # for result publication in the study. Otherwise, if automatic
7697 # publication is switched on, default value is used for result name.
7699 # @return New GEOM.GEOM_Object, containing the displaced shape.
7701 # @ref tui_modify_location "Example"
7702 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7704 Modify the Location of the given object by LCS, creating its copy before the setting.
7707 theObject The object to be displaced.
7708 theStartLCS Coordinate system to perform displacement from it.
7709 If theStartLCS is NULL, displacement
7710 will be performed from global CS.
7711 If theObject itself is used as theStartLCS,
7712 its location will be changed to theEndLCS.
7713 theEndLCS Coordinate system to perform displacement to it.
7714 theName Object name; when specified, this parameter is used
7715 for result publication in the study. Otherwise, if automatic
7716 publication is switched on, default value is used for result name.
7719 New GEOM.GEOM_Object, containing the displaced shape.
7722 # create local coordinate systems
7723 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7724 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7725 # modify the location of the given object
7726 position = geompy.MakePosition(cylinder, cs1, cs2)
7728 # Example: see GEOM_TestAll.py
7729 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7730 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7731 self._autoPublish(anObj, theName, "displaced")
7734 ## Modify the Location of the given object by Path.
7735 # @param theObject The object to be displaced.
7736 # @param thePath Wire or Edge along that the object will be translated.
7737 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7738 # @param theCopy is to create a copy objects if true.
7739 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7740 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7741 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7743 # @ref tui_modify_location "Example"
7744 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7746 Modify the Location of the given object by Path.
7749 theObject The object to be displaced.
7750 thePath Wire or Edge along that the object will be translated.
7751 theDistance progress of Path (0 = start location, 1 = end of path location).
7752 theCopy is to create a copy objects if true.
7753 theReverse 0 - for usual direction, 1 - to reverse path direction.
7756 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7757 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7760 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7762 # Example: see GEOM_TestAll.py
7763 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7764 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7767 ## Modify the Location of the given object by Path, creating its copy before the operation.
7768 # @param theObject The object to be displaced.
7769 # @param thePath Wire or Edge along that the object will be translated.
7770 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7771 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7772 # @param theName Object name; when specified, this parameter is used
7773 # for result publication in the study. Otherwise, if automatic
7774 # publication is switched on, default value is used for result name.
7776 # @return New GEOM.GEOM_Object, containing the displaced shape.
7777 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7779 Modify the Location of the given object by Path, creating its copy before the operation.
7782 theObject The object to be displaced.
7783 thePath Wire or Edge along that the object will be translated.
7784 theDistance progress of Path (0 = start location, 1 = end of path location).
7785 theReverse 0 - for usual direction, 1 - to reverse path direction.
7786 theName Object name; when specified, this parameter is used
7787 for result publication in the study. Otherwise, if automatic
7788 publication is switched on, default value is used for result name.
7791 New GEOM.GEOM_Object, containing the displaced shape.
7793 # Example: see GEOM_TestAll.py
7794 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7795 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7796 self._autoPublish(anObj, theName, "displaced")
7799 ## Offset given shape.
7800 # @param theObject The base object for the offset.
7801 # @param theOffset Offset value.
7802 # @param theCopy Flag used to offset object itself or create a copy.
7803 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7804 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7805 def Offset(self, theObject, theOffset, theCopy=False):
7810 theObject The base object for the offset.
7811 theOffset Offset value.
7812 theCopy Flag used to offset object itself or create a copy.
7815 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7816 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7818 theOffset, Parameters = ParseParameters(theOffset)
7820 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7822 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7823 RaiseIfFailed("Offset", self.TrsfOp)
7824 anObj.SetParameters(Parameters)
7827 ## Create new object as offset of the given one.
7828 # @param theObject The base object for the offset.
7829 # @param theOffset Offset value.
7830 # @param theName Object name; when specified, this parameter is used
7831 # for result publication in the study. Otherwise, if automatic
7832 # publication is switched on, default value is used for result name.
7834 # @return New GEOM.GEOM_Object, containing the offset object.
7836 # @ref tui_offset "Example"
7837 def MakeOffset(self, theObject, theOffset, theName=None):
7839 Create new object as offset of the given one.
7842 theObject The base object for the offset.
7843 theOffset Offset value.
7844 theName Object name; when specified, this parameter is used
7845 for result publication in the study. Otherwise, if automatic
7846 publication is switched on, default value is used for result name.
7849 New GEOM.GEOM_Object, containing the offset object.
7852 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7853 # create a new object as offset of the given object
7854 offset = geompy.MakeOffset(box, 70.)
7856 # Example: see GEOM_TestAll.py
7857 theOffset, Parameters = ParseParameters(theOffset)
7858 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7859 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7860 anObj.SetParameters(Parameters)
7861 self._autoPublish(anObj, theName, "offset")
7864 ## Create new object as projection of the given one on a 2D surface.
7865 # @param theSource The source object for the projection. It can be a point, edge or wire.
7866 # @param theTarget The target object. It can be planar or cylindrical face.
7867 # @param theName Object name; when specified, this parameter is used
7868 # for result publication in the study. Otherwise, if automatic
7869 # publication is switched on, default value is used for result name.
7871 # @return New GEOM.GEOM_Object, containing the projection.
7873 # @ref tui_projection "Example"
7874 def MakeProjection(self, theSource, theTarget, theName=None):
7876 Create new object as projection of the given one on a 2D surface.
7879 theSource The source object for the projection. It can be a point, edge or wire.
7880 theTarget The target object. It can be planar or cylindrical face.
7881 theName Object name; when specified, this parameter is used
7882 for result publication in the study. Otherwise, if automatic
7883 publication is switched on, default value is used for result name.
7886 New GEOM.GEOM_Object, containing the projection.
7888 # Example: see GEOM_TestAll.py
7889 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7890 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7891 self._autoPublish(anObj, theName, "projection")
7894 # -----------------------------------------------------------------------------
7896 # -----------------------------------------------------------------------------
7898 ## Translate the given object along the given vector a given number times
7899 # @param theObject The object to be translated.
7900 # @param theVector Direction of the translation. DX if None.
7901 # @param theStep Distance to translate on.
7902 # @param theNbTimes Quantity of translations to be done.
7903 # @param theName Object name; when specified, this parameter is used
7904 # for result publication in the study. Otherwise, if automatic
7905 # publication is switched on, default value is used for result name.
7907 # @return New GEOM.GEOM_Object, containing compound of all
7908 # the shapes, obtained after each translation.
7910 # @ref tui_multi_translation "Example"
7911 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7913 Translate the given object along the given vector a given number times
7916 theObject The object to be translated.
7917 theVector Direction of the translation. DX if None.
7918 theStep Distance to translate on.
7919 theNbTimes Quantity of translations to be done.
7920 theName Object name; when specified, this parameter is used
7921 for result publication in the study. Otherwise, if automatic
7922 publication is switched on, default value is used for result name.
7925 New GEOM.GEOM_Object, containing compound of all
7926 the shapes, obtained after each translation.
7929 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7931 # Example: see GEOM_TestAll.py
7932 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7933 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7934 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7935 anObj.SetParameters(Parameters)
7936 self._autoPublish(anObj, theName, "multitranslation")
7939 ## Conseqently apply two specified translations to theObject specified number of times.
7940 # @param theObject The object to be translated.
7941 # @param theVector1 Direction of the first translation. DX if None.
7942 # @param theStep1 Step of the first translation.
7943 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7944 # @param theVector2 Direction of the second translation. DY if None.
7945 # @param theStep2 Step of the second translation.
7946 # @param theNbTimes2 Quantity of translations to be done along theVector2.
7947 # @param theName Object name; when specified, this parameter is used
7948 # for result publication in the study. Otherwise, if automatic
7949 # publication is switched on, default value is used for result name.
7951 # @return New GEOM.GEOM_Object, containing compound of all
7952 # the shapes, obtained after each translation.
7954 # @ref tui_multi_translation "Example"
7955 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
7956 theVector2, theStep2, theNbTimes2, theName=None):
7958 Conseqently apply two specified translations to theObject specified number of times.
7961 theObject The object to be translated.
7962 theVector1 Direction of the first translation. DX if None.
7963 theStep1 Step of the first translation.
7964 theNbTimes1 Quantity of translations to be done along theVector1.
7965 theVector2 Direction of the second translation. DY if None.
7966 theStep2 Step of the second translation.
7967 theNbTimes2 Quantity of translations to be done along theVector2.
7968 theName Object name; when specified, this parameter is used
7969 for result publication in the study. Otherwise, if automatic
7970 publication is switched on, default value is used for result name.
7973 New GEOM.GEOM_Object, containing compound of all
7974 the shapes, obtained after each translation.
7977 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
7979 # Example: see GEOM_TestAll.py
7980 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
7981 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
7982 theVector2, theStep2, theNbTimes2)
7983 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
7984 anObj.SetParameters(Parameters)
7985 self._autoPublish(anObj, theName, "multitranslation")
7988 ## Rotate the given object around the given axis a given number times.
7989 # Rotation angle will be 2*PI/theNbTimes.
7990 # @param theObject The object to be rotated.
7991 # @param theAxis The rotation axis. DZ if None.
7992 # @param theNbTimes Quantity of rotations to be done.
7993 # @param theName Object name; when specified, this parameter is used
7994 # for result publication in the study. Otherwise, if automatic
7995 # publication is switched on, default value is used for result name.
7997 # @return New GEOM.GEOM_Object, containing compound of all the
7998 # shapes, obtained after each rotation.
8000 # @ref tui_multi_rotation "Example"
8001 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8003 Rotate the given object around the given axis a given number times.
8004 Rotation angle will be 2*PI/theNbTimes.
8007 theObject The object to be rotated.
8008 theAxis The rotation axis. DZ if None.
8009 theNbTimes Quantity of rotations to be done.
8010 theName Object name; when specified, this parameter is used
8011 for result publication in the study. Otherwise, if automatic
8012 publication is switched on, default value is used for result name.
8015 New GEOM.GEOM_Object, containing compound of all the
8016 shapes, obtained after each rotation.
8019 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8021 # Example: see GEOM_TestAll.py
8022 theNbTimes, Parameters = ParseParameters(theNbTimes)
8023 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8024 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8025 anObj.SetParameters(Parameters)
8026 self._autoPublish(anObj, theName, "multirotation")
8029 ## Rotate the given object around the given axis
8030 # a given number times on the given angle.
8031 # @param theObject The object to be rotated.
8032 # @param theAxis The rotation axis. DZ if None.
8033 # @param theAngleStep Rotation angle in radians.
8034 # @param theNbTimes Quantity of rotations to be done.
8035 # @param theName Object name; when specified, this parameter is used
8036 # for result publication in the study. Otherwise, if automatic
8037 # publication is switched on, default value is used for result name.
8039 # @return New GEOM.GEOM_Object, containing compound of all the
8040 # shapes, obtained after each rotation.
8042 # @ref tui_multi_rotation "Example"
8043 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8045 Rotate the given object around the given axis
8046 a given number times on the given angle.
8049 theObject The object to be rotated.
8050 theAxis The rotation axis. DZ if None.
8051 theAngleStep Rotation angle in radians.
8052 theNbTimes Quantity of rotations to be done.
8053 theName Object name; when specified, this parameter is used
8054 for result publication in the study. Otherwise, if automatic
8055 publication is switched on, default value is used for result name.
8058 New GEOM.GEOM_Object, containing compound of all the
8059 shapes, obtained after each rotation.
8062 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8064 # Example: see GEOM_TestAll.py
8065 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8066 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8067 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8068 anObj.SetParameters(Parameters)
8069 self._autoPublish(anObj, theName, "multirotation")
8072 ## Rotate the given object around the given axis a given
8073 # number times and multi-translate each rotation result.
8074 # Rotation angle will be 2*PI/theNbTimes1.
8075 # Translation direction passes through center of gravity
8076 # of rotated shape and its projection on the rotation axis.
8077 # @param theObject The object to be rotated.
8078 # @param theAxis Rotation axis. DZ if None.
8079 # @param theNbTimes1 Quantity of rotations to be done.
8080 # @param theRadialStep Translation distance.
8081 # @param theNbTimes2 Quantity of translations to be done.
8082 # @param theName Object name; when specified, this parameter is used
8083 # for result publication in the study. Otherwise, if automatic
8084 # publication is switched on, default value is used for result name.
8086 # @return New GEOM.GEOM_Object, containing compound of all the
8087 # shapes, obtained after each transformation.
8089 # @ref tui_multi_rotation "Example"
8090 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8092 Rotate the given object around the
8093 given axis on the given angle a given number
8094 times and multi-translate each rotation result.
8095 Translation direction passes through center of gravity
8096 of rotated shape and its projection on the rotation axis.
8099 theObject The object to be rotated.
8100 theAxis Rotation axis. DZ if None.
8101 theNbTimes1 Quantity of rotations to be done.
8102 theRadialStep Translation distance.
8103 theNbTimes2 Quantity of translations to be done.
8104 theName Object name; when specified, this parameter is used
8105 for result publication in the study. Otherwise, if automatic
8106 publication is switched on, default value is used for result name.
8109 New GEOM.GEOM_Object, containing compound of all the
8110 shapes, obtained after each transformation.
8113 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8115 # Example: see GEOM_TestAll.py
8116 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8117 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8118 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8119 anObj.SetParameters(Parameters)
8120 self._autoPublish(anObj, theName, "multirotation")
8123 ## Rotate the given object around the
8124 # given axis on the given angle a given number
8125 # times and multi-translate each rotation result.
8126 # Translation direction passes through center of gravity
8127 # of rotated shape and its projection on the rotation axis.
8128 # @param theObject The object to be rotated.
8129 # @param theAxis Rotation axis. DZ if None.
8130 # @param theAngleStep Rotation angle in radians.
8131 # @param theNbTimes1 Quantity of rotations to be done.
8132 # @param theRadialStep Translation distance.
8133 # @param theNbTimes2 Quantity of translations to be done.
8134 # @param theName Object name; when specified, this parameter is used
8135 # for result publication in the study. Otherwise, if automatic
8136 # publication is switched on, default value is used for result name.
8138 # @return New GEOM.GEOM_Object, containing compound of all the
8139 # shapes, obtained after each transformation.
8141 # @ref tui_multi_rotation "Example"
8142 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8144 Rotate the given object around the
8145 given axis on the given angle a given number
8146 times and multi-translate each rotation result.
8147 Translation direction passes through center of gravity
8148 of rotated shape and its projection on the rotation axis.
8151 theObject The object to be rotated.
8152 theAxis Rotation axis. DZ if None.
8153 theAngleStep Rotation angle in radians.
8154 theNbTimes1 Quantity of rotations to be done.
8155 theRadialStep Translation distance.
8156 theNbTimes2 Quantity of translations to be done.
8157 theName Object name; when specified, this parameter is used
8158 for result publication in the study. Otherwise, if automatic
8159 publication is switched on, default value is used for result name.
8162 New GEOM.GEOM_Object, containing compound of all the
8163 shapes, obtained after each transformation.
8166 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8168 # Example: see GEOM_TestAll.py
8169 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8170 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8171 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8172 anObj.SetParameters(Parameters)
8173 self._autoPublish(anObj, theName, "multirotation")
8176 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8178 # @ref swig_MakeMultiRotation "Example"
8179 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8181 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8184 pz = geompy.MakeVertex(0, 0, 100)
8185 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8186 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8188 # Example: see GEOM_TestOthers.py
8189 aVec = self.MakeLine(aPoint,aDir)
8190 # note: auto-publishing is done in self.MultiRotate1D()
8191 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8194 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8196 # @ref swig_MakeMultiRotation "Example"
8197 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8199 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8202 pz = geompy.MakeVertex(0, 0, 100)
8203 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8204 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8206 # Example: see GEOM_TestOthers.py
8207 aVec = self.MakeLine(aPoint,aDir)
8208 # note: auto-publishing is done in self.MultiRotate1D()
8209 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8212 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8214 # @ref swig_MakeMultiRotation "Example"
8215 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8217 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8220 pz = geompy.MakeVertex(0, 0, 100)
8221 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8222 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8224 # Example: see GEOM_TestOthers.py
8225 aVec = self.MakeLine(aPoint,aDir)
8226 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8227 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8230 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8232 # @ref swig_MakeMultiRotation "Example"
8233 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8235 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8238 pz = geompy.MakeVertex(0, 0, 100)
8239 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8240 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8242 # Example: see GEOM_TestOthers.py
8243 aVec = self.MakeLine(aPoint,aDir)
8244 # note: auto-publishing is done in self.MultiRotate2D()
8245 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8248 # end of l3_transform
8251 ## @addtogroup l3_transform_d
8254 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8255 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8257 Deprecated method. Use MultiRotate1DNbTimes instead.
8259 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8260 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8262 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8263 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8264 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8266 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8267 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8270 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8272 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8273 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8274 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8275 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8276 anObj.SetParameters(Parameters)
8277 self._autoPublish(anObj, theName, "multirotation")
8280 ## The same, as MultiRotate1D(), but axis is given by direction and point
8281 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8282 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8284 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8285 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8288 pz = geompy.MakeVertex(0, 0, 100)
8289 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8290 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8292 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8293 aVec = self.MakeLine(aPoint,aDir)
8294 # note: auto-publishing is done in self.MultiRotate1D()
8295 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8298 ## The same, as MultiRotate2D(), but axis is given by direction and point
8299 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8300 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8302 The same, as MultiRotate2D(), but axis is given by direction and point
8303 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8306 pz = geompy.MakeVertex(0, 0, 100)
8307 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8308 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8310 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8311 aVec = self.MakeLine(aPoint,aDir)
8312 # note: auto-publishing is done in self.MultiRotate2D()
8313 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8316 # end of l3_transform_d
8319 ## @addtogroup l3_local
8322 ## Perform a fillet on all edges of the given shape.
8323 # @param theShape Shape, to perform fillet on.
8324 # @param theR Fillet radius.
8325 # @param theName Object name; when specified, this parameter is used
8326 # for result publication in the study. Otherwise, if automatic
8327 # publication is switched on, default value is used for result name.
8329 # @return New GEOM.GEOM_Object, containing the result shape.
8331 # @ref tui_fillet "Example 1"
8332 # \n @ref swig_MakeFilletAll "Example 2"
8333 def MakeFilletAll(self, theShape, theR, theName=None):
8335 Perform a fillet on all edges of the given shape.
8338 theShape Shape, to perform fillet on.
8340 theName Object name; when specified, this parameter is used
8341 for result publication in the study. Otherwise, if automatic
8342 publication is switched on, default value is used for result name.
8345 New GEOM.GEOM_Object, containing the result shape.
8348 filletall = geompy.MakeFilletAll(prism, 10.)
8350 # Example: see GEOM_TestOthers.py
8351 theR,Parameters = ParseParameters(theR)
8352 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8353 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8354 anObj.SetParameters(Parameters)
8355 self._autoPublish(anObj, theName, "fillet")
8358 ## Perform a fillet on the specified edges/faces of the given shape
8359 # @param theShape Shape, to perform fillet on.
8360 # @param theR Fillet radius.
8361 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8362 # @param theListShapes Global indices of edges/faces to perform fillet on.
8363 # @param theName Object name; when specified, this parameter is used
8364 # for result publication in the study. Otherwise, if automatic
8365 # publication is switched on, default value is used for result name.
8367 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8369 # @return New GEOM.GEOM_Object, containing the result shape.
8371 # @ref tui_fillet "Example"
8372 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8374 Perform a fillet on the specified edges/faces of the given shape
8377 theShape Shape, to perform fillet on.
8379 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8380 theListShapes Global indices of edges/faces to perform fillet on.
8381 theName Object name; when specified, this parameter is used
8382 for result publication in the study. Otherwise, if automatic
8383 publication is switched on, default value is used for result name.
8386 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8389 New GEOM.GEOM_Object, containing the result shape.
8392 # get the list of IDs (IDList) for the fillet
8393 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8395 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8396 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8397 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8398 # make a fillet on the specified edges of the given shape
8399 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8401 # Example: see GEOM_TestAll.py
8402 theR,Parameters = ParseParameters(theR)
8404 if theShapeType == self.ShapeType["EDGE"]:
8405 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8406 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8408 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8409 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8410 anObj.SetParameters(Parameters)
8411 self._autoPublish(anObj, theName, "fillet")
8414 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8415 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8417 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8420 # get the list of IDs (IDList) for the fillet
8421 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8423 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8424 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8425 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8426 # make a fillet on the specified edges of the given shape
8427 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8429 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8431 if theShapeType == self.ShapeType["EDGE"]:
8432 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8433 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8435 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8436 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8437 anObj.SetParameters(Parameters)
8438 self._autoPublish(anObj, theName, "fillet")
8441 ## Perform a fillet on the specified edges of the given shape
8442 # @param theShape Wire Shape to perform fillet on.
8443 # @param theR Fillet radius.
8444 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8445 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8446 # \note The list of vertices could be empty,
8447 # in this case fillet will done done at all vertices in wire
8448 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8449 # by the length of the edges, nearest to the fillet vertex.
8450 # But sometimes the next edge is C1 continuous with the one, nearest to
8451 # the fillet point, and such two (or more) edges can be united to allow
8452 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8453 # thus ignoring the secant vertex (vertices).
8454 # @param theName Object name; when specified, this parameter is used
8455 # for result publication in the study. Otherwise, if automatic
8456 # publication is switched on, default value is used for result name.
8458 # @return New GEOM.GEOM_Object, containing the result shape.
8460 # @ref tui_fillet2d "Example"
8461 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8463 Perform a fillet on the specified edges of the given shape
8466 theShape Wire Shape to perform fillet on.
8468 theListOfVertexes Global indices of vertexes to perform fillet on.
8469 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8470 by the length of the edges, nearest to the fillet vertex.
8471 But sometimes the next edge is C1 continuous with the one, nearest to
8472 the fillet point, and such two (or more) edges can be united to allow
8473 bigger radius. Set this flag to TRUE to allow collinear edges union,
8474 thus ignoring the secant vertex (vertices).
8475 theName Object name; when specified, this parameter is used
8476 for result publication in the study. Otherwise, if automatic
8477 publication is switched on, default value is used for result name.
8479 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8481 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8484 New GEOM.GEOM_Object, containing the result shape.
8488 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8489 # make fillet at given wire vertices with giver radius
8490 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8492 # Example: see GEOM_TestAll.py
8493 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8494 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8495 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8496 anObj.SetParameters(Parameters)
8497 self._autoPublish(anObj, theName, "fillet")
8500 ## Perform a fillet at the specified vertices of the given face/shell.
8501 # @param theShape Face or Shell shape to perform fillet on.
8502 # @param theR Fillet radius.
8503 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8504 # @param theName Object name; when specified, this parameter is used
8505 # for result publication in the study. Otherwise, if automatic
8506 # publication is switched on, default value is used for result name.
8508 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8510 # @return New GEOM.GEOM_Object, containing the result shape.
8512 # @ref tui_fillet2d "Example"
8513 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8515 Perform a fillet at the specified vertices of the given face/shell.
8518 theShape Face or Shell shape to perform fillet on.
8520 theListOfVertexes Global indices of vertexes to perform fillet on.
8521 theName Object name; when specified, this parameter is used
8522 for result publication in the study. Otherwise, if automatic
8523 publication is switched on, default value is used for result name.
8525 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8528 New GEOM.GEOM_Object, containing the result shape.
8531 face = geompy.MakeFaceHW(100, 100, 1)
8532 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8534 # Example: see GEOM_TestAll.py
8535 theR,Parameters = ParseParameters(theR)
8536 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8537 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8538 anObj.SetParameters(Parameters)
8539 self._autoPublish(anObj, theName, "fillet")
8542 ## Perform a symmetric chamfer on all edges of the given shape.
8543 # @param theShape Shape, to perform chamfer on.
8544 # @param theD Chamfer size along each face.
8545 # @param theName Object name; when specified, this parameter is used
8546 # for result publication in the study. Otherwise, if automatic
8547 # publication is switched on, default value is used for result name.
8549 # @return New GEOM.GEOM_Object, containing the result shape.
8551 # @ref tui_chamfer "Example 1"
8552 # \n @ref swig_MakeChamferAll "Example 2"
8553 def MakeChamferAll(self, theShape, theD, theName=None):
8555 Perform a symmetric chamfer on all edges of the given shape.
8558 theShape Shape, to perform chamfer on.
8559 theD Chamfer size along each face.
8560 theName Object name; when specified, this parameter is used
8561 for result publication in the study. Otherwise, if automatic
8562 publication is switched on, default value is used for result name.
8565 New GEOM.GEOM_Object, containing the result shape.
8568 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8570 # Example: see GEOM_TestOthers.py
8571 theD,Parameters = ParseParameters(theD)
8572 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8573 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8574 anObj.SetParameters(Parameters)
8575 self._autoPublish(anObj, theName, "chamfer")
8578 ## Perform a chamfer on edges, common to the specified faces,
8579 # with distance D1 on the Face1
8580 # @param theShape Shape, to perform chamfer on.
8581 # @param theD1 Chamfer size along \a theFace1.
8582 # @param theD2 Chamfer size along \a theFace2.
8583 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8584 # @param theName Object name; when specified, this parameter is used
8585 # for result publication in the study. Otherwise, if automatic
8586 # publication is switched on, default value is used for result name.
8588 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8590 # @return New GEOM.GEOM_Object, containing the result shape.
8592 # @ref tui_chamfer "Example"
8593 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8595 Perform a chamfer on edges, common to the specified faces,
8596 with distance D1 on the Face1
8599 theShape Shape, to perform chamfer on.
8600 theD1 Chamfer size along theFace1.
8601 theD2 Chamfer size along theFace2.
8602 theFace1,theFace2 Global indices of two faces of theShape.
8603 theName Object name; when specified, this parameter is used
8604 for result publication in the study. Otherwise, if automatic
8605 publication is switched on, default value is used for result name.
8608 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8611 New GEOM.GEOM_Object, containing the result shape.
8614 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8615 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8616 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8617 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8619 # Example: see GEOM_TestAll.py
8620 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8621 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8622 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8623 anObj.SetParameters(Parameters)
8624 self._autoPublish(anObj, theName, "chamfer")
8627 ## Perform a chamfer on edges
8628 # @param theShape Shape, to perform chamfer on.
8629 # @param theD Chamfer length
8630 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8631 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8632 # @param theName Object name; when specified, this parameter is used
8633 # for result publication in the study. Otherwise, if automatic
8634 # publication is switched on, default value is used for result name.
8636 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8638 # @return New GEOM.GEOM_Object, containing the result shape.
8639 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8641 Perform a chamfer on edges
8644 theShape Shape, to perform chamfer on.
8645 theD1 Chamfer size along theFace1.
8646 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8647 theFace1,theFace2 Global indices of two faces of theShape.
8648 theName Object name; when specified, this parameter is used
8649 for result publication in the study. Otherwise, if automatic
8650 publication is switched on, default value is used for result name.
8653 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8656 New GEOM.GEOM_Object, containing the result shape.
8659 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8660 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8661 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8663 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8666 if isinstance(theAngle,str):
8668 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8670 theAngle = theAngle*math.pi/180.0
8671 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8672 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8673 anObj.SetParameters(Parameters)
8674 self._autoPublish(anObj, theName, "chamfer")
8677 ## Perform a chamfer on all edges of the specified faces,
8678 # with distance D1 on the first specified face (if several for one edge)
8679 # @param theShape Shape, to perform chamfer on.
8680 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8681 # connected to the edge, are in \a theFaces, \a theD1
8682 # will be get along face, which is nearer to \a theFaces beginning.
8683 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8684 # @param theFaces Sequence of global indices of faces of \a theShape.
8685 # @param theName Object name; when specified, this parameter is used
8686 # for result publication in the study. Otherwise, if automatic
8687 # publication is switched on, default value is used for result name.
8689 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8691 # @return New GEOM.GEOM_Object, containing the result shape.
8693 # @ref tui_chamfer "Example"
8694 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8696 Perform a chamfer on all edges of the specified faces,
8697 with distance D1 on the first specified face (if several for one edge)
8700 theShape Shape, to perform chamfer on.
8701 theD1 Chamfer size along face from theFaces. If both faces,
8702 connected to the edge, are in theFaces, theD1
8703 will be get along face, which is nearer to theFaces beginning.
8704 theD2 Chamfer size along another of two faces, connected to the edge.
8705 theFaces Sequence of global indices of faces of theShape.
8706 theName Object name; when specified, this parameter is used
8707 for result publication in the study. Otherwise, if automatic
8708 publication is switched on, default value is used for result name.
8710 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8713 New GEOM.GEOM_Object, containing the result shape.
8715 # Example: see GEOM_TestAll.py
8716 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8717 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8718 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8719 anObj.SetParameters(Parameters)
8720 self._autoPublish(anObj, theName, "chamfer")
8723 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8724 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8726 # @ref swig_FilletChamfer "Example"
8727 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8729 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8730 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8733 if isinstance(theAngle,str):
8735 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8737 theAngle = theAngle*math.pi/180.0
8738 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8739 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8740 anObj.SetParameters(Parameters)
8741 self._autoPublish(anObj, theName, "chamfer")
8744 ## Perform a chamfer on edges,
8745 # with distance D1 on the first specified face (if several for one edge)
8746 # @param theShape Shape, to perform chamfer on.
8747 # @param theD1,theD2 Chamfer size
8748 # @param theEdges Sequence of edges of \a theShape.
8749 # @param theName Object name; when specified, this parameter is used
8750 # for result publication in the study. Otherwise, if automatic
8751 # publication is switched on, default value is used for result name.
8753 # @return New GEOM.GEOM_Object, containing the result shape.
8755 # @ref swig_FilletChamfer "Example"
8756 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8758 Perform a chamfer on edges,
8759 with distance D1 on the first specified face (if several for one edge)
8762 theShape Shape, to perform chamfer on.
8763 theD1,theD2 Chamfer size
8764 theEdges Sequence of edges of theShape.
8765 theName Object name; when specified, this parameter is used
8766 for result publication in the study. Otherwise, if automatic
8767 publication is switched on, default value is used for result name.
8770 New GEOM.GEOM_Object, containing the result shape.
8772 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8773 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8774 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8775 anObj.SetParameters(Parameters)
8776 self._autoPublish(anObj, theName, "chamfer")
8779 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8780 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8781 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8783 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8784 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8787 if isinstance(theAngle,str):
8789 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8791 theAngle = theAngle*math.pi/180.0
8792 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8793 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8794 anObj.SetParameters(Parameters)
8795 self._autoPublish(anObj, theName, "chamfer")
8798 ## @sa MakeChamferEdge(), MakeChamferFaces()
8800 # @ref swig_MakeChamfer "Example"
8801 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8803 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8805 # Example: see GEOM_TestOthers.py
8807 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8808 if aShapeType == self.ShapeType["EDGE"]:
8809 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8811 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8814 ## Remove material from a solid by extrusion of the base shape on the given distance.
8815 # @param theInit Shape to remove material from. It must be a solid or
8816 # a compound made of a single solid.
8817 # @param theBase Closed edge or wire defining the base shape to be extruded.
8818 # @param theH Prism dimension along the normal to theBase
8819 # @param theAngle Draft angle in degrees.
8820 # @param theName Object name; when specified, this parameter is used
8821 # for result publication in the study. Otherwise, if automatic
8822 # publication is switched on, default value is used for result name.
8824 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8826 # @ref tui_creation_prism "Example"
8827 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8829 Add material to a solid by extrusion of the base shape on the given distance.
8832 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8833 theBase Closed edge or wire defining the base shape to be extruded.
8834 theH Prism dimension along the normal to theBase
8835 theAngle Draft angle in degrees.
8836 theName Object name; when specified, this parameter is used
8837 for result publication in the study. Otherwise, if automatic
8838 publication is switched on, default value is used for result name.
8841 New GEOM.GEOM_Object, containing the initial shape with removed material.
8843 # Example: see GEOM_TestAll.py
8844 #theH,Parameters = ParseParameters(theH)
8845 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8846 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8847 #anObj.SetParameters(Parameters)
8848 self._autoPublish(anObj, theName, "extrudedCut")
8851 ## Add material to a solid by extrusion of the base shape on the given distance.
8852 # @param theInit Shape to add material to. It must be a solid or
8853 # a compound made of a single solid.
8854 # @param theBase Closed edge or wire defining the base shape to be extruded.
8855 # @param theH Prism dimension along the normal to theBase
8856 # @param theAngle Draft angle in degrees.
8857 # @param theName Object name; when specified, this parameter is used
8858 # for result publication in the study. Otherwise, if automatic
8859 # publication is switched on, default value is used for result name.
8861 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8863 # @ref tui_creation_prism "Example"
8864 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8866 Add material to a solid by extrusion of the base shape on the given distance.
8869 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8870 theBase Closed edge or wire defining the base shape to be extruded.
8871 theH Prism dimension along the normal to theBase
8872 theAngle Draft angle in degrees.
8873 theName Object name; when specified, this parameter is used
8874 for result publication in the study. Otherwise, if automatic
8875 publication is switched on, default value is used for result name.
8878 New GEOM.GEOM_Object, containing the initial shape with added material.
8880 # Example: see GEOM_TestAll.py
8881 #theH,Parameters = ParseParameters(theH)
8882 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8883 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8884 #anObj.SetParameters(Parameters)
8885 self._autoPublish(anObj, theName, "extrudedBoss")
8891 ## @addtogroup l3_basic_op
8894 ## Perform an Archimde operation on the given shape with given parameters.
8895 # The object presenting the resulting face is returned.
8896 # @param theShape Shape to be put in water.
8897 # @param theWeight Weight og the shape.
8898 # @param theWaterDensity Density of the water.
8899 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8900 # @param theName Object name; when specified, this parameter is used
8901 # for result publication in the study. Otherwise, if automatic
8902 # publication is switched on, default value is used for result name.
8904 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8905 # by a plane, corresponding to water level.
8907 # @ref tui_archimede "Example"
8908 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8910 Perform an Archimde operation on the given shape with given parameters.
8911 The object presenting the resulting face is returned.
8914 theShape Shape to be put in water.
8915 theWeight Weight og the shape.
8916 theWaterDensity Density of the water.
8917 theMeshDeflection Deflection of the mesh, using to compute the section.
8918 theName Object name; when specified, this parameter is used
8919 for result publication in the study. Otherwise, if automatic
8920 publication is switched on, default value is used for result name.
8923 New GEOM.GEOM_Object, containing a section of theShape
8924 by a plane, corresponding to water level.
8926 # Example: see GEOM_TestAll.py
8927 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8928 theWeight,theWaterDensity,theMeshDeflection)
8929 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8930 RaiseIfFailed("MakeArchimede", self.LocalOp)
8931 anObj.SetParameters(Parameters)
8932 self._autoPublish(anObj, theName, "archimede")
8935 # end of l3_basic_op
8938 ## @addtogroup l2_measure
8941 ## Get point coordinates
8944 # @ref tui_measurement_tools_page "Example"
8945 def PointCoordinates(self,Point):
8947 Get point coordinates
8952 # Example: see GEOM_TestMeasures.py
8953 aTuple = self.MeasuOp.PointCoordinates(Point)
8954 RaiseIfFailed("PointCoordinates", self.MeasuOp)
8957 ## Get vector coordinates
8960 # @ref tui_measurement_tools_page "Example"
8961 def VectorCoordinates(self,Vector):
8963 Get vector coordinates
8969 p1=self.GetFirstVertex(Vector)
8970 p2=self.GetLastVertex(Vector)
8972 X1=self.PointCoordinates(p1)
8973 X2=self.PointCoordinates(p2)
8975 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
8978 ## Compute cross product
8979 # @return vector w=u^v
8981 # @ref tui_measurement_tools_page "Example"
8982 def CrossProduct(self, Vector1, Vector2):
8984 Compute cross product
8986 Returns: vector w=u^v
8988 u=self.VectorCoordinates(Vector1)
8989 v=self.VectorCoordinates(Vector2)
8990 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])
8994 ## Compute cross product
8995 # @return dot product p=u.v
8997 # @ref tui_measurement_tools_page "Example"
8998 def DotProduct(self, Vector1, Vector2):
9000 Compute cross product
9002 Returns: dot product p=u.v
9004 u=self.VectorCoordinates(Vector1)
9005 v=self.VectorCoordinates(Vector2)
9006 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9011 ## Get summarized length of all wires,
9012 # area of surface and volume of the given shape.
9013 # @param theShape Shape to define properties of.
9014 # @return [theLength, theSurfArea, theVolume]\n
9015 # theLength: Summarized length of all wires of the given shape.\n
9016 # theSurfArea: Area of surface of the given shape.\n
9017 # theVolume: Volume of the given shape.
9019 # @ref tui_measurement_tools_page "Example"
9020 def BasicProperties(self,theShape):
9022 Get summarized length of all wires,
9023 area of surface and volume of the given shape.
9026 theShape Shape to define properties of.
9029 [theLength, theSurfArea, theVolume]
9030 theLength: Summarized length of all wires of the given shape.
9031 theSurfArea: Area of surface of the given shape.
9032 theVolume: Volume of the given shape.
9034 # Example: see GEOM_TestMeasures.py
9035 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9036 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9039 ## Get parameters of bounding box of the given shape
9040 # @param theShape Shape to obtain bounding box of.
9041 # @param precise TRUE for precise computation; FALSE for fast one.
9042 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9043 # Xmin,Xmax: Limits of shape along OX axis.
9044 # Ymin,Ymax: Limits of shape along OY axis.
9045 # Zmin,Zmax: Limits of shape along OZ axis.
9047 # @ref tui_measurement_tools_page "Example"
9048 def BoundingBox (self, theShape, precise=False):
9050 Get parameters of bounding box of the given shape
9053 theShape Shape to obtain bounding box of.
9054 precise TRUE for precise computation; FALSE for fast one.
9057 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9058 Xmin,Xmax: Limits of shape along OX axis.
9059 Ymin,Ymax: Limits of shape along OY axis.
9060 Zmin,Zmax: Limits of shape along OZ axis.
9062 # Example: see GEOM_TestMeasures.py
9063 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9064 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9067 ## Get bounding box of the given shape
9068 # @param theShape Shape to obtain bounding box of.
9069 # @param precise TRUE for precise computation; FALSE for fast one.
9070 # @param theName Object name; when specified, this parameter is used
9071 # for result publication in the study. Otherwise, if automatic
9072 # publication is switched on, default value is used for result name.
9074 # @return New GEOM.GEOM_Object, containing the created box.
9076 # @ref tui_measurement_tools_page "Example"
9077 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9079 Get bounding box of the given shape
9082 theShape Shape to obtain bounding box of.
9083 precise TRUE for precise computation; FALSE for fast one.
9084 theName Object name; when specified, this parameter is used
9085 for result publication in the study. Otherwise, if automatic
9086 publication is switched on, default value is used for result name.
9089 New GEOM.GEOM_Object, containing the created box.
9091 # Example: see GEOM_TestMeasures.py
9092 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9093 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9094 self._autoPublish(anObj, theName, "bndbox")
9097 ## Get inertia matrix and moments of inertia of theShape.
9098 # @param theShape Shape to calculate inertia of.
9099 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9100 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9101 # Ix,Iy,Iz: Moments of inertia of the given shape.
9103 # @ref tui_measurement_tools_page "Example"
9104 def Inertia(self,theShape):
9106 Get inertia matrix and moments of inertia of theShape.
9109 theShape Shape to calculate inertia of.
9112 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9113 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9114 Ix,Iy,Iz: Moments of inertia of the given shape.
9116 # Example: see GEOM_TestMeasures.py
9117 aTuple = self.MeasuOp.GetInertia(theShape)
9118 RaiseIfFailed("GetInertia", self.MeasuOp)
9121 ## Get if coords are included in the shape (ST_IN or ST_ON)
9122 # @param theShape Shape
9123 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9124 # @param tolerance to be used (default is 1.0e-7)
9125 # @return list_of_boolean = [res1, res2, ...]
9126 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9128 Get if coords are included in the shape (ST_IN or ST_ON)
9132 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9133 tolerance to be used (default is 1.0e-7)
9136 list_of_boolean = [res1, res2, ...]
9138 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9140 ## Get minimal distance between the given shapes.
9141 # @param theShape1,theShape2 Shapes to find minimal distance between.
9142 # @return Value of the minimal distance between the given shapes.
9144 # @ref tui_measurement_tools_page "Example"
9145 def MinDistance(self, theShape1, theShape2):
9147 Get minimal distance between the given shapes.
9150 theShape1,theShape2 Shapes to find minimal distance between.
9153 Value of the minimal distance between the given shapes.
9155 # Example: see GEOM_TestMeasures.py
9156 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9157 RaiseIfFailed("GetMinDistance", self.MeasuOp)
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, in form of list
9163 # [Distance, DX, DY, DZ].
9165 # @ref swig_all_measure "Example"
9166 def MinDistanceComponents(self, theShape1, theShape2):
9168 Get minimal distance between the given shapes.
9171 theShape1,theShape2 Shapes to find minimal distance between.
9174 Value of the minimal distance between the given shapes, in form of list
9175 [Distance, DX, DY, DZ]
9177 # Example: see GEOM_TestMeasures.py
9178 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9179 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9180 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9183 ## Get closest points of the given shapes.
9184 # @param theShape1,theShape2 Shapes to find closest points of.
9185 # @return The number of found solutions (-1 in case of infinite number of
9186 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9188 # @ref tui_measurement_tools_page "Example"
9189 def ClosestPoints (self, theShape1, theShape2):
9191 Get closest points of the given shapes.
9194 theShape1,theShape2 Shapes to find closest points of.
9197 The number of found solutions (-1 in case of infinite number of
9198 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9200 # Example: see GEOM_TestMeasures.py
9201 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9202 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9205 ## Get angle between the given shapes in degrees.
9206 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9207 # @note If both arguments are vectors, the angle is computed in accordance
9208 # with their orientations, otherwise the minimum angle is computed.
9209 # @return Value of the angle between the given shapes in degrees.
9211 # @ref tui_measurement_tools_page "Example"
9212 def GetAngle(self, theShape1, theShape2):
9214 Get angle between the given shapes in degrees.
9217 theShape1,theShape2 Lines or linear edges to find angle between.
9220 If both arguments are vectors, the angle is computed in accordance
9221 with their orientations, otherwise the minimum angle is computed.
9224 Value of the angle between the given shapes in degrees.
9226 # Example: see GEOM_TestMeasures.py
9227 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9228 RaiseIfFailed("GetAngle", self.MeasuOp)
9231 ## Get angle between the given shapes in radians.
9232 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9233 # @note If both arguments are vectors, the angle is computed in accordance
9234 # with their orientations, otherwise the minimum angle is computed.
9235 # @return Value of the angle between the given shapes in radians.
9237 # @ref tui_measurement_tools_page "Example"
9238 def GetAngleRadians(self, theShape1, theShape2):
9240 Get angle between the given shapes in radians.
9243 theShape1,theShape2 Lines or linear edges to find angle between.
9247 If both arguments are vectors, the angle is computed in accordance
9248 with their orientations, otherwise the minimum angle is computed.
9251 Value of the angle between the given shapes in radians.
9253 # Example: see GEOM_TestMeasures.py
9254 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9255 RaiseIfFailed("GetAngle", self.MeasuOp)
9258 ## Get angle between the given vectors in degrees.
9259 # @param theShape1,theShape2 Vectors to find angle between.
9260 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9261 # if False, the opposite vector to the normal vector is used.
9262 # @return Value of the angle between the given vectors in degrees.
9264 # @ref tui_measurement_tools_page "Example"
9265 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9267 Get angle between the given vectors in degrees.
9270 theShape1,theShape2 Vectors to find angle between.
9271 theFlag If True, the normal vector is defined by the two vectors cross,
9272 if False, the opposite vector to the normal vector is used.
9275 Value of the angle between the given vectors in degrees.
9277 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9279 anAngle = 360. - anAngle
9280 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9283 ## The same as GetAngleVectors, but the result is in radians.
9284 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9286 Get angle between the given vectors in radians.
9289 theShape1,theShape2 Vectors to find angle between.
9290 theFlag If True, the normal vector is defined by the two vectors cross,
9291 if False, the opposite vector to the normal vector is used.
9294 Value of the angle between the given vectors in radians.
9296 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9299 ## @name Curve Curvature Measurement
9300 # Methods for receiving radius of curvature of curves
9301 # in the given point
9304 ## Measure curvature of a curve at a point, set by parameter.
9305 # @param theCurve a curve.
9306 # @param theParam parameter.
9307 # @return radius of curvature of \a theCurve.
9309 # @ref swig_todo "Example"
9310 def CurveCurvatureByParam(self, theCurve, theParam):
9312 Measure curvature of a curve at a point, set by parameter.
9319 radius of curvature of theCurve.
9321 # Example: see GEOM_TestMeasures.py
9322 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9323 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9326 ## Measure curvature of a curve at a point.
9327 # @param theCurve a curve.
9328 # @param thePoint given point.
9329 # @return radius of curvature of \a theCurve.
9331 # @ref swig_todo "Example"
9332 def CurveCurvatureByPoint(self, theCurve, thePoint):
9334 Measure curvature of a curve at a point.
9338 thePoint given point.
9341 radius of curvature of theCurve.
9343 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9344 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9348 ## @name Surface Curvature Measurement
9349 # Methods for receiving max and min radius of curvature of surfaces
9350 # in the given point
9353 ## Measure max radius of curvature of surface.
9354 # @param theSurf the given surface.
9355 # @param theUParam Value of U-parameter on the referenced surface.
9356 # @param theVParam Value of V-parameter on the referenced surface.
9357 # @return max radius of curvature of theSurf.
9359 ## @ref swig_todo "Example"
9360 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9362 Measure max radius of curvature of surface.
9365 theSurf the given surface.
9366 theUParam Value of U-parameter on the referenced surface.
9367 theVParam Value of V-parameter on the referenced surface.
9370 max radius of curvature of theSurf.
9372 # Example: see GEOM_TestMeasures.py
9373 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9374 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9377 ## Measure max radius of curvature of surface in the given point
9378 # @param theSurf the given surface.
9379 # @param thePoint given point.
9380 # @return max radius of curvature of theSurf.
9382 ## @ref swig_todo "Example"
9383 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9385 Measure max radius of curvature of surface in the given point.
9388 theSurf the given surface.
9389 thePoint given point.
9392 max radius of curvature of theSurf.
9394 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9395 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9398 ## Measure min radius of curvature of surface.
9399 # @param theSurf the given surface.
9400 # @param theUParam Value of U-parameter on the referenced surface.
9401 # @param theVParam Value of V-parameter on the referenced surface.
9402 # @return min radius of curvature of theSurf.
9404 ## @ref swig_todo "Example"
9405 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9407 Measure min radius of curvature of surface.
9410 theSurf the given surface.
9411 theUParam Value of U-parameter on the referenced surface.
9412 theVParam Value of V-parameter on the referenced surface.
9415 Min radius of curvature of theSurf.
9417 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9418 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9421 ## Measure min radius of curvature of surface in the given point
9422 # @param theSurf the given surface.
9423 # @param thePoint given point.
9424 # @return min radius of curvature of theSurf.
9426 ## @ref swig_todo "Example"
9427 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9429 Measure min radius of curvature of surface in the given point.
9432 theSurf the given surface.
9433 thePoint given point.
9436 Min radius of curvature of theSurf.
9438 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9439 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9443 ## Get min and max tolerances of sub-shapes of theShape
9444 # @param theShape Shape, to get tolerances of.
9445 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9446 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9447 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9448 # VertMin,VertMax: Min and max tolerances of the vertices.
9450 # @ref tui_measurement_tools_page "Example"
9451 def Tolerance(self,theShape):
9453 Get min and max tolerances of sub-shapes of theShape
9456 theShape Shape, to get tolerances of.
9459 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9460 FaceMin,FaceMax: Min and max tolerances of the faces.
9461 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9462 VertMin,VertMax: Min and max tolerances of the vertices.
9464 # Example: see GEOM_TestMeasures.py
9465 aTuple = self.MeasuOp.GetTolerance(theShape)
9466 RaiseIfFailed("GetTolerance", self.MeasuOp)
9469 ## Obtain description of the given shape (number of sub-shapes of each type)
9470 # @param theShape Shape to be described.
9471 # @return Description of the given shape.
9473 # @ref tui_measurement_tools_page "Example"
9474 def WhatIs(self,theShape):
9476 Obtain description of the given shape (number of sub-shapes of each type)
9479 theShape Shape to be described.
9482 Description of the given shape.
9484 # Example: see GEOM_TestMeasures.py
9485 aDescr = self.MeasuOp.WhatIs(theShape)
9486 RaiseIfFailed("WhatIs", self.MeasuOp)
9489 ## Obtain quantity of shapes of the given type in \a theShape.
9490 # If \a theShape is of type \a theType, it is also counted.
9491 # @param theShape Shape to be described.
9492 # @param theType the given ShapeType().
9493 # @return Quantity of shapes of type \a theType in \a theShape.
9495 # @ref tui_measurement_tools_page "Example"
9496 def NbShapes (self, theShape, theType):
9498 Obtain quantity of shapes of the given type in theShape.
9499 If theShape is of type theType, it is also counted.
9502 theShape Shape to be described.
9503 theType the given geompy.ShapeType
9506 Quantity of shapes of type theType in theShape.
9508 # Example: see GEOM_TestMeasures.py
9509 listSh = self.SubShapeAllIDs(theShape, theType)
9511 t = EnumToLong(theShape.GetShapeType())
9512 theType = EnumToLong(theType)
9518 ## Obtain quantity of shapes of each type in \a theShape.
9519 # The \a theShape is also counted.
9520 # @param theShape Shape to be described.
9521 # @return Dictionary of ShapeType() with bound quantities of shapes.
9523 # @ref tui_measurement_tools_page "Example"
9524 def ShapeInfo (self, theShape):
9526 Obtain quantity of shapes of each type in theShape.
9527 The theShape is also counted.
9530 theShape Shape to be described.
9533 Dictionary of geompy.ShapeType with bound quantities of shapes.
9535 # Example: see GEOM_TestMeasures.py
9537 for typeSh in self.ShapeType:
9538 if typeSh in ( "AUTO", "SHAPE" ): continue
9539 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9541 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9548 ## Get a point, situated at the centre of mass of theShape.
9549 # @param theShape Shape to define centre of mass of.
9550 # @param theName Object name; when specified, this parameter is used
9551 # for result publication in the study. Otherwise, if automatic
9552 # publication is switched on, default value is used for result name.
9554 # @return New GEOM.GEOM_Object, containing the created point.
9556 # @ref tui_measurement_tools_page "Example"
9557 def MakeCDG(self, theShape, theName=None):
9559 Get a point, situated at the centre of mass of theShape.
9562 theShape Shape to define centre of mass of.
9563 theName Object name; when specified, this parameter is used
9564 for result publication in the study. Otherwise, if automatic
9565 publication is switched on, default value is used for result name.
9568 New GEOM.GEOM_Object, containing the created point.
9570 # Example: see GEOM_TestMeasures.py
9571 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9572 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9573 self._autoPublish(anObj, theName, "centerOfMass")
9576 ## Get a vertex sub-shape by index depended with orientation.
9577 # @param theShape Shape to find sub-shape.
9578 # @param theIndex Index to find vertex by this index (starting from zero)
9579 # @param theName Object name; when specified, this parameter is used
9580 # for result publication in the study. Otherwise, if automatic
9581 # publication is switched on, default value is used for result name.
9583 # @return New GEOM.GEOM_Object, containing the created vertex.
9585 # @ref tui_measurement_tools_page "Example"
9586 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9588 Get a vertex sub-shape by index depended with orientation.
9591 theShape Shape to find sub-shape.
9592 theIndex Index to find vertex by this index (starting from zero)
9593 theName Object name; when specified, this parameter is used
9594 for result publication in the study. Otherwise, if automatic
9595 publication is switched on, default value is used for result name.
9598 New GEOM.GEOM_Object, containing the created vertex.
9600 # Example: see GEOM_TestMeasures.py
9601 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9602 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9603 self._autoPublish(anObj, theName, "vertex")
9606 ## Get the first vertex of wire/edge depended orientation.
9607 # @param theShape Shape to find first vertex.
9608 # @param theName Object name; when specified, this parameter is used
9609 # for result publication in the study. Otherwise, if automatic
9610 # publication is switched on, default value is used for result name.
9612 # @return New GEOM.GEOM_Object, containing the created vertex.
9614 # @ref tui_measurement_tools_page "Example"
9615 def GetFirstVertex(self, theShape, theName=None):
9617 Get the first vertex of wire/edge depended orientation.
9620 theShape Shape to find first vertex.
9621 theName Object name; when specified, this parameter is used
9622 for result publication in the study. Otherwise, if automatic
9623 publication is switched on, default value is used for result name.
9626 New GEOM.GEOM_Object, containing the created vertex.
9628 # Example: see GEOM_TestMeasures.py
9629 # note: auto-publishing is done in self.GetVertexByIndex()
9630 anObj = self.GetVertexByIndex(theShape, 0, theName)
9631 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9634 ## Get the last vertex of wire/edge depended orientation.
9635 # @param theShape Shape to find last vertex.
9636 # @param theName Object name; when specified, this parameter is used
9637 # for result publication in the study. Otherwise, if automatic
9638 # publication is switched on, default value is used for result name.
9640 # @return New GEOM.GEOM_Object, containing the created vertex.
9642 # @ref tui_measurement_tools_page "Example"
9643 def GetLastVertex(self, theShape, theName=None):
9645 Get the last vertex of wire/edge depended orientation.
9648 theShape Shape to find last vertex.
9649 theName Object name; when specified, this parameter is used
9650 for result publication in the study. Otherwise, if automatic
9651 publication is switched on, default value is used for result name.
9654 New GEOM.GEOM_Object, containing the created vertex.
9656 # Example: see GEOM_TestMeasures.py
9657 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9658 # note: auto-publishing is done in self.GetVertexByIndex()
9659 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9660 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9663 ## Get a normale to the given face. If the point is not given,
9664 # the normale is calculated at the center of mass.
9665 # @param theFace Face to define normale of.
9666 # @param theOptionalPoint Point to compute the normale at.
9667 # @param theName Object name; when specified, this parameter is used
9668 # for result publication in the study. Otherwise, if automatic
9669 # publication is switched on, default value is used for result name.
9671 # @return New GEOM.GEOM_Object, containing the created vector.
9673 # @ref swig_todo "Example"
9674 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9676 Get a normale to the given face. If the point is not given,
9677 the normale is calculated at the center of mass.
9680 theFace Face to define normale of.
9681 theOptionalPoint Point to compute the normale at.
9682 theName Object name; when specified, this parameter is used
9683 for result publication in the study. Otherwise, if automatic
9684 publication is switched on, default value is used for result name.
9687 New GEOM.GEOM_Object, containing the created vector.
9689 # Example: see GEOM_TestMeasures.py
9690 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9691 RaiseIfFailed("GetNormal", self.MeasuOp)
9692 self._autoPublish(anObj, theName, "normal")
9695 ## Check a topology of the given shape.
9696 # @param theShape Shape to check validity of.
9697 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9698 # if TRUE, the shape's geometry will be checked also.
9699 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9700 # of problem is printed.
9701 # if TRUE and if theShape is invalid, the description
9702 # of problem is also returned.
9703 # @return TRUE, if the shape "seems to be valid".
9705 # @ref tui_measurement_tools_page "Example"
9706 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9708 Check a topology of the given shape.
9711 theShape Shape to check validity of.
9712 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9713 if TRUE, the shape's geometry will be checked also.
9714 theReturnStatus If FALSE and if theShape is invalid, a description
9715 of problem is printed.
9716 if TRUE and if theShape is invalid, the description
9717 of problem is returned.
9720 TRUE, if the shape "seems to be valid".
9721 If theShape is invalid, prints a description of problem.
9722 This description can also be returned.
9724 # Example: see GEOM_TestMeasures.py
9726 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9727 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9729 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9730 RaiseIfFailed("CheckShape", self.MeasuOp)
9732 if theReturnStatus == 0:
9734 if theReturnStatus == 1:
9735 return (IsValid, Status)
9738 ## Detect self-intersections in the given shape.
9739 # @param theShape Shape to check.
9740 # @return TRUE, if the shape contains no self-intersections.
9742 # @ref tui_measurement_tools_page "Example"
9743 def CheckSelfIntersections(self, theShape):
9745 Detect self-intersections in the given shape.
9748 theShape Shape to check.
9751 TRUE, if the shape contains no self-intersections.
9753 # Example: see GEOM_TestMeasures.py
9754 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9755 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9758 ## Get position (LCS) of theShape.
9760 # Origin of the LCS is situated at the shape's center of mass.
9761 # Axes of the LCS are obtained from shape's location or,
9762 # if the shape is a planar face, from position of its plane.
9764 # @param theShape Shape to calculate position of.
9765 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9766 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9767 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9768 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9770 # @ref swig_todo "Example"
9771 def GetPosition(self,theShape):
9773 Get position (LCS) of theShape.
9774 Origin of the LCS is situated at the shape's center of mass.
9775 Axes of the LCS are obtained from shape's location or,
9776 if the shape is a planar face, from position of its plane.
9779 theShape Shape to calculate position of.
9782 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9783 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9784 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9785 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9787 # Example: see GEOM_TestMeasures.py
9788 aTuple = self.MeasuOp.GetPosition(theShape)
9789 RaiseIfFailed("GetPosition", self.MeasuOp)
9792 ## Get kind of theShape.
9794 # @param theShape Shape to get a kind of.
9795 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9796 # and a list of parameters, describing the shape.
9797 # @note Concrete meaning of each value, returned via \a theIntegers
9798 # or \a theDoubles list depends on the kind() of the shape.
9800 # @ref swig_todo "Example"
9801 def KindOfShape(self,theShape):
9803 Get kind of theShape.
9806 theShape Shape to get a kind of.
9809 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9810 and a list of parameters, describing the shape.
9812 Concrete meaning of each value, returned via theIntegers
9813 or theDoubles list depends on the geompy.kind of the shape
9815 # Example: see GEOM_TestMeasures.py
9816 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9817 RaiseIfFailed("KindOfShape", self.MeasuOp)
9819 aKind = aRoughTuple[0]
9820 anInts = aRoughTuple[1]
9821 aDbls = aRoughTuple[2]
9823 # Now there is no exception from this rule:
9824 aKindTuple = [aKind] + aDbls + anInts
9826 # If they are we will regroup parameters for such kind of shape.
9828 #if aKind == kind.SOME_KIND:
9829 # # SOME_KIND int int double int double double
9830 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9837 ## @addtogroup l2_import_export
9840 ## Import a shape from the BREP or IGES or STEP file
9841 # (depends on given format) with given name.
9842 # @param theFileName The file, containing the shape.
9843 # @param theFormatName Specify format for the file reading.
9844 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9845 # If format 'IGES_SCALE' is used instead of 'IGES' or
9846 # format 'STEP_SCALE' is used instead of 'STEP',
9847 # length unit will be set to 'meter' and result model will be scaled.
9848 # @param theName Object name; when specified, this parameter is used
9849 # for result publication in the study. Otherwise, if automatic
9850 # publication is switched on, default value is used for result name.
9852 # @return New GEOM.GEOM_Object, containing the imported shape.
9854 # @ref swig_Import_Export "Example"
9855 def ImportFile(self, theFileName, theFormatName, theName=None):
9857 Import a shape from the BREP or IGES or STEP file
9858 (depends on given format) with given name.
9861 theFileName The file, containing the shape.
9862 theFormatName Specify format for the file reading.
9863 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9864 If format 'IGES_SCALE' is used instead of 'IGES' or
9865 format 'STEP_SCALE' is used instead of 'STEP',
9866 length unit will be set to 'meter' and result model will be scaled.
9867 theName Object name; when specified, this parameter is used
9868 for result publication in the study. Otherwise, if automatic
9869 publication is switched on, default value is used for result name.
9872 New GEOM.GEOM_Object, containing the imported shape.
9874 # Example: see GEOM_TestOthers.py
9875 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9876 RaiseIfFailed("ImportFile", self.InsertOp)
9877 self._autoPublish(anObj, theName, "imported")
9880 ## Deprecated analog of ImportFile()
9881 def Import(self, theFileName, theFormatName, theName=None):
9883 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9885 print "WARNING: Function Import is deprecated, use ImportFile instead"
9886 # note: auto-publishing is done in self.ImportFile()
9887 return self.ImportFile(theFileName, theFormatName, theName)
9889 ## Shortcut to ImportFile() for BREP format.
9890 # Import a shape from the BREP file with given name.
9891 # @param theFileName The file, containing the shape.
9892 # @param theName Object name; when specified, this parameter is used
9893 # for result publication in the study. Otherwise, if automatic
9894 # publication is switched on, default value is used for result name.
9896 # @return New GEOM.GEOM_Object, containing the imported shape.
9898 # @ref swig_Import_Export "Example"
9899 def ImportBREP(self, theFileName, theName=None):
9901 geompy.ImportFile(...) function for BREP format
9902 Import a shape from the BREP file with given name.
9905 theFileName The file, containing the shape.
9906 theName Object name; when specified, this parameter is used
9907 for result publication in the study. Otherwise, if automatic
9908 publication is switched on, default value is used for result name.
9911 New GEOM.GEOM_Object, containing the imported shape.
9913 # Example: see GEOM_TestOthers.py
9914 # note: auto-publishing is done in self.ImportFile()
9915 return self.ImportFile(theFileName, "BREP", theName)
9917 ## Shortcut to ImportFile() for IGES format
9918 # Import a shape from the IGES file with given name.
9919 # @param theFileName The file, containing the shape.
9920 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9921 # and result model will be scaled, if its units are not meters.
9922 # If False (default), file length units will be taken into account.
9923 # @param theName Object name; when specified, this parameter is used
9924 # for result publication in the study. Otherwise, if automatic
9925 # publication is switched on, default value is used for result name.
9927 # @return New GEOM.GEOM_Object, containing the imported shape.
9929 # @ref swig_Import_Export "Example"
9930 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9932 geompy.ImportFile(...) function for IGES format
9935 theFileName The file, containing the shape.
9936 ignoreUnits If True, file length units will be ignored (set to 'meter')
9937 and result model will be scaled, if its units are not meters.
9938 If False (default), file length units will be taken into account.
9939 theName Object name; when specified, this parameter is used
9940 for result publication in the study. Otherwise, if automatic
9941 publication is switched on, default value is used for result name.
9944 New GEOM.GEOM_Object, containing the imported shape.
9946 # Example: see GEOM_TestOthers.py
9947 # note: auto-publishing is done in self.ImportFile()
9949 return self.ImportFile(theFileName, "IGES_SCALE", theName)
9950 return self.ImportFile(theFileName, "IGES", theName)
9952 ## Return length unit from given IGES file
9953 # @param theFileName The file, containing the shape.
9954 # @return String, containing the units name.
9956 # @ref swig_Import_Export "Example"
9957 def GetIGESUnit(self, theFileName):
9959 Return length units from given IGES file
9962 theFileName The file, containing the shape.
9965 String, containing the units name.
9967 # Example: see GEOM_TestOthers.py
9968 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
9971 ## Shortcut to ImportFile() for STEP format
9972 # Import a shape from the STEP file with given name.
9973 # @param theFileName The file, containing the shape.
9974 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9975 # and result model will be scaled, if its units are not meters.
9976 # If False (default), file length units will be taken into account.
9977 # @param theName Object name; when specified, this parameter is used
9978 # for result publication in the study. Otherwise, if automatic
9979 # publication is switched on, default value is used for result name.
9981 # @return New GEOM.GEOM_Object, containing the imported shape.
9983 # @ref swig_Import_Export "Example"
9984 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
9986 geompy.ImportFile(...) function for STEP format
9989 theFileName The file, containing the shape.
9990 ignoreUnits If True, file length units will be ignored (set to 'meter')
9991 and result model will be scaled, if its units are not meters.
9992 If False (default), file length units will be taken into account.
9993 theName Object name; when specified, this parameter is used
9994 for result publication in the study. Otherwise, if automatic
9995 publication is switched on, default value is used for result name.
9998 New GEOM.GEOM_Object, containing the imported shape.
10000 # Example: see GEOM_TestOthers.py
10001 # note: auto-publishing is done in self.ImportFile()
10003 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10004 return self.ImportFile(theFileName, "STEP", theName)
10006 ## Return length unit from given IGES or STEP file
10007 # @param theFileName The file, containing the shape.
10008 # @return String, containing the units name.
10010 # @ref swig_Import_Export "Example"
10011 def GetSTEPUnit(self, theFileName):
10013 Return length units from given STEP file
10016 theFileName The file, containing the shape.
10019 String, containing the units name.
10021 # Example: see GEOM_TestOthers.py
10022 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10025 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10026 # @note This method will not be dumped to the python script by DumpStudy functionality.
10027 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10028 # @param theStream The BRep binary stream.
10029 # @param theName Object name; when specified, this parameter is used
10030 # for result publication in the study. Otherwise, if automatic
10031 # publication is switched on, default value is used for result name.
10033 # @return New GEOM_Object, containing the shape, read from theStream.
10035 # @ref swig_Import_Export "Example"
10036 def RestoreShape (self, theStream, theName=None):
10038 Read a shape from the binary stream, containing its bounding representation (BRep).
10041 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10044 theStream The BRep binary stream.
10045 theName Object name; when specified, this parameter is used
10046 for result publication in the study. Otherwise, if automatic
10047 publication is switched on, default value is used for result name.
10050 New GEOM_Object, containing the shape, read from theStream.
10052 # Example: see GEOM_TestOthers.py
10053 anObj = self.InsertOp.RestoreShape(theStream)
10054 RaiseIfFailed("RestoreShape", self.InsertOp)
10055 self._autoPublish(anObj, theName, "restored")
10058 ## Export the given shape into a file with given name.
10059 # @param theObject Shape to be stored in the file.
10060 # @param theFileName Name of the file to store the given shape in.
10061 # @param theFormatName Specify format for the shape storage.
10062 # Available formats can be obtained with
10063 # geompy.InsertOp.ExportTranslators()[0] method.
10065 # @ref swig_Import_Export "Example"
10066 def Export(self, theObject, theFileName, theFormatName):
10068 Export the given shape into a file with given name.
10071 theObject Shape to be stored in the file.
10072 theFileName Name of the file to store the given shape in.
10073 theFormatName Specify format for the shape storage.
10074 Available formats can be obtained with
10075 geompy.InsertOp.ExportTranslators()[0] method.
10077 # Example: see GEOM_TestOthers.py
10078 self.InsertOp.Export(theObject, theFileName, theFormatName)
10079 if self.InsertOp.IsDone() == 0:
10080 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10084 ## Shortcut to Export() for BREP format
10086 # @ref swig_Import_Export "Example"
10087 def ExportBREP(self,theObject, theFileName):
10089 geompy.Export(...) function for BREP format
10091 # Example: see GEOM_TestOthers.py
10092 return self.Export(theObject, theFileName, "BREP")
10094 ## Shortcut to Export() for IGES format
10096 # @ref swig_Import_Export "Example"
10097 def ExportIGES(self,theObject, theFileName):
10099 geompy.Export(...) function for IGES format
10101 # Example: see GEOM_TestOthers.py
10102 return self.Export(theObject, theFileName, "IGES")
10104 ## Shortcut to Export() for STEP format
10106 # @ref swig_Import_Export "Example"
10107 def ExportSTEP(self,theObject, theFileName):
10109 geompy.Export(...) function for STEP format
10111 # Example: see GEOM_TestOthers.py
10112 return self.Export(theObject, theFileName, "STEP")
10114 # end of l2_import_export
10117 ## @addtogroup l3_blocks
10120 ## Create a quadrangle face from four edges. Order of Edges is not
10121 # important. It is not necessary that edges share the same vertex.
10122 # @param E1,E2,E3,E4 Edges for the face bound.
10123 # @param theName Object name; when specified, this parameter is used
10124 # for result publication in the study. Otherwise, if automatic
10125 # publication is switched on, default value is used for result name.
10127 # @return New GEOM.GEOM_Object, containing the created face.
10129 # @ref tui_building_by_blocks_page "Example"
10130 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10132 Create a quadrangle face from four edges. Order of Edges is not
10133 important. It is not necessary that edges share the same vertex.
10136 E1,E2,E3,E4 Edges for the face bound.
10137 theName Object name; when specified, this parameter is used
10138 for result publication in the study. Otherwise, if automatic
10139 publication is switched on, default value is used for result name.
10142 New GEOM.GEOM_Object, containing the created face.
10145 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10147 # Example: see GEOM_Spanner.py
10148 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10149 RaiseIfFailed("MakeQuad", self.BlocksOp)
10150 self._autoPublish(anObj, theName, "quad")
10153 ## Create a quadrangle face on two edges.
10154 # The missing edges will be built by creating the shortest ones.
10155 # @param E1,E2 Two opposite edges for the face.
10156 # @param theName Object name; when specified, this parameter is used
10157 # for result publication in the study. Otherwise, if automatic
10158 # publication is switched on, default value is used for result name.
10160 # @return New GEOM.GEOM_Object, containing the created face.
10162 # @ref tui_building_by_blocks_page "Example"
10163 def MakeQuad2Edges(self, E1, E2, theName=None):
10165 Create a quadrangle face on two edges.
10166 The missing edges will be built by creating the shortest ones.
10169 E1,E2 Two opposite edges for the face.
10170 theName Object name; when specified, this parameter is used
10171 for result publication in the study. Otherwise, if automatic
10172 publication is switched on, default value is used for result name.
10175 New GEOM.GEOM_Object, containing the created face.
10179 p1 = geompy.MakeVertex( 0., 0., 0.)
10180 p2 = geompy.MakeVertex(150., 30., 0.)
10181 p3 = geompy.MakeVertex( 0., 120., 50.)
10182 p4 = geompy.MakeVertex( 0., 40., 70.)
10184 edge1 = geompy.MakeEdge(p1, p2)
10185 edge2 = geompy.MakeEdge(p3, p4)
10186 # create a quadrangle face from two edges
10187 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10189 # Example: see GEOM_Spanner.py
10190 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10191 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10192 self._autoPublish(anObj, theName, "quad")
10195 ## Create a quadrangle face with specified corners.
10196 # The missing edges will be built by creating the shortest ones.
10197 # @param V1,V2,V3,V4 Corner vertices for the face.
10198 # @param theName Object name; when specified, this parameter is used
10199 # for result publication in the study. Otherwise, if automatic
10200 # publication is switched on, default value is used for result name.
10202 # @return New GEOM.GEOM_Object, containing the created face.
10204 # @ref tui_building_by_blocks_page "Example 1"
10205 # \n @ref swig_MakeQuad4Vertices "Example 2"
10206 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10208 Create a quadrangle face with specified corners.
10209 The missing edges will be built by creating the shortest ones.
10212 V1,V2,V3,V4 Corner vertices for the face.
10213 theName Object name; when specified, this parameter is used
10214 for result publication in the study. Otherwise, if automatic
10215 publication is switched on, default value is used for result name.
10218 New GEOM.GEOM_Object, containing the created face.
10222 p1 = geompy.MakeVertex( 0., 0., 0.)
10223 p2 = geompy.MakeVertex(150., 30., 0.)
10224 p3 = geompy.MakeVertex( 0., 120., 50.)
10225 p4 = geompy.MakeVertex( 0., 40., 70.)
10226 # create a quadrangle from four points in its corners
10227 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10229 # Example: see GEOM_Spanner.py
10230 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10231 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10232 self._autoPublish(anObj, theName, "quad")
10235 ## Create a hexahedral solid, bounded by the six given faces. Order of
10236 # faces is not important. It is not necessary that Faces share the same edge.
10237 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10238 # @param theName Object name; when specified, this parameter is used
10239 # for result publication in the study. Otherwise, if automatic
10240 # publication is switched on, default value is used for result name.
10242 # @return New GEOM.GEOM_Object, containing the created solid.
10244 # @ref tui_building_by_blocks_page "Example 1"
10245 # \n @ref swig_MakeHexa "Example 2"
10246 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10248 Create a hexahedral solid, bounded by the six given faces. Order of
10249 faces is not important. It is not necessary that Faces share the same edge.
10252 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10253 theName Object name; when specified, this parameter is used
10254 for result publication in the study. Otherwise, if automatic
10255 publication is switched on, default value is used for result name.
10258 New GEOM.GEOM_Object, containing the created solid.
10261 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10263 # Example: see GEOM_Spanner.py
10264 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10265 RaiseIfFailed("MakeHexa", self.BlocksOp)
10266 self._autoPublish(anObj, theName, "hexa")
10269 ## Create a hexahedral solid between two given faces.
10270 # The missing faces will be built by creating the smallest ones.
10271 # @param F1,F2 Two opposite faces for the hexahedral solid.
10272 # @param theName Object name; when specified, this parameter is used
10273 # for result publication in the study. Otherwise, if automatic
10274 # publication is switched on, default value is used for result name.
10276 # @return New GEOM.GEOM_Object, containing the created solid.
10278 # @ref tui_building_by_blocks_page "Example 1"
10279 # \n @ref swig_MakeHexa2Faces "Example 2"
10280 def MakeHexa2Faces(self, F1, F2, theName=None):
10282 Create a hexahedral solid between two given faces.
10283 The missing faces will be built by creating the smallest ones.
10286 F1,F2 Two opposite faces for the hexahedral solid.
10287 theName Object name; when specified, this parameter is used
10288 for result publication in the study. Otherwise, if automatic
10289 publication is switched on, default value is used for result name.
10292 New GEOM.GEOM_Object, containing the created solid.
10295 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10297 # Example: see GEOM_Spanner.py
10298 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10299 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10300 self._autoPublish(anObj, theName, "hexa")
10306 ## @addtogroup l3_blocks_op
10309 ## Get a vertex, found in the given shape by its coordinates.
10310 # @param theShape Block or a compound of blocks.
10311 # @param theX,theY,theZ Coordinates of the sought vertex.
10312 # @param theEpsilon Maximum allowed distance between the resulting
10313 # vertex and point with the given coordinates.
10314 # @param theName Object name; when specified, this parameter is used
10315 # for result publication in the study. Otherwise, if automatic
10316 # publication is switched on, default value is used for result name.
10318 # @return New GEOM.GEOM_Object, containing the found vertex.
10320 # @ref swig_GetPoint "Example"
10321 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10323 Get a vertex, found in the given shape by its coordinates.
10326 theShape Block or a compound of blocks.
10327 theX,theY,theZ Coordinates of the sought vertex.
10328 theEpsilon Maximum allowed distance between the resulting
10329 vertex and point with the given coordinates.
10330 theName Object name; when specified, this parameter is used
10331 for result publication in the study. Otherwise, if automatic
10332 publication is switched on, default value is used for result name.
10335 New GEOM.GEOM_Object, containing the found vertex.
10338 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10340 # Example: see GEOM_TestOthers.py
10341 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10342 RaiseIfFailed("GetPoint", self.BlocksOp)
10343 self._autoPublish(anObj, theName, "vertex")
10346 ## Find a vertex of the given shape, which has minimal distance to the given point.
10347 # @param theShape Any shape.
10348 # @param thePoint Point, close to the desired vertex.
10349 # @param theName Object name; when specified, this parameter is used
10350 # for result publication in the study. Otherwise, if automatic
10351 # publication is switched on, default value is used for result name.
10353 # @return New GEOM.GEOM_Object, containing the found vertex.
10355 # @ref swig_GetVertexNearPoint "Example"
10356 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10358 Find a vertex of the given shape, which has minimal distance to the given point.
10361 theShape Any shape.
10362 thePoint Point, close to the desired vertex.
10363 theName Object name; when specified, this parameter is used
10364 for result publication in the study. Otherwise, if automatic
10365 publication is switched on, default value is used for result name.
10368 New GEOM.GEOM_Object, containing the found vertex.
10371 pmidle = geompy.MakeVertex(50, 0, 50)
10372 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10374 # Example: see GEOM_TestOthers.py
10375 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10376 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10377 self._autoPublish(anObj, theName, "vertex")
10380 ## Get an edge, found in the given shape by two given vertices.
10381 # @param theShape Block or a compound of blocks.
10382 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10383 # @param 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.
10387 # @return New GEOM.GEOM_Object, containing the found edge.
10389 # @ref swig_GetEdge "Example"
10390 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10392 Get an edge, found in the given shape by two given vertices.
10395 theShape Block or a compound of blocks.
10396 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10397 theName Object name; when specified, this parameter is used
10398 for result publication in the study. Otherwise, if automatic
10399 publication is switched on, default value is used for result name.
10402 New GEOM.GEOM_Object, containing the found edge.
10404 # Example: see GEOM_Spanner.py
10405 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10406 RaiseIfFailed("GetEdge", self.BlocksOp)
10407 self._autoPublish(anObj, theName, "edge")
10410 ## Find an edge of the given shape, which has minimal distance to the given point.
10411 # @param theShape Block or a compound of blocks.
10412 # @param thePoint Point, close to the desired edge.
10413 # @param theName Object name; when specified, this parameter is used
10414 # for result publication in the study. Otherwise, if automatic
10415 # publication is switched on, default value is used for result name.
10417 # @return New GEOM.GEOM_Object, containing the found edge.
10419 # @ref swig_GetEdgeNearPoint "Example"
10420 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10422 Find an edge of the given shape, which has minimal distance to the given point.
10425 theShape Block or a compound of blocks.
10426 thePoint Point, close to the desired edge.
10427 theName Object name; when specified, this parameter is used
10428 for result publication in the study. Otherwise, if automatic
10429 publication is switched on, default value is used for result name.
10432 New GEOM.GEOM_Object, containing the found edge.
10434 # Example: see GEOM_TestOthers.py
10435 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10436 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10437 self._autoPublish(anObj, theName, "edge")
10440 ## Returns a face, found in the given shape by four given corner vertices.
10441 # @param theShape Block or a compound of blocks.
10442 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10443 # @param theName Object name; when specified, this parameter is used
10444 # for result publication in the study. Otherwise, if automatic
10445 # publication is switched on, default value is used for result name.
10447 # @return New GEOM.GEOM_Object, containing the found face.
10449 # @ref swig_todo "Example"
10450 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10452 Returns a face, found in the given shape by four given corner vertices.
10455 theShape Block or a compound of blocks.
10456 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10457 theName Object name; when specified, this parameter is used
10458 for result publication in the study. Otherwise, if automatic
10459 publication is switched on, default value is used for result name.
10462 New GEOM.GEOM_Object, containing the found face.
10464 # Example: see GEOM_Spanner.py
10465 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10466 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10467 self._autoPublish(anObj, theName, "face")
10470 ## Get a face of block, found in the given shape by two given edges.
10471 # @param theShape Block or a compound of blocks.
10472 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10473 # @param theName Object name; when specified, this parameter is used
10474 # for result publication in the study. Otherwise, if automatic
10475 # publication is switched on, default value is used for result name.
10477 # @return New GEOM.GEOM_Object, containing the found face.
10479 # @ref swig_todo "Example"
10480 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10482 Get a face of block, found in the given shape by two given edges.
10485 theShape Block or a compound of blocks.
10486 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10487 theName Object name; when specified, this parameter is used
10488 for result publication in the study. Otherwise, if automatic
10489 publication is switched on, default value is used for result name.
10492 New GEOM.GEOM_Object, containing the found face.
10494 # Example: see GEOM_Spanner.py
10495 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10496 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10497 self._autoPublish(anObj, theName, "face")
10500 ## Find a face, opposite to the given one in the given block.
10501 # @param theBlock Must be a hexahedral solid.
10502 # @param theFace Face of \a theBlock, opposite to the desired face.
10503 # @param theName Object name; when specified, this parameter is used
10504 # for result publication in the study. Otherwise, if automatic
10505 # publication is switched on, default value is used for result name.
10507 # @return New GEOM.GEOM_Object, containing the found face.
10509 # @ref swig_GetOppositeFace "Example"
10510 def GetOppositeFace(self, theBlock, theFace, theName=None):
10512 Find a face, opposite to the given one in the given block.
10515 theBlock Must be a hexahedral solid.
10516 theFace Face of theBlock, opposite to the desired face.
10517 theName Object name; when specified, this parameter is used
10518 for result publication in the study. Otherwise, if automatic
10519 publication is switched on, default value is used for result name.
10522 New GEOM.GEOM_Object, containing the found face.
10524 # Example: see GEOM_Spanner.py
10525 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10526 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10527 self._autoPublish(anObj, theName, "face")
10530 ## Find a face of the given shape, which has minimal distance to the given point.
10531 # @param theShape Block or a compound of blocks.
10532 # @param thePoint Point, close to the desired face.
10533 # @param theName Object name; when specified, this parameter is used
10534 # for result publication in the study. Otherwise, if automatic
10535 # publication is switched on, default value is used for result name.
10537 # @return New GEOM.GEOM_Object, containing the found face.
10539 # @ref swig_GetFaceNearPoint "Example"
10540 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10542 Find a face of the given shape, which has minimal distance to the given point.
10545 theShape Block or a compound of blocks.
10546 thePoint Point, close to the desired face.
10547 theName Object name; when specified, this parameter is used
10548 for result publication in the study. Otherwise, if automatic
10549 publication is switched on, default value is used for result name.
10552 New GEOM.GEOM_Object, containing the found face.
10554 # Example: see GEOM_Spanner.py
10555 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10556 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10557 self._autoPublish(anObj, theName, "face")
10560 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10561 # @param theBlock Block or a compound of blocks.
10562 # @param theVector Vector, close to the normale of the desired face.
10563 # @param theName Object name; when specified, this parameter is used
10564 # for result publication in the study. Otherwise, if automatic
10565 # publication is switched on, default value is used for result name.
10567 # @return New GEOM.GEOM_Object, containing the found face.
10569 # @ref swig_todo "Example"
10570 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10572 Find a face of block, whose outside normale has minimal angle with the given vector.
10575 theBlock Block or a compound of blocks.
10576 theVector Vector, close to the normale of the desired face.
10577 theName Object name; when specified, this parameter is used
10578 for result publication in the study. Otherwise, if automatic
10579 publication is switched on, default value is used for result name.
10582 New GEOM.GEOM_Object, containing the found face.
10584 # Example: see GEOM_Spanner.py
10585 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10586 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10587 self._autoPublish(anObj, theName, "face")
10590 ## Find all sub-shapes of type \a theShapeType of the given shape,
10591 # which have minimal distance to the given point.
10592 # @param theShape Any shape.
10593 # @param thePoint Point, close to the desired shape.
10594 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10595 # @param theTolerance The tolerance for distances comparison. All shapes
10596 # with distances to the given point in interval
10597 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10598 # @param theName Object name; when specified, this parameter is used
10599 # for result publication in the study. Otherwise, if automatic
10600 # publication is switched on, default value is used for result name.
10602 # @return New GEOM_Object, containing a group of all found shapes.
10604 # @ref swig_GetShapesNearPoint "Example"
10605 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10607 Find all sub-shapes of type theShapeType of the given shape,
10608 which have minimal distance to the given point.
10611 theShape Any shape.
10612 thePoint Point, close to the desired shape.
10613 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10614 theTolerance The tolerance for distances comparison. All shapes
10615 with distances to the given point in interval
10616 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10617 theName Object name; when specified, this parameter is used
10618 for result publication in the study. Otherwise, if automatic
10619 publication is switched on, default value is used for result name.
10622 New GEOM_Object, containing a group of all found shapes.
10624 # Example: see GEOM_TestOthers.py
10625 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10626 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10627 self._autoPublish(anObj, theName, "group")
10630 # end of l3_blocks_op
10633 ## @addtogroup l4_blocks_measure
10636 ## Check, if the compound of blocks is given.
10637 # To be considered as a compound of blocks, the
10638 # given shape must satisfy the following conditions:
10639 # - Each element of the compound should be a Block (6 faces and 12 edges).
10640 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10641 # - The compound should be connexe.
10642 # - The glue between two quadrangle faces should be applied.
10643 # @param theCompound The compound to check.
10644 # @return TRUE, if the given shape is a compound of blocks.
10645 # If theCompound is not valid, prints all discovered errors.
10647 # @ref tui_measurement_tools_page "Example 1"
10648 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10649 def CheckCompoundOfBlocks(self,theCompound):
10651 Check, if the compound of blocks is given.
10652 To be considered as a compound of blocks, the
10653 given shape must satisfy the following conditions:
10654 - Each element of the compound should be a Block (6 faces and 12 edges).
10655 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10656 - The compound should be connexe.
10657 - The glue between two quadrangle faces should be applied.
10660 theCompound The compound to check.
10663 TRUE, if the given shape is a compound of blocks.
10664 If theCompound is not valid, prints all discovered errors.
10666 # Example: see GEOM_Spanner.py
10667 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10668 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10670 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10674 ## Retrieve all non blocks solids and faces from \a theShape.
10675 # @param theShape The shape to explore.
10676 # @param theName Object name; when specified, this parameter is used
10677 # for result publication in the study. Otherwise, if automatic
10678 # publication is switched on, default value is used for result name.
10680 # @return A tuple of two GEOM_Objects. The first object is a group of all
10681 # non block solids (= not 6 faces, or with 6 faces, but with the
10682 # presence of non-quadrangular faces). The second object is a
10683 # group of all non quadrangular faces.
10685 # @ref tui_measurement_tools_page "Example 1"
10686 # \n @ref swig_GetNonBlocks "Example 2"
10687 def GetNonBlocks (self, theShape, theName=None):
10689 Retrieve all non blocks solids and faces from theShape.
10692 theShape The shape to explore.
10693 theName Object name; when specified, this parameter is used
10694 for result publication in the study. Otherwise, if automatic
10695 publication is switched on, default value is used for result name.
10698 A tuple of two GEOM_Objects. The first object is a group of all
10699 non block solids (= not 6 faces, or with 6 faces, but with the
10700 presence of non-quadrangular faces). The second object is a
10701 group of all non quadrangular faces.
10704 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10706 # Example: see GEOM_Spanner.py
10707 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10708 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10709 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10712 ## Remove all seam and degenerated edges from \a theShape.
10713 # Unite faces and edges, sharing one surface. It means that
10714 # this faces must have references to one C++ surface object (handle).
10715 # @param theShape The compound or single solid to remove irregular edges from.
10716 # @param doUnionFaces If True, then unite faces. If False (the default value),
10717 # do not unite faces.
10718 # @param theName Object name; when specified, this parameter is used
10719 # for result publication in the study. Otherwise, if automatic
10720 # publication is switched on, default value is used for result name.
10722 # @return Improved shape.
10724 # @ref swig_RemoveExtraEdges "Example"
10725 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10727 Remove all seam and degenerated edges from theShape.
10728 Unite faces and edges, sharing one surface. It means that
10729 this faces must have references to one C++ surface object (handle).
10732 theShape The compound or single solid to remove irregular edges from.
10733 doUnionFaces If True, then unite faces. If False (the default value),
10734 do not unite faces.
10735 theName Object name; when specified, this parameter is used
10736 for result publication in the study. Otherwise, if automatic
10737 publication is switched on, default value is used for result name.
10742 # Example: see GEOM_TestOthers.py
10743 nbFacesOptimum = -1 # -1 means do not unite faces
10744 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10745 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10746 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10747 self._autoPublish(anObj, theName, "removeExtraEdges")
10750 ## Performs union faces of \a theShape
10751 # Unite faces sharing one surface. It means that
10752 # these faces must have references to one C++ surface object (handle).
10753 # @param theShape The compound or single solid that contains faces
10754 # to perform union.
10755 # @param 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.
10759 # @return Improved shape.
10761 # @ref swig_UnionFaces "Example"
10762 def UnionFaces(self, theShape, theName=None):
10764 Performs union faces of theShape.
10765 Unite faces sharing one surface. It means that
10766 these faces must have references to one C++ surface object (handle).
10769 theShape The compound or single solid that contains faces
10771 theName Object name; when specified, this parameter is used
10772 for result publication in the study. Otherwise, if automatic
10773 publication is switched on, default value is used for result name.
10778 # Example: see GEOM_TestOthers.py
10779 anObj = self.BlocksOp.UnionFaces(theShape)
10780 RaiseIfFailed("UnionFaces", self.BlocksOp)
10781 self._autoPublish(anObj, theName, "unionFaces")
10784 ## Check, if the given shape is a blocks compound.
10785 # Fix all detected errors.
10786 # \note Single block can be also fixed by this method.
10787 # @param theShape The compound to check and improve.
10788 # @param theName Object name; when specified, this parameter is used
10789 # for result publication in the study. Otherwise, if automatic
10790 # publication is switched on, default value is used for result name.
10792 # @return Improved compound.
10794 # @ref swig_CheckAndImprove "Example"
10795 def CheckAndImprove(self, theShape, theName=None):
10797 Check, if the given shape is a blocks compound.
10798 Fix all detected errors.
10801 Single block can be also fixed by this method.
10804 theShape The compound to check and improve.
10805 theName Object name; when specified, this parameter is used
10806 for result publication in the study. Otherwise, if automatic
10807 publication is switched on, default value is used for result name.
10812 # Example: see GEOM_TestOthers.py
10813 anObj = self.BlocksOp.CheckAndImprove(theShape)
10814 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10815 self._autoPublish(anObj, theName, "improved")
10818 # end of l4_blocks_measure
10821 ## @addtogroup l3_blocks_op
10824 ## Get all the blocks, contained in the given compound.
10825 # @param theCompound The compound to explode.
10826 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10827 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10828 # @param theName Object name; when specified, this parameter is used
10829 # for result publication in the study. Otherwise, if automatic
10830 # publication is switched on, default value is used for result name.
10832 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10834 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10836 # @ref tui_explode_on_blocks "Example 1"
10837 # \n @ref swig_MakeBlockExplode "Example 2"
10838 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10840 Get all the blocks, contained in the given compound.
10843 theCompound The compound to explode.
10844 theMinNbFaces If solid has lower number of faces, it is not a block.
10845 theMaxNbFaces If solid has higher number of faces, it is not a block.
10846 theName Object name; when specified, this parameter is used
10847 for result publication in the study. Otherwise, if automatic
10848 publication is switched on, default value is used for result name.
10851 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10854 List of GEOM.GEOM_Object, containing the retrieved blocks.
10856 # Example: see GEOM_TestOthers.py
10857 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10858 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10859 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10860 for anObj in aList:
10861 anObj.SetParameters(Parameters)
10863 self._autoPublish(aList, theName, "block")
10866 ## Find block, containing the given point inside its volume or on boundary.
10867 # @param theCompound Compound, to find block in.
10868 # @param thePoint Point, close to the desired block. If the point lays on
10869 # boundary between some blocks, we return block with nearest center.
10870 # @param theName Object name; when specified, this parameter is used
10871 # for result publication in the study. Otherwise, if automatic
10872 # publication is switched on, default value is used for result name.
10874 # @return New GEOM.GEOM_Object, containing the found block.
10876 # @ref swig_todo "Example"
10877 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10879 Find block, containing the given point inside its volume or on boundary.
10882 theCompound Compound, to find block in.
10883 thePoint Point, close to the desired block. If the point lays on
10884 boundary between some blocks, we return block with nearest center.
10885 theName Object name; when specified, this parameter is used
10886 for result publication in the study. Otherwise, if automatic
10887 publication is switched on, default value is used for result name.
10890 New GEOM.GEOM_Object, containing the found block.
10892 # Example: see GEOM_Spanner.py
10893 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10894 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10895 self._autoPublish(anObj, theName, "block")
10898 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10899 # @param theCompound Compound, to find block in.
10900 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10901 # @param theName Object name; when specified, this parameter is used
10902 # for result publication in the study. Otherwise, if automatic
10903 # publication is switched on, default value is used for result name.
10905 # @return New GEOM.GEOM_Object, containing the found block.
10907 # @ref swig_GetBlockByParts "Example"
10908 def GetBlockByParts(self, theCompound, theParts, theName=None):
10910 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10913 theCompound Compound, to find block in.
10914 theParts List of faces and/or edges and/or vertices to be parts of the found block.
10915 theName Object name; when specified, this parameter is used
10916 for result publication in the study. Otherwise, if automatic
10917 publication is switched on, default value is used for result name.
10920 New GEOM_Object, containing the found block.
10922 # Example: see GEOM_TestOthers.py
10923 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10924 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10925 self._autoPublish(anObj, theName, "block")
10928 ## Return all blocks, containing all the elements, passed as the parts.
10929 # @param theCompound Compound, to find blocks in.
10930 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10931 # @param theName Object name; when specified, this parameter is used
10932 # for result publication in the study. Otherwise, if automatic
10933 # publication is switched on, default value is used for result name.
10935 # @return List of GEOM.GEOM_Object, containing the found blocks.
10937 # @ref swig_todo "Example"
10938 def GetBlocksByParts(self, theCompound, theParts, theName=None):
10940 Return all blocks, containing all the elements, passed as the parts.
10943 theCompound Compound, to find blocks in.
10944 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10945 theName Object name; when specified, this parameter is used
10946 for result publication in the study. Otherwise, if automatic
10947 publication is switched on, default value is used for result name.
10950 List of GEOM.GEOM_Object, containing the found blocks.
10952 # Example: see GEOM_Spanner.py
10953 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
10954 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
10955 self._autoPublish(aList, theName, "block")
10958 ## Multi-transformate block and glue the result.
10959 # Transformation is defined so, as to superpose direction faces.
10960 # @param Block Hexahedral solid to be multi-transformed.
10961 # @param DirFace1 ID of First direction face.
10962 # @param DirFace2 ID of Second direction face.
10963 # @param NbTimes Quantity of transformations to be done.
10964 # @param theName Object name; when specified, this parameter is used
10965 # for result publication in the study. Otherwise, if automatic
10966 # publication is switched on, default value is used for result name.
10968 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10970 # @return New GEOM.GEOM_Object, containing the result shape.
10972 # @ref tui_multi_transformation "Example"
10973 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
10975 Multi-transformate block and glue the result.
10976 Transformation is defined so, as to superpose direction faces.
10979 Block Hexahedral solid to be multi-transformed.
10980 DirFace1 ID of First direction face.
10981 DirFace2 ID of Second direction face.
10982 NbTimes Quantity of transformations to be done.
10983 theName Object name; when specified, this parameter is used
10984 for result publication in the study. Otherwise, if automatic
10985 publication is switched on, default value is used for result name.
10988 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10991 New GEOM.GEOM_Object, containing the result shape.
10993 # Example: see GEOM_Spanner.py
10994 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
10995 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
10996 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
10997 anObj.SetParameters(Parameters)
10998 self._autoPublish(anObj, theName, "transformed")
11001 ## Multi-transformate block and glue the result.
11002 # @param Block Hexahedral solid to be multi-transformed.
11003 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11004 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11005 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11006 # @param theName Object name; when specified, this parameter is used
11007 # for result publication in the study. Otherwise, if automatic
11008 # publication is switched on, default value is used for result name.
11010 # @return New GEOM.GEOM_Object, containing the result shape.
11012 # @ref tui_multi_transformation "Example"
11013 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11014 DirFace1V, DirFace2V, NbTimesV, theName=None):
11016 Multi-transformate block and glue the result.
11019 Block Hexahedral solid to be multi-transformed.
11020 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11021 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11022 NbTimesU,NbTimesV Quantity of transformations to be done.
11023 theName Object name; when specified, this parameter is used
11024 for result publication in the study. Otherwise, if automatic
11025 publication is switched on, default value is used for result name.
11028 New GEOM.GEOM_Object, containing the result shape.
11030 # Example: see GEOM_Spanner.py
11031 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11032 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11033 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11034 DirFace1V, DirFace2V, NbTimesV)
11035 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11036 anObj.SetParameters(Parameters)
11037 self._autoPublish(anObj, theName, "transformed")
11040 ## Build all possible propagation groups.
11041 # Propagation group is a set of all edges, opposite to one (main)
11042 # edge of this group directly or through other opposite edges.
11043 # Notion of Opposite Edge make sence only on quadrangle face.
11044 # @param theShape Shape to build propagation groups on.
11045 # @param theName Object name; when specified, this parameter is used
11046 # for result publication in the study. Otherwise, if automatic
11047 # publication is switched on, default value is used for result name.
11049 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11051 # @ref swig_Propagate "Example"
11052 def Propagate(self, theShape, theName=None):
11054 Build all possible propagation groups.
11055 Propagation group is a set of all edges, opposite to one (main)
11056 edge of this group directly or through other opposite edges.
11057 Notion of Opposite Edge make sence only on quadrangle face.
11060 theShape Shape to build propagation groups on.
11061 theName Object name; when specified, this parameter is used
11062 for result publication in the study. Otherwise, if automatic
11063 publication is switched on, default value is used for result name.
11066 List of GEOM.GEOM_Object, each of them is a propagation group.
11068 # Example: see GEOM_TestOthers.py
11069 listChains = self.BlocksOp.Propagate(theShape)
11070 RaiseIfFailed("Propagate", self.BlocksOp)
11071 self._autoPublish(listChains, theName, "propagate")
11074 # end of l3_blocks_op
11077 ## @addtogroup l3_groups
11080 ## Creates a new group which will store sub-shapes of theMainShape
11081 # @param theMainShape is a GEOM object on which the group is selected
11082 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11083 # @param theName Object name; when specified, this parameter is used
11084 # for result publication in the study. Otherwise, if automatic
11085 # publication is switched on, default value is used for result name.
11087 # @return a newly created GEOM group (GEOM.GEOM_Object)
11089 # @ref tui_working_with_groups_page "Example 1"
11090 # \n @ref swig_CreateGroup "Example 2"
11091 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11093 Creates a new group which will store sub-shapes of theMainShape
11096 theMainShape is a GEOM object on which the group is selected
11097 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11098 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11099 theName Object name; when specified, this parameter is used
11100 for result publication in the study. Otherwise, if automatic
11101 publication is switched on, default value is used for result name.
11104 a newly created GEOM group
11107 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11110 # Example: see GEOM_TestOthers.py
11111 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11112 RaiseIfFailed("CreateGroup", self.GroupOp)
11113 self._autoPublish(anObj, theName, "group")
11116 ## Adds a sub-object with ID theSubShapeId to the group
11117 # @param theGroup is a GEOM group to which the new sub-shape is added
11118 # @param theSubShapeID is a sub-shape ID in the main object.
11119 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11121 # @ref tui_working_with_groups_page "Example"
11122 def AddObject(self,theGroup, theSubShapeID):
11124 Adds a sub-object with ID theSubShapeId to the group
11127 theGroup is a GEOM group to which the new sub-shape is added
11128 theSubShapeID is a sub-shape ID in the main object.
11131 Use method GetSubShapeID() to get an unique ID of the sub-shape
11133 # Example: see GEOM_TestOthers.py
11134 self.GroupOp.AddObject(theGroup, theSubShapeID)
11135 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11136 RaiseIfFailed("AddObject", self.GroupOp)
11140 ## Removes a sub-object with ID \a theSubShapeId from the group
11141 # @param theGroup is a GEOM group from which the new sub-shape is removed
11142 # @param theSubShapeID is a sub-shape ID in the main object.
11143 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11145 # @ref tui_working_with_groups_page "Example"
11146 def RemoveObject(self,theGroup, theSubShapeID):
11148 Removes a sub-object with ID theSubShapeId from the group
11151 theGroup is a GEOM group from which the new sub-shape is removed
11152 theSubShapeID is a sub-shape ID in the main object.
11155 Use method GetSubShapeID() to get an unique ID of the sub-shape
11157 # Example: see GEOM_TestOthers.py
11158 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11159 RaiseIfFailed("RemoveObject", self.GroupOp)
11162 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11163 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11164 # @param theSubShapes is a list of sub-shapes to be added.
11166 # @ref tui_working_with_groups_page "Example"
11167 def UnionList (self,theGroup, theSubShapes):
11169 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11172 theGroup is a GEOM group to which the new sub-shapes are added.
11173 theSubShapes is a list of sub-shapes to be added.
11175 # Example: see GEOM_TestOthers.py
11176 self.GroupOp.UnionList(theGroup, theSubShapes)
11177 RaiseIfFailed("UnionList", self.GroupOp)
11180 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11181 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11182 # @param theSubShapes is a list of indices of sub-shapes to be added.
11184 # @ref swig_UnionIDs "Example"
11185 def UnionIDs(self,theGroup, theSubShapes):
11187 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11190 theGroup is a GEOM group to which the new sub-shapes are added.
11191 theSubShapes is a list of indices of sub-shapes to be added.
11193 # Example: see GEOM_TestOthers.py
11194 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11195 RaiseIfFailed("UnionIDs", self.GroupOp)
11198 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11199 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11200 # @param theSubShapes is a list of sub-shapes to be removed.
11202 # @ref tui_working_with_groups_page "Example"
11203 def DifferenceList (self,theGroup, theSubShapes):
11205 Removes from the group all the given shapes. No errors, if some shapes are not included.
11208 theGroup is a GEOM group from which the sub-shapes are removed.
11209 theSubShapes is a list of sub-shapes to be removed.
11211 # Example: see GEOM_TestOthers.py
11212 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11213 RaiseIfFailed("DifferenceList", self.GroupOp)
11216 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11217 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11218 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11220 # @ref swig_DifferenceIDs "Example"
11221 def DifferenceIDs(self,theGroup, theSubShapes):
11223 Removes from the group all the given shapes. No errors, if some shapes are not included.
11226 theGroup is a GEOM group from which the sub-shapes are removed.
11227 theSubShapes is a list of indices of sub-shapes to be removed.
11229 # Example: see GEOM_TestOthers.py
11230 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11231 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11234 ## Union of two groups.
11235 # New group is created. It will contain all entities
11236 # which are present in groups theGroup1 and theGroup2.
11237 # @param theGroup1, theGroup2 are the initial GEOM groups
11238 # to create the united group from.
11239 # @param theName Object name; when specified, this parameter is used
11240 # for result publication in the study. Otherwise, if automatic
11241 # publication is switched on, default value is used for result name.
11243 # @return a newly created GEOM group.
11245 # @ref tui_union_groups_anchor "Example"
11246 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11248 Union of two groups.
11249 New group is created. It will contain all entities
11250 which are present in groups theGroup1 and theGroup2.
11253 theGroup1, theGroup2 are the initial GEOM groups
11254 to create the united group from.
11255 theName Object name; when specified, this parameter is used
11256 for result publication in the study. Otherwise, if automatic
11257 publication is switched on, default value is used for result name.
11260 a newly created GEOM group.
11262 # Example: see GEOM_TestOthers.py
11263 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11264 RaiseIfFailed("UnionGroups", self.GroupOp)
11265 self._autoPublish(aGroup, theName, "group")
11268 ## Intersection of two groups.
11269 # New group is created. It will contain only those entities
11270 # which are present in both groups theGroup1 and theGroup2.
11271 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11272 # @param theName Object name; when specified, this parameter is used
11273 # for result publication in the study. Otherwise, if automatic
11274 # publication is switched on, default value is used for result name.
11276 # @return a newly created GEOM group.
11278 # @ref tui_intersect_groups_anchor "Example"
11279 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11281 Intersection of two groups.
11282 New group is created. It will contain only those entities
11283 which are present in both groups theGroup1 and theGroup2.
11286 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11287 theName Object name; when specified, this parameter is used
11288 for result publication in the study. Otherwise, if automatic
11289 publication is switched on, default value is used for result name.
11292 a newly created GEOM group.
11294 # Example: see GEOM_TestOthers.py
11295 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11296 RaiseIfFailed("IntersectGroups", self.GroupOp)
11297 self._autoPublish(aGroup, theName, "group")
11300 ## Cut of two groups.
11301 # New group is created. It will contain entities which are
11302 # present in group theGroup1 but are not present in group theGroup2.
11303 # @param theGroup1 is a GEOM group to include elements of.
11304 # @param theGroup2 is a GEOM group to exclude elements of.
11305 # @param theName Object name; when specified, this parameter is used
11306 # for result publication in the study. Otherwise, if automatic
11307 # publication is switched on, default value is used for result name.
11309 # @return a newly created GEOM group.
11311 # @ref tui_cut_groups_anchor "Example"
11312 def CutGroups (self, theGroup1, theGroup2, theName=None):
11315 New group is created. It will contain entities which are
11316 present in group theGroup1 but are not present in group theGroup2.
11319 theGroup1 is a GEOM group to include elements of.
11320 theGroup2 is a GEOM group to exclude elements of.
11321 theName Object name; when specified, this parameter is used
11322 for result publication in the study. Otherwise, if automatic
11323 publication is switched on, default value is used for result name.
11326 a newly created GEOM group.
11328 # Example: see GEOM_TestOthers.py
11329 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11330 RaiseIfFailed("CutGroups", self.GroupOp)
11331 self._autoPublish(aGroup, theName, "group")
11334 ## Union of list of groups.
11335 # New group is created. It will contain all entities that are
11336 # present in groups listed in theGList.
11337 # @param theGList is a list of GEOM groups to create the united group from.
11338 # @param theName Object name; when specified, this parameter is used
11339 # for result publication in the study. Otherwise, if automatic
11340 # publication is switched on, default value is used for result name.
11342 # @return a newly created GEOM group.
11344 # @ref tui_union_groups_anchor "Example"
11345 def UnionListOfGroups (self, theGList, theName=None):
11347 Union of list of groups.
11348 New group is created. It will contain all entities that are
11349 present in groups listed in theGList.
11352 theGList is a list of GEOM groups to create the united group from.
11353 theName Object name; when specified, this parameter is used
11354 for result publication in the study. Otherwise, if automatic
11355 publication is switched on, default value is used for result name.
11358 a newly created GEOM group.
11360 # Example: see GEOM_TestOthers.py
11361 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11362 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11363 self._autoPublish(aGroup, theName, "group")
11366 ## Cut of lists of groups.
11367 # New group is created. It will contain only entities
11368 # which are present in groups listed in theGList1 but
11369 # are not present in groups from theGList2.
11370 # @param theGList1 is a list of GEOM groups to include elements of.
11371 # @param theGList2 is a list of GEOM groups to exclude elements of.
11372 # @param theName Object name; when specified, this parameter is used
11373 # for result publication in the study. Otherwise, if automatic
11374 # publication is switched on, default value is used for result name.
11376 # @return a newly created GEOM group.
11378 # @ref tui_intersect_groups_anchor "Example"
11379 def IntersectListOfGroups (self, theGList, theName=None):
11381 Cut of lists of groups.
11382 New group is created. It will contain only entities
11383 which are present in groups listed in theGList1 but
11384 are not present in groups from theGList2.
11387 theGList1 is a list of GEOM groups to include elements of.
11388 theGList2 is a list of GEOM groups to exclude elements of.
11389 theName Object name; when specified, this parameter is used
11390 for result publication in the study. Otherwise, if automatic
11391 publication is switched on, default value is used for result name.
11394 a newly created GEOM group.
11396 # Example: see GEOM_TestOthers.py
11397 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11398 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11399 self._autoPublish(aGroup, theName, "group")
11402 ## Cut of lists of groups.
11403 # New group is created. It will contain only entities
11404 # which are present in groups listed in theGList1 but
11405 # are not present in groups from theGList2.
11406 # @param theGList1 is a list of GEOM groups to include elements of.
11407 # @param theGList2 is a list of GEOM groups to exclude elements of.
11408 # @param theName Object name; when specified, this parameter is used
11409 # for result publication in the study. Otherwise, if automatic
11410 # publication is switched on, default value is used for result name.
11412 # @return a newly created GEOM group.
11414 # @ref tui_cut_groups_anchor "Example"
11415 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11417 Cut of lists of groups.
11418 New group is created. It will contain only entities
11419 which are present in groups listed in theGList1 but
11420 are not present in groups from theGList2.
11423 theGList1 is a list of GEOM groups to include elements of.
11424 theGList2 is a list of GEOM groups to exclude elements of.
11425 theName Object name; when specified, this parameter is used
11426 for result publication in the study. Otherwise, if automatic
11427 publication is switched on, default value is used for result name.
11430 a newly created GEOM group.
11432 # Example: see GEOM_TestOthers.py
11433 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11434 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11435 self._autoPublish(aGroup, theName, "group")
11438 ## Returns a list of sub-objects ID stored in the group
11439 # @param theGroup is a GEOM group for which a list of IDs is requested
11441 # @ref swig_GetObjectIDs "Example"
11442 def GetObjectIDs(self,theGroup):
11444 Returns a list of sub-objects ID stored in the group
11447 theGroup is a GEOM group for which a list of IDs is requested
11449 # Example: see GEOM_TestOthers.py
11450 ListIDs = self.GroupOp.GetObjects(theGroup)
11451 RaiseIfFailed("GetObjects", self.GroupOp)
11454 ## Returns a type of sub-objects stored in the group
11455 # @param theGroup is a GEOM group which type is returned.
11457 # @ref swig_GetType "Example"
11458 def GetType(self,theGroup):
11460 Returns a type of sub-objects stored in the group
11463 theGroup is a GEOM group which type is returned.
11465 # Example: see GEOM_TestOthers.py
11466 aType = self.GroupOp.GetType(theGroup)
11467 RaiseIfFailed("GetType", self.GroupOp)
11470 ## Convert a type of geom object from id to string value
11471 # @param theId is a GEOM obect type id.
11472 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11473 # @ref swig_GetType "Example"
11474 def ShapeIdToType(self, theId):
11476 Convert a type of geom object from id to string value
11479 theId is a GEOM obect type id.
11482 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11509 return "REVOLUTION"
11557 return "FREE_BOUNDS"
11565 return "THRUSECTIONS"
11567 return "COMPOUNDFILTER"
11569 return "SHAPES_ON_SHAPE"
11571 return "ELLIPSE_ARC"
11573 return "3DSKETCHER"
11579 return "PIPETSHAPE"
11580 return "Shape Id not exist."
11582 ## Returns a main shape associated with the group
11583 # @param theGroup is a GEOM group for which a main shape object is requested
11584 # @return a GEOM object which is a main shape for theGroup
11586 # @ref swig_GetMainShape "Example"
11587 def GetMainShape(self,theGroup):
11589 Returns a main shape associated with the group
11592 theGroup is a GEOM group for which a main shape object is requested
11595 a GEOM object which is a main shape for theGroup
11597 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11599 # Example: see GEOM_TestOthers.py
11600 anObj = self.GroupOp.GetMainShape(theGroup)
11601 RaiseIfFailed("GetMainShape", self.GroupOp)
11604 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11605 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11606 # @param theShape given shape (see GEOM.GEOM_Object)
11607 # @param min_length minimum length of edges of theShape
11608 # @param max_length maximum length of edges of theShape
11609 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11610 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11611 # @param theName Object name; when specified, this parameter is used
11612 # for result publication in the study. Otherwise, if automatic
11613 # publication is switched on, default value is used for result name.
11615 # @return a newly created GEOM group of edges
11617 # @@ref swig_todo "Example"
11618 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11620 Create group of edges of theShape, whose length is in range [min_length, max_length].
11621 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11624 theShape given shape
11625 min_length minimum length of edges of theShape
11626 max_length maximum length of edges of theShape
11627 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11628 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11629 theName Object name; when specified, this parameter is used
11630 for result publication in the study. Otherwise, if automatic
11631 publication is switched on, default value is used for result name.
11634 a newly created GEOM group of edges.
11636 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11637 edges_in_range = []
11639 Props = self.BasicProperties(edge)
11640 if min_length <= Props[0] and Props[0] <= max_length:
11641 if (not include_min) and (min_length == Props[0]):
11644 if (not include_max) and (Props[0] == max_length):
11647 edges_in_range.append(edge)
11649 if len(edges_in_range) <= 0:
11650 print "No edges found by given criteria"
11653 # note: auto-publishing is done in self.CreateGroup()
11654 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11655 self.UnionList(group_edges, edges_in_range)
11659 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11660 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11661 # @param min_length minimum length of edges of selected shape
11662 # @param max_length maximum length of edges of selected shape
11663 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11664 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11665 # @return a newly created GEOM group of edges
11666 # @ref swig_todo "Example"
11667 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11669 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11670 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11673 min_length minimum length of edges of selected shape
11674 max_length maximum length of edges of selected shape
11675 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11676 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11679 a newly created GEOM group of edges.
11681 nb_selected = sg.SelectedCount()
11682 if nb_selected < 1:
11683 print "Select a shape before calling this function, please."
11685 if nb_selected > 1:
11686 print "Only one shape must be selected"
11689 id_shape = sg.getSelected(0)
11690 shape = IDToObject( id_shape )
11692 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11696 if include_min: left_str = " <= "
11697 if include_max: right_str = " <= "
11699 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11700 + left_str + "length" + right_str + `max_length`)
11702 sg.updateObjBrowser(1)
11709 ## @addtogroup l4_advanced
11712 ## Create a T-shape object with specified caracteristics for the main
11713 # and the incident pipes (radius, width, half-length).
11714 # The extremities of the main pipe are located on junctions points P1 and P2.
11715 # The extremity of the incident pipe is located on junction point P3.
11716 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11717 # the main plane of the T-shape is XOY.
11719 # @param theR1 Internal radius of main pipe
11720 # @param theW1 Width of main pipe
11721 # @param theL1 Half-length of main pipe
11722 # @param theR2 Internal radius of incident pipe (R2 < R1)
11723 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11724 # @param theL2 Half-length of incident pipe
11726 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11727 # @param theP1 1st junction point of main pipe
11728 # @param theP2 2nd junction point of main pipe
11729 # @param theP3 Junction point of incident pipe
11731 # @param theRL Internal radius of left thickness reduction
11732 # @param theWL Width of left thickness reduction
11733 # @param theLtransL Length of left transition part
11734 # @param theLthinL Length of left thin part
11736 # @param theRR Internal radius of right thickness reduction
11737 # @param theWR Width of right thickness reduction
11738 # @param theLtransR Length of right transition part
11739 # @param theLthinR Length of right thin part
11741 # @param theRI Internal radius of incident thickness reduction
11742 # @param theWI Width of incident thickness reduction
11743 # @param theLtransI Length of incident transition part
11744 # @param theLthinI Length of incident thin part
11746 # @param theName Object name; when specified, this parameter is used
11747 # for result publication in the study. Otherwise, if automatic
11748 # publication is switched on, default value is used for result name.
11750 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11752 # @ref tui_creation_pipetshape "Example"
11753 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11754 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11755 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11756 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11757 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11760 Create a T-shape object with specified caracteristics for the main
11761 and the incident pipes (radius, width, half-length).
11762 The extremities of the main pipe are located on junctions points P1 and P2.
11763 The extremity of the incident pipe is located on junction point P3.
11764 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11765 the main plane of the T-shape is XOY.
11768 theR1 Internal radius of main pipe
11769 theW1 Width of main pipe
11770 theL1 Half-length of main pipe
11771 theR2 Internal radius of incident pipe (R2 < R1)
11772 theW2 Width of incident pipe (R2+W2 < R1+W1)
11773 theL2 Half-length of incident pipe
11774 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11775 theP1 1st junction point of main pipe
11776 theP2 2nd junction point of main pipe
11777 theP3 Junction point of incident pipe
11779 theRL Internal radius of left thickness reduction
11780 theWL Width of left thickness reduction
11781 theLtransL Length of left transition part
11782 theLthinL Length of left thin part
11784 theRR Internal radius of right thickness reduction
11785 theWR Width of right thickness reduction
11786 theLtransR Length of right transition part
11787 theLthinR Length of right thin part
11789 theRI Internal radius of incident thickness reduction
11790 theWI Width of incident thickness reduction
11791 theLtransI Length of incident transition part
11792 theLthinI Length of incident thin part
11794 theName Object name; when specified, this parameter is used
11795 for result publication in the study. Otherwise, if automatic
11796 publication is switched on, default value is used for result name.
11799 List of GEOM_Object, containing the created shape and propagation groups.
11802 # create PipeTShape object
11803 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11804 # create PipeTShape object with position
11805 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11806 # create PipeTShape object with left thickness reduction
11807 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11809 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)
11810 if (theP1 and theP2 and theP3):
11811 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11812 theRL, theWL, theLtransL, theLthinL,
11813 theRR, theWR, theLtransR, theLthinR,
11814 theRI, theWI, theLtransI, theLthinI,
11815 theHexMesh, theP1, theP2, theP3)
11817 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11818 theRL, theWL, theLtransL, theLthinL,
11819 theRR, theWR, theLtransR, theLthinR,
11820 theRI, theWI, theLtransI, theLthinI,
11822 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11823 if Parameters: anObj[0].SetParameters(Parameters)
11824 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11825 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11828 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11829 # and the incident pipes (radius, width, half-length). The chamfer is
11830 # created on the junction of the pipes.
11831 # The extremities of the main pipe are located on junctions points P1 and P2.
11832 # The extremity of the incident pipe is located on junction point P3.
11833 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11834 # the main plane of the T-shape is XOY.
11835 # @param theR1 Internal radius of main pipe
11836 # @param theW1 Width of main pipe
11837 # @param theL1 Half-length of main pipe
11838 # @param theR2 Internal radius of incident pipe (R2 < R1)
11839 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11840 # @param theL2 Half-length of incident pipe
11841 # @param theH Height of the chamfer.
11842 # @param theW Width of the chamfer.
11843 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11844 # @param theP1 1st junction point of main pipe
11845 # @param theP2 2nd junction point of main pipe
11846 # @param theP3 Junction point of incident pipe
11848 # @param theRL Internal radius of left thickness reduction
11849 # @param theWL Width of left thickness reduction
11850 # @param theLtransL Length of left transition part
11851 # @param theLthinL Length of left thin part
11853 # @param theRR Internal radius of right thickness reduction
11854 # @param theWR Width of right thickness reduction
11855 # @param theLtransR Length of right transition part
11856 # @param theLthinR Length of right thin part
11858 # @param theRI Internal radius of incident thickness reduction
11859 # @param theWI Width of incident thickness reduction
11860 # @param theLtransI Length of incident transition part
11861 # @param theLthinI Length of incident thin part
11863 # @param theName Object name; when specified, this parameter is used
11864 # for result publication in the study. Otherwise, if automatic
11865 # publication is switched on, default value is used for result name.
11867 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11869 # @ref tui_creation_pipetshape "Example"
11870 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11871 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11872 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11873 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11874 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11877 Create a T-shape object with chamfer and with specified caracteristics for the main
11878 and the incident pipes (radius, width, half-length). The chamfer is
11879 created on the junction of the pipes.
11880 The extremities of the main pipe are located on junctions points P1 and P2.
11881 The extremity of the incident pipe is located on junction point P3.
11882 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11883 the main plane of the T-shape is XOY.
11886 theR1 Internal radius of main pipe
11887 theW1 Width of main pipe
11888 theL1 Half-length of main pipe
11889 theR2 Internal radius of incident pipe (R2 < R1)
11890 theW2 Width of incident pipe (R2+W2 < R1+W1)
11891 theL2 Half-length of incident pipe
11892 theH Height of the chamfer.
11893 theW Width of the chamfer.
11894 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11895 theP1 1st junction point of main pipe
11896 theP2 2nd junction point of main pipe
11897 theP3 Junction point of incident pipe
11899 theRL Internal radius of left thickness reduction
11900 theWL Width of left thickness reduction
11901 theLtransL Length of left transition part
11902 theLthinL Length of left thin part
11904 theRR Internal radius of right thickness reduction
11905 theWR Width of right thickness reduction
11906 theLtransR Length of right transition part
11907 theLthinR Length of right thin part
11909 theRI Internal radius of incident thickness reduction
11910 theWI Width of incident thickness reduction
11911 theLtransI Length of incident transition part
11912 theLthinI Length of incident thin part
11914 theName Object name; when specified, this parameter is used
11915 for result publication in the study. Otherwise, if automatic
11916 publication is switched on, default value is used for result name.
11919 List of GEOM_Object, containing the created shape and propagation groups.
11922 # create PipeTShape with chamfer object
11923 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11924 # create PipeTShape with chamfer object with position
11925 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11926 # create PipeTShape with chamfer object with left thickness reduction
11927 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)
11929 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)
11930 if (theP1 and theP2 and theP3):
11931 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11932 theRL, theWL, theLtransL, theLthinL,
11933 theRR, theWR, theLtransR, theLthinR,
11934 theRI, theWI, theLtransI, theLthinI,
11935 theH, theW, theHexMesh, theP1, theP2, theP3)
11937 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
11938 theRL, theWL, theLtransL, theLthinL,
11939 theRR, theWR, theLtransR, theLthinR,
11940 theRI, theWI, theLtransI, theLthinI,
11941 theH, theW, theHexMesh)
11942 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
11943 if Parameters: anObj[0].SetParameters(Parameters)
11944 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11945 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11948 ## Create a T-shape object with fillet and with specified caracteristics for the main
11949 # and the incident pipes (radius, width, half-length). The fillet is
11950 # created on the junction of the pipes.
11951 # The extremities of the main pipe are located on junctions points P1 and P2.
11952 # The extremity of the incident pipe is located on junction point P3.
11953 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11954 # the main plane of the T-shape is XOY.
11955 # @param theR1 Internal radius of main pipe
11956 # @param theW1 Width of main pipe
11957 # @param theL1 Half-length of main pipe
11958 # @param theR2 Internal radius of incident pipe (R2 < R1)
11959 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11960 # @param theL2 Half-length of incident pipe
11961 # @param theRF Radius of curvature of fillet.
11962 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11963 # @param theP1 1st junction point of main pipe
11964 # @param theP2 2nd junction point of main pipe
11965 # @param theP3 Junction point of incident pipe
11967 # @param theRL Internal radius of left thickness reduction
11968 # @param theWL Width of left thickness reduction
11969 # @param theLtransL Length of left transition part
11970 # @param theLthinL Length of left thin part
11972 # @param theRR Internal radius of right thickness reduction
11973 # @param theWR Width of right thickness reduction
11974 # @param theLtransR Length of right transition part
11975 # @param theLthinR Length of right thin part
11977 # @param theRI Internal radius of incident thickness reduction
11978 # @param theWI Width of incident thickness reduction
11979 # @param theLtransI Length of incident transition part
11980 # @param theLthinI Length of incident thin part
11982 # @param theName Object name; when specified, this parameter is used
11983 # for result publication in the study. Otherwise, if automatic
11984 # publication is switched on, default value is used for result name.
11986 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11988 # @ref tui_creation_pipetshape "Example"
11989 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
11990 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11991 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11992 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11993 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11996 Create a T-shape object with fillet and with specified caracteristics for the main
11997 and the incident pipes (radius, width, half-length). The fillet is
11998 created on the junction of the pipes.
11999 The extremities of the main pipe are located on junctions points P1 and P2.
12000 The extremity of the incident pipe is located on junction point P3.
12003 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12004 the main plane of the T-shape is XOY.
12005 theR1 Internal radius of main pipe
12006 theW1 Width of main pipe
12007 heL1 Half-length of main pipe
12008 theR2 Internal radius of incident pipe (R2 < R1)
12009 theW2 Width of incident pipe (R2+W2 < R1+W1)
12010 theL2 Half-length of incident pipe
12011 theRF Radius of curvature of fillet.
12012 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12013 theP1 1st junction point of main pipe
12014 theP2 2nd junction point of main pipe
12015 theP3 Junction point of incident pipe
12017 theRL Internal radius of left thickness reduction
12018 theWL Width of left thickness reduction
12019 theLtransL Length of left transition part
12020 theLthinL Length of left thin part
12022 theRR Internal radius of right thickness reduction
12023 theWR Width of right thickness reduction
12024 theLtransR Length of right transition part
12025 theLthinR Length of right thin part
12027 theRI Internal radius of incident thickness reduction
12028 theWI Width of incident thickness reduction
12029 theLtransI Length of incident transition part
12030 theLthinI Length of incident thin part
12032 theName Object name; when specified, this parameter is used
12033 for result publication in the study. Otherwise, if automatic
12034 publication is switched on, default value is used for result name.
12037 List of GEOM_Object, containing the created shape and propagation groups.
12040 # create PipeTShape with fillet object
12041 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12042 # create PipeTShape with fillet object with position
12043 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12044 # create PipeTShape with fillet object with left thickness reduction
12045 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)
12047 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)
12048 if (theP1 and theP2 and theP3):
12049 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12050 theRL, theWL, theLtransL, theLthinL,
12051 theRR, theWR, theLtransR, theLthinR,
12052 theRI, theWI, theLtransI, theLthinI,
12053 theRF, theHexMesh, theP1, theP2, theP3)
12055 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12056 theRL, theWL, theLtransL, theLthinL,
12057 theRR, theWR, theLtransR, theLthinR,
12058 theRI, theWI, theLtransI, theLthinI,
12060 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12061 if Parameters: anObj[0].SetParameters(Parameters)
12062 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12063 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12066 ## This function allows creating a disk already divided into blocks. It
12067 # can be used to create divided pipes for later meshing in hexaedra.
12068 # @param theR Radius of the disk
12069 # @param theOrientation Orientation of the plane on which the disk will be built
12070 # 1 = XOY, 2 = OYZ, 3 = OZX
12071 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12072 # @param theName Object name; when specified, this parameter is used
12073 # for result publication in the study. Otherwise, if automatic
12074 # publication is switched on, default value is used for result name.
12076 # @return New GEOM_Object, containing the created shape.
12078 # @ref tui_creation_divideddisk "Example"
12079 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12081 Creates a disk, divided into blocks. It can be used to create divided pipes
12082 for later meshing in hexaedra.
12085 theR Radius of the disk
12086 theOrientation Orientation of the plane on which the disk will be built:
12087 1 = XOY, 2 = OYZ, 3 = OZX
12088 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12089 theName Object name; when specified, this parameter is used
12090 for result publication in the study. Otherwise, if automatic
12091 publication is switched on, default value is used for result name.
12094 New GEOM_Object, containing the created shape.
12096 theR, Parameters = ParseParameters(theR)
12097 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12098 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12099 if Parameters: anObj.SetParameters(Parameters)
12100 self._autoPublish(anObj, theName, "dividedDisk")
12103 ## This function allows creating a disk already divided into blocks. It
12104 # can be used to create divided pipes for later meshing in hexaedra.
12105 # @param theCenter Center of the disk
12106 # @param theVector Normal vector to the plane of the created disk
12107 # @param theRadius Radius of the disk
12108 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12109 # @param 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.
12113 # @return New GEOM_Object, containing the created shape.
12115 # @ref tui_creation_divideddisk "Example"
12116 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12118 Creates a disk already divided into blocks. It can be used to create divided pipes
12119 for later meshing in hexaedra.
12122 theCenter Center of the disk
12123 theVector Normal vector to the plane of the created disk
12124 theRadius Radius of the disk
12125 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12126 theName Object name; when specified, this parameter is used
12127 for result publication in the study. Otherwise, if automatic
12128 publication is switched on, default value is used for result name.
12131 New GEOM_Object, containing the created shape.
12133 theRadius, Parameters = ParseParameters(theRadius)
12134 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12135 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12136 if Parameters: anObj.SetParameters(Parameters)
12137 self._autoPublish(anObj, theName, "dividedDisk")
12140 ## Builds a cylinder prepared for hexa meshes
12141 # @param theR Radius of the cylinder
12142 # @param theH Height of the cylinder
12143 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12144 # @param theName Object name; when specified, this parameter is used
12145 # for result publication in the study. Otherwise, if automatic
12146 # publication is switched on, default value is used for result name.
12148 # @return New GEOM_Object, containing the created shape.
12150 # @ref tui_creation_dividedcylinder "Example"
12151 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12153 Builds a cylinder prepared for hexa meshes
12156 theR Radius of the cylinder
12157 theH Height of the cylinder
12158 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12159 theName Object name; when specified, this parameter is used
12160 for result publication in the study. Otherwise, if automatic
12161 publication is switched on, default value is used for result name.
12164 New GEOM_Object, containing the created shape.
12166 theR, theH, Parameters = ParseParameters(theR, theH)
12167 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12168 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12169 if Parameters: anObj.SetParameters(Parameters)
12170 self._autoPublish(anObj, theName, "dividedCylinder")
12173 #@@ insert new functions before this line @@ do not remove this line @@#
12175 # end of l4_advanced
12178 ## Create a copy of the given object
12180 # @param theOriginal geometry object for copy
12181 # @param theName Object name; when specified, this parameter is used
12182 # for result publication in the study. Otherwise, if automatic
12183 # publication is switched on, default value is used for result name.
12185 # @return New GEOM_Object, containing the copied shape.
12187 # @ingroup l1_geomBuilder_auxiliary
12188 # @ref swig_MakeCopy "Example"
12189 def MakeCopy(self, theOriginal, theName=None):
12191 Create a copy of the given object
12194 theOriginal geometry object for copy
12195 theName Object name; when specified, this parameter is used
12196 for result publication in the study. Otherwise, if automatic
12197 publication is switched on, default value is used for result name.
12200 New GEOM_Object, containing the copied shape.
12202 Example of usage: Copy = geompy.MakeCopy(Box)
12204 # Example: see GEOM_TestAll.py
12205 anObj = self.InsertOp.MakeCopy(theOriginal)
12206 RaiseIfFailed("MakeCopy", self.InsertOp)
12207 self._autoPublish(anObj, theName, "copy")
12210 ## Add Path to load python scripts from
12211 # @param Path a path to load python scripts from
12212 # @ingroup l1_geomBuilder_auxiliary
12213 def addPath(self,Path):
12215 Add Path to load python scripts from
12218 Path a path to load python scripts from
12220 if (sys.path.count(Path) < 1):
12221 sys.path.append(Path)
12225 ## Load marker texture from the file
12226 # @param Path a path to the texture file
12227 # @return unique texture identifier
12228 # @ingroup l1_geomBuilder_auxiliary
12229 def LoadTexture(self, Path):
12231 Load marker texture from the file
12234 Path a path to the texture file
12237 unique texture identifier
12239 # Example: see GEOM_TestAll.py
12240 ID = self.InsertOp.LoadTexture(Path)
12241 RaiseIfFailed("LoadTexture", self.InsertOp)
12244 ## Get internal name of the object based on its study entry
12245 # @note This method does not provide an unique identifier of the geometry object.
12246 # @note This is internal function of GEOM component, though it can be used outside it for
12247 # appropriate reason (e.g. for identification of geometry object).
12248 # @param obj geometry object
12249 # @return unique object identifier
12250 # @ingroup l1_geomBuilder_auxiliary
12251 def getObjectID(self, obj):
12253 Get internal name of the object based on its study entry.
12254 Note: this method does not provide an unique identifier of the geometry object.
12255 It is an internal function of GEOM component, though it can be used outside GEOM for
12256 appropriate reason (e.g. for identification of geometry object).
12259 obj geometry object
12262 unique object identifier
12265 entry = salome.ObjectToID(obj)
12266 if entry is not None:
12267 lst = entry.split(":")
12269 ID = lst[-1] # -1 means last item in the list
12270 return "GEOM_" + ID
12275 ## Add marker texture. @a Width and @a Height parameters
12276 # specify width and height of the texture in pixels.
12277 # If @a RowData is @c True, @a Texture parameter should represent texture data
12278 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12279 # parameter should be unpacked string, in which '1' symbols represent opaque
12280 # pixels and '0' represent transparent pixels of the texture bitmap.
12282 # @param Width texture width in pixels
12283 # @param Height texture height in pixels
12284 # @param Texture texture data
12285 # @param RowData if @c True, @a Texture data are packed in the byte stream
12286 # @return unique texture identifier
12287 # @ingroup l1_geomBuilder_auxiliary
12288 def AddTexture(self, Width, Height, Texture, RowData=False):
12290 Add marker texture. Width and Height parameters
12291 specify width and height of the texture in pixels.
12292 If RowData is True, Texture parameter should represent texture data
12293 packed into the byte array. If RowData is False (default), Texture
12294 parameter should be unpacked string, in which '1' symbols represent opaque
12295 pixels and '0' represent transparent pixels of the texture bitmap.
12298 Width texture width in pixels
12299 Height texture height in pixels
12300 Texture texture data
12301 RowData if True, Texture data are packed in the byte stream
12304 return unique texture identifier
12306 if not RowData: Texture = PackData(Texture)
12307 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12308 RaiseIfFailed("AddTexture", self.InsertOp)
12312 # Register the new proxy for GEOM_Gen
12313 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12315 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12316 # interface to GEOM operations.
12321 # salome.salome_init()
12322 # from salome.geom import geomBuilder
12323 # geompy = geomBuilder.New(salome.myStudy)
12325 # @param study SALOME study, generally obtained by salome.myStudy.
12326 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12327 # @return geomBuilder instance
12328 def New( study, instance=None):
12330 Create a new geomBuilder instance.The geomBuilder class provides the Python
12331 interface to GEOM operations.
12335 salome.salome_init()
12336 from salome.geom import geomBuilder
12337 geompy = geomBuilder.New(salome.myStudy)
12340 study SALOME study, generally obtained by salome.myStudy.
12341 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12343 geomBuilder instance
12345 #print "New geomBuilder ", study, instance
12352 geom = geomBuilder()
12353 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12354 geom.init_geom(study)