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)
700 # The below line is a right way to map all plugin functions to geomBuilder,
701 # but AdvancedOperations are already mapped, that is why this line is commented
702 # and presents here only as an axample
703 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
705 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
706 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
708 # set GEOM as root in the use case tree
709 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
710 self.myUseCaseBuilder.SetRootCurrent()
711 self.myUseCaseBuilder.Append(self.father)
714 def GetPluginOperations(self, studyID, libraryName):
715 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
717 # bind methods of operations to self
718 methods = op.__class__.__dict__['__methods__']
719 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
720 for meth_name in methods:
721 if not meth_name in avoid_methods: # avoid basic methods
722 function = getattr(op.__class__, meth_name)
723 if callable(function):
724 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
725 self.__dict__[meth_name] = PluginOperation(op, function)
728 ## Enable / disable results auto-publishing
730 # The automatic publishing is managed in the following way:
731 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
732 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
733 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
734 # value passed as parameter has the same effect.
735 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
736 # maximum number of sub-shapes allowed for publishing is set to specified value.
738 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
739 # @ingroup l1_publish_data
740 def addToStudyAuto(self, maxNbSubShapes=-1):
742 Enable / disable results auto-publishing
744 The automatic publishing is managed in the following way:
745 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
746 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
747 maximum number of sub-shapes allowed for publishing is unlimited; any negative
748 value passed as parameter has the same effect.
749 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
750 maximum number of sub-shapes allowed for publishing is set to this value.
753 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
756 geompy.addToStudyAuto() # enable auto-publishing
757 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
758 geompy.addToStudyAuto(0) # disable auto-publishing
760 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
763 ## Dump component to the Python script
764 # This method overrides IDL function to allow default values for the parameters.
765 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
767 Dump component to the Python script
768 This method overrides IDL function to allow default values for the parameters.
770 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
772 ## Get name for sub-shape aSubObj of shape aMainObj
774 # @ref swig_SubShapeName "Example"
775 def SubShapeName(self,aSubObj, aMainObj):
777 Get name for sub-shape aSubObj of shape aMainObj
779 # Example: see GEOM_TestAll.py
781 #aSubId = orb.object_to_string(aSubObj)
782 #aMainId = orb.object_to_string(aMainObj)
783 #index = gg.getIndexTopology(aSubId, aMainId)
784 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
785 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
786 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
789 ## Publish in study aShape with name aName
791 # \param aShape the shape to be published
792 # \param aName the name for the shape
793 # \param doRestoreSubShapes if True, finds and publishes also
794 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
795 # and published sub-shapes of arguments
796 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
797 # these arguments description
798 # \return study entry of the published shape in form of string
800 # @ingroup l1_publish_data
801 # @ref swig_all_addtostudy "Example"
802 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
803 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
805 Publish in study aShape with name aName
808 aShape the shape to be published
809 aName the name for the shape
810 doRestoreSubShapes if True, finds and publishes also
811 sub-shapes of aShape, corresponding to its arguments
812 and published sub-shapes of arguments
813 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
814 these arguments description
817 study entry of the published shape in form of string
820 id_block1 = geompy.addToStudy(Block1, "Block 1")
822 # Example: see GEOM_TestAll.py
824 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
825 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
826 if doRestoreSubShapes:
827 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
828 theFindMethod, theInheritFirstArg, True )
830 print "addToStudy() failed"
832 return aShape.GetStudyEntry()
834 ## Publish in study aShape with name aName as sub-object of previously published aFather
835 # \param aFather previously published object
836 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
837 # \param aName the name for the shape
839 # \return study entry of the published shape in form of string
841 # @ingroup l1_publish_data
842 # @ref swig_all_addtostudyInFather "Example"
843 def addToStudyInFather(self, aFather, aShape, aName):
845 Publish in study aShape with name aName as sub-object of previously published aFather
848 aFather previously published object
849 aShape the shape to be published as sub-object of aFather
850 aName the name for the shape
853 study entry of the published shape in form of string
855 # Example: see GEOM_TestAll.py
857 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
858 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
860 print "addToStudyInFather() failed"
862 return aShape.GetStudyEntry()
864 ## Unpublish object in study
866 # \param obj the object to be unpublished
867 def hideInStudy(self, obj):
869 Unpublish object in study
872 obj the object to be unpublished
874 ior = salome.orb.object_to_string(obj)
875 aSObject = self.myStudy.FindObjectIOR(ior)
876 if aSObject is not None:
877 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
878 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
879 drwAttribute.SetDrawable(False)
882 # end of l1_geomBuilder_auxiliary
885 ## @addtogroup l3_restore_ss
888 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
889 # To be used from python scripts out of addToStudy() (non-default usage)
890 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
891 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
892 # If this list is empty, all operation arguments will be published
893 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
894 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
895 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
896 # Do not publish sub-shapes in place of arguments, but only
897 # in place of sub-shapes of the first argument,
898 # because the whole shape corresponds to the first argument.
899 # Mainly to be used after transformations, but it also can be
900 # usefull after partition with one object shape, and some other
901 # operations, where only the first argument has to be considered.
902 # If theObject has only one argument shape, this flag is automatically
903 # considered as True, not regarding really passed value.
904 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
905 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
906 # \return list of published sub-shapes
908 # @ref tui_restore_prs_params "Example"
909 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
910 theInheritFirstArg=False, theAddPrefix=True):
912 Publish sub-shapes, standing for arguments and sub-shapes of arguments
913 To be used from python scripts out of geompy.addToStudy (non-default usage)
916 theObject published GEOM.GEOM_Object, arguments of which will be published
917 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
918 If this list is empty, all operation arguments will be published
919 theFindMethod method to search sub-shapes, corresponding to arguments and
920 their sub-shapes. Value from enumeration GEOM.find_shape_method.
921 theInheritFirstArg set properties of the first argument for theObject.
922 Do not publish sub-shapes in place of arguments, but only
923 in place of sub-shapes of the first argument,
924 because the whole shape corresponds to the first argument.
925 Mainly to be used after transformations, but it also can be
926 usefull after partition with one object shape, and some other
927 operations, where only the first argument has to be considered.
928 If theObject has only one argument shape, this flag is automatically
929 considered as True, not regarding really passed value.
930 theAddPrefix add prefix "from_" to names of restored sub-shapes,
931 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
933 list of published sub-shapes
935 # Example: see GEOM_TestAll.py
936 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
937 theFindMethod, theInheritFirstArg, theAddPrefix)
939 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
940 # To be used from python scripts out of addToStudy() (non-default usage)
941 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
942 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
943 # If this list is empty, all operation arguments will be published
944 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
945 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
946 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
947 # Do not publish sub-shapes in place of arguments, but only
948 # in place of sub-shapes of the first argument,
949 # because the whole shape corresponds to the first argument.
950 # Mainly to be used after transformations, but it also can be
951 # usefull after partition with one object shape, and some other
952 # operations, where only the first argument has to be considered.
953 # If theObject has only one argument shape, this flag is automatically
954 # considered as True, not regarding really passed value.
955 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
956 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
957 # \return list of published sub-shapes
959 # @ref tui_restore_prs_params "Example"
960 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
961 theInheritFirstArg=False, theAddPrefix=True):
963 Publish sub-shapes, standing for arguments and sub-shapes of arguments
964 To be used from python scripts out of geompy.addToStudy() (non-default usage)
967 theObject published GEOM.GEOM_Object, arguments of which will be published
968 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
969 If this list is empty, all operation arguments will be published
970 theFindMethod method to search sub-shapes, corresponding to arguments and
971 their sub-shapes. Value from enumeration GEOM::find_shape_method.
972 theInheritFirstArg set properties of the first argument for theObject.
973 Do not publish sub-shapes in place of arguments, but only
974 in place of sub-shapes of the first argument,
975 because the whole shape corresponds to the first argument.
976 Mainly to be used after transformations, but it also can be
977 usefull after partition with one object shape, and some other
978 operations, where only the first argument has to be considered.
979 If theObject has only one argument shape, this flag is automatically
980 considered as True, not regarding really passed value.
981 theAddPrefix add prefix "from_" to names of restored sub-shapes,
982 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
985 list of published sub-shapes
987 # Example: see GEOM_TestAll.py
988 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
989 theFindMethod, theInheritFirstArg, theAddPrefix)
991 # end of l3_restore_ss
994 ## @addtogroup l3_basic_go
997 ## Create point by three coordinates.
998 # @param theX The X coordinate of the point.
999 # @param theY The Y coordinate of the point.
1000 # @param theZ The Z coordinate of the point.
1001 # @param theName Object name; when specified, this parameter is used
1002 # for result publication in the study. Otherwise, if automatic
1003 # publication is switched on, default value is used for result name.
1005 # @return New GEOM.GEOM_Object, containing the created point.
1007 # @ref tui_creation_point "Example"
1008 def MakeVertex(self, theX, theY, theZ, theName=None):
1010 Create point by three coordinates.
1013 theX The X coordinate of the point.
1014 theY The Y coordinate of the point.
1015 theZ The Z coordinate of the point.
1016 theName Object name; when specified, this parameter is used
1017 for result publication in the study. Otherwise, if automatic
1018 publication is switched on, default value is used for result name.
1021 New GEOM.GEOM_Object, containing the created point.
1023 # Example: see GEOM_TestAll.py
1024 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1025 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1026 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1027 anObj.SetParameters(Parameters)
1028 self._autoPublish(anObj, theName, "vertex")
1031 ## Create a point, distant from the referenced point
1032 # on the given distances along the coordinate axes.
1033 # @param theReference The referenced point.
1034 # @param theX Displacement from the referenced point along OX axis.
1035 # @param theY Displacement from the referenced point along OY axis.
1036 # @param theZ Displacement from the referenced point along OZ axis.
1037 # @param theName Object name; when specified, this parameter is used
1038 # for result publication in the study. Otherwise, if automatic
1039 # publication is switched on, default value is used for result name.
1041 # @return New GEOM.GEOM_Object, containing the created point.
1043 # @ref tui_creation_point "Example"
1044 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1046 Create a point, distant from the referenced point
1047 on the given distances along the coordinate axes.
1050 theReference The referenced point.
1051 theX Displacement from the referenced point along OX axis.
1052 theY Displacement from the referenced point along OY axis.
1053 theZ Displacement from the referenced point along OZ axis.
1054 theName Object name; when specified, this parameter is used
1055 for result publication in the study. Otherwise, if automatic
1056 publication is switched on, default value is used for result name.
1059 New GEOM.GEOM_Object, containing the created point.
1061 # Example: see GEOM_TestAll.py
1062 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1063 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1064 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1065 anObj.SetParameters(Parameters)
1066 self._autoPublish(anObj, theName, "vertex")
1069 ## Create a point, corresponding to the given parameter on the given curve.
1070 # @param theRefCurve The referenced curve.
1071 # @param theParameter Value of parameter on the referenced curve.
1072 # @param theName Object name; when specified, this parameter is used
1073 # for result publication in the study. Otherwise, if automatic
1074 # publication is switched on, default value is used for result name.
1076 # @return New GEOM.GEOM_Object, containing the created point.
1078 # @ref tui_creation_point "Example"
1079 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1081 Create a point, corresponding to the given parameter on the given curve.
1084 theRefCurve The referenced curve.
1085 theParameter Value of parameter on the referenced curve.
1086 theName Object name; when specified, this parameter is used
1087 for result publication in the study. Otherwise, if automatic
1088 publication is switched on, default value is used for result name.
1091 New GEOM.GEOM_Object, containing the created point.
1094 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1096 # Example: see GEOM_TestAll.py
1097 theParameter, Parameters = ParseParameters(theParameter)
1098 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1099 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1100 anObj.SetParameters(Parameters)
1101 self._autoPublish(anObj, theName, "vertex")
1104 ## Create a point by projection give coordinates on the given curve
1105 # @param theRefCurve The referenced curve.
1106 # @param theX X-coordinate in 3D space
1107 # @param theY Y-coordinate in 3D space
1108 # @param theZ Z-coordinate in 3D space
1109 # @param theName Object name; when specified, this parameter is used
1110 # for result publication in the study. Otherwise, if automatic
1111 # publication is switched on, default value is used for result name.
1113 # @return New GEOM.GEOM_Object, containing the created point.
1115 # @ref tui_creation_point "Example"
1116 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1118 Create a point by projection give coordinates on the given curve
1121 theRefCurve The referenced curve.
1122 theX X-coordinate in 3D space
1123 theY Y-coordinate in 3D space
1124 theZ Z-coordinate in 3D space
1125 theName Object name; when specified, this parameter is used
1126 for result publication in the study. Otherwise, if automatic
1127 publication is switched on, default value is used for result name.
1130 New GEOM.GEOM_Object, containing the created point.
1133 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1135 # Example: see GEOM_TestAll.py
1136 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1137 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1138 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1139 anObj.SetParameters(Parameters)
1140 self._autoPublish(anObj, theName, "vertex")
1143 ## Create a point, corresponding to the given length on the given curve.
1144 # @param theRefCurve The referenced curve.
1145 # @param theLength Length on the referenced curve. It can be negative.
1146 # @param theStartPoint Point allowing to choose the direction for the calculation
1147 # of the length. If None, start from the first point of theRefCurve.
1148 # @param theName Object name; when specified, this parameter is used
1149 # for result publication in the study. Otherwise, if automatic
1150 # publication is switched on, default value is used for result name.
1152 # @return New GEOM.GEOM_Object, containing the created point.
1154 # @ref tui_creation_point "Example"
1155 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1157 Create a point, corresponding to the given length on the given curve.
1160 theRefCurve The referenced curve.
1161 theLength Length on the referenced curve. It can be negative.
1162 theStartPoint Point allowing to choose the direction for the calculation
1163 of the length. If None, start from the first point of theRefCurve.
1164 theName Object name; when specified, this parameter is used
1165 for result publication in the study. Otherwise, if automatic
1166 publication is switched on, default value is used for result name.
1169 New GEOM.GEOM_Object, containing the created point.
1171 # Example: see GEOM_TestAll.py
1172 theLength, Parameters = ParseParameters(theLength)
1173 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1174 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1175 anObj.SetParameters(Parameters)
1176 self._autoPublish(anObj, theName, "vertex")
1179 ## Create a point, corresponding to the given parameters on the
1181 # @param theRefSurf The referenced surface.
1182 # @param theUParameter Value of U-parameter on the referenced surface.
1183 # @param theVParameter Value of V-parameter on the referenced surface.
1184 # @param theName Object name; when specified, this parameter is used
1185 # for result publication in the study. Otherwise, if automatic
1186 # publication is switched on, default value is used for result name.
1188 # @return New GEOM.GEOM_Object, containing the created point.
1190 # @ref swig_MakeVertexOnSurface "Example"
1191 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1193 Create a point, corresponding to the given parameters on the
1197 theRefSurf The referenced surface.
1198 theUParameter Value of U-parameter on the referenced surface.
1199 theVParameter Value of V-parameter on the referenced surface.
1200 theName Object name; when specified, this parameter is used
1201 for result publication in the study. Otherwise, if automatic
1202 publication is switched on, default value is used for result name.
1205 New GEOM.GEOM_Object, containing the created point.
1208 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1210 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1211 # Example: see GEOM_TestAll.py
1212 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1213 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1214 anObj.SetParameters(Parameters);
1215 self._autoPublish(anObj, theName, "vertex")
1218 ## Create a point by projection give coordinates on the given surface
1219 # @param theRefSurf The referenced surface.
1220 # @param theX X-coordinate in 3D space
1221 # @param theY Y-coordinate in 3D space
1222 # @param theZ Z-coordinate in 3D space
1223 # @param theName Object name; when specified, this parameter is used
1224 # for result publication in the study. Otherwise, if automatic
1225 # publication is switched on, default value is used for result name.
1227 # @return New GEOM.GEOM_Object, containing the created point.
1229 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1230 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1232 Create a point by projection give coordinates on the given surface
1235 theRefSurf The referenced surface.
1236 theX X-coordinate in 3D space
1237 theY Y-coordinate in 3D space
1238 theZ Z-coordinate in 3D space
1239 theName Object name; when specified, this parameter is used
1240 for result publication in the study. Otherwise, if automatic
1241 publication is switched on, default value is used for result name.
1244 New GEOM.GEOM_Object, containing the created point.
1247 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1249 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1250 # Example: see GEOM_TestAll.py
1251 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1252 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1253 anObj.SetParameters(Parameters);
1254 self._autoPublish(anObj, theName, "vertex")
1257 ## Create a point, which lays on the given face.
1258 # The point will lay in arbitrary place of the face.
1259 # The only condition on it is a non-zero distance to the face boundary.
1260 # Such point can be used to uniquely identify the face inside any
1261 # shape in case, when the shape does not contain overlapped faces.
1262 # @param theFace The referenced face.
1263 # @param theName Object name; when specified, this parameter is used
1264 # for result publication in the study. Otherwise, if automatic
1265 # publication is switched on, default value is used for result name.
1267 # @return New GEOM.GEOM_Object, containing the created point.
1269 # @ref swig_MakeVertexInsideFace "Example"
1270 def MakeVertexInsideFace (self, theFace, theName=None):
1272 Create a point, which lays on the given face.
1273 The point will lay in arbitrary place of the face.
1274 The only condition on it is a non-zero distance to the face boundary.
1275 Such point can be used to uniquely identify the face inside any
1276 shape in case, when the shape does not contain overlapped faces.
1279 theFace The referenced face.
1280 theName Object name; when specified, this parameter is used
1281 for result publication in the study. Otherwise, if automatic
1282 publication is switched on, default value is used for result name.
1285 New GEOM.GEOM_Object, containing the created point.
1288 p_on_face = geompy.MakeVertexInsideFace(Face)
1290 # Example: see GEOM_TestAll.py
1291 anObj = self.BasicOp.MakePointOnFace(theFace)
1292 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1293 self._autoPublish(anObj, theName, "vertex")
1296 ## Create a point on intersection of two lines.
1297 # @param theRefLine1, theRefLine2 The referenced lines.
1298 # @param theName Object name; when specified, this parameter is used
1299 # for result publication in the study. Otherwise, if automatic
1300 # publication is switched on, default value is used for result name.
1302 # @return New GEOM.GEOM_Object, containing the created point.
1304 # @ref swig_MakeVertexOnLinesIntersection "Example"
1305 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1307 Create a point on intersection of two lines.
1310 theRefLine1, theRefLine2 The referenced lines.
1311 theName Object name; when specified, this parameter is used
1312 for result publication in the study. Otherwise, if automatic
1313 publication is switched on, default value is used for result name.
1316 New GEOM.GEOM_Object, containing the created point.
1318 # Example: see GEOM_TestAll.py
1319 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1320 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1321 self._autoPublish(anObj, theName, "vertex")
1324 ## Create a tangent, corresponding to the given parameter on the given curve.
1325 # @param theRefCurve The referenced curve.
1326 # @param theParameter Value of parameter on the referenced curve.
1327 # @param theName Object name; when specified, this parameter is used
1328 # for result publication in the study. Otherwise, if automatic
1329 # publication is switched on, default value is used for result name.
1331 # @return New GEOM.GEOM_Object, containing the created tangent.
1333 # @ref swig_MakeTangentOnCurve "Example"
1334 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1336 Create a tangent, corresponding to the given parameter on the given curve.
1339 theRefCurve The referenced curve.
1340 theParameter Value of parameter on the referenced curve.
1341 theName Object name; when specified, this parameter is used
1342 for result publication in the study. Otherwise, if automatic
1343 publication is switched on, default value is used for result name.
1346 New GEOM.GEOM_Object, containing the created tangent.
1349 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1351 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1352 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1353 self._autoPublish(anObj, theName, "tangent")
1356 ## Create a tangent plane, corresponding to the given parameter on the given face.
1357 # @param theFace The face for which tangent plane should be built.
1358 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1359 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1360 # @param theTrimSize the size of plane.
1361 # @param theName Object name; when specified, this parameter is used
1362 # for result publication in the study. Otherwise, if automatic
1363 # publication is switched on, default value is used for result name.
1365 # @return New GEOM.GEOM_Object, containing the created tangent.
1367 # @ref swig_MakeTangentPlaneOnFace "Example"
1368 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1370 Create a tangent plane, corresponding to the given parameter on the given face.
1373 theFace The face for which tangent plane should be built.
1374 theParameterV vertical value of the center point (0.0 - 1.0).
1375 theParameterU horisontal value of the center point (0.0 - 1.0).
1376 theTrimSize the size of plane.
1377 theName Object name; when specified, this parameter is used
1378 for result publication in the study. Otherwise, if automatic
1379 publication is switched on, default value is used for result name.
1382 New GEOM.GEOM_Object, containing the created tangent.
1385 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1387 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1388 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1389 self._autoPublish(anObj, theName, "tangent")
1392 ## Create a vector with the given components.
1393 # @param theDX X component of the vector.
1394 # @param theDY Y component of the vector.
1395 # @param theDZ Z component of the vector.
1396 # @param theName Object name; when specified, this parameter is used
1397 # for result publication in the study. Otherwise, if automatic
1398 # publication is switched on, default value is used for result name.
1400 # @return New GEOM.GEOM_Object, containing the created vector.
1402 # @ref tui_creation_vector "Example"
1403 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1405 Create a vector with the given components.
1408 theDX X component of the vector.
1409 theDY Y component of the vector.
1410 theDZ Z component of the vector.
1411 theName Object name; when specified, this parameter is used
1412 for result publication in the study. Otherwise, if automatic
1413 publication is switched on, default value is used for result name.
1416 New GEOM.GEOM_Object, containing the created vector.
1418 # Example: see GEOM_TestAll.py
1419 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1420 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1421 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1422 anObj.SetParameters(Parameters)
1423 self._autoPublish(anObj, theName, "vector")
1426 ## Create a vector between two points.
1427 # @param thePnt1 Start point for the vector.
1428 # @param thePnt2 End point for the vector.
1429 # @param theName Object name; when specified, this parameter is used
1430 # for result publication in the study. Otherwise, if automatic
1431 # publication is switched on, default value is used for result name.
1433 # @return New GEOM.GEOM_Object, containing the created vector.
1435 # @ref tui_creation_vector "Example"
1436 def MakeVector(self, thePnt1, thePnt2, theName=None):
1438 Create a vector between two points.
1441 thePnt1 Start point for the vector.
1442 thePnt2 End point for the vector.
1443 theName Object name; when specified, this parameter is used
1444 for result publication in the study. Otherwise, if automatic
1445 publication is switched on, default value is used for result name.
1448 New GEOM.GEOM_Object, containing the created vector.
1450 # Example: see GEOM_TestAll.py
1451 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1452 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1453 self._autoPublish(anObj, theName, "vector")
1456 ## Create a line, passing through the given point
1457 # and parrallel to the given direction
1458 # @param thePnt Point. The resulting line will pass through it.
1459 # @param theDir Direction. The resulting line will be parallel to it.
1460 # @param theName Object name; when specified, this parameter is used
1461 # for result publication in the study. Otherwise, if automatic
1462 # publication is switched on, default value is used for result name.
1464 # @return New GEOM.GEOM_Object, containing the created line.
1466 # @ref tui_creation_line "Example"
1467 def MakeLine(self, thePnt, theDir, theName=None):
1469 Create a line, passing through the given point
1470 and parrallel to the given direction
1473 thePnt Point. The resulting line will pass through it.
1474 theDir Direction. The resulting line will be parallel to it.
1475 theName Object name; when specified, this parameter is used
1476 for result publication in the study. Otherwise, if automatic
1477 publication is switched on, default value is used for result name.
1480 New GEOM.GEOM_Object, containing the created line.
1482 # Example: see GEOM_TestAll.py
1483 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1484 RaiseIfFailed("MakeLine", self.BasicOp)
1485 self._autoPublish(anObj, theName, "line")
1488 ## Create a line, passing through the given points
1489 # @param thePnt1 First of two points, defining the line.
1490 # @param thePnt2 Second of two points, defining the line.
1491 # @param theName Object name; when specified, this parameter is used
1492 # for result publication in the study. Otherwise, if automatic
1493 # publication is switched on, default value is used for result name.
1495 # @return New GEOM.GEOM_Object, containing the created line.
1497 # @ref tui_creation_line "Example"
1498 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1500 Create a line, passing through the given points
1503 thePnt1 First of two points, defining the line.
1504 thePnt2 Second of two points, defining the line.
1505 theName Object name; when specified, this parameter is used
1506 for result publication in the study. Otherwise, if automatic
1507 publication is switched on, default value is used for result name.
1510 New GEOM.GEOM_Object, containing the created line.
1512 # Example: see GEOM_TestAll.py
1513 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1514 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1515 self._autoPublish(anObj, theName, "line")
1518 ## Create a line on two faces intersection.
1519 # @param theFace1 First of two faces, defining the line.
1520 # @param theFace2 Second of two faces, defining the line.
1521 # @param theName Object name; when specified, this parameter is used
1522 # for result publication in the study. Otherwise, if automatic
1523 # publication is switched on, default value is used for result name.
1525 # @return New GEOM.GEOM_Object, containing the created line.
1527 # @ref swig_MakeLineTwoFaces "Example"
1528 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1530 Create a line on two faces intersection.
1533 theFace1 First of two faces, defining the line.
1534 theFace2 Second of two faces, defining the line.
1535 theName Object name; when specified, this parameter is used
1536 for result publication in the study. Otherwise, if automatic
1537 publication is switched on, default value is used for result name.
1540 New GEOM.GEOM_Object, containing the created line.
1542 # Example: see GEOM_TestAll.py
1543 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1544 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1545 self._autoPublish(anObj, theName, "line")
1548 ## Create a plane, passing through the given point
1549 # and normal to the given vector.
1550 # @param thePnt Point, the plane has to pass through.
1551 # @param theVec Vector, defining the plane normal direction.
1552 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1553 # @param theName Object name; when specified, this parameter is used
1554 # for result publication in the study. Otherwise, if automatic
1555 # publication is switched on, default value is used for result name.
1557 # @return New GEOM.GEOM_Object, containing the created plane.
1559 # @ref tui_creation_plane "Example"
1560 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1562 Create a plane, passing through the given point
1563 and normal to the given vector.
1566 thePnt Point, the plane has to pass through.
1567 theVec Vector, defining the plane normal direction.
1568 theTrimSize Half size of a side of quadrangle face, representing the plane.
1569 theName Object name; when specified, this parameter is used
1570 for result publication in the study. Otherwise, if automatic
1571 publication is switched on, default value is used for result name.
1574 New GEOM.GEOM_Object, containing the created plane.
1576 # Example: see GEOM_TestAll.py
1577 theTrimSize, Parameters = ParseParameters(theTrimSize);
1578 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1579 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1580 anObj.SetParameters(Parameters)
1581 self._autoPublish(anObj, theName, "plane")
1584 ## Create a plane, passing through the three given points
1585 # @param thePnt1 First of three points, defining the plane.
1586 # @param thePnt2 Second of three points, defining the plane.
1587 # @param thePnt3 Fird of three points, defining the plane.
1588 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1589 # @param theName Object name; when specified, this parameter is used
1590 # for result publication in the study. Otherwise, if automatic
1591 # publication is switched on, default value is used for result name.
1593 # @return New GEOM.GEOM_Object, containing the created plane.
1595 # @ref tui_creation_plane "Example"
1596 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1598 Create a plane, passing through the three given points
1601 thePnt1 First of three points, defining the plane.
1602 thePnt2 Second of three points, defining the plane.
1603 thePnt3 Fird of three points, defining the plane.
1604 theTrimSize Half size of a side of quadrangle face, representing the plane.
1605 theName Object name; when specified, this parameter is used
1606 for result publication in the study. Otherwise, if automatic
1607 publication is switched on, default value is used for result name.
1610 New GEOM.GEOM_Object, containing the created plane.
1612 # Example: see GEOM_TestAll.py
1613 theTrimSize, Parameters = ParseParameters(theTrimSize);
1614 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1615 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1616 anObj.SetParameters(Parameters)
1617 self._autoPublish(anObj, theName, "plane")
1620 ## Create a plane, similar to the existing one, but with another size of representing face.
1621 # @param theFace Referenced plane or LCS(Marker).
1622 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1623 # @param theName Object name; when specified, this parameter is used
1624 # for result publication in the study. Otherwise, if automatic
1625 # publication is switched on, default value is used for result name.
1627 # @return New GEOM.GEOM_Object, containing the created plane.
1629 # @ref tui_creation_plane "Example"
1630 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1632 Create a plane, similar to the existing one, but with another size of representing face.
1635 theFace Referenced plane or LCS(Marker).
1636 theTrimSize New half size of a side of quadrangle face, representing the plane.
1637 theName Object name; when specified, this parameter is used
1638 for result publication in the study. Otherwise, if automatic
1639 publication is switched on, default value is used for result name.
1642 New GEOM.GEOM_Object, containing the created plane.
1644 # Example: see GEOM_TestAll.py
1645 theTrimSize, Parameters = ParseParameters(theTrimSize);
1646 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1647 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1648 anObj.SetParameters(Parameters)
1649 self._autoPublish(anObj, theName, "plane")
1652 ## Create a plane, passing through the 2 vectors
1653 # with center in a start point of the first vector.
1654 # @param theVec1 Vector, defining center point and plane direction.
1655 # @param theVec2 Vector, defining the plane normal direction.
1656 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1657 # @param theName Object name; when specified, this parameter is used
1658 # for result publication in the study. Otherwise, if automatic
1659 # publication is switched on, default value is used for result name.
1661 # @return New GEOM.GEOM_Object, containing the created plane.
1663 # @ref tui_creation_plane "Example"
1664 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1666 Create a plane, passing through the 2 vectors
1667 with center in a start point of the first vector.
1670 theVec1 Vector, defining center point and plane direction.
1671 theVec2 Vector, defining the plane normal direction.
1672 theTrimSize Half size of a side of quadrangle face, representing the plane.
1673 theName Object name; when specified, this parameter is used
1674 for result publication in the study. Otherwise, if automatic
1675 publication is switched on, default value is used for result name.
1678 New GEOM.GEOM_Object, containing the created plane.
1680 # Example: see GEOM_TestAll.py
1681 theTrimSize, Parameters = ParseParameters(theTrimSize);
1682 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1683 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1684 anObj.SetParameters(Parameters)
1685 self._autoPublish(anObj, theName, "plane")
1688 ## Create a plane, based on a Local coordinate system.
1689 # @param theLCS coordinate system, defining plane.
1690 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1691 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1692 # @param theName Object name; when specified, this parameter is used
1693 # for result publication in the study. Otherwise, if automatic
1694 # publication is switched on, default value is used for result name.
1696 # @return New GEOM.GEOM_Object, containing the created plane.
1698 # @ref tui_creation_plane "Example"
1699 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1701 Create a plane, based on a Local coordinate system.
1704 theLCS coordinate system, defining plane.
1705 theTrimSize Half size of a side of quadrangle face, representing the plane.
1706 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1707 theName Object name; when specified, this parameter is used
1708 for result publication in the study. Otherwise, if automatic
1709 publication is switched on, default value is used for result name.
1712 New GEOM.GEOM_Object, containing the created plane.
1714 # Example: see GEOM_TestAll.py
1715 theTrimSize, Parameters = ParseParameters(theTrimSize);
1716 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1717 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1718 anObj.SetParameters(Parameters)
1719 self._autoPublish(anObj, theName, "plane")
1722 ## Create a local coordinate system.
1723 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1724 # @param XDX,XDY,XDZ Three components of OX direction
1725 # @param YDX,YDY,YDZ Three components of OY direction
1726 # @param theName Object name; when specified, this parameter is used
1727 # for result publication in the study. Otherwise, if automatic
1728 # publication is switched on, default value is used for result name.
1730 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1732 # @ref swig_MakeMarker "Example"
1733 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1735 Create a local coordinate system.
1738 OX,OY,OZ Three coordinates of coordinate system origin.
1739 XDX,XDY,XDZ Three components of OX direction
1740 YDX,YDY,YDZ Three components of OY direction
1741 theName Object name; when specified, this parameter is used
1742 for result publication in the study. Otherwise, if automatic
1743 publication is switched on, default value is used for result name.
1746 New GEOM.GEOM_Object, containing the created coordinate system.
1748 # Example: see GEOM_TestAll.py
1749 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1750 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1751 RaiseIfFailed("MakeMarker", self.BasicOp)
1752 anObj.SetParameters(Parameters)
1753 self._autoPublish(anObj, theName, "lcs")
1756 ## Create a local coordinate system from shape.
1757 # @param theShape The initial shape to detect the coordinate system.
1758 # @param theName Object name; when specified, this parameter is used
1759 # for result publication in the study. Otherwise, if automatic
1760 # publication is switched on, default value is used for result name.
1762 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1764 # @ref tui_creation_lcs "Example"
1765 def MakeMarkerFromShape(self, theShape, theName=None):
1767 Create a local coordinate system from shape.
1770 theShape The initial shape to detect the coordinate system.
1771 theName Object name; when specified, this parameter is used
1772 for result publication in the study. Otherwise, if automatic
1773 publication is switched on, default value is used for result name.
1776 New GEOM.GEOM_Object, containing the created coordinate system.
1778 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1779 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1780 self._autoPublish(anObj, theName, "lcs")
1783 ## Create a local coordinate system from point and two vectors.
1784 # @param theOrigin Point of coordinate system origin.
1785 # @param theXVec Vector of X direction
1786 # @param theYVec Vector of Y direction
1787 # @param theName Object name; when specified, this parameter is used
1788 # for result publication in the study. Otherwise, if automatic
1789 # publication is switched on, default value is used for result name.
1791 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1793 # @ref tui_creation_lcs "Example"
1794 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1796 Create a local coordinate system from point and two vectors.
1799 theOrigin Point of coordinate system origin.
1800 theXVec Vector of X direction
1801 theYVec Vector of Y direction
1802 theName Object name; when specified, this parameter is used
1803 for result publication in the study. Otherwise, if automatic
1804 publication is switched on, default value is used for result name.
1807 New GEOM.GEOM_Object, containing the created coordinate system.
1810 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1811 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1812 self._autoPublish(anObj, theName, "lcs")
1815 # end of l3_basic_go
1818 ## @addtogroup l4_curves
1821 ## Create an arc of circle, passing through three given points.
1822 # @param thePnt1 Start point of the arc.
1823 # @param thePnt2 Middle point of the arc.
1824 # @param thePnt3 End point of the arc.
1825 # @param theName Object name; when specified, this parameter is used
1826 # for result publication in the study. Otherwise, if automatic
1827 # publication is switched on, default value is used for result name.
1829 # @return New GEOM.GEOM_Object, containing the created arc.
1831 # @ref swig_MakeArc "Example"
1832 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1834 Create an arc of circle, passing through three given points.
1837 thePnt1 Start point of the arc.
1838 thePnt2 Middle point of the arc.
1839 thePnt3 End point of the arc.
1840 theName Object name; when specified, this parameter is used
1841 for result publication in the study. Otherwise, if automatic
1842 publication is switched on, default value is used for result name.
1845 New GEOM.GEOM_Object, containing the created arc.
1847 # Example: see GEOM_TestAll.py
1848 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1849 RaiseIfFailed("MakeArc", self.CurvesOp)
1850 self._autoPublish(anObj, theName, "arc")
1853 ## Create an arc of circle from a center and 2 points.
1854 # @param thePnt1 Center of the arc
1855 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1856 # @param thePnt3 End point of the arc (Gives also a direction)
1857 # @param theSense Orientation of the arc
1858 # @param theName Object name; when specified, this parameter is used
1859 # for result publication in the study. Otherwise, if automatic
1860 # publication is switched on, default value is used for result name.
1862 # @return New GEOM.GEOM_Object, containing the created arc.
1864 # @ref swig_MakeArc "Example"
1865 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1867 Create an arc of circle from a center and 2 points.
1870 thePnt1 Center of the arc
1871 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1872 thePnt3 End point of the arc (Gives also a direction)
1873 theSense Orientation of the arc
1874 theName Object name; when specified, this parameter is used
1875 for result publication in the study. Otherwise, if automatic
1876 publication is switched on, default value is used for result name.
1879 New GEOM.GEOM_Object, containing the created arc.
1881 # Example: see GEOM_TestAll.py
1882 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1883 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1884 self._autoPublish(anObj, theName, "arc")
1887 ## Create an arc of ellipse, of center and two points.
1888 # @param theCenter Center of the arc.
1889 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1890 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1891 # @param theName Object name; when specified, this parameter is used
1892 # for result publication in the study. Otherwise, if automatic
1893 # publication is switched on, default value is used for result name.
1895 # @return New GEOM.GEOM_Object, containing the created arc.
1897 # @ref swig_MakeArc "Example"
1898 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1900 Create an arc of ellipse, of center and two points.
1903 theCenter Center of the arc.
1904 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1905 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1906 theName Object name; when specified, this parameter is used
1907 for result publication in the study. Otherwise, if automatic
1908 publication is switched on, default value is used for result name.
1911 New GEOM.GEOM_Object, containing the created arc.
1913 # Example: see GEOM_TestAll.py
1914 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1915 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1916 self._autoPublish(anObj, theName, "arc")
1919 ## Create a circle with given center, normal vector and radius.
1920 # @param thePnt Circle center.
1921 # @param theVec Vector, normal to the plane of the circle.
1922 # @param theR Circle radius.
1923 # @param theName Object name; when specified, this parameter is used
1924 # for result publication in the study. Otherwise, if automatic
1925 # publication is switched on, default value is used for result name.
1927 # @return New GEOM.GEOM_Object, containing the created circle.
1929 # @ref tui_creation_circle "Example"
1930 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1932 Create a circle with given center, normal vector and radius.
1935 thePnt Circle center.
1936 theVec Vector, normal to the plane of the circle.
1938 theName Object name; when specified, this parameter is used
1939 for result publication in the study. Otherwise, if automatic
1940 publication is switched on, default value is used for result name.
1943 New GEOM.GEOM_Object, containing the created circle.
1945 # Example: see GEOM_TestAll.py
1946 theR, Parameters = ParseParameters(theR)
1947 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1948 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1949 anObj.SetParameters(Parameters)
1950 self._autoPublish(anObj, theName, "circle")
1953 ## Create a circle with given radius.
1954 # Center of the circle will be in the origin of global
1955 # coordinate system and normal vector will be codirected with Z axis
1956 # @param theR Circle radius.
1957 # @param theName Object name; when specified, this parameter is used
1958 # for result publication in the study. Otherwise, if automatic
1959 # publication is switched on, default value is used for result name.
1961 # @return New GEOM.GEOM_Object, containing the created circle.
1962 def MakeCircleR(self, theR, theName=None):
1964 Create a circle with given radius.
1965 Center of the circle will be in the origin of global
1966 coordinate system and normal vector will be codirected with Z axis
1970 theName Object name; when specified, this parameter is used
1971 for result publication in the study. Otherwise, if automatic
1972 publication is switched on, default value is used for result name.
1975 New GEOM.GEOM_Object, containing the created circle.
1977 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1978 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1979 self._autoPublish(anObj, theName, "circle")
1982 ## Create a circle, passing through three given points
1983 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1984 # @param theName Object name; when specified, this parameter is used
1985 # for result publication in the study. Otherwise, if automatic
1986 # publication is switched on, default value is used for result name.
1988 # @return New GEOM.GEOM_Object, containing the created circle.
1990 # @ref tui_creation_circle "Example"
1991 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1993 Create a circle, passing through three given points
1996 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1997 theName Object name; when specified, this parameter is used
1998 for result publication in the study. Otherwise, if automatic
1999 publication is switched on, default value is used for result name.
2002 New GEOM.GEOM_Object, containing the created circle.
2004 # Example: see GEOM_TestAll.py
2005 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2006 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2007 self._autoPublish(anObj, theName, "circle")
2010 ## Create a circle, with given point1 as center,
2011 # passing through the point2 as radius and laying in the plane,
2012 # defined by all three given points.
2013 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2014 # @param theName Object name; when specified, this parameter is used
2015 # for result publication in the study. Otherwise, if automatic
2016 # publication is switched on, default value is used for result name.
2018 # @return New GEOM.GEOM_Object, containing the created circle.
2020 # @ref swig_MakeCircle "Example"
2021 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2023 Create a circle, with given point1 as center,
2024 passing through the point2 as radius and laying in the plane,
2025 defined by all three given points.
2028 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2029 theName Object name; when specified, this parameter is used
2030 for result publication in the study. Otherwise, if automatic
2031 publication is switched on, default value is used for result name.
2034 New GEOM.GEOM_Object, containing the created circle.
2036 # Example: see GEOM_example6.py
2037 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2038 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2039 self._autoPublish(anObj, theName, "circle")
2042 ## Create an ellipse with given center, normal vector and radiuses.
2043 # @param thePnt Ellipse center.
2044 # @param theVec Vector, normal to the plane of the ellipse.
2045 # @param theRMajor Major ellipse radius.
2046 # @param theRMinor Minor ellipse radius.
2047 # @param theVecMaj Vector, direction of the ellipse's main axis.
2048 # @param theName Object name; when specified, this parameter is used
2049 # for result publication in the study. Otherwise, if automatic
2050 # publication is switched on, default value is used for result name.
2052 # @return New GEOM.GEOM_Object, containing the created ellipse.
2054 # @ref tui_creation_ellipse "Example"
2055 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2057 Create an ellipse with given center, normal vector and radiuses.
2060 thePnt Ellipse center.
2061 theVec Vector, normal to the plane of the ellipse.
2062 theRMajor Major ellipse radius.
2063 theRMinor Minor ellipse radius.
2064 theVecMaj Vector, direction of the ellipse's main axis.
2065 theName Object name; when specified, this parameter is used
2066 for result publication in the study. Otherwise, if automatic
2067 publication is switched on, default value is used for result name.
2070 New GEOM.GEOM_Object, containing the created ellipse.
2072 # Example: see GEOM_TestAll.py
2073 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2074 if theVecMaj is not None:
2075 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2077 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2079 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2080 anObj.SetParameters(Parameters)
2081 self._autoPublish(anObj, theName, "ellipse")
2084 ## Create an ellipse with given radiuses.
2085 # Center of the ellipse will be in the origin of global
2086 # coordinate system and normal vector will be codirected with Z axis
2087 # @param theRMajor Major ellipse radius.
2088 # @param theRMinor Minor ellipse radius.
2089 # @param theName Object name; when specified, this parameter is used
2090 # for result publication in the study. Otherwise, if automatic
2091 # publication is switched on, default value is used for result name.
2093 # @return New GEOM.GEOM_Object, containing the created ellipse.
2094 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2096 Create an ellipse with given radiuses.
2097 Center of the ellipse will be in the origin of global
2098 coordinate system and normal vector will be codirected with Z axis
2101 theRMajor Major ellipse radius.
2102 theRMinor Minor ellipse radius.
2103 theName Object name; when specified, this parameter is used
2104 for result publication in the study. Otherwise, if automatic
2105 publication is switched on, default value is used for result name.
2108 New GEOM.GEOM_Object, containing the created ellipse.
2110 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2111 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2112 self._autoPublish(anObj, theName, "ellipse")
2115 ## Create a polyline on the set of points.
2116 # @param thePoints Sequence of points for the polyline.
2117 # @param theIsClosed If True, build a closed wire.
2118 # @param theName Object name; when specified, this parameter is used
2119 # for result publication in the study. Otherwise, if automatic
2120 # publication is switched on, default value is used for result name.
2122 # @return New GEOM.GEOM_Object, containing the created polyline.
2124 # @ref tui_creation_curve "Example"
2125 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2127 Create a polyline on the set of points.
2130 thePoints Sequence of points for the polyline.
2131 theIsClosed If True, build a closed wire.
2132 theName Object name; when specified, this parameter is used
2133 for result publication in the study. Otherwise, if automatic
2134 publication is switched on, default value is used for result name.
2137 New GEOM.GEOM_Object, containing the created polyline.
2139 # Example: see GEOM_TestAll.py
2140 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2141 RaiseIfFailed("MakePolyline", self.CurvesOp)
2142 self._autoPublish(anObj, theName, "polyline")
2145 ## Create bezier curve on the set of points.
2146 # @param thePoints Sequence of points for the bezier curve.
2147 # @param theIsClosed If True, build a closed curve.
2148 # @param theName Object name; when specified, this parameter is used
2149 # for result publication in the study. Otherwise, if automatic
2150 # publication is switched on, default value is used for result name.
2152 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2154 # @ref tui_creation_curve "Example"
2155 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2157 Create bezier curve on the set of points.
2160 thePoints Sequence of points for the bezier curve.
2161 theIsClosed If True, build a closed curve.
2162 theName Object name; when specified, this parameter is used
2163 for result publication in the study. Otherwise, if automatic
2164 publication is switched on, default value is used for result name.
2167 New GEOM.GEOM_Object, containing the created bezier curve.
2169 # Example: see GEOM_TestAll.py
2170 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2171 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2172 self._autoPublish(anObj, theName, "bezier")
2175 ## Create B-Spline curve on the set of points.
2176 # @param thePoints Sequence of points for the B-Spline curve.
2177 # @param theIsClosed If True, build a closed curve.
2178 # @param theDoReordering If TRUE, the algo does not follow the order of
2179 # \a thePoints but searches for the closest vertex.
2180 # @param theName Object name; when specified, this parameter is used
2181 # for result publication in the study. Otherwise, if automatic
2182 # publication is switched on, default value is used for result name.
2184 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2186 # @ref tui_creation_curve "Example"
2187 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2189 Create B-Spline curve on the set of points.
2192 thePoints Sequence of points for the B-Spline curve.
2193 theIsClosed If True, build a closed curve.
2194 theDoReordering If True, the algo does not follow the order of
2195 thePoints but searches for the closest vertex.
2196 theName Object name; when specified, this parameter is used
2197 for result publication in the study. Otherwise, if automatic
2198 publication is switched on, default value is used for result name.
2201 New GEOM.GEOM_Object, containing the created B-Spline curve.
2203 # Example: see GEOM_TestAll.py
2204 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2205 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2206 self._autoPublish(anObj, theName, "bspline")
2209 ## Create B-Spline curve on the set of points.
2210 # @param thePoints Sequence of points for the B-Spline curve.
2211 # @param theFirstVec Vector object, defining the curve direction at its first point.
2212 # @param theLastVec Vector object, defining the curve direction at its last point.
2213 # @param theName Object name; when specified, this parameter is used
2214 # for result publication in the study. Otherwise, if automatic
2215 # publication is switched on, default value is used for result name.
2217 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2219 # @ref tui_creation_curve "Example"
2220 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2222 Create B-Spline curve on the set of points.
2225 thePoints Sequence of points for the B-Spline curve.
2226 theFirstVec Vector object, defining the curve direction at its first point.
2227 theLastVec Vector object, defining the curve direction at its last point.
2228 theName Object name; when specified, this parameter is used
2229 for result publication in the study. Otherwise, if automatic
2230 publication is switched on, default value is used for result name.
2233 New GEOM.GEOM_Object, containing the created B-Spline curve.
2235 # Example: see GEOM_TestAll.py
2236 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2237 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2238 self._autoPublish(anObj, theName, "bspline")
2241 ## Creates a curve using the parametric definition of the basic points.
2242 # @param thexExpr parametric equation of the coordinates X.
2243 # @param theyExpr parametric equation of the coordinates Y.
2244 # @param thezExpr parametric equation of the coordinates Z.
2245 # @param theParamMin the minimal value of the parameter.
2246 # @param theParamMax the maximum value of the parameter.
2247 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2248 # @param theCurveType the type of the curve.
2249 # @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.
2250 # @param theName Object name; when specified, this parameter is used
2251 # for result publication in the study. Otherwise, if automatic
2252 # publication is switched on, default value is used for result name.
2254 # @return New GEOM.GEOM_Object, containing the created curve.
2256 # @ref tui_creation_curve "Example"
2257 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2258 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2260 Creates a curve using the parametric definition of the basic points.
2263 thexExpr parametric equation of the coordinates X.
2264 theyExpr parametric equation of the coordinates Y.
2265 thezExpr parametric equation of the coordinates Z.
2266 theParamMin the minimal value of the parameter.
2267 theParamMax the maximum value of the parameter.
2268 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2269 theCurveType the type of the curve.
2270 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2271 method is used which can lead to a bug.
2272 theName Object name; when specified, this parameter is used
2273 for result publication in the study. Otherwise, if automatic
2274 publication is switched on, default value is used for result name.
2277 New GEOM.GEOM_Object, containing the created curve.
2279 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2281 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2283 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2284 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2285 anObj.SetParameters(Parameters)
2286 self._autoPublish(anObj, theName, "curve")
2292 ## @addtogroup l3_sketcher
2295 ## Create a sketcher (wire or face), following the textual description,
2296 # passed through <VAR>theCommand</VAR> argument. \n
2297 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2298 # Format of the description string have to be the following:
2300 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2303 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2305 # - "R angle" : Set the direction by angle
2306 # - "D dx dy" : Set the direction by DX & DY
2309 # - "TT x y" : Create segment by point at X & Y
2310 # - "T dx dy" : Create segment by point with DX & DY
2311 # - "L length" : Create segment by direction & Length
2312 # - "IX x" : Create segment by direction & Intersect. X
2313 # - "IY y" : Create segment by direction & Intersect. Y
2316 # - "C radius length" : Create arc by direction, radius and length(in degree)
2317 # - "AA x y": Create arc by point at X & Y
2318 # - "A dx dy" : Create arc by point with DX & DY
2319 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2320 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2321 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2322 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2325 # - "WW" : Close Wire (to finish)
2326 # - "WF" : Close Wire and build face (to finish)
2329 # - Flag1 (= reverse) is 0 or 2 ...
2330 # - if 0 the drawn arc is the one of lower angle (< Pi)
2331 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2334 # - Flag2 (= control tolerance) is 0 or 1 ...
2335 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2336 # - if 1 the wire is built only if the end point is on the arc
2337 # with a tolerance of 10^-7 on the distance else the creation fails
2339 # @param theCommand String, defining the sketcher in local
2340 # coordinates of the working plane.
2341 # @param theWorkingPlane Nine double values, defining origin,
2342 # OZ and OX directions of the working plane.
2343 # @param theName Object name; when specified, this parameter is used
2344 # for result publication in the study. Otherwise, if automatic
2345 # publication is switched on, default value is used for result name.
2347 # @return New GEOM.GEOM_Object, containing the created wire.
2349 # @ref tui_sketcher_page "Example"
2350 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2352 Create a sketcher (wire or face), following the textual description, passed
2353 through theCommand argument.
2354 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2355 Format of the description string have to be the following:
2356 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2358 - x1, y1 are coordinates of the first sketcher point (zero by default),
2360 - "R angle" : Set the direction by angle
2361 - "D dx dy" : Set the direction by DX & DY
2363 - "TT x y" : Create segment by point at X & Y
2364 - "T dx dy" : Create segment by point with DX & DY
2365 - "L length" : Create segment by direction & Length
2366 - "IX x" : Create segment by direction & Intersect. X
2367 - "IY y" : Create segment by direction & Intersect. Y
2369 - "C radius length" : Create arc by direction, radius and length(in degree)
2370 - "AA x y": Create arc by point at X & Y
2371 - "A dx dy" : Create arc by point with DX & DY
2372 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2373 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2374 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2375 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2377 - "WW" : Close Wire (to finish)
2378 - "WF" : Close Wire and build face (to finish)
2380 - Flag1 (= reverse) is 0 or 2 ...
2381 - if 0 the drawn arc is the one of lower angle (< Pi)
2382 - if 2 the drawn arc ius the one of greater angle (> Pi)
2384 - Flag2 (= control tolerance) is 0 or 1 ...
2385 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2386 - if 1 the wire is built only if the end point is on the arc
2387 with a tolerance of 10^-7 on the distance else the creation fails
2390 theCommand String, defining the sketcher in local
2391 coordinates of the working plane.
2392 theWorkingPlane Nine double values, defining origin,
2393 OZ and OX directions of the working plane.
2394 theName Object name; when specified, this parameter is used
2395 for result publication in the study. Otherwise, if automatic
2396 publication is switched on, default value is used for result name.
2399 New GEOM.GEOM_Object, containing the created wire.
2401 # Example: see GEOM_TestAll.py
2402 theCommand,Parameters = ParseSketcherCommand(theCommand)
2403 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2404 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2405 anObj.SetParameters(Parameters)
2406 self._autoPublish(anObj, theName, "wire")
2409 ## Create a sketcher (wire or face), following the textual description,
2410 # passed through <VAR>theCommand</VAR> argument. \n
2411 # For format of the description string see MakeSketcher() method.\n
2412 # @param theCommand String, defining the sketcher in local
2413 # coordinates of the working plane.
2414 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2415 # @param theName Object name; when specified, this parameter is used
2416 # for result publication in the study. Otherwise, if automatic
2417 # publication is switched on, default value is used for result name.
2419 # @return New GEOM.GEOM_Object, containing the created wire.
2421 # @ref tui_sketcher_page "Example"
2422 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2424 Create a sketcher (wire or face), following the textual description,
2425 passed through theCommand argument.
2426 For format of the description string see geompy.MakeSketcher() method.
2429 theCommand String, defining the sketcher in local
2430 coordinates of the working plane.
2431 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2432 theName Object name; when specified, this parameter is used
2433 for result publication in the study. Otherwise, if automatic
2434 publication is switched on, default value is used for result name.
2437 New GEOM.GEOM_Object, containing the created wire.
2439 theCommand,Parameters = ParseSketcherCommand(theCommand)
2440 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2441 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2442 anObj.SetParameters(Parameters)
2443 self._autoPublish(anObj, theName, "wire")
2446 ## Obtain a 2D sketcher interface
2447 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2448 def Sketcher2D (self):
2450 Obtain a 2D sketcher interface.
2453 sk = geompy.Sketcher2D()
2455 sk.addSegmentRelative(15, 70)
2456 sk.addSegmentPerpY(50)
2457 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2458 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2459 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2461 Sketch_1 = sk.wire(geomObj_1)
2463 sk = Sketcher2D (self)
2466 ## Create a sketcher wire, following the numerical description,
2467 # passed through <VAR>theCoordinates</VAR> argument. \n
2468 # @param theCoordinates double values, defining points to create a wire,
2470 # @param theName Object name; when specified, this parameter is used
2471 # for result publication in the study. Otherwise, if automatic
2472 # publication is switched on, default value is used for result name.
2474 # @return New GEOM.GEOM_Object, containing the created wire.
2476 # @ref tui_3dsketcher_page "Example"
2477 def Make3DSketcher(self, theCoordinates, theName=None):
2479 Create a sketcher wire, following the numerical description,
2480 passed through theCoordinates argument.
2483 theCoordinates double values, defining points to create a wire,
2485 theName Object name; when specified, this parameter is used
2486 for result publication in the study. Otherwise, if automatic
2487 publication is switched on, default value is used for result name.
2490 New GEOM_Object, containing the created wire.
2492 theCoordinates,Parameters = ParseParameters(theCoordinates)
2493 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2494 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2495 anObj.SetParameters(Parameters)
2496 self._autoPublish(anObj, theName, "wire")
2499 ## Obtain a 3D sketcher interface
2500 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2502 # @ref tui_3dsketcher_page "Example"
2503 def Sketcher3D (self):
2505 Obtain a 3D sketcher interface.
2508 sk = geompy.Sketcher3D()
2509 sk.addPointsAbsolute(0,0,0, 70,0,0)
2510 sk.addPointsRelative(0, 0, 130)
2511 sk.addPointAnglesLength("OXY", 50, 0, 100)
2512 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2514 a3D_Sketcher_1 = sk.wire()
2516 sk = Sketcher3D (self)
2519 # end of l3_sketcher
2522 ## @addtogroup l3_3d_primitives
2525 ## Create a box by coordinates of two opposite vertices.
2527 # @param x1,y1,z1 double values, defining first point it.
2528 # @param x2,y2,z2 double values, defining first point it.
2529 # @param theName Object name; when specified, this parameter is used
2530 # for result publication in the study. Otherwise, if automatic
2531 # publication is switched on, default value is used for result name.
2533 # @return New GEOM.GEOM_Object, containing the created box.
2535 # @ref tui_creation_box "Example"
2536 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2538 Create a box by coordinates of two opposite vertices.
2541 x1,y1,z1 double values, defining first point.
2542 x2,y2,z2 double values, defining second point.
2543 theName Object name; when specified, this parameter is used
2544 for result publication in the study. Otherwise, if automatic
2545 publication is switched on, default value is used for result name.
2548 New GEOM.GEOM_Object, containing the created box.
2550 # Example: see GEOM_TestAll.py
2551 pnt1 = self.MakeVertex(x1,y1,z1)
2552 pnt2 = self.MakeVertex(x2,y2,z2)
2553 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2554 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2556 ## Create a box with specified dimensions along the coordinate axes
2557 # and with edges, parallel to the coordinate axes.
2558 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2559 # @param theDX Length of Box edges, parallel to OX axis.
2560 # @param theDY Length of Box edges, parallel to OY axis.
2561 # @param theDZ Length of Box edges, parallel to OZ axis.
2562 # @param theName Object name; when specified, this parameter is used
2563 # for result publication in the study. Otherwise, if automatic
2564 # publication is switched on, default value is used for result name.
2566 # @return New GEOM.GEOM_Object, containing the created box.
2568 # @ref tui_creation_box "Example"
2569 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2571 Create a box with specified dimensions along the coordinate axes
2572 and with edges, parallel to the coordinate axes.
2573 Center of the box will be at point (DX/2, DY/2, DZ/2).
2576 theDX Length of Box edges, parallel to OX axis.
2577 theDY Length of Box edges, parallel to OY axis.
2578 theDZ Length of Box edges, parallel to OZ axis.
2579 theName Object name; when specified, this parameter is used
2580 for result publication in the study. Otherwise, if automatic
2581 publication is switched on, default value is used for result name.
2584 New GEOM.GEOM_Object, containing the created box.
2586 # Example: see GEOM_TestAll.py
2587 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2588 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2589 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2590 anObj.SetParameters(Parameters)
2591 self._autoPublish(anObj, theName, "box")
2594 ## Create a box with two specified opposite vertices,
2595 # and with edges, parallel to the coordinate axes
2596 # @param thePnt1 First of two opposite vertices.
2597 # @param thePnt2 Second of two opposite vertices.
2598 # @param theName Object name; when specified, this parameter is used
2599 # for result publication in the study. Otherwise, if automatic
2600 # publication is switched on, default value is used for result name.
2602 # @return New GEOM.GEOM_Object, containing the created box.
2604 # @ref tui_creation_box "Example"
2605 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2607 Create a box with two specified opposite vertices,
2608 and with edges, parallel to the coordinate axes
2611 thePnt1 First of two opposite vertices.
2612 thePnt2 Second of two opposite vertices.
2613 theName Object name; when specified, this parameter is used
2614 for result publication in the study. Otherwise, if automatic
2615 publication is switched on, default value is used for result name.
2618 New GEOM.GEOM_Object, containing the created box.
2620 # Example: see GEOM_TestAll.py
2621 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2622 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2623 self._autoPublish(anObj, theName, "box")
2626 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2627 # @param theH height of Face.
2628 # @param theW width of Face.
2629 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2630 # @param theName Object name; when specified, this parameter is used
2631 # for result publication in the study. Otherwise, if automatic
2632 # publication is switched on, default value is used for result name.
2634 # @return New GEOM.GEOM_Object, containing the created face.
2636 # @ref tui_creation_face "Example"
2637 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2639 Create a face with specified dimensions with edges parallel to coordinate axes.
2642 theH height of Face.
2644 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2645 theName Object name; when specified, this parameter is used
2646 for result publication in the study. Otherwise, if automatic
2647 publication is switched on, default value is used for result name.
2650 New GEOM.GEOM_Object, containing the created face.
2652 # Example: see GEOM_TestAll.py
2653 theH,theW,Parameters = ParseParameters(theH, theW)
2654 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2655 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2656 anObj.SetParameters(Parameters)
2657 self._autoPublish(anObj, theName, "rectangle")
2660 ## Create a face from another plane and two sizes,
2661 # vertical size and horisontal size.
2662 # @param theObj Normale vector to the creating face or
2664 # @param theH Height (vertical size).
2665 # @param theW Width (horisontal size).
2666 # @param theName Object name; when specified, this parameter is used
2667 # for result publication in the study. Otherwise, if automatic
2668 # publication is switched on, default value is used for result name.
2670 # @return New GEOM.GEOM_Object, containing the created face.
2672 # @ref tui_creation_face "Example"
2673 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2675 Create a face from another plane and two sizes,
2676 vertical size and horisontal size.
2679 theObj Normale vector to the creating face or
2681 theH Height (vertical size).
2682 theW Width (horisontal size).
2683 theName Object name; when specified, this parameter is used
2684 for result publication in the study. Otherwise, if automatic
2685 publication is switched on, default value is used for result name.
2688 New GEOM_Object, containing the created face.
2690 # Example: see GEOM_TestAll.py
2691 theH,theW,Parameters = ParseParameters(theH, theW)
2692 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2693 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2694 anObj.SetParameters(Parameters)
2695 self._autoPublish(anObj, theName, "rectangle")
2698 ## Create a disk with given center, normal vector and radius.
2699 # @param thePnt Disk center.
2700 # @param theVec Vector, normal to the plane of the disk.
2701 # @param theR Disk radius.
2702 # @param theName Object name; when specified, this parameter is used
2703 # for result publication in the study. Otherwise, if automatic
2704 # publication is switched on, default value is used for result name.
2706 # @return New GEOM.GEOM_Object, containing the created disk.
2708 # @ref tui_creation_disk "Example"
2709 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2711 Create a disk with given center, normal vector and radius.
2715 theVec Vector, normal to the plane of the disk.
2717 theName Object name; when specified, this parameter is used
2718 for result publication in the study. Otherwise, if automatic
2719 publication is switched on, default value is used for result name.
2722 New GEOM.GEOM_Object, containing the created disk.
2724 # Example: see GEOM_TestAll.py
2725 theR,Parameters = ParseParameters(theR)
2726 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2727 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2728 anObj.SetParameters(Parameters)
2729 self._autoPublish(anObj, theName, "disk")
2732 ## Create a disk, passing through three given points
2733 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2734 # @param theName Object name; when specified, this parameter is used
2735 # for result publication in the study. Otherwise, if automatic
2736 # publication is switched on, default value is used for result name.
2738 # @return New GEOM.GEOM_Object, containing the created disk.
2740 # @ref tui_creation_disk "Example"
2741 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2743 Create a disk, passing through three given points
2746 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2747 theName Object name; when specified, this parameter is used
2748 for result publication in the study. Otherwise, if automatic
2749 publication is switched on, default value is used for result name.
2752 New GEOM.GEOM_Object, containing the created disk.
2754 # Example: see GEOM_TestAll.py
2755 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2756 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2757 self._autoPublish(anObj, theName, "disk")
2760 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2761 # @param theR Radius of Face.
2762 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2763 # @param theName Object name; when specified, this parameter is used
2764 # for result publication in the study. Otherwise, if automatic
2765 # publication is switched on, default value is used for result name.
2767 # @return New GEOM.GEOM_Object, containing the created disk.
2769 # @ref tui_creation_face "Example"
2770 def MakeDiskR(self, theR, theOrientation, theName=None):
2772 Create a disk with specified dimensions along OX-OY coordinate axes.
2775 theR Radius of Face.
2776 theOrientation set the orientation belong axis OXY or OYZ or OZX
2777 theName Object name; when specified, this parameter is used
2778 for result publication in the study. Otherwise, if automatic
2779 publication is switched on, default value is used for result name.
2782 New GEOM.GEOM_Object, containing the created disk.
2785 Disk3 = geompy.MakeDiskR(100., 1)
2787 # Example: see GEOM_TestAll.py
2788 theR,Parameters = ParseParameters(theR)
2789 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2790 RaiseIfFailed("MakeDiskR", self.PrimOp)
2791 anObj.SetParameters(Parameters)
2792 self._autoPublish(anObj, theName, "disk")
2795 ## Create a cylinder with given base point, axis, radius and height.
2796 # @param thePnt Central point of cylinder base.
2797 # @param theAxis Cylinder axis.
2798 # @param theR Cylinder radius.
2799 # @param theH Cylinder height.
2800 # @param theName Object name; when specified, this parameter is used
2801 # for result publication in the study. Otherwise, if automatic
2802 # publication is switched on, default value is used for result name.
2804 # @return New GEOM.GEOM_Object, containing the created cylinder.
2806 # @ref tui_creation_cylinder "Example"
2807 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2809 Create a cylinder with given base point, axis, radius and height.
2812 thePnt Central point of cylinder base.
2813 theAxis Cylinder axis.
2814 theR Cylinder radius.
2815 theH Cylinder height.
2816 theName Object name; when specified, this parameter is used
2817 for result publication in the study. Otherwise, if automatic
2818 publication is switched on, default value is used for result name.
2821 New GEOM.GEOM_Object, containing the created cylinder.
2823 # Example: see GEOM_TestAll.py
2824 theR,theH,Parameters = ParseParameters(theR, theH)
2825 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2826 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2827 anObj.SetParameters(Parameters)
2828 self._autoPublish(anObj, theName, "cylinder")
2831 ## Create a cylinder with given radius and height at
2832 # the origin of coordinate system. Axis of the cylinder
2833 # will be collinear to the OZ axis of the coordinate system.
2834 # @param theR Cylinder radius.
2835 # @param theH Cylinder height.
2836 # @param theName Object name; when specified, this parameter is used
2837 # for result publication in the study. Otherwise, if automatic
2838 # publication is switched on, default value is used for result name.
2840 # @return New GEOM.GEOM_Object, containing the created cylinder.
2842 # @ref tui_creation_cylinder "Example"
2843 def MakeCylinderRH(self, theR, theH, theName=None):
2845 Create a cylinder with given radius and height at
2846 the origin of coordinate system. Axis of the cylinder
2847 will be collinear to the OZ axis of the coordinate system.
2850 theR Cylinder radius.
2851 theH Cylinder height.
2852 theName Object name; when specified, this parameter is used
2853 for result publication in the study. Otherwise, if automatic
2854 publication is switched on, default value is used for result name.
2857 New GEOM.GEOM_Object, containing the created cylinder.
2859 # Example: see GEOM_TestAll.py
2860 theR,theH,Parameters = ParseParameters(theR, theH)
2861 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2862 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2863 anObj.SetParameters(Parameters)
2864 self._autoPublish(anObj, theName, "cylinder")
2867 ## Create a sphere with given center and radius.
2868 # @param thePnt Sphere center.
2869 # @param theR Sphere radius.
2870 # @param theName Object name; when specified, this parameter is used
2871 # for result publication in the study. Otherwise, if automatic
2872 # publication is switched on, default value is used for result name.
2874 # @return New GEOM.GEOM_Object, containing the created sphere.
2876 # @ref tui_creation_sphere "Example"
2877 def MakeSpherePntR(self, thePnt, theR, theName=None):
2879 Create a sphere with given center and radius.
2882 thePnt Sphere center.
2884 theName Object name; when specified, this parameter is used
2885 for result publication in the study. Otherwise, if automatic
2886 publication is switched on, default value is used for result name.
2889 New GEOM.GEOM_Object, containing the created sphere.
2891 # Example: see GEOM_TestAll.py
2892 theR,Parameters = ParseParameters(theR)
2893 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2894 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2895 anObj.SetParameters(Parameters)
2896 self._autoPublish(anObj, theName, "sphere")
2899 ## Create a sphere with given center and radius.
2900 # @param x,y,z Coordinates of sphere center.
2901 # @param theR Sphere radius.
2902 # @param theName Object name; when specified, this parameter is used
2903 # for result publication in the study. Otherwise, if automatic
2904 # publication is switched on, default value is used for result name.
2906 # @return New GEOM.GEOM_Object, containing the created sphere.
2908 # @ref tui_creation_sphere "Example"
2909 def MakeSphere(self, x, y, z, theR, theName=None):
2911 Create a sphere with given center and radius.
2914 x,y,z Coordinates of sphere center.
2916 theName Object name; when specified, this parameter is used
2917 for result publication in the study. Otherwise, if automatic
2918 publication is switched on, default value is used for result name.
2921 New GEOM.GEOM_Object, containing the created sphere.
2923 # Example: see GEOM_TestAll.py
2924 point = self.MakeVertex(x, y, z)
2925 # note: auto-publishing is done in self.MakeSpherePntR()
2926 anObj = self.MakeSpherePntR(point, theR, theName)
2929 ## Create a sphere with given radius at the origin of coordinate system.
2930 # @param theR Sphere radius.
2931 # @param theName Object name; when specified, this parameter is used
2932 # for result publication in the study. Otherwise, if automatic
2933 # publication is switched on, default value is used for result name.
2935 # @return New GEOM.GEOM_Object, containing the created sphere.
2937 # @ref tui_creation_sphere "Example"
2938 def MakeSphereR(self, theR, theName=None):
2940 Create a sphere with given radius at the origin of coordinate system.
2944 theName Object name; when specified, this parameter is used
2945 for result publication in the study. Otherwise, if automatic
2946 publication is switched on, default value is used for result name.
2949 New GEOM.GEOM_Object, containing the created sphere.
2951 # Example: see GEOM_TestAll.py
2952 theR,Parameters = ParseParameters(theR)
2953 anObj = self.PrimOp.MakeSphereR(theR)
2954 RaiseIfFailed("MakeSphereR", self.PrimOp)
2955 anObj.SetParameters(Parameters)
2956 self._autoPublish(anObj, theName, "sphere")
2959 ## Create a cone with given base point, axis, height and radiuses.
2960 # @param thePnt Central point of the first cone base.
2961 # @param theAxis Cone axis.
2962 # @param theR1 Radius of the first cone base.
2963 # @param theR2 Radius of the second cone base.
2964 # \note If both radiuses are non-zero, the cone will be truncated.
2965 # \note If the radiuses are equal, a cylinder will be created instead.
2966 # @param theH Cone height.
2967 # @param theName Object name; when specified, this parameter is used
2968 # for result publication in the study. Otherwise, if automatic
2969 # publication is switched on, default value is used for result name.
2971 # @return New GEOM.GEOM_Object, containing the created cone.
2973 # @ref tui_creation_cone "Example"
2974 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2976 Create a cone with given base point, axis, height and radiuses.
2979 thePnt Central point of the first cone base.
2981 theR1 Radius of the first cone base.
2982 theR2 Radius of the second cone base.
2984 theName Object name; when specified, this parameter is used
2985 for result publication in the study. Otherwise, if automatic
2986 publication is switched on, default value is used for result name.
2989 If both radiuses are non-zero, the cone will be truncated.
2990 If the radiuses are equal, a cylinder will be created instead.
2993 New GEOM.GEOM_Object, containing the created cone.
2995 # Example: see GEOM_TestAll.py
2996 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2997 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2998 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2999 anObj.SetParameters(Parameters)
3000 self._autoPublish(anObj, theName, "cone")
3003 ## Create a cone with given height and radiuses at
3004 # the origin of coordinate system. Axis of the cone will
3005 # be collinear to the OZ axis of the coordinate system.
3006 # @param theR1 Radius of the first cone base.
3007 # @param theR2 Radius of the second cone base.
3008 # \note If both radiuses are non-zero, the cone will be truncated.
3009 # \note If the radiuses are equal, a cylinder will be created instead.
3010 # @param theH Cone height.
3011 # @param theName Object name; when specified, this parameter is used
3012 # for result publication in the study. Otherwise, if automatic
3013 # publication is switched on, default value is used for result name.
3015 # @return New GEOM.GEOM_Object, containing the created cone.
3017 # @ref tui_creation_cone "Example"
3018 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3020 Create a cone with given height and radiuses at
3021 the origin of coordinate system. Axis of the cone will
3022 be collinear to the OZ axis of the coordinate system.
3025 theR1 Radius of the first cone base.
3026 theR2 Radius of the second cone base.
3028 theName Object name; when specified, this parameter is used
3029 for result publication in the study. Otherwise, if automatic
3030 publication is switched on, default value is used for result name.
3033 If both radiuses are non-zero, the cone will be truncated.
3034 If the radiuses are equal, a cylinder will be created instead.
3037 New GEOM.GEOM_Object, containing the created cone.
3039 # Example: see GEOM_TestAll.py
3040 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3041 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3042 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3043 anObj.SetParameters(Parameters)
3044 self._autoPublish(anObj, theName, "cone")
3047 ## Create a torus with given center, normal vector and radiuses.
3048 # @param thePnt Torus central point.
3049 # @param theVec Torus axis of symmetry.
3050 # @param theRMajor Torus major radius.
3051 # @param theRMinor Torus minor radius.
3052 # @param theName Object name; when specified, this parameter is used
3053 # for result publication in the study. Otherwise, if automatic
3054 # publication is switched on, default value is used for result name.
3056 # @return New GEOM.GEOM_Object, containing the created torus.
3058 # @ref tui_creation_torus "Example"
3059 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3061 Create a torus with given center, normal vector and radiuses.
3064 thePnt Torus central point.
3065 theVec Torus axis of symmetry.
3066 theRMajor Torus major radius.
3067 theRMinor Torus minor radius.
3068 theName Object name; when specified, this parameter is used
3069 for result publication in the study. Otherwise, if automatic
3070 publication is switched on, default value is used for result name.
3073 New GEOM.GEOM_Object, containing the created torus.
3075 # Example: see GEOM_TestAll.py
3076 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3077 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3078 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3079 anObj.SetParameters(Parameters)
3080 self._autoPublish(anObj, theName, "torus")
3083 ## Create a torus with given radiuses at the origin of coordinate system.
3084 # @param theRMajor Torus major radius.
3085 # @param theRMinor Torus minor radius.
3086 # @param theName Object name; when specified, this parameter is used
3087 # for result publication in the study. Otherwise, if automatic
3088 # publication is switched on, default value is used for result name.
3090 # @return New GEOM.GEOM_Object, containing the created torus.
3092 # @ref tui_creation_torus "Example"
3093 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3095 Create a torus with given radiuses at the origin of coordinate system.
3098 theRMajor Torus major radius.
3099 theRMinor Torus minor radius.
3100 theName Object name; when specified, this parameter is used
3101 for result publication in the study. Otherwise, if automatic
3102 publication is switched on, default value is used for result name.
3105 New GEOM.GEOM_Object, containing the created torus.
3107 # Example: see GEOM_TestAll.py
3108 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3109 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3110 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3111 anObj.SetParameters(Parameters)
3112 self._autoPublish(anObj, theName, "torus")
3115 # end of l3_3d_primitives
3118 ## @addtogroup l3_complex
3121 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3122 # @param theBase Base shape to be extruded.
3123 # @param thePoint1 First end of extrusion vector.
3124 # @param thePoint2 Second end of extrusion vector.
3125 # @param theScaleFactor Use it to make prism with scaled second base.
3126 # Nagative value means not scaled second base.
3127 # @param theName Object name; when specified, this parameter is used
3128 # for result publication in the study. Otherwise, if automatic
3129 # publication is switched on, default value is used for result name.
3131 # @return New GEOM.GEOM_Object, containing the created prism.
3133 # @ref tui_creation_prism "Example"
3134 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3136 Create a shape by extrusion of the base shape along a vector, defined by two points.
3139 theBase Base shape to be extruded.
3140 thePoint1 First end of extrusion vector.
3141 thePoint2 Second end of extrusion vector.
3142 theScaleFactor Use it to make prism with scaled second base.
3143 Nagative value means not scaled second base.
3144 theName Object name; when specified, this parameter is used
3145 for result publication in the study. Otherwise, if automatic
3146 publication is switched on, default value is used for result name.
3149 New GEOM.GEOM_Object, containing the created prism.
3151 # Example: see GEOM_TestAll.py
3154 if theScaleFactor > 0:
3155 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3156 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3158 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3159 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3160 anObj.SetParameters(Parameters)
3161 self._autoPublish(anObj, theName, "prism")
3164 ## Create a shape by extrusion of the base shape along a
3165 # vector, defined by two points, in 2 Ways (forward/backward).
3166 # @param theBase Base shape to be extruded.
3167 # @param thePoint1 First end of extrusion vector.
3168 # @param thePoint2 Second end of extrusion vector.
3169 # @param theName Object name; when specified, this parameter is used
3170 # for result publication in the study. Otherwise, if automatic
3171 # publication is switched on, default value is used for result name.
3173 # @return New GEOM.GEOM_Object, containing the created prism.
3175 # @ref tui_creation_prism "Example"
3176 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3178 Create a shape by extrusion of the base shape along a
3179 vector, defined by two points, in 2 Ways (forward/backward).
3182 theBase Base shape to be extruded.
3183 thePoint1 First end of extrusion vector.
3184 thePoint2 Second end of extrusion vector.
3185 theName Object name; when specified, this parameter is used
3186 for result publication in the study. Otherwise, if automatic
3187 publication is switched on, default value is used for result name.
3190 New GEOM.GEOM_Object, containing the created prism.
3192 # Example: see GEOM_TestAll.py
3193 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3194 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3195 self._autoPublish(anObj, theName, "prism")
3198 ## Create a shape by extrusion of the base shape along the vector,
3199 # i.e. all the space, transfixed by the base shape during its translation
3200 # along the vector on the given distance.
3201 # @param theBase Base shape to be extruded.
3202 # @param theVec Direction of extrusion.
3203 # @param theH Prism dimension along theVec.
3204 # @param theScaleFactor Use it to make prism with scaled second base.
3205 # Negative value means not scaled second base.
3206 # @param theName Object name; when specified, this parameter is used
3207 # for result publication in the study. Otherwise, if automatic
3208 # publication is switched on, default value is used for result name.
3210 # @return New GEOM.GEOM_Object, containing the created prism.
3212 # @ref tui_creation_prism "Example"
3213 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3215 Create a shape by extrusion of the base shape along the vector,
3216 i.e. all the space, transfixed by the base shape during its translation
3217 along the vector on the given distance.
3220 theBase Base shape to be extruded.
3221 theVec Direction of extrusion.
3222 theH Prism dimension along theVec.
3223 theScaleFactor Use it to make prism with scaled second base.
3224 Negative value means not scaled second base.
3225 theName Object name; when specified, this parameter is used
3226 for result publication in the study. Otherwise, if automatic
3227 publication is switched on, default value is used for result name.
3230 New GEOM.GEOM_Object, containing the created prism.
3232 # Example: see GEOM_TestAll.py
3235 if theScaleFactor > 0:
3236 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3237 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3239 theH,Parameters = ParseParameters(theH)
3240 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3241 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3242 anObj.SetParameters(Parameters)
3243 self._autoPublish(anObj, theName, "prism")
3246 ## Create a shape by extrusion of the base shape along the vector,
3247 # i.e. all the space, transfixed by the base shape during its translation
3248 # along the vector on the given distance in 2 Ways (forward/backward).
3249 # @param theBase Base shape to be extruded.
3250 # @param theVec Direction of extrusion.
3251 # @param theH Prism dimension along theVec in forward direction.
3252 # @param theName Object name; when specified, this parameter is used
3253 # for result publication in the study. Otherwise, if automatic
3254 # publication is switched on, default value is used for result name.
3256 # @return New GEOM.GEOM_Object, containing the created prism.
3258 # @ref tui_creation_prism "Example"
3259 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3261 Create a shape by extrusion of the base shape along the vector,
3262 i.e. all the space, transfixed by the base shape during its translation
3263 along the vector on the given distance in 2 Ways (forward/backward).
3266 theBase Base shape to be extruded.
3267 theVec Direction of extrusion.
3268 theH Prism dimension along theVec in forward direction.
3269 theName Object name; when specified, this parameter is used
3270 for result publication in the study. Otherwise, if automatic
3271 publication is switched on, default value is used for result name.
3274 New GEOM.GEOM_Object, containing the created prism.
3276 # Example: see GEOM_TestAll.py
3277 theH,Parameters = ParseParameters(theH)
3278 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3279 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3280 anObj.SetParameters(Parameters)
3281 self._autoPublish(anObj, theName, "prism")
3284 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3285 # @param theBase Base shape to be extruded.
3286 # @param theDX, theDY, theDZ Directions of extrusion.
3287 # @param theScaleFactor Use it to make prism with scaled second base.
3288 # Nagative value means not scaled second base.
3289 # @param theName Object name; when specified, this parameter is used
3290 # for result publication in the study. Otherwise, if automatic
3291 # publication is switched on, default value is used for result name.
3293 # @return New GEOM.GEOM_Object, containing the created prism.
3295 # @ref tui_creation_prism "Example"
3296 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3298 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3301 theBase Base shape to be extruded.
3302 theDX, theDY, theDZ Directions of extrusion.
3303 theScaleFactor Use it to make prism with scaled second base.
3304 Nagative value means not scaled second base.
3305 theName Object name; when specified, this parameter is used
3306 for result publication in the study. Otherwise, if automatic
3307 publication is switched on, default value is used for result name.
3310 New GEOM.GEOM_Object, containing the created prism.
3312 # Example: see GEOM_TestAll.py
3315 if theScaleFactor > 0:
3316 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3317 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3319 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3320 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3321 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3322 anObj.SetParameters(Parameters)
3323 self._autoPublish(anObj, theName, "prism")
3326 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3327 # i.e. all the space, transfixed by the base shape during its translation
3328 # along the vector on the given distance in 2 Ways (forward/backward).
3329 # @param theBase Base shape to be extruded.
3330 # @param theDX, theDY, theDZ Directions of extrusion.
3331 # @param theName Object name; when specified, this parameter is used
3332 # for result publication in the study. Otherwise, if automatic
3333 # publication is switched on, default value is used for result name.
3335 # @return New GEOM.GEOM_Object, containing the created prism.
3337 # @ref tui_creation_prism "Example"
3338 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3340 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3341 i.e. all the space, transfixed by the base shape during its translation
3342 along the vector on the given distance in 2 Ways (forward/backward).
3345 theBase Base shape to be extruded.
3346 theDX, theDY, theDZ Directions of extrusion.
3347 theName Object name; when specified, this parameter is used
3348 for result publication in the study. Otherwise, if automatic
3349 publication is switched on, default value is used for result name.
3352 New GEOM.GEOM_Object, containing the created prism.
3354 # Example: see GEOM_TestAll.py
3355 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3356 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3357 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3358 anObj.SetParameters(Parameters)
3359 self._autoPublish(anObj, theName, "prism")
3362 ## Create a shape by revolution of the base shape around the axis
3363 # on the given angle, i.e. all the space, transfixed by the base
3364 # shape during its rotation around the axis on the given angle.
3365 # @param theBase Base shape to be rotated.
3366 # @param theAxis Rotation axis.
3367 # @param theAngle Rotation angle in radians.
3368 # @param theName Object name; when specified, this parameter is used
3369 # for result publication in the study. Otherwise, if automatic
3370 # publication is switched on, default value is used for result name.
3372 # @return New GEOM.GEOM_Object, containing the created revolution.
3374 # @ref tui_creation_revolution "Example"
3375 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3377 Create a shape by revolution of the base shape around the axis
3378 on the given angle, i.e. all the space, transfixed by the base
3379 shape during its rotation around the axis on the given angle.
3382 theBase Base shape to be rotated.
3383 theAxis Rotation axis.
3384 theAngle Rotation angle in radians.
3385 theName Object name; when specified, this parameter is used
3386 for result publication in the study. Otherwise, if automatic
3387 publication is switched on, default value is used for result name.
3390 New GEOM.GEOM_Object, containing the created revolution.
3392 # Example: see GEOM_TestAll.py
3393 theAngle,Parameters = ParseParameters(theAngle)
3394 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3395 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3396 anObj.SetParameters(Parameters)
3397 self._autoPublish(anObj, theName, "revolution")
3400 ## Create a shape by revolution of the base shape around the axis
3401 # on the given angle, i.e. all the space, transfixed by the base
3402 # shape during its rotation around the axis on the given angle in
3403 # both directions (forward/backward)
3404 # @param theBase Base shape to be rotated.
3405 # @param theAxis Rotation axis.
3406 # @param theAngle Rotation angle in radians.
3407 # @param theName Object name; when specified, this parameter is used
3408 # for result publication in the study. Otherwise, if automatic
3409 # publication is switched on, default value is used for result name.
3411 # @return New GEOM.GEOM_Object, containing the created revolution.
3413 # @ref tui_creation_revolution "Example"
3414 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3416 Create a shape by revolution of the base shape around the axis
3417 on the given angle, i.e. all the space, transfixed by the base
3418 shape during its rotation around the axis on the given angle in
3419 both directions (forward/backward).
3422 theBase Base shape to be rotated.
3423 theAxis Rotation axis.
3424 theAngle Rotation angle in radians.
3425 theName Object name; when specified, this parameter is used
3426 for result publication in the study. Otherwise, if automatic
3427 publication is switched on, default value is used for result name.
3430 New GEOM.GEOM_Object, containing the created revolution.
3432 theAngle,Parameters = ParseParameters(theAngle)
3433 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3434 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3435 anObj.SetParameters(Parameters)
3436 self._autoPublish(anObj, theName, "revolution")
3439 ## Create a filling from the given compound of contours.
3440 # @param theShape the compound of contours
3441 # @param theMinDeg a minimal degree of BSpline surface to create
3442 # @param theMaxDeg a maximal degree of BSpline surface to create
3443 # @param theTol2D a 2d tolerance to be reached
3444 # @param theTol3D a 3d tolerance to be reached
3445 # @param theNbIter a number of iteration of approximation algorithm
3446 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3447 # @param isApprox if True, BSpline curves are generated in the process
3448 # of surface construction. By default it is False, that means
3449 # the surface is created using given curves. The usage of
3450 # Approximation makes the algorithm work slower, but allows
3451 # building the surface for rather complex cases.
3452 # @param theName Object name; when specified, this parameter is used
3453 # for result publication in the study. Otherwise, if automatic
3454 # publication is switched on, default value is used for result name.
3456 # @return New GEOM.GEOM_Object, containing the created filling surface.
3458 # @ref tui_creation_filling "Example"
3459 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3460 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3462 Create a filling from the given compound of contours.
3465 theShape the compound of contours
3466 theMinDeg a minimal degree of BSpline surface to create
3467 theMaxDeg a maximal degree of BSpline surface to create
3468 theTol2D a 2d tolerance to be reached
3469 theTol3D a 3d tolerance to be reached
3470 theNbIter a number of iteration of approximation algorithm
3471 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3472 isApprox if True, BSpline curves are generated in the process
3473 of surface construction. By default it is False, that means
3474 the surface is created using given curves. The usage of
3475 Approximation makes the algorithm work slower, but allows
3476 building the surface for rather complex cases
3477 theName Object name; when specified, this parameter is used
3478 for result publication in the study. Otherwise, if automatic
3479 publication is switched on, default value is used for result name.
3482 New GEOM.GEOM_Object, containing the created filling surface.
3485 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3487 # Example: see GEOM_TestAll.py
3488 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3489 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3490 theTol2D, theTol3D, theNbIter,
3491 theMethod, isApprox)
3492 RaiseIfFailed("MakeFilling", self.PrimOp)
3493 anObj.SetParameters(Parameters)
3494 self._autoPublish(anObj, theName, "filling")
3498 ## Create a filling from the given compound of contours.
3499 # This method corresponds to MakeFilling with isApprox=True
3500 # @param theShape the compound of contours
3501 # @param theMinDeg a minimal degree of BSpline surface to create
3502 # @param theMaxDeg a maximal degree of BSpline surface to create
3503 # @param theTol3D a 3d tolerance to be reached
3504 # @param theName Object name; when specified, this parameter is used
3505 # for result publication in the study. Otherwise, if automatic
3506 # publication is switched on, default value is used for result name.
3508 # @return New GEOM.GEOM_Object, containing the created filling surface.
3510 # @ref tui_creation_filling "Example"
3511 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3513 Create a filling from the given compound of contours.
3514 This method corresponds to MakeFilling with isApprox=True
3517 theShape the compound of contours
3518 theMinDeg a minimal degree of BSpline surface to create
3519 theMaxDeg a maximal degree of BSpline surface to create
3520 theTol3D a 3d tolerance to be reached
3521 theName Object name; when specified, this parameter is used
3522 for result publication in the study. Otherwise, if automatic
3523 publication is switched on, default value is used for result name.
3526 New GEOM.GEOM_Object, containing the created filling surface.
3529 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3531 # Example: see GEOM_TestAll.py
3532 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3533 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3534 0, theTol3D, 0, GEOM.FOM_Default, True)
3535 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3536 anObj.SetParameters(Parameters)
3537 self._autoPublish(anObj, theName, "filling")
3540 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3541 # @param theSeqSections - set of specified sections.
3542 # @param theModeSolid - mode defining building solid or shell
3543 # @param thePreci - precision 3D used for smoothing
3544 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3545 # @param theName Object name; when specified, this parameter is used
3546 # for result publication in the study. Otherwise, if automatic
3547 # publication is switched on, default value is used for result name.
3549 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3551 # @ref swig_todo "Example"
3552 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3554 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3557 theSeqSections - set of specified sections.
3558 theModeSolid - mode defining building solid or shell
3559 thePreci - precision 3D used for smoothing
3560 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3561 theName Object name; when specified, this parameter is used
3562 for result publication in the study. Otherwise, if automatic
3563 publication is switched on, default value is used for result name.
3566 New GEOM.GEOM_Object, containing the created shell or solid.
3568 # Example: see GEOM_TestAll.py
3569 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3570 RaiseIfFailed("MakeThruSections", self.PrimOp)
3571 self._autoPublish(anObj, theName, "filling")
3574 ## Create a shape by extrusion of the base shape along
3575 # the path shape. The path shape can be a wire or an edge.
3576 # @param theBase Base shape to be extruded.
3577 # @param thePath Path shape to extrude the base shape along it.
3578 # @param theName Object name; when specified, this parameter is used
3579 # for result publication in the study. Otherwise, if automatic
3580 # publication is switched on, default value is used for result name.
3582 # @return New GEOM.GEOM_Object, containing the created pipe.
3584 # @ref tui_creation_pipe "Example"
3585 def MakePipe(self, theBase, thePath, theName=None):
3587 Create a shape by extrusion of the base shape along
3588 the path shape. The path shape can be a wire or an edge.
3591 theBase Base shape to be extruded.
3592 thePath Path shape to extrude the base shape along it.
3593 theName Object name; when specified, this parameter is used
3594 for result publication in the study. Otherwise, if automatic
3595 publication is switched on, default value is used for result name.
3598 New GEOM.GEOM_Object, containing the created pipe.
3600 # Example: see GEOM_TestAll.py
3601 anObj = self.PrimOp.MakePipe(theBase, thePath)
3602 RaiseIfFailed("MakePipe", self.PrimOp)
3603 self._autoPublish(anObj, theName, "pipe")
3606 ## Create a shape by extrusion of the profile shape along
3607 # the path shape. The path shape can be a wire or an edge.
3608 # the several profiles can be specified in the several locations of path.
3609 # @param theSeqBases - list of Bases shape to be extruded.
3610 # @param theLocations - list of locations on the path corresponding
3611 # specified list of the Bases shapes. Number of locations
3612 # should be equal to number of bases or list of locations can be empty.
3613 # @param thePath - Path shape to extrude the base shape along it.
3614 # @param theWithContact - the mode defining that the section is translated to be in
3615 # contact with the spine.
3616 # @param theWithCorrection - defining that the section is rotated to be
3617 # orthogonal to the spine tangent in the correspondent point
3618 # @param theName Object name; when specified, this parameter is used
3619 # for result publication in the study. Otherwise, if automatic
3620 # publication is switched on, default value is used for result name.
3622 # @return New GEOM.GEOM_Object, containing the created pipe.
3624 # @ref tui_creation_pipe_with_diff_sec "Example"
3625 def MakePipeWithDifferentSections(self, theSeqBases,
3626 theLocations, thePath,
3627 theWithContact, theWithCorrection, theName=None):
3629 Create a shape by extrusion of the profile shape along
3630 the path shape. The path shape can be a wire or an edge.
3631 the several profiles can be specified in the several locations of path.
3634 theSeqBases - list of Bases shape to be extruded.
3635 theLocations - list of locations on the path corresponding
3636 specified list of the Bases shapes. Number of locations
3637 should be equal to number of bases or list of locations can be empty.
3638 thePath - Path shape to extrude the base shape along it.
3639 theWithContact - the mode defining that the section is translated to be in
3640 contact with the spine(0/1)
3641 theWithCorrection - defining that the section is rotated to be
3642 orthogonal to the spine tangent in the correspondent point (0/1)
3643 theName Object name; when specified, this parameter is used
3644 for result publication in the study. Otherwise, if automatic
3645 publication is switched on, default value is used for result name.
3648 New GEOM.GEOM_Object, containing the created pipe.
3650 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3651 theLocations, thePath,
3652 theWithContact, theWithCorrection)
3653 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3654 self._autoPublish(anObj, theName, "pipe")
3657 ## Create a shape by extrusion of the profile shape along
3658 # the path shape. The path shape can be a wire or a edge.
3659 # the several profiles can be specified in the several locations of path.
3660 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3661 # shell or face. If number of faces in neighbour sections
3662 # aren't coincided result solid between such sections will
3663 # be created using external boundaries of this shells.
3664 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3665 # This list is used for searching correspondences between
3666 # faces in the sections. Size of this list must be equal
3667 # to size of list of base shapes.
3668 # @param theLocations - list of locations on the path corresponding
3669 # specified list of the Bases shapes. Number of locations
3670 # should be equal to number of bases. First and last
3671 # locations must be coincided with first and last vertexes
3672 # of path correspondingly.
3673 # @param thePath - Path shape to extrude the base shape along it.
3674 # @param theWithContact - the mode defining that the section is translated to be in
3675 # contact with the spine.
3676 # @param theWithCorrection - defining that the section is rotated to be
3677 # orthogonal to the spine tangent in the correspondent point
3678 # @param theName Object name; when specified, this parameter is used
3679 # for result publication in the study. Otherwise, if automatic
3680 # publication is switched on, default value is used for result name.
3682 # @return New GEOM.GEOM_Object, containing the created solids.
3684 # @ref tui_creation_pipe_with_shell_sec "Example"
3685 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3686 theLocations, thePath,
3687 theWithContact, theWithCorrection, theName=None):
3689 Create a shape by extrusion of the profile shape along
3690 the path shape. The path shape can be a wire or a edge.
3691 the several profiles can be specified in the several locations of path.
3694 theSeqBases - list of Bases shape to be extruded. Base shape must be
3695 shell or face. If number of faces in neighbour sections
3696 aren't coincided result solid between such sections will
3697 be created using external boundaries of this shells.
3698 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3699 This list is used for searching correspondences between
3700 faces in the sections. Size of this list must be equal
3701 to size of list of base shapes.
3702 theLocations - list of locations on the path corresponding
3703 specified list of the Bases shapes. Number of locations
3704 should be equal to number of bases. First and last
3705 locations must be coincided with first and last vertexes
3706 of path correspondingly.
3707 thePath - Path shape to extrude the base shape along it.
3708 theWithContact - the mode defining that the section is translated to be in
3709 contact with the spine (0/1)
3710 theWithCorrection - defining that the section is rotated to be
3711 orthogonal to the spine tangent in the correspondent point (0/1)
3712 theName Object name; when specified, this parameter is used
3713 for result publication in the study. Otherwise, if automatic
3714 publication is switched on, default value is used for result name.
3717 New GEOM.GEOM_Object, containing the created solids.
3719 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3720 theLocations, thePath,
3721 theWithContact, theWithCorrection)
3722 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3723 self._autoPublish(anObj, theName, "pipe")
3726 ## Create a shape by extrusion of the profile shape along
3727 # the path shape. This function is used only for debug pipe
3728 # functionality - it is a version of function MakePipeWithShellSections()
3729 # which give a possibility to recieve information about
3730 # creating pipe between each pair of sections step by step.
3731 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3732 theLocations, thePath,
3733 theWithContact, theWithCorrection, theName=None):
3735 Create a shape by extrusion of the profile shape along
3736 the path shape. This function is used only for debug pipe
3737 functionality - it is a version of previous function
3738 geompy.MakePipeWithShellSections() which give a possibility to
3739 recieve information about creating pipe between each pair of
3740 sections step by step.
3743 nbsect = len(theSeqBases)
3744 nbsubsect = len(theSeqSubBases)
3745 #print "nbsect = ",nbsect
3746 for i in range(1,nbsect):
3748 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3749 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3751 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3752 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3753 tmpLocations, thePath,
3754 theWithContact, theWithCorrection)
3755 if self.PrimOp.IsDone() == 0:
3756 print "Problems with pipe creation between ",i," and ",i+1," sections"
3757 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3760 print "Pipe between ",i," and ",i+1," sections is OK"
3765 resc = self.MakeCompound(res)
3766 #resc = self.MakeSewing(res, 0.001)
3767 #print "resc: ",resc
3768 self._autoPublish(resc, theName, "pipe")
3771 ## Create solids between given sections
3772 # @param theSeqBases - list of sections (shell or face).
3773 # @param theLocations - list of corresponding vertexes
3774 # @param theName Object name; when specified, this parameter is used
3775 # for result publication in the study. Otherwise, if automatic
3776 # publication is switched on, default value is used for result name.
3778 # @return New GEOM.GEOM_Object, containing the created solids.
3780 # @ref tui_creation_pipe_without_path "Example"
3781 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3783 Create solids between given sections
3786 theSeqBases - list of sections (shell or face).
3787 theLocations - list of corresponding vertexes
3788 theName Object name; when specified, this parameter is used
3789 for result publication in the study. Otherwise, if automatic
3790 publication is switched on, default value is used for result name.
3793 New GEOM.GEOM_Object, containing the created solids.
3795 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3796 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3797 self._autoPublish(anObj, theName, "pipe")
3800 ## Create a shape by extrusion of the base shape along
3801 # the path shape with constant bi-normal direction along the given vector.
3802 # The path shape can be a wire or an edge.
3803 # @param theBase Base shape to be extruded.
3804 # @param thePath Path shape to extrude the base shape along it.
3805 # @param theVec Vector defines a constant binormal direction to keep the
3806 # same angle beetween the direction and the sections
3807 # along the sweep surface.
3808 # @param theName Object name; when specified, this parameter is used
3809 # for result publication in the study. Otherwise, if automatic
3810 # publication is switched on, default value is used for result name.
3812 # @return New GEOM.GEOM_Object, containing the created pipe.
3814 # @ref tui_creation_pipe "Example"
3815 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3817 Create a shape by extrusion of the base shape along
3818 the path shape with constant bi-normal direction along the given vector.
3819 The path shape can be a wire or an edge.
3822 theBase Base shape to be extruded.
3823 thePath Path shape to extrude the base shape along it.
3824 theVec Vector defines a constant binormal direction to keep the
3825 same angle beetween the direction and the sections
3826 along the sweep surface.
3827 theName Object name; when specified, this parameter is used
3828 for result publication in the study. Otherwise, if automatic
3829 publication is switched on, default value is used for result name.
3832 New GEOM.GEOM_Object, containing the created pipe.
3834 # Example: see GEOM_TestAll.py
3835 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3836 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3837 self._autoPublish(anObj, theName, "pipe")
3840 ## Makes a thick solid from a face or a shell
3841 # @param theShape Face or Shell to be thicken
3842 # @param theThickness Thickness of the resulting solid
3843 # @param theName Object name; when specified, this parameter is used
3844 # for result publication in the study. Otherwise, if automatic
3845 # publication is switched on, default value is used for result name.
3847 # @return New GEOM.GEOM_Object, containing the created solid
3849 def MakeThickSolid(self, theShape, theThickness, theName=None):
3851 Make a thick solid from a face or a shell
3854 theShape Face or Shell to be thicken
3855 theThickness Thickness of the resulting solid
3856 theName Object name; when specified, this parameter is used
3857 for result publication in the study. Otherwise, if automatic
3858 publication is switched on, default value is used for result name.
3861 New GEOM.GEOM_Object, containing the created solid
3863 # Example: see GEOM_TestAll.py
3864 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3865 RaiseIfFailed("MakeThickening", self.PrimOp)
3866 self._autoPublish(anObj, theName, "pipe")
3870 ## Modifies a face or a shell to make it a thick solid
3871 # @param theShape Face or Shell to be thicken
3872 # @param theThickness Thickness of the resulting solid
3874 # @return The modified shape
3876 def Thicken(self, theShape, theThickness):
3878 Modifies a face or a shell to make it a thick solid
3881 theBase Base shape to be extruded.
3882 thePath Path shape to extrude the base shape along it.
3883 theName Object name; when specified, this parameter is used
3884 for result publication in the study. Otherwise, if automatic
3885 publication is switched on, default value is used for result name.
3890 # Example: see GEOM_TestAll.py
3891 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3892 RaiseIfFailed("MakeThickening", self.PrimOp)
3895 ## Build a middle path of a pipe-like shape.
3896 # The path shape can be a wire or an edge.
3897 # @param theShape It can be closed or unclosed pipe-like shell
3898 # or a pipe-like solid.
3899 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3900 # should be wires or faces of theShape.
3901 # @param theName Object name; when specified, this parameter is used
3902 # for result publication in the study. Otherwise, if automatic
3903 # publication is switched on, default value is used for result name.
3905 # @note It is not assumed that exact or approximate copy of theShape
3906 # can be obtained by applying existing Pipe operation on the
3907 # resulting "Path" wire taking theBase1 as the base - it is not
3908 # always possible; though in some particular cases it might work
3909 # it is not guaranteed. Thus, RestorePath function should not be
3910 # considered as an exact reverse operation of the Pipe.
3912 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3913 # source pipe's "path".
3915 # @ref tui_creation_pipe_path "Example"
3916 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3918 Build a middle path of a pipe-like shape.
3919 The path shape can be a wire or an edge.
3922 theShape It can be closed or unclosed pipe-like shell
3923 or a pipe-like solid.
3924 theBase1, theBase2 Two bases of the supposed pipe. This
3925 should be wires or faces of theShape.
3926 theName Object name; when specified, this parameter is used
3927 for result publication in the study. Otherwise, if automatic
3928 publication is switched on, default value is used for result name.
3931 New GEOM_Object, containing an edge or wire that represent
3934 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3935 RaiseIfFailed("RestorePath", self.PrimOp)
3936 self._autoPublish(anObj, theName, "path")
3939 ## Build a middle path of a pipe-like shape.
3940 # The path shape can be a wire or an edge.
3941 # @param theShape It can be closed or unclosed pipe-like shell
3942 # or a pipe-like solid.
3943 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3944 # should be lists of edges of theShape.
3945 # @param theName Object name; when specified, this parameter is used
3946 # for result publication in the study. Otherwise, if automatic
3947 # publication is switched on, default value is used for result name.
3949 # @note It is not assumed that exact or approximate copy of theShape
3950 # can be obtained by applying existing Pipe operation on the
3951 # resulting "Path" wire taking theBase1 as the base - it is not
3952 # always possible; though in some particular cases it might work
3953 # it is not guaranteed. Thus, RestorePath function should not be
3954 # considered as an exact reverse operation of the Pipe.
3956 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3957 # source pipe's "path".
3959 # @ref tui_creation_pipe_path "Example"
3960 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3962 Build a middle path of a pipe-like shape.
3963 The path shape can be a wire or an edge.
3966 theShape It can be closed or unclosed pipe-like shell
3967 or a pipe-like solid.
3968 listEdges1, listEdges2 Two bases of the supposed pipe. This
3969 should be lists of edges of theShape.
3970 theName Object name; when specified, this parameter is used
3971 for result publication in the study. Otherwise, if automatic
3972 publication is switched on, default value is used for result name.
3975 New GEOM_Object, containing an edge or wire that represent
3978 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3979 RaiseIfFailed("RestorePath", self.PrimOp)
3980 self._autoPublish(anObj, theName, "path")
3986 ## @addtogroup l3_advanced
3989 ## Create a linear edge with specified ends.
3990 # @param thePnt1 Point for the first end of edge.
3991 # @param thePnt2 Point for the second end of edge.
3992 # @param theName Object name; when specified, this parameter is used
3993 # for result publication in the study. Otherwise, if automatic
3994 # publication is switched on, default value is used for result name.
3996 # @return New GEOM.GEOM_Object, containing the created edge.
3998 # @ref tui_creation_edge "Example"
3999 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4001 Create a linear edge with specified ends.
4004 thePnt1 Point for the first end of edge.
4005 thePnt2 Point for the second end of edge.
4006 theName Object name; when specified, this parameter is used
4007 for result publication in the study. Otherwise, if automatic
4008 publication is switched on, default value is used for result name.
4011 New GEOM.GEOM_Object, containing the created edge.
4013 # Example: see GEOM_TestAll.py
4014 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4015 RaiseIfFailed("MakeEdge", self.ShapesOp)
4016 self._autoPublish(anObj, theName, "edge")
4019 ## Create a new edge, corresponding to the given length on the given curve.
4020 # @param theRefCurve The referenced curve (edge).
4021 # @param theLength Length on the referenced curve. It can be negative.
4022 # @param theStartPoint Any point can be selected for it, the new edge will begin
4023 # at the end of \a theRefCurve, close to the selected point.
4024 # If None, start from the first point of \a theRefCurve.
4025 # @param theName Object name; when specified, this parameter is used
4026 # for result publication in the study. Otherwise, if automatic
4027 # publication is switched on, default value is used for result name.
4029 # @return New GEOM.GEOM_Object, containing the created edge.
4031 # @ref tui_creation_edge "Example"
4032 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4034 Create a new edge, corresponding to the given length on the given curve.
4037 theRefCurve The referenced curve (edge).
4038 theLength Length on the referenced curve. It can be negative.
4039 theStartPoint Any point can be selected for it, the new edge will begin
4040 at the end of theRefCurve, close to the selected point.
4041 If None, start from the first point of theRefCurve.
4042 theName Object name; when specified, this parameter is used
4043 for result publication in the study. Otherwise, if automatic
4044 publication is switched on, default value is used for result name.
4047 New GEOM.GEOM_Object, containing the created edge.
4049 # Example: see GEOM_TestAll.py
4050 theLength, Parameters = ParseParameters(theLength)
4051 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4052 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4053 anObj.SetParameters(Parameters)
4054 self._autoPublish(anObj, theName, "edge")
4057 ## Create an edge from specified wire.
4058 # @param theWire source Wire
4059 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4060 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4061 # @param theName Object name; when specified, this parameter is used
4062 # for result publication in the study. Otherwise, if automatic
4063 # publication is switched on, default value is used for result name.
4065 # @return New GEOM.GEOM_Object, containing the created edge.
4067 # @ref tui_creation_edge "Example"
4068 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4070 Create an edge from specified wire.
4074 theLinearTolerance linear tolerance value (default = 1e-07)
4075 theAngularTolerance angular tolerance value (default = 1e-12)
4076 theName Object name; when specified, this parameter is used
4077 for result publication in the study. Otherwise, if automatic
4078 publication is switched on, default value is used for result name.
4081 New GEOM.GEOM_Object, containing the created edge.
4083 # Example: see GEOM_TestAll.py
4084 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4085 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4086 self._autoPublish(anObj, theName, "edge")
4089 ## Create a wire from the set of edges and wires.
4090 # @param theEdgesAndWires List of edges and/or wires.
4091 # @param theTolerance Maximum distance between vertices, that will be merged.
4092 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4093 # @param theName Object name; when specified, this parameter is used
4094 # for result publication in the study. Otherwise, if automatic
4095 # publication is switched on, default value is used for result name.
4097 # @return New GEOM.GEOM_Object, containing the created wire.
4099 # @ref tui_creation_wire "Example"
4100 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4102 Create a wire from the set of edges and wires.
4105 theEdgesAndWires List of edges and/or wires.
4106 theTolerance Maximum distance between vertices, that will be merged.
4107 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4108 theName Object name; when specified, this parameter is used
4109 for result publication in the study. Otherwise, if automatic
4110 publication is switched on, default value is used for result name.
4113 New GEOM.GEOM_Object, containing the created wire.
4115 # Example: see GEOM_TestAll.py
4116 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4117 RaiseIfFailed("MakeWire", self.ShapesOp)
4118 self._autoPublish(anObj, theName, "wire")
4121 ## Create a face on the given wire.
4122 # @param theWire closed Wire or Edge to build the face on.
4123 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4124 # If the tolerance of the obtained planar face is less
4125 # than 1e-06, this face will be returned, otherwise the
4126 # algorithm tries to build any suitable face on the given
4127 # wire and prints a warning message.
4128 # @param theName Object name; when specified, this parameter is used
4129 # for result publication in the study. Otherwise, if automatic
4130 # publication is switched on, default value is used for result name.
4132 # @return New GEOM.GEOM_Object, containing the created face.
4134 # @ref tui_creation_face "Example"
4135 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4137 Create a face on the given wire.
4140 theWire closed Wire or Edge to build the face on.
4141 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4142 If the tolerance of the obtained planar face is less
4143 than 1e-06, this face will be returned, otherwise the
4144 algorithm tries to build any suitable face on the given
4145 wire and prints a warning message.
4146 theName Object name; when specified, this parameter is used
4147 for result publication in the study. Otherwise, if automatic
4148 publication is switched on, default value is used for result name.
4151 New GEOM.GEOM_Object, containing the created face.
4153 # Example: see GEOM_TestAll.py
4154 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4155 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4156 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4158 RaiseIfFailed("MakeFace", self.ShapesOp)
4159 self._autoPublish(anObj, theName, "face")
4162 ## Create a face on the given wires set.
4163 # @param theWires List of closed wires or edges to build the face on.
4164 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4165 # If the tolerance of the obtained planar face is less
4166 # than 1e-06, this face will be returned, otherwise the
4167 # algorithm tries to build any suitable face on the given
4168 # wire and prints a warning message.
4169 # @param theName Object name; when specified, this parameter is used
4170 # for result publication in the study. Otherwise, if automatic
4171 # publication is switched on, default value is used for result name.
4173 # @return New GEOM.GEOM_Object, containing the created face.
4175 # @ref tui_creation_face "Example"
4176 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4178 Create a face on the given wires set.
4181 theWires List of closed wires or edges to build the face on.
4182 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4183 If the tolerance of the obtained planar face is less
4184 than 1e-06, this face will be returned, otherwise the
4185 algorithm tries to build any suitable face on the given
4186 wire and prints a warning message.
4187 theName Object name; when specified, this parameter is used
4188 for result publication in the study. Otherwise, if automatic
4189 publication is switched on, default value is used for result name.
4192 New GEOM.GEOM_Object, containing the created face.
4194 # Example: see GEOM_TestAll.py
4195 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4196 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4197 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4199 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4200 self._autoPublish(anObj, theName, "face")
4203 ## See MakeFaceWires() method for details.
4205 # @ref tui_creation_face "Example 1"
4206 # \n @ref swig_MakeFaces "Example 2"
4207 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4209 See geompy.MakeFaceWires() method for details.
4211 # Example: see GEOM_TestOthers.py
4212 # note: auto-publishing is done in self.MakeFaceWires()
4213 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4216 ## Create a shell from the set of faces and shells.
4217 # @param theFacesAndShells List of faces and/or shells.
4218 # @param theName Object name; when specified, this parameter is used
4219 # for result publication in the study. Otherwise, if automatic
4220 # publication is switched on, default value is used for result name.
4222 # @return New GEOM.GEOM_Object, containing the created shell.
4224 # @ref tui_creation_shell "Example"
4225 def MakeShell(self, theFacesAndShells, theName=None):
4227 Create a shell from the set of faces and shells.
4230 theFacesAndShells List of faces and/or shells.
4231 theName Object name; when specified, this parameter is used
4232 for result publication in the study. Otherwise, if automatic
4233 publication is switched on, default value is used for result name.
4236 New GEOM.GEOM_Object, containing the created shell.
4238 # Example: see GEOM_TestAll.py
4239 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4240 RaiseIfFailed("MakeShell", self.ShapesOp)
4241 self._autoPublish(anObj, theName, "shell")
4244 ## Create a solid, bounded by the given shells.
4245 # @param theShells Sequence of bounding shells.
4246 # @param theName Object name; when specified, this parameter is used
4247 # for result publication in the study. Otherwise, if automatic
4248 # publication is switched on, default value is used for result name.
4250 # @return New GEOM.GEOM_Object, containing the created solid.
4252 # @ref tui_creation_solid "Example"
4253 def MakeSolid(self, theShells, theName=None):
4255 Create a solid, bounded by the given shells.
4258 theShells Sequence of bounding shells.
4259 theName Object name; when specified, this parameter is used
4260 for result publication in the study. Otherwise, if automatic
4261 publication is switched on, default value is used for result name.
4264 New GEOM.GEOM_Object, containing the created solid.
4266 # Example: see GEOM_TestAll.py
4267 if len(theShells) == 1:
4268 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4270 # raise RuntimeError, "MakeSolidShells : " + descr
4271 if descr == "WRN_SHAPE_UNCLOSED":
4272 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4273 anObj = self.ShapesOp.MakeSolidShells(theShells)
4274 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4275 self._autoPublish(anObj, theName, "solid")
4278 ## Create a compound of the given shapes.
4279 # @param theShapes List of shapes to put in compound.
4280 # @param theName Object name; when specified, this parameter is used
4281 # for result publication in the study. Otherwise, if automatic
4282 # publication is switched on, default value is used for result name.
4284 # @return New GEOM.GEOM_Object, containing the created compound.
4286 # @ref tui_creation_compound "Example"
4287 def MakeCompound(self, theShapes, theName=None):
4289 Create a compound of the given shapes.
4292 theShapes List of shapes to put in compound.
4293 theName Object name; when specified, this parameter is used
4294 for result publication in the study. Otherwise, if automatic
4295 publication is switched on, default value is used for result name.
4298 New GEOM.GEOM_Object, containing the created compound.
4300 # Example: see GEOM_TestAll.py
4301 anObj = self.ShapesOp.MakeCompound(theShapes)
4302 RaiseIfFailed("MakeCompound", self.ShapesOp)
4303 self._autoPublish(anObj, theName, "compound")
4306 # end of l3_advanced
4309 ## @addtogroup l2_measure
4312 ## Gives quantity of faces in the given shape.
4313 # @param theShape Shape to count faces of.
4314 # @return Quantity of faces.
4316 # @ref swig_NumberOf "Example"
4317 def NumberOfFaces(self, theShape):
4319 Gives quantity of faces in the given shape.
4322 theShape Shape to count faces of.
4327 # Example: see GEOM_TestOthers.py
4328 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4329 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4332 ## Gives quantity of edges in the given shape.
4333 # @param theShape Shape to count edges of.
4334 # @return Quantity of edges.
4336 # @ref swig_NumberOf "Example"
4337 def NumberOfEdges(self, theShape):
4339 Gives quantity of edges in the given shape.
4342 theShape Shape to count edges of.
4347 # Example: see GEOM_TestOthers.py
4348 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4349 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4352 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4353 # @param theShape Shape to count sub-shapes of.
4354 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4355 # @return Quantity of sub-shapes of given type.
4357 # @ref swig_NumberOf "Example"
4358 def NumberOfSubShapes(self, theShape, theShapeType):
4360 Gives quantity of sub-shapes of type theShapeType in the given shape.
4363 theShape Shape to count sub-shapes of.
4364 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4367 Quantity of sub-shapes of given type.
4369 # Example: see GEOM_TestOthers.py
4370 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4371 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4374 ## Gives quantity of solids in the given shape.
4375 # @param theShape Shape to count solids in.
4376 # @return Quantity of solids.
4378 # @ref swig_NumberOf "Example"
4379 def NumberOfSolids(self, theShape):
4381 Gives quantity of solids in the given shape.
4384 theShape Shape to count solids in.
4389 # Example: see GEOM_TestOthers.py
4390 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4391 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4397 ## @addtogroup l3_healing
4400 ## Reverses an orientation the given shape.
4401 # @param theShape Shape to be reversed.
4402 # @param theName Object name; when specified, this parameter is used
4403 # for result publication in the study. Otherwise, if automatic
4404 # publication is switched on, default value is used for result name.
4406 # @return The reversed copy of theShape.
4408 # @ref swig_ChangeOrientation "Example"
4409 def ChangeOrientation(self, theShape, theName=None):
4411 Reverses an orientation the given shape.
4414 theShape Shape to be reversed.
4415 theName Object name; when specified, this parameter is used
4416 for result publication in the study. Otherwise, if automatic
4417 publication is switched on, default value is used for result name.
4420 The reversed copy of theShape.
4422 # Example: see GEOM_TestAll.py
4423 anObj = self.ShapesOp.ChangeOrientation(theShape)
4424 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4425 self._autoPublish(anObj, theName, "reversed")
4428 ## See ChangeOrientation() method for details.
4430 # @ref swig_OrientationChange "Example"
4431 def OrientationChange(self, theShape, theName=None):
4433 See geompy.ChangeOrientation method for details.
4435 # Example: see GEOM_TestOthers.py
4436 # note: auto-publishing is done in self.ChangeOrientation()
4437 anObj = self.ChangeOrientation(theShape, theName)
4443 ## @addtogroup l4_obtain
4446 ## Retrieve all free faces from the given shape.
4447 # Free face is a face, which is not shared between two shells of the shape.
4448 # @param theShape Shape to find free faces in.
4449 # @return List of IDs of all free faces, contained in theShape.
4451 # @ref tui_measurement_tools_page "Example"
4452 def GetFreeFacesIDs(self,theShape):
4454 Retrieve all free faces from the given shape.
4455 Free face is a face, which is not shared between two shells of the shape.
4458 theShape Shape to find free faces in.
4461 List of IDs of all free faces, contained in theShape.
4463 # Example: see GEOM_TestOthers.py
4464 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4465 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4468 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4469 # @param theShape1 Shape to find sub-shapes in.
4470 # @param theShape2 Shape to find shared sub-shapes with.
4471 # @param theShapeType Type of sub-shapes to be retrieved.
4472 # @param theName Object name; when specified, this parameter is used
4473 # for result publication in the study. Otherwise, if automatic
4474 # publication is switched on, default value is used for result name.
4476 # @return List of sub-shapes of theShape1, shared with theShape2.
4478 # @ref swig_GetSharedShapes "Example"
4479 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4481 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4484 theShape1 Shape to find sub-shapes in.
4485 theShape2 Shape to find shared sub-shapes with.
4486 theShapeType Type of sub-shapes to be retrieved.
4487 theName Object name; when specified, this parameter is used
4488 for result publication in the study. Otherwise, if automatic
4489 publication is switched on, default value is used for result name.
4492 List of sub-shapes of theShape1, shared with theShape2.
4494 # Example: see GEOM_TestOthers.py
4495 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4496 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4497 self._autoPublish(aList, theName, "shared")
4500 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4501 # @param theShapes Shapes to find common sub-shapes of.
4502 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4503 # @param theName Object name; when specified, this parameter is used
4504 # for result publication in the study. Otherwise, if automatic
4505 # publication is switched on, default value is used for result name.
4507 # @return List of objects, that are sub-shapes of all given shapes.
4509 # @ref swig_GetSharedShapes "Example"
4510 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4512 Get all sub-shapes, shared by all shapes in the list theShapes.
4515 theShapes Shapes to find common sub-shapes of.
4516 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4517 theName Object name; when specified, this parameter is used
4518 for result publication in the study. Otherwise, if automatic
4519 publication is switched on, default value is used for result name.
4522 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4524 # Example: see GEOM_TestOthers.py
4525 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4526 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4527 self._autoPublish(aList, theName, "shared")
4530 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4531 # situated relatively the specified plane by the certain way,
4532 # defined through <VAR>theState</VAR> parameter.
4533 # @param theShape Shape to find sub-shapes of.
4534 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4535 # @param theAx1 Vector (or line, or linear edge), specifying normal
4536 # direction and location of the plane to find shapes on.
4537 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4538 # @param theName Object name; when specified, this parameter is used
4539 # for result publication in the study. Otherwise, if automatic
4540 # publication is switched on, default value is used for result name.
4542 # @return List of all found sub-shapes.
4544 # @ref swig_GetShapesOnPlane "Example"
4545 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4547 Find in theShape all sub-shapes of type theShapeType,
4548 situated relatively the specified plane by the certain way,
4549 defined through theState parameter.
4552 theShape Shape to find sub-shapes of.
4553 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4554 theAx1 Vector (or line, or linear edge), specifying normal
4555 direction and location of the plane to find shapes on.
4556 theState The state of the sub-shapes to find (see GEOM::shape_state)
4557 theName Object name; when specified, this parameter is used
4558 for result publication in the study. Otherwise, if automatic
4559 publication is switched on, default value is used for result name.
4562 List of all found sub-shapes.
4564 # Example: see GEOM_TestOthers.py
4565 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4566 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4567 self._autoPublish(aList, theName, "shapeOnPlane")
4570 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4571 # situated relatively the specified plane by the certain way,
4572 # defined through <VAR>theState</VAR> parameter.
4573 # @param theShape Shape to find sub-shapes of.
4574 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4575 # @param theAx1 Vector (or line, or linear edge), specifying normal
4576 # direction and location of the plane to find shapes on.
4577 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4579 # @return List of all found sub-shapes indices.
4581 # @ref swig_GetShapesOnPlaneIDs "Example"
4582 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4584 Find in theShape all sub-shapes of type theShapeType,
4585 situated relatively the specified plane by the certain way,
4586 defined through theState parameter.
4589 theShape Shape to find sub-shapes of.
4590 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4591 theAx1 Vector (or line, or linear edge), specifying normal
4592 direction and location of the plane to find shapes on.
4593 theState The state of the sub-shapes to find (see GEOM::shape_state)
4596 List of all found sub-shapes indices.
4598 # Example: see GEOM_TestOthers.py
4599 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4600 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4603 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4604 # situated relatively the specified plane by the certain way,
4605 # defined through <VAR>theState</VAR> parameter.
4606 # @param theShape Shape to find sub-shapes of.
4607 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4608 # @param theAx1 Vector (or line, or linear edge), specifying normal
4609 # direction of the plane to find shapes on.
4610 # @param thePnt Point specifying location of the plane to find shapes on.
4611 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4612 # @param theName Object name; when specified, this parameter is used
4613 # for result publication in the study. Otherwise, if automatic
4614 # publication is switched on, default value is used for result name.
4616 # @return List of all found sub-shapes.
4618 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4619 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4621 Find in theShape all sub-shapes of type theShapeType,
4622 situated relatively the specified plane by the certain way,
4623 defined through theState parameter.
4626 theShape Shape to find sub-shapes of.
4627 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4628 theAx1 Vector (or line, or linear edge), specifying normal
4629 direction and location of the plane to find shapes on.
4630 thePnt Point specifying location of the plane to find shapes on.
4631 theState The state of the sub-shapes to find (see GEOM::shape_state)
4632 theName Object name; when specified, this parameter is used
4633 for result publication in the study. Otherwise, if automatic
4634 publication is switched on, default value is used for result name.
4637 List of all found sub-shapes.
4639 # Example: see GEOM_TestOthers.py
4640 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4641 theAx1, thePnt, theState)
4642 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4643 self._autoPublish(aList, theName, "shapeOnPlane")
4646 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4647 # situated relatively the specified plane by the certain way,
4648 # defined through <VAR>theState</VAR> parameter.
4649 # @param theShape Shape to find sub-shapes of.
4650 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4651 # @param theAx1 Vector (or line, or linear edge), specifying normal
4652 # direction of the plane to find shapes on.
4653 # @param thePnt Point specifying location of the plane to find shapes on.
4654 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4656 # @return List of all found sub-shapes indices.
4658 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4659 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4661 Find in theShape all sub-shapes of type theShapeType,
4662 situated relatively the specified plane by the certain way,
4663 defined through theState parameter.
4666 theShape Shape to find sub-shapes of.
4667 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4668 theAx1 Vector (or line, or linear edge), specifying normal
4669 direction and location of the plane to find shapes on.
4670 thePnt Point specifying location of the plane to find shapes on.
4671 theState The state of the sub-shapes to find (see GEOM::shape_state)
4674 List of all found sub-shapes indices.
4676 # Example: see GEOM_TestOthers.py
4677 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4678 theAx1, thePnt, theState)
4679 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4682 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4683 # the specified cylinder by the certain way, defined through \a theState parameter.
4684 # @param theShape Shape to find sub-shapes of.
4685 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4686 # @param theAxis Vector (or line, or linear edge), specifying
4687 # axis of the cylinder to find shapes on.
4688 # @param theRadius Radius of the cylinder to find shapes on.
4689 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4690 # @param theName Object name; when specified, this parameter is used
4691 # for result publication in the study. Otherwise, if automatic
4692 # publication is switched on, default value is used for result name.
4694 # @return List of all found sub-shapes.
4696 # @ref swig_GetShapesOnCylinder "Example"
4697 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4699 Find in theShape all sub-shapes of type theShapeType, situated relatively
4700 the specified cylinder by the certain way, defined through theState parameter.
4703 theShape Shape to find sub-shapes of.
4704 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4705 theAxis Vector (or line, or linear edge), specifying
4706 axis of the cylinder to find shapes on.
4707 theRadius Radius of the cylinder to find shapes on.
4708 theState The state of the sub-shapes to find (see GEOM::shape_state)
4709 theName Object name; when specified, this parameter is used
4710 for result publication in the study. Otherwise, if automatic
4711 publication is switched on, default value is used for result name.
4714 List of all found sub-shapes.
4716 # Example: see GEOM_TestOthers.py
4717 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4718 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4719 self._autoPublish(aList, theName, "shapeOnCylinder")
4722 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4723 # the specified cylinder by the certain way, defined through \a theState parameter.
4724 # @param theShape Shape to find sub-shapes of.
4725 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4726 # @param theAxis Vector (or line, or linear edge), specifying
4727 # axis of the cylinder to find shapes on.
4728 # @param theRadius Radius of the cylinder to find shapes on.
4729 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4731 # @return List of all found sub-shapes indices.
4733 # @ref swig_GetShapesOnCylinderIDs "Example"
4734 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4736 Find in theShape all sub-shapes of type theShapeType, situated relatively
4737 the specified cylinder by the certain way, defined through theState parameter.
4740 theShape Shape to find sub-shapes of.
4741 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4742 theAxis Vector (or line, or linear edge), specifying
4743 axis of the cylinder to find shapes on.
4744 theRadius Radius of the cylinder to find shapes on.
4745 theState The state of the sub-shapes to find (see GEOM::shape_state)
4748 List of all found sub-shapes indices.
4750 # Example: see GEOM_TestOthers.py
4751 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4752 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4755 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4756 # the specified cylinder by the certain way, defined through \a theState parameter.
4757 # @param theShape Shape to find sub-shapes of.
4758 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4759 # @param theAxis Vector (or line, or linear edge), specifying
4760 # axis of the cylinder to find shapes on.
4761 # @param thePnt Point specifying location of the bottom of the cylinder.
4762 # @param theRadius Radius of the cylinder to find shapes on.
4763 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4764 # @param theName Object name; when specified, this parameter is used
4765 # for result publication in the study. Otherwise, if automatic
4766 # publication is switched on, default value is used for result name.
4768 # @return List of all found sub-shapes.
4770 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4771 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4773 Find in theShape all sub-shapes of type theShapeType, situated relatively
4774 the specified cylinder by the certain way, defined through theState parameter.
4777 theShape Shape to find sub-shapes of.
4778 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4779 theAxis Vector (or line, or linear edge), specifying
4780 axis of the cylinder to find shapes on.
4781 theRadius Radius of the cylinder to find shapes on.
4782 theState The state of the sub-shapes to find (see GEOM::shape_state)
4783 theName Object name; when specified, this parameter is used
4784 for result publication in the study. Otherwise, if automatic
4785 publication is switched on, default value is used for result name.
4788 List of all found sub-shapes.
4790 # Example: see GEOM_TestOthers.py
4791 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4792 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4793 self._autoPublish(aList, theName, "shapeOnCylinder")
4796 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4797 # the specified cylinder by the certain way, defined through \a theState parameter.
4798 # @param theShape Shape to find sub-shapes of.
4799 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4800 # @param theAxis Vector (or line, or linear edge), specifying
4801 # axis of the cylinder to find shapes on.
4802 # @param thePnt Point specifying location of the bottom of the cylinder.
4803 # @param theRadius Radius of the cylinder to find shapes on.
4804 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4806 # @return List of all found sub-shapes indices
4808 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4809 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4811 Find in theShape all sub-shapes of type theShapeType, situated relatively
4812 the specified cylinder by the certain way, defined through theState parameter.
4815 theShape Shape to find sub-shapes of.
4816 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4817 theAxis Vector (or line, or linear edge), specifying
4818 axis of the cylinder to find shapes on.
4819 theRadius Radius of the cylinder to find shapes on.
4820 theState The state of the sub-shapes to find (see GEOM::shape_state)
4823 List of all found sub-shapes indices.
4825 # Example: see GEOM_TestOthers.py
4826 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4827 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4830 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4831 # the specified sphere by the certain way, defined through \a theState parameter.
4832 # @param theShape Shape to find sub-shapes of.
4833 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4834 # @param theCenter Point, specifying center of the sphere to find shapes on.
4835 # @param theRadius Radius of the sphere to find shapes on.
4836 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4837 # @param theName Object name; when specified, this parameter is used
4838 # for result publication in the study. Otherwise, if automatic
4839 # publication is switched on, default value is used for result name.
4841 # @return List of all found sub-shapes.
4843 # @ref swig_GetShapesOnSphere "Example"
4844 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4846 Find in theShape all sub-shapes of type theShapeType, situated relatively
4847 the specified sphere by the certain way, defined through theState parameter.
4850 theShape Shape to find sub-shapes of.
4851 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4852 theCenter Point, specifying center of the sphere to find shapes on.
4853 theRadius Radius of the sphere to find shapes on.
4854 theState The state of the sub-shapes to find (see GEOM::shape_state)
4855 theName Object name; when specified, this parameter is used
4856 for result publication in the study. Otherwise, if automatic
4857 publication is switched on, default value is used for result name.
4860 List of all found sub-shapes.
4862 # Example: see GEOM_TestOthers.py
4863 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4864 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4865 self._autoPublish(aList, theName, "shapeOnSphere")
4868 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4869 # the specified sphere by the certain way, defined through \a theState parameter.
4870 # @param theShape Shape to find sub-shapes of.
4871 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4872 # @param theCenter Point, specifying center of the sphere to find shapes on.
4873 # @param theRadius Radius of the sphere to find shapes on.
4874 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4876 # @return List of all found sub-shapes indices.
4878 # @ref swig_GetShapesOnSphereIDs "Example"
4879 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4881 Find in theShape all sub-shapes of type theShapeType, situated relatively
4882 the specified sphere by the certain way, defined through theState parameter.
4885 theShape Shape to find sub-shapes of.
4886 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4887 theCenter Point, specifying center of the sphere to find shapes on.
4888 theRadius Radius of the sphere to find shapes on.
4889 theState The state of the sub-shapes to find (see GEOM::shape_state)
4892 List of all found sub-shapes indices.
4894 # Example: see GEOM_TestOthers.py
4895 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4896 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4899 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4900 # the specified quadrangle by the certain way, defined through \a theState parameter.
4901 # @param theShape Shape to find sub-shapes of.
4902 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4903 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4904 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4905 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4906 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4907 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4908 # @param theName Object name; when specified, this parameter is used
4909 # for result publication in the study. Otherwise, if automatic
4910 # publication is switched on, default value is used for result name.
4912 # @return List of all found sub-shapes.
4914 # @ref swig_GetShapesOnQuadrangle "Example"
4915 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4916 theTopLeftPoint, theTopRigthPoint,
4917 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4919 Find in theShape all sub-shapes of type theShapeType, situated relatively
4920 the specified quadrangle by the certain way, defined through theState parameter.
4923 theShape Shape to find sub-shapes of.
4924 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4925 theTopLeftPoint Point, specifying top left corner of a quadrangle
4926 theTopRigthPoint Point, specifying top right corner of a quadrangle
4927 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4928 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4929 theState The state of the sub-shapes to find (see GEOM::shape_state)
4930 theName Object name; when specified, this parameter is used
4931 for result publication in the study. Otherwise, if automatic
4932 publication is switched on, default value is used for result name.
4935 List of all found sub-shapes.
4937 # Example: see GEOM_TestOthers.py
4938 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4939 theTopLeftPoint, theTopRigthPoint,
4940 theBottomLeftPoint, theBottomRigthPoint, theState)
4941 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4942 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4945 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4946 # the specified quadrangle by the certain way, defined through \a theState parameter.
4947 # @param theShape Shape to find sub-shapes of.
4948 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4949 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4950 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4951 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4952 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4953 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4955 # @return List of all found sub-shapes indices.
4957 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4958 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4959 theTopLeftPoint, theTopRigthPoint,
4960 theBottomLeftPoint, theBottomRigthPoint, theState):
4962 Find in theShape all sub-shapes of type theShapeType, situated relatively
4963 the specified quadrangle by the certain way, defined through theState parameter.
4966 theShape Shape to find sub-shapes of.
4967 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4968 theTopLeftPoint Point, specifying top left corner of a quadrangle
4969 theTopRigthPoint Point, specifying top right corner of a quadrangle
4970 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4971 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4972 theState The state of the sub-shapes to find (see GEOM::shape_state)
4975 List of all found sub-shapes indices.
4978 # Example: see GEOM_TestOthers.py
4979 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4980 theTopLeftPoint, theTopRigthPoint,
4981 theBottomLeftPoint, theBottomRigthPoint, theState)
4982 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4985 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4986 # the specified \a theBox by the certain way, defined through \a theState parameter.
4987 # @param theBox Shape for relative comparing.
4988 # @param theShape Shape to find sub-shapes of.
4989 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4990 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4991 # @param theName Object name; when specified, this parameter is used
4992 # for result publication in the study. Otherwise, if automatic
4993 # publication is switched on, default value is used for result name.
4995 # @return List of all found sub-shapes.
4997 # @ref swig_GetShapesOnBox "Example"
4998 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5000 Find in theShape all sub-shapes of type theShapeType, situated relatively
5001 the specified theBox by the certain way, defined through theState parameter.
5004 theBox Shape for relative comparing.
5005 theShape Shape to find sub-shapes of.
5006 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5007 theState The state of the sub-shapes to find (see GEOM::shape_state)
5008 theName Object name; when specified, this parameter is used
5009 for result publication in the study. Otherwise, if automatic
5010 publication is switched on, default value is used for result name.
5013 List of all found sub-shapes.
5015 # Example: see GEOM_TestOthers.py
5016 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5017 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5018 self._autoPublish(aList, theName, "shapeOnBox")
5021 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5022 # the specified \a theBox by the certain way, defined through \a theState parameter.
5023 # @param theBox Shape for relative comparing.
5024 # @param theShape Shape to find sub-shapes of.
5025 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5026 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5028 # @return List of all found sub-shapes indices.
5030 # @ref swig_GetShapesOnBoxIDs "Example"
5031 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5033 Find in theShape all sub-shapes of type theShapeType, situated relatively
5034 the specified theBox by the certain way, defined through theState parameter.
5037 theBox Shape for relative comparing.
5038 theShape Shape to find sub-shapes of.
5039 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5040 theState The state of the sub-shapes to find (see GEOM::shape_state)
5043 List of all found sub-shapes indices.
5045 # Example: see GEOM_TestOthers.py
5046 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5047 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5050 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5051 # situated relatively the specified \a theCheckShape by the
5052 # certain way, defined through \a theState parameter.
5053 # @param theCheckShape Shape for relative comparing. It must be a solid.
5054 # @param theShape Shape to find sub-shapes of.
5055 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5056 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5057 # @param theName Object name; when specified, this parameter is used
5058 # for result publication in the study. Otherwise, if automatic
5059 # publication is switched on, default value is used for result name.
5061 # @return List of all found sub-shapes.
5063 # @ref swig_GetShapesOnShape "Example"
5064 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5066 Find in theShape all sub-shapes of type theShapeType,
5067 situated relatively the specified theCheckShape by the
5068 certain way, defined through theState parameter.
5071 theCheckShape Shape for relative comparing. It must be a solid.
5072 theShape Shape to find sub-shapes of.
5073 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5074 theState The state of the sub-shapes to find (see GEOM::shape_state)
5075 theName Object name; when specified, this parameter is used
5076 for result publication in the study. Otherwise, if automatic
5077 publication is switched on, default value is used for result name.
5080 List of all found sub-shapes.
5082 # Example: see GEOM_TestOthers.py
5083 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5084 theShapeType, theState)
5085 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5086 self._autoPublish(aList, theName, "shapeOnShape")
5089 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5090 # situated relatively the specified \a theCheckShape by the
5091 # certain way, defined through \a theState parameter.
5092 # @param theCheckShape Shape for relative comparing. It must be a solid.
5093 # @param theShape Shape to find sub-shapes of.
5094 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5095 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5096 # @param theName Object name; when specified, this parameter is used
5097 # for result publication in the study. Otherwise, if automatic
5098 # publication is switched on, default value is used for result name.
5100 # @return All found sub-shapes as compound.
5102 # @ref swig_GetShapesOnShapeAsCompound "Example"
5103 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5105 Find in theShape all sub-shapes of type theShapeType,
5106 situated relatively the specified theCheckShape by the
5107 certain way, defined through theState parameter.
5110 theCheckShape Shape for relative comparing. It must be a solid.
5111 theShape Shape to find sub-shapes of.
5112 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5113 theState The state of the sub-shapes to find (see GEOM::shape_state)
5114 theName Object name; when specified, this parameter is used
5115 for result publication in the study. Otherwise, if automatic
5116 publication is switched on, default value is used for result name.
5119 All found sub-shapes as compound.
5121 # Example: see GEOM_TestOthers.py
5122 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5123 theShapeType, theState)
5124 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5125 self._autoPublish(anObj, theName, "shapeOnShape")
5128 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5129 # situated relatively the specified \a theCheckShape by the
5130 # certain way, defined through \a theState parameter.
5131 # @param theCheckShape Shape for relative comparing. It must be a solid.
5132 # @param theShape Shape to find sub-shapes of.
5133 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5134 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5136 # @return List of all found sub-shapes indices.
5138 # @ref swig_GetShapesOnShapeIDs "Example"
5139 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5141 Find in theShape all sub-shapes of type theShapeType,
5142 situated relatively the specified theCheckShape by the
5143 certain way, defined through theState parameter.
5146 theCheckShape Shape for relative comparing. It must be a solid.
5147 theShape Shape to find sub-shapes of.
5148 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5149 theState The state of the sub-shapes to find (see GEOM::shape_state)
5152 List of all found sub-shapes indices.
5154 # Example: see GEOM_TestOthers.py
5155 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5156 theShapeType, theState)
5157 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5160 ## Get sub-shape(s) of theShapeWhere, which are
5161 # coincident with \a theShapeWhat or could be a part of it.
5162 # @param theShapeWhere Shape to find sub-shapes of.
5163 # @param theShapeWhat Shape, specifying what to find.
5164 # @param isNewImplementation implementation of GetInPlace functionality
5165 # (default = False, old alghorithm based on shape properties)
5166 # @param theName Object name; when specified, this parameter is used
5167 # for result publication in the study. Otherwise, if automatic
5168 # publication is switched on, default value is used for result name.
5170 # @return Group of all found sub-shapes or a single found sub-shape.
5172 # @note This function has a restriction on argument shapes.
5173 # If \a theShapeWhere has curved parts with significantly
5174 # outstanding centres (i.e. the mass centre of a part is closer to
5175 # \a theShapeWhat than to the part), such parts will not be found.
5176 # @image html get_in_place_lost_part.png
5178 # @ref swig_GetInPlace "Example"
5179 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5181 Get sub-shape(s) of theShapeWhere, which are
5182 coincident with theShapeWhat or could be a part of it.
5185 theShapeWhere Shape to find sub-shapes of.
5186 theShapeWhat Shape, specifying what to find.
5187 isNewImplementation Implementation of GetInPlace functionality
5188 (default = False, old alghorithm based on shape properties)
5189 theName Object name; when specified, this parameter is used
5190 for result publication in the study. Otherwise, if automatic
5191 publication is switched on, default value is used for result name.
5194 Group of all found sub-shapes or a single found sub-shape.
5198 This function has a restriction on argument shapes.
5199 If theShapeWhere has curved parts with significantly
5200 outstanding centres (i.e. the mass centre of a part is closer to
5201 theShapeWhat than to the part), such parts will not be found.
5203 # Example: see GEOM_TestOthers.py
5205 if isNewImplementation:
5206 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5208 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5210 RaiseIfFailed("GetInPlace", self.ShapesOp)
5211 self._autoPublish(anObj, theName, "inplace")
5214 ## Get sub-shape(s) of \a theShapeWhere, which are
5215 # coincident with \a theShapeWhat or could be a part of it.
5217 # Implementation of this method is based on a saved history of an operation,
5218 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5219 # arguments (an argument shape or a sub-shape of an argument shape).
5220 # The operation could be the Partition or one of boolean operations,
5221 # performed on simple shapes (not on compounds).
5223 # @param theShapeWhere Shape to find sub-shapes of.
5224 # @param theShapeWhat Shape, specifying what to find (must be in the
5225 # building history of the ShapeWhere).
5226 # @param theName Object name; when specified, this parameter is used
5227 # for result publication in the study. Otherwise, if automatic
5228 # publication is switched on, default value is used for result name.
5230 # @return Group of all found sub-shapes or a single found sub-shape.
5232 # @ref swig_GetInPlace "Example"
5233 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5235 Implementation of this method is based on a saved history of an operation,
5236 produced theShapeWhere. The theShapeWhat must be among this operation's
5237 arguments (an argument shape or a sub-shape of an argument shape).
5238 The operation could be the Partition or one of boolean operations,
5239 performed on simple shapes (not on compounds).
5242 theShapeWhere Shape to find sub-shapes of.
5243 theShapeWhat Shape, specifying what to find (must be in the
5244 building history of the ShapeWhere).
5245 theName Object name; when specified, this parameter is used
5246 for result publication in the study. Otherwise, if automatic
5247 publication is switched on, default value is used for result name.
5250 Group of all found sub-shapes or a single found sub-shape.
5252 # Example: see GEOM_TestOthers.py
5253 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5254 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5255 self._autoPublish(anObj, theName, "inplace")
5258 ## Get sub-shape of theShapeWhere, which is
5259 # equal to \a theShapeWhat.
5260 # @param theShapeWhere Shape to find sub-shape of.
5261 # @param theShapeWhat Shape, specifying what to find.
5262 # @param theName Object name; when specified, this parameter is used
5263 # for result publication in the study. Otherwise, if automatic
5264 # publication is switched on, default value is used for result name.
5266 # @return New GEOM.GEOM_Object for found sub-shape.
5268 # @ref swig_GetSame "Example"
5269 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5271 Get sub-shape of theShapeWhere, which is
5272 equal to theShapeWhat.
5275 theShapeWhere Shape to find sub-shape of.
5276 theShapeWhat Shape, specifying what to find.
5277 theName Object name; when specified, this parameter is used
5278 for result publication in the study. Otherwise, if automatic
5279 publication is switched on, default value is used for result name.
5282 New GEOM.GEOM_Object for found sub-shape.
5284 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5285 RaiseIfFailed("GetSame", self.ShapesOp)
5286 self._autoPublish(anObj, theName, "sameShape")
5290 ## Get sub-shape indices of theShapeWhere, which is
5291 # equal to \a theShapeWhat.
5292 # @param theShapeWhere Shape to find sub-shape of.
5293 # @param theShapeWhat Shape, specifying what to find.
5294 # @return List of all found sub-shapes indices.
5296 # @ref swig_GetSame "Example"
5297 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5299 Get sub-shape indices of theShapeWhere, which is
5300 equal to theShapeWhat.
5303 theShapeWhere Shape to find sub-shape of.
5304 theShapeWhat Shape, specifying what to find.
5307 List of all found sub-shapes indices.
5309 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5310 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5317 ## @addtogroup l4_access
5320 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5321 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5322 # @param aShape Shape to get sub-shape of.
5323 # @param ListOfID List of sub-shapes indices.
5324 # @param theName Object name; when specified, this parameter is used
5325 # for result publication in the study. Otherwise, if automatic
5326 # publication is switched on, default value is used for result name.
5328 # @return Found sub-shape.
5330 # @ref swig_all_decompose "Example"
5331 def GetSubShape(self, aShape, ListOfID, theName=None):
5333 Obtain a composite sub-shape of aShape, composed from sub-shapes
5334 of aShape, selected by their unique IDs inside aShape
5337 aShape Shape to get sub-shape of.
5338 ListOfID List of sub-shapes indices.
5339 theName Object name; when specified, this parameter is used
5340 for result publication in the study. Otherwise, if automatic
5341 publication is switched on, default value is used for result name.
5346 # Example: see GEOM_TestAll.py
5347 anObj = self.AddSubShape(aShape,ListOfID)
5348 self._autoPublish(anObj, theName, "subshape")
5351 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5352 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5353 # @param aShape Shape to get sub-shape of.
5354 # @param aSubShape Sub-shapes of aShape.
5355 # @return ID of found sub-shape.
5357 # @ref swig_all_decompose "Example"
5358 def GetSubShapeID(self, aShape, aSubShape):
5360 Obtain unique ID of sub-shape aSubShape inside aShape
5361 of aShape, selected by their unique IDs inside aShape
5364 aShape Shape to get sub-shape of.
5365 aSubShape Sub-shapes of aShape.
5368 ID of found sub-shape.
5370 # Example: see GEOM_TestAll.py
5371 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5372 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5375 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5376 # This function is provided for performance purpose. The complexity is O(n) with n
5377 # the number of subobjects of aShape
5378 # @param aShape Shape to get sub-shape of.
5379 # @param aSubShapes Sub-shapes of aShape.
5380 # @return list of IDs of found sub-shapes.
5382 # @ref swig_all_decompose "Example"
5383 def GetSubShapesIDs(self, aShape, aSubShapes):
5385 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5386 This function is provided for performance purpose. The complexity is O(n) with n
5387 the number of subobjects of aShape
5390 aShape Shape to get sub-shape of.
5391 aSubShapes Sub-shapes of aShape.
5394 List of IDs of found sub-shape.
5396 # Example: see GEOM_TestAll.py
5397 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5398 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5404 ## @addtogroup l4_decompose
5407 ## Get all sub-shapes and groups of \a theShape,
5408 # that were created already by any other methods.
5409 # @param theShape Any shape.
5410 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5411 # returned, else all found sub-shapes and groups.
5412 # @return List of existing sub-objects of \a theShape.
5414 # @ref swig_all_decompose "Example"
5415 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5417 Get all sub-shapes and groups of theShape,
5418 that were created already by any other methods.
5422 theGroupsOnly If this parameter is TRUE, only groups will be
5423 returned, else all found sub-shapes and groups.
5426 List of existing sub-objects of theShape.
5428 # Example: see GEOM_TestAll.py
5429 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5430 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5433 ## Get all groups of \a theShape,
5434 # that were created already by any other methods.
5435 # @param theShape Any shape.
5436 # @return List of existing groups of \a theShape.
5438 # @ref swig_all_decompose "Example"
5439 def GetGroups(self, theShape):
5441 Get all groups of theShape,
5442 that were created already by any other methods.
5448 List of existing groups of theShape.
5450 # Example: see GEOM_TestAll.py
5451 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5452 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5455 ## Explode a shape on sub-shapes of a given type.
5456 # If the shape itself matches the type, it is also returned.
5457 # @param aShape Shape to be exploded.
5458 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5459 # @param theName Object name; when specified, this parameter is used
5460 # for result publication in the study. Otherwise, if automatic
5461 # publication is switched on, default value is used for result name.
5463 # @return List of sub-shapes of type theShapeType, contained in theShape.
5465 # @ref swig_all_decompose "Example"
5466 def SubShapeAll(self, aShape, aType, theName=None):
5468 Explode a shape on sub-shapes of a given type.
5469 If the shape itself matches the type, it is also returned.
5472 aShape Shape to be exploded.
5473 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5474 theName Object name; when specified, this parameter is used
5475 for result publication in the study. Otherwise, if automatic
5476 publication is switched on, default value is used for result name.
5479 List of sub-shapes of type theShapeType, contained in theShape.
5481 # Example: see GEOM_TestAll.py
5482 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5483 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5484 self._autoPublish(ListObj, theName, "subshape")
5487 ## Explode a shape on sub-shapes of a given type.
5488 # @param aShape Shape to be exploded.
5489 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5490 # @return List of IDs of sub-shapes.
5492 # @ref swig_all_decompose "Example"
5493 def SubShapeAllIDs(self, aShape, aType):
5495 Explode a shape on sub-shapes of a given type.
5498 aShape Shape to be exploded (see geompy.ShapeType)
5499 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5502 List of IDs of sub-shapes.
5504 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5505 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5508 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5509 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5510 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5511 # @param aShape Shape to get sub-shape of.
5512 # @param ListOfInd List of sub-shapes indices.
5513 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5514 # @param theName Object name; when specified, this parameter is used
5515 # for result publication in the study. Otherwise, if automatic
5516 # publication is switched on, default value is used for result name.
5518 # @return A compound of sub-shapes of aShape.
5520 # @ref swig_all_decompose "Example"
5521 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5523 Obtain a compound of sub-shapes of aShape,
5524 selected by their indices in list of all sub-shapes of type aType.
5525 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5528 aShape Shape to get sub-shape of.
5529 ListOfID List of sub-shapes indices.
5530 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5531 theName Object name; when specified, this parameter is used
5532 for result publication in the study. Otherwise, if automatic
5533 publication is switched on, default value is used for result name.
5536 A compound of sub-shapes of aShape.
5538 # Example: see GEOM_TestAll.py
5540 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5541 for ind in ListOfInd:
5542 ListOfIDs.append(AllShapeIDsList[ind - 1])
5543 # note: auto-publishing is done in self.GetSubShape()
5544 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5547 ## Explode a shape on sub-shapes of a given type.
5548 # Sub-shapes will be sorted by coordinates of their gravity centers.
5549 # If the shape itself matches the type, it is also returned.
5550 # @param aShape Shape to be exploded.
5551 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5552 # @param theName Object name; when specified, this parameter is used
5553 # for result publication in the study. Otherwise, if automatic
5554 # publication is switched on, default value is used for result name.
5556 # @return List of sub-shapes of type theShapeType, contained in theShape.
5558 # @ref swig_SubShapeAllSorted "Example"
5559 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5561 Explode a shape on sub-shapes of a given type.
5562 Sub-shapes will be sorted by coordinates of their gravity centers.
5563 If the shape itself matches the type, it is also returned.
5566 aShape Shape to be exploded.
5567 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5568 theName Object name; when specified, this parameter is used
5569 for result publication in the study. Otherwise, if automatic
5570 publication is switched on, default value is used for result name.
5573 List of sub-shapes of type theShapeType, contained in theShape.
5575 # Example: see GEOM_TestAll.py
5576 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5577 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5578 self._autoPublish(ListObj, theName, "subshape")
5581 ## Explode a shape on sub-shapes of a given type.
5582 # Sub-shapes will be sorted by coordinates of their gravity centers.
5583 # @param aShape Shape to be exploded.
5584 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5585 # @return List of IDs of sub-shapes.
5587 # @ref swig_all_decompose "Example"
5588 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5590 Explode a shape on sub-shapes of a given type.
5591 Sub-shapes will be sorted by coordinates of their gravity centers.
5594 aShape Shape to be exploded.
5595 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5598 List of IDs of sub-shapes.
5600 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5601 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5604 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5605 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5606 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5607 # @param aShape Shape to get sub-shape of.
5608 # @param ListOfInd List of sub-shapes indices.
5609 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5610 # @param theName Object name; when specified, this parameter is used
5611 # for result publication in the study. Otherwise, if automatic
5612 # publication is switched on, default value is used for result name.
5614 # @return A compound of sub-shapes of aShape.
5616 # @ref swig_all_decompose "Example"
5617 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5619 Obtain a compound of sub-shapes of aShape,
5620 selected by they indices in sorted list of all sub-shapes of type aType.
5621 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5624 aShape Shape to get sub-shape of.
5625 ListOfID List of sub-shapes indices.
5626 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5627 theName Object name; when specified, this parameter is used
5628 for result publication in the study. Otherwise, if automatic
5629 publication is switched on, default value is used for result name.
5632 A compound of sub-shapes of aShape.
5634 # Example: see GEOM_TestAll.py
5636 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5637 for ind in ListOfInd:
5638 ListOfIDs.append(AllShapeIDsList[ind - 1])
5639 # note: auto-publishing is done in self.GetSubShape()
5640 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5643 ## Extract shapes (excluding the main shape) of given type.
5644 # @param aShape The shape.
5645 # @param aType The shape type (see ShapeType())
5646 # @param isSorted Boolean flag to switch sorting on/off.
5647 # @param theName Object name; when specified, this parameter is used
5648 # for result publication in the study. Otherwise, if automatic
5649 # publication is switched on, default value is used for result name.
5651 # @return List of sub-shapes of type aType, contained in aShape.
5653 # @ref swig_FilletChamfer "Example"
5654 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5656 Extract shapes (excluding the main shape) of given type.
5660 aType The shape type (see geompy.ShapeType)
5661 isSorted Boolean flag to switch sorting on/off.
5662 theName Object name; when specified, this parameter is used
5663 for result publication in the study. Otherwise, if automatic
5664 publication is switched on, default value is used for result name.
5667 List of sub-shapes of type aType, contained in aShape.
5669 # Example: see GEOM_TestAll.py
5670 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5671 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5672 self._autoPublish(ListObj, theName, "subshape")
5675 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5676 # @param aShape Main shape.
5677 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5678 # @param theName Object name; when specified, this parameter is used
5679 # for result publication in the study. Otherwise, if automatic
5680 # publication is switched on, default value is used for result name.
5681 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5683 # @ref swig_all_decompose "Example"
5684 def SubShapes(self, aShape, anIDs, theName=None):
5686 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5690 anIDs List of unique IDs of sub-shapes inside theMainShape.
5691 theName Object name; when specified, this parameter is used
5692 for result publication in the study. Otherwise, if automatic
5693 publication is switched on, default value is used for result name.
5696 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5698 # Example: see GEOM_TestAll.py
5699 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5700 RaiseIfFailed("SubShapes", self.ShapesOp)
5701 self._autoPublish(ListObj, theName, "subshape")
5704 # end of l4_decompose
5707 ## @addtogroup l4_decompose_d
5710 ## Deprecated method
5711 # It works like SubShapeAllSortedCentres(), but wrongly
5712 # defines centres of faces, shells and solids.
5713 def SubShapeAllSorted(self, aShape, aType, theName=None):
5716 It works like geompy.SubShapeAllSortedCentres, but wrongly
5717 defines centres of faces, shells and solids.
5719 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5720 RaiseIfFailed("MakeExplode", self.ShapesOp)
5721 self._autoPublish(ListObj, theName, "subshape")
5724 ## Deprecated method
5725 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5726 # defines centres of faces, shells and solids.
5727 def SubShapeAllSortedIDs(self, aShape, aType):
5730 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5731 defines centres of faces, shells and solids.
5733 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5734 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5737 ## Deprecated method
5738 # It works like SubShapeSortedCentres(), but has a bug
5739 # (wrongly defines centres of faces, shells and solids).
5740 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5743 It works like geompy.SubShapeSortedCentres, but has a bug
5744 (wrongly defines centres of faces, shells and solids).
5747 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5748 for ind in ListOfInd:
5749 ListOfIDs.append(AllShapeIDsList[ind - 1])
5750 # note: auto-publishing is done in self.GetSubShape()
5751 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5754 # end of l4_decompose_d
5757 ## @addtogroup l3_healing
5760 ## Apply a sequence of Shape Healing operators to the given object.
5761 # @param theShape Shape to be processed.
5762 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5763 # @param theParameters List of names of parameters
5764 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5765 # @param theValues List of values of parameters, in the same order
5766 # as parameters are listed in <VAR>theParameters</VAR> list.
5767 # @param theName Object name; when specified, this parameter is used
5768 # for result publication in the study. Otherwise, if automatic
5769 # publication is switched on, default value is used for result name.
5771 # <b> Operators and Parameters: </b> \n
5773 # * \b FixShape - corrects invalid shapes. \n
5774 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5775 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5777 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5778 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5779 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5780 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5782 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5783 # surfaces in segments using a certain angle. \n
5784 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5785 # if Angle=180, four if Angle=90, etc). \n
5786 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5788 # * \b SplitClosedFaces - splits closed faces in segments.
5789 # The number of segments depends on the number of splitting points.\n
5790 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5792 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5793 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5794 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5795 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5796 # This and the previous parameters can take the following values:\n
5797 # \b Parametric \b Continuity \n
5798 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5799 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5800 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5801 # ruling out sharp edges).\n
5802 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5803 # are of the same magnitude).\n
5804 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5805 # or surfaces (d/du C(u)) are the same at junction. \n
5806 # \b Geometric \b Continuity \n
5807 # \b G1: first derivatives are proportional at junction.\n
5808 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5809 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5810 # \b G2: first and second derivatives are proportional at junction.
5811 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5812 # continuity requires that the underlying parameterization was continuous as well.
5813 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5815 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5816 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5817 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5818 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5819 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5820 # with the specified parameters.\n
5821 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5822 # with the specified parameters.\n
5823 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5824 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5825 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5826 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5828 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5829 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5830 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5831 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5832 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5834 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5835 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5838 # @return New GEOM.GEOM_Object, containing processed shape.
5840 # \n @ref tui_shape_processing "Example"
5841 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5843 Apply a sequence of Shape Healing operators to the given object.
5846 theShape Shape to be processed.
5847 theValues List of values of parameters, in the same order
5848 as parameters are listed in theParameters list.
5849 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5850 theParameters List of names of parameters
5851 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5852 theName Object name; when specified, this parameter is used
5853 for result publication in the study. Otherwise, if automatic
5854 publication is switched on, default value is used for result name.
5856 Operators and Parameters:
5858 * FixShape - corrects invalid shapes.
5859 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5860 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5861 * FixFaceSize - removes small faces, such as spots and strips.
5862 * FixFaceSize.Tolerance - defines minimum possible face size.
5863 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5864 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5865 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5866 in segments using a certain angle.
5867 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5868 if Angle=180, four if Angle=90, etc).
5869 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5870 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5872 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5873 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5874 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5875 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5876 * SplitContinuity.CurveContinuity - required continuity for curves.
5877 This and the previous parameters can take the following values:
5879 Parametric Continuity:
5880 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5881 coincidental. The curves or surfaces may still meet at an angle,
5882 giving rise to a sharp corner or edge).
5883 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5884 are parallel, ruling out sharp edges).
5885 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5886 or surfaces are of the same magnitude).
5887 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5888 curves or surfaces (d/du C(u)) are the same at junction.
5890 Geometric Continuity:
5891 G1: first derivatives are proportional at junction.
5892 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5893 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5894 G2: first and second derivatives are proportional at junction. As the names imply,
5895 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5896 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5897 geometric continuity of order n, but not vice-versa.
5898 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5899 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5900 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5901 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5902 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5903 the specified parameters.
5904 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5905 the specified parameters.
5906 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5907 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5908 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5909 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5910 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5911 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5912 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5913 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5914 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5915 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5916 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5919 New GEOM.GEOM_Object, containing processed shape.
5921 Note: For more information look through SALOME Geometry User's Guide->
5922 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5924 # Example: see GEOM_TestHealing.py
5925 theValues,Parameters = ParseList(theValues)
5926 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5927 # To avoid script failure in case of good argument shape
5928 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5930 RaiseIfFailed("ProcessShape", self.HealOp)
5931 for string in (theOperators + theParameters):
5932 Parameters = ":" + Parameters
5934 anObj.SetParameters(Parameters)
5935 self._autoPublish(anObj, theName, "healed")
5938 ## Remove faces from the given object (shape).
5939 # @param theObject Shape to be processed.
5940 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5941 # removes ALL faces of the given object.
5942 # @param theName Object name; when specified, this parameter is used
5943 # for result publication in the study. Otherwise, if automatic
5944 # publication is switched on, default value is used for result name.
5946 # @return New GEOM.GEOM_Object, containing processed shape.
5948 # @ref tui_suppress_faces "Example"
5949 def SuppressFaces(self, theObject, theFaces, theName=None):
5951 Remove faces from the given object (shape).
5954 theObject Shape to be processed.
5955 theFaces Indices of faces to be removed, if EMPTY then the method
5956 removes ALL faces of the given object.
5957 theName Object name; when specified, this parameter is used
5958 for result publication in the study. Otherwise, if automatic
5959 publication is switched on, default value is used for result name.
5962 New GEOM.GEOM_Object, containing processed shape.
5964 # Example: see GEOM_TestHealing.py
5965 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5966 RaiseIfFailed("SuppressFaces", self.HealOp)
5967 self._autoPublish(anObj, theName, "suppressFaces")
5970 ## Sewing of some shapes into single shape.
5971 # @param ListShape Shapes to be processed.
5972 # @param theTolerance Required tolerance value.
5973 # @param AllowNonManifold Flag that allows non-manifold sewing.
5974 # @param theName Object name; when specified, this parameter is used
5975 # for result publication in the study. Otherwise, if automatic
5976 # publication is switched on, default value is used for result name.
5978 # @return New GEOM.GEOM_Object, containing processed shape.
5980 # @ref tui_sewing "Example"
5981 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5983 Sewing of some shapes into single shape.
5986 ListShape Shapes to be processed.
5987 theTolerance Required tolerance value.
5988 AllowNonManifold Flag that allows non-manifold sewing.
5989 theName Object name; when specified, this parameter is used
5990 for result publication in the study. Otherwise, if automatic
5991 publication is switched on, default value is used for result name.
5994 New GEOM.GEOM_Object, containing processed shape.
5996 # Example: see GEOM_TestHealing.py
5997 comp = self.MakeCompound(ListShape)
5998 # note: auto-publishing is done in self.Sew()
5999 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6002 ## Sewing of the given object.
6003 # @param theObject Shape to be processed.
6004 # @param theTolerance Required tolerance value.
6005 # @param AllowNonManifold Flag that allows non-manifold sewing.
6006 # @param theName Object name; when specified, this parameter is used
6007 # for result publication in the study. Otherwise, if automatic
6008 # publication is switched on, default value is used for result name.
6010 # @return New GEOM.GEOM_Object, containing processed shape.
6011 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6013 Sewing of the given object.
6016 theObject Shape to be processed.
6017 theTolerance Required tolerance value.
6018 AllowNonManifold Flag that allows non-manifold sewing.
6019 theName Object name; when specified, this parameter is used
6020 for result publication in the study. Otherwise, if automatic
6021 publication is switched on, default value is used for result name.
6024 New GEOM.GEOM_Object, containing processed shape.
6026 # Example: see MakeSewing() above
6027 theTolerance,Parameters = ParseParameters(theTolerance)
6028 if AllowNonManifold:
6029 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6031 anObj = self.HealOp.Sew(theObject, theTolerance)
6032 # To avoid script failure in case of good argument shape
6033 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6035 RaiseIfFailed("Sew", self.HealOp)
6036 anObj.SetParameters(Parameters)
6037 self._autoPublish(anObj, theName, "sewed")
6040 ## Rebuild the topology of theCompound of solids by removing
6041 # of the faces that are shared by several solids.
6042 # @param theCompound Shape to be processed.
6043 # @param theName Object name; when specified, this parameter is used
6044 # for result publication in the study. Otherwise, if automatic
6045 # publication is switched on, default value is used for result name.
6047 # @return New GEOM.GEOM_Object, containing processed shape.
6049 # @ref tui_remove_webs "Example"
6050 def RemoveInternalFaces (self, theCompound, theName=None):
6052 Rebuild the topology of theCompound of solids by removing
6053 of the faces that are shared by several solids.
6056 theCompound Shape to be processed.
6057 theName Object name; when specified, this parameter is used
6058 for result publication in the study. Otherwise, if automatic
6059 publication is switched on, default value is used for result name.
6062 New GEOM.GEOM_Object, containing processed shape.
6064 # Example: see GEOM_TestHealing.py
6065 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6066 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6067 self._autoPublish(anObj, theName, "removeWebs")
6070 ## Remove internal wires and edges from the given object (face).
6071 # @param theObject Shape to be processed.
6072 # @param theWires Indices of wires to be removed, if EMPTY then the method
6073 # removes ALL internal wires of the given object.
6074 # @param theName Object name; when specified, this parameter is used
6075 # for result publication in the study. Otherwise, if automatic
6076 # publication is switched on, default value is used for result name.
6078 # @return New GEOM.GEOM_Object, containing processed shape.
6080 # @ref tui_suppress_internal_wires "Example"
6081 def SuppressInternalWires(self, theObject, theWires, theName=None):
6083 Remove internal wires and edges from the given object (face).
6086 theObject Shape to be processed.
6087 theWires Indices of wires to be removed, if EMPTY then the method
6088 removes ALL internal wires of the given object.
6089 theName Object name; when specified, this parameter is used
6090 for result publication in the study. Otherwise, if automatic
6091 publication is switched on, default value is used for result name.
6094 New GEOM.GEOM_Object, containing processed shape.
6096 # Example: see GEOM_TestHealing.py
6097 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6098 RaiseIfFailed("RemoveIntWires", self.HealOp)
6099 self._autoPublish(anObj, theName, "suppressWires")
6102 ## Remove internal closed contours (holes) from the given object.
6103 # @param theObject Shape to be processed.
6104 # @param theWires Indices of wires to be removed, if EMPTY then the method
6105 # removes ALL internal holes of the given object
6106 # @param theName Object name; when specified, this parameter is used
6107 # for result publication in the study. Otherwise, if automatic
6108 # publication is switched on, default value is used for result name.
6110 # @return New GEOM.GEOM_Object, containing processed shape.
6112 # @ref tui_suppress_holes "Example"
6113 def SuppressHoles(self, theObject, theWires, theName=None):
6115 Remove internal closed contours (holes) from the given object.
6118 theObject Shape to be processed.
6119 theWires Indices of wires to be removed, if EMPTY then the method
6120 removes ALL internal holes of the given object
6121 theName Object name; when specified, this parameter is used
6122 for result publication in the study. Otherwise, if automatic
6123 publication is switched on, default value is used for result name.
6126 New GEOM.GEOM_Object, containing processed shape.
6128 # Example: see GEOM_TestHealing.py
6129 anObj = self.HealOp.FillHoles(theObject, theWires)
6130 RaiseIfFailed("FillHoles", self.HealOp)
6131 self._autoPublish(anObj, theName, "suppressHoles")
6134 ## Close an open wire.
6135 # @param theObject Shape to be processed.
6136 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6137 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6138 # @param isCommonVertex If True : closure by creation of a common vertex,
6139 # If False : closure by creation of an edge between ends.
6140 # @param theName Object name; when specified, this parameter is used
6141 # for result publication in the study. Otherwise, if automatic
6142 # publication is switched on, default value is used for result name.
6144 # @return New GEOM.GEOM_Object, containing processed shape.
6146 # @ref tui_close_contour "Example"
6147 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6152 theObject Shape to be processed.
6153 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6154 if [ ], then theObject itself is a wire.
6155 isCommonVertex If True : closure by creation of a common vertex,
6156 If False : closure by creation of an edge between ends.
6157 theName Object name; when specified, this parameter is used
6158 for result publication in the study. Otherwise, if automatic
6159 publication is switched on, default value is used for result name.
6162 New GEOM.GEOM_Object, containing processed shape.
6164 # Example: see GEOM_TestHealing.py
6165 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6166 RaiseIfFailed("CloseContour", self.HealOp)
6167 self._autoPublish(anObj, theName, "closeContour")
6170 ## Addition of a point to a given edge object.
6171 # @param theObject Shape to be processed.
6172 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6173 # if -1, then theObject itself is the edge.
6174 # @param theValue Value of parameter on edge or length parameter,
6175 # depending on \a isByParameter.
6176 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6177 # if FALSE : \a theValue is treated as a length parameter [0..1]
6178 # @param theName Object name; when specified, this parameter is used
6179 # for result publication in the study. Otherwise, if automatic
6180 # publication is switched on, default value is used for result name.
6182 # @return New GEOM.GEOM_Object, containing processed shape.
6184 # @ref tui_add_point_on_edge "Example"
6185 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6187 Addition of a point to a given edge object.
6190 theObject Shape to be processed.
6191 theEdgeIndex Index of edge to be divided within theObject's shape,
6192 if -1, then theObject itself is the edge.
6193 theValue Value of parameter on edge or length parameter,
6194 depending on isByParameter.
6195 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6196 if FALSE : theValue is treated as a length parameter [0..1]
6197 theName Object name; when specified, this parameter is used
6198 for result publication in the study. Otherwise, if automatic
6199 publication is switched on, default value is used for result name.
6202 New GEOM.GEOM_Object, containing processed shape.
6204 # Example: see GEOM_TestHealing.py
6205 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6206 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6207 RaiseIfFailed("DivideEdge", self.HealOp)
6208 anObj.SetParameters(Parameters)
6209 self._autoPublish(anObj, theName, "divideEdge")
6212 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6213 # @param theWire Wire to minimize the number of C1 continuous edges in.
6214 # @param theVertices A list of vertices to suppress. If the list
6215 # is empty, all vertices in a wire will be assumed.
6216 # @param theName Object name; when specified, this parameter is used
6217 # for result publication in the study. Otherwise, if automatic
6218 # publication is switched on, default value is used for result name.
6220 # @return New GEOM.GEOM_Object with modified wire.
6222 # @ref tui_fuse_collinear_edges "Example"
6223 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6225 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6228 theWire Wire to minimize the number of C1 continuous edges in.
6229 theVertices A list of vertices to suppress. If the list
6230 is empty, all vertices in a wire will be assumed.
6231 theName Object name; when specified, this parameter is used
6232 for result publication in the study. Otherwise, if automatic
6233 publication is switched on, default value is used for result name.
6236 New GEOM.GEOM_Object with modified wire.
6238 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6239 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6240 self._autoPublish(anObj, theName, "fuseEdges")
6243 ## Change orientation of the given object. Updates given shape.
6244 # @param theObject Shape to be processed.
6245 # @return Updated <var>theObject</var>
6247 # @ref swig_todo "Example"
6248 def ChangeOrientationShell(self,theObject):
6250 Change orientation of the given object. Updates given shape.
6253 theObject Shape to be processed.
6258 theObject = self.HealOp.ChangeOrientation(theObject)
6259 RaiseIfFailed("ChangeOrientation", self.HealOp)
6262 ## Change orientation of the given object.
6263 # @param theObject Shape to be processed.
6264 # @param theName Object name; when specified, this parameter is used
6265 # for result publication in the study. Otherwise, if automatic
6266 # publication is switched on, default value is used for result name.
6268 # @return New GEOM.GEOM_Object, containing processed shape.
6270 # @ref swig_todo "Example"
6271 def ChangeOrientationShellCopy(self, theObject, theName=None):
6273 Change orientation of the given object.
6276 theObject Shape to be processed.
6277 theName Object name; when specified, this parameter is used
6278 for result publication in the study. Otherwise, if automatic
6279 publication is switched on, default value is used for result name.
6282 New GEOM.GEOM_Object, containing processed shape.
6284 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6285 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6286 self._autoPublish(anObj, theName, "reversed")
6289 ## Try to limit tolerance of the given object by value \a theTolerance.
6290 # @param theObject Shape to be processed.
6291 # @param theTolerance Required tolerance value.
6292 # @param theName Object name; when specified, this parameter is used
6293 # for result publication in the study. Otherwise, if automatic
6294 # publication is switched on, default value is used for result name.
6296 # @return New GEOM.GEOM_Object, containing processed shape.
6298 # @ref tui_limit_tolerance "Example"
6299 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6301 Try to limit tolerance of the given object by value theTolerance.
6304 theObject Shape to be processed.
6305 theTolerance Required tolerance value.
6306 theName Object name; when specified, this parameter is used
6307 for result publication in the study. Otherwise, if automatic
6308 publication is switched on, default value is used for result name.
6311 New GEOM.GEOM_Object, containing processed shape.
6313 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6314 RaiseIfFailed("LimitTolerance", self.HealOp)
6315 self._autoPublish(anObj, theName, "limitTolerance")
6318 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6319 # that constitute a free boundary of the given shape.
6320 # @param theObject Shape to get free boundary of.
6321 # @param theName Object name; when specified, this parameter is used
6322 # for result publication in the study. Otherwise, if automatic
6323 # publication is switched on, default value is used for result name.
6325 # @return [\a status, \a theClosedWires, \a theOpenWires]
6326 # \n \a status: FALSE, if an error(s) occured during the method execution.
6327 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6328 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6330 # @ref tui_measurement_tools_page "Example"
6331 def GetFreeBoundary(self, theObject, theName=None):
6333 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6334 that constitute a free boundary of the given shape.
6337 theObject Shape to get free boundary of.
6338 theName Object name; when specified, this parameter is used
6339 for result publication in the study. Otherwise, if automatic
6340 publication is switched on, default value is used for result name.
6343 [status, theClosedWires, theOpenWires]
6344 status: FALSE, if an error(s) occured during the method execution.
6345 theClosedWires: Closed wires on the free boundary of the given shape.
6346 theOpenWires: Open wires on the free boundary of the given shape.
6348 # Example: see GEOM_TestHealing.py
6349 anObj = self.HealOp.GetFreeBoundary(theObject)
6350 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6351 self._autoPublish(anObj[1], theName, "closedWire")
6352 self._autoPublish(anObj[2], theName, "openWire")
6355 ## Replace coincident faces in theShape by one face.
6356 # @param theShape Initial shape.
6357 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6358 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6359 # otherwise all initial shapes.
6360 # @param theName Object name; when specified, this parameter is used
6361 # for result publication in the study. Otherwise, if automatic
6362 # publication is switched on, default value is used for result name.
6364 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6366 # @ref tui_glue_faces "Example"
6367 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6369 Replace coincident faces in theShape by one face.
6372 theShape Initial shape.
6373 theTolerance Maximum distance between faces, which can be considered as coincident.
6374 doKeepNonSolids If FALSE, only solids will present in the result,
6375 otherwise all initial shapes.
6376 theName Object name; when specified, this parameter is used
6377 for result publication in the study. Otherwise, if automatic
6378 publication is switched on, default value is used for result name.
6381 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6383 # Example: see GEOM_Spanner.py
6384 theTolerance,Parameters = ParseParameters(theTolerance)
6385 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6387 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6388 anObj.SetParameters(Parameters)
6389 self._autoPublish(anObj, theName, "glueFaces")
6392 ## Find coincident faces in theShape for possible gluing.
6393 # @param theShape Initial shape.
6394 # @param theTolerance Maximum distance between faces,
6395 # which can be considered as coincident.
6396 # @param theName Object name; when specified, this parameter is used
6397 # for result publication in the study. Otherwise, if automatic
6398 # publication is switched on, default value is used for result name.
6400 # @return GEOM.ListOfGO
6402 # @ref tui_glue_faces "Example"
6403 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6405 Find coincident faces in theShape for possible gluing.
6408 theShape Initial shape.
6409 theTolerance Maximum distance between faces,
6410 which can be considered as coincident.
6411 theName Object name; when specified, this parameter is used
6412 for result publication in the study. Otherwise, if automatic
6413 publication is switched on, default value is used for result name.
6418 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6419 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6420 self._autoPublish(anObj, theName, "facesToGlue")
6423 ## Replace coincident faces in theShape by one face
6424 # in compliance with given list of faces
6425 # @param theShape Initial shape.
6426 # @param theTolerance Maximum distance between faces,
6427 # which can be considered as coincident.
6428 # @param theFaces List of faces for gluing.
6429 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6430 # otherwise all initial shapes.
6431 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6432 # will be glued, otherwise only the edges,
6433 # belonging to <VAR>theFaces</VAR>.
6434 # @param theName Object name; when specified, this parameter is used
6435 # for result publication in the study. Otherwise, if automatic
6436 # publication is switched on, default value is used for result name.
6438 # @return New GEOM.GEOM_Object, containing a copy of theShape
6439 # without some faces.
6441 # @ref tui_glue_faces "Example"
6442 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6443 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6445 Replace coincident faces in theShape by one face
6446 in compliance with given list of faces
6449 theShape Initial shape.
6450 theTolerance Maximum distance between faces,
6451 which can be considered as coincident.
6452 theFaces List of faces for gluing.
6453 doKeepNonSolids If FALSE, only solids will present in the result,
6454 otherwise all initial shapes.
6455 doGlueAllEdges If TRUE, all coincident edges of theShape
6456 will be glued, otherwise only the edges,
6457 belonging to theFaces.
6458 theName Object name; when specified, this parameter is used
6459 for result publication in the study. Otherwise, if automatic
6460 publication is switched on, default value is used for result name.
6463 New GEOM.GEOM_Object, containing a copy of theShape
6466 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6467 doKeepNonSolids, doGlueAllEdges)
6469 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6470 self._autoPublish(anObj, theName, "glueFaces")
6473 ## Replace coincident edges in theShape by one edge.
6474 # @param theShape Initial shape.
6475 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6476 # @param theName Object name; when specified, this parameter is used
6477 # for result publication in the study. Otherwise, if automatic
6478 # publication is switched on, default value is used for result name.
6480 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6482 # @ref tui_glue_edges "Example"
6483 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6485 Replace coincident edges in theShape by one edge.
6488 theShape Initial shape.
6489 theTolerance Maximum distance between edges, which can be considered as coincident.
6490 theName Object name; when specified, this parameter is used
6491 for result publication in the study. Otherwise, if automatic
6492 publication is switched on, default value is used for result name.
6495 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6497 theTolerance,Parameters = ParseParameters(theTolerance)
6498 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6500 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6501 anObj.SetParameters(Parameters)
6502 self._autoPublish(anObj, theName, "glueEdges")
6505 ## Find coincident edges in theShape for possible gluing.
6506 # @param theShape Initial shape.
6507 # @param theTolerance Maximum distance between edges,
6508 # which can be considered as coincident.
6509 # @param theName Object name; when specified, this parameter is used
6510 # for result publication in the study. Otherwise, if automatic
6511 # publication is switched on, default value is used for result name.
6513 # @return GEOM.ListOfGO
6515 # @ref tui_glue_edges "Example"
6516 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6518 Find coincident edges in theShape for possible gluing.
6521 theShape Initial shape.
6522 theTolerance Maximum distance between edges,
6523 which can be considered as coincident.
6524 theName Object name; when specified, this parameter is used
6525 for result publication in the study. Otherwise, if automatic
6526 publication is switched on, default value is used for result name.
6531 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6532 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6533 self._autoPublish(anObj, theName, "edgesToGlue")
6536 ## Replace coincident edges in theShape by one edge
6537 # in compliance with given list of edges.
6538 # @param theShape Initial shape.
6539 # @param theTolerance Maximum distance between edges,
6540 # which can be considered as coincident.
6541 # @param theEdges List of edges for gluing.
6542 # @param theName Object name; when specified, this parameter is used
6543 # for result publication in the study. Otherwise, if automatic
6544 # publication is switched on, default value is used for result name.
6546 # @return New GEOM.GEOM_Object, containing a copy of theShape
6547 # without some edges.
6549 # @ref tui_glue_edges "Example"
6550 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6552 Replace coincident edges in theShape by one edge
6553 in compliance with given list of edges.
6556 theShape Initial shape.
6557 theTolerance Maximum distance between edges,
6558 which can be considered as coincident.
6559 theEdges List of edges for gluing.
6560 theName Object name; when specified, this parameter is used
6561 for result publication in the study. Otherwise, if automatic
6562 publication is switched on, default value is used for result name.
6565 New GEOM.GEOM_Object, containing a copy of theShape
6568 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6570 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6571 self._autoPublish(anObj, theName, "glueEdges")
6577 ## @addtogroup l3_boolean Boolean Operations
6580 # -----------------------------------------------------------------------------
6581 # Boolean (Common, Cut, Fuse, Section)
6582 # -----------------------------------------------------------------------------
6584 ## Perform one of boolean operations on two given shapes.
6585 # @param theShape1 First argument for boolean operation.
6586 # @param theShape2 Second argument for boolean operation.
6587 # @param theOperation Indicates the operation to be done:\n
6588 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6589 # @param theName Object name; when specified, this parameter is used
6590 # for result publication in the study. Otherwise, if automatic
6591 # publication is switched on, default value is used for result name.
6593 # @return New GEOM.GEOM_Object, containing the result shape.
6595 # @ref tui_fuse "Example"
6596 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6598 Perform one of boolean operations on two given shapes.
6601 theShape1 First argument for boolean operation.
6602 theShape2 Second argument for boolean operation.
6603 theOperation Indicates the operation to be done:
6604 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6605 theName Object name; when specified, this parameter is used
6606 for result publication in the study. Otherwise, if automatic
6607 publication is switched on, default value is used for result name.
6610 New GEOM.GEOM_Object, containing the result shape.
6612 # Example: see GEOM_TestAll.py
6613 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6614 RaiseIfFailed("MakeBoolean", self.BoolOp)
6615 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6616 self._autoPublish(anObj, theName, def_names[theOperation])
6619 ## Perform Common boolean operation on two given shapes.
6620 # @param theShape1 First argument for boolean operation.
6621 # @param theShape2 Second argument for boolean operation.
6622 # @param theName Object name; when specified, this parameter is used
6623 # for result publication in the study. Otherwise, if automatic
6624 # publication is switched on, default value is used for result name.
6626 # @return New GEOM.GEOM_Object, containing the result shape.
6628 # @ref tui_common "Example 1"
6629 # \n @ref swig_MakeCommon "Example 2"
6630 def MakeCommon(self, theShape1, theShape2, theName=None):
6632 Perform Common boolean operation on two given shapes.
6635 theShape1 First argument for boolean operation.
6636 theShape2 Second argument for boolean operation.
6637 theName Object name; when specified, this parameter is used
6638 for result publication in the study. Otherwise, if automatic
6639 publication is switched on, default value is used for result name.
6642 New GEOM.GEOM_Object, containing the result shape.
6644 # Example: see GEOM_TestOthers.py
6645 # note: auto-publishing is done in self.MakeBoolean()
6646 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6648 ## Perform Cut boolean operation on two given shapes.
6649 # @param theShape1 First argument for boolean operation.
6650 # @param theShape2 Second argument for boolean operation.
6651 # @param theName Object name; when specified, this parameter is used
6652 # for result publication in the study. Otherwise, if automatic
6653 # publication is switched on, default value is used for result name.
6655 # @return New GEOM.GEOM_Object, containing the result shape.
6657 # @ref tui_cut "Example 1"
6658 # \n @ref swig_MakeCommon "Example 2"
6659 def MakeCut(self, theShape1, theShape2, theName=None):
6661 Perform Cut boolean operation on two given shapes.
6664 theShape1 First argument for boolean operation.
6665 theShape2 Second argument for boolean operation.
6666 theName Object name; when specified, this parameter is used
6667 for result publication in the study. Otherwise, if automatic
6668 publication is switched on, default value is used for result name.
6671 New GEOM.GEOM_Object, containing the result shape.
6674 # Example: see GEOM_TestOthers.py
6675 # note: auto-publishing is done in self.MakeBoolean()
6676 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6678 ## Perform Fuse boolean operation on two given shapes.
6679 # @param theShape1 First argument for boolean operation.
6680 # @param theShape2 Second argument for boolean operation.
6681 # @param theName Object name; when specified, this parameter is used
6682 # for result publication in the study. Otherwise, if automatic
6683 # publication is switched on, default value is used for result name.
6685 # @return New GEOM.GEOM_Object, containing the result shape.
6687 # @ref tui_fuse "Example 1"
6688 # \n @ref swig_MakeCommon "Example 2"
6689 def MakeFuse(self, theShape1, theShape2, theName=None):
6691 Perform Fuse boolean operation on two given shapes.
6694 theShape1 First argument for boolean operation.
6695 theShape2 Second argument for boolean operation.
6696 theName Object name; when specified, this parameter is used
6697 for result publication in the study. Otherwise, if automatic
6698 publication is switched on, default value is used for result name.
6701 New GEOM.GEOM_Object, containing the result shape.
6704 # Example: see GEOM_TestOthers.py
6705 # note: auto-publishing is done in self.MakeBoolean()
6706 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6708 ## Perform Section boolean operation on two given shapes.
6709 # @param theShape1 First argument for boolean operation.
6710 # @param theShape2 Second argument for boolean operation.
6711 # @param theName Object name; when specified, this parameter is used
6712 # for result publication in the study. Otherwise, if automatic
6713 # publication is switched on, default value is used for result name.
6715 # @return New GEOM.GEOM_Object, containing the result shape.
6717 # @ref tui_section "Example 1"
6718 # \n @ref swig_MakeCommon "Example 2"
6719 def MakeSection(self, theShape1, theShape2, theName=None):
6721 Perform Section boolean operation on two given shapes.
6724 theShape1 First argument for boolean operation.
6725 theShape2 Second argument for boolean operation.
6726 theName Object name; when specified, this parameter is used
6727 for result publication in the study. Otherwise, if automatic
6728 publication is switched on, default value is used for result name.
6731 New GEOM.GEOM_Object, containing the result shape.
6734 # Example: see GEOM_TestOthers.py
6735 # note: auto-publishing is done in self.MakeBoolean()
6736 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6738 ## Perform Fuse boolean operation on the list of shapes.
6739 # @param theShapesList Shapes to be fused.
6740 # @param theName Object name; when specified, this parameter is used
6741 # for result publication in the study. Otherwise, if automatic
6742 # publication is switched on, default value is used for result name.
6744 # @return New GEOM.GEOM_Object, containing the result shape.
6746 # @ref tui_fuse "Example 1"
6747 # \n @ref swig_MakeCommon "Example 2"
6748 def MakeFuseList(self, theShapesList, theName=None):
6750 Perform Fuse boolean operation on the list of shapes.
6753 theShapesList Shapes to be fused.
6754 theName Object name; when specified, this parameter is used
6755 for result publication in the study. Otherwise, if automatic
6756 publication is switched on, default value is used for result name.
6759 New GEOM.GEOM_Object, containing the result shape.
6762 # Example: see GEOM_TestOthers.py
6763 anObj = self.BoolOp.MakeFuseList(theShapesList)
6764 RaiseIfFailed("MakeFuseList", self.BoolOp)
6765 self._autoPublish(anObj, theName, "fuse")
6768 ## Perform Common boolean operation on the list of shapes.
6769 # @param theShapesList Shapes for Common operation.
6770 # @param theName Object name; when specified, this parameter is used
6771 # for result publication in the study. Otherwise, if automatic
6772 # publication is switched on, default value is used for result name.
6774 # @return New GEOM.GEOM_Object, containing the result shape.
6776 # @ref tui_common "Example 1"
6777 # \n @ref swig_MakeCommon "Example 2"
6778 def MakeCommonList(self, theShapesList, theName=None):
6780 Perform Common boolean operation on the list of shapes.
6783 theShapesList Shapes for Common operation.
6784 theName Object name; when specified, this parameter is used
6785 for result publication in the study. Otherwise, if automatic
6786 publication is switched on, default value is used for result name.
6789 New GEOM.GEOM_Object, containing the result shape.
6792 # Example: see GEOM_TestOthers.py
6793 anObj = self.BoolOp.MakeCommonList(theShapesList)
6794 RaiseIfFailed("MakeCommonList", self.BoolOp)
6795 self._autoPublish(anObj, theName, "common")
6798 ## Perform Cut boolean operation on one object and the list of tools.
6799 # @param theMainShape The object of the operation.
6800 # @param theShapesList The list of tools of the operation.
6801 # @param theName Object name; when specified, this parameter is used
6802 # for result publication in the study. Otherwise, if automatic
6803 # publication is switched on, default value is used for result name.
6805 # @return New GEOM.GEOM_Object, containing the result shape.
6807 # @ref tui_cut "Example 1"
6808 # \n @ref swig_MakeCommon "Example 2"
6809 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6811 Perform Cut boolean operation on one object and the list of tools.
6814 theMainShape The object of the operation.
6815 theShapesList The list of tools of the operation.
6816 theName Object name; when specified, this parameter is used
6817 for result publication in the study. Otherwise, if automatic
6818 publication is switched on, default value is used for result name.
6821 New GEOM.GEOM_Object, containing the result shape.
6824 # Example: see GEOM_TestOthers.py
6825 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6826 RaiseIfFailed("MakeCutList", self.BoolOp)
6827 self._autoPublish(anObj, theName, "cut")
6833 ## @addtogroup l3_basic_op
6836 ## Perform partition operation.
6837 # @param ListShapes Shapes to be intersected.
6838 # @param ListTools Shapes to intersect theShapes.
6839 # @param Limit Type of resulting shapes (see ShapeType()).\n
6840 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6841 # type will be detected automatically.
6842 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6843 # target type (equal to Limit) are kept in the result,
6844 # else standalone shapes of lower dimension
6845 # are kept also (if they exist).
6846 # @param theName Object name; when specified, this parameter is used
6847 # for result publication in the study. Otherwise, if automatic
6848 # publication is switched on, default value is used for result name.
6850 # @note Each compound from ListShapes and ListTools will be exploded
6851 # in order to avoid possible intersection between shapes from this compound.
6853 # After implementation new version of PartitionAlgo (October 2006)
6854 # other parameters are ignored by current functionality. They are kept
6855 # in this function only for support old versions.
6856 # @param ListKeepInside Shapes, outside which the results will be deleted.
6857 # Each shape from theKeepInside must belong to theShapes also.
6858 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6859 # Each shape from theRemoveInside must belong to theShapes also.
6860 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6861 # @param ListMaterials Material indices for each shape. Make sence,
6862 # only if theRemoveWebs is TRUE.
6864 # @return New GEOM.GEOM_Object, containing the result shapes.
6866 # @ref tui_partition "Example"
6867 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6868 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6869 KeepNonlimitShapes=0, theName=None):
6871 Perform partition operation.
6874 ListShapes Shapes to be intersected.
6875 ListTools Shapes to intersect theShapes.
6876 Limit Type of resulting shapes (see geompy.ShapeType)
6877 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6878 type will be detected automatically.
6879 KeepNonlimitShapes if this parameter == 0, then only shapes of
6880 target type (equal to Limit) are kept in the result,
6881 else standalone shapes of lower dimension
6882 are kept also (if they exist).
6883 theName Object name; when specified, this parameter is used
6884 for result publication in the study. Otherwise, if automatic
6885 publication is switched on, default value is used for result name.
6887 Each compound from ListShapes and ListTools will be exploded
6888 in order to avoid possible intersection between shapes from
6891 After implementation new version of PartitionAlgo (October 2006) other
6892 parameters are ignored by current functionality. They are kept in this
6893 function only for support old versions.
6896 ListKeepInside Shapes, outside which the results will be deleted.
6897 Each shape from theKeepInside must belong to theShapes also.
6898 ListRemoveInside Shapes, inside which the results will be deleted.
6899 Each shape from theRemoveInside must belong to theShapes also.
6900 RemoveWebs If TRUE, perform Glue 3D algorithm.
6901 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6904 New GEOM.GEOM_Object, containing the result shapes.
6906 # Example: see GEOM_TestAll.py
6907 if Limit == self.ShapeType["AUTO"]:
6908 # automatic detection of the most appropriate shape limit type
6910 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6911 Limit = EnumToLong(lim)
6913 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6914 ListKeepInside, ListRemoveInside,
6915 Limit, RemoveWebs, ListMaterials,
6916 KeepNonlimitShapes);
6917 RaiseIfFailed("MakePartition", self.BoolOp)
6918 self._autoPublish(anObj, theName, "partition")
6921 ## Perform partition operation.
6922 # This method may be useful if it is needed to make a partition for
6923 # compound contains nonintersected shapes. Performance will be better
6924 # since intersection between shapes from compound is not performed.
6926 # Description of all parameters as in previous method MakePartition()
6928 # @note Passed compounds (via ListShapes or via ListTools)
6929 # have to consist of nonintersecting shapes.
6931 # @return New GEOM.GEOM_Object, containing the result shapes.
6933 # @ref swig_todo "Example"
6934 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6935 ListKeepInside=[], ListRemoveInside=[],
6936 Limit=ShapeType["AUTO"], RemoveWebs=0,
6937 ListMaterials=[], KeepNonlimitShapes=0,
6940 Perform partition operation.
6941 This method may be useful if it is needed to make a partition for
6942 compound contains nonintersected shapes. Performance will be better
6943 since intersection between shapes from compound is not performed.
6946 Description of all parameters as in method geompy.MakePartition
6949 Passed compounds (via ListShapes or via ListTools)
6950 have to consist of nonintersecting shapes.
6953 New GEOM.GEOM_Object, containing the result shapes.
6955 if Limit == self.ShapeType["AUTO"]:
6956 # automatic detection of the most appropriate shape limit type
6958 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6959 Limit = EnumToLong(lim)
6961 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6962 ListKeepInside, ListRemoveInside,
6963 Limit, RemoveWebs, ListMaterials,
6964 KeepNonlimitShapes);
6965 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6966 self._autoPublish(anObj, theName, "partition")
6969 ## See method MakePartition() for more information.
6971 # @ref tui_partition "Example 1"
6972 # \n @ref swig_Partition "Example 2"
6973 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6974 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6975 KeepNonlimitShapes=0, theName=None):
6977 See method geompy.MakePartition for more information.
6979 # Example: see GEOM_TestOthers.py
6980 # note: auto-publishing is done in self.MakePartition()
6981 anObj = self.MakePartition(ListShapes, ListTools,
6982 ListKeepInside, ListRemoveInside,
6983 Limit, RemoveWebs, ListMaterials,
6984 KeepNonlimitShapes, theName);
6987 ## Perform partition of the Shape with the Plane
6988 # @param theShape Shape to be intersected.
6989 # @param thePlane Tool shape, to intersect theShape.
6990 # @param theName Object name; when specified, this parameter is used
6991 # for result publication in the study. Otherwise, if automatic
6992 # publication is switched on, default value is used for result name.
6994 # @return New GEOM.GEOM_Object, containing the result shape.
6996 # @ref tui_partition "Example"
6997 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6999 Perform partition of the Shape with the Plane
7002 theShape Shape to be intersected.
7003 thePlane Tool shape, to intersect theShape.
7004 theName Object name; when specified, this parameter is used
7005 for result publication in the study. Otherwise, if automatic
7006 publication is switched on, default value is used for result name.
7009 New GEOM.GEOM_Object, containing the result shape.
7011 # Example: see GEOM_TestAll.py
7012 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7013 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7014 self._autoPublish(anObj, theName, "partition")
7017 # end of l3_basic_op
7020 ## @addtogroup l3_transform
7023 ## Translate the given object along the vector, specified
7024 # by its end points.
7025 # @param theObject The object to be translated.
7026 # @param thePoint1 Start point of translation vector.
7027 # @param thePoint2 End point of translation vector.
7028 # @param theCopy Flag used to translate object itself or create a copy.
7029 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7030 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7031 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7033 Translate the given object along the vector, specified by its end points.
7036 theObject The object to be translated.
7037 thePoint1 Start point of translation vector.
7038 thePoint2 End point of translation vector.
7039 theCopy Flag used to translate object itself or create a copy.
7042 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7043 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7046 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7048 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7049 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7052 ## Translate the given object along the vector, specified
7053 # by its end points, creating its copy before the translation.
7054 # @param theObject The object to be translated.
7055 # @param thePoint1 Start point of translation vector.
7056 # @param thePoint2 End point of translation vector.
7057 # @param theName Object name; when specified, this parameter is used
7058 # for result publication in the study. Otherwise, if automatic
7059 # publication is switched on, default value is used for result name.
7061 # @return New GEOM.GEOM_Object, containing the translated object.
7063 # @ref tui_translation "Example 1"
7064 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7065 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7067 Translate the given object along the vector, specified
7068 by its end points, creating its copy before the translation.
7071 theObject The object to be translated.
7072 thePoint1 Start point of translation vector.
7073 thePoint2 End point of translation vector.
7074 theName Object name; when specified, this parameter is used
7075 for result publication in the study. Otherwise, if automatic
7076 publication is switched on, default value is used for result name.
7079 New GEOM.GEOM_Object, containing the translated object.
7081 # Example: see GEOM_TestAll.py
7082 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7083 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7084 self._autoPublish(anObj, theName, "translated")
7087 ## Translate the given object along the vector, specified by its components.
7088 # @param theObject The object to be translated.
7089 # @param theDX,theDY,theDZ Components of translation vector.
7090 # @param theCopy Flag used to translate object itself or create a copy.
7091 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7092 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7094 # @ref tui_translation "Example"
7095 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7097 Translate the given object along the vector, specified by its components.
7100 theObject The object to be translated.
7101 theDX,theDY,theDZ Components of translation vector.
7102 theCopy Flag used to translate object itself or create a copy.
7105 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7106 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7108 # Example: see GEOM_TestAll.py
7109 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7111 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7113 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7114 anObj.SetParameters(Parameters)
7115 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7118 ## Translate the given object along the vector, specified
7119 # by its components, creating its copy before the translation.
7120 # @param theObject The object to be translated.
7121 # @param theDX,theDY,theDZ Components of translation vector.
7122 # @param theName Object name; when specified, this parameter is used
7123 # for result publication in the study. Otherwise, if automatic
7124 # publication is switched on, default value is used for result name.
7126 # @return New GEOM.GEOM_Object, containing the translated object.
7128 # @ref tui_translation "Example"
7129 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7131 Translate the given object along the vector, specified
7132 by its components, creating its copy before the translation.
7135 theObject The object to be translated.
7136 theDX,theDY,theDZ Components of translation vector.
7137 theName Object name; when specified, this parameter is used
7138 for result publication in the study. Otherwise, if automatic
7139 publication is switched on, default value is used for result name.
7142 New GEOM.GEOM_Object, containing the translated object.
7144 # Example: see GEOM_TestAll.py
7145 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7146 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7147 anObj.SetParameters(Parameters)
7148 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7149 self._autoPublish(anObj, theName, "translated")
7152 ## Translate the given object along the given vector.
7153 # @param theObject The object to be translated.
7154 # @param theVector The translation vector.
7155 # @param theCopy Flag used to translate object itself or create a copy.
7156 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7157 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7158 def TranslateVector(self, theObject, theVector, theCopy=False):
7160 Translate the given object along the given vector.
7163 theObject The object to be translated.
7164 theVector The translation vector.
7165 theCopy Flag used to translate object itself or create a copy.
7168 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7169 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7172 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7174 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7175 RaiseIfFailed("TranslateVector", self.TrsfOp)
7178 ## Translate the given object along the given vector,
7179 # creating its copy before the translation.
7180 # @param theObject The object to be translated.
7181 # @param theVector The translation vector.
7182 # @param theName Object name; when specified, this parameter is used
7183 # for result publication in the study. Otherwise, if automatic
7184 # publication is switched on, default value is used for result name.
7186 # @return New GEOM.GEOM_Object, containing the translated object.
7188 # @ref tui_translation "Example"
7189 def MakeTranslationVector(self, theObject, theVector, theName=None):
7191 Translate the given object along the given vector,
7192 creating its copy before the translation.
7195 theObject The object to be translated.
7196 theVector The translation vector.
7197 theName Object name; when specified, this parameter is used
7198 for result publication in the study. Otherwise, if automatic
7199 publication is switched on, default value is used for result name.
7202 New GEOM.GEOM_Object, containing the translated object.
7204 # Example: see GEOM_TestAll.py
7205 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7206 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7207 self._autoPublish(anObj, theName, "translated")
7210 ## Translate the given object along the given vector on given distance.
7211 # @param theObject The object to be translated.
7212 # @param theVector The translation vector.
7213 # @param theDistance The translation distance.
7214 # @param theCopy Flag used to translate object itself or create a copy.
7215 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7216 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7218 # @ref tui_translation "Example"
7219 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7221 Translate the given object along the given vector on given distance.
7224 theObject The object to be translated.
7225 theVector The translation vector.
7226 theDistance The translation distance.
7227 theCopy Flag used to translate object itself or create a copy.
7230 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7231 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7233 # Example: see GEOM_TestAll.py
7234 theDistance,Parameters = ParseParameters(theDistance)
7235 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7236 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7237 anObj.SetParameters(Parameters)
7240 ## Translate the given object along the given vector on given distance,
7241 # creating its copy before the translation.
7242 # @param theObject The object to be translated.
7243 # @param theVector The translation vector.
7244 # @param theDistance The translation distance.
7245 # @param theName Object name; when specified, this parameter is used
7246 # for result publication in the study. Otherwise, if automatic
7247 # publication is switched on, default value is used for result name.
7249 # @return New GEOM.GEOM_Object, containing the translated object.
7251 # @ref tui_translation "Example"
7252 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7254 Translate the given object along the given vector on given distance,
7255 creating its copy before the translation.
7258 theObject The object to be translated.
7259 theVector The translation vector.
7260 theDistance The translation distance.
7261 theName Object name; when specified, this parameter is used
7262 for result publication in the study. Otherwise, if automatic
7263 publication is switched on, default value is used for result name.
7266 New GEOM.GEOM_Object, containing the translated object.
7268 # Example: see GEOM_TestAll.py
7269 theDistance,Parameters = ParseParameters(theDistance)
7270 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7271 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7272 anObj.SetParameters(Parameters)
7273 self._autoPublish(anObj, theName, "translated")
7276 ## Rotate the given object around the given axis on the given angle.
7277 # @param theObject The object to be rotated.
7278 # @param theAxis Rotation axis.
7279 # @param theAngle Rotation angle in radians.
7280 # @param theCopy Flag used to rotate object itself or create a copy.
7282 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7283 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7285 # @ref tui_rotation "Example"
7286 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7288 Rotate the given object around the given axis on the given angle.
7291 theObject The object to be rotated.
7292 theAxis Rotation axis.
7293 theAngle Rotation angle in radians.
7294 theCopy Flag used to rotate object itself or create a copy.
7297 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7298 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7300 # Example: see GEOM_TestAll.py
7302 if isinstance(theAngle,str):
7304 theAngle, Parameters = ParseParameters(theAngle)
7306 theAngle = theAngle*math.pi/180.0
7308 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7310 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7311 RaiseIfFailed("Rotate", self.TrsfOp)
7312 anObj.SetParameters(Parameters)
7315 ## Rotate the given object around the given axis
7316 # on the given angle, creating its copy before the rotatation.
7317 # @param theObject The object to be rotated.
7318 # @param theAxis Rotation axis.
7319 # @param theAngle Rotation angle in radians.
7320 # @param theName Object name; when specified, this parameter is used
7321 # for result publication in the study. Otherwise, if automatic
7322 # publication is switched on, default value is used for result name.
7324 # @return New GEOM.GEOM_Object, containing the rotated object.
7326 # @ref tui_rotation "Example"
7327 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7329 Rotate the given object around the given axis
7330 on the given angle, creating its copy before the rotatation.
7333 theObject The object to be rotated.
7334 theAxis Rotation axis.
7335 theAngle Rotation angle in radians.
7336 theName Object name; when specified, this parameter is used
7337 for result publication in the study. Otherwise, if automatic
7338 publication is switched on, default value is used for result name.
7341 New GEOM.GEOM_Object, containing the rotated object.
7343 # Example: see GEOM_TestAll.py
7345 if isinstance(theAngle,str):
7347 theAngle, Parameters = ParseParameters(theAngle)
7349 theAngle = theAngle*math.pi/180.0
7350 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7351 RaiseIfFailed("RotateCopy", self.TrsfOp)
7352 anObj.SetParameters(Parameters)
7353 self._autoPublish(anObj, theName, "rotated")
7356 ## Rotate given object around vector perpendicular to plane
7357 # containing three points.
7358 # @param theObject The object to be rotated.
7359 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7360 # containing the three points.
7361 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7362 # @param theCopy Flag used to rotate object itself or create a copy.
7363 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7364 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7365 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7367 Rotate given object around vector perpendicular to plane
7368 containing three points.
7371 theObject The object to be rotated.
7372 theCentPoint central point the axis is the vector perpendicular to the plane
7373 containing the three points.
7374 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7375 theCopy Flag used to rotate object itself or create a copy.
7378 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7379 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7382 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7384 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7385 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7388 ## Rotate given object around vector perpendicular to plane
7389 # containing three points, creating its copy before the rotatation.
7390 # @param theObject The object to be rotated.
7391 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7392 # containing the three points.
7393 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7394 # @param theName Object name; when specified, this parameter is used
7395 # for result publication in the study. Otherwise, if automatic
7396 # publication is switched on, default value is used for result name.
7398 # @return New GEOM.GEOM_Object, containing the rotated object.
7400 # @ref tui_rotation "Example"
7401 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7403 Rotate given object around vector perpendicular to plane
7404 containing three points, creating its copy before the rotatation.
7407 theObject The object to be rotated.
7408 theCentPoint central point the axis is the vector perpendicular to the plane
7409 containing the three points.
7410 thePoint1,thePoint2 in a perpendicular plane of the axis.
7411 theName Object name; when specified, this parameter is used
7412 for result publication in the study. Otherwise, if automatic
7413 publication is switched on, default value is used for result name.
7416 New GEOM.GEOM_Object, containing the rotated object.
7418 # Example: see GEOM_TestAll.py
7419 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7420 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7421 self._autoPublish(anObj, theName, "rotated")
7424 ## Scale the given object by the specified factor.
7425 # @param theObject The object to be scaled.
7426 # @param thePoint Center point for scaling.
7427 # Passing None for it means scaling relatively the origin of global CS.
7428 # @param theFactor Scaling factor value.
7429 # @param theCopy Flag used to scale object itself or create a copy.
7430 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7431 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7432 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7434 Scale the given object by the specified factor.
7437 theObject The object to be scaled.
7438 thePoint Center point for scaling.
7439 Passing None for it means scaling relatively the origin of global CS.
7440 theFactor Scaling factor value.
7441 theCopy Flag used to scale object itself or create a copy.
7444 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7445 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7447 # Example: see GEOM_TestAll.py
7448 theFactor, Parameters = ParseParameters(theFactor)
7450 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7452 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7453 RaiseIfFailed("Scale", self.TrsfOp)
7454 anObj.SetParameters(Parameters)
7457 ## Scale the given object by the factor, creating its copy before the scaling.
7458 # @param theObject The object to be scaled.
7459 # @param thePoint Center point for scaling.
7460 # Passing None for it means scaling relatively the origin of global CS.
7461 # @param theFactor Scaling factor value.
7462 # @param theName Object name; when specified, this parameter is used
7463 # for result publication in the study. Otherwise, if automatic
7464 # publication is switched on, default value is used for result name.
7466 # @return New GEOM.GEOM_Object, containing the scaled shape.
7468 # @ref tui_scale "Example"
7469 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7471 Scale the given object by the factor, creating its copy before the scaling.
7474 theObject The object to be scaled.
7475 thePoint Center point for scaling.
7476 Passing None for it means scaling relatively the origin of global CS.
7477 theFactor Scaling factor value.
7478 theName Object name; when specified, this parameter is used
7479 for result publication in the study. Otherwise, if automatic
7480 publication is switched on, default value is used for result name.
7483 New GEOM.GEOM_Object, containing the scaled shape.
7485 # Example: see GEOM_TestAll.py
7486 theFactor, Parameters = ParseParameters(theFactor)
7487 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7488 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7489 anObj.SetParameters(Parameters)
7490 self._autoPublish(anObj, theName, "scaled")
7493 ## Scale the given object by different factors along coordinate axes.
7494 # @param theObject The object to be scaled.
7495 # @param thePoint Center point for scaling.
7496 # Passing None for it means scaling relatively the origin of global CS.
7497 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7498 # @param theCopy Flag used to scale object itself or create a copy.
7499 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7500 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7501 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7503 Scale the given object by different factors along coordinate axes.
7506 theObject The object to be scaled.
7507 thePoint Center point for scaling.
7508 Passing None for it means scaling relatively the origin of global CS.
7509 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7510 theCopy Flag used to scale object itself or create a copy.
7513 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7514 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7516 # Example: see GEOM_TestAll.py
7517 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7519 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7520 theFactorX, theFactorY, theFactorZ)
7522 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7523 theFactorX, theFactorY, theFactorZ)
7524 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7525 anObj.SetParameters(Parameters)
7528 ## Scale the given object by different factors along coordinate axes,
7529 # creating its copy before the scaling.
7530 # @param theObject The object to be scaled.
7531 # @param thePoint Center point for scaling.
7532 # Passing None for it means scaling relatively the origin of global CS.
7533 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7534 # @param theName Object name; when specified, this parameter is used
7535 # for result publication in the study. Otherwise, if automatic
7536 # publication is switched on, default value is used for result name.
7538 # @return New GEOM.GEOM_Object, containing the scaled shape.
7540 # @ref swig_scale "Example"
7541 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7543 Scale the given object by different factors along coordinate axes,
7544 creating its copy before the scaling.
7547 theObject The object to be scaled.
7548 thePoint Center point for scaling.
7549 Passing None for it means scaling relatively the origin of global CS.
7550 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7551 theName Object name; when specified, this parameter is used
7552 for result publication in the study. Otherwise, if automatic
7553 publication is switched on, default value is used for result name.
7556 New GEOM.GEOM_Object, containing the scaled shape.
7558 # Example: see GEOM_TestAll.py
7559 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7560 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7561 theFactorX, theFactorY, theFactorZ)
7562 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7563 anObj.SetParameters(Parameters)
7564 self._autoPublish(anObj, theName, "scaled")
7567 ## Mirror an object relatively the given plane.
7568 # @param theObject The object to be mirrored.
7569 # @param thePlane Plane of symmetry.
7570 # @param theCopy Flag used to mirror object itself or create a copy.
7571 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7572 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7573 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7575 Mirror an object relatively the given plane.
7578 theObject The object to be mirrored.
7579 thePlane Plane of symmetry.
7580 theCopy Flag used to mirror object itself or create a copy.
7583 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7584 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7587 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7589 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7590 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7593 ## Create an object, symmetrical
7594 # to the given one relatively the given plane.
7595 # @param theObject The object to be mirrored.
7596 # @param thePlane Plane of symmetry.
7597 # @param theName Object name; when specified, this parameter is used
7598 # for result publication in the study. Otherwise, if automatic
7599 # publication is switched on, default value is used for result name.
7601 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7603 # @ref tui_mirror "Example"
7604 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7606 Create an object, symmetrical to the given one relatively the given plane.
7609 theObject The object to be mirrored.
7610 thePlane Plane of symmetry.
7611 theName Object name; when specified, this parameter is used
7612 for result publication in the study. Otherwise, if automatic
7613 publication is switched on, default value is used for result name.
7616 New GEOM.GEOM_Object, containing the mirrored shape.
7618 # Example: see GEOM_TestAll.py
7619 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7620 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7621 self._autoPublish(anObj, theName, "mirrored")
7624 ## Mirror an object relatively the given axis.
7625 # @param theObject The object to be mirrored.
7626 # @param theAxis Axis of symmetry.
7627 # @param theCopy Flag used to mirror object itself or create a copy.
7628 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7629 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7630 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7632 Mirror an object relatively the given axis.
7635 theObject The object to be mirrored.
7636 theAxis Axis of symmetry.
7637 theCopy Flag used to mirror object itself or create a copy.
7640 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7641 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7644 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7646 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7647 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7650 ## Create an object, symmetrical
7651 # to the given one relatively the given axis.
7652 # @param theObject The object to be mirrored.
7653 # @param theAxis Axis of symmetry.
7654 # @param theName Object name; when specified, this parameter is used
7655 # for result publication in the study. Otherwise, if automatic
7656 # publication is switched on, default value is used for result name.
7658 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7660 # @ref tui_mirror "Example"
7661 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7663 Create an object, symmetrical to the given one relatively the given axis.
7666 theObject The object to be mirrored.
7667 theAxis Axis of symmetry.
7668 theName Object name; when specified, this parameter is used
7669 for result publication in the study. Otherwise, if automatic
7670 publication is switched on, default value is used for result name.
7673 New GEOM.GEOM_Object, containing the mirrored shape.
7675 # Example: see GEOM_TestAll.py
7676 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7677 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7678 self._autoPublish(anObj, theName, "mirrored")
7681 ## Mirror an object relatively the given point.
7682 # @param theObject The object to be mirrored.
7683 # @param thePoint Point of symmetry.
7684 # @param theCopy Flag used to mirror object itself or create a copy.
7685 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7686 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7687 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7689 Mirror an object relatively the given point.
7692 theObject The object to be mirrored.
7693 thePoint Point of symmetry.
7694 theCopy Flag used to mirror object itself or create a copy.
7697 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7698 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7700 # Example: see GEOM_TestAll.py
7702 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7704 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7705 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7708 ## Create an object, symmetrical
7709 # to the given one relatively the given point.
7710 # @param theObject The object to be mirrored.
7711 # @param thePoint Point of symmetry.
7712 # @param theName Object name; when specified, this parameter is used
7713 # for result publication in the study. Otherwise, if automatic
7714 # publication is switched on, default value is used for result name.
7716 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7718 # @ref tui_mirror "Example"
7719 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7721 Create an object, symmetrical
7722 to the given one relatively the given point.
7725 theObject The object to be mirrored.
7726 thePoint Point of symmetry.
7727 theName Object name; when specified, this parameter is used
7728 for result publication in the study. Otherwise, if automatic
7729 publication is switched on, default value is used for result name.
7732 New GEOM.GEOM_Object, containing the mirrored shape.
7734 # Example: see GEOM_TestAll.py
7735 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7736 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7737 self._autoPublish(anObj, theName, "mirrored")
7740 ## Modify the location of the given object.
7741 # @param theObject The object to be displaced.
7742 # @param theStartLCS Coordinate system to perform displacement from it.\n
7743 # If \a theStartLCS is NULL, displacement
7744 # will be performed from global CS.\n
7745 # If \a theObject itself is used as \a theStartLCS,
7746 # its location will be changed to \a theEndLCS.
7747 # @param theEndLCS Coordinate system to perform displacement to it.
7748 # @param theCopy Flag used to displace object itself or create a copy.
7749 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7750 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7751 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7753 Modify the Location of the given object by LCS, creating its copy before the setting.
7756 theObject The object to be displaced.
7757 theStartLCS Coordinate system to perform displacement from it.
7758 If theStartLCS is NULL, displacement
7759 will be performed from global CS.
7760 If theObject itself is used as theStartLCS,
7761 its location will be changed to theEndLCS.
7762 theEndLCS Coordinate system to perform displacement to it.
7763 theCopy Flag used to displace object itself or create a copy.
7766 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7767 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7769 # Example: see GEOM_TestAll.py
7771 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7773 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7774 RaiseIfFailed("Displace", self.TrsfOp)
7777 ## Modify the Location of the given object by LCS,
7778 # creating its copy before the setting.
7779 # @param theObject The object to be displaced.
7780 # @param theStartLCS Coordinate system to perform displacement from it.\n
7781 # If \a theStartLCS is NULL, displacement
7782 # will be performed from global CS.\n
7783 # If \a theObject itself is used as \a theStartLCS,
7784 # its location will be changed to \a theEndLCS.
7785 # @param theEndLCS Coordinate system to perform displacement to it.
7786 # @param theName Object name; when specified, this parameter is used
7787 # for result publication in the study. Otherwise, if automatic
7788 # publication is switched on, default value is used for result name.
7790 # @return New GEOM.GEOM_Object, containing the displaced shape.
7792 # @ref tui_modify_location "Example"
7793 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7795 Modify the Location of the given object by LCS, creating its copy before the setting.
7798 theObject The object to be displaced.
7799 theStartLCS Coordinate system to perform displacement from it.
7800 If theStartLCS is NULL, displacement
7801 will be performed from global CS.
7802 If theObject itself is used as theStartLCS,
7803 its location will be changed to theEndLCS.
7804 theEndLCS Coordinate system to perform displacement to it.
7805 theName Object name; when specified, this parameter is used
7806 for result publication in the study. Otherwise, if automatic
7807 publication is switched on, default value is used for result name.
7810 New GEOM.GEOM_Object, containing the displaced shape.
7813 # create local coordinate systems
7814 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7815 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7816 # modify the location of the given object
7817 position = geompy.MakePosition(cylinder, cs1, cs2)
7819 # Example: see GEOM_TestAll.py
7820 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7821 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7822 self._autoPublish(anObj, theName, "displaced")
7825 ## Modify the Location of the given object by Path.
7826 # @param theObject The object to be displaced.
7827 # @param thePath Wire or Edge along that the object will be translated.
7828 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7829 # @param theCopy is to create a copy objects if true.
7830 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7831 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7832 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7834 # @ref tui_modify_location "Example"
7835 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7837 Modify the Location of the given object by Path.
7840 theObject The object to be displaced.
7841 thePath Wire or Edge along that the object will be translated.
7842 theDistance progress of Path (0 = start location, 1 = end of path location).
7843 theCopy is to create a copy objects if true.
7844 theReverse 0 - for usual direction, 1 - to reverse path direction.
7847 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7848 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7851 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7853 # Example: see GEOM_TestAll.py
7854 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7855 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7858 ## Modify the Location of the given object by Path, creating its copy before the operation.
7859 # @param theObject The object to be displaced.
7860 # @param thePath Wire or Edge along that the object will be translated.
7861 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7862 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7863 # @param theName Object name; when specified, this parameter is used
7864 # for result publication in the study. Otherwise, if automatic
7865 # publication is switched on, default value is used for result name.
7867 # @return New GEOM.GEOM_Object, containing the displaced shape.
7868 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7870 Modify the Location of the given object by Path, creating its copy before the operation.
7873 theObject The object to be displaced.
7874 thePath Wire or Edge along that the object will be translated.
7875 theDistance progress of Path (0 = start location, 1 = end of path location).
7876 theReverse 0 - for usual direction, 1 - to reverse path direction.
7877 theName Object name; when specified, this parameter is used
7878 for result publication in the study. Otherwise, if automatic
7879 publication is switched on, default value is used for result name.
7882 New GEOM.GEOM_Object, containing the displaced shape.
7884 # Example: see GEOM_TestAll.py
7885 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7886 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7887 self._autoPublish(anObj, theName, "displaced")
7890 ## Offset given shape.
7891 # @param theObject The base object for the offset.
7892 # @param theOffset Offset value.
7893 # @param theCopy Flag used to offset object itself or create a copy.
7894 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7895 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7896 def Offset(self, theObject, theOffset, theCopy=False):
7901 theObject The base object for the offset.
7902 theOffset Offset value.
7903 theCopy Flag used to offset object itself or create a copy.
7906 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7907 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7909 theOffset, Parameters = ParseParameters(theOffset)
7911 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7913 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7914 RaiseIfFailed("Offset", self.TrsfOp)
7915 anObj.SetParameters(Parameters)
7918 ## Create new object as offset of the given one.
7919 # @param theObject The base object for the offset.
7920 # @param theOffset Offset value.
7921 # @param theName Object name; when specified, this parameter is used
7922 # for result publication in the study. Otherwise, if automatic
7923 # publication is switched on, default value is used for result name.
7925 # @return New GEOM.GEOM_Object, containing the offset object.
7927 # @ref tui_offset "Example"
7928 def MakeOffset(self, theObject, theOffset, theName=None):
7930 Create new object as offset of the given one.
7933 theObject The base object for the offset.
7934 theOffset Offset value.
7935 theName Object name; when specified, this parameter is used
7936 for result publication in the study. Otherwise, if automatic
7937 publication is switched on, default value is used for result name.
7940 New GEOM.GEOM_Object, containing the offset object.
7943 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7944 # create a new object as offset of the given object
7945 offset = geompy.MakeOffset(box, 70.)
7947 # Example: see GEOM_TestAll.py
7948 theOffset, Parameters = ParseParameters(theOffset)
7949 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7950 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7951 anObj.SetParameters(Parameters)
7952 self._autoPublish(anObj, theName, "offset")
7955 ## Create new object as projection of the given one on a 2D surface.
7956 # @param theSource The source object for the projection. It can be a point, edge or wire.
7957 # @param theTarget The target object. It can be planar or cylindrical face.
7958 # @param theName Object name; when specified, this parameter is used
7959 # for result publication in the study. Otherwise, if automatic
7960 # publication is switched on, default value is used for result name.
7962 # @return New GEOM.GEOM_Object, containing the projection.
7964 # @ref tui_projection "Example"
7965 def MakeProjection(self, theSource, theTarget, theName=None):
7967 Create new object as projection of the given one on a 2D surface.
7970 theSource The source object for the projection. It can be a point, edge or wire.
7971 theTarget The target object. It can be planar or cylindrical face.
7972 theName Object name; when specified, this parameter is used
7973 for result publication in the study. Otherwise, if automatic
7974 publication is switched on, default value is used for result name.
7977 New GEOM.GEOM_Object, containing the projection.
7979 # Example: see GEOM_TestAll.py
7980 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7981 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7982 self._autoPublish(anObj, theName, "projection")
7985 # -----------------------------------------------------------------------------
7987 # -----------------------------------------------------------------------------
7989 ## Translate the given object along the given vector a given number times
7990 # @param theObject The object to be translated.
7991 # @param theVector Direction of the translation. DX if None.
7992 # @param theStep Distance to translate on.
7993 # @param theNbTimes Quantity of translations to be done.
7994 # @param theName Object name; when specified, this parameter is used
7995 # for result publication in the study. Otherwise, if automatic
7996 # publication is switched on, default value is used for result name.
7998 # @return New GEOM.GEOM_Object, containing compound of all
7999 # the shapes, obtained after each translation.
8001 # @ref tui_multi_translation "Example"
8002 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8004 Translate the given object along the given vector a given number times
8007 theObject The object to be translated.
8008 theVector Direction of the translation. DX if None.
8009 theStep Distance to translate on.
8010 theNbTimes Quantity of translations to be done.
8011 theName Object name; when specified, this parameter is used
8012 for result publication in the study. Otherwise, if automatic
8013 publication is switched on, default value is used for result name.
8016 New GEOM.GEOM_Object, containing compound of all
8017 the shapes, obtained after each translation.
8020 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8022 # Example: see GEOM_TestAll.py
8023 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8024 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8025 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8026 anObj.SetParameters(Parameters)
8027 self._autoPublish(anObj, theName, "multitranslation")
8030 ## Conseqently apply two specified translations to theObject specified number of times.
8031 # @param theObject The object to be translated.
8032 # @param theVector1 Direction of the first translation. DX if None.
8033 # @param theStep1 Step of the first translation.
8034 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8035 # @param theVector2 Direction of the second translation. DY if None.
8036 # @param theStep2 Step of the second translation.
8037 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8038 # @param theName Object name; when specified, this parameter is used
8039 # for result publication in the study. Otherwise, if automatic
8040 # publication is switched on, default value is used for result name.
8042 # @return New GEOM.GEOM_Object, containing compound of all
8043 # the shapes, obtained after each translation.
8045 # @ref tui_multi_translation "Example"
8046 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8047 theVector2, theStep2, theNbTimes2, theName=None):
8049 Conseqently apply two specified translations to theObject specified number of times.
8052 theObject The object to be translated.
8053 theVector1 Direction of the first translation. DX if None.
8054 theStep1 Step of the first translation.
8055 theNbTimes1 Quantity of translations to be done along theVector1.
8056 theVector2 Direction of the second translation. DY if None.
8057 theStep2 Step of the second translation.
8058 theNbTimes2 Quantity of translations to be done along theVector2.
8059 theName Object name; when specified, this parameter is used
8060 for result publication in the study. Otherwise, if automatic
8061 publication is switched on, default value is used for result name.
8064 New GEOM.GEOM_Object, containing compound of all
8065 the shapes, obtained after each translation.
8068 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8070 # Example: see GEOM_TestAll.py
8071 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8072 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8073 theVector2, theStep2, theNbTimes2)
8074 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8075 anObj.SetParameters(Parameters)
8076 self._autoPublish(anObj, theName, "multitranslation")
8079 ## Rotate the given object around the given axis a given number times.
8080 # Rotation angle will be 2*PI/theNbTimes.
8081 # @param theObject The object to be rotated.
8082 # @param theAxis The rotation axis. DZ if None.
8083 # @param theNbTimes Quantity of rotations to be done.
8084 # @param theName Object name; when specified, this parameter is used
8085 # for result publication in the study. Otherwise, if automatic
8086 # publication is switched on, default value is used for result name.
8088 # @return New GEOM.GEOM_Object, containing compound of all the
8089 # shapes, obtained after each rotation.
8091 # @ref tui_multi_rotation "Example"
8092 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8094 Rotate the given object around the given axis a given number times.
8095 Rotation angle will be 2*PI/theNbTimes.
8098 theObject The object to be rotated.
8099 theAxis The rotation axis. DZ if None.
8100 theNbTimes Quantity of rotations to be done.
8101 theName Object name; when specified, this parameter is used
8102 for result publication in the study. Otherwise, if automatic
8103 publication is switched on, default value is used for result name.
8106 New GEOM.GEOM_Object, containing compound of all the
8107 shapes, obtained after each rotation.
8110 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8112 # Example: see GEOM_TestAll.py
8113 theNbTimes, Parameters = ParseParameters(theNbTimes)
8114 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8115 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8116 anObj.SetParameters(Parameters)
8117 self._autoPublish(anObj, theName, "multirotation")
8120 ## Rotate the given object around the given axis
8121 # a given number times on the given angle.
8122 # @param theObject The object to be rotated.
8123 # @param theAxis The rotation axis. DZ if None.
8124 # @param theAngleStep Rotation angle in radians.
8125 # @param theNbTimes Quantity of rotations to be done.
8126 # @param theName Object name; when specified, this parameter is used
8127 # for result publication in the study. Otherwise, if automatic
8128 # publication is switched on, default value is used for result name.
8130 # @return New GEOM.GEOM_Object, containing compound of all the
8131 # shapes, obtained after each rotation.
8133 # @ref tui_multi_rotation "Example"
8134 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8136 Rotate the given object around the given axis
8137 a given number times on the given angle.
8140 theObject The object to be rotated.
8141 theAxis The rotation axis. DZ if None.
8142 theAngleStep Rotation angle in radians.
8143 theNbTimes Quantity of rotations to be done.
8144 theName Object name; when specified, this parameter is used
8145 for result publication in the study. Otherwise, if automatic
8146 publication is switched on, default value is used for result name.
8149 New GEOM.GEOM_Object, containing compound of all the
8150 shapes, obtained after each rotation.
8153 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8155 # Example: see GEOM_TestAll.py
8156 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8157 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8158 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8159 anObj.SetParameters(Parameters)
8160 self._autoPublish(anObj, theName, "multirotation")
8163 ## Rotate the given object around the given axis a given
8164 # number times and multi-translate each rotation result.
8165 # Rotation angle will be 2*PI/theNbTimes1.
8166 # Translation direction passes through center of gravity
8167 # of rotated shape and its projection on the rotation axis.
8168 # @param theObject The object to be rotated.
8169 # @param theAxis Rotation axis. DZ if None.
8170 # @param theNbTimes1 Quantity of rotations to be done.
8171 # @param theRadialStep Translation distance.
8172 # @param theNbTimes2 Quantity of translations to be done.
8173 # @param theName Object name; when specified, this parameter is used
8174 # for result publication in the study. Otherwise, if automatic
8175 # publication is switched on, default value is used for result name.
8177 # @return New GEOM.GEOM_Object, containing compound of all the
8178 # shapes, obtained after each transformation.
8180 # @ref tui_multi_rotation "Example"
8181 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8183 Rotate the given object around the
8184 given axis on the given angle a given number
8185 times and multi-translate each rotation result.
8186 Translation direction passes through center of gravity
8187 of rotated shape and its projection on the rotation axis.
8190 theObject The object to be rotated.
8191 theAxis Rotation axis. DZ if None.
8192 theNbTimes1 Quantity of rotations to be done.
8193 theRadialStep Translation distance.
8194 theNbTimes2 Quantity of translations to be done.
8195 theName Object name; when specified, this parameter is used
8196 for result publication in the study. Otherwise, if automatic
8197 publication is switched on, default value is used for result name.
8200 New GEOM.GEOM_Object, containing compound of all the
8201 shapes, obtained after each transformation.
8204 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8206 # Example: see GEOM_TestAll.py
8207 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8208 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8209 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8210 anObj.SetParameters(Parameters)
8211 self._autoPublish(anObj, theName, "multirotation")
8214 ## Rotate the given object around the
8215 # given axis on the given angle a given number
8216 # times and multi-translate each rotation result.
8217 # Translation direction passes through center of gravity
8218 # of rotated shape and its projection on the rotation axis.
8219 # @param theObject The object to be rotated.
8220 # @param theAxis Rotation axis. DZ if None.
8221 # @param theAngleStep Rotation angle in radians.
8222 # @param theNbTimes1 Quantity of rotations to be done.
8223 # @param theRadialStep Translation distance.
8224 # @param theNbTimes2 Quantity of translations to be done.
8225 # @param theName Object name; when specified, this parameter is used
8226 # for result publication in the study. Otherwise, if automatic
8227 # publication is switched on, default value is used for result name.
8229 # @return New GEOM.GEOM_Object, containing compound of all the
8230 # shapes, obtained after each transformation.
8232 # @ref tui_multi_rotation "Example"
8233 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8235 Rotate the given object around the
8236 given axis on the given angle a given number
8237 times and multi-translate each rotation result.
8238 Translation direction passes through center of gravity
8239 of rotated shape and its projection on the rotation axis.
8242 theObject The object to be rotated.
8243 theAxis Rotation axis. DZ if None.
8244 theAngleStep Rotation angle in radians.
8245 theNbTimes1 Quantity of rotations to be done.
8246 theRadialStep Translation distance.
8247 theNbTimes2 Quantity of translations to be done.
8248 theName Object name; when specified, this parameter is used
8249 for result publication in the study. Otherwise, if automatic
8250 publication is switched on, default value is used for result name.
8253 New GEOM.GEOM_Object, containing compound of all the
8254 shapes, obtained after each transformation.
8257 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8259 # Example: see GEOM_TestAll.py
8260 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8261 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8262 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8263 anObj.SetParameters(Parameters)
8264 self._autoPublish(anObj, theName, "multirotation")
8267 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8269 # @ref swig_MakeMultiRotation "Example"
8270 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8272 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8275 pz = geompy.MakeVertex(0, 0, 100)
8276 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8277 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8279 # Example: see GEOM_TestOthers.py
8280 aVec = self.MakeLine(aPoint,aDir)
8281 # note: auto-publishing is done in self.MultiRotate1D()
8282 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8285 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8287 # @ref swig_MakeMultiRotation "Example"
8288 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8290 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8293 pz = geompy.MakeVertex(0, 0, 100)
8294 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8295 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8297 # Example: see GEOM_TestOthers.py
8298 aVec = self.MakeLine(aPoint,aDir)
8299 # note: auto-publishing is done in self.MultiRotate1D()
8300 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8303 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8305 # @ref swig_MakeMultiRotation "Example"
8306 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8308 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8311 pz = geompy.MakeVertex(0, 0, 100)
8312 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8313 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8315 # Example: see GEOM_TestOthers.py
8316 aVec = self.MakeLine(aPoint,aDir)
8317 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8318 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8321 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8323 # @ref swig_MakeMultiRotation "Example"
8324 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8326 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8329 pz = geompy.MakeVertex(0, 0, 100)
8330 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8331 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8333 # Example: see GEOM_TestOthers.py
8334 aVec = self.MakeLine(aPoint,aDir)
8335 # note: auto-publishing is done in self.MultiRotate2D()
8336 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8339 # end of l3_transform
8342 ## @addtogroup l3_transform_d
8345 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8346 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8348 Deprecated method. Use MultiRotate1DNbTimes instead.
8350 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8351 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8353 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8354 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8355 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8357 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8358 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8361 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8363 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8364 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8365 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8366 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8367 anObj.SetParameters(Parameters)
8368 self._autoPublish(anObj, theName, "multirotation")
8371 ## The same, as MultiRotate1D(), but axis is given by direction and point
8372 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8373 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8375 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8376 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8379 pz = geompy.MakeVertex(0, 0, 100)
8380 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8381 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8383 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8384 aVec = self.MakeLine(aPoint,aDir)
8385 # note: auto-publishing is done in self.MultiRotate1D()
8386 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8389 ## The same, as MultiRotate2D(), but axis is given by direction and point
8390 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8391 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8393 The same, as MultiRotate2D(), but axis is given by direction and point
8394 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8397 pz = geompy.MakeVertex(0, 0, 100)
8398 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8399 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8401 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8402 aVec = self.MakeLine(aPoint,aDir)
8403 # note: auto-publishing is done in self.MultiRotate2D()
8404 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8407 # end of l3_transform_d
8410 ## @addtogroup l3_local
8413 ## Perform a fillet on all edges of the given shape.
8414 # @param theShape Shape, to perform fillet on.
8415 # @param theR Fillet radius.
8416 # @param theName Object name; when specified, this parameter is used
8417 # for result publication in the study. Otherwise, if automatic
8418 # publication is switched on, default value is used for result name.
8420 # @return New GEOM.GEOM_Object, containing the result shape.
8422 # @ref tui_fillet "Example 1"
8423 # \n @ref swig_MakeFilletAll "Example 2"
8424 def MakeFilletAll(self, theShape, theR, theName=None):
8426 Perform a fillet on all edges of the given shape.
8429 theShape Shape, to perform fillet on.
8431 theName Object name; when specified, this parameter is used
8432 for result publication in the study. Otherwise, if automatic
8433 publication is switched on, default value is used for result name.
8436 New GEOM.GEOM_Object, containing the result shape.
8439 filletall = geompy.MakeFilletAll(prism, 10.)
8441 # Example: see GEOM_TestOthers.py
8442 theR,Parameters = ParseParameters(theR)
8443 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8444 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8445 anObj.SetParameters(Parameters)
8446 self._autoPublish(anObj, theName, "fillet")
8449 ## Perform a fillet on the specified edges/faces of the given shape
8450 # @param theShape Shape, to perform fillet on.
8451 # @param theR Fillet radius.
8452 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8453 # @param theListShapes Global indices of edges/faces to perform fillet on.
8454 # @param theName Object name; when specified, this parameter is used
8455 # for result publication in the study. Otherwise, if automatic
8456 # publication is switched on, default value is used for result name.
8458 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8460 # @return New GEOM.GEOM_Object, containing the result shape.
8462 # @ref tui_fillet "Example"
8463 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8465 Perform a fillet on the specified edges/faces of the given shape
8468 theShape Shape, to perform fillet on.
8470 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8471 theListShapes Global indices of edges/faces to perform fillet on.
8472 theName Object name; when specified, this parameter is used
8473 for result publication in the study. Otherwise, if automatic
8474 publication is switched on, default value is used for result name.
8477 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8480 New GEOM.GEOM_Object, containing the result shape.
8483 # get the list of IDs (IDList) for the fillet
8484 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8486 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8487 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8488 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8489 # make a fillet on the specified edges of the given shape
8490 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8492 # Example: see GEOM_TestAll.py
8493 theR,Parameters = ParseParameters(theR)
8495 if theShapeType == self.ShapeType["EDGE"]:
8496 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8497 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8499 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8500 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8501 anObj.SetParameters(Parameters)
8502 self._autoPublish(anObj, theName, "fillet")
8505 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8506 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8508 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8511 # get the list of IDs (IDList) for the fillet
8512 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8514 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8515 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8516 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8517 # make a fillet on the specified edges of the given shape
8518 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8520 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8522 if theShapeType == self.ShapeType["EDGE"]:
8523 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8524 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8526 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8527 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8528 anObj.SetParameters(Parameters)
8529 self._autoPublish(anObj, theName, "fillet")
8532 ## Perform a fillet on the specified edges of the given shape
8533 # @param theShape Wire Shape to perform fillet on.
8534 # @param theR Fillet radius.
8535 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8536 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8537 # \note The list of vertices could be empty,
8538 # in this case fillet will done done at all vertices in wire
8539 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8540 # by the length of the edges, nearest to the fillet vertex.
8541 # But sometimes the next edge is C1 continuous with the one, nearest to
8542 # the fillet point, and such two (or more) edges can be united to allow
8543 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8544 # thus ignoring the secant vertex (vertices).
8545 # @param theName Object name; when specified, this parameter is used
8546 # for result publication in the study. Otherwise, if automatic
8547 # publication is switched on, default value is used for result name.
8549 # @return New GEOM.GEOM_Object, containing the result shape.
8551 # @ref tui_fillet2d "Example"
8552 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8554 Perform a fillet on the specified edges of the given shape
8557 theShape Wire Shape to perform fillet on.
8559 theListOfVertexes Global indices of vertexes to perform fillet on.
8560 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8561 by the length of the edges, nearest to the fillet vertex.
8562 But sometimes the next edge is C1 continuous with the one, nearest to
8563 the fillet point, and such two (or more) edges can be united to allow
8564 bigger radius. Set this flag to TRUE to allow collinear edges union,
8565 thus ignoring the secant vertex (vertices).
8566 theName Object name; when specified, this parameter is used
8567 for result publication in the study. Otherwise, if automatic
8568 publication is switched on, default value is used for result name.
8570 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8572 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8575 New GEOM.GEOM_Object, containing the result shape.
8579 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8580 # make fillet at given wire vertices with giver radius
8581 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8583 # Example: see GEOM_TestAll.py
8584 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8585 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8586 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8587 anObj.SetParameters(Parameters)
8588 self._autoPublish(anObj, theName, "fillet")
8591 ## Perform a fillet at the specified vertices of the given face/shell.
8592 # @param theShape Face or Shell shape to perform fillet on.
8593 # @param theR Fillet radius.
8594 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8595 # @param theName Object name; when specified, this parameter is used
8596 # for result publication in the study. Otherwise, if automatic
8597 # publication is switched on, default value is used for result name.
8599 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8601 # @return New GEOM.GEOM_Object, containing the result shape.
8603 # @ref tui_fillet2d "Example"
8604 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8606 Perform a fillet at the specified vertices of the given face/shell.
8609 theShape Face or Shell shape to perform fillet on.
8611 theListOfVertexes Global indices of vertexes to perform fillet on.
8612 theName Object name; when specified, this parameter is used
8613 for result publication in the study. Otherwise, if automatic
8614 publication is switched on, default value is used for result name.
8616 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8619 New GEOM.GEOM_Object, containing the result shape.
8622 face = geompy.MakeFaceHW(100, 100, 1)
8623 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8625 # Example: see GEOM_TestAll.py
8626 theR,Parameters = ParseParameters(theR)
8627 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8628 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8629 anObj.SetParameters(Parameters)
8630 self._autoPublish(anObj, theName, "fillet")
8633 ## Perform a symmetric chamfer on all edges of the given shape.
8634 # @param theShape Shape, to perform chamfer on.
8635 # @param theD Chamfer size along each face.
8636 # @param theName Object name; when specified, this parameter is used
8637 # for result publication in the study. Otherwise, if automatic
8638 # publication is switched on, default value is used for result name.
8640 # @return New GEOM.GEOM_Object, containing the result shape.
8642 # @ref tui_chamfer "Example 1"
8643 # \n @ref swig_MakeChamferAll "Example 2"
8644 def MakeChamferAll(self, theShape, theD, theName=None):
8646 Perform a symmetric chamfer on all edges of the given shape.
8649 theShape Shape, to perform chamfer on.
8650 theD Chamfer size along each face.
8651 theName Object name; when specified, this parameter is used
8652 for result publication in the study. Otherwise, if automatic
8653 publication is switched on, default value is used for result name.
8656 New GEOM.GEOM_Object, containing the result shape.
8659 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8661 # Example: see GEOM_TestOthers.py
8662 theD,Parameters = ParseParameters(theD)
8663 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8664 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8665 anObj.SetParameters(Parameters)
8666 self._autoPublish(anObj, theName, "chamfer")
8669 ## Perform a chamfer on edges, common to the specified faces,
8670 # with distance D1 on the Face1
8671 # @param theShape Shape, to perform chamfer on.
8672 # @param theD1 Chamfer size along \a theFace1.
8673 # @param theD2 Chamfer size along \a theFace2.
8674 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8675 # @param theName Object name; when specified, this parameter is used
8676 # for result publication in the study. Otherwise, if automatic
8677 # publication is switched on, default value is used for result name.
8679 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8681 # @return New GEOM.GEOM_Object, containing the result shape.
8683 # @ref tui_chamfer "Example"
8684 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8686 Perform a chamfer on edges, common to the specified faces,
8687 with distance D1 on the Face1
8690 theShape Shape, to perform chamfer on.
8691 theD1 Chamfer size along theFace1.
8692 theD2 Chamfer size along theFace2.
8693 theFace1,theFace2 Global indices of two faces of theShape.
8694 theName Object name; when specified, this parameter is used
8695 for result publication in the study. Otherwise, if automatic
8696 publication is switched on, default value is used for result name.
8699 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8702 New GEOM.GEOM_Object, containing the result shape.
8705 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8706 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8707 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8708 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8710 # Example: see GEOM_TestAll.py
8711 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8712 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8713 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8714 anObj.SetParameters(Parameters)
8715 self._autoPublish(anObj, theName, "chamfer")
8718 ## Perform a chamfer on edges
8719 # @param theShape Shape, to perform chamfer on.
8720 # @param theD Chamfer length
8721 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8722 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8723 # @param theName Object name; when specified, this parameter is used
8724 # for result publication in the study. Otherwise, if automatic
8725 # publication is switched on, default value is used for result name.
8727 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8729 # @return New GEOM.GEOM_Object, containing the result shape.
8730 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8732 Perform a chamfer on edges
8735 theShape Shape, to perform chamfer on.
8736 theD1 Chamfer size along theFace1.
8737 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8738 theFace1,theFace2 Global indices of two faces of theShape.
8739 theName Object name; when specified, this parameter is used
8740 for result publication in the study. Otherwise, if automatic
8741 publication is switched on, default value is used for result name.
8744 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8747 New GEOM.GEOM_Object, containing the result shape.
8750 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8751 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8752 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8754 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8757 if isinstance(theAngle,str):
8759 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8761 theAngle = theAngle*math.pi/180.0
8762 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8763 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8764 anObj.SetParameters(Parameters)
8765 self._autoPublish(anObj, theName, "chamfer")
8768 ## Perform a chamfer on all edges of the specified faces,
8769 # with distance D1 on the first specified face (if several for one edge)
8770 # @param theShape Shape, to perform chamfer on.
8771 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8772 # connected to the edge, are in \a theFaces, \a theD1
8773 # will be get along face, which is nearer to \a theFaces beginning.
8774 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8775 # @param theFaces Sequence of global indices of faces of \a theShape.
8776 # @param theName Object name; when specified, this parameter is used
8777 # for result publication in the study. Otherwise, if automatic
8778 # publication is switched on, default value is used for result name.
8780 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8782 # @return New GEOM.GEOM_Object, containing the result shape.
8784 # @ref tui_chamfer "Example"
8785 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8787 Perform a chamfer on all edges of the specified faces,
8788 with distance D1 on the first specified face (if several for one edge)
8791 theShape Shape, to perform chamfer on.
8792 theD1 Chamfer size along face from theFaces. If both faces,
8793 connected to the edge, are in theFaces, theD1
8794 will be get along face, which is nearer to theFaces beginning.
8795 theD2 Chamfer size along another of two faces, connected to the edge.
8796 theFaces Sequence of global indices of faces of theShape.
8797 theName Object name; when specified, this parameter is used
8798 for result publication in the study. Otherwise, if automatic
8799 publication is switched on, default value is used for result name.
8801 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8804 New GEOM.GEOM_Object, containing the result shape.
8806 # Example: see GEOM_TestAll.py
8807 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8808 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8809 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8810 anObj.SetParameters(Parameters)
8811 self._autoPublish(anObj, theName, "chamfer")
8814 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8815 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8817 # @ref swig_FilletChamfer "Example"
8818 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8820 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8821 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8824 if isinstance(theAngle,str):
8826 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8828 theAngle = theAngle*math.pi/180.0
8829 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8830 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8831 anObj.SetParameters(Parameters)
8832 self._autoPublish(anObj, theName, "chamfer")
8835 ## Perform a chamfer on edges,
8836 # with distance D1 on the first specified face (if several for one edge)
8837 # @param theShape Shape, to perform chamfer on.
8838 # @param theD1,theD2 Chamfer size
8839 # @param theEdges Sequence of edges of \a theShape.
8840 # @param theName Object name; when specified, this parameter is used
8841 # for result publication in the study. Otherwise, if automatic
8842 # publication is switched on, default value is used for result name.
8844 # @return New GEOM.GEOM_Object, containing the result shape.
8846 # @ref swig_FilletChamfer "Example"
8847 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8849 Perform a chamfer on edges,
8850 with distance D1 on the first specified face (if several for one edge)
8853 theShape Shape, to perform chamfer on.
8854 theD1,theD2 Chamfer size
8855 theEdges Sequence of edges of theShape.
8856 theName Object name; when specified, this parameter is used
8857 for result publication in the study. Otherwise, if automatic
8858 publication is switched on, default value is used for result name.
8861 New GEOM.GEOM_Object, containing the result shape.
8863 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8864 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8865 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8866 anObj.SetParameters(Parameters)
8867 self._autoPublish(anObj, theName, "chamfer")
8870 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8871 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8872 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8874 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8875 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8878 if isinstance(theAngle,str):
8880 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8882 theAngle = theAngle*math.pi/180.0
8883 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8884 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8885 anObj.SetParameters(Parameters)
8886 self._autoPublish(anObj, theName, "chamfer")
8889 ## @sa MakeChamferEdge(), MakeChamferFaces()
8891 # @ref swig_MakeChamfer "Example"
8892 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8894 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8896 # Example: see GEOM_TestOthers.py
8898 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8899 if aShapeType == self.ShapeType["EDGE"]:
8900 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8902 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8905 ## Remove material from a solid by extrusion of the base shape on the given distance.
8906 # @param theInit Shape to remove material from. It must be a solid or
8907 # a compound made of a single solid.
8908 # @param theBase Closed edge or wire defining the base shape to be extruded.
8909 # @param theH Prism dimension along the normal to theBase
8910 # @param theAngle Draft angle in degrees.
8911 # @param theName Object name; when specified, this parameter is used
8912 # for result publication in the study. Otherwise, if automatic
8913 # publication is switched on, default value is used for result name.
8915 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8917 # @ref tui_creation_prism "Example"
8918 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8920 Add material to a solid by extrusion of the base shape on the given distance.
8923 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8924 theBase Closed edge or wire defining the base shape to be extruded.
8925 theH Prism dimension along the normal to theBase
8926 theAngle Draft angle in degrees.
8927 theName Object name; when specified, this parameter is used
8928 for result publication in the study. Otherwise, if automatic
8929 publication is switched on, default value is used for result name.
8932 New GEOM.GEOM_Object, containing the initial shape with removed material.
8934 # Example: see GEOM_TestAll.py
8935 #theH,Parameters = ParseParameters(theH)
8936 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8937 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8938 #anObj.SetParameters(Parameters)
8939 self._autoPublish(anObj, theName, "extrudedCut")
8942 ## Add material to a solid by extrusion of the base shape on the given distance.
8943 # @param theInit Shape to add material to. It must be a solid or
8944 # a compound made of a single solid.
8945 # @param theBase Closed edge or wire defining the base shape to be extruded.
8946 # @param theH Prism dimension along the normal to theBase
8947 # @param theAngle Draft angle in degrees.
8948 # @param theName Object name; when specified, this parameter is used
8949 # for result publication in the study. Otherwise, if automatic
8950 # publication is switched on, default value is used for result name.
8952 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8954 # @ref tui_creation_prism "Example"
8955 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8957 Add material to a solid by extrusion of the base shape on the given distance.
8960 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8961 theBase Closed edge or wire defining the base shape to be extruded.
8962 theH Prism dimension along the normal to theBase
8963 theAngle Draft angle in degrees.
8964 theName Object name; when specified, this parameter is used
8965 for result publication in the study. Otherwise, if automatic
8966 publication is switched on, default value is used for result name.
8969 New GEOM.GEOM_Object, containing the initial shape with added material.
8971 # Example: see GEOM_TestAll.py
8972 #theH,Parameters = ParseParameters(theH)
8973 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8974 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8975 #anObj.SetParameters(Parameters)
8976 self._autoPublish(anObj, theName, "extrudedBoss")
8982 ## @addtogroup l3_basic_op
8985 ## Perform an Archimde operation on the given shape with given parameters.
8986 # The object presenting the resulting face is returned.
8987 # @param theShape Shape to be put in water.
8988 # @param theWeight Weight og the shape.
8989 # @param theWaterDensity Density of the water.
8990 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8991 # @param theName Object name; when specified, this parameter is used
8992 # for result publication in the study. Otherwise, if automatic
8993 # publication is switched on, default value is used for result name.
8995 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8996 # by a plane, corresponding to water level.
8998 # @ref tui_archimede "Example"
8999 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9001 Perform an Archimde operation on the given shape with given parameters.
9002 The object presenting the resulting face is returned.
9005 theShape Shape to be put in water.
9006 theWeight Weight og the shape.
9007 theWaterDensity Density of the water.
9008 theMeshDeflection Deflection of the mesh, using to compute the section.
9009 theName Object name; when specified, this parameter is used
9010 for result publication in the study. Otherwise, if automatic
9011 publication is switched on, default value is used for result name.
9014 New GEOM.GEOM_Object, containing a section of theShape
9015 by a plane, corresponding to water level.
9017 # Example: see GEOM_TestAll.py
9018 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9019 theWeight,theWaterDensity,theMeshDeflection)
9020 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9021 RaiseIfFailed("MakeArchimede", self.LocalOp)
9022 anObj.SetParameters(Parameters)
9023 self._autoPublish(anObj, theName, "archimede")
9026 # end of l3_basic_op
9029 ## @addtogroup l2_measure
9032 ## Get point coordinates
9035 # @ref tui_measurement_tools_page "Example"
9036 def PointCoordinates(self,Point):
9038 Get point coordinates
9043 # Example: see GEOM_TestMeasures.py
9044 aTuple = self.MeasuOp.PointCoordinates(Point)
9045 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9048 ## Get vector coordinates
9051 # @ref tui_measurement_tools_page "Example"
9052 def VectorCoordinates(self,Vector):
9054 Get vector coordinates
9060 p1=self.GetFirstVertex(Vector)
9061 p2=self.GetLastVertex(Vector)
9063 X1=self.PointCoordinates(p1)
9064 X2=self.PointCoordinates(p2)
9066 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9069 ## Compute cross product
9070 # @return vector w=u^v
9072 # @ref tui_measurement_tools_page "Example"
9073 def CrossProduct(self, Vector1, Vector2):
9075 Compute cross product
9077 Returns: vector w=u^v
9079 u=self.VectorCoordinates(Vector1)
9080 v=self.VectorCoordinates(Vector2)
9081 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])
9085 ## Compute cross product
9086 # @return dot product p=u.v
9088 # @ref tui_measurement_tools_page "Example"
9089 def DotProduct(self, Vector1, Vector2):
9091 Compute cross product
9093 Returns: dot product p=u.v
9095 u=self.VectorCoordinates(Vector1)
9096 v=self.VectorCoordinates(Vector2)
9097 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9102 ## Get summarized length of all wires,
9103 # area of surface and volume of the given shape.
9104 # @param theShape Shape to define properties of.
9105 # @return [theLength, theSurfArea, theVolume]\n
9106 # theLength: Summarized length of all wires of the given shape.\n
9107 # theSurfArea: Area of surface of the given shape.\n
9108 # theVolume: Volume of the given shape.
9110 # @ref tui_measurement_tools_page "Example"
9111 def BasicProperties(self,theShape):
9113 Get summarized length of all wires,
9114 area of surface and volume of the given shape.
9117 theShape Shape to define properties of.
9120 [theLength, theSurfArea, theVolume]
9121 theLength: Summarized length of all wires of the given shape.
9122 theSurfArea: Area of surface of the given shape.
9123 theVolume: Volume of the given shape.
9125 # Example: see GEOM_TestMeasures.py
9126 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9127 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9130 ## Get parameters of bounding box of the given shape
9131 # @param theShape Shape to obtain bounding box of.
9132 # @param precise TRUE for precise computation; FALSE for fast one.
9133 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9134 # Xmin,Xmax: Limits of shape along OX axis.
9135 # Ymin,Ymax: Limits of shape along OY axis.
9136 # Zmin,Zmax: Limits of shape along OZ axis.
9138 # @ref tui_measurement_tools_page "Example"
9139 def BoundingBox (self, theShape, precise=False):
9141 Get parameters of bounding box of the given shape
9144 theShape Shape to obtain bounding box of.
9145 precise TRUE for precise computation; FALSE for fast one.
9148 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9149 Xmin,Xmax: Limits of shape along OX axis.
9150 Ymin,Ymax: Limits of shape along OY axis.
9151 Zmin,Zmax: Limits of shape along OZ axis.
9153 # Example: see GEOM_TestMeasures.py
9154 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9155 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9158 ## Get bounding box of the given shape
9159 # @param theShape Shape to obtain bounding box of.
9160 # @param precise TRUE for precise computation; FALSE for fast one.
9161 # @param theName Object name; when specified, this parameter is used
9162 # for result publication in the study. Otherwise, if automatic
9163 # publication is switched on, default value is used for result name.
9165 # @return New GEOM.GEOM_Object, containing the created box.
9167 # @ref tui_measurement_tools_page "Example"
9168 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9170 Get bounding box of the given shape
9173 theShape Shape to obtain bounding box of.
9174 precise TRUE for precise computation; FALSE for fast one.
9175 theName Object name; when specified, this parameter is used
9176 for result publication in the study. Otherwise, if automatic
9177 publication is switched on, default value is used for result name.
9180 New GEOM.GEOM_Object, containing the created box.
9182 # Example: see GEOM_TestMeasures.py
9183 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9184 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9185 self._autoPublish(anObj, theName, "bndbox")
9188 ## Get inertia matrix and moments of inertia of theShape.
9189 # @param theShape Shape to calculate inertia of.
9190 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9191 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9192 # Ix,Iy,Iz: Moments of inertia of the given shape.
9194 # @ref tui_measurement_tools_page "Example"
9195 def Inertia(self,theShape):
9197 Get inertia matrix and moments of inertia of theShape.
9200 theShape Shape to calculate inertia of.
9203 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9204 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9205 Ix,Iy,Iz: Moments of inertia of the given shape.
9207 # Example: see GEOM_TestMeasures.py
9208 aTuple = self.MeasuOp.GetInertia(theShape)
9209 RaiseIfFailed("GetInertia", self.MeasuOp)
9212 ## Get if coords are included in the shape (ST_IN or ST_ON)
9213 # @param theShape Shape
9214 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9215 # @param tolerance to be used (default is 1.0e-7)
9216 # @return list_of_boolean = [res1, res2, ...]
9217 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9219 Get if coords are included in the shape (ST_IN or ST_ON)
9223 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9224 tolerance to be used (default is 1.0e-7)
9227 list_of_boolean = [res1, res2, ...]
9229 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9231 ## Get minimal distance between the given shapes.
9232 # @param theShape1,theShape2 Shapes to find minimal distance between.
9233 # @return Value of the minimal distance between the given shapes.
9235 # @ref tui_measurement_tools_page "Example"
9236 def MinDistance(self, theShape1, theShape2):
9238 Get minimal distance between the given shapes.
9241 theShape1,theShape2 Shapes to find minimal distance between.
9244 Value of the minimal distance between the given shapes.
9246 # Example: see GEOM_TestMeasures.py
9247 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9248 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9251 ## Get minimal distance between the given shapes.
9252 # @param theShape1,theShape2 Shapes to find minimal distance between.
9253 # @return Value of the minimal distance between the given shapes, in form of list
9254 # [Distance, DX, DY, DZ].
9256 # @ref swig_all_measure "Example"
9257 def MinDistanceComponents(self, theShape1, theShape2):
9259 Get minimal distance between the given shapes.
9262 theShape1,theShape2 Shapes to find minimal distance between.
9265 Value of the minimal distance between the given shapes, in form of list
9266 [Distance, DX, DY, DZ]
9268 # Example: see GEOM_TestMeasures.py
9269 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9270 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9271 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9274 ## Get closest points of the given shapes.
9275 # @param theShape1,theShape2 Shapes to find closest points of.
9276 # @return The number of found solutions (-1 in case of infinite number of
9277 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9279 # @ref tui_measurement_tools_page "Example"
9280 def ClosestPoints (self, theShape1, theShape2):
9282 Get closest points of the given shapes.
9285 theShape1,theShape2 Shapes to find closest points of.
9288 The number of found solutions (-1 in case of infinite number of
9289 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9291 # Example: see GEOM_TestMeasures.py
9292 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9293 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9296 ## Get angle between the given shapes in degrees.
9297 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9298 # @note If both arguments are vectors, the angle is computed in accordance
9299 # with their orientations, otherwise the minimum angle is computed.
9300 # @return Value of the angle between the given shapes in degrees.
9302 # @ref tui_measurement_tools_page "Example"
9303 def GetAngle(self, theShape1, theShape2):
9305 Get angle between the given shapes in degrees.
9308 theShape1,theShape2 Lines or linear edges to find angle between.
9311 If both arguments are vectors, the angle is computed in accordance
9312 with their orientations, otherwise the minimum angle is computed.
9315 Value of the angle between the given shapes in degrees.
9317 # Example: see GEOM_TestMeasures.py
9318 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9319 RaiseIfFailed("GetAngle", self.MeasuOp)
9322 ## Get angle between the given shapes in radians.
9323 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9324 # @note If both arguments are vectors, the angle is computed in accordance
9325 # with their orientations, otherwise the minimum angle is computed.
9326 # @return Value of the angle between the given shapes in radians.
9328 # @ref tui_measurement_tools_page "Example"
9329 def GetAngleRadians(self, theShape1, theShape2):
9331 Get angle between the given shapes in radians.
9334 theShape1,theShape2 Lines or linear edges to find angle between.
9338 If both arguments are vectors, the angle is computed in accordance
9339 with their orientations, otherwise the minimum angle is computed.
9342 Value of the angle between the given shapes in radians.
9344 # Example: see GEOM_TestMeasures.py
9345 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9346 RaiseIfFailed("GetAngle", self.MeasuOp)
9349 ## Get angle between the given vectors in degrees.
9350 # @param theShape1,theShape2 Vectors to find angle between.
9351 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9352 # if False, the opposite vector to the normal vector is used.
9353 # @return Value of the angle between the given vectors in degrees.
9355 # @ref tui_measurement_tools_page "Example"
9356 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9358 Get angle between the given vectors in degrees.
9361 theShape1,theShape2 Vectors to find angle between.
9362 theFlag If True, the normal vector is defined by the two vectors cross,
9363 if False, the opposite vector to the normal vector is used.
9366 Value of the angle between the given vectors in degrees.
9368 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9370 anAngle = 360. - anAngle
9371 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9374 ## The same as GetAngleVectors, but the result is in radians.
9375 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9377 Get angle between the given vectors in radians.
9380 theShape1,theShape2 Vectors to find angle between.
9381 theFlag If True, the normal vector is defined by the two vectors cross,
9382 if False, the opposite vector to the normal vector is used.
9385 Value of the angle between the given vectors in radians.
9387 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9390 ## @name Curve Curvature Measurement
9391 # Methods for receiving radius of curvature of curves
9392 # in the given point
9395 ## Measure curvature of a curve at a point, set by parameter.
9396 # @param theCurve a curve.
9397 # @param theParam parameter.
9398 # @return radius of curvature of \a theCurve.
9400 # @ref swig_todo "Example"
9401 def CurveCurvatureByParam(self, theCurve, theParam):
9403 Measure curvature of a curve at a point, set by parameter.
9410 radius of curvature of theCurve.
9412 # Example: see GEOM_TestMeasures.py
9413 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9414 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9417 ## Measure curvature of a curve at a point.
9418 # @param theCurve a curve.
9419 # @param thePoint given point.
9420 # @return radius of curvature of \a theCurve.
9422 # @ref swig_todo "Example"
9423 def CurveCurvatureByPoint(self, theCurve, thePoint):
9425 Measure curvature of a curve at a point.
9429 thePoint given point.
9432 radius of curvature of theCurve.
9434 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9435 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9439 ## @name Surface Curvature Measurement
9440 # Methods for receiving max and min radius of curvature of surfaces
9441 # in the given point
9444 ## Measure max radius of curvature of surface.
9445 # @param theSurf the given surface.
9446 # @param theUParam Value of U-parameter on the referenced surface.
9447 # @param theVParam Value of V-parameter on the referenced surface.
9448 # @return max radius of curvature of theSurf.
9450 ## @ref swig_todo "Example"
9451 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9453 Measure max radius of curvature of surface.
9456 theSurf the given surface.
9457 theUParam Value of U-parameter on the referenced surface.
9458 theVParam Value of V-parameter on the referenced surface.
9461 max radius of curvature of theSurf.
9463 # Example: see GEOM_TestMeasures.py
9464 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9465 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9468 ## Measure max radius of curvature of surface in the given point
9469 # @param theSurf the given surface.
9470 # @param thePoint given point.
9471 # @return max radius of curvature of theSurf.
9473 ## @ref swig_todo "Example"
9474 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9476 Measure max radius of curvature of surface in the given point.
9479 theSurf the given surface.
9480 thePoint given point.
9483 max radius of curvature of theSurf.
9485 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9486 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9489 ## Measure min radius of curvature of surface.
9490 # @param theSurf the given surface.
9491 # @param theUParam Value of U-parameter on the referenced surface.
9492 # @param theVParam Value of V-parameter on the referenced surface.
9493 # @return min radius of curvature of theSurf.
9495 ## @ref swig_todo "Example"
9496 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9498 Measure min radius of curvature of surface.
9501 theSurf the given surface.
9502 theUParam Value of U-parameter on the referenced surface.
9503 theVParam Value of V-parameter on the referenced surface.
9506 Min radius of curvature of theSurf.
9508 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9509 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9512 ## Measure min radius of curvature of surface in the given point
9513 # @param theSurf the given surface.
9514 # @param thePoint given point.
9515 # @return min radius of curvature of theSurf.
9517 ## @ref swig_todo "Example"
9518 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9520 Measure min radius of curvature of surface in the given point.
9523 theSurf the given surface.
9524 thePoint given point.
9527 Min radius of curvature of theSurf.
9529 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9530 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9534 ## Get min and max tolerances of sub-shapes of theShape
9535 # @param theShape Shape, to get tolerances of.
9536 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9537 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9538 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9539 # VertMin,VertMax: Min and max tolerances of the vertices.
9541 # @ref tui_measurement_tools_page "Example"
9542 def Tolerance(self,theShape):
9544 Get min and max tolerances of sub-shapes of theShape
9547 theShape Shape, to get tolerances of.
9550 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9551 FaceMin,FaceMax: Min and max tolerances of the faces.
9552 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9553 VertMin,VertMax: Min and max tolerances of the vertices.
9555 # Example: see GEOM_TestMeasures.py
9556 aTuple = self.MeasuOp.GetTolerance(theShape)
9557 RaiseIfFailed("GetTolerance", self.MeasuOp)
9560 ## Obtain description of the given shape (number of sub-shapes of each type)
9561 # @param theShape Shape to be described.
9562 # @return Description of the given shape.
9564 # @ref tui_measurement_tools_page "Example"
9565 def WhatIs(self,theShape):
9567 Obtain description of the given shape (number of sub-shapes of each type)
9570 theShape Shape to be described.
9573 Description of the given shape.
9575 # Example: see GEOM_TestMeasures.py
9576 aDescr = self.MeasuOp.WhatIs(theShape)
9577 RaiseIfFailed("WhatIs", self.MeasuOp)
9580 ## Obtain quantity of shapes of the given type in \a theShape.
9581 # If \a theShape is of type \a theType, it is also counted.
9582 # @param theShape Shape to be described.
9583 # @param theType the given ShapeType().
9584 # @return Quantity of shapes of type \a theType in \a theShape.
9586 # @ref tui_measurement_tools_page "Example"
9587 def NbShapes (self, theShape, theType):
9589 Obtain quantity of shapes of the given type in theShape.
9590 If theShape is of type theType, it is also counted.
9593 theShape Shape to be described.
9594 theType the given geompy.ShapeType
9597 Quantity of shapes of type theType in theShape.
9599 # Example: see GEOM_TestMeasures.py
9600 listSh = self.SubShapeAllIDs(theShape, theType)
9602 t = EnumToLong(theShape.GetShapeType())
9603 theType = EnumToLong(theType)
9609 ## Obtain quantity of shapes of each type in \a theShape.
9610 # The \a theShape is also counted.
9611 # @param theShape Shape to be described.
9612 # @return Dictionary of ShapeType() with bound quantities of shapes.
9614 # @ref tui_measurement_tools_page "Example"
9615 def ShapeInfo (self, theShape):
9617 Obtain quantity of shapes of each type in theShape.
9618 The theShape is also counted.
9621 theShape Shape to be described.
9624 Dictionary of geompy.ShapeType with bound quantities of shapes.
9626 # Example: see GEOM_TestMeasures.py
9628 for typeSh in self.ShapeType:
9629 if typeSh in ( "AUTO", "SHAPE" ): continue
9630 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9632 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9639 def GetCreationInformation(self, theShape):
9640 info = theShape.GetCreationInformation()
9642 opName = info.operationName
9643 if not opName: opName = "no info available"
9644 res = "Operation: " + opName
9646 for parVal in info.params:
9647 res += " \n %s = %s" % ( parVal.name, parVal.value )
9650 ## Get a point, situated at the centre of mass of theShape.
9651 # @param theShape Shape to define centre of mass of.
9652 # @param theName Object name; when specified, this parameter is used
9653 # for result publication in the study. Otherwise, if automatic
9654 # publication is switched on, default value is used for result name.
9656 # @return New GEOM.GEOM_Object, containing the created point.
9658 # @ref tui_measurement_tools_page "Example"
9659 def MakeCDG(self, theShape, theName=None):
9661 Get a point, situated at the centre of mass of theShape.
9664 theShape Shape to define centre of mass of.
9665 theName Object name; when specified, this parameter is used
9666 for result publication in the study. Otherwise, if automatic
9667 publication is switched on, default value is used for result name.
9670 New GEOM.GEOM_Object, containing the created point.
9672 # Example: see GEOM_TestMeasures.py
9673 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9674 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9675 self._autoPublish(anObj, theName, "centerOfMass")
9678 ## Get a vertex sub-shape by index depended with orientation.
9679 # @param theShape Shape to find sub-shape.
9680 # @param theIndex Index to find vertex by this index (starting from zero)
9681 # @param theName Object name; when specified, this parameter is used
9682 # for result publication in the study. Otherwise, if automatic
9683 # publication is switched on, default value is used for result name.
9685 # @return New GEOM.GEOM_Object, containing the created vertex.
9687 # @ref tui_measurement_tools_page "Example"
9688 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9690 Get a vertex sub-shape by index depended with orientation.
9693 theShape Shape to find sub-shape.
9694 theIndex Index to find vertex by this index (starting from zero)
9695 theName Object name; when specified, this parameter is used
9696 for result publication in the study. Otherwise, if automatic
9697 publication is switched on, default value is used for result name.
9700 New GEOM.GEOM_Object, containing the created vertex.
9702 # Example: see GEOM_TestMeasures.py
9703 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9704 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9705 self._autoPublish(anObj, theName, "vertex")
9708 ## Get the first vertex of wire/edge depended orientation.
9709 # @param theShape Shape to find first vertex.
9710 # @param theName Object name; when specified, this parameter is used
9711 # for result publication in the study. Otherwise, if automatic
9712 # publication is switched on, default value is used for result name.
9714 # @return New GEOM.GEOM_Object, containing the created vertex.
9716 # @ref tui_measurement_tools_page "Example"
9717 def GetFirstVertex(self, theShape, theName=None):
9719 Get the first vertex of wire/edge depended orientation.
9722 theShape Shape to find first vertex.
9723 theName Object name; when specified, this parameter is used
9724 for result publication in the study. Otherwise, if automatic
9725 publication is switched on, default value is used for result name.
9728 New GEOM.GEOM_Object, containing the created vertex.
9730 # Example: see GEOM_TestMeasures.py
9731 # note: auto-publishing is done in self.GetVertexByIndex()
9732 anObj = self.GetVertexByIndex(theShape, 0, theName)
9733 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9736 ## Get the last vertex of wire/edge depended orientation.
9737 # @param theShape Shape to find last vertex.
9738 # @param theName Object name; when specified, this parameter is used
9739 # for result publication in the study. Otherwise, if automatic
9740 # publication is switched on, default value is used for result name.
9742 # @return New GEOM.GEOM_Object, containing the created vertex.
9744 # @ref tui_measurement_tools_page "Example"
9745 def GetLastVertex(self, theShape, theName=None):
9747 Get the last vertex of wire/edge depended orientation.
9750 theShape Shape to find last vertex.
9751 theName Object name; when specified, this parameter is used
9752 for result publication in the study. Otherwise, if automatic
9753 publication is switched on, default value is used for result name.
9756 New GEOM.GEOM_Object, containing the created vertex.
9758 # Example: see GEOM_TestMeasures.py
9759 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9760 # note: auto-publishing is done in self.GetVertexByIndex()
9761 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9762 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9765 ## Get a normale to the given face. If the point is not given,
9766 # the normale is calculated at the center of mass.
9767 # @param theFace Face to define normale of.
9768 # @param theOptionalPoint Point to compute the normale at.
9769 # @param theName Object name; when specified, this parameter is used
9770 # for result publication in the study. Otherwise, if automatic
9771 # publication is switched on, default value is used for result name.
9773 # @return New GEOM.GEOM_Object, containing the created vector.
9775 # @ref swig_todo "Example"
9776 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9778 Get a normale to the given face. If the point is not given,
9779 the normale is calculated at the center of mass.
9782 theFace Face to define normale of.
9783 theOptionalPoint Point to compute the normale at.
9784 theName Object name; when specified, this parameter is used
9785 for result publication in the study. Otherwise, if automatic
9786 publication is switched on, default value is used for result name.
9789 New GEOM.GEOM_Object, containing the created vector.
9791 # Example: see GEOM_TestMeasures.py
9792 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9793 RaiseIfFailed("GetNormal", self.MeasuOp)
9794 self._autoPublish(anObj, theName, "normal")
9797 ## Check a topology of the given shape.
9798 # @param theShape Shape to check validity of.
9799 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9800 # if TRUE, the shape's geometry will be checked also.
9801 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9802 # of problem is printed.
9803 # if TRUE and if theShape is invalid, the description
9804 # of problem is also returned.
9805 # @return TRUE, if the shape "seems to be valid".
9807 # @ref tui_measurement_tools_page "Example"
9808 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9810 Check a topology of the given shape.
9813 theShape Shape to check validity of.
9814 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9815 if TRUE, the shape's geometry will be checked also.
9816 theReturnStatus If FALSE and if theShape is invalid, a description
9817 of problem is printed.
9818 if TRUE and if theShape is invalid, the description
9819 of problem is returned.
9822 TRUE, if the shape "seems to be valid".
9823 If theShape is invalid, prints a description of problem.
9824 This description can also be returned.
9826 # Example: see GEOM_TestMeasures.py
9828 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9829 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9831 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9832 RaiseIfFailed("CheckShape", self.MeasuOp)
9834 if theReturnStatus == 0:
9836 if theReturnStatus == 1:
9837 return (IsValid, Status)
9840 ## Detect self-intersections in the given shape.
9841 # @param theShape Shape to check.
9842 # @return TRUE, if the shape contains no self-intersections.
9844 # @ref tui_measurement_tools_page "Example"
9845 def CheckSelfIntersections(self, theShape):
9847 Detect self-intersections in the given shape.
9850 theShape Shape to check.
9853 TRUE, if the shape contains no self-intersections.
9855 # Example: see GEOM_TestMeasures.py
9856 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9857 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9860 ## Get position (LCS) of theShape.
9862 # Origin of the LCS is situated at the shape's center of mass.
9863 # Axes of the LCS are obtained from shape's location or,
9864 # if the shape is a planar face, from position of its plane.
9866 # @param theShape Shape to calculate position of.
9867 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9868 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9869 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9870 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9872 # @ref swig_todo "Example"
9873 def GetPosition(self,theShape):
9875 Get position (LCS) of theShape.
9876 Origin of the LCS is situated at the shape's center of mass.
9877 Axes of the LCS are obtained from shape's location or,
9878 if the shape is a planar face, from position of its plane.
9881 theShape Shape to calculate position of.
9884 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9885 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9886 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9887 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9889 # Example: see GEOM_TestMeasures.py
9890 aTuple = self.MeasuOp.GetPosition(theShape)
9891 RaiseIfFailed("GetPosition", self.MeasuOp)
9894 ## Get kind of theShape.
9896 # @param theShape Shape to get a kind of.
9897 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9898 # and a list of parameters, describing the shape.
9899 # @note Concrete meaning of each value, returned via \a theIntegers
9900 # or \a theDoubles list depends on the kind() of the shape.
9902 # @ref swig_todo "Example"
9903 def KindOfShape(self,theShape):
9905 Get kind of theShape.
9908 theShape Shape to get a kind of.
9911 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9912 and a list of parameters, describing the shape.
9914 Concrete meaning of each value, returned via theIntegers
9915 or theDoubles list depends on the geompy.kind of the shape
9917 # Example: see GEOM_TestMeasures.py
9918 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9919 RaiseIfFailed("KindOfShape", self.MeasuOp)
9921 aKind = aRoughTuple[0]
9922 anInts = aRoughTuple[1]
9923 aDbls = aRoughTuple[2]
9925 # Now there is no exception from this rule:
9926 aKindTuple = [aKind] + aDbls + anInts
9928 # If they are we will regroup parameters for such kind of shape.
9930 #if aKind == kind.SOME_KIND:
9931 # # SOME_KIND int int double int double double
9932 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9939 ## @addtogroup l2_import_export
9942 ## Import a shape from the BREP or IGES or STEP file
9943 # (depends on given format) with given name.
9944 # @param theFileName The file, containing the shape.
9945 # @param theFormatName Specify format for the file reading.
9946 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9947 # If format 'IGES_SCALE' is used instead of 'IGES' or
9948 # format 'STEP_SCALE' is used instead of 'STEP',
9949 # length unit will be set to 'meter' and result model will be scaled.
9950 # @param theName Object name; when specified, this parameter is used
9951 # for result publication in the study. Otherwise, if automatic
9952 # publication is switched on, default value is used for result name.
9954 # @return New GEOM.GEOM_Object, containing the imported shape.
9956 # @ref swig_Import_Export "Example"
9957 def ImportFile(self, theFileName, theFormatName, theName=None):
9959 Import a shape from the BREP or IGES or STEP file
9960 (depends on given format) with given name.
9963 theFileName The file, containing the shape.
9964 theFormatName Specify format for the file reading.
9965 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9966 If format 'IGES_SCALE' is used instead of 'IGES' or
9967 format 'STEP_SCALE' is used instead of 'STEP',
9968 length unit will be set to 'meter' and result model will be scaled.
9969 theName Object name; when specified, this parameter is used
9970 for result publication in the study. Otherwise, if automatic
9971 publication is switched on, default value is used for result name.
9974 New GEOM.GEOM_Object, containing the imported shape.
9976 # Example: see GEOM_TestOthers.py
9977 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9978 RaiseIfFailed("ImportFile", self.InsertOp)
9979 self._autoPublish(anObj, theName, "imported")
9982 ## Deprecated analog of ImportFile()
9983 def Import(self, theFileName, theFormatName, theName=None):
9985 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9987 print "WARNING: Function Import is deprecated, use ImportFile instead"
9988 # note: auto-publishing is done in self.ImportFile()
9989 return self.ImportFile(theFileName, theFormatName, theName)
9991 ## Shortcut to ImportFile() for BREP format.
9992 # Import a shape from the BREP file with given name.
9993 # @param theFileName The file, containing the shape.
9994 # @param theName Object name; when specified, this parameter is used
9995 # for result publication in the study. Otherwise, if automatic
9996 # publication is switched on, default value is used for result name.
9998 # @return New GEOM.GEOM_Object, containing the imported shape.
10000 # @ref swig_Import_Export "Example"
10001 def ImportBREP(self, theFileName, theName=None):
10003 geompy.ImportFile(...) function for BREP format
10004 Import a shape from the BREP file with given name.
10007 theFileName The file, containing the shape.
10008 theName Object name; when specified, this parameter is used
10009 for result publication in the study. Otherwise, if automatic
10010 publication is switched on, default value is used for result name.
10013 New GEOM.GEOM_Object, containing the imported shape.
10015 # Example: see GEOM_TestOthers.py
10016 # note: auto-publishing is done in self.ImportFile()
10017 return self.ImportFile(theFileName, "BREP", theName)
10019 ## Shortcut to ImportFile() for IGES format
10020 # Import a shape from the IGES file with given name.
10021 # @param theFileName The file, containing the shape.
10022 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10023 # and result model will be scaled, if its units are not meters.
10024 # If False (default), file length units will be taken into account.
10025 # @param theName Object name; when specified, this parameter is used
10026 # for result publication in the study. Otherwise, if automatic
10027 # publication is switched on, default value is used for result name.
10029 # @return New GEOM.GEOM_Object, containing the imported shape.
10031 # @ref swig_Import_Export "Example"
10032 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10034 geompy.ImportFile(...) function for IGES format
10037 theFileName The file, containing the shape.
10038 ignoreUnits If True, file length units will be ignored (set to 'meter')
10039 and result model will be scaled, if its units are not meters.
10040 If False (default), file length units will be taken into account.
10041 theName Object name; when specified, this parameter is used
10042 for result publication in the study. Otherwise, if automatic
10043 publication is switched on, default value is used for result name.
10046 New GEOM.GEOM_Object, containing the imported shape.
10048 # Example: see GEOM_TestOthers.py
10049 # note: auto-publishing is done in self.ImportFile()
10051 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10052 return self.ImportFile(theFileName, "IGES", theName)
10054 ## Return length unit from given IGES file
10055 # @param theFileName The file, containing the shape.
10056 # @return String, containing the units name.
10058 # @ref swig_Import_Export "Example"
10059 def GetIGESUnit(self, theFileName):
10061 Return length units from given IGES file
10064 theFileName The file, containing the shape.
10067 String, containing the units name.
10069 # Example: see GEOM_TestOthers.py
10070 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10073 ## Shortcut to ImportFile() for STEP format
10074 # Import a shape from the STEP file with given name.
10075 # @param theFileName The file, containing the shape.
10076 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10077 # and result model will be scaled, if its units are not meters.
10078 # If False (default), file length units will be taken into account.
10079 # @param theName Object name; when specified, this parameter is used
10080 # for result publication in the study. Otherwise, if automatic
10081 # publication is switched on, default value is used for result name.
10083 # @return New GEOM.GEOM_Object, containing the imported shape.
10085 # @ref swig_Import_Export "Example"
10086 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10088 geompy.ImportFile(...) function for STEP format
10091 theFileName The file, containing the shape.
10092 ignoreUnits If True, file length units will be ignored (set to 'meter')
10093 and result model will be scaled, if its units are not meters.
10094 If False (default), file length units will be taken into account.
10095 theName Object name; when specified, this parameter is used
10096 for result publication in the study. Otherwise, if automatic
10097 publication is switched on, default value is used for result name.
10100 New GEOM.GEOM_Object, containing the imported shape.
10102 # Example: see GEOM_TestOthers.py
10103 # note: auto-publishing is done in self.ImportFile()
10105 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10106 return self.ImportFile(theFileName, "STEP", theName)
10108 ## Return length unit from given IGES or STEP file
10109 # @param theFileName The file, containing the shape.
10110 # @return String, containing the units name.
10112 # @ref swig_Import_Export "Example"
10113 def GetSTEPUnit(self, theFileName):
10115 Return length units from given STEP file
10118 theFileName The file, containing the shape.
10121 String, containing the units name.
10123 # Example: see GEOM_TestOthers.py
10124 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10127 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10128 # @note This method will not be dumped to the python script by DumpStudy functionality.
10129 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10130 # @param theStream The BRep binary stream.
10131 # @param theName Object name; when specified, this parameter is used
10132 # for result publication in the study. Otherwise, if automatic
10133 # publication is switched on, default value is used for result name.
10135 # @return New GEOM_Object, containing the shape, read from theStream.
10137 # @ref swig_Import_Export "Example"
10138 def RestoreShape (self, theStream, theName=None):
10140 Read a shape from the binary stream, containing its bounding representation (BRep).
10143 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10146 theStream The BRep binary stream.
10147 theName Object name; when specified, this parameter is used
10148 for result publication in the study. Otherwise, if automatic
10149 publication is switched on, default value is used for result name.
10152 New GEOM_Object, containing the shape, read from theStream.
10154 # Example: see GEOM_TestOthers.py
10155 anObj = self.InsertOp.RestoreShape(theStream)
10156 RaiseIfFailed("RestoreShape", self.InsertOp)
10157 self._autoPublish(anObj, theName, "restored")
10160 ## Export the given shape into a file with given name.
10161 # @param theObject Shape to be stored in the file.
10162 # @param theFileName Name of the file to store the given shape in.
10163 # @param theFormatName Specify format for the shape storage.
10164 # Available formats can be obtained with
10165 # geompy.InsertOp.ExportTranslators()[0] method.
10167 # @ref swig_Import_Export "Example"
10168 def Export(self, theObject, theFileName, theFormatName):
10170 Export the given shape into a file with given name.
10173 theObject Shape to be stored in the file.
10174 theFileName Name of the file to store the given shape in.
10175 theFormatName Specify format for the shape storage.
10176 Available formats can be obtained with
10177 geompy.InsertOp.ExportTranslators()[0] method.
10179 # Example: see GEOM_TestOthers.py
10180 self.InsertOp.Export(theObject, theFileName, theFormatName)
10181 if self.InsertOp.IsDone() == 0:
10182 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10186 ## Shortcut to Export() for BREP format
10188 # @ref swig_Import_Export "Example"
10189 def ExportBREP(self,theObject, theFileName):
10191 geompy.Export(...) function for BREP format
10193 # Example: see GEOM_TestOthers.py
10194 return self.Export(theObject, theFileName, "BREP")
10196 ## Shortcut to Export() for IGES format
10198 # @ref swig_Import_Export "Example"
10199 def ExportIGES(self,theObject, theFileName):
10201 geompy.Export(...) function for IGES format
10203 # Example: see GEOM_TestOthers.py
10204 return self.Export(theObject, theFileName, "IGES")
10206 ## Shortcut to Export() for STEP format
10208 # @ref swig_Import_Export "Example"
10209 def ExportSTEP(self,theObject, theFileName):
10211 geompy.Export(...) function for STEP format
10213 # Example: see GEOM_TestOthers.py
10214 return self.Export(theObject, theFileName, "STEP")
10216 # end of l2_import_export
10219 ## @addtogroup l3_blocks
10222 ## Create a quadrangle face from four edges. Order of Edges is not
10223 # important. It is not necessary that edges share the same vertex.
10224 # @param E1,E2,E3,E4 Edges for the face bound.
10225 # @param theName Object name; when specified, this parameter is used
10226 # for result publication in the study. Otherwise, if automatic
10227 # publication is switched on, default value is used for result name.
10229 # @return New GEOM.GEOM_Object, containing the created face.
10231 # @ref tui_building_by_blocks_page "Example"
10232 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10234 Create a quadrangle face from four edges. Order of Edges is not
10235 important. It is not necessary that edges share the same vertex.
10238 E1,E2,E3,E4 Edges for the face bound.
10239 theName Object name; when specified, this parameter is used
10240 for result publication in the study. Otherwise, if automatic
10241 publication is switched on, default value is used for result name.
10244 New GEOM.GEOM_Object, containing the created face.
10247 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10249 # Example: see GEOM_Spanner.py
10250 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10251 RaiseIfFailed("MakeQuad", self.BlocksOp)
10252 self._autoPublish(anObj, theName, "quad")
10255 ## Create a quadrangle face on two edges.
10256 # The missing edges will be built by creating the shortest ones.
10257 # @param E1,E2 Two opposite edges for the face.
10258 # @param theName Object name; when specified, this parameter is used
10259 # for result publication in the study. Otherwise, if automatic
10260 # publication is switched on, default value is used for result name.
10262 # @return New GEOM.GEOM_Object, containing the created face.
10264 # @ref tui_building_by_blocks_page "Example"
10265 def MakeQuad2Edges(self, E1, E2, theName=None):
10267 Create a quadrangle face on two edges.
10268 The missing edges will be built by creating the shortest ones.
10271 E1,E2 Two opposite edges for the face.
10272 theName Object name; when specified, this parameter is used
10273 for result publication in the study. Otherwise, if automatic
10274 publication is switched on, default value is used for result name.
10277 New GEOM.GEOM_Object, containing the created face.
10281 p1 = geompy.MakeVertex( 0., 0., 0.)
10282 p2 = geompy.MakeVertex(150., 30., 0.)
10283 p3 = geompy.MakeVertex( 0., 120., 50.)
10284 p4 = geompy.MakeVertex( 0., 40., 70.)
10286 edge1 = geompy.MakeEdge(p1, p2)
10287 edge2 = geompy.MakeEdge(p3, p4)
10288 # create a quadrangle face from two edges
10289 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10291 # Example: see GEOM_Spanner.py
10292 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10293 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10294 self._autoPublish(anObj, theName, "quad")
10297 ## Create a quadrangle face with specified corners.
10298 # The missing edges will be built by creating the shortest ones.
10299 # @param V1,V2,V3,V4 Corner vertices for the face.
10300 # @param theName Object name; when specified, this parameter is used
10301 # for result publication in the study. Otherwise, if automatic
10302 # publication is switched on, default value is used for result name.
10304 # @return New GEOM.GEOM_Object, containing the created face.
10306 # @ref tui_building_by_blocks_page "Example 1"
10307 # \n @ref swig_MakeQuad4Vertices "Example 2"
10308 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10310 Create a quadrangle face with specified corners.
10311 The missing edges will be built by creating the shortest ones.
10314 V1,V2,V3,V4 Corner vertices for the face.
10315 theName Object name; when specified, this parameter is used
10316 for result publication in the study. Otherwise, if automatic
10317 publication is switched on, default value is used for result name.
10320 New GEOM.GEOM_Object, containing the created face.
10324 p1 = geompy.MakeVertex( 0., 0., 0.)
10325 p2 = geompy.MakeVertex(150., 30., 0.)
10326 p3 = geompy.MakeVertex( 0., 120., 50.)
10327 p4 = geompy.MakeVertex( 0., 40., 70.)
10328 # create a quadrangle from four points in its corners
10329 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10331 # Example: see GEOM_Spanner.py
10332 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10333 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10334 self._autoPublish(anObj, theName, "quad")
10337 ## Create a hexahedral solid, bounded by the six given faces. Order of
10338 # faces is not important. It is not necessary that Faces share the same edge.
10339 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10340 # @param theName Object name; when specified, this parameter is used
10341 # for result publication in the study. Otherwise, if automatic
10342 # publication is switched on, default value is used for result name.
10344 # @return New GEOM.GEOM_Object, containing the created solid.
10346 # @ref tui_building_by_blocks_page "Example 1"
10347 # \n @ref swig_MakeHexa "Example 2"
10348 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10350 Create a hexahedral solid, bounded by the six given faces. Order of
10351 faces is not important. It is not necessary that Faces share the same edge.
10354 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10355 theName Object name; when specified, this parameter is used
10356 for result publication in the study. Otherwise, if automatic
10357 publication is switched on, default value is used for result name.
10360 New GEOM.GEOM_Object, containing the created solid.
10363 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10365 # Example: see GEOM_Spanner.py
10366 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10367 RaiseIfFailed("MakeHexa", self.BlocksOp)
10368 self._autoPublish(anObj, theName, "hexa")
10371 ## Create a hexahedral solid between two given faces.
10372 # The missing faces will be built by creating the smallest ones.
10373 # @param F1,F2 Two opposite faces for the hexahedral solid.
10374 # @param theName Object name; when specified, this parameter is used
10375 # for result publication in the study. Otherwise, if automatic
10376 # publication is switched on, default value is used for result name.
10378 # @return New GEOM.GEOM_Object, containing the created solid.
10380 # @ref tui_building_by_blocks_page "Example 1"
10381 # \n @ref swig_MakeHexa2Faces "Example 2"
10382 def MakeHexa2Faces(self, F1, F2, theName=None):
10384 Create a hexahedral solid between two given faces.
10385 The missing faces will be built by creating the smallest ones.
10388 F1,F2 Two opposite faces for the hexahedral solid.
10389 theName Object name; when specified, this parameter is used
10390 for result publication in the study. Otherwise, if automatic
10391 publication is switched on, default value is used for result name.
10394 New GEOM.GEOM_Object, containing the created solid.
10397 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10399 # Example: see GEOM_Spanner.py
10400 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10401 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10402 self._autoPublish(anObj, theName, "hexa")
10408 ## @addtogroup l3_blocks_op
10411 ## Get a vertex, found in the given shape by its coordinates.
10412 # @param theShape Block or a compound of blocks.
10413 # @param theX,theY,theZ Coordinates of the sought vertex.
10414 # @param theEpsilon Maximum allowed distance between the resulting
10415 # vertex and point with the given coordinates.
10416 # @param theName Object name; when specified, this parameter is used
10417 # for result publication in the study. Otherwise, if automatic
10418 # publication is switched on, default value is used for result name.
10420 # @return New GEOM.GEOM_Object, containing the found vertex.
10422 # @ref swig_GetPoint "Example"
10423 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10425 Get a vertex, found in the given shape by its coordinates.
10428 theShape Block or a compound of blocks.
10429 theX,theY,theZ Coordinates of the sought vertex.
10430 theEpsilon Maximum allowed distance between the resulting
10431 vertex and point with the given coordinates.
10432 theName Object name; when specified, this parameter is used
10433 for result publication in the study. Otherwise, if automatic
10434 publication is switched on, default value is used for result name.
10437 New GEOM.GEOM_Object, containing the found vertex.
10440 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10442 # Example: see GEOM_TestOthers.py
10443 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10444 RaiseIfFailed("GetPoint", self.BlocksOp)
10445 self._autoPublish(anObj, theName, "vertex")
10448 ## Find a vertex of the given shape, which has minimal distance to the given point.
10449 # @param theShape Any shape.
10450 # @param thePoint Point, close to the desired vertex.
10451 # @param theName Object name; when specified, this parameter is used
10452 # for result publication in the study. Otherwise, if automatic
10453 # publication is switched on, default value is used for result name.
10455 # @return New GEOM.GEOM_Object, containing the found vertex.
10457 # @ref swig_GetVertexNearPoint "Example"
10458 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10460 Find a vertex of the given shape, which has minimal distance to the given point.
10463 theShape Any shape.
10464 thePoint Point, close to the desired vertex.
10465 theName Object name; when specified, this parameter is used
10466 for result publication in the study. Otherwise, if automatic
10467 publication is switched on, default value is used for result name.
10470 New GEOM.GEOM_Object, containing the found vertex.
10473 pmidle = geompy.MakeVertex(50, 0, 50)
10474 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10476 # Example: see GEOM_TestOthers.py
10477 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10478 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10479 self._autoPublish(anObj, theName, "vertex")
10482 ## Get an edge, found in the given shape by two given vertices.
10483 # @param theShape Block or a compound of blocks.
10484 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10485 # @param theName Object name; when specified, this parameter is used
10486 # for result publication in the study. Otherwise, if automatic
10487 # publication is switched on, default value is used for result name.
10489 # @return New GEOM.GEOM_Object, containing the found edge.
10491 # @ref swig_GetEdge "Example"
10492 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10494 Get an edge, found in the given shape by two given vertices.
10497 theShape Block or a compound of blocks.
10498 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10499 theName Object name; when specified, this parameter is used
10500 for result publication in the study. Otherwise, if automatic
10501 publication is switched on, default value is used for result name.
10504 New GEOM.GEOM_Object, containing the found edge.
10506 # Example: see GEOM_Spanner.py
10507 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10508 RaiseIfFailed("GetEdge", self.BlocksOp)
10509 self._autoPublish(anObj, theName, "edge")
10512 ## Find an edge of the given shape, which has minimal distance to the given point.
10513 # @param theShape Block or a compound of blocks.
10514 # @param thePoint Point, close to the desired edge.
10515 # @param theName Object name; when specified, this parameter is used
10516 # for result publication in the study. Otherwise, if automatic
10517 # publication is switched on, default value is used for result name.
10519 # @return New GEOM.GEOM_Object, containing the found edge.
10521 # @ref swig_GetEdgeNearPoint "Example"
10522 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10524 Find an edge of the given shape, which has minimal distance to the given point.
10527 theShape Block or a compound of blocks.
10528 thePoint Point, close to the desired edge.
10529 theName Object name; when specified, this parameter is used
10530 for result publication in the study. Otherwise, if automatic
10531 publication is switched on, default value is used for result name.
10534 New GEOM.GEOM_Object, containing the found edge.
10536 # Example: see GEOM_TestOthers.py
10537 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10538 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10539 self._autoPublish(anObj, theName, "edge")
10542 ## Returns a face, found in the given shape by four given corner vertices.
10543 # @param theShape Block or a compound of blocks.
10544 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10545 # @param theName Object name; when specified, this parameter is used
10546 # for result publication in the study. Otherwise, if automatic
10547 # publication is switched on, default value is used for result name.
10549 # @return New GEOM.GEOM_Object, containing the found face.
10551 # @ref swig_todo "Example"
10552 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10554 Returns a face, found in the given shape by four given corner vertices.
10557 theShape Block or a compound of blocks.
10558 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10559 theName Object name; when specified, this parameter is used
10560 for result publication in the study. Otherwise, if automatic
10561 publication is switched on, default value is used for result name.
10564 New GEOM.GEOM_Object, containing the found face.
10566 # Example: see GEOM_Spanner.py
10567 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10568 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10569 self._autoPublish(anObj, theName, "face")
10572 ## Get a face of block, found in the given shape by two given edges.
10573 # @param theShape Block or a compound of blocks.
10574 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10575 # @param theName Object name; when specified, this parameter is used
10576 # for result publication in the study. Otherwise, if automatic
10577 # publication is switched on, default value is used for result name.
10579 # @return New GEOM.GEOM_Object, containing the found face.
10581 # @ref swig_todo "Example"
10582 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10584 Get a face of block, found in the given shape by two given edges.
10587 theShape Block or a compound of blocks.
10588 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10589 theName Object name; when specified, this parameter is used
10590 for result publication in the study. Otherwise, if automatic
10591 publication is switched on, default value is used for result name.
10594 New GEOM.GEOM_Object, containing the found face.
10596 # Example: see GEOM_Spanner.py
10597 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10598 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10599 self._autoPublish(anObj, theName, "face")
10602 ## Find a face, opposite to the given one in the given block.
10603 # @param theBlock Must be a hexahedral solid.
10604 # @param theFace Face of \a theBlock, opposite to the desired face.
10605 # @param theName Object name; when specified, this parameter is used
10606 # for result publication in the study. Otherwise, if automatic
10607 # publication is switched on, default value is used for result name.
10609 # @return New GEOM.GEOM_Object, containing the found face.
10611 # @ref swig_GetOppositeFace "Example"
10612 def GetOppositeFace(self, theBlock, theFace, theName=None):
10614 Find a face, opposite to the given one in the given block.
10617 theBlock Must be a hexahedral solid.
10618 theFace Face of theBlock, opposite to the desired face.
10619 theName Object name; when specified, this parameter is used
10620 for result publication in the study. Otherwise, if automatic
10621 publication is switched on, default value is used for result name.
10624 New GEOM.GEOM_Object, containing the found face.
10626 # Example: see GEOM_Spanner.py
10627 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10628 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10629 self._autoPublish(anObj, theName, "face")
10632 ## Find a face of the given shape, which has minimal distance to the given point.
10633 # @param theShape Block or a compound of blocks.
10634 # @param thePoint Point, close to the desired face.
10635 # @param theName Object name; when specified, this parameter is used
10636 # for result publication in the study. Otherwise, if automatic
10637 # publication is switched on, default value is used for result name.
10639 # @return New GEOM.GEOM_Object, containing the found face.
10641 # @ref swig_GetFaceNearPoint "Example"
10642 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10644 Find a face of the given shape, which has minimal distance to the given point.
10647 theShape Block or a compound of blocks.
10648 thePoint Point, close to the desired face.
10649 theName Object name; when specified, this parameter is used
10650 for result publication in the study. Otherwise, if automatic
10651 publication is switched on, default value is used for result name.
10654 New GEOM.GEOM_Object, containing the found face.
10656 # Example: see GEOM_Spanner.py
10657 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10658 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10659 self._autoPublish(anObj, theName, "face")
10662 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10663 # @param theBlock Block or a compound of blocks.
10664 # @param theVector Vector, close to the normale of the desired face.
10665 # @param theName Object name; when specified, this parameter is used
10666 # for result publication in the study. Otherwise, if automatic
10667 # publication is switched on, default value is used for result name.
10669 # @return New GEOM.GEOM_Object, containing the found face.
10671 # @ref swig_todo "Example"
10672 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10674 Find a face of block, whose outside normale has minimal angle with the given vector.
10677 theBlock Block or a compound of blocks.
10678 theVector Vector, close to the normale of the desired face.
10679 theName Object name; when specified, this parameter is used
10680 for result publication in the study. Otherwise, if automatic
10681 publication is switched on, default value is used for result name.
10684 New GEOM.GEOM_Object, containing the found face.
10686 # Example: see GEOM_Spanner.py
10687 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10688 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10689 self._autoPublish(anObj, theName, "face")
10692 ## Find all sub-shapes of type \a theShapeType of the given shape,
10693 # which have minimal distance to the given point.
10694 # @param theShape Any shape.
10695 # @param thePoint Point, close to the desired shape.
10696 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10697 # @param theTolerance The tolerance for distances comparison. All shapes
10698 # with distances to the given point in interval
10699 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10700 # @param theName Object name; when specified, this parameter is used
10701 # for result publication in the study. Otherwise, if automatic
10702 # publication is switched on, default value is used for result name.
10704 # @return New GEOM_Object, containing a group of all found shapes.
10706 # @ref swig_GetShapesNearPoint "Example"
10707 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10709 Find all sub-shapes of type theShapeType of the given shape,
10710 which have minimal distance to the given point.
10713 theShape Any shape.
10714 thePoint Point, close to the desired shape.
10715 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10716 theTolerance The tolerance for distances comparison. All shapes
10717 with distances to the given point in interval
10718 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10719 theName Object name; when specified, this parameter is used
10720 for result publication in the study. Otherwise, if automatic
10721 publication is switched on, default value is used for result name.
10724 New GEOM_Object, containing a group of all found shapes.
10726 # Example: see GEOM_TestOthers.py
10727 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10728 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10729 self._autoPublish(anObj, theName, "group")
10732 # end of l3_blocks_op
10735 ## @addtogroup l4_blocks_measure
10738 ## Check, if the compound of blocks is given.
10739 # To be considered as a compound of blocks, the
10740 # given shape must satisfy the following conditions:
10741 # - Each element of the compound should be a Block (6 faces and 12 edges).
10742 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10743 # - The compound should be connexe.
10744 # - The glue between two quadrangle faces should be applied.
10745 # @param theCompound The compound to check.
10746 # @return TRUE, if the given shape is a compound of blocks.
10747 # If theCompound is not valid, prints all discovered errors.
10749 # @ref tui_measurement_tools_page "Example 1"
10750 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10751 def CheckCompoundOfBlocks(self,theCompound):
10753 Check, if the compound of blocks is given.
10754 To be considered as a compound of blocks, the
10755 given shape must satisfy the following conditions:
10756 - Each element of the compound should be a Block (6 faces and 12 edges).
10757 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10758 - The compound should be connexe.
10759 - The glue between two quadrangle faces should be applied.
10762 theCompound The compound to check.
10765 TRUE, if the given shape is a compound of blocks.
10766 If theCompound is not valid, prints all discovered errors.
10768 # Example: see GEOM_Spanner.py
10769 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10770 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10772 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10776 ## Retrieve all non blocks solids and faces from \a theShape.
10777 # @param theShape The shape to explore.
10778 # @param theName Object name; when specified, this parameter is used
10779 # for result publication in the study. Otherwise, if automatic
10780 # publication is switched on, default value is used for result name.
10782 # @return A tuple of two GEOM_Objects. The first object is a group of all
10783 # non block solids (= not 6 faces, or with 6 faces, but with the
10784 # presence of non-quadrangular faces). The second object is a
10785 # group of all non quadrangular faces.
10787 # @ref tui_measurement_tools_page "Example 1"
10788 # \n @ref swig_GetNonBlocks "Example 2"
10789 def GetNonBlocks (self, theShape, theName=None):
10791 Retrieve all non blocks solids and faces from theShape.
10794 theShape The shape to explore.
10795 theName Object name; when specified, this parameter is used
10796 for result publication in the study. Otherwise, if automatic
10797 publication is switched on, default value is used for result name.
10800 A tuple of two GEOM_Objects. The first object is a group of all
10801 non block solids (= not 6 faces, or with 6 faces, but with the
10802 presence of non-quadrangular faces). The second object is a
10803 group of all non quadrangular faces.
10806 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10808 # Example: see GEOM_Spanner.py
10809 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10810 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10811 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10814 ## Remove all seam and degenerated edges from \a theShape.
10815 # Unite faces and edges, sharing one surface. It means that
10816 # this faces must have references to one C++ surface object (handle).
10817 # @param theShape The compound or single solid to remove irregular edges from.
10818 # @param doUnionFaces If True, then unite faces. If False (the default value),
10819 # do not unite faces.
10820 # @param theName Object name; when specified, this parameter is used
10821 # for result publication in the study. Otherwise, if automatic
10822 # publication is switched on, default value is used for result name.
10824 # @return Improved shape.
10826 # @ref swig_RemoveExtraEdges "Example"
10827 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10829 Remove all seam and degenerated edges from theShape.
10830 Unite faces and edges, sharing one surface. It means that
10831 this faces must have references to one C++ surface object (handle).
10834 theShape The compound or single solid to remove irregular edges from.
10835 doUnionFaces If True, then unite faces. If False (the default value),
10836 do not unite faces.
10837 theName Object name; when specified, this parameter is used
10838 for result publication in the study. Otherwise, if automatic
10839 publication is switched on, default value is used for result name.
10844 # Example: see GEOM_TestOthers.py
10845 nbFacesOptimum = -1 # -1 means do not unite faces
10846 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10847 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10848 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10849 self._autoPublish(anObj, theName, "removeExtraEdges")
10852 ## Performs union faces of \a theShape
10853 # Unite faces sharing one surface. It means that
10854 # these faces must have references to one C++ surface object (handle).
10855 # @param theShape The compound or single solid that contains faces
10856 # to perform union.
10857 # @param theName Object name; when specified, this parameter is used
10858 # for result publication in the study. Otherwise, if automatic
10859 # publication is switched on, default value is used for result name.
10861 # @return Improved shape.
10863 # @ref swig_UnionFaces "Example"
10864 def UnionFaces(self, theShape, theName=None):
10866 Performs union faces of theShape.
10867 Unite faces sharing one surface. It means that
10868 these faces must have references to one C++ surface object (handle).
10871 theShape The compound or single solid that contains faces
10873 theName Object name; when specified, this parameter is used
10874 for result publication in the study. Otherwise, if automatic
10875 publication is switched on, default value is used for result name.
10880 # Example: see GEOM_TestOthers.py
10881 anObj = self.BlocksOp.UnionFaces(theShape)
10882 RaiseIfFailed("UnionFaces", self.BlocksOp)
10883 self._autoPublish(anObj, theName, "unionFaces")
10886 ## Check, if the given shape is a blocks compound.
10887 # Fix all detected errors.
10888 # \note Single block can be also fixed by this method.
10889 # @param theShape The compound to check and improve.
10890 # @param theName Object name; when specified, this parameter is used
10891 # for result publication in the study. Otherwise, if automatic
10892 # publication is switched on, default value is used for result name.
10894 # @return Improved compound.
10896 # @ref swig_CheckAndImprove "Example"
10897 def CheckAndImprove(self, theShape, theName=None):
10899 Check, if the given shape is a blocks compound.
10900 Fix all detected errors.
10903 Single block can be also fixed by this method.
10906 theShape The compound to check and improve.
10907 theName Object name; when specified, this parameter is used
10908 for result publication in the study. Otherwise, if automatic
10909 publication is switched on, default value is used for result name.
10914 # Example: see GEOM_TestOthers.py
10915 anObj = self.BlocksOp.CheckAndImprove(theShape)
10916 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10917 self._autoPublish(anObj, theName, "improved")
10920 # end of l4_blocks_measure
10923 ## @addtogroup l3_blocks_op
10926 ## Get all the blocks, contained in the given compound.
10927 # @param theCompound The compound to explode.
10928 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10929 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10930 # @param theName Object name; when specified, this parameter is used
10931 # for result publication in the study. Otherwise, if automatic
10932 # publication is switched on, default value is used for result name.
10934 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10936 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10938 # @ref tui_explode_on_blocks "Example 1"
10939 # \n @ref swig_MakeBlockExplode "Example 2"
10940 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10942 Get all the blocks, contained in the given compound.
10945 theCompound The compound to explode.
10946 theMinNbFaces If solid has lower number of faces, it is not a block.
10947 theMaxNbFaces If solid has higher number of faces, it is not a block.
10948 theName Object name; when specified, this parameter is used
10949 for result publication in the study. Otherwise, if automatic
10950 publication is switched on, default value is used for result name.
10953 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10956 List of GEOM.GEOM_Object, containing the retrieved blocks.
10958 # Example: see GEOM_TestOthers.py
10959 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10960 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10961 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10962 for anObj in aList:
10963 anObj.SetParameters(Parameters)
10965 self._autoPublish(aList, theName, "block")
10968 ## Find block, containing the given point inside its volume or on boundary.
10969 # @param theCompound Compound, to find block in.
10970 # @param thePoint Point, close to the desired block. If the point lays on
10971 # boundary between some blocks, we return block with nearest center.
10972 # @param theName Object name; when specified, this parameter is used
10973 # for result publication in the study. Otherwise, if automatic
10974 # publication is switched on, default value is used for result name.
10976 # @return New GEOM.GEOM_Object, containing the found block.
10978 # @ref swig_todo "Example"
10979 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10981 Find block, containing the given point inside its volume or on boundary.
10984 theCompound Compound, to find block in.
10985 thePoint Point, close to the desired block. If the point lays on
10986 boundary between some blocks, we return block with nearest center.
10987 theName Object name; when specified, this parameter is used
10988 for result publication in the study. Otherwise, if automatic
10989 publication is switched on, default value is used for result name.
10992 New GEOM.GEOM_Object, containing the found block.
10994 # Example: see GEOM_Spanner.py
10995 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10996 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10997 self._autoPublish(anObj, theName, "block")
11000 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11001 # @param theCompound Compound, to find block in.
11002 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11003 # @param theName Object name; when specified, this parameter is used
11004 # for result publication in the study. Otherwise, if automatic
11005 # publication is switched on, default value is used for result name.
11007 # @return New GEOM.GEOM_Object, containing the found block.
11009 # @ref swig_GetBlockByParts "Example"
11010 def GetBlockByParts(self, theCompound, theParts, theName=None):
11012 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11015 theCompound Compound, to find block in.
11016 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11017 theName Object name; when specified, this parameter is used
11018 for result publication in the study. Otherwise, if automatic
11019 publication is switched on, default value is used for result name.
11022 New GEOM_Object, containing the found block.
11024 # Example: see GEOM_TestOthers.py
11025 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11026 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11027 self._autoPublish(anObj, theName, "block")
11030 ## Return all blocks, containing all the elements, passed as the parts.
11031 # @param theCompound Compound, to find blocks in.
11032 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11033 # @param theName Object name; when specified, this parameter is used
11034 # for result publication in the study. Otherwise, if automatic
11035 # publication is switched on, default value is used for result name.
11037 # @return List of GEOM.GEOM_Object, containing the found blocks.
11039 # @ref swig_todo "Example"
11040 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11042 Return all blocks, containing all the elements, passed as the parts.
11045 theCompound Compound, to find blocks in.
11046 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11047 theName Object name; when specified, this parameter is used
11048 for result publication in the study. Otherwise, if automatic
11049 publication is switched on, default value is used for result name.
11052 List of GEOM.GEOM_Object, containing the found blocks.
11054 # Example: see GEOM_Spanner.py
11055 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11056 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11057 self._autoPublish(aList, theName, "block")
11060 ## Multi-transformate block and glue the result.
11061 # Transformation is defined so, as to superpose direction faces.
11062 # @param Block Hexahedral solid to be multi-transformed.
11063 # @param DirFace1 ID of First direction face.
11064 # @param DirFace2 ID of Second direction face.
11065 # @param NbTimes Quantity of transformations to be done.
11066 # @param theName Object name; when specified, this parameter is used
11067 # for result publication in the study. Otherwise, if automatic
11068 # publication is switched on, default value is used for result name.
11070 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11072 # @return New GEOM.GEOM_Object, containing the result shape.
11074 # @ref tui_multi_transformation "Example"
11075 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11077 Multi-transformate block and glue the result.
11078 Transformation is defined so, as to superpose direction faces.
11081 Block Hexahedral solid to be multi-transformed.
11082 DirFace1 ID of First direction face.
11083 DirFace2 ID of Second direction face.
11084 NbTimes Quantity of transformations to be done.
11085 theName Object name; when specified, this parameter is used
11086 for result publication in the study. Otherwise, if automatic
11087 publication is switched on, default value is used for result name.
11090 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11093 New GEOM.GEOM_Object, containing the result shape.
11095 # Example: see GEOM_Spanner.py
11096 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11097 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11098 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11099 anObj.SetParameters(Parameters)
11100 self._autoPublish(anObj, theName, "transformed")
11103 ## Multi-transformate block and glue the result.
11104 # @param Block Hexahedral solid to be multi-transformed.
11105 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11106 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11107 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11108 # @param theName Object name; when specified, this parameter is used
11109 # for result publication in the study. Otherwise, if automatic
11110 # publication is switched on, default value is used for result name.
11112 # @return New GEOM.GEOM_Object, containing the result shape.
11114 # @ref tui_multi_transformation "Example"
11115 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11116 DirFace1V, DirFace2V, NbTimesV, theName=None):
11118 Multi-transformate block and glue the result.
11121 Block Hexahedral solid to be multi-transformed.
11122 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11123 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11124 NbTimesU,NbTimesV Quantity of transformations to be done.
11125 theName Object name; when specified, this parameter is used
11126 for result publication in the study. Otherwise, if automatic
11127 publication is switched on, default value is used for result name.
11130 New GEOM.GEOM_Object, containing the result shape.
11132 # Example: see GEOM_Spanner.py
11133 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11134 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11135 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11136 DirFace1V, DirFace2V, NbTimesV)
11137 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11138 anObj.SetParameters(Parameters)
11139 self._autoPublish(anObj, theName, "transformed")
11142 ## Build all possible propagation groups.
11143 # Propagation group is a set of all edges, opposite to one (main)
11144 # edge of this group directly or through other opposite edges.
11145 # Notion of Opposite Edge make sence only on quadrangle face.
11146 # @param theShape Shape to build propagation groups on.
11147 # @param theName Object name; when specified, this parameter is used
11148 # for result publication in the study. Otherwise, if automatic
11149 # publication is switched on, default value is used for result name.
11151 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11153 # @ref swig_Propagate "Example"
11154 def Propagate(self, theShape, theName=None):
11156 Build all possible propagation groups.
11157 Propagation group is a set of all edges, opposite to one (main)
11158 edge of this group directly or through other opposite edges.
11159 Notion of Opposite Edge make sence only on quadrangle face.
11162 theShape Shape to build propagation groups on.
11163 theName Object name; when specified, this parameter is used
11164 for result publication in the study. Otherwise, if automatic
11165 publication is switched on, default value is used for result name.
11168 List of GEOM.GEOM_Object, each of them is a propagation group.
11170 # Example: see GEOM_TestOthers.py
11171 listChains = self.BlocksOp.Propagate(theShape)
11172 RaiseIfFailed("Propagate", self.BlocksOp)
11173 self._autoPublish(listChains, theName, "propagate")
11176 # end of l3_blocks_op
11179 ## @addtogroup l3_groups
11182 ## Creates a new group which will store sub-shapes of theMainShape
11183 # @param theMainShape is a GEOM object on which the group is selected
11184 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11185 # @param theName Object name; when specified, this parameter is used
11186 # for result publication in the study. Otherwise, if automatic
11187 # publication is switched on, default value is used for result name.
11189 # @return a newly created GEOM group (GEOM.GEOM_Object)
11191 # @ref tui_working_with_groups_page "Example 1"
11192 # \n @ref swig_CreateGroup "Example 2"
11193 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11195 Creates a new group which will store sub-shapes of theMainShape
11198 theMainShape is a GEOM object on which the group is selected
11199 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11200 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11201 theName Object name; when specified, this parameter is used
11202 for result publication in the study. Otherwise, if automatic
11203 publication is switched on, default value is used for result name.
11206 a newly created GEOM group
11209 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11212 # Example: see GEOM_TestOthers.py
11213 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11214 RaiseIfFailed("CreateGroup", self.GroupOp)
11215 self._autoPublish(anObj, theName, "group")
11218 ## Adds a sub-object with ID theSubShapeId to the group
11219 # @param theGroup is a GEOM group to which the new sub-shape is added
11220 # @param theSubShapeID is a sub-shape ID in the main object.
11221 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11223 # @ref tui_working_with_groups_page "Example"
11224 def AddObject(self,theGroup, theSubShapeID):
11226 Adds a sub-object with ID theSubShapeId to the group
11229 theGroup is a GEOM group to which the new sub-shape is added
11230 theSubShapeID is a sub-shape ID in the main object.
11233 Use method GetSubShapeID() to get an unique ID of the sub-shape
11235 # Example: see GEOM_TestOthers.py
11236 self.GroupOp.AddObject(theGroup, theSubShapeID)
11237 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11238 RaiseIfFailed("AddObject", self.GroupOp)
11242 ## Removes a sub-object with ID \a theSubShapeId from the group
11243 # @param theGroup is a GEOM group from which the new sub-shape is removed
11244 # @param theSubShapeID is a sub-shape ID in the main object.
11245 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11247 # @ref tui_working_with_groups_page "Example"
11248 def RemoveObject(self,theGroup, theSubShapeID):
11250 Removes a sub-object with ID theSubShapeId from the group
11253 theGroup is a GEOM group from which the new sub-shape is removed
11254 theSubShapeID is a sub-shape ID in the main object.
11257 Use method GetSubShapeID() to get an unique ID of the sub-shape
11259 # Example: see GEOM_TestOthers.py
11260 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11261 RaiseIfFailed("RemoveObject", self.GroupOp)
11264 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11265 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11266 # @param theSubShapes is a list of sub-shapes to be added.
11268 # @ref tui_working_with_groups_page "Example"
11269 def UnionList (self,theGroup, theSubShapes):
11271 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11274 theGroup is a GEOM group to which the new sub-shapes are added.
11275 theSubShapes is a list of sub-shapes to be added.
11277 # Example: see GEOM_TestOthers.py
11278 self.GroupOp.UnionList(theGroup, theSubShapes)
11279 RaiseIfFailed("UnionList", self.GroupOp)
11282 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11283 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11284 # @param theSubShapes is a list of indices of sub-shapes to be added.
11286 # @ref swig_UnionIDs "Example"
11287 def UnionIDs(self,theGroup, theSubShapes):
11289 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11292 theGroup is a GEOM group to which the new sub-shapes are added.
11293 theSubShapes is a list of indices of sub-shapes to be added.
11295 # Example: see GEOM_TestOthers.py
11296 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11297 RaiseIfFailed("UnionIDs", self.GroupOp)
11300 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11301 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11302 # @param theSubShapes is a list of sub-shapes to be removed.
11304 # @ref tui_working_with_groups_page "Example"
11305 def DifferenceList (self,theGroup, theSubShapes):
11307 Removes from the group all the given shapes. No errors, if some shapes are not included.
11310 theGroup is a GEOM group from which the sub-shapes are removed.
11311 theSubShapes is a list of sub-shapes to be removed.
11313 # Example: see GEOM_TestOthers.py
11314 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11315 RaiseIfFailed("DifferenceList", self.GroupOp)
11318 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11319 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11320 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11322 # @ref swig_DifferenceIDs "Example"
11323 def DifferenceIDs(self,theGroup, theSubShapes):
11325 Removes from the group all the given shapes. No errors, if some shapes are not included.
11328 theGroup is a GEOM group from which the sub-shapes are removed.
11329 theSubShapes is a list of indices of sub-shapes to be removed.
11331 # Example: see GEOM_TestOthers.py
11332 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11333 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11336 ## Union of two groups.
11337 # New group is created. It will contain all entities
11338 # which are present in groups theGroup1 and theGroup2.
11339 # @param theGroup1, theGroup2 are the initial GEOM groups
11340 # to create the united group from.
11341 # @param theName Object name; when specified, this parameter is used
11342 # for result publication in the study. Otherwise, if automatic
11343 # publication is switched on, default value is used for result name.
11345 # @return a newly created GEOM group.
11347 # @ref tui_union_groups_anchor "Example"
11348 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11350 Union of two groups.
11351 New group is created. It will contain all entities
11352 which are present in groups theGroup1 and theGroup2.
11355 theGroup1, theGroup2 are the initial GEOM groups
11356 to create the united group from.
11357 theName Object name; when specified, this parameter is used
11358 for result publication in the study. Otherwise, if automatic
11359 publication is switched on, default value is used for result name.
11362 a newly created GEOM group.
11364 # Example: see GEOM_TestOthers.py
11365 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11366 RaiseIfFailed("UnionGroups", self.GroupOp)
11367 self._autoPublish(aGroup, theName, "group")
11370 ## Intersection of two groups.
11371 # New group is created. It will contain only those entities
11372 # which are present in both groups theGroup1 and theGroup2.
11373 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11374 # @param theName Object name; when specified, this parameter is used
11375 # for result publication in the study. Otherwise, if automatic
11376 # publication is switched on, default value is used for result name.
11378 # @return a newly created GEOM group.
11380 # @ref tui_intersect_groups_anchor "Example"
11381 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11383 Intersection of two groups.
11384 New group is created. It will contain only those entities
11385 which are present in both groups theGroup1 and theGroup2.
11388 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11389 theName Object name; when specified, this parameter is used
11390 for result publication in the study. Otherwise, if automatic
11391 publication is switched on, default value is used for result name.
11394 a newly created GEOM group.
11396 # Example: see GEOM_TestOthers.py
11397 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11398 RaiseIfFailed("IntersectGroups", self.GroupOp)
11399 self._autoPublish(aGroup, theName, "group")
11402 ## Cut of two groups.
11403 # New group is created. It will contain entities which are
11404 # present in group theGroup1 but are not present in group theGroup2.
11405 # @param theGroup1 is a GEOM group to include elements of.
11406 # @param theGroup2 is a GEOM group to exclude elements of.
11407 # @param theName Object name; when specified, this parameter is used
11408 # for result publication in the study. Otherwise, if automatic
11409 # publication is switched on, default value is used for result name.
11411 # @return a newly created GEOM group.
11413 # @ref tui_cut_groups_anchor "Example"
11414 def CutGroups (self, theGroup1, theGroup2, theName=None):
11417 New group is created. It will contain entities which are
11418 present in group theGroup1 but are not present in group theGroup2.
11421 theGroup1 is a GEOM group to include elements of.
11422 theGroup2 is a GEOM group to exclude elements of.
11423 theName Object name; when specified, this parameter is used
11424 for result publication in the study. Otherwise, if automatic
11425 publication is switched on, default value is used for result name.
11428 a newly created GEOM group.
11430 # Example: see GEOM_TestOthers.py
11431 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11432 RaiseIfFailed("CutGroups", self.GroupOp)
11433 self._autoPublish(aGroup, theName, "group")
11436 ## Union of list of groups.
11437 # New group is created. It will contain all entities that are
11438 # present in groups listed in theGList.
11439 # @param theGList is a list of GEOM groups to create the united group from.
11440 # @param theName Object name; when specified, this parameter is used
11441 # for result publication in the study. Otherwise, if automatic
11442 # publication is switched on, default value is used for result name.
11444 # @return a newly created GEOM group.
11446 # @ref tui_union_groups_anchor "Example"
11447 def UnionListOfGroups (self, theGList, theName=None):
11449 Union of list of groups.
11450 New group is created. It will contain all entities that are
11451 present in groups listed in theGList.
11454 theGList is a list of GEOM groups to create the united group from.
11455 theName Object name; when specified, this parameter is used
11456 for result publication in the study. Otherwise, if automatic
11457 publication is switched on, default value is used for result name.
11460 a newly created GEOM group.
11462 # Example: see GEOM_TestOthers.py
11463 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11464 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11465 self._autoPublish(aGroup, theName, "group")
11468 ## Cut of lists of groups.
11469 # New group is created. It will contain only entities
11470 # which are present in groups listed in theGList.
11471 # @param theGList is a list of GEOM groups to include elements of.
11472 # @param theName Object name; when specified, this parameter is used
11473 # for result publication in the study. Otherwise, if automatic
11474 # publication is switched on, default value is used for result name.
11476 # @return a newly created GEOM group.
11478 # @ref tui_intersect_groups_anchor "Example"
11479 def IntersectListOfGroups (self, theGList, theName=None):
11481 Cut of lists of groups.
11482 New group is created. It will contain only entities
11483 which are present in groups listed in theGList.
11486 theGList is a list of GEOM groups to include elements of.
11487 theName Object name; when specified, this parameter is used
11488 for result publication in the study. Otherwise, if automatic
11489 publication is switched on, default value is used for result name.
11492 a newly created GEOM group.
11494 # Example: see GEOM_TestOthers.py
11495 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11496 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11497 self._autoPublish(aGroup, theName, "group")
11500 ## Cut of lists of groups.
11501 # New group is created. It will contain only entities
11502 # which are present in groups listed in theGList1 but
11503 # are not present in groups from theGList2.
11504 # @param theGList1 is a list of GEOM groups to include elements of.
11505 # @param theGList2 is a list of GEOM groups to exclude elements of.
11506 # @param theName Object name; when specified, this parameter is used
11507 # for result publication in the study. Otherwise, if automatic
11508 # publication is switched on, default value is used for result name.
11510 # @return a newly created GEOM group.
11512 # @ref tui_cut_groups_anchor "Example"
11513 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11515 Cut of lists of groups.
11516 New group is created. It will contain only entities
11517 which are present in groups listed in theGList1 but
11518 are not present in groups from theGList2.
11521 theGList1 is a list of GEOM groups to include elements of.
11522 theGList2 is a list of GEOM groups to exclude elements of.
11523 theName Object name; when specified, this parameter is used
11524 for result publication in the study. Otherwise, if automatic
11525 publication is switched on, default value is used for result name.
11528 a newly created GEOM group.
11530 # Example: see GEOM_TestOthers.py
11531 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11532 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11533 self._autoPublish(aGroup, theName, "group")
11536 ## Returns a list of sub-objects ID stored in the group
11537 # @param theGroup is a GEOM group for which a list of IDs is requested
11539 # @ref swig_GetObjectIDs "Example"
11540 def GetObjectIDs(self,theGroup):
11542 Returns a list of sub-objects ID stored in the group
11545 theGroup is a GEOM group for which a list of IDs is requested
11547 # Example: see GEOM_TestOthers.py
11548 ListIDs = self.GroupOp.GetObjects(theGroup)
11549 RaiseIfFailed("GetObjects", self.GroupOp)
11552 ## Returns a type of sub-objects stored in the group
11553 # @param theGroup is a GEOM group which type is returned.
11555 # @ref swig_GetType "Example"
11556 def GetType(self,theGroup):
11558 Returns a type of sub-objects stored in the group
11561 theGroup is a GEOM group which type is returned.
11563 # Example: see GEOM_TestOthers.py
11564 aType = self.GroupOp.GetType(theGroup)
11565 RaiseIfFailed("GetType", self.GroupOp)
11568 ## Convert a type of geom object from id to string value
11569 # @param theId is a GEOM obect type id.
11570 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11571 # @ref swig_GetType "Example"
11572 def ShapeIdToType(self, theId):
11574 Convert a type of geom object from id to string value
11577 theId is a GEOM obect type id.
11580 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11607 return "REVOLUTION"
11655 return "FREE_BOUNDS"
11663 return "THRUSECTIONS"
11665 return "COMPOUNDFILTER"
11667 return "SHAPES_ON_SHAPE"
11669 return "ELLIPSE_ARC"
11671 return "3DSKETCHER"
11677 return "PIPETSHAPE"
11678 return "Shape Id not exist."
11680 ## Returns a main shape associated with the group
11681 # @param theGroup is a GEOM group for which a main shape object is requested
11682 # @return a GEOM object which is a main shape for theGroup
11684 # @ref swig_GetMainShape "Example"
11685 def GetMainShape(self,theGroup):
11687 Returns a main shape associated with the group
11690 theGroup is a GEOM group for which a main shape object is requested
11693 a GEOM object which is a main shape for theGroup
11695 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11697 # Example: see GEOM_TestOthers.py
11698 anObj = self.GroupOp.GetMainShape(theGroup)
11699 RaiseIfFailed("GetMainShape", self.GroupOp)
11702 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11703 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11704 # @param theShape given shape (see GEOM.GEOM_Object)
11705 # @param min_length minimum length of edges of theShape
11706 # @param max_length maximum length of edges of theShape
11707 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11708 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11709 # @param theName Object name; when specified, this parameter is used
11710 # for result publication in the study. Otherwise, if automatic
11711 # publication is switched on, default value is used for result name.
11713 # @return a newly created GEOM group of edges
11715 # @@ref swig_todo "Example"
11716 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11718 Create group of edges of theShape, whose length is in range [min_length, max_length].
11719 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11722 theShape given shape
11723 min_length minimum length of edges of theShape
11724 max_length maximum length of edges of theShape
11725 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11726 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11727 theName Object name; when specified, this parameter is used
11728 for result publication in the study. Otherwise, if automatic
11729 publication is switched on, default value is used for result name.
11732 a newly created GEOM group of edges.
11734 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11735 edges_in_range = []
11737 Props = self.BasicProperties(edge)
11738 if min_length <= Props[0] and Props[0] <= max_length:
11739 if (not include_min) and (min_length == Props[0]):
11742 if (not include_max) and (Props[0] == max_length):
11745 edges_in_range.append(edge)
11747 if len(edges_in_range) <= 0:
11748 print "No edges found by given criteria"
11751 # note: auto-publishing is done in self.CreateGroup()
11752 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11753 self.UnionList(group_edges, edges_in_range)
11757 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11758 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11759 # @param min_length minimum length of edges of selected shape
11760 # @param max_length maximum length of edges of selected shape
11761 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11762 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11763 # @return a newly created GEOM group of edges
11764 # @ref swig_todo "Example"
11765 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11767 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11768 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11771 min_length minimum length of edges of selected shape
11772 max_length maximum length of edges of selected shape
11773 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11774 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11777 a newly created GEOM group of edges.
11779 nb_selected = sg.SelectedCount()
11780 if nb_selected < 1:
11781 print "Select a shape before calling this function, please."
11783 if nb_selected > 1:
11784 print "Only one shape must be selected"
11787 id_shape = sg.getSelected(0)
11788 shape = IDToObject( id_shape )
11790 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11794 if include_min: left_str = " <= "
11795 if include_max: right_str = " <= "
11797 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11798 + left_str + "length" + right_str + `max_length`)
11800 sg.updateObjBrowser(1)
11807 ## @addtogroup l4_advanced
11810 ## Create a T-shape object with specified caracteristics for the main
11811 # and the incident pipes (radius, width, half-length).
11812 # The extremities of the main pipe are located on junctions points P1 and P2.
11813 # The extremity of the incident pipe is located on junction point P3.
11814 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11815 # the main plane of the T-shape is XOY.
11817 # @param theR1 Internal radius of main pipe
11818 # @param theW1 Width of main pipe
11819 # @param theL1 Half-length of main pipe
11820 # @param theR2 Internal radius of incident pipe (R2 < R1)
11821 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11822 # @param theL2 Half-length of incident pipe
11824 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11825 # @param theP1 1st junction point of main pipe
11826 # @param theP2 2nd junction point of main pipe
11827 # @param theP3 Junction point of incident pipe
11829 # @param theRL Internal radius of left thickness reduction
11830 # @param theWL Width of left thickness reduction
11831 # @param theLtransL Length of left transition part
11832 # @param theLthinL Length of left thin part
11834 # @param theRR Internal radius of right thickness reduction
11835 # @param theWR Width of right thickness reduction
11836 # @param theLtransR Length of right transition part
11837 # @param theLthinR Length of right thin part
11839 # @param theRI Internal radius of incident thickness reduction
11840 # @param theWI Width of incident thickness reduction
11841 # @param theLtransI Length of incident transition part
11842 # @param theLthinI Length of incident thin part
11844 # @param theName Object name; when specified, this parameter is used
11845 # for result publication in the study. Otherwise, if automatic
11846 # publication is switched on, default value is used for result name.
11848 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11850 # @ref tui_creation_pipetshape "Example"
11851 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11852 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11853 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11854 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11855 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11858 Create a T-shape object with specified caracteristics for the main
11859 and the incident pipes (radius, width, half-length).
11860 The extremities of the main pipe are located on junctions points P1 and P2.
11861 The extremity of the incident pipe is located on junction point P3.
11862 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11863 the main plane of the T-shape is XOY.
11866 theR1 Internal radius of main pipe
11867 theW1 Width of main pipe
11868 theL1 Half-length of main pipe
11869 theR2 Internal radius of incident pipe (R2 < R1)
11870 theW2 Width of incident pipe (R2+W2 < R1+W1)
11871 theL2 Half-length of incident pipe
11872 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11873 theP1 1st junction point of main pipe
11874 theP2 2nd junction point of main pipe
11875 theP3 Junction point of incident pipe
11877 theRL Internal radius of left thickness reduction
11878 theWL Width of left thickness reduction
11879 theLtransL Length of left transition part
11880 theLthinL Length of left thin part
11882 theRR Internal radius of right thickness reduction
11883 theWR Width of right thickness reduction
11884 theLtransR Length of right transition part
11885 theLthinR Length of right thin part
11887 theRI Internal radius of incident thickness reduction
11888 theWI Width of incident thickness reduction
11889 theLtransI Length of incident transition part
11890 theLthinI Length of incident thin part
11892 theName Object name; when specified, this parameter is used
11893 for result publication in the study. Otherwise, if automatic
11894 publication is switched on, default value is used for result name.
11897 List of GEOM_Object, containing the created shape and propagation groups.
11900 # create PipeTShape object
11901 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11902 # create PipeTShape object with position
11903 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11904 # create PipeTShape object with left thickness reduction
11905 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11907 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)
11908 if (theP1 and theP2 and theP3):
11909 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11910 theRL, theWL, theLtransL, theLthinL,
11911 theRR, theWR, theLtransR, theLthinR,
11912 theRI, theWI, theLtransI, theLthinI,
11913 theHexMesh, theP1, theP2, theP3)
11915 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11916 theRL, theWL, theLtransL, theLthinL,
11917 theRR, theWR, theLtransR, theLthinR,
11918 theRI, theWI, theLtransI, theLthinI,
11920 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11921 if Parameters: anObj[0].SetParameters(Parameters)
11922 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11923 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11926 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11927 # and the incident pipes (radius, width, half-length). The chamfer is
11928 # created on the junction of the pipes.
11929 # The extremities of the main pipe are located on junctions points P1 and P2.
11930 # The extremity of the incident pipe is located on junction point P3.
11931 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11932 # the main plane of the T-shape is XOY.
11933 # @param theR1 Internal radius of main pipe
11934 # @param theW1 Width of main pipe
11935 # @param theL1 Half-length of main pipe
11936 # @param theR2 Internal radius of incident pipe (R2 < R1)
11937 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11938 # @param theL2 Half-length of incident pipe
11939 # @param theH Height of the chamfer.
11940 # @param theW Width of the chamfer.
11941 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11942 # @param theP1 1st junction point of main pipe
11943 # @param theP2 2nd junction point of main pipe
11944 # @param theP3 Junction point of incident pipe
11946 # @param theRL Internal radius of left thickness reduction
11947 # @param theWL Width of left thickness reduction
11948 # @param theLtransL Length of left transition part
11949 # @param theLthinL Length of left thin part
11951 # @param theRR Internal radius of right thickness reduction
11952 # @param theWR Width of right thickness reduction
11953 # @param theLtransR Length of right transition part
11954 # @param theLthinR Length of right thin part
11956 # @param theRI Internal radius of incident thickness reduction
11957 # @param theWI Width of incident thickness reduction
11958 # @param theLtransI Length of incident transition part
11959 # @param theLthinI Length of incident thin part
11961 # @param theName Object name; when specified, this parameter is used
11962 # for result publication in the study. Otherwise, if automatic
11963 # publication is switched on, default value is used for result name.
11965 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11967 # @ref tui_creation_pipetshape "Example"
11968 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11969 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11970 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11971 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11972 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11975 Create a T-shape object with chamfer and with specified caracteristics for the main
11976 and the incident pipes (radius, width, half-length). The chamfer is
11977 created on the junction of the pipes.
11978 The extremities of the main pipe are located on junctions points P1 and P2.
11979 The extremity of the incident pipe is located on junction point P3.
11980 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11981 the main plane of the T-shape is XOY.
11984 theR1 Internal radius of main pipe
11985 theW1 Width of main pipe
11986 theL1 Half-length of main pipe
11987 theR2 Internal radius of incident pipe (R2 < R1)
11988 theW2 Width of incident pipe (R2+W2 < R1+W1)
11989 theL2 Half-length of incident pipe
11990 theH Height of the chamfer.
11991 theW Width of the chamfer.
11992 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11993 theP1 1st junction point of main pipe
11994 theP2 2nd junction point of main pipe
11995 theP3 Junction point of incident pipe
11997 theRL Internal radius of left thickness reduction
11998 theWL Width of left thickness reduction
11999 theLtransL Length of left transition part
12000 theLthinL Length of left thin part
12002 theRR Internal radius of right thickness reduction
12003 theWR Width of right thickness reduction
12004 theLtransR Length of right transition part
12005 theLthinR Length of right thin part
12007 theRI Internal radius of incident thickness reduction
12008 theWI Width of incident thickness reduction
12009 theLtransI Length of incident transition part
12010 theLthinI Length of incident thin part
12012 theName Object name; when specified, this parameter is used
12013 for result publication in the study. Otherwise, if automatic
12014 publication is switched on, default value is used for result name.
12017 List of GEOM_Object, containing the created shape and propagation groups.
12020 # create PipeTShape with chamfer object
12021 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12022 # create PipeTShape with chamfer object with position
12023 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12024 # create PipeTShape with chamfer object with left thickness reduction
12025 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)
12027 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)
12028 if (theP1 and theP2 and theP3):
12029 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12030 theRL, theWL, theLtransL, theLthinL,
12031 theRR, theWR, theLtransR, theLthinR,
12032 theRI, theWI, theLtransI, theLthinI,
12033 theH, theW, theHexMesh, theP1, theP2, theP3)
12035 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12036 theRL, theWL, theLtransL, theLthinL,
12037 theRR, theWR, theLtransR, theLthinR,
12038 theRI, theWI, theLtransI, theLthinI,
12039 theH, theW, theHexMesh)
12040 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12041 if Parameters: anObj[0].SetParameters(Parameters)
12042 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12043 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12046 ## Create a T-shape object with fillet and with specified caracteristics for the main
12047 # and the incident pipes (radius, width, half-length). The fillet is
12048 # created on the junction of the pipes.
12049 # The extremities of the main pipe are located on junctions points P1 and P2.
12050 # The extremity of the incident pipe is located on junction point P3.
12051 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12052 # the main plane of the T-shape is XOY.
12053 # @param theR1 Internal radius of main pipe
12054 # @param theW1 Width of main pipe
12055 # @param theL1 Half-length of main pipe
12056 # @param theR2 Internal radius of incident pipe (R2 < R1)
12057 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12058 # @param theL2 Half-length of incident pipe
12059 # @param theRF Radius of curvature of fillet.
12060 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12061 # @param theP1 1st junction point of main pipe
12062 # @param theP2 2nd junction point of main pipe
12063 # @param theP3 Junction point of incident pipe
12065 # @param theRL Internal radius of left thickness reduction
12066 # @param theWL Width of left thickness reduction
12067 # @param theLtransL Length of left transition part
12068 # @param theLthinL Length of left thin part
12070 # @param theRR Internal radius of right thickness reduction
12071 # @param theWR Width of right thickness reduction
12072 # @param theLtransR Length of right transition part
12073 # @param theLthinR Length of right thin part
12075 # @param theRI Internal radius of incident thickness reduction
12076 # @param theWI Width of incident thickness reduction
12077 # @param theLtransI Length of incident transition part
12078 # @param theLthinI Length of incident thin part
12080 # @param theName Object name; when specified, this parameter is used
12081 # for result publication in the study. Otherwise, if automatic
12082 # publication is switched on, default value is used for result name.
12084 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12086 # @ref tui_creation_pipetshape "Example"
12087 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12088 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12089 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12090 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12091 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12094 Create a T-shape object with fillet and with specified caracteristics for the main
12095 and the incident pipes (radius, width, half-length). The fillet is
12096 created on the junction of the pipes.
12097 The extremities of the main pipe are located on junctions points P1 and P2.
12098 The extremity of the incident pipe is located on junction point P3.
12101 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12102 the main plane of the T-shape is XOY.
12103 theR1 Internal radius of main pipe
12104 theW1 Width of main pipe
12105 heL1 Half-length of main pipe
12106 theR2 Internal radius of incident pipe (R2 < R1)
12107 theW2 Width of incident pipe (R2+W2 < R1+W1)
12108 theL2 Half-length of incident pipe
12109 theRF Radius of curvature of fillet.
12110 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12111 theP1 1st junction point of main pipe
12112 theP2 2nd junction point of main pipe
12113 theP3 Junction point of incident pipe
12115 theRL Internal radius of left thickness reduction
12116 theWL Width of left thickness reduction
12117 theLtransL Length of left transition part
12118 theLthinL Length of left thin part
12120 theRR Internal radius of right thickness reduction
12121 theWR Width of right thickness reduction
12122 theLtransR Length of right transition part
12123 theLthinR Length of right thin part
12125 theRI Internal radius of incident thickness reduction
12126 theWI Width of incident thickness reduction
12127 theLtransI Length of incident transition part
12128 theLthinI Length of incident thin part
12130 theName Object name; when specified, this parameter is used
12131 for result publication in the study. Otherwise, if automatic
12132 publication is switched on, default value is used for result name.
12135 List of GEOM_Object, containing the created shape and propagation groups.
12138 # create PipeTShape with fillet object
12139 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12140 # create PipeTShape with fillet object with position
12141 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12142 # create PipeTShape with fillet object with left thickness reduction
12143 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)
12145 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)
12146 if (theP1 and theP2 and theP3):
12147 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12148 theRL, theWL, theLtransL, theLthinL,
12149 theRR, theWR, theLtransR, theLthinR,
12150 theRI, theWI, theLtransI, theLthinI,
12151 theRF, theHexMesh, theP1, theP2, theP3)
12153 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12154 theRL, theWL, theLtransL, theLthinL,
12155 theRR, theWR, theLtransR, theLthinR,
12156 theRI, theWI, theLtransI, theLthinI,
12158 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12159 if Parameters: anObj[0].SetParameters(Parameters)
12160 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12161 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12164 ## This function allows creating a disk already divided into blocks. It
12165 # can be used to create divided pipes for later meshing in hexaedra.
12166 # @param theR Radius of the disk
12167 # @param theOrientation Orientation of the plane on which the disk will be built
12168 # 1 = XOY, 2 = OYZ, 3 = OZX
12169 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12170 # @param theName Object name; when specified, this parameter is used
12171 # for result publication in the study. Otherwise, if automatic
12172 # publication is switched on, default value is used for result name.
12174 # @return New GEOM_Object, containing the created shape.
12176 # @ref tui_creation_divideddisk "Example"
12177 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12179 Creates a disk, divided into blocks. It can be used to create divided pipes
12180 for later meshing in hexaedra.
12183 theR Radius of the disk
12184 theOrientation Orientation of the plane on which the disk will be built:
12185 1 = XOY, 2 = OYZ, 3 = OZX
12186 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12187 theName Object name; when specified, this parameter is used
12188 for result publication in the study. Otherwise, if automatic
12189 publication is switched on, default value is used for result name.
12192 New GEOM_Object, containing the created shape.
12194 theR, Parameters = ParseParameters(theR)
12195 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12196 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12197 if Parameters: anObj.SetParameters(Parameters)
12198 self._autoPublish(anObj, theName, "dividedDisk")
12201 ## This function allows creating a disk already divided into blocks. It
12202 # can be used to create divided pipes for later meshing in hexaedra.
12203 # @param theCenter Center of the disk
12204 # @param theVector Normal vector to the plane of the created disk
12205 # @param theRadius Radius of the disk
12206 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12207 # @param theName Object name; when specified, this parameter is used
12208 # for result publication in the study. Otherwise, if automatic
12209 # publication is switched on, default value is used for result name.
12211 # @return New GEOM_Object, containing the created shape.
12213 # @ref tui_creation_divideddisk "Example"
12214 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12216 Creates a disk already divided into blocks. It can be used to create divided pipes
12217 for later meshing in hexaedra.
12220 theCenter Center of the disk
12221 theVector Normal vector to the plane of the created disk
12222 theRadius Radius of the disk
12223 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12224 theName Object name; when specified, this parameter is used
12225 for result publication in the study. Otherwise, if automatic
12226 publication is switched on, default value is used for result name.
12229 New GEOM_Object, containing the created shape.
12231 theRadius, Parameters = ParseParameters(theRadius)
12232 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12233 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12234 if Parameters: anObj.SetParameters(Parameters)
12235 self._autoPublish(anObj, theName, "dividedDisk")
12238 ## Builds a cylinder prepared for hexa meshes
12239 # @param theR Radius of the cylinder
12240 # @param theH Height of the cylinder
12241 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12242 # @param theName Object name; when specified, this parameter is used
12243 # for result publication in the study. Otherwise, if automatic
12244 # publication is switched on, default value is used for result name.
12246 # @return New GEOM_Object, containing the created shape.
12248 # @ref tui_creation_dividedcylinder "Example"
12249 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12251 Builds a cylinder prepared for hexa meshes
12254 theR Radius of the cylinder
12255 theH Height of the cylinder
12256 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12257 theName Object name; when specified, this parameter is used
12258 for result publication in the study. Otherwise, if automatic
12259 publication is switched on, default value is used for result name.
12262 New GEOM_Object, containing the created shape.
12264 theR, theH, Parameters = ParseParameters(theR, theH)
12265 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12266 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12267 if Parameters: anObj.SetParameters(Parameters)
12268 self._autoPublish(anObj, theName, "dividedCylinder")
12271 ## Create a surface from a cloud of points
12272 # @param thelPoints list of points
12273 # @return New GEOM_Object, containing the created shape.
12275 # @ref tui_creation_smoothingsurface "Example"
12276 def MakeSmoothingSurface(self, thelPoints):
12277 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12278 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12281 #@@ insert new functions before this line @@ do not remove this line @@#
12283 # end of l4_advanced
12286 ## Create a copy of the given object
12288 # @param theOriginal geometry object for copy
12289 # @param theName Object name; when specified, this parameter is used
12290 # for result publication in the study. Otherwise, if automatic
12291 # publication is switched on, default value is used for result name.
12293 # @return New GEOM_Object, containing the copied shape.
12295 # @ingroup l1_geomBuilder_auxiliary
12296 # @ref swig_MakeCopy "Example"
12297 def MakeCopy(self, theOriginal, theName=None):
12299 Create a copy of the given object
12302 theOriginal geometry object for copy
12303 theName Object name; when specified, this parameter is used
12304 for result publication in the study. Otherwise, if automatic
12305 publication is switched on, default value is used for result name.
12308 New GEOM_Object, containing the copied shape.
12310 Example of usage: Copy = geompy.MakeCopy(Box)
12312 # Example: see GEOM_TestAll.py
12313 anObj = self.InsertOp.MakeCopy(theOriginal)
12314 RaiseIfFailed("MakeCopy", self.InsertOp)
12315 self._autoPublish(anObj, theName, "copy")
12318 ## Add Path to load python scripts from
12319 # @param Path a path to load python scripts from
12320 # @ingroup l1_geomBuilder_auxiliary
12321 def addPath(self,Path):
12323 Add Path to load python scripts from
12326 Path a path to load python scripts from
12328 if (sys.path.count(Path) < 1):
12329 sys.path.append(Path)
12333 ## Load marker texture from the file
12334 # @param Path a path to the texture file
12335 # @return unique texture identifier
12336 # @ingroup l1_geomBuilder_auxiliary
12337 def LoadTexture(self, Path):
12339 Load marker texture from the file
12342 Path a path to the texture file
12345 unique texture identifier
12347 # Example: see GEOM_TestAll.py
12348 ID = self.InsertOp.LoadTexture(Path)
12349 RaiseIfFailed("LoadTexture", self.InsertOp)
12352 ## Get internal name of the object based on its study entry
12353 # @note This method does not provide an unique identifier of the geometry object.
12354 # @note This is internal function of GEOM component, though it can be used outside it for
12355 # appropriate reason (e.g. for identification of geometry object).
12356 # @param obj geometry object
12357 # @return unique object identifier
12358 # @ingroup l1_geomBuilder_auxiliary
12359 def getObjectID(self, obj):
12361 Get internal name of the object based on its study entry.
12362 Note: this method does not provide an unique identifier of the geometry object.
12363 It is an internal function of GEOM component, though it can be used outside GEOM for
12364 appropriate reason (e.g. for identification of geometry object).
12367 obj geometry object
12370 unique object identifier
12373 entry = salome.ObjectToID(obj)
12374 if entry is not None:
12375 lst = entry.split(":")
12377 ID = lst[-1] # -1 means last item in the list
12378 return "GEOM_" + ID
12383 ## Add marker texture. @a Width and @a Height parameters
12384 # specify width and height of the texture in pixels.
12385 # If @a RowData is @c True, @a Texture parameter should represent texture data
12386 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12387 # parameter should be unpacked string, in which '1' symbols represent opaque
12388 # pixels and '0' represent transparent pixels of the texture bitmap.
12390 # @param Width texture width in pixels
12391 # @param Height texture height in pixels
12392 # @param Texture texture data
12393 # @param RowData if @c True, @a Texture data are packed in the byte stream
12394 # @return unique texture identifier
12395 # @ingroup l1_geomBuilder_auxiliary
12396 def AddTexture(self, Width, Height, Texture, RowData=False):
12398 Add marker texture. Width and Height parameters
12399 specify width and height of the texture in pixels.
12400 If RowData is True, Texture parameter should represent texture data
12401 packed into the byte array. If RowData is False (default), Texture
12402 parameter should be unpacked string, in which '1' symbols represent opaque
12403 pixels and '0' represent transparent pixels of the texture bitmap.
12406 Width texture width in pixels
12407 Height texture height in pixels
12408 Texture texture data
12409 RowData if True, Texture data are packed in the byte stream
12412 return unique texture identifier
12414 if not RowData: Texture = PackData(Texture)
12415 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12416 RaiseIfFailed("AddTexture", self.InsertOp)
12419 ## Creates a new folder object. It is a container for any GEOM objects.
12420 # @param Name name of the container
12421 # @param Father parent object. If None,
12422 # folder under 'Geometry' root object will be created.
12423 # @return a new created folder
12424 def NewFolder(self, Name, Father=None):
12426 Create a new folder object. It is an auxiliary container for any GEOM objects.
12429 Name name of the container
12430 Father parent object. If None,
12431 folder under 'Geometry' root object will be created.
12434 a new created folder
12436 if not Father: Father = self.father
12437 return self.CreateFolder(Name, Father)
12439 ## Move object to the specified folder
12440 # @param Object object to move
12441 # @param Folder target folder
12442 def PutToFolder(self, Object, Folder):
12444 Move object to the specified folder
12447 Object object to move
12448 Folder target folder
12450 self.MoveToFolder(Object, Folder)
12453 ## Move list of objects to the specified folder
12454 # @param ListOfSO list of objects to move
12455 # @param Folder target folder
12456 def PutListToFolder(self, ListOfSO, Folder):
12458 Move list of objects to the specified folder
12461 ListOfSO list of objects to move
12462 Folder target folder
12464 self.MoveListToFolder(ListOfSO, Folder)
12468 # Register the new proxy for GEOM_Gen
12469 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12471 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12472 # interface to GEOM operations.
12477 # salome.salome_init()
12478 # from salome.geom import geomBuilder
12479 # geompy = geomBuilder.New(salome.myStudy)
12481 # @param study SALOME study, generally obtained by salome.myStudy.
12482 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12483 # @return geomBuilder instance
12484 def New( study, instance=None):
12486 Create a new geomBuilder instance.The geomBuilder class provides the Python
12487 interface to GEOM operations.
12491 salome.salome_init()
12492 from salome.geom import geomBuilder
12493 geompy = geomBuilder.New(salome.myStudy)
12496 study SALOME study, generally obtained by salome.myStudy.
12497 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12499 geomBuilder instance
12501 #print "New geomBuilder ", study, instance
12508 geom = geomBuilder()
12509 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12510 geom.init_geom(study)