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 ##! Private class used to bind calls of plugin operations to geomBuilder
463 class PluginOperation:
464 def __init__(self, operation, function):
465 self.operation = operation
466 self.function = function
469 def __call__(self, *args):
470 res = self.function(self.operation, *args)
471 RaiseIfFailed(self.function.__name__, self.operation)
474 # Warning: geom is a singleton
480 class geomBuilder(object, GEOM._objref_GEOM_Gen):
482 ## Enumeration ShapeType as a dictionary. \n
483 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
484 # @ingroup l1_geomBuilder_auxiliary
485 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
487 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
488 # and a list of parameters, describing the shape.
489 # List of parameters, describing the shape:
490 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
491 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
493 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
495 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
497 # - SPHERE: [xc yc zc R]
498 # - CYLINDER: [xb yb zb dx dy dz R H]
499 # - BOX: [xc yc zc ax ay az]
500 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
501 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
502 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
503 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
504 # - SOLID: [nb_faces nb_edges nb_vertices]
506 # - SPHERE2D: [xc yc zc R]
507 # - CYLINDER2D: [xb yb zb dx dy dz R H]
508 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
509 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
510 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
511 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
512 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
513 # - PLANE: [xo yo zo dx dy dz]
514 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
515 # - FACE: [nb_edges nb_vertices]
517 # - CIRCLE: [xc yc zc dx dy dz R]
518 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
519 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
520 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
521 # - LINE: [xo yo zo dx dy dz]
522 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
523 # - EDGE: [nb_vertices]
526 # @ingroup l1_geomBuilder_auxiliary
527 kind = GEOM.GEOM_IKindOfShape
534 #print "==== __new__ ", engine, geom, doLcc, created
536 # geom engine is either retrieved from engine, or created
538 # Following test avoids a recursive loop
541 # geom engine not created: existing engine found
543 if doLcc and not created:
545 # FindOrLoadComponent called:
546 # 1. CORBA resolution of server
547 # 2. the __new__ method is called again
548 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
549 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
552 # FindOrLoadComponent not called
554 # geomBuilder instance is created from lcc.FindOrLoadComponent
555 #print "==== super ", engine, geom, doLcc, created
556 geom = super(geomBuilder,cls).__new__(cls)
559 # geom engine not created: existing engine found
560 #print "==== existing ", engine, geom, doLcc, created
562 #print "return geom 1 ", geom
565 #print "return geom 2 ", geom
570 #print "-------- geomBuilder __init__ --- ", created, self
573 GEOM._objref_GEOM_Gen.__init__(self)
574 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
575 self.myBuilder = None
594 ## Process object publication in the study, as follows:
595 # - if @a theName is specified (not None), the object is published in the study
596 # with this name, not taking into account "auto-publishing" option;
597 # - if @a theName is NOT specified, the object is published in the study
598 # (using default name, which can be customized using @a theDefaultName parameter)
599 # only if auto-publishing is switched on.
601 # @param theObj object, a subject for publishing
602 # @param theName object name for study
603 # @param theDefaultName default name for the auto-publishing
605 # @sa addToStudyAuto()
606 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
608 def _item_name(_names, _defname, _idx=-1):
609 if not _names: _names = _defname
610 if type(_names) in [types.ListType, types.TupleType]:
612 if _idx >= len(_names) or not _names[_idx]:
613 if type(_defname) not in [types.ListType, types.TupleType]:
614 _name = "%s_%d"%(_defname, _idx+1)
615 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
616 _name = _defname[_idx]
618 _name = "%noname_%d"%(dn, _idx+1)
624 # must be wrong usage
629 _name = "%s_%d"%(_names, _idx+1)
637 if not theName and not self.myMaxNbSubShapesAllowed:
638 return # nothing to do: auto-publishing is disabled
639 if not theName and not theDefaultName:
640 return # neither theName nor theDefaultName is given
642 if type(theObj) in [types.ListType, types.TupleType]:
643 # list of objects is being published
646 if not obj: continue # bad object
647 ###if obj.GetStudyEntry(): continue # already published
648 name = _item_name(theName, theDefaultName, idx)
649 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
650 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
652 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
655 if not theName and idx == self.myMaxNbSubShapesAllowed: break
659 # single object is published
660 ###if theObj.GetStudyEntry(): return # already published
661 name = _item_name(theName, theDefaultName)
662 if theObj.IsMainShape():
663 self.addToStudy(theObj, name)
665 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
670 ## @addtogroup l1_geomBuilder_auxiliary
672 def init_geom(self,theStudy):
673 self.myStudy = theStudy
674 self.myStudyId = self.myStudy._get_StudyId()
675 self.myBuilder = self.myStudy.NewBuilder()
676 self.father = self.myStudy.FindComponent("GEOM")
677 if self.father is None:
678 self.father = self.myBuilder.NewComponent("GEOM")
679 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
680 FName = A1._narrow(SALOMEDS.AttributeName)
681 FName.SetValue("Geometry")
682 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
683 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
684 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
685 self.myBuilder.DefineComponentInstance(self.father,self)
687 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
688 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
689 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
690 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
691 self.HealOp = self.GetIHealingOperations (self.myStudyId)
692 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
693 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
694 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
695 self.LocalOp = self.GetILocalOperations (self.myStudyId)
696 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
697 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
698 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
699 #self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
700 self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
701 # set GEOM as root in the use case tree
702 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
703 self.myUseCaseBuilder.SetRootCurrent()
704 self.myUseCaseBuilder.Append(self.father)
707 def GetPluginOperations(self, studyID, libraryName):
708 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
710 # bind methods of operations to self
711 methods = op.__class__.__dict__['__methods__']
712 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
713 for meth_name in methods:
714 if not meth_name in avoid_methods: # avoid basic methods
715 function = getattr(op.__class__, meth_name)
716 if callable(function):
717 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
718 self.__dict__[meth_name] = PluginOperation(op, function)
721 ## Enable / disable results auto-publishing
723 # The automatic publishing is managed in the following way:
724 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
725 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
726 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
727 # value passed as parameter has the same effect.
728 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
729 # maximum number of sub-shapes allowed for publishing is set to specified value.
731 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
732 # @ingroup l1_publish_data
733 def addToStudyAuto(self, maxNbSubShapes=-1):
735 Enable / disable results auto-publishing
737 The automatic publishing is managed in the following way:
738 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
739 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
740 maximum number of sub-shapes allowed for publishing is unlimited; any negative
741 value passed as parameter has the same effect.
742 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
743 maximum number of sub-shapes allowed for publishing is set to this value.
746 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
749 geompy.addToStudyAuto() # enable auto-publishing
750 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
751 geompy.addToStudyAuto(0) # disable auto-publishing
753 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
756 ## Dump component to the Python script
757 # This method overrides IDL function to allow default values for the parameters.
758 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
760 Dump component to the Python script
761 This method overrides IDL function to allow default values for the parameters.
763 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
765 ## Get name for sub-shape aSubObj of shape aMainObj
767 # @ref swig_SubShapeName "Example"
768 def SubShapeName(self,aSubObj, aMainObj):
770 Get name for sub-shape aSubObj of shape aMainObj
772 # Example: see GEOM_TestAll.py
774 #aSubId = orb.object_to_string(aSubObj)
775 #aMainId = orb.object_to_string(aMainObj)
776 #index = gg.getIndexTopology(aSubId, aMainId)
777 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
778 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
779 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
782 ## Publish in study aShape with name aName
784 # \param aShape the shape to be published
785 # \param aName the name for the shape
786 # \param doRestoreSubShapes if True, finds and publishes also
787 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
788 # and published sub-shapes of arguments
789 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
790 # these arguments description
791 # \return study entry of the published shape in form of string
793 # @ingroup l1_publish_data
794 # @ref swig_all_addtostudy "Example"
795 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
796 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
798 Publish in study aShape with name aName
801 aShape the shape to be published
802 aName the name for the shape
803 doRestoreSubShapes if True, finds and publishes also
804 sub-shapes of aShape, corresponding to its arguments
805 and published sub-shapes of arguments
806 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
807 these arguments description
810 study entry of the published shape in form of string
813 id_block1 = geompy.addToStudy(Block1, "Block 1")
815 # Example: see GEOM_TestAll.py
817 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
818 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
819 if doRestoreSubShapes:
820 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
821 theFindMethod, theInheritFirstArg, True )
823 print "addToStudy() failed"
825 return aShape.GetStudyEntry()
827 ## Publish in study aShape with name aName as sub-object of previously published aFather
828 # \param aFather previously published object
829 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
830 # \param aName the name for the shape
832 # \return study entry of the published shape in form of string
834 # @ingroup l1_publish_data
835 # @ref swig_all_addtostudyInFather "Example"
836 def addToStudyInFather(self, aFather, aShape, aName):
838 Publish in study aShape with name aName as sub-object of previously published aFather
841 aFather previously published object
842 aShape the shape to be published as sub-object of aFather
843 aName the name for the shape
846 study entry of the published shape in form of string
848 # Example: see GEOM_TestAll.py
850 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
851 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
853 print "addToStudyInFather() failed"
855 return aShape.GetStudyEntry()
857 ## Unpublish object in study
859 # \param obj the object to be unpublished
860 def hideInStudy(self, obj):
862 Unpublish object in study
865 obj the object to be unpublished
867 ior = salome.orb.object_to_string(obj)
868 aSObject = self.myStudy.FindObjectIOR(ior)
869 if aSObject is not None:
870 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
871 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
872 drwAttribute.SetDrawable(False)
875 # end of l1_geomBuilder_auxiliary
878 ## @addtogroup l3_restore_ss
881 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
882 # To be used from python scripts out of addToStudy() (non-default usage)
883 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
884 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
885 # If this list is empty, all operation arguments will be published
886 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
887 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
888 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
889 # Do not publish sub-shapes in place of arguments, but only
890 # in place of sub-shapes of the first argument,
891 # because the whole shape corresponds to the first argument.
892 # Mainly to be used after transformations, but it also can be
893 # usefull after partition with one object shape, and some other
894 # operations, where only the first argument has to be considered.
895 # If theObject has only one argument shape, this flag is automatically
896 # considered as True, not regarding really passed value.
897 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
898 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
899 # \return list of published sub-shapes
901 # @ref tui_restore_prs_params "Example"
902 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
903 theInheritFirstArg=False, theAddPrefix=True):
905 Publish sub-shapes, standing for arguments and sub-shapes of arguments
906 To be used from python scripts out of geompy.addToStudy (non-default usage)
909 theObject published GEOM.GEOM_Object, arguments of which will be published
910 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
911 If this list is empty, all operation arguments will be published
912 theFindMethod method to search sub-shapes, corresponding to arguments and
913 their sub-shapes. Value from enumeration GEOM.find_shape_method.
914 theInheritFirstArg set properties of the first argument for theObject.
915 Do not publish sub-shapes in place of arguments, but only
916 in place of sub-shapes of the first argument,
917 because the whole shape corresponds to the first argument.
918 Mainly to be used after transformations, but it also can be
919 usefull after partition with one object shape, and some other
920 operations, where only the first argument has to be considered.
921 If theObject has only one argument shape, this flag is automatically
922 considered as True, not regarding really passed value.
923 theAddPrefix add prefix "from_" to names of restored sub-shapes,
924 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
926 list of published sub-shapes
928 # Example: see GEOM_TestAll.py
929 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
930 theFindMethod, theInheritFirstArg, theAddPrefix)
932 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
933 # To be used from python scripts out of addToStudy() (non-default usage)
934 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
935 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
936 # If this list is empty, all operation arguments will be published
937 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
938 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
939 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
940 # Do not publish sub-shapes in place of arguments, but only
941 # in place of sub-shapes of the first argument,
942 # because the whole shape corresponds to the first argument.
943 # Mainly to be used after transformations, but it also can be
944 # usefull after partition with one object shape, and some other
945 # operations, where only the first argument has to be considered.
946 # If theObject has only one argument shape, this flag is automatically
947 # considered as True, not regarding really passed value.
948 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
949 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
950 # \return list of published sub-shapes
952 # @ref tui_restore_prs_params "Example"
953 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
954 theInheritFirstArg=False, theAddPrefix=True):
956 Publish sub-shapes, standing for arguments and sub-shapes of arguments
957 To be used from python scripts out of geompy.addToStudy() (non-default usage)
960 theObject published GEOM.GEOM_Object, arguments of which will be published
961 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
962 If this list is empty, all operation arguments will be published
963 theFindMethod method to search sub-shapes, corresponding to arguments and
964 their sub-shapes. Value from enumeration GEOM::find_shape_method.
965 theInheritFirstArg set properties of the first argument for theObject.
966 Do not publish sub-shapes in place of arguments, but only
967 in place of sub-shapes of the first argument,
968 because the whole shape corresponds to the first argument.
969 Mainly to be used after transformations, but it also can be
970 usefull after partition with one object shape, and some other
971 operations, where only the first argument has to be considered.
972 If theObject has only one argument shape, this flag is automatically
973 considered as True, not regarding really passed value.
974 theAddPrefix add prefix "from_" to names of restored sub-shapes,
975 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
978 list of published sub-shapes
980 # Example: see GEOM_TestAll.py
981 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
982 theFindMethod, theInheritFirstArg, theAddPrefix)
984 # end of l3_restore_ss
987 ## @addtogroup l3_basic_go
990 ## Create point by three coordinates.
991 # @param theX The X coordinate of the point.
992 # @param theY The Y coordinate of the point.
993 # @param theZ The Z coordinate of the point.
994 # @param theName Object name; when specified, this parameter is used
995 # for result publication in the study. Otherwise, if automatic
996 # publication is switched on, default value is used for result name.
998 # @return New GEOM.GEOM_Object, containing the created point.
1000 # @ref tui_creation_point "Example"
1001 def MakeVertex(self, theX, theY, theZ, theName=None):
1003 Create point by three coordinates.
1006 theX The X coordinate of the point.
1007 theY The Y coordinate of the point.
1008 theZ The Z coordinate of the point.
1009 theName Object name; when specified, this parameter is used
1010 for result publication in the study. Otherwise, if automatic
1011 publication is switched on, default value is used for result name.
1014 New GEOM.GEOM_Object, containing the created point.
1016 # Example: see GEOM_TestAll.py
1017 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1018 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1019 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1020 anObj.SetParameters(Parameters)
1021 self._autoPublish(anObj, theName, "vertex")
1024 ## Create a point, distant from the referenced point
1025 # on the given distances along the coordinate axes.
1026 # @param theReference The referenced point.
1027 # @param theX Displacement from the referenced point along OX axis.
1028 # @param theY Displacement from the referenced point along OY axis.
1029 # @param theZ Displacement from the referenced point along OZ axis.
1030 # @param theName Object name; when specified, this parameter is used
1031 # for result publication in the study. Otherwise, if automatic
1032 # publication is switched on, default value is used for result name.
1034 # @return New GEOM.GEOM_Object, containing the created point.
1036 # @ref tui_creation_point "Example"
1037 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1039 Create a point, distant from the referenced point
1040 on the given distances along the coordinate axes.
1043 theReference The referenced point.
1044 theX Displacement from the referenced point along OX axis.
1045 theY Displacement from the referenced point along OY axis.
1046 theZ Displacement from the referenced point along OZ axis.
1047 theName Object name; when specified, this parameter is used
1048 for result publication in the study. Otherwise, if automatic
1049 publication is switched on, default value is used for result name.
1052 New GEOM.GEOM_Object, containing the created point.
1054 # Example: see GEOM_TestAll.py
1055 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1056 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1057 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1058 anObj.SetParameters(Parameters)
1059 self._autoPublish(anObj, theName, "vertex")
1062 ## Create a point, corresponding to the given parameter on the given curve.
1063 # @param theRefCurve The referenced curve.
1064 # @param theParameter Value of parameter on the referenced curve.
1065 # @param theName Object name; when specified, this parameter is used
1066 # for result publication in the study. Otherwise, if automatic
1067 # publication is switched on, default value is used for result name.
1069 # @return New GEOM.GEOM_Object, containing the created point.
1071 # @ref tui_creation_point "Example"
1072 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1074 Create a point, corresponding to the given parameter on the given curve.
1077 theRefCurve The referenced curve.
1078 theParameter Value of parameter on the referenced curve.
1079 theName Object name; when specified, this parameter is used
1080 for result publication in the study. Otherwise, if automatic
1081 publication is switched on, default value is used for result name.
1084 New GEOM.GEOM_Object, containing the created point.
1087 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1089 # Example: see GEOM_TestAll.py
1090 theParameter, Parameters = ParseParameters(theParameter)
1091 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1092 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1093 anObj.SetParameters(Parameters)
1094 self._autoPublish(anObj, theName, "vertex")
1097 ## Create a point by projection give coordinates on the given curve
1098 # @param theRefCurve The referenced curve.
1099 # @param theX X-coordinate in 3D space
1100 # @param theY Y-coordinate in 3D space
1101 # @param theZ Z-coordinate in 3D space
1102 # @param theName Object name; when specified, this parameter is used
1103 # for result publication in the study. Otherwise, if automatic
1104 # publication is switched on, default value is used for result name.
1106 # @return New GEOM.GEOM_Object, containing the created point.
1108 # @ref tui_creation_point "Example"
1109 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1111 Create a point by projection give coordinates on the given curve
1114 theRefCurve The referenced curve.
1115 theX X-coordinate in 3D space
1116 theY Y-coordinate in 3D space
1117 theZ Z-coordinate in 3D space
1118 theName Object name; when specified, this parameter is used
1119 for result publication in the study. Otherwise, if automatic
1120 publication is switched on, default value is used for result name.
1123 New GEOM.GEOM_Object, containing the created point.
1126 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1128 # Example: see GEOM_TestAll.py
1129 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1130 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1131 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1132 anObj.SetParameters(Parameters)
1133 self._autoPublish(anObj, theName, "vertex")
1136 ## Create a point, corresponding to the given length on the given curve.
1137 # @param theRefCurve The referenced curve.
1138 # @param theLength Length on the referenced curve. It can be negative.
1139 # @param theStartPoint Point allowing to choose the direction for the calculation
1140 # of the length. If None, start from the first point of theRefCurve.
1141 # @param theName Object name; when specified, this parameter is used
1142 # for result publication in the study. Otherwise, if automatic
1143 # publication is switched on, default value is used for result name.
1145 # @return New GEOM.GEOM_Object, containing the created point.
1147 # @ref tui_creation_point "Example"
1148 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1150 Create a point, corresponding to the given length on the given curve.
1153 theRefCurve The referenced curve.
1154 theLength Length on the referenced curve. It can be negative.
1155 theStartPoint Point allowing to choose the direction for the calculation
1156 of the length. If None, start from the first point of theRefCurve.
1157 theName Object name; when specified, this parameter is used
1158 for result publication in the study. Otherwise, if automatic
1159 publication is switched on, default value is used for result name.
1162 New GEOM.GEOM_Object, containing the created point.
1164 # Example: see GEOM_TestAll.py
1165 theLength, Parameters = ParseParameters(theLength)
1166 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1167 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1168 anObj.SetParameters(Parameters)
1169 self._autoPublish(anObj, theName, "vertex")
1172 ## Create a point, corresponding to the given parameters on the
1174 # @param theRefSurf The referenced surface.
1175 # @param theUParameter Value of U-parameter on the referenced surface.
1176 # @param theVParameter Value of V-parameter on the referenced surface.
1177 # @param theName Object name; when specified, this parameter is used
1178 # for result publication in the study. Otherwise, if automatic
1179 # publication is switched on, default value is used for result name.
1181 # @return New GEOM.GEOM_Object, containing the created point.
1183 # @ref swig_MakeVertexOnSurface "Example"
1184 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1186 Create a point, corresponding to the given parameters on the
1190 theRefSurf The referenced surface.
1191 theUParameter Value of U-parameter on the referenced surface.
1192 theVParameter Value of V-parameter on the referenced surface.
1193 theName Object name; when specified, this parameter is used
1194 for result publication in the study. Otherwise, if automatic
1195 publication is switched on, default value is used for result name.
1198 New GEOM.GEOM_Object, containing the created point.
1201 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1203 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1204 # Example: see GEOM_TestAll.py
1205 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1206 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1207 anObj.SetParameters(Parameters);
1208 self._autoPublish(anObj, theName, "vertex")
1211 ## Create a point by projection give coordinates on the given surface
1212 # @param theRefSurf The referenced surface.
1213 # @param theX X-coordinate in 3D space
1214 # @param theY Y-coordinate in 3D space
1215 # @param theZ Z-coordinate in 3D space
1216 # @param theName Object name; when specified, this parameter is used
1217 # for result publication in the study. Otherwise, if automatic
1218 # publication is switched on, default value is used for result name.
1220 # @return New GEOM.GEOM_Object, containing the created point.
1222 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1223 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1225 Create a point by projection give coordinates on the given surface
1228 theRefSurf The referenced surface.
1229 theX X-coordinate in 3D space
1230 theY Y-coordinate in 3D space
1231 theZ Z-coordinate in 3D space
1232 theName Object name; when specified, this parameter is used
1233 for result publication in the study. Otherwise, if automatic
1234 publication is switched on, default value is used for result name.
1237 New GEOM.GEOM_Object, containing the created point.
1240 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1242 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1243 # Example: see GEOM_TestAll.py
1244 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1245 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1246 anObj.SetParameters(Parameters);
1247 self._autoPublish(anObj, theName, "vertex")
1250 ## Create a point, which lays on the given face.
1251 # The point will lay in arbitrary place of the face.
1252 # The only condition on it is a non-zero distance to the face boundary.
1253 # Such point can be used to uniquely identify the face inside any
1254 # shape in case, when the shape does not contain overlapped faces.
1255 # @param theFace The referenced face.
1256 # @param theName Object name; when specified, this parameter is used
1257 # for result publication in the study. Otherwise, if automatic
1258 # publication is switched on, default value is used for result name.
1260 # @return New GEOM.GEOM_Object, containing the created point.
1262 # @ref swig_MakeVertexInsideFace "Example"
1263 def MakeVertexInsideFace (self, theFace, theName=None):
1265 Create a point, which lays on the given face.
1266 The point will lay in arbitrary place of the face.
1267 The only condition on it is a non-zero distance to the face boundary.
1268 Such point can be used to uniquely identify the face inside any
1269 shape in case, when the shape does not contain overlapped faces.
1272 theFace The referenced face.
1273 theName Object name; when specified, this parameter is used
1274 for result publication in the study. Otherwise, if automatic
1275 publication is switched on, default value is used for result name.
1278 New GEOM.GEOM_Object, containing the created point.
1281 p_on_face = geompy.MakeVertexInsideFace(Face)
1283 # Example: see GEOM_TestAll.py
1284 anObj = self.BasicOp.MakePointOnFace(theFace)
1285 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1286 self._autoPublish(anObj, theName, "vertex")
1289 ## Create a point on intersection of two lines.
1290 # @param theRefLine1, theRefLine2 The referenced lines.
1291 # @param theName Object name; when specified, this parameter is used
1292 # for result publication in the study. Otherwise, if automatic
1293 # publication is switched on, default value is used for result name.
1295 # @return New GEOM.GEOM_Object, containing the created point.
1297 # @ref swig_MakeVertexOnLinesIntersection "Example"
1298 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1300 Create a point on intersection of two lines.
1303 theRefLine1, theRefLine2 The referenced lines.
1304 theName Object name; when specified, this parameter is used
1305 for result publication in the study. Otherwise, if automatic
1306 publication is switched on, default value is used for result name.
1309 New GEOM.GEOM_Object, containing the created point.
1311 # Example: see GEOM_TestAll.py
1312 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1313 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1314 self._autoPublish(anObj, theName, "vertex")
1317 ## Create a tangent, corresponding to the given parameter on the given curve.
1318 # @param theRefCurve The referenced curve.
1319 # @param theParameter Value of parameter on the referenced curve.
1320 # @param theName Object name; when specified, this parameter is used
1321 # for result publication in the study. Otherwise, if automatic
1322 # publication is switched on, default value is used for result name.
1324 # @return New GEOM.GEOM_Object, containing the created tangent.
1326 # @ref swig_MakeTangentOnCurve "Example"
1327 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1329 Create a tangent, corresponding to the given parameter on the given curve.
1332 theRefCurve The referenced curve.
1333 theParameter Value of parameter on the referenced curve.
1334 theName Object name; when specified, this parameter is used
1335 for result publication in the study. Otherwise, if automatic
1336 publication is switched on, default value is used for result name.
1339 New GEOM.GEOM_Object, containing the created tangent.
1342 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1344 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1345 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1346 self._autoPublish(anObj, theName, "tangent")
1349 ## Create a tangent plane, corresponding to the given parameter on the given face.
1350 # @param theFace The face for which tangent plane should be built.
1351 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1352 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1353 # @param theTrimSize the size of plane.
1354 # @param theName Object name; when specified, this parameter is used
1355 # for result publication in the study. Otherwise, if automatic
1356 # publication is switched on, default value is used for result name.
1358 # @return New GEOM.GEOM_Object, containing the created tangent.
1360 # @ref swig_MakeTangentPlaneOnFace "Example"
1361 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1363 Create a tangent plane, corresponding to the given parameter on the given face.
1366 theFace The face for which tangent plane should be built.
1367 theParameterV vertical value of the center point (0.0 - 1.0).
1368 theParameterU horisontal value of the center point (0.0 - 1.0).
1369 theTrimSize the size of plane.
1370 theName Object name; when specified, this parameter is used
1371 for result publication in the study. Otherwise, if automatic
1372 publication is switched on, default value is used for result name.
1375 New GEOM.GEOM_Object, containing the created tangent.
1378 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1380 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1381 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1382 self._autoPublish(anObj, theName, "tangent")
1385 ## Create a vector with the given components.
1386 # @param theDX X component of the vector.
1387 # @param theDY Y component of the vector.
1388 # @param theDZ Z component of the vector.
1389 # @param theName Object name; when specified, this parameter is used
1390 # for result publication in the study. Otherwise, if automatic
1391 # publication is switched on, default value is used for result name.
1393 # @return New GEOM.GEOM_Object, containing the created vector.
1395 # @ref tui_creation_vector "Example"
1396 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1398 Create a vector with the given components.
1401 theDX X component of the vector.
1402 theDY Y component of the vector.
1403 theDZ Z component of the vector.
1404 theName Object name; when specified, this parameter is used
1405 for result publication in the study. Otherwise, if automatic
1406 publication is switched on, default value is used for result name.
1409 New GEOM.GEOM_Object, containing the created vector.
1411 # Example: see GEOM_TestAll.py
1412 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1413 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1414 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1415 anObj.SetParameters(Parameters)
1416 self._autoPublish(anObj, theName, "vector")
1419 ## Create a vector between two points.
1420 # @param thePnt1 Start point for the vector.
1421 # @param thePnt2 End point for the vector.
1422 # @param theName Object name; when specified, this parameter is used
1423 # for result publication in the study. Otherwise, if automatic
1424 # publication is switched on, default value is used for result name.
1426 # @return New GEOM.GEOM_Object, containing the created vector.
1428 # @ref tui_creation_vector "Example"
1429 def MakeVector(self, thePnt1, thePnt2, theName=None):
1431 Create a vector between two points.
1434 thePnt1 Start point for the vector.
1435 thePnt2 End point for the vector.
1436 theName Object name; when specified, this parameter is used
1437 for result publication in the study. Otherwise, if automatic
1438 publication is switched on, default value is used for result name.
1441 New GEOM.GEOM_Object, containing the created vector.
1443 # Example: see GEOM_TestAll.py
1444 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1445 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1446 self._autoPublish(anObj, theName, "vector")
1449 ## Create a line, passing through the given point
1450 # and parrallel to the given direction
1451 # @param thePnt Point. The resulting line will pass through it.
1452 # @param theDir Direction. The resulting line will be parallel to it.
1453 # @param theName Object name; when specified, this parameter is used
1454 # for result publication in the study. Otherwise, if automatic
1455 # publication is switched on, default value is used for result name.
1457 # @return New GEOM.GEOM_Object, containing the created line.
1459 # @ref tui_creation_line "Example"
1460 def MakeLine(self, thePnt, theDir, theName=None):
1462 Create a line, passing through the given point
1463 and parrallel to the given direction
1466 thePnt Point. The resulting line will pass through it.
1467 theDir Direction. The resulting line will be parallel to it.
1468 theName Object name; when specified, this parameter is used
1469 for result publication in the study. Otherwise, if automatic
1470 publication is switched on, default value is used for result name.
1473 New GEOM.GEOM_Object, containing the created line.
1475 # Example: see GEOM_TestAll.py
1476 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1477 RaiseIfFailed("MakeLine", self.BasicOp)
1478 self._autoPublish(anObj, theName, "line")
1481 ## Create a line, passing through the given points
1482 # @param thePnt1 First of two points, defining the line.
1483 # @param thePnt2 Second of two points, defining the line.
1484 # @param theName Object name; when specified, this parameter is used
1485 # for result publication in the study. Otherwise, if automatic
1486 # publication is switched on, default value is used for result name.
1488 # @return New GEOM.GEOM_Object, containing the created line.
1490 # @ref tui_creation_line "Example"
1491 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1493 Create a line, passing through the given points
1496 thePnt1 First of two points, defining the line.
1497 thePnt2 Second of two points, defining the line.
1498 theName Object name; when specified, this parameter is used
1499 for result publication in the study. Otherwise, if automatic
1500 publication is switched on, default value is used for result name.
1503 New GEOM.GEOM_Object, containing the created line.
1505 # Example: see GEOM_TestAll.py
1506 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1507 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1508 self._autoPublish(anObj, theName, "line")
1511 ## Create a line on two faces intersection.
1512 # @param theFace1 First of two faces, defining the line.
1513 # @param theFace2 Second of two faces, defining the line.
1514 # @param theName Object name; when specified, this parameter is used
1515 # for result publication in the study. Otherwise, if automatic
1516 # publication is switched on, default value is used for result name.
1518 # @return New GEOM.GEOM_Object, containing the created line.
1520 # @ref swig_MakeLineTwoFaces "Example"
1521 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1523 Create a line on two faces intersection.
1526 theFace1 First of two faces, defining the line.
1527 theFace2 Second of two faces, defining the line.
1528 theName Object name; when specified, this parameter is used
1529 for result publication in the study. Otherwise, if automatic
1530 publication is switched on, default value is used for result name.
1533 New GEOM.GEOM_Object, containing the created line.
1535 # Example: see GEOM_TestAll.py
1536 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1537 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1538 self._autoPublish(anObj, theName, "line")
1541 ## Create a plane, passing through the given point
1542 # and normal to the given vector.
1543 # @param thePnt Point, the plane has to pass through.
1544 # @param theVec Vector, defining the plane normal direction.
1545 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1546 # @param theName Object name; when specified, this parameter is used
1547 # for result publication in the study. Otherwise, if automatic
1548 # publication is switched on, default value is used for result name.
1550 # @return New GEOM.GEOM_Object, containing the created plane.
1552 # @ref tui_creation_plane "Example"
1553 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1555 Create a plane, passing through the given point
1556 and normal to the given vector.
1559 thePnt Point, the plane has to pass through.
1560 theVec Vector, defining the plane normal direction.
1561 theTrimSize Half size of a side of quadrangle face, representing the plane.
1562 theName Object name; when specified, this parameter is used
1563 for result publication in the study. Otherwise, if automatic
1564 publication is switched on, default value is used for result name.
1567 New GEOM.GEOM_Object, containing the created plane.
1569 # Example: see GEOM_TestAll.py
1570 theTrimSize, Parameters = ParseParameters(theTrimSize);
1571 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1572 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1573 anObj.SetParameters(Parameters)
1574 self._autoPublish(anObj, theName, "plane")
1577 ## Create a plane, passing through the three given points
1578 # @param thePnt1 First of three points, defining the plane.
1579 # @param thePnt2 Second of three points, defining the plane.
1580 # @param thePnt3 Fird of three points, defining the plane.
1581 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1582 # @param theName Object name; when specified, this parameter is used
1583 # for result publication in the study. Otherwise, if automatic
1584 # publication is switched on, default value is used for result name.
1586 # @return New GEOM.GEOM_Object, containing the created plane.
1588 # @ref tui_creation_plane "Example"
1589 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1591 Create a plane, passing through the three given points
1594 thePnt1 First of three points, defining the plane.
1595 thePnt2 Second of three points, defining the plane.
1596 thePnt3 Fird of three points, defining the plane.
1597 theTrimSize Half size of a side of quadrangle face, representing the plane.
1598 theName Object name; when specified, this parameter is used
1599 for result publication in the study. Otherwise, if automatic
1600 publication is switched on, default value is used for result name.
1603 New GEOM.GEOM_Object, containing the created plane.
1605 # Example: see GEOM_TestAll.py
1606 theTrimSize, Parameters = ParseParameters(theTrimSize);
1607 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1608 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1609 anObj.SetParameters(Parameters)
1610 self._autoPublish(anObj, theName, "plane")
1613 ## Create a plane, similar to the existing one, but with another size of representing face.
1614 # @param theFace Referenced plane or LCS(Marker).
1615 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1616 # @param theName Object name; when specified, this parameter is used
1617 # for result publication in the study. Otherwise, if automatic
1618 # publication is switched on, default value is used for result name.
1620 # @return New GEOM.GEOM_Object, containing the created plane.
1622 # @ref tui_creation_plane "Example"
1623 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1625 Create a plane, similar to the existing one, but with another size of representing face.
1628 theFace Referenced plane or LCS(Marker).
1629 theTrimSize New half size of a side of quadrangle face, representing the plane.
1630 theName Object name; when specified, this parameter is used
1631 for result publication in the study. Otherwise, if automatic
1632 publication is switched on, default value is used for result name.
1635 New GEOM.GEOM_Object, containing the created plane.
1637 # Example: see GEOM_TestAll.py
1638 theTrimSize, Parameters = ParseParameters(theTrimSize);
1639 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1640 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1641 anObj.SetParameters(Parameters)
1642 self._autoPublish(anObj, theName, "plane")
1645 ## Create a plane, passing through the 2 vectors
1646 # with center in a start point of the first vector.
1647 # @param theVec1 Vector, defining center point and plane direction.
1648 # @param theVec2 Vector, defining the plane normal direction.
1649 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1650 # @param theName Object name; when specified, this parameter is used
1651 # for result publication in the study. Otherwise, if automatic
1652 # publication is switched on, default value is used for result name.
1654 # @return New GEOM.GEOM_Object, containing the created plane.
1656 # @ref tui_creation_plane "Example"
1657 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1659 Create a plane, passing through the 2 vectors
1660 with center in a start point of the first vector.
1663 theVec1 Vector, defining center point and plane direction.
1664 theVec2 Vector, defining the plane normal direction.
1665 theTrimSize Half size of a side of quadrangle face, representing the plane.
1666 theName Object name; when specified, this parameter is used
1667 for result publication in the study. Otherwise, if automatic
1668 publication is switched on, default value is used for result name.
1671 New GEOM.GEOM_Object, containing the created plane.
1673 # Example: see GEOM_TestAll.py
1674 theTrimSize, Parameters = ParseParameters(theTrimSize);
1675 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1676 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1677 anObj.SetParameters(Parameters)
1678 self._autoPublish(anObj, theName, "plane")
1681 ## Create a plane, based on a Local coordinate system.
1682 # @param theLCS coordinate system, defining plane.
1683 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1684 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1685 # @param theName Object name; when specified, this parameter is used
1686 # for result publication in the study. Otherwise, if automatic
1687 # publication is switched on, default value is used for result name.
1689 # @return New GEOM.GEOM_Object, containing the created plane.
1691 # @ref tui_creation_plane "Example"
1692 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1694 Create a plane, based on a Local coordinate system.
1697 theLCS coordinate system, defining plane.
1698 theTrimSize Half size of a side of quadrangle face, representing the plane.
1699 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created plane.
1707 # Example: see GEOM_TestAll.py
1708 theTrimSize, Parameters = ParseParameters(theTrimSize);
1709 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1710 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1711 anObj.SetParameters(Parameters)
1712 self._autoPublish(anObj, theName, "plane")
1715 ## Create a local coordinate system.
1716 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1717 # @param XDX,XDY,XDZ Three components of OX direction
1718 # @param YDX,YDY,YDZ Three components of OY direction
1719 # @param theName Object name; when specified, this parameter is used
1720 # for result publication in the study. Otherwise, if automatic
1721 # publication is switched on, default value is used for result name.
1723 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1725 # @ref swig_MakeMarker "Example"
1726 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1728 Create a local coordinate system.
1731 OX,OY,OZ Three coordinates of coordinate system origin.
1732 XDX,XDY,XDZ Three components of OX direction
1733 YDX,YDY,YDZ Three components of OY direction
1734 theName Object name; when specified, this parameter is used
1735 for result publication in the study. Otherwise, if automatic
1736 publication is switched on, default value is used for result name.
1739 New GEOM.GEOM_Object, containing the created coordinate system.
1741 # Example: see GEOM_TestAll.py
1742 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1743 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1744 RaiseIfFailed("MakeMarker", self.BasicOp)
1745 anObj.SetParameters(Parameters)
1746 self._autoPublish(anObj, theName, "lcs")
1749 ## Create a local coordinate system from shape.
1750 # @param theShape The initial shape to detect the coordinate system.
1751 # @param theName Object name; when specified, this parameter is used
1752 # for result publication in the study. Otherwise, if automatic
1753 # publication is switched on, default value is used for result name.
1755 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1757 # @ref tui_creation_lcs "Example"
1758 def MakeMarkerFromShape(self, theShape, theName=None):
1760 Create a local coordinate system from shape.
1763 theShape The initial shape to detect the coordinate system.
1764 theName Object name; when specified, this parameter is used
1765 for result publication in the study. Otherwise, if automatic
1766 publication is switched on, default value is used for result name.
1769 New GEOM.GEOM_Object, containing the created coordinate system.
1771 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1772 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1773 self._autoPublish(anObj, theName, "lcs")
1776 ## Create a local coordinate system from point and two vectors.
1777 # @param theOrigin Point of coordinate system origin.
1778 # @param theXVec Vector of X direction
1779 # @param theYVec Vector of Y direction
1780 # @param theName Object name; when specified, this parameter is used
1781 # for result publication in the study. Otherwise, if automatic
1782 # publication is switched on, default value is used for result name.
1784 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1786 # @ref tui_creation_lcs "Example"
1787 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1789 Create a local coordinate system from point and two vectors.
1792 theOrigin Point of coordinate system origin.
1793 theXVec Vector of X direction
1794 theYVec Vector of Y direction
1795 theName Object name; when specified, this parameter is used
1796 for result publication in the study. Otherwise, if automatic
1797 publication is switched on, default value is used for result name.
1800 New GEOM.GEOM_Object, containing the created coordinate system.
1803 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1804 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1805 self._autoPublish(anObj, theName, "lcs")
1808 # end of l3_basic_go
1811 ## @addtogroup l4_curves
1814 ## Create an arc of circle, passing through three given points.
1815 # @param thePnt1 Start point of the arc.
1816 # @param thePnt2 Middle point of the arc.
1817 # @param thePnt3 End point of the arc.
1818 # @param theName Object name; when specified, this parameter is used
1819 # for result publication in the study. Otherwise, if automatic
1820 # publication is switched on, default value is used for result name.
1822 # @return New GEOM.GEOM_Object, containing the created arc.
1824 # @ref swig_MakeArc "Example"
1825 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1827 Create an arc of circle, passing through three given points.
1830 thePnt1 Start point of the arc.
1831 thePnt2 Middle point of the arc.
1832 thePnt3 End point of the arc.
1833 theName Object name; when specified, this parameter is used
1834 for result publication in the study. Otherwise, if automatic
1835 publication is switched on, default value is used for result name.
1838 New GEOM.GEOM_Object, containing the created arc.
1840 # Example: see GEOM_TestAll.py
1841 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1842 RaiseIfFailed("MakeArc", self.CurvesOp)
1843 self._autoPublish(anObj, theName, "arc")
1846 ## Create an arc of circle from a center and 2 points.
1847 # @param thePnt1 Center of the arc
1848 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1849 # @param thePnt3 End point of the arc (Gives also a direction)
1850 # @param theSense Orientation of the arc
1851 # @param theName Object name; when specified, this parameter is used
1852 # for result publication in the study. Otherwise, if automatic
1853 # publication is switched on, default value is used for result name.
1855 # @return New GEOM.GEOM_Object, containing the created arc.
1857 # @ref swig_MakeArc "Example"
1858 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1860 Create an arc of circle from a center and 2 points.
1863 thePnt1 Center of the arc
1864 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1865 thePnt3 End point of the arc (Gives also a direction)
1866 theSense Orientation of the arc
1867 theName Object name; when specified, this parameter is used
1868 for result publication in the study. Otherwise, if automatic
1869 publication is switched on, default value is used for result name.
1872 New GEOM.GEOM_Object, containing the created arc.
1874 # Example: see GEOM_TestAll.py
1875 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1876 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1877 self._autoPublish(anObj, theName, "arc")
1880 ## Create an arc of ellipse, of center and two points.
1881 # @param theCenter Center of the arc.
1882 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1883 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1884 # @param theName Object name; when specified, this parameter is used
1885 # for result publication in the study. Otherwise, if automatic
1886 # publication is switched on, default value is used for result name.
1888 # @return New GEOM.GEOM_Object, containing the created arc.
1890 # @ref swig_MakeArc "Example"
1891 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1893 Create an arc of ellipse, of center and two points.
1896 theCenter Center of the arc.
1897 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1898 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1899 theName Object name; when specified, this parameter is used
1900 for result publication in the study. Otherwise, if automatic
1901 publication is switched on, default value is used for result name.
1904 New GEOM.GEOM_Object, containing the created arc.
1906 # Example: see GEOM_TestAll.py
1907 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1908 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1909 self._autoPublish(anObj, theName, "arc")
1912 ## Create a circle with given center, normal vector and radius.
1913 # @param thePnt Circle center.
1914 # @param theVec Vector, normal to the plane of the circle.
1915 # @param theR Circle radius.
1916 # @param theName Object name; when specified, this parameter is used
1917 # for result publication in the study. Otherwise, if automatic
1918 # publication is switched on, default value is used for result name.
1920 # @return New GEOM.GEOM_Object, containing the created circle.
1922 # @ref tui_creation_circle "Example"
1923 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1925 Create a circle with given center, normal vector and radius.
1928 thePnt Circle center.
1929 theVec Vector, normal to the plane of the circle.
1931 theName Object name; when specified, this parameter is used
1932 for result publication in the study. Otherwise, if automatic
1933 publication is switched on, default value is used for result name.
1936 New GEOM.GEOM_Object, containing the created circle.
1938 # Example: see GEOM_TestAll.py
1939 theR, Parameters = ParseParameters(theR)
1940 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1941 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1942 anObj.SetParameters(Parameters)
1943 self._autoPublish(anObj, theName, "circle")
1946 ## Create a circle with given radius.
1947 # Center of the circle will be in the origin of global
1948 # coordinate system and normal vector will be codirected with Z axis
1949 # @param theR Circle radius.
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.
1955 def MakeCircleR(self, theR, theName=None):
1957 Create a circle with given radius.
1958 Center of the circle will be in the origin of global
1959 coordinate system and normal vector will be codirected with Z axis
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 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1971 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1972 self._autoPublish(anObj, theName, "circle")
1975 ## Create a circle, passing through three given points
1976 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1977 # @param theName Object name; when specified, this parameter is used
1978 # for result publication in the study. Otherwise, if automatic
1979 # publication is switched on, default value is used for result name.
1981 # @return New GEOM.GEOM_Object, containing the created circle.
1983 # @ref tui_creation_circle "Example"
1984 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1986 Create a circle, passing through three given points
1989 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1990 theName Object name; when specified, this parameter is used
1991 for result publication in the study. Otherwise, if automatic
1992 publication is switched on, default value is used for result name.
1995 New GEOM.GEOM_Object, containing the created circle.
1997 # Example: see GEOM_TestAll.py
1998 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1999 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2000 self._autoPublish(anObj, theName, "circle")
2003 ## Create a circle, with given point1 as center,
2004 # passing through the point2 as radius and laying in the plane,
2005 # defined by all three given points.
2006 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2007 # @param theName Object name; when specified, this parameter is used
2008 # for result publication in the study. Otherwise, if automatic
2009 # publication is switched on, default value is used for result name.
2011 # @return New GEOM.GEOM_Object, containing the created circle.
2013 # @ref swig_MakeCircle "Example"
2014 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2016 Create a circle, with given point1 as center,
2017 passing through the point2 as radius and laying in the plane,
2018 defined by all three given points.
2021 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2022 theName Object name; when specified, this parameter is used
2023 for result publication in the study. Otherwise, if automatic
2024 publication is switched on, default value is used for result name.
2027 New GEOM.GEOM_Object, containing the created circle.
2029 # Example: see GEOM_example6.py
2030 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2031 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2032 self._autoPublish(anObj, theName, "circle")
2035 ## Create an ellipse with given center, normal vector and radiuses.
2036 # @param thePnt Ellipse center.
2037 # @param theVec Vector, normal to the plane of the ellipse.
2038 # @param theRMajor Major ellipse radius.
2039 # @param theRMinor Minor ellipse radius.
2040 # @param theVecMaj Vector, direction of the ellipse's main axis.
2041 # @param theName Object name; when specified, this parameter is used
2042 # for result publication in the study. Otherwise, if automatic
2043 # publication is switched on, default value is used for result name.
2045 # @return New GEOM.GEOM_Object, containing the created ellipse.
2047 # @ref tui_creation_ellipse "Example"
2048 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2050 Create an ellipse with given center, normal vector and radiuses.
2053 thePnt Ellipse center.
2054 theVec Vector, normal to the plane of the ellipse.
2055 theRMajor Major ellipse radius.
2056 theRMinor Minor ellipse radius.
2057 theVecMaj Vector, direction of the ellipse's main axis.
2058 theName Object name; when specified, this parameter is used
2059 for result publication in the study. Otherwise, if automatic
2060 publication is switched on, default value is used for result name.
2063 New GEOM.GEOM_Object, containing the created ellipse.
2065 # Example: see GEOM_TestAll.py
2066 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2067 if theVecMaj is not None:
2068 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2070 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2072 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2073 anObj.SetParameters(Parameters)
2074 self._autoPublish(anObj, theName, "ellipse")
2077 ## Create an ellipse with given radiuses.
2078 # Center of the ellipse will be in the origin of global
2079 # coordinate system and normal vector will be codirected with Z axis
2080 # @param theRMajor Major ellipse radius.
2081 # @param theRMinor Minor ellipse radius.
2082 # @param theName Object name; when specified, this parameter is used
2083 # for result publication in the study. Otherwise, if automatic
2084 # publication is switched on, default value is used for result name.
2086 # @return New GEOM.GEOM_Object, containing the created ellipse.
2087 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2089 Create an ellipse with given radiuses.
2090 Center of the ellipse will be in the origin of global
2091 coordinate system and normal vector will be codirected with Z axis
2094 theRMajor Major ellipse radius.
2095 theRMinor Minor ellipse radius.
2096 theName Object name; when specified, this parameter is used
2097 for result publication in the study. Otherwise, if automatic
2098 publication is switched on, default value is used for result name.
2101 New GEOM.GEOM_Object, containing the created ellipse.
2103 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2104 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2105 self._autoPublish(anObj, theName, "ellipse")
2108 ## Create a polyline on the set of points.
2109 # @param thePoints Sequence of points for the polyline.
2110 # @param theIsClosed If True, build a closed wire.
2111 # @param theName Object name; when specified, this parameter is used
2112 # for result publication in the study. Otherwise, if automatic
2113 # publication is switched on, default value is used for result name.
2115 # @return New GEOM.GEOM_Object, containing the created polyline.
2117 # @ref tui_creation_curve "Example"
2118 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2120 Create a polyline on the set of points.
2123 thePoints Sequence of points for the polyline.
2124 theIsClosed If True, build a closed wire.
2125 theName Object name; when specified, this parameter is used
2126 for result publication in the study. Otherwise, if automatic
2127 publication is switched on, default value is used for result name.
2130 New GEOM.GEOM_Object, containing the created polyline.
2132 # Example: see GEOM_TestAll.py
2133 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2134 RaiseIfFailed("MakePolyline", self.CurvesOp)
2135 self._autoPublish(anObj, theName, "polyline")
2138 ## Create bezier curve on the set of points.
2139 # @param thePoints Sequence of points for the bezier curve.
2140 # @param theIsClosed If True, build a closed curve.
2141 # @param theName Object name; when specified, this parameter is used
2142 # for result publication in the study. Otherwise, if automatic
2143 # publication is switched on, default value is used for result name.
2145 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2147 # @ref tui_creation_curve "Example"
2148 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2150 Create bezier curve on the set of points.
2153 thePoints Sequence of points for the bezier curve.
2154 theIsClosed If True, build a closed curve.
2155 theName Object name; when specified, this parameter is used
2156 for result publication in the study. Otherwise, if automatic
2157 publication is switched on, default value is used for result name.
2160 New GEOM.GEOM_Object, containing the created bezier curve.
2162 # Example: see GEOM_TestAll.py
2163 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2164 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2165 self._autoPublish(anObj, theName, "bezier")
2168 ## Create B-Spline curve on the set of points.
2169 # @param thePoints Sequence of points for the B-Spline curve.
2170 # @param theIsClosed If True, build a closed curve.
2171 # @param theDoReordering If TRUE, the algo does not follow the order of
2172 # \a thePoints but searches for the closest vertex.
2173 # @param theName Object name; when specified, this parameter is used
2174 # for result publication in the study. Otherwise, if automatic
2175 # publication is switched on, default value is used for result name.
2177 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2179 # @ref tui_creation_curve "Example"
2180 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2182 Create B-Spline curve on the set of points.
2185 thePoints Sequence of points for the B-Spline curve.
2186 theIsClosed If True, build a closed curve.
2187 theDoReordering If True, the algo does not follow the order of
2188 thePoints but searches for the closest vertex.
2189 theName Object name; when specified, this parameter is used
2190 for result publication in the study. Otherwise, if automatic
2191 publication is switched on, default value is used for result name.
2194 New GEOM.GEOM_Object, containing the created B-Spline curve.
2196 # Example: see GEOM_TestAll.py
2197 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2198 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2199 self._autoPublish(anObj, theName, "bspline")
2202 ## Create B-Spline curve on the set of points.
2203 # @param thePoints Sequence of points for the B-Spline curve.
2204 # @param theFirstVec Vector object, defining the curve direction at its first point.
2205 # @param theLastVec Vector object, defining the curve direction at its last point.
2206 # @param theName Object name; when specified, this parameter is used
2207 # for result publication in the study. Otherwise, if automatic
2208 # publication is switched on, default value is used for result name.
2210 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2212 # @ref tui_creation_curve "Example"
2213 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2215 Create B-Spline curve on the set of points.
2218 thePoints Sequence of points for the B-Spline curve.
2219 theFirstVec Vector object, defining the curve direction at its first point.
2220 theLastVec Vector object, defining the curve direction at its last point.
2221 theName Object name; when specified, this parameter is used
2222 for result publication in the study. Otherwise, if automatic
2223 publication is switched on, default value is used for result name.
2226 New GEOM.GEOM_Object, containing the created B-Spline curve.
2228 # Example: see GEOM_TestAll.py
2229 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2230 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2231 self._autoPublish(anObj, theName, "bspline")
2234 ## Creates a curve using the parametric definition of the basic points.
2235 # @param thexExpr parametric equation of the coordinates X.
2236 # @param theyExpr parametric equation of the coordinates Y.
2237 # @param thezExpr parametric equation of the coordinates Z.
2238 # @param theParamMin the minimal value of the parameter.
2239 # @param theParamMax the maximum value of the parameter.
2240 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2241 # @param theCurveType the type of the curve.
2242 # @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.
2243 # @param theName Object name; when specified, this parameter is used
2244 # for result publication in the study. Otherwise, if automatic
2245 # publication is switched on, default value is used for result name.
2247 # @return New GEOM.GEOM_Object, containing the created curve.
2249 # @ref tui_creation_curve "Example"
2250 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2251 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2253 Creates a curve using the parametric definition of the basic points.
2256 thexExpr parametric equation of the coordinates X.
2257 theyExpr parametric equation of the coordinates Y.
2258 thezExpr parametric equation of the coordinates Z.
2259 theParamMin the minimal value of the parameter.
2260 theParamMax the maximum value of the parameter.
2261 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2262 theCurveType the type of the curve.
2263 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2264 method is used which can lead to a bug.
2265 theName Object name; when specified, this parameter is used
2266 for result publication in the study. Otherwise, if automatic
2267 publication is switched on, default value is used for result name.
2270 New GEOM.GEOM_Object, containing the created curve.
2272 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2274 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2276 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2277 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2278 anObj.SetParameters(Parameters)
2279 self._autoPublish(anObj, theName, "curve")
2285 ## @addtogroup l3_sketcher
2288 ## Create a sketcher (wire or face), following the textual description,
2289 # passed through <VAR>theCommand</VAR> argument. \n
2290 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2291 # Format of the description string have to be the following:
2293 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2296 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2298 # - "R angle" : Set the direction by angle
2299 # - "D dx dy" : Set the direction by DX & DY
2302 # - "TT x y" : Create segment by point at X & Y
2303 # - "T dx dy" : Create segment by point with DX & DY
2304 # - "L length" : Create segment by direction & Length
2305 # - "IX x" : Create segment by direction & Intersect. X
2306 # - "IY y" : Create segment by direction & Intersect. Y
2309 # - "C radius length" : Create arc by direction, radius and length(in degree)
2310 # - "AA x y": Create arc by point at X & Y
2311 # - "A dx dy" : Create arc by point with DX & DY
2312 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2313 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2314 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2315 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2318 # - "WW" : Close Wire (to finish)
2319 # - "WF" : Close Wire and build face (to finish)
2322 # - Flag1 (= reverse) is 0 or 2 ...
2323 # - if 0 the drawn arc is the one of lower angle (< Pi)
2324 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2327 # - Flag2 (= control tolerance) is 0 or 1 ...
2328 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2329 # - if 1 the wire is built only if the end point is on the arc
2330 # with a tolerance of 10^-7 on the distance else the creation fails
2332 # @param theCommand String, defining the sketcher in local
2333 # coordinates of the working plane.
2334 # @param theWorkingPlane Nine double values, defining origin,
2335 # OZ and OX directions of the working plane.
2336 # @param theName Object name; when specified, this parameter is used
2337 # for result publication in the study. Otherwise, if automatic
2338 # publication is switched on, default value is used for result name.
2340 # @return New GEOM.GEOM_Object, containing the created wire.
2342 # @ref tui_sketcher_page "Example"
2343 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2345 Create a sketcher (wire or face), following the textual description, passed
2346 through theCommand argument.
2347 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2348 Format of the description string have to be the following:
2349 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2351 - x1, y1 are coordinates of the first sketcher point (zero by default),
2353 - "R angle" : Set the direction by angle
2354 - "D dx dy" : Set the direction by DX & DY
2356 - "TT x y" : Create segment by point at X & Y
2357 - "T dx dy" : Create segment by point with DX & DY
2358 - "L length" : Create segment by direction & Length
2359 - "IX x" : Create segment by direction & Intersect. X
2360 - "IY y" : Create segment by direction & Intersect. Y
2362 - "C radius length" : Create arc by direction, radius and length(in degree)
2363 - "AA x y": Create arc by point at X & Y
2364 - "A dx dy" : Create arc by point with DX & DY
2365 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2366 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2367 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2368 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2370 - "WW" : Close Wire (to finish)
2371 - "WF" : Close Wire and build face (to finish)
2373 - Flag1 (= reverse) is 0 or 2 ...
2374 - if 0 the drawn arc is the one of lower angle (< Pi)
2375 - if 2 the drawn arc ius the one of greater angle (> Pi)
2377 - Flag2 (= control tolerance) is 0 or 1 ...
2378 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2379 - if 1 the wire is built only if the end point is on the arc
2380 with a tolerance of 10^-7 on the distance else the creation fails
2383 theCommand String, defining the sketcher in local
2384 coordinates of the working plane.
2385 theWorkingPlane Nine double values, defining origin,
2386 OZ and OX directions of the working plane.
2387 theName Object name; when specified, this parameter is used
2388 for result publication in the study. Otherwise, if automatic
2389 publication is switched on, default value is used for result name.
2392 New GEOM.GEOM_Object, containing the created wire.
2394 # Example: see GEOM_TestAll.py
2395 theCommand,Parameters = ParseSketcherCommand(theCommand)
2396 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2397 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2398 anObj.SetParameters(Parameters)
2399 self._autoPublish(anObj, theName, "wire")
2402 ## Create a sketcher (wire or face), following the textual description,
2403 # passed through <VAR>theCommand</VAR> argument. \n
2404 # For format of the description string see MakeSketcher() method.\n
2405 # @param theCommand String, defining the sketcher in local
2406 # coordinates of the working plane.
2407 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2408 # @param theName Object name; when specified, this parameter is used
2409 # for result publication in the study. Otherwise, if automatic
2410 # publication is switched on, default value is used for result name.
2412 # @return New GEOM.GEOM_Object, containing the created wire.
2414 # @ref tui_sketcher_page "Example"
2415 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2417 Create a sketcher (wire or face), following the textual description,
2418 passed through theCommand argument.
2419 For format of the description string see geompy.MakeSketcher() method.
2422 theCommand String, defining the sketcher in local
2423 coordinates of the working plane.
2424 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2425 theName Object name; when specified, this parameter is used
2426 for result publication in the study. Otherwise, if automatic
2427 publication is switched on, default value is used for result name.
2430 New GEOM.GEOM_Object, containing the created wire.
2432 theCommand,Parameters = ParseSketcherCommand(theCommand)
2433 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2434 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2435 anObj.SetParameters(Parameters)
2436 self._autoPublish(anObj, theName, "wire")
2439 ## Obtain a 2D sketcher interface
2440 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2441 def Sketcher2D (self):
2443 Obtain a 2D sketcher interface.
2446 sk = geompy.Sketcher2D()
2448 sk.addSegmentRelative(15, 70)
2449 sk.addSegmentPerpY(50)
2450 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2451 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2452 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2454 Sketch_1 = sk.wire(geomObj_1)
2456 sk = Sketcher2D (self)
2459 ## Create a sketcher wire, following the numerical description,
2460 # passed through <VAR>theCoordinates</VAR> argument. \n
2461 # @param theCoordinates double values, defining points to create a wire,
2463 # @param theName Object name; when specified, this parameter is used
2464 # for result publication in the study. Otherwise, if automatic
2465 # publication is switched on, default value is used for result name.
2467 # @return New GEOM.GEOM_Object, containing the created wire.
2469 # @ref tui_3dsketcher_page "Example"
2470 def Make3DSketcher(self, theCoordinates, theName=None):
2472 Create a sketcher wire, following the numerical description,
2473 passed through theCoordinates argument.
2476 theCoordinates double values, defining points to create a wire,
2478 theName Object name; when specified, this parameter is used
2479 for result publication in the study. Otherwise, if automatic
2480 publication is switched on, default value is used for result name.
2483 New GEOM_Object, containing the created wire.
2485 theCoordinates,Parameters = ParseParameters(theCoordinates)
2486 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2487 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2488 anObj.SetParameters(Parameters)
2489 self._autoPublish(anObj, theName, "wire")
2492 ## Obtain a 3D sketcher interface
2493 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2495 # @ref tui_3dsketcher_page "Example"
2496 def Sketcher3D (self):
2498 Obtain a 3D sketcher interface.
2501 sk = geompy.Sketcher3D()
2502 sk.addPointsAbsolute(0,0,0, 70,0,0)
2503 sk.addPointsRelative(0, 0, 130)
2504 sk.addPointAnglesLength("OXY", 50, 0, 100)
2505 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2507 a3D_Sketcher_1 = sk.wire()
2509 sk = Sketcher3D (self)
2512 # end of l3_sketcher
2515 ## @addtogroup l3_3d_primitives
2518 ## Create a box by coordinates of two opposite vertices.
2520 # @param x1,y1,z1 double values, defining first point it.
2521 # @param x2,y2,z2 double values, defining first point it.
2522 # @param theName Object name; when specified, this parameter is used
2523 # for result publication in the study. Otherwise, if automatic
2524 # publication is switched on, default value is used for result name.
2526 # @return New GEOM.GEOM_Object, containing the created box.
2528 # @ref tui_creation_box "Example"
2529 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2531 Create a box by coordinates of two opposite vertices.
2534 x1,y1,z1 double values, defining first point.
2535 x2,y2,z2 double values, defining second point.
2536 theName Object name; when specified, this parameter is used
2537 for result publication in the study. Otherwise, if automatic
2538 publication is switched on, default value is used for result name.
2541 New GEOM.GEOM_Object, containing the created box.
2543 # Example: see GEOM_TestAll.py
2544 pnt1 = self.MakeVertex(x1,y1,z1)
2545 pnt2 = self.MakeVertex(x2,y2,z2)
2546 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2547 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2549 ## Create a box with specified dimensions along the coordinate axes
2550 # and with edges, parallel to the coordinate axes.
2551 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2552 # @param theDX Length of Box edges, parallel to OX axis.
2553 # @param theDY Length of Box edges, parallel to OY axis.
2554 # @param theDZ Length of Box edges, parallel to OZ axis.
2555 # @param theName Object name; when specified, this parameter is used
2556 # for result publication in the study. Otherwise, if automatic
2557 # publication is switched on, default value is used for result name.
2559 # @return New GEOM.GEOM_Object, containing the created box.
2561 # @ref tui_creation_box "Example"
2562 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2564 Create a box with specified dimensions along the coordinate axes
2565 and with edges, parallel to the coordinate axes.
2566 Center of the box will be at point (DX/2, DY/2, DZ/2).
2569 theDX Length of Box edges, parallel to OX axis.
2570 theDY Length of Box edges, parallel to OY axis.
2571 theDZ Length of Box edges, parallel to OZ axis.
2572 theName Object name; when specified, this parameter is used
2573 for result publication in the study. Otherwise, if automatic
2574 publication is switched on, default value is used for result name.
2577 New GEOM.GEOM_Object, containing the created box.
2579 # Example: see GEOM_TestAll.py
2580 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2581 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2582 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2583 anObj.SetParameters(Parameters)
2584 self._autoPublish(anObj, theName, "box")
2587 ## Create a box with two specified opposite vertices,
2588 # and with edges, parallel to the coordinate axes
2589 # @param thePnt1 First of two opposite vertices.
2590 # @param thePnt2 Second of two opposite vertices.
2591 # @param theName Object name; when specified, this parameter is used
2592 # for result publication in the study. Otherwise, if automatic
2593 # publication is switched on, default value is used for result name.
2595 # @return New GEOM.GEOM_Object, containing the created box.
2597 # @ref tui_creation_box "Example"
2598 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2600 Create a box with two specified opposite vertices,
2601 and with edges, parallel to the coordinate axes
2604 thePnt1 First of two opposite vertices.
2605 thePnt2 Second of two opposite vertices.
2606 theName Object name; when specified, this parameter is used
2607 for result publication in the study. Otherwise, if automatic
2608 publication is switched on, default value is used for result name.
2611 New GEOM.GEOM_Object, containing the created box.
2613 # Example: see GEOM_TestAll.py
2614 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2615 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2616 self._autoPublish(anObj, theName, "box")
2619 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2620 # @param theH height of Face.
2621 # @param theW width of Face.
2622 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2623 # @param theName Object name; when specified, this parameter is used
2624 # for result publication in the study. Otherwise, if automatic
2625 # publication is switched on, default value is used for result name.
2627 # @return New GEOM.GEOM_Object, containing the created face.
2629 # @ref tui_creation_face "Example"
2630 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2632 Create a face with specified dimensions with edges parallel to coordinate axes.
2635 theH height of Face.
2637 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2638 theName Object name; when specified, this parameter is used
2639 for result publication in the study. Otherwise, if automatic
2640 publication is switched on, default value is used for result name.
2643 New GEOM.GEOM_Object, containing the created face.
2645 # Example: see GEOM_TestAll.py
2646 theH,theW,Parameters = ParseParameters(theH, theW)
2647 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2648 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2649 anObj.SetParameters(Parameters)
2650 self._autoPublish(anObj, theName, "rectangle")
2653 ## Create a face from another plane and two sizes,
2654 # vertical size and horisontal size.
2655 # @param theObj Normale vector to the creating face or
2657 # @param theH Height (vertical size).
2658 # @param theW Width (horisontal size).
2659 # @param theName Object name; when specified, this parameter is used
2660 # for result publication in the study. Otherwise, if automatic
2661 # publication is switched on, default value is used for result name.
2663 # @return New GEOM.GEOM_Object, containing the created face.
2665 # @ref tui_creation_face "Example"
2666 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2668 Create a face from another plane and two sizes,
2669 vertical size and horisontal size.
2672 theObj Normale vector to the creating face or
2674 theH Height (vertical size).
2675 theW Width (horisontal size).
2676 theName Object name; when specified, this parameter is used
2677 for result publication in the study. Otherwise, if automatic
2678 publication is switched on, default value is used for result name.
2681 New GEOM_Object, containing the created face.
2683 # Example: see GEOM_TestAll.py
2684 theH,theW,Parameters = ParseParameters(theH, theW)
2685 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2686 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2687 anObj.SetParameters(Parameters)
2688 self._autoPublish(anObj, theName, "rectangle")
2691 ## Create a disk with given center, normal vector and radius.
2692 # @param thePnt Disk center.
2693 # @param theVec Vector, normal to the plane of the disk.
2694 # @param theR Disk radius.
2695 # @param theName Object name; when specified, this parameter is used
2696 # for result publication in the study. Otherwise, if automatic
2697 # publication is switched on, default value is used for result name.
2699 # @return New GEOM.GEOM_Object, containing the created disk.
2701 # @ref tui_creation_disk "Example"
2702 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2704 Create a disk with given center, normal vector and radius.
2708 theVec Vector, normal to the plane of the disk.
2710 theName Object name; when specified, this parameter is used
2711 for result publication in the study. Otherwise, if automatic
2712 publication is switched on, default value is used for result name.
2715 New GEOM.GEOM_Object, containing the created disk.
2717 # Example: see GEOM_TestAll.py
2718 theR,Parameters = ParseParameters(theR)
2719 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2720 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2721 anObj.SetParameters(Parameters)
2722 self._autoPublish(anObj, theName, "disk")
2725 ## Create a disk, passing through three given points
2726 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2727 # @param theName Object name; when specified, this parameter is used
2728 # for result publication in the study. Otherwise, if automatic
2729 # publication is switched on, default value is used for result name.
2731 # @return New GEOM.GEOM_Object, containing the created disk.
2733 # @ref tui_creation_disk "Example"
2734 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2736 Create a disk, passing through three given points
2739 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2740 theName Object name; when specified, this parameter is used
2741 for result publication in the study. Otherwise, if automatic
2742 publication is switched on, default value is used for result name.
2745 New GEOM.GEOM_Object, containing the created disk.
2747 # Example: see GEOM_TestAll.py
2748 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2749 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2750 self._autoPublish(anObj, theName, "disk")
2753 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2754 # @param theR Radius of Face.
2755 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2756 # @param theName Object name; when specified, this parameter is used
2757 # for result publication in the study. Otherwise, if automatic
2758 # publication is switched on, default value is used for result name.
2760 # @return New GEOM.GEOM_Object, containing the created disk.
2762 # @ref tui_creation_face "Example"
2763 def MakeDiskR(self, theR, theOrientation, theName=None):
2765 Create a disk with specified dimensions along OX-OY coordinate axes.
2768 theR Radius of Face.
2769 theOrientation set the orientation belong axis OXY or OYZ or OZX
2770 theName Object name; when specified, this parameter is used
2771 for result publication in the study. Otherwise, if automatic
2772 publication is switched on, default value is used for result name.
2775 New GEOM.GEOM_Object, containing the created disk.
2778 Disk3 = geompy.MakeDiskR(100., 1)
2780 # Example: see GEOM_TestAll.py
2781 theR,Parameters = ParseParameters(theR)
2782 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2783 RaiseIfFailed("MakeDiskR", self.PrimOp)
2784 anObj.SetParameters(Parameters)
2785 self._autoPublish(anObj, theName, "disk")
2788 ## Create a cylinder with given base point, axis, radius and height.
2789 # @param thePnt Central point of cylinder base.
2790 # @param theAxis Cylinder axis.
2791 # @param theR Cylinder radius.
2792 # @param theH Cylinder height.
2793 # @param theName Object name; when specified, this parameter is used
2794 # for result publication in the study. Otherwise, if automatic
2795 # publication is switched on, default value is used for result name.
2797 # @return New GEOM.GEOM_Object, containing the created cylinder.
2799 # @ref tui_creation_cylinder "Example"
2800 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2802 Create a cylinder with given base point, axis, radius and height.
2805 thePnt Central point of cylinder base.
2806 theAxis Cylinder axis.
2807 theR Cylinder radius.
2808 theH Cylinder height.
2809 theName Object name; when specified, this parameter is used
2810 for result publication in the study. Otherwise, if automatic
2811 publication is switched on, default value is used for result name.
2814 New GEOM.GEOM_Object, containing the created cylinder.
2816 # Example: see GEOM_TestAll.py
2817 theR,theH,Parameters = ParseParameters(theR, theH)
2818 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2819 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2820 anObj.SetParameters(Parameters)
2821 self._autoPublish(anObj, theName, "cylinder")
2824 ## Create a cylinder with given radius and height at
2825 # the origin of coordinate system. Axis of the cylinder
2826 # will be collinear to the OZ axis of the coordinate system.
2827 # @param theR Cylinder radius.
2828 # @param theH Cylinder height.
2829 # @param theName Object name; when specified, this parameter is used
2830 # for result publication in the study. Otherwise, if automatic
2831 # publication is switched on, default value is used for result name.
2833 # @return New GEOM.GEOM_Object, containing the created cylinder.
2835 # @ref tui_creation_cylinder "Example"
2836 def MakeCylinderRH(self, theR, theH, theName=None):
2838 Create a cylinder with given radius and height at
2839 the origin of coordinate system. Axis of the cylinder
2840 will be collinear to the OZ axis of the coordinate system.
2843 theR Cylinder radius.
2844 theH Cylinder height.
2845 theName Object name; when specified, this parameter is used
2846 for result publication in the study. Otherwise, if automatic
2847 publication is switched on, default value is used for result name.
2850 New GEOM.GEOM_Object, containing the created cylinder.
2852 # Example: see GEOM_TestAll.py
2853 theR,theH,Parameters = ParseParameters(theR, theH)
2854 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2855 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2856 anObj.SetParameters(Parameters)
2857 self._autoPublish(anObj, theName, "cylinder")
2860 ## Create a sphere with given center and radius.
2861 # @param thePnt Sphere center.
2862 # @param theR Sphere radius.
2863 # @param theName Object name; when specified, this parameter is used
2864 # for result publication in the study. Otherwise, if automatic
2865 # publication is switched on, default value is used for result name.
2867 # @return New GEOM.GEOM_Object, containing the created sphere.
2869 # @ref tui_creation_sphere "Example"
2870 def MakeSpherePntR(self, thePnt, theR, theName=None):
2872 Create a sphere with given center and radius.
2875 thePnt Sphere center.
2877 theName Object name; when specified, this parameter is used
2878 for result publication in the study. Otherwise, if automatic
2879 publication is switched on, default value is used for result name.
2882 New GEOM.GEOM_Object, containing the created sphere.
2884 # Example: see GEOM_TestAll.py
2885 theR,Parameters = ParseParameters(theR)
2886 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2887 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2888 anObj.SetParameters(Parameters)
2889 self._autoPublish(anObj, theName, "sphere")
2892 ## Create a sphere with given center and radius.
2893 # @param x,y,z Coordinates of sphere center.
2894 # @param theR Sphere radius.
2895 # @param theName Object name; when specified, this parameter is used
2896 # for result publication in the study. Otherwise, if automatic
2897 # publication is switched on, default value is used for result name.
2899 # @return New GEOM.GEOM_Object, containing the created sphere.
2901 # @ref tui_creation_sphere "Example"
2902 def MakeSphere(self, x, y, z, theR, theName=None):
2904 Create a sphere with given center and radius.
2907 x,y,z Coordinates of sphere center.
2909 theName Object name; when specified, this parameter is used
2910 for result publication in the study. Otherwise, if automatic
2911 publication is switched on, default value is used for result name.
2914 New GEOM.GEOM_Object, containing the created sphere.
2916 # Example: see GEOM_TestAll.py
2917 point = self.MakeVertex(x, y, z)
2918 # note: auto-publishing is done in self.MakeSpherePntR()
2919 anObj = self.MakeSpherePntR(point, theR, theName)
2922 ## Create a sphere with given radius at the origin of coordinate system.
2923 # @param theR Sphere radius.
2924 # @param theName Object name; when specified, this parameter is used
2925 # for result publication in the study. Otherwise, if automatic
2926 # publication is switched on, default value is used for result name.
2928 # @return New GEOM.GEOM_Object, containing the created sphere.
2930 # @ref tui_creation_sphere "Example"
2931 def MakeSphereR(self, theR, theName=None):
2933 Create a sphere with given radius at the origin of coordinate system.
2937 theName Object name; when specified, this parameter is used
2938 for result publication in the study. Otherwise, if automatic
2939 publication is switched on, default value is used for result name.
2942 New GEOM.GEOM_Object, containing the created sphere.
2944 # Example: see GEOM_TestAll.py
2945 theR,Parameters = ParseParameters(theR)
2946 anObj = self.PrimOp.MakeSphereR(theR)
2947 RaiseIfFailed("MakeSphereR", self.PrimOp)
2948 anObj.SetParameters(Parameters)
2949 self._autoPublish(anObj, theName, "sphere")
2952 ## Create a cone with given base point, axis, height and radiuses.
2953 # @param thePnt Central point of the first cone base.
2954 # @param theAxis Cone axis.
2955 # @param theR1 Radius of the first cone base.
2956 # @param theR2 Radius of the second cone base.
2957 # \note If both radiuses are non-zero, the cone will be truncated.
2958 # \note If the radiuses are equal, a cylinder will be created instead.
2959 # @param theH Cone height.
2960 # @param theName Object name; when specified, this parameter is used
2961 # for result publication in the study. Otherwise, if automatic
2962 # publication is switched on, default value is used for result name.
2964 # @return New GEOM.GEOM_Object, containing the created cone.
2966 # @ref tui_creation_cone "Example"
2967 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2969 Create a cone with given base point, axis, height and radiuses.
2972 thePnt Central point of the first cone base.
2974 theR1 Radius of the first cone base.
2975 theR2 Radius of the second cone base.
2977 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.
2982 If both radiuses are non-zero, the cone will be truncated.
2983 If the radiuses are equal, a cylinder will be created instead.
2986 New GEOM.GEOM_Object, containing the created cone.
2988 # Example: see GEOM_TestAll.py
2989 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2990 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2991 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2992 anObj.SetParameters(Parameters)
2993 self._autoPublish(anObj, theName, "cone")
2996 ## Create a cone with given height and radiuses at
2997 # the origin of coordinate system. Axis of the cone will
2998 # be collinear to the OZ axis of the coordinate system.
2999 # @param theR1 Radius of the first cone base.
3000 # @param theR2 Radius of the second cone base.
3001 # \note If both radiuses are non-zero, the cone will be truncated.
3002 # \note If the radiuses are equal, a cylinder will be created instead.
3003 # @param theH Cone height.
3004 # @param theName Object name; when specified, this parameter is used
3005 # for result publication in the study. Otherwise, if automatic
3006 # publication is switched on, default value is used for result name.
3008 # @return New GEOM.GEOM_Object, containing the created cone.
3010 # @ref tui_creation_cone "Example"
3011 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3013 Create a cone with given height and radiuses at
3014 the origin of coordinate system. Axis of the cone will
3015 be collinear to the OZ axis of the coordinate system.
3018 theR1 Radius of the first cone base.
3019 theR2 Radius of the second cone base.
3021 theName Object name; when specified, this parameter is used
3022 for result publication in the study. Otherwise, if automatic
3023 publication is switched on, default value is used for result name.
3026 If both radiuses are non-zero, the cone will be truncated.
3027 If the radiuses are equal, a cylinder will be created instead.
3030 New GEOM.GEOM_Object, containing the created cone.
3032 # Example: see GEOM_TestAll.py
3033 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3034 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3035 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3036 anObj.SetParameters(Parameters)
3037 self._autoPublish(anObj, theName, "cone")
3040 ## Create a torus with given center, normal vector and radiuses.
3041 # @param thePnt Torus central point.
3042 # @param theVec Torus axis of symmetry.
3043 # @param theRMajor Torus major radius.
3044 # @param theRMinor Torus minor radius.
3045 # @param theName Object name; when specified, this parameter is used
3046 # for result publication in the study. Otherwise, if automatic
3047 # publication is switched on, default value is used for result name.
3049 # @return New GEOM.GEOM_Object, containing the created torus.
3051 # @ref tui_creation_torus "Example"
3052 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3054 Create a torus with given center, normal vector and radiuses.
3057 thePnt Torus central point.
3058 theVec Torus axis of symmetry.
3059 theRMajor Torus major radius.
3060 theRMinor Torus minor radius.
3061 theName Object name; when specified, this parameter is used
3062 for result publication in the study. Otherwise, if automatic
3063 publication is switched on, default value is used for result name.
3066 New GEOM.GEOM_Object, containing the created torus.
3068 # Example: see GEOM_TestAll.py
3069 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3070 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3071 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3072 anObj.SetParameters(Parameters)
3073 self._autoPublish(anObj, theName, "torus")
3076 ## Create a torus with given radiuses at the origin of coordinate system.
3077 # @param theRMajor Torus major radius.
3078 # @param theRMinor Torus minor radius.
3079 # @param theName Object name; when specified, this parameter is used
3080 # for result publication in the study. Otherwise, if automatic
3081 # publication is switched on, default value is used for result name.
3083 # @return New GEOM.GEOM_Object, containing the created torus.
3085 # @ref tui_creation_torus "Example"
3086 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3088 Create a torus with given radiuses at the origin of coordinate system.
3091 theRMajor Torus major radius.
3092 theRMinor Torus minor radius.
3093 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.
3098 New GEOM.GEOM_Object, containing the created torus.
3100 # Example: see GEOM_TestAll.py
3101 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3102 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3103 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3104 anObj.SetParameters(Parameters)
3105 self._autoPublish(anObj, theName, "torus")
3108 # end of l3_3d_primitives
3111 ## @addtogroup l3_complex
3114 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3115 # @param theBase Base shape to be extruded.
3116 # @param thePoint1 First end of extrusion vector.
3117 # @param thePoint2 Second end of extrusion vector.
3118 # @param theScaleFactor Use it to make prism with scaled second base.
3119 # Nagative value means not scaled second base.
3120 # @param theName Object name; when specified, this parameter is used
3121 # for result publication in the study. Otherwise, if automatic
3122 # publication is switched on, default value is used for result name.
3124 # @return New GEOM.GEOM_Object, containing the created prism.
3126 # @ref tui_creation_prism "Example"
3127 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3129 Create a shape by extrusion of the base shape along a vector, defined by two points.
3132 theBase Base shape to be extruded.
3133 thePoint1 First end of extrusion vector.
3134 thePoint2 Second end of extrusion vector.
3135 theScaleFactor Use it to make prism with scaled second base.
3136 Nagative value means not scaled second base.
3137 theName Object name; when specified, this parameter is used
3138 for result publication in the study. Otherwise, if automatic
3139 publication is switched on, default value is used for result name.
3142 New GEOM.GEOM_Object, containing the created prism.
3144 # Example: see GEOM_TestAll.py
3147 if theScaleFactor > 0:
3148 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3149 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3151 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3152 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3153 anObj.SetParameters(Parameters)
3154 self._autoPublish(anObj, theName, "prism")
3157 ## Create a shape by extrusion of the base shape along a
3158 # vector, defined by two points, in 2 Ways (forward/backward).
3159 # @param theBase Base shape to be extruded.
3160 # @param thePoint1 First end of extrusion vector.
3161 # @param thePoint2 Second end of extrusion vector.
3162 # @param theName Object name; when specified, this parameter is used
3163 # for result publication in the study. Otherwise, if automatic
3164 # publication is switched on, default value is used for result name.
3166 # @return New GEOM.GEOM_Object, containing the created prism.
3168 # @ref tui_creation_prism "Example"
3169 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3171 Create a shape by extrusion of the base shape along a
3172 vector, defined by two points, in 2 Ways (forward/backward).
3175 theBase Base shape to be extruded.
3176 thePoint1 First end of extrusion vector.
3177 thePoint2 Second end of extrusion vector.
3178 theName Object name; when specified, this parameter is used
3179 for result publication in the study. Otherwise, if automatic
3180 publication is switched on, default value is used for result name.
3183 New GEOM.GEOM_Object, containing the created prism.
3185 # Example: see GEOM_TestAll.py
3186 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3187 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3188 self._autoPublish(anObj, theName, "prism")
3191 ## Create a shape by extrusion of the base shape along the vector,
3192 # i.e. all the space, transfixed by the base shape during its translation
3193 # along the vector on the given distance.
3194 # @param theBase Base shape to be extruded.
3195 # @param theVec Direction of extrusion.
3196 # @param theH Prism dimension along theVec.
3197 # @param theScaleFactor Use it to make prism with scaled second base.
3198 # Negative value means not scaled second base.
3199 # @param theName Object name; when specified, this parameter is used
3200 # for result publication in the study. Otherwise, if automatic
3201 # publication is switched on, default value is used for result name.
3203 # @return New GEOM.GEOM_Object, containing the created prism.
3205 # @ref tui_creation_prism "Example"
3206 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3208 Create a shape by extrusion of the base shape along the vector,
3209 i.e. all the space, transfixed by the base shape during its translation
3210 along the vector on the given distance.
3213 theBase Base shape to be extruded.
3214 theVec Direction of extrusion.
3215 theH Prism dimension along theVec.
3216 theScaleFactor Use it to make prism with scaled second base.
3217 Negative value means not scaled second base.
3218 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.
3223 New GEOM.GEOM_Object, containing the created prism.
3225 # Example: see GEOM_TestAll.py
3228 if theScaleFactor > 0:
3229 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3230 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3232 theH,Parameters = ParseParameters(theH)
3233 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3234 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "prism")
3239 ## Create a shape by extrusion of the base shape along the vector,
3240 # i.e. all the space, transfixed by the base shape during its translation
3241 # along the vector on the given distance in 2 Ways (forward/backward).
3242 # @param theBase Base shape to be extruded.
3243 # @param theVec Direction of extrusion.
3244 # @param theH Prism dimension along theVec in forward direction.
3245 # @param theName Object name; when specified, this parameter is used
3246 # for result publication in the study. Otherwise, if automatic
3247 # publication is switched on, default value is used for result name.
3249 # @return New GEOM.GEOM_Object, containing the created prism.
3251 # @ref tui_creation_prism "Example"
3252 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3254 Create a shape by extrusion of the base shape along the vector,
3255 i.e. all the space, transfixed by the base shape during its translation
3256 along the vector on the given distance in 2 Ways (forward/backward).
3259 theBase Base shape to be extruded.
3260 theVec Direction of extrusion.
3261 theH Prism dimension along theVec in forward direction.
3262 theName Object name; when specified, this parameter is used
3263 for result publication in the study. Otherwise, if automatic
3264 publication is switched on, default value is used for result name.
3267 New GEOM.GEOM_Object, containing the created prism.
3269 # Example: see GEOM_TestAll.py
3270 theH,Parameters = ParseParameters(theH)
3271 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3272 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3273 anObj.SetParameters(Parameters)
3274 self._autoPublish(anObj, theName, "prism")
3277 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3278 # @param theBase Base shape to be extruded.
3279 # @param theDX, theDY, theDZ Directions of extrusion.
3280 # @param theScaleFactor Use it to make prism with scaled second base.
3281 # Nagative value means not scaled second base.
3282 # @param theName Object name; when specified, this parameter is used
3283 # for result publication in the study. Otherwise, if automatic
3284 # publication is switched on, default value is used for result name.
3286 # @return New GEOM.GEOM_Object, containing the created prism.
3288 # @ref tui_creation_prism "Example"
3289 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3291 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3294 theBase Base shape to be extruded.
3295 theDX, theDY, theDZ Directions of extrusion.
3296 theScaleFactor Use it to make prism with scaled second base.
3297 Nagative value means not scaled second base.
3298 theName Object name; when specified, this parameter is used
3299 for result publication in the study. Otherwise, if automatic
3300 publication is switched on, default value is used for result name.
3303 New GEOM.GEOM_Object, containing the created prism.
3305 # Example: see GEOM_TestAll.py
3308 if theScaleFactor > 0:
3309 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3310 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3312 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3313 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3314 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3315 anObj.SetParameters(Parameters)
3316 self._autoPublish(anObj, theName, "prism")
3319 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3320 # i.e. all the space, transfixed by the base shape during its translation
3321 # along the vector on the given distance in 2 Ways (forward/backward).
3322 # @param theBase Base shape to be extruded.
3323 # @param theDX, theDY, theDZ Directions of extrusion.
3324 # @param theName Object name; when specified, this parameter is used
3325 # for result publication in the study. Otherwise, if automatic
3326 # publication is switched on, default value is used for result name.
3328 # @return New GEOM.GEOM_Object, containing the created prism.
3330 # @ref tui_creation_prism "Example"
3331 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3333 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3334 i.e. all the space, transfixed by the base shape during its translation
3335 along the vector on the given distance in 2 Ways (forward/backward).
3338 theBase Base shape to be extruded.
3339 theDX, theDY, theDZ Directions of extrusion.
3340 theName Object name; when specified, this parameter is used
3341 for result publication in the study. Otherwise, if automatic
3342 publication is switched on, default value is used for result name.
3345 New GEOM.GEOM_Object, containing the created prism.
3347 # Example: see GEOM_TestAll.py
3348 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3349 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3350 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3351 anObj.SetParameters(Parameters)
3352 self._autoPublish(anObj, theName, "prism")
3355 ## Create a shape by revolution of the base shape around the axis
3356 # on the given angle, i.e. all the space, transfixed by the base
3357 # shape during its rotation around the axis on the given angle.
3358 # @param theBase Base shape to be rotated.
3359 # @param theAxis Rotation axis.
3360 # @param theAngle Rotation angle in radians.
3361 # @param theName Object name; when specified, this parameter is used
3362 # for result publication in the study. Otherwise, if automatic
3363 # publication is switched on, default value is used for result name.
3365 # @return New GEOM.GEOM_Object, containing the created revolution.
3367 # @ref tui_creation_revolution "Example"
3368 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3370 Create a shape by revolution of the base shape around the axis
3371 on the given angle, i.e. all the space, transfixed by the base
3372 shape during its rotation around the axis on the given angle.
3375 theBase Base shape to be rotated.
3376 theAxis Rotation axis.
3377 theAngle Rotation angle in radians.
3378 theName Object name; when specified, this parameter is used
3379 for result publication in the study. Otherwise, if automatic
3380 publication is switched on, default value is used for result name.
3383 New GEOM.GEOM_Object, containing the created revolution.
3385 # Example: see GEOM_TestAll.py
3386 theAngle,Parameters = ParseParameters(theAngle)
3387 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3388 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3389 anObj.SetParameters(Parameters)
3390 self._autoPublish(anObj, theName, "revolution")
3393 ## Create a shape by revolution of the base shape around the axis
3394 # on the given angle, i.e. all the space, transfixed by the base
3395 # shape during its rotation around the axis on the given angle in
3396 # both directions (forward/backward)
3397 # @param theBase Base shape to be rotated.
3398 # @param theAxis Rotation axis.
3399 # @param theAngle Rotation angle in radians.
3400 # @param theName Object name; when specified, this parameter is used
3401 # for result publication in the study. Otherwise, if automatic
3402 # publication is switched on, default value is used for result name.
3404 # @return New GEOM.GEOM_Object, containing the created revolution.
3406 # @ref tui_creation_revolution "Example"
3407 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3409 Create a shape by revolution of the base shape around the axis
3410 on the given angle, i.e. all the space, transfixed by the base
3411 shape during its rotation around the axis on the given angle in
3412 both directions (forward/backward).
3415 theBase Base shape to be rotated.
3416 theAxis Rotation axis.
3417 theAngle Rotation angle in radians.
3418 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.
3423 New GEOM.GEOM_Object, containing the created revolution.
3425 theAngle,Parameters = ParseParameters(theAngle)
3426 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3427 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3428 anObj.SetParameters(Parameters)
3429 self._autoPublish(anObj, theName, "revolution")
3432 ## Create a filling from the given compound of contours.
3433 # @param theShape the compound of contours
3434 # @param theMinDeg a minimal degree of BSpline surface to create
3435 # @param theMaxDeg a maximal degree of BSpline surface to create
3436 # @param theTol2D a 2d tolerance to be reached
3437 # @param theTol3D a 3d tolerance to be reached
3438 # @param theNbIter a number of iteration of approximation algorithm
3439 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3440 # @param isApprox if True, BSpline curves are generated in the process
3441 # of surface construction. By default it is False, that means
3442 # the surface is created using given curves. The usage of
3443 # Approximation makes the algorithm work slower, but allows
3444 # building the surface for rather complex cases.
3445 # @param theName Object name; when specified, this parameter is used
3446 # for result publication in the study. Otherwise, if automatic
3447 # publication is switched on, default value is used for result name.
3449 # @return New GEOM.GEOM_Object, containing the created filling surface.
3451 # @ref tui_creation_filling "Example"
3452 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3453 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3455 Create a filling from the given compound of contours.
3458 theShape the compound of contours
3459 theMinDeg a minimal degree of BSpline surface to create
3460 theMaxDeg a maximal degree of BSpline surface to create
3461 theTol2D a 2d tolerance to be reached
3462 theTol3D a 3d tolerance to be reached
3463 theNbIter a number of iteration of approximation algorithm
3464 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3465 isApprox if True, BSpline curves are generated in the process
3466 of surface construction. By default it is False, that means
3467 the surface is created using given curves. The usage of
3468 Approximation makes the algorithm work slower, but allows
3469 building the surface for rather complex cases
3470 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.
3475 New GEOM.GEOM_Object, containing the created filling surface.
3478 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3480 # Example: see GEOM_TestAll.py
3481 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3482 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3483 theTol2D, theTol3D, theNbIter,
3484 theMethod, isApprox)
3485 RaiseIfFailed("MakeFilling", self.PrimOp)
3486 anObj.SetParameters(Parameters)
3487 self._autoPublish(anObj, theName, "filling")
3491 ## Create a filling from the given compound of contours.
3492 # This method corresponds to MakeFilling with isApprox=True
3493 # @param theShape the compound of contours
3494 # @param theMinDeg a minimal degree of BSpline surface to create
3495 # @param theMaxDeg a maximal degree of BSpline surface to create
3496 # @param theTol3D a 3d tolerance to be reached
3497 # @param theName Object name; when specified, this parameter is used
3498 # for result publication in the study. Otherwise, if automatic
3499 # publication is switched on, default value is used for result name.
3501 # @return New GEOM.GEOM_Object, containing the created filling surface.
3503 # @ref tui_creation_filling "Example"
3504 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3506 Create a filling from the given compound of contours.
3507 This method corresponds to MakeFilling with isApprox=True
3510 theShape the compound of contours
3511 theMinDeg a minimal degree of BSpline surface to create
3512 theMaxDeg a maximal degree of BSpline surface to create
3513 theTol3D a 3d tolerance to be reached
3514 theName Object name; when specified, this parameter is used
3515 for result publication in the study. Otherwise, if automatic
3516 publication is switched on, default value is used for result name.
3519 New GEOM.GEOM_Object, containing the created filling surface.
3522 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3524 # Example: see GEOM_TestAll.py
3525 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3526 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3527 0, theTol3D, 0, GEOM.FOM_Default, True)
3528 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "filling")
3533 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3534 # @param theSeqSections - set of specified sections.
3535 # @param theModeSolid - mode defining building solid or shell
3536 # @param thePreci - precision 3D used for smoothing
3537 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3538 # @param theName Object name; when specified, this parameter is used
3539 # for result publication in the study. Otherwise, if automatic
3540 # publication is switched on, default value is used for result name.
3542 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3544 # @ref swig_todo "Example"
3545 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3547 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3550 theSeqSections - set of specified sections.
3551 theModeSolid - mode defining building solid or shell
3552 thePreci - precision 3D used for smoothing
3553 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3554 theName Object name; when specified, this parameter is used
3555 for result publication in the study. Otherwise, if automatic
3556 publication is switched on, default value is used for result name.
3559 New GEOM.GEOM_Object, containing the created shell or solid.
3561 # Example: see GEOM_TestAll.py
3562 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3563 RaiseIfFailed("MakeThruSections", self.PrimOp)
3564 self._autoPublish(anObj, theName, "filling")
3567 ## Create a shape by extrusion of the base shape along
3568 # the path shape. The path shape can be a wire or an edge.
3569 # @param theBase Base shape to be extruded.
3570 # @param thePath Path shape to extrude the base shape along it.
3571 # @param theName Object name; when specified, this parameter is used
3572 # for result publication in the study. Otherwise, if automatic
3573 # publication is switched on, default value is used for result name.
3575 # @return New GEOM.GEOM_Object, containing the created pipe.
3577 # @ref tui_creation_pipe "Example"
3578 def MakePipe(self, theBase, thePath, theName=None):
3580 Create a shape by extrusion of the base shape along
3581 the path shape. The path shape can be a wire or an edge.
3584 theBase Base shape to be extruded.
3585 thePath Path shape to extrude the base shape along it.
3586 theName Object name; when specified, this parameter is used
3587 for result publication in the study. Otherwise, if automatic
3588 publication is switched on, default value is used for result name.
3591 New GEOM.GEOM_Object, containing the created pipe.
3593 # Example: see GEOM_TestAll.py
3594 anObj = self.PrimOp.MakePipe(theBase, thePath)
3595 RaiseIfFailed("MakePipe", self.PrimOp)
3596 self._autoPublish(anObj, theName, "pipe")
3599 ## Create a shape by extrusion of the profile shape along
3600 # the path shape. The path shape can be a wire or an edge.
3601 # the several profiles can be specified in the several locations of path.
3602 # @param theSeqBases - list of Bases shape to be extruded.
3603 # @param theLocations - list of locations on the path corresponding
3604 # specified list of the Bases shapes. Number of locations
3605 # should be equal to number of bases or list of locations can be empty.
3606 # @param thePath - Path shape to extrude the base shape along it.
3607 # @param theWithContact - the mode defining that the section is translated to be in
3608 # contact with the spine.
3609 # @param theWithCorrection - defining that the section is rotated to be
3610 # orthogonal to the spine tangent in the correspondent point
3611 # @param theName Object name; when specified, this parameter is used
3612 # for result publication in the study. Otherwise, if automatic
3613 # publication is switched on, default value is used for result name.
3615 # @return New GEOM.GEOM_Object, containing the created pipe.
3617 # @ref tui_creation_pipe_with_diff_sec "Example"
3618 def MakePipeWithDifferentSections(self, theSeqBases,
3619 theLocations, thePath,
3620 theWithContact, theWithCorrection, theName=None):
3622 Create a shape by extrusion of the profile shape along
3623 the path shape. The path shape can be a wire or an edge.
3624 the several profiles can be specified in the several locations of path.
3627 theSeqBases - list of Bases shape to be extruded.
3628 theLocations - list of locations on the path corresponding
3629 specified list of the Bases shapes. Number of locations
3630 should be equal to number of bases or list of locations can be empty.
3631 thePath - Path shape to extrude the base shape along it.
3632 theWithContact - the mode defining that the section is translated to be in
3633 contact with the spine(0/1)
3634 theWithCorrection - defining that the section is rotated to be
3635 orthogonal to the spine tangent in the correspondent point (0/1)
3636 theName Object name; when specified, this parameter is used
3637 for result publication in the study. Otherwise, if automatic
3638 publication is switched on, default value is used for result name.
3641 New GEOM.GEOM_Object, containing the created pipe.
3643 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3644 theLocations, thePath,
3645 theWithContact, theWithCorrection)
3646 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3647 self._autoPublish(anObj, theName, "pipe")
3650 ## Create a shape by extrusion of the profile shape along
3651 # the path shape. The path shape can be a wire or a edge.
3652 # the several profiles can be specified in the several locations of path.
3653 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3654 # shell or face. If number of faces in neighbour sections
3655 # aren't coincided result solid between such sections will
3656 # be created using external boundaries of this shells.
3657 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3658 # This list is used for searching correspondences between
3659 # faces in the sections. Size of this list must be equal
3660 # to size of list of base shapes.
3661 # @param theLocations - list of locations on the path corresponding
3662 # specified list of the Bases shapes. Number of locations
3663 # should be equal to number of bases. First and last
3664 # locations must be coincided with first and last vertexes
3665 # of path correspondingly.
3666 # @param thePath - Path shape to extrude the base shape along it.
3667 # @param theWithContact - the mode defining that the section is translated to be in
3668 # contact with the spine.
3669 # @param theWithCorrection - defining that the section is rotated to be
3670 # orthogonal to the spine tangent in the correspondent point
3671 # @param theName Object name; when specified, this parameter is used
3672 # for result publication in the study. Otherwise, if automatic
3673 # publication is switched on, default value is used for result name.
3675 # @return New GEOM.GEOM_Object, containing the created solids.
3677 # @ref tui_creation_pipe_with_shell_sec "Example"
3678 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3679 theLocations, thePath,
3680 theWithContact, theWithCorrection, theName=None):
3682 Create a shape by extrusion of the profile shape along
3683 the path shape. The path shape can be a wire or a edge.
3684 the several profiles can be specified in the several locations of path.
3687 theSeqBases - list of Bases shape to be extruded. Base shape must be
3688 shell or face. If number of faces in neighbour sections
3689 aren't coincided result solid between such sections will
3690 be created using external boundaries of this shells.
3691 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3692 This list is used for searching correspondences between
3693 faces in the sections. Size of this list must be equal
3694 to size of list of base shapes.
3695 theLocations - list of locations on the path corresponding
3696 specified list of the Bases shapes. Number of locations
3697 should be equal to number of bases. First and last
3698 locations must be coincided with first and last vertexes
3699 of path correspondingly.
3700 thePath - Path shape to extrude the base shape along it.
3701 theWithContact - the mode defining that the section is translated to be in
3702 contact with the spine (0/1)
3703 theWithCorrection - defining that the section is rotated to be
3704 orthogonal to the spine tangent in the correspondent point (0/1)
3705 theName Object name; when specified, this parameter is used
3706 for result publication in the study. Otherwise, if automatic
3707 publication is switched on, default value is used for result name.
3710 New GEOM.GEOM_Object, containing the created solids.
3712 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3713 theLocations, thePath,
3714 theWithContact, theWithCorrection)
3715 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3716 self._autoPublish(anObj, theName, "pipe")
3719 ## Create a shape by extrusion of the profile shape along
3720 # the path shape. This function is used only for debug pipe
3721 # functionality - it is a version of function MakePipeWithShellSections()
3722 # which give a possibility to recieve information about
3723 # creating pipe between each pair of sections step by step.
3724 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3725 theLocations, thePath,
3726 theWithContact, theWithCorrection, theName=None):
3728 Create a shape by extrusion of the profile shape along
3729 the path shape. This function is used only for debug pipe
3730 functionality - it is a version of previous function
3731 geompy.MakePipeWithShellSections() which give a possibility to
3732 recieve information about creating pipe between each pair of
3733 sections step by step.
3736 nbsect = len(theSeqBases)
3737 nbsubsect = len(theSeqSubBases)
3738 #print "nbsect = ",nbsect
3739 for i in range(1,nbsect):
3741 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3742 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3744 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3745 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3746 tmpLocations, thePath,
3747 theWithContact, theWithCorrection)
3748 if self.PrimOp.IsDone() == 0:
3749 print "Problems with pipe creation between ",i," and ",i+1," sections"
3750 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3753 print "Pipe between ",i," and ",i+1," sections is OK"
3758 resc = self.MakeCompound(res)
3759 #resc = self.MakeSewing(res, 0.001)
3760 #print "resc: ",resc
3761 self._autoPublish(resc, theName, "pipe")
3764 ## Create solids between given sections
3765 # @param theSeqBases - list of sections (shell or face).
3766 # @param theLocations - list of corresponding vertexes
3767 # @param theName Object name; when specified, this parameter is used
3768 # for result publication in the study. Otherwise, if automatic
3769 # publication is switched on, default value is used for result name.
3771 # @return New GEOM.GEOM_Object, containing the created solids.
3773 # @ref tui_creation_pipe_without_path "Example"
3774 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3776 Create solids between given sections
3779 theSeqBases - list of sections (shell or face).
3780 theLocations - list of corresponding vertexes
3781 theName Object name; when specified, this parameter is used
3782 for result publication in the study. Otherwise, if automatic
3783 publication is switched on, default value is used for result name.
3786 New GEOM.GEOM_Object, containing the created solids.
3788 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3789 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3790 self._autoPublish(anObj, theName, "pipe")
3793 ## Create a shape by extrusion of the base shape along
3794 # the path shape with constant bi-normal direction along the given vector.
3795 # The path shape can be a wire or an edge.
3796 # @param theBase Base shape to be extruded.
3797 # @param thePath Path shape to extrude the base shape along it.
3798 # @param theVec Vector defines a constant binormal direction to keep the
3799 # same angle beetween the direction and the sections
3800 # along the sweep surface.
3801 # @param theName Object name; when specified, this parameter is used
3802 # for result publication in the study. Otherwise, if automatic
3803 # publication is switched on, default value is used for result name.
3805 # @return New GEOM.GEOM_Object, containing the created pipe.
3807 # @ref tui_creation_pipe "Example"
3808 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3810 Create a shape by extrusion of the base shape along
3811 the path shape with constant bi-normal direction along the given vector.
3812 The path shape can be a wire or an edge.
3815 theBase Base shape to be extruded.
3816 thePath Path shape to extrude the base shape along it.
3817 theVec Vector defines a constant binormal direction to keep the
3818 same angle beetween the direction and the sections
3819 along the sweep surface.
3820 theName Object name; when specified, this parameter is used
3821 for result publication in the study. Otherwise, if automatic
3822 publication is switched on, default value is used for result name.
3825 New GEOM.GEOM_Object, containing the created pipe.
3827 # Example: see GEOM_TestAll.py
3828 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3829 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3830 self._autoPublish(anObj, theName, "pipe")
3833 ## Makes a thick solid from a face or a shell
3834 # @param theShape Face or Shell to be thicken
3835 # @param theThickness Thickness of the resulting solid
3836 # @param theName Object name; when specified, this parameter is used
3837 # for result publication in the study. Otherwise, if automatic
3838 # publication is switched on, default value is used for result name.
3840 # @return New GEOM.GEOM_Object, containing the created solid
3842 def MakeThickSolid(self, theShape, theThickness, theName=None):
3844 Make a thick solid from a face or a shell
3847 theShape Face or Shell to be thicken
3848 theThickness Thickness of the resulting solid
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.
3854 New GEOM.GEOM_Object, containing the created solid
3856 # Example: see GEOM_TestAll.py
3857 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3858 RaiseIfFailed("MakeThickening", self.PrimOp)
3859 self._autoPublish(anObj, theName, "pipe")
3863 ## Modifies a face or a shell to make it a thick solid
3864 # @param theShape Face or Shell to be thicken
3865 # @param theThickness Thickness of the resulting solid
3867 # @return The modified shape
3869 def Thicken(self, theShape, theThickness):
3871 Modifies a face or a shell to make it a thick solid
3874 theBase Base shape to be extruded.
3875 thePath Path shape to extrude the base shape along it.
3876 theName Object name; when specified, this parameter is used
3877 for result publication in the study. Otherwise, if automatic
3878 publication is switched on, default value is used for result name.
3883 # Example: see GEOM_TestAll.py
3884 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3885 RaiseIfFailed("MakeThickening", self.PrimOp)
3888 ## Build a middle path of a pipe-like shape.
3889 # The path shape can be a wire or an edge.
3890 # @param theShape It can be closed or unclosed pipe-like shell
3891 # or a pipe-like solid.
3892 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3893 # should be wires or faces of theShape.
3894 # @param theName Object name; when specified, this parameter is used
3895 # for result publication in the study. Otherwise, if automatic
3896 # publication is switched on, default value is used for result name.
3898 # @note It is not assumed that exact or approximate copy of theShape
3899 # can be obtained by applying existing Pipe operation on the
3900 # resulting "Path" wire taking theBase1 as the base - it is not
3901 # always possible; though in some particular cases it might work
3902 # it is not guaranteed. Thus, RestorePath function should not be
3903 # considered as an exact reverse operation of the Pipe.
3905 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3906 # source pipe's "path".
3908 # @ref tui_creation_pipe_path "Example"
3909 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3911 Build a middle path of a pipe-like shape.
3912 The path shape can be a wire or an edge.
3915 theShape It can be closed or unclosed pipe-like shell
3916 or a pipe-like solid.
3917 theBase1, theBase2 Two bases of the supposed pipe. This
3918 should be wires or faces of theShape.
3919 theName Object name; when specified, this parameter is used
3920 for result publication in the study. Otherwise, if automatic
3921 publication is switched on, default value is used for result name.
3924 New GEOM_Object, containing an edge or wire that represent
3927 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3928 RaiseIfFailed("RestorePath", self.PrimOp)
3929 self._autoPublish(anObj, theName, "path")
3932 ## Build a middle path of a pipe-like shape.
3933 # The path shape can be a wire or an edge.
3934 # @param theShape It can be closed or unclosed pipe-like shell
3935 # or a pipe-like solid.
3936 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3937 # should be lists of edges of theShape.
3938 # @param theName Object name; when specified, this parameter is used
3939 # for result publication in the study. Otherwise, if automatic
3940 # publication is switched on, default value is used for result name.
3942 # @note It is not assumed that exact or approximate copy of theShape
3943 # can be obtained by applying existing Pipe operation on the
3944 # resulting "Path" wire taking theBase1 as the base - it is not
3945 # always possible; though in some particular cases it might work
3946 # it is not guaranteed. Thus, RestorePath function should not be
3947 # considered as an exact reverse operation of the Pipe.
3949 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3950 # source pipe's "path".
3952 # @ref tui_creation_pipe_path "Example"
3953 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3955 Build a middle path of a pipe-like shape.
3956 The path shape can be a wire or an edge.
3959 theShape It can be closed or unclosed pipe-like shell
3960 or a pipe-like solid.
3961 listEdges1, listEdges2 Two bases of the supposed pipe. This
3962 should be lists of edges of theShape.
3963 theName Object name; when specified, this parameter is used
3964 for result publication in the study. Otherwise, if automatic
3965 publication is switched on, default value is used for result name.
3968 New GEOM_Object, containing an edge or wire that represent
3971 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3972 RaiseIfFailed("RestorePath", self.PrimOp)
3973 self._autoPublish(anObj, theName, "path")
3979 ## @addtogroup l3_advanced
3982 ## Create a linear edge with specified ends.
3983 # @param thePnt1 Point for the first end of edge.
3984 # @param thePnt2 Point for the second end of edge.
3985 # @param theName Object name; when specified, this parameter is used
3986 # for result publication in the study. Otherwise, if automatic
3987 # publication is switched on, default value is used for result name.
3989 # @return New GEOM.GEOM_Object, containing the created edge.
3991 # @ref tui_creation_edge "Example"
3992 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3994 Create a linear edge with specified ends.
3997 thePnt1 Point for the first end of edge.
3998 thePnt2 Point for the second end of edge.
3999 theName Object name; when specified, this parameter is used
4000 for result publication in the study. Otherwise, if automatic
4001 publication is switched on, default value is used for result name.
4004 New GEOM.GEOM_Object, containing the created edge.
4006 # Example: see GEOM_TestAll.py
4007 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4008 RaiseIfFailed("MakeEdge", self.ShapesOp)
4009 self._autoPublish(anObj, theName, "edge")
4012 ## Create a new edge, corresponding to the given length on the given curve.
4013 # @param theRefCurve The referenced curve (edge).
4014 # @param theLength Length on the referenced curve. It can be negative.
4015 # @param theStartPoint Any point can be selected for it, the new edge will begin
4016 # at the end of \a theRefCurve, close to the selected point.
4017 # If None, start from the first point of \a theRefCurve.
4018 # @param theName Object name; when specified, this parameter is used
4019 # for result publication in the study. Otherwise, if automatic
4020 # publication is switched on, default value is used for result name.
4022 # @return New GEOM.GEOM_Object, containing the created edge.
4024 # @ref tui_creation_edge "Example"
4025 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4027 Create a new edge, corresponding to the given length on the given curve.
4030 theRefCurve The referenced curve (edge).
4031 theLength Length on the referenced curve. It can be negative.
4032 theStartPoint Any point can be selected for it, the new edge will begin
4033 at the end of theRefCurve, close to the selected point.
4034 If None, start from the first point of theRefCurve.
4035 theName Object name; when specified, this parameter is used
4036 for result publication in the study. Otherwise, if automatic
4037 publication is switched on, default value is used for result name.
4040 New GEOM.GEOM_Object, containing the created edge.
4042 # Example: see GEOM_TestAll.py
4043 theLength, Parameters = ParseParameters(theLength)
4044 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4045 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4046 anObj.SetParameters(Parameters)
4047 self._autoPublish(anObj, theName, "edge")
4050 ## Create an edge from specified wire.
4051 # @param theWire source Wire
4052 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4053 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4054 # @param theName Object name; when specified, this parameter is used
4055 # for result publication in the study. Otherwise, if automatic
4056 # publication is switched on, default value is used for result name.
4058 # @return New GEOM.GEOM_Object, containing the created edge.
4060 # @ref tui_creation_edge "Example"
4061 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4063 Create an edge from specified wire.
4067 theLinearTolerance linear tolerance value (default = 1e-07)
4068 theAngularTolerance angular tolerance value (default = 1e-12)
4069 theName Object name; when specified, this parameter is used
4070 for result publication in the study. Otherwise, if automatic
4071 publication is switched on, default value is used for result name.
4074 New GEOM.GEOM_Object, containing the created edge.
4076 # Example: see GEOM_TestAll.py
4077 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4078 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4079 self._autoPublish(anObj, theName, "edge")
4082 ## Create a wire from the set of edges and wires.
4083 # @param theEdgesAndWires List of edges and/or wires.
4084 # @param theTolerance Maximum distance between vertices, that will be merged.
4085 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4086 # @param theName Object name; when specified, this parameter is used
4087 # for result publication in the study. Otherwise, if automatic
4088 # publication is switched on, default value is used for result name.
4090 # @return New GEOM.GEOM_Object, containing the created wire.
4092 # @ref tui_creation_wire "Example"
4093 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4095 Create a wire from the set of edges and wires.
4098 theEdgesAndWires List of edges and/or wires.
4099 theTolerance Maximum distance between vertices, that will be merged.
4100 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4101 theName Object name; when specified, this parameter is used
4102 for result publication in the study. Otherwise, if automatic
4103 publication is switched on, default value is used for result name.
4106 New GEOM.GEOM_Object, containing the created wire.
4108 # Example: see GEOM_TestAll.py
4109 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4110 RaiseIfFailed("MakeWire", self.ShapesOp)
4111 self._autoPublish(anObj, theName, "wire")
4114 ## Create a face on the given wire.
4115 # @param theWire closed Wire or Edge to build the face on.
4116 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4117 # If the tolerance of the obtained planar face is less
4118 # than 1e-06, this face will be returned, otherwise the
4119 # algorithm tries to build any suitable face on the given
4120 # wire and prints a warning message.
4121 # @param theName Object name; when specified, this parameter is used
4122 # for result publication in the study. Otherwise, if automatic
4123 # publication is switched on, default value is used for result name.
4125 # @return New GEOM.GEOM_Object, containing the created face.
4127 # @ref tui_creation_face "Example"
4128 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4130 Create a face on the given wire.
4133 theWire closed Wire or Edge to build the face on.
4134 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4135 If the tolerance of the obtained planar face is less
4136 than 1e-06, this face will be returned, otherwise the
4137 algorithm tries to build any suitable face on the given
4138 wire and prints a warning message.
4139 theName Object name; when specified, this parameter is used
4140 for result publication in the study. Otherwise, if automatic
4141 publication is switched on, default value is used for result name.
4144 New GEOM.GEOM_Object, containing the created face.
4146 # Example: see GEOM_TestAll.py
4147 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4148 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4149 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4151 RaiseIfFailed("MakeFace", self.ShapesOp)
4152 self._autoPublish(anObj, theName, "face")
4155 ## Create a face on the given wires set.
4156 # @param theWires List of closed wires or edges to build the face on.
4157 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4158 # If the tolerance of the obtained planar face is less
4159 # than 1e-06, this face will be returned, otherwise the
4160 # algorithm tries to build any suitable face on the given
4161 # wire and prints a warning message.
4162 # @param theName Object name; when specified, this parameter is used
4163 # for result publication in the study. Otherwise, if automatic
4164 # publication is switched on, default value is used for result name.
4166 # @return New GEOM.GEOM_Object, containing the created face.
4168 # @ref tui_creation_face "Example"
4169 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4171 Create a face on the given wires set.
4174 theWires List of closed wires or edges to build the face on.
4175 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4176 If the tolerance of the obtained planar face is less
4177 than 1e-06, this face will be returned, otherwise the
4178 algorithm tries to build any suitable face on the given
4179 wire and prints a warning message.
4180 theName Object name; when specified, this parameter is used
4181 for result publication in the study. Otherwise, if automatic
4182 publication is switched on, default value is used for result name.
4185 New GEOM.GEOM_Object, containing the created face.
4187 # Example: see GEOM_TestAll.py
4188 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4189 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4190 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4192 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4193 self._autoPublish(anObj, theName, "face")
4196 ## See MakeFaceWires() method for details.
4198 # @ref tui_creation_face "Example 1"
4199 # \n @ref swig_MakeFaces "Example 2"
4200 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4202 See geompy.MakeFaceWires() method for details.
4204 # Example: see GEOM_TestOthers.py
4205 # note: auto-publishing is done in self.MakeFaceWires()
4206 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4209 ## Create a shell from the set of faces and shells.
4210 # @param theFacesAndShells List of faces and/or shells.
4211 # @param theName Object name; when specified, this parameter is used
4212 # for result publication in the study. Otherwise, if automatic
4213 # publication is switched on, default value is used for result name.
4215 # @return New GEOM.GEOM_Object, containing the created shell.
4217 # @ref tui_creation_shell "Example"
4218 def MakeShell(self, theFacesAndShells, theName=None):
4220 Create a shell from the set of faces and shells.
4223 theFacesAndShells List of faces and/or shells.
4224 theName Object name; when specified, this parameter is used
4225 for result publication in the study. Otherwise, if automatic
4226 publication is switched on, default value is used for result name.
4229 New GEOM.GEOM_Object, containing the created shell.
4231 # Example: see GEOM_TestAll.py
4232 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4233 RaiseIfFailed("MakeShell", self.ShapesOp)
4234 self._autoPublish(anObj, theName, "shell")
4237 ## Create a solid, bounded by the given shells.
4238 # @param theShells Sequence of bounding shells.
4239 # @param theName Object name; when specified, this parameter is used
4240 # for result publication in the study. Otherwise, if automatic
4241 # publication is switched on, default value is used for result name.
4243 # @return New GEOM.GEOM_Object, containing the created solid.
4245 # @ref tui_creation_solid "Example"
4246 def MakeSolid(self, theShells, theName=None):
4248 Create a solid, bounded by the given shells.
4251 theShells Sequence of bounding shells.
4252 theName Object name; when specified, this parameter is used
4253 for result publication in the study. Otherwise, if automatic
4254 publication is switched on, default value is used for result name.
4257 New GEOM.GEOM_Object, containing the created solid.
4259 # Example: see GEOM_TestAll.py
4260 if len(theShells) == 1:
4261 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4263 # raise RuntimeError, "MakeSolidShells : " + descr
4264 if descr == "WRN_SHAPE_UNCLOSED":
4265 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4266 anObj = self.ShapesOp.MakeSolidShells(theShells)
4267 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4268 self._autoPublish(anObj, theName, "solid")
4271 ## Create a compound of the given shapes.
4272 # @param theShapes List of shapes to put in compound.
4273 # @param theName Object name; when specified, this parameter is used
4274 # for result publication in the study. Otherwise, if automatic
4275 # publication is switched on, default value is used for result name.
4277 # @return New GEOM.GEOM_Object, containing the created compound.
4279 # @ref tui_creation_compound "Example"
4280 def MakeCompound(self, theShapes, theName=None):
4282 Create a compound of the given shapes.
4285 theShapes List of shapes to put in compound.
4286 theName Object name; when specified, this parameter is used
4287 for result publication in the study. Otherwise, if automatic
4288 publication is switched on, default value is used for result name.
4291 New GEOM.GEOM_Object, containing the created compound.
4293 # Example: see GEOM_TestAll.py
4294 anObj = self.ShapesOp.MakeCompound(theShapes)
4295 RaiseIfFailed("MakeCompound", self.ShapesOp)
4296 self._autoPublish(anObj, theName, "compound")
4299 # end of l3_advanced
4302 ## @addtogroup l2_measure
4305 ## Gives quantity of faces in the given shape.
4306 # @param theShape Shape to count faces of.
4307 # @return Quantity of faces.
4309 # @ref swig_NumberOf "Example"
4310 def NumberOfFaces(self, theShape):
4312 Gives quantity of faces in the given shape.
4315 theShape Shape to count faces of.
4320 # Example: see GEOM_TestOthers.py
4321 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4322 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4325 ## Gives quantity of edges in the given shape.
4326 # @param theShape Shape to count edges of.
4327 # @return Quantity of edges.
4329 # @ref swig_NumberOf "Example"
4330 def NumberOfEdges(self, theShape):
4332 Gives quantity of edges in the given shape.
4335 theShape Shape to count edges of.
4340 # Example: see GEOM_TestOthers.py
4341 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4342 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4345 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4346 # @param theShape Shape to count sub-shapes of.
4347 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4348 # @return Quantity of sub-shapes of given type.
4350 # @ref swig_NumberOf "Example"
4351 def NumberOfSubShapes(self, theShape, theShapeType):
4353 Gives quantity of sub-shapes of type theShapeType in the given shape.
4356 theShape Shape to count sub-shapes of.
4357 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4360 Quantity of sub-shapes of given type.
4362 # Example: see GEOM_TestOthers.py
4363 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4364 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4367 ## Gives quantity of solids in the given shape.
4368 # @param theShape Shape to count solids in.
4369 # @return Quantity of solids.
4371 # @ref swig_NumberOf "Example"
4372 def NumberOfSolids(self, theShape):
4374 Gives quantity of solids in the given shape.
4377 theShape Shape to count solids in.
4382 # Example: see GEOM_TestOthers.py
4383 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4384 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4390 ## @addtogroup l3_healing
4393 ## Reverses an orientation the given shape.
4394 # @param theShape Shape to be reversed.
4395 # @param theName Object name; when specified, this parameter is used
4396 # for result publication in the study. Otherwise, if automatic
4397 # publication is switched on, default value is used for result name.
4399 # @return The reversed copy of theShape.
4401 # @ref swig_ChangeOrientation "Example"
4402 def ChangeOrientation(self, theShape, theName=None):
4404 Reverses an orientation the given shape.
4407 theShape Shape to be reversed.
4408 theName Object name; when specified, this parameter is used
4409 for result publication in the study. Otherwise, if automatic
4410 publication is switched on, default value is used for result name.
4413 The reversed copy of theShape.
4415 # Example: see GEOM_TestAll.py
4416 anObj = self.ShapesOp.ChangeOrientation(theShape)
4417 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4418 self._autoPublish(anObj, theName, "reversed")
4421 ## See ChangeOrientation() method for details.
4423 # @ref swig_OrientationChange "Example"
4424 def OrientationChange(self, theShape, theName=None):
4426 See geompy.ChangeOrientation method for details.
4428 # Example: see GEOM_TestOthers.py
4429 # note: auto-publishing is done in self.ChangeOrientation()
4430 anObj = self.ChangeOrientation(theShape, theName)
4436 ## @addtogroup l4_obtain
4439 ## Retrieve all free faces from the given shape.
4440 # Free face is a face, which is not shared between two shells of the shape.
4441 # @param theShape Shape to find free faces in.
4442 # @return List of IDs of all free faces, contained in theShape.
4444 # @ref tui_measurement_tools_page "Example"
4445 def GetFreeFacesIDs(self,theShape):
4447 Retrieve all free faces from the given shape.
4448 Free face is a face, which is not shared between two shells of the shape.
4451 theShape Shape to find free faces in.
4454 List of IDs of all free faces, contained in theShape.
4456 # Example: see GEOM_TestOthers.py
4457 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4458 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4461 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4462 # @param theShape1 Shape to find sub-shapes in.
4463 # @param theShape2 Shape to find shared sub-shapes with.
4464 # @param theShapeType Type of sub-shapes to be retrieved.
4465 # @param theName Object name; when specified, this parameter is used
4466 # for result publication in the study. Otherwise, if automatic
4467 # publication is switched on, default value is used for result name.
4469 # @return List of sub-shapes of theShape1, shared with theShape2.
4471 # @ref swig_GetSharedShapes "Example"
4472 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4474 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4477 theShape1 Shape to find sub-shapes in.
4478 theShape2 Shape to find shared sub-shapes with.
4479 theShapeType Type of sub-shapes to be retrieved.
4480 theName Object name; when specified, this parameter is used
4481 for result publication in the study. Otherwise, if automatic
4482 publication is switched on, default value is used for result name.
4485 List of sub-shapes of theShape1, shared with theShape2.
4487 # Example: see GEOM_TestOthers.py
4488 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4489 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4490 self._autoPublish(aList, theName, "shared")
4493 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4494 # @param theShapes Shapes to find common sub-shapes of.
4495 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4496 # @param theName Object name; when specified, this parameter is used
4497 # for result publication in the study. Otherwise, if automatic
4498 # publication is switched on, default value is used for result name.
4500 # @return List of objects, that are sub-shapes of all given shapes.
4502 # @ref swig_GetSharedShapes "Example"
4503 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4505 Get all sub-shapes, shared by all shapes in the list theShapes.
4508 theShapes Shapes to find common sub-shapes of.
4509 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4510 theName Object name; when specified, this parameter is used
4511 for result publication in the study. Otherwise, if automatic
4512 publication is switched on, default value is used for result name.
4515 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4517 # Example: see GEOM_TestOthers.py
4518 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4519 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4520 self._autoPublish(aList, theName, "shared")
4523 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4524 # situated relatively the specified plane by the certain way,
4525 # defined through <VAR>theState</VAR> parameter.
4526 # @param theShape Shape to find sub-shapes of.
4527 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4528 # @param theAx1 Vector (or line, or linear edge), specifying normal
4529 # direction and location of the plane to find shapes on.
4530 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4531 # @param theName Object name; when specified, this parameter is used
4532 # for result publication in the study. Otherwise, if automatic
4533 # publication is switched on, default value is used for result name.
4535 # @return List of all found sub-shapes.
4537 # @ref swig_GetShapesOnPlane "Example"
4538 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4540 Find in theShape all sub-shapes of type theShapeType,
4541 situated relatively the specified plane by the certain way,
4542 defined through theState parameter.
4545 theShape Shape to find sub-shapes of.
4546 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4547 theAx1 Vector (or line, or linear edge), specifying normal
4548 direction and location of the plane to find shapes on.
4549 theState The state of the sub-shapes to find (see GEOM::shape_state)
4550 theName Object name; when specified, this parameter is used
4551 for result publication in the study. Otherwise, if automatic
4552 publication is switched on, default value is used for result name.
4555 List of all found sub-shapes.
4557 # Example: see GEOM_TestOthers.py
4558 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4559 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4560 self._autoPublish(aList, theName, "shapeOnPlane")
4563 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4564 # situated relatively the specified plane by the certain way,
4565 # defined through <VAR>theState</VAR> parameter.
4566 # @param theShape Shape to find sub-shapes of.
4567 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4568 # @param theAx1 Vector (or line, or linear edge), specifying normal
4569 # direction and location of the plane to find shapes on.
4570 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4572 # @return List of all found sub-shapes indices.
4574 # @ref swig_GetShapesOnPlaneIDs "Example"
4575 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4577 Find in theShape all sub-shapes of type theShapeType,
4578 situated relatively the specified plane by the certain way,
4579 defined through theState parameter.
4582 theShape Shape to find sub-shapes of.
4583 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4584 theAx1 Vector (or line, or linear edge), specifying normal
4585 direction and location of the plane to find shapes on.
4586 theState The state of the sub-shapes to find (see GEOM::shape_state)
4589 List of all found sub-shapes indices.
4591 # Example: see GEOM_TestOthers.py
4592 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4593 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4596 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4597 # situated relatively the specified plane by the certain way,
4598 # defined through <VAR>theState</VAR> parameter.
4599 # @param theShape Shape to find sub-shapes of.
4600 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4601 # @param theAx1 Vector (or line, or linear edge), specifying normal
4602 # direction of the plane to find shapes on.
4603 # @param thePnt Point specifying location of the plane to find shapes on.
4604 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4605 # @param theName Object name; when specified, this parameter is used
4606 # for result publication in the study. Otherwise, if automatic
4607 # publication is switched on, default value is used for result name.
4609 # @return List of all found sub-shapes.
4611 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4612 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4614 Find in theShape all sub-shapes of type theShapeType,
4615 situated relatively the specified plane by the certain way,
4616 defined through theState parameter.
4619 theShape Shape to find sub-shapes of.
4620 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4621 theAx1 Vector (or line, or linear edge), specifying normal
4622 direction and location of the plane to find shapes on.
4623 thePnt Point specifying location of the plane to find shapes on.
4624 theState The state of the sub-shapes to find (see GEOM::shape_state)
4625 theName Object name; when specified, this parameter is used
4626 for result publication in the study. Otherwise, if automatic
4627 publication is switched on, default value is used for result name.
4630 List of all found sub-shapes.
4632 # Example: see GEOM_TestOthers.py
4633 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4634 theAx1, thePnt, theState)
4635 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4636 self._autoPublish(aList, theName, "shapeOnPlane")
4639 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4640 # situated relatively the specified plane by the certain way,
4641 # defined through <VAR>theState</VAR> parameter.
4642 # @param theShape Shape to find sub-shapes of.
4643 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4644 # @param theAx1 Vector (or line, or linear edge), specifying normal
4645 # direction of the plane to find shapes on.
4646 # @param thePnt Point specifying location of the plane to find shapes on.
4647 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4649 # @return List of all found sub-shapes indices.
4651 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4652 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4654 Find in theShape all sub-shapes of type theShapeType,
4655 situated relatively the specified plane by the certain way,
4656 defined through theState parameter.
4659 theShape Shape to find sub-shapes of.
4660 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4661 theAx1 Vector (or line, or linear edge), specifying normal
4662 direction and location of the plane to find shapes on.
4663 thePnt Point specifying location of the plane to find shapes on.
4664 theState The state of the sub-shapes to find (see GEOM::shape_state)
4667 List of all found sub-shapes indices.
4669 # Example: see GEOM_TestOthers.py
4670 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4671 theAx1, thePnt, theState)
4672 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4675 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4676 # the specified cylinder by the certain way, defined through \a theState parameter.
4677 # @param theShape Shape to find sub-shapes of.
4678 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4679 # @param theAxis Vector (or line, or linear edge), specifying
4680 # axis of the cylinder to find shapes on.
4681 # @param theRadius Radius of the cylinder to find shapes on.
4682 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4683 # @param theName Object name; when specified, this parameter is used
4684 # for result publication in the study. Otherwise, if automatic
4685 # publication is switched on, default value is used for result name.
4687 # @return List of all found sub-shapes.
4689 # @ref swig_GetShapesOnCylinder "Example"
4690 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4692 Find in theShape all sub-shapes of type theShapeType, situated relatively
4693 the specified cylinder by the certain way, defined through theState parameter.
4696 theShape Shape to find sub-shapes of.
4697 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4698 theAxis Vector (or line, or linear edge), specifying
4699 axis of the cylinder to find shapes on.
4700 theRadius Radius of the cylinder to find shapes on.
4701 theState The state of the sub-shapes to find (see GEOM::shape_state)
4702 theName Object name; when specified, this parameter is used
4703 for result publication in the study. Otherwise, if automatic
4704 publication is switched on, default value is used for result name.
4707 List of all found sub-shapes.
4709 # Example: see GEOM_TestOthers.py
4710 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4711 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4712 self._autoPublish(aList, theName, "shapeOnCylinder")
4715 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4716 # the specified cylinder by the certain way, defined through \a theState parameter.
4717 # @param theShape Shape to find sub-shapes of.
4718 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4719 # @param theAxis Vector (or line, or linear edge), specifying
4720 # axis of the cylinder to find shapes on.
4721 # @param theRadius Radius of the cylinder to find shapes on.
4722 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4724 # @return List of all found sub-shapes indices.
4726 # @ref swig_GetShapesOnCylinderIDs "Example"
4727 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4729 Find in theShape all sub-shapes of type theShapeType, situated relatively
4730 the specified cylinder by the certain way, defined through theState parameter.
4733 theShape Shape to find sub-shapes of.
4734 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4735 theAxis Vector (or line, or linear edge), specifying
4736 axis of the cylinder to find shapes on.
4737 theRadius Radius of the cylinder to find shapes on.
4738 theState The state of the sub-shapes to find (see GEOM::shape_state)
4741 List of all found sub-shapes indices.
4743 # Example: see GEOM_TestOthers.py
4744 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4745 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4748 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4749 # the specified cylinder by the certain way, defined through \a theState parameter.
4750 # @param theShape Shape to find sub-shapes of.
4751 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4752 # @param theAxis Vector (or line, or linear edge), specifying
4753 # axis of the cylinder to find shapes on.
4754 # @param thePnt Point specifying location of the bottom of the cylinder.
4755 # @param theRadius Radius of the cylinder to find shapes on.
4756 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4757 # @param theName Object name; when specified, this parameter is used
4758 # for result publication in the study. Otherwise, if automatic
4759 # publication is switched on, default value is used for result name.
4761 # @return List of all found sub-shapes.
4763 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4764 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4766 Find in theShape all sub-shapes of type theShapeType, situated relatively
4767 the specified cylinder by the certain way, defined through theState parameter.
4770 theShape Shape to find sub-shapes of.
4771 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4772 theAxis Vector (or line, or linear edge), specifying
4773 axis of the cylinder to find shapes on.
4774 theRadius Radius of the cylinder to find shapes on.
4775 theState The state of the sub-shapes to find (see GEOM::shape_state)
4776 theName Object name; when specified, this parameter is used
4777 for result publication in the study. Otherwise, if automatic
4778 publication is switched on, default value is used for result name.
4781 List of all found sub-shapes.
4783 # Example: see GEOM_TestOthers.py
4784 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4785 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4786 self._autoPublish(aList, theName, "shapeOnCylinder")
4789 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4790 # the specified cylinder by the certain way, defined through \a theState parameter.
4791 # @param theShape Shape to find sub-shapes of.
4792 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4793 # @param theAxis Vector (or line, or linear edge), specifying
4794 # axis of the cylinder to find shapes on.
4795 # @param thePnt Point specifying location of the bottom of the cylinder.
4796 # @param theRadius Radius of the cylinder to find shapes on.
4797 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4799 # @return List of all found sub-shapes indices
4801 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4802 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4804 Find in theShape all sub-shapes of type theShapeType, situated relatively
4805 the specified cylinder by the certain way, defined through theState parameter.
4808 theShape Shape to find sub-shapes of.
4809 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4810 theAxis Vector (or line, or linear edge), specifying
4811 axis of the cylinder to find shapes on.
4812 theRadius Radius of the cylinder to find shapes on.
4813 theState The state of the sub-shapes to find (see GEOM::shape_state)
4816 List of all found sub-shapes indices.
4818 # Example: see GEOM_TestOthers.py
4819 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4820 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4823 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4824 # the specified sphere by the certain way, defined through \a theState parameter.
4825 # @param theShape Shape to find sub-shapes of.
4826 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4827 # @param theCenter Point, specifying center of the sphere to find shapes on.
4828 # @param theRadius Radius of the sphere to find shapes on.
4829 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4830 # @param theName Object name; when specified, this parameter is used
4831 # for result publication in the study. Otherwise, if automatic
4832 # publication is switched on, default value is used for result name.
4834 # @return List of all found sub-shapes.
4836 # @ref swig_GetShapesOnSphere "Example"
4837 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4839 Find in theShape all sub-shapes of type theShapeType, situated relatively
4840 the specified sphere by the certain way, defined through theState parameter.
4843 theShape Shape to find sub-shapes of.
4844 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4845 theCenter Point, specifying center of the sphere to find shapes on.
4846 theRadius Radius of the sphere to find shapes on.
4847 theState The state of the sub-shapes to find (see GEOM::shape_state)
4848 theName Object name; when specified, this parameter is used
4849 for result publication in the study. Otherwise, if automatic
4850 publication is switched on, default value is used for result name.
4853 List of all found sub-shapes.
4855 # Example: see GEOM_TestOthers.py
4856 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4857 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4858 self._autoPublish(aList, theName, "shapeOnSphere")
4861 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4862 # the specified sphere by the certain way, defined through \a theState parameter.
4863 # @param theShape Shape to find sub-shapes of.
4864 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4865 # @param theCenter Point, specifying center of the sphere to find shapes on.
4866 # @param theRadius Radius of the sphere to find shapes on.
4867 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4869 # @return List of all found sub-shapes indices.
4871 # @ref swig_GetShapesOnSphereIDs "Example"
4872 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4874 Find in theShape all sub-shapes of type theShapeType, situated relatively
4875 the specified sphere by the certain way, defined through theState parameter.
4878 theShape Shape to find sub-shapes of.
4879 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4880 theCenter Point, specifying center of the sphere to find shapes on.
4881 theRadius Radius of the sphere to find shapes on.
4882 theState The state of the sub-shapes to find (see GEOM::shape_state)
4885 List of all found sub-shapes indices.
4887 # Example: see GEOM_TestOthers.py
4888 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4889 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4892 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4893 # the specified quadrangle by the certain way, defined through \a theState parameter.
4894 # @param theShape Shape to find sub-shapes of.
4895 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4896 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4897 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4898 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4899 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4900 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4901 # @param theName Object name; when specified, this parameter is used
4902 # for result publication in the study. Otherwise, if automatic
4903 # publication is switched on, default value is used for result name.
4905 # @return List of all found sub-shapes.
4907 # @ref swig_GetShapesOnQuadrangle "Example"
4908 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4909 theTopLeftPoint, theTopRigthPoint,
4910 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4912 Find in theShape all sub-shapes of type theShapeType, situated relatively
4913 the specified quadrangle by the certain way, defined through theState parameter.
4916 theShape Shape to find sub-shapes of.
4917 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4918 theTopLeftPoint Point, specifying top left corner of a quadrangle
4919 theTopRigthPoint Point, specifying top right corner of a quadrangle
4920 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4921 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4922 theState The state of the sub-shapes to find (see GEOM::shape_state)
4923 theName Object name; when specified, this parameter is used
4924 for result publication in the study. Otherwise, if automatic
4925 publication is switched on, default value is used for result name.
4928 List of all found sub-shapes.
4930 # Example: see GEOM_TestOthers.py
4931 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4932 theTopLeftPoint, theTopRigthPoint,
4933 theBottomLeftPoint, theBottomRigthPoint, theState)
4934 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4935 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4938 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4939 # the specified quadrangle by the certain way, defined through \a theState parameter.
4940 # @param theShape Shape to find sub-shapes of.
4941 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4942 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4943 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4944 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4945 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4946 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4948 # @return List of all found sub-shapes indices.
4950 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4951 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4952 theTopLeftPoint, theTopRigthPoint,
4953 theBottomLeftPoint, theBottomRigthPoint, theState):
4955 Find in theShape all sub-shapes of type theShapeType, situated relatively
4956 the specified quadrangle by the certain way, defined through theState parameter.
4959 theShape Shape to find sub-shapes of.
4960 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4961 theTopLeftPoint Point, specifying top left corner of a quadrangle
4962 theTopRigthPoint Point, specifying top right corner of a quadrangle
4963 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4964 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4965 theState The state of the sub-shapes to find (see GEOM::shape_state)
4968 List of all found sub-shapes indices.
4971 # Example: see GEOM_TestOthers.py
4972 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4973 theTopLeftPoint, theTopRigthPoint,
4974 theBottomLeftPoint, theBottomRigthPoint, theState)
4975 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4978 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4979 # the specified \a theBox by the certain way, defined through \a theState parameter.
4980 # @param theBox Shape for relative comparing.
4981 # @param theShape Shape to find sub-shapes of.
4982 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4983 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4984 # @param theName Object name; when specified, this parameter is used
4985 # for result publication in the study. Otherwise, if automatic
4986 # publication is switched on, default value is used for result name.
4988 # @return List of all found sub-shapes.
4990 # @ref swig_GetShapesOnBox "Example"
4991 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4993 Find in theShape all sub-shapes of type theShapeType, situated relatively
4994 the specified theBox by the certain way, defined through theState parameter.
4997 theBox Shape for relative comparing.
4998 theShape Shape to find sub-shapes of.
4999 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5000 theState The state of the sub-shapes to find (see GEOM::shape_state)
5001 theName Object name; when specified, this parameter is used
5002 for result publication in the study. Otherwise, if automatic
5003 publication is switched on, default value is used for result name.
5006 List of all found sub-shapes.
5008 # Example: see GEOM_TestOthers.py
5009 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5010 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5011 self._autoPublish(aList, theName, "shapeOnBox")
5014 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5015 # the specified \a theBox by the certain way, defined through \a theState parameter.
5016 # @param theBox Shape for relative comparing.
5017 # @param theShape Shape to find sub-shapes of.
5018 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5019 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5021 # @return List of all found sub-shapes indices.
5023 # @ref swig_GetShapesOnBoxIDs "Example"
5024 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5026 Find in theShape all sub-shapes of type theShapeType, situated relatively
5027 the specified theBox by the certain way, defined through theState parameter.
5030 theBox Shape for relative comparing.
5031 theShape Shape to find sub-shapes of.
5032 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5033 theState The state of the sub-shapes to find (see GEOM::shape_state)
5036 List of all found sub-shapes indices.
5038 # Example: see GEOM_TestOthers.py
5039 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5040 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5043 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5044 # situated relatively the specified \a theCheckShape by the
5045 # certain way, defined through \a theState parameter.
5046 # @param theCheckShape Shape for relative comparing. It must be a solid.
5047 # @param theShape Shape to find sub-shapes of.
5048 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5049 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5050 # @param theName Object name; when specified, this parameter is used
5051 # for result publication in the study. Otherwise, if automatic
5052 # publication is switched on, default value is used for result name.
5054 # @return List of all found sub-shapes.
5056 # @ref swig_GetShapesOnShape "Example"
5057 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5059 Find in theShape all sub-shapes of type theShapeType,
5060 situated relatively the specified theCheckShape by the
5061 certain way, defined through theState parameter.
5064 theCheckShape Shape for relative comparing. It must be a solid.
5065 theShape Shape to find sub-shapes of.
5066 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5067 theState The state of the sub-shapes to find (see GEOM::shape_state)
5068 theName Object name; when specified, this parameter is used
5069 for result publication in the study. Otherwise, if automatic
5070 publication is switched on, default value is used for result name.
5073 List of all found sub-shapes.
5075 # Example: see GEOM_TestOthers.py
5076 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5077 theShapeType, theState)
5078 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5079 self._autoPublish(aList, theName, "shapeOnShape")
5082 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5083 # situated relatively the specified \a theCheckShape by the
5084 # certain way, defined through \a theState parameter.
5085 # @param theCheckShape Shape for relative comparing. It must be a solid.
5086 # @param theShape Shape to find sub-shapes of.
5087 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5088 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5089 # @param theName Object name; when specified, this parameter is used
5090 # for result publication in the study. Otherwise, if automatic
5091 # publication is switched on, default value is used for result name.
5093 # @return All found sub-shapes as compound.
5095 # @ref swig_GetShapesOnShapeAsCompound "Example"
5096 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5098 Find in theShape all sub-shapes of type theShapeType,
5099 situated relatively the specified theCheckShape by the
5100 certain way, defined through theState parameter.
5103 theCheckShape Shape for relative comparing. It must be a solid.
5104 theShape Shape to find sub-shapes of.
5105 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5106 theState The state of the sub-shapes to find (see GEOM::shape_state)
5107 theName Object name; when specified, this parameter is used
5108 for result publication in the study. Otherwise, if automatic
5109 publication is switched on, default value is used for result name.
5112 All found sub-shapes as compound.
5114 # Example: see GEOM_TestOthers.py
5115 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5116 theShapeType, theState)
5117 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5118 self._autoPublish(anObj, theName, "shapeOnShape")
5121 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5122 # situated relatively the specified \a theCheckShape by the
5123 # certain way, defined through \a theState parameter.
5124 # @param theCheckShape Shape for relative comparing. It must be a solid.
5125 # @param theShape Shape to find sub-shapes of.
5126 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5127 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5129 # @return List of all found sub-shapes indices.
5131 # @ref swig_GetShapesOnShapeIDs "Example"
5132 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5134 Find in theShape all sub-shapes of type theShapeType,
5135 situated relatively the specified theCheckShape by the
5136 certain way, defined through theState parameter.
5139 theCheckShape Shape for relative comparing. It must be a solid.
5140 theShape Shape to find sub-shapes of.
5141 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5142 theState The state of the sub-shapes to find (see GEOM::shape_state)
5145 List of all found sub-shapes indices.
5147 # Example: see GEOM_TestOthers.py
5148 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5149 theShapeType, theState)
5150 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5153 ## Get sub-shape(s) of theShapeWhere, which are
5154 # coincident with \a theShapeWhat or could be a part of it.
5155 # @param theShapeWhere Shape to find sub-shapes of.
5156 # @param theShapeWhat Shape, specifying what to find.
5157 # @param isNewImplementation implementation of GetInPlace functionality
5158 # (default = False, old alghorithm based on shape properties)
5159 # @param theName Object name; when specified, this parameter is used
5160 # for result publication in the study. Otherwise, if automatic
5161 # publication is switched on, default value is used for result name.
5163 # @return Group of all found sub-shapes or a single found sub-shape.
5165 # @note This function has a restriction on argument shapes.
5166 # If \a theShapeWhere has curved parts with significantly
5167 # outstanding centres (i.e. the mass centre of a part is closer to
5168 # \a theShapeWhat than to the part), such parts will not be found.
5169 # @image html get_in_place_lost_part.png
5171 # @ref swig_GetInPlace "Example"
5172 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5174 Get sub-shape(s) of theShapeWhere, which are
5175 coincident with theShapeWhat or could be a part of it.
5178 theShapeWhere Shape to find sub-shapes of.
5179 theShapeWhat Shape, specifying what to find.
5180 isNewImplementation Implementation of GetInPlace functionality
5181 (default = False, old alghorithm based on shape properties)
5182 theName Object name; when specified, this parameter is used
5183 for result publication in the study. Otherwise, if automatic
5184 publication is switched on, default value is used for result name.
5187 Group of all found sub-shapes or a single found sub-shape.
5191 This function has a restriction on argument shapes.
5192 If theShapeWhere has curved parts with significantly
5193 outstanding centres (i.e. the mass centre of a part is closer to
5194 theShapeWhat than to the part), such parts will not be found.
5196 # Example: see GEOM_TestOthers.py
5198 if isNewImplementation:
5199 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5201 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5203 RaiseIfFailed("GetInPlace", self.ShapesOp)
5204 self._autoPublish(anObj, theName, "inplace")
5207 ## Get sub-shape(s) of \a theShapeWhere, which are
5208 # coincident with \a theShapeWhat or could be a part of it.
5210 # Implementation of this method is based on a saved history of an operation,
5211 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5212 # arguments (an argument shape or a sub-shape of an argument shape).
5213 # The operation could be the Partition or one of boolean operations,
5214 # performed on simple shapes (not on compounds).
5216 # @param theShapeWhere Shape to find sub-shapes of.
5217 # @param theShapeWhat Shape, specifying what to find (must be in the
5218 # building history of the ShapeWhere).
5219 # @param theName Object name; when specified, this parameter is used
5220 # for result publication in the study. Otherwise, if automatic
5221 # publication is switched on, default value is used for result name.
5223 # @return Group of all found sub-shapes or a single found sub-shape.
5225 # @ref swig_GetInPlace "Example"
5226 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5228 Implementation of this method is based on a saved history of an operation,
5229 produced theShapeWhere. The theShapeWhat must be among this operation's
5230 arguments (an argument shape or a sub-shape of an argument shape).
5231 The operation could be the Partition or one of boolean operations,
5232 performed on simple shapes (not on compounds).
5235 theShapeWhere Shape to find sub-shapes of.
5236 theShapeWhat Shape, specifying what to find (must be in the
5237 building history of the ShapeWhere).
5238 theName Object name; when specified, this parameter is used
5239 for result publication in the study. Otherwise, if automatic
5240 publication is switched on, default value is used for result name.
5243 Group of all found sub-shapes or a single found sub-shape.
5245 # Example: see GEOM_TestOthers.py
5246 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5247 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5248 self._autoPublish(anObj, theName, "inplace")
5251 ## Get sub-shape of theShapeWhere, which is
5252 # equal to \a theShapeWhat.
5253 # @param theShapeWhere Shape to find sub-shape of.
5254 # @param theShapeWhat Shape, specifying what to find.
5255 # @param theName Object name; when specified, this parameter is used
5256 # for result publication in the study. Otherwise, if automatic
5257 # publication is switched on, default value is used for result name.
5259 # @return New GEOM.GEOM_Object for found sub-shape.
5261 # @ref swig_GetSame "Example"
5262 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5264 Get sub-shape of theShapeWhere, which is
5265 equal to theShapeWhat.
5268 theShapeWhere Shape to find sub-shape of.
5269 theShapeWhat Shape, specifying what to find.
5270 theName Object name; when specified, this parameter is used
5271 for result publication in the study. Otherwise, if automatic
5272 publication is switched on, default value is used for result name.
5275 New GEOM.GEOM_Object for found sub-shape.
5277 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5278 RaiseIfFailed("GetSame", self.ShapesOp)
5279 self._autoPublish(anObj, theName, "sameShape")
5283 ## Get sub-shape indices of theShapeWhere, which is
5284 # equal to \a theShapeWhat.
5285 # @param theShapeWhere Shape to find sub-shape of.
5286 # @param theShapeWhat Shape, specifying what to find.
5287 # @return List of all found sub-shapes indices.
5289 # @ref swig_GetSame "Example"
5290 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5292 Get sub-shape indices of theShapeWhere, which is
5293 equal to theShapeWhat.
5296 theShapeWhere Shape to find sub-shape of.
5297 theShapeWhat Shape, specifying what to find.
5300 List of all found sub-shapes indices.
5302 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5303 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5310 ## @addtogroup l4_access
5313 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5314 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5315 # @param aShape Shape to get sub-shape of.
5316 # @param ListOfID List of sub-shapes indices.
5317 # @param theName Object name; when specified, this parameter is used
5318 # for result publication in the study. Otherwise, if automatic
5319 # publication is switched on, default value is used for result name.
5321 # @return Found sub-shape.
5323 # @ref swig_all_decompose "Example"
5324 def GetSubShape(self, aShape, ListOfID, theName=None):
5326 Obtain a composite sub-shape of aShape, composed from sub-shapes
5327 of aShape, selected by their unique IDs inside aShape
5330 aShape Shape to get sub-shape of.
5331 ListOfID List of sub-shapes indices.
5332 theName Object name; when specified, this parameter is used
5333 for result publication in the study. Otherwise, if automatic
5334 publication is switched on, default value is used for result name.
5339 # Example: see GEOM_TestAll.py
5340 anObj = self.AddSubShape(aShape,ListOfID)
5341 self._autoPublish(anObj, theName, "subshape")
5344 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5345 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5346 # @param aShape Shape to get sub-shape of.
5347 # @param aSubShape Sub-shapes of aShape.
5348 # @return ID of found sub-shape.
5350 # @ref swig_all_decompose "Example"
5351 def GetSubShapeID(self, aShape, aSubShape):
5353 Obtain unique ID of sub-shape aSubShape inside aShape
5354 of aShape, selected by their unique IDs inside aShape
5357 aShape Shape to get sub-shape of.
5358 aSubShape Sub-shapes of aShape.
5361 ID of found sub-shape.
5363 # Example: see GEOM_TestAll.py
5364 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5365 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5368 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5369 # This function is provided for performance purpose. The complexity is O(n) with n
5370 # the number of subobjects of aShape
5371 # @param aShape Shape to get sub-shape of.
5372 # @param aSubShapes Sub-shapes of aShape.
5373 # @return list of IDs of found sub-shapes.
5375 # @ref swig_all_decompose "Example"
5376 def GetSubShapesIDs(self, aShape, aSubShapes):
5378 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5379 This function is provided for performance purpose. The complexity is O(n) with n
5380 the number of subobjects of aShape
5383 aShape Shape to get sub-shape of.
5384 aSubShapes Sub-shapes of aShape.
5387 List of IDs of found sub-shape.
5389 # Example: see GEOM_TestAll.py
5390 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5391 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5397 ## @addtogroup l4_decompose
5400 ## Get all sub-shapes and groups of \a theShape,
5401 # that were created already by any other methods.
5402 # @param theShape Any shape.
5403 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5404 # returned, else all found sub-shapes and groups.
5405 # @return List of existing sub-objects of \a theShape.
5407 # @ref swig_all_decompose "Example"
5408 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5410 Get all sub-shapes and groups of theShape,
5411 that were created already by any other methods.
5415 theGroupsOnly If this parameter is TRUE, only groups will be
5416 returned, else all found sub-shapes and groups.
5419 List of existing sub-objects of theShape.
5421 # Example: see GEOM_TestAll.py
5422 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5423 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5426 ## Get all groups of \a theShape,
5427 # that were created already by any other methods.
5428 # @param theShape Any shape.
5429 # @return List of existing groups of \a theShape.
5431 # @ref swig_all_decompose "Example"
5432 def GetGroups(self, theShape):
5434 Get all groups of theShape,
5435 that were created already by any other methods.
5441 List of existing groups of theShape.
5443 # Example: see GEOM_TestAll.py
5444 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5445 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5448 ## Explode a shape on sub-shapes of a given type.
5449 # If the shape itself matches the type, it is also returned.
5450 # @param aShape Shape to be exploded.
5451 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5452 # @param theName Object name; when specified, this parameter is used
5453 # for result publication in the study. Otherwise, if automatic
5454 # publication is switched on, default value is used for result name.
5456 # @return List of sub-shapes of type theShapeType, contained in theShape.
5458 # @ref swig_all_decompose "Example"
5459 def SubShapeAll(self, aShape, aType, theName=None):
5461 Explode a shape on sub-shapes of a given type.
5462 If the shape itself matches the type, it is also returned.
5465 aShape Shape to be exploded.
5466 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5467 theName Object name; when specified, this parameter is used
5468 for result publication in the study. Otherwise, if automatic
5469 publication is switched on, default value is used for result name.
5472 List of sub-shapes of type theShapeType, contained in theShape.
5474 # Example: see GEOM_TestAll.py
5475 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5476 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5477 self._autoPublish(ListObj, theName, "subshape")
5480 ## Explode a shape on sub-shapes of a given type.
5481 # @param aShape Shape to be exploded.
5482 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5483 # @return List of IDs of sub-shapes.
5485 # @ref swig_all_decompose "Example"
5486 def SubShapeAllIDs(self, aShape, aType):
5488 Explode a shape on sub-shapes of a given type.
5491 aShape Shape to be exploded (see geompy.ShapeType)
5492 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5495 List of IDs of sub-shapes.
5497 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5498 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5501 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5502 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5503 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5504 # @param aShape Shape to get sub-shape of.
5505 # @param ListOfInd List of sub-shapes indices.
5506 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5507 # @param theName Object name; when specified, this parameter is used
5508 # for result publication in the study. Otherwise, if automatic
5509 # publication is switched on, default value is used for result name.
5511 # @return A compound of sub-shapes of aShape.
5513 # @ref swig_all_decompose "Example"
5514 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5516 Obtain a compound of sub-shapes of aShape,
5517 selected by their indices in list of all sub-shapes of type aType.
5518 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5521 aShape Shape to get sub-shape of.
5522 ListOfID List of sub-shapes indices.
5523 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5524 theName Object name; when specified, this parameter is used
5525 for result publication in the study. Otherwise, if automatic
5526 publication is switched on, default value is used for result name.
5529 A compound of sub-shapes of aShape.
5531 # Example: see GEOM_TestAll.py
5533 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5534 for ind in ListOfInd:
5535 ListOfIDs.append(AllShapeIDsList[ind - 1])
5536 # note: auto-publishing is done in self.GetSubShape()
5537 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5540 ## Explode a shape on sub-shapes of a given type.
5541 # Sub-shapes will be sorted by coordinates of their gravity centers.
5542 # If the shape itself matches the type, it is also returned.
5543 # @param aShape Shape to be exploded.
5544 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5545 # @param theName Object name; when specified, this parameter is used
5546 # for result publication in the study. Otherwise, if automatic
5547 # publication is switched on, default value is used for result name.
5549 # @return List of sub-shapes of type theShapeType, contained in theShape.
5551 # @ref swig_SubShapeAllSorted "Example"
5552 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5554 Explode a shape on sub-shapes of a given type.
5555 Sub-shapes will be sorted by coordinates of their gravity centers.
5556 If the shape itself matches the type, it is also returned.
5559 aShape Shape to be exploded.
5560 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5561 theName Object name; when specified, this parameter is used
5562 for result publication in the study. Otherwise, if automatic
5563 publication is switched on, default value is used for result name.
5566 List of sub-shapes of type theShapeType, contained in theShape.
5568 # Example: see GEOM_TestAll.py
5569 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5570 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5571 self._autoPublish(ListObj, theName, "subshape")
5574 ## Explode a shape on sub-shapes of a given type.
5575 # Sub-shapes will be sorted by coordinates of their gravity centers.
5576 # @param aShape Shape to be exploded.
5577 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5578 # @return List of IDs of sub-shapes.
5580 # @ref swig_all_decompose "Example"
5581 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5583 Explode a shape on sub-shapes of a given type.
5584 Sub-shapes will be sorted by coordinates of their gravity centers.
5587 aShape Shape to be exploded.
5588 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5591 List of IDs of sub-shapes.
5593 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5594 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5597 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5598 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5599 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5600 # @param aShape Shape to get sub-shape of.
5601 # @param ListOfInd List of sub-shapes indices.
5602 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5603 # @param theName Object name; when specified, this parameter is used
5604 # for result publication in the study. Otherwise, if automatic
5605 # publication is switched on, default value is used for result name.
5607 # @return A compound of sub-shapes of aShape.
5609 # @ref swig_all_decompose "Example"
5610 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5612 Obtain a compound of sub-shapes of aShape,
5613 selected by they indices in sorted list of all sub-shapes of type aType.
5614 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5617 aShape Shape to get sub-shape of.
5618 ListOfID List of sub-shapes indices.
5619 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5620 theName Object name; when specified, this parameter is used
5621 for result publication in the study. Otherwise, if automatic
5622 publication is switched on, default value is used for result name.
5625 A compound of sub-shapes of aShape.
5627 # Example: see GEOM_TestAll.py
5629 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5630 for ind in ListOfInd:
5631 ListOfIDs.append(AllShapeIDsList[ind - 1])
5632 # note: auto-publishing is done in self.GetSubShape()
5633 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5636 ## Extract shapes (excluding the main shape) of given type.
5637 # @param aShape The shape.
5638 # @param aType The shape type (see ShapeType())
5639 # @param isSorted Boolean flag to switch sorting on/off.
5640 # @param theName Object name; when specified, this parameter is used
5641 # for result publication in the study. Otherwise, if automatic
5642 # publication is switched on, default value is used for result name.
5644 # @return List of sub-shapes of type aType, contained in aShape.
5646 # @ref swig_FilletChamfer "Example"
5647 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5649 Extract shapes (excluding the main shape) of given type.
5653 aType The shape type (see geompy.ShapeType)
5654 isSorted Boolean flag to switch sorting on/off.
5655 theName Object name; when specified, this parameter is used
5656 for result publication in the study. Otherwise, if automatic
5657 publication is switched on, default value is used for result name.
5660 List of sub-shapes of type aType, contained in aShape.
5662 # Example: see GEOM_TestAll.py
5663 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5664 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5665 self._autoPublish(ListObj, theName, "subshape")
5668 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5669 # @param aShape Main shape.
5670 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5671 # @param theName Object name; when specified, this parameter is used
5672 # for result publication in the study. Otherwise, if automatic
5673 # publication is switched on, default value is used for result name.
5674 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5676 # @ref swig_all_decompose "Example"
5677 def SubShapes(self, aShape, anIDs, theName=None):
5679 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5683 anIDs List of unique IDs of sub-shapes inside theMainShape.
5684 theName Object name; when specified, this parameter is used
5685 for result publication in the study. Otherwise, if automatic
5686 publication is switched on, default value is used for result name.
5689 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5691 # Example: see GEOM_TestAll.py
5692 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5693 RaiseIfFailed("SubShapes", self.ShapesOp)
5694 self._autoPublish(ListObj, theName, "subshape")
5697 # end of l4_decompose
5700 ## @addtogroup l4_decompose_d
5703 ## Deprecated method
5704 # It works like SubShapeAllSortedCentres(), but wrongly
5705 # defines centres of faces, shells and solids.
5706 def SubShapeAllSorted(self, aShape, aType, theName=None):
5709 It works like geompy.SubShapeAllSortedCentres, but wrongly
5710 defines centres of faces, shells and solids.
5712 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5713 RaiseIfFailed("MakeExplode", self.ShapesOp)
5714 self._autoPublish(ListObj, theName, "subshape")
5717 ## Deprecated method
5718 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5719 # defines centres of faces, shells and solids.
5720 def SubShapeAllSortedIDs(self, aShape, aType):
5723 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5724 defines centres of faces, shells and solids.
5726 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5727 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5730 ## Deprecated method
5731 # It works like SubShapeSortedCentres(), but has a bug
5732 # (wrongly defines centres of faces, shells and solids).
5733 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5736 It works like geompy.SubShapeSortedCentres, but has a bug
5737 (wrongly defines centres of faces, shells and solids).
5740 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5741 for ind in ListOfInd:
5742 ListOfIDs.append(AllShapeIDsList[ind - 1])
5743 # note: auto-publishing is done in self.GetSubShape()
5744 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5747 # end of l4_decompose_d
5750 ## @addtogroup l3_healing
5753 ## Apply a sequence of Shape Healing operators to the given object.
5754 # @param theShape Shape to be processed.
5755 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5756 # @param theParameters List of names of parameters
5757 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5758 # @param theValues List of values of parameters, in the same order
5759 # as parameters are listed in <VAR>theParameters</VAR> list.
5760 # @param theName Object name; when specified, this parameter is used
5761 # for result publication in the study. Otherwise, if automatic
5762 # publication is switched on, default value is used for result name.
5764 # <b> Operators and Parameters: </b> \n
5766 # * \b FixShape - corrects invalid shapes. \n
5767 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5768 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5770 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5771 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5772 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5773 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5775 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5776 # surfaces in segments using a certain angle. \n
5777 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5778 # if Angle=180, four if Angle=90, etc). \n
5779 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5781 # * \b SplitClosedFaces - splits closed faces in segments.
5782 # The number of segments depends on the number of splitting points.\n
5783 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5785 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5786 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5787 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5788 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5789 # This and the previous parameters can take the following values:\n
5790 # \b Parametric \b Continuity \n
5791 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5792 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5793 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5794 # ruling out sharp edges).\n
5795 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5796 # are of the same magnitude).\n
5797 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5798 # or surfaces (d/du C(u)) are the same at junction. \n
5799 # \b Geometric \b Continuity \n
5800 # \b G1: first derivatives are proportional at junction.\n
5801 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5802 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5803 # \b G2: first and second derivatives are proportional at junction.
5804 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5805 # continuity requires that the underlying parameterization was continuous as well.
5806 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5808 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5809 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5810 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5811 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5812 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5813 # with the specified parameters.\n
5814 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5815 # with the specified parameters.\n
5816 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5817 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5818 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5819 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5821 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5822 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5823 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5824 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5825 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5827 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5828 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5831 # @return New GEOM.GEOM_Object, containing processed shape.
5833 # \n @ref tui_shape_processing "Example"
5834 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5836 Apply a sequence of Shape Healing operators to the given object.
5839 theShape Shape to be processed.
5840 theValues List of values of parameters, in the same order
5841 as parameters are listed in theParameters list.
5842 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5843 theParameters List of names of parameters
5844 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5845 theName Object name; when specified, this parameter is used
5846 for result publication in the study. Otherwise, if automatic
5847 publication is switched on, default value is used for result name.
5849 Operators and Parameters:
5851 * FixShape - corrects invalid shapes.
5852 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5853 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5854 * FixFaceSize - removes small faces, such as spots and strips.
5855 * FixFaceSize.Tolerance - defines minimum possible face size.
5856 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5857 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5858 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5859 in segments using a certain angle.
5860 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5861 if Angle=180, four if Angle=90, etc).
5862 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5863 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5865 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5866 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5867 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5868 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5869 * SplitContinuity.CurveContinuity - required continuity for curves.
5870 This and the previous parameters can take the following values:
5872 Parametric Continuity:
5873 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5874 coincidental. The curves or surfaces may still meet at an angle,
5875 giving rise to a sharp corner or edge).
5876 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5877 are parallel, ruling out sharp edges).
5878 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5879 or surfaces are of the same magnitude).
5880 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5881 curves or surfaces (d/du C(u)) are the same at junction.
5883 Geometric Continuity:
5884 G1: first derivatives are proportional at junction.
5885 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5886 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5887 G2: first and second derivatives are proportional at junction. As the names imply,
5888 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5889 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5890 geometric continuity of order n, but not vice-versa.
5891 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5892 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5893 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5894 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5895 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5896 the specified parameters.
5897 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5898 the specified parameters.
5899 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5900 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5901 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5902 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5903 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5904 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5905 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5906 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5907 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5908 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5909 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5912 New GEOM.GEOM_Object, containing processed shape.
5914 Note: For more information look through SALOME Geometry User's Guide->
5915 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5917 # Example: see GEOM_TestHealing.py
5918 theValues,Parameters = ParseList(theValues)
5919 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5920 # To avoid script failure in case of good argument shape
5921 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5923 RaiseIfFailed("ProcessShape", self.HealOp)
5924 for string in (theOperators + theParameters):
5925 Parameters = ":" + Parameters
5927 anObj.SetParameters(Parameters)
5928 self._autoPublish(anObj, theName, "healed")
5931 ## Remove faces from the given object (shape).
5932 # @param theObject Shape to be processed.
5933 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5934 # removes ALL faces of the given object.
5935 # @param theName Object name; when specified, this parameter is used
5936 # for result publication in the study. Otherwise, if automatic
5937 # publication is switched on, default value is used for result name.
5939 # @return New GEOM.GEOM_Object, containing processed shape.
5941 # @ref tui_suppress_faces "Example"
5942 def SuppressFaces(self, theObject, theFaces, theName=None):
5944 Remove faces from the given object (shape).
5947 theObject Shape to be processed.
5948 theFaces Indices of faces to be removed, if EMPTY then the method
5949 removes ALL faces of the given object.
5950 theName Object name; when specified, this parameter is used
5951 for result publication in the study. Otherwise, if automatic
5952 publication is switched on, default value is used for result name.
5955 New GEOM.GEOM_Object, containing processed shape.
5957 # Example: see GEOM_TestHealing.py
5958 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5959 RaiseIfFailed("SuppressFaces", self.HealOp)
5960 self._autoPublish(anObj, theName, "suppressFaces")
5963 ## Sewing of some shapes into single shape.
5964 # @param ListShape Shapes to be processed.
5965 # @param theTolerance Required tolerance value.
5966 # @param AllowNonManifold Flag that allows non-manifold sewing.
5967 # @param theName Object name; when specified, this parameter is used
5968 # for result publication in the study. Otherwise, if automatic
5969 # publication is switched on, default value is used for result name.
5971 # @return New GEOM.GEOM_Object, containing processed shape.
5973 # @ref tui_sewing "Example"
5974 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5976 Sewing of some shapes into single shape.
5979 ListShape Shapes to be processed.
5980 theTolerance Required tolerance value.
5981 AllowNonManifold Flag that allows non-manifold sewing.
5982 theName Object name; when specified, this parameter is used
5983 for result publication in the study. Otherwise, if automatic
5984 publication is switched on, default value is used for result name.
5987 New GEOM.GEOM_Object, containing processed shape.
5989 # Example: see GEOM_TestHealing.py
5990 comp = self.MakeCompound(ListShape)
5991 # note: auto-publishing is done in self.Sew()
5992 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
5995 ## Sewing of the given object.
5996 # @param theObject Shape to be processed.
5997 # @param theTolerance Required tolerance value.
5998 # @param AllowNonManifold Flag that allows non-manifold sewing.
5999 # @param theName Object name; when specified, this parameter is used
6000 # for result publication in the study. Otherwise, if automatic
6001 # publication is switched on, default value is used for result name.
6003 # @return New GEOM.GEOM_Object, containing processed shape.
6004 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6006 Sewing of the given object.
6009 theObject Shape to be processed.
6010 theTolerance Required tolerance value.
6011 AllowNonManifold Flag that allows non-manifold sewing.
6012 theName Object name; when specified, this parameter is used
6013 for result publication in the study. Otherwise, if automatic
6014 publication is switched on, default value is used for result name.
6017 New GEOM.GEOM_Object, containing processed shape.
6019 # Example: see MakeSewing() above
6020 theTolerance,Parameters = ParseParameters(theTolerance)
6021 if AllowNonManifold:
6022 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6024 anObj = self.HealOp.Sew(theObject, theTolerance)
6025 # To avoid script failure in case of good argument shape
6026 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6028 RaiseIfFailed("Sew", self.HealOp)
6029 anObj.SetParameters(Parameters)
6030 self._autoPublish(anObj, theName, "sewed")
6033 ## Rebuild the topology of theCompound of solids by removing
6034 # of the faces that are shared by several solids.
6035 # @param theCompound Shape to be processed.
6036 # @param theName Object name; when specified, this parameter is used
6037 # for result publication in the study. Otherwise, if automatic
6038 # publication is switched on, default value is used for result name.
6040 # @return New GEOM.GEOM_Object, containing processed shape.
6042 # @ref tui_remove_webs "Example"
6043 def RemoveInternalFaces (self, theCompound, theName=None):
6045 Rebuild the topology of theCompound of solids by removing
6046 of the faces that are shared by several solids.
6049 theCompound Shape to be processed.
6050 theName Object name; when specified, this parameter is used
6051 for result publication in the study. Otherwise, if automatic
6052 publication is switched on, default value is used for result name.
6055 New GEOM.GEOM_Object, containing processed shape.
6057 # Example: see GEOM_TestHealing.py
6058 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6059 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6060 self._autoPublish(anObj, theName, "removeWebs")
6063 ## Remove internal wires and edges from the given object (face).
6064 # @param theObject Shape to be processed.
6065 # @param theWires Indices of wires to be removed, if EMPTY then the method
6066 # removes ALL internal wires of the given object.
6067 # @param theName Object name; when specified, this parameter is used
6068 # for result publication in the study. Otherwise, if automatic
6069 # publication is switched on, default value is used for result name.
6071 # @return New GEOM.GEOM_Object, containing processed shape.
6073 # @ref tui_suppress_internal_wires "Example"
6074 def SuppressInternalWires(self, theObject, theWires, theName=None):
6076 Remove internal wires and edges from the given object (face).
6079 theObject Shape to be processed.
6080 theWires Indices of wires to be removed, if EMPTY then the method
6081 removes ALL internal wires of the given object.
6082 theName Object name; when specified, this parameter is used
6083 for result publication in the study. Otherwise, if automatic
6084 publication is switched on, default value is used for result name.
6087 New GEOM.GEOM_Object, containing processed shape.
6089 # Example: see GEOM_TestHealing.py
6090 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6091 RaiseIfFailed("RemoveIntWires", self.HealOp)
6092 self._autoPublish(anObj, theName, "suppressWires")
6095 ## Remove internal closed contours (holes) from the given object.
6096 # @param theObject Shape to be processed.
6097 # @param theWires Indices of wires to be removed, if EMPTY then the method
6098 # removes ALL internal holes of the given object
6099 # @param theName Object name; when specified, this parameter is used
6100 # for result publication in the study. Otherwise, if automatic
6101 # publication is switched on, default value is used for result name.
6103 # @return New GEOM.GEOM_Object, containing processed shape.
6105 # @ref tui_suppress_holes "Example"
6106 def SuppressHoles(self, theObject, theWires, theName=None):
6108 Remove internal closed contours (holes) from the given object.
6111 theObject Shape to be processed.
6112 theWires Indices of wires to be removed, if EMPTY then the method
6113 removes ALL internal holes of the given object
6114 theName Object name; when specified, this parameter is used
6115 for result publication in the study. Otherwise, if automatic
6116 publication is switched on, default value is used for result name.
6119 New GEOM.GEOM_Object, containing processed shape.
6121 # Example: see GEOM_TestHealing.py
6122 anObj = self.HealOp.FillHoles(theObject, theWires)
6123 RaiseIfFailed("FillHoles", self.HealOp)
6124 self._autoPublish(anObj, theName, "suppressHoles")
6127 ## Close an open wire.
6128 # @param theObject Shape to be processed.
6129 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6130 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6131 # @param isCommonVertex If True : closure by creation of a common vertex,
6132 # If False : closure by creation of an edge between ends.
6133 # @param theName Object name; when specified, this parameter is used
6134 # for result publication in the study. Otherwise, if automatic
6135 # publication is switched on, default value is used for result name.
6137 # @return New GEOM.GEOM_Object, containing processed shape.
6139 # @ref tui_close_contour "Example"
6140 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6145 theObject Shape to be processed.
6146 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6147 if [ ], then theObject itself is a wire.
6148 isCommonVertex If True : closure by creation of a common vertex,
6149 If False : closure by creation of an edge between ends.
6150 theName Object name; when specified, this parameter is used
6151 for result publication in the study. Otherwise, if automatic
6152 publication is switched on, default value is used for result name.
6155 New GEOM.GEOM_Object, containing processed shape.
6157 # Example: see GEOM_TestHealing.py
6158 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6159 RaiseIfFailed("CloseContour", self.HealOp)
6160 self._autoPublish(anObj, theName, "closeContour")
6163 ## Addition of a point to a given edge object.
6164 # @param theObject Shape to be processed.
6165 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6166 # if -1, then theObject itself is the edge.
6167 # @param theValue Value of parameter on edge or length parameter,
6168 # depending on \a isByParameter.
6169 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6170 # if FALSE : \a theValue is treated as a length parameter [0..1]
6171 # @param theName Object name; when specified, this parameter is used
6172 # for result publication in the study. Otherwise, if automatic
6173 # publication is switched on, default value is used for result name.
6175 # @return New GEOM.GEOM_Object, containing processed shape.
6177 # @ref tui_add_point_on_edge "Example"
6178 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6180 Addition of a point to a given edge object.
6183 theObject Shape to be processed.
6184 theEdgeIndex Index of edge to be divided within theObject's shape,
6185 if -1, then theObject itself is the edge.
6186 theValue Value of parameter on edge or length parameter,
6187 depending on isByParameter.
6188 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6189 if FALSE : theValue is treated as a length parameter [0..1]
6190 theName Object name; when specified, this parameter is used
6191 for result publication in the study. Otherwise, if automatic
6192 publication is switched on, default value is used for result name.
6195 New GEOM.GEOM_Object, containing processed shape.
6197 # Example: see GEOM_TestHealing.py
6198 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6199 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6200 RaiseIfFailed("DivideEdge", self.HealOp)
6201 anObj.SetParameters(Parameters)
6202 self._autoPublish(anObj, theName, "divideEdge")
6205 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6206 # @param theWire Wire to minimize the number of C1 continuous edges in.
6207 # @param theVertices A list of vertices to suppress. If the list
6208 # is empty, all vertices in a wire will be assumed.
6209 # @param theName Object name; when specified, this parameter is used
6210 # for result publication in the study. Otherwise, if automatic
6211 # publication is switched on, default value is used for result name.
6213 # @return New GEOM.GEOM_Object with modified wire.
6215 # @ref tui_fuse_collinear_edges "Example"
6216 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6218 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6221 theWire Wire to minimize the number of C1 continuous edges in.
6222 theVertices A list of vertices to suppress. If the list
6223 is empty, all vertices in a wire will be assumed.
6224 theName Object name; when specified, this parameter is used
6225 for result publication in the study. Otherwise, if automatic
6226 publication is switched on, default value is used for result name.
6229 New GEOM.GEOM_Object with modified wire.
6231 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6232 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6233 self._autoPublish(anObj, theName, "fuseEdges")
6236 ## Change orientation of the given object. Updates given shape.
6237 # @param theObject Shape to be processed.
6238 # @return Updated <var>theObject</var>
6240 # @ref swig_todo "Example"
6241 def ChangeOrientationShell(self,theObject):
6243 Change orientation of the given object. Updates given shape.
6246 theObject Shape to be processed.
6251 theObject = self.HealOp.ChangeOrientation(theObject)
6252 RaiseIfFailed("ChangeOrientation", self.HealOp)
6255 ## Change orientation of the given object.
6256 # @param theObject Shape to be processed.
6257 # @param theName Object name; when specified, this parameter is used
6258 # for result publication in the study. Otherwise, if automatic
6259 # publication is switched on, default value is used for result name.
6261 # @return New GEOM.GEOM_Object, containing processed shape.
6263 # @ref swig_todo "Example"
6264 def ChangeOrientationShellCopy(self, theObject, theName=None):
6266 Change orientation of the given object.
6269 theObject Shape to be processed.
6270 theName Object name; when specified, this parameter is used
6271 for result publication in the study. Otherwise, if automatic
6272 publication is switched on, default value is used for result name.
6275 New GEOM.GEOM_Object, containing processed shape.
6277 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6278 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6279 self._autoPublish(anObj, theName, "reversed")
6282 ## Try to limit tolerance of the given object by value \a theTolerance.
6283 # @param theObject Shape to be processed.
6284 # @param theTolerance Required tolerance value.
6285 # @param theName Object name; when specified, this parameter is used
6286 # for result publication in the study. Otherwise, if automatic
6287 # publication is switched on, default value is used for result name.
6289 # @return New GEOM.GEOM_Object, containing processed shape.
6291 # @ref tui_limit_tolerance "Example"
6292 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6294 Try to limit tolerance of the given object by value theTolerance.
6297 theObject Shape to be processed.
6298 theTolerance Required tolerance value.
6299 theName Object name; when specified, this parameter is used
6300 for result publication in the study. Otherwise, if automatic
6301 publication is switched on, default value is used for result name.
6304 New GEOM.GEOM_Object, containing processed shape.
6306 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6307 RaiseIfFailed("LimitTolerance", self.HealOp)
6308 self._autoPublish(anObj, theName, "limitTolerance")
6311 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6312 # that constitute a free boundary of the given shape.
6313 # @param theObject Shape to get free boundary of.
6314 # @param theName Object name; when specified, this parameter is used
6315 # for result publication in the study. Otherwise, if automatic
6316 # publication is switched on, default value is used for result name.
6318 # @return [\a status, \a theClosedWires, \a theOpenWires]
6319 # \n \a status: FALSE, if an error(s) occured during the method execution.
6320 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6321 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6323 # @ref tui_measurement_tools_page "Example"
6324 def GetFreeBoundary(self, theObject, theName=None):
6326 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6327 that constitute a free boundary of the given shape.
6330 theObject Shape to get free boundary of.
6331 theName Object name; when specified, this parameter is used
6332 for result publication in the study. Otherwise, if automatic
6333 publication is switched on, default value is used for result name.
6336 [status, theClosedWires, theOpenWires]
6337 status: FALSE, if an error(s) occured during the method execution.
6338 theClosedWires: Closed wires on the free boundary of the given shape.
6339 theOpenWires: Open wires on the free boundary of the given shape.
6341 # Example: see GEOM_TestHealing.py
6342 anObj = self.HealOp.GetFreeBoundary(theObject)
6343 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6344 self._autoPublish(anObj[1], theName, "closedWire")
6345 self._autoPublish(anObj[2], theName, "openWire")
6348 ## Replace coincident faces in theShape by one face.
6349 # @param theShape Initial shape.
6350 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6351 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6352 # otherwise all initial shapes.
6353 # @param theName Object name; when specified, this parameter is used
6354 # for result publication in the study. Otherwise, if automatic
6355 # publication is switched on, default value is used for result name.
6357 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6359 # @ref tui_glue_faces "Example"
6360 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6362 Replace coincident faces in theShape by one face.
6365 theShape Initial shape.
6366 theTolerance Maximum distance between faces, which can be considered as coincident.
6367 doKeepNonSolids If FALSE, only solids will present in the result,
6368 otherwise all initial shapes.
6369 theName Object name; when specified, this parameter is used
6370 for result publication in the study. Otherwise, if automatic
6371 publication is switched on, default value is used for result name.
6374 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6376 # Example: see GEOM_Spanner.py
6377 theTolerance,Parameters = ParseParameters(theTolerance)
6378 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6380 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6381 anObj.SetParameters(Parameters)
6382 self._autoPublish(anObj, theName, "glueFaces")
6385 ## Find coincident faces in theShape for possible gluing.
6386 # @param theShape Initial shape.
6387 # @param theTolerance Maximum distance between faces,
6388 # which can be considered as coincident.
6389 # @param theName Object name; when specified, this parameter is used
6390 # for result publication in the study. Otherwise, if automatic
6391 # publication is switched on, default value is used for result name.
6393 # @return GEOM.ListOfGO
6395 # @ref tui_glue_faces "Example"
6396 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6398 Find coincident faces in theShape for possible gluing.
6401 theShape Initial shape.
6402 theTolerance Maximum distance between faces,
6403 which can be considered as coincident.
6404 theName Object name; when specified, this parameter is used
6405 for result publication in the study. Otherwise, if automatic
6406 publication is switched on, default value is used for result name.
6411 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6412 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6413 self._autoPublish(anObj, theName, "facesToGlue")
6416 ## Replace coincident faces in theShape by one face
6417 # in compliance with given list of faces
6418 # @param theShape Initial shape.
6419 # @param theTolerance Maximum distance between faces,
6420 # which can be considered as coincident.
6421 # @param theFaces List of faces for gluing.
6422 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6423 # otherwise all initial shapes.
6424 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6425 # will be glued, otherwise only the edges,
6426 # belonging to <VAR>theFaces</VAR>.
6427 # @param theName Object name; when specified, this parameter is used
6428 # for result publication in the study. Otherwise, if automatic
6429 # publication is switched on, default value is used for result name.
6431 # @return New GEOM.GEOM_Object, containing a copy of theShape
6432 # without some faces.
6434 # @ref tui_glue_faces "Example"
6435 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6436 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6438 Replace coincident faces in theShape by one face
6439 in compliance with given list of faces
6442 theShape Initial shape.
6443 theTolerance Maximum distance between faces,
6444 which can be considered as coincident.
6445 theFaces List of faces for gluing.
6446 doKeepNonSolids If FALSE, only solids will present in the result,
6447 otherwise all initial shapes.
6448 doGlueAllEdges If TRUE, all coincident edges of theShape
6449 will be glued, otherwise only the edges,
6450 belonging to theFaces.
6451 theName Object name; when specified, this parameter is used
6452 for result publication in the study. Otherwise, if automatic
6453 publication is switched on, default value is used for result name.
6456 New GEOM.GEOM_Object, containing a copy of theShape
6459 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6460 doKeepNonSolids, doGlueAllEdges)
6462 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6463 self._autoPublish(anObj, theName, "glueFaces")
6466 ## Replace coincident edges in theShape by one edge.
6467 # @param theShape Initial shape.
6468 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6469 # @param theName Object name; when specified, this parameter is used
6470 # for result publication in the study. Otherwise, if automatic
6471 # publication is switched on, default value is used for result name.
6473 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6475 # @ref tui_glue_edges "Example"
6476 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6478 Replace coincident edges in theShape by one edge.
6481 theShape Initial shape.
6482 theTolerance Maximum distance between edges, which can be considered as coincident.
6483 theName Object name; when specified, this parameter is used
6484 for result publication in the study. Otherwise, if automatic
6485 publication is switched on, default value is used for result name.
6488 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6490 theTolerance,Parameters = ParseParameters(theTolerance)
6491 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6493 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6494 anObj.SetParameters(Parameters)
6495 self._autoPublish(anObj, theName, "glueEdges")
6498 ## Find coincident edges in theShape for possible gluing.
6499 # @param theShape Initial shape.
6500 # @param theTolerance Maximum distance between edges,
6501 # which can be considered as coincident.
6502 # @param theName Object name; when specified, this parameter is used
6503 # for result publication in the study. Otherwise, if automatic
6504 # publication is switched on, default value is used for result name.
6506 # @return GEOM.ListOfGO
6508 # @ref tui_glue_edges "Example"
6509 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6511 Find coincident edges in theShape for possible gluing.
6514 theShape Initial shape.
6515 theTolerance Maximum distance between edges,
6516 which can be considered as coincident.
6517 theName Object name; when specified, this parameter is used
6518 for result publication in the study. Otherwise, if automatic
6519 publication is switched on, default value is used for result name.
6524 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6525 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6526 self._autoPublish(anObj, theName, "edgesToGlue")
6529 ## Replace coincident edges in theShape by one edge
6530 # in compliance with given list of edges.
6531 # @param theShape Initial shape.
6532 # @param theTolerance Maximum distance between edges,
6533 # which can be considered as coincident.
6534 # @param theEdges List of edges for gluing.
6535 # @param theName Object name; when specified, this parameter is used
6536 # for result publication in the study. Otherwise, if automatic
6537 # publication is switched on, default value is used for result name.
6539 # @return New GEOM.GEOM_Object, containing a copy of theShape
6540 # without some edges.
6542 # @ref tui_glue_edges "Example"
6543 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6545 Replace coincident edges in theShape by one edge
6546 in compliance with given list of edges.
6549 theShape Initial shape.
6550 theTolerance Maximum distance between edges,
6551 which can be considered as coincident.
6552 theEdges List of edges for gluing.
6553 theName Object name; when specified, this parameter is used
6554 for result publication in the study. Otherwise, if automatic
6555 publication is switched on, default value is used for result name.
6558 New GEOM.GEOM_Object, containing a copy of theShape
6561 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6563 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6564 self._autoPublish(anObj, theName, "glueEdges")
6570 ## @addtogroup l3_boolean Boolean Operations
6573 # -----------------------------------------------------------------------------
6574 # Boolean (Common, Cut, Fuse, Section)
6575 # -----------------------------------------------------------------------------
6577 ## Perform one of boolean operations on two given shapes.
6578 # @param theShape1 First argument for boolean operation.
6579 # @param theShape2 Second argument for boolean operation.
6580 # @param theOperation Indicates the operation to be done:\n
6581 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6582 # @param theName Object name; when specified, this parameter is used
6583 # for result publication in the study. Otherwise, if automatic
6584 # publication is switched on, default value is used for result name.
6586 # @return New GEOM.GEOM_Object, containing the result shape.
6588 # @ref tui_fuse "Example"
6589 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6591 Perform one of boolean operations on two given shapes.
6594 theShape1 First argument for boolean operation.
6595 theShape2 Second argument for boolean operation.
6596 theOperation Indicates the operation to be done:
6597 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6598 theName Object name; when specified, this parameter is used
6599 for result publication in the study. Otherwise, if automatic
6600 publication is switched on, default value is used for result name.
6603 New GEOM.GEOM_Object, containing the result shape.
6605 # Example: see GEOM_TestAll.py
6606 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6607 RaiseIfFailed("MakeBoolean", self.BoolOp)
6608 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6609 self._autoPublish(anObj, theName, def_names[theOperation])
6612 ## Perform Common boolean operation on two given shapes.
6613 # @param theShape1 First argument for boolean operation.
6614 # @param theShape2 Second argument for boolean operation.
6615 # @param theName Object name; when specified, this parameter is used
6616 # for result publication in the study. Otherwise, if automatic
6617 # publication is switched on, default value is used for result name.
6619 # @return New GEOM.GEOM_Object, containing the result shape.
6621 # @ref tui_common "Example 1"
6622 # \n @ref swig_MakeCommon "Example 2"
6623 def MakeCommon(self, theShape1, theShape2, theName=None):
6625 Perform Common boolean operation on two given shapes.
6628 theShape1 First argument for boolean operation.
6629 theShape2 Second argument for boolean operation.
6630 theName Object name; when specified, this parameter is used
6631 for result publication in the study. Otherwise, if automatic
6632 publication is switched on, default value is used for result name.
6635 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, 1, theName)
6641 ## Perform Cut 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_cut "Example 1"
6651 # \n @ref swig_MakeCommon "Example 2"
6652 def MakeCut(self, theShape1, theShape2, theName=None):
6654 Perform Cut 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, 2, theName)
6671 ## Perform Fuse 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_fuse "Example 1"
6681 # \n @ref swig_MakeCommon "Example 2"
6682 def MakeFuse(self, theShape1, theShape2, theName=None):
6684 Perform Fuse 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, 3, theName)
6701 ## Perform Section boolean operation on two given shapes.
6702 # @param theShape1 First argument for boolean operation.
6703 # @param theShape2 Second argument for boolean operation.
6704 # @param theName Object name; when specified, this parameter is used
6705 # for result publication in the study. Otherwise, if automatic
6706 # publication is switched on, default value is used for result name.
6708 # @return New GEOM.GEOM_Object, containing the result shape.
6710 # @ref tui_section "Example 1"
6711 # \n @ref swig_MakeCommon "Example 2"
6712 def MakeSection(self, theShape1, theShape2, theName=None):
6714 Perform Section boolean operation on two given shapes.
6717 theShape1 First argument for boolean operation.
6718 theShape2 Second argument for boolean operation.
6719 theName Object name; when specified, this parameter is used
6720 for result publication in the study. Otherwise, if automatic
6721 publication is switched on, default value is used for result name.
6724 New GEOM.GEOM_Object, containing the result shape.
6727 # Example: see GEOM_TestOthers.py
6728 # note: auto-publishing is done in self.MakeBoolean()
6729 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6731 ## Perform Fuse boolean operation on the list of shapes.
6732 # @param theShapesList Shapes to be fused.
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_fuse "Example 1"
6740 # \n @ref swig_MakeCommon "Example 2"
6741 def MakeFuseList(self, theShapesList, theName=None):
6743 Perform Fuse boolean operation on the list of shapes.
6746 theShapesList Shapes to be fused.
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.MakeFuseList(theShapesList)
6757 RaiseIfFailed("MakeFuseList", self.BoolOp)
6758 self._autoPublish(anObj, theName, "fuse")
6761 ## Perform Common boolean operation on the list of shapes.
6762 # @param theShapesList Shapes for Common operation.
6763 # @param theName Object name; when specified, this parameter is used
6764 # for result publication in the study. Otherwise, if automatic
6765 # publication is switched on, default value is used for result name.
6767 # @return New GEOM.GEOM_Object, containing the result shape.
6769 # @ref tui_common "Example 1"
6770 # \n @ref swig_MakeCommon "Example 2"
6771 def MakeCommonList(self, theShapesList, theName=None):
6773 Perform Common boolean operation on the list of shapes.
6776 theShapesList Shapes for Common operation.
6777 theName Object name; when specified, this parameter is used
6778 for result publication in the study. Otherwise, if automatic
6779 publication is switched on, default value is used for result name.
6782 New GEOM.GEOM_Object, containing the result shape.
6785 # Example: see GEOM_TestOthers.py
6786 anObj = self.BoolOp.MakeCommonList(theShapesList)
6787 RaiseIfFailed("MakeCommonList", self.BoolOp)
6788 self._autoPublish(anObj, theName, "common")
6791 ## Perform Cut boolean operation on one object and the list of tools.
6792 # @param theMainShape The object of the operation.
6793 # @param theShapesList The list of tools of the operation.
6794 # @param theName Object name; when specified, this parameter is used
6795 # for result publication in the study. Otherwise, if automatic
6796 # publication is switched on, default value is used for result name.
6798 # @return New GEOM.GEOM_Object, containing the result shape.
6800 # @ref tui_cut "Example 1"
6801 # \n @ref swig_MakeCommon "Example 2"
6802 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6804 Perform Cut boolean operation on one object and the list of tools.
6807 theMainShape The object of the operation.
6808 theShapesList The list of tools of the operation.
6809 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.
6814 New GEOM.GEOM_Object, containing the result shape.
6817 # Example: see GEOM_TestOthers.py
6818 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6819 RaiseIfFailed("MakeCutList", self.BoolOp)
6820 self._autoPublish(anObj, theName, "cut")
6826 ## @addtogroup l3_basic_op
6829 ## Perform partition operation.
6830 # @param ListShapes Shapes to be intersected.
6831 # @param ListTools Shapes to intersect theShapes.
6832 # @param Limit Type of resulting shapes (see ShapeType()).\n
6833 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6834 # type will be detected automatically.
6835 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6836 # target type (equal to Limit) are kept in the result,
6837 # else standalone shapes of lower dimension
6838 # are kept also (if they exist).
6839 # @param theName Object name; when specified, this parameter is used
6840 # for result publication in the study. Otherwise, if automatic
6841 # publication is switched on, default value is used for result name.
6843 # @note Each compound from ListShapes and ListTools will be exploded
6844 # in order to avoid possible intersection between shapes from this compound.
6846 # After implementation new version of PartitionAlgo (October 2006)
6847 # other parameters are ignored by current functionality. They are kept
6848 # in this function only for support old versions.
6849 # @param ListKeepInside Shapes, outside which the results will be deleted.
6850 # Each shape from theKeepInside must belong to theShapes also.
6851 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6852 # Each shape from theRemoveInside must belong to theShapes also.
6853 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6854 # @param ListMaterials Material indices for each shape. Make sence,
6855 # only if theRemoveWebs is TRUE.
6857 # @return New GEOM.GEOM_Object, containing the result shapes.
6859 # @ref tui_partition "Example"
6860 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6861 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6862 KeepNonlimitShapes=0, theName=None):
6864 Perform partition operation.
6867 ListShapes Shapes to be intersected.
6868 ListTools Shapes to intersect theShapes.
6869 Limit Type of resulting shapes (see geompy.ShapeType)
6870 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6871 type will be detected automatically.
6872 KeepNonlimitShapes if this parameter == 0, then only shapes of
6873 target type (equal to Limit) are kept in the result,
6874 else standalone shapes of lower dimension
6875 are kept also (if they exist).
6876 theName Object name; when specified, this parameter is used
6877 for result publication in the study. Otherwise, if automatic
6878 publication is switched on, default value is used for result name.
6880 Each compound from ListShapes and ListTools will be exploded
6881 in order to avoid possible intersection between shapes from
6884 After implementation new version of PartitionAlgo (October 2006) other
6885 parameters are ignored by current functionality. They are kept in this
6886 function only for support old versions.
6889 ListKeepInside Shapes, outside which the results will be deleted.
6890 Each shape from theKeepInside must belong to theShapes also.
6891 ListRemoveInside Shapes, inside which the results will be deleted.
6892 Each shape from theRemoveInside must belong to theShapes also.
6893 RemoveWebs If TRUE, perform Glue 3D algorithm.
6894 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6897 New GEOM.GEOM_Object, containing the result shapes.
6899 # Example: see GEOM_TestAll.py
6900 if Limit == self.ShapeType["AUTO"]:
6901 # automatic detection of the most appropriate shape limit type
6903 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6904 Limit = EnumToLong(lim)
6906 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6907 ListKeepInside, ListRemoveInside,
6908 Limit, RemoveWebs, ListMaterials,
6909 KeepNonlimitShapes);
6910 RaiseIfFailed("MakePartition", self.BoolOp)
6911 self._autoPublish(anObj, theName, "partition")
6914 ## Perform partition operation.
6915 # This method may be useful if it is needed to make a partition for
6916 # compound contains nonintersected shapes. Performance will be better
6917 # since intersection between shapes from compound is not performed.
6919 # Description of all parameters as in previous method MakePartition()
6921 # @note Passed compounds (via ListShapes or via ListTools)
6922 # have to consist of nonintersecting shapes.
6924 # @return New GEOM.GEOM_Object, containing the result shapes.
6926 # @ref swig_todo "Example"
6927 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6928 ListKeepInside=[], ListRemoveInside=[],
6929 Limit=ShapeType["AUTO"], RemoveWebs=0,
6930 ListMaterials=[], KeepNonlimitShapes=0,
6933 Perform partition operation.
6934 This method may be useful if it is needed to make a partition for
6935 compound contains nonintersected shapes. Performance will be better
6936 since intersection between shapes from compound is not performed.
6939 Description of all parameters as in method geompy.MakePartition
6942 Passed compounds (via ListShapes or via ListTools)
6943 have to consist of nonintersecting shapes.
6946 New GEOM.GEOM_Object, containing the result shapes.
6948 if Limit == self.ShapeType["AUTO"]:
6949 # automatic detection of the most appropriate shape limit type
6951 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6952 Limit = EnumToLong(lim)
6954 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6955 ListKeepInside, ListRemoveInside,
6956 Limit, RemoveWebs, ListMaterials,
6957 KeepNonlimitShapes);
6958 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6959 self._autoPublish(anObj, theName, "partition")
6962 ## See method MakePartition() for more information.
6964 # @ref tui_partition "Example 1"
6965 # \n @ref swig_Partition "Example 2"
6966 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6967 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6968 KeepNonlimitShapes=0, theName=None):
6970 See method geompy.MakePartition for more information.
6972 # Example: see GEOM_TestOthers.py
6973 # note: auto-publishing is done in self.MakePartition()
6974 anObj = self.MakePartition(ListShapes, ListTools,
6975 ListKeepInside, ListRemoveInside,
6976 Limit, RemoveWebs, ListMaterials,
6977 KeepNonlimitShapes, theName);
6980 ## Perform partition of the Shape with the Plane
6981 # @param theShape Shape to be intersected.
6982 # @param thePlane Tool shape, to intersect theShape.
6983 # @param theName Object name; when specified, this parameter is used
6984 # for result publication in the study. Otherwise, if automatic
6985 # publication is switched on, default value is used for result name.
6987 # @return New GEOM.GEOM_Object, containing the result shape.
6989 # @ref tui_partition "Example"
6990 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6992 Perform partition of the Shape with the Plane
6995 theShape Shape to be intersected.
6996 thePlane Tool shape, to intersect theShape.
6997 theName Object name; when specified, this parameter is used
6998 for result publication in the study. Otherwise, if automatic
6999 publication is switched on, default value is used for result name.
7002 New GEOM.GEOM_Object, containing the result shape.
7004 # Example: see GEOM_TestAll.py
7005 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7006 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7007 self._autoPublish(anObj, theName, "partition")
7010 # end of l3_basic_op
7013 ## @addtogroup l3_transform
7016 ## Translate the given object along the vector, specified
7017 # by its end points.
7018 # @param theObject The object to be translated.
7019 # @param thePoint1 Start point of translation vector.
7020 # @param thePoint2 End point of translation vector.
7021 # @param theCopy Flag used to translate object itself or create a copy.
7022 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7023 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7024 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7026 Translate the given object along the vector, specified by its end points.
7029 theObject The object to be translated.
7030 thePoint1 Start point of translation vector.
7031 thePoint2 End point of translation vector.
7032 theCopy Flag used to translate object itself or create a copy.
7035 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7036 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7039 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7041 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7042 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7045 ## Translate the given object along the vector, specified
7046 # by its end points, creating its copy before the translation.
7047 # @param theObject The object to be translated.
7048 # @param thePoint1 Start point of translation vector.
7049 # @param thePoint2 End point of translation vector.
7050 # @param theName Object name; when specified, this parameter is used
7051 # for result publication in the study. Otherwise, if automatic
7052 # publication is switched on, default value is used for result name.
7054 # @return New GEOM.GEOM_Object, containing the translated object.
7056 # @ref tui_translation "Example 1"
7057 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7058 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7060 Translate the given object along the vector, specified
7061 by its end points, creating its copy before the translation.
7064 theObject The object to be translated.
7065 thePoint1 Start point of translation vector.
7066 thePoint2 End point of translation vector.
7067 theName Object name; when specified, this parameter is used
7068 for result publication in the study. Otherwise, if automatic
7069 publication is switched on, default value is used for result name.
7072 New GEOM.GEOM_Object, containing the translated object.
7074 # Example: see GEOM_TestAll.py
7075 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7076 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7077 self._autoPublish(anObj, theName, "translated")
7080 ## Translate the given object along the vector, specified by its components.
7081 # @param theObject The object to be translated.
7082 # @param theDX,theDY,theDZ Components of translation vector.
7083 # @param theCopy Flag used to translate object itself or create a copy.
7084 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7085 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7087 # @ref tui_translation "Example"
7088 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7090 Translate the given object along the vector, specified by its components.
7093 theObject The object to be translated.
7094 theDX,theDY,theDZ Components of translation vector.
7095 theCopy Flag used to translate object itself or create a copy.
7098 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7099 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7101 # Example: see GEOM_TestAll.py
7102 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7104 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7106 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7107 anObj.SetParameters(Parameters)
7108 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7111 ## Translate the given object along the vector, specified
7112 # by its components, creating its copy before the translation.
7113 # @param theObject The object to be translated.
7114 # @param theDX,theDY,theDZ Components of translation vector.
7115 # @param theName Object name; when specified, this parameter is used
7116 # for result publication in the study. Otherwise, if automatic
7117 # publication is switched on, default value is used for result name.
7119 # @return New GEOM.GEOM_Object, containing the translated object.
7121 # @ref tui_translation "Example"
7122 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7124 Translate the given object along the vector, specified
7125 by its components, creating its copy before the translation.
7128 theObject The object to be translated.
7129 theDX,theDY,theDZ Components of translation vector.
7130 theName Object name; when specified, this parameter is used
7131 for result publication in the study. Otherwise, if automatic
7132 publication is switched on, default value is used for result name.
7135 New GEOM.GEOM_Object, containing the translated object.
7137 # Example: see GEOM_TestAll.py
7138 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7139 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7140 anObj.SetParameters(Parameters)
7141 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7142 self._autoPublish(anObj, theName, "translated")
7145 ## Translate the given object along the given vector.
7146 # @param theObject The object to be translated.
7147 # @param theVector The translation vector.
7148 # @param theCopy Flag used to translate object itself or create a copy.
7149 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7150 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7151 def TranslateVector(self, theObject, theVector, theCopy=False):
7153 Translate the given object along the given vector.
7156 theObject The object to be translated.
7157 theVector The translation vector.
7158 theCopy Flag used to translate object itself or create a copy.
7161 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7162 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7165 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7167 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7168 RaiseIfFailed("TranslateVector", self.TrsfOp)
7171 ## Translate the given object along the given vector,
7172 # creating its copy before the translation.
7173 # @param theObject The object to be translated.
7174 # @param theVector The translation vector.
7175 # @param theName Object name; when specified, this parameter is used
7176 # for result publication in the study. Otherwise, if automatic
7177 # publication is switched on, default value is used for result name.
7179 # @return New GEOM.GEOM_Object, containing the translated object.
7181 # @ref tui_translation "Example"
7182 def MakeTranslationVector(self, theObject, theVector, theName=None):
7184 Translate the given object along the given vector,
7185 creating its copy before the translation.
7188 theObject The object to be translated.
7189 theVector The translation vector.
7190 theName Object name; when specified, this parameter is used
7191 for result publication in the study. Otherwise, if automatic
7192 publication is switched on, default value is used for result name.
7195 New GEOM.GEOM_Object, containing the translated object.
7197 # Example: see GEOM_TestAll.py
7198 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7199 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7200 self._autoPublish(anObj, theName, "translated")
7203 ## Translate the given object along the given vector on given distance.
7204 # @param theObject The object to be translated.
7205 # @param theVector The translation vector.
7206 # @param theDistance The translation distance.
7207 # @param theCopy Flag used to translate object itself or create a copy.
7208 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7209 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7211 # @ref tui_translation "Example"
7212 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7214 Translate the given object along the given vector on given distance.
7217 theObject The object to be translated.
7218 theVector The translation vector.
7219 theDistance The translation distance.
7220 theCopy Flag used to translate object itself or create a copy.
7223 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7224 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7226 # Example: see GEOM_TestAll.py
7227 theDistance,Parameters = ParseParameters(theDistance)
7228 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7229 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7230 anObj.SetParameters(Parameters)
7233 ## Translate the given object along the given vector on given distance,
7234 # creating its copy before the translation.
7235 # @param theObject The object to be translated.
7236 # @param theVector The translation vector.
7237 # @param theDistance The translation distance.
7238 # @param theName Object name; when specified, this parameter is used
7239 # for result publication in the study. Otherwise, if automatic
7240 # publication is switched on, default value is used for result name.
7242 # @return New GEOM.GEOM_Object, containing the translated object.
7244 # @ref tui_translation "Example"
7245 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7247 Translate the given object along the given vector on given distance,
7248 creating its copy before the translation.
7251 theObject The object to be translated.
7252 theVector The translation vector.
7253 theDistance The translation distance.
7254 theName Object name; when specified, this parameter is used
7255 for result publication in the study. Otherwise, if automatic
7256 publication is switched on, default value is used for result name.
7259 New GEOM.GEOM_Object, containing the translated object.
7261 # Example: see GEOM_TestAll.py
7262 theDistance,Parameters = ParseParameters(theDistance)
7263 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7264 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7265 anObj.SetParameters(Parameters)
7266 self._autoPublish(anObj, theName, "translated")
7269 ## Rotate the given object around the given axis on the given angle.
7270 # @param theObject The object to be rotated.
7271 # @param theAxis Rotation axis.
7272 # @param theAngle Rotation angle in radians.
7273 # @param theCopy Flag used to rotate object itself or create a copy.
7275 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7276 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7278 # @ref tui_rotation "Example"
7279 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7281 Rotate the given object around the given axis on the given angle.
7284 theObject The object to be rotated.
7285 theAxis Rotation axis.
7286 theAngle Rotation angle in radians.
7287 theCopy Flag used to rotate object itself or create a copy.
7290 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7291 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7293 # Example: see GEOM_TestAll.py
7295 if isinstance(theAngle,str):
7297 theAngle, Parameters = ParseParameters(theAngle)
7299 theAngle = theAngle*math.pi/180.0
7301 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7303 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7304 RaiseIfFailed("Rotate", self.TrsfOp)
7305 anObj.SetParameters(Parameters)
7308 ## Rotate the given object around the given axis
7309 # on the given angle, creating its copy before the rotatation.
7310 # @param theObject The object to be rotated.
7311 # @param theAxis Rotation axis.
7312 # @param theAngle Rotation angle in radians.
7313 # @param theName Object name; when specified, this parameter is used
7314 # for result publication in the study. Otherwise, if automatic
7315 # publication is switched on, default value is used for result name.
7317 # @return New GEOM.GEOM_Object, containing the rotated object.
7319 # @ref tui_rotation "Example"
7320 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7322 Rotate the given object around the given axis
7323 on the given angle, creating its copy before the rotatation.
7326 theObject The object to be rotated.
7327 theAxis Rotation axis.
7328 theAngle Rotation angle in radians.
7329 theName Object name; when specified, this parameter is used
7330 for result publication in the study. Otherwise, if automatic
7331 publication is switched on, default value is used for result name.
7334 New GEOM.GEOM_Object, containing the rotated object.
7336 # Example: see GEOM_TestAll.py
7338 if isinstance(theAngle,str):
7340 theAngle, Parameters = ParseParameters(theAngle)
7342 theAngle = theAngle*math.pi/180.0
7343 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7344 RaiseIfFailed("RotateCopy", self.TrsfOp)
7345 anObj.SetParameters(Parameters)
7346 self._autoPublish(anObj, theName, "rotated")
7349 ## Rotate given object around vector perpendicular to plane
7350 # containing three points.
7351 # @param theObject The object to be rotated.
7352 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7353 # containing the three points.
7354 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7355 # @param theCopy Flag used to rotate object itself or create a copy.
7356 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7357 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7358 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7360 Rotate given object around vector perpendicular to plane
7361 containing three points.
7364 theObject The object to be rotated.
7365 theCentPoint central point the axis is the vector perpendicular to the plane
7366 containing the three points.
7367 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7368 theCopy Flag used to rotate object itself or create a copy.
7371 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7372 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7375 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7377 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7378 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7381 ## Rotate given object around vector perpendicular to plane
7382 # containing three points, creating its copy before the rotatation.
7383 # @param theObject The object to be rotated.
7384 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7385 # containing the three points.
7386 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7387 # @param theName Object name; when specified, this parameter is used
7388 # for result publication in the study. Otherwise, if automatic
7389 # publication is switched on, default value is used for result name.
7391 # @return New GEOM.GEOM_Object, containing the rotated object.
7393 # @ref tui_rotation "Example"
7394 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7396 Rotate given object around vector perpendicular to plane
7397 containing three points, creating its copy before the rotatation.
7400 theObject The object to be rotated.
7401 theCentPoint central point the axis is the vector perpendicular to the plane
7402 containing the three points.
7403 thePoint1,thePoint2 in a perpendicular plane of the axis.
7404 theName Object name; when specified, this parameter is used
7405 for result publication in the study. Otherwise, if automatic
7406 publication is switched on, default value is used for result name.
7409 New GEOM.GEOM_Object, containing the rotated object.
7411 # Example: see GEOM_TestAll.py
7412 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7413 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7414 self._autoPublish(anObj, theName, "rotated")
7417 ## Scale the given object by the specified factor.
7418 # @param theObject The object to be scaled.
7419 # @param thePoint Center point for scaling.
7420 # Passing None for it means scaling relatively the origin of global CS.
7421 # @param theFactor Scaling factor value.
7422 # @param theCopy Flag used to scale object itself or create a copy.
7423 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7424 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7425 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7427 Scale the given object by the specified factor.
7430 theObject The object to be scaled.
7431 thePoint Center point for scaling.
7432 Passing None for it means scaling relatively the origin of global CS.
7433 theFactor Scaling factor value.
7434 theCopy Flag used to scale object itself or create a copy.
7437 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7438 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7440 # Example: see GEOM_TestAll.py
7441 theFactor, Parameters = ParseParameters(theFactor)
7443 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7445 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7446 RaiseIfFailed("Scale", self.TrsfOp)
7447 anObj.SetParameters(Parameters)
7450 ## Scale the given object by the factor, creating its copy before the scaling.
7451 # @param theObject The object to be scaled.
7452 # @param thePoint Center point for scaling.
7453 # Passing None for it means scaling relatively the origin of global CS.
7454 # @param theFactor Scaling factor value.
7455 # @param theName Object name; when specified, this parameter is used
7456 # for result publication in the study. Otherwise, if automatic
7457 # publication is switched on, default value is used for result name.
7459 # @return New GEOM.GEOM_Object, containing the scaled shape.
7461 # @ref tui_scale "Example"
7462 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7464 Scale the given object by the factor, creating its copy before the scaling.
7467 theObject The object to be scaled.
7468 thePoint Center point for scaling.
7469 Passing None for it means scaling relatively the origin of global CS.
7470 theFactor Scaling factor value.
7471 theName Object name; when specified, this parameter is used
7472 for result publication in the study. Otherwise, if automatic
7473 publication is switched on, default value is used for result name.
7476 New GEOM.GEOM_Object, containing the scaled shape.
7478 # Example: see GEOM_TestAll.py
7479 theFactor, Parameters = ParseParameters(theFactor)
7480 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7481 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7482 anObj.SetParameters(Parameters)
7483 self._autoPublish(anObj, theName, "scaled")
7486 ## Scale the given object by different factors along coordinate axes.
7487 # @param theObject The object to be scaled.
7488 # @param thePoint Center point for scaling.
7489 # Passing None for it means scaling relatively the origin of global CS.
7490 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7491 # @param theCopy Flag used to scale object itself or create a copy.
7492 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7493 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7494 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7496 Scale the given object by different factors along coordinate axes.
7499 theObject The object to be scaled.
7500 thePoint Center point for scaling.
7501 Passing None for it means scaling relatively the origin of global CS.
7502 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7503 theCopy Flag used to scale object itself or create a copy.
7506 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7507 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7509 # Example: see GEOM_TestAll.py
7510 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7512 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7513 theFactorX, theFactorY, theFactorZ)
7515 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7516 theFactorX, theFactorY, theFactorZ)
7517 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7518 anObj.SetParameters(Parameters)
7521 ## Scale the given object by different factors along coordinate axes,
7522 # creating its copy before the scaling.
7523 # @param theObject The object to be scaled.
7524 # @param thePoint Center point for scaling.
7525 # Passing None for it means scaling relatively the origin of global CS.
7526 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7527 # @param theName Object name; when specified, this parameter is used
7528 # for result publication in the study. Otherwise, if automatic
7529 # publication is switched on, default value is used for result name.
7531 # @return New GEOM.GEOM_Object, containing the scaled shape.
7533 # @ref swig_scale "Example"
7534 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7536 Scale the given object by different factors along coordinate axes,
7537 creating its copy before the scaling.
7540 theObject The object to be scaled.
7541 thePoint Center point for scaling.
7542 Passing None for it means scaling relatively the origin of global CS.
7543 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7544 theName Object name; when specified, this parameter is used
7545 for result publication in the study. Otherwise, if automatic
7546 publication is switched on, default value is used for result name.
7549 New GEOM.GEOM_Object, containing the scaled shape.
7551 # Example: see GEOM_TestAll.py
7552 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7553 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7554 theFactorX, theFactorY, theFactorZ)
7555 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7556 anObj.SetParameters(Parameters)
7557 self._autoPublish(anObj, theName, "scaled")
7560 ## Mirror an object relatively the given plane.
7561 # @param theObject The object to be mirrored.
7562 # @param thePlane Plane of symmetry.
7563 # @param theCopy Flag used to mirror object itself or create a copy.
7564 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7565 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7566 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7568 Mirror an object relatively the given plane.
7571 theObject The object to be mirrored.
7572 thePlane Plane of symmetry.
7573 theCopy Flag used to mirror object itself or create a copy.
7576 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7577 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7580 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7582 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7583 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7586 ## Create an object, symmetrical
7587 # to the given one relatively the given plane.
7588 # @param theObject The object to be mirrored.
7589 # @param thePlane Plane of symmetry.
7590 # @param theName Object name; when specified, this parameter is used
7591 # for result publication in the study. Otherwise, if automatic
7592 # publication is switched on, default value is used for result name.
7594 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7596 # @ref tui_mirror "Example"
7597 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7599 Create an object, symmetrical to the given one relatively the given plane.
7602 theObject The object to be mirrored.
7603 thePlane Plane of symmetry.
7604 theName Object name; when specified, this parameter is used
7605 for result publication in the study. Otherwise, if automatic
7606 publication is switched on, default value is used for result name.
7609 New GEOM.GEOM_Object, containing the mirrored shape.
7611 # Example: see GEOM_TestAll.py
7612 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7613 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7614 self._autoPublish(anObj, theName, "mirrored")
7617 ## Mirror an object relatively the given axis.
7618 # @param theObject The object to be mirrored.
7619 # @param theAxis Axis of symmetry.
7620 # @param theCopy Flag used to mirror object itself or create a copy.
7621 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7622 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7623 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7625 Mirror an object relatively the given axis.
7628 theObject The object to be mirrored.
7629 theAxis Axis of symmetry.
7630 theCopy Flag used to mirror object itself or create a copy.
7633 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7634 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7637 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7639 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7640 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7643 ## Create an object, symmetrical
7644 # to the given one relatively the given axis.
7645 # @param theObject The object to be mirrored.
7646 # @param theAxis Axis of symmetry.
7647 # @param theName Object name; when specified, this parameter is used
7648 # for result publication in the study. Otherwise, if automatic
7649 # publication is switched on, default value is used for result name.
7651 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7653 # @ref tui_mirror "Example"
7654 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7656 Create an object, symmetrical to the given one relatively the given axis.
7659 theObject The object to be mirrored.
7660 theAxis Axis of symmetry.
7661 theName Object name; when specified, this parameter is used
7662 for result publication in the study. Otherwise, if automatic
7663 publication is switched on, default value is used for result name.
7666 New GEOM.GEOM_Object, containing the mirrored shape.
7668 # Example: see GEOM_TestAll.py
7669 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7670 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7671 self._autoPublish(anObj, theName, "mirrored")
7674 ## Mirror an object relatively the given point.
7675 # @param theObject The object to be mirrored.
7676 # @param thePoint Point of symmetry.
7677 # @param theCopy Flag used to mirror object itself or create a copy.
7678 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7679 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7680 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7682 Mirror an object relatively the given point.
7685 theObject The object to be mirrored.
7686 thePoint Point of symmetry.
7687 theCopy Flag used to mirror object itself or create a copy.
7690 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7691 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7693 # Example: see GEOM_TestAll.py
7695 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7697 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7698 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7701 ## Create an object, symmetrical
7702 # to the given one relatively the given point.
7703 # @param theObject The object to be mirrored.
7704 # @param thePoint Point of symmetry.
7705 # @param theName Object name; when specified, this parameter is used
7706 # for result publication in the study. Otherwise, if automatic
7707 # publication is switched on, default value is used for result name.
7709 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7711 # @ref tui_mirror "Example"
7712 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7714 Create an object, symmetrical
7715 to the given one relatively the given point.
7718 theObject The object to be mirrored.
7719 thePoint Point of symmetry.
7720 theName Object name; when specified, this parameter is used
7721 for result publication in the study. Otherwise, if automatic
7722 publication is switched on, default value is used for result name.
7725 New GEOM.GEOM_Object, containing the mirrored shape.
7727 # Example: see GEOM_TestAll.py
7728 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7729 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7730 self._autoPublish(anObj, theName, "mirrored")
7733 ## Modify the location of the given object.
7734 # @param theObject The object to be displaced.
7735 # @param theStartLCS Coordinate system to perform displacement from it.\n
7736 # If \a theStartLCS is NULL, displacement
7737 # will be performed from global CS.\n
7738 # If \a theObject itself is used as \a theStartLCS,
7739 # its location will be changed to \a theEndLCS.
7740 # @param theEndLCS Coordinate system to perform displacement to it.
7741 # @param theCopy Flag used to displace object itself or create a copy.
7742 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7743 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7744 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7746 Modify the Location of the given object by LCS, creating its copy before the setting.
7749 theObject The object to be displaced.
7750 theStartLCS Coordinate system to perform displacement from it.
7751 If theStartLCS is NULL, displacement
7752 will be performed from global CS.
7753 If theObject itself is used as theStartLCS,
7754 its location will be changed to theEndLCS.
7755 theEndLCS Coordinate system to perform displacement to it.
7756 theCopy Flag used to displace object itself or create a copy.
7759 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7760 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7762 # Example: see GEOM_TestAll.py
7764 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7766 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7767 RaiseIfFailed("Displace", self.TrsfOp)
7770 ## Modify the Location of the given object by LCS,
7771 # creating its copy before the setting.
7772 # @param theObject The object to be displaced.
7773 # @param theStartLCS Coordinate system to perform displacement from it.\n
7774 # If \a theStartLCS is NULL, displacement
7775 # will be performed from global CS.\n
7776 # If \a theObject itself is used as \a theStartLCS,
7777 # its location will be changed to \a theEndLCS.
7778 # @param theEndLCS Coordinate system to perform displacement to it.
7779 # @param theName Object name; when specified, this parameter is used
7780 # for result publication in the study. Otherwise, if automatic
7781 # publication is switched on, default value is used for result name.
7783 # @return New GEOM.GEOM_Object, containing the displaced shape.
7785 # @ref tui_modify_location "Example"
7786 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7788 Modify the Location of the given object by LCS, creating its copy before the setting.
7791 theObject The object to be displaced.
7792 theStartLCS Coordinate system to perform displacement from it.
7793 If theStartLCS is NULL, displacement
7794 will be performed from global CS.
7795 If theObject itself is used as theStartLCS,
7796 its location will be changed to theEndLCS.
7797 theEndLCS Coordinate system to perform displacement to it.
7798 theName Object name; when specified, this parameter is used
7799 for result publication in the study. Otherwise, if automatic
7800 publication is switched on, default value is used for result name.
7803 New GEOM.GEOM_Object, containing the displaced shape.
7806 # create local coordinate systems
7807 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7808 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7809 # modify the location of the given object
7810 position = geompy.MakePosition(cylinder, cs1, cs2)
7812 # Example: see GEOM_TestAll.py
7813 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7814 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7815 self._autoPublish(anObj, theName, "displaced")
7818 ## Modify the Location of the given object by Path.
7819 # @param theObject The object to be displaced.
7820 # @param thePath Wire or Edge along that the object will be translated.
7821 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7822 # @param theCopy is to create a copy objects if true.
7823 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7824 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7825 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7827 # @ref tui_modify_location "Example"
7828 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7830 Modify the Location of the given object by Path.
7833 theObject The object to be displaced.
7834 thePath Wire or Edge along that the object will be translated.
7835 theDistance progress of Path (0 = start location, 1 = end of path location).
7836 theCopy is to create a copy objects if true.
7837 theReverse 0 - for usual direction, 1 - to reverse path direction.
7840 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7841 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7844 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7846 # Example: see GEOM_TestAll.py
7847 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7848 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7851 ## Modify the Location of the given object by Path, creating its copy before the operation.
7852 # @param theObject The object to be displaced.
7853 # @param thePath Wire or Edge along that the object will be translated.
7854 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7855 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7856 # @param theName Object name; when specified, this parameter is used
7857 # for result publication in the study. Otherwise, if automatic
7858 # publication is switched on, default value is used for result name.
7860 # @return New GEOM.GEOM_Object, containing the displaced shape.
7861 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7863 Modify the Location of the given object by Path, creating its copy before the operation.
7866 theObject The object to be displaced.
7867 thePath Wire or Edge along that the object will be translated.
7868 theDistance progress of Path (0 = start location, 1 = end of path location).
7869 theReverse 0 - for usual direction, 1 - to reverse path direction.
7870 theName Object name; when specified, this parameter is used
7871 for result publication in the study. Otherwise, if automatic
7872 publication is switched on, default value is used for result name.
7875 New GEOM.GEOM_Object, containing the displaced shape.
7877 # Example: see GEOM_TestAll.py
7878 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7879 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7880 self._autoPublish(anObj, theName, "displaced")
7883 ## Offset given shape.
7884 # @param theObject The base object for the offset.
7885 # @param theOffset Offset value.
7886 # @param theCopy Flag used to offset object itself or create a copy.
7887 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7888 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7889 def Offset(self, theObject, theOffset, theCopy=False):
7894 theObject The base object for the offset.
7895 theOffset Offset value.
7896 theCopy Flag used to offset object itself or create a copy.
7899 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7900 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7902 theOffset, Parameters = ParseParameters(theOffset)
7904 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7906 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7907 RaiseIfFailed("Offset", self.TrsfOp)
7908 anObj.SetParameters(Parameters)
7911 ## Create new object as offset of the given one.
7912 # @param theObject The base object for the offset.
7913 # @param theOffset Offset value.
7914 # @param theName Object name; when specified, this parameter is used
7915 # for result publication in the study. Otherwise, if automatic
7916 # publication is switched on, default value is used for result name.
7918 # @return New GEOM.GEOM_Object, containing the offset object.
7920 # @ref tui_offset "Example"
7921 def MakeOffset(self, theObject, theOffset, theName=None):
7923 Create new object as offset of the given one.
7926 theObject The base object for the offset.
7927 theOffset Offset value.
7928 theName Object name; when specified, this parameter is used
7929 for result publication in the study. Otherwise, if automatic
7930 publication is switched on, default value is used for result name.
7933 New GEOM.GEOM_Object, containing the offset object.
7936 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7937 # create a new object as offset of the given object
7938 offset = geompy.MakeOffset(box, 70.)
7940 # Example: see GEOM_TestAll.py
7941 theOffset, Parameters = ParseParameters(theOffset)
7942 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7943 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7944 anObj.SetParameters(Parameters)
7945 self._autoPublish(anObj, theName, "offset")
7948 ## Create new object as projection of the given one on a 2D surface.
7949 # @param theSource The source object for the projection. It can be a point, edge or wire.
7950 # @param theTarget The target object. It can be planar or cylindrical face.
7951 # @param theName Object name; when specified, this parameter is used
7952 # for result publication in the study. Otherwise, if automatic
7953 # publication is switched on, default value is used for result name.
7955 # @return New GEOM.GEOM_Object, containing the projection.
7957 # @ref tui_projection "Example"
7958 def MakeProjection(self, theSource, theTarget, theName=None):
7960 Create new object as projection of the given one on a 2D surface.
7963 theSource The source object for the projection. It can be a point, edge or wire.
7964 theTarget The target object. It can be planar or cylindrical face.
7965 theName Object name; when specified, this parameter is used
7966 for result publication in the study. Otherwise, if automatic
7967 publication is switched on, default value is used for result name.
7970 New GEOM.GEOM_Object, containing the projection.
7972 # Example: see GEOM_TestAll.py
7973 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7974 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7975 self._autoPublish(anObj, theName, "projection")
7978 # -----------------------------------------------------------------------------
7980 # -----------------------------------------------------------------------------
7982 ## Translate the given object along the given vector a given number times
7983 # @param theObject The object to be translated.
7984 # @param theVector Direction of the translation. DX if None.
7985 # @param theStep Distance to translate on.
7986 # @param theNbTimes Quantity of translations to be done.
7987 # @param theName Object name; when specified, this parameter is used
7988 # for result publication in the study. Otherwise, if automatic
7989 # publication is switched on, default value is used for result name.
7991 # @return New GEOM.GEOM_Object, containing compound of all
7992 # the shapes, obtained after each translation.
7994 # @ref tui_multi_translation "Example"
7995 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7997 Translate the given object along the given vector a given number times
8000 theObject The object to be translated.
8001 theVector Direction of the translation. DX if None.
8002 theStep Distance to translate on.
8003 theNbTimes Quantity of translations to be done.
8004 theName Object name; when specified, this parameter is used
8005 for result publication in the study. Otherwise, if automatic
8006 publication is switched on, default value is used for result name.
8009 New GEOM.GEOM_Object, containing compound of all
8010 the shapes, obtained after each translation.
8013 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8015 # Example: see GEOM_TestAll.py
8016 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8017 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8018 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8019 anObj.SetParameters(Parameters)
8020 self._autoPublish(anObj, theName, "multitranslation")
8023 ## Conseqently apply two specified translations to theObject specified number of times.
8024 # @param theObject The object to be translated.
8025 # @param theVector1 Direction of the first translation. DX if None.
8026 # @param theStep1 Step of the first translation.
8027 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8028 # @param theVector2 Direction of the second translation. DY if None.
8029 # @param theStep2 Step of the second translation.
8030 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8031 # @param theName Object name; when specified, this parameter is used
8032 # for result publication in the study. Otherwise, if automatic
8033 # publication is switched on, default value is used for result name.
8035 # @return New GEOM.GEOM_Object, containing compound of all
8036 # the shapes, obtained after each translation.
8038 # @ref tui_multi_translation "Example"
8039 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8040 theVector2, theStep2, theNbTimes2, theName=None):
8042 Conseqently apply two specified translations to theObject specified number of times.
8045 theObject The object to be translated.
8046 theVector1 Direction of the first translation. DX if None.
8047 theStep1 Step of the first translation.
8048 theNbTimes1 Quantity of translations to be done along theVector1.
8049 theVector2 Direction of the second translation. DY if None.
8050 theStep2 Step of the second translation.
8051 theNbTimes2 Quantity of translations to be done along theVector2.
8052 theName Object name; when specified, this parameter is used
8053 for result publication in the study. Otherwise, if automatic
8054 publication is switched on, default value is used for result name.
8057 New GEOM.GEOM_Object, containing compound of all
8058 the shapes, obtained after each translation.
8061 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8063 # Example: see GEOM_TestAll.py
8064 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8065 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8066 theVector2, theStep2, theNbTimes2)
8067 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8068 anObj.SetParameters(Parameters)
8069 self._autoPublish(anObj, theName, "multitranslation")
8072 ## Rotate the given object around the given axis a given number times.
8073 # Rotation angle will be 2*PI/theNbTimes.
8074 # @param theObject The object to be rotated.
8075 # @param theAxis The rotation axis. DZ if None.
8076 # @param theNbTimes Quantity of rotations to be done.
8077 # @param theName Object name; when specified, this parameter is used
8078 # for result publication in the study. Otherwise, if automatic
8079 # publication is switched on, default value is used for result name.
8081 # @return New GEOM.GEOM_Object, containing compound of all the
8082 # shapes, obtained after each rotation.
8084 # @ref tui_multi_rotation "Example"
8085 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8087 Rotate the given object around the given axis a given number times.
8088 Rotation angle will be 2*PI/theNbTimes.
8091 theObject The object to be rotated.
8092 theAxis The rotation axis. DZ if None.
8093 theNbTimes Quantity of rotations to be done.
8094 theName Object name; when specified, this parameter is used
8095 for result publication in the study. Otherwise, if automatic
8096 publication is switched on, default value is used for result name.
8099 New GEOM.GEOM_Object, containing compound of all the
8100 shapes, obtained after each rotation.
8103 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8105 # Example: see GEOM_TestAll.py
8106 theNbTimes, Parameters = ParseParameters(theNbTimes)
8107 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8108 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8109 anObj.SetParameters(Parameters)
8110 self._autoPublish(anObj, theName, "multirotation")
8113 ## Rotate the given object around the given axis
8114 # a given number times on the given angle.
8115 # @param theObject The object to be rotated.
8116 # @param theAxis The rotation axis. DZ if None.
8117 # @param theAngleStep Rotation angle in radians.
8118 # @param theNbTimes Quantity of rotations to be done.
8119 # @param theName Object name; when specified, this parameter is used
8120 # for result publication in the study. Otherwise, if automatic
8121 # publication is switched on, default value is used for result name.
8123 # @return New GEOM.GEOM_Object, containing compound of all the
8124 # shapes, obtained after each rotation.
8126 # @ref tui_multi_rotation "Example"
8127 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8129 Rotate the given object around the given axis
8130 a given number times on the given angle.
8133 theObject The object to be rotated.
8134 theAxis The rotation axis. DZ if None.
8135 theAngleStep Rotation angle in radians.
8136 theNbTimes Quantity of rotations to be done.
8137 theName Object name; when specified, this parameter is used
8138 for result publication in the study. Otherwise, if automatic
8139 publication is switched on, default value is used for result name.
8142 New GEOM.GEOM_Object, containing compound of all the
8143 shapes, obtained after each rotation.
8146 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8148 # Example: see GEOM_TestAll.py
8149 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8150 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8151 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8152 anObj.SetParameters(Parameters)
8153 self._autoPublish(anObj, theName, "multirotation")
8156 ## Rotate the given object around the given axis a given
8157 # number times and multi-translate each rotation result.
8158 # Rotation angle will be 2*PI/theNbTimes1.
8159 # Translation direction passes through center of gravity
8160 # of rotated shape and its projection on the rotation axis.
8161 # @param theObject The object to be rotated.
8162 # @param theAxis Rotation axis. DZ if None.
8163 # @param theNbTimes1 Quantity of rotations to be done.
8164 # @param theRadialStep Translation distance.
8165 # @param theNbTimes2 Quantity of translations to be done.
8166 # @param theName Object name; when specified, this parameter is used
8167 # for result publication in the study. Otherwise, if automatic
8168 # publication is switched on, default value is used for result name.
8170 # @return New GEOM.GEOM_Object, containing compound of all the
8171 # shapes, obtained after each transformation.
8173 # @ref tui_multi_rotation "Example"
8174 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8176 Rotate the given object around the
8177 given axis on the given angle a given number
8178 times and multi-translate each rotation result.
8179 Translation direction passes through center of gravity
8180 of rotated shape and its projection on the rotation axis.
8183 theObject The object to be rotated.
8184 theAxis Rotation axis. DZ if None.
8185 theNbTimes1 Quantity of rotations to be done.
8186 theRadialStep Translation distance.
8187 theNbTimes2 Quantity of translations to be done.
8188 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.
8193 New GEOM.GEOM_Object, containing compound of all the
8194 shapes, obtained after each transformation.
8197 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8199 # Example: see GEOM_TestAll.py
8200 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8201 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8202 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8203 anObj.SetParameters(Parameters)
8204 self._autoPublish(anObj, theName, "multirotation")
8207 ## Rotate the given object around the
8208 # given axis on the given angle a given number
8209 # times and multi-translate each rotation result.
8210 # Translation direction passes through center of gravity
8211 # of rotated shape and its projection on the rotation axis.
8212 # @param theObject The object to be rotated.
8213 # @param theAxis Rotation axis. DZ if None.
8214 # @param theAngleStep Rotation angle in radians.
8215 # @param theNbTimes1 Quantity of rotations to be done.
8216 # @param theRadialStep Translation distance.
8217 # @param theNbTimes2 Quantity of translations to be done.
8218 # @param theName Object name; when specified, this parameter is used
8219 # for result publication in the study. Otherwise, if automatic
8220 # publication is switched on, default value is used for result name.
8222 # @return New GEOM.GEOM_Object, containing compound of all the
8223 # shapes, obtained after each transformation.
8225 # @ref tui_multi_rotation "Example"
8226 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8228 Rotate the given object around the
8229 given axis on the given angle a given number
8230 times and multi-translate each rotation result.
8231 Translation direction passes through center of gravity
8232 of rotated shape and its projection on the rotation axis.
8235 theObject The object to be rotated.
8236 theAxis Rotation axis. DZ if None.
8237 theAngleStep Rotation angle in radians.
8238 theNbTimes1 Quantity of rotations to be done.
8239 theRadialStep Translation distance.
8240 theNbTimes2 Quantity of translations to be done.
8241 theName Object name; when specified, this parameter is used
8242 for result publication in the study. Otherwise, if automatic
8243 publication is switched on, default value is used for result name.
8246 New GEOM.GEOM_Object, containing compound of all the
8247 shapes, obtained after each transformation.
8250 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8252 # Example: see GEOM_TestAll.py
8253 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8254 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8255 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8256 anObj.SetParameters(Parameters)
8257 self._autoPublish(anObj, theName, "multirotation")
8260 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8262 # @ref swig_MakeMultiRotation "Example"
8263 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8265 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8268 pz = geompy.MakeVertex(0, 0, 100)
8269 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8270 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8272 # Example: see GEOM_TestOthers.py
8273 aVec = self.MakeLine(aPoint,aDir)
8274 # note: auto-publishing is done in self.MultiRotate1D()
8275 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8278 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8280 # @ref swig_MakeMultiRotation "Example"
8281 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8283 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8286 pz = geompy.MakeVertex(0, 0, 100)
8287 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8288 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8290 # Example: see GEOM_TestOthers.py
8291 aVec = self.MakeLine(aPoint,aDir)
8292 # note: auto-publishing is done in self.MultiRotate1D()
8293 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8296 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8298 # @ref swig_MakeMultiRotation "Example"
8299 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8301 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8304 pz = geompy.MakeVertex(0, 0, 100)
8305 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8306 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8308 # Example: see GEOM_TestOthers.py
8309 aVec = self.MakeLine(aPoint,aDir)
8310 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8311 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8314 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8316 # @ref swig_MakeMultiRotation "Example"
8317 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8319 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8322 pz = geompy.MakeVertex(0, 0, 100)
8323 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8324 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8326 # Example: see GEOM_TestOthers.py
8327 aVec = self.MakeLine(aPoint,aDir)
8328 # note: auto-publishing is done in self.MultiRotate2D()
8329 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8332 # end of l3_transform
8335 ## @addtogroup l3_transform_d
8338 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8339 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8341 Deprecated method. Use MultiRotate1DNbTimes instead.
8343 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8344 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8346 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8347 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8348 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8350 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8351 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8354 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8356 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8357 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8358 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8359 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8360 anObj.SetParameters(Parameters)
8361 self._autoPublish(anObj, theName, "multirotation")
8364 ## The same, as MultiRotate1D(), but axis is given by direction and point
8365 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8366 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8368 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8369 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8372 pz = geompy.MakeVertex(0, 0, 100)
8373 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8374 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8376 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8377 aVec = self.MakeLine(aPoint,aDir)
8378 # note: auto-publishing is done in self.MultiRotate1D()
8379 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8382 ## The same, as MultiRotate2D(), but axis is given by direction and point
8383 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8384 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8386 The same, as MultiRotate2D(), but axis is given by direction and point
8387 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8390 pz = geompy.MakeVertex(0, 0, 100)
8391 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8392 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8394 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8395 aVec = self.MakeLine(aPoint,aDir)
8396 # note: auto-publishing is done in self.MultiRotate2D()
8397 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8400 # end of l3_transform_d
8403 ## @addtogroup l3_local
8406 ## Perform a fillet on all edges of the given shape.
8407 # @param theShape Shape, to perform fillet on.
8408 # @param theR Fillet radius.
8409 # @param theName Object name; when specified, this parameter is used
8410 # for result publication in the study. Otherwise, if automatic
8411 # publication is switched on, default value is used for result name.
8413 # @return New GEOM.GEOM_Object, containing the result shape.
8415 # @ref tui_fillet "Example 1"
8416 # \n @ref swig_MakeFilletAll "Example 2"
8417 def MakeFilletAll(self, theShape, theR, theName=None):
8419 Perform a fillet on all edges of the given shape.
8422 theShape Shape, to perform fillet on.
8424 theName Object name; when specified, this parameter is used
8425 for result publication in the study. Otherwise, if automatic
8426 publication is switched on, default value is used for result name.
8429 New GEOM.GEOM_Object, containing the result shape.
8432 filletall = geompy.MakeFilletAll(prism, 10.)
8434 # Example: see GEOM_TestOthers.py
8435 theR,Parameters = ParseParameters(theR)
8436 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8437 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8438 anObj.SetParameters(Parameters)
8439 self._autoPublish(anObj, theName, "fillet")
8442 ## Perform a fillet on the specified edges/faces of the given shape
8443 # @param theShape Shape, to perform fillet on.
8444 # @param theR Fillet radius.
8445 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8446 # @param theListShapes Global indices of edges/faces to perform fillet on.
8447 # @param theName Object name; when specified, this parameter is used
8448 # for result publication in the study. Otherwise, if automatic
8449 # publication is switched on, default value is used for result name.
8451 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8453 # @return New GEOM.GEOM_Object, containing the result shape.
8455 # @ref tui_fillet "Example"
8456 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8458 Perform a fillet on the specified edges/faces of the given shape
8461 theShape Shape, to perform fillet on.
8463 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8464 theListShapes Global indices of edges/faces to perform fillet on.
8465 theName Object name; when specified, this parameter is used
8466 for result publication in the study. Otherwise, if automatic
8467 publication is switched on, default value is used for result name.
8470 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8473 New GEOM.GEOM_Object, containing the result shape.
8476 # get the list of IDs (IDList) for the fillet
8477 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8479 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8480 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8481 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8482 # make a fillet on the specified edges of the given shape
8483 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8485 # Example: see GEOM_TestAll.py
8486 theR,Parameters = ParseParameters(theR)
8488 if theShapeType == self.ShapeType["EDGE"]:
8489 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8490 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8492 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8493 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8494 anObj.SetParameters(Parameters)
8495 self._autoPublish(anObj, theName, "fillet")
8498 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8499 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8501 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8504 # get the list of IDs (IDList) for the fillet
8505 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8507 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8508 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8509 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8510 # make a fillet on the specified edges of the given shape
8511 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8513 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8515 if theShapeType == self.ShapeType["EDGE"]:
8516 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8517 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8519 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8520 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8521 anObj.SetParameters(Parameters)
8522 self._autoPublish(anObj, theName, "fillet")
8525 ## Perform a fillet on the specified edges of the given shape
8526 # @param theShape Wire Shape to perform fillet on.
8527 # @param theR Fillet radius.
8528 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8529 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8530 # \note The list of vertices could be empty,
8531 # in this case fillet will done done at all vertices in wire
8532 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8533 # by the length of the edges, nearest to the fillet vertex.
8534 # But sometimes the next edge is C1 continuous with the one, nearest to
8535 # the fillet point, and such two (or more) edges can be united to allow
8536 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8537 # thus ignoring the secant vertex (vertices).
8538 # @param theName Object name; when specified, this parameter is used
8539 # for result publication in the study. Otherwise, if automatic
8540 # publication is switched on, default value is used for result name.
8542 # @return New GEOM.GEOM_Object, containing the result shape.
8544 # @ref tui_fillet2d "Example"
8545 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8547 Perform a fillet on the specified edges of the given shape
8550 theShape Wire Shape to perform fillet on.
8552 theListOfVertexes Global indices of vertexes to perform fillet on.
8553 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8554 by the length of the edges, nearest to the fillet vertex.
8555 But sometimes the next edge is C1 continuous with the one, nearest to
8556 the fillet point, and such two (or more) edges can be united to allow
8557 bigger radius. Set this flag to TRUE to allow collinear edges union,
8558 thus ignoring the secant vertex (vertices).
8559 theName Object name; when specified, this parameter is used
8560 for result publication in the study. Otherwise, if automatic
8561 publication is switched on, default value is used for result name.
8563 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8565 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8568 New GEOM.GEOM_Object, containing the result shape.
8572 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8573 # make fillet at given wire vertices with giver radius
8574 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8576 # Example: see GEOM_TestAll.py
8577 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8578 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8579 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8580 anObj.SetParameters(Parameters)
8581 self._autoPublish(anObj, theName, "fillet")
8584 ## Perform a fillet at the specified vertices of the given face/shell.
8585 # @param theShape Face or Shell shape to perform fillet on.
8586 # @param theR Fillet radius.
8587 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8588 # @param theName Object name; when specified, this parameter is used
8589 # for result publication in the study. Otherwise, if automatic
8590 # publication is switched on, default value is used for result name.
8592 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8594 # @return New GEOM.GEOM_Object, containing the result shape.
8596 # @ref tui_fillet2d "Example"
8597 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8599 Perform a fillet at the specified vertices of the given face/shell.
8602 theShape Face or Shell shape to perform fillet on.
8604 theListOfVertexes Global indices of vertexes to perform fillet on.
8605 theName Object name; when specified, this parameter is used
8606 for result publication in the study. Otherwise, if automatic
8607 publication is switched on, default value is used for result name.
8609 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8612 New GEOM.GEOM_Object, containing the result shape.
8615 face = geompy.MakeFaceHW(100, 100, 1)
8616 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8618 # Example: see GEOM_TestAll.py
8619 theR,Parameters = ParseParameters(theR)
8620 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8621 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8622 anObj.SetParameters(Parameters)
8623 self._autoPublish(anObj, theName, "fillet")
8626 ## Perform a symmetric chamfer on all edges of the given shape.
8627 # @param theShape Shape, to perform chamfer on.
8628 # @param theD Chamfer size along each face.
8629 # @param theName Object name; when specified, this parameter is used
8630 # for result publication in the study. Otherwise, if automatic
8631 # publication is switched on, default value is used for result name.
8633 # @return New GEOM.GEOM_Object, containing the result shape.
8635 # @ref tui_chamfer "Example 1"
8636 # \n @ref swig_MakeChamferAll "Example 2"
8637 def MakeChamferAll(self, theShape, theD, theName=None):
8639 Perform a symmetric chamfer on all edges of the given shape.
8642 theShape Shape, to perform chamfer on.
8643 theD Chamfer size along each face.
8644 theName Object name; when specified, this parameter is used
8645 for result publication in the study. Otherwise, if automatic
8646 publication is switched on, default value is used for result name.
8649 New GEOM.GEOM_Object, containing the result shape.
8652 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8654 # Example: see GEOM_TestOthers.py
8655 theD,Parameters = ParseParameters(theD)
8656 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8657 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8658 anObj.SetParameters(Parameters)
8659 self._autoPublish(anObj, theName, "chamfer")
8662 ## Perform a chamfer on edges, common to the specified faces,
8663 # with distance D1 on the Face1
8664 # @param theShape Shape, to perform chamfer on.
8665 # @param theD1 Chamfer size along \a theFace1.
8666 # @param theD2 Chamfer size along \a theFace2.
8667 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8668 # @param theName Object name; when specified, this parameter is used
8669 # for result publication in the study. Otherwise, if automatic
8670 # publication is switched on, default value is used for result name.
8672 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8674 # @return New GEOM.GEOM_Object, containing the result shape.
8676 # @ref tui_chamfer "Example"
8677 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8679 Perform a chamfer on edges, common to the specified faces,
8680 with distance D1 on the Face1
8683 theShape Shape, to perform chamfer on.
8684 theD1 Chamfer size along theFace1.
8685 theD2 Chamfer size along theFace2.
8686 theFace1,theFace2 Global indices of two faces of theShape.
8687 theName Object name; when specified, this parameter is used
8688 for result publication in the study. Otherwise, if automatic
8689 publication is switched on, default value is used for result name.
8692 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8695 New GEOM.GEOM_Object, containing the result shape.
8698 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8699 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8700 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8701 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8703 # Example: see GEOM_TestAll.py
8704 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8705 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8706 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8707 anObj.SetParameters(Parameters)
8708 self._autoPublish(anObj, theName, "chamfer")
8711 ## Perform a chamfer on edges
8712 # @param theShape Shape, to perform chamfer on.
8713 # @param theD Chamfer length
8714 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8715 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8716 # @param theName Object name; when specified, this parameter is used
8717 # for result publication in the study. Otherwise, if automatic
8718 # publication is switched on, default value is used for result name.
8720 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8722 # @return New GEOM.GEOM_Object, containing the result shape.
8723 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8725 Perform a chamfer on edges
8728 theShape Shape, to perform chamfer on.
8729 theD1 Chamfer size along theFace1.
8730 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8731 theFace1,theFace2 Global indices of two faces of theShape.
8732 theName Object name; when specified, this parameter is used
8733 for result publication in the study. Otherwise, if automatic
8734 publication is switched on, default value is used for result name.
8737 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8740 New GEOM.GEOM_Object, containing the result shape.
8743 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8744 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8745 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8747 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8750 if isinstance(theAngle,str):
8752 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8754 theAngle = theAngle*math.pi/180.0
8755 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8756 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8757 anObj.SetParameters(Parameters)
8758 self._autoPublish(anObj, theName, "chamfer")
8761 ## Perform a chamfer on all edges of the specified faces,
8762 # with distance D1 on the first specified face (if several for one edge)
8763 # @param theShape Shape, to perform chamfer on.
8764 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8765 # connected to the edge, are in \a theFaces, \a theD1
8766 # will be get along face, which is nearer to \a theFaces beginning.
8767 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8768 # @param theFaces Sequence of global indices of faces of \a theShape.
8769 # @param theName Object name; when specified, this parameter is used
8770 # for result publication in the study. Otherwise, if automatic
8771 # publication is switched on, default value is used for result name.
8773 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8775 # @return New GEOM.GEOM_Object, containing the result shape.
8777 # @ref tui_chamfer "Example"
8778 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8780 Perform a chamfer on all edges of the specified faces,
8781 with distance D1 on the first specified face (if several for one edge)
8784 theShape Shape, to perform chamfer on.
8785 theD1 Chamfer size along face from theFaces. If both faces,
8786 connected to the edge, are in theFaces, theD1
8787 will be get along face, which is nearer to theFaces beginning.
8788 theD2 Chamfer size along another of two faces, connected to the edge.
8789 theFaces Sequence of global indices of faces of theShape.
8790 theName Object name; when specified, this parameter is used
8791 for result publication in the study. Otherwise, if automatic
8792 publication is switched on, default value is used for result name.
8794 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8797 New GEOM.GEOM_Object, containing the result shape.
8799 # Example: see GEOM_TestAll.py
8800 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8801 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8802 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8803 anObj.SetParameters(Parameters)
8804 self._autoPublish(anObj, theName, "chamfer")
8807 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8808 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8810 # @ref swig_FilletChamfer "Example"
8811 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8813 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8814 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8817 if isinstance(theAngle,str):
8819 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8821 theAngle = theAngle*math.pi/180.0
8822 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8823 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8824 anObj.SetParameters(Parameters)
8825 self._autoPublish(anObj, theName, "chamfer")
8828 ## Perform a chamfer on edges,
8829 # with distance D1 on the first specified face (if several for one edge)
8830 # @param theShape Shape, to perform chamfer on.
8831 # @param theD1,theD2 Chamfer size
8832 # @param theEdges Sequence of edges of \a theShape.
8833 # @param theName Object name; when specified, this parameter is used
8834 # for result publication in the study. Otherwise, if automatic
8835 # publication is switched on, default value is used for result name.
8837 # @return New GEOM.GEOM_Object, containing the result shape.
8839 # @ref swig_FilletChamfer "Example"
8840 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8842 Perform a chamfer on edges,
8843 with distance D1 on the first specified face (if several for one edge)
8846 theShape Shape, to perform chamfer on.
8847 theD1,theD2 Chamfer size
8848 theEdges Sequence of edges of theShape.
8849 theName Object name; when specified, this parameter is used
8850 for result publication in the study. Otherwise, if automatic
8851 publication is switched on, default value is used for result name.
8854 New GEOM.GEOM_Object, containing the result shape.
8856 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8857 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8858 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8859 anObj.SetParameters(Parameters)
8860 self._autoPublish(anObj, theName, "chamfer")
8863 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8864 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8865 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8867 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8868 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8871 if isinstance(theAngle,str):
8873 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8875 theAngle = theAngle*math.pi/180.0
8876 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8877 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8878 anObj.SetParameters(Parameters)
8879 self._autoPublish(anObj, theName, "chamfer")
8882 ## @sa MakeChamferEdge(), MakeChamferFaces()
8884 # @ref swig_MakeChamfer "Example"
8885 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8887 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8889 # Example: see GEOM_TestOthers.py
8891 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8892 if aShapeType == self.ShapeType["EDGE"]:
8893 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8895 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8898 ## Remove material from a solid by extrusion of the base shape on the given distance.
8899 # @param theInit Shape to remove material from. It must be a solid or
8900 # a compound made of a single solid.
8901 # @param theBase Closed edge or wire defining the base shape to be extruded.
8902 # @param theH Prism dimension along the normal to theBase
8903 # @param theAngle Draft angle in degrees.
8904 # @param theName Object name; when specified, this parameter is used
8905 # for result publication in the study. Otherwise, if automatic
8906 # publication is switched on, default value is used for result name.
8908 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8910 # @ref tui_creation_prism "Example"
8911 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8913 Add material to a solid by extrusion of the base shape on the given distance.
8916 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8917 theBase Closed edge or wire defining the base shape to be extruded.
8918 theH Prism dimension along the normal to theBase
8919 theAngle Draft angle in degrees.
8920 theName Object name; when specified, this parameter is used
8921 for result publication in the study. Otherwise, if automatic
8922 publication is switched on, default value is used for result name.
8925 New GEOM.GEOM_Object, containing the initial shape with removed material.
8927 # Example: see GEOM_TestAll.py
8928 #theH,Parameters = ParseParameters(theH)
8929 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8930 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8931 #anObj.SetParameters(Parameters)
8932 self._autoPublish(anObj, theName, "extrudedCut")
8935 ## Add material to a solid by extrusion of the base shape on the given distance.
8936 # @param theInit Shape to add material to. It must be a solid or
8937 # a compound made of a single solid.
8938 # @param theBase Closed edge or wire defining the base shape to be extruded.
8939 # @param theH Prism dimension along the normal to theBase
8940 # @param theAngle Draft angle in degrees.
8941 # @param theName Object name; when specified, this parameter is used
8942 # for result publication in the study. Otherwise, if automatic
8943 # publication is switched on, default value is used for result name.
8945 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8947 # @ref tui_creation_prism "Example"
8948 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8950 Add material to a solid by extrusion of the base shape on the given distance.
8953 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8954 theBase Closed edge or wire defining the base shape to be extruded.
8955 theH Prism dimension along the normal to theBase
8956 theAngle Draft angle in degrees.
8957 theName Object name; when specified, this parameter is used
8958 for result publication in the study. Otherwise, if automatic
8959 publication is switched on, default value is used for result name.
8962 New GEOM.GEOM_Object, containing the initial shape with added material.
8964 # Example: see GEOM_TestAll.py
8965 #theH,Parameters = ParseParameters(theH)
8966 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8967 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8968 #anObj.SetParameters(Parameters)
8969 self._autoPublish(anObj, theName, "extrudedBoss")
8975 ## @addtogroup l3_basic_op
8978 ## Perform an Archimde operation on the given shape with given parameters.
8979 # The object presenting the resulting face is returned.
8980 # @param theShape Shape to be put in water.
8981 # @param theWeight Weight og the shape.
8982 # @param theWaterDensity Density of the water.
8983 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8984 # @param theName Object name; when specified, this parameter is used
8985 # for result publication in the study. Otherwise, if automatic
8986 # publication is switched on, default value is used for result name.
8988 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8989 # by a plane, corresponding to water level.
8991 # @ref tui_archimede "Example"
8992 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8994 Perform an Archimde operation on the given shape with given parameters.
8995 The object presenting the resulting face is returned.
8998 theShape Shape to be put in water.
8999 theWeight Weight og the shape.
9000 theWaterDensity Density of the water.
9001 theMeshDeflection Deflection of the mesh, using to compute the section.
9002 theName Object name; when specified, this parameter is used
9003 for result publication in the study. Otherwise, if automatic
9004 publication is switched on, default value is used for result name.
9007 New GEOM.GEOM_Object, containing a section of theShape
9008 by a plane, corresponding to water level.
9010 # Example: see GEOM_TestAll.py
9011 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9012 theWeight,theWaterDensity,theMeshDeflection)
9013 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9014 RaiseIfFailed("MakeArchimede", self.LocalOp)
9015 anObj.SetParameters(Parameters)
9016 self._autoPublish(anObj, theName, "archimede")
9019 # end of l3_basic_op
9022 ## @addtogroup l2_measure
9025 ## Get point coordinates
9028 # @ref tui_measurement_tools_page "Example"
9029 def PointCoordinates(self,Point):
9031 Get point coordinates
9036 # Example: see GEOM_TestMeasures.py
9037 aTuple = self.MeasuOp.PointCoordinates(Point)
9038 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9041 ## Get vector coordinates
9044 # @ref tui_measurement_tools_page "Example"
9045 def VectorCoordinates(self,Vector):
9047 Get vector coordinates
9053 p1=self.GetFirstVertex(Vector)
9054 p2=self.GetLastVertex(Vector)
9056 X1=self.PointCoordinates(p1)
9057 X2=self.PointCoordinates(p2)
9059 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9062 ## Compute cross product
9063 # @return vector w=u^v
9065 # @ref tui_measurement_tools_page "Example"
9066 def CrossProduct(self, Vector1, Vector2):
9068 Compute cross product
9070 Returns: vector w=u^v
9072 u=self.VectorCoordinates(Vector1)
9073 v=self.VectorCoordinates(Vector2)
9074 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])
9078 ## Compute cross product
9079 # @return dot product p=u.v
9081 # @ref tui_measurement_tools_page "Example"
9082 def DotProduct(self, Vector1, Vector2):
9084 Compute cross product
9086 Returns: dot product p=u.v
9088 u=self.VectorCoordinates(Vector1)
9089 v=self.VectorCoordinates(Vector2)
9090 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9095 ## Get summarized length of all wires,
9096 # area of surface and volume of the given shape.
9097 # @param theShape Shape to define properties of.
9098 # @return [theLength, theSurfArea, theVolume]\n
9099 # theLength: Summarized length of all wires of the given shape.\n
9100 # theSurfArea: Area of surface of the given shape.\n
9101 # theVolume: Volume of the given shape.
9103 # @ref tui_measurement_tools_page "Example"
9104 def BasicProperties(self,theShape):
9106 Get summarized length of all wires,
9107 area of surface and volume of the given shape.
9110 theShape Shape to define properties of.
9113 [theLength, theSurfArea, theVolume]
9114 theLength: Summarized length of all wires of the given shape.
9115 theSurfArea: Area of surface of the given shape.
9116 theVolume: Volume of the given shape.
9118 # Example: see GEOM_TestMeasures.py
9119 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9120 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9123 ## Get parameters of bounding box of the given shape
9124 # @param theShape Shape to obtain bounding box of.
9125 # @param precise TRUE for precise computation; FALSE for fast one.
9126 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9127 # Xmin,Xmax: Limits of shape along OX axis.
9128 # Ymin,Ymax: Limits of shape along OY axis.
9129 # Zmin,Zmax: Limits of shape along OZ axis.
9131 # @ref tui_measurement_tools_page "Example"
9132 def BoundingBox (self, theShape, precise=False):
9134 Get parameters of bounding box of the given shape
9137 theShape Shape to obtain bounding box of.
9138 precise TRUE for precise computation; FALSE for fast one.
9141 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9142 Xmin,Xmax: Limits of shape along OX axis.
9143 Ymin,Ymax: Limits of shape along OY axis.
9144 Zmin,Zmax: Limits of shape along OZ axis.
9146 # Example: see GEOM_TestMeasures.py
9147 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9148 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9151 ## Get bounding box of the given shape
9152 # @param theShape Shape to obtain bounding box of.
9153 # @param precise TRUE for precise computation; FALSE for fast one.
9154 # @param theName Object name; when specified, this parameter is used
9155 # for result publication in the study. Otherwise, if automatic
9156 # publication is switched on, default value is used for result name.
9158 # @return New GEOM.GEOM_Object, containing the created box.
9160 # @ref tui_measurement_tools_page "Example"
9161 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9163 Get bounding box of the given shape
9166 theShape Shape to obtain bounding box of.
9167 precise TRUE for precise computation; FALSE for fast one.
9168 theName Object name; when specified, this parameter is used
9169 for result publication in the study. Otherwise, if automatic
9170 publication is switched on, default value is used for result name.
9173 New GEOM.GEOM_Object, containing the created box.
9175 # Example: see GEOM_TestMeasures.py
9176 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9177 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9178 self._autoPublish(anObj, theName, "bndbox")
9181 ## Get inertia matrix and moments of inertia of theShape.
9182 # @param theShape Shape to calculate inertia of.
9183 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9184 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9185 # Ix,Iy,Iz: Moments of inertia of the given shape.
9187 # @ref tui_measurement_tools_page "Example"
9188 def Inertia(self,theShape):
9190 Get inertia matrix and moments of inertia of theShape.
9193 theShape Shape to calculate inertia of.
9196 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9197 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9198 Ix,Iy,Iz: Moments of inertia of the given shape.
9200 # Example: see GEOM_TestMeasures.py
9201 aTuple = self.MeasuOp.GetInertia(theShape)
9202 RaiseIfFailed("GetInertia", self.MeasuOp)
9205 ## Get if coords are included in the shape (ST_IN or ST_ON)
9206 # @param theShape Shape
9207 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9208 # @param tolerance to be used (default is 1.0e-7)
9209 # @return list_of_boolean = [res1, res2, ...]
9210 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9212 Get if coords are included in the shape (ST_IN or ST_ON)
9216 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9217 tolerance to be used (default is 1.0e-7)
9220 list_of_boolean = [res1, res2, ...]
9222 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9224 ## Get minimal distance between the given shapes.
9225 # @param theShape1,theShape2 Shapes to find minimal distance between.
9226 # @return Value of the minimal distance between the given shapes.
9228 # @ref tui_measurement_tools_page "Example"
9229 def MinDistance(self, theShape1, theShape2):
9231 Get minimal distance between the given shapes.
9234 theShape1,theShape2 Shapes to find minimal distance between.
9237 Value of the minimal distance between the given shapes.
9239 # Example: see GEOM_TestMeasures.py
9240 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9241 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9244 ## Get minimal distance between the given shapes.
9245 # @param theShape1,theShape2 Shapes to find minimal distance between.
9246 # @return Value of the minimal distance between the given shapes, in form of list
9247 # [Distance, DX, DY, DZ].
9249 # @ref swig_all_measure "Example"
9250 def MinDistanceComponents(self, theShape1, theShape2):
9252 Get minimal distance between the given shapes.
9255 theShape1,theShape2 Shapes to find minimal distance between.
9258 Value of the minimal distance between the given shapes, in form of list
9259 [Distance, DX, DY, DZ]
9261 # Example: see GEOM_TestMeasures.py
9262 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9263 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9264 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9267 ## Get closest points of the given shapes.
9268 # @param theShape1,theShape2 Shapes to find closest points of.
9269 # @return The number of found solutions (-1 in case of infinite number of
9270 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9272 # @ref tui_measurement_tools_page "Example"
9273 def ClosestPoints (self, theShape1, theShape2):
9275 Get closest points of the given shapes.
9278 theShape1,theShape2 Shapes to find closest points of.
9281 The number of found solutions (-1 in case of infinite number of
9282 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9284 # Example: see GEOM_TestMeasures.py
9285 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9286 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9289 ## Get angle between the given shapes in degrees.
9290 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9291 # @note If both arguments are vectors, the angle is computed in accordance
9292 # with their orientations, otherwise the minimum angle is computed.
9293 # @return Value of the angle between the given shapes in degrees.
9295 # @ref tui_measurement_tools_page "Example"
9296 def GetAngle(self, theShape1, theShape2):
9298 Get angle between the given shapes in degrees.
9301 theShape1,theShape2 Lines or linear edges to find angle between.
9304 If both arguments are vectors, the angle is computed in accordance
9305 with their orientations, otherwise the minimum angle is computed.
9308 Value of the angle between the given shapes in degrees.
9310 # Example: see GEOM_TestMeasures.py
9311 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9312 RaiseIfFailed("GetAngle", self.MeasuOp)
9315 ## Get angle between the given shapes in radians.
9316 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9317 # @note If both arguments are vectors, the angle is computed in accordance
9318 # with their orientations, otherwise the minimum angle is computed.
9319 # @return Value of the angle between the given shapes in radians.
9321 # @ref tui_measurement_tools_page "Example"
9322 def GetAngleRadians(self, theShape1, theShape2):
9324 Get angle between the given shapes in radians.
9327 theShape1,theShape2 Lines or linear edges to find angle between.
9331 If both arguments are vectors, the angle is computed in accordance
9332 with their orientations, otherwise the minimum angle is computed.
9335 Value of the angle between the given shapes in radians.
9337 # Example: see GEOM_TestMeasures.py
9338 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9339 RaiseIfFailed("GetAngle", self.MeasuOp)
9342 ## Get angle between the given vectors in degrees.
9343 # @param theShape1,theShape2 Vectors to find angle between.
9344 # @param 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.
9346 # @return Value of the angle between the given vectors in degrees.
9348 # @ref tui_measurement_tools_page "Example"
9349 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9351 Get angle between the given vectors in degrees.
9354 theShape1,theShape2 Vectors to find angle between.
9355 theFlag If True, the normal vector is defined by the two vectors cross,
9356 if False, the opposite vector to the normal vector is used.
9359 Value of the angle between the given vectors in degrees.
9361 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9363 anAngle = 360. - anAngle
9364 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9367 ## The same as GetAngleVectors, but the result is in radians.
9368 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9370 Get angle between the given vectors in radians.
9373 theShape1,theShape2 Vectors to find angle between.
9374 theFlag If True, the normal vector is defined by the two vectors cross,
9375 if False, the opposite vector to the normal vector is used.
9378 Value of the angle between the given vectors in radians.
9380 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9383 ## @name Curve Curvature Measurement
9384 # Methods for receiving radius of curvature of curves
9385 # in the given point
9388 ## Measure curvature of a curve at a point, set by parameter.
9389 # @param theCurve a curve.
9390 # @param theParam parameter.
9391 # @return radius of curvature of \a theCurve.
9393 # @ref swig_todo "Example"
9394 def CurveCurvatureByParam(self, theCurve, theParam):
9396 Measure curvature of a curve at a point, set by parameter.
9403 radius of curvature of theCurve.
9405 # Example: see GEOM_TestMeasures.py
9406 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9407 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9410 ## Measure curvature of a curve at a point.
9411 # @param theCurve a curve.
9412 # @param thePoint given point.
9413 # @return radius of curvature of \a theCurve.
9415 # @ref swig_todo "Example"
9416 def CurveCurvatureByPoint(self, theCurve, thePoint):
9418 Measure curvature of a curve at a point.
9422 thePoint given point.
9425 radius of curvature of theCurve.
9427 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9428 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9432 ## @name Surface Curvature Measurement
9433 # Methods for receiving max and min radius of curvature of surfaces
9434 # in the given point
9437 ## Measure max radius of curvature of surface.
9438 # @param theSurf the given surface.
9439 # @param theUParam Value of U-parameter on the referenced surface.
9440 # @param theVParam Value of V-parameter on the referenced surface.
9441 # @return max radius of curvature of theSurf.
9443 ## @ref swig_todo "Example"
9444 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9446 Measure max radius of curvature of surface.
9449 theSurf the given surface.
9450 theUParam Value of U-parameter on the referenced surface.
9451 theVParam Value of V-parameter on the referenced surface.
9454 max radius of curvature of theSurf.
9456 # Example: see GEOM_TestMeasures.py
9457 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9458 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9461 ## Measure max radius of curvature of surface in the given point
9462 # @param theSurf the given surface.
9463 # @param thePoint given point.
9464 # @return max radius of curvature of theSurf.
9466 ## @ref swig_todo "Example"
9467 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9469 Measure max radius of curvature of surface in the given point.
9472 theSurf the given surface.
9473 thePoint given point.
9476 max radius of curvature of theSurf.
9478 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9479 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9482 ## Measure min radius of curvature of surface.
9483 # @param theSurf the given surface.
9484 # @param theUParam Value of U-parameter on the referenced surface.
9485 # @param theVParam Value of V-parameter on the referenced surface.
9486 # @return min radius of curvature of theSurf.
9488 ## @ref swig_todo "Example"
9489 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9491 Measure min radius of curvature of surface.
9494 theSurf the given surface.
9495 theUParam Value of U-parameter on the referenced surface.
9496 theVParam Value of V-parameter on the referenced surface.
9499 Min radius of curvature of theSurf.
9501 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9502 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9505 ## Measure min radius of curvature of surface in the given point
9506 # @param theSurf the given surface.
9507 # @param thePoint given point.
9508 # @return min radius of curvature of theSurf.
9510 ## @ref swig_todo "Example"
9511 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9513 Measure min radius of curvature of surface in the given point.
9516 theSurf the given surface.
9517 thePoint given point.
9520 Min radius of curvature of theSurf.
9522 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9523 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9527 ## Get min and max tolerances of sub-shapes of theShape
9528 # @param theShape Shape, to get tolerances of.
9529 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9530 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9531 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9532 # VertMin,VertMax: Min and max tolerances of the vertices.
9534 # @ref tui_measurement_tools_page "Example"
9535 def Tolerance(self,theShape):
9537 Get min and max tolerances of sub-shapes of theShape
9540 theShape Shape, to get tolerances of.
9543 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9544 FaceMin,FaceMax: Min and max tolerances of the faces.
9545 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9546 VertMin,VertMax: Min and max tolerances of the vertices.
9548 # Example: see GEOM_TestMeasures.py
9549 aTuple = self.MeasuOp.GetTolerance(theShape)
9550 RaiseIfFailed("GetTolerance", self.MeasuOp)
9553 ## Obtain description of the given shape (number of sub-shapes of each type)
9554 # @param theShape Shape to be described.
9555 # @return Description of the given shape.
9557 # @ref tui_measurement_tools_page "Example"
9558 def WhatIs(self,theShape):
9560 Obtain description of the given shape (number of sub-shapes of each type)
9563 theShape Shape to be described.
9566 Description of the given shape.
9568 # Example: see GEOM_TestMeasures.py
9569 aDescr = self.MeasuOp.WhatIs(theShape)
9570 RaiseIfFailed("WhatIs", self.MeasuOp)
9573 ## Obtain quantity of shapes of the given type in \a theShape.
9574 # If \a theShape is of type \a theType, it is also counted.
9575 # @param theShape Shape to be described.
9576 # @param theType the given ShapeType().
9577 # @return Quantity of shapes of type \a theType in \a theShape.
9579 # @ref tui_measurement_tools_page "Example"
9580 def NbShapes (self, theShape, theType):
9582 Obtain quantity of shapes of the given type in theShape.
9583 If theShape is of type theType, it is also counted.
9586 theShape Shape to be described.
9587 theType the given geompy.ShapeType
9590 Quantity of shapes of type theType in theShape.
9592 # Example: see GEOM_TestMeasures.py
9593 listSh = self.SubShapeAllIDs(theShape, theType)
9595 t = EnumToLong(theShape.GetShapeType())
9596 theType = EnumToLong(theType)
9602 ## Obtain quantity of shapes of each type in \a theShape.
9603 # The \a theShape is also counted.
9604 # @param theShape Shape to be described.
9605 # @return Dictionary of ShapeType() with bound quantities of shapes.
9607 # @ref tui_measurement_tools_page "Example"
9608 def ShapeInfo (self, theShape):
9610 Obtain quantity of shapes of each type in theShape.
9611 The theShape is also counted.
9614 theShape Shape to be described.
9617 Dictionary of geompy.ShapeType with bound quantities of shapes.
9619 # Example: see GEOM_TestMeasures.py
9621 for typeSh in self.ShapeType:
9622 if typeSh in ( "AUTO", "SHAPE" ): continue
9623 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9625 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9632 def GetCreationInformation(self, theShape):
9633 info = theShape.GetCreationInformation()
9635 opName = info.operationName
9636 if not opName: opName = "no info available"
9637 res = "Operation: " + opName
9639 for parVal in info.params:
9640 res += " \n %s = %s" % ( parVal.name, parVal.value )
9643 ## Get a point, situated at the centre of mass of theShape.
9644 # @param theShape Shape to define centre of mass of.
9645 # @param theName Object name; when specified, this parameter is used
9646 # for result publication in the study. Otherwise, if automatic
9647 # publication is switched on, default value is used for result name.
9649 # @return New GEOM.GEOM_Object, containing the created point.
9651 # @ref tui_measurement_tools_page "Example"
9652 def MakeCDG(self, theShape, theName=None):
9654 Get a point, situated at the centre of mass of theShape.
9657 theShape Shape to define centre of mass of.
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 point.
9665 # Example: see GEOM_TestMeasures.py
9666 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9667 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9668 self._autoPublish(anObj, theName, "centerOfMass")
9671 ## Get a vertex sub-shape by index depended with orientation.
9672 # @param theShape Shape to find sub-shape.
9673 # @param theIndex Index to find vertex by this index (starting from zero)
9674 # @param theName Object name; when specified, this parameter is used
9675 # for result publication in the study. Otherwise, if automatic
9676 # publication is switched on, default value is used for result name.
9678 # @return New GEOM.GEOM_Object, containing the created vertex.
9680 # @ref tui_measurement_tools_page "Example"
9681 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9683 Get a vertex sub-shape by index depended with orientation.
9686 theShape Shape to find sub-shape.
9687 theIndex Index to find vertex by this index (starting from zero)
9688 theName Object name; when specified, this parameter is used
9689 for result publication in the study. Otherwise, if automatic
9690 publication is switched on, default value is used for result name.
9693 New GEOM.GEOM_Object, containing the created vertex.
9695 # Example: see GEOM_TestMeasures.py
9696 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9697 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9698 self._autoPublish(anObj, theName, "vertex")
9701 ## Get the first vertex of wire/edge depended orientation.
9702 # @param theShape Shape to find first vertex.
9703 # @param theName Object name; when specified, this parameter is used
9704 # for result publication in the study. Otherwise, if automatic
9705 # publication is switched on, default value is used for result name.
9707 # @return New GEOM.GEOM_Object, containing the created vertex.
9709 # @ref tui_measurement_tools_page "Example"
9710 def GetFirstVertex(self, theShape, theName=None):
9712 Get the first vertex of wire/edge depended orientation.
9715 theShape Shape to find first vertex.
9716 theName Object name; when specified, this parameter is used
9717 for result publication in the study. Otherwise, if automatic
9718 publication is switched on, default value is used for result name.
9721 New GEOM.GEOM_Object, containing the created vertex.
9723 # Example: see GEOM_TestMeasures.py
9724 # note: auto-publishing is done in self.GetVertexByIndex()
9725 anObj = self.GetVertexByIndex(theShape, 0, theName)
9726 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9729 ## Get the last vertex of wire/edge depended orientation.
9730 # @param theShape Shape to find last vertex.
9731 # @param theName Object name; when specified, this parameter is used
9732 # for result publication in the study. Otherwise, if automatic
9733 # publication is switched on, default value is used for result name.
9735 # @return New GEOM.GEOM_Object, containing the created vertex.
9737 # @ref tui_measurement_tools_page "Example"
9738 def GetLastVertex(self, theShape, theName=None):
9740 Get the last vertex of wire/edge depended orientation.
9743 theShape Shape to find last vertex.
9744 theName Object name; when specified, this parameter is used
9745 for result publication in the study. Otherwise, if automatic
9746 publication is switched on, default value is used for result name.
9749 New GEOM.GEOM_Object, containing the created vertex.
9751 # Example: see GEOM_TestMeasures.py
9752 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9753 # note: auto-publishing is done in self.GetVertexByIndex()
9754 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9755 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9758 ## Get a normale to the given face. If the point is not given,
9759 # the normale is calculated at the center of mass.
9760 # @param theFace Face to define normale of.
9761 # @param theOptionalPoint Point to compute the normale at.
9762 # @param theName Object name; when specified, this parameter is used
9763 # for result publication in the study. Otherwise, if automatic
9764 # publication is switched on, default value is used for result name.
9766 # @return New GEOM.GEOM_Object, containing the created vector.
9768 # @ref swig_todo "Example"
9769 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9771 Get a normale to the given face. If the point is not given,
9772 the normale is calculated at the center of mass.
9775 theFace Face to define normale of.
9776 theOptionalPoint Point to compute the normale at.
9777 theName Object name; when specified, this parameter is used
9778 for result publication in the study. Otherwise, if automatic
9779 publication is switched on, default value is used for result name.
9782 New GEOM.GEOM_Object, containing the created vector.
9784 # Example: see GEOM_TestMeasures.py
9785 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9786 RaiseIfFailed("GetNormal", self.MeasuOp)
9787 self._autoPublish(anObj, theName, "normal")
9790 ## Check a topology of the given shape.
9791 # @param theShape Shape to check validity of.
9792 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9793 # if TRUE, the shape's geometry will be checked also.
9794 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9795 # of problem is printed.
9796 # if TRUE and if theShape is invalid, the description
9797 # of problem is also returned.
9798 # @return TRUE, if the shape "seems to be valid".
9800 # @ref tui_measurement_tools_page "Example"
9801 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9803 Check a topology of the given shape.
9806 theShape Shape to check validity of.
9807 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9808 if TRUE, the shape's geometry will be checked also.
9809 theReturnStatus If FALSE and if theShape is invalid, a description
9810 of problem is printed.
9811 if TRUE and if theShape is invalid, the description
9812 of problem is returned.
9815 TRUE, if the shape "seems to be valid".
9816 If theShape is invalid, prints a description of problem.
9817 This description can also be returned.
9819 # Example: see GEOM_TestMeasures.py
9821 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9822 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9824 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9825 RaiseIfFailed("CheckShape", self.MeasuOp)
9827 if theReturnStatus == 0:
9829 if theReturnStatus == 1:
9830 return (IsValid, Status)
9833 ## Detect self-intersections in the given shape.
9834 # @param theShape Shape to check.
9835 # @return TRUE, if the shape contains no self-intersections.
9837 # @ref tui_measurement_tools_page "Example"
9838 def CheckSelfIntersections(self, theShape):
9840 Detect self-intersections in the given shape.
9843 theShape Shape to check.
9846 TRUE, if the shape contains no self-intersections.
9848 # Example: see GEOM_TestMeasures.py
9849 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9850 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9853 ## Get position (LCS) of theShape.
9855 # Origin of the LCS is situated at the shape's center of mass.
9856 # Axes of the LCS are obtained from shape's location or,
9857 # if the shape is a planar face, from position of its plane.
9859 # @param theShape Shape to calculate position of.
9860 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9861 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9862 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9863 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9865 # @ref swig_todo "Example"
9866 def GetPosition(self,theShape):
9868 Get position (LCS) of theShape.
9869 Origin of the LCS is situated at the shape's center of mass.
9870 Axes of the LCS are obtained from shape's location or,
9871 if the shape is a planar face, from position of its plane.
9874 theShape Shape to calculate position of.
9877 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9878 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9879 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9880 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9882 # Example: see GEOM_TestMeasures.py
9883 aTuple = self.MeasuOp.GetPosition(theShape)
9884 RaiseIfFailed("GetPosition", self.MeasuOp)
9887 ## Get kind of theShape.
9889 # @param theShape Shape to get a kind of.
9890 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9891 # and a list of parameters, describing the shape.
9892 # @note Concrete meaning of each value, returned via \a theIntegers
9893 # or \a theDoubles list depends on the kind() of the shape.
9895 # @ref swig_todo "Example"
9896 def KindOfShape(self,theShape):
9898 Get kind of theShape.
9901 theShape Shape to get a kind of.
9904 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9905 and a list of parameters, describing the shape.
9907 Concrete meaning of each value, returned via theIntegers
9908 or theDoubles list depends on the geompy.kind of the shape
9910 # Example: see GEOM_TestMeasures.py
9911 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9912 RaiseIfFailed("KindOfShape", self.MeasuOp)
9914 aKind = aRoughTuple[0]
9915 anInts = aRoughTuple[1]
9916 aDbls = aRoughTuple[2]
9918 # Now there is no exception from this rule:
9919 aKindTuple = [aKind] + aDbls + anInts
9921 # If they are we will regroup parameters for such kind of shape.
9923 #if aKind == kind.SOME_KIND:
9924 # # SOME_KIND int int double int double double
9925 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9932 ## @addtogroup l2_import_export
9935 ## Import a shape from the BREP or IGES or STEP file
9936 # (depends on given format) with given name.
9937 # @param theFileName The file, containing the shape.
9938 # @param theFormatName Specify format for the file reading.
9939 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9940 # If format 'IGES_SCALE' is used instead of 'IGES' or
9941 # format 'STEP_SCALE' is used instead of 'STEP',
9942 # length unit will be set to 'meter' and result model will be scaled.
9943 # @param theName Object name; when specified, this parameter is used
9944 # for result publication in the study. Otherwise, if automatic
9945 # publication is switched on, default value is used for result name.
9947 # @return New GEOM.GEOM_Object, containing the imported shape.
9949 # @ref swig_Import_Export "Example"
9950 def ImportFile(self, theFileName, theFormatName, theName=None):
9952 Import a shape from the BREP or IGES or STEP file
9953 (depends on given format) with given name.
9956 theFileName The file, containing the shape.
9957 theFormatName Specify format for the file reading.
9958 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9959 If format 'IGES_SCALE' is used instead of 'IGES' or
9960 format 'STEP_SCALE' is used instead of 'STEP',
9961 length unit will be set to 'meter' and result model will be scaled.
9962 theName Object name; when specified, this parameter is used
9963 for result publication in the study. Otherwise, if automatic
9964 publication is switched on, default value is used for result name.
9967 New GEOM.GEOM_Object, containing the imported shape.
9969 # Example: see GEOM_TestOthers.py
9970 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9971 RaiseIfFailed("ImportFile", self.InsertOp)
9972 self._autoPublish(anObj, theName, "imported")
9975 ## Deprecated analog of ImportFile()
9976 def Import(self, theFileName, theFormatName, theName=None):
9978 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9980 print "WARNING: Function Import is deprecated, use ImportFile instead"
9981 # note: auto-publishing is done in self.ImportFile()
9982 return self.ImportFile(theFileName, theFormatName, theName)
9984 ## Shortcut to ImportFile() for BREP format.
9985 # Import a shape from the BREP file with given name.
9986 # @param theFileName The file, containing the shape.
9987 # @param theName Object name; when specified, this parameter is used
9988 # for result publication in the study. Otherwise, if automatic
9989 # publication is switched on, default value is used for result name.
9991 # @return New GEOM.GEOM_Object, containing the imported shape.
9993 # @ref swig_Import_Export "Example"
9994 def ImportBREP(self, theFileName, theName=None):
9996 geompy.ImportFile(...) function for BREP format
9997 Import a shape from the BREP file with given name.
10000 theFileName The file, containing the shape.
10001 theName Object name; when specified, this parameter is used
10002 for result publication in the study. Otherwise, if automatic
10003 publication is switched on, default value is used for result name.
10006 New GEOM.GEOM_Object, containing the imported shape.
10008 # Example: see GEOM_TestOthers.py
10009 # note: auto-publishing is done in self.ImportFile()
10010 return self.ImportFile(theFileName, "BREP", theName)
10012 ## Shortcut to ImportFile() for IGES format
10013 # Import a shape from the IGES file with given name.
10014 # @param theFileName The file, containing the shape.
10015 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10016 # and result model will be scaled, if its units are not meters.
10017 # If False (default), file length units will be taken into account.
10018 # @param theName Object name; when specified, this parameter is used
10019 # for result publication in the study. Otherwise, if automatic
10020 # publication is switched on, default value is used for result name.
10022 # @return New GEOM.GEOM_Object, containing the imported shape.
10024 # @ref swig_Import_Export "Example"
10025 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10027 geompy.ImportFile(...) function for IGES format
10030 theFileName The file, containing the shape.
10031 ignoreUnits If True, file length units will be ignored (set to 'meter')
10032 and result model will be scaled, if its units are not meters.
10033 If False (default), file length units will be taken into account.
10034 theName Object name; when specified, this parameter is used
10035 for result publication in the study. Otherwise, if automatic
10036 publication is switched on, default value is used for result name.
10039 New GEOM.GEOM_Object, containing the imported shape.
10041 # Example: see GEOM_TestOthers.py
10042 # note: auto-publishing is done in self.ImportFile()
10044 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10045 return self.ImportFile(theFileName, "IGES", theName)
10047 ## Return length unit from given IGES file
10048 # @param theFileName The file, containing the shape.
10049 # @return String, containing the units name.
10051 # @ref swig_Import_Export "Example"
10052 def GetIGESUnit(self, theFileName):
10054 Return length units from given IGES file
10057 theFileName The file, containing the shape.
10060 String, containing the units name.
10062 # Example: see GEOM_TestOthers.py
10063 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10066 ## Shortcut to ImportFile() for STEP format
10067 # Import a shape from the STEP file with given name.
10068 # @param theFileName The file, containing the shape.
10069 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10070 # and result model will be scaled, if its units are not meters.
10071 # If False (default), file length units will be taken into account.
10072 # @param theName Object name; when specified, this parameter is used
10073 # for result publication in the study. Otherwise, if automatic
10074 # publication is switched on, default value is used for result name.
10076 # @return New GEOM.GEOM_Object, containing the imported shape.
10078 # @ref swig_Import_Export "Example"
10079 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10081 geompy.ImportFile(...) function for STEP format
10084 theFileName The file, containing the shape.
10085 ignoreUnits If True, file length units will be ignored (set to 'meter')
10086 and result model will be scaled, if its units are not meters.
10087 If False (default), file length units will be taken into account.
10088 theName Object name; when specified, this parameter is used
10089 for result publication in the study. Otherwise, if automatic
10090 publication is switched on, default value is used for result name.
10093 New GEOM.GEOM_Object, containing the imported shape.
10095 # Example: see GEOM_TestOthers.py
10096 # note: auto-publishing is done in self.ImportFile()
10098 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10099 return self.ImportFile(theFileName, "STEP", theName)
10101 ## Return length unit from given IGES or STEP file
10102 # @param theFileName The file, containing the shape.
10103 # @return String, containing the units name.
10105 # @ref swig_Import_Export "Example"
10106 def GetSTEPUnit(self, theFileName):
10108 Return length units from given STEP file
10111 theFileName The file, containing the shape.
10114 String, containing the units name.
10116 # Example: see GEOM_TestOthers.py
10117 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10120 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10121 # @note This method will not be dumped to the python script by DumpStudy functionality.
10122 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10123 # @param theStream The BRep binary stream.
10124 # @param theName Object name; when specified, this parameter is used
10125 # for result publication in the study. Otherwise, if automatic
10126 # publication is switched on, default value is used for result name.
10128 # @return New GEOM_Object, containing the shape, read from theStream.
10130 # @ref swig_Import_Export "Example"
10131 def RestoreShape (self, theStream, theName=None):
10133 Read a shape from the binary stream, containing its bounding representation (BRep).
10136 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10139 theStream The BRep binary stream.
10140 theName Object name; when specified, this parameter is used
10141 for result publication in the study. Otherwise, if automatic
10142 publication is switched on, default value is used for result name.
10145 New GEOM_Object, containing the shape, read from theStream.
10147 # Example: see GEOM_TestOthers.py
10148 anObj = self.InsertOp.RestoreShape(theStream)
10149 RaiseIfFailed("RestoreShape", self.InsertOp)
10150 self._autoPublish(anObj, theName, "restored")
10153 ## Export the given shape into a file with given name.
10154 # @param theObject Shape to be stored in the file.
10155 # @param theFileName Name of the file to store the given shape in.
10156 # @param theFormatName Specify format for the shape storage.
10157 # Available formats can be obtained with
10158 # geompy.InsertOp.ExportTranslators()[0] method.
10160 # @ref swig_Import_Export "Example"
10161 def Export(self, theObject, theFileName, theFormatName):
10163 Export the given shape into a file with given name.
10166 theObject Shape to be stored in the file.
10167 theFileName Name of the file to store the given shape in.
10168 theFormatName Specify format for the shape storage.
10169 Available formats can be obtained with
10170 geompy.InsertOp.ExportTranslators()[0] method.
10172 # Example: see GEOM_TestOthers.py
10173 self.InsertOp.Export(theObject, theFileName, theFormatName)
10174 if self.InsertOp.IsDone() == 0:
10175 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10179 ## Shortcut to Export() for BREP format
10181 # @ref swig_Import_Export "Example"
10182 def ExportBREP(self,theObject, theFileName):
10184 geompy.Export(...) function for BREP format
10186 # Example: see GEOM_TestOthers.py
10187 return self.Export(theObject, theFileName, "BREP")
10189 ## Shortcut to Export() for IGES format
10191 # @ref swig_Import_Export "Example"
10192 def ExportIGES(self,theObject, theFileName):
10194 geompy.Export(...) function for IGES format
10196 # Example: see GEOM_TestOthers.py
10197 return self.Export(theObject, theFileName, "IGES")
10199 ## Shortcut to Export() for STEP format
10201 # @ref swig_Import_Export "Example"
10202 def ExportSTEP(self,theObject, theFileName):
10204 geompy.Export(...) function for STEP format
10206 # Example: see GEOM_TestOthers.py
10207 return self.Export(theObject, theFileName, "STEP")
10209 # end of l2_import_export
10212 ## @addtogroup l3_blocks
10215 ## Create a quadrangle face from four edges. Order of Edges is not
10216 # important. It is not necessary that edges share the same vertex.
10217 # @param E1,E2,E3,E4 Edges for the face bound.
10218 # @param theName Object name; when specified, this parameter is used
10219 # for result publication in the study. Otherwise, if automatic
10220 # publication is switched on, default value is used for result name.
10222 # @return New GEOM.GEOM_Object, containing the created face.
10224 # @ref tui_building_by_blocks_page "Example"
10225 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10227 Create a quadrangle face from four edges. Order of Edges is not
10228 important. It is not necessary that edges share the same vertex.
10231 E1,E2,E3,E4 Edges for the face bound.
10232 theName Object name; when specified, this parameter is used
10233 for result publication in the study. Otherwise, if automatic
10234 publication is switched on, default value is used for result name.
10237 New GEOM.GEOM_Object, containing the created face.
10240 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10242 # Example: see GEOM_Spanner.py
10243 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10244 RaiseIfFailed("MakeQuad", self.BlocksOp)
10245 self._autoPublish(anObj, theName, "quad")
10248 ## Create a quadrangle face on two edges.
10249 # The missing edges will be built by creating the shortest ones.
10250 # @param E1,E2 Two opposite edges for the face.
10251 # @param theName Object name; when specified, this parameter is used
10252 # for result publication in the study. Otherwise, if automatic
10253 # publication is switched on, default value is used for result name.
10255 # @return New GEOM.GEOM_Object, containing the created face.
10257 # @ref tui_building_by_blocks_page "Example"
10258 def MakeQuad2Edges(self, E1, E2, theName=None):
10260 Create a quadrangle face on two edges.
10261 The missing edges will be built by creating the shortest ones.
10264 E1,E2 Two opposite edges for the face.
10265 theName Object name; when specified, this parameter is used
10266 for result publication in the study. Otherwise, if automatic
10267 publication is switched on, default value is used for result name.
10270 New GEOM.GEOM_Object, containing the created face.
10274 p1 = geompy.MakeVertex( 0., 0., 0.)
10275 p2 = geompy.MakeVertex(150., 30., 0.)
10276 p3 = geompy.MakeVertex( 0., 120., 50.)
10277 p4 = geompy.MakeVertex( 0., 40., 70.)
10279 edge1 = geompy.MakeEdge(p1, p2)
10280 edge2 = geompy.MakeEdge(p3, p4)
10281 # create a quadrangle face from two edges
10282 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10284 # Example: see GEOM_Spanner.py
10285 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10286 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10287 self._autoPublish(anObj, theName, "quad")
10290 ## Create a quadrangle face with specified corners.
10291 # The missing edges will be built by creating the shortest ones.
10292 # @param V1,V2,V3,V4 Corner vertices for the face.
10293 # @param theName Object name; when specified, this parameter is used
10294 # for result publication in the study. Otherwise, if automatic
10295 # publication is switched on, default value is used for result name.
10297 # @return New GEOM.GEOM_Object, containing the created face.
10299 # @ref tui_building_by_blocks_page "Example 1"
10300 # \n @ref swig_MakeQuad4Vertices "Example 2"
10301 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10303 Create a quadrangle face with specified corners.
10304 The missing edges will be built by creating the shortest ones.
10307 V1,V2,V3,V4 Corner vertices for the face.
10308 theName Object name; when specified, this parameter is used
10309 for result publication in the study. Otherwise, if automatic
10310 publication is switched on, default value is used for result name.
10313 New GEOM.GEOM_Object, containing the created face.
10317 p1 = geompy.MakeVertex( 0., 0., 0.)
10318 p2 = geompy.MakeVertex(150., 30., 0.)
10319 p3 = geompy.MakeVertex( 0., 120., 50.)
10320 p4 = geompy.MakeVertex( 0., 40., 70.)
10321 # create a quadrangle from four points in its corners
10322 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10324 # Example: see GEOM_Spanner.py
10325 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10326 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10327 self._autoPublish(anObj, theName, "quad")
10330 ## Create a hexahedral solid, bounded by the six given faces. Order of
10331 # faces is not important. It is not necessary that Faces share the same edge.
10332 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10333 # @param theName Object name; when specified, this parameter is used
10334 # for result publication in the study. Otherwise, if automatic
10335 # publication is switched on, default value is used for result name.
10337 # @return New GEOM.GEOM_Object, containing the created solid.
10339 # @ref tui_building_by_blocks_page "Example 1"
10340 # \n @ref swig_MakeHexa "Example 2"
10341 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10343 Create a hexahedral solid, bounded by the six given faces. Order of
10344 faces is not important. It is not necessary that Faces share the same edge.
10347 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10348 theName Object name; when specified, this parameter is used
10349 for result publication in the study. Otherwise, if automatic
10350 publication is switched on, default value is used for result name.
10353 New GEOM.GEOM_Object, containing the created solid.
10356 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10358 # Example: see GEOM_Spanner.py
10359 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10360 RaiseIfFailed("MakeHexa", self.BlocksOp)
10361 self._autoPublish(anObj, theName, "hexa")
10364 ## Create a hexahedral solid between two given faces.
10365 # The missing faces will be built by creating the smallest ones.
10366 # @param F1,F2 Two opposite faces for the hexahedral solid.
10367 # @param theName Object name; when specified, this parameter is used
10368 # for result publication in the study. Otherwise, if automatic
10369 # publication is switched on, default value is used for result name.
10371 # @return New GEOM.GEOM_Object, containing the created solid.
10373 # @ref tui_building_by_blocks_page "Example 1"
10374 # \n @ref swig_MakeHexa2Faces "Example 2"
10375 def MakeHexa2Faces(self, F1, F2, theName=None):
10377 Create a hexahedral solid between two given faces.
10378 The missing faces will be built by creating the smallest ones.
10381 F1,F2 Two opposite faces for the hexahedral solid.
10382 theName Object name; when specified, this parameter is used
10383 for result publication in the study. Otherwise, if automatic
10384 publication is switched on, default value is used for result name.
10387 New GEOM.GEOM_Object, containing the created solid.
10390 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10392 # Example: see GEOM_Spanner.py
10393 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10394 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10395 self._autoPublish(anObj, theName, "hexa")
10401 ## @addtogroup l3_blocks_op
10404 ## Get a vertex, found in the given shape by its coordinates.
10405 # @param theShape Block or a compound of blocks.
10406 # @param theX,theY,theZ Coordinates of the sought vertex.
10407 # @param theEpsilon Maximum allowed distance between the resulting
10408 # vertex and point with the given coordinates.
10409 # @param theName Object name; when specified, this parameter is used
10410 # for result publication in the study. Otherwise, if automatic
10411 # publication is switched on, default value is used for result name.
10413 # @return New GEOM.GEOM_Object, containing the found vertex.
10415 # @ref swig_GetPoint "Example"
10416 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10418 Get a vertex, found in the given shape by its coordinates.
10421 theShape Block or a compound of blocks.
10422 theX,theY,theZ Coordinates of the sought vertex.
10423 theEpsilon Maximum allowed distance between the resulting
10424 vertex and point with the given coordinates.
10425 theName Object name; when specified, this parameter is used
10426 for result publication in the study. Otherwise, if automatic
10427 publication is switched on, default value is used for result name.
10430 New GEOM.GEOM_Object, containing the found vertex.
10433 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10435 # Example: see GEOM_TestOthers.py
10436 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10437 RaiseIfFailed("GetPoint", self.BlocksOp)
10438 self._autoPublish(anObj, theName, "vertex")
10441 ## Find a vertex of the given shape, which has minimal distance to the given point.
10442 # @param theShape Any shape.
10443 # @param thePoint Point, close to the desired vertex.
10444 # @param theName Object name; when specified, this parameter is used
10445 # for result publication in the study. Otherwise, if automatic
10446 # publication is switched on, default value is used for result name.
10448 # @return New GEOM.GEOM_Object, containing the found vertex.
10450 # @ref swig_GetVertexNearPoint "Example"
10451 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10453 Find a vertex of the given shape, which has minimal distance to the given point.
10456 theShape Any shape.
10457 thePoint Point, close to the desired vertex.
10458 theName Object name; when specified, this parameter is used
10459 for result publication in the study. Otherwise, if automatic
10460 publication is switched on, default value is used for result name.
10463 New GEOM.GEOM_Object, containing the found vertex.
10466 pmidle = geompy.MakeVertex(50, 0, 50)
10467 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10469 # Example: see GEOM_TestOthers.py
10470 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10471 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10472 self._autoPublish(anObj, theName, "vertex")
10475 ## Get an edge, found in the given shape by two given vertices.
10476 # @param theShape Block or a compound of blocks.
10477 # @param thePoint1,thePoint2 Points, close to the ends of 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_GetEdge "Example"
10485 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10487 Get an edge, found in the given shape by two given vertices.
10490 theShape Block or a compound of blocks.
10491 thePoint1,thePoint2 Points, close to the ends of 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_Spanner.py
10500 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10501 RaiseIfFailed("GetEdge", self.BlocksOp)
10502 self._autoPublish(anObj, theName, "edge")
10505 ## Find an edge of the given shape, which has minimal distance to the given point.
10506 # @param theShape Block or a compound of blocks.
10507 # @param thePoint Point, close to the desired edge.
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 edge.
10514 # @ref swig_GetEdgeNearPoint "Example"
10515 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10517 Find an edge of the given shape, which has minimal distance to the given point.
10520 theShape Block or a compound of blocks.
10521 thePoint Point, close to the desired edge.
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 edge.
10529 # Example: see GEOM_TestOthers.py
10530 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10531 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10532 self._autoPublish(anObj, theName, "edge")
10535 ## Returns a face, found in the given shape by four given corner vertices.
10536 # @param theShape Block or a compound of blocks.
10537 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners 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 GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10547 Returns a face, found in the given shape by four given corner vertices.
10550 theShape Block or a compound of blocks.
10551 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners 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.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10561 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10562 self._autoPublish(anObj, theName, "face")
10565 ## Get a face of block, found in the given shape by two given edges.
10566 # @param theShape Block or a compound of blocks.
10567 # @param theEdge1,theEdge2 Edges, close to the edges of 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_todo "Example"
10575 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10577 Get a face of block, found in the given shape by two given edges.
10580 theShape Block or a compound of blocks.
10581 theEdge1,theEdge2 Edges, close to the edges of 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.GetFaceByEdges(theShape, theEdge1, theEdge2)
10591 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10592 self._autoPublish(anObj, theName, "face")
10595 ## Find a face, opposite to the given one in the given block.
10596 # @param theBlock Must be a hexahedral solid.
10597 # @param theFace Face of \a theBlock, opposite 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_GetOppositeFace "Example"
10605 def GetOppositeFace(self, theBlock, theFace, theName=None):
10607 Find a face, opposite to the given one in the given block.
10610 theBlock Must be a hexahedral solid.
10611 theFace Face of theBlock, opposite 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.GetOppositeFace(theBlock, theFace)
10621 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10622 self._autoPublish(anObj, theName, "face")
10625 ## Find a face of the given shape, which has minimal distance to the given point.
10626 # @param theShape Block or a compound of blocks.
10627 # @param thePoint Point, close to 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_GetFaceNearPoint "Example"
10635 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10637 Find a face of the given shape, which has minimal distance to the given point.
10640 theShape Block or a compound of blocks.
10641 thePoint Point, close to 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.GetFaceNearPoint(theShape, thePoint)
10651 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10652 self._autoPublish(anObj, theName, "face")
10655 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10656 # @param theBlock Block or a compound of blocks.
10657 # @param theVector Vector, close to the normale of the desired face.
10658 # @param theName Object name; when specified, this parameter is used
10659 # for result publication in the study. Otherwise, if automatic
10660 # publication is switched on, default value is used for result name.
10662 # @return New GEOM.GEOM_Object, containing the found face.
10664 # @ref swig_todo "Example"
10665 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10667 Find a face of block, whose outside normale has minimal angle with the given vector.
10670 theBlock Block or a compound of blocks.
10671 theVector Vector, close to the normale of the desired face.
10672 theName Object name; when specified, this parameter is used
10673 for result publication in the study. Otherwise, if automatic
10674 publication is switched on, default value is used for result name.
10677 New GEOM.GEOM_Object, containing the found face.
10679 # Example: see GEOM_Spanner.py
10680 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10681 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10682 self._autoPublish(anObj, theName, "face")
10685 ## Find all sub-shapes of type \a theShapeType of the given shape,
10686 # which have minimal distance to the given point.
10687 # @param theShape Any shape.
10688 # @param thePoint Point, close to the desired shape.
10689 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10690 # @param theTolerance The tolerance for distances comparison. All shapes
10691 # with distances to the given point in interval
10692 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10693 # @param theName Object name; when specified, this parameter is used
10694 # for result publication in the study. Otherwise, if automatic
10695 # publication is switched on, default value is used for result name.
10697 # @return New GEOM_Object, containing a group of all found shapes.
10699 # @ref swig_GetShapesNearPoint "Example"
10700 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10702 Find all sub-shapes of type theShapeType of the given shape,
10703 which have minimal distance to the given point.
10706 theShape Any shape.
10707 thePoint Point, close to the desired shape.
10708 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10709 theTolerance The tolerance for distances comparison. All shapes
10710 with distances to the given point in interval
10711 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10712 theName Object name; when specified, this parameter is used
10713 for result publication in the study. Otherwise, if automatic
10714 publication is switched on, default value is used for result name.
10717 New GEOM_Object, containing a group of all found shapes.
10719 # Example: see GEOM_TestOthers.py
10720 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10721 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10722 self._autoPublish(anObj, theName, "group")
10725 # end of l3_blocks_op
10728 ## @addtogroup l4_blocks_measure
10731 ## Check, if the compound of blocks is given.
10732 # To be considered as a compound of blocks, the
10733 # given shape must satisfy the following conditions:
10734 # - Each element of the compound should be a Block (6 faces and 12 edges).
10735 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10736 # - The compound should be connexe.
10737 # - The glue between two quadrangle faces should be applied.
10738 # @param theCompound The compound to check.
10739 # @return TRUE, if the given shape is a compound of blocks.
10740 # If theCompound is not valid, prints all discovered errors.
10742 # @ref tui_measurement_tools_page "Example 1"
10743 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10744 def CheckCompoundOfBlocks(self,theCompound):
10746 Check, if the compound of blocks is given.
10747 To be considered as a compound of blocks, the
10748 given shape must satisfy the following conditions:
10749 - Each element of the compound should be a Block (6 faces and 12 edges).
10750 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10751 - The compound should be connexe.
10752 - The glue between two quadrangle faces should be applied.
10755 theCompound The compound to check.
10758 TRUE, if the given shape is a compound of blocks.
10759 If theCompound is not valid, prints all discovered errors.
10761 # Example: see GEOM_Spanner.py
10762 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10763 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10765 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10769 ## Retrieve all non blocks solids and faces from \a theShape.
10770 # @param theShape The shape to explore.
10771 # @param theName Object name; when specified, this parameter is used
10772 # for result publication in the study. Otherwise, if automatic
10773 # publication is switched on, default value is used for result name.
10775 # @return A tuple of two GEOM_Objects. The first object is a group of all
10776 # non block solids (= not 6 faces, or with 6 faces, but with the
10777 # presence of non-quadrangular faces). The second object is a
10778 # group of all non quadrangular faces.
10780 # @ref tui_measurement_tools_page "Example 1"
10781 # \n @ref swig_GetNonBlocks "Example 2"
10782 def GetNonBlocks (self, theShape, theName=None):
10784 Retrieve all non blocks solids and faces from theShape.
10787 theShape The shape to explore.
10788 theName Object name; when specified, this parameter is used
10789 for result publication in the study. Otherwise, if automatic
10790 publication is switched on, default value is used for result name.
10793 A tuple of two GEOM_Objects. The first object is a group of all
10794 non block solids (= not 6 faces, or with 6 faces, but with the
10795 presence of non-quadrangular faces). The second object is a
10796 group of all non quadrangular faces.
10799 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10801 # Example: see GEOM_Spanner.py
10802 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10803 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10804 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10807 ## Remove all seam and degenerated edges from \a theShape.
10808 # Unite faces and edges, sharing one surface. It means that
10809 # this faces must have references to one C++ surface object (handle).
10810 # @param theShape The compound or single solid to remove irregular edges from.
10811 # @param doUnionFaces If True, then unite faces. If False (the default value),
10812 # do not unite faces.
10813 # @param theName Object name; when specified, this parameter is used
10814 # for result publication in the study. Otherwise, if automatic
10815 # publication is switched on, default value is used for result name.
10817 # @return Improved shape.
10819 # @ref swig_RemoveExtraEdges "Example"
10820 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10822 Remove all seam and degenerated edges from theShape.
10823 Unite faces and edges, sharing one surface. It means that
10824 this faces must have references to one C++ surface object (handle).
10827 theShape The compound or single solid to remove irregular edges from.
10828 doUnionFaces If True, then unite faces. If False (the default value),
10829 do not unite faces.
10830 theName Object name; when specified, this parameter is used
10831 for result publication in the study. Otherwise, if automatic
10832 publication is switched on, default value is used for result name.
10837 # Example: see GEOM_TestOthers.py
10838 nbFacesOptimum = -1 # -1 means do not unite faces
10839 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10840 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10841 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10842 self._autoPublish(anObj, theName, "removeExtraEdges")
10845 ## Performs union faces of \a theShape
10846 # Unite faces sharing one surface. It means that
10847 # these faces must have references to one C++ surface object (handle).
10848 # @param theShape The compound or single solid that contains faces
10849 # to perform union.
10850 # @param theName Object name; when specified, this parameter is used
10851 # for result publication in the study. Otherwise, if automatic
10852 # publication is switched on, default value is used for result name.
10854 # @return Improved shape.
10856 # @ref swig_UnionFaces "Example"
10857 def UnionFaces(self, theShape, theName=None):
10859 Performs union faces of theShape.
10860 Unite faces sharing one surface. It means that
10861 these faces must have references to one C++ surface object (handle).
10864 theShape The compound or single solid that contains faces
10866 theName Object name; when specified, this parameter is used
10867 for result publication in the study. Otherwise, if automatic
10868 publication is switched on, default value is used for result name.
10873 # Example: see GEOM_TestOthers.py
10874 anObj = self.BlocksOp.UnionFaces(theShape)
10875 RaiseIfFailed("UnionFaces", self.BlocksOp)
10876 self._autoPublish(anObj, theName, "unionFaces")
10879 ## Check, if the given shape is a blocks compound.
10880 # Fix all detected errors.
10881 # \note Single block can be also fixed by this method.
10882 # @param theShape The compound to check and improve.
10883 # @param theName Object name; when specified, this parameter is used
10884 # for result publication in the study. Otherwise, if automatic
10885 # publication is switched on, default value is used for result name.
10887 # @return Improved compound.
10889 # @ref swig_CheckAndImprove "Example"
10890 def CheckAndImprove(self, theShape, theName=None):
10892 Check, if the given shape is a blocks compound.
10893 Fix all detected errors.
10896 Single block can be also fixed by this method.
10899 theShape The compound to check and improve.
10900 theName Object name; when specified, this parameter is used
10901 for result publication in the study. Otherwise, if automatic
10902 publication is switched on, default value is used for result name.
10907 # Example: see GEOM_TestOthers.py
10908 anObj = self.BlocksOp.CheckAndImprove(theShape)
10909 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10910 self._autoPublish(anObj, theName, "improved")
10913 # end of l4_blocks_measure
10916 ## @addtogroup l3_blocks_op
10919 ## Get all the blocks, contained in the given compound.
10920 # @param theCompound The compound to explode.
10921 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10922 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10923 # @param theName Object name; when specified, this parameter is used
10924 # for result publication in the study. Otherwise, if automatic
10925 # publication is switched on, default value is used for result name.
10927 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10929 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10931 # @ref tui_explode_on_blocks "Example 1"
10932 # \n @ref swig_MakeBlockExplode "Example 2"
10933 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10935 Get all the blocks, contained in the given compound.
10938 theCompound The compound to explode.
10939 theMinNbFaces If solid has lower number of faces, it is not a block.
10940 theMaxNbFaces If solid has higher number of faces, it is not a block.
10941 theName Object name; when specified, this parameter is used
10942 for result publication in the study. Otherwise, if automatic
10943 publication is switched on, default value is used for result name.
10946 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10949 List of GEOM.GEOM_Object, containing the retrieved blocks.
10951 # Example: see GEOM_TestOthers.py
10952 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10953 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10954 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10955 for anObj in aList:
10956 anObj.SetParameters(Parameters)
10958 self._autoPublish(aList, theName, "block")
10961 ## Find block, containing the given point inside its volume or on boundary.
10962 # @param theCompound Compound, to find block in.
10963 # @param thePoint Point, close to the desired block. If the point lays on
10964 # boundary between some blocks, we return block with nearest center.
10965 # @param theName Object name; when specified, this parameter is used
10966 # for result publication in the study. Otherwise, if automatic
10967 # publication is switched on, default value is used for result name.
10969 # @return New GEOM.GEOM_Object, containing the found block.
10971 # @ref swig_todo "Example"
10972 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10974 Find block, containing the given point inside its volume or on boundary.
10977 theCompound Compound, to find block in.
10978 thePoint Point, close to the desired block. If the point lays on
10979 boundary between some blocks, we return block with nearest center.
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.GEOM_Object, containing the found block.
10987 # Example: see GEOM_Spanner.py
10988 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10989 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10990 self._autoPublish(anObj, theName, "block")
10993 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10994 # @param theCompound Compound, to find block in.
10995 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
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 New GEOM.GEOM_Object, containing the found block.
11002 # @ref swig_GetBlockByParts "Example"
11003 def GetBlockByParts(self, theCompound, theParts, theName=None):
11005 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11008 theCompound Compound, to find block in.
11009 theParts List of faces and/or edges and/or vertices to be parts of the found block.
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 New GEOM_Object, containing the found block.
11017 # Example: see GEOM_TestOthers.py
11018 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11019 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11020 self._autoPublish(anObj, theName, "block")
11023 ## Return all blocks, containing all the elements, passed as the parts.
11024 # @param theCompound Compound, to find blocks in.
11025 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11026 # @param theName Object name; when specified, this parameter is used
11027 # for result publication in the study. Otherwise, if automatic
11028 # publication is switched on, default value is used for result name.
11030 # @return List of GEOM.GEOM_Object, containing the found blocks.
11032 # @ref swig_todo "Example"
11033 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11035 Return all blocks, containing all the elements, passed as the parts.
11038 theCompound Compound, to find blocks in.
11039 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11040 theName Object name; when specified, this parameter is used
11041 for result publication in the study. Otherwise, if automatic
11042 publication is switched on, default value is used for result name.
11045 List of GEOM.GEOM_Object, containing the found blocks.
11047 # Example: see GEOM_Spanner.py
11048 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11049 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11050 self._autoPublish(aList, theName, "block")
11053 ## Multi-transformate block and glue the result.
11054 # Transformation is defined so, as to superpose direction faces.
11055 # @param Block Hexahedral solid to be multi-transformed.
11056 # @param DirFace1 ID of First direction face.
11057 # @param DirFace2 ID of Second direction face.
11058 # @param NbTimes Quantity of transformations to be done.
11059 # @param theName Object name; when specified, this parameter is used
11060 # for result publication in the study. Otherwise, if automatic
11061 # publication is switched on, default value is used for result name.
11063 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11065 # @return New GEOM.GEOM_Object, containing the result shape.
11067 # @ref tui_multi_transformation "Example"
11068 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11070 Multi-transformate block and glue the result.
11071 Transformation is defined so, as to superpose direction faces.
11074 Block Hexahedral solid to be multi-transformed.
11075 DirFace1 ID of First direction face.
11076 DirFace2 ID of Second direction face.
11077 NbTimes Quantity of transformations to be done.
11078 theName Object name; when specified, this parameter is used
11079 for result publication in the study. Otherwise, if automatic
11080 publication is switched on, default value is used for result name.
11083 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11086 New GEOM.GEOM_Object, containing the result shape.
11088 # Example: see GEOM_Spanner.py
11089 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11090 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11091 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11092 anObj.SetParameters(Parameters)
11093 self._autoPublish(anObj, theName, "transformed")
11096 ## Multi-transformate block and glue the result.
11097 # @param Block Hexahedral solid to be multi-transformed.
11098 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11099 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11100 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11101 # @param theName Object name; when specified, this parameter is used
11102 # for result publication in the study. Otherwise, if automatic
11103 # publication is switched on, default value is used for result name.
11105 # @return New GEOM.GEOM_Object, containing the result shape.
11107 # @ref tui_multi_transformation "Example"
11108 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11109 DirFace1V, DirFace2V, NbTimesV, theName=None):
11111 Multi-transformate block and glue the result.
11114 Block Hexahedral solid to be multi-transformed.
11115 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11116 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11117 NbTimesU,NbTimesV Quantity of transformations to be done.
11118 theName Object name; when specified, this parameter is used
11119 for result publication in the study. Otherwise, if automatic
11120 publication is switched on, default value is used for result name.
11123 New GEOM.GEOM_Object, containing the result shape.
11125 # Example: see GEOM_Spanner.py
11126 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11127 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11128 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11129 DirFace1V, DirFace2V, NbTimesV)
11130 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11131 anObj.SetParameters(Parameters)
11132 self._autoPublish(anObj, theName, "transformed")
11135 ## Build all possible propagation groups.
11136 # Propagation group is a set of all edges, opposite to one (main)
11137 # edge of this group directly or through other opposite edges.
11138 # Notion of Opposite Edge make sence only on quadrangle face.
11139 # @param theShape Shape to build propagation groups on.
11140 # @param theName Object name; when specified, this parameter is used
11141 # for result publication in the study. Otherwise, if automatic
11142 # publication is switched on, default value is used for result name.
11144 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11146 # @ref swig_Propagate "Example"
11147 def Propagate(self, theShape, theName=None):
11149 Build all possible propagation groups.
11150 Propagation group is a set of all edges, opposite to one (main)
11151 edge of this group directly or through other opposite edges.
11152 Notion of Opposite Edge make sence only on quadrangle face.
11155 theShape Shape to build propagation groups on.
11156 theName Object name; when specified, this parameter is used
11157 for result publication in the study. Otherwise, if automatic
11158 publication is switched on, default value is used for result name.
11161 List of GEOM.GEOM_Object, each of them is a propagation group.
11163 # Example: see GEOM_TestOthers.py
11164 listChains = self.BlocksOp.Propagate(theShape)
11165 RaiseIfFailed("Propagate", self.BlocksOp)
11166 self._autoPublish(listChains, theName, "propagate")
11169 # end of l3_blocks_op
11172 ## @addtogroup l3_groups
11175 ## Creates a new group which will store sub-shapes of theMainShape
11176 # @param theMainShape is a GEOM object on which the group is selected
11177 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11178 # @param theName Object name; when specified, this parameter is used
11179 # for result publication in the study. Otherwise, if automatic
11180 # publication is switched on, default value is used for result name.
11182 # @return a newly created GEOM group (GEOM.GEOM_Object)
11184 # @ref tui_working_with_groups_page "Example 1"
11185 # \n @ref swig_CreateGroup "Example 2"
11186 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11188 Creates a new group which will store sub-shapes of theMainShape
11191 theMainShape is a GEOM object on which the group is selected
11192 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11193 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11194 theName Object name; when specified, this parameter is used
11195 for result publication in the study. Otherwise, if automatic
11196 publication is switched on, default value is used for result name.
11199 a newly created GEOM group
11202 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11205 # Example: see GEOM_TestOthers.py
11206 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11207 RaiseIfFailed("CreateGroup", self.GroupOp)
11208 self._autoPublish(anObj, theName, "group")
11211 ## Adds a sub-object with ID theSubShapeId to the group
11212 # @param theGroup is a GEOM group to which the new sub-shape is added
11213 # @param theSubShapeID is a sub-shape ID in the main object.
11214 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11216 # @ref tui_working_with_groups_page "Example"
11217 def AddObject(self,theGroup, theSubShapeID):
11219 Adds a sub-object with ID theSubShapeId to the group
11222 theGroup is a GEOM group to which the new sub-shape is added
11223 theSubShapeID is a sub-shape ID in the main object.
11226 Use method GetSubShapeID() to get an unique ID of the sub-shape
11228 # Example: see GEOM_TestOthers.py
11229 self.GroupOp.AddObject(theGroup, theSubShapeID)
11230 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11231 RaiseIfFailed("AddObject", self.GroupOp)
11235 ## Removes a sub-object with ID \a theSubShapeId from the group
11236 # @param theGroup is a GEOM group from which the new sub-shape is removed
11237 # @param theSubShapeID is a sub-shape ID in the main object.
11238 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11240 # @ref tui_working_with_groups_page "Example"
11241 def RemoveObject(self,theGroup, theSubShapeID):
11243 Removes a sub-object with ID theSubShapeId from the group
11246 theGroup is a GEOM group from which the new sub-shape is removed
11247 theSubShapeID is a sub-shape ID in the main object.
11250 Use method GetSubShapeID() to get an unique ID of the sub-shape
11252 # Example: see GEOM_TestOthers.py
11253 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11254 RaiseIfFailed("RemoveObject", self.GroupOp)
11257 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11258 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11259 # @param theSubShapes is a list of sub-shapes to be added.
11261 # @ref tui_working_with_groups_page "Example"
11262 def UnionList (self,theGroup, theSubShapes):
11264 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11267 theGroup is a GEOM group to which the new sub-shapes are added.
11268 theSubShapes is a list of sub-shapes to be added.
11270 # Example: see GEOM_TestOthers.py
11271 self.GroupOp.UnionList(theGroup, theSubShapes)
11272 RaiseIfFailed("UnionList", self.GroupOp)
11275 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11276 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11277 # @param theSubShapes is a list of indices of sub-shapes to be added.
11279 # @ref swig_UnionIDs "Example"
11280 def UnionIDs(self,theGroup, theSubShapes):
11282 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11285 theGroup is a GEOM group to which the new sub-shapes are added.
11286 theSubShapes is a list of indices of sub-shapes to be added.
11288 # Example: see GEOM_TestOthers.py
11289 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11290 RaiseIfFailed("UnionIDs", self.GroupOp)
11293 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11294 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11295 # @param theSubShapes is a list of sub-shapes to be removed.
11297 # @ref tui_working_with_groups_page "Example"
11298 def DifferenceList (self,theGroup, theSubShapes):
11300 Removes from the group all the given shapes. No errors, if some shapes are not included.
11303 theGroup is a GEOM group from which the sub-shapes are removed.
11304 theSubShapes is a list of sub-shapes to be removed.
11306 # Example: see GEOM_TestOthers.py
11307 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11308 RaiseIfFailed("DifferenceList", self.GroupOp)
11311 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11312 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11313 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11315 # @ref swig_DifferenceIDs "Example"
11316 def DifferenceIDs(self,theGroup, theSubShapes):
11318 Removes from the group all the given shapes. No errors, if some shapes are not included.
11321 theGroup is a GEOM group from which the sub-shapes are removed.
11322 theSubShapes is a list of indices of sub-shapes to be removed.
11324 # Example: see GEOM_TestOthers.py
11325 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11326 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11329 ## Union of two groups.
11330 # New group is created. It will contain all entities
11331 # which are present in groups theGroup1 and theGroup2.
11332 # @param theGroup1, theGroup2 are the initial GEOM groups
11333 # to create the united group from.
11334 # @param theName Object name; when specified, this parameter is used
11335 # for result publication in the study. Otherwise, if automatic
11336 # publication is switched on, default value is used for result name.
11338 # @return a newly created GEOM group.
11340 # @ref tui_union_groups_anchor "Example"
11341 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11343 Union of two groups.
11344 New group is created. It will contain all entities
11345 which are present in groups theGroup1 and theGroup2.
11348 theGroup1, theGroup2 are the initial GEOM groups
11349 to create the united group from.
11350 theName Object name; when specified, this parameter is used
11351 for result publication in the study. Otherwise, if automatic
11352 publication is switched on, default value is used for result name.
11355 a newly created GEOM group.
11357 # Example: see GEOM_TestOthers.py
11358 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11359 RaiseIfFailed("UnionGroups", self.GroupOp)
11360 self._autoPublish(aGroup, theName, "group")
11363 ## Intersection of two groups.
11364 # New group is created. It will contain only those entities
11365 # which are present in both groups theGroup1 and theGroup2.
11366 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11367 # @param theName Object name; when specified, this parameter is used
11368 # for result publication in the study. Otherwise, if automatic
11369 # publication is switched on, default value is used for result name.
11371 # @return a newly created GEOM group.
11373 # @ref tui_intersect_groups_anchor "Example"
11374 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11376 Intersection of two groups.
11377 New group is created. It will contain only those entities
11378 which are present in both groups theGroup1 and theGroup2.
11381 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11382 theName Object name; when specified, this parameter is used
11383 for result publication in the study. Otherwise, if automatic
11384 publication is switched on, default value is used for result name.
11387 a newly created GEOM group.
11389 # Example: see GEOM_TestOthers.py
11390 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11391 RaiseIfFailed("IntersectGroups", self.GroupOp)
11392 self._autoPublish(aGroup, theName, "group")
11395 ## Cut of two groups.
11396 # New group is created. It will contain entities which are
11397 # present in group theGroup1 but are not present in group theGroup2.
11398 # @param theGroup1 is a GEOM group to include elements of.
11399 # @param theGroup2 is a GEOM group to exclude elements of.
11400 # @param theName Object name; when specified, this parameter is used
11401 # for result publication in the study. Otherwise, if automatic
11402 # publication is switched on, default value is used for result name.
11404 # @return a newly created GEOM group.
11406 # @ref tui_cut_groups_anchor "Example"
11407 def CutGroups (self, theGroup1, theGroup2, theName=None):
11410 New group is created. It will contain entities which are
11411 present in group theGroup1 but are not present in group theGroup2.
11414 theGroup1 is a GEOM group to include elements of.
11415 theGroup2 is a GEOM group to exclude elements of.
11416 theName Object name; when specified, this parameter is used
11417 for result publication in the study. Otherwise, if automatic
11418 publication is switched on, default value is used for result name.
11421 a newly created GEOM group.
11423 # Example: see GEOM_TestOthers.py
11424 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11425 RaiseIfFailed("CutGroups", self.GroupOp)
11426 self._autoPublish(aGroup, theName, "group")
11429 ## Union of list of groups.
11430 # New group is created. It will contain all entities that are
11431 # present in groups listed in theGList.
11432 # @param theGList is a list of GEOM groups to create the united group from.
11433 # @param theName Object name; when specified, this parameter is used
11434 # for result publication in the study. Otherwise, if automatic
11435 # publication is switched on, default value is used for result name.
11437 # @return a newly created GEOM group.
11439 # @ref tui_union_groups_anchor "Example"
11440 def UnionListOfGroups (self, theGList, theName=None):
11442 Union of list of groups.
11443 New group is created. It will contain all entities that are
11444 present in groups listed in theGList.
11447 theGList is a list of GEOM groups to create the united group from.
11448 theName Object name; when specified, this parameter is used
11449 for result publication in the study. Otherwise, if automatic
11450 publication is switched on, default value is used for result name.
11453 a newly created GEOM group.
11455 # Example: see GEOM_TestOthers.py
11456 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11457 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11458 self._autoPublish(aGroup, theName, "group")
11461 ## Cut of lists of groups.
11462 # New group is created. It will contain only entities
11463 # which are present in groups listed in theGList.
11464 # @param theGList is a list of GEOM groups to include elements of.
11465 # @param theName Object name; when specified, this parameter is used
11466 # for result publication in the study. Otherwise, if automatic
11467 # publication is switched on, default value is used for result name.
11469 # @return a newly created GEOM group.
11471 # @ref tui_intersect_groups_anchor "Example"
11472 def IntersectListOfGroups (self, theGList, theName=None):
11474 Cut of lists of groups.
11475 New group is created. It will contain only entities
11476 which are present in groups listed in theGList.
11479 theGList is a list of GEOM groups to include elements of.
11480 theName Object name; when specified, this parameter is used
11481 for result publication in the study. Otherwise, if automatic
11482 publication is switched on, default value is used for result name.
11485 a newly created GEOM group.
11487 # Example: see GEOM_TestOthers.py
11488 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11489 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11490 self._autoPublish(aGroup, theName, "group")
11493 ## Cut of lists of groups.
11494 # New group is created. It will contain only entities
11495 # which are present in groups listed in theGList1 but
11496 # are not present in groups from theGList2.
11497 # @param theGList1 is a list of GEOM groups to include elements of.
11498 # @param theGList2 is a list of GEOM groups to exclude elements of.
11499 # @param theName Object name; when specified, this parameter is used
11500 # for result publication in the study. Otherwise, if automatic
11501 # publication is switched on, default value is used for result name.
11503 # @return a newly created GEOM group.
11505 # @ref tui_cut_groups_anchor "Example"
11506 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11508 Cut of lists of groups.
11509 New group is created. It will contain only entities
11510 which are present in groups listed in theGList1 but
11511 are not present in groups from theGList2.
11514 theGList1 is a list of GEOM groups to include elements of.
11515 theGList2 is a list of GEOM groups to exclude elements of.
11516 theName Object name; when specified, this parameter is used
11517 for result publication in the study. Otherwise, if automatic
11518 publication is switched on, default value is used for result name.
11521 a newly created GEOM group.
11523 # Example: see GEOM_TestOthers.py
11524 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11525 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11526 self._autoPublish(aGroup, theName, "group")
11529 ## Returns a list of sub-objects ID stored in the group
11530 # @param theGroup is a GEOM group for which a list of IDs is requested
11532 # @ref swig_GetObjectIDs "Example"
11533 def GetObjectIDs(self,theGroup):
11535 Returns a list of sub-objects ID stored in the group
11538 theGroup is a GEOM group for which a list of IDs is requested
11540 # Example: see GEOM_TestOthers.py
11541 ListIDs = self.GroupOp.GetObjects(theGroup)
11542 RaiseIfFailed("GetObjects", self.GroupOp)
11545 ## Returns a type of sub-objects stored in the group
11546 # @param theGroup is a GEOM group which type is returned.
11548 # @ref swig_GetType "Example"
11549 def GetType(self,theGroup):
11551 Returns a type of sub-objects stored in the group
11554 theGroup is a GEOM group which type is returned.
11556 # Example: see GEOM_TestOthers.py
11557 aType = self.GroupOp.GetType(theGroup)
11558 RaiseIfFailed("GetType", self.GroupOp)
11561 ## Convert a type of geom object from id to string value
11562 # @param theId is a GEOM obect type id.
11563 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11564 # @ref swig_GetType "Example"
11565 def ShapeIdToType(self, theId):
11567 Convert a type of geom object from id to string value
11570 theId is a GEOM obect type id.
11573 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11600 return "REVOLUTION"
11648 return "FREE_BOUNDS"
11656 return "THRUSECTIONS"
11658 return "COMPOUNDFILTER"
11660 return "SHAPES_ON_SHAPE"
11662 return "ELLIPSE_ARC"
11664 return "3DSKETCHER"
11670 return "PIPETSHAPE"
11671 return "Shape Id not exist."
11673 ## Returns a main shape associated with the group
11674 # @param theGroup is a GEOM group for which a main shape object is requested
11675 # @return a GEOM object which is a main shape for theGroup
11677 # @ref swig_GetMainShape "Example"
11678 def GetMainShape(self,theGroup):
11680 Returns a main shape associated with the group
11683 theGroup is a GEOM group for which a main shape object is requested
11686 a GEOM object which is a main shape for theGroup
11688 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11690 # Example: see GEOM_TestOthers.py
11691 anObj = self.GroupOp.GetMainShape(theGroup)
11692 RaiseIfFailed("GetMainShape", self.GroupOp)
11695 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11696 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11697 # @param theShape given shape (see GEOM.GEOM_Object)
11698 # @param min_length minimum length of edges of theShape
11699 # @param max_length maximum length of edges of theShape
11700 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11701 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11702 # @param theName Object name; when specified, this parameter is used
11703 # for result publication in the study. Otherwise, if automatic
11704 # publication is switched on, default value is used for result name.
11706 # @return a newly created GEOM group of edges
11708 # @@ref swig_todo "Example"
11709 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11711 Create group of edges of theShape, whose length is in range [min_length, max_length].
11712 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11715 theShape given shape
11716 min_length minimum length of edges of theShape
11717 max_length maximum length of edges of theShape
11718 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11719 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11720 theName Object name; when specified, this parameter is used
11721 for result publication in the study. Otherwise, if automatic
11722 publication is switched on, default value is used for result name.
11725 a newly created GEOM group of edges.
11727 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11728 edges_in_range = []
11730 Props = self.BasicProperties(edge)
11731 if min_length <= Props[0] and Props[0] <= max_length:
11732 if (not include_min) and (min_length == Props[0]):
11735 if (not include_max) and (Props[0] == max_length):
11738 edges_in_range.append(edge)
11740 if len(edges_in_range) <= 0:
11741 print "No edges found by given criteria"
11744 # note: auto-publishing is done in self.CreateGroup()
11745 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11746 self.UnionList(group_edges, edges_in_range)
11750 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11751 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11752 # @param min_length minimum length of edges of selected shape
11753 # @param max_length maximum length of edges of selected shape
11754 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11755 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11756 # @return a newly created GEOM group of edges
11757 # @ref swig_todo "Example"
11758 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11760 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11761 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11764 min_length minimum length of edges of selected shape
11765 max_length maximum length of edges of selected shape
11766 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11767 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11770 a newly created GEOM group of edges.
11772 nb_selected = sg.SelectedCount()
11773 if nb_selected < 1:
11774 print "Select a shape before calling this function, please."
11776 if nb_selected > 1:
11777 print "Only one shape must be selected"
11780 id_shape = sg.getSelected(0)
11781 shape = IDToObject( id_shape )
11783 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11787 if include_min: left_str = " <= "
11788 if include_max: right_str = " <= "
11790 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11791 + left_str + "length" + right_str + `max_length`)
11793 sg.updateObjBrowser(1)
11800 ## @addtogroup l4_advanced
11803 ## Create a T-shape object with specified caracteristics for the main
11804 # and the incident pipes (radius, width, half-length).
11805 # The extremities of the main pipe are located on junctions points P1 and P2.
11806 # The extremity of the incident pipe is located on junction point P3.
11807 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11808 # the main plane of the T-shape is XOY.
11810 # @param theR1 Internal radius of main pipe
11811 # @param theW1 Width of main pipe
11812 # @param theL1 Half-length of main pipe
11813 # @param theR2 Internal radius of incident pipe (R2 < R1)
11814 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11815 # @param theL2 Half-length of incident pipe
11817 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11818 # @param theP1 1st junction point of main pipe
11819 # @param theP2 2nd junction point of main pipe
11820 # @param theP3 Junction point of incident pipe
11822 # @param theRL Internal radius of left thickness reduction
11823 # @param theWL Width of left thickness reduction
11824 # @param theLtransL Length of left transition part
11825 # @param theLthinL Length of left thin part
11827 # @param theRR Internal radius of right thickness reduction
11828 # @param theWR Width of right thickness reduction
11829 # @param theLtransR Length of right transition part
11830 # @param theLthinR Length of right thin part
11832 # @param theRI Internal radius of incident thickness reduction
11833 # @param theWI Width of incident thickness reduction
11834 # @param theLtransI Length of incident transition part
11835 # @param theLthinI Length of incident thin part
11837 # @param theName Object name; when specified, this parameter is used
11838 # for result publication in the study. Otherwise, if automatic
11839 # publication is switched on, default value is used for result name.
11841 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11843 # @ref tui_creation_pipetshape "Example"
11844 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11845 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11846 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11847 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11848 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11851 Create a T-shape object with specified caracteristics for the main
11852 and the incident pipes (radius, width, half-length).
11853 The extremities of the main pipe are located on junctions points P1 and P2.
11854 The extremity of the incident pipe is located on junction point P3.
11855 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11856 the main plane of the T-shape is XOY.
11859 theR1 Internal radius of main pipe
11860 theW1 Width of main pipe
11861 theL1 Half-length of main pipe
11862 theR2 Internal radius of incident pipe (R2 < R1)
11863 theW2 Width of incident pipe (R2+W2 < R1+W1)
11864 theL2 Half-length of incident pipe
11865 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11866 theP1 1st junction point of main pipe
11867 theP2 2nd junction point of main pipe
11868 theP3 Junction point of incident pipe
11870 theRL Internal radius of left thickness reduction
11871 theWL Width of left thickness reduction
11872 theLtransL Length of left transition part
11873 theLthinL Length of left thin part
11875 theRR Internal radius of right thickness reduction
11876 theWR Width of right thickness reduction
11877 theLtransR Length of right transition part
11878 theLthinR Length of right thin part
11880 theRI Internal radius of incident thickness reduction
11881 theWI Width of incident thickness reduction
11882 theLtransI Length of incident transition part
11883 theLthinI Length of incident thin part
11885 theName Object name; when specified, this parameter is used
11886 for result publication in the study. Otherwise, if automatic
11887 publication is switched on, default value is used for result name.
11890 List of GEOM_Object, containing the created shape and propagation groups.
11893 # create PipeTShape object
11894 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11895 # create PipeTShape object with position
11896 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11897 # create PipeTShape object with left thickness reduction
11898 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11900 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)
11901 if (theP1 and theP2 and theP3):
11902 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11903 theRL, theWL, theLtransL, theLthinL,
11904 theRR, theWR, theLtransR, theLthinR,
11905 theRI, theWI, theLtransI, theLthinI,
11906 theHexMesh, theP1, theP2, theP3)
11908 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11909 theRL, theWL, theLtransL, theLthinL,
11910 theRR, theWR, theLtransR, theLthinR,
11911 theRI, theWI, theLtransI, theLthinI,
11913 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11914 if Parameters: anObj[0].SetParameters(Parameters)
11915 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11916 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11919 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11920 # and the incident pipes (radius, width, half-length). The chamfer is
11921 # created on the junction of the pipes.
11922 # The extremities of the main pipe are located on junctions points P1 and P2.
11923 # The extremity of the incident pipe is located on junction point P3.
11924 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11925 # the main plane of the T-shape is XOY.
11926 # @param theR1 Internal radius of main pipe
11927 # @param theW1 Width of main pipe
11928 # @param theL1 Half-length of main pipe
11929 # @param theR2 Internal radius of incident pipe (R2 < R1)
11930 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11931 # @param theL2 Half-length of incident pipe
11932 # @param theH Height of the chamfer.
11933 # @param theW Width of the chamfer.
11934 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11935 # @param theP1 1st junction point of main pipe
11936 # @param theP2 2nd junction point of main pipe
11937 # @param theP3 Junction point of incident pipe
11939 # @param theRL Internal radius of left thickness reduction
11940 # @param theWL Width of left thickness reduction
11941 # @param theLtransL Length of left transition part
11942 # @param theLthinL Length of left thin part
11944 # @param theRR Internal radius of right thickness reduction
11945 # @param theWR Width of right thickness reduction
11946 # @param theLtransR Length of right transition part
11947 # @param theLthinR Length of right thin part
11949 # @param theRI Internal radius of incident thickness reduction
11950 # @param theWI Width of incident thickness reduction
11951 # @param theLtransI Length of incident transition part
11952 # @param theLthinI Length of incident thin part
11954 # @param theName Object name; when specified, this parameter is used
11955 # for result publication in the study. Otherwise, if automatic
11956 # publication is switched on, default value is used for result name.
11958 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11960 # @ref tui_creation_pipetshape "Example"
11961 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11962 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11963 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11964 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11965 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11968 Create a T-shape object with chamfer and with specified caracteristics for the main
11969 and the incident pipes (radius, width, half-length). The chamfer is
11970 created on the junction of the pipes.
11971 The extremities of the main pipe are located on junctions points P1 and P2.
11972 The extremity of the incident pipe is located on junction point P3.
11973 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11974 the main plane of the T-shape is XOY.
11977 theR1 Internal radius of main pipe
11978 theW1 Width of main pipe
11979 theL1 Half-length of main pipe
11980 theR2 Internal radius of incident pipe (R2 < R1)
11981 theW2 Width of incident pipe (R2+W2 < R1+W1)
11982 theL2 Half-length of incident pipe
11983 theH Height of the chamfer.
11984 theW Width of the chamfer.
11985 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11986 theP1 1st junction point of main pipe
11987 theP2 2nd junction point of main pipe
11988 theP3 Junction point of incident pipe
11990 theRL Internal radius of left thickness reduction
11991 theWL Width of left thickness reduction
11992 theLtransL Length of left transition part
11993 theLthinL Length of left thin part
11995 theRR Internal radius of right thickness reduction
11996 theWR Width of right thickness reduction
11997 theLtransR Length of right transition part
11998 theLthinR Length of right thin part
12000 theRI Internal radius of incident thickness reduction
12001 theWI Width of incident thickness reduction
12002 theLtransI Length of incident transition part
12003 theLthinI Length of incident thin part
12005 theName Object name; when specified, this parameter is used
12006 for result publication in the study. Otherwise, if automatic
12007 publication is switched on, default value is used for result name.
12010 List of GEOM_Object, containing the created shape and propagation groups.
12013 # create PipeTShape with chamfer object
12014 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12015 # create PipeTShape with chamfer object with position
12016 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12017 # create PipeTShape with chamfer object with left thickness reduction
12018 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)
12020 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)
12021 if (theP1 and theP2 and theP3):
12022 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12023 theRL, theWL, theLtransL, theLthinL,
12024 theRR, theWR, theLtransR, theLthinR,
12025 theRI, theWI, theLtransI, theLthinI,
12026 theH, theW, theHexMesh, theP1, theP2, theP3)
12028 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12029 theRL, theWL, theLtransL, theLthinL,
12030 theRR, theWR, theLtransR, theLthinR,
12031 theRI, theWI, theLtransI, theLthinI,
12032 theH, theW, theHexMesh)
12033 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12034 if Parameters: anObj[0].SetParameters(Parameters)
12035 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12036 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12039 ## Create a T-shape object with fillet and with specified caracteristics for the main
12040 # and the incident pipes (radius, width, half-length). The fillet is
12041 # created on the junction of the pipes.
12042 # The extremities of the main pipe are located on junctions points P1 and P2.
12043 # The extremity of the incident pipe is located on junction point P3.
12044 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12045 # the main plane of the T-shape is XOY.
12046 # @param theR1 Internal radius of main pipe
12047 # @param theW1 Width of main pipe
12048 # @param theL1 Half-length of main pipe
12049 # @param theR2 Internal radius of incident pipe (R2 < R1)
12050 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12051 # @param theL2 Half-length of incident pipe
12052 # @param theRF Radius of curvature of fillet.
12053 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12054 # @param theP1 1st junction point of main pipe
12055 # @param theP2 2nd junction point of main pipe
12056 # @param theP3 Junction point of incident pipe
12058 # @param theRL Internal radius of left thickness reduction
12059 # @param theWL Width of left thickness reduction
12060 # @param theLtransL Length of left transition part
12061 # @param theLthinL Length of left thin part
12063 # @param theRR Internal radius of right thickness reduction
12064 # @param theWR Width of right thickness reduction
12065 # @param theLtransR Length of right transition part
12066 # @param theLthinR Length of right thin part
12068 # @param theRI Internal radius of incident thickness reduction
12069 # @param theWI Width of incident thickness reduction
12070 # @param theLtransI Length of incident transition part
12071 # @param theLthinI Length of incident thin part
12073 # @param theName Object name; when specified, this parameter is used
12074 # for result publication in the study. Otherwise, if automatic
12075 # publication is switched on, default value is used for result name.
12077 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12079 # @ref tui_creation_pipetshape "Example"
12080 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12081 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12082 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12083 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12084 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12087 Create a T-shape object with fillet and with specified caracteristics for the main
12088 and the incident pipes (radius, width, half-length). The fillet is
12089 created on the junction of the pipes.
12090 The extremities of the main pipe are located on junctions points P1 and P2.
12091 The extremity of the incident pipe is located on junction point P3.
12094 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12095 the main plane of the T-shape is XOY.
12096 theR1 Internal radius of main pipe
12097 theW1 Width of main pipe
12098 heL1 Half-length of main pipe
12099 theR2 Internal radius of incident pipe (R2 < R1)
12100 theW2 Width of incident pipe (R2+W2 < R1+W1)
12101 theL2 Half-length of incident pipe
12102 theRF Radius of curvature of fillet.
12103 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12104 theP1 1st junction point of main pipe
12105 theP2 2nd junction point of main pipe
12106 theP3 Junction point of incident pipe
12108 theRL Internal radius of left thickness reduction
12109 theWL Width of left thickness reduction
12110 theLtransL Length of left transition part
12111 theLthinL Length of left thin part
12113 theRR Internal radius of right thickness reduction
12114 theWR Width of right thickness reduction
12115 theLtransR Length of right transition part
12116 theLthinR Length of right thin part
12118 theRI Internal radius of incident thickness reduction
12119 theWI Width of incident thickness reduction
12120 theLtransI Length of incident transition part
12121 theLthinI Length of incident thin part
12123 theName Object name; when specified, this parameter is used
12124 for result publication in the study. Otherwise, if automatic
12125 publication is switched on, default value is used for result name.
12128 List of GEOM_Object, containing the created shape and propagation groups.
12131 # create PipeTShape with fillet object
12132 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12133 # create PipeTShape with fillet object with position
12134 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12135 # create PipeTShape with fillet object with left thickness reduction
12136 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)
12138 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)
12139 if (theP1 and theP2 and theP3):
12140 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12141 theRL, theWL, theLtransL, theLthinL,
12142 theRR, theWR, theLtransR, theLthinR,
12143 theRI, theWI, theLtransI, theLthinI,
12144 theRF, theHexMesh, theP1, theP2, theP3)
12146 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12147 theRL, theWL, theLtransL, theLthinL,
12148 theRR, theWR, theLtransR, theLthinR,
12149 theRI, theWI, theLtransI, theLthinI,
12151 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12152 if Parameters: anObj[0].SetParameters(Parameters)
12153 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12154 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12157 ## This function allows creating a disk already divided into blocks. It
12158 # can be used to create divided pipes for later meshing in hexaedra.
12159 # @param theR Radius of the disk
12160 # @param theOrientation Orientation of the plane on which the disk will be built
12161 # 1 = XOY, 2 = OYZ, 3 = OZX
12162 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12163 # @param theName Object name; when specified, this parameter is used
12164 # for result publication in the study. Otherwise, if automatic
12165 # publication is switched on, default value is used for result name.
12167 # @return New GEOM_Object, containing the created shape.
12169 # @ref tui_creation_divideddisk "Example"
12170 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12172 Creates a disk, divided into blocks. It can be used to create divided pipes
12173 for later meshing in hexaedra.
12176 theR Radius of the disk
12177 theOrientation Orientation of the plane on which the disk will be built:
12178 1 = XOY, 2 = OYZ, 3 = OZX
12179 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12180 theName Object name; when specified, this parameter is used
12181 for result publication in the study. Otherwise, if automatic
12182 publication is switched on, default value is used for result name.
12185 New GEOM_Object, containing the created shape.
12187 theR, Parameters = ParseParameters(theR)
12188 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12189 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12190 if Parameters: anObj.SetParameters(Parameters)
12191 self._autoPublish(anObj, theName, "dividedDisk")
12194 ## This function allows creating a disk already divided into blocks. It
12195 # can be used to create divided pipes for later meshing in hexaedra.
12196 # @param theCenter Center of the disk
12197 # @param theVector Normal vector to the plane of the created disk
12198 # @param theRadius Radius of the disk
12199 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12200 # @param theName Object name; when specified, this parameter is used
12201 # for result publication in the study. Otherwise, if automatic
12202 # publication is switched on, default value is used for result name.
12204 # @return New GEOM_Object, containing the created shape.
12206 # @ref tui_creation_divideddisk "Example"
12207 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12209 Creates a disk already divided into blocks. It can be used to create divided pipes
12210 for later meshing in hexaedra.
12213 theCenter Center of the disk
12214 theVector Normal vector to the plane of the created disk
12215 theRadius Radius of the disk
12216 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12217 theName Object name; when specified, this parameter is used
12218 for result publication in the study. Otherwise, if automatic
12219 publication is switched on, default value is used for result name.
12222 New GEOM_Object, containing the created shape.
12224 theRadius, Parameters = ParseParameters(theRadius)
12225 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12226 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12227 if Parameters: anObj.SetParameters(Parameters)
12228 self._autoPublish(anObj, theName, "dividedDisk")
12231 ## Builds a cylinder prepared for hexa meshes
12232 # @param theR Radius of the cylinder
12233 # @param theH Height of the cylinder
12234 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12235 # @param theName Object name; when specified, this parameter is used
12236 # for result publication in the study. Otherwise, if automatic
12237 # publication is switched on, default value is used for result name.
12239 # @return New GEOM_Object, containing the created shape.
12241 # @ref tui_creation_dividedcylinder "Example"
12242 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12244 Builds a cylinder prepared for hexa meshes
12247 theR Radius of the cylinder
12248 theH Height of the cylinder
12249 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12250 theName Object name; when specified, this parameter is used
12251 for result publication in the study. Otherwise, if automatic
12252 publication is switched on, default value is used for result name.
12255 New GEOM_Object, containing the created shape.
12257 theR, theH, Parameters = ParseParameters(theR, theH)
12258 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12259 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12260 if Parameters: anObj.SetParameters(Parameters)
12261 self._autoPublish(anObj, theName, "dividedCylinder")
12264 ## Create a surface from a cloud of points
12265 # @param thelPoints list of points
12266 # @return New GEOM_Object, containing the created shape.
12268 # @ref tui_creation_smoothingsurface "Example"
12269 def MakeSmoothingSurface(self, thelPoints):
12270 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12271 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12274 #@@ insert new functions before this line @@ do not remove this line @@#
12276 # end of l4_advanced
12279 ## Create a copy of the given object
12281 # @param theOriginal geometry object for copy
12282 # @param theName Object name; when specified, this parameter is used
12283 # for result publication in the study. Otherwise, if automatic
12284 # publication is switched on, default value is used for result name.
12286 # @return New GEOM_Object, containing the copied shape.
12288 # @ingroup l1_geomBuilder_auxiliary
12289 # @ref swig_MakeCopy "Example"
12290 def MakeCopy(self, theOriginal, theName=None):
12292 Create a copy of the given object
12295 theOriginal geometry object for copy
12296 theName Object name; when specified, this parameter is used
12297 for result publication in the study. Otherwise, if automatic
12298 publication is switched on, default value is used for result name.
12301 New GEOM_Object, containing the copied shape.
12303 Example of usage: Copy = geompy.MakeCopy(Box)
12305 # Example: see GEOM_TestAll.py
12306 anObj = self.InsertOp.MakeCopy(theOriginal)
12307 RaiseIfFailed("MakeCopy", self.InsertOp)
12308 self._autoPublish(anObj, theName, "copy")
12311 ## Add Path to load python scripts from
12312 # @param Path a path to load python scripts from
12313 # @ingroup l1_geomBuilder_auxiliary
12314 def addPath(self,Path):
12316 Add Path to load python scripts from
12319 Path a path to load python scripts from
12321 if (sys.path.count(Path) < 1):
12322 sys.path.append(Path)
12326 ## Load marker texture from the file
12327 # @param Path a path to the texture file
12328 # @return unique texture identifier
12329 # @ingroup l1_geomBuilder_auxiliary
12330 def LoadTexture(self, Path):
12332 Load marker texture from the file
12335 Path a path to the texture file
12338 unique texture identifier
12340 # Example: see GEOM_TestAll.py
12341 ID = self.InsertOp.LoadTexture(Path)
12342 RaiseIfFailed("LoadTexture", self.InsertOp)
12345 ## Get internal name of the object based on its study entry
12346 # @note This method does not provide an unique identifier of the geometry object.
12347 # @note This is internal function of GEOM component, though it can be used outside it for
12348 # appropriate reason (e.g. for identification of geometry object).
12349 # @param obj geometry object
12350 # @return unique object identifier
12351 # @ingroup l1_geomBuilder_auxiliary
12352 def getObjectID(self, obj):
12354 Get internal name of the object based on its study entry.
12355 Note: this method does not provide an unique identifier of the geometry object.
12356 It is an internal function of GEOM component, though it can be used outside GEOM for
12357 appropriate reason (e.g. for identification of geometry object).
12360 obj geometry object
12363 unique object identifier
12366 entry = salome.ObjectToID(obj)
12367 if entry is not None:
12368 lst = entry.split(":")
12370 ID = lst[-1] # -1 means last item in the list
12371 return "GEOM_" + ID
12376 ## Add marker texture. @a Width and @a Height parameters
12377 # specify width and height of the texture in pixels.
12378 # If @a RowData is @c True, @a Texture parameter should represent texture data
12379 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12380 # parameter should be unpacked string, in which '1' symbols represent opaque
12381 # pixels and '0' represent transparent pixels of the texture bitmap.
12383 # @param Width texture width in pixels
12384 # @param Height texture height in pixels
12385 # @param Texture texture data
12386 # @param RowData if @c True, @a Texture data are packed in the byte stream
12387 # @return unique texture identifier
12388 # @ingroup l1_geomBuilder_auxiliary
12389 def AddTexture(self, Width, Height, Texture, RowData=False):
12391 Add marker texture. Width and Height parameters
12392 specify width and height of the texture in pixels.
12393 If RowData is True, Texture parameter should represent texture data
12394 packed into the byte array. If RowData is False (default), Texture
12395 parameter should be unpacked string, in which '1' symbols represent opaque
12396 pixels and '0' represent transparent pixels of the texture bitmap.
12399 Width texture width in pixels
12400 Height texture height in pixels
12401 Texture texture data
12402 RowData if True, Texture data are packed in the byte stream
12405 return unique texture identifier
12407 if not RowData: Texture = PackData(Texture)
12408 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12409 RaiseIfFailed("AddTexture", self.InsertOp)
12412 ## Creates a new folder object. It is a container for any GEOM objects.
12413 # @param Name name of the container
12414 # @param Father parent object. If None,
12415 # folder under 'Geometry' root object will be created.
12416 # @return a new created folder
12417 def NewFolder(self, Name, Father=None):
12419 Create a new folder object. It is an auxiliary container for any GEOM objects.
12422 Name name of the container
12423 Father parent object. If None,
12424 folder under 'Geometry' root object will be created.
12427 a new created folder
12429 if not Father: Father = self.father
12430 return self.CreateFolder(Name, Father)
12432 ## Move object to the specified folder
12433 # @param Object object to move
12434 # @param Folder target folder
12435 def PutToFolder(self, Object, Folder):
12437 Move object to the specified folder
12440 Object object to move
12441 Folder target folder
12443 self.MoveToFolder(Object, Folder)
12446 ## Move list of objects to the specified folder
12447 # @param ListOfSO list of objects to move
12448 # @param Folder target folder
12449 def PutListToFolder(self, ListOfSO, Folder):
12451 Move list of objects to the specified folder
12454 ListOfSO list of objects to move
12455 Folder target folder
12457 self.MoveListToFolder(ListOfSO, Folder)
12461 # Register the new proxy for GEOM_Gen
12462 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12464 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12465 # interface to GEOM operations.
12470 # salome.salome_init()
12471 # from salome.geom import geomBuilder
12472 # geompy = geomBuilder.New(salome.myStudy)
12474 # @param study SALOME study, generally obtained by salome.myStudy.
12475 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12476 # @return geomBuilder instance
12477 def New( study, instance=None):
12479 Create a new geomBuilder instance.The geomBuilder class provides the Python
12480 interface to GEOM operations.
12484 salome.salome_init()
12485 from salome.geom import geomBuilder
12486 geompy = geomBuilder.New(salome.myStudy)
12489 study SALOME study, generally obtained by salome.myStudy.
12490 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12492 geomBuilder instance
12494 #print "New geomBuilder ", study, instance
12501 geom = geomBuilder()
12502 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12503 geom.init_geom(study)