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 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
150 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
152 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
154 ## @defgroup l2_import_export Importing/exporting geometrical objects
155 ## @defgroup l2_creating Creating geometrical objects
157 ## @defgroup l3_basic_go Creating Basic Geometric Objects
159 ## @defgroup l4_curves Creating Curves
162 ## @defgroup l3_3d_primitives Creating 3D Primitives
163 ## @defgroup l3_complex Creating Complex Objects
164 ## @defgroup l3_groups Working with groups
165 ## @defgroup l3_blocks Building by blocks
167 ## @defgroup l4_blocks_measure Check and Improve
170 ## @defgroup l3_sketcher Sketcher
171 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
173 ## @defgroup l4_decompose Decompose objects
174 ## @defgroup l4_decompose_d Decompose objects deprecated methods
175 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
176 ## @defgroup l4_obtain Access to sub-shapes by a criteria
177 ## @defgroup l4_advanced Advanced objects creation functions
182 ## @defgroup l2_transforming Transforming geometrical objects
184 ## @defgroup l3_basic_op Basic Operations
185 ## @defgroup l3_boolean Boolean Operations
186 ## @defgroup l3_transform Transformation Operations
187 ## @defgroup l3_transform_d Transformation Operations deprecated methods
188 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
189 ## @defgroup l3_blocks_op Blocks Operations
190 ## @defgroup l3_healing Repairing Operations
191 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
194 ## @defgroup l2_measure Using measurement tools
198 # initialize SALOME session in try/except block
199 # to avoid problems in some cases, e.g. when generating documentation
207 from salome_notebook import *
213 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
216 def _toListOfNames(_names, _size=-1):
219 if type(_names) in [types.ListType, types.TupleType]:
220 for i in _names: l.append(i)
223 if l and len(l) < _size:
224 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
227 ## Raise an Error, containing the Method_name, if Operation is Failed
228 ## @ingroup l1_geomBuilder_auxiliary
229 def RaiseIfFailed (Method_name, Operation):
230 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
231 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
233 ## Return list of variables value from salome notebook
234 ## @ingroup l1_geomBuilder_auxiliary
235 def ParseParameters(*parameters):
238 for parameter in parameters:
239 if isinstance(parameter, list):
240 lResults = ParseParameters(*parameter)
241 if len(lResults) > 0:
242 Result.append(lResults[:-1])
243 StringResult += lResults[-1].split(":")
247 if isinstance(parameter,str):
248 if notebook.isVariable(parameter):
249 Result.append(notebook.get(parameter))
251 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
254 Result.append(parameter)
256 StringResult.append(str(parameter))
260 Result.append(":".join(StringResult))
262 Result = ":".join(StringResult)
265 ## Return list of variables value from salome notebook
266 ## @ingroup l1_geomBuilder_auxiliary
270 for parameter in list:
271 if isinstance(parameter,str) and notebook.isVariable(parameter):
272 Result.append(str(notebook.get(parameter)))
275 Result.append(str(parameter))
278 StringResult = StringResult + str(parameter)
279 StringResult = StringResult + ":"
281 StringResult = StringResult[:len(StringResult)-1]
282 return Result, StringResult
284 ## Return list of variables value from salome notebook
285 ## @ingroup l1_geomBuilder_auxiliary
286 def ParseSketcherCommand(command):
289 sections = command.split(":")
290 for section in sections:
291 parameters = section.split(" ")
293 for parameter in parameters:
294 if paramIndex > 1 and parameter.find("'") != -1:
295 parameter = parameter.replace("'","")
296 if notebook.isVariable(parameter):
297 Result = Result + str(notebook.get(parameter)) + " "
300 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
304 Result = Result + str(parameter) + " "
307 StringResult = StringResult + parameter
308 StringResult = StringResult + ":"
310 paramIndex = paramIndex + 1
312 Result = Result[:len(Result)-1] + ":"
314 Result = Result[:len(Result)-1]
315 return Result, StringResult
317 ## Helper function which can be used to pack the passed string to the byte data.
318 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
319 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
322 ## val = PackData("10001110") # val = 0xAE
323 ## val = PackData("1") # val = 0x80
325 ## @param data unpacked data - a string containing '1' and '0' symbols
326 ## @return data packed to the byte stream
327 ## @ingroup l1_geomBuilder_auxiliary
330 Helper function which can be used to pack the passed string to the byte data.
331 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
332 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
335 data unpacked data - a string containing '1' and '0' symbols
338 data packed to the byte stream
341 val = PackData("10001110") # val = 0xAE
342 val = PackData("1") # val = 0x80
345 if len(data)%8: bytes += 1
347 for b in range(bytes):
348 d = data[b*8:(b+1)*8]
353 if d[i] == "1": val += 1
355 raise "Invalid symbol %s" % d[i]
362 ## Read bitmap texture from the text file.
363 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
364 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
365 ## The function returns width and height of the pixmap in pixels and byte stream representing
366 ## texture bitmap itself.
368 ## This function can be used to read the texture to the byte stream in order to pass it to
369 ## the AddTexture() function of geomBuilder class.
372 ## from salome.geom import geomBuilder
373 ## geompy = geomBuilder.New(salome.myStudy)
374 ## texture = geompy.readtexture('mytexture.dat')
375 ## texture = geompy.AddTexture(*texture)
376 ## obj.SetMarkerTexture(texture)
378 ## @param fname texture file name
379 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
380 ## @ingroup l1_geomBuilder_auxiliary
381 def ReadTexture(fname):
383 Read bitmap texture from the text file.
384 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
385 A zero symbol ('0') represents transparent pixel of the texture bitmap.
386 The function returns width and height of the pixmap in pixels and byte stream representing
387 texture bitmap itself.
388 This function can be used to read the texture to the byte stream in order to pass it to
389 the AddTexture() function of geomBuilder class.
392 fname texture file name
395 sequence of tree values: texture's width, height in pixels and its byte stream
398 from salome.geom import geomBuilder
399 geompy = geomBuilder.New(salome.myStudy)
400 texture = geompy.readtexture('mytexture.dat')
401 texture = geompy.AddTexture(*texture)
402 obj.SetMarkerTexture(texture)
406 lines = [ l.strip() for l in f.readlines()]
409 if lines: maxlen = max([len(x) for x in lines])
411 if maxlen%8: lenbytes += 1
415 lenline = (len(line)/8+1)*8
418 lenline = (len(line)/8)*8
420 for i in range(lenline/8):
423 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
426 bytedata += PackData(byte)
428 for i in range(lenline/8, lenbytes):
429 bytedata += PackData("0")
431 return lenbytes*8, len(lines), bytedata
436 ## Returns a long value from enumeration type
437 # Can be used for CORBA enumerator types like GEOM.shape_type
438 # @param theItem enumeration type
439 # @ingroup l1_geomBuilder_auxiliary
440 def EnumToLong(theItem):
442 Returns a long value from enumeration type
443 Can be used for CORBA enumerator types like geomBuilder.ShapeType
446 theItem enumeration type
449 if hasattr(theItem, "_v"): ret = theItem._v
452 ## Information about closed/unclosed state of shell or wire
453 # @ingroup l1_geomBuilder_auxiliary
456 Information about closed/unclosed state of shell or wire
462 # Warning: geom is a singleton
468 class geomBuilder(object, GEOM._objref_GEOM_Gen):
470 ## Enumeration ShapeType as a dictionary. \n
471 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
472 # @ingroup l1_geomBuilder_auxiliary
473 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
475 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
476 # and a list of parameters, describing the shape.
477 # List of parameters, describing the shape:
478 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
479 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
481 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
483 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
485 # - SPHERE: [xc yc zc R]
486 # - CYLINDER: [xb yb zb dx dy dz R H]
487 # - BOX: [xc yc zc ax ay az]
488 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
489 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
490 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
491 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
492 # - SOLID: [nb_faces nb_edges nb_vertices]
494 # - SPHERE2D: [xc yc zc R]
495 # - CYLINDER2D: [xb yb zb dx dy dz R H]
496 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
497 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
498 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
499 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
500 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
501 # - PLANE: [xo yo zo dx dy dz]
502 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
503 # - FACE: [nb_edges nb_vertices]
505 # - CIRCLE: [xc yc zc dx dy dz R]
506 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
507 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
508 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
509 # - LINE: [xo yo zo dx dy dz]
510 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
511 # - EDGE: [nb_vertices]
514 # @ingroup l1_geomBuilder_auxiliary
515 kind = GEOM.GEOM_IKindOfShape
522 #print "==== __new__ ", engine, geom, doLcc, created
524 # geom engine is either retrieved from engine, or created
526 # Following test avoids a recursive loop
529 # geom engine not created: existing engine found
531 if doLcc and not created:
533 # FindOrLoadComponent called:
534 # 1. CORBA resolution of server
535 # 2. the __new__ method is called again
536 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
537 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
540 # FindOrLoadComponent not called
542 # geomBuilder instance is created from lcc.FindOrLoadComponent
543 #print "==== super ", engine, geom, doLcc, created
544 geom = super(geomBuilder,cls).__new__(cls)
547 # geom engine not created: existing engine found
548 #print "==== existing ", engine, geom, doLcc, created
550 #print "return geom 1 ", geom
553 #print "return geom 2 ", geom
558 #print "-------- geomBuilder __init__ --- ", created, self
561 GEOM._objref_GEOM_Gen.__init__(self)
562 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
563 self.myBuilder = None
582 ## Process object publication in the study, as follows:
583 # - if @a theName is specified (not None), the object is published in the study
584 # with this name, not taking into account "auto-publishing" option;
585 # - if @a theName is NOT specified, the object is published in the study
586 # (using default name, which can be customized using @a theDefaultName parameter)
587 # only if auto-publishing is switched on.
589 # @param theObj object, a subject for publishing
590 # @param theName object name for study
591 # @param theDefaultName default name for the auto-publishing
593 # @sa addToStudyAuto()
594 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
596 def _item_name(_names, _defname, _idx=-1):
597 if not _names: _names = _defname
598 if type(_names) in [types.ListType, types.TupleType]:
600 if _idx >= len(_names) or not _names[_idx]:
601 if type(_defname) not in [types.ListType, types.TupleType]:
602 _name = "%s_%d"%(_defname, _idx+1)
603 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
604 _name = _defname[_idx]
606 _name = "%noname_%d"%(dn, _idx+1)
612 # must be wrong usage
617 _name = "%s_%d"%(_names, _idx+1)
625 if not theName and not self.myMaxNbSubShapesAllowed:
626 return # nothing to do: auto-publishing is disabled
627 if not theName and not theDefaultName:
628 return # neither theName nor theDefaultName is given
630 if type(theObj) in [types.ListType, types.TupleType]:
631 # list of objects is being published
634 if not obj: continue # bad object
635 ###if obj.GetStudyEntry(): continue # already published
636 name = _item_name(theName, theDefaultName, idx)
637 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
638 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
640 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
643 if not theName and idx == self.myMaxNbSubShapesAllowed: break
647 # single object is published
648 ###if theObj.GetStudyEntry(): return # already published
649 name = _item_name(theName, theDefaultName)
650 if theObj.IsMainShape():
651 self.addToStudy(theObj, name)
653 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
658 ## @addtogroup l1_geomBuilder_auxiliary
660 def init_geom(self,theStudy):
661 self.myStudy = theStudy
662 self.myStudyId = self.myStudy._get_StudyId()
663 self.myBuilder = self.myStudy.NewBuilder()
664 self.father = self.myStudy.FindComponent("GEOM")
665 if self.father is None:
666 self.father = self.myBuilder.NewComponent("GEOM")
667 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
668 FName = A1._narrow(SALOMEDS.AttributeName)
669 FName.SetValue("Geometry")
670 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
671 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
672 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
673 self.myBuilder.DefineComponentInstance(self.father,self)
675 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
676 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
677 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
678 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
679 self.HealOp = self.GetIHealingOperations (self.myStudyId)
680 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
681 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
682 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
683 self.LocalOp = self.GetILocalOperations (self.myStudyId)
684 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
685 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
686 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
687 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
688 # set GEOM as root in the use case tree
689 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
690 self.myUseCaseBuilder.SetRootCurrent()
691 self.myUseCaseBuilder.Append(self.father)
694 ## Enable / disable results auto-publishing
696 # The automatic publishing is managed in the following way:
697 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
698 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
699 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
700 # value passed as parameter has the same effect.
701 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
702 # maximum number of sub-shapes allowed for publishing is set to specified value.
704 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
705 # @ingroup l1_publish_data
706 def addToStudyAuto(self, maxNbSubShapes=-1):
708 Enable / disable results auto-publishing
710 The automatic publishing is managed in the following way:
711 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
712 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
713 maximum number of sub-shapes allowed for publishing is unlimited; any negative
714 value passed as parameter has the same effect.
715 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
716 maximum number of sub-shapes allowed for publishing is set to this value.
719 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
722 geompy.addToStudyAuto() # enable auto-publishing
723 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
724 geompy.addToStudyAuto(0) # disable auto-publishing
726 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
729 ## Dump component to the Python script
730 # This method overrides IDL function to allow default values for the parameters.
731 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
733 Dump component to the Python script
734 This method overrides IDL function to allow default values for the parameters.
736 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
738 ## Get name for sub-shape aSubObj of shape aMainObj
740 # @ref swig_SubShapeName "Example"
741 def SubShapeName(self,aSubObj, aMainObj):
743 Get name for sub-shape aSubObj of shape aMainObj
745 # Example: see GEOM_TestAll.py
747 #aSubId = orb.object_to_string(aSubObj)
748 #aMainId = orb.object_to_string(aMainObj)
749 #index = gg.getIndexTopology(aSubId, aMainId)
750 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
751 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
752 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
755 ## Publish in study aShape with name aName
757 # \param aShape the shape to be published
758 # \param aName the name for the shape
759 # \param doRestoreSubShapes if True, finds and publishes also
760 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
761 # and published sub-shapes of arguments
762 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
763 # these arguments description
764 # \return study entry of the published shape in form of string
766 # @ingroup l1_publish_data
767 # @ref swig_all_addtostudy "Example"
768 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
769 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
771 Publish in study aShape with name aName
774 aShape the shape to be published
775 aName the name for the shape
776 doRestoreSubShapes if True, finds and publishes also
777 sub-shapes of aShape, corresponding to its arguments
778 and published sub-shapes of arguments
779 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
780 these arguments description
783 study entry of the published shape in form of string
786 id_block1 = geompy.addToStudy(Block1, "Block 1")
788 # Example: see GEOM_TestAll.py
790 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
791 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
792 if doRestoreSubShapes:
793 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
794 theFindMethod, theInheritFirstArg, True )
796 print "addToStudy() failed"
798 return aShape.GetStudyEntry()
800 ## Publish in study aShape with name aName as sub-object of previously published aFather
801 # \param aFather previously published object
802 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
803 # \param aName the name for the shape
805 # \return study entry of the published shape in form of string
807 # @ingroup l1_publish_data
808 # @ref swig_all_addtostudyInFather "Example"
809 def addToStudyInFather(self, aFather, aShape, aName):
811 Publish in study aShape with name aName as sub-object of previously published aFather
814 aFather previously published object
815 aShape the shape to be published as sub-object of aFather
816 aName the name for the shape
819 study entry of the published shape in form of string
821 # Example: see GEOM_TestAll.py
823 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
824 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
826 print "addToStudyInFather() failed"
828 return aShape.GetStudyEntry()
830 ## Unpublish object in study
832 # \param obj the object to be unpublished
833 def hideInStudy(self, obj):
835 Unpublish object in study
838 obj the object to be unpublished
840 ior = salome.orb.object_to_string(obj)
841 aSObject = self.myStudy.FindObjectIOR(ior)
842 if aSObject is not None:
843 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
844 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
845 drwAttribute.SetDrawable(False)
848 # end of l1_geomBuilder_auxiliary
851 ## @addtogroup l3_restore_ss
854 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
855 # To be used from python scripts out of addToStudy() (non-default usage)
856 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
857 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
858 # If this list is empty, all operation arguments will be published
859 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
860 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
861 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
862 # Do not publish sub-shapes in place of arguments, but only
863 # in place of sub-shapes of the first argument,
864 # because the whole shape corresponds to the first argument.
865 # Mainly to be used after transformations, but it also can be
866 # usefull after partition with one object shape, and some other
867 # operations, where only the first argument has to be considered.
868 # If theObject has only one argument shape, this flag is automatically
869 # considered as True, not regarding really passed value.
870 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
871 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
872 # \return list of published sub-shapes
874 # @ref tui_restore_prs_params "Example"
875 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
876 theInheritFirstArg=False, theAddPrefix=True):
878 Publish sub-shapes, standing for arguments and sub-shapes of arguments
879 To be used from python scripts out of geompy.addToStudy (non-default usage)
882 theObject published GEOM.GEOM_Object, arguments of which will be published
883 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
884 If this list is empty, all operation arguments will be published
885 theFindMethod method to search sub-shapes, corresponding to arguments and
886 their sub-shapes. Value from enumeration GEOM.find_shape_method.
887 theInheritFirstArg set properties of the first argument for theObject.
888 Do not publish sub-shapes in place of arguments, but only
889 in place of sub-shapes of the first argument,
890 because the whole shape corresponds to the first argument.
891 Mainly to be used after transformations, but it also can be
892 usefull after partition with one object shape, and some other
893 operations, where only the first argument has to be considered.
894 If theObject has only one argument shape, this flag is automatically
895 considered as True, not regarding really passed value.
896 theAddPrefix add prefix "from_" to names of restored sub-shapes,
897 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
899 list of published sub-shapes
901 # Example: see GEOM_TestAll.py
902 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
903 theFindMethod, theInheritFirstArg, theAddPrefix)
905 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
906 # To be used from python scripts out of addToStudy() (non-default usage)
907 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
908 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
909 # If this list is empty, all operation arguments will be published
910 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
911 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
912 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
913 # Do not publish sub-shapes in place of arguments, but only
914 # in place of sub-shapes of the first argument,
915 # because the whole shape corresponds to the first argument.
916 # Mainly to be used after transformations, but it also can be
917 # usefull after partition with one object shape, and some other
918 # operations, where only the first argument has to be considered.
919 # If theObject has only one argument shape, this flag is automatically
920 # considered as True, not regarding really passed value.
921 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
922 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
923 # \return list of published sub-shapes
925 # @ref tui_restore_prs_params "Example"
926 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
927 theInheritFirstArg=False, theAddPrefix=True):
929 Publish sub-shapes, standing for arguments and sub-shapes of arguments
930 To be used from python scripts out of geompy.addToStudy() (non-default usage)
933 theObject published GEOM.GEOM_Object, arguments of which will be published
934 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
935 If this list is empty, all operation arguments will be published
936 theFindMethod method to search sub-shapes, corresponding to arguments and
937 their sub-shapes. Value from enumeration GEOM::find_shape_method.
938 theInheritFirstArg set properties of the first argument for theObject.
939 Do not publish sub-shapes in place of arguments, but only
940 in place of sub-shapes of the first argument,
941 because the whole shape corresponds to the first argument.
942 Mainly to be used after transformations, but it also can be
943 usefull after partition with one object shape, and some other
944 operations, where only the first argument has to be considered.
945 If theObject has only one argument shape, this flag is automatically
946 considered as True, not regarding really passed value.
947 theAddPrefix add prefix "from_" to names of restored sub-shapes,
948 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
951 list of published sub-shapes
953 # Example: see GEOM_TestAll.py
954 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
955 theFindMethod, theInheritFirstArg, theAddPrefix)
957 # end of l3_restore_ss
960 ## @addtogroup l3_basic_go
963 ## Create point by three coordinates.
964 # @param theX The X coordinate of the point.
965 # @param theY The Y coordinate of the point.
966 # @param theZ The Z coordinate of the point.
967 # @param theName Object name; when specified, this parameter is used
968 # for result publication in the study. Otherwise, if automatic
969 # publication is switched on, default value is used for result name.
971 # @return New GEOM.GEOM_Object, containing the created point.
973 # @ref tui_creation_point "Example"
974 def MakeVertex(self, theX, theY, theZ, theName=None):
976 Create point by three coordinates.
979 theX The X coordinate of the point.
980 theY The Y coordinate of the point.
981 theZ The Z coordinate of the point.
982 theName Object name; when specified, this parameter is used
983 for result publication in the study. Otherwise, if automatic
984 publication is switched on, default value is used for result name.
987 New GEOM.GEOM_Object, containing the created point.
989 # Example: see GEOM_TestAll.py
990 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
991 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
992 RaiseIfFailed("MakePointXYZ", self.BasicOp)
993 anObj.SetParameters(Parameters)
994 self._autoPublish(anObj, theName, "vertex")
997 ## Create a point, distant from the referenced point
998 # on the given distances along the coordinate axes.
999 # @param theReference The referenced point.
1000 # @param theX Displacement from the referenced point along OX axis.
1001 # @param theY Displacement from the referenced point along OY axis.
1002 # @param theZ Displacement from the referenced point along OZ axis.
1003 # @param theName Object name; when specified, this parameter is used
1004 # for result publication in the study. Otherwise, if automatic
1005 # publication is switched on, default value is used for result name.
1007 # @return New GEOM.GEOM_Object, containing the created point.
1009 # @ref tui_creation_point "Example"
1010 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1012 Create a point, distant from the referenced point
1013 on the given distances along the coordinate axes.
1016 theReference The referenced point.
1017 theX Displacement from the referenced point along OX axis.
1018 theY Displacement from the referenced point along OY axis.
1019 theZ Displacement from the referenced point along OZ axis.
1020 theName Object name; when specified, this parameter is used
1021 for result publication in the study. Otherwise, if automatic
1022 publication is switched on, default value is used for result name.
1025 New GEOM.GEOM_Object, containing the created point.
1027 # Example: see GEOM_TestAll.py
1028 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1029 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1030 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1031 anObj.SetParameters(Parameters)
1032 self._autoPublish(anObj, theName, "vertex")
1035 ## Create a point, corresponding to the given parameter on the given curve.
1036 # @param theRefCurve The referenced curve.
1037 # @param theParameter Value of parameter on the referenced curve.
1038 # @param theName Object name; when specified, this parameter is used
1039 # for result publication in the study. Otherwise, if automatic
1040 # publication is switched on, default value is used for result name.
1042 # @return New GEOM.GEOM_Object, containing the created point.
1044 # @ref tui_creation_point "Example"
1045 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1047 Create a point, corresponding to the given parameter on the given curve.
1050 theRefCurve The referenced curve.
1051 theParameter Value of parameter on the referenced curve.
1052 theName Object name; when specified, this parameter is used
1053 for result publication in the study. Otherwise, if automatic
1054 publication is switched on, default value is used for result name.
1057 New GEOM.GEOM_Object, containing the created point.
1060 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1062 # Example: see GEOM_TestAll.py
1063 theParameter, Parameters = ParseParameters(theParameter)
1064 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1065 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1066 anObj.SetParameters(Parameters)
1067 self._autoPublish(anObj, theName, "vertex")
1070 ## Create a point by projection give coordinates on the given curve
1071 # @param theRefCurve The referenced curve.
1072 # @param theX X-coordinate in 3D space
1073 # @param theY Y-coordinate in 3D space
1074 # @param theZ Z-coordinate in 3D space
1075 # @param theName Object name; when specified, this parameter is used
1076 # for result publication in the study. Otherwise, if automatic
1077 # publication is switched on, default value is used for result name.
1079 # @return New GEOM.GEOM_Object, containing the created point.
1081 # @ref tui_creation_point "Example"
1082 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1084 Create a point by projection give coordinates on the given curve
1087 theRefCurve The referenced curve.
1088 theX X-coordinate in 3D space
1089 theY Y-coordinate in 3D space
1090 theZ Z-coordinate in 3D space
1091 theName Object name; when specified, this parameter is used
1092 for result publication in the study. Otherwise, if automatic
1093 publication is switched on, default value is used for result name.
1096 New GEOM.GEOM_Object, containing the created point.
1099 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1101 # Example: see GEOM_TestAll.py
1102 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1103 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1104 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1105 anObj.SetParameters(Parameters)
1106 self._autoPublish(anObj, theName, "vertex")
1109 ## Create a point, corresponding to the given length on the given curve.
1110 # @param theRefCurve The referenced curve.
1111 # @param theLength Length on the referenced curve. It can be negative.
1112 # @param theStartPoint Point allowing to choose the direction for the calculation
1113 # of the length. If None, start from the first point of theRefCurve.
1114 # @param theName Object name; when specified, this parameter is used
1115 # for result publication in the study. Otherwise, if automatic
1116 # publication is switched on, default value is used for result name.
1118 # @return New GEOM.GEOM_Object, containing the created point.
1120 # @ref tui_creation_point "Example"
1121 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1123 Create a point, corresponding to the given length on the given curve.
1126 theRefCurve The referenced curve.
1127 theLength Length on the referenced curve. It can be negative.
1128 theStartPoint Point allowing to choose the direction for the calculation
1129 of the length. If None, start from the first point of theRefCurve.
1130 theName Object name; when specified, this parameter is used
1131 for result publication in the study. Otherwise, if automatic
1132 publication is switched on, default value is used for result name.
1135 New GEOM.GEOM_Object, containing the created point.
1137 # Example: see GEOM_TestAll.py
1138 theLength, Parameters = ParseParameters(theLength)
1139 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1140 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1141 anObj.SetParameters(Parameters)
1142 self._autoPublish(anObj, theName, "vertex")
1145 ## Create a point, corresponding to the given parameters on the
1147 # @param theRefSurf The referenced surface.
1148 # @param theUParameter Value of U-parameter on the referenced surface.
1149 # @param theVParameter Value of V-parameter on the referenced surface.
1150 # @param theName Object name; when specified, this parameter is used
1151 # for result publication in the study. Otherwise, if automatic
1152 # publication is switched on, default value is used for result name.
1154 # @return New GEOM.GEOM_Object, containing the created point.
1156 # @ref swig_MakeVertexOnSurface "Example"
1157 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1159 Create a point, corresponding to the given parameters on the
1163 theRefSurf The referenced surface.
1164 theUParameter Value of U-parameter on the referenced surface.
1165 theVParameter Value of V-parameter on the referenced surface.
1166 theName Object name; when specified, this parameter is used
1167 for result publication in the study. Otherwise, if automatic
1168 publication is switched on, default value is used for result name.
1171 New GEOM.GEOM_Object, containing the created point.
1174 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1176 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1177 # Example: see GEOM_TestAll.py
1178 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1179 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1180 anObj.SetParameters(Parameters);
1181 self._autoPublish(anObj, theName, "vertex")
1184 ## Create a point by projection give coordinates on the given surface
1185 # @param theRefSurf The referenced surface.
1186 # @param theX X-coordinate in 3D space
1187 # @param theY Y-coordinate in 3D space
1188 # @param theZ Z-coordinate in 3D space
1189 # @param theName Object name; when specified, this parameter is used
1190 # for result publication in the study. Otherwise, if automatic
1191 # publication is switched on, default value is used for result name.
1193 # @return New GEOM.GEOM_Object, containing the created point.
1195 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1196 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1198 Create a point by projection give coordinates on the given surface
1201 theRefSurf The referenced surface.
1202 theX X-coordinate in 3D space
1203 theY Y-coordinate in 3D space
1204 theZ Z-coordinate in 3D space
1205 theName Object name; when specified, this parameter is used
1206 for result publication in the study. Otherwise, if automatic
1207 publication is switched on, default value is used for result name.
1210 New GEOM.GEOM_Object, containing the created point.
1213 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1215 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1216 # Example: see GEOM_TestAll.py
1217 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1218 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1219 anObj.SetParameters(Parameters);
1220 self._autoPublish(anObj, theName, "vertex")
1223 ## Create a point, which lays on the given face.
1224 # The point will lay in arbitrary place of the face.
1225 # The only condition on it is a non-zero distance to the face boundary.
1226 # Such point can be used to uniquely identify the face inside any
1227 # shape in case, when the shape does not contain overlapped faces.
1228 # @param theFace The referenced face.
1229 # @param theName Object name; when specified, this parameter is used
1230 # for result publication in the study. Otherwise, if automatic
1231 # publication is switched on, default value is used for result name.
1233 # @return New GEOM.GEOM_Object, containing the created point.
1235 # @ref swig_MakeVertexInsideFace "Example"
1236 def MakeVertexInsideFace (self, theFace, theName=None):
1238 Create a point, which lays on the given face.
1239 The point will lay in arbitrary place of the face.
1240 The only condition on it is a non-zero distance to the face boundary.
1241 Such point can be used to uniquely identify the face inside any
1242 shape in case, when the shape does not contain overlapped faces.
1245 theFace The referenced face.
1246 theName Object name; when specified, this parameter is used
1247 for result publication in the study. Otherwise, if automatic
1248 publication is switched on, default value is used for result name.
1251 New GEOM.GEOM_Object, containing the created point.
1254 p_on_face = geompy.MakeVertexInsideFace(Face)
1256 # Example: see GEOM_TestAll.py
1257 anObj = self.BasicOp.MakePointOnFace(theFace)
1258 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1259 self._autoPublish(anObj, theName, "vertex")
1262 ## Create a point on intersection of two lines.
1263 # @param theRefLine1, theRefLine2 The referenced lines.
1264 # @param theName Object name; when specified, this parameter is used
1265 # for result publication in the study. Otherwise, if automatic
1266 # publication is switched on, default value is used for result name.
1268 # @return New GEOM.GEOM_Object, containing the created point.
1270 # @ref swig_MakeVertexOnLinesIntersection "Example"
1271 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1273 Create a point on intersection of two lines.
1276 theRefLine1, theRefLine2 The referenced lines.
1277 theName Object name; when specified, this parameter is used
1278 for result publication in the study. Otherwise, if automatic
1279 publication is switched on, default value is used for result name.
1282 New GEOM.GEOM_Object, containing the created point.
1284 # Example: see GEOM_TestAll.py
1285 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1286 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1287 self._autoPublish(anObj, theName, "vertex")
1290 ## Create a tangent, corresponding to the given parameter on the given curve.
1291 # @param theRefCurve The referenced curve.
1292 # @param theParameter Value of parameter on the referenced curve.
1293 # @param theName Object name; when specified, this parameter is used
1294 # for result publication in the study. Otherwise, if automatic
1295 # publication is switched on, default value is used for result name.
1297 # @return New GEOM.GEOM_Object, containing the created tangent.
1299 # @ref swig_MakeTangentOnCurve "Example"
1300 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1302 Create a tangent, corresponding to the given parameter on the given curve.
1305 theRefCurve The referenced curve.
1306 theParameter Value of parameter on the referenced curve.
1307 theName Object name; when specified, this parameter is used
1308 for result publication in the study. Otherwise, if automatic
1309 publication is switched on, default value is used for result name.
1312 New GEOM.GEOM_Object, containing the created tangent.
1315 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1317 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1318 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1319 self._autoPublish(anObj, theName, "tangent")
1322 ## Create a tangent plane, corresponding to the given parameter on the given face.
1323 # @param theFace The face for which tangent plane should be built.
1324 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1325 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1326 # @param theTrimSize the size of plane.
1327 # @param theName Object name; when specified, this parameter is used
1328 # for result publication in the study. Otherwise, if automatic
1329 # publication is switched on, default value is used for result name.
1331 # @return New GEOM.GEOM_Object, containing the created tangent.
1333 # @ref swig_MakeTangentPlaneOnFace "Example"
1334 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1336 Create a tangent plane, corresponding to the given parameter on the given face.
1339 theFace The face for which tangent plane should be built.
1340 theParameterV vertical value of the center point (0.0 - 1.0).
1341 theParameterU horisontal value of the center point (0.0 - 1.0).
1342 theTrimSize the size of plane.
1343 theName Object name; when specified, this parameter is used
1344 for result publication in the study. Otherwise, if automatic
1345 publication is switched on, default value is used for result name.
1348 New GEOM.GEOM_Object, containing the created tangent.
1351 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1353 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1354 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1355 self._autoPublish(anObj, theName, "tangent")
1358 ## Create a vector with the given components.
1359 # @param theDX X component of the vector.
1360 # @param theDY Y component of the vector.
1361 # @param theDZ Z component of the vector.
1362 # @param theName Object name; when specified, this parameter is used
1363 # for result publication in the study. Otherwise, if automatic
1364 # publication is switched on, default value is used for result name.
1366 # @return New GEOM.GEOM_Object, containing the created vector.
1368 # @ref tui_creation_vector "Example"
1369 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1371 Create a vector with the given components.
1374 theDX X component of the vector.
1375 theDY Y component of the vector.
1376 theDZ Z component of the vector.
1377 theName Object name; when specified, this parameter is used
1378 for result publication in the study. Otherwise, if automatic
1379 publication is switched on, default value is used for result name.
1382 New GEOM.GEOM_Object, containing the created vector.
1384 # Example: see GEOM_TestAll.py
1385 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1386 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1387 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1388 anObj.SetParameters(Parameters)
1389 self._autoPublish(anObj, theName, "vector")
1392 ## Create a vector between two points.
1393 # @param thePnt1 Start point for the vector.
1394 # @param thePnt2 End point for the vector.
1395 # @param theName Object name; when specified, this parameter is used
1396 # for result publication in the study. Otherwise, if automatic
1397 # publication is switched on, default value is used for result name.
1399 # @return New GEOM.GEOM_Object, containing the created vector.
1401 # @ref tui_creation_vector "Example"
1402 def MakeVector(self, thePnt1, thePnt2, theName=None):
1404 Create a vector between two points.
1407 thePnt1 Start point for the vector.
1408 thePnt2 End point for the vector.
1409 theName Object name; when specified, this parameter is used
1410 for result publication in the study. Otherwise, if automatic
1411 publication is switched on, default value is used for result name.
1414 New GEOM.GEOM_Object, containing the created vector.
1416 # Example: see GEOM_TestAll.py
1417 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1418 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1419 self._autoPublish(anObj, theName, "vector")
1422 ## Create a line, passing through the given point
1423 # and parrallel to the given direction
1424 # @param thePnt Point. The resulting line will pass through it.
1425 # @param theDir Direction. The resulting line will be parallel to it.
1426 # @param theName Object name; when specified, this parameter is used
1427 # for result publication in the study. Otherwise, if automatic
1428 # publication is switched on, default value is used for result name.
1430 # @return New GEOM.GEOM_Object, containing the created line.
1432 # @ref tui_creation_line "Example"
1433 def MakeLine(self, thePnt, theDir, theName=None):
1435 Create a line, passing through the given point
1436 and parrallel to the given direction
1439 thePnt Point. The resulting line will pass through it.
1440 theDir Direction. The resulting line will be parallel to it.
1441 theName Object name; when specified, this parameter is used
1442 for result publication in the study. Otherwise, if automatic
1443 publication is switched on, default value is used for result name.
1446 New GEOM.GEOM_Object, containing the created line.
1448 # Example: see GEOM_TestAll.py
1449 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1450 RaiseIfFailed("MakeLine", self.BasicOp)
1451 self._autoPublish(anObj, theName, "line")
1454 ## Create a line, passing through the given points
1455 # @param thePnt1 First of two points, defining the line.
1456 # @param thePnt2 Second of two points, defining the line.
1457 # @param theName Object name; when specified, this parameter is used
1458 # for result publication in the study. Otherwise, if automatic
1459 # publication is switched on, default value is used for result name.
1461 # @return New GEOM.GEOM_Object, containing the created line.
1463 # @ref tui_creation_line "Example"
1464 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1466 Create a line, passing through the given points
1469 thePnt1 First of two points, defining the line.
1470 thePnt2 Second of two points, defining the line.
1471 theName Object name; when specified, this parameter is used
1472 for result publication in the study. Otherwise, if automatic
1473 publication is switched on, default value is used for result name.
1476 New GEOM.GEOM_Object, containing the created line.
1478 # Example: see GEOM_TestAll.py
1479 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1480 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1481 self._autoPublish(anObj, theName, "line")
1484 ## Create a line on two faces intersection.
1485 # @param theFace1 First of two faces, defining the line.
1486 # @param theFace2 Second of two faces, defining the line.
1487 # @param theName Object name; when specified, this parameter is used
1488 # for result publication in the study. Otherwise, if automatic
1489 # publication is switched on, default value is used for result name.
1491 # @return New GEOM.GEOM_Object, containing the created line.
1493 # @ref swig_MakeLineTwoFaces "Example"
1494 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1496 Create a line on two faces intersection.
1499 theFace1 First of two faces, defining the line.
1500 theFace2 Second of two faces, defining the line.
1501 theName Object name; when specified, this parameter is used
1502 for result publication in the study. Otherwise, if automatic
1503 publication is switched on, default value is used for result name.
1506 New GEOM.GEOM_Object, containing the created line.
1508 # Example: see GEOM_TestAll.py
1509 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1510 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1511 self._autoPublish(anObj, theName, "line")
1514 ## Create a plane, passing through the given point
1515 # and normal to the given vector.
1516 # @param thePnt Point, the plane has to pass through.
1517 # @param theVec Vector, defining the plane normal direction.
1518 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1519 # @param theName Object name; when specified, this parameter is used
1520 # for result publication in the study. Otherwise, if automatic
1521 # publication is switched on, default value is used for result name.
1523 # @return New GEOM.GEOM_Object, containing the created plane.
1525 # @ref tui_creation_plane "Example"
1526 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1528 Create a plane, passing through the given point
1529 and normal to the given vector.
1532 thePnt Point, the plane has to pass through.
1533 theVec Vector, defining the plane normal direction.
1534 theTrimSize Half size of a side of quadrangle face, representing the plane.
1535 theName Object name; when specified, this parameter is used
1536 for result publication in the study. Otherwise, if automatic
1537 publication is switched on, default value is used for result name.
1540 New GEOM.GEOM_Object, containing the created plane.
1542 # Example: see GEOM_TestAll.py
1543 theTrimSize, Parameters = ParseParameters(theTrimSize);
1544 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1545 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1546 anObj.SetParameters(Parameters)
1547 self._autoPublish(anObj, theName, "plane")
1550 ## Create a plane, passing through the three given points
1551 # @param thePnt1 First of three points, defining the plane.
1552 # @param thePnt2 Second of three points, defining the plane.
1553 # @param thePnt3 Fird of three points, defining the plane.
1554 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1555 # @param theName Object name; when specified, this parameter is used
1556 # for result publication in the study. Otherwise, if automatic
1557 # publication is switched on, default value is used for result name.
1559 # @return New GEOM.GEOM_Object, containing the created plane.
1561 # @ref tui_creation_plane "Example"
1562 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1564 Create a plane, passing through the three given points
1567 thePnt1 First of three points, defining the plane.
1568 thePnt2 Second of three points, defining the plane.
1569 thePnt3 Fird of three points, defining the plane.
1570 theTrimSize Half size of a side of quadrangle face, representing the plane.
1571 theName Object name; when specified, this parameter is used
1572 for result publication in the study. Otherwise, if automatic
1573 publication is switched on, default value is used for result name.
1576 New GEOM.GEOM_Object, containing the created plane.
1578 # Example: see GEOM_TestAll.py
1579 theTrimSize, Parameters = ParseParameters(theTrimSize);
1580 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1581 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1582 anObj.SetParameters(Parameters)
1583 self._autoPublish(anObj, theName, "plane")
1586 ## Create a plane, similar to the existing one, but with another size of representing face.
1587 # @param theFace Referenced plane or LCS(Marker).
1588 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1589 # @param theName Object name; when specified, this parameter is used
1590 # for result publication in the study. Otherwise, if automatic
1591 # publication is switched on, default value is used for result name.
1593 # @return New GEOM.GEOM_Object, containing the created plane.
1595 # @ref tui_creation_plane "Example"
1596 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1598 Create a plane, similar to the existing one, but with another size of representing face.
1601 theFace Referenced plane or LCS(Marker).
1602 theTrimSize New half size of a side of quadrangle face, representing the plane.
1603 theName Object name; when specified, this parameter is used
1604 for result publication in the study. Otherwise, if automatic
1605 publication is switched on, default value is used for result name.
1608 New GEOM.GEOM_Object, containing the created plane.
1610 # Example: see GEOM_TestAll.py
1611 theTrimSize, Parameters = ParseParameters(theTrimSize);
1612 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1613 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1614 anObj.SetParameters(Parameters)
1615 self._autoPublish(anObj, theName, "plane")
1618 ## Create a plane, passing through the 2 vectors
1619 # with center in a start point of the first vector.
1620 # @param theVec1 Vector, defining center point and plane direction.
1621 # @param theVec2 Vector, defining the plane normal direction.
1622 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1623 # @param theName Object name; when specified, this parameter is used
1624 # for result publication in the study. Otherwise, if automatic
1625 # publication is switched on, default value is used for result name.
1627 # @return New GEOM.GEOM_Object, containing the created plane.
1629 # @ref tui_creation_plane "Example"
1630 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1632 Create a plane, passing through the 2 vectors
1633 with center in a start point of the first vector.
1636 theVec1 Vector, defining center point and plane direction.
1637 theVec2 Vector, defining the plane normal direction.
1638 theTrimSize Half size of a side of quadrangle face, representing the plane.
1639 theName Object name; when specified, this parameter is used
1640 for result publication in the study. Otherwise, if automatic
1641 publication is switched on, default value is used for result name.
1644 New GEOM.GEOM_Object, containing the created plane.
1646 # Example: see GEOM_TestAll.py
1647 theTrimSize, Parameters = ParseParameters(theTrimSize);
1648 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1649 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1650 anObj.SetParameters(Parameters)
1651 self._autoPublish(anObj, theName, "plane")
1654 ## Create a plane, based on a Local coordinate system.
1655 # @param theLCS coordinate system, defining plane.
1656 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1657 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1658 # @param theName Object name; when specified, this parameter is used
1659 # for result publication in the study. Otherwise, if automatic
1660 # publication is switched on, default value is used for result name.
1662 # @return New GEOM.GEOM_Object, containing the created plane.
1664 # @ref tui_creation_plane "Example"
1665 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1667 Create a plane, based on a Local coordinate system.
1670 theLCS coordinate system, defining plane.
1671 theTrimSize Half size of a side of quadrangle face, representing the plane.
1672 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1673 theName Object name; when specified, this parameter is used
1674 for result publication in the study. Otherwise, if automatic
1675 publication is switched on, default value is used for result name.
1678 New GEOM.GEOM_Object, containing the created plane.
1680 # Example: see GEOM_TestAll.py
1681 theTrimSize, Parameters = ParseParameters(theTrimSize);
1682 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1683 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1684 anObj.SetParameters(Parameters)
1685 self._autoPublish(anObj, theName, "plane")
1688 ## Create a local coordinate system.
1689 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1690 # @param XDX,XDY,XDZ Three components of OX direction
1691 # @param YDX,YDY,YDZ Three components of OY direction
1692 # @param theName Object name; when specified, this parameter is used
1693 # for result publication in the study. Otherwise, if automatic
1694 # publication is switched on, default value is used for result name.
1696 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1698 # @ref swig_MakeMarker "Example"
1699 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1701 Create a local coordinate system.
1704 OX,OY,OZ Three coordinates of coordinate system origin.
1705 XDX,XDY,XDZ Three components of OX direction
1706 YDX,YDY,YDZ Three components of OY direction
1707 theName Object name; when specified, this parameter is used
1708 for result publication in the study. Otherwise, if automatic
1709 publication is switched on, default value is used for result name.
1712 New GEOM.GEOM_Object, containing the created coordinate system.
1714 # Example: see GEOM_TestAll.py
1715 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1716 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1717 RaiseIfFailed("MakeMarker", self.BasicOp)
1718 anObj.SetParameters(Parameters)
1719 self._autoPublish(anObj, theName, "lcs")
1722 ## Create a local coordinate system from shape.
1723 # @param theShape The initial shape to detect the coordinate system.
1724 # @param theName Object name; when specified, this parameter is used
1725 # for result publication in the study. Otherwise, if automatic
1726 # publication is switched on, default value is used for result name.
1728 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1730 # @ref tui_creation_lcs "Example"
1731 def MakeMarkerFromShape(self, theShape, theName=None):
1733 Create a local coordinate system from shape.
1736 theShape The initial shape to detect the coordinate system.
1737 theName Object name; when specified, this parameter is used
1738 for result publication in the study. Otherwise, if automatic
1739 publication is switched on, default value is used for result name.
1742 New GEOM.GEOM_Object, containing the created coordinate system.
1744 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1745 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1746 self._autoPublish(anObj, theName, "lcs")
1749 ## Create a local coordinate system from point and two vectors.
1750 # @param theOrigin Point of coordinate system origin.
1751 # @param theXVec Vector of X direction
1752 # @param theYVec Vector of Y direction
1753 # @param theName Object name; when specified, this parameter is used
1754 # for result publication in the study. Otherwise, if automatic
1755 # publication is switched on, default value is used for result name.
1757 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1759 # @ref tui_creation_lcs "Example"
1760 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1762 Create a local coordinate system from point and two vectors.
1765 theOrigin Point of coordinate system origin.
1766 theXVec Vector of X direction
1767 theYVec Vector of Y direction
1768 theName Object name; when specified, this parameter is used
1769 for result publication in the study. Otherwise, if automatic
1770 publication is switched on, default value is used for result name.
1773 New GEOM.GEOM_Object, containing the created coordinate system.
1776 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1777 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1778 self._autoPublish(anObj, theName, "lcs")
1781 # end of l3_basic_go
1784 ## @addtogroup l4_curves
1787 ## Create an arc of circle, passing through three given points.
1788 # @param thePnt1 Start point of the arc.
1789 # @param thePnt2 Middle point of the arc.
1790 # @param thePnt3 End point of the arc.
1791 # @param theName Object name; when specified, this parameter is used
1792 # for result publication in the study. Otherwise, if automatic
1793 # publication is switched on, default value is used for result name.
1795 # @return New GEOM.GEOM_Object, containing the created arc.
1797 # @ref swig_MakeArc "Example"
1798 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1800 Create an arc of circle, passing through three given points.
1803 thePnt1 Start point of the arc.
1804 thePnt2 Middle point of the arc.
1805 thePnt3 End point of the arc.
1806 theName Object name; when specified, this parameter is used
1807 for result publication in the study. Otherwise, if automatic
1808 publication is switched on, default value is used for result name.
1811 New GEOM.GEOM_Object, containing the created arc.
1813 # Example: see GEOM_TestAll.py
1814 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1815 RaiseIfFailed("MakeArc", self.CurvesOp)
1816 self._autoPublish(anObj, theName, "arc")
1819 ## Create an arc of circle from a center and 2 points.
1820 # @param thePnt1 Center of the arc
1821 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1822 # @param thePnt3 End point of the arc (Gives also a direction)
1823 # @param theSense Orientation of the arc
1824 # @param theName Object name; when specified, this parameter is used
1825 # for result publication in the study. Otherwise, if automatic
1826 # publication is switched on, default value is used for result name.
1828 # @return New GEOM.GEOM_Object, containing the created arc.
1830 # @ref swig_MakeArc "Example"
1831 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1833 Create an arc of circle from a center and 2 points.
1836 thePnt1 Center of the arc
1837 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1838 thePnt3 End point of the arc (Gives also a direction)
1839 theSense Orientation of the arc
1840 theName Object name; when specified, this parameter is used
1841 for result publication in the study. Otherwise, if automatic
1842 publication is switched on, default value is used for result name.
1845 New GEOM.GEOM_Object, containing the created arc.
1847 # Example: see GEOM_TestAll.py
1848 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1849 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1850 self._autoPublish(anObj, theName, "arc")
1853 ## Create an arc of ellipse, of center and two points.
1854 # @param theCenter Center of the arc.
1855 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1856 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1857 # @param theName Object name; when specified, this parameter is used
1858 # for result publication in the study. Otherwise, if automatic
1859 # publication is switched on, default value is used for result name.
1861 # @return New GEOM.GEOM_Object, containing the created arc.
1863 # @ref swig_MakeArc "Example"
1864 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1866 Create an arc of ellipse, of center and two points.
1869 theCenter Center of the arc.
1870 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1871 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1872 theName Object name; when specified, this parameter is used
1873 for result publication in the study. Otherwise, if automatic
1874 publication is switched on, default value is used for result name.
1877 New GEOM.GEOM_Object, containing the created arc.
1879 # Example: see GEOM_TestAll.py
1880 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1881 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1882 self._autoPublish(anObj, theName, "arc")
1885 ## Create a circle with given center, normal vector and radius.
1886 # @param thePnt Circle center.
1887 # @param theVec Vector, normal to the plane of the circle.
1888 # @param theR Circle radius.
1889 # @param theName Object name; when specified, this parameter is used
1890 # for result publication in the study. Otherwise, if automatic
1891 # publication is switched on, default value is used for result name.
1893 # @return New GEOM.GEOM_Object, containing the created circle.
1895 # @ref tui_creation_circle "Example"
1896 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1898 Create a circle with given center, normal vector and radius.
1901 thePnt Circle center.
1902 theVec Vector, normal to the plane of the circle.
1904 theName Object name; when specified, this parameter is used
1905 for result publication in the study. Otherwise, if automatic
1906 publication is switched on, default value is used for result name.
1909 New GEOM.GEOM_Object, containing the created circle.
1911 # Example: see GEOM_TestAll.py
1912 theR, Parameters = ParseParameters(theR)
1913 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1914 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1915 anObj.SetParameters(Parameters)
1916 self._autoPublish(anObj, theName, "circle")
1919 ## Create a circle with given radius.
1920 # Center of the circle will be in the origin of global
1921 # coordinate system and normal vector will be codirected with Z axis
1922 # @param theR Circle radius.
1923 # @param theName Object name; when specified, this parameter is used
1924 # for result publication in the study. Otherwise, if automatic
1925 # publication is switched on, default value is used for result name.
1927 # @return New GEOM.GEOM_Object, containing the created circle.
1928 def MakeCircleR(self, theR, theName=None):
1930 Create a circle with given radius.
1931 Center of the circle will be in the origin of global
1932 coordinate system and normal vector will be codirected with Z axis
1936 theName Object name; when specified, this parameter is used
1937 for result publication in the study. Otherwise, if automatic
1938 publication is switched on, default value is used for result name.
1941 New GEOM.GEOM_Object, containing the created circle.
1943 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1944 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1945 self._autoPublish(anObj, theName, "circle")
1948 ## Create a circle, passing through three given points
1949 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1950 # @param theName Object name; when specified, this parameter is used
1951 # for result publication in the study. Otherwise, if automatic
1952 # publication is switched on, default value is used for result name.
1954 # @return New GEOM.GEOM_Object, containing the created circle.
1956 # @ref tui_creation_circle "Example"
1957 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1959 Create a circle, passing through three given points
1962 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1963 theName Object name; when specified, this parameter is used
1964 for result publication in the study. Otherwise, if automatic
1965 publication is switched on, default value is used for result name.
1968 New GEOM.GEOM_Object, containing the created circle.
1970 # Example: see GEOM_TestAll.py
1971 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1972 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1973 self._autoPublish(anObj, theName, "circle")
1976 ## Create a circle, with given point1 as center,
1977 # passing through the point2 as radius and laying in the plane,
1978 # defined by all three given points.
1979 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1980 # @param theName Object name; when specified, this parameter is used
1981 # for result publication in the study. Otherwise, if automatic
1982 # publication is switched on, default value is used for result name.
1984 # @return New GEOM.GEOM_Object, containing the created circle.
1986 # @ref swig_MakeCircle "Example"
1987 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1989 Create a circle, with given point1 as center,
1990 passing through the point2 as radius and laying in the plane,
1991 defined by all three given points.
1994 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1995 theName Object name; when specified, this parameter is used
1996 for result publication in the study. Otherwise, if automatic
1997 publication is switched on, default value is used for result name.
2000 New GEOM.GEOM_Object, containing the created circle.
2002 # Example: see GEOM_example6.py
2003 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2004 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2005 self._autoPublish(anObj, theName, "circle")
2008 ## Create an ellipse with given center, normal vector and radiuses.
2009 # @param thePnt Ellipse center.
2010 # @param theVec Vector, normal to the plane of the ellipse.
2011 # @param theRMajor Major ellipse radius.
2012 # @param theRMinor Minor ellipse radius.
2013 # @param theVecMaj Vector, direction of the ellipse's main axis.
2014 # @param theName Object name; when specified, this parameter is used
2015 # for result publication in the study. Otherwise, if automatic
2016 # publication is switched on, default value is used for result name.
2018 # @return New GEOM.GEOM_Object, containing the created ellipse.
2020 # @ref tui_creation_ellipse "Example"
2021 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2023 Create an ellipse with given center, normal vector and radiuses.
2026 thePnt Ellipse center.
2027 theVec Vector, normal to the plane of the ellipse.
2028 theRMajor Major ellipse radius.
2029 theRMinor Minor ellipse radius.
2030 theVecMaj Vector, direction of the ellipse's main axis.
2031 theName Object name; when specified, this parameter is used
2032 for result publication in the study. Otherwise, if automatic
2033 publication is switched on, default value is used for result name.
2036 New GEOM.GEOM_Object, containing the created ellipse.
2038 # Example: see GEOM_TestAll.py
2039 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2040 if theVecMaj is not None:
2041 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2043 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2045 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2046 anObj.SetParameters(Parameters)
2047 self._autoPublish(anObj, theName, "ellipse")
2050 ## Create an ellipse with given radiuses.
2051 # Center of the ellipse will be in the origin of global
2052 # coordinate system and normal vector will be codirected with Z axis
2053 # @param theRMajor Major ellipse radius.
2054 # @param theRMinor Minor ellipse radius.
2055 # @param theName Object name; when specified, this parameter is used
2056 # for result publication in the study. Otherwise, if automatic
2057 # publication is switched on, default value is used for result name.
2059 # @return New GEOM.GEOM_Object, containing the created ellipse.
2060 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2062 Create an ellipse with given radiuses.
2063 Center of the ellipse will be in the origin of global
2064 coordinate system and normal vector will be codirected with Z axis
2067 theRMajor Major ellipse radius.
2068 theRMinor Minor ellipse radius.
2069 theName Object name; when specified, this parameter is used
2070 for result publication in the study. Otherwise, if automatic
2071 publication is switched on, default value is used for result name.
2074 New GEOM.GEOM_Object, containing the created ellipse.
2076 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2077 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2078 self._autoPublish(anObj, theName, "ellipse")
2081 ## Create a polyline on the set of points.
2082 # @param thePoints Sequence of points for the polyline.
2083 # @param theIsClosed If True, build a closed wire.
2084 # @param theName Object name; when specified, this parameter is used
2085 # for result publication in the study. Otherwise, if automatic
2086 # publication is switched on, default value is used for result name.
2088 # @return New GEOM.GEOM_Object, containing the created polyline.
2090 # @ref tui_creation_curve "Example"
2091 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2093 Create a polyline on the set of points.
2096 thePoints Sequence of points for the polyline.
2097 theIsClosed If True, build a closed wire.
2098 theName Object name; when specified, this parameter is used
2099 for result publication in the study. Otherwise, if automatic
2100 publication is switched on, default value is used for result name.
2103 New GEOM.GEOM_Object, containing the created polyline.
2105 # Example: see GEOM_TestAll.py
2106 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2107 RaiseIfFailed("MakePolyline", self.CurvesOp)
2108 self._autoPublish(anObj, theName, "polyline")
2111 ## Create bezier curve on the set of points.
2112 # @param thePoints Sequence of points for the bezier curve.
2113 # @param theIsClosed If True, build a closed curve.
2114 # @param theName Object name; when specified, this parameter is used
2115 # for result publication in the study. Otherwise, if automatic
2116 # publication is switched on, default value is used for result name.
2118 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2120 # @ref tui_creation_curve "Example"
2121 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2123 Create bezier curve on the set of points.
2126 thePoints Sequence of points for the bezier curve.
2127 theIsClosed If True, build a closed curve.
2128 theName Object name; when specified, this parameter is used
2129 for result publication in the study. Otherwise, if automatic
2130 publication is switched on, default value is used for result name.
2133 New GEOM.GEOM_Object, containing the created bezier curve.
2135 # Example: see GEOM_TestAll.py
2136 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2137 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2138 self._autoPublish(anObj, theName, "bezier")
2141 ## Create B-Spline curve on the set of points.
2142 # @param thePoints Sequence of points for the B-Spline curve.
2143 # @param theIsClosed If True, build a closed curve.
2144 # @param theDoReordering If TRUE, the algo does not follow the order of
2145 # \a thePoints but searches for the closest vertex.
2146 # @param theName Object name; when specified, this parameter is used
2147 # for result publication in the study. Otherwise, if automatic
2148 # publication is switched on, default value is used for result name.
2150 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2152 # @ref tui_creation_curve "Example"
2153 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2155 Create B-Spline curve on the set of points.
2158 thePoints Sequence of points for the B-Spline curve.
2159 theIsClosed If True, build a closed curve.
2160 theDoReordering If True, the algo does not follow the order of
2161 thePoints but searches for the closest vertex.
2162 theName Object name; when specified, this parameter is used
2163 for result publication in the study. Otherwise, if automatic
2164 publication is switched on, default value is used for result name.
2167 New GEOM.GEOM_Object, containing the created B-Spline curve.
2169 # Example: see GEOM_TestAll.py
2170 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2171 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2172 self._autoPublish(anObj, theName, "bspline")
2175 ## Create B-Spline curve on the set of points.
2176 # @param thePoints Sequence of points for the B-Spline curve.
2177 # @param theFirstVec Vector object, defining the curve direction at its first point.
2178 # @param theLastVec Vector object, defining the curve direction at its last point.
2179 # @param theName Object name; when specified, this parameter is used
2180 # for result publication in the study. Otherwise, if automatic
2181 # publication is switched on, default value is used for result name.
2183 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2185 # @ref tui_creation_curve "Example"
2186 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2188 Create B-Spline curve on the set of points.
2191 thePoints Sequence of points for the B-Spline curve.
2192 theFirstVec Vector object, defining the curve direction at its first point.
2193 theLastVec Vector object, defining the curve direction at its last point.
2194 theName Object name; when specified, this parameter is used
2195 for result publication in the study. Otherwise, if automatic
2196 publication is switched on, default value is used for result name.
2199 New GEOM.GEOM_Object, containing the created B-Spline curve.
2201 # Example: see GEOM_TestAll.py
2202 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2203 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2204 self._autoPublish(anObj, theName, "bspline")
2207 ## Creates a curve using the parametric definition of the basic points.
2208 # @param thexExpr parametric equation of the coordinates X.
2209 # @param theyExpr parametric equation of the coordinates Y.
2210 # @param thezExpr parametric equation of the coordinates Z.
2211 # @param theParamMin the minimal value of the parameter.
2212 # @param theParamMax the maximum value of the parameter.
2213 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2214 # @param theCurveType the type of the curve.
2215 # @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.
2216 # @param theName Object name; when specified, this parameter is used
2217 # for result publication in the study. Otherwise, if automatic
2218 # publication is switched on, default value is used for result name.
2220 # @return New GEOM.GEOM_Object, containing the created curve.
2222 # @ref tui_creation_curve "Example"
2223 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2224 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2226 Creates a curve using the parametric definition of the basic points.
2229 thexExpr parametric equation of the coordinates X.
2230 theyExpr parametric equation of the coordinates Y.
2231 thezExpr parametric equation of the coordinates Z.
2232 theParamMin the minimal value of the parameter.
2233 theParamMax the maximum value of the parameter.
2234 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2235 theCurveType the type of the curve.
2236 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2237 method is used which can lead to a bug.
2238 theName Object name; when specified, this parameter is used
2239 for result publication in the study. Otherwise, if automatic
2240 publication is switched on, default value is used for result name.
2243 New GEOM.GEOM_Object, containing the created curve.
2245 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2247 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2249 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2250 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2251 anObj.SetParameters(Parameters)
2252 self._autoPublish(anObj, theName, "curve")
2258 ## @addtogroup l3_sketcher
2261 ## Create a sketcher (wire or face), following the textual description,
2262 # passed through <VAR>theCommand</VAR> argument. \n
2263 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2264 # Format of the description string have to be the following:
2266 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2269 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2271 # - "R angle" : Set the direction by angle
2272 # - "D dx dy" : Set the direction by DX & DY
2275 # - "TT x y" : Create segment by point at X & Y
2276 # - "T dx dy" : Create segment by point with DX & DY
2277 # - "L length" : Create segment by direction & Length
2278 # - "IX x" : Create segment by direction & Intersect. X
2279 # - "IY y" : Create segment by direction & Intersect. Y
2282 # - "C radius length" : Create arc by direction, radius and length(in degree)
2283 # - "AA x y": Create arc by point at X & Y
2284 # - "A dx dy" : Create arc by point with DX & DY
2285 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2286 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2287 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2288 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2291 # - "WW" : Close Wire (to finish)
2292 # - "WF" : Close Wire and build face (to finish)
2295 # - Flag1 (= reverse) is 0 or 2 ...
2296 # - if 0 the drawn arc is the one of lower angle (< Pi)
2297 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2300 # - Flag2 (= control tolerance) is 0 or 1 ...
2301 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2302 # - if 1 the wire is built only if the end point is on the arc
2303 # with a tolerance of 10^-7 on the distance else the creation fails
2305 # @param theCommand String, defining the sketcher in local
2306 # coordinates of the working plane.
2307 # @param theWorkingPlane Nine double values, defining origin,
2308 # OZ and OX directions of the working plane.
2309 # @param theName Object name; when specified, this parameter is used
2310 # for result publication in the study. Otherwise, if automatic
2311 # publication is switched on, default value is used for result name.
2313 # @return New GEOM.GEOM_Object, containing the created wire.
2315 # @ref tui_sketcher_page "Example"
2316 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2318 Create a sketcher (wire or face), following the textual description, passed
2319 through theCommand argument.
2320 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2321 Format of the description string have to be the following:
2322 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2324 - x1, y1 are coordinates of the first sketcher point (zero by default),
2326 - "R angle" : Set the direction by angle
2327 - "D dx dy" : Set the direction by DX & DY
2329 - "TT x y" : Create segment by point at X & Y
2330 - "T dx dy" : Create segment by point with DX & DY
2331 - "L length" : Create segment by direction & Length
2332 - "IX x" : Create segment by direction & Intersect. X
2333 - "IY y" : Create segment by direction & Intersect. Y
2335 - "C radius length" : Create arc by direction, radius and length(in degree)
2336 - "AA x y": Create arc by point at X & Y
2337 - "A dx dy" : Create arc by point with DX & DY
2338 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2339 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2340 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2341 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2343 - "WW" : Close Wire (to finish)
2344 - "WF" : Close Wire and build face (to finish)
2346 - Flag1 (= reverse) is 0 or 2 ...
2347 - if 0 the drawn arc is the one of lower angle (< Pi)
2348 - if 2 the drawn arc ius the one of greater angle (> Pi)
2350 - Flag2 (= control tolerance) is 0 or 1 ...
2351 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2352 - if 1 the wire is built only if the end point is on the arc
2353 with a tolerance of 10^-7 on the distance else the creation fails
2356 theCommand String, defining the sketcher in local
2357 coordinates of the working plane.
2358 theWorkingPlane Nine double values, defining origin,
2359 OZ and OX directions of the working plane.
2360 theName Object name; when specified, this parameter is used
2361 for result publication in the study. Otherwise, if automatic
2362 publication is switched on, default value is used for result name.
2365 New GEOM.GEOM_Object, containing the created wire.
2367 # Example: see GEOM_TestAll.py
2368 theCommand,Parameters = ParseSketcherCommand(theCommand)
2369 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2370 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2371 anObj.SetParameters(Parameters)
2372 self._autoPublish(anObj, theName, "wire")
2375 ## Create a sketcher (wire or face), following the textual description,
2376 # passed through <VAR>theCommand</VAR> argument. \n
2377 # For format of the description string see MakeSketcher() method.\n
2378 # @param theCommand String, defining the sketcher in local
2379 # coordinates of the working plane.
2380 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2381 # @param theName Object name; when specified, this parameter is used
2382 # for result publication in the study. Otherwise, if automatic
2383 # publication is switched on, default value is used for result name.
2385 # @return New GEOM.GEOM_Object, containing the created wire.
2387 # @ref tui_sketcher_page "Example"
2388 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2390 Create a sketcher (wire or face), following the textual description,
2391 passed through theCommand argument.
2392 For format of the description string see geompy.MakeSketcher() method.
2395 theCommand String, defining the sketcher in local
2396 coordinates of the working plane.
2397 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2398 theName Object name; when specified, this parameter is used
2399 for result publication in the study. Otherwise, if automatic
2400 publication is switched on, default value is used for result name.
2403 New GEOM.GEOM_Object, containing the created wire.
2405 theCommand,Parameters = ParseSketcherCommand(theCommand)
2406 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2407 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2408 anObj.SetParameters(Parameters)
2409 self._autoPublish(anObj, theName, "wire")
2412 ## Obtain a 2D sketcher interface
2413 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2414 def Sketcher2D (self):
2416 Obtain a 2D sketcher interface.
2419 sk = geompy.Sketcher2D()
2421 sk.addSegmentRelative(15, 70)
2422 sk.addSegmentPerpY(50)
2423 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2424 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2425 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2427 Sketch_1 = sk.wire(geomObj_1)
2429 sk = Sketcher2D (self)
2432 ## Create a sketcher wire, following the numerical description,
2433 # passed through <VAR>theCoordinates</VAR> argument. \n
2434 # @param theCoordinates double values, defining points to create a wire,
2436 # @param theName Object name; when specified, this parameter is used
2437 # for result publication in the study. Otherwise, if automatic
2438 # publication is switched on, default value is used for result name.
2440 # @return New GEOM.GEOM_Object, containing the created wire.
2442 # @ref tui_3dsketcher_page "Example"
2443 def Make3DSketcher(self, theCoordinates, theName=None):
2445 Create a sketcher wire, following the numerical description,
2446 passed through theCoordinates argument.
2449 theCoordinates double values, defining points to create a wire,
2451 theName Object name; when specified, this parameter is used
2452 for result publication in the study. Otherwise, if automatic
2453 publication is switched on, default value is used for result name.
2456 New GEOM_Object, containing the created wire.
2458 theCoordinates,Parameters = ParseParameters(theCoordinates)
2459 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2460 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2461 anObj.SetParameters(Parameters)
2462 self._autoPublish(anObj, theName, "wire")
2465 ## Obtain a 3D sketcher interface
2466 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2468 # @ref tui_3dsketcher_page "Example"
2469 def Sketcher3D (self):
2471 Obtain a 3D sketcher interface.
2474 sk = geompy.Sketcher3D()
2475 sk.addPointsAbsolute(0,0,0, 70,0,0)
2476 sk.addPointsRelative(0, 0, 130)
2477 sk.addPointAnglesLength("OXY", 50, 0, 100)
2478 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2480 a3D_Sketcher_1 = sk.wire()
2482 sk = Sketcher3D (self)
2485 # end of l3_sketcher
2488 ## @addtogroup l3_3d_primitives
2491 ## Create a box by coordinates of two opposite vertices.
2493 # @param x1,y1,z1 double values, defining first point it.
2494 # @param x2,y2,z2 double values, defining first point it.
2495 # @param theName Object name; when specified, this parameter is used
2496 # for result publication in the study. Otherwise, if automatic
2497 # publication is switched on, default value is used for result name.
2499 # @return New GEOM.GEOM_Object, containing the created box.
2501 # @ref tui_creation_box "Example"
2502 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2504 Create a box by coordinates of two opposite vertices.
2507 x1,y1,z1 double values, defining first point.
2508 x2,y2,z2 double values, defining second point.
2509 theName Object name; when specified, this parameter is used
2510 for result publication in the study. Otherwise, if automatic
2511 publication is switched on, default value is used for result name.
2514 New GEOM.GEOM_Object, containing the created box.
2516 # Example: see GEOM_TestAll.py
2517 pnt1 = self.MakeVertex(x1,y1,z1)
2518 pnt2 = self.MakeVertex(x2,y2,z2)
2519 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2520 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2522 ## Create a box with specified dimensions along the coordinate axes
2523 # and with edges, parallel to the coordinate axes.
2524 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2525 # @param theDX Length of Box edges, parallel to OX axis.
2526 # @param theDY Length of Box edges, parallel to OY axis.
2527 # @param theDZ Length of Box edges, parallel to OZ axis.
2528 # @param theName Object name; when specified, this parameter is used
2529 # for result publication in the study. Otherwise, if automatic
2530 # publication is switched on, default value is used for result name.
2532 # @return New GEOM.GEOM_Object, containing the created box.
2534 # @ref tui_creation_box "Example"
2535 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2537 Create a box with specified dimensions along the coordinate axes
2538 and with edges, parallel to the coordinate axes.
2539 Center of the box will be at point (DX/2, DY/2, DZ/2).
2542 theDX Length of Box edges, parallel to OX axis.
2543 theDY Length of Box edges, parallel to OY axis.
2544 theDZ Length of Box edges, parallel to OZ axis.
2545 theName Object name; when specified, this parameter is used
2546 for result publication in the study. Otherwise, if automatic
2547 publication is switched on, default value is used for result name.
2550 New GEOM.GEOM_Object, containing the created box.
2552 # Example: see GEOM_TestAll.py
2553 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2554 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2555 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2556 anObj.SetParameters(Parameters)
2557 self._autoPublish(anObj, theName, "box")
2560 ## Create a box with two specified opposite vertices,
2561 # and with edges, parallel to the coordinate axes
2562 # @param thePnt1 First of two opposite vertices.
2563 # @param thePnt2 Second of two opposite vertices.
2564 # @param theName Object name; when specified, this parameter is used
2565 # for result publication in the study. Otherwise, if automatic
2566 # publication is switched on, default value is used for result name.
2568 # @return New GEOM.GEOM_Object, containing the created box.
2570 # @ref tui_creation_box "Example"
2571 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2573 Create a box with two specified opposite vertices,
2574 and with edges, parallel to the coordinate axes
2577 thePnt1 First of two opposite vertices.
2578 thePnt2 Second of two opposite vertices.
2579 theName Object name; when specified, this parameter is used
2580 for result publication in the study. Otherwise, if automatic
2581 publication is switched on, default value is used for result name.
2584 New GEOM.GEOM_Object, containing the created box.
2586 # Example: see GEOM_TestAll.py
2587 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2588 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2589 self._autoPublish(anObj, theName, "box")
2592 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2593 # @param theH height of Face.
2594 # @param theW width of Face.
2595 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2596 # @param theName Object name; when specified, this parameter is used
2597 # for result publication in the study. Otherwise, if automatic
2598 # publication is switched on, default value is used for result name.
2600 # @return New GEOM.GEOM_Object, containing the created face.
2602 # @ref tui_creation_face "Example"
2603 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2605 Create a face with specified dimensions with edges parallel to coordinate axes.
2608 theH height of Face.
2610 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2611 theName Object name; when specified, this parameter is used
2612 for result publication in the study. Otherwise, if automatic
2613 publication is switched on, default value is used for result name.
2616 New GEOM.GEOM_Object, containing the created face.
2618 # Example: see GEOM_TestAll.py
2619 theH,theW,Parameters = ParseParameters(theH, theW)
2620 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2621 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2622 anObj.SetParameters(Parameters)
2623 self._autoPublish(anObj, theName, "rectangle")
2626 ## Create a face from another plane and two sizes,
2627 # vertical size and horisontal size.
2628 # @param theObj Normale vector to the creating face or
2630 # @param theH Height (vertical size).
2631 # @param theW Width (horisontal size).
2632 # @param theName Object name; when specified, this parameter is used
2633 # for result publication in the study. Otherwise, if automatic
2634 # publication is switched on, default value is used for result name.
2636 # @return New GEOM.GEOM_Object, containing the created face.
2638 # @ref tui_creation_face "Example"
2639 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2641 Create a face from another plane and two sizes,
2642 vertical size and horisontal size.
2645 theObj Normale vector to the creating face or
2647 theH Height (vertical size).
2648 theW Width (horisontal size).
2649 theName Object name; when specified, this parameter is used
2650 for result publication in the study. Otherwise, if automatic
2651 publication is switched on, default value is used for result name.
2654 New GEOM_Object, containing the created face.
2656 # Example: see GEOM_TestAll.py
2657 theH,theW,Parameters = ParseParameters(theH, theW)
2658 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2659 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2660 anObj.SetParameters(Parameters)
2661 self._autoPublish(anObj, theName, "rectangle")
2664 ## Create a disk with given center, normal vector and radius.
2665 # @param thePnt Disk center.
2666 # @param theVec Vector, normal to the plane of the disk.
2667 # @param theR Disk radius.
2668 # @param theName Object name; when specified, this parameter is used
2669 # for result publication in the study. Otherwise, if automatic
2670 # publication is switched on, default value is used for result name.
2672 # @return New GEOM.GEOM_Object, containing the created disk.
2674 # @ref tui_creation_disk "Example"
2675 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2677 Create a disk with given center, normal vector and radius.
2681 theVec Vector, normal to the plane of the disk.
2683 theName Object name; when specified, this parameter is used
2684 for result publication in the study. Otherwise, if automatic
2685 publication is switched on, default value is used for result name.
2688 New GEOM.GEOM_Object, containing the created disk.
2690 # Example: see GEOM_TestAll.py
2691 theR,Parameters = ParseParameters(theR)
2692 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2693 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2694 anObj.SetParameters(Parameters)
2695 self._autoPublish(anObj, theName, "disk")
2698 ## Create a disk, passing through three given points
2699 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2700 # @param theName Object name; when specified, this parameter is used
2701 # for result publication in the study. Otherwise, if automatic
2702 # publication is switched on, default value is used for result name.
2704 # @return New GEOM.GEOM_Object, containing the created disk.
2706 # @ref tui_creation_disk "Example"
2707 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2709 Create a disk, passing through three given points
2712 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2713 theName Object name; when specified, this parameter is used
2714 for result publication in the study. Otherwise, if automatic
2715 publication is switched on, default value is used for result name.
2718 New GEOM.GEOM_Object, containing the created disk.
2720 # Example: see GEOM_TestAll.py
2721 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2722 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2723 self._autoPublish(anObj, theName, "disk")
2726 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2727 # @param theR Radius of Face.
2728 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2729 # @param theName Object name; when specified, this parameter is used
2730 # for result publication in the study. Otherwise, if automatic
2731 # publication is switched on, default value is used for result name.
2733 # @return New GEOM.GEOM_Object, containing the created disk.
2735 # @ref tui_creation_face "Example"
2736 def MakeDiskR(self, theR, theOrientation, theName=None):
2738 Create a disk with specified dimensions along OX-OY coordinate axes.
2741 theR Radius of Face.
2742 theOrientation set the orientation belong axis OXY or OYZ or OZX
2743 theName Object name; when specified, this parameter is used
2744 for result publication in the study. Otherwise, if automatic
2745 publication is switched on, default value is used for result name.
2748 New GEOM.GEOM_Object, containing the created disk.
2751 Disk3 = geompy.MakeDiskR(100., 1)
2753 # Example: see GEOM_TestAll.py
2754 theR,Parameters = ParseParameters(theR)
2755 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2756 RaiseIfFailed("MakeDiskR", self.PrimOp)
2757 anObj.SetParameters(Parameters)
2758 self._autoPublish(anObj, theName, "disk")
2761 ## Create a cylinder with given base point, axis, radius and height.
2762 # @param thePnt Central point of cylinder base.
2763 # @param theAxis Cylinder axis.
2764 # @param theR Cylinder radius.
2765 # @param theH Cylinder height.
2766 # @param theName Object name; when specified, this parameter is used
2767 # for result publication in the study. Otherwise, if automatic
2768 # publication is switched on, default value is used for result name.
2770 # @return New GEOM.GEOM_Object, containing the created cylinder.
2772 # @ref tui_creation_cylinder "Example"
2773 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2775 Create a cylinder with given base point, axis, radius and height.
2778 thePnt Central point of cylinder base.
2779 theAxis Cylinder axis.
2780 theR Cylinder radius.
2781 theH Cylinder height.
2782 theName Object name; when specified, this parameter is used
2783 for result publication in the study. Otherwise, if automatic
2784 publication is switched on, default value is used for result name.
2787 New GEOM.GEOM_Object, containing the created cylinder.
2789 # Example: see GEOM_TestAll.py
2790 theR,theH,Parameters = ParseParameters(theR, theH)
2791 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2792 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2793 anObj.SetParameters(Parameters)
2794 self._autoPublish(anObj, theName, "cylinder")
2797 ## Create a cylinder with given radius and height at
2798 # the origin of coordinate system. Axis of the cylinder
2799 # will be collinear to the OZ axis of the coordinate system.
2800 # @param theR Cylinder radius.
2801 # @param theH Cylinder height.
2802 # @param theName Object name; when specified, this parameter is used
2803 # for result publication in the study. Otherwise, if automatic
2804 # publication is switched on, default value is used for result name.
2806 # @return New GEOM.GEOM_Object, containing the created cylinder.
2808 # @ref tui_creation_cylinder "Example"
2809 def MakeCylinderRH(self, theR, theH, theName=None):
2811 Create a cylinder with given radius and height at
2812 the origin of coordinate system. Axis of the cylinder
2813 will be collinear to the OZ axis of the coordinate system.
2816 theR Cylinder radius.
2817 theH Cylinder height.
2818 theName Object name; when specified, this parameter is used
2819 for result publication in the study. Otherwise, if automatic
2820 publication is switched on, default value is used for result name.
2823 New GEOM.GEOM_Object, containing the created cylinder.
2825 # Example: see GEOM_TestAll.py
2826 theR,theH,Parameters = ParseParameters(theR, theH)
2827 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2828 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2829 anObj.SetParameters(Parameters)
2830 self._autoPublish(anObj, theName, "cylinder")
2833 ## Create a sphere with given center and radius.
2834 # @param thePnt Sphere center.
2835 # @param theR Sphere radius.
2836 # @param theName Object name; when specified, this parameter is used
2837 # for result publication in the study. Otherwise, if automatic
2838 # publication is switched on, default value is used for result name.
2840 # @return New GEOM.GEOM_Object, containing the created sphere.
2842 # @ref tui_creation_sphere "Example"
2843 def MakeSpherePntR(self, thePnt, theR, theName=None):
2845 Create a sphere with given center and radius.
2848 thePnt Sphere center.
2850 theName Object name; when specified, this parameter is used
2851 for result publication in the study. Otherwise, if automatic
2852 publication is switched on, default value is used for result name.
2855 New GEOM.GEOM_Object, containing the created sphere.
2857 # Example: see GEOM_TestAll.py
2858 theR,Parameters = ParseParameters(theR)
2859 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2860 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2861 anObj.SetParameters(Parameters)
2862 self._autoPublish(anObj, theName, "sphere")
2865 ## Create a sphere with given center and radius.
2866 # @param x,y,z Coordinates of sphere center.
2867 # @param theR Sphere radius.
2868 # @param theName Object name; when specified, this parameter is used
2869 # for result publication in the study. Otherwise, if automatic
2870 # publication is switched on, default value is used for result name.
2872 # @return New GEOM.GEOM_Object, containing the created sphere.
2874 # @ref tui_creation_sphere "Example"
2875 def MakeSphere(self, x, y, z, theR, theName=None):
2877 Create a sphere with given center and radius.
2880 x,y,z Coordinates of sphere center.
2882 theName Object name; when specified, this parameter is used
2883 for result publication in the study. Otherwise, if automatic
2884 publication is switched on, default value is used for result name.
2887 New GEOM.GEOM_Object, containing the created sphere.
2889 # Example: see GEOM_TestAll.py
2890 point = self.MakeVertex(x, y, z)
2891 # note: auto-publishing is done in self.MakeSpherePntR()
2892 anObj = self.MakeSpherePntR(point, theR, theName)
2895 ## Create a sphere with given radius at the origin of coordinate system.
2896 # @param theR Sphere radius.
2897 # @param theName Object name; when specified, this parameter is used
2898 # for result publication in the study. Otherwise, if automatic
2899 # publication is switched on, default value is used for result name.
2901 # @return New GEOM.GEOM_Object, containing the created sphere.
2903 # @ref tui_creation_sphere "Example"
2904 def MakeSphereR(self, theR, theName=None):
2906 Create a sphere with given radius at the origin of coordinate system.
2910 theName Object name; when specified, this parameter is used
2911 for result publication in the study. Otherwise, if automatic
2912 publication is switched on, default value is used for result name.
2915 New GEOM.GEOM_Object, containing the created sphere.
2917 # Example: see GEOM_TestAll.py
2918 theR,Parameters = ParseParameters(theR)
2919 anObj = self.PrimOp.MakeSphereR(theR)
2920 RaiseIfFailed("MakeSphereR", self.PrimOp)
2921 anObj.SetParameters(Parameters)
2922 self._autoPublish(anObj, theName, "sphere")
2925 ## Create a cone with given base point, axis, height and radiuses.
2926 # @param thePnt Central point of the first cone base.
2927 # @param theAxis Cone axis.
2928 # @param theR1 Radius of the first cone base.
2929 # @param theR2 Radius of the second cone base.
2930 # \note If both radiuses are non-zero, the cone will be truncated.
2931 # \note If the radiuses are equal, a cylinder will be created instead.
2932 # @param theH Cone height.
2933 # @param theName Object name; when specified, this parameter is used
2934 # for result publication in the study. Otherwise, if automatic
2935 # publication is switched on, default value is used for result name.
2937 # @return New GEOM.GEOM_Object, containing the created cone.
2939 # @ref tui_creation_cone "Example"
2940 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2942 Create a cone with given base point, axis, height and radiuses.
2945 thePnt Central point of the first cone base.
2947 theR1 Radius of the first cone base.
2948 theR2 Radius of the second cone base.
2950 theName Object name; when specified, this parameter is used
2951 for result publication in the study. Otherwise, if automatic
2952 publication is switched on, default value is used for result name.
2955 If both radiuses are non-zero, the cone will be truncated.
2956 If the radiuses are equal, a cylinder will be created instead.
2959 New GEOM.GEOM_Object, containing the created cone.
2961 # Example: see GEOM_TestAll.py
2962 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2963 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2964 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2965 anObj.SetParameters(Parameters)
2966 self._autoPublish(anObj, theName, "cone")
2969 ## Create a cone with given height and radiuses at
2970 # the origin of coordinate system. Axis of the cone will
2971 # be collinear to the OZ axis of the coordinate system.
2972 # @param theR1 Radius of the first cone base.
2973 # @param theR2 Radius of the second cone base.
2974 # \note If both radiuses are non-zero, the cone will be truncated.
2975 # \note If the radiuses are equal, a cylinder will be created instead.
2976 # @param theH Cone height.
2977 # @param theName Object name; when specified, this parameter is used
2978 # for result publication in the study. Otherwise, if automatic
2979 # publication is switched on, default value is used for result name.
2981 # @return New GEOM.GEOM_Object, containing the created cone.
2983 # @ref tui_creation_cone "Example"
2984 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
2986 Create a cone with given height and radiuses at
2987 the origin of coordinate system. Axis of the cone will
2988 be collinear to the OZ axis of the coordinate system.
2991 theR1 Radius of the first cone base.
2992 theR2 Radius of the second cone base.
2994 theName Object name; when specified, this parameter is used
2995 for result publication in the study. Otherwise, if automatic
2996 publication is switched on, default value is used for result name.
2999 If both radiuses are non-zero, the cone will be truncated.
3000 If the radiuses are equal, a cylinder will be created instead.
3003 New GEOM.GEOM_Object, containing the created cone.
3005 # Example: see GEOM_TestAll.py
3006 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3007 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3008 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3009 anObj.SetParameters(Parameters)
3010 self._autoPublish(anObj, theName, "cone")
3013 ## Create a torus with given center, normal vector and radiuses.
3014 # @param thePnt Torus central point.
3015 # @param theVec Torus axis of symmetry.
3016 # @param theRMajor Torus major radius.
3017 # @param theRMinor Torus minor radius.
3018 # @param theName Object name; when specified, this parameter is used
3019 # for result publication in the study. Otherwise, if automatic
3020 # publication is switched on, default value is used for result name.
3022 # @return New GEOM.GEOM_Object, containing the created torus.
3024 # @ref tui_creation_torus "Example"
3025 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3027 Create a torus with given center, normal vector and radiuses.
3030 thePnt Torus central point.
3031 theVec Torus axis of symmetry.
3032 theRMajor Torus major radius.
3033 theRMinor Torus minor radius.
3034 theName Object name; when specified, this parameter is used
3035 for result publication in the study. Otherwise, if automatic
3036 publication is switched on, default value is used for result name.
3039 New GEOM.GEOM_Object, containing the created torus.
3041 # Example: see GEOM_TestAll.py
3042 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3043 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3044 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3045 anObj.SetParameters(Parameters)
3046 self._autoPublish(anObj, theName, "torus")
3049 ## Create a torus with given radiuses at the origin of coordinate system.
3050 # @param theRMajor Torus major radius.
3051 # @param theRMinor Torus minor radius.
3052 # @param theName Object name; when specified, this parameter is used
3053 # for result publication in the study. Otherwise, if automatic
3054 # publication is switched on, default value is used for result name.
3056 # @return New GEOM.GEOM_Object, containing the created torus.
3058 # @ref tui_creation_torus "Example"
3059 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3061 Create a torus with given radiuses at the origin of coordinate system.
3064 theRMajor Torus major radius.
3065 theRMinor Torus minor radius.
3066 theName Object name; when specified, this parameter is used
3067 for result publication in the study. Otherwise, if automatic
3068 publication is switched on, default value is used for result name.
3071 New GEOM.GEOM_Object, containing the created torus.
3073 # Example: see GEOM_TestAll.py
3074 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3075 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3076 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3077 anObj.SetParameters(Parameters)
3078 self._autoPublish(anObj, theName, "torus")
3081 # end of l3_3d_primitives
3084 ## @addtogroup l3_complex
3087 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3088 # @param theBase Base shape to be extruded.
3089 # @param thePoint1 First end of extrusion vector.
3090 # @param thePoint2 Second end of extrusion vector.
3091 # @param theScaleFactor Use it to make prism with scaled second base.
3092 # Nagative value means not scaled second base.
3093 # @param theName Object name; when specified, this parameter is used
3094 # for result publication in the study. Otherwise, if automatic
3095 # publication is switched on, default value is used for result name.
3097 # @return New GEOM.GEOM_Object, containing the created prism.
3099 # @ref tui_creation_prism "Example"
3100 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3102 Create a shape by extrusion of the base shape along a vector, defined by two points.
3105 theBase Base shape to be extruded.
3106 thePoint1 First end of extrusion vector.
3107 thePoint2 Second end of extrusion vector.
3108 theScaleFactor Use it to make prism with scaled second base.
3109 Nagative value means not scaled second base.
3110 theName Object name; when specified, this parameter is used
3111 for result publication in the study. Otherwise, if automatic
3112 publication is switched on, default value is used for result name.
3115 New GEOM.GEOM_Object, containing the created prism.
3117 # Example: see GEOM_TestAll.py
3120 if theScaleFactor > 0:
3121 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3122 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3124 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3125 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3126 anObj.SetParameters(Parameters)
3127 self._autoPublish(anObj, theName, "prism")
3130 ## Create a shape by extrusion of the base shape along a
3131 # vector, defined by two points, in 2 Ways (forward/backward).
3132 # @param theBase Base shape to be extruded.
3133 # @param thePoint1 First end of extrusion vector.
3134 # @param thePoint2 Second end of extrusion vector.
3135 # @param theName Object name; when specified, this parameter is used
3136 # for result publication in the study. Otherwise, if automatic
3137 # publication is switched on, default value is used for result name.
3139 # @return New GEOM.GEOM_Object, containing the created prism.
3141 # @ref tui_creation_prism "Example"
3142 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3144 Create a shape by extrusion of the base shape along a
3145 vector, defined by two points, in 2 Ways (forward/backward).
3148 theBase Base shape to be extruded.
3149 thePoint1 First end of extrusion vector.
3150 thePoint2 Second end of extrusion vector.
3151 theName Object name; when specified, this parameter is used
3152 for result publication in the study. Otherwise, if automatic
3153 publication is switched on, default value is used for result name.
3156 New GEOM.GEOM_Object, containing the created prism.
3158 # Example: see GEOM_TestAll.py
3159 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3160 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3161 self._autoPublish(anObj, theName, "prism")
3164 ## Create a shape by extrusion of the base shape along the vector,
3165 # i.e. all the space, transfixed by the base shape during its translation
3166 # along the vector on the given distance.
3167 # @param theBase Base shape to be extruded.
3168 # @param theVec Direction of extrusion.
3169 # @param theH Prism dimension along theVec.
3170 # @param theScaleFactor Use it to make prism with scaled second base.
3171 # Negative value means not scaled second base.
3172 # @param theName Object name; when specified, this parameter is used
3173 # for result publication in the study. Otherwise, if automatic
3174 # publication is switched on, default value is used for result name.
3176 # @return New GEOM.GEOM_Object, containing the created prism.
3178 # @ref tui_creation_prism "Example"
3179 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3181 Create a shape by extrusion of the base shape along the vector,
3182 i.e. all the space, transfixed by the base shape during its translation
3183 along the vector on the given distance.
3186 theBase Base shape to be extruded.
3187 theVec Direction of extrusion.
3188 theH Prism dimension along theVec.
3189 theScaleFactor Use it to make prism with scaled second base.
3190 Negative value means not scaled second base.
3191 theName Object name; when specified, this parameter is used
3192 for result publication in the study. Otherwise, if automatic
3193 publication is switched on, default value is used for result name.
3196 New GEOM.GEOM_Object, containing the created prism.
3198 # Example: see GEOM_TestAll.py
3201 if theScaleFactor > 0:
3202 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3203 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3205 theH,Parameters = ParseParameters(theH)
3206 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3207 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3208 anObj.SetParameters(Parameters)
3209 self._autoPublish(anObj, theName, "prism")
3212 ## Create a shape by extrusion of the base shape along the vector,
3213 # i.e. all the space, transfixed by the base shape during its translation
3214 # along the vector on the given distance in 2 Ways (forward/backward).
3215 # @param theBase Base shape to be extruded.
3216 # @param theVec Direction of extrusion.
3217 # @param theH Prism dimension along theVec in forward direction.
3218 # @param theName Object name; when specified, this parameter is used
3219 # for result publication in the study. Otherwise, if automatic
3220 # publication is switched on, default value is used for result name.
3222 # @return New GEOM.GEOM_Object, containing the created prism.
3224 # @ref tui_creation_prism "Example"
3225 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3227 Create a shape by extrusion of the base shape along the vector,
3228 i.e. all the space, transfixed by the base shape during its translation
3229 along the vector on the given distance in 2 Ways (forward/backward).
3232 theBase Base shape to be extruded.
3233 theVec Direction of extrusion.
3234 theH Prism dimension along theVec in forward direction.
3235 theName Object name; when specified, this parameter is used
3236 for result publication in the study. Otherwise, if automatic
3237 publication is switched on, default value is used for result name.
3240 New GEOM.GEOM_Object, containing the created prism.
3242 # Example: see GEOM_TestAll.py
3243 theH,Parameters = ParseParameters(theH)
3244 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3245 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3246 anObj.SetParameters(Parameters)
3247 self._autoPublish(anObj, theName, "prism")
3250 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3251 # @param theBase Base shape to be extruded.
3252 # @param theDX, theDY, theDZ Directions of extrusion.
3253 # @param theScaleFactor Use it to make prism with scaled second base.
3254 # Nagative value means not scaled second base.
3255 # @param theName Object name; when specified, this parameter is used
3256 # for result publication in the study. Otherwise, if automatic
3257 # publication is switched on, default value is used for result name.
3259 # @return New GEOM.GEOM_Object, containing the created prism.
3261 # @ref tui_creation_prism "Example"
3262 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3264 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3267 theBase Base shape to be extruded.
3268 theDX, theDY, theDZ Directions of extrusion.
3269 theScaleFactor Use it to make prism with scaled second base.
3270 Nagative value means not scaled second base.
3271 theName Object name; when specified, this parameter is used
3272 for result publication in the study. Otherwise, if automatic
3273 publication is switched on, default value is used for result name.
3276 New GEOM.GEOM_Object, containing the created prism.
3278 # Example: see GEOM_TestAll.py
3281 if theScaleFactor > 0:
3282 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3283 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3285 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3286 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3287 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3288 anObj.SetParameters(Parameters)
3289 self._autoPublish(anObj, theName, "prism")
3292 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3293 # i.e. all the space, transfixed by the base shape during its translation
3294 # along the vector on the given distance in 2 Ways (forward/backward).
3295 # @param theBase Base shape to be extruded.
3296 # @param theDX, theDY, theDZ Directions of extrusion.
3297 # @param theName Object name; when specified, this parameter is used
3298 # for result publication in the study. Otherwise, if automatic
3299 # publication is switched on, default value is used for result name.
3301 # @return New GEOM.GEOM_Object, containing the created prism.
3303 # @ref tui_creation_prism "Example"
3304 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3306 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3307 i.e. all the space, transfixed by the base shape during its translation
3308 along the vector on the given distance in 2 Ways (forward/backward).
3311 theBase Base shape to be extruded.
3312 theDX, theDY, theDZ Directions of extrusion.
3313 theName Object name; when specified, this parameter is used
3314 for result publication in the study. Otherwise, if automatic
3315 publication is switched on, default value is used for result name.
3318 New GEOM.GEOM_Object, containing the created prism.
3320 # Example: see GEOM_TestAll.py
3321 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3322 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3323 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3324 anObj.SetParameters(Parameters)
3325 self._autoPublish(anObj, theName, "prism")
3328 ## Create a shape by revolution of the base shape around the axis
3329 # on the given angle, i.e. all the space, transfixed by the base
3330 # shape during its rotation around the axis on the given angle.
3331 # @param theBase Base shape to be rotated.
3332 # @param theAxis Rotation axis.
3333 # @param theAngle Rotation angle in radians.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created revolution.
3340 # @ref tui_creation_revolution "Example"
3341 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3343 Create a shape by revolution of the base shape around the axis
3344 on the given angle, i.e. all the space, transfixed by the base
3345 shape during its rotation around the axis on the given angle.
3348 theBase Base shape to be rotated.
3349 theAxis Rotation axis.
3350 theAngle Rotation angle in radians.
3351 theName Object name; when specified, this parameter is used
3352 for result publication in the study. Otherwise, if automatic
3353 publication is switched on, default value is used for result name.
3356 New GEOM.GEOM_Object, containing the created revolution.
3358 # Example: see GEOM_TestAll.py
3359 theAngle,Parameters = ParseParameters(theAngle)
3360 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3361 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3362 anObj.SetParameters(Parameters)
3363 self._autoPublish(anObj, theName, "revolution")
3366 ## Create a shape by revolution of the base shape around the axis
3367 # on the given angle, i.e. all the space, transfixed by the base
3368 # shape during its rotation around the axis on the given angle in
3369 # both directions (forward/backward)
3370 # @param theBase Base shape to be rotated.
3371 # @param theAxis Rotation axis.
3372 # @param theAngle Rotation angle in radians.
3373 # @param theName Object name; when specified, this parameter is used
3374 # for result publication in the study. Otherwise, if automatic
3375 # publication is switched on, default value is used for result name.
3377 # @return New GEOM.GEOM_Object, containing the created revolution.
3379 # @ref tui_creation_revolution "Example"
3380 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3382 Create a shape by revolution of the base shape around the axis
3383 on the given angle, i.e. all the space, transfixed by the base
3384 shape during its rotation around the axis on the given angle in
3385 both directions (forward/backward).
3388 theBase Base shape to be rotated.
3389 theAxis Rotation axis.
3390 theAngle Rotation angle in radians.
3391 theName Object name; when specified, this parameter is used
3392 for result publication in the study. Otherwise, if automatic
3393 publication is switched on, default value is used for result name.
3396 New GEOM.GEOM_Object, containing the created revolution.
3398 theAngle,Parameters = ParseParameters(theAngle)
3399 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3400 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3401 anObj.SetParameters(Parameters)
3402 self._autoPublish(anObj, theName, "revolution")
3405 ## Create a filling from the given compound of contours.
3406 # @param theShape the compound of contours
3407 # @param theMinDeg a minimal degree of BSpline surface to create
3408 # @param theMaxDeg a maximal degree of BSpline surface to create
3409 # @param theTol2D a 2d tolerance to be reached
3410 # @param theTol3D a 3d tolerance to be reached
3411 # @param theNbIter a number of iteration of approximation algorithm
3412 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3413 # @param isApprox if True, BSpline curves are generated in the process
3414 # of surface construction. By default it is False, that means
3415 # the surface is created using given curves. The usage of
3416 # Approximation makes the algorithm work slower, but allows
3417 # building the surface for rather complex cases.
3418 # @param theName Object name; when specified, this parameter is used
3419 # for result publication in the study. Otherwise, if automatic
3420 # publication is switched on, default value is used for result name.
3422 # @return New GEOM.GEOM_Object, containing the created filling surface.
3424 # @ref tui_creation_filling "Example"
3425 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3426 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3428 Create a filling from the given compound of contours.
3431 theShape the compound of contours
3432 theMinDeg a minimal degree of BSpline surface to create
3433 theMaxDeg a maximal degree of BSpline surface to create
3434 theTol2D a 2d tolerance to be reached
3435 theTol3D a 3d tolerance to be reached
3436 theNbIter a number of iteration of approximation algorithm
3437 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3438 isApprox if True, BSpline curves are generated in the process
3439 of surface construction. By default it is False, that means
3440 the surface is created using given curves. The usage of
3441 Approximation makes the algorithm work slower, but allows
3442 building the surface for rather complex cases
3443 theName Object name; when specified, this parameter is used
3444 for result publication in the study. Otherwise, if automatic
3445 publication is switched on, default value is used for result name.
3448 New GEOM.GEOM_Object, containing the created filling surface.
3451 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3453 # Example: see GEOM_TestAll.py
3454 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3455 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3456 theTol2D, theTol3D, theNbIter,
3457 theMethod, isApprox)
3458 RaiseIfFailed("MakeFilling", self.PrimOp)
3459 anObj.SetParameters(Parameters)
3460 self._autoPublish(anObj, theName, "filling")
3464 ## Create a filling from the given compound of contours.
3465 # This method corresponds to MakeFilling with isApprox=True
3466 # @param theShape the compound of contours
3467 # @param theMinDeg a minimal degree of BSpline surface to create
3468 # @param theMaxDeg a maximal degree of BSpline surface to create
3469 # @param theTol3D a 3d tolerance to be reached
3470 # @param theName Object name; when specified, this parameter is used
3471 # for result publication in the study. Otherwise, if automatic
3472 # publication is switched on, default value is used for result name.
3474 # @return New GEOM.GEOM_Object, containing the created filling surface.
3476 # @ref tui_creation_filling "Example"
3477 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3479 Create a filling from the given compound of contours.
3480 This method corresponds to MakeFilling with isApprox=True
3483 theShape the compound of contours
3484 theMinDeg a minimal degree of BSpline surface to create
3485 theMaxDeg a maximal degree of BSpline surface to create
3486 theTol3D a 3d tolerance to be reached
3487 theName Object name; when specified, this parameter is used
3488 for result publication in the study. Otherwise, if automatic
3489 publication is switched on, default value is used for result name.
3492 New GEOM.GEOM_Object, containing the created filling surface.
3495 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3497 # Example: see GEOM_TestAll.py
3498 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3499 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3500 0, theTol3D, 0, GEOM.FOM_Default, True)
3501 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3502 anObj.SetParameters(Parameters)
3503 self._autoPublish(anObj, theName, "filling")
3506 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3507 # @param theSeqSections - set of specified sections.
3508 # @param theModeSolid - mode defining building solid or shell
3509 # @param thePreci - precision 3D used for smoothing
3510 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3511 # @param theName Object name; when specified, this parameter is used
3512 # for result publication in the study. Otherwise, if automatic
3513 # publication is switched on, default value is used for result name.
3515 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3517 # @ref swig_todo "Example"
3518 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3520 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3523 theSeqSections - set of specified sections.
3524 theModeSolid - mode defining building solid or shell
3525 thePreci - precision 3D used for smoothing
3526 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3527 theName Object name; when specified, this parameter is used
3528 for result publication in the study. Otherwise, if automatic
3529 publication is switched on, default value is used for result name.
3532 New GEOM.GEOM_Object, containing the created shell or solid.
3534 # Example: see GEOM_TestAll.py
3535 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3536 RaiseIfFailed("MakeThruSections", self.PrimOp)
3537 self._autoPublish(anObj, theName, "filling")
3540 ## Create a shape by extrusion of the base shape along
3541 # the path shape. The path shape can be a wire or an edge.
3542 # @param theBase Base shape to be extruded.
3543 # @param thePath Path shape to extrude the base shape along it.
3544 # @param theName Object name; when specified, this parameter is used
3545 # for result publication in the study. Otherwise, if automatic
3546 # publication is switched on, default value is used for result name.
3548 # @return New GEOM.GEOM_Object, containing the created pipe.
3550 # @ref tui_creation_pipe "Example"
3551 def MakePipe(self, theBase, thePath, theName=None):
3553 Create a shape by extrusion of the base shape along
3554 the path shape. The path shape can be a wire or an edge.
3557 theBase Base shape to be extruded.
3558 thePath Path shape to extrude the base shape along it.
3559 theName Object name; when specified, this parameter is used
3560 for result publication in the study. Otherwise, if automatic
3561 publication is switched on, default value is used for result name.
3564 New GEOM.GEOM_Object, containing the created pipe.
3566 # Example: see GEOM_TestAll.py
3567 anObj = self.PrimOp.MakePipe(theBase, thePath)
3568 RaiseIfFailed("MakePipe", self.PrimOp)
3569 self._autoPublish(anObj, theName, "pipe")
3572 ## Create a shape by extrusion of the profile shape along
3573 # the path shape. The path shape can be a wire or an edge.
3574 # the several profiles can be specified in the several locations of path.
3575 # @param theSeqBases - list of Bases shape to be extruded.
3576 # @param theLocations - list of locations on the path corresponding
3577 # specified list of the Bases shapes. Number of locations
3578 # should be equal to number of bases or list of locations can be empty.
3579 # @param thePath - Path shape to extrude the base shape along it.
3580 # @param theWithContact - the mode defining that the section is translated to be in
3581 # contact with the spine.
3582 # @param theWithCorrection - defining that the section is rotated to be
3583 # orthogonal to the spine tangent in the correspondent point
3584 # @param theName Object name; when specified, this parameter is used
3585 # for result publication in the study. Otherwise, if automatic
3586 # publication is switched on, default value is used for result name.
3588 # @return New GEOM.GEOM_Object, containing the created pipe.
3590 # @ref tui_creation_pipe_with_diff_sec "Example"
3591 def MakePipeWithDifferentSections(self, theSeqBases,
3592 theLocations, thePath,
3593 theWithContact, theWithCorrection, theName=None):
3595 Create a shape by extrusion of the profile shape along
3596 the path shape. The path shape can be a wire or an edge.
3597 the several profiles can be specified in the several locations of path.
3600 theSeqBases - list of Bases shape to be extruded.
3601 theLocations - list of locations on the path corresponding
3602 specified list of the Bases shapes. Number of locations
3603 should be equal to number of bases or list of locations can be empty.
3604 thePath - Path shape to extrude the base shape along it.
3605 theWithContact - the mode defining that the section is translated to be in
3606 contact with the spine(0/1)
3607 theWithCorrection - defining that the section is rotated to be
3608 orthogonal to the spine tangent in the correspondent point (0/1)
3609 theName Object name; when specified, this parameter is used
3610 for result publication in the study. Otherwise, if automatic
3611 publication is switched on, default value is used for result name.
3614 New GEOM.GEOM_Object, containing the created pipe.
3616 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3617 theLocations, thePath,
3618 theWithContact, theWithCorrection)
3619 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3620 self._autoPublish(anObj, theName, "pipe")
3623 ## Create a shape by extrusion of the profile shape along
3624 # the path shape. The path shape can be a wire or a edge.
3625 # the several profiles can be specified in the several locations of path.
3626 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3627 # shell or face. If number of faces in neighbour sections
3628 # aren't coincided result solid between such sections will
3629 # be created using external boundaries of this shells.
3630 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3631 # This list is used for searching correspondences between
3632 # faces in the sections. Size of this list must be equal
3633 # to size of list of base shapes.
3634 # @param theLocations - list of locations on the path corresponding
3635 # specified list of the Bases shapes. Number of locations
3636 # should be equal to number of bases. First and last
3637 # locations must be coincided with first and last vertexes
3638 # of path correspondingly.
3639 # @param thePath - Path shape to extrude the base shape along it.
3640 # @param theWithContact - the mode defining that the section is translated to be in
3641 # contact with the spine.
3642 # @param theWithCorrection - defining that the section is rotated to be
3643 # orthogonal to the spine tangent in the correspondent point
3644 # @param theName Object name; when specified, this parameter is used
3645 # for result publication in the study. Otherwise, if automatic
3646 # publication is switched on, default value is used for result name.
3648 # @return New GEOM.GEOM_Object, containing the created solids.
3650 # @ref tui_creation_pipe_with_shell_sec "Example"
3651 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3652 theLocations, thePath,
3653 theWithContact, theWithCorrection, theName=None):
3655 Create a shape by extrusion of the profile shape along
3656 the path shape. The path shape can be a wire or a edge.
3657 the several profiles can be specified in the several locations of path.
3660 theSeqBases - list of Bases shape to be extruded. Base shape must be
3661 shell or face. If number of faces in neighbour sections
3662 aren't coincided result solid between such sections will
3663 be created using external boundaries of this shells.
3664 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3665 This list is used for searching correspondences between
3666 faces in the sections. Size of this list must be equal
3667 to size of list of base shapes.
3668 theLocations - list of locations on the path corresponding
3669 specified list of the Bases shapes. Number of locations
3670 should be equal to number of bases. First and last
3671 locations must be coincided with first and last vertexes
3672 of path correspondingly.
3673 thePath - Path shape to extrude the base shape along it.
3674 theWithContact - the mode defining that the section is translated to be in
3675 contact with the spine (0/1)
3676 theWithCorrection - defining that the section is rotated to be
3677 orthogonal to the spine tangent in the correspondent point (0/1)
3678 theName Object name; when specified, this parameter is used
3679 for result publication in the study. Otherwise, if automatic
3680 publication is switched on, default value is used for result name.
3683 New GEOM.GEOM_Object, containing the created solids.
3685 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3686 theLocations, thePath,
3687 theWithContact, theWithCorrection)
3688 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3689 self._autoPublish(anObj, theName, "pipe")
3692 ## Create a shape by extrusion of the profile shape along
3693 # the path shape. This function is used only for debug pipe
3694 # functionality - it is a version of function MakePipeWithShellSections()
3695 # which give a possibility to recieve information about
3696 # creating pipe between each pair of sections step by step.
3697 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3698 theLocations, thePath,
3699 theWithContact, theWithCorrection, theName=None):
3701 Create a shape by extrusion of the profile shape along
3702 the path shape. This function is used only for debug pipe
3703 functionality - it is a version of previous function
3704 geompy.MakePipeWithShellSections() which give a possibility to
3705 recieve information about creating pipe between each pair of
3706 sections step by step.
3709 nbsect = len(theSeqBases)
3710 nbsubsect = len(theSeqSubBases)
3711 #print "nbsect = ",nbsect
3712 for i in range(1,nbsect):
3714 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3715 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3717 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3718 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3719 tmpLocations, thePath,
3720 theWithContact, theWithCorrection)
3721 if self.PrimOp.IsDone() == 0:
3722 print "Problems with pipe creation between ",i," and ",i+1," sections"
3723 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3726 print "Pipe between ",i," and ",i+1," sections is OK"
3731 resc = self.MakeCompound(res)
3732 #resc = self.MakeSewing(res, 0.001)
3733 #print "resc: ",resc
3734 self._autoPublish(resc, theName, "pipe")
3737 ## Create solids between given sections
3738 # @param theSeqBases - list of sections (shell or face).
3739 # @param theLocations - list of corresponding vertexes
3740 # @param theName Object name; when specified, this parameter is used
3741 # for result publication in the study. Otherwise, if automatic
3742 # publication is switched on, default value is used for result name.
3744 # @return New GEOM.GEOM_Object, containing the created solids.
3746 # @ref tui_creation_pipe_without_path "Example"
3747 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3749 Create solids between given sections
3752 theSeqBases - list of sections (shell or face).
3753 theLocations - list of corresponding vertexes
3754 theName Object name; when specified, this parameter is used
3755 for result publication in the study. Otherwise, if automatic
3756 publication is switched on, default value is used for result name.
3759 New GEOM.GEOM_Object, containing the created solids.
3761 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3762 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3763 self._autoPublish(anObj, theName, "pipe")
3766 ## Create a shape by extrusion of the base shape along
3767 # the path shape with constant bi-normal direction along the given vector.
3768 # The path shape can be a wire or an edge.
3769 # @param theBase Base shape to be extruded.
3770 # @param thePath Path shape to extrude the base shape along it.
3771 # @param theVec Vector defines a constant binormal direction to keep the
3772 # same angle beetween the direction and the sections
3773 # along the sweep surface.
3774 # @param theName Object name; when specified, this parameter is used
3775 # for result publication in the study. Otherwise, if automatic
3776 # publication is switched on, default value is used for result name.
3778 # @return New GEOM.GEOM_Object, containing the created pipe.
3780 # @ref tui_creation_pipe "Example"
3781 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3783 Create a shape by extrusion of the base shape along
3784 the path shape with constant bi-normal direction along the given vector.
3785 The path shape can be a wire or an edge.
3788 theBase Base shape to be extruded.
3789 thePath Path shape to extrude the base shape along it.
3790 theVec Vector defines a constant binormal direction to keep the
3791 same angle beetween the direction and the sections
3792 along the sweep surface.
3793 theName Object name; when specified, this parameter is used
3794 for result publication in the study. Otherwise, if automatic
3795 publication is switched on, default value is used for result name.
3798 New GEOM.GEOM_Object, containing the created pipe.
3800 # Example: see GEOM_TestAll.py
3801 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3802 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3803 self._autoPublish(anObj, theName, "pipe")
3806 ## Makes a thick solid from a face or a shell
3807 # @param theShape Face or Shell to be thicken
3808 # @param theThickness Thickness of the resulting solid
3809 # @param theName Object name; when specified, this parameter is used
3810 # for result publication in the study. Otherwise, if automatic
3811 # publication is switched on, default value is used for result name.
3813 # @return New GEOM.GEOM_Object, containing the created solid
3815 def MakeThickSolid(self, theShape, theThickness, theName=None):
3817 Make a thick solid from a face or a shell
3820 theShape Face or Shell to be thicken
3821 theThickness Thickness of the resulting solid
3822 theName Object name; when specified, this parameter is used
3823 for result publication in the study. Otherwise, if automatic
3824 publication is switched on, default value is used for result name.
3827 New GEOM.GEOM_Object, containing the created solid
3829 # Example: see GEOM_TestAll.py
3830 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3831 RaiseIfFailed("MakeThickening", self.PrimOp)
3832 self._autoPublish(anObj, theName, "pipe")
3836 ## Modifies a face or a shell to make it a thick solid
3837 # @param theShape Face or Shell to be thicken
3838 # @param theThickness Thickness of the resulting solid
3840 # @return The modified shape
3842 def Thicken(self, theShape, theThickness):
3844 Modifies a face or a shell to make it a thick solid
3847 theBase Base shape to be extruded.
3848 thePath Path shape to extrude the base shape along it.
3849 theName Object name; when specified, this parameter is used
3850 for result publication in the study. Otherwise, if automatic
3851 publication is switched on, default value is used for result name.
3856 # Example: see GEOM_TestAll.py
3857 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3858 RaiseIfFailed("MakeThickening", self.PrimOp)
3861 ## Build a middle path of a pipe-like shape.
3862 # The path shape can be a wire or an edge.
3863 # @param theShape It can be closed or unclosed pipe-like shell
3864 # or a pipe-like solid.
3865 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3866 # should be wires or faces of theShape.
3867 # @param theName Object name; when specified, this parameter is used
3868 # for result publication in the study. Otherwise, if automatic
3869 # publication is switched on, default value is used for result name.
3871 # @note It is not assumed that exact or approximate copy of theShape
3872 # can be obtained by applying existing Pipe operation on the
3873 # resulting "Path" wire taking theBase1 as the base - it is not
3874 # always possible; though in some particular cases it might work
3875 # it is not guaranteed. Thus, RestorePath function should not be
3876 # considered as an exact reverse operation of the Pipe.
3878 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3879 # source pipe's "path".
3881 # @ref tui_creation_pipe_path "Example"
3882 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3884 Build a middle path of a pipe-like shape.
3885 The path shape can be a wire or an edge.
3888 theShape It can be closed or unclosed pipe-like shell
3889 or a pipe-like solid.
3890 theBase1, theBase2 Two bases of the supposed pipe. This
3891 should be wires or faces of theShape.
3892 theName Object name; when specified, this parameter is used
3893 for result publication in the study. Otherwise, if automatic
3894 publication is switched on, default value is used for result name.
3897 New GEOM_Object, containing an edge or wire that represent
3900 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3901 RaiseIfFailed("RestorePath", self.PrimOp)
3902 self._autoPublish(anObj, theName, "path")
3905 ## Build a middle path of a pipe-like shape.
3906 # The path shape can be a wire or an edge.
3907 # @param theShape It can be closed or unclosed pipe-like shell
3908 # or a pipe-like solid.
3909 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3910 # should be lists of edges of theShape.
3911 # @param theName Object name; when specified, this parameter is used
3912 # for result publication in the study. Otherwise, if automatic
3913 # publication is switched on, default value is used for result name.
3915 # @note It is not assumed that exact or approximate copy of theShape
3916 # can be obtained by applying existing Pipe operation on the
3917 # resulting "Path" wire taking theBase1 as the base - it is not
3918 # always possible; though in some particular cases it might work
3919 # it is not guaranteed. Thus, RestorePath function should not be
3920 # considered as an exact reverse operation of the Pipe.
3922 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3923 # source pipe's "path".
3925 # @ref tui_creation_pipe_path "Example"
3926 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3928 Build a middle path of a pipe-like shape.
3929 The path shape can be a wire or an edge.
3932 theShape It can be closed or unclosed pipe-like shell
3933 or a pipe-like solid.
3934 listEdges1, listEdges2 Two bases of the supposed pipe. This
3935 should be lists of edges of theShape.
3936 theName Object name; when specified, this parameter is used
3937 for result publication in the study. Otherwise, if automatic
3938 publication is switched on, default value is used for result name.
3941 New GEOM_Object, containing an edge or wire that represent
3944 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3945 RaiseIfFailed("RestorePath", self.PrimOp)
3946 self._autoPublish(anObj, theName, "path")
3952 ## @addtogroup l3_advanced
3955 ## Create a linear edge with specified ends.
3956 # @param thePnt1 Point for the first end of edge.
3957 # @param thePnt2 Point for the second end of edge.
3958 # @param theName Object name; when specified, this parameter is used
3959 # for result publication in the study. Otherwise, if automatic
3960 # publication is switched on, default value is used for result name.
3962 # @return New GEOM.GEOM_Object, containing the created edge.
3964 # @ref tui_creation_edge "Example"
3965 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3967 Create a linear edge with specified ends.
3970 thePnt1 Point for the first end of edge.
3971 thePnt2 Point for the second end of edge.
3972 theName Object name; when specified, this parameter is used
3973 for result publication in the study. Otherwise, if automatic
3974 publication is switched on, default value is used for result name.
3977 New GEOM.GEOM_Object, containing the created edge.
3979 # Example: see GEOM_TestAll.py
3980 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3981 RaiseIfFailed("MakeEdge", self.ShapesOp)
3982 self._autoPublish(anObj, theName, "edge")
3985 ## Create a new edge, corresponding to the given length on the given curve.
3986 # @param theRefCurve The referenced curve (edge).
3987 # @param theLength Length on the referenced curve. It can be negative.
3988 # @param theStartPoint Any point can be selected for it, the new edge will begin
3989 # at the end of \a theRefCurve, close to the selected point.
3990 # If None, start from the first point of \a theRefCurve.
3991 # @param theName Object name; when specified, this parameter is used
3992 # for result publication in the study. Otherwise, if automatic
3993 # publication is switched on, default value is used for result name.
3995 # @return New GEOM.GEOM_Object, containing the created edge.
3997 # @ref tui_creation_edge "Example"
3998 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4000 Create a new edge, corresponding to the given length on the given curve.
4003 theRefCurve The referenced curve (edge).
4004 theLength Length on the referenced curve. It can be negative.
4005 theStartPoint Any point can be selected for it, the new edge will begin
4006 at the end of theRefCurve, close to the selected point.
4007 If None, start from the first point of theRefCurve.
4008 theName Object name; when specified, this parameter is used
4009 for result publication in the study. Otherwise, if automatic
4010 publication is switched on, default value is used for result name.
4013 New GEOM.GEOM_Object, containing the created edge.
4015 # Example: see GEOM_TestAll.py
4016 theLength, Parameters = ParseParameters(theLength)
4017 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4018 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4019 anObj.SetParameters(Parameters)
4020 self._autoPublish(anObj, theName, "edge")
4023 ## Create an edge from specified wire.
4024 # @param theWire source Wire
4025 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4026 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4027 # @param theName Object name; when specified, this parameter is used
4028 # for result publication in the study. Otherwise, if automatic
4029 # publication is switched on, default value is used for result name.
4031 # @return New GEOM.GEOM_Object, containing the created edge.
4033 # @ref tui_creation_edge "Example"
4034 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4036 Create an edge from specified wire.
4040 theLinearTolerance linear tolerance value (default = 1e-07)
4041 theAngularTolerance angular tolerance value (default = 1e-12)
4042 theName Object name; when specified, this parameter is used
4043 for result publication in the study. Otherwise, if automatic
4044 publication is switched on, default value is used for result name.
4047 New GEOM.GEOM_Object, containing the created edge.
4049 # Example: see GEOM_TestAll.py
4050 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4051 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4052 self._autoPublish(anObj, theName, "edge")
4055 ## Create a wire from the set of edges and wires.
4056 # @param theEdgesAndWires List of edges and/or wires.
4057 # @param theTolerance Maximum distance between vertices, that will be merged.
4058 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4059 # @param theName Object name; when specified, this parameter is used
4060 # for result publication in the study. Otherwise, if automatic
4061 # publication is switched on, default value is used for result name.
4063 # @return New GEOM.GEOM_Object, containing the created wire.
4065 # @ref tui_creation_wire "Example"
4066 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4068 Create a wire from the set of edges and wires.
4071 theEdgesAndWires List of edges and/or wires.
4072 theTolerance Maximum distance between vertices, that will be merged.
4073 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4074 theName Object name; when specified, this parameter is used
4075 for result publication in the study. Otherwise, if automatic
4076 publication is switched on, default value is used for result name.
4079 New GEOM.GEOM_Object, containing the created wire.
4081 # Example: see GEOM_TestAll.py
4082 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4083 RaiseIfFailed("MakeWire", self.ShapesOp)
4084 self._autoPublish(anObj, theName, "wire")
4087 ## Create a face on the given wire.
4088 # @param theWire closed Wire or Edge to build the face on.
4089 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4090 # If the tolerance of the obtained planar face is less
4091 # than 1e-06, this face will be returned, otherwise the
4092 # algorithm tries to build any suitable face on the given
4093 # wire and prints a warning message.
4094 # @param theName Object name; when specified, this parameter is used
4095 # for result publication in the study. Otherwise, if automatic
4096 # publication is switched on, default value is used for result name.
4098 # @return New GEOM.GEOM_Object, containing the created face.
4100 # @ref tui_creation_face "Example"
4101 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4103 Create a face on the given wire.
4106 theWire closed Wire or Edge to build the face on.
4107 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4108 If the tolerance of the obtained planar face is less
4109 than 1e-06, this face will be returned, otherwise the
4110 algorithm tries to build any suitable face on the given
4111 wire and prints a warning message.
4112 theName Object name; when specified, this parameter is used
4113 for result publication in the study. Otherwise, if automatic
4114 publication is switched on, default value is used for result name.
4117 New GEOM.GEOM_Object, containing the created face.
4119 # Example: see GEOM_TestAll.py
4120 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4121 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4122 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4124 RaiseIfFailed("MakeFace", self.ShapesOp)
4125 self._autoPublish(anObj, theName, "face")
4128 ## Create a face on the given wires set.
4129 # @param theWires List of closed wires or edges to build the face on.
4130 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4131 # If the tolerance of the obtained planar face is less
4132 # than 1e-06, this face will be returned, otherwise the
4133 # algorithm tries to build any suitable face on the given
4134 # wire and prints a warning message.
4135 # @param theName Object name; when specified, this parameter is used
4136 # for result publication in the study. Otherwise, if automatic
4137 # publication is switched on, default value is used for result name.
4139 # @return New GEOM.GEOM_Object, containing the created face.
4141 # @ref tui_creation_face "Example"
4142 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4144 Create a face on the given wires set.
4147 theWires List of closed wires or edges to build the face on.
4148 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4149 If the tolerance of the obtained planar face is less
4150 than 1e-06, this face will be returned, otherwise the
4151 algorithm tries to build any suitable face on the given
4152 wire and prints a warning message.
4153 theName Object name; when specified, this parameter is used
4154 for result publication in the study. Otherwise, if automatic
4155 publication is switched on, default value is used for result name.
4158 New GEOM.GEOM_Object, containing the created face.
4160 # Example: see GEOM_TestAll.py
4161 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4162 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4163 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4165 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4166 self._autoPublish(anObj, theName, "face")
4169 ## See MakeFaceWires() method for details.
4171 # @ref tui_creation_face "Example 1"
4172 # \n @ref swig_MakeFaces "Example 2"
4173 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4175 See geompy.MakeFaceWires() method for details.
4177 # Example: see GEOM_TestOthers.py
4178 # note: auto-publishing is done in self.MakeFaceWires()
4179 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4182 ## Create a shell from the set of faces and shells.
4183 # @param theFacesAndShells List of faces and/or shells.
4184 # @param theName Object name; when specified, this parameter is used
4185 # for result publication in the study. Otherwise, if automatic
4186 # publication is switched on, default value is used for result name.
4188 # @return New GEOM.GEOM_Object, containing the created shell.
4190 # @ref tui_creation_shell "Example"
4191 def MakeShell(self, theFacesAndShells, theName=None):
4193 Create a shell from the set of faces and shells.
4196 theFacesAndShells List of faces and/or shells.
4197 theName Object name; when specified, this parameter is used
4198 for result publication in the study. Otherwise, if automatic
4199 publication is switched on, default value is used for result name.
4202 New GEOM.GEOM_Object, containing the created shell.
4204 # Example: see GEOM_TestAll.py
4205 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4206 RaiseIfFailed("MakeShell", self.ShapesOp)
4207 self._autoPublish(anObj, theName, "shell")
4210 ## Create a solid, bounded by the given shells.
4211 # @param theShells Sequence of bounding shells.
4212 # @param theName Object name; when specified, this parameter is used
4213 # for result publication in the study. Otherwise, if automatic
4214 # publication is switched on, default value is used for result name.
4216 # @return New GEOM.GEOM_Object, containing the created solid.
4218 # @ref tui_creation_solid "Example"
4219 def MakeSolid(self, theShells, theName=None):
4221 Create a solid, bounded by the given shells.
4224 theShells Sequence of bounding shells.
4225 theName Object name; when specified, this parameter is used
4226 for result publication in the study. Otherwise, if automatic
4227 publication is switched on, default value is used for result name.
4230 New GEOM.GEOM_Object, containing the created solid.
4232 # Example: see GEOM_TestAll.py
4233 if len(theShells) == 1:
4234 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4236 # raise RuntimeError, "MakeSolidShells : " + descr
4237 if descr == "WRN_SHAPE_UNCLOSED":
4238 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4239 anObj = self.ShapesOp.MakeSolidShells(theShells)
4240 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4241 self._autoPublish(anObj, theName, "solid")
4244 ## Create a compound of the given shapes.
4245 # @param theShapes List of shapes to put in compound.
4246 # @param theName Object name; when specified, this parameter is used
4247 # for result publication in the study. Otherwise, if automatic
4248 # publication is switched on, default value is used for result name.
4250 # @return New GEOM.GEOM_Object, containing the created compound.
4252 # @ref tui_creation_compound "Example"
4253 def MakeCompound(self, theShapes, theName=None):
4255 Create a compound of the given shapes.
4258 theShapes List of shapes to put in compound.
4259 theName Object name; when specified, this parameter is used
4260 for result publication in the study. Otherwise, if automatic
4261 publication is switched on, default value is used for result name.
4264 New GEOM.GEOM_Object, containing the created compound.
4266 # Example: see GEOM_TestAll.py
4267 anObj = self.ShapesOp.MakeCompound(theShapes)
4268 RaiseIfFailed("MakeCompound", self.ShapesOp)
4269 self._autoPublish(anObj, theName, "compound")
4272 # end of l3_advanced
4275 ## @addtogroup l2_measure
4278 ## Gives quantity of faces in the given shape.
4279 # @param theShape Shape to count faces of.
4280 # @return Quantity of faces.
4282 # @ref swig_NumberOf "Example"
4283 def NumberOfFaces(self, theShape):
4285 Gives quantity of faces in the given shape.
4288 theShape Shape to count faces of.
4293 # Example: see GEOM_TestOthers.py
4294 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4295 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4298 ## Gives quantity of edges in the given shape.
4299 # @param theShape Shape to count edges of.
4300 # @return Quantity of edges.
4302 # @ref swig_NumberOf "Example"
4303 def NumberOfEdges(self, theShape):
4305 Gives quantity of edges in the given shape.
4308 theShape Shape to count edges of.
4313 # Example: see GEOM_TestOthers.py
4314 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4315 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4318 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4319 # @param theShape Shape to count sub-shapes of.
4320 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4321 # @return Quantity of sub-shapes of given type.
4323 # @ref swig_NumberOf "Example"
4324 def NumberOfSubShapes(self, theShape, theShapeType):
4326 Gives quantity of sub-shapes of type theShapeType in the given shape.
4329 theShape Shape to count sub-shapes of.
4330 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4333 Quantity of sub-shapes of given type.
4335 # Example: see GEOM_TestOthers.py
4336 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4337 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4340 ## Gives quantity of solids in the given shape.
4341 # @param theShape Shape to count solids in.
4342 # @return Quantity of solids.
4344 # @ref swig_NumberOf "Example"
4345 def NumberOfSolids(self, theShape):
4347 Gives quantity of solids in the given shape.
4350 theShape Shape to count solids in.
4355 # Example: see GEOM_TestOthers.py
4356 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4357 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4363 ## @addtogroup l3_healing
4366 ## Reverses an orientation the given shape.
4367 # @param theShape Shape to be reversed.
4368 # @param theName Object name; when specified, this parameter is used
4369 # for result publication in the study. Otherwise, if automatic
4370 # publication is switched on, default value is used for result name.
4372 # @return The reversed copy of theShape.
4374 # @ref swig_ChangeOrientation "Example"
4375 def ChangeOrientation(self, theShape, theName=None):
4377 Reverses an orientation the given shape.
4380 theShape Shape to be reversed.
4381 theName Object name; when specified, this parameter is used
4382 for result publication in the study. Otherwise, if automatic
4383 publication is switched on, default value is used for result name.
4386 The reversed copy of theShape.
4388 # Example: see GEOM_TestAll.py
4389 anObj = self.ShapesOp.ChangeOrientation(theShape)
4390 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4391 self._autoPublish(anObj, theName, "reversed")
4394 ## See ChangeOrientation() method for details.
4396 # @ref swig_OrientationChange "Example"
4397 def OrientationChange(self, theShape, theName=None):
4399 See geompy.ChangeOrientation method for details.
4401 # Example: see GEOM_TestOthers.py
4402 # note: auto-publishing is done in self.ChangeOrientation()
4403 anObj = self.ChangeOrientation(theShape, theName)
4409 ## @addtogroup l4_obtain
4412 ## Retrieve all free faces from the given shape.
4413 # Free face is a face, which is not shared between two shells of the shape.
4414 # @param theShape Shape to find free faces in.
4415 # @return List of IDs of all free faces, contained in theShape.
4417 # @ref tui_measurement_tools_page "Example"
4418 def GetFreeFacesIDs(self,theShape):
4420 Retrieve all free faces from the given shape.
4421 Free face is a face, which is not shared between two shells of the shape.
4424 theShape Shape to find free faces in.
4427 List of IDs of all free faces, contained in theShape.
4429 # Example: see GEOM_TestOthers.py
4430 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4431 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4434 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4435 # @param theShape1 Shape to find sub-shapes in.
4436 # @param theShape2 Shape to find shared sub-shapes with.
4437 # @param theShapeType Type of sub-shapes to be retrieved.
4438 # @param theName Object name; when specified, this parameter is used
4439 # for result publication in the study. Otherwise, if automatic
4440 # publication is switched on, default value is used for result name.
4442 # @return List of sub-shapes of theShape1, shared with theShape2.
4444 # @ref swig_GetSharedShapes "Example"
4445 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4447 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4450 theShape1 Shape to find sub-shapes in.
4451 theShape2 Shape to find shared sub-shapes with.
4452 theShapeType Type of sub-shapes to be retrieved.
4453 theName Object name; when specified, this parameter is used
4454 for result publication in the study. Otherwise, if automatic
4455 publication is switched on, default value is used for result name.
4458 List of sub-shapes of theShape1, shared with theShape2.
4460 # Example: see GEOM_TestOthers.py
4461 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4462 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4463 self._autoPublish(aList, theName, "shared")
4466 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4467 # @param theShapes Shapes to find common sub-shapes of.
4468 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4469 # @param theName Object name; when specified, this parameter is used
4470 # for result publication in the study. Otherwise, if automatic
4471 # publication is switched on, default value is used for result name.
4473 # @return List of objects, that are sub-shapes of all given shapes.
4475 # @ref swig_GetSharedShapes "Example"
4476 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4478 Get all sub-shapes, shared by all shapes in the list theShapes.
4481 theShapes Shapes to find common sub-shapes of.
4482 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4483 theName Object name; when specified, this parameter is used
4484 for result publication in the study. Otherwise, if automatic
4485 publication is switched on, default value is used for result name.
4488 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4490 # Example: see GEOM_TestOthers.py
4491 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4492 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4493 self._autoPublish(aList, theName, "shared")
4496 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4497 # situated relatively the specified plane by the certain way,
4498 # defined through <VAR>theState</VAR> parameter.
4499 # @param theShape Shape to find sub-shapes of.
4500 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4501 # @param theAx1 Vector (or line, or linear edge), specifying normal
4502 # direction and location of the plane to find shapes on.
4503 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4504 # @param theName Object name; when specified, this parameter is used
4505 # for result publication in the study. Otherwise, if automatic
4506 # publication is switched on, default value is used for result name.
4508 # @return List of all found sub-shapes.
4510 # @ref swig_GetShapesOnPlane "Example"
4511 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4513 Find in theShape all sub-shapes of type theShapeType,
4514 situated relatively the specified plane by the certain way,
4515 defined through theState parameter.
4518 theShape Shape to find sub-shapes of.
4519 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4520 theAx1 Vector (or line, or linear edge), specifying normal
4521 direction and location of the plane to find shapes on.
4522 theState The state of the sub-shapes to find (see GEOM::shape_state)
4523 theName Object name; when specified, this parameter is used
4524 for result publication in the study. Otherwise, if automatic
4525 publication is switched on, default value is used for result name.
4528 List of all found sub-shapes.
4530 # Example: see GEOM_TestOthers.py
4531 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4532 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4533 self._autoPublish(aList, theName, "shapeOnPlane")
4536 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4537 # situated relatively the specified plane by the certain way,
4538 # defined through <VAR>theState</VAR> parameter.
4539 # @param theShape Shape to find sub-shapes of.
4540 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4541 # @param theAx1 Vector (or line, or linear edge), specifying normal
4542 # direction and location of the plane to find shapes on.
4543 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4545 # @return List of all found sub-shapes indices.
4547 # @ref swig_GetShapesOnPlaneIDs "Example"
4548 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4550 Find in theShape all sub-shapes of type theShapeType,
4551 situated relatively the specified plane by the certain way,
4552 defined through theState parameter.
4555 theShape Shape to find sub-shapes of.
4556 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4557 theAx1 Vector (or line, or linear edge), specifying normal
4558 direction and location of the plane to find shapes on.
4559 theState The state of the sub-shapes to find (see GEOM::shape_state)
4562 List of all found sub-shapes indices.
4564 # Example: see GEOM_TestOthers.py
4565 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4566 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4569 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4570 # situated relatively the specified plane by the certain way,
4571 # defined through <VAR>theState</VAR> parameter.
4572 # @param theShape Shape to find sub-shapes of.
4573 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4574 # @param theAx1 Vector (or line, or linear edge), specifying normal
4575 # direction of the plane to find shapes on.
4576 # @param thePnt Point specifying location of the plane to find shapes on.
4577 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4578 # @param theName Object name; when specified, this parameter is used
4579 # for result publication in the study. Otherwise, if automatic
4580 # publication is switched on, default value is used for result name.
4582 # @return List of all found sub-shapes.
4584 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4585 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4587 Find in theShape all sub-shapes of type theShapeType,
4588 situated relatively the specified plane by the certain way,
4589 defined through theState parameter.
4592 theShape Shape to find sub-shapes of.
4593 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4594 theAx1 Vector (or line, or linear edge), specifying normal
4595 direction and location of the plane to find shapes on.
4596 thePnt Point specifying location of the plane to find shapes on.
4597 theState The state of the sub-shapes to find (see GEOM::shape_state)
4598 theName Object name; when specified, this parameter is used
4599 for result publication in the study. Otherwise, if automatic
4600 publication is switched on, default value is used for result name.
4603 List of all found sub-shapes.
4605 # Example: see GEOM_TestOthers.py
4606 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4607 theAx1, thePnt, theState)
4608 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4609 self._autoPublish(aList, theName, "shapeOnPlane")
4612 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4613 # situated relatively the specified plane by the certain way,
4614 # defined through <VAR>theState</VAR> parameter.
4615 # @param theShape Shape to find sub-shapes of.
4616 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4617 # @param theAx1 Vector (or line, or linear edge), specifying normal
4618 # direction of the plane to find shapes on.
4619 # @param thePnt Point specifying location of the plane to find shapes on.
4620 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4622 # @return List of all found sub-shapes indices.
4624 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4625 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4627 Find in theShape all sub-shapes of type theShapeType,
4628 situated relatively the specified plane by the certain way,
4629 defined through theState parameter.
4632 theShape Shape to find sub-shapes of.
4633 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4634 theAx1 Vector (or line, or linear edge), specifying normal
4635 direction and location of the plane to find shapes on.
4636 thePnt Point specifying location of the plane to find shapes on.
4637 theState The state of the sub-shapes to find (see GEOM::shape_state)
4640 List of all found sub-shapes indices.
4642 # Example: see GEOM_TestOthers.py
4643 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4644 theAx1, thePnt, theState)
4645 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4648 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4649 # the specified cylinder by the certain way, defined through \a theState parameter.
4650 # @param theShape Shape to find sub-shapes of.
4651 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4652 # @param theAxis Vector (or line, or linear edge), specifying
4653 # axis of the cylinder to find shapes on.
4654 # @param theRadius Radius of the cylinder to find shapes on.
4655 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4656 # @param theName Object name; when specified, this parameter is used
4657 # for result publication in the study. Otherwise, if automatic
4658 # publication is switched on, default value is used for result name.
4660 # @return List of all found sub-shapes.
4662 # @ref swig_GetShapesOnCylinder "Example"
4663 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4665 Find in theShape all sub-shapes of type theShapeType, situated relatively
4666 the specified cylinder by the certain way, defined through theState parameter.
4669 theShape Shape to find sub-shapes of.
4670 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4671 theAxis Vector (or line, or linear edge), specifying
4672 axis of the cylinder to find shapes on.
4673 theRadius Radius of the cylinder to find shapes on.
4674 theState The state of the sub-shapes to find (see GEOM::shape_state)
4675 theName Object name; when specified, this parameter is used
4676 for result publication in the study. Otherwise, if automatic
4677 publication is switched on, default value is used for result name.
4680 List of all found sub-shapes.
4682 # Example: see GEOM_TestOthers.py
4683 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4684 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4685 self._autoPublish(aList, theName, "shapeOnCylinder")
4688 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4689 # the specified cylinder by the certain way, defined through \a theState parameter.
4690 # @param theShape Shape to find sub-shapes of.
4691 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4692 # @param theAxis Vector (or line, or linear edge), specifying
4693 # axis of the cylinder to find shapes on.
4694 # @param theRadius Radius of the cylinder to find shapes on.
4695 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4697 # @return List of all found sub-shapes indices.
4699 # @ref swig_GetShapesOnCylinderIDs "Example"
4700 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4702 Find in theShape all sub-shapes of type theShapeType, situated relatively
4703 the specified cylinder by the certain way, defined through theState parameter.
4706 theShape Shape to find sub-shapes of.
4707 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4708 theAxis Vector (or line, or linear edge), specifying
4709 axis of the cylinder to find shapes on.
4710 theRadius Radius of the cylinder to find shapes on.
4711 theState The state of the sub-shapes to find (see GEOM::shape_state)
4714 List of all found sub-shapes indices.
4716 # Example: see GEOM_TestOthers.py
4717 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4718 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4721 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4722 # the specified cylinder by the certain way, defined through \a theState parameter.
4723 # @param theShape Shape to find sub-shapes of.
4724 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4725 # @param theAxis Vector (or line, or linear edge), specifying
4726 # axis of the cylinder to find shapes on.
4727 # @param thePnt Point specifying location of the bottom of the cylinder.
4728 # @param theRadius Radius of the cylinder to find shapes on.
4729 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4730 # @param theName Object name; when specified, this parameter is used
4731 # for result publication in the study. Otherwise, if automatic
4732 # publication is switched on, default value is used for result name.
4734 # @return List of all found sub-shapes.
4736 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4737 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4739 Find in theShape all sub-shapes of type theShapeType, situated relatively
4740 the specified cylinder by the certain way, defined through theState parameter.
4743 theShape Shape to find sub-shapes of.
4744 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4745 theAxis Vector (or line, or linear edge), specifying
4746 axis of the cylinder to find shapes on.
4747 theRadius Radius of the cylinder to find shapes on.
4748 theState The state of the sub-shapes to find (see GEOM::shape_state)
4749 theName Object name; when specified, this parameter is used
4750 for result publication in the study. Otherwise, if automatic
4751 publication is switched on, default value is used for result name.
4754 List of all found sub-shapes.
4756 # Example: see GEOM_TestOthers.py
4757 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4758 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4759 self._autoPublish(aList, theName, "shapeOnCylinder")
4762 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4763 # the specified cylinder by the certain way, defined through \a theState parameter.
4764 # @param theShape Shape to find sub-shapes of.
4765 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4766 # @param theAxis Vector (or line, or linear edge), specifying
4767 # axis of the cylinder to find shapes on.
4768 # @param thePnt Point specifying location of the bottom of the cylinder.
4769 # @param theRadius Radius of the cylinder to find shapes on.
4770 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4772 # @return List of all found sub-shapes indices
4774 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4775 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4777 Find in theShape all sub-shapes of type theShapeType, situated relatively
4778 the specified cylinder by the certain way, defined through theState parameter.
4781 theShape Shape to find sub-shapes of.
4782 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4783 theAxis Vector (or line, or linear edge), specifying
4784 axis of the cylinder to find shapes on.
4785 theRadius Radius of the cylinder to find shapes on.
4786 theState The state of the sub-shapes to find (see GEOM::shape_state)
4789 List of all found sub-shapes indices.
4791 # Example: see GEOM_TestOthers.py
4792 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4793 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4796 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4797 # the specified sphere by the certain way, defined through \a theState parameter.
4798 # @param theShape Shape to find sub-shapes of.
4799 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4800 # @param theCenter Point, specifying center of the sphere to find shapes on.
4801 # @param theRadius Radius of the sphere to find shapes on.
4802 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4803 # @param theName Object name; when specified, this parameter is used
4804 # for result publication in the study. Otherwise, if automatic
4805 # publication is switched on, default value is used for result name.
4807 # @return List of all found sub-shapes.
4809 # @ref swig_GetShapesOnSphere "Example"
4810 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4812 Find in theShape all sub-shapes of type theShapeType, situated relatively
4813 the specified sphere by the certain way, defined through theState parameter.
4816 theShape Shape to find sub-shapes of.
4817 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4818 theCenter Point, specifying center of the sphere to find shapes on.
4819 theRadius Radius of the sphere to find shapes on.
4820 theState The state of the sub-shapes to find (see GEOM::shape_state)
4821 theName Object name; when specified, this parameter is used
4822 for result publication in the study. Otherwise, if automatic
4823 publication is switched on, default value is used for result name.
4826 List of all found sub-shapes.
4828 # Example: see GEOM_TestOthers.py
4829 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4830 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4831 self._autoPublish(aList, theName, "shapeOnSphere")
4834 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4835 # the specified sphere by the certain way, defined through \a theState parameter.
4836 # @param theShape Shape to find sub-shapes of.
4837 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4838 # @param theCenter Point, specifying center of the sphere to find shapes on.
4839 # @param theRadius Radius of the sphere to find shapes on.
4840 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4842 # @return List of all found sub-shapes indices.
4844 # @ref swig_GetShapesOnSphereIDs "Example"
4845 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4847 Find in theShape all sub-shapes of type theShapeType, situated relatively
4848 the specified sphere by the certain way, defined through theState parameter.
4851 theShape Shape to find sub-shapes of.
4852 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4853 theCenter Point, specifying center of the sphere to find shapes on.
4854 theRadius Radius of the sphere to find shapes on.
4855 theState The state of the sub-shapes to find (see GEOM::shape_state)
4858 List of all found sub-shapes indices.
4860 # Example: see GEOM_TestOthers.py
4861 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4862 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4865 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4866 # the specified quadrangle by the certain way, defined through \a theState parameter.
4867 # @param theShape Shape to find sub-shapes of.
4868 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4869 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4870 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4871 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4872 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4873 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4874 # @param theName Object name; when specified, this parameter is used
4875 # for result publication in the study. Otherwise, if automatic
4876 # publication is switched on, default value is used for result name.
4878 # @return List of all found sub-shapes.
4880 # @ref swig_GetShapesOnQuadrangle "Example"
4881 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4882 theTopLeftPoint, theTopRigthPoint,
4883 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4885 Find in theShape all sub-shapes of type theShapeType, situated relatively
4886 the specified quadrangle by the certain way, defined through theState parameter.
4889 theShape Shape to find sub-shapes of.
4890 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4891 theTopLeftPoint Point, specifying top left corner of a quadrangle
4892 theTopRigthPoint Point, specifying top right corner of a quadrangle
4893 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4894 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4895 theState The state of the sub-shapes to find (see GEOM::shape_state)
4896 theName Object name; when specified, this parameter is used
4897 for result publication in the study. Otherwise, if automatic
4898 publication is switched on, default value is used for result name.
4901 List of all found sub-shapes.
4903 # Example: see GEOM_TestOthers.py
4904 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4905 theTopLeftPoint, theTopRigthPoint,
4906 theBottomLeftPoint, theBottomRigthPoint, theState)
4907 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4908 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4911 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4912 # the specified quadrangle by the certain way, defined through \a theState parameter.
4913 # @param theShape Shape to find sub-shapes of.
4914 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4915 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4916 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4917 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4918 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4919 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4921 # @return List of all found sub-shapes indices.
4923 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4924 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4925 theTopLeftPoint, theTopRigthPoint,
4926 theBottomLeftPoint, theBottomRigthPoint, theState):
4928 Find in theShape all sub-shapes of type theShapeType, situated relatively
4929 the specified quadrangle by the certain way, defined through theState parameter.
4932 theShape Shape to find sub-shapes of.
4933 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4934 theTopLeftPoint Point, specifying top left corner of a quadrangle
4935 theTopRigthPoint Point, specifying top right corner of a quadrangle
4936 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4937 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4938 theState The state of the sub-shapes to find (see GEOM::shape_state)
4941 List of all found sub-shapes indices.
4944 # Example: see GEOM_TestOthers.py
4945 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4946 theTopLeftPoint, theTopRigthPoint,
4947 theBottomLeftPoint, theBottomRigthPoint, theState)
4948 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4951 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4952 # the specified \a theBox by the certain way, defined through \a theState parameter.
4953 # @param theBox Shape for relative comparing.
4954 # @param theShape Shape to find sub-shapes of.
4955 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4956 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4957 # @param theName Object name; when specified, this parameter is used
4958 # for result publication in the study. Otherwise, if automatic
4959 # publication is switched on, default value is used for result name.
4961 # @return List of all found sub-shapes.
4963 # @ref swig_GetShapesOnBox "Example"
4964 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4966 Find in theShape all sub-shapes of type theShapeType, situated relatively
4967 the specified theBox by the certain way, defined through theState parameter.
4970 theBox Shape for relative comparing.
4971 theShape Shape to find sub-shapes of.
4972 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4973 theState The state of the sub-shapes to find (see GEOM::shape_state)
4974 theName Object name; when specified, this parameter is used
4975 for result publication in the study. Otherwise, if automatic
4976 publication is switched on, default value is used for result name.
4979 List of all found sub-shapes.
4981 # Example: see GEOM_TestOthers.py
4982 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
4983 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
4984 self._autoPublish(aList, theName, "shapeOnBox")
4987 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4988 # the specified \a theBox by the certain way, defined through \a theState parameter.
4989 # @param theBox Shape for relative comparing.
4990 # @param theShape Shape to find sub-shapes of.
4991 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4992 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4994 # @return List of all found sub-shapes indices.
4996 # @ref swig_GetShapesOnBoxIDs "Example"
4997 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
4999 Find in theShape all sub-shapes of type theShapeType, situated relatively
5000 the specified theBox by the certain way, defined through theState parameter.
5003 theBox Shape for relative comparing.
5004 theShape Shape to find sub-shapes of.
5005 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5006 theState The state of the sub-shapes to find (see GEOM::shape_state)
5009 List of all found sub-shapes indices.
5011 # Example: see GEOM_TestOthers.py
5012 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5013 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5016 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5017 # situated relatively the specified \a theCheckShape by the
5018 # certain way, defined through \a theState parameter.
5019 # @param theCheckShape Shape for relative comparing. It must be a solid.
5020 # @param theShape Shape to find sub-shapes of.
5021 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5022 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5023 # @param theName Object name; when specified, this parameter is used
5024 # for result publication in the study. Otherwise, if automatic
5025 # publication is switched on, default value is used for result name.
5027 # @return List of all found sub-shapes.
5029 # @ref swig_GetShapesOnShape "Example"
5030 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5032 Find in theShape all sub-shapes of type theShapeType,
5033 situated relatively the specified theCheckShape by the
5034 certain way, defined through theState parameter.
5037 theCheckShape Shape for relative comparing. It must be a solid.
5038 theShape Shape to find sub-shapes of.
5039 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5040 theState The state of the sub-shapes to find (see GEOM::shape_state)
5041 theName Object name; when specified, this parameter is used
5042 for result publication in the study. Otherwise, if automatic
5043 publication is switched on, default value is used for result name.
5046 List of all found sub-shapes.
5048 # Example: see GEOM_TestOthers.py
5049 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5050 theShapeType, theState)
5051 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5052 self._autoPublish(aList, theName, "shapeOnShape")
5055 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5056 # situated relatively the specified \a theCheckShape by the
5057 # certain way, defined through \a theState parameter.
5058 # @param theCheckShape Shape for relative comparing. It must be a solid.
5059 # @param theShape Shape to find sub-shapes of.
5060 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5061 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5062 # @param theName Object name; when specified, this parameter is used
5063 # for result publication in the study. Otherwise, if automatic
5064 # publication is switched on, default value is used for result name.
5066 # @return All found sub-shapes as compound.
5068 # @ref swig_GetShapesOnShapeAsCompound "Example"
5069 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5071 Find in theShape all sub-shapes of type theShapeType,
5072 situated relatively the specified theCheckShape by the
5073 certain way, defined through theState parameter.
5076 theCheckShape Shape for relative comparing. It must be a solid.
5077 theShape Shape to find sub-shapes of.
5078 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5079 theState The state of the sub-shapes to find (see GEOM::shape_state)
5080 theName Object name; when specified, this parameter is used
5081 for result publication in the study. Otherwise, if automatic
5082 publication is switched on, default value is used for result name.
5085 All found sub-shapes as compound.
5087 # Example: see GEOM_TestOthers.py
5088 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5089 theShapeType, theState)
5090 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5091 self._autoPublish(anObj, theName, "shapeOnShape")
5094 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5095 # situated relatively the specified \a theCheckShape by the
5096 # certain way, defined through \a theState parameter.
5097 # @param theCheckShape Shape for relative comparing. It must be a solid.
5098 # @param theShape Shape to find sub-shapes of.
5099 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5100 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5102 # @return List of all found sub-shapes indices.
5104 # @ref swig_GetShapesOnShapeIDs "Example"
5105 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5107 Find in theShape all sub-shapes of type theShapeType,
5108 situated relatively the specified theCheckShape by the
5109 certain way, defined through theState parameter.
5112 theCheckShape Shape for relative comparing. It must be a solid.
5113 theShape Shape to find sub-shapes of.
5114 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5115 theState The state of the sub-shapes to find (see GEOM::shape_state)
5118 List of all found sub-shapes indices.
5120 # Example: see GEOM_TestOthers.py
5121 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5122 theShapeType, theState)
5123 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5126 ## Get sub-shape(s) of theShapeWhere, which are
5127 # coincident with \a theShapeWhat or could be a part of it.
5128 # @param theShapeWhere Shape to find sub-shapes of.
5129 # @param theShapeWhat Shape, specifying what to find.
5130 # @param isNewImplementation implementation of GetInPlace functionality
5131 # (default = False, old alghorithm based on shape properties)
5132 # @param theName Object name; when specified, this parameter is used
5133 # for result publication in the study. Otherwise, if automatic
5134 # publication is switched on, default value is used for result name.
5136 # @return Group of all found sub-shapes or a single found sub-shape.
5138 # @note This function has a restriction on argument shapes.
5139 # If \a theShapeWhere has curved parts with significantly
5140 # outstanding centres (i.e. the mass centre of a part is closer to
5141 # \a theShapeWhat than to the part), such parts will not be found.
5142 # @image html get_in_place_lost_part.png
5144 # @ref swig_GetInPlace "Example"
5145 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5147 Get sub-shape(s) of theShapeWhere, which are
5148 coincident with theShapeWhat or could be a part of it.
5151 theShapeWhere Shape to find sub-shapes of.
5152 theShapeWhat Shape, specifying what to find.
5153 isNewImplementation Implementation of GetInPlace functionality
5154 (default = False, old alghorithm based on shape properties)
5155 theName Object name; when specified, this parameter is used
5156 for result publication in the study. Otherwise, if automatic
5157 publication is switched on, default value is used for result name.
5160 Group of all found sub-shapes or a single found sub-shape.
5164 This function has a restriction on argument shapes.
5165 If theShapeWhere has curved parts with significantly
5166 outstanding centres (i.e. the mass centre of a part is closer to
5167 theShapeWhat than to the part), such parts will not be found.
5169 # Example: see GEOM_TestOthers.py
5171 if isNewImplementation:
5172 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5174 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5176 RaiseIfFailed("GetInPlace", self.ShapesOp)
5177 self._autoPublish(anObj, theName, "inplace")
5180 ## Get sub-shape(s) of \a theShapeWhere, which are
5181 # coincident with \a theShapeWhat or could be a part of it.
5183 # Implementation of this method is based on a saved history of an operation,
5184 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5185 # arguments (an argument shape or a sub-shape of an argument shape).
5186 # The operation could be the Partition or one of boolean operations,
5187 # performed on simple shapes (not on compounds).
5189 # @param theShapeWhere Shape to find sub-shapes of.
5190 # @param theShapeWhat Shape, specifying what to find (must be in the
5191 # building history of the ShapeWhere).
5192 # @param theName Object name; when specified, this parameter is used
5193 # for result publication in the study. Otherwise, if automatic
5194 # publication is switched on, default value is used for result name.
5196 # @return Group of all found sub-shapes or a single found sub-shape.
5198 # @ref swig_GetInPlace "Example"
5199 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5201 Implementation of this method is based on a saved history of an operation,
5202 produced theShapeWhere. The theShapeWhat must be among this operation's
5203 arguments (an argument shape or a sub-shape of an argument shape).
5204 The operation could be the Partition or one of boolean operations,
5205 performed on simple shapes (not on compounds).
5208 theShapeWhere Shape to find sub-shapes of.
5209 theShapeWhat Shape, specifying what to find (must be in the
5210 building history of the ShapeWhere).
5211 theName Object name; when specified, this parameter is used
5212 for result publication in the study. Otherwise, if automatic
5213 publication is switched on, default value is used for result name.
5216 Group of all found sub-shapes or a single found sub-shape.
5218 # Example: see GEOM_TestOthers.py
5219 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5220 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5221 self._autoPublish(anObj, theName, "inplace")
5224 ## Get sub-shape of theShapeWhere, which is
5225 # equal to \a theShapeWhat.
5226 # @param theShapeWhere Shape to find sub-shape of.
5227 # @param theShapeWhat Shape, specifying what to find.
5228 # @param theName Object name; when specified, this parameter is used
5229 # for result publication in the study. Otherwise, if automatic
5230 # publication is switched on, default value is used for result name.
5232 # @return New GEOM.GEOM_Object for found sub-shape.
5234 # @ref swig_GetSame "Example"
5235 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5237 Get sub-shape of theShapeWhere, which is
5238 equal to theShapeWhat.
5241 theShapeWhere Shape to find sub-shape of.
5242 theShapeWhat Shape, specifying what to find.
5243 theName Object name; when specified, this parameter is used
5244 for result publication in the study. Otherwise, if automatic
5245 publication is switched on, default value is used for result name.
5248 New GEOM.GEOM_Object for found sub-shape.
5250 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5251 RaiseIfFailed("GetSame", self.ShapesOp)
5252 self._autoPublish(anObj, theName, "sameShape")
5256 ## Get sub-shape indices of theShapeWhere, which is
5257 # equal to \a theShapeWhat.
5258 # @param theShapeWhere Shape to find sub-shape of.
5259 # @param theShapeWhat Shape, specifying what to find.
5260 # @return List of all found sub-shapes indices.
5262 # @ref swig_GetSame "Example"
5263 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5265 Get sub-shape indices of theShapeWhere, which is
5266 equal to theShapeWhat.
5269 theShapeWhere Shape to find sub-shape of.
5270 theShapeWhat Shape, specifying what to find.
5273 List of all found sub-shapes indices.
5275 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5276 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5283 ## @addtogroup l4_access
5286 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5287 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5288 # @param aShape Shape to get sub-shape of.
5289 # @param ListOfID List of sub-shapes indices.
5290 # @param theName Object name; when specified, this parameter is used
5291 # for result publication in the study. Otherwise, if automatic
5292 # publication is switched on, default value is used for result name.
5294 # @return Found sub-shape.
5296 # @ref swig_all_decompose "Example"
5297 def GetSubShape(self, aShape, ListOfID, theName=None):
5299 Obtain a composite sub-shape of aShape, composed from sub-shapes
5300 of aShape, selected by their unique IDs inside aShape
5303 aShape Shape to get sub-shape of.
5304 ListOfID List of sub-shapes indices.
5305 theName Object name; when specified, this parameter is used
5306 for result publication in the study. Otherwise, if automatic
5307 publication is switched on, default value is used for result name.
5312 # Example: see GEOM_TestAll.py
5313 anObj = self.AddSubShape(aShape,ListOfID)
5314 self._autoPublish(anObj, theName, "subshape")
5317 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5318 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5319 # @param aShape Shape to get sub-shape of.
5320 # @param aSubShape Sub-shapes of aShape.
5321 # @return ID of found sub-shape.
5323 # @ref swig_all_decompose "Example"
5324 def GetSubShapeID(self, aShape, aSubShape):
5326 Obtain unique ID of sub-shape aSubShape inside aShape
5327 of aShape, selected by their unique IDs inside aShape
5330 aShape Shape to get sub-shape of.
5331 aSubShape Sub-shapes of aShape.
5334 ID of found sub-shape.
5336 # Example: see GEOM_TestAll.py
5337 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5338 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5341 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5342 # This function is provided for performance purpose. The complexity is O(n) with n
5343 # the number of subobjects of aShape
5344 # @param aShape Shape to get sub-shape of.
5345 # @param aSubShapes Sub-shapes of aShape.
5346 # @return list of IDs of found sub-shapes.
5348 # @ref swig_all_decompose "Example"
5349 def GetSubShapesIDs(self, aShape, aSubShapes):
5351 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5352 This function is provided for performance purpose. The complexity is O(n) with n
5353 the number of subobjects of aShape
5356 aShape Shape to get sub-shape of.
5357 aSubShapes Sub-shapes of aShape.
5360 List of IDs of found sub-shape.
5362 # Example: see GEOM_TestAll.py
5363 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5364 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5370 ## @addtogroup l4_decompose
5373 ## Get all sub-shapes and groups of \a theShape,
5374 # that were created already by any other methods.
5375 # @param theShape Any shape.
5376 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5377 # returned, else all found sub-shapes and groups.
5378 # @return List of existing sub-objects of \a theShape.
5380 # @ref swig_all_decompose "Example"
5381 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5383 Get all sub-shapes and groups of theShape,
5384 that were created already by any other methods.
5388 theGroupsOnly If this parameter is TRUE, only groups will be
5389 returned, else all found sub-shapes and groups.
5392 List of existing sub-objects of theShape.
5394 # Example: see GEOM_TestAll.py
5395 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5396 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5399 ## Get all groups of \a theShape,
5400 # that were created already by any other methods.
5401 # @param theShape Any shape.
5402 # @return List of existing groups of \a theShape.
5404 # @ref swig_all_decompose "Example"
5405 def GetGroups(self, theShape):
5407 Get all groups of theShape,
5408 that were created already by any other methods.
5414 List of existing groups of theShape.
5416 # Example: see GEOM_TestAll.py
5417 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5418 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5421 ## Explode a shape on sub-shapes of a given type.
5422 # If the shape itself matches the type, it is also returned.
5423 # @param aShape Shape to be exploded.
5424 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5425 # @param theName Object name; when specified, this parameter is used
5426 # for result publication in the study. Otherwise, if automatic
5427 # publication is switched on, default value is used for result name.
5429 # @return List of sub-shapes of type theShapeType, contained in theShape.
5431 # @ref swig_all_decompose "Example"
5432 def SubShapeAll(self, aShape, aType, theName=None):
5434 Explode a shape on sub-shapes of a given type.
5435 If the shape itself matches the type, it is also returned.
5438 aShape Shape to be exploded.
5439 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5440 theName Object name; when specified, this parameter is used
5441 for result publication in the study. Otherwise, if automatic
5442 publication is switched on, default value is used for result name.
5445 List of sub-shapes of type theShapeType, contained in theShape.
5447 # Example: see GEOM_TestAll.py
5448 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5449 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5450 self._autoPublish(ListObj, theName, "subshape")
5453 ## Explode a shape on sub-shapes of a given type.
5454 # @param aShape Shape to be exploded.
5455 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5456 # @return List of IDs of sub-shapes.
5458 # @ref swig_all_decompose "Example"
5459 def SubShapeAllIDs(self, aShape, aType):
5461 Explode a shape on sub-shapes of a given type.
5464 aShape Shape to be exploded (see geompy.ShapeType)
5465 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5468 List of IDs of sub-shapes.
5470 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5471 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5474 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5475 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5476 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5477 # @param aShape Shape to get sub-shape of.
5478 # @param ListOfInd List of sub-shapes indices.
5479 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5480 # @param theName Object name; when specified, this parameter is used
5481 # for result publication in the study. Otherwise, if automatic
5482 # publication is switched on, default value is used for result name.
5484 # @return A compound of sub-shapes of aShape.
5486 # @ref swig_all_decompose "Example"
5487 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5489 Obtain a compound of sub-shapes of aShape,
5490 selected by their indices in list of all sub-shapes of type aType.
5491 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5494 aShape Shape to get sub-shape of.
5495 ListOfID List of sub-shapes indices.
5496 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5497 theName Object name; when specified, this parameter is used
5498 for result publication in the study. Otherwise, if automatic
5499 publication is switched on, default value is used for result name.
5502 A compound of sub-shapes of aShape.
5504 # Example: see GEOM_TestAll.py
5506 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5507 for ind in ListOfInd:
5508 ListOfIDs.append(AllShapeIDsList[ind - 1])
5509 # note: auto-publishing is done in self.GetSubShape()
5510 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5513 ## Explode a shape on sub-shapes of a given type.
5514 # Sub-shapes will be sorted by coordinates of their gravity centers.
5515 # If the shape itself matches the type, it is also returned.
5516 # @param aShape Shape to be exploded.
5517 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5518 # @param theName Object name; when specified, this parameter is used
5519 # for result publication in the study. Otherwise, if automatic
5520 # publication is switched on, default value is used for result name.
5522 # @return List of sub-shapes of type theShapeType, contained in theShape.
5524 # @ref swig_SubShapeAllSorted "Example"
5525 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5527 Explode a shape on sub-shapes of a given type.
5528 Sub-shapes will be sorted by coordinates of their gravity centers.
5529 If the shape itself matches the type, it is also returned.
5532 aShape Shape to be exploded.
5533 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5534 theName Object name; when specified, this parameter is used
5535 for result publication in the study. Otherwise, if automatic
5536 publication is switched on, default value is used for result name.
5539 List of sub-shapes of type theShapeType, contained in theShape.
5541 # Example: see GEOM_TestAll.py
5542 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5543 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5544 self._autoPublish(ListObj, theName, "subshape")
5547 ## Explode a shape on sub-shapes of a given type.
5548 # Sub-shapes will be sorted by coordinates of their gravity centers.
5549 # @param aShape Shape to be exploded.
5550 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5551 # @return List of IDs of sub-shapes.
5553 # @ref swig_all_decompose "Example"
5554 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5556 Explode a shape on sub-shapes of a given type.
5557 Sub-shapes will be sorted by coordinates of their gravity centers.
5560 aShape Shape to be exploded.
5561 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5564 List of IDs of sub-shapes.
5566 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5567 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5570 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5571 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5572 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5573 # @param aShape Shape to get sub-shape of.
5574 # @param ListOfInd List of sub-shapes indices.
5575 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5576 # @param theName Object name; when specified, this parameter is used
5577 # for result publication in the study. Otherwise, if automatic
5578 # publication is switched on, default value is used for result name.
5580 # @return A compound of sub-shapes of aShape.
5582 # @ref swig_all_decompose "Example"
5583 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5585 Obtain a compound of sub-shapes of aShape,
5586 selected by they indices in sorted list of all sub-shapes of type aType.
5587 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5590 aShape Shape to get sub-shape of.
5591 ListOfID List of sub-shapes indices.
5592 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5593 theName Object name; when specified, this parameter is used
5594 for result publication in the study. Otherwise, if automatic
5595 publication is switched on, default value is used for result name.
5598 A compound of sub-shapes of aShape.
5600 # Example: see GEOM_TestAll.py
5602 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5603 for ind in ListOfInd:
5604 ListOfIDs.append(AllShapeIDsList[ind - 1])
5605 # note: auto-publishing is done in self.GetSubShape()
5606 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5609 ## Extract shapes (excluding the main shape) of given type.
5610 # @param aShape The shape.
5611 # @param aType The shape type (see ShapeType())
5612 # @param isSorted Boolean flag to switch sorting on/off.
5613 # @param theName Object name; when specified, this parameter is used
5614 # for result publication in the study. Otherwise, if automatic
5615 # publication is switched on, default value is used for result name.
5617 # @return List of sub-shapes of type aType, contained in aShape.
5619 # @ref swig_FilletChamfer "Example"
5620 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5622 Extract shapes (excluding the main shape) of given type.
5626 aType The shape type (see geompy.ShapeType)
5627 isSorted Boolean flag to switch sorting on/off.
5628 theName Object name; when specified, this parameter is used
5629 for result publication in the study. Otherwise, if automatic
5630 publication is switched on, default value is used for result name.
5633 List of sub-shapes of type aType, contained in aShape.
5635 # Example: see GEOM_TestAll.py
5636 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5637 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5638 self._autoPublish(ListObj, theName, "subshape")
5641 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5642 # @param aShape Main shape.
5643 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5644 # @param theName Object name; when specified, this parameter is used
5645 # for result publication in the study. Otherwise, if automatic
5646 # publication is switched on, default value is used for result name.
5647 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5649 # @ref swig_all_decompose "Example"
5650 def SubShapes(self, aShape, anIDs, theName=None):
5652 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5656 anIDs List of unique IDs of sub-shapes inside theMainShape.
5657 theName Object name; when specified, this parameter is used
5658 for result publication in the study. Otherwise, if automatic
5659 publication is switched on, default value is used for result name.
5662 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5664 # Example: see GEOM_TestAll.py
5665 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5666 RaiseIfFailed("SubShapes", self.ShapesOp)
5667 self._autoPublish(ListObj, theName, "subshape")
5670 # end of l4_decompose
5673 ## @addtogroup l4_decompose_d
5676 ## Deprecated method
5677 # It works like SubShapeAllSortedCentres(), but wrongly
5678 # defines centres of faces, shells and solids.
5679 def SubShapeAllSorted(self, aShape, aType, theName=None):
5682 It works like geompy.SubShapeAllSortedCentres, but wrongly
5683 defines centres of faces, shells and solids.
5685 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5686 RaiseIfFailed("MakeExplode", self.ShapesOp)
5687 self._autoPublish(ListObj, theName, "subshape")
5690 ## Deprecated method
5691 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5692 # defines centres of faces, shells and solids.
5693 def SubShapeAllSortedIDs(self, aShape, aType):
5696 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5697 defines centres of faces, shells and solids.
5699 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5700 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5703 ## Deprecated method
5704 # It works like SubShapeSortedCentres(), but has a bug
5705 # (wrongly defines centres of faces, shells and solids).
5706 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5709 It works like geompy.SubShapeSortedCentres, but has a bug
5710 (wrongly defines centres of faces, shells and solids).
5713 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5714 for ind in ListOfInd:
5715 ListOfIDs.append(AllShapeIDsList[ind - 1])
5716 # note: auto-publishing is done in self.GetSubShape()
5717 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5720 # end of l4_decompose_d
5723 ## @addtogroup l3_healing
5726 ## Apply a sequence of Shape Healing operators to the given object.
5727 # @param theShape Shape to be processed.
5728 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5729 # @param theParameters List of names of parameters
5730 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5731 # @param theValues List of values of parameters, in the same order
5732 # as parameters are listed in <VAR>theParameters</VAR> list.
5733 # @param theName Object name; when specified, this parameter is used
5734 # for result publication in the study. Otherwise, if automatic
5735 # publication is switched on, default value is used for result name.
5737 # <b> Operators and Parameters: </b> \n
5739 # * \b FixShape - corrects invalid shapes. \n
5740 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5741 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5743 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5744 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5745 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5746 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5748 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5749 # surfaces in segments using a certain angle. \n
5750 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5751 # if Angle=180, four if Angle=90, etc). \n
5752 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5754 # * \b SplitClosedFaces - splits closed faces in segments.
5755 # The number of segments depends on the number of splitting points.\n
5756 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5758 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5759 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5760 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5761 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5762 # This and the previous parameters can take the following values:\n
5763 # \b Parametric \b Continuity \n
5764 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5765 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5766 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5767 # ruling out sharp edges).\n
5768 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5769 # are of the same magnitude).\n
5770 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5771 # or surfaces (d/du C(u)) are the same at junction. \n
5772 # \b Geometric \b Continuity \n
5773 # \b G1: first derivatives are proportional at junction.\n
5774 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5775 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5776 # \b G2: first and second derivatives are proportional at junction.
5777 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5778 # continuity requires that the underlying parameterization was continuous as well.
5779 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5781 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5782 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5783 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5784 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5785 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5786 # with the specified parameters.\n
5787 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5788 # with the specified parameters.\n
5789 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5790 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5791 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5792 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5794 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5795 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5796 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5797 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5798 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5800 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5801 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5804 # @return New GEOM.GEOM_Object, containing processed shape.
5806 # \n @ref tui_shape_processing "Example"
5807 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5809 Apply a sequence of Shape Healing operators to the given object.
5812 theShape Shape to be processed.
5813 theValues List of values of parameters, in the same order
5814 as parameters are listed in theParameters list.
5815 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5816 theParameters List of names of parameters
5817 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5818 theName Object name; when specified, this parameter is used
5819 for result publication in the study. Otherwise, if automatic
5820 publication is switched on, default value is used for result name.
5822 Operators and Parameters:
5824 * FixShape - corrects invalid shapes.
5825 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5826 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5827 * FixFaceSize - removes small faces, such as spots and strips.
5828 * FixFaceSize.Tolerance - defines minimum possible face size.
5829 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5830 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5831 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5832 in segments using a certain angle.
5833 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5834 if Angle=180, four if Angle=90, etc).
5835 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5836 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5838 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5839 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5840 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5841 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5842 * SplitContinuity.CurveContinuity - required continuity for curves.
5843 This and the previous parameters can take the following values:
5845 Parametric Continuity:
5846 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5847 coincidental. The curves or surfaces may still meet at an angle,
5848 giving rise to a sharp corner or edge).
5849 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5850 are parallel, ruling out sharp edges).
5851 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5852 or surfaces are of the same magnitude).
5853 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5854 curves or surfaces (d/du C(u)) are the same at junction.
5856 Geometric Continuity:
5857 G1: first derivatives are proportional at junction.
5858 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5859 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5860 G2: first and second derivatives are proportional at junction. As the names imply,
5861 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5862 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5863 geometric continuity of order n, but not vice-versa.
5864 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5865 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5866 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5867 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5868 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5869 the specified parameters.
5870 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5871 the specified parameters.
5872 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5873 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5874 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5875 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5876 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5877 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5878 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5879 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5880 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5881 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5882 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5885 New GEOM.GEOM_Object, containing processed shape.
5887 Note: For more information look through SALOME Geometry User's Guide->
5888 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5890 # Example: see GEOM_TestHealing.py
5891 theValues,Parameters = ParseList(theValues)
5892 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5893 # To avoid script failure in case of good argument shape
5894 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5896 RaiseIfFailed("ProcessShape", self.HealOp)
5897 for string in (theOperators + theParameters):
5898 Parameters = ":" + Parameters
5900 anObj.SetParameters(Parameters)
5901 self._autoPublish(anObj, theName, "healed")
5904 ## Remove faces from the given object (shape).
5905 # @param theObject Shape to be processed.
5906 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5907 # removes ALL faces of the given object.
5908 # @param theName Object name; when specified, this parameter is used
5909 # for result publication in the study. Otherwise, if automatic
5910 # publication is switched on, default value is used for result name.
5912 # @return New GEOM.GEOM_Object, containing processed shape.
5914 # @ref tui_suppress_faces "Example"
5915 def SuppressFaces(self, theObject, theFaces, theName=None):
5917 Remove faces from the given object (shape).
5920 theObject Shape to be processed.
5921 theFaces Indices of faces to be removed, if EMPTY then the method
5922 removes ALL faces of the given object.
5923 theName Object name; when specified, this parameter is used
5924 for result publication in the study. Otherwise, if automatic
5925 publication is switched on, default value is used for result name.
5928 New GEOM.GEOM_Object, containing processed shape.
5930 # Example: see GEOM_TestHealing.py
5931 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5932 RaiseIfFailed("SuppressFaces", self.HealOp)
5933 self._autoPublish(anObj, theName, "suppressFaces")
5936 ## Sewing of some shapes into single shape.
5937 # @param ListShape Shapes to be processed.
5938 # @param theTolerance Required tolerance value.
5939 # @param AllowNonManifold Flag that allows non-manifold sewing.
5940 # @param theName Object name; when specified, this parameter is used
5941 # for result publication in the study. Otherwise, if automatic
5942 # publication is switched on, default value is used for result name.
5944 # @return New GEOM.GEOM_Object, containing processed shape.
5946 # @ref tui_sewing "Example"
5947 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5949 Sewing of some shapes into single shape.
5952 ListShape Shapes to be processed.
5953 theTolerance Required tolerance value.
5954 AllowNonManifold Flag that allows non-manifold sewing.
5955 theName Object name; when specified, this parameter is used
5956 for result publication in the study. Otherwise, if automatic
5957 publication is switched on, default value is used for result name.
5960 New GEOM.GEOM_Object, containing processed shape.
5962 # Example: see GEOM_TestHealing.py
5963 comp = self.MakeCompound(ListShape)
5964 # note: auto-publishing is done in self.Sew()
5965 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
5968 ## Sewing of the given object.
5969 # @param theObject Shape to be processed.
5970 # @param theTolerance Required tolerance value.
5971 # @param AllowNonManifold Flag that allows non-manifold sewing.
5972 # @param theName Object name; when specified, this parameter is used
5973 # for result publication in the study. Otherwise, if automatic
5974 # publication is switched on, default value is used for result name.
5976 # @return New GEOM.GEOM_Object, containing processed shape.
5977 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
5979 Sewing of the given object.
5982 theObject Shape to be processed.
5983 theTolerance Required tolerance value.
5984 AllowNonManifold Flag that allows non-manifold sewing.
5985 theName Object name; when specified, this parameter is used
5986 for result publication in the study. Otherwise, if automatic
5987 publication is switched on, default value is used for result name.
5990 New GEOM.GEOM_Object, containing processed shape.
5992 # Example: see MakeSewing() above
5993 theTolerance,Parameters = ParseParameters(theTolerance)
5994 if AllowNonManifold:
5995 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
5997 anObj = self.HealOp.Sew(theObject, theTolerance)
5998 RaiseIfFailed("Sew", self.HealOp)
5999 anObj.SetParameters(Parameters)
6000 self._autoPublish(anObj, theName, "sewed")
6003 ## Rebuild the topology of theCompound of solids by removing
6004 # of the faces that are shared by several solids.
6005 # @param theCompound Shape to be processed.
6006 # @param theName Object name; when specified, this parameter is used
6007 # for result publication in the study. Otherwise, if automatic
6008 # publication is switched on, default value is used for result name.
6010 # @return New GEOM.GEOM_Object, containing processed shape.
6012 # @ref tui_remove_webs "Example"
6013 def RemoveInternalFaces (self, theCompound, theName=None):
6015 Rebuild the topology of theCompound of solids by removing
6016 of the faces that are shared by several solids.
6019 theCompound Shape to be processed.
6020 theName Object name; when specified, this parameter is used
6021 for result publication in the study. Otherwise, if automatic
6022 publication is switched on, default value is used for result name.
6025 New GEOM.GEOM_Object, containing processed shape.
6027 # Example: see GEOM_TestHealing.py
6028 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6029 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6030 self._autoPublish(anObj, theName, "removeWebs")
6033 ## Remove internal wires and edges from the given object (face).
6034 # @param theObject Shape to be processed.
6035 # @param theWires Indices of wires to be removed, if EMPTY then the method
6036 # removes ALL internal wires of the given object.
6037 # @param theName Object name; when specified, this parameter is used
6038 # for result publication in the study. Otherwise, if automatic
6039 # publication is switched on, default value is used for result name.
6041 # @return New GEOM.GEOM_Object, containing processed shape.
6043 # @ref tui_suppress_internal_wires "Example"
6044 def SuppressInternalWires(self, theObject, theWires, theName=None):
6046 Remove internal wires and edges from the given object (face).
6049 theObject Shape to be processed.
6050 theWires Indices of wires to be removed, if EMPTY then the method
6051 removes ALL internal wires of the given object.
6052 theName Object name; when specified, this parameter is used
6053 for result publication in the study. Otherwise, if automatic
6054 publication is switched on, default value is used for result name.
6057 New GEOM.GEOM_Object, containing processed shape.
6059 # Example: see GEOM_TestHealing.py
6060 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6061 RaiseIfFailed("RemoveIntWires", self.HealOp)
6062 self._autoPublish(anObj, theName, "suppressWires")
6065 ## Remove internal closed contours (holes) from the given object.
6066 # @param theObject Shape to be processed.
6067 # @param theWires Indices of wires to be removed, if EMPTY then the method
6068 # removes ALL internal holes of the given object
6069 # @param theName Object name; when specified, this parameter is used
6070 # for result publication in the study. Otherwise, if automatic
6071 # publication is switched on, default value is used for result name.
6073 # @return New GEOM.GEOM_Object, containing processed shape.
6075 # @ref tui_suppress_holes "Example"
6076 def SuppressHoles(self, theObject, theWires, theName=None):
6078 Remove internal closed contours (holes) from the given object.
6081 theObject Shape to be processed.
6082 theWires Indices of wires to be removed, if EMPTY then the method
6083 removes ALL internal holes of the given object
6084 theName Object name; when specified, this parameter is used
6085 for result publication in the study. Otherwise, if automatic
6086 publication is switched on, default value is used for result name.
6089 New GEOM.GEOM_Object, containing processed shape.
6091 # Example: see GEOM_TestHealing.py
6092 anObj = self.HealOp.FillHoles(theObject, theWires)
6093 RaiseIfFailed("FillHoles", self.HealOp)
6094 self._autoPublish(anObj, theName, "suppressHoles")
6097 ## Close an open wire.
6098 # @param theObject Shape to be processed.
6099 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6100 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6101 # @param isCommonVertex If True : closure by creation of a common vertex,
6102 # If False : closure by creation of an edge between ends.
6103 # @param theName Object name; when specified, this parameter is used
6104 # for result publication in the study. Otherwise, if automatic
6105 # publication is switched on, default value is used for result name.
6107 # @return New GEOM.GEOM_Object, containing processed shape.
6109 # @ref tui_close_contour "Example"
6110 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6115 theObject Shape to be processed.
6116 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6117 if [ ], then theObject itself is a wire.
6118 isCommonVertex If True : closure by creation of a common vertex,
6119 If False : closure by creation of an edge between ends.
6120 theName Object name; when specified, this parameter is used
6121 for result publication in the study. Otherwise, if automatic
6122 publication is switched on, default value is used for result name.
6125 New GEOM.GEOM_Object, containing processed shape.
6127 # Example: see GEOM_TestHealing.py
6128 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6129 RaiseIfFailed("CloseContour", self.HealOp)
6130 self._autoPublish(anObj, theName, "closeContour")
6133 ## Addition of a point to a given edge object.
6134 # @param theObject Shape to be processed.
6135 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6136 # if -1, then theObject itself is the edge.
6137 # @param theValue Value of parameter on edge or length parameter,
6138 # depending on \a isByParameter.
6139 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6140 # if FALSE : \a theValue is treated as a length parameter [0..1]
6141 # @param theName Object name; when specified, this parameter is used
6142 # for result publication in the study. Otherwise, if automatic
6143 # publication is switched on, default value is used for result name.
6145 # @return New GEOM.GEOM_Object, containing processed shape.
6147 # @ref tui_add_point_on_edge "Example"
6148 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6150 Addition of a point to a given edge object.
6153 theObject Shape to be processed.
6154 theEdgeIndex Index of edge to be divided within theObject's shape,
6155 if -1, then theObject itself is the edge.
6156 theValue Value of parameter on edge or length parameter,
6157 depending on isByParameter.
6158 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6159 if FALSE : theValue is treated as a length parameter [0..1]
6160 theName Object name; when specified, this parameter is used
6161 for result publication in the study. Otherwise, if automatic
6162 publication is switched on, default value is used for result name.
6165 New GEOM.GEOM_Object, containing processed shape.
6167 # Example: see GEOM_TestHealing.py
6168 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6169 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6170 RaiseIfFailed("DivideEdge", self.HealOp)
6171 anObj.SetParameters(Parameters)
6172 self._autoPublish(anObj, theName, "divideEdge")
6175 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6176 # @param theWire Wire to minimize the number of C1 continuous edges in.
6177 # @param theVertices A list of vertices to suppress. If the list
6178 # is empty, all vertices in a wire will be assumed.
6179 # @param theName Object name; when specified, this parameter is used
6180 # for result publication in the study. Otherwise, if automatic
6181 # publication is switched on, default value is used for result name.
6183 # @return New GEOM.GEOM_Object with modified wire.
6185 # @ref tui_fuse_collinear_edges "Example"
6186 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6188 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6191 theWire Wire to minimize the number of C1 continuous edges in.
6192 theVertices A list of vertices to suppress. If the list
6193 is empty, all vertices in a wire will be assumed.
6194 theName Object name; when specified, this parameter is used
6195 for result publication in the study. Otherwise, if automatic
6196 publication is switched on, default value is used for result name.
6199 New GEOM.GEOM_Object with modified wire.
6201 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6202 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6203 self._autoPublish(anObj, theName, "fuseEdges")
6206 ## Change orientation of the given object. Updates given shape.
6207 # @param theObject Shape to be processed.
6208 # @return Updated <var>theObject</var>
6210 # @ref swig_todo "Example"
6211 def ChangeOrientationShell(self,theObject):
6213 Change orientation of the given object. Updates given shape.
6216 theObject Shape to be processed.
6221 theObject = self.HealOp.ChangeOrientation(theObject)
6222 RaiseIfFailed("ChangeOrientation", self.HealOp)
6225 ## Change orientation of the given object.
6226 # @param theObject Shape to be processed.
6227 # @param theName Object name; when specified, this parameter is used
6228 # for result publication in the study. Otherwise, if automatic
6229 # publication is switched on, default value is used for result name.
6231 # @return New GEOM.GEOM_Object, containing processed shape.
6233 # @ref swig_todo "Example"
6234 def ChangeOrientationShellCopy(self, theObject, theName=None):
6236 Change orientation of the given object.
6239 theObject Shape to be processed.
6240 theName Object name; when specified, this parameter is used
6241 for result publication in the study. Otherwise, if automatic
6242 publication is switched on, default value is used for result name.
6245 New GEOM.GEOM_Object, containing processed shape.
6247 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6248 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6249 self._autoPublish(anObj, theName, "reversed")
6252 ## Try to limit tolerance of the given object by value \a theTolerance.
6253 # @param theObject Shape to be processed.
6254 # @param theTolerance Required tolerance value.
6255 # @param theName Object name; when specified, this parameter is used
6256 # for result publication in the study. Otherwise, if automatic
6257 # publication is switched on, default value is used for result name.
6259 # @return New GEOM.GEOM_Object, containing processed shape.
6261 # @ref tui_limit_tolerance "Example"
6262 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6264 Try to limit tolerance of the given object by value theTolerance.
6267 theObject Shape to be processed.
6268 theTolerance Required tolerance value.
6269 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.
6274 New GEOM.GEOM_Object, containing processed shape.
6276 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6277 RaiseIfFailed("LimitTolerance", self.HealOp)
6278 self._autoPublish(anObj, theName, "limitTolerance")
6281 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6282 # that constitute a free boundary of the given shape.
6283 # @param theObject Shape to get free boundary of.
6284 # @param theName Object name; when specified, this parameter is used
6285 # for result publication in the study. Otherwise, if automatic
6286 # publication is switched on, default value is used for result name.
6288 # @return [\a status, \a theClosedWires, \a theOpenWires]
6289 # \n \a status: FALSE, if an error(s) occured during the method execution.
6290 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6291 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6293 # @ref tui_measurement_tools_page "Example"
6294 def GetFreeBoundary(self, theObject, theName=None):
6296 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6297 that constitute a free boundary of the given shape.
6300 theObject Shape to get free boundary of.
6301 theName Object name; when specified, this parameter is used
6302 for result publication in the study. Otherwise, if automatic
6303 publication is switched on, default value is used for result name.
6306 [status, theClosedWires, theOpenWires]
6307 status: FALSE, if an error(s) occured during the method execution.
6308 theClosedWires: Closed wires on the free boundary of the given shape.
6309 theOpenWires: Open wires on the free boundary of the given shape.
6311 # Example: see GEOM_TestHealing.py
6312 anObj = self.HealOp.GetFreeBoundary(theObject)
6313 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6314 self._autoPublish(anObj[1], theName, "closedWire")
6315 self._autoPublish(anObj[2], theName, "openWire")
6318 ## Replace coincident faces in theShape by one face.
6319 # @param theShape Initial shape.
6320 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6321 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6322 # otherwise all initial shapes.
6323 # @param theName Object name; when specified, this parameter is used
6324 # for result publication in the study. Otherwise, if automatic
6325 # publication is switched on, default value is used for result name.
6327 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6329 # @ref tui_glue_faces "Example"
6330 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6332 Replace coincident faces in theShape by one face.
6335 theShape Initial shape.
6336 theTolerance Maximum distance between faces, which can be considered as coincident.
6337 doKeepNonSolids If FALSE, only solids will present in the result,
6338 otherwise all initial shapes.
6339 theName Object name; when specified, this parameter is used
6340 for result publication in the study. Otherwise, if automatic
6341 publication is switched on, default value is used for result name.
6344 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6346 # Example: see GEOM_Spanner.py
6347 theTolerance,Parameters = ParseParameters(theTolerance)
6348 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6350 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6351 anObj.SetParameters(Parameters)
6352 self._autoPublish(anObj, theName, "glueFaces")
6355 ## Find coincident faces in theShape for possible gluing.
6356 # @param theShape Initial shape.
6357 # @param theTolerance Maximum distance between faces,
6358 # which can be considered as coincident.
6359 # @param theName Object name; when specified, this parameter is used
6360 # for result publication in the study. Otherwise, if automatic
6361 # publication is switched on, default value is used for result name.
6363 # @return GEOM.ListOfGO
6365 # @ref tui_glue_faces "Example"
6366 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6368 Find coincident faces in theShape for possible gluing.
6371 theShape Initial shape.
6372 theTolerance Maximum distance between faces,
6373 which can be considered as coincident.
6374 theName Object name; when specified, this parameter is used
6375 for result publication in the study. Otherwise, if automatic
6376 publication is switched on, default value is used for result name.
6381 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6382 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6383 self._autoPublish(anObj, theName, "facesToGlue")
6386 ## Replace coincident faces in theShape by one face
6387 # in compliance with given list of faces
6388 # @param theShape Initial shape.
6389 # @param theTolerance Maximum distance between faces,
6390 # which can be considered as coincident.
6391 # @param theFaces List of faces for gluing.
6392 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6393 # otherwise all initial shapes.
6394 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6395 # will be glued, otherwise only the edges,
6396 # belonging to <VAR>theFaces</VAR>.
6397 # @param theName Object name; when specified, this parameter is used
6398 # for result publication in the study. Otherwise, if automatic
6399 # publication is switched on, default value is used for result name.
6401 # @return New GEOM.GEOM_Object, containing a copy of theShape
6402 # without some faces.
6404 # @ref tui_glue_faces "Example"
6405 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6406 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6408 Replace coincident faces in theShape by one face
6409 in compliance with given list of faces
6412 theShape Initial shape.
6413 theTolerance Maximum distance between faces,
6414 which can be considered as coincident.
6415 theFaces List of faces for gluing.
6416 doKeepNonSolids If FALSE, only solids will present in the result,
6417 otherwise all initial shapes.
6418 doGlueAllEdges If TRUE, all coincident edges of theShape
6419 will be glued, otherwise only the edges,
6420 belonging to theFaces.
6421 theName Object name; when specified, this parameter is used
6422 for result publication in the study. Otherwise, if automatic
6423 publication is switched on, default value is used for result name.
6426 New GEOM.GEOM_Object, containing a copy of theShape
6429 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6430 doKeepNonSolids, doGlueAllEdges)
6432 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6433 self._autoPublish(anObj, theName, "glueFaces")
6436 ## Replace coincident edges in theShape by one edge.
6437 # @param theShape Initial shape.
6438 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6439 # @param theName Object name; when specified, this parameter is used
6440 # for result publication in the study. Otherwise, if automatic
6441 # publication is switched on, default value is used for result name.
6443 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6445 # @ref tui_glue_edges "Example"
6446 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6448 Replace coincident edges in theShape by one edge.
6451 theShape Initial shape.
6452 theTolerance Maximum distance between edges, which can be considered as coincident.
6453 theName Object name; when specified, this parameter is used
6454 for result publication in the study. Otherwise, if automatic
6455 publication is switched on, default value is used for result name.
6458 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6460 theTolerance,Parameters = ParseParameters(theTolerance)
6461 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6463 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6464 anObj.SetParameters(Parameters)
6465 self._autoPublish(anObj, theName, "glueEdges")
6468 ## Find coincident edges in theShape for possible gluing.
6469 # @param theShape Initial shape.
6470 # @param theTolerance Maximum distance between edges,
6471 # which can be considered as coincident.
6472 # @param theName Object name; when specified, this parameter is used
6473 # for result publication in the study. Otherwise, if automatic
6474 # publication is switched on, default value is used for result name.
6476 # @return GEOM.ListOfGO
6478 # @ref tui_glue_edges "Example"
6479 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6481 Find coincident edges in theShape for possible gluing.
6484 theShape Initial shape.
6485 theTolerance Maximum distance between edges,
6486 which can be considered as coincident.
6487 theName Object name; when specified, this parameter is used
6488 for result publication in the study. Otherwise, if automatic
6489 publication is switched on, default value is used for result name.
6494 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6495 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6496 self._autoPublish(anObj, theName, "edgesToGlue")
6499 ## Replace coincident edges in theShape by one edge
6500 # in compliance with given list of edges.
6501 # @param theShape Initial shape.
6502 # @param theTolerance Maximum distance between edges,
6503 # which can be considered as coincident.
6504 # @param theEdges List of edges for gluing.
6505 # @param theName Object name; when specified, this parameter is used
6506 # for result publication in the study. Otherwise, if automatic
6507 # publication is switched on, default value is used for result name.
6509 # @return New GEOM.GEOM_Object, containing a copy of theShape
6510 # without some edges.
6512 # @ref tui_glue_edges "Example"
6513 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6515 Replace coincident edges in theShape by one edge
6516 in compliance with given list of edges.
6519 theShape Initial shape.
6520 theTolerance Maximum distance between edges,
6521 which can be considered as coincident.
6522 theEdges List of edges for gluing.
6523 theName Object name; when specified, this parameter is used
6524 for result publication in the study. Otherwise, if automatic
6525 publication is switched on, default value is used for result name.
6528 New GEOM.GEOM_Object, containing a copy of theShape
6531 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6533 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6534 self._autoPublish(anObj, theName, "glueEdges")
6540 ## @addtogroup l3_boolean Boolean Operations
6543 # -----------------------------------------------------------------------------
6544 # Boolean (Common, Cut, Fuse, Section)
6545 # -----------------------------------------------------------------------------
6547 ## Perform one of boolean operations on two given shapes.
6548 # @param theShape1 First argument for boolean operation.
6549 # @param theShape2 Second argument for boolean operation.
6550 # @param theOperation Indicates the operation to be done:\n
6551 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6552 # @param theName Object name; when specified, this parameter is used
6553 # for result publication in the study. Otherwise, if automatic
6554 # publication is switched on, default value is used for result name.
6556 # @return New GEOM.GEOM_Object, containing the result shape.
6558 # @ref tui_fuse "Example"
6559 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6561 Perform one of boolean operations on two given shapes.
6564 theShape1 First argument for boolean operation.
6565 theShape2 Second argument for boolean operation.
6566 theOperation Indicates the operation to be done:
6567 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6568 theName Object name; when specified, this parameter is used
6569 for result publication in the study. Otherwise, if automatic
6570 publication is switched on, default value is used for result name.
6573 New GEOM.GEOM_Object, containing the result shape.
6575 # Example: see GEOM_TestAll.py
6576 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6577 RaiseIfFailed("MakeBoolean", self.BoolOp)
6578 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6579 self._autoPublish(anObj, theName, def_names[theOperation])
6582 ## Perform Common boolean operation on two given shapes.
6583 # @param theShape1 First argument for boolean operation.
6584 # @param theShape2 Second argument for boolean operation.
6585 # @param theName Object name; when specified, this parameter is used
6586 # for result publication in the study. Otherwise, if automatic
6587 # publication is switched on, default value is used for result name.
6589 # @return New GEOM.GEOM_Object, containing the result shape.
6591 # @ref tui_common "Example 1"
6592 # \n @ref swig_MakeCommon "Example 2"
6593 def MakeCommon(self, theShape1, theShape2, theName=None):
6595 Perform Common boolean operation on two given shapes.
6598 theShape1 First argument for boolean operation.
6599 theShape2 Second argument for boolean operation.
6600 theName Object name; when specified, this parameter is used
6601 for result publication in the study. Otherwise, if automatic
6602 publication is switched on, default value is used for result name.
6605 New GEOM.GEOM_Object, containing the result shape.
6607 # Example: see GEOM_TestOthers.py
6608 # note: auto-publishing is done in self.MakeBoolean()
6609 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6611 ## Perform Cut boolean operation on two given shapes.
6612 # @param theShape1 First argument for boolean operation.
6613 # @param theShape2 Second argument for boolean operation.
6614 # @param theName Object name; when specified, this parameter is used
6615 # for result publication in the study. Otherwise, if automatic
6616 # publication is switched on, default value is used for result name.
6618 # @return New GEOM.GEOM_Object, containing the result shape.
6620 # @ref tui_cut "Example 1"
6621 # \n @ref swig_MakeCommon "Example 2"
6622 def MakeCut(self, theShape1, theShape2, theName=None):
6624 Perform Cut boolean operation on two given shapes.
6627 theShape1 First argument for boolean operation.
6628 theShape2 Second argument for boolean operation.
6629 theName Object name; when specified, this parameter is used
6630 for result publication in the study. Otherwise, if automatic
6631 publication is switched on, default value is used for result name.
6634 New GEOM.GEOM_Object, containing the result shape.
6637 # Example: see GEOM_TestOthers.py
6638 # note: auto-publishing is done in self.MakeBoolean()
6639 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6641 ## Perform Fuse boolean operation on two given shapes.
6642 # @param theShape1 First argument for boolean operation.
6643 # @param theShape2 Second argument for boolean operation.
6644 # @param theName Object name; when specified, this parameter is used
6645 # for result publication in the study. Otherwise, if automatic
6646 # publication is switched on, default value is used for result name.
6648 # @return New GEOM.GEOM_Object, containing the result shape.
6650 # @ref tui_fuse "Example 1"
6651 # \n @ref swig_MakeCommon "Example 2"
6652 def MakeFuse(self, theShape1, theShape2, theName=None):
6654 Perform Fuse boolean operation on two given shapes.
6657 theShape1 First argument for boolean operation.
6658 theShape2 Second argument for boolean operation.
6659 theName Object name; when specified, this parameter is used
6660 for result publication in the study. Otherwise, if automatic
6661 publication is switched on, default value is used for result name.
6664 New GEOM.GEOM_Object, containing the result shape.
6667 # Example: see GEOM_TestOthers.py
6668 # note: auto-publishing is done in self.MakeBoolean()
6669 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6671 ## Perform Section boolean operation on two given shapes.
6672 # @param theShape1 First argument for boolean operation.
6673 # @param theShape2 Second argument for boolean operation.
6674 # @param theName Object name; when specified, this parameter is used
6675 # for result publication in the study. Otherwise, if automatic
6676 # publication is switched on, default value is used for result name.
6678 # @return New GEOM.GEOM_Object, containing the result shape.
6680 # @ref tui_section "Example 1"
6681 # \n @ref swig_MakeCommon "Example 2"
6682 def MakeSection(self, theShape1, theShape2, theName=None):
6684 Perform Section boolean operation on two given shapes.
6687 theShape1 First argument for boolean operation.
6688 theShape2 Second argument for boolean operation.
6689 theName Object name; when specified, this parameter is used
6690 for result publication in the study. Otherwise, if automatic
6691 publication is switched on, default value is used for result name.
6694 New GEOM.GEOM_Object, containing the result shape.
6697 # Example: see GEOM_TestOthers.py
6698 # note: auto-publishing is done in self.MakeBoolean()
6699 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6701 ## Perform Fuse boolean operation on the list of shapes.
6702 # @param theShapesList Shapes to be fused.
6703 # @param theName Object name; when specified, this parameter is used
6704 # for result publication in the study. Otherwise, if automatic
6705 # publication is switched on, default value is used for result name.
6707 # @return New GEOM.GEOM_Object, containing the result shape.
6709 # @ref tui_fuse "Example 1"
6710 # \n @ref swig_MakeCommon "Example 2"
6711 def MakeFuseList(self, theShapesList, theName=None):
6713 Perform Fuse boolean operation on the list of shapes.
6716 theShapesList Shapes to be fused.
6717 theName Object name; when specified, this parameter is used
6718 for result publication in the study. Otherwise, if automatic
6719 publication is switched on, default value is used for result name.
6722 New GEOM.GEOM_Object, containing the result shape.
6725 # Example: see GEOM_TestOthers.py
6726 anObj = self.BoolOp.MakeFuseList(theShapesList)
6727 RaiseIfFailed("MakeFuseList", self.BoolOp)
6728 self._autoPublish(anObj, theName, "fuse")
6731 ## Perform Common boolean operation on the list of shapes.
6732 # @param theShapesList Shapes for Common operation.
6733 # @param theName Object name; when specified, this parameter is used
6734 # for result publication in the study. Otherwise, if automatic
6735 # publication is switched on, default value is used for result name.
6737 # @return New GEOM.GEOM_Object, containing the result shape.
6739 # @ref tui_common "Example 1"
6740 # \n @ref swig_MakeCommon "Example 2"
6741 def MakeCommonList(self, theShapesList, theName=None):
6743 Perform Common boolean operation on the list of shapes.
6746 theShapesList Shapes for Common operation.
6747 theName Object name; when specified, this parameter is used
6748 for result publication in the study. Otherwise, if automatic
6749 publication is switched on, default value is used for result name.
6752 New GEOM.GEOM_Object, containing the result shape.
6755 # Example: see GEOM_TestOthers.py
6756 anObj = self.BoolOp.MakeCommonList(theShapesList)
6757 RaiseIfFailed("MakeCommonList", self.BoolOp)
6758 self._autoPublish(anObj, theName, "common")
6761 ## Perform Cut boolean operation on one object and the list of tools.
6762 # @param theMainShape The object of the operation.
6763 # @param theShapesList The list of tools of the operation.
6764 # @param theName Object name; when specified, this parameter is used
6765 # for result publication in the study. Otherwise, if automatic
6766 # publication is switched on, default value is used for result name.
6768 # @return New GEOM.GEOM_Object, containing the result shape.
6770 # @ref tui_cut "Example 1"
6771 # \n @ref swig_MakeCommon "Example 2"
6772 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6774 Perform Cut boolean operation on one object and the list of tools.
6777 theMainShape The object of the operation.
6778 theShapesList The list of tools of the operation.
6779 theName Object name; when specified, this parameter is used
6780 for result publication in the study. Otherwise, if automatic
6781 publication is switched on, default value is used for result name.
6784 New GEOM.GEOM_Object, containing the result shape.
6787 # Example: see GEOM_TestOthers.py
6788 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6789 RaiseIfFailed("MakeCutList", self.BoolOp)
6790 self._autoPublish(anObj, theName, "cut")
6796 ## @addtogroup l3_basic_op
6799 ## Perform partition operation.
6800 # @param ListShapes Shapes to be intersected.
6801 # @param ListTools Shapes to intersect theShapes.
6802 # @param Limit Type of resulting shapes (see ShapeType()).\n
6803 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6804 # type will be detected automatically.
6805 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6806 # target type (equal to Limit) are kept in the result,
6807 # else standalone shapes of lower dimension
6808 # are kept also (if they exist).
6809 # @param theName Object name; when specified, this parameter is used
6810 # for result publication in the study. Otherwise, if automatic
6811 # publication is switched on, default value is used for result name.
6813 # @note Each compound from ListShapes and ListTools will be exploded
6814 # in order to avoid possible intersection between shapes from this compound.
6816 # After implementation new version of PartitionAlgo (October 2006)
6817 # other parameters are ignored by current functionality. They are kept
6818 # in this function only for support old versions.
6819 # @param ListKeepInside Shapes, outside which the results will be deleted.
6820 # Each shape from theKeepInside must belong to theShapes also.
6821 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6822 # Each shape from theRemoveInside must belong to theShapes also.
6823 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6824 # @param ListMaterials Material indices for each shape. Make sence,
6825 # only if theRemoveWebs is TRUE.
6827 # @return New GEOM.GEOM_Object, containing the result shapes.
6829 # @ref tui_partition "Example"
6830 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6831 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6832 KeepNonlimitShapes=0, theName=None):
6834 Perform partition operation.
6837 ListShapes Shapes to be intersected.
6838 ListTools Shapes to intersect theShapes.
6839 Limit Type of resulting shapes (see geompy.ShapeType)
6840 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6841 type will be detected automatically.
6842 KeepNonlimitShapes if this parameter == 0, then only shapes of
6843 target type (equal to Limit) are kept in the result,
6844 else standalone shapes of lower dimension
6845 are kept also (if they exist).
6846 theName Object name; when specified, this parameter is used
6847 for result publication in the study. Otherwise, if automatic
6848 publication is switched on, default value is used for result name.
6850 Each compound from ListShapes and ListTools will be exploded
6851 in order to avoid possible intersection between shapes from
6854 After implementation new version of PartitionAlgo (October 2006) other
6855 parameters are ignored by current functionality. They are kept in this
6856 function only for support old versions.
6859 ListKeepInside Shapes, outside which the results will be deleted.
6860 Each shape from theKeepInside must belong to theShapes also.
6861 ListRemoveInside Shapes, inside which the results will be deleted.
6862 Each shape from theRemoveInside must belong to theShapes also.
6863 RemoveWebs If TRUE, perform Glue 3D algorithm.
6864 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6867 New GEOM.GEOM_Object, containing the result shapes.
6869 # Example: see GEOM_TestAll.py
6870 if Limit == self.ShapeType["AUTO"]:
6871 # automatic detection of the most appropriate shape limit type
6873 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6874 Limit = EnumToLong(lim)
6876 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6877 ListKeepInside, ListRemoveInside,
6878 Limit, RemoveWebs, ListMaterials,
6879 KeepNonlimitShapes);
6880 RaiseIfFailed("MakePartition", self.BoolOp)
6881 self._autoPublish(anObj, theName, "partition")
6884 ## Perform partition operation.
6885 # This method may be useful if it is needed to make a partition for
6886 # compound contains nonintersected shapes. Performance will be better
6887 # since intersection between shapes from compound is not performed.
6889 # Description of all parameters as in previous method MakePartition()
6891 # @note Passed compounds (via ListShapes or via ListTools)
6892 # have to consist of nonintersecting shapes.
6894 # @return New GEOM.GEOM_Object, containing the result shapes.
6896 # @ref swig_todo "Example"
6897 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6898 ListKeepInside=[], ListRemoveInside=[],
6899 Limit=ShapeType["AUTO"], RemoveWebs=0,
6900 ListMaterials=[], KeepNonlimitShapes=0,
6903 Perform partition operation.
6904 This method may be useful if it is needed to make a partition for
6905 compound contains nonintersected shapes. Performance will be better
6906 since intersection between shapes from compound is not performed.
6909 Description of all parameters as in method geompy.MakePartition
6912 Passed compounds (via ListShapes or via ListTools)
6913 have to consist of nonintersecting shapes.
6916 New GEOM.GEOM_Object, containing the result shapes.
6918 if Limit == self.ShapeType["AUTO"]:
6919 # automatic detection of the most appropriate shape limit type
6921 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6922 Limit = EnumToLong(lim)
6924 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6925 ListKeepInside, ListRemoveInside,
6926 Limit, RemoveWebs, ListMaterials,
6927 KeepNonlimitShapes);
6928 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6929 self._autoPublish(anObj, theName, "partition")
6932 ## See method MakePartition() for more information.
6934 # @ref tui_partition "Example 1"
6935 # \n @ref swig_Partition "Example 2"
6936 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6937 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6938 KeepNonlimitShapes=0, theName=None):
6940 See method geompy.MakePartition for more information.
6942 # Example: see GEOM_TestOthers.py
6943 # note: auto-publishing is done in self.MakePartition()
6944 anObj = self.MakePartition(ListShapes, ListTools,
6945 ListKeepInside, ListRemoveInside,
6946 Limit, RemoveWebs, ListMaterials,
6947 KeepNonlimitShapes, theName);
6950 ## Perform partition of the Shape with the Plane
6951 # @param theShape Shape to be intersected.
6952 # @param thePlane Tool shape, to intersect theShape.
6953 # @param theName Object name; when specified, this parameter is used
6954 # for result publication in the study. Otherwise, if automatic
6955 # publication is switched on, default value is used for result name.
6957 # @return New GEOM.GEOM_Object, containing the result shape.
6959 # @ref tui_partition "Example"
6960 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6962 Perform partition of the Shape with the Plane
6965 theShape Shape to be intersected.
6966 thePlane Tool shape, to intersect theShape.
6967 theName Object name; when specified, this parameter is used
6968 for result publication in the study. Otherwise, if automatic
6969 publication is switched on, default value is used for result name.
6972 New GEOM.GEOM_Object, containing the result shape.
6974 # Example: see GEOM_TestAll.py
6975 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6976 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6977 self._autoPublish(anObj, theName, "partition")
6980 # end of l3_basic_op
6983 ## @addtogroup l3_transform
6986 ## Translate the given object along the vector, specified
6987 # by its end points.
6988 # @param theObject The object to be translated.
6989 # @param thePoint1 Start point of translation vector.
6990 # @param thePoint2 End point of translation vector.
6991 # @param theCopy Flag used to translate object itself or create a copy.
6992 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6993 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6994 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6996 Translate the given object along the vector, specified by its end points.
6999 theObject The object to be translated.
7000 thePoint1 Start point of translation vector.
7001 thePoint2 End point of translation vector.
7002 theCopy Flag used to translate object itself or create a copy.
7005 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7006 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7009 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7011 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7012 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7015 ## Translate the given object along the vector, specified
7016 # by its end points, creating its copy before the translation.
7017 # @param theObject The object to be translated.
7018 # @param thePoint1 Start point of translation vector.
7019 # @param thePoint2 End point of translation vector.
7020 # @param theName Object name; when specified, this parameter is used
7021 # for result publication in the study. Otherwise, if automatic
7022 # publication is switched on, default value is used for result name.
7024 # @return New GEOM.GEOM_Object, containing the translated object.
7026 # @ref tui_translation "Example 1"
7027 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7028 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7030 Translate the given object along the vector, specified
7031 by its end points, creating its copy before the translation.
7034 theObject The object to be translated.
7035 thePoint1 Start point of translation vector.
7036 thePoint2 End point of translation vector.
7037 theName Object name; when specified, this parameter is used
7038 for result publication in the study. Otherwise, if automatic
7039 publication is switched on, default value is used for result name.
7042 New GEOM.GEOM_Object, containing the translated object.
7044 # Example: see GEOM_TestAll.py
7045 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7046 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7047 self._autoPublish(anObj, theName, "translated")
7050 ## Translate the given object along the vector, specified by its components.
7051 # @param theObject The object to be translated.
7052 # @param theDX,theDY,theDZ Components of translation vector.
7053 # @param theCopy Flag used to translate object itself or create a copy.
7054 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7055 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7057 # @ref tui_translation "Example"
7058 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7060 Translate the given object along the vector, specified by its components.
7063 theObject The object to be translated.
7064 theDX,theDY,theDZ Components of translation vector.
7065 theCopy Flag used to translate object itself or create a copy.
7068 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7069 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7071 # Example: see GEOM_TestAll.py
7072 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7074 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7076 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7077 anObj.SetParameters(Parameters)
7078 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7081 ## Translate the given object along the vector, specified
7082 # by its components, creating its copy before the translation.
7083 # @param theObject The object to be translated.
7084 # @param theDX,theDY,theDZ Components of translation vector.
7085 # @param theName Object name; when specified, this parameter is used
7086 # for result publication in the study. Otherwise, if automatic
7087 # publication is switched on, default value is used for result name.
7089 # @return New GEOM.GEOM_Object, containing the translated object.
7091 # @ref tui_translation "Example"
7092 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7094 Translate the given object along the vector, specified
7095 by its components, creating its copy before the translation.
7098 theObject The object to be translated.
7099 theDX,theDY,theDZ Components of translation vector.
7100 theName Object name; when specified, this parameter is used
7101 for result publication in the study. Otherwise, if automatic
7102 publication is switched on, default value is used for result name.
7105 New GEOM.GEOM_Object, containing the translated object.
7107 # Example: see GEOM_TestAll.py
7108 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7109 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7110 anObj.SetParameters(Parameters)
7111 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7112 self._autoPublish(anObj, theName, "translated")
7115 ## Translate the given object along the given vector.
7116 # @param theObject The object to be translated.
7117 # @param theVector The translation vector.
7118 # @param theCopy Flag used to translate object itself or create a copy.
7119 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7120 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7121 def TranslateVector(self, theObject, theVector, theCopy=False):
7123 Translate the given object along the given vector.
7126 theObject The object to be translated.
7127 theVector The translation vector.
7128 theCopy Flag used to translate object itself or create a copy.
7131 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7132 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7135 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7137 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7138 RaiseIfFailed("TranslateVector", self.TrsfOp)
7141 ## Translate the given object along the given vector,
7142 # creating its copy before the translation.
7143 # @param theObject The object to be translated.
7144 # @param theVector The translation vector.
7145 # @param theName Object name; when specified, this parameter is used
7146 # for result publication in the study. Otherwise, if automatic
7147 # publication is switched on, default value is used for result name.
7149 # @return New GEOM.GEOM_Object, containing the translated object.
7151 # @ref tui_translation "Example"
7152 def MakeTranslationVector(self, theObject, theVector, theName=None):
7154 Translate the given object along the given vector,
7155 creating its copy before the translation.
7158 theObject The object to be translated.
7159 theVector The translation vector.
7160 theName Object name; when specified, this parameter is used
7161 for result publication in the study. Otherwise, if automatic
7162 publication is switched on, default value is used for result name.
7165 New GEOM.GEOM_Object, containing the translated object.
7167 # Example: see GEOM_TestAll.py
7168 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7169 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7170 self._autoPublish(anObj, theName, "translated")
7173 ## Translate the given object along the given vector on given distance.
7174 # @param theObject The object to be translated.
7175 # @param theVector The translation vector.
7176 # @param theDistance The translation distance.
7177 # @param theCopy Flag used to translate object itself or create a copy.
7178 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7179 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7181 # @ref tui_translation "Example"
7182 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7184 Translate the given object along the given vector on given distance.
7187 theObject The object to be translated.
7188 theVector The translation vector.
7189 theDistance The translation distance.
7190 theCopy Flag used to translate object itself or create a copy.
7193 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7194 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7196 # Example: see GEOM_TestAll.py
7197 theDistance,Parameters = ParseParameters(theDistance)
7198 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7199 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7200 anObj.SetParameters(Parameters)
7203 ## Translate the given object along the given vector on given distance,
7204 # creating its copy before the translation.
7205 # @param theObject The object to be translated.
7206 # @param theVector The translation vector.
7207 # @param theDistance The translation distance.
7208 # @param theName Object name; when specified, this parameter is used
7209 # for result publication in the study. Otherwise, if automatic
7210 # publication is switched on, default value is used for result name.
7212 # @return New GEOM.GEOM_Object, containing the translated object.
7214 # @ref tui_translation "Example"
7215 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7217 Translate the given object along the given vector on given distance,
7218 creating its copy before the translation.
7221 theObject The object to be translated.
7222 theVector The translation vector.
7223 theDistance The translation distance.
7224 theName Object name; when specified, this parameter is used
7225 for result publication in the study. Otherwise, if automatic
7226 publication is switched on, default value is used for result name.
7229 New GEOM.GEOM_Object, containing the translated object.
7231 # Example: see GEOM_TestAll.py
7232 theDistance,Parameters = ParseParameters(theDistance)
7233 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7234 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7235 anObj.SetParameters(Parameters)
7236 self._autoPublish(anObj, theName, "translated")
7239 ## Rotate the given object around the given axis on the given angle.
7240 # @param theObject The object to be rotated.
7241 # @param theAxis Rotation axis.
7242 # @param theAngle Rotation angle in radians.
7243 # @param theCopy Flag used to rotate object itself or create a copy.
7245 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7246 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7248 # @ref tui_rotation "Example"
7249 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7251 Rotate the given object around the given axis on the given angle.
7254 theObject The object to be rotated.
7255 theAxis Rotation axis.
7256 theAngle Rotation angle in radians.
7257 theCopy Flag used to rotate object itself or create a copy.
7260 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7261 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7263 # Example: see GEOM_TestAll.py
7265 if isinstance(theAngle,str):
7267 theAngle, Parameters = ParseParameters(theAngle)
7269 theAngle = theAngle*math.pi/180.0
7271 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7273 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7274 RaiseIfFailed("Rotate", self.TrsfOp)
7275 anObj.SetParameters(Parameters)
7278 ## Rotate the given object around the given axis
7279 # on the given angle, creating its copy before the rotatation.
7280 # @param theObject The object to be rotated.
7281 # @param theAxis Rotation axis.
7282 # @param theAngle Rotation angle in radians.
7283 # @param theName Object name; when specified, this parameter is used
7284 # for result publication in the study. Otherwise, if automatic
7285 # publication is switched on, default value is used for result name.
7287 # @return New GEOM.GEOM_Object, containing the rotated object.
7289 # @ref tui_rotation "Example"
7290 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7292 Rotate the given object around the given axis
7293 on the given angle, creating its copy before the rotatation.
7296 theObject The object to be rotated.
7297 theAxis Rotation axis.
7298 theAngle Rotation angle in radians.
7299 theName Object name; when specified, this parameter is used
7300 for result publication in the study. Otherwise, if automatic
7301 publication is switched on, default value is used for result name.
7304 New GEOM.GEOM_Object, containing the rotated object.
7306 # Example: see GEOM_TestAll.py
7308 if isinstance(theAngle,str):
7310 theAngle, Parameters = ParseParameters(theAngle)
7312 theAngle = theAngle*math.pi/180.0
7313 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7314 RaiseIfFailed("RotateCopy", self.TrsfOp)
7315 anObj.SetParameters(Parameters)
7316 self._autoPublish(anObj, theName, "rotated")
7319 ## Rotate given object around vector perpendicular to plane
7320 # containing three points.
7321 # @param theObject The object to be rotated.
7322 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7323 # containing the three points.
7324 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7325 # @param theCopy Flag used to rotate object itself or create a copy.
7326 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7327 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7328 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7330 Rotate given object around vector perpendicular to plane
7331 containing three points.
7334 theObject The object to be rotated.
7335 theCentPoint central point the axis is the vector perpendicular to the plane
7336 containing the three points.
7337 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7338 theCopy Flag used to rotate object itself or create a copy.
7341 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7342 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7345 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7347 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7348 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7351 ## Rotate given object around vector perpendicular to plane
7352 # containing three points, creating its copy before the rotatation.
7353 # @param theObject The object to be rotated.
7354 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7355 # containing the three points.
7356 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7357 # @param theName Object name; when specified, this parameter is used
7358 # for result publication in the study. Otherwise, if automatic
7359 # publication is switched on, default value is used for result name.
7361 # @return New GEOM.GEOM_Object, containing the rotated object.
7363 # @ref tui_rotation "Example"
7364 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7366 Rotate given object around vector perpendicular to plane
7367 containing three points, creating its copy before the rotatation.
7370 theObject The object to be rotated.
7371 theCentPoint central point the axis is the vector perpendicular to the plane
7372 containing the three points.
7373 thePoint1,thePoint2 in a perpendicular plane of the axis.
7374 theName Object name; when specified, this parameter is used
7375 for result publication in the study. Otherwise, if automatic
7376 publication is switched on, default value is used for result name.
7379 New GEOM.GEOM_Object, containing the rotated object.
7381 # Example: see GEOM_TestAll.py
7382 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7383 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7384 self._autoPublish(anObj, theName, "rotated")
7387 ## Scale the given object by the specified factor.
7388 # @param theObject The object to be scaled.
7389 # @param thePoint Center point for scaling.
7390 # Passing None for it means scaling relatively the origin of global CS.
7391 # @param theFactor Scaling factor value.
7392 # @param theCopy Flag used to scale object itself or create a copy.
7393 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7394 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7395 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7397 Scale the given object by the specified factor.
7400 theObject The object to be scaled.
7401 thePoint Center point for scaling.
7402 Passing None for it means scaling relatively the origin of global CS.
7403 theFactor Scaling factor value.
7404 theCopy Flag used to scale object itself or create a copy.
7407 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7408 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7410 # Example: see GEOM_TestAll.py
7411 theFactor, Parameters = ParseParameters(theFactor)
7413 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7415 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7416 RaiseIfFailed("Scale", self.TrsfOp)
7417 anObj.SetParameters(Parameters)
7420 ## Scale the given object by the factor, creating its copy before the scaling.
7421 # @param theObject The object to be scaled.
7422 # @param thePoint Center point for scaling.
7423 # Passing None for it means scaling relatively the origin of global CS.
7424 # @param theFactor Scaling factor value.
7425 # @param theName Object name; when specified, this parameter is used
7426 # for result publication in the study. Otherwise, if automatic
7427 # publication is switched on, default value is used for result name.
7429 # @return New GEOM.GEOM_Object, containing the scaled shape.
7431 # @ref tui_scale "Example"
7432 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7434 Scale the given object by the factor, creating its copy before the scaling.
7437 theObject The object to be scaled.
7438 thePoint Center point for scaling.
7439 Passing None for it means scaling relatively the origin of global CS.
7440 theFactor Scaling factor value.
7441 theName Object name; when specified, this parameter is used
7442 for result publication in the study. Otherwise, if automatic
7443 publication is switched on, default value is used for result name.
7446 New GEOM.GEOM_Object, containing the scaled shape.
7448 # Example: see GEOM_TestAll.py
7449 theFactor, Parameters = ParseParameters(theFactor)
7450 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7451 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7452 anObj.SetParameters(Parameters)
7453 self._autoPublish(anObj, theName, "scaled")
7456 ## Scale the given object by different factors along coordinate axes.
7457 # @param theObject The object to be scaled.
7458 # @param thePoint Center point for scaling.
7459 # Passing None for it means scaling relatively the origin of global CS.
7460 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7461 # @param theCopy Flag used to scale object itself or create a copy.
7462 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7463 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7464 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7466 Scale the given object by different factors along coordinate axes.
7469 theObject The object to be scaled.
7470 thePoint Center point for scaling.
7471 Passing None for it means scaling relatively the origin of global CS.
7472 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7473 theCopy Flag used to scale object itself or create a copy.
7476 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7477 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7479 # Example: see GEOM_TestAll.py
7480 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7482 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7483 theFactorX, theFactorY, theFactorZ)
7485 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7486 theFactorX, theFactorY, theFactorZ)
7487 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7488 anObj.SetParameters(Parameters)
7491 ## Scale the given object by different factors along coordinate axes,
7492 # creating its copy before the scaling.
7493 # @param theObject The object to be scaled.
7494 # @param thePoint Center point for scaling.
7495 # Passing None for it means scaling relatively the origin of global CS.
7496 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7497 # @param theName Object name; when specified, this parameter is used
7498 # for result publication in the study. Otherwise, if automatic
7499 # publication is switched on, default value is used for result name.
7501 # @return New GEOM.GEOM_Object, containing the scaled shape.
7503 # @ref swig_scale "Example"
7504 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7506 Scale the given object by different factors along coordinate axes,
7507 creating its copy before the scaling.
7510 theObject The object to be scaled.
7511 thePoint Center point for scaling.
7512 Passing None for it means scaling relatively the origin of global CS.
7513 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7514 theName Object name; when specified, this parameter is used
7515 for result publication in the study. Otherwise, if automatic
7516 publication is switched on, default value is used for result name.
7519 New GEOM.GEOM_Object, containing the scaled shape.
7521 # Example: see GEOM_TestAll.py
7522 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7523 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7524 theFactorX, theFactorY, theFactorZ)
7525 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7526 anObj.SetParameters(Parameters)
7527 self._autoPublish(anObj, theName, "scaled")
7530 ## Mirror an object relatively the given plane.
7531 # @param theObject The object to be mirrored.
7532 # @param thePlane Plane of symmetry.
7533 # @param theCopy Flag used to mirror object itself or create a copy.
7534 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7535 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7536 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7538 Mirror an object relatively the given plane.
7541 theObject The object to be mirrored.
7542 thePlane Plane of symmetry.
7543 theCopy Flag used to mirror object itself or create a copy.
7546 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7547 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7550 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7552 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7553 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7556 ## Create an object, symmetrical
7557 # to the given one relatively the given plane.
7558 # @param theObject The object to be mirrored.
7559 # @param thePlane Plane of symmetry.
7560 # @param theName Object name; when specified, this parameter is used
7561 # for result publication in the study. Otherwise, if automatic
7562 # publication is switched on, default value is used for result name.
7564 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7566 # @ref tui_mirror "Example"
7567 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7569 Create an object, symmetrical to the given one relatively the given plane.
7572 theObject The object to be mirrored.
7573 thePlane Plane of symmetry.
7574 theName Object name; when specified, this parameter is used
7575 for result publication in the study. Otherwise, if automatic
7576 publication is switched on, default value is used for result name.
7579 New GEOM.GEOM_Object, containing the mirrored shape.
7581 # Example: see GEOM_TestAll.py
7582 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7583 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7584 self._autoPublish(anObj, theName, "mirrored")
7587 ## Mirror an object relatively the given axis.
7588 # @param theObject The object to be mirrored.
7589 # @param theAxis Axis of symmetry.
7590 # @param theCopy Flag used to mirror object itself or create a copy.
7591 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7592 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7593 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7595 Mirror an object relatively the given axis.
7598 theObject The object to be mirrored.
7599 theAxis Axis of symmetry.
7600 theCopy Flag used to mirror object itself or create a copy.
7603 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7604 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7607 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7609 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7610 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7613 ## Create an object, symmetrical
7614 # to the given one relatively the given axis.
7615 # @param theObject The object to be mirrored.
7616 # @param theAxis Axis of symmetry.
7617 # @param theName Object name; when specified, this parameter is used
7618 # for result publication in the study. Otherwise, if automatic
7619 # publication is switched on, default value is used for result name.
7621 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7623 # @ref tui_mirror "Example"
7624 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7626 Create an object, symmetrical to the given one relatively the given axis.
7629 theObject The object to be mirrored.
7630 theAxis Axis of symmetry.
7631 theName Object name; when specified, this parameter is used
7632 for result publication in the study. Otherwise, if automatic
7633 publication is switched on, default value is used for result name.
7636 New GEOM.GEOM_Object, containing the mirrored shape.
7638 # Example: see GEOM_TestAll.py
7639 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7640 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7641 self._autoPublish(anObj, theName, "mirrored")
7644 ## Mirror an object relatively the given point.
7645 # @param theObject The object to be mirrored.
7646 # @param thePoint Point of symmetry.
7647 # @param theCopy Flag used to mirror object itself or create a copy.
7648 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7649 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7650 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7652 Mirror an object relatively the given point.
7655 theObject The object to be mirrored.
7656 thePoint Point of symmetry.
7657 theCopy Flag used to mirror object itself or create a copy.
7660 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7661 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7663 # Example: see GEOM_TestAll.py
7665 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7667 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7668 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7671 ## Create an object, symmetrical
7672 # to the given one relatively the given point.
7673 # @param theObject The object to be mirrored.
7674 # @param thePoint Point of symmetry.
7675 # @param theName Object name; when specified, this parameter is used
7676 # for result publication in the study. Otherwise, if automatic
7677 # publication is switched on, default value is used for result name.
7679 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7681 # @ref tui_mirror "Example"
7682 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7684 Create an object, symmetrical
7685 to the given one relatively the given point.
7688 theObject The object to be mirrored.
7689 thePoint Point of symmetry.
7690 theName Object name; when specified, this parameter is used
7691 for result publication in the study. Otherwise, if automatic
7692 publication is switched on, default value is used for result name.
7695 New GEOM.GEOM_Object, containing the mirrored shape.
7697 # Example: see GEOM_TestAll.py
7698 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7699 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7700 self._autoPublish(anObj, theName, "mirrored")
7703 ## Modify the location of the given object.
7704 # @param theObject The object to be displaced.
7705 # @param theStartLCS Coordinate system to perform displacement from it.\n
7706 # If \a theStartLCS is NULL, displacement
7707 # will be performed from global CS.\n
7708 # If \a theObject itself is used as \a theStartLCS,
7709 # its location will be changed to \a theEndLCS.
7710 # @param theEndLCS Coordinate system to perform displacement to it.
7711 # @param theCopy Flag used to displace object itself or create a copy.
7712 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7713 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7714 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7716 Modify the Location of the given object by LCS, creating its copy before the setting.
7719 theObject The object to be displaced.
7720 theStartLCS Coordinate system to perform displacement from it.
7721 If theStartLCS is NULL, displacement
7722 will be performed from global CS.
7723 If theObject itself is used as theStartLCS,
7724 its location will be changed to theEndLCS.
7725 theEndLCS Coordinate system to perform displacement to it.
7726 theCopy Flag used to displace object itself or create a copy.
7729 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7730 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7732 # Example: see GEOM_TestAll.py
7734 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7736 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7737 RaiseIfFailed("Displace", self.TrsfOp)
7740 ## Modify the Location of the given object by LCS,
7741 # creating its copy before the setting.
7742 # @param theObject The object to be displaced.
7743 # @param theStartLCS Coordinate system to perform displacement from it.\n
7744 # If \a theStartLCS is NULL, displacement
7745 # will be performed from global CS.\n
7746 # If \a theObject itself is used as \a theStartLCS,
7747 # its location will be changed to \a theEndLCS.
7748 # @param theEndLCS Coordinate system to perform displacement to it.
7749 # @param theName Object name; when specified, this parameter is used
7750 # for result publication in the study. Otherwise, if automatic
7751 # publication is switched on, default value is used for result name.
7753 # @return New GEOM.GEOM_Object, containing the displaced shape.
7755 # @ref tui_modify_location "Example"
7756 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7758 Modify the Location of the given object by LCS, creating its copy before the setting.
7761 theObject The object to be displaced.
7762 theStartLCS Coordinate system to perform displacement from it.
7763 If theStartLCS is NULL, displacement
7764 will be performed from global CS.
7765 If theObject itself is used as theStartLCS,
7766 its location will be changed to theEndLCS.
7767 theEndLCS Coordinate system to perform displacement to it.
7768 theName Object name; when specified, this parameter is used
7769 for result publication in the study. Otherwise, if automatic
7770 publication is switched on, default value is used for result name.
7773 New GEOM.GEOM_Object, containing the displaced shape.
7776 # create local coordinate systems
7777 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7778 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7779 # modify the location of the given object
7780 position = geompy.MakePosition(cylinder, cs1, cs2)
7782 # Example: see GEOM_TestAll.py
7783 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7784 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7785 self._autoPublish(anObj, theName, "displaced")
7788 ## Modify the Location of the given object by Path.
7789 # @param theObject The object to be displaced.
7790 # @param thePath Wire or Edge along that the object will be translated.
7791 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7792 # @param theCopy is to create a copy objects if true.
7793 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7794 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7795 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7797 # @ref tui_modify_location "Example"
7798 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7800 Modify the Location of the given object by Path.
7803 theObject The object to be displaced.
7804 thePath Wire or Edge along that the object will be translated.
7805 theDistance progress of Path (0 = start location, 1 = end of path location).
7806 theCopy is to create a copy objects if true.
7807 theReverse 0 - for usual direction, 1 - to reverse path direction.
7810 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7811 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7814 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7816 # Example: see GEOM_TestAll.py
7817 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7818 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7821 ## Modify the Location of the given object by Path, creating its copy before the operation.
7822 # @param theObject The object to be displaced.
7823 # @param thePath Wire or Edge along that the object will be translated.
7824 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7825 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7826 # @param theName Object name; when specified, this parameter is used
7827 # for result publication in the study. Otherwise, if automatic
7828 # publication is switched on, default value is used for result name.
7830 # @return New GEOM.GEOM_Object, containing the displaced shape.
7831 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7833 Modify the Location of the given object by Path, creating its copy before the operation.
7836 theObject The object to be displaced.
7837 thePath Wire or Edge along that the object will be translated.
7838 theDistance progress of Path (0 = start location, 1 = end of path location).
7839 theReverse 0 - for usual direction, 1 - to reverse path direction.
7840 theName Object name; when specified, this parameter is used
7841 for result publication in the study. Otherwise, if automatic
7842 publication is switched on, default value is used for result name.
7845 New GEOM.GEOM_Object, containing the displaced shape.
7847 # Example: see GEOM_TestAll.py
7848 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7849 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7850 self._autoPublish(anObj, theName, "displaced")
7853 ## Offset given shape.
7854 # @param theObject The base object for the offset.
7855 # @param theOffset Offset value.
7856 # @param theCopy Flag used to offset object itself or create a copy.
7857 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7858 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7859 def Offset(self, theObject, theOffset, theCopy=False):
7864 theObject The base object for the offset.
7865 theOffset Offset value.
7866 theCopy Flag used to offset object itself or create a copy.
7869 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7870 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7872 theOffset, Parameters = ParseParameters(theOffset)
7874 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7876 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7877 RaiseIfFailed("Offset", self.TrsfOp)
7878 anObj.SetParameters(Parameters)
7881 ## Create new object as offset of the given one.
7882 # @param theObject The base object for the offset.
7883 # @param theOffset Offset value.
7884 # @param theName Object name; when specified, this parameter is used
7885 # for result publication in the study. Otherwise, if automatic
7886 # publication is switched on, default value is used for result name.
7888 # @return New GEOM.GEOM_Object, containing the offset object.
7890 # @ref tui_offset "Example"
7891 def MakeOffset(self, theObject, theOffset, theName=None):
7893 Create new object as offset of the given one.
7896 theObject The base object for the offset.
7897 theOffset Offset value.
7898 theName Object name; when specified, this parameter is used
7899 for result publication in the study. Otherwise, if automatic
7900 publication is switched on, default value is used for result name.
7903 New GEOM.GEOM_Object, containing the offset object.
7906 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7907 # create a new object as offset of the given object
7908 offset = geompy.MakeOffset(box, 70.)
7910 # Example: see GEOM_TestAll.py
7911 theOffset, Parameters = ParseParameters(theOffset)
7912 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7913 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7914 anObj.SetParameters(Parameters)
7915 self._autoPublish(anObj, theName, "offset")
7918 ## Create new object as projection of the given one on a 2D surface.
7919 # @param theSource The source object for the projection. It can be a point, edge or wire.
7920 # @param theTarget The target object. It can be planar or cylindrical face.
7921 # @param theName Object name; when specified, this parameter is used
7922 # for result publication in the study. Otherwise, if automatic
7923 # publication is switched on, default value is used for result name.
7925 # @return New GEOM.GEOM_Object, containing the projection.
7927 # @ref tui_projection "Example"
7928 def MakeProjection(self, theSource, theTarget, theName=None):
7930 Create new object as projection of the given one on a 2D surface.
7933 theSource The source object for the projection. It can be a point, edge or wire.
7934 theTarget The target object. It can be planar or cylindrical face.
7935 theName Object name; when specified, this parameter is used
7936 for result publication in the study. Otherwise, if automatic
7937 publication is switched on, default value is used for result name.
7940 New GEOM.GEOM_Object, containing the projection.
7942 # Example: see GEOM_TestAll.py
7943 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7944 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7945 self._autoPublish(anObj, theName, "projection")
7948 # -----------------------------------------------------------------------------
7950 # -----------------------------------------------------------------------------
7952 ## Translate the given object along the given vector a given number times
7953 # @param theObject The object to be translated.
7954 # @param theVector Direction of the translation. DX if None.
7955 # @param theStep Distance to translate on.
7956 # @param theNbTimes Quantity of translations to be done.
7957 # @param theName Object name; when specified, this parameter is used
7958 # for result publication in the study. Otherwise, if automatic
7959 # publication is switched on, default value is used for result name.
7961 # @return New GEOM.GEOM_Object, containing compound of all
7962 # the shapes, obtained after each translation.
7964 # @ref tui_multi_translation "Example"
7965 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7967 Translate the given object along the given vector a given number times
7970 theObject The object to be translated.
7971 theVector Direction of the translation. DX if None.
7972 theStep Distance to translate on.
7973 theNbTimes Quantity of translations to be done.
7974 theName Object name; when specified, this parameter is used
7975 for result publication in the study. Otherwise, if automatic
7976 publication is switched on, default value is used for result name.
7979 New GEOM.GEOM_Object, containing compound of all
7980 the shapes, obtained after each translation.
7983 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7985 # Example: see GEOM_TestAll.py
7986 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7987 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7988 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7989 anObj.SetParameters(Parameters)
7990 self._autoPublish(anObj, theName, "multitranslation")
7993 ## Conseqently apply two specified translations to theObject specified number of times.
7994 # @param theObject The object to be translated.
7995 # @param theVector1 Direction of the first translation. DX if None.
7996 # @param theStep1 Step of the first translation.
7997 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7998 # @param theVector2 Direction of the second translation. DY if None.
7999 # @param theStep2 Step of the second translation.
8000 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8001 # @param theName Object name; when specified, this parameter is used
8002 # for result publication in the study. Otherwise, if automatic
8003 # publication is switched on, default value is used for result name.
8005 # @return New GEOM.GEOM_Object, containing compound of all
8006 # the shapes, obtained after each translation.
8008 # @ref tui_multi_translation "Example"
8009 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8010 theVector2, theStep2, theNbTimes2, theName=None):
8012 Conseqently apply two specified translations to theObject specified number of times.
8015 theObject The object to be translated.
8016 theVector1 Direction of the first translation. DX if None.
8017 theStep1 Step of the first translation.
8018 theNbTimes1 Quantity of translations to be done along theVector1.
8019 theVector2 Direction of the second translation. DY if None.
8020 theStep2 Step of the second translation.
8021 theNbTimes2 Quantity of translations to be done along theVector2.
8022 theName Object name; when specified, this parameter is used
8023 for result publication in the study. Otherwise, if automatic
8024 publication is switched on, default value is used for result name.
8027 New GEOM.GEOM_Object, containing compound of all
8028 the shapes, obtained after each translation.
8031 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8033 # Example: see GEOM_TestAll.py
8034 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8035 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8036 theVector2, theStep2, theNbTimes2)
8037 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8038 anObj.SetParameters(Parameters)
8039 self._autoPublish(anObj, theName, "multitranslation")
8042 ## Rotate the given object around the given axis a given number times.
8043 # Rotation angle will be 2*PI/theNbTimes.
8044 # @param theObject The object to be rotated.
8045 # @param theAxis The rotation axis. DZ if None.
8046 # @param theNbTimes Quantity of rotations to be done.
8047 # @param theName Object name; when specified, this parameter is used
8048 # for result publication in the study. Otherwise, if automatic
8049 # publication is switched on, default value is used for result name.
8051 # @return New GEOM.GEOM_Object, containing compound of all the
8052 # shapes, obtained after each rotation.
8054 # @ref tui_multi_rotation "Example"
8055 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8057 Rotate the given object around the given axis a given number times.
8058 Rotation angle will be 2*PI/theNbTimes.
8061 theObject The object to be rotated.
8062 theAxis The rotation axis. DZ if None.
8063 theNbTimes Quantity of rotations to be done.
8064 theName Object name; when specified, this parameter is used
8065 for result publication in the study. Otherwise, if automatic
8066 publication is switched on, default value is used for result name.
8069 New GEOM.GEOM_Object, containing compound of all the
8070 shapes, obtained after each rotation.
8073 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8075 # Example: see GEOM_TestAll.py
8076 theNbTimes, Parameters = ParseParameters(theNbTimes)
8077 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8078 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8079 anObj.SetParameters(Parameters)
8080 self._autoPublish(anObj, theName, "multirotation")
8083 ## Rotate the given object around the given axis
8084 # a given number times on the given angle.
8085 # @param theObject The object to be rotated.
8086 # @param theAxis The rotation axis. DZ if None.
8087 # @param theAngleStep Rotation angle in radians.
8088 # @param theNbTimes Quantity of rotations to be done.
8089 # @param theName Object name; when specified, this parameter is used
8090 # for result publication in the study. Otherwise, if automatic
8091 # publication is switched on, default value is used for result name.
8093 # @return New GEOM.GEOM_Object, containing compound of all the
8094 # shapes, obtained after each rotation.
8096 # @ref tui_multi_rotation "Example"
8097 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8099 Rotate the given object around the given axis
8100 a given number times on the given angle.
8103 theObject The object to be rotated.
8104 theAxis The rotation axis. DZ if None.
8105 theAngleStep Rotation angle in radians.
8106 theNbTimes Quantity of rotations to be done.
8107 theName Object name; when specified, this parameter is used
8108 for result publication in the study. Otherwise, if automatic
8109 publication is switched on, default value is used for result name.
8112 New GEOM.GEOM_Object, containing compound of all the
8113 shapes, obtained after each rotation.
8116 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8118 # Example: see GEOM_TestAll.py
8119 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8120 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8121 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8122 anObj.SetParameters(Parameters)
8123 self._autoPublish(anObj, theName, "multirotation")
8126 ## Rotate the given object around the given axis a given
8127 # number times and multi-translate each rotation result.
8128 # Rotation angle will be 2*PI/theNbTimes1.
8129 # Translation direction passes through center of gravity
8130 # of rotated shape and its projection on the rotation axis.
8131 # @param theObject The object to be rotated.
8132 # @param theAxis Rotation axis. DZ if None.
8133 # @param theNbTimes1 Quantity of rotations to be done.
8134 # @param theRadialStep Translation distance.
8135 # @param theNbTimes2 Quantity of translations to be done.
8136 # @param theName Object name; when specified, this parameter is used
8137 # for result publication in the study. Otherwise, if automatic
8138 # publication is switched on, default value is used for result name.
8140 # @return New GEOM.GEOM_Object, containing compound of all the
8141 # shapes, obtained after each transformation.
8143 # @ref tui_multi_rotation "Example"
8144 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8146 Rotate the given object around the
8147 given axis on the given angle a given number
8148 times and multi-translate each rotation result.
8149 Translation direction passes through center of gravity
8150 of rotated shape and its projection on the rotation axis.
8153 theObject The object to be rotated.
8154 theAxis Rotation axis. DZ if None.
8155 theNbTimes1 Quantity of rotations to be done.
8156 theRadialStep Translation distance.
8157 theNbTimes2 Quantity of translations to be done.
8158 theName Object name; when specified, this parameter is used
8159 for result publication in the study. Otherwise, if automatic
8160 publication is switched on, default value is used for result name.
8163 New GEOM.GEOM_Object, containing compound of all the
8164 shapes, obtained after each transformation.
8167 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8169 # Example: see GEOM_TestAll.py
8170 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8171 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8172 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8173 anObj.SetParameters(Parameters)
8174 self._autoPublish(anObj, theName, "multirotation")
8177 ## Rotate the given object around the
8178 # given axis on the given angle a given number
8179 # times and multi-translate each rotation result.
8180 # Translation direction passes through center of gravity
8181 # of rotated shape and its projection on the rotation axis.
8182 # @param theObject The object to be rotated.
8183 # @param theAxis Rotation axis. DZ if None.
8184 # @param theAngleStep Rotation angle in radians.
8185 # @param theNbTimes1 Quantity of rotations to be done.
8186 # @param theRadialStep Translation distance.
8187 # @param theNbTimes2 Quantity of translations to be done.
8188 # @param theName Object name; when specified, this parameter is used
8189 # for result publication in the study. Otherwise, if automatic
8190 # publication is switched on, default value is used for result name.
8192 # @return New GEOM.GEOM_Object, containing compound of all the
8193 # shapes, obtained after each transformation.
8195 # @ref tui_multi_rotation "Example"
8196 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8198 Rotate the given object around the
8199 given axis on the given angle a given number
8200 times and multi-translate each rotation result.
8201 Translation direction passes through center of gravity
8202 of rotated shape and its projection on the rotation axis.
8205 theObject The object to be rotated.
8206 theAxis Rotation axis. DZ if None.
8207 theAngleStep Rotation angle in radians.
8208 theNbTimes1 Quantity of rotations to be done.
8209 theRadialStep Translation distance.
8210 theNbTimes2 Quantity of translations to be done.
8211 theName Object name; when specified, this parameter is used
8212 for result publication in the study. Otherwise, if automatic
8213 publication is switched on, default value is used for result name.
8216 New GEOM.GEOM_Object, containing compound of all the
8217 shapes, obtained after each transformation.
8220 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8222 # Example: see GEOM_TestAll.py
8223 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8224 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8225 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8226 anObj.SetParameters(Parameters)
8227 self._autoPublish(anObj, theName, "multirotation")
8230 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8232 # @ref swig_MakeMultiRotation "Example"
8233 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8235 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8238 pz = geompy.MakeVertex(0, 0, 100)
8239 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8240 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8242 # Example: see GEOM_TestOthers.py
8243 aVec = self.MakeLine(aPoint,aDir)
8244 # note: auto-publishing is done in self.MultiRotate1D()
8245 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8248 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8250 # @ref swig_MakeMultiRotation "Example"
8251 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8253 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8256 pz = geompy.MakeVertex(0, 0, 100)
8257 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8258 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8260 # Example: see GEOM_TestOthers.py
8261 aVec = self.MakeLine(aPoint,aDir)
8262 # note: auto-publishing is done in self.MultiRotate1D()
8263 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8266 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8268 # @ref swig_MakeMultiRotation "Example"
8269 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8271 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8274 pz = geompy.MakeVertex(0, 0, 100)
8275 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8276 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8278 # Example: see GEOM_TestOthers.py
8279 aVec = self.MakeLine(aPoint,aDir)
8280 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8281 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8284 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8286 # @ref swig_MakeMultiRotation "Example"
8287 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8289 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8292 pz = geompy.MakeVertex(0, 0, 100)
8293 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8294 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8296 # Example: see GEOM_TestOthers.py
8297 aVec = self.MakeLine(aPoint,aDir)
8298 # note: auto-publishing is done in self.MultiRotate2D()
8299 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8302 # end of l3_transform
8305 ## @addtogroup l3_transform_d
8308 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8309 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8311 Deprecated method. Use MultiRotate1DNbTimes instead.
8313 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8314 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8316 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8317 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8318 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8320 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8321 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8324 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8326 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8327 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8328 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8329 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8330 anObj.SetParameters(Parameters)
8331 self._autoPublish(anObj, theName, "multirotation")
8334 ## The same, as MultiRotate1D(), but axis is given by direction and point
8335 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8336 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8338 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8339 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8342 pz = geompy.MakeVertex(0, 0, 100)
8343 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8344 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8346 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8347 aVec = self.MakeLine(aPoint,aDir)
8348 # note: auto-publishing is done in self.MultiRotate1D()
8349 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8352 ## The same, as MultiRotate2D(), but axis is given by direction and point
8353 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8354 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8356 The same, as MultiRotate2D(), but axis is given by direction and point
8357 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8360 pz = geompy.MakeVertex(0, 0, 100)
8361 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8362 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8364 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8365 aVec = self.MakeLine(aPoint,aDir)
8366 # note: auto-publishing is done in self.MultiRotate2D()
8367 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8370 # end of l3_transform_d
8373 ## @addtogroup l3_local
8376 ## Perform a fillet on all edges of the given shape.
8377 # @param theShape Shape, to perform fillet on.
8378 # @param theR Fillet radius.
8379 # @param theName Object name; when specified, this parameter is used
8380 # for result publication in the study. Otherwise, if automatic
8381 # publication is switched on, default value is used for result name.
8383 # @return New GEOM.GEOM_Object, containing the result shape.
8385 # @ref tui_fillet "Example 1"
8386 # \n @ref swig_MakeFilletAll "Example 2"
8387 def MakeFilletAll(self, theShape, theR, theName=None):
8389 Perform a fillet on all edges of the given shape.
8392 theShape Shape, to perform fillet on.
8394 theName Object name; when specified, this parameter is used
8395 for result publication in the study. Otherwise, if automatic
8396 publication is switched on, default value is used for result name.
8399 New GEOM.GEOM_Object, containing the result shape.
8402 filletall = geompy.MakeFilletAll(prism, 10.)
8404 # Example: see GEOM_TestOthers.py
8405 theR,Parameters = ParseParameters(theR)
8406 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8407 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8408 anObj.SetParameters(Parameters)
8409 self._autoPublish(anObj, theName, "fillet")
8412 ## Perform a fillet on the specified edges/faces of the given shape
8413 # @param theShape Shape, to perform fillet on.
8414 # @param theR Fillet radius.
8415 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8416 # @param theListShapes Global indices of edges/faces to perform fillet on.
8417 # @param theName Object name; when specified, this parameter is used
8418 # for result publication in the study. Otherwise, if automatic
8419 # publication is switched on, default value is used for result name.
8421 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8423 # @return New GEOM.GEOM_Object, containing the result shape.
8425 # @ref tui_fillet "Example"
8426 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8428 Perform a fillet on the specified edges/faces of the given shape
8431 theShape Shape, to perform fillet on.
8433 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8434 theListShapes Global indices of edges/faces to perform fillet on.
8435 theName Object name; when specified, this parameter is used
8436 for result publication in the study. Otherwise, if automatic
8437 publication is switched on, default value is used for result name.
8440 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8443 New GEOM.GEOM_Object, containing the result shape.
8446 # get the list of IDs (IDList) for the fillet
8447 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8449 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8450 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8451 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8452 # make a fillet on the specified edges of the given shape
8453 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8455 # Example: see GEOM_TestAll.py
8456 theR,Parameters = ParseParameters(theR)
8458 if theShapeType == self.ShapeType["EDGE"]:
8459 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8460 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8462 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8463 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8464 anObj.SetParameters(Parameters)
8465 self._autoPublish(anObj, theName, "fillet")
8468 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8469 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8471 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8474 # get the list of IDs (IDList) for the fillet
8475 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8477 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8478 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8479 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8480 # make a fillet on the specified edges of the given shape
8481 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8483 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8485 if theShapeType == self.ShapeType["EDGE"]:
8486 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8487 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8489 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8490 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8491 anObj.SetParameters(Parameters)
8492 self._autoPublish(anObj, theName, "fillet")
8495 ## Perform a fillet on the specified edges of the given shape
8496 # @param theShape Wire Shape to perform fillet on.
8497 # @param theR Fillet radius.
8498 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8499 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8500 # \note The list of vertices could be empty,
8501 # in this case fillet will done done at all vertices in wire
8502 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8503 # by the length of the edges, nearest to the fillet vertex.
8504 # But sometimes the next edge is C1 continuous with the one, nearest to
8505 # the fillet point, and such two (or more) edges can be united to allow
8506 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8507 # thus ignoring the secant vertex (vertices).
8508 # @param theName Object name; when specified, this parameter is used
8509 # for result publication in the study. Otherwise, if automatic
8510 # publication is switched on, default value is used for result name.
8512 # @return New GEOM.GEOM_Object, containing the result shape.
8514 # @ref tui_fillet2d "Example"
8515 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8517 Perform a fillet on the specified edges of the given shape
8520 theShape Wire Shape to perform fillet on.
8522 theListOfVertexes Global indices of vertexes to perform fillet on.
8523 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8524 by the length of the edges, nearest to the fillet vertex.
8525 But sometimes the next edge is C1 continuous with the one, nearest to
8526 the fillet point, and such two (or more) edges can be united to allow
8527 bigger radius. Set this flag to TRUE to allow collinear edges union,
8528 thus ignoring the secant vertex (vertices).
8529 theName Object name; when specified, this parameter is used
8530 for result publication in the study. Otherwise, if automatic
8531 publication is switched on, default value is used for result name.
8533 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8535 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8538 New GEOM.GEOM_Object, containing the result shape.
8542 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8543 # make fillet at given wire vertices with giver radius
8544 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8546 # Example: see GEOM_TestAll.py
8547 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8548 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8549 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8550 anObj.SetParameters(Parameters)
8551 self._autoPublish(anObj, theName, "fillet")
8554 ## Perform a fillet at the specified vertices of the given face/shell.
8555 # @param theShape Face or Shell shape to perform fillet on.
8556 # @param theR Fillet radius.
8557 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8558 # @param theName Object name; when specified, this parameter is used
8559 # for result publication in the study. Otherwise, if automatic
8560 # publication is switched on, default value is used for result name.
8562 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8564 # @return New GEOM.GEOM_Object, containing the result shape.
8566 # @ref tui_fillet2d "Example"
8567 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8569 Perform a fillet at the specified vertices of the given face/shell.
8572 theShape Face or Shell shape to perform fillet on.
8574 theListOfVertexes Global indices of vertexes to perform fillet on.
8575 theName Object name; when specified, this parameter is used
8576 for result publication in the study. Otherwise, if automatic
8577 publication is switched on, default value is used for result name.
8579 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8582 New GEOM.GEOM_Object, containing the result shape.
8585 face = geompy.MakeFaceHW(100, 100, 1)
8586 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8588 # Example: see GEOM_TestAll.py
8589 theR,Parameters = ParseParameters(theR)
8590 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8591 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8592 anObj.SetParameters(Parameters)
8593 self._autoPublish(anObj, theName, "fillet")
8596 ## Perform a symmetric chamfer on all edges of the given shape.
8597 # @param theShape Shape, to perform chamfer on.
8598 # @param theD Chamfer size along each face.
8599 # @param theName Object name; when specified, this parameter is used
8600 # for result publication in the study. Otherwise, if automatic
8601 # publication is switched on, default value is used for result name.
8603 # @return New GEOM.GEOM_Object, containing the result shape.
8605 # @ref tui_chamfer "Example 1"
8606 # \n @ref swig_MakeChamferAll "Example 2"
8607 def MakeChamferAll(self, theShape, theD, theName=None):
8609 Perform a symmetric chamfer on all edges of the given shape.
8612 theShape Shape, to perform chamfer on.
8613 theD Chamfer size along each face.
8614 theName Object name; when specified, this parameter is used
8615 for result publication in the study. Otherwise, if automatic
8616 publication is switched on, default value is used for result name.
8619 New GEOM.GEOM_Object, containing the result shape.
8622 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8624 # Example: see GEOM_TestOthers.py
8625 theD,Parameters = ParseParameters(theD)
8626 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8627 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8628 anObj.SetParameters(Parameters)
8629 self._autoPublish(anObj, theName, "chamfer")
8632 ## Perform a chamfer on edges, common to the specified faces,
8633 # with distance D1 on the Face1
8634 # @param theShape Shape, to perform chamfer on.
8635 # @param theD1 Chamfer size along \a theFace1.
8636 # @param theD2 Chamfer size along \a theFace2.
8637 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8638 # @param theName Object name; when specified, this parameter is used
8639 # for result publication in the study. Otherwise, if automatic
8640 # publication is switched on, default value is used for result name.
8642 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8644 # @return New GEOM.GEOM_Object, containing the result shape.
8646 # @ref tui_chamfer "Example"
8647 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8649 Perform a chamfer on edges, common to the specified faces,
8650 with distance D1 on the Face1
8653 theShape Shape, to perform chamfer on.
8654 theD1 Chamfer size along theFace1.
8655 theD2 Chamfer size along theFace2.
8656 theFace1,theFace2 Global indices of two faces of theShape.
8657 theName Object name; when specified, this parameter is used
8658 for result publication in the study. Otherwise, if automatic
8659 publication is switched on, default value is used for result name.
8662 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8665 New GEOM.GEOM_Object, containing the result shape.
8668 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8669 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8670 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8671 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8673 # Example: see GEOM_TestAll.py
8674 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8675 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8676 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8677 anObj.SetParameters(Parameters)
8678 self._autoPublish(anObj, theName, "chamfer")
8681 ## Perform a chamfer on edges
8682 # @param theShape Shape, to perform chamfer on.
8683 # @param theD Chamfer length
8684 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8685 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8686 # @param theName Object name; when specified, this parameter is used
8687 # for result publication in the study. Otherwise, if automatic
8688 # publication is switched on, default value is used for result name.
8690 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8692 # @return New GEOM.GEOM_Object, containing the result shape.
8693 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8695 Perform a chamfer on edges
8698 theShape Shape, to perform chamfer on.
8699 theD1 Chamfer size along theFace1.
8700 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8701 theFace1,theFace2 Global indices of two faces of theShape.
8702 theName Object name; when specified, this parameter is used
8703 for result publication in the study. Otherwise, if automatic
8704 publication is switched on, default value is used for result name.
8707 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8710 New GEOM.GEOM_Object, containing the result shape.
8713 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8714 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8715 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8717 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8720 if isinstance(theAngle,str):
8722 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8724 theAngle = theAngle*math.pi/180.0
8725 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8726 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8727 anObj.SetParameters(Parameters)
8728 self._autoPublish(anObj, theName, "chamfer")
8731 ## Perform a chamfer on all edges of the specified faces,
8732 # with distance D1 on the first specified face (if several for one edge)
8733 # @param theShape Shape, to perform chamfer on.
8734 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8735 # connected to the edge, are in \a theFaces, \a theD1
8736 # will be get along face, which is nearer to \a theFaces beginning.
8737 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8738 # @param theFaces Sequence of global indices of faces of \a theShape.
8739 # @param theName Object name; when specified, this parameter is used
8740 # for result publication in the study. Otherwise, if automatic
8741 # publication is switched on, default value is used for result name.
8743 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8745 # @return New GEOM.GEOM_Object, containing the result shape.
8747 # @ref tui_chamfer "Example"
8748 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8750 Perform a chamfer on all edges of the specified faces,
8751 with distance D1 on the first specified face (if several for one edge)
8754 theShape Shape, to perform chamfer on.
8755 theD1 Chamfer size along face from theFaces. If both faces,
8756 connected to the edge, are in theFaces, theD1
8757 will be get along face, which is nearer to theFaces beginning.
8758 theD2 Chamfer size along another of two faces, connected to the edge.
8759 theFaces Sequence of global indices of faces of theShape.
8760 theName Object name; when specified, this parameter is used
8761 for result publication in the study. Otherwise, if automatic
8762 publication is switched on, default value is used for result name.
8764 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8767 New GEOM.GEOM_Object, containing the result shape.
8769 # Example: see GEOM_TestAll.py
8770 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8771 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8772 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8773 anObj.SetParameters(Parameters)
8774 self._autoPublish(anObj, theName, "chamfer")
8777 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8778 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8780 # @ref swig_FilletChamfer "Example"
8781 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8783 The Same that geompy.MakeChamferFaces 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.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8793 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8794 anObj.SetParameters(Parameters)
8795 self._autoPublish(anObj, theName, "chamfer")
8798 ## Perform a chamfer on edges,
8799 # with distance D1 on the first specified face (if several for one edge)
8800 # @param theShape Shape, to perform chamfer on.
8801 # @param theD1,theD2 Chamfer size
8802 # @param theEdges Sequence of edges of \a theShape.
8803 # @param theName Object name; when specified, this parameter is used
8804 # for result publication in the study. Otherwise, if automatic
8805 # publication is switched on, default value is used for result name.
8807 # @return New GEOM.GEOM_Object, containing the result shape.
8809 # @ref swig_FilletChamfer "Example"
8810 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8812 Perform a chamfer on edges,
8813 with distance D1 on the first specified face (if several for one edge)
8816 theShape Shape, to perform chamfer on.
8817 theD1,theD2 Chamfer size
8818 theEdges Sequence of edges of theShape.
8819 theName Object name; when specified, this parameter is used
8820 for result publication in the study. Otherwise, if automatic
8821 publication is switched on, default value is used for result name.
8824 New GEOM.GEOM_Object, containing the result shape.
8826 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8827 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8828 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8829 anObj.SetParameters(Parameters)
8830 self._autoPublish(anObj, theName, "chamfer")
8833 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8834 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8835 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8837 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8838 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8841 if isinstance(theAngle,str):
8843 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8845 theAngle = theAngle*math.pi/180.0
8846 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8847 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8848 anObj.SetParameters(Parameters)
8849 self._autoPublish(anObj, theName, "chamfer")
8852 ## @sa MakeChamferEdge(), MakeChamferFaces()
8854 # @ref swig_MakeChamfer "Example"
8855 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8857 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8859 # Example: see GEOM_TestOthers.py
8861 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8862 if aShapeType == self.ShapeType["EDGE"]:
8863 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8865 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8868 ## Remove material from a solid by extrusion of the base shape on the given distance.
8869 # @param theInit Shape to remove material from. It must be a solid or
8870 # a compound made of a single solid.
8871 # @param theBase Closed edge or wire defining the base shape to be extruded.
8872 # @param theH Prism dimension along the normal to theBase
8873 # @param theAngle Draft angle in degrees.
8874 # @param theName Object name; when specified, this parameter is used
8875 # for result publication in the study. Otherwise, if automatic
8876 # publication is switched on, default value is used for result name.
8878 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8880 # @ref tui_creation_prism "Example"
8881 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8883 Add material to a solid by extrusion of the base shape on the given distance.
8886 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8887 theBase Closed edge or wire defining the base shape to be extruded.
8888 theH Prism dimension along the normal to theBase
8889 theAngle Draft angle in degrees.
8890 theName Object name; when specified, this parameter is used
8891 for result publication in the study. Otherwise, if automatic
8892 publication is switched on, default value is used for result name.
8895 New GEOM.GEOM_Object, containing the initial shape with removed material.
8897 # Example: see GEOM_TestAll.py
8898 #theH,Parameters = ParseParameters(theH)
8899 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8900 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8901 #anObj.SetParameters(Parameters)
8902 self._autoPublish(anObj, theName, "extrudedCut")
8905 ## Add material to a solid by extrusion of the base shape on the given distance.
8906 # @param theInit Shape to add material to. It must be a solid or
8907 # a compound made of a single solid.
8908 # @param theBase Closed edge or wire defining the base shape to be extruded.
8909 # @param theH Prism dimension along the normal to theBase
8910 # @param theAngle Draft angle in degrees.
8911 # @param theName Object name; when specified, this parameter is used
8912 # for result publication in the study. Otherwise, if automatic
8913 # publication is switched on, default value is used for result name.
8915 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8917 # @ref tui_creation_prism "Example"
8918 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8920 Add material to a solid by extrusion of the base shape on the given distance.
8923 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8924 theBase Closed edge or wire defining the base shape to be extruded.
8925 theH Prism dimension along the normal to theBase
8926 theAngle Draft angle in degrees.
8927 theName Object name; when specified, this parameter is used
8928 for result publication in the study. Otherwise, if automatic
8929 publication is switched on, default value is used for result name.
8932 New GEOM.GEOM_Object, containing the initial shape with added material.
8934 # Example: see GEOM_TestAll.py
8935 #theH,Parameters = ParseParameters(theH)
8936 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8937 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8938 #anObj.SetParameters(Parameters)
8939 self._autoPublish(anObj, theName, "extrudedBoss")
8945 ## @addtogroup l3_basic_op
8948 ## Perform an Archimde operation on the given shape with given parameters.
8949 # The object presenting the resulting face is returned.
8950 # @param theShape Shape to be put in water.
8951 # @param theWeight Weight og the shape.
8952 # @param theWaterDensity Density of the water.
8953 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8954 # @param theName Object name; when specified, this parameter is used
8955 # for result publication in the study. Otherwise, if automatic
8956 # publication is switched on, default value is used for result name.
8958 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8959 # by a plane, corresponding to water level.
8961 # @ref tui_archimede "Example"
8962 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8964 Perform an Archimde operation on the given shape with given parameters.
8965 The object presenting the resulting face is returned.
8968 theShape Shape to be put in water.
8969 theWeight Weight og the shape.
8970 theWaterDensity Density of the water.
8971 theMeshDeflection Deflection of the mesh, using to compute the section.
8972 theName Object name; when specified, this parameter is used
8973 for result publication in the study. Otherwise, if automatic
8974 publication is switched on, default value is used for result name.
8977 New GEOM.GEOM_Object, containing a section of theShape
8978 by a plane, corresponding to water level.
8980 # Example: see GEOM_TestAll.py
8981 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8982 theWeight,theWaterDensity,theMeshDeflection)
8983 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8984 RaiseIfFailed("MakeArchimede", self.LocalOp)
8985 anObj.SetParameters(Parameters)
8986 self._autoPublish(anObj, theName, "archimede")
8989 # end of l3_basic_op
8992 ## @addtogroup l2_measure
8995 ## Get point coordinates
8998 # @ref tui_measurement_tools_page "Example"
8999 def PointCoordinates(self,Point):
9001 Get point coordinates
9006 # Example: see GEOM_TestMeasures.py
9007 aTuple = self.MeasuOp.PointCoordinates(Point)
9008 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9011 ## Get vector coordinates
9014 # @ref tui_measurement_tools_page "Example"
9015 def VectorCoordinates(self,Vector):
9017 Get vector coordinates
9023 p1=self.GetFirstVertex(Vector)
9024 p2=self.GetLastVertex(Vector)
9026 X1=self.PointCoordinates(p1)
9027 X2=self.PointCoordinates(p2)
9029 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9032 ## Compute cross product
9033 # @return vector w=u^v
9035 # @ref tui_measurement_tools_page "Example"
9036 def CrossProduct(self, Vector1, Vector2):
9038 Compute cross product
9040 Returns: vector w=u^v
9042 u=self.VectorCoordinates(Vector1)
9043 v=self.VectorCoordinates(Vector2)
9044 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])
9048 ## Compute cross product
9049 # @return dot product p=u.v
9051 # @ref tui_measurement_tools_page "Example"
9052 def DotProduct(self, Vector1, Vector2):
9054 Compute cross product
9056 Returns: dot product p=u.v
9058 u=self.VectorCoordinates(Vector1)
9059 v=self.VectorCoordinates(Vector2)
9060 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9065 ## Get summarized length of all wires,
9066 # area of surface and volume of the given shape.
9067 # @param theShape Shape to define properties of.
9068 # @return [theLength, theSurfArea, theVolume]\n
9069 # theLength: Summarized length of all wires of the given shape.\n
9070 # theSurfArea: Area of surface of the given shape.\n
9071 # theVolume: Volume of the given shape.
9073 # @ref tui_measurement_tools_page "Example"
9074 def BasicProperties(self,theShape):
9076 Get summarized length of all wires,
9077 area of surface and volume of the given shape.
9080 theShape Shape to define properties of.
9083 [theLength, theSurfArea, theVolume]
9084 theLength: Summarized length of all wires of the given shape.
9085 theSurfArea: Area of surface of the given shape.
9086 theVolume: Volume of the given shape.
9088 # Example: see GEOM_TestMeasures.py
9089 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9090 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9093 ## Get parameters of bounding box of the given shape
9094 # @param theShape Shape to obtain bounding box of.
9095 # @param precise TRUE for precise computation; FALSE for fast one.
9096 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9097 # Xmin,Xmax: Limits of shape along OX axis.
9098 # Ymin,Ymax: Limits of shape along OY axis.
9099 # Zmin,Zmax: Limits of shape along OZ axis.
9101 # @ref tui_measurement_tools_page "Example"
9102 def BoundingBox (self, theShape, precise=False):
9104 Get parameters of bounding box of the given shape
9107 theShape Shape to obtain bounding box of.
9108 precise TRUE for precise computation; FALSE for fast one.
9111 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9112 Xmin,Xmax: Limits of shape along OX axis.
9113 Ymin,Ymax: Limits of shape along OY axis.
9114 Zmin,Zmax: Limits of shape along OZ axis.
9116 # Example: see GEOM_TestMeasures.py
9117 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9118 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9121 ## Get bounding box of the given shape
9122 # @param theShape Shape to obtain bounding box of.
9123 # @param precise TRUE for precise computation; FALSE for fast one.
9124 # @param theName Object name; when specified, this parameter is used
9125 # for result publication in the study. Otherwise, if automatic
9126 # publication is switched on, default value is used for result name.
9128 # @return New GEOM.GEOM_Object, containing the created box.
9130 # @ref tui_measurement_tools_page "Example"
9131 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9133 Get bounding box of the given shape
9136 theShape Shape to obtain bounding box of.
9137 precise TRUE for precise computation; FALSE for fast one.
9138 theName Object name; when specified, this parameter is used
9139 for result publication in the study. Otherwise, if automatic
9140 publication is switched on, default value is used for result name.
9143 New GEOM.GEOM_Object, containing the created box.
9145 # Example: see GEOM_TestMeasures.py
9146 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9147 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9148 self._autoPublish(anObj, theName, "bndbox")
9151 ## Get inertia matrix and moments of inertia of theShape.
9152 # @param theShape Shape to calculate inertia of.
9153 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9154 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9155 # Ix,Iy,Iz: Moments of inertia of the given shape.
9157 # @ref tui_measurement_tools_page "Example"
9158 def Inertia(self,theShape):
9160 Get inertia matrix and moments of inertia of theShape.
9163 theShape Shape to calculate inertia of.
9166 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9167 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9168 Ix,Iy,Iz: Moments of inertia of the given shape.
9170 # Example: see GEOM_TestMeasures.py
9171 aTuple = self.MeasuOp.GetInertia(theShape)
9172 RaiseIfFailed("GetInertia", self.MeasuOp)
9175 ## Get if coords are included in the shape (ST_IN or ST_ON)
9176 # @param theShape Shape
9177 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9178 # @param tolerance to be used (default is 1.0e-7)
9179 # @return list_of_boolean = [res1, res2, ...]
9180 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9182 Get if coords are included in the shape (ST_IN or ST_ON)
9186 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9187 tolerance to be used (default is 1.0e-7)
9190 list_of_boolean = [res1, res2, ...]
9192 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9194 ## Get minimal distance between the given shapes.
9195 # @param theShape1,theShape2 Shapes to find minimal distance between.
9196 # @return Value of the minimal distance between the given shapes.
9198 # @ref tui_measurement_tools_page "Example"
9199 def MinDistance(self, theShape1, theShape2):
9201 Get minimal distance between the given shapes.
9204 theShape1,theShape2 Shapes to find minimal distance between.
9207 Value of the minimal distance between the given shapes.
9209 # Example: see GEOM_TestMeasures.py
9210 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9211 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9214 ## Get minimal distance between the given shapes.
9215 # @param theShape1,theShape2 Shapes to find minimal distance between.
9216 # @return Value of the minimal distance between the given shapes, in form of list
9217 # [Distance, DX, DY, DZ].
9219 # @ref swig_all_measure "Example"
9220 def MinDistanceComponents(self, theShape1, theShape2):
9222 Get minimal distance between the given shapes.
9225 theShape1,theShape2 Shapes to find minimal distance between.
9228 Value of the minimal distance between the given shapes, in form of list
9229 [Distance, DX, DY, DZ]
9231 # Example: see GEOM_TestMeasures.py
9232 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9233 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9234 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9237 ## Get closest points of the given shapes.
9238 # @param theShape1,theShape2 Shapes to find closest points of.
9239 # @return The number of found solutions (-1 in case of infinite number of
9240 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9242 # @ref tui_measurement_tools_page "Example"
9243 def ClosestPoints (self, theShape1, theShape2):
9245 Get closest points of the given shapes.
9248 theShape1,theShape2 Shapes to find closest points of.
9251 The number of found solutions (-1 in case of infinite number of
9252 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9254 # Example: see GEOM_TestMeasures.py
9255 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9256 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9259 ## Get angle between the given shapes in degrees.
9260 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9261 # @note If both arguments are vectors, the angle is computed in accordance
9262 # with their orientations, otherwise the minimum angle is computed.
9263 # @return Value of the angle between the given shapes in degrees.
9265 # @ref tui_measurement_tools_page "Example"
9266 def GetAngle(self, theShape1, theShape2):
9268 Get angle between the given shapes in degrees.
9271 theShape1,theShape2 Lines or linear edges to find angle between.
9274 If both arguments are vectors, the angle is computed in accordance
9275 with their orientations, otherwise the minimum angle is computed.
9278 Value of the angle between the given shapes in degrees.
9280 # Example: see GEOM_TestMeasures.py
9281 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9282 RaiseIfFailed("GetAngle", self.MeasuOp)
9285 ## Get angle between the given shapes in radians.
9286 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9287 # @note If both arguments are vectors, the angle is computed in accordance
9288 # with their orientations, otherwise the minimum angle is computed.
9289 # @return Value of the angle between the given shapes in radians.
9291 # @ref tui_measurement_tools_page "Example"
9292 def GetAngleRadians(self, theShape1, theShape2):
9294 Get angle between the given shapes in radians.
9297 theShape1,theShape2 Lines or linear edges to find angle between.
9301 If both arguments are vectors, the angle is computed in accordance
9302 with their orientations, otherwise the minimum angle is computed.
9305 Value of the angle between the given shapes in radians.
9307 # Example: see GEOM_TestMeasures.py
9308 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9309 RaiseIfFailed("GetAngle", self.MeasuOp)
9312 ## Get angle between the given vectors in degrees.
9313 # @param theShape1,theShape2 Vectors to find angle between.
9314 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9315 # if False, the opposite vector to the normal vector is used.
9316 # @return Value of the angle between the given vectors in degrees.
9318 # @ref tui_measurement_tools_page "Example"
9319 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9321 Get angle between the given vectors in degrees.
9324 theShape1,theShape2 Vectors to find angle between.
9325 theFlag If True, the normal vector is defined by the two vectors cross,
9326 if False, the opposite vector to the normal vector is used.
9329 Value of the angle between the given vectors in degrees.
9331 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9333 anAngle = 360. - anAngle
9334 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9337 ## The same as GetAngleVectors, but the result is in radians.
9338 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9340 Get angle between the given vectors in radians.
9343 theShape1,theShape2 Vectors to find angle between.
9344 theFlag If True, the normal vector is defined by the two vectors cross,
9345 if False, the opposite vector to the normal vector is used.
9348 Value of the angle between the given vectors in radians.
9350 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9353 ## @name Curve Curvature Measurement
9354 # Methods for receiving radius of curvature of curves
9355 # in the given point
9358 ## Measure curvature of a curve at a point, set by parameter.
9359 # @param theCurve a curve.
9360 # @param theParam parameter.
9361 # @return radius of curvature of \a theCurve.
9363 # @ref swig_todo "Example"
9364 def CurveCurvatureByParam(self, theCurve, theParam):
9366 Measure curvature of a curve at a point, set by parameter.
9373 radius of curvature of theCurve.
9375 # Example: see GEOM_TestMeasures.py
9376 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9377 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9380 ## Measure curvature of a curve at a point.
9381 # @param theCurve a curve.
9382 # @param thePoint given point.
9383 # @return radius of curvature of \a theCurve.
9385 # @ref swig_todo "Example"
9386 def CurveCurvatureByPoint(self, theCurve, thePoint):
9388 Measure curvature of a curve at a point.
9392 thePoint given point.
9395 radius of curvature of theCurve.
9397 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9398 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9402 ## @name Surface Curvature Measurement
9403 # Methods for receiving max and min radius of curvature of surfaces
9404 # in the given point
9407 ## Measure max radius of curvature of surface.
9408 # @param theSurf the given surface.
9409 # @param theUParam Value of U-parameter on the referenced surface.
9410 # @param theVParam Value of V-parameter on the referenced surface.
9411 # @return max radius of curvature of theSurf.
9413 ## @ref swig_todo "Example"
9414 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9416 Measure max radius of curvature of surface.
9419 theSurf the given surface.
9420 theUParam Value of U-parameter on the referenced surface.
9421 theVParam Value of V-parameter on the referenced surface.
9424 max radius of curvature of theSurf.
9426 # Example: see GEOM_TestMeasures.py
9427 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9428 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9431 ## Measure max radius of curvature of surface in the given point
9432 # @param theSurf the given surface.
9433 # @param thePoint given point.
9434 # @return max radius of curvature of theSurf.
9436 ## @ref swig_todo "Example"
9437 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9439 Measure max radius of curvature of surface in the given point.
9442 theSurf the given surface.
9443 thePoint given point.
9446 max radius of curvature of theSurf.
9448 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9449 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9452 ## Measure min radius of curvature of surface.
9453 # @param theSurf the given surface.
9454 # @param theUParam Value of U-parameter on the referenced surface.
9455 # @param theVParam Value of V-parameter on the referenced surface.
9456 # @return min radius of curvature of theSurf.
9458 ## @ref swig_todo "Example"
9459 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9461 Measure min radius of curvature of surface.
9464 theSurf the given surface.
9465 theUParam Value of U-parameter on the referenced surface.
9466 theVParam Value of V-parameter on the referenced surface.
9469 Min radius of curvature of theSurf.
9471 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9472 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9475 ## Measure min radius of curvature of surface in the given point
9476 # @param theSurf the given surface.
9477 # @param thePoint given point.
9478 # @return min radius of curvature of theSurf.
9480 ## @ref swig_todo "Example"
9481 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9483 Measure min radius of curvature of surface in the given point.
9486 theSurf the given surface.
9487 thePoint given point.
9490 Min radius of curvature of theSurf.
9492 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9493 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9497 ## Get min and max tolerances of sub-shapes of theShape
9498 # @param theShape Shape, to get tolerances of.
9499 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9500 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9501 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9502 # VertMin,VertMax: Min and max tolerances of the vertices.
9504 # @ref tui_measurement_tools_page "Example"
9505 def Tolerance(self,theShape):
9507 Get min and max tolerances of sub-shapes of theShape
9510 theShape Shape, to get tolerances of.
9513 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9514 FaceMin,FaceMax: Min and max tolerances of the faces.
9515 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9516 VertMin,VertMax: Min and max tolerances of the vertices.
9518 # Example: see GEOM_TestMeasures.py
9519 aTuple = self.MeasuOp.GetTolerance(theShape)
9520 RaiseIfFailed("GetTolerance", self.MeasuOp)
9523 ## Obtain description of the given shape (number of sub-shapes of each type)
9524 # @param theShape Shape to be described.
9525 # @return Description of the given shape.
9527 # @ref tui_measurement_tools_page "Example"
9528 def WhatIs(self,theShape):
9530 Obtain description of the given shape (number of sub-shapes of each type)
9533 theShape Shape to be described.
9536 Description of the given shape.
9538 # Example: see GEOM_TestMeasures.py
9539 aDescr = self.MeasuOp.WhatIs(theShape)
9540 RaiseIfFailed("WhatIs", self.MeasuOp)
9543 ## Obtain quantity of shapes of the given type in \a theShape.
9544 # If \a theShape is of type \a theType, it is also counted.
9545 # @param theShape Shape to be described.
9546 # @param theType the given ShapeType().
9547 # @return Quantity of shapes of type \a theType in \a theShape.
9549 # @ref tui_measurement_tools_page "Example"
9550 def NbShapes (self, theShape, theType):
9552 Obtain quantity of shapes of the given type in theShape.
9553 If theShape is of type theType, it is also counted.
9556 theShape Shape to be described.
9557 theType the given geompy.ShapeType
9560 Quantity of shapes of type theType in theShape.
9562 # Example: see GEOM_TestMeasures.py
9563 listSh = self.SubShapeAllIDs(theShape, theType)
9565 t = EnumToLong(theShape.GetShapeType())
9566 theType = EnumToLong(theType)
9572 ## Obtain quantity of shapes of each type in \a theShape.
9573 # The \a theShape is also counted.
9574 # @param theShape Shape to be described.
9575 # @return Dictionary of ShapeType() with bound quantities of shapes.
9577 # @ref tui_measurement_tools_page "Example"
9578 def ShapeInfo (self, theShape):
9580 Obtain quantity of shapes of each type in theShape.
9581 The theShape is also counted.
9584 theShape Shape to be described.
9587 Dictionary of geompy.ShapeType with bound quantities of shapes.
9589 # Example: see GEOM_TestMeasures.py
9591 for typeSh in self.ShapeType:
9592 if typeSh in ( "AUTO", "SHAPE" ): continue
9593 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9595 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9602 def GetCreationInformation(self, theShape):
9603 info = theShape.GetCreationInformation()
9605 opName = info.operationName
9606 if not opName: opName = "no info available"
9607 res = "Operation: " + opName
9609 for parVal in info.params:
9610 res += " \n %s = %s" % ( parVal.name, parVal.value )
9613 ## Get a point, situated at the centre of mass of theShape.
9614 # @param theShape Shape to define centre of mass of.
9615 # @param theName Object name; when specified, this parameter is used
9616 # for result publication in the study. Otherwise, if automatic
9617 # publication is switched on, default value is used for result name.
9619 # @return New GEOM.GEOM_Object, containing the created point.
9621 # @ref tui_measurement_tools_page "Example"
9622 def MakeCDG(self, theShape, theName=None):
9624 Get a point, situated at the centre of mass of theShape.
9627 theShape Shape to define centre of mass of.
9628 theName Object name; when specified, this parameter is used
9629 for result publication in the study. Otherwise, if automatic
9630 publication is switched on, default value is used for result name.
9633 New GEOM.GEOM_Object, containing the created point.
9635 # Example: see GEOM_TestMeasures.py
9636 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9637 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9638 self._autoPublish(anObj, theName, "centerOfMass")
9641 ## Get a vertex sub-shape by index depended with orientation.
9642 # @param theShape Shape to find sub-shape.
9643 # @param theIndex Index to find vertex by this index (starting from zero)
9644 # @param theName Object name; when specified, this parameter is used
9645 # for result publication in the study. Otherwise, if automatic
9646 # publication is switched on, default value is used for result name.
9648 # @return New GEOM.GEOM_Object, containing the created vertex.
9650 # @ref tui_measurement_tools_page "Example"
9651 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9653 Get a vertex sub-shape by index depended with orientation.
9656 theShape Shape to find sub-shape.
9657 theIndex Index to find vertex by this index (starting from zero)
9658 theName Object name; when specified, this parameter is used
9659 for result publication in the study. Otherwise, if automatic
9660 publication is switched on, default value is used for result name.
9663 New GEOM.GEOM_Object, containing the created vertex.
9665 # Example: see GEOM_TestMeasures.py
9666 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9667 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9668 self._autoPublish(anObj, theName, "vertex")
9671 ## Get the first vertex of wire/edge depended orientation.
9672 # @param theShape Shape to find first vertex.
9673 # @param theName Object name; when specified, this parameter is used
9674 # for result publication in the study. Otherwise, if automatic
9675 # publication is switched on, default value is used for result name.
9677 # @return New GEOM.GEOM_Object, containing the created vertex.
9679 # @ref tui_measurement_tools_page "Example"
9680 def GetFirstVertex(self, theShape, theName=None):
9682 Get the first vertex of wire/edge depended orientation.
9685 theShape Shape to find first vertex.
9686 theName Object name; when specified, this parameter is used
9687 for result publication in the study. Otherwise, if automatic
9688 publication is switched on, default value is used for result name.
9691 New GEOM.GEOM_Object, containing the created vertex.
9693 # Example: see GEOM_TestMeasures.py
9694 # note: auto-publishing is done in self.GetVertexByIndex()
9695 anObj = self.GetVertexByIndex(theShape, 0, theName)
9696 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9699 ## Get the last vertex of wire/edge depended orientation.
9700 # @param theShape Shape to find last vertex.
9701 # @param theName Object name; when specified, this parameter is used
9702 # for result publication in the study. Otherwise, if automatic
9703 # publication is switched on, default value is used for result name.
9705 # @return New GEOM.GEOM_Object, containing the created vertex.
9707 # @ref tui_measurement_tools_page "Example"
9708 def GetLastVertex(self, theShape, theName=None):
9710 Get the last vertex of wire/edge depended orientation.
9713 theShape Shape to find last vertex.
9714 theName Object name; when specified, this parameter is used
9715 for result publication in the study. Otherwise, if automatic
9716 publication is switched on, default value is used for result name.
9719 New GEOM.GEOM_Object, containing the created vertex.
9721 # Example: see GEOM_TestMeasures.py
9722 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9723 # note: auto-publishing is done in self.GetVertexByIndex()
9724 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9725 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9728 ## Get a normale to the given face. If the point is not given,
9729 # the normale is calculated at the center of mass.
9730 # @param theFace Face to define normale of.
9731 # @param theOptionalPoint Point to compute the normale at.
9732 # @param theName Object name; when specified, this parameter is used
9733 # for result publication in the study. Otherwise, if automatic
9734 # publication is switched on, default value is used for result name.
9736 # @return New GEOM.GEOM_Object, containing the created vector.
9738 # @ref swig_todo "Example"
9739 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9741 Get a normale to the given face. If the point is not given,
9742 the normale is calculated at the center of mass.
9745 theFace Face to define normale of.
9746 theOptionalPoint Point to compute the normale at.
9747 theName Object name; when specified, this parameter is used
9748 for result publication in the study. Otherwise, if automatic
9749 publication is switched on, default value is used for result name.
9752 New GEOM.GEOM_Object, containing the created vector.
9754 # Example: see GEOM_TestMeasures.py
9755 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9756 RaiseIfFailed("GetNormal", self.MeasuOp)
9757 self._autoPublish(anObj, theName, "normal")
9760 ## Check a topology of the given shape.
9761 # @param theShape Shape to check validity of.
9762 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9763 # if TRUE, the shape's geometry will be checked also.
9764 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9765 # of problem is printed.
9766 # if TRUE and if theShape is invalid, the description
9767 # of problem is also returned.
9768 # @return TRUE, if the shape "seems to be valid".
9770 # @ref tui_measurement_tools_page "Example"
9771 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9773 Check a topology of the given shape.
9776 theShape Shape to check validity of.
9777 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9778 if TRUE, the shape's geometry will be checked also.
9779 theReturnStatus If FALSE and if theShape is invalid, a description
9780 of problem is printed.
9781 if TRUE and if theShape is invalid, the description
9782 of problem is returned.
9785 TRUE, if the shape "seems to be valid".
9786 If theShape is invalid, prints a description of problem.
9787 This description can also be returned.
9789 # Example: see GEOM_TestMeasures.py
9791 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9792 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9794 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9795 RaiseIfFailed("CheckShape", self.MeasuOp)
9797 if theReturnStatus == 0:
9799 if theReturnStatus == 1:
9800 return (IsValid, Status)
9803 ## Detect self-intersections in the given shape.
9804 # @param theShape Shape to check.
9805 # @return TRUE, if the shape contains no self-intersections.
9807 # @ref tui_measurement_tools_page "Example"
9808 def CheckSelfIntersections(self, theShape):
9810 Detect self-intersections in the given shape.
9813 theShape Shape to check.
9816 TRUE, if the shape contains no self-intersections.
9818 # Example: see GEOM_TestMeasures.py
9819 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9820 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9823 ## Get position (LCS) of theShape.
9825 # Origin of the LCS is situated at the shape's center of mass.
9826 # Axes of the LCS are obtained from shape's location or,
9827 # if the shape is a planar face, from position of its plane.
9829 # @param theShape Shape to calculate position of.
9830 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9831 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9832 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9833 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9835 # @ref swig_todo "Example"
9836 def GetPosition(self,theShape):
9838 Get position (LCS) of theShape.
9839 Origin of the LCS is situated at the shape's center of mass.
9840 Axes of the LCS are obtained from shape's location or,
9841 if the shape is a planar face, from position of its plane.
9844 theShape Shape to calculate position of.
9847 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9848 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9849 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9850 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9852 # Example: see GEOM_TestMeasures.py
9853 aTuple = self.MeasuOp.GetPosition(theShape)
9854 RaiseIfFailed("GetPosition", self.MeasuOp)
9857 ## Get kind of theShape.
9859 # @param theShape Shape to get a kind of.
9860 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9861 # and a list of parameters, describing the shape.
9862 # @note Concrete meaning of each value, returned via \a theIntegers
9863 # or \a theDoubles list depends on the kind() of the shape.
9865 # @ref swig_todo "Example"
9866 def KindOfShape(self,theShape):
9868 Get kind of theShape.
9871 theShape Shape to get a kind of.
9874 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9875 and a list of parameters, describing the shape.
9877 Concrete meaning of each value, returned via theIntegers
9878 or theDoubles list depends on the geompy.kind of the shape
9880 # Example: see GEOM_TestMeasures.py
9881 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9882 RaiseIfFailed("KindOfShape", self.MeasuOp)
9884 aKind = aRoughTuple[0]
9885 anInts = aRoughTuple[1]
9886 aDbls = aRoughTuple[2]
9888 # Now there is no exception from this rule:
9889 aKindTuple = [aKind] + aDbls + anInts
9891 # If they are we will regroup parameters for such kind of shape.
9893 #if aKind == kind.SOME_KIND:
9894 # # SOME_KIND int int double int double double
9895 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9902 ## @addtogroup l2_import_export
9905 ## Import a shape from the BREP or IGES or STEP file
9906 # (depends on given format) with given name.
9907 # @param theFileName The file, containing the shape.
9908 # @param theFormatName Specify format for the file reading.
9909 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9910 # If format 'IGES_SCALE' is used instead of 'IGES' or
9911 # format 'STEP_SCALE' is used instead of 'STEP',
9912 # length unit will be set to 'meter' and result model will be scaled.
9913 # @param theName Object name; when specified, this parameter is used
9914 # for result publication in the study. Otherwise, if automatic
9915 # publication is switched on, default value is used for result name.
9917 # @return New GEOM.GEOM_Object, containing the imported shape.
9919 # @ref swig_Import_Export "Example"
9920 def ImportFile(self, theFileName, theFormatName, theName=None):
9922 Import a shape from the BREP or IGES or STEP file
9923 (depends on given format) with given name.
9926 theFileName The file, containing the shape.
9927 theFormatName Specify format for the file reading.
9928 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9929 If format 'IGES_SCALE' is used instead of 'IGES' or
9930 format 'STEP_SCALE' is used instead of 'STEP',
9931 length unit will be set to 'meter' and result model will be scaled.
9932 theName Object name; when specified, this parameter is used
9933 for result publication in the study. Otherwise, if automatic
9934 publication is switched on, default value is used for result name.
9937 New GEOM.GEOM_Object, containing the imported shape.
9939 # Example: see GEOM_TestOthers.py
9940 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9941 RaiseIfFailed("ImportFile", self.InsertOp)
9942 self._autoPublish(anObj, theName, "imported")
9945 ## Deprecated analog of ImportFile()
9946 def Import(self, theFileName, theFormatName, theName=None):
9948 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9950 print "WARNING: Function Import is deprecated, use ImportFile instead"
9951 # note: auto-publishing is done in self.ImportFile()
9952 return self.ImportFile(theFileName, theFormatName, theName)
9954 ## Shortcut to ImportFile() for BREP format.
9955 # Import a shape from the BREP file with given name.
9956 # @param theFileName The file, containing the shape.
9957 # @param theName Object name; when specified, this parameter is used
9958 # for result publication in the study. Otherwise, if automatic
9959 # publication is switched on, default value is used for result name.
9961 # @return New GEOM.GEOM_Object, containing the imported shape.
9963 # @ref swig_Import_Export "Example"
9964 def ImportBREP(self, theFileName, theName=None):
9966 geompy.ImportFile(...) function for BREP format
9967 Import a shape from the BREP file with given name.
9970 theFileName The file, containing the shape.
9971 theName Object name; when specified, this parameter is used
9972 for result publication in the study. Otherwise, if automatic
9973 publication is switched on, default value is used for result name.
9976 New GEOM.GEOM_Object, containing the imported shape.
9978 # Example: see GEOM_TestOthers.py
9979 # note: auto-publishing is done in self.ImportFile()
9980 return self.ImportFile(theFileName, "BREP", theName)
9982 ## Shortcut to ImportFile() for IGES format
9983 # Import a shape from the IGES file with given name.
9984 # @param theFileName The file, containing the shape.
9985 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9986 # and result model will be scaled, if its units are not meters.
9987 # If False (default), file length units will be taken into account.
9988 # @param theName Object name; when specified, this parameter is used
9989 # for result publication in the study. Otherwise, if automatic
9990 # publication is switched on, default value is used for result name.
9992 # @return New GEOM.GEOM_Object, containing the imported shape.
9994 # @ref swig_Import_Export "Example"
9995 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9997 geompy.ImportFile(...) function for IGES format
10000 theFileName The file, containing the shape.
10001 ignoreUnits If True, file length units will be ignored (set to 'meter')
10002 and result model will be scaled, if its units are not meters.
10003 If False (default), file length units will be taken into account.
10004 theName Object name; when specified, this parameter is used
10005 for result publication in the study. Otherwise, if automatic
10006 publication is switched on, default value is used for result name.
10009 New GEOM.GEOM_Object, containing the imported shape.
10011 # Example: see GEOM_TestOthers.py
10012 # note: auto-publishing is done in self.ImportFile()
10014 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10015 return self.ImportFile(theFileName, "IGES", theName)
10017 ## Return length unit from given IGES file
10018 # @param theFileName The file, containing the shape.
10019 # @return String, containing the units name.
10021 # @ref swig_Import_Export "Example"
10022 def GetIGESUnit(self, theFileName):
10024 Return length units from given IGES file
10027 theFileName The file, containing the shape.
10030 String, containing the units name.
10032 # Example: see GEOM_TestOthers.py
10033 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10036 ## Shortcut to ImportFile() for STEP format
10037 # Import a shape from the STEP file with given name.
10038 # @param theFileName The file, containing the shape.
10039 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10040 # and result model will be scaled, if its units are not meters.
10041 # If False (default), file length units will be taken into account.
10042 # @param theName Object name; when specified, this parameter is used
10043 # for result publication in the study. Otherwise, if automatic
10044 # publication is switched on, default value is used for result name.
10046 # @return New GEOM.GEOM_Object, containing the imported shape.
10048 # @ref swig_Import_Export "Example"
10049 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10051 geompy.ImportFile(...) function for STEP format
10054 theFileName The file, containing the shape.
10055 ignoreUnits If True, file length units will be ignored (set to 'meter')
10056 and result model will be scaled, if its units are not meters.
10057 If False (default), file length units will be taken into account.
10058 theName Object name; when specified, this parameter is used
10059 for result publication in the study. Otherwise, if automatic
10060 publication is switched on, default value is used for result name.
10063 New GEOM.GEOM_Object, containing the imported shape.
10065 # Example: see GEOM_TestOthers.py
10066 # note: auto-publishing is done in self.ImportFile()
10068 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10069 return self.ImportFile(theFileName, "STEP", theName)
10071 ## Return length unit from given IGES or STEP file
10072 # @param theFileName The file, containing the shape.
10073 # @return String, containing the units name.
10075 # @ref swig_Import_Export "Example"
10076 def GetSTEPUnit(self, theFileName):
10078 Return length units from given STEP file
10081 theFileName The file, containing the shape.
10084 String, containing the units name.
10086 # Example: see GEOM_TestOthers.py
10087 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10090 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10091 # @note This method will not be dumped to the python script by DumpStudy functionality.
10092 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10093 # @param theStream The BRep binary stream.
10094 # @param theName Object name; when specified, this parameter is used
10095 # for result publication in the study. Otherwise, if automatic
10096 # publication is switched on, default value is used for result name.
10098 # @return New GEOM_Object, containing the shape, read from theStream.
10100 # @ref swig_Import_Export "Example"
10101 def RestoreShape (self, theStream, theName=None):
10103 Read a shape from the binary stream, containing its bounding representation (BRep).
10106 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10109 theStream The BRep binary stream.
10110 theName Object name; when specified, this parameter is used
10111 for result publication in the study. Otherwise, if automatic
10112 publication is switched on, default value is used for result name.
10115 New GEOM_Object, containing the shape, read from theStream.
10117 # Example: see GEOM_TestOthers.py
10118 anObj = self.InsertOp.RestoreShape(theStream)
10119 RaiseIfFailed("RestoreShape", self.InsertOp)
10120 self._autoPublish(anObj, theName, "restored")
10123 ## Export the given shape into a file with given name.
10124 # @param theObject Shape to be stored in the file.
10125 # @param theFileName Name of the file to store the given shape in.
10126 # @param theFormatName Specify format for the shape storage.
10127 # Available formats can be obtained with
10128 # geompy.InsertOp.ExportTranslators()[0] method.
10130 # @ref swig_Import_Export "Example"
10131 def Export(self, theObject, theFileName, theFormatName):
10133 Export the given shape into a file with given name.
10136 theObject Shape to be stored in the file.
10137 theFileName Name of the file to store the given shape in.
10138 theFormatName Specify format for the shape storage.
10139 Available formats can be obtained with
10140 geompy.InsertOp.ExportTranslators()[0] method.
10142 # Example: see GEOM_TestOthers.py
10143 self.InsertOp.Export(theObject, theFileName, theFormatName)
10144 if self.InsertOp.IsDone() == 0:
10145 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10149 ## Shortcut to Export() for BREP format
10151 # @ref swig_Import_Export "Example"
10152 def ExportBREP(self,theObject, theFileName):
10154 geompy.Export(...) function for BREP format
10156 # Example: see GEOM_TestOthers.py
10157 return self.Export(theObject, theFileName, "BREP")
10159 ## Shortcut to Export() for IGES format
10161 # @ref swig_Import_Export "Example"
10162 def ExportIGES(self,theObject, theFileName):
10164 geompy.Export(...) function for IGES format
10166 # Example: see GEOM_TestOthers.py
10167 return self.Export(theObject, theFileName, "IGES")
10169 ## Shortcut to Export() for STEP format
10171 # @ref swig_Import_Export "Example"
10172 def ExportSTEP(self,theObject, theFileName):
10174 geompy.Export(...) function for STEP format
10176 # Example: see GEOM_TestOthers.py
10177 return self.Export(theObject, theFileName, "STEP")
10179 # end of l2_import_export
10182 ## @addtogroup l3_blocks
10185 ## Create a quadrangle face from four edges. Order of Edges is not
10186 # important. It is not necessary that edges share the same vertex.
10187 # @param E1,E2,E3,E4 Edges for the face bound.
10188 # @param theName Object name; when specified, this parameter is used
10189 # for result publication in the study. Otherwise, if automatic
10190 # publication is switched on, default value is used for result name.
10192 # @return New GEOM.GEOM_Object, containing the created face.
10194 # @ref tui_building_by_blocks_page "Example"
10195 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10197 Create a quadrangle face from four edges. Order of Edges is not
10198 important. It is not necessary that edges share the same vertex.
10201 E1,E2,E3,E4 Edges for the face bound.
10202 theName Object name; when specified, this parameter is used
10203 for result publication in the study. Otherwise, if automatic
10204 publication is switched on, default value is used for result name.
10207 New GEOM.GEOM_Object, containing the created face.
10210 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10212 # Example: see GEOM_Spanner.py
10213 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10214 RaiseIfFailed("MakeQuad", self.BlocksOp)
10215 self._autoPublish(anObj, theName, "quad")
10218 ## Create a quadrangle face on two edges.
10219 # The missing edges will be built by creating the shortest ones.
10220 # @param E1,E2 Two opposite edges for the face.
10221 # @param theName Object name; when specified, this parameter is used
10222 # for result publication in the study. Otherwise, if automatic
10223 # publication is switched on, default value is used for result name.
10225 # @return New GEOM.GEOM_Object, containing the created face.
10227 # @ref tui_building_by_blocks_page "Example"
10228 def MakeQuad2Edges(self, E1, E2, theName=None):
10230 Create a quadrangle face on two edges.
10231 The missing edges will be built by creating the shortest ones.
10234 E1,E2 Two opposite edges for the face.
10235 theName Object name; when specified, this parameter is used
10236 for result publication in the study. Otherwise, if automatic
10237 publication is switched on, default value is used for result name.
10240 New GEOM.GEOM_Object, containing the created face.
10244 p1 = geompy.MakeVertex( 0., 0., 0.)
10245 p2 = geompy.MakeVertex(150., 30., 0.)
10246 p3 = geompy.MakeVertex( 0., 120., 50.)
10247 p4 = geompy.MakeVertex( 0., 40., 70.)
10249 edge1 = geompy.MakeEdge(p1, p2)
10250 edge2 = geompy.MakeEdge(p3, p4)
10251 # create a quadrangle face from two edges
10252 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10254 # Example: see GEOM_Spanner.py
10255 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10256 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10257 self._autoPublish(anObj, theName, "quad")
10260 ## Create a quadrangle face with specified corners.
10261 # The missing edges will be built by creating the shortest ones.
10262 # @param V1,V2,V3,V4 Corner vertices for the face.
10263 # @param theName Object name; when specified, this parameter is used
10264 # for result publication in the study. Otherwise, if automatic
10265 # publication is switched on, default value is used for result name.
10267 # @return New GEOM.GEOM_Object, containing the created face.
10269 # @ref tui_building_by_blocks_page "Example 1"
10270 # \n @ref swig_MakeQuad4Vertices "Example 2"
10271 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10273 Create a quadrangle face with specified corners.
10274 The missing edges will be built by creating the shortest ones.
10277 V1,V2,V3,V4 Corner vertices for the face.
10278 theName Object name; when specified, this parameter is used
10279 for result publication in the study. Otherwise, if automatic
10280 publication is switched on, default value is used for result name.
10283 New GEOM.GEOM_Object, containing the created face.
10287 p1 = geompy.MakeVertex( 0., 0., 0.)
10288 p2 = geompy.MakeVertex(150., 30., 0.)
10289 p3 = geompy.MakeVertex( 0., 120., 50.)
10290 p4 = geompy.MakeVertex( 0., 40., 70.)
10291 # create a quadrangle from four points in its corners
10292 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10294 # Example: see GEOM_Spanner.py
10295 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10296 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10297 self._autoPublish(anObj, theName, "quad")
10300 ## Create a hexahedral solid, bounded by the six given faces. Order of
10301 # faces is not important. It is not necessary that Faces share the same edge.
10302 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10303 # @param theName Object name; when specified, this parameter is used
10304 # for result publication in the study. Otherwise, if automatic
10305 # publication is switched on, default value is used for result name.
10307 # @return New GEOM.GEOM_Object, containing the created solid.
10309 # @ref tui_building_by_blocks_page "Example 1"
10310 # \n @ref swig_MakeHexa "Example 2"
10311 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10313 Create a hexahedral solid, bounded by the six given faces. Order of
10314 faces is not important. It is not necessary that Faces share the same edge.
10317 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10318 theName Object name; when specified, this parameter is used
10319 for result publication in the study. Otherwise, if automatic
10320 publication is switched on, default value is used for result name.
10323 New GEOM.GEOM_Object, containing the created solid.
10326 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10328 # Example: see GEOM_Spanner.py
10329 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10330 RaiseIfFailed("MakeHexa", self.BlocksOp)
10331 self._autoPublish(anObj, theName, "hexa")
10334 ## Create a hexahedral solid between two given faces.
10335 # The missing faces will be built by creating the smallest ones.
10336 # @param F1,F2 Two opposite faces for the hexahedral solid.
10337 # @param theName Object name; when specified, this parameter is used
10338 # for result publication in the study. Otherwise, if automatic
10339 # publication is switched on, default value is used for result name.
10341 # @return New GEOM.GEOM_Object, containing the created solid.
10343 # @ref tui_building_by_blocks_page "Example 1"
10344 # \n @ref swig_MakeHexa2Faces "Example 2"
10345 def MakeHexa2Faces(self, F1, F2, theName=None):
10347 Create a hexahedral solid between two given faces.
10348 The missing faces will be built by creating the smallest ones.
10351 F1,F2 Two opposite faces for the hexahedral solid.
10352 theName Object name; when specified, this parameter is used
10353 for result publication in the study. Otherwise, if automatic
10354 publication is switched on, default value is used for result name.
10357 New GEOM.GEOM_Object, containing the created solid.
10360 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10362 # Example: see GEOM_Spanner.py
10363 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10364 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10365 self._autoPublish(anObj, theName, "hexa")
10371 ## @addtogroup l3_blocks_op
10374 ## Get a vertex, found in the given shape by its coordinates.
10375 # @param theShape Block or a compound of blocks.
10376 # @param theX,theY,theZ Coordinates of the sought vertex.
10377 # @param theEpsilon Maximum allowed distance between the resulting
10378 # vertex and point with the given coordinates.
10379 # @param theName Object name; when specified, this parameter is used
10380 # for result publication in the study. Otherwise, if automatic
10381 # publication is switched on, default value is used for result name.
10383 # @return New GEOM.GEOM_Object, containing the found vertex.
10385 # @ref swig_GetPoint "Example"
10386 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10388 Get a vertex, found in the given shape by its coordinates.
10391 theShape Block or a compound of blocks.
10392 theX,theY,theZ Coordinates of the sought vertex.
10393 theEpsilon Maximum allowed distance between the resulting
10394 vertex and point with the given coordinates.
10395 theName Object name; when specified, this parameter is used
10396 for result publication in the study. Otherwise, if automatic
10397 publication is switched on, default value is used for result name.
10400 New GEOM.GEOM_Object, containing the found vertex.
10403 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10405 # Example: see GEOM_TestOthers.py
10406 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10407 RaiseIfFailed("GetPoint", self.BlocksOp)
10408 self._autoPublish(anObj, theName, "vertex")
10411 ## Find a vertex of the given shape, which has minimal distance to the given point.
10412 # @param theShape Any shape.
10413 # @param thePoint Point, close to the desired vertex.
10414 # @param theName Object name; when specified, this parameter is used
10415 # for result publication in the study. Otherwise, if automatic
10416 # publication is switched on, default value is used for result name.
10418 # @return New GEOM.GEOM_Object, containing the found vertex.
10420 # @ref swig_GetVertexNearPoint "Example"
10421 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10423 Find a vertex of the given shape, which has minimal distance to the given point.
10426 theShape Any shape.
10427 thePoint Point, close to the desired vertex.
10428 theName Object name; when specified, this parameter is used
10429 for result publication in the study. Otherwise, if automatic
10430 publication is switched on, default value is used for result name.
10433 New GEOM.GEOM_Object, containing the found vertex.
10436 pmidle = geompy.MakeVertex(50, 0, 50)
10437 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10439 # Example: see GEOM_TestOthers.py
10440 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10441 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10442 self._autoPublish(anObj, theName, "vertex")
10445 ## Get an edge, found in the given shape by two given vertices.
10446 # @param theShape Block or a compound of blocks.
10447 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10448 # @param theName Object name; when specified, this parameter is used
10449 # for result publication in the study. Otherwise, if automatic
10450 # publication is switched on, default value is used for result name.
10452 # @return New GEOM.GEOM_Object, containing the found edge.
10454 # @ref swig_GetEdge "Example"
10455 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10457 Get an edge, found in the given shape by two given vertices.
10460 theShape Block or a compound of blocks.
10461 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10462 theName Object name; when specified, this parameter is used
10463 for result publication in the study. Otherwise, if automatic
10464 publication is switched on, default value is used for result name.
10467 New GEOM.GEOM_Object, containing the found edge.
10469 # Example: see GEOM_Spanner.py
10470 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10471 RaiseIfFailed("GetEdge", self.BlocksOp)
10472 self._autoPublish(anObj, theName, "edge")
10475 ## Find an edge of the given shape, which has minimal distance to the given point.
10476 # @param theShape Block or a compound of blocks.
10477 # @param thePoint Point, close to the desired edge.
10478 # @param theName Object name; when specified, this parameter is used
10479 # for result publication in the study. Otherwise, if automatic
10480 # publication is switched on, default value is used for result name.
10482 # @return New GEOM.GEOM_Object, containing the found edge.
10484 # @ref swig_GetEdgeNearPoint "Example"
10485 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10487 Find an edge of the given shape, which has minimal distance to the given point.
10490 theShape Block or a compound of blocks.
10491 thePoint Point, close to the desired edge.
10492 theName Object name; when specified, this parameter is used
10493 for result publication in the study. Otherwise, if automatic
10494 publication is switched on, default value is used for result name.
10497 New GEOM.GEOM_Object, containing the found edge.
10499 # Example: see GEOM_TestOthers.py
10500 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10501 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10502 self._autoPublish(anObj, theName, "edge")
10505 ## Returns a face, found in the given shape by four given corner vertices.
10506 # @param theShape Block or a compound of blocks.
10507 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10508 # @param theName Object name; when specified, this parameter is used
10509 # for result publication in the study. Otherwise, if automatic
10510 # publication is switched on, default value is used for result name.
10512 # @return New GEOM.GEOM_Object, containing the found face.
10514 # @ref swig_todo "Example"
10515 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10517 Returns a face, found in the given shape by four given corner vertices.
10520 theShape Block or a compound of blocks.
10521 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10522 theName Object name; when specified, this parameter is used
10523 for result publication in the study. Otherwise, if automatic
10524 publication is switched on, default value is used for result name.
10527 New GEOM.GEOM_Object, containing the found face.
10529 # Example: see GEOM_Spanner.py
10530 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10531 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10532 self._autoPublish(anObj, theName, "face")
10535 ## Get a face of block, found in the given shape by two given edges.
10536 # @param theShape Block or a compound of blocks.
10537 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10538 # @param theName Object name; when specified, this parameter is used
10539 # for result publication in the study. Otherwise, if automatic
10540 # publication is switched on, default value is used for result name.
10542 # @return New GEOM.GEOM_Object, containing the found face.
10544 # @ref swig_todo "Example"
10545 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10547 Get a face of block, found in the given shape by two given edges.
10550 theShape Block or a compound of blocks.
10551 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10552 theName Object name; when specified, this parameter is used
10553 for result publication in the study. Otherwise, if automatic
10554 publication is switched on, default value is used for result name.
10557 New GEOM.GEOM_Object, containing the found face.
10559 # Example: see GEOM_Spanner.py
10560 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10561 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10562 self._autoPublish(anObj, theName, "face")
10565 ## Find a face, opposite to the given one in the given block.
10566 # @param theBlock Must be a hexahedral solid.
10567 # @param theFace Face of \a theBlock, opposite to the desired face.
10568 # @param theName Object name; when specified, this parameter is used
10569 # for result publication in the study. Otherwise, if automatic
10570 # publication is switched on, default value is used for result name.
10572 # @return New GEOM.GEOM_Object, containing the found face.
10574 # @ref swig_GetOppositeFace "Example"
10575 def GetOppositeFace(self, theBlock, theFace, theName=None):
10577 Find a face, opposite to the given one in the given block.
10580 theBlock Must be a hexahedral solid.
10581 theFace Face of theBlock, opposite to the desired face.
10582 theName Object name; when specified, this parameter is used
10583 for result publication in the study. Otherwise, if automatic
10584 publication is switched on, default value is used for result name.
10587 New GEOM.GEOM_Object, containing the found face.
10589 # Example: see GEOM_Spanner.py
10590 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10591 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10592 self._autoPublish(anObj, theName, "face")
10595 ## Find a face of the given shape, which has minimal distance to the given point.
10596 # @param theShape Block or a compound of blocks.
10597 # @param thePoint Point, close to the desired face.
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.GEOM_Object, containing the found face.
10604 # @ref swig_GetFaceNearPoint "Example"
10605 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10607 Find a face of the given shape, which has minimal distance to the given point.
10610 theShape Block or a compound of blocks.
10611 thePoint Point, close to the desired face.
10612 theName Object name; when specified, this parameter is used
10613 for result publication in the study. Otherwise, if automatic
10614 publication is switched on, default value is used for result name.
10617 New GEOM.GEOM_Object, containing the found face.
10619 # Example: see GEOM_Spanner.py
10620 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10621 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10622 self._autoPublish(anObj, theName, "face")
10625 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10626 # @param theBlock Block or a compound of blocks.
10627 # @param theVector Vector, close to the normale of the desired face.
10628 # @param theName Object name; when specified, this parameter is used
10629 # for result publication in the study. Otherwise, if automatic
10630 # publication is switched on, default value is used for result name.
10632 # @return New GEOM.GEOM_Object, containing the found face.
10634 # @ref swig_todo "Example"
10635 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10637 Find a face of block, whose outside normale has minimal angle with the given vector.
10640 theBlock Block or a compound of blocks.
10641 theVector Vector, close to the normale of the desired face.
10642 theName Object name; when specified, this parameter is used
10643 for result publication in the study. Otherwise, if automatic
10644 publication is switched on, default value is used for result name.
10647 New GEOM.GEOM_Object, containing the found face.
10649 # Example: see GEOM_Spanner.py
10650 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10651 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10652 self._autoPublish(anObj, theName, "face")
10655 ## Find all sub-shapes of type \a theShapeType of the given shape,
10656 # which have minimal distance to the given point.
10657 # @param theShape Any shape.
10658 # @param thePoint Point, close to the desired shape.
10659 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10660 # @param theTolerance The tolerance for distances comparison. All shapes
10661 # with distances to the given point in interval
10662 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10663 # @param theName Object name; when specified, this parameter is used
10664 # for result publication in the study. Otherwise, if automatic
10665 # publication is switched on, default value is used for result name.
10667 # @return New GEOM_Object, containing a group of all found shapes.
10669 # @ref swig_GetShapesNearPoint "Example"
10670 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10672 Find all sub-shapes of type theShapeType of the given shape,
10673 which have minimal distance to the given point.
10676 theShape Any shape.
10677 thePoint Point, close to the desired shape.
10678 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10679 theTolerance The tolerance for distances comparison. All shapes
10680 with distances to the given point in interval
10681 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10682 theName Object name; when specified, this parameter is used
10683 for result publication in the study. Otherwise, if automatic
10684 publication is switched on, default value is used for result name.
10687 New GEOM_Object, containing a group of all found shapes.
10689 # Example: see GEOM_TestOthers.py
10690 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10691 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10692 self._autoPublish(anObj, theName, "group")
10695 # end of l3_blocks_op
10698 ## @addtogroup l4_blocks_measure
10701 ## Check, if the compound of blocks is given.
10702 # To be considered as a compound of blocks, the
10703 # given shape must satisfy the following conditions:
10704 # - Each element of the compound should be a Block (6 faces and 12 edges).
10705 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10706 # - The compound should be connexe.
10707 # - The glue between two quadrangle faces should be applied.
10708 # @param theCompound The compound to check.
10709 # @return TRUE, if the given shape is a compound of blocks.
10710 # If theCompound is not valid, prints all discovered errors.
10712 # @ref tui_measurement_tools_page "Example 1"
10713 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10714 def CheckCompoundOfBlocks(self,theCompound):
10716 Check, if the compound of blocks is given.
10717 To be considered as a compound of blocks, the
10718 given shape must satisfy the following conditions:
10719 - Each element of the compound should be a Block (6 faces and 12 edges).
10720 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10721 - The compound should be connexe.
10722 - The glue between two quadrangle faces should be applied.
10725 theCompound The compound to check.
10728 TRUE, if the given shape is a compound of blocks.
10729 If theCompound is not valid, prints all discovered errors.
10731 # Example: see GEOM_Spanner.py
10732 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10733 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10735 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10739 ## Retrieve all non blocks solids and faces from \a theShape.
10740 # @param theShape The shape to explore.
10741 # @param theName Object name; when specified, this parameter is used
10742 # for result publication in the study. Otherwise, if automatic
10743 # publication is switched on, default value is used for result name.
10745 # @return A tuple of two GEOM_Objects. The first object is a group of all
10746 # non block solids (= not 6 faces, or with 6 faces, but with the
10747 # presence of non-quadrangular faces). The second object is a
10748 # group of all non quadrangular faces.
10750 # @ref tui_measurement_tools_page "Example 1"
10751 # \n @ref swig_GetNonBlocks "Example 2"
10752 def GetNonBlocks (self, theShape, theName=None):
10754 Retrieve all non blocks solids and faces from theShape.
10757 theShape The shape to explore.
10758 theName Object name; when specified, this parameter is used
10759 for result publication in the study. Otherwise, if automatic
10760 publication is switched on, default value is used for result name.
10763 A tuple of two GEOM_Objects. The first object is a group of all
10764 non block solids (= not 6 faces, or with 6 faces, but with the
10765 presence of non-quadrangular faces). The second object is a
10766 group of all non quadrangular faces.
10769 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10771 # Example: see GEOM_Spanner.py
10772 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10773 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10774 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10777 ## Remove all seam and degenerated edges from \a theShape.
10778 # Unite faces and edges, sharing one surface. It means that
10779 # this faces must have references to one C++ surface object (handle).
10780 # @param theShape The compound or single solid to remove irregular edges from.
10781 # @param doUnionFaces If True, then unite faces. If False (the default value),
10782 # do not unite faces.
10783 # @param theName Object name; when specified, this parameter is used
10784 # for result publication in the study. Otherwise, if automatic
10785 # publication is switched on, default value is used for result name.
10787 # @return Improved shape.
10789 # @ref swig_RemoveExtraEdges "Example"
10790 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10792 Remove all seam and degenerated edges from theShape.
10793 Unite faces and edges, sharing one surface. It means that
10794 this faces must have references to one C++ surface object (handle).
10797 theShape The compound or single solid to remove irregular edges from.
10798 doUnionFaces If True, then unite faces. If False (the default value),
10799 do not unite faces.
10800 theName Object name; when specified, this parameter is used
10801 for result publication in the study. Otherwise, if automatic
10802 publication is switched on, default value is used for result name.
10807 # Example: see GEOM_TestOthers.py
10808 nbFacesOptimum = -1 # -1 means do not unite faces
10809 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10810 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10811 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10812 self._autoPublish(anObj, theName, "removeExtraEdges")
10815 ## Performs union faces of \a theShape
10816 # Unite faces sharing one surface. It means that
10817 # these faces must have references to one C++ surface object (handle).
10818 # @param theShape The compound or single solid that contains faces
10819 # to perform union.
10820 # @param theName Object name; when specified, this parameter is used
10821 # for result publication in the study. Otherwise, if automatic
10822 # publication is switched on, default value is used for result name.
10824 # @return Improved shape.
10826 # @ref swig_UnionFaces "Example"
10827 def UnionFaces(self, theShape, theName=None):
10829 Performs union faces of theShape.
10830 Unite faces sharing one surface. It means that
10831 these faces must have references to one C++ surface object (handle).
10834 theShape The compound or single solid that contains faces
10836 theName Object name; when specified, this parameter is used
10837 for result publication in the study. Otherwise, if automatic
10838 publication is switched on, default value is used for result name.
10843 # Example: see GEOM_TestOthers.py
10844 anObj = self.BlocksOp.UnionFaces(theShape)
10845 RaiseIfFailed("UnionFaces", self.BlocksOp)
10846 self._autoPublish(anObj, theName, "unionFaces")
10849 ## Check, if the given shape is a blocks compound.
10850 # Fix all detected errors.
10851 # \note Single block can be also fixed by this method.
10852 # @param theShape The compound to check and improve.
10853 # @param theName Object name; when specified, this parameter is used
10854 # for result publication in the study. Otherwise, if automatic
10855 # publication is switched on, default value is used for result name.
10857 # @return Improved compound.
10859 # @ref swig_CheckAndImprove "Example"
10860 def CheckAndImprove(self, theShape, theName=None):
10862 Check, if the given shape is a blocks compound.
10863 Fix all detected errors.
10866 Single block can be also fixed by this method.
10869 theShape The compound to check and improve.
10870 theName Object name; when specified, this parameter is used
10871 for result publication in the study. Otherwise, if automatic
10872 publication is switched on, default value is used for result name.
10877 # Example: see GEOM_TestOthers.py
10878 anObj = self.BlocksOp.CheckAndImprove(theShape)
10879 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10880 self._autoPublish(anObj, theName, "improved")
10883 # end of l4_blocks_measure
10886 ## @addtogroup l3_blocks_op
10889 ## Get all the blocks, contained in the given compound.
10890 # @param theCompound The compound to explode.
10891 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10892 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10893 # @param theName Object name; when specified, this parameter is used
10894 # for result publication in the study. Otherwise, if automatic
10895 # publication is switched on, default value is used for result name.
10897 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10899 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10901 # @ref tui_explode_on_blocks "Example 1"
10902 # \n @ref swig_MakeBlockExplode "Example 2"
10903 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10905 Get all the blocks, contained in the given compound.
10908 theCompound The compound to explode.
10909 theMinNbFaces If solid has lower number of faces, it is not a block.
10910 theMaxNbFaces If solid has higher number of faces, it is not a block.
10911 theName Object name; when specified, this parameter is used
10912 for result publication in the study. Otherwise, if automatic
10913 publication is switched on, default value is used for result name.
10916 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10919 List of GEOM.GEOM_Object, containing the retrieved blocks.
10921 # Example: see GEOM_TestOthers.py
10922 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10923 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10924 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10925 for anObj in aList:
10926 anObj.SetParameters(Parameters)
10928 self._autoPublish(aList, theName, "block")
10931 ## Find block, containing the given point inside its volume or on boundary.
10932 # @param theCompound Compound, to find block in.
10933 # @param thePoint Point, close to the desired block. If the point lays on
10934 # boundary between some blocks, we return block with nearest center.
10935 # @param theName Object name; when specified, this parameter is used
10936 # for result publication in the study. Otherwise, if automatic
10937 # publication is switched on, default value is used for result name.
10939 # @return New GEOM.GEOM_Object, containing the found block.
10941 # @ref swig_todo "Example"
10942 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10944 Find block, containing the given point inside its volume or on boundary.
10947 theCompound Compound, to find block in.
10948 thePoint Point, close to the desired block. If the point lays on
10949 boundary between some blocks, we return block with nearest center.
10950 theName Object name; when specified, this parameter is used
10951 for result publication in the study. Otherwise, if automatic
10952 publication is switched on, default value is used for result name.
10955 New GEOM.GEOM_Object, containing the found block.
10957 # Example: see GEOM_Spanner.py
10958 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10959 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10960 self._autoPublish(anObj, theName, "block")
10963 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10964 # @param theCompound Compound, to find block in.
10965 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10966 # @param theName Object name; when specified, this parameter is used
10967 # for result publication in the study. Otherwise, if automatic
10968 # publication is switched on, default value is used for result name.
10970 # @return New GEOM.GEOM_Object, containing the found block.
10972 # @ref swig_GetBlockByParts "Example"
10973 def GetBlockByParts(self, theCompound, theParts, theName=None):
10975 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10978 theCompound Compound, to find block in.
10979 theParts List of faces and/or edges and/or vertices to be parts of the found block.
10980 theName Object name; when specified, this parameter is used
10981 for result publication in the study. Otherwise, if automatic
10982 publication is switched on, default value is used for result name.
10985 New GEOM_Object, containing the found block.
10987 # Example: see GEOM_TestOthers.py
10988 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10989 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10990 self._autoPublish(anObj, theName, "block")
10993 ## Return all blocks, containing all the elements, passed as the parts.
10994 # @param theCompound Compound, to find blocks in.
10995 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10996 # @param theName Object name; when specified, this parameter is used
10997 # for result publication in the study. Otherwise, if automatic
10998 # publication is switched on, default value is used for result name.
11000 # @return List of GEOM.GEOM_Object, containing the found blocks.
11002 # @ref swig_todo "Example"
11003 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11005 Return all blocks, containing all the elements, passed as the parts.
11008 theCompound Compound, to find blocks in.
11009 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11010 theName Object name; when specified, this parameter is used
11011 for result publication in the study. Otherwise, if automatic
11012 publication is switched on, default value is used for result name.
11015 List of GEOM.GEOM_Object, containing the found blocks.
11017 # Example: see GEOM_Spanner.py
11018 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11019 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11020 self._autoPublish(aList, theName, "block")
11023 ## Multi-transformate block and glue the result.
11024 # Transformation is defined so, as to superpose direction faces.
11025 # @param Block Hexahedral solid to be multi-transformed.
11026 # @param DirFace1 ID of First direction face.
11027 # @param DirFace2 ID of Second direction face.
11028 # @param NbTimes Quantity of transformations to be done.
11029 # @param theName Object name; when specified, this parameter is used
11030 # for result publication in the study. Otherwise, if automatic
11031 # publication is switched on, default value is used for result name.
11033 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11035 # @return New GEOM.GEOM_Object, containing the result shape.
11037 # @ref tui_multi_transformation "Example"
11038 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11040 Multi-transformate block and glue the result.
11041 Transformation is defined so, as to superpose direction faces.
11044 Block Hexahedral solid to be multi-transformed.
11045 DirFace1 ID of First direction face.
11046 DirFace2 ID of Second direction face.
11047 NbTimes Quantity of transformations to be done.
11048 theName Object name; when specified, this parameter is used
11049 for result publication in the study. Otherwise, if automatic
11050 publication is switched on, default value is used for result name.
11053 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11056 New GEOM.GEOM_Object, containing the result shape.
11058 # Example: see GEOM_Spanner.py
11059 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11060 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11061 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11062 anObj.SetParameters(Parameters)
11063 self._autoPublish(anObj, theName, "transformed")
11066 ## Multi-transformate block and glue the result.
11067 # @param Block Hexahedral solid to be multi-transformed.
11068 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11069 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11070 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11071 # @param theName Object name; when specified, this parameter is used
11072 # for result publication in the study. Otherwise, if automatic
11073 # publication is switched on, default value is used for result name.
11075 # @return New GEOM.GEOM_Object, containing the result shape.
11077 # @ref tui_multi_transformation "Example"
11078 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11079 DirFace1V, DirFace2V, NbTimesV, theName=None):
11081 Multi-transformate block and glue the result.
11084 Block Hexahedral solid to be multi-transformed.
11085 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11086 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11087 NbTimesU,NbTimesV Quantity of transformations to be done.
11088 theName Object name; when specified, this parameter is used
11089 for result publication in the study. Otherwise, if automatic
11090 publication is switched on, default value is used for result name.
11093 New GEOM.GEOM_Object, containing the result shape.
11095 # Example: see GEOM_Spanner.py
11096 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11097 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11098 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11099 DirFace1V, DirFace2V, NbTimesV)
11100 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11101 anObj.SetParameters(Parameters)
11102 self._autoPublish(anObj, theName, "transformed")
11105 ## Build all possible propagation groups.
11106 # Propagation group is a set of all edges, opposite to one (main)
11107 # edge of this group directly or through other opposite edges.
11108 # Notion of Opposite Edge make sence only on quadrangle face.
11109 # @param theShape Shape to build propagation groups on.
11110 # @param theName Object name; when specified, this parameter is used
11111 # for result publication in the study. Otherwise, if automatic
11112 # publication is switched on, default value is used for result name.
11114 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11116 # @ref swig_Propagate "Example"
11117 def Propagate(self, theShape, theName=None):
11119 Build all possible propagation groups.
11120 Propagation group is a set of all edges, opposite to one (main)
11121 edge of this group directly or through other opposite edges.
11122 Notion of Opposite Edge make sence only on quadrangle face.
11125 theShape Shape to build propagation groups on.
11126 theName Object name; when specified, this parameter is used
11127 for result publication in the study. Otherwise, if automatic
11128 publication is switched on, default value is used for result name.
11131 List of GEOM.GEOM_Object, each of them is a propagation group.
11133 # Example: see GEOM_TestOthers.py
11134 listChains = self.BlocksOp.Propagate(theShape)
11135 RaiseIfFailed("Propagate", self.BlocksOp)
11136 self._autoPublish(listChains, theName, "propagate")
11139 # end of l3_blocks_op
11142 ## @addtogroup l3_groups
11145 ## Creates a new group which will store sub-shapes of theMainShape
11146 # @param theMainShape is a GEOM object on which the group is selected
11147 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11148 # @param theName Object name; when specified, this parameter is used
11149 # for result publication in the study. Otherwise, if automatic
11150 # publication is switched on, default value is used for result name.
11152 # @return a newly created GEOM group (GEOM.GEOM_Object)
11154 # @ref tui_working_with_groups_page "Example 1"
11155 # \n @ref swig_CreateGroup "Example 2"
11156 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11158 Creates a new group which will store sub-shapes of theMainShape
11161 theMainShape is a GEOM object on which the group is selected
11162 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11163 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11164 theName Object name; when specified, this parameter is used
11165 for result publication in the study. Otherwise, if automatic
11166 publication is switched on, default value is used for result name.
11169 a newly created GEOM group
11172 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11175 # Example: see GEOM_TestOthers.py
11176 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11177 RaiseIfFailed("CreateGroup", self.GroupOp)
11178 self._autoPublish(anObj, theName, "group")
11181 ## Adds a sub-object with ID theSubShapeId to the group
11182 # @param theGroup is a GEOM group to which the new sub-shape is added
11183 # @param theSubShapeID is a sub-shape ID in the main object.
11184 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11186 # @ref tui_working_with_groups_page "Example"
11187 def AddObject(self,theGroup, theSubShapeID):
11189 Adds a sub-object with ID theSubShapeId to the group
11192 theGroup is a GEOM group to which the new sub-shape is added
11193 theSubShapeID is a sub-shape ID in the main object.
11196 Use method GetSubShapeID() to get an unique ID of the sub-shape
11198 # Example: see GEOM_TestOthers.py
11199 self.GroupOp.AddObject(theGroup, theSubShapeID)
11200 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11201 RaiseIfFailed("AddObject", self.GroupOp)
11205 ## Removes a sub-object with ID \a theSubShapeId from the group
11206 # @param theGroup is a GEOM group from which the new sub-shape is removed
11207 # @param theSubShapeID is a sub-shape ID in the main object.
11208 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11210 # @ref tui_working_with_groups_page "Example"
11211 def RemoveObject(self,theGroup, theSubShapeID):
11213 Removes a sub-object with ID theSubShapeId from the group
11216 theGroup is a GEOM group from which the new sub-shape is removed
11217 theSubShapeID is a sub-shape ID in the main object.
11220 Use method GetSubShapeID() to get an unique ID of the sub-shape
11222 # Example: see GEOM_TestOthers.py
11223 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11224 RaiseIfFailed("RemoveObject", self.GroupOp)
11227 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11228 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11229 # @param theSubShapes is a list of sub-shapes to be added.
11231 # @ref tui_working_with_groups_page "Example"
11232 def UnionList (self,theGroup, theSubShapes):
11234 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11237 theGroup is a GEOM group to which the new sub-shapes are added.
11238 theSubShapes is a list of sub-shapes to be added.
11240 # Example: see GEOM_TestOthers.py
11241 self.GroupOp.UnionList(theGroup, theSubShapes)
11242 RaiseIfFailed("UnionList", self.GroupOp)
11245 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11246 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11247 # @param theSubShapes is a list of indices of sub-shapes to be added.
11249 # @ref swig_UnionIDs "Example"
11250 def UnionIDs(self,theGroup, theSubShapes):
11252 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11255 theGroup is a GEOM group to which the new sub-shapes are added.
11256 theSubShapes is a list of indices of sub-shapes to be added.
11258 # Example: see GEOM_TestOthers.py
11259 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11260 RaiseIfFailed("UnionIDs", self.GroupOp)
11263 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11264 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11265 # @param theSubShapes is a list of sub-shapes to be removed.
11267 # @ref tui_working_with_groups_page "Example"
11268 def DifferenceList (self,theGroup, theSubShapes):
11270 Removes from the group all the given shapes. No errors, if some shapes are not included.
11273 theGroup is a GEOM group from which the sub-shapes are removed.
11274 theSubShapes is a list of sub-shapes to be removed.
11276 # Example: see GEOM_TestOthers.py
11277 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11278 RaiseIfFailed("DifferenceList", self.GroupOp)
11281 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11282 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11283 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11285 # @ref swig_DifferenceIDs "Example"
11286 def DifferenceIDs(self,theGroup, theSubShapes):
11288 Removes from the group all the given shapes. No errors, if some shapes are not included.
11291 theGroup is a GEOM group from which the sub-shapes are removed.
11292 theSubShapes is a list of indices of sub-shapes to be removed.
11294 # Example: see GEOM_TestOthers.py
11295 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11296 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11299 ## Union of two groups.
11300 # New group is created. It will contain all entities
11301 # which are present in groups theGroup1 and theGroup2.
11302 # @param theGroup1, theGroup2 are the initial GEOM groups
11303 # to create the united group from.
11304 # @param theName Object name; when specified, this parameter is used
11305 # for result publication in the study. Otherwise, if automatic
11306 # publication is switched on, default value is used for result name.
11308 # @return a newly created GEOM group.
11310 # @ref tui_union_groups_anchor "Example"
11311 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11313 Union of two groups.
11314 New group is created. It will contain all entities
11315 which are present in groups theGroup1 and theGroup2.
11318 theGroup1, theGroup2 are the initial GEOM groups
11319 to create the united group from.
11320 theName Object name; when specified, this parameter is used
11321 for result publication in the study. Otherwise, if automatic
11322 publication is switched on, default value is used for result name.
11325 a newly created GEOM group.
11327 # Example: see GEOM_TestOthers.py
11328 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11329 RaiseIfFailed("UnionGroups", self.GroupOp)
11330 self._autoPublish(aGroup, theName, "group")
11333 ## Intersection of two groups.
11334 # New group is created. It will contain only those entities
11335 # which are present in both groups theGroup1 and theGroup2.
11336 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11337 # @param theName Object name; when specified, this parameter is used
11338 # for result publication in the study. Otherwise, if automatic
11339 # publication is switched on, default value is used for result name.
11341 # @return a newly created GEOM group.
11343 # @ref tui_intersect_groups_anchor "Example"
11344 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11346 Intersection of two groups.
11347 New group is created. It will contain only those entities
11348 which are present in both groups theGroup1 and theGroup2.
11351 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11352 theName Object name; when specified, this parameter is used
11353 for result publication in the study. Otherwise, if automatic
11354 publication is switched on, default value is used for result name.
11357 a newly created GEOM group.
11359 # Example: see GEOM_TestOthers.py
11360 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11361 RaiseIfFailed("IntersectGroups", self.GroupOp)
11362 self._autoPublish(aGroup, theName, "group")
11365 ## Cut of two groups.
11366 # New group is created. It will contain entities which are
11367 # present in group theGroup1 but are not present in group theGroup2.
11368 # @param theGroup1 is a GEOM group to include elements of.
11369 # @param theGroup2 is a GEOM group to exclude elements of.
11370 # @param theName Object name; when specified, this parameter is used
11371 # for result publication in the study. Otherwise, if automatic
11372 # publication is switched on, default value is used for result name.
11374 # @return a newly created GEOM group.
11376 # @ref tui_cut_groups_anchor "Example"
11377 def CutGroups (self, theGroup1, theGroup2, theName=None):
11380 New group is created. It will contain entities which are
11381 present in group theGroup1 but are not present in group theGroup2.
11384 theGroup1 is a GEOM group to include elements of.
11385 theGroup2 is a GEOM group to exclude elements of.
11386 theName Object name; when specified, this parameter is used
11387 for result publication in the study. Otherwise, if automatic
11388 publication is switched on, default value is used for result name.
11391 a newly created GEOM group.
11393 # Example: see GEOM_TestOthers.py
11394 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11395 RaiseIfFailed("CutGroups", self.GroupOp)
11396 self._autoPublish(aGroup, theName, "group")
11399 ## Union of list of groups.
11400 # New group is created. It will contain all entities that are
11401 # present in groups listed in theGList.
11402 # @param theGList is a list of GEOM groups to create the united group from.
11403 # @param theName Object name; when specified, this parameter is used
11404 # for result publication in the study. Otherwise, if automatic
11405 # publication is switched on, default value is used for result name.
11407 # @return a newly created GEOM group.
11409 # @ref tui_union_groups_anchor "Example"
11410 def UnionListOfGroups (self, theGList, theName=None):
11412 Union of list of groups.
11413 New group is created. It will contain all entities that are
11414 present in groups listed in theGList.
11417 theGList is a list of GEOM groups to create the united group from.
11418 theName Object name; when specified, this parameter is used
11419 for result publication in the study. Otherwise, if automatic
11420 publication is switched on, default value is used for result name.
11423 a newly created GEOM group.
11425 # Example: see GEOM_TestOthers.py
11426 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11427 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11428 self._autoPublish(aGroup, theName, "group")
11431 ## Cut of lists of groups.
11432 # New group is created. It will contain only entities
11433 # which are present in groups listed in theGList.
11434 # @param theGList is a list of GEOM groups to include elements of.
11435 # @param theName Object name; when specified, this parameter is used
11436 # for result publication in the study. Otherwise, if automatic
11437 # publication is switched on, default value is used for result name.
11439 # @return a newly created GEOM group.
11441 # @ref tui_intersect_groups_anchor "Example"
11442 def IntersectListOfGroups (self, theGList, theName=None):
11444 Cut of lists of groups.
11445 New group is created. It will contain only entities
11446 which are present in groups listed in theGList.
11449 theGList is a list of GEOM groups to include elements of.
11450 theName Object name; when specified, this parameter is used
11451 for result publication in the study. Otherwise, if automatic
11452 publication is switched on, default value is used for result name.
11455 a newly created GEOM group.
11457 # Example: see GEOM_TestOthers.py
11458 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11459 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11460 self._autoPublish(aGroup, theName, "group")
11463 ## Cut of lists of groups.
11464 # New group is created. It will contain only entities
11465 # which are present in groups listed in theGList1 but
11466 # are not present in groups from theGList2.
11467 # @param theGList1 is a list of GEOM groups to include elements of.
11468 # @param theGList2 is a list of GEOM groups to exclude elements of.
11469 # @param theName Object name; when specified, this parameter is used
11470 # for result publication in the study. Otherwise, if automatic
11471 # publication is switched on, default value is used for result name.
11473 # @return a newly created GEOM group.
11475 # @ref tui_cut_groups_anchor "Example"
11476 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11478 Cut of lists of groups.
11479 New group is created. It will contain only entities
11480 which are present in groups listed in theGList1 but
11481 are not present in groups from theGList2.
11484 theGList1 is a list of GEOM groups to include elements of.
11485 theGList2 is a list of GEOM groups to exclude elements of.
11486 theName Object name; when specified, this parameter is used
11487 for result publication in the study. Otherwise, if automatic
11488 publication is switched on, default value is used for result name.
11491 a newly created GEOM group.
11493 # Example: see GEOM_TestOthers.py
11494 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11495 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11496 self._autoPublish(aGroup, theName, "group")
11499 ## Returns a list of sub-objects ID stored in the group
11500 # @param theGroup is a GEOM group for which a list of IDs is requested
11502 # @ref swig_GetObjectIDs "Example"
11503 def GetObjectIDs(self,theGroup):
11505 Returns a list of sub-objects ID stored in the group
11508 theGroup is a GEOM group for which a list of IDs is requested
11510 # Example: see GEOM_TestOthers.py
11511 ListIDs = self.GroupOp.GetObjects(theGroup)
11512 RaiseIfFailed("GetObjects", self.GroupOp)
11515 ## Returns a type of sub-objects stored in the group
11516 # @param theGroup is a GEOM group which type is returned.
11518 # @ref swig_GetType "Example"
11519 def GetType(self,theGroup):
11521 Returns a type of sub-objects stored in the group
11524 theGroup is a GEOM group which type is returned.
11526 # Example: see GEOM_TestOthers.py
11527 aType = self.GroupOp.GetType(theGroup)
11528 RaiseIfFailed("GetType", self.GroupOp)
11531 ## Convert a type of geom object from id to string value
11532 # @param theId is a GEOM obect type id.
11533 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11534 # @ref swig_GetType "Example"
11535 def ShapeIdToType(self, theId):
11537 Convert a type of geom object from id to string value
11540 theId is a GEOM obect type id.
11543 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11570 return "REVOLUTION"
11618 return "FREE_BOUNDS"
11626 return "THRUSECTIONS"
11628 return "COMPOUNDFILTER"
11630 return "SHAPES_ON_SHAPE"
11632 return "ELLIPSE_ARC"
11634 return "3DSKETCHER"
11640 return "PIPETSHAPE"
11641 return "Shape Id not exist."
11643 ## Returns a main shape associated with the group
11644 # @param theGroup is a GEOM group for which a main shape object is requested
11645 # @return a GEOM object which is a main shape for theGroup
11647 # @ref swig_GetMainShape "Example"
11648 def GetMainShape(self,theGroup):
11650 Returns a main shape associated with the group
11653 theGroup is a GEOM group for which a main shape object is requested
11656 a GEOM object which is a main shape for theGroup
11658 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11660 # Example: see GEOM_TestOthers.py
11661 anObj = self.GroupOp.GetMainShape(theGroup)
11662 RaiseIfFailed("GetMainShape", self.GroupOp)
11665 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11666 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11667 # @param theShape given shape (see GEOM.GEOM_Object)
11668 # @param min_length minimum length of edges of theShape
11669 # @param max_length maximum length of edges of theShape
11670 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11671 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11672 # @param theName Object name; when specified, this parameter is used
11673 # for result publication in the study. Otherwise, if automatic
11674 # publication is switched on, default value is used for result name.
11676 # @return a newly created GEOM group of edges
11678 # @@ref swig_todo "Example"
11679 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11681 Create group of edges of theShape, whose length is in range [min_length, max_length].
11682 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11685 theShape given shape
11686 min_length minimum length of edges of theShape
11687 max_length maximum length of edges of theShape
11688 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11689 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11690 theName Object name; when specified, this parameter is used
11691 for result publication in the study. Otherwise, if automatic
11692 publication is switched on, default value is used for result name.
11695 a newly created GEOM group of edges.
11697 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11698 edges_in_range = []
11700 Props = self.BasicProperties(edge)
11701 if min_length <= Props[0] and Props[0] <= max_length:
11702 if (not include_min) and (min_length == Props[0]):
11705 if (not include_max) and (Props[0] == max_length):
11708 edges_in_range.append(edge)
11710 if len(edges_in_range) <= 0:
11711 print "No edges found by given criteria"
11714 # note: auto-publishing is done in self.CreateGroup()
11715 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11716 self.UnionList(group_edges, edges_in_range)
11720 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11721 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11722 # @param min_length minimum length of edges of selected shape
11723 # @param max_length maximum length of edges of selected shape
11724 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11725 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11726 # @return a newly created GEOM group of edges
11727 # @ref swig_todo "Example"
11728 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11730 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11731 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11734 min_length minimum length of edges of selected shape
11735 max_length maximum length of edges of selected shape
11736 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11737 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11740 a newly created GEOM group of edges.
11742 nb_selected = sg.SelectedCount()
11743 if nb_selected < 1:
11744 print "Select a shape before calling this function, please."
11746 if nb_selected > 1:
11747 print "Only one shape must be selected"
11750 id_shape = sg.getSelected(0)
11751 shape = IDToObject( id_shape )
11753 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11757 if include_min: left_str = " <= "
11758 if include_max: right_str = " <= "
11760 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11761 + left_str + "length" + right_str + `max_length`)
11763 sg.updateObjBrowser(1)
11770 ## @addtogroup l4_advanced
11773 ## Create a T-shape object with specified caracteristics for the main
11774 # and the incident pipes (radius, width, half-length).
11775 # The extremities of the main pipe are located on junctions points P1 and P2.
11776 # The extremity of the incident pipe is located on junction point P3.
11777 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11778 # the main plane of the T-shape is XOY.
11780 # @param theR1 Internal radius of main pipe
11781 # @param theW1 Width of main pipe
11782 # @param theL1 Half-length of main pipe
11783 # @param theR2 Internal radius of incident pipe (R2 < R1)
11784 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11785 # @param theL2 Half-length of incident pipe
11787 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11788 # @param theP1 1st junction point of main pipe
11789 # @param theP2 2nd junction point of main pipe
11790 # @param theP3 Junction point of incident pipe
11792 # @param theRL Internal radius of left thickness reduction
11793 # @param theWL Width of left thickness reduction
11794 # @param theLtransL Length of left transition part
11795 # @param theLthinL Length of left thin part
11797 # @param theRR Internal radius of right thickness reduction
11798 # @param theWR Width of right thickness reduction
11799 # @param theLtransR Length of right transition part
11800 # @param theLthinR Length of right thin part
11802 # @param theRI Internal radius of incident thickness reduction
11803 # @param theWI Width of incident thickness reduction
11804 # @param theLtransI Length of incident transition part
11805 # @param theLthinI Length of incident thin part
11807 # @param theName Object name; when specified, this parameter is used
11808 # for result publication in the study. Otherwise, if automatic
11809 # publication is switched on, default value is used for result name.
11811 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11813 # @ref tui_creation_pipetshape "Example"
11814 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11815 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11816 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11817 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11818 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11821 Create a T-shape object with specified caracteristics for the main
11822 and the incident pipes (radius, width, half-length).
11823 The extremities of the main pipe are located on junctions points P1 and P2.
11824 The extremity of the incident pipe is located on junction point P3.
11825 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11826 the main plane of the T-shape is XOY.
11829 theR1 Internal radius of main pipe
11830 theW1 Width of main pipe
11831 theL1 Half-length of main pipe
11832 theR2 Internal radius of incident pipe (R2 < R1)
11833 theW2 Width of incident pipe (R2+W2 < R1+W1)
11834 theL2 Half-length of incident pipe
11835 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11836 theP1 1st junction point of main pipe
11837 theP2 2nd junction point of main pipe
11838 theP3 Junction point of incident pipe
11840 theRL Internal radius of left thickness reduction
11841 theWL Width of left thickness reduction
11842 theLtransL Length of left transition part
11843 theLthinL Length of left thin part
11845 theRR Internal radius of right thickness reduction
11846 theWR Width of right thickness reduction
11847 theLtransR Length of right transition part
11848 theLthinR Length of right thin part
11850 theRI Internal radius of incident thickness reduction
11851 theWI Width of incident thickness reduction
11852 theLtransI Length of incident transition part
11853 theLthinI Length of incident thin part
11855 theName Object name; when specified, this parameter is used
11856 for result publication in the study. Otherwise, if automatic
11857 publication is switched on, default value is used for result name.
11860 List of GEOM_Object, containing the created shape and propagation groups.
11863 # create PipeTShape object
11864 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11865 # create PipeTShape object with position
11866 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11867 # create PipeTShape object with left thickness reduction
11868 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11870 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)
11871 if (theP1 and theP2 and theP3):
11872 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11873 theRL, theWL, theLtransL, theLthinL,
11874 theRR, theWR, theLtransR, theLthinR,
11875 theRI, theWI, theLtransI, theLthinI,
11876 theHexMesh, theP1, theP2, theP3)
11878 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11879 theRL, theWL, theLtransL, theLthinL,
11880 theRR, theWR, theLtransR, theLthinR,
11881 theRI, theWI, theLtransI, theLthinI,
11883 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11884 if Parameters: anObj[0].SetParameters(Parameters)
11885 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11886 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11889 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11890 # and the incident pipes (radius, width, half-length). The chamfer is
11891 # created on the junction of the pipes.
11892 # The extremities of the main pipe are located on junctions points P1 and P2.
11893 # The extremity of the incident pipe is located on junction point P3.
11894 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11895 # the main plane of the T-shape is XOY.
11896 # @param theR1 Internal radius of main pipe
11897 # @param theW1 Width of main pipe
11898 # @param theL1 Half-length of main pipe
11899 # @param theR2 Internal radius of incident pipe (R2 < R1)
11900 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11901 # @param theL2 Half-length of incident pipe
11902 # @param theH Height of the chamfer.
11903 # @param theW Width of the chamfer.
11904 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11905 # @param theP1 1st junction point of main pipe
11906 # @param theP2 2nd junction point of main pipe
11907 # @param theP3 Junction point of incident pipe
11909 # @param theRL Internal radius of left thickness reduction
11910 # @param theWL Width of left thickness reduction
11911 # @param theLtransL Length of left transition part
11912 # @param theLthinL Length of left thin part
11914 # @param theRR Internal radius of right thickness reduction
11915 # @param theWR Width of right thickness reduction
11916 # @param theLtransR Length of right transition part
11917 # @param theLthinR Length of right thin part
11919 # @param theRI Internal radius of incident thickness reduction
11920 # @param theWI Width of incident thickness reduction
11921 # @param theLtransI Length of incident transition part
11922 # @param theLthinI Length of incident thin part
11924 # @param theName Object name; when specified, this parameter is used
11925 # for result publication in the study. Otherwise, if automatic
11926 # publication is switched on, default value is used for result name.
11928 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11930 # @ref tui_creation_pipetshape "Example"
11931 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11932 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11933 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11934 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11935 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11938 Create a T-shape object with chamfer and with specified caracteristics for the main
11939 and the incident pipes (radius, width, half-length). The chamfer is
11940 created on the junction of the pipes.
11941 The extremities of the main pipe are located on junctions points P1 and P2.
11942 The extremity of the incident pipe is located on junction point P3.
11943 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11944 the main plane of the T-shape is XOY.
11947 theR1 Internal radius of main pipe
11948 theW1 Width of main pipe
11949 theL1 Half-length of main pipe
11950 theR2 Internal radius of incident pipe (R2 < R1)
11951 theW2 Width of incident pipe (R2+W2 < R1+W1)
11952 theL2 Half-length of incident pipe
11953 theH Height of the chamfer.
11954 theW Width of the chamfer.
11955 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11956 theP1 1st junction point of main pipe
11957 theP2 2nd junction point of main pipe
11958 theP3 Junction point of incident pipe
11960 theRL Internal radius of left thickness reduction
11961 theWL Width of left thickness reduction
11962 theLtransL Length of left transition part
11963 theLthinL Length of left thin part
11965 theRR Internal radius of right thickness reduction
11966 theWR Width of right thickness reduction
11967 theLtransR Length of right transition part
11968 theLthinR Length of right thin part
11970 theRI Internal radius of incident thickness reduction
11971 theWI Width of incident thickness reduction
11972 theLtransI Length of incident transition part
11973 theLthinI Length of incident thin part
11975 theName Object name; when specified, this parameter is used
11976 for result publication in the study. Otherwise, if automatic
11977 publication is switched on, default value is used for result name.
11980 List of GEOM_Object, containing the created shape and propagation groups.
11983 # create PipeTShape with chamfer object
11984 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11985 # create PipeTShape with chamfer object with position
11986 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11987 # create PipeTShape with chamfer object with left thickness reduction
11988 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)
11990 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)
11991 if (theP1 and theP2 and theP3):
11992 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11993 theRL, theWL, theLtransL, theLthinL,
11994 theRR, theWR, theLtransR, theLthinR,
11995 theRI, theWI, theLtransI, theLthinI,
11996 theH, theW, theHexMesh, theP1, theP2, theP3)
11998 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
11999 theRL, theWL, theLtransL, theLthinL,
12000 theRR, theWR, theLtransR, theLthinR,
12001 theRI, theWI, theLtransI, theLthinI,
12002 theH, theW, theHexMesh)
12003 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12004 if Parameters: anObj[0].SetParameters(Parameters)
12005 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12006 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12009 ## Create a T-shape object with fillet and with specified caracteristics for the main
12010 # and the incident pipes (radius, width, half-length). The fillet is
12011 # created on the junction of the pipes.
12012 # The extremities of the main pipe are located on junctions points P1 and P2.
12013 # The extremity of the incident pipe is located on junction point P3.
12014 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12015 # the main plane of the T-shape is XOY.
12016 # @param theR1 Internal radius of main pipe
12017 # @param theW1 Width of main pipe
12018 # @param theL1 Half-length of main pipe
12019 # @param theR2 Internal radius of incident pipe (R2 < R1)
12020 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12021 # @param theL2 Half-length of incident pipe
12022 # @param theRF Radius of curvature of fillet.
12023 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12024 # @param theP1 1st junction point of main pipe
12025 # @param theP2 2nd junction point of main pipe
12026 # @param theP3 Junction point of incident pipe
12028 # @param theRL Internal radius of left thickness reduction
12029 # @param theWL Width of left thickness reduction
12030 # @param theLtransL Length of left transition part
12031 # @param theLthinL Length of left thin part
12033 # @param theRR Internal radius of right thickness reduction
12034 # @param theWR Width of right thickness reduction
12035 # @param theLtransR Length of right transition part
12036 # @param theLthinR Length of right thin part
12038 # @param theRI Internal radius of incident thickness reduction
12039 # @param theWI Width of incident thickness reduction
12040 # @param theLtransI Length of incident transition part
12041 # @param theLthinI Length of incident thin part
12043 # @param theName Object name; when specified, this parameter is used
12044 # for result publication in the study. Otherwise, if automatic
12045 # publication is switched on, default value is used for result name.
12047 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12049 # @ref tui_creation_pipetshape "Example"
12050 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12051 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12052 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12053 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12054 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12057 Create a T-shape object with fillet and with specified caracteristics for the main
12058 and the incident pipes (radius, width, half-length). The fillet is
12059 created on the junction of the pipes.
12060 The extremities of the main pipe are located on junctions points P1 and P2.
12061 The extremity of the incident pipe is located on junction point P3.
12064 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12065 the main plane of the T-shape is XOY.
12066 theR1 Internal radius of main pipe
12067 theW1 Width of main pipe
12068 heL1 Half-length of main pipe
12069 theR2 Internal radius of incident pipe (R2 < R1)
12070 theW2 Width of incident pipe (R2+W2 < R1+W1)
12071 theL2 Half-length of incident pipe
12072 theRF Radius of curvature of fillet.
12073 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12074 theP1 1st junction point of main pipe
12075 theP2 2nd junction point of main pipe
12076 theP3 Junction point of incident pipe
12078 theRL Internal radius of left thickness reduction
12079 theWL Width of left thickness reduction
12080 theLtransL Length of left transition part
12081 theLthinL Length of left thin part
12083 theRR Internal radius of right thickness reduction
12084 theWR Width of right thickness reduction
12085 theLtransR Length of right transition part
12086 theLthinR Length of right thin part
12088 theRI Internal radius of incident thickness reduction
12089 theWI Width of incident thickness reduction
12090 theLtransI Length of incident transition part
12091 theLthinI Length of incident thin part
12093 theName Object name; when specified, this parameter is used
12094 for result publication in the study. Otherwise, if automatic
12095 publication is switched on, default value is used for result name.
12098 List of GEOM_Object, containing the created shape and propagation groups.
12101 # create PipeTShape with fillet object
12102 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12103 # create PipeTShape with fillet object with position
12104 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12105 # create PipeTShape with fillet object with left thickness reduction
12106 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)
12108 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)
12109 if (theP1 and theP2 and theP3):
12110 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12111 theRL, theWL, theLtransL, theLthinL,
12112 theRR, theWR, theLtransR, theLthinR,
12113 theRI, theWI, theLtransI, theLthinI,
12114 theRF, theHexMesh, theP1, theP2, theP3)
12116 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12117 theRL, theWL, theLtransL, theLthinL,
12118 theRR, theWR, theLtransR, theLthinR,
12119 theRI, theWI, theLtransI, theLthinI,
12121 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12122 if Parameters: anObj[0].SetParameters(Parameters)
12123 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12124 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12127 ## This function allows creating a disk already divided into blocks. It
12128 # can be used to create divided pipes for later meshing in hexaedra.
12129 # @param theR Radius of the disk
12130 # @param theOrientation Orientation of the plane on which the disk will be built
12131 # 1 = XOY, 2 = OYZ, 3 = OZX
12132 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12133 # @param theName Object name; when specified, this parameter is used
12134 # for result publication in the study. Otherwise, if automatic
12135 # publication is switched on, default value is used for result name.
12137 # @return New GEOM_Object, containing the created shape.
12139 # @ref tui_creation_divideddisk "Example"
12140 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12142 Creates a disk, divided into blocks. It can be used to create divided pipes
12143 for later meshing in hexaedra.
12146 theR Radius of the disk
12147 theOrientation Orientation of the plane on which the disk will be built:
12148 1 = XOY, 2 = OYZ, 3 = OZX
12149 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12150 theName Object name; when specified, this parameter is used
12151 for result publication in the study. Otherwise, if automatic
12152 publication is switched on, default value is used for result name.
12155 New GEOM_Object, containing the created shape.
12157 theR, Parameters = ParseParameters(theR)
12158 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12159 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12160 if Parameters: anObj.SetParameters(Parameters)
12161 self._autoPublish(anObj, theName, "dividedDisk")
12164 ## This function allows creating a disk already divided into blocks. It
12165 # can be used to create divided pipes for later meshing in hexaedra.
12166 # @param theCenter Center of the disk
12167 # @param theVector Normal vector to the plane of the created disk
12168 # @param theRadius Radius of the disk
12169 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12170 # @param theName Object name; when specified, this parameter is used
12171 # for result publication in the study. Otherwise, if automatic
12172 # publication is switched on, default value is used for result name.
12174 # @return New GEOM_Object, containing the created shape.
12176 # @ref tui_creation_divideddisk "Example"
12177 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12179 Creates a disk already divided into blocks. It can be used to create divided pipes
12180 for later meshing in hexaedra.
12183 theCenter Center of the disk
12184 theVector Normal vector to the plane of the created disk
12185 theRadius Radius of the disk
12186 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12187 theName Object name; when specified, this parameter is used
12188 for result publication in the study. Otherwise, if automatic
12189 publication is switched on, default value is used for result name.
12192 New GEOM_Object, containing the created shape.
12194 theRadius, Parameters = ParseParameters(theRadius)
12195 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12196 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12197 if Parameters: anObj.SetParameters(Parameters)
12198 self._autoPublish(anObj, theName, "dividedDisk")
12201 ## Builds a cylinder prepared for hexa meshes
12202 # @param theR Radius of the cylinder
12203 # @param theH Height of the cylinder
12204 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12205 # @param theName Object name; when specified, this parameter is used
12206 # for result publication in the study. Otherwise, if automatic
12207 # publication is switched on, default value is used for result name.
12209 # @return New GEOM_Object, containing the created shape.
12211 # @ref tui_creation_dividedcylinder "Example"
12212 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12214 Builds a cylinder prepared for hexa meshes
12217 theR Radius of the cylinder
12218 theH Height of the cylinder
12219 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12220 theName Object name; when specified, this parameter is used
12221 for result publication in the study. Otherwise, if automatic
12222 publication is switched on, default value is used for result name.
12225 New GEOM_Object, containing the created shape.
12227 theR, theH, Parameters = ParseParameters(theR, theH)
12228 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12229 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12230 if Parameters: anObj.SetParameters(Parameters)
12231 self._autoPublish(anObj, theName, "dividedCylinder")
12234 ## Create a surface from a cloud of points
12235 # @param thelPoints list of points
12236 # @return New GEOM_Object, containing the created shape.
12238 # @ref tui_creation_smoothingsurface "Example"
12239 def MakeSmoothingSurface(self, thelPoints):
12240 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12241 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12244 #@@ insert new functions before this line @@ do not remove this line @@#
12246 # end of l4_advanced
12249 ## Create a copy of the given object
12251 # @param theOriginal geometry object for copy
12252 # @param theName Object name; when specified, this parameter is used
12253 # for result publication in the study. Otherwise, if automatic
12254 # publication is switched on, default value is used for result name.
12256 # @return New GEOM_Object, containing the copied shape.
12258 # @ingroup l1_geomBuilder_auxiliary
12259 # @ref swig_MakeCopy "Example"
12260 def MakeCopy(self, theOriginal, theName=None):
12262 Create a copy of the given object
12265 theOriginal geometry object for copy
12266 theName Object name; when specified, this parameter is used
12267 for result publication in the study. Otherwise, if automatic
12268 publication is switched on, default value is used for result name.
12271 New GEOM_Object, containing the copied shape.
12273 Example of usage: Copy = geompy.MakeCopy(Box)
12275 # Example: see GEOM_TestAll.py
12276 anObj = self.InsertOp.MakeCopy(theOriginal)
12277 RaiseIfFailed("MakeCopy", self.InsertOp)
12278 self._autoPublish(anObj, theName, "copy")
12281 ## Add Path to load python scripts from
12282 # @param Path a path to load python scripts from
12283 # @ingroup l1_geomBuilder_auxiliary
12284 def addPath(self,Path):
12286 Add Path to load python scripts from
12289 Path a path to load python scripts from
12291 if (sys.path.count(Path) < 1):
12292 sys.path.append(Path)
12296 ## Load marker texture from the file
12297 # @param Path a path to the texture file
12298 # @return unique texture identifier
12299 # @ingroup l1_geomBuilder_auxiliary
12300 def LoadTexture(self, Path):
12302 Load marker texture from the file
12305 Path a path to the texture file
12308 unique texture identifier
12310 # Example: see GEOM_TestAll.py
12311 ID = self.InsertOp.LoadTexture(Path)
12312 RaiseIfFailed("LoadTexture", self.InsertOp)
12315 ## Get internal name of the object based on its study entry
12316 # @note This method does not provide an unique identifier of the geometry object.
12317 # @note This is internal function of GEOM component, though it can be used outside it for
12318 # appropriate reason (e.g. for identification of geometry object).
12319 # @param obj geometry object
12320 # @return unique object identifier
12321 # @ingroup l1_geomBuilder_auxiliary
12322 def getObjectID(self, obj):
12324 Get internal name of the object based on its study entry.
12325 Note: this method does not provide an unique identifier of the geometry object.
12326 It is an internal function of GEOM component, though it can be used outside GEOM for
12327 appropriate reason (e.g. for identification of geometry object).
12330 obj geometry object
12333 unique object identifier
12336 entry = salome.ObjectToID(obj)
12337 if entry is not None:
12338 lst = entry.split(":")
12340 ID = lst[-1] # -1 means last item in the list
12341 return "GEOM_" + ID
12346 ## Add marker texture. @a Width and @a Height parameters
12347 # specify width and height of the texture in pixels.
12348 # If @a RowData is @c True, @a Texture parameter should represent texture data
12349 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12350 # parameter should be unpacked string, in which '1' symbols represent opaque
12351 # pixels and '0' represent transparent pixels of the texture bitmap.
12353 # @param Width texture width in pixels
12354 # @param Height texture height in pixels
12355 # @param Texture texture data
12356 # @param RowData if @c True, @a Texture data are packed in the byte stream
12357 # @return unique texture identifier
12358 # @ingroup l1_geomBuilder_auxiliary
12359 def AddTexture(self, Width, Height, Texture, RowData=False):
12361 Add marker texture. Width and Height parameters
12362 specify width and height of the texture in pixels.
12363 If RowData is True, Texture parameter should represent texture data
12364 packed into the byte array. If RowData is False (default), Texture
12365 parameter should be unpacked string, in which '1' symbols represent opaque
12366 pixels and '0' represent transparent pixels of the texture bitmap.
12369 Width texture width in pixels
12370 Height texture height in pixels
12371 Texture texture data
12372 RowData if True, Texture data are packed in the byte stream
12375 return unique texture identifier
12377 if not RowData: Texture = PackData(Texture)
12378 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12379 RaiseIfFailed("AddTexture", self.InsertOp)
12382 ## Creates a new folder object. It is a container for any GEOM objects.
12383 # @param Name name of the container
12384 # @param Father parent object. If None,
12385 # folder under 'Geometry' root object will be created.
12386 # @return a new created folder
12387 def NewFolder(self, Name, Father=None):
12389 Create a new folder object. It is an auxiliary container for any GEOM objects.
12392 Name name of the container
12393 Father parent object. If None,
12394 folder under 'Geometry' root object will be created.
12397 a new created folder
12399 if not Father: Father = self.father
12400 return self.CreateFolder(Name, Father)
12402 ## Move object to the specified folder
12403 # @param Object object to move
12404 # @param Folder target folder
12405 def PutToFolder(self, Object, Folder):
12407 Move object to the specified folder
12410 Object object to move
12411 Folder target folder
12413 self.MoveToFolder(Object, Folder)
12416 ## Move list of objects to the specified folder
12417 # @param ListOfSO list of objects to move
12418 # @param Folder target folder
12419 def PutListToFolder(self, ListOfSO, Folder):
12421 Move list of objects to the specified folder
12424 ListOfSO list of objects to move
12425 Folder target folder
12427 self.MoveListToFolder(ListOfSO, Folder)
12431 # Register the new proxy for GEOM_Gen
12432 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12434 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12435 # interface to GEOM operations.
12440 # salome.salome_init()
12441 # from salome.geom import geomBuilder
12442 # geompy = geomBuilder.New(salome.myStudy)
12444 # @param study SALOME study, generally obtained by salome.myStudy.
12445 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12446 # @return geomBuilder instance
12447 def New( study, instance=None):
12449 Create a new geomBuilder instance.The geomBuilder class provides the Python
12450 interface to GEOM operations.
12454 salome.salome_init()
12455 from salome.geom import geomBuilder
12456 geompy = geomBuilder.New(salome.myStudy)
12459 study SALOME study, generally obtained by salome.myStudy.
12460 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12462 geomBuilder instance
12464 #print "New geomBuilder ", study, instance
12471 geom = geomBuilder()
12472 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12473 geom.init_geom(study)