1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014 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, or (at your option) any later version.
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 ## - 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.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
190 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
192 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
194 ## @defgroup l2_import_export Importing/exporting geometrical objects
195 ## @defgroup l2_creating Creating geometrical objects
197 ## @defgroup l3_basic_go Creating Basic Geometric Objects
199 ## @defgroup l4_curves Creating Curves
202 ## @defgroup l3_3d_primitives Creating 3D Primitives
203 ## @defgroup l3_complex Creating Complex Objects
204 ## @defgroup l3_groups Working with groups
205 ## @defgroup l3_blocks Building by blocks
207 ## @defgroup l4_blocks_measure Check and Improve
210 ## @defgroup l3_sketcher Sketcher
211 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
213 ## @defgroup l4_decompose Decompose objects
214 ## @defgroup l4_decompose_d Decompose objects deprecated methods
215 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
216 ## @defgroup l4_obtain Access to sub-shapes by a criteria
217 ## @defgroup l4_advanced Advanced objects creation functions
222 ## @defgroup l2_transforming Transforming geometrical objects
224 ## @defgroup l3_basic_op Basic Operations
225 ## @defgroup l3_boolean Boolean Operations
226 ## @defgroup l3_transform Transformation Operations
227 ## @defgroup l3_transform_d Transformation Operations deprecated methods
228 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
229 ## @defgroup l3_blocks_op Blocks Operations
230 ## @defgroup l3_healing Repairing Operations
231 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
234 ## @defgroup l2_measure Using measurement tools
235 ## @defgroup l2_field Field on Geometry
239 # initialize SALOME session in try/except block
240 # to avoid problems in some cases, e.g. when generating documentation
248 from salome_notebook import *
254 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
257 def _toListOfNames(_names, _size=-1):
260 if type(_names) in [types.ListType, types.TupleType]:
261 for i in _names: l.append(i)
264 if l and len(l) < _size:
265 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
268 ## Raise an Error, containing the Method_name, if Operation is Failed
269 ## @ingroup l1_geomBuilder_auxiliary
270 def RaiseIfFailed (Method_name, Operation):
271 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
272 Operation.AbortOperation()
273 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
275 Operation.FinishOperation()
278 ## Return list of variables value from salome notebook
279 ## @ingroup l1_geomBuilder_auxiliary
280 def ParseParameters(*parameters):
283 for parameter in parameters:
284 if isinstance(parameter, list):
285 lResults = ParseParameters(*parameter)
286 if len(lResults) > 0:
287 Result.append(lResults[:-1])
288 StringResult += lResults[-1].split(":")
292 if isinstance(parameter,str):
293 if notebook.isVariable(parameter):
294 Result.append(notebook.get(parameter))
296 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
299 Result.append(parameter)
301 StringResult.append(str(parameter))
305 Result.append(":".join(StringResult))
307 Result = ":".join(StringResult)
310 ## Return list of variables value from salome notebook
311 ## @ingroup l1_geomBuilder_auxiliary
315 for parameter in list:
316 if isinstance(parameter,str) and notebook.isVariable(parameter):
317 Result.append(str(notebook.get(parameter)))
320 Result.append(str(parameter))
323 StringResult = StringResult + str(parameter)
324 StringResult = StringResult + ":"
326 StringResult = StringResult[:len(StringResult)-1]
327 return Result, StringResult
329 ## Return list of variables value from salome notebook
330 ## @ingroup l1_geomBuilder_auxiliary
331 def ParseSketcherCommand(command):
334 sections = command.split(":")
335 for section in sections:
336 parameters = section.split(" ")
338 for parameter in parameters:
339 if paramIndex > 1 and parameter.find("'") != -1:
340 parameter = parameter.replace("'","")
341 if notebook.isVariable(parameter):
342 Result = Result + str(notebook.get(parameter)) + " "
345 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
349 Result = Result + str(parameter) + " "
352 StringResult = StringResult + parameter
353 StringResult = StringResult + ":"
355 paramIndex = paramIndex + 1
357 Result = Result[:len(Result)-1] + ":"
359 Result = Result[:len(Result)-1]
360 return Result, StringResult
362 ## Helper function which can be used to pack the passed string to the byte data.
363 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
364 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
367 ## val = PackData("10001110") # val = 0xAE
368 ## val = PackData("1") # val = 0x80
370 ## @param data unpacked data - a string containing '1' and '0' symbols
371 ## @return data packed to the byte stream
372 ## @ingroup l1_geomBuilder_auxiliary
375 Helper function which can be used to pack the passed string to the byte data.
376 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
377 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
380 data unpacked data - a string containing '1' and '0' symbols
383 data packed to the byte stream
386 val = PackData("10001110") # val = 0xAE
387 val = PackData("1") # val = 0x80
390 if len(data)%8: bytes += 1
392 for b in range(bytes):
393 d = data[b*8:(b+1)*8]
398 if d[i] == "1": val += 1
400 raise "Invalid symbol %s" % d[i]
407 ## Read bitmap texture from the text file.
408 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
409 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
410 ## The function returns width and height of the pixmap in pixels and byte stream representing
411 ## texture bitmap itself.
413 ## This function can be used to read the texture to the byte stream in order to pass it to
414 ## the AddTexture() function of geomBuilder class.
417 ## from salome.geom import geomBuilder
418 ## geompy = geomBuilder.New(salome.myStudy)
419 ## texture = geompy.readtexture('mytexture.dat')
420 ## texture = geompy.AddTexture(*texture)
421 ## obj.SetMarkerTexture(texture)
423 ## @param fname texture file name
424 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
425 ## @ingroup l1_geomBuilder_auxiliary
426 def ReadTexture(fname):
428 Read bitmap texture from the text file.
429 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
430 A zero symbol ('0') represents transparent pixel of the texture bitmap.
431 The function returns width and height of the pixmap in pixels and byte stream representing
432 texture bitmap itself.
433 This function can be used to read the texture to the byte stream in order to pass it to
434 the AddTexture() function of geomBuilder class.
437 fname texture file name
440 sequence of tree values: texture's width, height in pixels and its byte stream
443 from salome.geom import geomBuilder
444 geompy = geomBuilder.New(salome.myStudy)
445 texture = geompy.readtexture('mytexture.dat')
446 texture = geompy.AddTexture(*texture)
447 obj.SetMarkerTexture(texture)
451 lines = [ l.strip() for l in f.readlines()]
454 if lines: maxlen = max([len(x) for x in lines])
456 if maxlen%8: lenbytes += 1
460 lenline = (len(line)/8+1)*8
463 lenline = (len(line)/8)*8
465 for i in range(lenline/8):
468 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
471 bytedata += PackData(byte)
473 for i in range(lenline/8, lenbytes):
474 bytedata += PackData("0")
476 return lenbytes*8, len(lines), bytedata
481 ## Returns a long value from enumeration type
482 # Can be used for CORBA enumerator types like GEOM.shape_type
483 # @param theItem enumeration type
484 # @ingroup l1_geomBuilder_auxiliary
485 def EnumToLong(theItem):
487 Returns a long value from enumeration type
488 Can be used for CORBA enumerator types like geomBuilder.ShapeType
491 theItem enumeration type
494 if hasattr(theItem, "_v"): ret = theItem._v
497 ## Information about closed/unclosed state of shell or wire
498 # @ingroup l1_geomBuilder_auxiliary
501 Information about closed/unclosed state of shell or wire
507 ##! Private class used to bind calls of plugin operations to geomBuilder
508 class PluginOperation:
509 def __init__(self, operation, function):
510 self.operation = operation
511 self.function = function
514 def __call__(self, *args):
515 res = self.function(self.operation, *args)
516 RaiseIfFailed(self.function.__name__, self.operation)
519 # Warning: geom is a singleton
525 class geomBuilder(object, GEOM._objref_GEOM_Gen):
527 ## Enumeration ShapeType as a dictionary. \n
528 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
529 # @ingroup l1_geomBuilder_auxiliary
530 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
532 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
533 # and a list of parameters, describing the shape.
534 # List of parameters, describing the shape:
535 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
536 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
538 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
540 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
542 # - SPHERE: [xc yc zc R]
543 # - CYLINDER: [xb yb zb dx dy dz R H]
544 # - BOX: [xc yc zc ax ay az]
545 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
546 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
547 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
548 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
549 # - SOLID: [nb_faces nb_edges nb_vertices]
551 # - SPHERE2D: [xc yc zc R]
552 # - CYLINDER2D: [xb yb zb dx dy dz R H]
553 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
554 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
555 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
556 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
557 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
558 # - PLANE: [xo yo zo dx dy dz]
559 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
560 # - FACE: [nb_edges nb_vertices]
562 # - CIRCLE: [xc yc zc dx dy dz R]
563 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
564 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
565 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
566 # - LINE: [xo yo zo dx dy dz]
567 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
568 # - EDGE: [nb_vertices]
571 # @ingroup l1_geomBuilder_auxiliary
572 kind = GEOM.GEOM_IKindOfShape
579 #print "==== __new__ ", engine, geom, doLcc, created
581 # geom engine is either retrieved from engine, or created
583 # Following test avoids a recursive loop
586 # geom engine not created: existing engine found
588 if doLcc and not created:
590 # FindOrLoadComponent called:
591 # 1. CORBA resolution of server
592 # 2. the __new__ method is called again
593 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
594 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
597 # FindOrLoadComponent not called
599 # geomBuilder instance is created from lcc.FindOrLoadComponent
600 #print "==== super ", engine, geom, doLcc, created
601 geom = super(geomBuilder,cls).__new__(cls)
604 # geom engine not created: existing engine found
605 #print "==== existing ", engine, geom, doLcc, created
607 #print "return geom 1 ", geom
610 #print "return geom 2 ", geom
615 #print "-------- geomBuilder __init__ --- ", created, self
618 GEOM._objref_GEOM_Gen.__init__(self)
619 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
620 self.myBuilder = None
640 ## Process object publication in the study, as follows:
641 # - if @a theName is specified (not None), the object is published in the study
642 # with this name, not taking into account "auto-publishing" option;
643 # - if @a theName is NOT specified, the object is published in the study
644 # (using default name, which can be customized using @a theDefaultName parameter)
645 # only if auto-publishing is switched on.
647 # @param theObj object, a subject for publishing
648 # @param theName object name for study
649 # @param theDefaultName default name for the auto-publishing
651 # @sa addToStudyAuto()
652 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
654 def _item_name(_names, _defname, _idx=-1):
655 if not _names: _names = _defname
656 if type(_names) in [types.ListType, types.TupleType]:
658 if _idx >= len(_names) or not _names[_idx]:
659 if type(_defname) not in [types.ListType, types.TupleType]:
660 _name = "%s_%d"%(_defname, _idx+1)
661 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
662 _name = _defname[_idx]
664 _name = "%noname_%d"%(dn, _idx+1)
670 # must be wrong usage
675 _name = "%s_%d"%(_names, _idx+1)
681 def _publish( _name, _obj ):
683 if isinstance( _obj, GEOM._objref_GEOM_Field ):
684 fatherObj = _obj.GetShape()
685 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
686 fatherObj = _obj.GetField()
687 elif not _obj.IsMainShape():
688 fatherObj = _obj.GetMainShape()
690 if fatherObj and fatherObj.GetStudyEntry():
691 self.addToStudyInFather(fatherObj, _obj, _name)
693 self.addToStudy(_obj, _name)
699 if not theName and not self.myMaxNbSubShapesAllowed:
700 return # nothing to do: auto-publishing is disabled
701 if not theName and not theDefaultName:
702 return # neither theName nor theDefaultName is given
704 if type(theObj) in [types.ListType, types.TupleType]:
705 # list of objects is being published
708 if not obj: continue # bad object
709 name = _item_name(theName, theDefaultName, idx)
710 _publish( name, obj )
712 if not theName and idx == self.myMaxNbSubShapesAllowed: break
716 # single object is published
717 name = _item_name(theName, theDefaultName)
718 _publish( name, theObj )
721 ## @addtogroup l1_geomBuilder_auxiliary
723 def init_geom(self,theStudy):
724 self.myStudy = theStudy
725 self.myStudyId = self.myStudy._get_StudyId()
726 self.myBuilder = self.myStudy.NewBuilder()
727 self.father = self.myStudy.FindComponent("GEOM")
728 if self.father is None:
729 self.father = self.myBuilder.NewComponent("GEOM")
730 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
731 FName = A1._narrow(SALOMEDS.AttributeName)
732 FName.SetValue("Geometry")
733 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
734 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
735 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
736 self.myBuilder.DefineComponentInstance(self.father,self)
738 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
739 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
740 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
741 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
742 self.HealOp = self.GetIHealingOperations (self.myStudyId)
743 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
744 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
745 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
746 self.LocalOp = self.GetILocalOperations (self.myStudyId)
747 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
748 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
749 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
750 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
752 # The below line is a right way to map all plugin functions to geomBuilder,
753 # but AdvancedOperations are already mapped, that is why this line is commented
754 # and presents here only as an axample
755 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
757 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
758 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
760 # set GEOM as root in the use case tree
761 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
762 self.myUseCaseBuilder.SetRootCurrent()
763 self.myUseCaseBuilder.Append(self.father)
766 def GetPluginOperations(self, studyID, libraryName):
767 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
769 # bind methods of operations to self
770 methods = op.__class__.__dict__['__methods__']
771 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
772 for meth_name in methods:
773 if not meth_name in avoid_methods: # avoid basic methods
774 function = getattr(op.__class__, meth_name)
775 if callable(function):
776 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
777 self.__dict__[meth_name] = PluginOperation(op, function)
780 ## Enable / disable results auto-publishing
782 # The automatic publishing is managed in the following way:
783 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
784 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
785 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
786 # value passed as parameter has the same effect.
787 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
788 # maximum number of sub-shapes allowed for publishing is set to specified value.
790 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
791 # @ingroup l1_publish_data
792 def addToStudyAuto(self, maxNbSubShapes=-1):
794 Enable / disable results auto-publishing
796 The automatic publishing is managed in the following way:
797 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
798 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
799 maximum number of sub-shapes allowed for publishing is unlimited; any negative
800 value passed as parameter has the same effect.
801 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
802 maximum number of sub-shapes allowed for publishing is set to this value.
805 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
808 geompy.addToStudyAuto() # enable auto-publishing
809 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
810 geompy.addToStudyAuto(0) # disable auto-publishing
812 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
815 ## Dump component to the Python script
816 # This method overrides IDL function to allow default values for the parameters.
817 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
819 Dump component to the Python script
820 This method overrides IDL function to allow default values for the parameters.
822 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
824 ## Get name for sub-shape aSubObj of shape aMainObj
826 # @ref swig_SubShapeName "Example"
827 def SubShapeName(self,aSubObj, aMainObj):
829 Get name for sub-shape aSubObj of shape aMainObj
831 # Example: see GEOM_TestAll.py
833 #aSubId = orb.object_to_string(aSubObj)
834 #aMainId = orb.object_to_string(aMainObj)
835 #index = gg.getIndexTopology(aSubId, aMainId)
836 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
837 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
838 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
841 ## Publish in study aShape with name aName
843 # \param aShape the shape to be published
844 # \param aName the name for the shape
845 # \param doRestoreSubShapes if True, finds and publishes also
846 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
847 # and published sub-shapes of arguments
848 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
849 # these arguments description
850 # \return study entry of the published shape in form of string
852 # @ingroup l1_publish_data
853 # @ref swig_all_addtostudy "Example"
854 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
855 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
857 Publish in study aShape with name aName
860 aShape the shape to be published
861 aName the name for the shape
862 doRestoreSubShapes if True, finds and publishes also
863 sub-shapes of aShape, corresponding to its arguments
864 and published sub-shapes of arguments
865 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
866 these arguments description
869 study entry of the published shape in form of string
872 id_block1 = geompy.addToStudy(Block1, "Block 1")
874 # Example: see GEOM_TestAll.py
876 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
877 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
878 if doRestoreSubShapes:
879 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
880 theFindMethod, theInheritFirstArg, True )
882 print "addToStudy() failed"
884 return aShape.GetStudyEntry()
886 ## Publish in study aShape with name aName as sub-object of previously published aFather
887 # \param aFather previously published object
888 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
889 # \param aName the name for the shape
891 # \return study entry of the published shape in form of string
893 # @ingroup l1_publish_data
894 # @ref swig_all_addtostudyInFather "Example"
895 def addToStudyInFather(self, aFather, aShape, aName):
897 Publish in study aShape with name aName as sub-object of previously published aFather
900 aFather previously published object
901 aShape the shape to be published as sub-object of aFather
902 aName the name for the shape
905 study entry of the published shape in form of string
907 # Example: see GEOM_TestAll.py
909 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
910 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
912 print "addToStudyInFather() failed"
914 return aShape.GetStudyEntry()
916 ## Unpublish object in study
918 # \param obj the object to be unpublished
919 def hideInStudy(self, obj):
921 Unpublish object in study
924 obj the object to be unpublished
926 ior = salome.orb.object_to_string(obj)
927 aSObject = self.myStudy.FindObjectIOR(ior)
928 if aSObject is not None:
929 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
930 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
931 drwAttribute.SetDrawable(False)
934 # end of l1_geomBuilder_auxiliary
937 ## @addtogroup l3_restore_ss
940 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
941 # To be used from python scripts out of addToStudy() (non-default usage)
942 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
943 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
944 # If this list is empty, all operation arguments will be published
945 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
946 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
947 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
948 # Do not publish sub-shapes in place of arguments, but only
949 # in place of sub-shapes of the first argument,
950 # because the whole shape corresponds to the first argument.
951 # Mainly to be used after transformations, but it also can be
952 # usefull after partition with one object shape, and some other
953 # operations, where only the first argument has to be considered.
954 # If theObject has only one argument shape, this flag is automatically
955 # considered as True, not regarding really passed value.
956 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
957 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
958 # \return list of published sub-shapes
960 # @ref tui_restore_prs_params "Example"
961 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
962 theInheritFirstArg=False, theAddPrefix=True):
964 Publish sub-shapes, standing for arguments and sub-shapes of arguments
965 To be used from python scripts out of geompy.addToStudy (non-default usage)
968 theObject published GEOM.GEOM_Object, arguments of which will be published
969 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
970 If this list is empty, all operation arguments will be published
971 theFindMethod method to search sub-shapes, corresponding to arguments and
972 their sub-shapes. Value from enumeration GEOM.find_shape_method.
973 theInheritFirstArg set properties of the first argument for theObject.
974 Do not publish sub-shapes in place of arguments, but only
975 in place of sub-shapes of the first argument,
976 because the whole shape corresponds to the first argument.
977 Mainly to be used after transformations, but it also can be
978 usefull after partition with one object shape, and some other
979 operations, where only the first argument has to be considered.
980 If theObject has only one argument shape, this flag is automatically
981 considered as True, not regarding really passed value.
982 theAddPrefix add prefix "from_" to names of restored sub-shapes,
983 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.RestoreSubShapesO(self.myStudy, theObject, theArgs,
989 theFindMethod, theInheritFirstArg, theAddPrefix)
991 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
992 # To be used from python scripts out of addToStudy() (non-default usage)
993 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
994 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
995 # If this list is empty, all operation arguments will be published
996 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
997 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
998 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
999 # Do not publish sub-shapes in place of arguments, but only
1000 # in place of sub-shapes of the first argument,
1001 # because the whole shape corresponds to the first argument.
1002 # Mainly to be used after transformations, but it also can be
1003 # usefull after partition with one object shape, and some other
1004 # operations, where only the first argument has to be considered.
1005 # If theObject has only one argument shape, this flag is automatically
1006 # considered as True, not regarding really passed value.
1007 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1008 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1009 # \return list of published sub-shapes
1011 # @ref tui_restore_prs_params "Example"
1012 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1013 theInheritFirstArg=False, theAddPrefix=True):
1015 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1016 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1019 theObject published GEOM.GEOM_Object, arguments of which will be published
1020 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1021 If this list is empty, all operation arguments will be published
1022 theFindMethod method to search sub-shapes, corresponding to arguments and
1023 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1024 theInheritFirstArg set properties of the first argument for theObject.
1025 Do not publish sub-shapes in place of arguments, but only
1026 in place of sub-shapes of the first argument,
1027 because the whole shape corresponds to the first argument.
1028 Mainly to be used after transformations, but it also can be
1029 usefull after partition with one object shape, and some other
1030 operations, where only the first argument has to be considered.
1031 If theObject has only one argument shape, this flag is automatically
1032 considered as True, not regarding really passed value.
1033 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1034 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1037 list of published sub-shapes
1039 # Example: see GEOM_TestAll.py
1040 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1041 theFindMethod, theInheritFirstArg, theAddPrefix)
1043 # end of l3_restore_ss
1046 ## @addtogroup l3_basic_go
1049 ## Create point by three coordinates.
1050 # @param theX The X coordinate of the point.
1051 # @param theY The Y coordinate of the point.
1052 # @param theZ The Z coordinate of the point.
1053 # @param theName Object name; when specified, this parameter is used
1054 # for result publication in the study. Otherwise, if automatic
1055 # publication is switched on, default value is used for result name.
1057 # @return New GEOM.GEOM_Object, containing the created point.
1059 # @ref tui_creation_point "Example"
1060 def MakeVertex(self, theX, theY, theZ, theName=None):
1062 Create point by three coordinates.
1065 theX The X coordinate of the point.
1066 theY The Y coordinate of the point.
1067 theZ The Z coordinate of the point.
1068 theName Object name; when specified, this parameter is used
1069 for result publication in the study. Otherwise, if automatic
1070 publication is switched on, default value is used for result name.
1073 New GEOM.GEOM_Object, containing the created point.
1075 # Example: see GEOM_TestAll.py
1076 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1077 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1078 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1079 anObj.SetParameters(Parameters)
1080 self._autoPublish(anObj, theName, "vertex")
1083 ## Create a point, distant from the referenced point
1084 # on the given distances along the coordinate axes.
1085 # @param theReference The referenced point.
1086 # @param theX Displacement from the referenced point along OX axis.
1087 # @param theY Displacement from the referenced point along OY axis.
1088 # @param theZ Displacement from the referenced point along OZ axis.
1089 # @param theName Object name; when specified, this parameter is used
1090 # for result publication in the study. Otherwise, if automatic
1091 # publication is switched on, default value is used for result name.
1093 # @return New GEOM.GEOM_Object, containing the created point.
1095 # @ref tui_creation_point "Example"
1096 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1098 Create a point, distant from the referenced point
1099 on the given distances along the coordinate axes.
1102 theReference The referenced point.
1103 theX Displacement from the referenced point along OX axis.
1104 theY Displacement from the referenced point along OY axis.
1105 theZ Displacement from the referenced point along OZ axis.
1106 theName Object name; when specified, this parameter is used
1107 for result publication in the study. Otherwise, if automatic
1108 publication is switched on, default value is used for result name.
1111 New GEOM.GEOM_Object, containing the created point.
1113 # Example: see GEOM_TestAll.py
1114 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1115 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1116 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1117 anObj.SetParameters(Parameters)
1118 self._autoPublish(anObj, theName, "vertex")
1121 ## Create a point, corresponding to the given parameter on the given curve.
1122 # @param theRefCurve The referenced curve.
1123 # @param theParameter Value of parameter on the referenced curve.
1124 # @param theName Object name; when specified, this parameter is used
1125 # for result publication in the study. Otherwise, if automatic
1126 # publication is switched on, default value is used for result name.
1128 # @return New GEOM.GEOM_Object, containing the created point.
1130 # @ref tui_creation_point "Example"
1131 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1133 Create a point, corresponding to the given parameter on the given curve.
1136 theRefCurve The referenced curve.
1137 theParameter Value of parameter on the referenced curve.
1138 theName Object name; when specified, this parameter is used
1139 for result publication in the study. Otherwise, if automatic
1140 publication is switched on, default value is used for result name.
1143 New GEOM.GEOM_Object, containing the created point.
1146 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1148 # Example: see GEOM_TestAll.py
1149 theParameter, Parameters = ParseParameters(theParameter)
1150 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1151 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1152 anObj.SetParameters(Parameters)
1153 self._autoPublish(anObj, theName, "vertex")
1156 ## Create a point by projection give coordinates on the given curve
1157 # @param theRefCurve The referenced curve.
1158 # @param theX X-coordinate in 3D space
1159 # @param theY Y-coordinate in 3D space
1160 # @param theZ Z-coordinate in 3D space
1161 # @param theName Object name; when specified, this parameter is used
1162 # for result publication in the study. Otherwise, if automatic
1163 # publication is switched on, default value is used for result name.
1165 # @return New GEOM.GEOM_Object, containing the created point.
1167 # @ref tui_creation_point "Example"
1168 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1170 Create a point by projection give coordinates on the given curve
1173 theRefCurve The referenced curve.
1174 theX X-coordinate in 3D space
1175 theY Y-coordinate in 3D space
1176 theZ Z-coordinate in 3D space
1177 theName Object name; when specified, this parameter is used
1178 for result publication in the study. Otherwise, if automatic
1179 publication is switched on, default value is used for result name.
1182 New GEOM.GEOM_Object, containing the created point.
1185 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1187 # Example: see GEOM_TestAll.py
1188 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1189 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1190 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1191 anObj.SetParameters(Parameters)
1192 self._autoPublish(anObj, theName, "vertex")
1195 ## Create a point, corresponding to the given length on the given curve.
1196 # @param theRefCurve The referenced curve.
1197 # @param theLength Length on the referenced curve. It can be negative.
1198 # @param theStartPoint Point allowing to choose the direction for the calculation
1199 # of the length. If None, start from the first point of theRefCurve.
1200 # @param 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.
1204 # @return New GEOM.GEOM_Object, containing the created point.
1206 # @ref tui_creation_point "Example"
1207 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1209 Create a point, corresponding to the given length on the given curve.
1212 theRefCurve The referenced curve.
1213 theLength Length on the referenced curve. It can be negative.
1214 theStartPoint Point allowing to choose the direction for the calculation
1215 of the length. If None, start from the first point of theRefCurve.
1216 theName Object name; when specified, this parameter is used
1217 for result publication in the study. Otherwise, if automatic
1218 publication is switched on, default value is used for result name.
1221 New GEOM.GEOM_Object, containing the created point.
1223 # Example: see GEOM_TestAll.py
1224 theLength, Parameters = ParseParameters(theLength)
1225 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1226 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1227 anObj.SetParameters(Parameters)
1228 self._autoPublish(anObj, theName, "vertex")
1231 ## Create a point, corresponding to the given parameters on the
1233 # @param theRefSurf The referenced surface.
1234 # @param theUParameter Value of U-parameter on the referenced surface.
1235 # @param theVParameter Value of V-parameter on the referenced surface.
1236 # @param theName Object name; when specified, this parameter is used
1237 # for result publication in the study. Otherwise, if automatic
1238 # publication is switched on, default value is used for result name.
1240 # @return New GEOM.GEOM_Object, containing the created point.
1242 # @ref swig_MakeVertexOnSurface "Example"
1243 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1245 Create a point, corresponding to the given parameters on the
1249 theRefSurf The referenced surface.
1250 theUParameter Value of U-parameter on the referenced surface.
1251 theVParameter Value of V-parameter on the referenced surface.
1252 theName Object name; when specified, this parameter is used
1253 for result publication in the study. Otherwise, if automatic
1254 publication is switched on, default value is used for result name.
1257 New GEOM.GEOM_Object, containing the created point.
1260 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1262 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1263 # Example: see GEOM_TestAll.py
1264 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1265 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1266 anObj.SetParameters(Parameters);
1267 self._autoPublish(anObj, theName, "vertex")
1270 ## Create a point by projection give coordinates on the given surface
1271 # @param theRefSurf The referenced surface.
1272 # @param theX X-coordinate in 3D space
1273 # @param theY Y-coordinate in 3D space
1274 # @param theZ Z-coordinate in 3D space
1275 # @param theName Object name; when specified, this parameter is used
1276 # for result publication in the study. Otherwise, if automatic
1277 # publication is switched on, default value is used for result name.
1279 # @return New GEOM.GEOM_Object, containing the created point.
1281 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1282 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1284 Create a point by projection give coordinates on the given surface
1287 theRefSurf The referenced surface.
1288 theX X-coordinate in 3D space
1289 theY Y-coordinate in 3D space
1290 theZ Z-coordinate in 3D space
1291 theName Object name; when specified, this parameter is used
1292 for result publication in the study. Otherwise, if automatic
1293 publication is switched on, default value is used for result name.
1296 New GEOM.GEOM_Object, containing the created point.
1299 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1301 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1302 # Example: see GEOM_TestAll.py
1303 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1304 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1305 anObj.SetParameters(Parameters);
1306 self._autoPublish(anObj, theName, "vertex")
1309 ## Create a point, which lays on the given face.
1310 # The point will lay in arbitrary place of the face.
1311 # The only condition on it is a non-zero distance to the face boundary.
1312 # Such point can be used to uniquely identify the face inside any
1313 # shape in case, when the shape does not contain overlapped faces.
1314 # @param theFace The referenced face.
1315 # @param theName Object name; when specified, this parameter is used
1316 # for result publication in the study. Otherwise, if automatic
1317 # publication is switched on, default value is used for result name.
1319 # @return New GEOM.GEOM_Object, containing the created point.
1321 # @ref swig_MakeVertexInsideFace "Example"
1322 def MakeVertexInsideFace (self, theFace, theName=None):
1324 Create a point, which lays on the given face.
1325 The point will lay in arbitrary place of the face.
1326 The only condition on it is a non-zero distance to the face boundary.
1327 Such point can be used to uniquely identify the face inside any
1328 shape in case, when the shape does not contain overlapped faces.
1331 theFace The referenced face.
1332 theName Object name; when specified, this parameter is used
1333 for result publication in the study. Otherwise, if automatic
1334 publication is switched on, default value is used for result name.
1337 New GEOM.GEOM_Object, containing the created point.
1340 p_on_face = geompy.MakeVertexInsideFace(Face)
1342 # Example: see GEOM_TestAll.py
1343 anObj = self.BasicOp.MakePointOnFace(theFace)
1344 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1345 self._autoPublish(anObj, theName, "vertex")
1348 ## Create a point on intersection of two lines.
1349 # @param theRefLine1, theRefLine2 The referenced lines.
1350 # @param theName Object name; when specified, this parameter is used
1351 # for result publication in the study. Otherwise, if automatic
1352 # publication is switched on, default value is used for result name.
1354 # @return New GEOM.GEOM_Object, containing the created point.
1356 # @ref swig_MakeVertexOnLinesIntersection "Example"
1357 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1359 Create a point on intersection of two lines.
1362 theRefLine1, theRefLine2 The referenced lines.
1363 theName Object name; when specified, this parameter is used
1364 for result publication in the study. Otherwise, if automatic
1365 publication is switched on, default value is used for result name.
1368 New GEOM.GEOM_Object, containing the created point.
1370 # Example: see GEOM_TestAll.py
1371 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1372 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1373 self._autoPublish(anObj, theName, "vertex")
1376 ## Create a tangent, corresponding to the given parameter on the given curve.
1377 # @param theRefCurve The referenced curve.
1378 # @param theParameter Value of parameter on the referenced curve.
1379 # @param theName Object name; when specified, this parameter is used
1380 # for result publication in the study. Otherwise, if automatic
1381 # publication is switched on, default value is used for result name.
1383 # @return New GEOM.GEOM_Object, containing the created tangent.
1385 # @ref swig_MakeTangentOnCurve "Example"
1386 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1388 Create a tangent, corresponding to the given parameter on the given curve.
1391 theRefCurve The referenced curve.
1392 theParameter Value of parameter on the referenced curve.
1393 theName Object name; when specified, this parameter is used
1394 for result publication in the study. Otherwise, if automatic
1395 publication is switched on, default value is used for result name.
1398 New GEOM.GEOM_Object, containing the created tangent.
1401 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1403 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1404 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1405 self._autoPublish(anObj, theName, "tangent")
1408 ## Create a tangent plane, corresponding to the given parameter on the given face.
1409 # @param theFace The face for which tangent plane should be built.
1410 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1411 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1412 # @param theTrimSize the size of plane.
1413 # @param theName Object name; when specified, this parameter is used
1414 # for result publication in the study. Otherwise, if automatic
1415 # publication is switched on, default value is used for result name.
1417 # @return New GEOM.GEOM_Object, containing the created tangent.
1419 # @ref swig_MakeTangentPlaneOnFace "Example"
1420 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1422 Create a tangent plane, corresponding to the given parameter on the given face.
1425 theFace The face for which tangent plane should be built.
1426 theParameterV vertical value of the center point (0.0 - 1.0).
1427 theParameterU horisontal value of the center point (0.0 - 1.0).
1428 theTrimSize the size of plane.
1429 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.
1434 New GEOM.GEOM_Object, containing the created tangent.
1437 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1439 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1440 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1441 self._autoPublish(anObj, theName, "tangent")
1444 ## Create a vector with the given components.
1445 # @param theDX X component of the vector.
1446 # @param theDY Y component of the vector.
1447 # @param theDZ Z component of the vector.
1448 # @param theName Object name; when specified, this parameter is used
1449 # for result publication in the study. Otherwise, if automatic
1450 # publication is switched on, default value is used for result name.
1452 # @return New GEOM.GEOM_Object, containing the created vector.
1454 # @ref tui_creation_vector "Example"
1455 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1457 Create a vector with the given components.
1460 theDX X component of the vector.
1461 theDY Y component of the vector.
1462 theDZ Z component of the vector.
1463 theName Object name; when specified, this parameter is used
1464 for result publication in the study. Otherwise, if automatic
1465 publication is switched on, default value is used for result name.
1468 New GEOM.GEOM_Object, containing the created vector.
1470 # Example: see GEOM_TestAll.py
1471 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1472 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1473 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1474 anObj.SetParameters(Parameters)
1475 self._autoPublish(anObj, theName, "vector")
1478 ## Create a vector between two points.
1479 # @param thePnt1 Start point for the vector.
1480 # @param thePnt2 End point for the vector.
1481 # @param theName Object name; when specified, this parameter is used
1482 # for result publication in the study. Otherwise, if automatic
1483 # publication is switched on, default value is used for result name.
1485 # @return New GEOM.GEOM_Object, containing the created vector.
1487 # @ref tui_creation_vector "Example"
1488 def MakeVector(self, thePnt1, thePnt2, theName=None):
1490 Create a vector between two points.
1493 thePnt1 Start point for the vector.
1494 thePnt2 End point for the vector.
1495 theName Object name; when specified, this parameter is used
1496 for result publication in the study. Otherwise, if automatic
1497 publication is switched on, default value is used for result name.
1500 New GEOM.GEOM_Object, containing the created vector.
1502 # Example: see GEOM_TestAll.py
1503 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1504 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1505 self._autoPublish(anObj, theName, "vector")
1508 ## Create a line, passing through the given point
1509 # and parrallel to the given direction
1510 # @param thePnt Point. The resulting line will pass through it.
1511 # @param theDir Direction. The resulting line will be parallel to it.
1512 # @param theName Object name; when specified, this parameter is used
1513 # for result publication in the study. Otherwise, if automatic
1514 # publication is switched on, default value is used for result name.
1516 # @return New GEOM.GEOM_Object, containing the created line.
1518 # @ref tui_creation_line "Example"
1519 def MakeLine(self, thePnt, theDir, theName=None):
1521 Create a line, passing through the given point
1522 and parrallel to the given direction
1525 thePnt Point. The resulting line will pass through it.
1526 theDir Direction. The resulting line will be parallel to it.
1527 theName Object name; when specified, this parameter is used
1528 for result publication in the study. Otherwise, if automatic
1529 publication is switched on, default value is used for result name.
1532 New GEOM.GEOM_Object, containing the created line.
1534 # Example: see GEOM_TestAll.py
1535 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1536 RaiseIfFailed("MakeLine", self.BasicOp)
1537 self._autoPublish(anObj, theName, "line")
1540 ## Create a line, passing through the given points
1541 # @param thePnt1 First of two points, defining the line.
1542 # @param thePnt2 Second of two points, defining the line.
1543 # @param theName Object name; when specified, this parameter is used
1544 # for result publication in the study. Otherwise, if automatic
1545 # publication is switched on, default value is used for result name.
1547 # @return New GEOM.GEOM_Object, containing the created line.
1549 # @ref tui_creation_line "Example"
1550 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1552 Create a line, passing through the given points
1555 thePnt1 First of two points, defining the line.
1556 thePnt2 Second of two points, defining the line.
1557 theName Object name; when specified, this parameter is used
1558 for result publication in the study. Otherwise, if automatic
1559 publication is switched on, default value is used for result name.
1562 New GEOM.GEOM_Object, containing the created line.
1564 # Example: see GEOM_TestAll.py
1565 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1566 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1567 self._autoPublish(anObj, theName, "line")
1570 ## Create a line on two faces intersection.
1571 # @param theFace1 First of two faces, defining the line.
1572 # @param theFace2 Second of two faces, defining the line.
1573 # @param theName Object name; when specified, this parameter is used
1574 # for result publication in the study. Otherwise, if automatic
1575 # publication is switched on, default value is used for result name.
1577 # @return New GEOM.GEOM_Object, containing the created line.
1579 # @ref swig_MakeLineTwoFaces "Example"
1580 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1582 Create a line on two faces intersection.
1585 theFace1 First of two faces, defining the line.
1586 theFace2 Second of two faces, defining the line.
1587 theName Object name; when specified, this parameter is used
1588 for result publication in the study. Otherwise, if automatic
1589 publication is switched on, default value is used for result name.
1592 New GEOM.GEOM_Object, containing the created line.
1594 # Example: see GEOM_TestAll.py
1595 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1596 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1597 self._autoPublish(anObj, theName, "line")
1600 ## Create a plane, passing through the given point
1601 # and normal to the given vector.
1602 # @param thePnt Point, the plane has to pass through.
1603 # @param theVec Vector, defining the plane normal direction.
1604 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1605 # @param 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.
1609 # @return New GEOM.GEOM_Object, containing the created plane.
1611 # @ref tui_creation_plane "Example"
1612 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1614 Create a plane, passing through the given point
1615 and normal to the given vector.
1618 thePnt Point, the plane has to pass through.
1619 theVec Vector, defining the plane normal direction.
1620 theTrimSize Half size of a side of quadrangle face, representing the plane.
1621 theName Object name; when specified, this parameter is used
1622 for result publication in the study. Otherwise, if automatic
1623 publication is switched on, default value is used for result name.
1626 New GEOM.GEOM_Object, containing the created plane.
1628 # Example: see GEOM_TestAll.py
1629 theTrimSize, Parameters = ParseParameters(theTrimSize);
1630 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1631 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1632 anObj.SetParameters(Parameters)
1633 self._autoPublish(anObj, theName, "plane")
1636 ## Create a plane, passing through the three given points
1637 # @param thePnt1 First of three points, defining the plane.
1638 # @param thePnt2 Second of three points, defining the plane.
1639 # @param thePnt3 Fird of three points, defining the plane.
1640 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1641 # @param theName Object name; when specified, this parameter is used
1642 # for result publication in the study. Otherwise, if automatic
1643 # publication is switched on, default value is used for result name.
1645 # @return New GEOM.GEOM_Object, containing the created plane.
1647 # @ref tui_creation_plane "Example"
1648 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1650 Create a plane, passing through the three given points
1653 thePnt1 First of three points, defining the plane.
1654 thePnt2 Second of three points, defining the plane.
1655 thePnt3 Fird of three points, defining the plane.
1656 theTrimSize Half size of a side of quadrangle face, representing the plane.
1657 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.
1662 New GEOM.GEOM_Object, containing the created plane.
1664 # Example: see GEOM_TestAll.py
1665 theTrimSize, Parameters = ParseParameters(theTrimSize);
1666 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1667 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1668 anObj.SetParameters(Parameters)
1669 self._autoPublish(anObj, theName, "plane")
1672 ## Create a plane, similar to the existing one, but with another size of representing face.
1673 # @param theFace Referenced plane or LCS(Marker).
1674 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1675 # @param theName Object name; when specified, this parameter is used
1676 # for result publication in the study. Otherwise, if automatic
1677 # publication is switched on, default value is used for result name.
1679 # @return New GEOM.GEOM_Object, containing the created plane.
1681 # @ref tui_creation_plane "Example"
1682 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1684 Create a plane, similar to the existing one, but with another size of representing face.
1687 theFace Referenced plane or LCS(Marker).
1688 theTrimSize New half size of a side of quadrangle face, representing the plane.
1689 theName Object name; when specified, this parameter is used
1690 for result publication in the study. Otherwise, if automatic
1691 publication is switched on, default value is used for result name.
1694 New GEOM.GEOM_Object, containing the created plane.
1696 # Example: see GEOM_TestAll.py
1697 theTrimSize, Parameters = ParseParameters(theTrimSize);
1698 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1699 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1700 anObj.SetParameters(Parameters)
1701 self._autoPublish(anObj, theName, "plane")
1704 ## Create a plane, passing through the 2 vectors
1705 # with center in a start point of the first vector.
1706 # @param theVec1 Vector, defining center point and plane direction.
1707 # @param theVec2 Vector, defining the plane normal direction.
1708 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1709 # @param theName Object name; when specified, this parameter is used
1710 # for result publication in the study. Otherwise, if automatic
1711 # publication is switched on, default value is used for result name.
1713 # @return New GEOM.GEOM_Object, containing the created plane.
1715 # @ref tui_creation_plane "Example"
1716 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1718 Create a plane, passing through the 2 vectors
1719 with center in a start point of the first vector.
1722 theVec1 Vector, defining center point and plane direction.
1723 theVec2 Vector, defining the plane normal direction.
1724 theTrimSize Half size of a side of quadrangle face, representing the plane.
1725 theName Object name; when specified, this parameter is used
1726 for result publication in the study. Otherwise, if automatic
1727 publication is switched on, default value is used for result name.
1730 New GEOM.GEOM_Object, containing the created plane.
1732 # Example: see GEOM_TestAll.py
1733 theTrimSize, Parameters = ParseParameters(theTrimSize);
1734 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1735 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1736 anObj.SetParameters(Parameters)
1737 self._autoPublish(anObj, theName, "plane")
1740 ## Create a plane, based on a Local coordinate system.
1741 # @param theLCS coordinate system, defining plane.
1742 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1743 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1744 # @param theName Object name; when specified, this parameter is used
1745 # for result publication in the study. Otherwise, if automatic
1746 # publication is switched on, default value is used for result name.
1748 # @return New GEOM.GEOM_Object, containing the created plane.
1750 # @ref tui_creation_plane "Example"
1751 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1753 Create a plane, based on a Local coordinate system.
1756 theLCS coordinate system, defining plane.
1757 theTrimSize Half size of a side of quadrangle face, representing the plane.
1758 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1759 theName Object name; when specified, this parameter is used
1760 for result publication in the study. Otherwise, if automatic
1761 publication is switched on, default value is used for result name.
1764 New GEOM.GEOM_Object, containing the created plane.
1766 # Example: see GEOM_TestAll.py
1767 theTrimSize, Parameters = ParseParameters(theTrimSize);
1768 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1769 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1770 anObj.SetParameters(Parameters)
1771 self._autoPublish(anObj, theName, "plane")
1774 ## Create a local coordinate system.
1775 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1776 # @param XDX,XDY,XDZ Three components of OX direction
1777 # @param YDX,YDY,YDZ Three components of OY direction
1778 # @param theName Object name; when specified, this parameter is used
1779 # for result publication in the study. Otherwise, if automatic
1780 # publication is switched on, default value is used for result name.
1782 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1784 # @ref swig_MakeMarker "Example"
1785 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1787 Create a local coordinate system.
1790 OX,OY,OZ Three coordinates of coordinate system origin.
1791 XDX,XDY,XDZ Three components of OX direction
1792 YDX,YDY,YDZ Three components of OY direction
1793 theName Object name; when specified, this parameter is used
1794 for result publication in the study. Otherwise, if automatic
1795 publication is switched on, default value is used for result name.
1798 New GEOM.GEOM_Object, containing the created coordinate system.
1800 # Example: see GEOM_TestAll.py
1801 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1802 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1803 RaiseIfFailed("MakeMarker", self.BasicOp)
1804 anObj.SetParameters(Parameters)
1805 self._autoPublish(anObj, theName, "lcs")
1808 ## Create a local coordinate system from shape.
1809 # @param theShape The initial shape to detect the coordinate system.
1810 # @param theName Object name; when specified, this parameter is used
1811 # for result publication in the study. Otherwise, if automatic
1812 # publication is switched on, default value is used for result name.
1814 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1816 # @ref tui_creation_lcs "Example"
1817 def MakeMarkerFromShape(self, theShape, theName=None):
1819 Create a local coordinate system from shape.
1822 theShape The initial shape to detect the coordinate system.
1823 theName Object name; when specified, this parameter is used
1824 for result publication in the study. Otherwise, if automatic
1825 publication is switched on, default value is used for result name.
1828 New GEOM.GEOM_Object, containing the created coordinate system.
1830 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1831 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1832 self._autoPublish(anObj, theName, "lcs")
1835 ## Create a local coordinate system from point and two vectors.
1836 # @param theOrigin Point of coordinate system origin.
1837 # @param theXVec Vector of X direction
1838 # @param theYVec Vector of Y direction
1839 # @param theName Object name; when specified, this parameter is used
1840 # for result publication in the study. Otherwise, if automatic
1841 # publication is switched on, default value is used for result name.
1843 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1845 # @ref tui_creation_lcs "Example"
1846 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1848 Create a local coordinate system from point and two vectors.
1851 theOrigin Point of coordinate system origin.
1852 theXVec Vector of X direction
1853 theYVec Vector of Y direction
1854 theName Object name; when specified, this parameter is used
1855 for result publication in the study. Otherwise, if automatic
1856 publication is switched on, default value is used for result name.
1859 New GEOM.GEOM_Object, containing the created coordinate system.
1862 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1863 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1864 self._autoPublish(anObj, theName, "lcs")
1867 # end of l3_basic_go
1870 ## @addtogroup l4_curves
1873 ## Create an arc of circle, passing through three given points.
1874 # @param thePnt1 Start point of the arc.
1875 # @param thePnt2 Middle point of the arc.
1876 # @param thePnt3 End point of the arc.
1877 # @param theName Object name; when specified, this parameter is used
1878 # for result publication in the study. Otherwise, if automatic
1879 # publication is switched on, default value is used for result name.
1881 # @return New GEOM.GEOM_Object, containing the created arc.
1883 # @ref swig_MakeArc "Example"
1884 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1886 Create an arc of circle, passing through three given points.
1889 thePnt1 Start point of the arc.
1890 thePnt2 Middle point of the arc.
1891 thePnt3 End point of the arc.
1892 theName Object name; when specified, this parameter is used
1893 for result publication in the study. Otherwise, if automatic
1894 publication is switched on, default value is used for result name.
1897 New GEOM.GEOM_Object, containing the created arc.
1899 # Example: see GEOM_TestAll.py
1900 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1901 RaiseIfFailed("MakeArc", self.CurvesOp)
1902 self._autoPublish(anObj, theName, "arc")
1905 ## Create an arc of circle from a center and 2 points.
1906 # @param thePnt1 Center of the arc
1907 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1908 # @param thePnt3 End point of the arc (Gives also a direction)
1909 # @param theSense Orientation of the arc
1910 # @param theName Object name; when specified, this parameter is used
1911 # for result publication in the study. Otherwise, if automatic
1912 # publication is switched on, default value is used for result name.
1914 # @return New GEOM.GEOM_Object, containing the created arc.
1916 # @ref swig_MakeArc "Example"
1917 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1919 Create an arc of circle from a center and 2 points.
1922 thePnt1 Center of the arc
1923 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1924 thePnt3 End point of the arc (Gives also a direction)
1925 theSense Orientation of the arc
1926 theName Object name; when specified, this parameter is used
1927 for result publication in the study. Otherwise, if automatic
1928 publication is switched on, default value is used for result name.
1931 New GEOM.GEOM_Object, containing the created arc.
1933 # Example: see GEOM_TestAll.py
1934 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1935 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1936 self._autoPublish(anObj, theName, "arc")
1939 ## Create an arc of ellipse, of center and two points.
1940 # @param theCenter Center of the arc.
1941 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1942 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1943 # @param theName Object name; when specified, this parameter is used
1944 # for result publication in the study. Otherwise, if automatic
1945 # publication is switched on, default value is used for result name.
1947 # @return New GEOM.GEOM_Object, containing the created arc.
1949 # @ref swig_MakeArc "Example"
1950 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1952 Create an arc of ellipse, of center and two points.
1955 theCenter Center of the arc.
1956 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1957 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1958 theName Object name; when specified, this parameter is used
1959 for result publication in the study. Otherwise, if automatic
1960 publication is switched on, default value is used for result name.
1963 New GEOM.GEOM_Object, containing the created arc.
1965 # Example: see GEOM_TestAll.py
1966 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1967 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1968 self._autoPublish(anObj, theName, "arc")
1971 ## Create a circle with given center, normal vector and radius.
1972 # @param thePnt Circle center.
1973 # @param theVec Vector, normal to the plane of the circle.
1974 # @param theR Circle radius.
1975 # @param theName Object name; when specified, this parameter is used
1976 # for result publication in the study. Otherwise, if automatic
1977 # publication is switched on, default value is used for result name.
1979 # @return New GEOM.GEOM_Object, containing the created circle.
1981 # @ref tui_creation_circle "Example"
1982 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1984 Create a circle with given center, normal vector and radius.
1987 thePnt Circle center.
1988 theVec Vector, normal to the plane of the circle.
1990 theName Object name; when specified, this parameter is used
1991 for result publication in the study. Otherwise, if automatic
1992 publication is switched on, default value is used for result name.
1995 New GEOM.GEOM_Object, containing the created circle.
1997 # Example: see GEOM_TestAll.py
1998 theR, Parameters = ParseParameters(theR)
1999 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2000 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2001 anObj.SetParameters(Parameters)
2002 self._autoPublish(anObj, theName, "circle")
2005 ## Create a circle with given radius.
2006 # Center of the circle will be in the origin of global
2007 # coordinate system and normal vector will be codirected with Z axis
2008 # @param theR Circle radius.
2009 # @param theName Object name; when specified, this parameter is used
2010 # for result publication in the study. Otherwise, if automatic
2011 # publication is switched on, default value is used for result name.
2013 # @return New GEOM.GEOM_Object, containing the created circle.
2014 def MakeCircleR(self, theR, theName=None):
2016 Create a circle with given radius.
2017 Center of the circle will be in the origin of global
2018 coordinate system and normal vector will be codirected with Z axis
2022 theName Object name; when specified, this parameter is used
2023 for result publication in the study. Otherwise, if automatic
2024 publication is switched on, default value is used for result name.
2027 New GEOM.GEOM_Object, containing the created circle.
2029 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2030 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2031 self._autoPublish(anObj, theName, "circle")
2034 ## Create a circle, passing through three given points
2035 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2036 # @param theName Object name; when specified, this parameter is used
2037 # for result publication in the study. Otherwise, if automatic
2038 # publication is switched on, default value is used for result name.
2040 # @return New GEOM.GEOM_Object, containing the created circle.
2042 # @ref tui_creation_circle "Example"
2043 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2045 Create a circle, passing through three given points
2048 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2049 theName Object name; when specified, this parameter is used
2050 for result publication in the study. Otherwise, if automatic
2051 publication is switched on, default value is used for result name.
2054 New GEOM.GEOM_Object, containing the created circle.
2056 # Example: see GEOM_TestAll.py
2057 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2058 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2059 self._autoPublish(anObj, theName, "circle")
2062 ## Create a circle, with given point1 as center,
2063 # passing through the point2 as radius and laying in the plane,
2064 # defined by all three given points.
2065 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2066 # @param theName Object name; when specified, this parameter is used
2067 # for result publication in the study. Otherwise, if automatic
2068 # publication is switched on, default value is used for result name.
2070 # @return New GEOM.GEOM_Object, containing the created circle.
2072 # @ref swig_MakeCircle "Example"
2073 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2075 Create a circle, with given point1 as center,
2076 passing through the point2 as radius and laying in the plane,
2077 defined by all three given points.
2080 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2081 theName Object name; when specified, this parameter is used
2082 for result publication in the study. Otherwise, if automatic
2083 publication is switched on, default value is used for result name.
2086 New GEOM.GEOM_Object, containing the created circle.
2088 # Example: see GEOM_example6.py
2089 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2090 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2091 self._autoPublish(anObj, theName, "circle")
2094 ## Create an ellipse with given center, normal vector and radiuses.
2095 # @param thePnt Ellipse center.
2096 # @param theVec Vector, normal to the plane of the ellipse.
2097 # @param theRMajor Major ellipse radius.
2098 # @param theRMinor Minor ellipse radius.
2099 # @param theVecMaj Vector, direction of the ellipse's main axis.
2100 # @param theName Object name; when specified, this parameter is used
2101 # for result publication in the study. Otherwise, if automatic
2102 # publication is switched on, default value is used for result name.
2104 # @return New GEOM.GEOM_Object, containing the created ellipse.
2106 # @ref tui_creation_ellipse "Example"
2107 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2109 Create an ellipse with given center, normal vector and radiuses.
2112 thePnt Ellipse center.
2113 theVec Vector, normal to the plane of the ellipse.
2114 theRMajor Major ellipse radius.
2115 theRMinor Minor ellipse radius.
2116 theVecMaj Vector, direction of the ellipse's main axis.
2117 theName Object name; when specified, this parameter is used
2118 for result publication in the study. Otherwise, if automatic
2119 publication is switched on, default value is used for result name.
2122 New GEOM.GEOM_Object, containing the created ellipse.
2124 # Example: see GEOM_TestAll.py
2125 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2126 if theVecMaj is not None:
2127 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2129 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2131 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2132 anObj.SetParameters(Parameters)
2133 self._autoPublish(anObj, theName, "ellipse")
2136 ## Create an ellipse with given radiuses.
2137 # Center of the ellipse will be in the origin of global
2138 # coordinate system and normal vector will be codirected with Z axis
2139 # @param theRMajor Major ellipse radius.
2140 # @param theRMinor Minor ellipse radius.
2141 # @param theName Object name; when specified, this parameter is used
2142 # for result publication in the study. Otherwise, if automatic
2143 # publication is switched on, default value is used for result name.
2145 # @return New GEOM.GEOM_Object, containing the created ellipse.
2146 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2148 Create an ellipse with given radiuses.
2149 Center of the ellipse will be in the origin of global
2150 coordinate system and normal vector will be codirected with Z axis
2153 theRMajor Major ellipse radius.
2154 theRMinor Minor ellipse radius.
2155 theName Object name; when specified, this parameter is used
2156 for result publication in the study. Otherwise, if automatic
2157 publication is switched on, default value is used for result name.
2160 New GEOM.GEOM_Object, containing the created ellipse.
2162 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2163 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2164 self._autoPublish(anObj, theName, "ellipse")
2167 ## Create a polyline on the set of points.
2168 # @param thePoints Sequence of points for the polyline.
2169 # @param theIsClosed If True, build a closed wire.
2170 # @param theName Object name; when specified, this parameter is used
2171 # for result publication in the study. Otherwise, if automatic
2172 # publication is switched on, default value is used for result name.
2174 # @return New GEOM.GEOM_Object, containing the created polyline.
2176 # @ref tui_creation_curve "Example"
2177 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2179 Create a polyline on the set of points.
2182 thePoints Sequence of points for the polyline.
2183 theIsClosed If True, build a closed wire.
2184 theName Object name; when specified, this parameter is used
2185 for result publication in the study. Otherwise, if automatic
2186 publication is switched on, default value is used for result name.
2189 New GEOM.GEOM_Object, containing the created polyline.
2191 # Example: see GEOM_TestAll.py
2192 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2193 RaiseIfFailed("MakePolyline", self.CurvesOp)
2194 self._autoPublish(anObj, theName, "polyline")
2197 ## Create bezier curve on the set of points.
2198 # @param thePoints Sequence of points for the bezier curve.
2199 # @param theIsClosed If True, build a closed curve.
2200 # @param theName Object name; when specified, this parameter is used
2201 # for result publication in the study. Otherwise, if automatic
2202 # publication is switched on, default value is used for result name.
2204 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2206 # @ref tui_creation_curve "Example"
2207 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2209 Create bezier curve on the set of points.
2212 thePoints Sequence of points for the bezier curve.
2213 theIsClosed If True, build a closed curve.
2214 theName Object name; when specified, this parameter is used
2215 for result publication in the study. Otherwise, if automatic
2216 publication is switched on, default value is used for result name.
2219 New GEOM.GEOM_Object, containing the created bezier curve.
2221 # Example: see GEOM_TestAll.py
2222 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2223 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2224 self._autoPublish(anObj, theName, "bezier")
2227 ## Create B-Spline curve on the set of points.
2228 # @param thePoints Sequence of points for the B-Spline curve.
2229 # @param theIsClosed If True, build a closed curve.
2230 # @param theDoReordering If TRUE, the algo does not follow the order of
2231 # \a thePoints but searches for the closest vertex.
2232 # @param theName Object name; when specified, this parameter is used
2233 # for result publication in the study. Otherwise, if automatic
2234 # publication is switched on, default value is used for result name.
2236 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2238 # @ref tui_creation_curve "Example"
2239 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2241 Create B-Spline curve on the set of points.
2244 thePoints Sequence of points for the B-Spline curve.
2245 theIsClosed If True, build a closed curve.
2246 theDoReordering If True, the algo does not follow the order of
2247 thePoints but searches for the closest vertex.
2248 theName Object name; when specified, this parameter is used
2249 for result publication in the study. Otherwise, if automatic
2250 publication is switched on, default value is used for result name.
2253 New GEOM.GEOM_Object, containing the created B-Spline curve.
2255 # Example: see GEOM_TestAll.py
2256 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2257 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2258 self._autoPublish(anObj, theName, "bspline")
2261 ## Create B-Spline curve on the set of points.
2262 # @param thePoints Sequence of points for the B-Spline curve.
2263 # @param theFirstVec Vector object, defining the curve direction at its first point.
2264 # @param theLastVec Vector object, defining the curve direction at its last point.
2265 # @param theName Object name; when specified, this parameter is used
2266 # for result publication in the study. Otherwise, if automatic
2267 # publication is switched on, default value is used for result name.
2269 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2271 # @ref tui_creation_curve "Example"
2272 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2274 Create B-Spline curve on the set of points.
2277 thePoints Sequence of points for the B-Spline curve.
2278 theFirstVec Vector object, defining the curve direction at its first point.
2279 theLastVec Vector object, defining the curve direction at its last point.
2280 theName Object name; when specified, this parameter is used
2281 for result publication in the study. Otherwise, if automatic
2282 publication is switched on, default value is used for result name.
2285 New GEOM.GEOM_Object, containing the created B-Spline curve.
2287 # Example: see GEOM_TestAll.py
2288 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2289 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2290 self._autoPublish(anObj, theName, "bspline")
2293 ## Creates a curve using the parametric definition of the basic points.
2294 # @param thexExpr parametric equation of the coordinates X.
2295 # @param theyExpr parametric equation of the coordinates Y.
2296 # @param thezExpr parametric equation of the coordinates Z.
2297 # @param theParamMin the minimal value of the parameter.
2298 # @param theParamMax the maximum value of the parameter.
2299 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2300 # @param theCurveType the type of the curve,
2301 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2302 # @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.
2303 # @param theName Object name; when specified, this parameter is used
2304 # for result publication in the study. Otherwise, if automatic
2305 # publication is switched on, default value is used for result name.
2307 # @return New GEOM.GEOM_Object, containing the created curve.
2309 # @ref tui_creation_curve "Example"
2310 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2311 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2313 Creates a curve using the parametric definition of the basic points.
2316 thexExpr parametric equation of the coordinates X.
2317 theyExpr parametric equation of the coordinates Y.
2318 thezExpr parametric equation of the coordinates Z.
2319 theParamMin the minimal value of the parameter.
2320 theParamMax the maximum value of the parameter.
2321 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2322 theCurveType the type of the curve,
2323 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2324 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2325 method is used which can lead to a bug.
2326 theName Object name; when specified, this parameter is used
2327 for result publication in the study. Otherwise, if automatic
2328 publication is switched on, default value is used for result name.
2331 New GEOM.GEOM_Object, containing the created curve.
2333 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2335 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2337 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2338 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2339 anObj.SetParameters(Parameters)
2340 self._autoPublish(anObj, theName, "curve")
2343 ## Create an isoline curve on a face.
2344 # @param theFace the face for which an isoline is created.
2345 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2347 # @param theParameter the U parameter for U-isoline or V parameter
2349 # @param theName Object name; when specified, this parameter is used
2350 # for result publication in the study. Otherwise, if automatic
2351 # publication is switched on, default value is used for result name.
2353 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2354 # a compound of edges.
2356 # @ref tui_creation_curve "Example"
2357 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2359 Create an isoline curve on a face.
2362 theFace the face for which an isoline is created.
2363 IsUIsoline True for U-isoline creation; False for V-isoline
2365 theParameter the U parameter for U-isoline or V parameter
2367 theName Object name; when specified, this parameter is used
2368 for result publication in the study. Otherwise, if automatic
2369 publication is switched on, default value is used for result name.
2372 New GEOM.GEOM_Object, containing the created isoline edge or a
2375 # Example: see GEOM_TestAll.py
2376 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2377 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2379 self._autoPublish(anObj, theName, "U-Isoline")
2381 self._autoPublish(anObj, theName, "V-Isoline")
2387 ## @addtogroup l3_sketcher
2390 ## Create a sketcher (wire or face), following the textual description,
2391 # passed through <VAR>theCommand</VAR> argument. \n
2392 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2393 # Format of the description string have to be the following:
2395 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2398 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2400 # - "R angle" : Set the direction by angle
2401 # - "D dx dy" : Set the direction by DX & DY
2404 # - "TT x y" : Create segment by point at X & Y
2405 # - "T dx dy" : Create segment by point with DX & DY
2406 # - "L length" : Create segment by direction & Length
2407 # - "IX x" : Create segment by direction & Intersect. X
2408 # - "IY y" : Create segment by direction & Intersect. Y
2411 # - "C radius length" : Create arc by direction, radius and length(in degree)
2412 # - "AA x y": Create arc by point at X & Y
2413 # - "A dx dy" : Create arc by point with DX & DY
2414 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2415 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2416 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2417 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2420 # - "WW" : Close Wire (to finish)
2421 # - "WF" : Close Wire and build face (to finish)
2424 # - Flag1 (= reverse) is 0 or 2 ...
2425 # - if 0 the drawn arc is the one of lower angle (< Pi)
2426 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2429 # - Flag2 (= control tolerance) is 0 or 1 ...
2430 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2431 # - if 1 the wire is built only if the end point is on the arc
2432 # with a tolerance of 10^-7 on the distance else the creation fails
2434 # @param theCommand String, defining the sketcher in local
2435 # coordinates of the working plane.
2436 # @param theWorkingPlane Nine double values, defining origin,
2437 # OZ and OX directions of the working plane.
2438 # @param theName Object name; when specified, this parameter is used
2439 # for result publication in the study. Otherwise, if automatic
2440 # publication is switched on, default value is used for result name.
2442 # @return New GEOM.GEOM_Object, containing the created wire.
2444 # @ref tui_sketcher_page "Example"
2445 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2447 Create a sketcher (wire or face), following the textual description, passed
2448 through theCommand argument.
2449 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2450 Format of the description string have to be the following:
2451 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2453 - x1, y1 are coordinates of the first sketcher point (zero by default),
2455 - "R angle" : Set the direction by angle
2456 - "D dx dy" : Set the direction by DX & DY
2458 - "TT x y" : Create segment by point at X & Y
2459 - "T dx dy" : Create segment by point with DX & DY
2460 - "L length" : Create segment by direction & Length
2461 - "IX x" : Create segment by direction & Intersect. X
2462 - "IY y" : Create segment by direction & Intersect. Y
2464 - "C radius length" : Create arc by direction, radius and length(in degree)
2465 - "AA x y": Create arc by point at X & Y
2466 - "A dx dy" : Create arc by point with DX & DY
2467 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2468 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2469 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2470 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2472 - "WW" : Close Wire (to finish)
2473 - "WF" : Close Wire and build face (to finish)
2475 - Flag1 (= reverse) is 0 or 2 ...
2476 - if 0 the drawn arc is the one of lower angle (< Pi)
2477 - if 2 the drawn arc ius the one of greater angle (> Pi)
2479 - Flag2 (= control tolerance) is 0 or 1 ...
2480 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2481 - if 1 the wire is built only if the end point is on the arc
2482 with a tolerance of 10^-7 on the distance else the creation fails
2485 theCommand String, defining the sketcher in local
2486 coordinates of the working plane.
2487 theWorkingPlane Nine double values, defining origin,
2488 OZ and OX directions of the working plane.
2489 theName Object name; when specified, this parameter is used
2490 for result publication in the study. Otherwise, if automatic
2491 publication is switched on, default value is used for result name.
2494 New GEOM.GEOM_Object, containing the created wire.
2496 # Example: see GEOM_TestAll.py
2497 theCommand,Parameters = ParseSketcherCommand(theCommand)
2498 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2499 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2500 anObj.SetParameters(Parameters)
2501 self._autoPublish(anObj, theName, "wire")
2504 ## Create a sketcher (wire or face), following the textual description,
2505 # passed through <VAR>theCommand</VAR> argument. \n
2506 # For format of the description string see MakeSketcher() method.\n
2507 # @param theCommand String, defining the sketcher in local
2508 # coordinates of the working plane.
2509 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2510 # @param theName Object name; when specified, this parameter is used
2511 # for result publication in the study. Otherwise, if automatic
2512 # publication is switched on, default value is used for result name.
2514 # @return New GEOM.GEOM_Object, containing the created wire.
2516 # @ref tui_sketcher_page "Example"
2517 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2519 Create a sketcher (wire or face), following the textual description,
2520 passed through theCommand argument.
2521 For format of the description string see geompy.MakeSketcher() method.
2524 theCommand String, defining the sketcher in local
2525 coordinates of the working plane.
2526 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2527 theName Object name; when specified, this parameter is used
2528 for result publication in the study. Otherwise, if automatic
2529 publication is switched on, default value is used for result name.
2532 New GEOM.GEOM_Object, containing the created wire.
2534 theCommand,Parameters = ParseSketcherCommand(theCommand)
2535 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2536 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2537 anObj.SetParameters(Parameters)
2538 self._autoPublish(anObj, theName, "wire")
2541 ## Obtain a 2D sketcher interface
2542 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2543 def Sketcher2D (self):
2545 Obtain a 2D sketcher interface.
2548 sk = geompy.Sketcher2D()
2550 sk.addSegmentRelative(15, 70)
2551 sk.addSegmentPerpY(50)
2552 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2553 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2554 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2556 Sketch_1 = sk.wire(geomObj_1)
2558 sk = Sketcher2D (self)
2561 ## Create a sketcher wire, following the numerical description,
2562 # passed through <VAR>theCoordinates</VAR> argument. \n
2563 # @param theCoordinates double values, defining points to create a wire,
2565 # @param theName Object name; when specified, this parameter is used
2566 # for result publication in the study. Otherwise, if automatic
2567 # publication is switched on, default value is used for result name.
2569 # @return New GEOM.GEOM_Object, containing the created wire.
2571 # @ref tui_3dsketcher_page "Example"
2572 def Make3DSketcher(self, theCoordinates, theName=None):
2574 Create a sketcher wire, following the numerical description,
2575 passed through theCoordinates argument.
2578 theCoordinates double values, defining points to create a wire,
2580 theName Object name; when specified, this parameter is used
2581 for result publication in the study. Otherwise, if automatic
2582 publication is switched on, default value is used for result name.
2585 New GEOM_Object, containing the created wire.
2587 theCoordinates,Parameters = ParseParameters(theCoordinates)
2588 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2589 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2590 anObj.SetParameters(Parameters)
2591 self._autoPublish(anObj, theName, "wire")
2594 ## Obtain a 3D sketcher interface
2595 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2597 # @ref tui_3dsketcher_page "Example"
2598 def Sketcher3D (self):
2600 Obtain a 3D sketcher interface.
2603 sk = geompy.Sketcher3D()
2604 sk.addPointsAbsolute(0,0,0, 70,0,0)
2605 sk.addPointsRelative(0, 0, 130)
2606 sk.addPointAnglesLength("OXY", 50, 0, 100)
2607 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2609 a3D_Sketcher_1 = sk.wire()
2611 sk = Sketcher3D (self)
2614 # end of l3_sketcher
2617 ## @addtogroup l3_3d_primitives
2620 ## Create a box by coordinates of two opposite vertices.
2622 # @param x1,y1,z1 double values, defining first point it.
2623 # @param x2,y2,z2 double values, defining first point it.
2624 # @param theName Object name; when specified, this parameter is used
2625 # for result publication in the study. Otherwise, if automatic
2626 # publication is switched on, default value is used for result name.
2628 # @return New GEOM.GEOM_Object, containing the created box.
2630 # @ref tui_creation_box "Example"
2631 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2633 Create a box by coordinates of two opposite vertices.
2636 x1,y1,z1 double values, defining first point.
2637 x2,y2,z2 double values, defining second point.
2638 theName Object name; when specified, this parameter is used
2639 for result publication in the study. Otherwise, if automatic
2640 publication is switched on, default value is used for result name.
2643 New GEOM.GEOM_Object, containing the created box.
2645 # Example: see GEOM_TestAll.py
2646 pnt1 = self.MakeVertex(x1,y1,z1)
2647 pnt2 = self.MakeVertex(x2,y2,z2)
2648 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2649 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2651 ## Create a box with specified dimensions along the coordinate axes
2652 # and with edges, parallel to the coordinate axes.
2653 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2654 # @param theDX Length of Box edges, parallel to OX axis.
2655 # @param theDY Length of Box edges, parallel to OY axis.
2656 # @param theDZ Length of Box edges, parallel to OZ axis.
2657 # @param theName Object name; when specified, this parameter is used
2658 # for result publication in the study. Otherwise, if automatic
2659 # publication is switched on, default value is used for result name.
2661 # @return New GEOM.GEOM_Object, containing the created box.
2663 # @ref tui_creation_box "Example"
2664 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2666 Create a box with specified dimensions along the coordinate axes
2667 and with edges, parallel to the coordinate axes.
2668 Center of the box will be at point (DX/2, DY/2, DZ/2).
2671 theDX Length of Box edges, parallel to OX axis.
2672 theDY Length of Box edges, parallel to OY axis.
2673 theDZ Length of Box edges, parallel to OZ axis.
2674 theName Object name; when specified, this parameter is used
2675 for result publication in the study. Otherwise, if automatic
2676 publication is switched on, default value is used for result name.
2679 New GEOM.GEOM_Object, containing the created box.
2681 # Example: see GEOM_TestAll.py
2682 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2683 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2684 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2685 anObj.SetParameters(Parameters)
2686 self._autoPublish(anObj, theName, "box")
2689 ## Create a box with two specified opposite vertices,
2690 # and with edges, parallel to the coordinate axes
2691 # @param thePnt1 First of two opposite vertices.
2692 # @param thePnt2 Second of two opposite vertices.
2693 # @param theName Object name; when specified, this parameter is used
2694 # for result publication in the study. Otherwise, if automatic
2695 # publication is switched on, default value is used for result name.
2697 # @return New GEOM.GEOM_Object, containing the created box.
2699 # @ref tui_creation_box "Example"
2700 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2702 Create a box with two specified opposite vertices,
2703 and with edges, parallel to the coordinate axes
2706 thePnt1 First of two opposite vertices.
2707 thePnt2 Second of two opposite vertices.
2708 theName Object name; when specified, this parameter is used
2709 for result publication in the study. Otherwise, if automatic
2710 publication is switched on, default value is used for result name.
2713 New GEOM.GEOM_Object, containing the created box.
2715 # Example: see GEOM_TestAll.py
2716 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2717 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2718 self._autoPublish(anObj, theName, "box")
2721 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2722 # @param theH height of Face.
2723 # @param theW width of Face.
2724 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2725 # @param theName Object name; when specified, this parameter is used
2726 # for result publication in the study. Otherwise, if automatic
2727 # publication is switched on, default value is used for result name.
2729 # @return New GEOM.GEOM_Object, containing the created face.
2731 # @ref tui_creation_face "Example"
2732 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2734 Create a face with specified dimensions with edges parallel to coordinate axes.
2737 theH height of Face.
2739 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2740 theName Object name; when specified, this parameter is used
2741 for result publication in the study. Otherwise, if automatic
2742 publication is switched on, default value is used for result name.
2745 New GEOM.GEOM_Object, containing the created face.
2747 # Example: see GEOM_TestAll.py
2748 theH,theW,Parameters = ParseParameters(theH, theW)
2749 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2750 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2751 anObj.SetParameters(Parameters)
2752 self._autoPublish(anObj, theName, "rectangle")
2755 ## Create a face from another plane and two sizes,
2756 # vertical size and horisontal size.
2757 # @param theObj Normale vector to the creating face or
2759 # @param theH Height (vertical size).
2760 # @param theW Width (horisontal size).
2761 # @param theName Object name; when specified, this parameter is used
2762 # for result publication in the study. Otherwise, if automatic
2763 # publication is switched on, default value is used for result name.
2765 # @return New GEOM.GEOM_Object, containing the created face.
2767 # @ref tui_creation_face "Example"
2768 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2770 Create a face from another plane and two sizes,
2771 vertical size and horisontal size.
2774 theObj Normale vector to the creating face or
2776 theH Height (vertical size).
2777 theW Width (horisontal size).
2778 theName Object name; when specified, this parameter is used
2779 for result publication in the study. Otherwise, if automatic
2780 publication is switched on, default value is used for result name.
2783 New GEOM_Object, containing the created face.
2785 # Example: see GEOM_TestAll.py
2786 theH,theW,Parameters = ParseParameters(theH, theW)
2787 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2788 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2789 anObj.SetParameters(Parameters)
2790 self._autoPublish(anObj, theName, "rectangle")
2793 ## Create a disk with given center, normal vector and radius.
2794 # @param thePnt Disk center.
2795 # @param theVec Vector, normal to the plane of the disk.
2796 # @param theR Disk radius.
2797 # @param theName Object name; when specified, this parameter is used
2798 # for result publication in the study. Otherwise, if automatic
2799 # publication is switched on, default value is used for result name.
2801 # @return New GEOM.GEOM_Object, containing the created disk.
2803 # @ref tui_creation_disk "Example"
2804 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2806 Create a disk with given center, normal vector and radius.
2810 theVec Vector, normal to the plane of the disk.
2812 theName Object name; when specified, this parameter is used
2813 for result publication in the study. Otherwise, if automatic
2814 publication is switched on, default value is used for result name.
2817 New GEOM.GEOM_Object, containing the created disk.
2819 # Example: see GEOM_TestAll.py
2820 theR,Parameters = ParseParameters(theR)
2821 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2822 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2823 anObj.SetParameters(Parameters)
2824 self._autoPublish(anObj, theName, "disk")
2827 ## Create a disk, passing through three given points
2828 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2829 # @param theName Object name; when specified, this parameter is used
2830 # for result publication in the study. Otherwise, if automatic
2831 # publication is switched on, default value is used for result name.
2833 # @return New GEOM.GEOM_Object, containing the created disk.
2835 # @ref tui_creation_disk "Example"
2836 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2838 Create a disk, passing through three given points
2841 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2842 theName Object name; when specified, this parameter is used
2843 for result publication in the study. Otherwise, if automatic
2844 publication is switched on, default value is used for result name.
2847 New GEOM.GEOM_Object, containing the created disk.
2849 # Example: see GEOM_TestAll.py
2850 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2851 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2852 self._autoPublish(anObj, theName, "disk")
2855 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2856 # @param theR Radius of Face.
2857 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2858 # @param theName Object name; when specified, this parameter is used
2859 # for result publication in the study. Otherwise, if automatic
2860 # publication is switched on, default value is used for result name.
2862 # @return New GEOM.GEOM_Object, containing the created disk.
2864 # @ref tui_creation_face "Example"
2865 def MakeDiskR(self, theR, theOrientation, theName=None):
2867 Create a disk with specified dimensions along OX-OY coordinate axes.
2870 theR Radius of Face.
2871 theOrientation set the orientation belong axis OXY or OYZ or OZX
2872 theName Object name; when specified, this parameter is used
2873 for result publication in the study. Otherwise, if automatic
2874 publication is switched on, default value is used for result name.
2877 New GEOM.GEOM_Object, containing the created disk.
2880 Disk3 = geompy.MakeDiskR(100., 1)
2882 # Example: see GEOM_TestAll.py
2883 theR,Parameters = ParseParameters(theR)
2884 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2885 RaiseIfFailed("MakeDiskR", self.PrimOp)
2886 anObj.SetParameters(Parameters)
2887 self._autoPublish(anObj, theName, "disk")
2890 ## Create a cylinder with given base point, axis, radius and height.
2891 # @param thePnt Central point of cylinder base.
2892 # @param theAxis Cylinder axis.
2893 # @param theR Cylinder radius.
2894 # @param theH Cylinder height.
2895 # @param theName Object name; when specified, this parameter is used
2896 # for result publication in the study. Otherwise, if automatic
2897 # publication is switched on, default value is used for result name.
2899 # @return New GEOM.GEOM_Object, containing the created cylinder.
2901 # @ref tui_creation_cylinder "Example"
2902 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2904 Create a cylinder with given base point, axis, radius and height.
2907 thePnt Central point of cylinder base.
2908 theAxis Cylinder axis.
2909 theR Cylinder radius.
2910 theH Cylinder height.
2911 theName Object name; when specified, this parameter is used
2912 for result publication in the study. Otherwise, if automatic
2913 publication is switched on, default value is used for result name.
2916 New GEOM.GEOM_Object, containing the created cylinder.
2918 # Example: see GEOM_TestAll.py
2919 theR,theH,Parameters = ParseParameters(theR, theH)
2920 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2921 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2922 anObj.SetParameters(Parameters)
2923 self._autoPublish(anObj, theName, "cylinder")
2926 ## Create a cylinder with given radius and height at
2927 # the origin of coordinate system. Axis of the cylinder
2928 # will be collinear to the OZ axis of the coordinate system.
2929 # @param theR Cylinder radius.
2930 # @param theH Cylinder height.
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 cylinder.
2937 # @ref tui_creation_cylinder "Example"
2938 def MakeCylinderRH(self, theR, theH, theName=None):
2940 Create a cylinder with given radius and height at
2941 the origin of coordinate system. Axis of the cylinder
2942 will be collinear to the OZ axis of the coordinate system.
2945 theR Cylinder radius.
2946 theH Cylinder height.
2947 theName Object name; when specified, this parameter is used
2948 for result publication in the study. Otherwise, if automatic
2949 publication is switched on, default value is used for result name.
2952 New GEOM.GEOM_Object, containing the created cylinder.
2954 # Example: see GEOM_TestAll.py
2955 theR,theH,Parameters = ParseParameters(theR, theH)
2956 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2957 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2958 anObj.SetParameters(Parameters)
2959 self._autoPublish(anObj, theName, "cylinder")
2962 ## Create a sphere with given center and radius.
2963 # @param thePnt Sphere center.
2964 # @param theR Sphere radius.
2965 # @param theName Object name; when specified, this parameter is used
2966 # for result publication in the study. Otherwise, if automatic
2967 # publication is switched on, default value is used for result name.
2969 # @return New GEOM.GEOM_Object, containing the created sphere.
2971 # @ref tui_creation_sphere "Example"
2972 def MakeSpherePntR(self, thePnt, theR, theName=None):
2974 Create a sphere with given center and radius.
2977 thePnt Sphere center.
2979 theName Object name; when specified, this parameter is used
2980 for result publication in the study. Otherwise, if automatic
2981 publication is switched on, default value is used for result name.
2984 New GEOM.GEOM_Object, containing the created sphere.
2986 # Example: see GEOM_TestAll.py
2987 theR,Parameters = ParseParameters(theR)
2988 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2989 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2990 anObj.SetParameters(Parameters)
2991 self._autoPublish(anObj, theName, "sphere")
2994 ## Create a sphere with given center and radius.
2995 # @param x,y,z Coordinates of sphere center.
2996 # @param theR Sphere radius.
2997 # @param theName Object name; when specified, this parameter is used
2998 # for result publication in the study. Otherwise, if automatic
2999 # publication is switched on, default value is used for result name.
3001 # @return New GEOM.GEOM_Object, containing the created sphere.
3003 # @ref tui_creation_sphere "Example"
3004 def MakeSphere(self, x, y, z, theR, theName=None):
3006 Create a sphere with given center and radius.
3009 x,y,z Coordinates of sphere center.
3011 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.
3016 New GEOM.GEOM_Object, containing the created sphere.
3018 # Example: see GEOM_TestAll.py
3019 point = self.MakeVertex(x, y, z)
3020 # note: auto-publishing is done in self.MakeSpherePntR()
3021 anObj = self.MakeSpherePntR(point, theR, theName)
3024 ## Create a sphere with given radius at the origin of coordinate system.
3025 # @param theR Sphere radius.
3026 # @param theName Object name; when specified, this parameter is used
3027 # for result publication in the study. Otherwise, if automatic
3028 # publication is switched on, default value is used for result name.
3030 # @return New GEOM.GEOM_Object, containing the created sphere.
3032 # @ref tui_creation_sphere "Example"
3033 def MakeSphereR(self, theR, theName=None):
3035 Create a sphere with given radius at the origin of coordinate system.
3039 theName Object name; when specified, this parameter is used
3040 for result publication in the study. Otherwise, if automatic
3041 publication is switched on, default value is used for result name.
3044 New GEOM.GEOM_Object, containing the created sphere.
3046 # Example: see GEOM_TestAll.py
3047 theR,Parameters = ParseParameters(theR)
3048 anObj = self.PrimOp.MakeSphereR(theR)
3049 RaiseIfFailed("MakeSphereR", self.PrimOp)
3050 anObj.SetParameters(Parameters)
3051 self._autoPublish(anObj, theName, "sphere")
3054 ## Create a cone with given base point, axis, height and radiuses.
3055 # @param thePnt Central point of the first cone base.
3056 # @param theAxis Cone axis.
3057 # @param theR1 Radius of the first cone base.
3058 # @param theR2 Radius of the second cone base.
3059 # \note If both radiuses are non-zero, the cone will be truncated.
3060 # \note If the radiuses are equal, a cylinder will be created instead.
3061 # @param theH Cone height.
3062 # @param theName Object name; when specified, this parameter is used
3063 # for result publication in the study. Otherwise, if automatic
3064 # publication is switched on, default value is used for result name.
3066 # @return New GEOM.GEOM_Object, containing the created cone.
3068 # @ref tui_creation_cone "Example"
3069 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3071 Create a cone with given base point, axis, height and radiuses.
3074 thePnt Central point of the first cone base.
3076 theR1 Radius of the first cone base.
3077 theR2 Radius of the second cone base.
3079 theName Object name; when specified, this parameter is used
3080 for result publication in the study. Otherwise, if automatic
3081 publication is switched on, default value is used for result name.
3084 If both radiuses are non-zero, the cone will be truncated.
3085 If the radiuses are equal, a cylinder will be created instead.
3088 New GEOM.GEOM_Object, containing the created cone.
3090 # Example: see GEOM_TestAll.py
3091 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3092 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3093 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3094 anObj.SetParameters(Parameters)
3095 self._autoPublish(anObj, theName, "cone")
3098 ## Create a cone with given height and radiuses at
3099 # the origin of coordinate system. Axis of the cone will
3100 # be collinear to the OZ axis of the coordinate system.
3101 # @param theR1 Radius of the first cone base.
3102 # @param theR2 Radius of the second cone base.
3103 # \note If both radiuses are non-zero, the cone will be truncated.
3104 # \note If the radiuses are equal, a cylinder will be created instead.
3105 # @param theH Cone height.
3106 # @param theName Object name; when specified, this parameter is used
3107 # for result publication in the study. Otherwise, if automatic
3108 # publication is switched on, default value is used for result name.
3110 # @return New GEOM.GEOM_Object, containing the created cone.
3112 # @ref tui_creation_cone "Example"
3113 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3115 Create a cone with given height and radiuses at
3116 the origin of coordinate system. Axis of the cone will
3117 be collinear to the OZ axis of the coordinate system.
3120 theR1 Radius of the first cone base.
3121 theR2 Radius of the second cone base.
3123 theName Object name; when specified, this parameter is used
3124 for result publication in the study. Otherwise, if automatic
3125 publication is switched on, default value is used for result name.
3128 If both radiuses are non-zero, the cone will be truncated.
3129 If the radiuses are equal, a cylinder will be created instead.
3132 New GEOM.GEOM_Object, containing the created cone.
3134 # Example: see GEOM_TestAll.py
3135 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3136 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3137 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3138 anObj.SetParameters(Parameters)
3139 self._autoPublish(anObj, theName, "cone")
3142 ## Create a torus with given center, normal vector and radiuses.
3143 # @param thePnt Torus central point.
3144 # @param theVec Torus axis of symmetry.
3145 # @param theRMajor Torus major radius.
3146 # @param theRMinor Torus minor radius.
3147 # @param theName Object name; when specified, this parameter is used
3148 # for result publication in the study. Otherwise, if automatic
3149 # publication is switched on, default value is used for result name.
3151 # @return New GEOM.GEOM_Object, containing the created torus.
3153 # @ref tui_creation_torus "Example"
3154 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3156 Create a torus with given center, normal vector and radiuses.
3159 thePnt Torus central point.
3160 theVec Torus axis of symmetry.
3161 theRMajor Torus major radius.
3162 theRMinor Torus minor radius.
3163 theName Object name; when specified, this parameter is used
3164 for result publication in the study. Otherwise, if automatic
3165 publication is switched on, default value is used for result name.
3168 New GEOM.GEOM_Object, containing the created torus.
3170 # Example: see GEOM_TestAll.py
3171 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3172 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3173 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3174 anObj.SetParameters(Parameters)
3175 self._autoPublish(anObj, theName, "torus")
3178 ## Create a torus with given radiuses at the origin of coordinate system.
3179 # @param theRMajor Torus major radius.
3180 # @param theRMinor Torus minor radius.
3181 # @param theName Object name; when specified, this parameter is used
3182 # for result publication in the study. Otherwise, if automatic
3183 # publication is switched on, default value is used for result name.
3185 # @return New GEOM.GEOM_Object, containing the created torus.
3187 # @ref tui_creation_torus "Example"
3188 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3190 Create a torus with given radiuses at the origin of coordinate system.
3193 theRMajor Torus major radius.
3194 theRMinor Torus minor radius.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created torus.
3202 # Example: see GEOM_TestAll.py
3203 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3204 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3205 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3206 anObj.SetParameters(Parameters)
3207 self._autoPublish(anObj, theName, "torus")
3210 # end of l3_3d_primitives
3213 ## @addtogroup l3_complex
3216 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3217 # @param theBase Base shape to be extruded.
3218 # @param thePoint1 First end of extrusion vector.
3219 # @param thePoint2 Second end of extrusion vector.
3220 # @param theScaleFactor Use it to make prism with scaled second base.
3221 # Nagative value means not scaled second base.
3222 # @param theName Object name; when specified, this parameter is used
3223 # for result publication in the study. Otherwise, if automatic
3224 # publication is switched on, default value is used for result name.
3226 # @return New GEOM.GEOM_Object, containing the created prism.
3228 # @ref tui_creation_prism "Example"
3229 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3231 Create a shape by extrusion of the base shape along a vector, defined by two points.
3234 theBase Base shape to be extruded.
3235 thePoint1 First end of extrusion vector.
3236 thePoint2 Second end of extrusion vector.
3237 theScaleFactor Use it to make prism with scaled second base.
3238 Nagative value means not scaled second base.
3239 theName Object name; when specified, this parameter is used
3240 for result publication in the study. Otherwise, if automatic
3241 publication is switched on, default value is used for result name.
3244 New GEOM.GEOM_Object, containing the created prism.
3246 # Example: see GEOM_TestAll.py
3249 if theScaleFactor > 0:
3250 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3251 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3253 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3254 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3255 anObj.SetParameters(Parameters)
3256 self._autoPublish(anObj, theName, "prism")
3259 ## Create a shape by extrusion of the base shape along a
3260 # vector, defined by two points, in 2 Ways (forward/backward).
3261 # @param theBase Base shape to be extruded.
3262 # @param thePoint1 First end of extrusion vector.
3263 # @param thePoint2 Second end of extrusion vector.
3264 # @param theName Object name; when specified, this parameter is used
3265 # for result publication in the study. Otherwise, if automatic
3266 # publication is switched on, default value is used for result name.
3268 # @return New GEOM.GEOM_Object, containing the created prism.
3270 # @ref tui_creation_prism "Example"
3271 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3273 Create a shape by extrusion of the base shape along a
3274 vector, defined by two points, in 2 Ways (forward/backward).
3277 theBase Base shape to be extruded.
3278 thePoint1 First end of extrusion vector.
3279 thePoint2 Second end of extrusion vector.
3280 theName Object name; when specified, this parameter is used
3281 for result publication in the study. Otherwise, if automatic
3282 publication is switched on, default value is used for result name.
3285 New GEOM.GEOM_Object, containing the created prism.
3287 # Example: see GEOM_TestAll.py
3288 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3289 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3290 self._autoPublish(anObj, theName, "prism")
3293 ## Create a shape by extrusion of the base shape along the vector,
3294 # i.e. all the space, transfixed by the base shape during its translation
3295 # along the vector on the given distance.
3296 # @param theBase Base shape to be extruded.
3297 # @param theVec Direction of extrusion.
3298 # @param theH Prism dimension along theVec.
3299 # @param theScaleFactor Use it to make prism with scaled second base.
3300 # Negative value means not scaled second base.
3301 # @param theName Object name; when specified, this parameter is used
3302 # for result publication in the study. Otherwise, if automatic
3303 # publication is switched on, default value is used for result name.
3305 # @return New GEOM.GEOM_Object, containing the created prism.
3307 # @ref tui_creation_prism "Example"
3308 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3310 Create a shape by extrusion of the base shape along the vector,
3311 i.e. all the space, transfixed by the base shape during its translation
3312 along the vector on the given distance.
3315 theBase Base shape to be extruded.
3316 theVec Direction of extrusion.
3317 theH Prism dimension along theVec.
3318 theScaleFactor Use it to make prism with scaled second base.
3319 Negative value means not scaled second base.
3320 theName Object name; when specified, this parameter is used
3321 for result publication in the study. Otherwise, if automatic
3322 publication is switched on, default value is used for result name.
3325 New GEOM.GEOM_Object, containing the created prism.
3327 # Example: see GEOM_TestAll.py
3330 if theScaleFactor > 0:
3331 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3332 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3334 theH,Parameters = ParseParameters(theH)
3335 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3336 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3337 anObj.SetParameters(Parameters)
3338 self._autoPublish(anObj, theName, "prism")
3341 ## Create a shape by extrusion of the base shape along the vector,
3342 # i.e. all the space, transfixed by the base shape during its translation
3343 # along the vector on the given distance in 2 Ways (forward/backward).
3344 # @param theBase Base shape to be extruded.
3345 # @param theVec Direction of extrusion.
3346 # @param theH Prism dimension along theVec in forward direction.
3347 # @param 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.
3351 # @return New GEOM.GEOM_Object, containing the created prism.
3353 # @ref tui_creation_prism "Example"
3354 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3356 Create a shape by extrusion of the base shape along the vector,
3357 i.e. all the space, transfixed by the base shape during its translation
3358 along the vector on the given distance in 2 Ways (forward/backward).
3361 theBase Base shape to be extruded.
3362 theVec Direction of extrusion.
3363 theH Prism dimension along theVec in forward direction.
3364 theName Object name; when specified, this parameter is used
3365 for result publication in the study. Otherwise, if automatic
3366 publication is switched on, default value is used for result name.
3369 New GEOM.GEOM_Object, containing the created prism.
3371 # Example: see GEOM_TestAll.py
3372 theH,Parameters = ParseParameters(theH)
3373 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3374 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3375 anObj.SetParameters(Parameters)
3376 self._autoPublish(anObj, theName, "prism")
3379 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3380 # @param theBase Base shape to be extruded.
3381 # @param theDX, theDY, theDZ Directions of extrusion.
3382 # @param theScaleFactor Use it to make prism with scaled second base.
3383 # Nagative value means not scaled second base.
3384 # @param theName Object name; when specified, this parameter is used
3385 # for result publication in the study. Otherwise, if automatic
3386 # publication is switched on, default value is used for result name.
3388 # @return New GEOM.GEOM_Object, containing the created prism.
3390 # @ref tui_creation_prism "Example"
3391 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3393 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3396 theBase Base shape to be extruded.
3397 theDX, theDY, theDZ Directions of extrusion.
3398 theScaleFactor Use it to make prism with scaled second base.
3399 Nagative value means not scaled second base.
3400 theName Object name; when specified, this parameter is used
3401 for result publication in the study. Otherwise, if automatic
3402 publication is switched on, default value is used for result name.
3405 New GEOM.GEOM_Object, containing the created prism.
3407 # Example: see GEOM_TestAll.py
3410 if theScaleFactor > 0:
3411 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3412 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3414 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3415 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3416 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3417 anObj.SetParameters(Parameters)
3418 self._autoPublish(anObj, theName, "prism")
3421 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3422 # i.e. all the space, transfixed by the base shape during its translation
3423 # along the vector on the given distance in 2 Ways (forward/backward).
3424 # @param theBase Base shape to be extruded.
3425 # @param theDX, theDY, theDZ Directions of extrusion.
3426 # @param theName Object name; when specified, this parameter is used
3427 # for result publication in the study. Otherwise, if automatic
3428 # publication is switched on, default value is used for result name.
3430 # @return New GEOM.GEOM_Object, containing the created prism.
3432 # @ref tui_creation_prism "Example"
3433 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3435 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3436 i.e. all the space, transfixed by the base shape during its translation
3437 along the vector on the given distance in 2 Ways (forward/backward).
3440 theBase Base shape to be extruded.
3441 theDX, theDY, theDZ Directions of extrusion.
3442 theName Object name; when specified, this parameter is used
3443 for result publication in the study. Otherwise, if automatic
3444 publication is switched on, default value is used for result name.
3447 New GEOM.GEOM_Object, containing the created prism.
3449 # Example: see GEOM_TestAll.py
3450 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3451 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3452 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3453 anObj.SetParameters(Parameters)
3454 self._autoPublish(anObj, theName, "prism")
3457 ## Create a shape by revolution of the base shape around the axis
3458 # on the given angle, i.e. all the space, transfixed by the base
3459 # shape during its rotation around the axis on the given angle.
3460 # @param theBase Base shape to be rotated.
3461 # @param theAxis Rotation axis.
3462 # @param theAngle Rotation angle in radians.
3463 # @param theName Object name; when specified, this parameter is used
3464 # for result publication in the study. Otherwise, if automatic
3465 # publication is switched on, default value is used for result name.
3467 # @return New GEOM.GEOM_Object, containing the created revolution.
3469 # @ref tui_creation_revolution "Example"
3470 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3472 Create a shape by revolution of the base shape around the axis
3473 on the given angle, i.e. all the space, transfixed by the base
3474 shape during its rotation around the axis on the given angle.
3477 theBase Base shape to be rotated.
3478 theAxis Rotation axis.
3479 theAngle Rotation angle in radians.
3480 theName Object name; when specified, this parameter is used
3481 for result publication in the study. Otherwise, if automatic
3482 publication is switched on, default value is used for result name.
3485 New GEOM.GEOM_Object, containing the created revolution.
3487 # Example: see GEOM_TestAll.py
3488 theAngle,Parameters = ParseParameters(theAngle)
3489 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3490 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3491 anObj.SetParameters(Parameters)
3492 self._autoPublish(anObj, theName, "revolution")
3495 ## Create a shape by revolution of the base shape around the axis
3496 # on the given angle, i.e. all the space, transfixed by the base
3497 # shape during its rotation around the axis on the given angle in
3498 # both directions (forward/backward)
3499 # @param theBase Base shape to be rotated.
3500 # @param theAxis Rotation axis.
3501 # @param theAngle Rotation angle in radians.
3502 # @param theName Object name; when specified, this parameter is used
3503 # for result publication in the study. Otherwise, if automatic
3504 # publication is switched on, default value is used for result name.
3506 # @return New GEOM.GEOM_Object, containing the created revolution.
3508 # @ref tui_creation_revolution "Example"
3509 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3511 Create a shape by revolution of the base shape around the axis
3512 on the given angle, i.e. all the space, transfixed by the base
3513 shape during its rotation around the axis on the given angle in
3514 both directions (forward/backward).
3517 theBase Base shape to be rotated.
3518 theAxis Rotation axis.
3519 theAngle Rotation angle in radians.
3520 theName Object name; when specified, this parameter is used
3521 for result publication in the study. Otherwise, if automatic
3522 publication is switched on, default value is used for result name.
3525 New GEOM.GEOM_Object, containing the created revolution.
3527 theAngle,Parameters = ParseParameters(theAngle)
3528 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3529 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3530 anObj.SetParameters(Parameters)
3531 self._autoPublish(anObj, theName, "revolution")
3534 ## Create a filling from the given compound of contours.
3535 # @param theShape the compound of contours
3536 # @param theMinDeg a minimal degree of BSpline surface to create
3537 # @param theMaxDeg a maximal degree of BSpline surface to create
3538 # @param theTol2D a 2d tolerance to be reached
3539 # @param theTol3D a 3d tolerance to be reached
3540 # @param theNbIter a number of iteration of approximation algorithm
3541 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3542 # @param isApprox if True, BSpline curves are generated in the process
3543 # of surface construction. By default it is False, that means
3544 # the surface is created using given curves. The usage of
3545 # Approximation makes the algorithm work slower, but allows
3546 # building the surface for rather complex cases.
3547 # @param theName Object name; when specified, this parameter is used
3548 # for result publication in the study. Otherwise, if automatic
3549 # publication is switched on, default value is used for result name.
3551 # @return New GEOM.GEOM_Object, containing the created filling surface.
3553 # @ref tui_creation_filling "Example"
3554 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3555 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3557 Create a filling from the given compound of contours.
3560 theShape the compound of contours
3561 theMinDeg a minimal degree of BSpline surface to create
3562 theMaxDeg a maximal degree of BSpline surface to create
3563 theTol2D a 2d tolerance to be reached
3564 theTol3D a 3d tolerance to be reached
3565 theNbIter a number of iteration of approximation algorithm
3566 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3567 isApprox if True, BSpline curves are generated in the process
3568 of surface construction. By default it is False, that means
3569 the surface is created using given curves. The usage of
3570 Approximation makes the algorithm work slower, but allows
3571 building the surface for rather complex cases
3572 theName Object name; when specified, this parameter is used
3573 for result publication in the study. Otherwise, if automatic
3574 publication is switched on, default value is used for result name.
3577 New GEOM.GEOM_Object, containing the created filling surface.
3580 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3582 # Example: see GEOM_TestAll.py
3583 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3584 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3585 theTol2D, theTol3D, theNbIter,
3586 theMethod, isApprox)
3587 RaiseIfFailed("MakeFilling", self.PrimOp)
3588 anObj.SetParameters(Parameters)
3589 self._autoPublish(anObj, theName, "filling")
3593 ## Create a filling from the given compound of contours.
3594 # This method corresponds to MakeFilling with isApprox=True
3595 # @param theShape the compound of contours
3596 # @param theMinDeg a minimal degree of BSpline surface to create
3597 # @param theMaxDeg a maximal degree of BSpline surface to create
3598 # @param theTol3D a 3d tolerance to be reached
3599 # @param theName Object name; when specified, this parameter is used
3600 # for result publication in the study. Otherwise, if automatic
3601 # publication is switched on, default value is used for result name.
3603 # @return New GEOM.GEOM_Object, containing the created filling surface.
3605 # @ref tui_creation_filling "Example"
3606 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3608 Create a filling from the given compound of contours.
3609 This method corresponds to MakeFilling with isApprox=True
3612 theShape the compound of contours
3613 theMinDeg a minimal degree of BSpline surface to create
3614 theMaxDeg a maximal degree of BSpline surface to create
3615 theTol3D a 3d tolerance to be reached
3616 theName Object name; when specified, this parameter is used
3617 for result publication in the study. Otherwise, if automatic
3618 publication is switched on, default value is used for result name.
3621 New GEOM.GEOM_Object, containing the created filling surface.
3624 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3626 # Example: see GEOM_TestAll.py
3627 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3628 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3629 0, theTol3D, 0, GEOM.FOM_Default, True)
3630 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3631 anObj.SetParameters(Parameters)
3632 self._autoPublish(anObj, theName, "filling")
3635 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3636 # @param theSeqSections - set of specified sections.
3637 # @param theModeSolid - mode defining building solid or shell
3638 # @param thePreci - precision 3D used for smoothing
3639 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3640 # @param theName Object name; when specified, this parameter is used
3641 # for result publication in the study. Otherwise, if automatic
3642 # publication is switched on, default value is used for result name.
3644 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3646 # @ref swig_todo "Example"
3647 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3649 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3652 theSeqSections - set of specified sections.
3653 theModeSolid - mode defining building solid or shell
3654 thePreci - precision 3D used for smoothing
3655 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3656 theName Object name; when specified, this parameter is used
3657 for result publication in the study. Otherwise, if automatic
3658 publication is switched on, default value is used for result name.
3661 New GEOM.GEOM_Object, containing the created shell or solid.
3663 # Example: see GEOM_TestAll.py
3664 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3665 RaiseIfFailed("MakeThruSections", self.PrimOp)
3666 self._autoPublish(anObj, theName, "filling")
3669 ## Create a shape by extrusion of the base shape along
3670 # the path shape. The path shape can be a wire or an edge.
3671 # @param theBase Base shape to be extruded.
3672 # @param thePath Path shape to extrude the base shape along it.
3673 # @param theName Object name; when specified, this parameter is used
3674 # for result publication in the study. Otherwise, if automatic
3675 # publication is switched on, default value is used for result name.
3677 # @return New GEOM.GEOM_Object, containing the created pipe.
3679 # @ref tui_creation_pipe "Example"
3680 def MakePipe(self, theBase, thePath, theName=None):
3682 Create a shape by extrusion of the base shape along
3683 the path shape. The path shape can be a wire or an edge.
3686 theBase Base shape to be extruded.
3687 thePath Path shape to extrude the base shape along it.
3688 theName Object name; when specified, this parameter is used
3689 for result publication in the study. Otherwise, if automatic
3690 publication is switched on, default value is used for result name.
3693 New GEOM.GEOM_Object, containing the created pipe.
3695 # Example: see GEOM_TestAll.py
3696 anObj = self.PrimOp.MakePipe(theBase, thePath)
3697 RaiseIfFailed("MakePipe", self.PrimOp)
3698 self._autoPublish(anObj, theName, "pipe")
3701 ## Create a shape by extrusion of the profile shape along
3702 # the path shape. The path shape can be a wire or an edge.
3703 # the several profiles can be specified in the several locations of path.
3704 # @param theSeqBases - list of Bases shape to be extruded.
3705 # @param theLocations - list of locations on the path corresponding
3706 # specified list of the Bases shapes. Number of locations
3707 # should be equal to number of bases or list of locations can be empty.
3708 # @param thePath - Path shape to extrude the base shape along it.
3709 # @param theWithContact - the mode defining that the section is translated to be in
3710 # contact with the spine.
3711 # @param theWithCorrection - defining that the section is rotated to be
3712 # orthogonal to the spine tangent in the correspondent point
3713 # @param theName Object name; when specified, this parameter is used
3714 # for result publication in the study. Otherwise, if automatic
3715 # publication is switched on, default value is used for result name.
3717 # @return New GEOM.GEOM_Object, containing the created pipe.
3719 # @ref tui_creation_pipe_with_diff_sec "Example"
3720 def MakePipeWithDifferentSections(self, theSeqBases,
3721 theLocations, thePath,
3722 theWithContact, theWithCorrection, theName=None):
3724 Create a shape by extrusion of the profile shape along
3725 the path shape. The path shape can be a wire or an edge.
3726 the several profiles can be specified in the several locations of path.
3729 theSeqBases - list of Bases shape to be extruded.
3730 theLocations - list of locations on the path corresponding
3731 specified list of the Bases shapes. Number of locations
3732 should be equal to number of bases or list of locations can be empty.
3733 thePath - Path shape to extrude the base shape along it.
3734 theWithContact - the mode defining that the section is translated to be in
3735 contact with the spine(0/1)
3736 theWithCorrection - defining that the section is rotated to be
3737 orthogonal to the spine tangent in the correspondent point (0/1)
3738 theName Object name; when specified, this parameter is used
3739 for result publication in the study. Otherwise, if automatic
3740 publication is switched on, default value is used for result name.
3743 New GEOM.GEOM_Object, containing the created pipe.
3745 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3746 theLocations, thePath,
3747 theWithContact, theWithCorrection)
3748 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3749 self._autoPublish(anObj, theName, "pipe")
3752 ## Create a shape by extrusion of the profile shape along
3753 # the path shape. The path shape can be a wire or a edge.
3754 # the several profiles can be specified in the several locations of path.
3755 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3756 # shell or face. If number of faces in neighbour sections
3757 # aren't coincided result solid between such sections will
3758 # be created using external boundaries of this shells.
3759 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3760 # This list is used for searching correspondences between
3761 # faces in the sections. Size of this list must be equal
3762 # to size of list of base shapes.
3763 # @param theLocations - list of locations on the path corresponding
3764 # specified list of the Bases shapes. Number of locations
3765 # should be equal to number of bases. First and last
3766 # locations must be coincided with first and last vertexes
3767 # of path correspondingly.
3768 # @param thePath - Path shape to extrude the base shape along it.
3769 # @param theWithContact - the mode defining that the section is translated to be in
3770 # contact with the spine.
3771 # @param theWithCorrection - defining that the section is rotated to be
3772 # orthogonal to the spine tangent in the correspondent point
3773 # @param theName Object name; when specified, this parameter is used
3774 # for result publication in the study. Otherwise, if automatic
3775 # publication is switched on, default value is used for result name.
3777 # @return New GEOM.GEOM_Object, containing the created solids.
3779 # @ref tui_creation_pipe_with_shell_sec "Example"
3780 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3781 theLocations, thePath,
3782 theWithContact, theWithCorrection, theName=None):
3784 Create a shape by extrusion of the profile shape along
3785 the path shape. The path shape can be a wire or a edge.
3786 the several profiles can be specified in the several locations of path.
3789 theSeqBases - list of Bases shape to be extruded. Base shape must be
3790 shell or face. If number of faces in neighbour sections
3791 aren't coincided result solid between such sections will
3792 be created using external boundaries of this shells.
3793 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3794 This list is used for searching correspondences between
3795 faces in the sections. Size of this list must be equal
3796 to size of list of base shapes.
3797 theLocations - list of locations on the path corresponding
3798 specified list of the Bases shapes. Number of locations
3799 should be equal to number of bases. First and last
3800 locations must be coincided with first and last vertexes
3801 of path correspondingly.
3802 thePath - Path shape to extrude the base shape along it.
3803 theWithContact - the mode defining that the section is translated to be in
3804 contact with the spine (0/1)
3805 theWithCorrection - defining that the section is rotated to be
3806 orthogonal to the spine tangent in the correspondent point (0/1)
3807 theName Object name; when specified, this parameter is used
3808 for result publication in the study. Otherwise, if automatic
3809 publication is switched on, default value is used for result name.
3812 New GEOM.GEOM_Object, containing the created solids.
3814 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3815 theLocations, thePath,
3816 theWithContact, theWithCorrection)
3817 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3818 self._autoPublish(anObj, theName, "pipe")
3821 ## Create a shape by extrusion of the profile shape along
3822 # the path shape. This function is used only for debug pipe
3823 # functionality - it is a version of function MakePipeWithShellSections()
3824 # which give a possibility to recieve information about
3825 # creating pipe between each pair of sections step by step.
3826 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3827 theLocations, thePath,
3828 theWithContact, theWithCorrection, theName=None):
3830 Create a shape by extrusion of the profile shape along
3831 the path shape. This function is used only for debug pipe
3832 functionality - it is a version of previous function
3833 geompy.MakePipeWithShellSections() which give a possibility to
3834 recieve information about creating pipe between each pair of
3835 sections step by step.
3838 nbsect = len(theSeqBases)
3839 nbsubsect = len(theSeqSubBases)
3840 #print "nbsect = ",nbsect
3841 for i in range(1,nbsect):
3843 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3844 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3846 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3847 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3848 tmpLocations, thePath,
3849 theWithContact, theWithCorrection)
3850 if self.PrimOp.IsDone() == 0:
3851 print "Problems with pipe creation between ",i," and ",i+1," sections"
3852 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3855 print "Pipe between ",i," and ",i+1," sections is OK"
3860 resc = self.MakeCompound(res)
3861 #resc = self.MakeSewing(res, 0.001)
3862 #print "resc: ",resc
3863 self._autoPublish(resc, theName, "pipe")
3866 ## Create solids between given sections
3867 # @param theSeqBases - list of sections (shell or face).
3868 # @param theLocations - list of corresponding vertexes
3869 # @param theName Object name; when specified, this parameter is used
3870 # for result publication in the study. Otherwise, if automatic
3871 # publication is switched on, default value is used for result name.
3873 # @return New GEOM.GEOM_Object, containing the created solids.
3875 # @ref tui_creation_pipe_without_path "Example"
3876 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3878 Create solids between given sections
3881 theSeqBases - list of sections (shell or face).
3882 theLocations - list of corresponding vertexes
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.
3888 New GEOM.GEOM_Object, containing the created solids.
3890 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3891 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3892 self._autoPublish(anObj, theName, "pipe")
3895 ## Create a shape by extrusion of the base shape along
3896 # the path shape with constant bi-normal direction along the given vector.
3897 # The path shape can be a wire or an edge.
3898 # @param theBase Base shape to be extruded.
3899 # @param thePath Path shape to extrude the base shape along it.
3900 # @param theVec Vector defines a constant binormal direction to keep the
3901 # same angle beetween the direction and the sections
3902 # along the sweep surface.
3903 # @param theName Object name; when specified, this parameter is used
3904 # for result publication in the study. Otherwise, if automatic
3905 # publication is switched on, default value is used for result name.
3907 # @return New GEOM.GEOM_Object, containing the created pipe.
3909 # @ref tui_creation_pipe "Example"
3910 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3912 Create a shape by extrusion of the base shape along
3913 the path shape with constant bi-normal direction along the given vector.
3914 The path shape can be a wire or an edge.
3917 theBase Base shape to be extruded.
3918 thePath Path shape to extrude the base shape along it.
3919 theVec Vector defines a constant binormal direction to keep the
3920 same angle beetween the direction and the sections
3921 along the sweep surface.
3922 theName Object name; when specified, this parameter is used
3923 for result publication in the study. Otherwise, if automatic
3924 publication is switched on, default value is used for result name.
3927 New GEOM.GEOM_Object, containing the created pipe.
3929 # Example: see GEOM_TestAll.py
3930 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3931 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3932 self._autoPublish(anObj, theName, "pipe")
3935 ## Makes a thick solid from a face or a shell
3936 # @param theShape Face or Shell to be thicken
3937 # @param theThickness Thickness of the resulting solid
3938 # @param theName Object name; when specified, this parameter is used
3939 # for result publication in the study. Otherwise, if automatic
3940 # publication is switched on, default value is used for result name.
3942 # @return New GEOM.GEOM_Object, containing the created solid
3944 def MakeThickSolid(self, theShape, theThickness, theName=None):
3946 Make a thick solid from a face or a shell
3949 theShape Face or Shell to be thicken
3950 theThickness Thickness of the resulting solid
3951 theName Object name; when specified, this parameter is used
3952 for result publication in the study. Otherwise, if automatic
3953 publication is switched on, default value is used for result name.
3956 New GEOM.GEOM_Object, containing the created solid
3958 # Example: see GEOM_TestAll.py
3959 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3960 RaiseIfFailed("MakeThickening", self.PrimOp)
3961 self._autoPublish(anObj, theName, "pipe")
3965 ## Modifies a face or a shell to make it a thick solid
3966 # @param theShape Face or Shell to be thicken
3967 # @param theThickness Thickness of the resulting solid
3969 # @return The modified shape
3971 def Thicken(self, theShape, theThickness):
3973 Modifies a face or a shell to make it a thick solid
3976 theBase Base shape to be extruded.
3977 thePath Path shape to extrude the base shape along it.
3978 theName Object name; when specified, this parameter is used
3979 for result publication in the study. Otherwise, if automatic
3980 publication is switched on, default value is used for result name.
3985 # Example: see GEOM_TestAll.py
3986 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3987 RaiseIfFailed("MakeThickening", self.PrimOp)
3990 ## Build a middle path of a pipe-like shape.
3991 # The path shape can be a wire or an edge.
3992 # @param theShape It can be closed or unclosed pipe-like shell
3993 # or a pipe-like solid.
3994 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3995 # should be wires or faces of theShape.
3996 # @param theName Object name; when specified, this parameter is used
3997 # for result publication in the study. Otherwise, if automatic
3998 # publication is switched on, default value is used for result name.
4000 # @note It is not assumed that exact or approximate copy of theShape
4001 # can be obtained by applying existing Pipe operation on the
4002 # resulting "Path" wire taking theBase1 as the base - it is not
4003 # always possible; though in some particular cases it might work
4004 # it is not guaranteed. Thus, RestorePath function should not be
4005 # considered as an exact reverse operation of the Pipe.
4007 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4008 # source pipe's "path".
4010 # @ref tui_creation_pipe_path "Example"
4011 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4013 Build a middle path of a pipe-like shape.
4014 The path shape can be a wire or an edge.
4017 theShape It can be closed or unclosed pipe-like shell
4018 or a pipe-like solid.
4019 theBase1, theBase2 Two bases of the supposed pipe. This
4020 should be wires or faces of theShape.
4021 theName Object name; when specified, this parameter is used
4022 for result publication in the study. Otherwise, if automatic
4023 publication is switched on, default value is used for result name.
4026 New GEOM_Object, containing an edge or wire that represent
4029 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4030 RaiseIfFailed("RestorePath", self.PrimOp)
4031 self._autoPublish(anObj, theName, "path")
4034 ## Build a middle path of a pipe-like shape.
4035 # The path shape can be a wire or an edge.
4036 # @param theShape It can be closed or unclosed pipe-like shell
4037 # or a pipe-like solid.
4038 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4039 # should be lists of edges of theShape.
4040 # @param theName Object name; when specified, this parameter is used
4041 # for result publication in the study. Otherwise, if automatic
4042 # publication is switched on, default value is used for result name.
4044 # @note It is not assumed that exact or approximate copy of theShape
4045 # can be obtained by applying existing Pipe operation on the
4046 # resulting "Path" wire taking theBase1 as the base - it is not
4047 # always possible; though in some particular cases it might work
4048 # it is not guaranteed. Thus, RestorePath function should not be
4049 # considered as an exact reverse operation of the Pipe.
4051 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4052 # source pipe's "path".
4054 # @ref tui_creation_pipe_path "Example"
4055 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4057 Build a middle path of a pipe-like shape.
4058 The path shape can be a wire or an edge.
4061 theShape It can be closed or unclosed pipe-like shell
4062 or a pipe-like solid.
4063 listEdges1, listEdges2 Two bases of the supposed pipe. This
4064 should be lists of edges of theShape.
4065 theName Object name; when specified, this parameter is used
4066 for result publication in the study. Otherwise, if automatic
4067 publication is switched on, default value is used for result name.
4070 New GEOM_Object, containing an edge or wire that represent
4073 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4074 RaiseIfFailed("RestorePath", self.PrimOp)
4075 self._autoPublish(anObj, theName, "path")
4081 ## @addtogroup l3_advanced
4084 ## Create a linear edge with specified ends.
4085 # @param thePnt1 Point for the first end of edge.
4086 # @param thePnt2 Point for the second end of edge.
4087 # @param theName Object name; when specified, this parameter is used
4088 # for result publication in the study. Otherwise, if automatic
4089 # publication is switched on, default value is used for result name.
4091 # @return New GEOM.GEOM_Object, containing the created edge.
4093 # @ref tui_creation_edge "Example"
4094 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4096 Create a linear edge with specified ends.
4099 thePnt1 Point for the first end of edge.
4100 thePnt2 Point for the second end of edge.
4101 theName Object name; when specified, this parameter is used
4102 for result publication in the study. Otherwise, if automatic
4103 publication is switched on, default value is used for result name.
4106 New GEOM.GEOM_Object, containing the created edge.
4108 # Example: see GEOM_TestAll.py
4109 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4110 RaiseIfFailed("MakeEdge", self.ShapesOp)
4111 self._autoPublish(anObj, theName, "edge")
4114 ## Create a new edge, corresponding to the given length on the given curve.
4115 # @param theRefCurve The referenced curve (edge).
4116 # @param theLength Length on the referenced curve. It can be negative.
4117 # @param theStartPoint Any point can be selected for it, the new edge will begin
4118 # at the end of \a theRefCurve, close to the selected point.
4119 # If None, start from the first point of \a theRefCurve.
4120 # @param theName Object name; when specified, this parameter is used
4121 # for result publication in the study. Otherwise, if automatic
4122 # publication is switched on, default value is used for result name.
4124 # @return New GEOM.GEOM_Object, containing the created edge.
4126 # @ref tui_creation_edge "Example"
4127 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4129 Create a new edge, corresponding to the given length on the given curve.
4132 theRefCurve The referenced curve (edge).
4133 theLength Length on the referenced curve. It can be negative.
4134 theStartPoint Any point can be selected for it, the new edge will begin
4135 at the end of theRefCurve, close to the selected point.
4136 If None, start from the first point of theRefCurve.
4137 theName Object name; when specified, this parameter is used
4138 for result publication in the study. Otherwise, if automatic
4139 publication is switched on, default value is used for result name.
4142 New GEOM.GEOM_Object, containing the created edge.
4144 # Example: see GEOM_TestAll.py
4145 theLength, Parameters = ParseParameters(theLength)
4146 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4147 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4148 anObj.SetParameters(Parameters)
4149 self._autoPublish(anObj, theName, "edge")
4152 ## Create an edge from specified wire.
4153 # @param theWire source Wire
4154 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4155 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4156 # @param theName Object name; when specified, this parameter is used
4157 # for result publication in the study. Otherwise, if automatic
4158 # publication is switched on, default value is used for result name.
4160 # @return New GEOM.GEOM_Object, containing the created edge.
4162 # @ref tui_creation_edge "Example"
4163 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4165 Create an edge from specified wire.
4169 theLinearTolerance linear tolerance value (default = 1e-07)
4170 theAngularTolerance angular tolerance value (default = 1e-12)
4171 theName Object name; when specified, this parameter is used
4172 for result publication in the study. Otherwise, if automatic
4173 publication is switched on, default value is used for result name.
4176 New GEOM.GEOM_Object, containing the created edge.
4178 # Example: see GEOM_TestAll.py
4179 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4180 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4181 self._autoPublish(anObj, theName, "edge")
4184 ## Create a wire from the set of edges and wires.
4185 # @param theEdgesAndWires List of edges and/or wires.
4186 # @param theTolerance Maximum distance between vertices, that will be merged.
4187 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4188 # @param theName Object name; when specified, this parameter is used
4189 # for result publication in the study. Otherwise, if automatic
4190 # publication is switched on, default value is used for result name.
4192 # @return New GEOM.GEOM_Object, containing the created wire.
4194 # @ref tui_creation_wire "Example"
4195 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4197 Create a wire from the set of edges and wires.
4200 theEdgesAndWires List of edges and/or wires.
4201 theTolerance Maximum distance between vertices, that will be merged.
4202 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4203 theName Object name; when specified, this parameter is used
4204 for result publication in the study. Otherwise, if automatic
4205 publication is switched on, default value is used for result name.
4208 New GEOM.GEOM_Object, containing the created wire.
4210 # Example: see GEOM_TestAll.py
4211 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4212 RaiseIfFailed("MakeWire", self.ShapesOp)
4213 self._autoPublish(anObj, theName, "wire")
4216 ## Create a face on the given wire.
4217 # @param theWire closed Wire or Edge to build the face on.
4218 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4219 # If the tolerance of the obtained planar face is less
4220 # than 1e-06, this face will be returned, otherwise the
4221 # algorithm tries to build any suitable face on the given
4222 # wire and prints a warning message.
4223 # @param theName Object name; when specified, this parameter is used
4224 # for result publication in the study. Otherwise, if automatic
4225 # publication is switched on, default value is used for result name.
4227 # @return New GEOM.GEOM_Object, containing the created face.
4229 # @ref tui_creation_face "Example"
4230 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4232 Create a face on the given wire.
4235 theWire closed Wire or Edge to build the face on.
4236 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4237 If the tolerance of the obtained planar face is less
4238 than 1e-06, this face will be returned, otherwise the
4239 algorithm tries to build any suitable face on the given
4240 wire and prints a warning message.
4241 theName Object name; when specified, this parameter is used
4242 for result publication in the study. Otherwise, if automatic
4243 publication is switched on, default value is used for result name.
4246 New GEOM.GEOM_Object, containing the created face.
4248 # Example: see GEOM_TestAll.py
4249 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4250 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4251 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4253 RaiseIfFailed("MakeFace", self.ShapesOp)
4254 self._autoPublish(anObj, theName, "face")
4257 ## Create a face on the given wires set.
4258 # @param theWires List of closed wires or edges to build the face on.
4259 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4260 # If the tolerance of the obtained planar face is less
4261 # than 1e-06, this face will be returned, otherwise the
4262 # algorithm tries to build any suitable face on the given
4263 # wire and prints a warning message.
4264 # @param theName Object name; when specified, this parameter is used
4265 # for result publication in the study. Otherwise, if automatic
4266 # publication is switched on, default value is used for result name.
4268 # @return New GEOM.GEOM_Object, containing the created face.
4270 # @ref tui_creation_face "Example"
4271 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4273 Create a face on the given wires set.
4276 theWires List of closed wires or edges to build the face on.
4277 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4278 If the tolerance of the obtained planar face is less
4279 than 1e-06, this face will be returned, otherwise the
4280 algorithm tries to build any suitable face on the given
4281 wire and prints a warning message.
4282 theName Object name; when specified, this parameter is used
4283 for result publication in the study. Otherwise, if automatic
4284 publication is switched on, default value is used for result name.
4287 New GEOM.GEOM_Object, containing the created face.
4289 # Example: see GEOM_TestAll.py
4290 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4291 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4292 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4294 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4295 self._autoPublish(anObj, theName, "face")
4298 ## See MakeFaceWires() method for details.
4300 # @ref tui_creation_face "Example 1"
4301 # \n @ref swig_MakeFaces "Example 2"
4302 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4304 See geompy.MakeFaceWires() method for details.
4306 # Example: see GEOM_TestOthers.py
4307 # note: auto-publishing is done in self.MakeFaceWires()
4308 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4311 ## Create a shell from the set of faces and shells.
4312 # @param theFacesAndShells List of faces and/or shells.
4313 # @param theName Object name; when specified, this parameter is used
4314 # for result publication in the study. Otherwise, if automatic
4315 # publication is switched on, default value is used for result name.
4317 # @return New GEOM.GEOM_Object, containing the created shell.
4319 # @ref tui_creation_shell "Example"
4320 def MakeShell(self, theFacesAndShells, theName=None):
4322 Create a shell from the set of faces and shells.
4325 theFacesAndShells List of faces and/or shells.
4326 theName Object name; when specified, this parameter is used
4327 for result publication in the study. Otherwise, if automatic
4328 publication is switched on, default value is used for result name.
4331 New GEOM.GEOM_Object, containing the created shell.
4333 # Example: see GEOM_TestAll.py
4334 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4335 RaiseIfFailed("MakeShell", self.ShapesOp)
4336 self._autoPublish(anObj, theName, "shell")
4339 ## Create a solid, bounded by the given shells.
4340 # @param theShells Sequence of bounding shells.
4341 # @param theName Object name; when specified, this parameter is used
4342 # for result publication in the study. Otherwise, if automatic
4343 # publication is switched on, default value is used for result name.
4345 # @return New GEOM.GEOM_Object, containing the created solid.
4347 # @ref tui_creation_solid "Example"
4348 def MakeSolid(self, theShells, theName=None):
4350 Create a solid, bounded by the given shells.
4353 theShells Sequence of bounding shells.
4354 theName Object name; when specified, this parameter is used
4355 for result publication in the study. Otherwise, if automatic
4356 publication is switched on, default value is used for result name.
4359 New GEOM.GEOM_Object, containing the created solid.
4361 # Example: see GEOM_TestAll.py
4362 if len(theShells) == 1:
4363 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4365 # raise RuntimeError, "MakeSolidShells : " + descr
4366 if descr == "WRN_SHAPE_UNCLOSED":
4367 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4368 anObj = self.ShapesOp.MakeSolidShells(theShells)
4369 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4370 self._autoPublish(anObj, theName, "solid")
4373 ## Create a compound of the given shapes.
4374 # @param theShapes List of shapes to put in compound.
4375 # @param theName Object name; when specified, this parameter is used
4376 # for result publication in the study. Otherwise, if automatic
4377 # publication is switched on, default value is used for result name.
4379 # @return New GEOM.GEOM_Object, containing the created compound.
4381 # @ref tui_creation_compound "Example"
4382 def MakeCompound(self, theShapes, theName=None):
4384 Create a compound of the given shapes.
4387 theShapes List of shapes to put in compound.
4388 theName Object name; when specified, this parameter is used
4389 for result publication in the study. Otherwise, if automatic
4390 publication is switched on, default value is used for result name.
4393 New GEOM.GEOM_Object, containing the created compound.
4395 # Example: see GEOM_TestAll.py
4396 self.ShapesOp.StartOperation()
4397 anObj = self.ShapesOp.MakeCompound(theShapes)
4398 RaiseIfFailed("MakeCompound", self.ShapesOp)
4399 self._autoPublish(anObj, theName, "compound")
4402 # end of l3_advanced
4405 ## @addtogroup l2_measure
4408 ## Gives quantity of faces in the given shape.
4409 # @param theShape Shape to count faces of.
4410 # @return Quantity of faces.
4412 # @ref swig_NumberOf "Example"
4413 def NumberOfFaces(self, theShape):
4415 Gives quantity of faces in the given shape.
4418 theShape Shape to count faces of.
4423 # Example: see GEOM_TestOthers.py
4424 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4425 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4428 ## Gives quantity of edges in the given shape.
4429 # @param theShape Shape to count edges of.
4430 # @return Quantity of edges.
4432 # @ref swig_NumberOf "Example"
4433 def NumberOfEdges(self, theShape):
4435 Gives quantity of edges in the given shape.
4438 theShape Shape to count edges of.
4443 # Example: see GEOM_TestOthers.py
4444 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4445 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4448 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4449 # @param theShape Shape to count sub-shapes of.
4450 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4451 # @return Quantity of sub-shapes of given type.
4453 # @ref swig_NumberOf "Example"
4454 def NumberOfSubShapes(self, theShape, theShapeType):
4456 Gives quantity of sub-shapes of type theShapeType in the given shape.
4459 theShape Shape to count sub-shapes of.
4460 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4463 Quantity of sub-shapes of given type.
4465 # Example: see GEOM_TestOthers.py
4466 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4467 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4470 ## Gives quantity of solids in the given shape.
4471 # @param theShape Shape to count solids in.
4472 # @return Quantity of solids.
4474 # @ref swig_NumberOf "Example"
4475 def NumberOfSolids(self, theShape):
4477 Gives quantity of solids in the given shape.
4480 theShape Shape to count solids in.
4485 # Example: see GEOM_TestOthers.py
4486 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4487 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4493 ## @addtogroup l3_healing
4496 ## Reverses an orientation the given shape.
4497 # @param theShape Shape to be reversed.
4498 # @param theName Object name; when specified, this parameter is used
4499 # for result publication in the study. Otherwise, if automatic
4500 # publication is switched on, default value is used for result name.
4502 # @return The reversed copy of theShape.
4504 # @ref swig_ChangeOrientation "Example"
4505 def ChangeOrientation(self, theShape, theName=None):
4507 Reverses an orientation the given shape.
4510 theShape Shape to be reversed.
4511 theName Object name; when specified, this parameter is used
4512 for result publication in the study. Otherwise, if automatic
4513 publication is switched on, default value is used for result name.
4516 The reversed copy of theShape.
4518 # Example: see GEOM_TestAll.py
4519 anObj = self.ShapesOp.ChangeOrientation(theShape)
4520 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4521 self._autoPublish(anObj, theName, "reversed")
4524 ## See ChangeOrientation() method for details.
4526 # @ref swig_OrientationChange "Example"
4527 def OrientationChange(self, theShape, theName=None):
4529 See geompy.ChangeOrientation method for details.
4531 # Example: see GEOM_TestOthers.py
4532 # note: auto-publishing is done in self.ChangeOrientation()
4533 anObj = self.ChangeOrientation(theShape, theName)
4539 ## @addtogroup l4_obtain
4542 ## Retrieve all free faces from the given shape.
4543 # Free face is a face, which is not shared between two shells of the shape.
4544 # @param theShape Shape to find free faces in.
4545 # @return List of IDs of all free faces, contained in theShape.
4547 # @ref tui_measurement_tools_page "Example"
4548 def GetFreeFacesIDs(self,theShape):
4550 Retrieve all free faces from the given shape.
4551 Free face is a face, which is not shared between two shells of the shape.
4554 theShape Shape to find free faces in.
4557 List of IDs of all free faces, contained in theShape.
4559 # Example: see GEOM_TestOthers.py
4560 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4561 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4564 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4565 # @param theShape1 Shape to find sub-shapes in.
4566 # @param theShape2 Shape to find shared sub-shapes with.
4567 # @param theShapeType Type of sub-shapes to be retrieved.
4568 # @param theName Object name; when specified, this parameter is used
4569 # for result publication in the study. Otherwise, if automatic
4570 # publication is switched on, default value is used for result name.
4572 # @return List of sub-shapes of theShape1, shared with theShape2.
4574 # @ref swig_GetSharedShapes "Example"
4575 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4577 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4580 theShape1 Shape to find sub-shapes in.
4581 theShape2 Shape to find shared sub-shapes with.
4582 theShapeType Type of sub-shapes to be retrieved.
4583 theName Object name; when specified, this parameter is used
4584 for result publication in the study. Otherwise, if automatic
4585 publication is switched on, default value is used for result name.
4588 List of sub-shapes of theShape1, shared with theShape2.
4590 # Example: see GEOM_TestOthers.py
4591 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4592 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4593 self._autoPublish(aList, theName, "shared")
4596 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4597 # @param theShapes Shapes to find common sub-shapes of.
4598 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4599 # @param theName Object name; when specified, this parameter is used
4600 # for result publication in the study. Otherwise, if automatic
4601 # publication is switched on, default value is used for result name.
4603 # @return List of objects, that are sub-shapes of all given shapes.
4605 # @ref swig_GetSharedShapes "Example"
4606 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4608 Get all sub-shapes, shared by all shapes in the list theShapes.
4611 theShapes Shapes to find common sub-shapes of.
4612 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4613 theName Object name; when specified, this parameter is used
4614 for result publication in the study. Otherwise, if automatic
4615 publication is switched on, default value is used for result name.
4618 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4620 # Example: see GEOM_TestOthers.py
4621 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4622 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4623 self._autoPublish(aList, theName, "shared")
4626 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4627 # situated relatively the specified plane by the certain way,
4628 # defined through <VAR>theState</VAR> parameter.
4629 # @param theShape Shape to find sub-shapes of.
4630 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4631 # @param theAx1 Vector (or line, or linear edge), specifying normal
4632 # direction and location of the plane to find shapes on.
4633 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4634 # @param theName Object name; when specified, this parameter is used
4635 # for result publication in the study. Otherwise, if automatic
4636 # publication is switched on, default value is used for result name.
4638 # @return List of all found sub-shapes.
4640 # @ref swig_GetShapesOnPlane "Example"
4641 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4643 Find in theShape all sub-shapes of type theShapeType,
4644 situated relatively the specified plane by the certain way,
4645 defined through theState parameter.
4648 theShape Shape to find sub-shapes of.
4649 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4650 theAx1 Vector (or line, or linear edge), specifying normal
4651 direction and location of the plane to find shapes on.
4652 theState The state of the sub-shapes to find (see GEOM::shape_state)
4653 theName Object name; when specified, this parameter is used
4654 for result publication in the study. Otherwise, if automatic
4655 publication is switched on, default value is used for result name.
4658 List of all found sub-shapes.
4660 # Example: see GEOM_TestOthers.py
4661 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4662 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4663 self._autoPublish(aList, theName, "shapeOnPlane")
4666 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4667 # situated relatively the specified plane by the certain way,
4668 # defined through <VAR>theState</VAR> parameter.
4669 # @param theShape Shape to find sub-shapes of.
4670 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4671 # @param theAx1 Vector (or line, or linear edge), specifying normal
4672 # direction and location of the plane to find shapes on.
4673 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4675 # @return List of all found sub-shapes indices.
4677 # @ref swig_GetShapesOnPlaneIDs "Example"
4678 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4680 Find in theShape all sub-shapes of type theShapeType,
4681 situated relatively the specified plane by the certain way,
4682 defined through theState parameter.
4685 theShape Shape to find sub-shapes of.
4686 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4687 theAx1 Vector (or line, or linear edge), specifying normal
4688 direction and location of the plane to find shapes on.
4689 theState The state of the sub-shapes to find (see GEOM::shape_state)
4692 List of all found sub-shapes indices.
4694 # Example: see GEOM_TestOthers.py
4695 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4696 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4699 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4700 # situated relatively the specified plane by the certain way,
4701 # defined through <VAR>theState</VAR> parameter.
4702 # @param theShape Shape to find sub-shapes of.
4703 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4704 # @param theAx1 Vector (or line, or linear edge), specifying normal
4705 # direction of the plane to find shapes on.
4706 # @param thePnt Point specifying location of the plane to find shapes on.
4707 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4708 # @param theName Object name; when specified, this parameter is used
4709 # for result publication in the study. Otherwise, if automatic
4710 # publication is switched on, default value is used for result name.
4712 # @return List of all found sub-shapes.
4714 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4715 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4717 Find in theShape all sub-shapes of type theShapeType,
4718 situated relatively the specified plane by the certain way,
4719 defined through theState parameter.
4722 theShape Shape to find sub-shapes of.
4723 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4724 theAx1 Vector (or line, or linear edge), specifying normal
4725 direction and location of the plane to find shapes on.
4726 thePnt Point specifying location of the plane to find shapes on.
4727 theState The state of the sub-shapes to find (see GEOM::shape_state)
4728 theName Object name; when specified, this parameter is used
4729 for result publication in the study. Otherwise, if automatic
4730 publication is switched on, default value is used for result name.
4733 List of all found sub-shapes.
4735 # Example: see GEOM_TestOthers.py
4736 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4737 theAx1, thePnt, theState)
4738 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4739 self._autoPublish(aList, theName, "shapeOnPlane")
4742 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4743 # situated relatively the specified plane by the certain way,
4744 # defined through <VAR>theState</VAR> parameter.
4745 # @param theShape Shape to find sub-shapes of.
4746 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4747 # @param theAx1 Vector (or line, or linear edge), specifying normal
4748 # direction of the plane to find shapes on.
4749 # @param thePnt Point specifying location of the plane to find shapes on.
4750 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4752 # @return List of all found sub-shapes indices.
4754 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4755 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4757 Find in theShape all sub-shapes of type theShapeType,
4758 situated relatively the specified plane by the certain way,
4759 defined through theState parameter.
4762 theShape Shape to find sub-shapes of.
4763 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4764 theAx1 Vector (or line, or linear edge), specifying normal
4765 direction and location of the plane to find shapes on.
4766 thePnt Point specifying location of the plane to find shapes on.
4767 theState The state of the sub-shapes to find (see GEOM::shape_state)
4770 List of all found sub-shapes indices.
4772 # Example: see GEOM_TestOthers.py
4773 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4774 theAx1, thePnt, theState)
4775 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4778 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4779 # the specified cylinder by the certain way, defined through \a theState parameter.
4780 # @param theShape Shape to find sub-shapes of.
4781 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4782 # @param theAxis Vector (or line, or linear edge), specifying
4783 # axis of the cylinder to find shapes on.
4784 # @param theRadius Radius of the cylinder to find shapes on.
4785 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4786 # @param theName Object name; when specified, this parameter is used
4787 # for result publication in the study. Otherwise, if automatic
4788 # publication is switched on, default value is used for result name.
4790 # @return List of all found sub-shapes.
4792 # @ref swig_GetShapesOnCylinder "Example"
4793 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4795 Find in theShape all sub-shapes of type theShapeType, situated relatively
4796 the specified cylinder by the certain way, defined through theState parameter.
4799 theShape Shape to find sub-shapes of.
4800 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4801 theAxis Vector (or line, or linear edge), specifying
4802 axis of the cylinder to find shapes on.
4803 theRadius Radius of the cylinder to find shapes on.
4804 theState The state of the sub-shapes to find (see GEOM::shape_state)
4805 theName Object name; when specified, this parameter is used
4806 for result publication in the study. Otherwise, if automatic
4807 publication is switched on, default value is used for result name.
4810 List of all found sub-shapes.
4812 # Example: see GEOM_TestOthers.py
4813 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4814 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4815 self._autoPublish(aList, theName, "shapeOnCylinder")
4818 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4819 # the specified cylinder by the certain way, defined through \a theState parameter.
4820 # @param theShape Shape to find sub-shapes of.
4821 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4822 # @param theAxis Vector (or line, or linear edge), specifying
4823 # axis of the cylinder to find shapes on.
4824 # @param theRadius Radius of the cylinder to find shapes on.
4825 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4827 # @return List of all found sub-shapes indices.
4829 # @ref swig_GetShapesOnCylinderIDs "Example"
4830 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4832 Find in theShape all sub-shapes of type theShapeType, situated relatively
4833 the specified cylinder by the certain way, defined through theState parameter.
4836 theShape Shape to find sub-shapes of.
4837 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4838 theAxis Vector (or line, or linear edge), specifying
4839 axis of the cylinder to find shapes on.
4840 theRadius Radius of the cylinder to find shapes on.
4841 theState The state of the sub-shapes to find (see GEOM::shape_state)
4844 List of all found sub-shapes indices.
4846 # Example: see GEOM_TestOthers.py
4847 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4848 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4851 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4852 # the specified cylinder by the certain way, defined through \a theState parameter.
4853 # @param theShape Shape to find sub-shapes of.
4854 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4855 # @param theAxis Vector (or line, or linear edge), specifying
4856 # axis of the cylinder to find shapes on.
4857 # @param thePnt Point specifying location of the bottom of the cylinder.
4858 # @param theRadius Radius of the cylinder to find shapes on.
4859 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4860 # @param theName Object name; when specified, this parameter is used
4861 # for result publication in the study. Otherwise, if automatic
4862 # publication is switched on, default value is used for result name.
4864 # @return List of all found sub-shapes.
4866 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4867 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4869 Find in theShape all sub-shapes of type theShapeType, situated relatively
4870 the specified cylinder by the certain way, defined through theState parameter.
4873 theShape Shape to find sub-shapes of.
4874 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4875 theAxis Vector (or line, or linear edge), specifying
4876 axis of the cylinder to find shapes on.
4877 theRadius Radius of the cylinder to find shapes on.
4878 theState The state of the sub-shapes to find (see GEOM::shape_state)
4879 theName Object name; when specified, this parameter is used
4880 for result publication in the study. Otherwise, if automatic
4881 publication is switched on, default value is used for result name.
4884 List of all found sub-shapes.
4886 # Example: see GEOM_TestOthers.py
4887 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4888 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4889 self._autoPublish(aList, theName, "shapeOnCylinder")
4892 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4893 # the specified cylinder by the certain way, defined through \a theState parameter.
4894 # @param theShape Shape to find sub-shapes of.
4895 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4896 # @param theAxis Vector (or line, or linear edge), specifying
4897 # axis of the cylinder to find shapes on.
4898 # @param thePnt Point specifying location of the bottom of the cylinder.
4899 # @param theRadius Radius of the cylinder to find shapes on.
4900 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4902 # @return List of all found sub-shapes indices
4904 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4905 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4907 Find in theShape all sub-shapes of type theShapeType, situated relatively
4908 the specified cylinder by the certain way, defined through theState parameter.
4911 theShape Shape to find sub-shapes of.
4912 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4913 theAxis Vector (or line, or linear edge), specifying
4914 axis of the cylinder to find shapes on.
4915 theRadius Radius of the cylinder to find shapes on.
4916 theState The state of the sub-shapes to find (see GEOM::shape_state)
4919 List of all found sub-shapes indices.
4921 # Example: see GEOM_TestOthers.py
4922 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4923 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4926 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4927 # the specified sphere by the certain way, defined through \a theState parameter.
4928 # @param theShape Shape to find sub-shapes of.
4929 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4930 # @param theCenter Point, specifying center of the sphere to find shapes on.
4931 # @param theRadius Radius of the sphere to find shapes on.
4932 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4933 # @param theName Object name; when specified, this parameter is used
4934 # for result publication in the study. Otherwise, if automatic
4935 # publication is switched on, default value is used for result name.
4937 # @return List of all found sub-shapes.
4939 # @ref swig_GetShapesOnSphere "Example"
4940 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4942 Find in theShape all sub-shapes of type theShapeType, situated relatively
4943 the specified sphere by the certain way, defined through theState parameter.
4946 theShape Shape to find sub-shapes of.
4947 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4948 theCenter Point, specifying center of the sphere to find shapes on.
4949 theRadius Radius of the sphere to find shapes on.
4950 theState The state of the sub-shapes to find (see GEOM::shape_state)
4951 theName Object name; when specified, this parameter is used
4952 for result publication in the study. Otherwise, if automatic
4953 publication is switched on, default value is used for result name.
4956 List of all found sub-shapes.
4958 # Example: see GEOM_TestOthers.py
4959 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4960 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4961 self._autoPublish(aList, theName, "shapeOnSphere")
4964 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4965 # the specified sphere by the certain way, defined through \a theState parameter.
4966 # @param theShape Shape to find sub-shapes of.
4967 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4968 # @param theCenter Point, specifying center of the sphere to find shapes on.
4969 # @param theRadius Radius of the sphere to find shapes on.
4970 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4972 # @return List of all found sub-shapes indices.
4974 # @ref swig_GetShapesOnSphereIDs "Example"
4975 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4977 Find in theShape all sub-shapes of type theShapeType, situated relatively
4978 the specified sphere by the certain way, defined through theState parameter.
4981 theShape Shape to find sub-shapes of.
4982 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4983 theCenter Point, specifying center of the sphere to find shapes on.
4984 theRadius Radius of the sphere to find shapes on.
4985 theState The state of the sub-shapes to find (see GEOM::shape_state)
4988 List of all found sub-shapes indices.
4990 # Example: see GEOM_TestOthers.py
4991 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4992 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4995 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4996 # the specified quadrangle by the certain way, defined through \a theState parameter.
4997 # @param theShape Shape to find sub-shapes of.
4998 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4999 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5000 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5001 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5002 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5003 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5004 # @param theName Object name; when specified, this parameter is used
5005 # for result publication in the study. Otherwise, if automatic
5006 # publication is switched on, default value is used for result name.
5008 # @return List of all found sub-shapes.
5010 # @ref swig_GetShapesOnQuadrangle "Example"
5011 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5012 theTopLeftPoint, theTopRigthPoint,
5013 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5015 Find in theShape all sub-shapes of type theShapeType, situated relatively
5016 the specified quadrangle by the certain way, defined through theState parameter.
5019 theShape Shape to find sub-shapes of.
5020 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5021 theTopLeftPoint Point, specifying top left corner of a quadrangle
5022 theTopRigthPoint Point, specifying top right corner of a quadrangle
5023 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5024 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5025 theState The state of the sub-shapes to find (see GEOM::shape_state)
5026 theName Object name; when specified, this parameter is used
5027 for result publication in the study. Otherwise, if automatic
5028 publication is switched on, default value is used for result name.
5031 List of all found sub-shapes.
5033 # Example: see GEOM_TestOthers.py
5034 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5035 theTopLeftPoint, theTopRigthPoint,
5036 theBottomLeftPoint, theBottomRigthPoint, theState)
5037 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5038 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5041 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5042 # the specified quadrangle by the certain way, defined through \a theState parameter.
5043 # @param theShape Shape to find sub-shapes of.
5044 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5045 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5046 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5047 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5048 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5049 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5051 # @return List of all found sub-shapes indices.
5053 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5054 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5055 theTopLeftPoint, theTopRigthPoint,
5056 theBottomLeftPoint, theBottomRigthPoint, theState):
5058 Find in theShape all sub-shapes of type theShapeType, situated relatively
5059 the specified quadrangle by the certain way, defined through theState parameter.
5062 theShape Shape to find sub-shapes of.
5063 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5064 theTopLeftPoint Point, specifying top left corner of a quadrangle
5065 theTopRigthPoint Point, specifying top right corner of a quadrangle
5066 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5067 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5068 theState The state of the sub-shapes to find (see GEOM::shape_state)
5071 List of all found sub-shapes indices.
5074 # Example: see GEOM_TestOthers.py
5075 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5076 theTopLeftPoint, theTopRigthPoint,
5077 theBottomLeftPoint, theBottomRigthPoint, theState)
5078 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5081 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5082 # the specified \a theBox by the certain way, defined through \a theState parameter.
5083 # @param theBox Shape for relative comparing.
5084 # @param theShape Shape to find sub-shapes of.
5085 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5086 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5087 # @param theName Object name; when specified, this parameter is used
5088 # for result publication in the study. Otherwise, if automatic
5089 # publication is switched on, default value is used for result name.
5091 # @return List of all found sub-shapes.
5093 # @ref swig_GetShapesOnBox "Example"
5094 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5096 Find in theShape all sub-shapes of type theShapeType, situated relatively
5097 the specified theBox by the certain way, defined through theState parameter.
5100 theBox Shape for relative comparing.
5101 theShape Shape to find sub-shapes of.
5102 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5103 theState The state of the sub-shapes to find (see GEOM::shape_state)
5104 theName Object name; when specified, this parameter is used
5105 for result publication in the study. Otherwise, if automatic
5106 publication is switched on, default value is used for result name.
5109 List of all found sub-shapes.
5111 # Example: see GEOM_TestOthers.py
5112 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5113 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5114 self._autoPublish(aList, theName, "shapeOnBox")
5117 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5118 # the specified \a theBox by the certain way, defined through \a theState parameter.
5119 # @param theBox Shape for relative comparing.
5120 # @param theShape Shape to find sub-shapes of.
5121 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5122 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5124 # @return List of all found sub-shapes indices.
5126 # @ref swig_GetShapesOnBoxIDs "Example"
5127 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5129 Find in theShape all sub-shapes of type theShapeType, situated relatively
5130 the specified theBox by the certain way, defined through theState parameter.
5133 theBox Shape for relative comparing.
5134 theShape Shape to find sub-shapes of.
5135 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5136 theState The state of the sub-shapes to find (see GEOM::shape_state)
5139 List of all found sub-shapes indices.
5141 # Example: see GEOM_TestOthers.py
5142 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5143 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5146 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5147 # situated relatively the specified \a theCheckShape by the
5148 # certain way, defined through \a theState parameter.
5149 # @param theCheckShape Shape for relative comparing. It must be a solid.
5150 # @param theShape Shape to find sub-shapes of.
5151 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5152 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5153 # @param theName Object name; when specified, this parameter is used
5154 # for result publication in the study. Otherwise, if automatic
5155 # publication is switched on, default value is used for result name.
5157 # @return List of all found sub-shapes.
5159 # @ref swig_GetShapesOnShape "Example"
5160 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5162 Find in theShape all sub-shapes of type theShapeType,
5163 situated relatively the specified theCheckShape by the
5164 certain way, defined through theState parameter.
5167 theCheckShape Shape for relative comparing. It must be a solid.
5168 theShape Shape to find sub-shapes of.
5169 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5170 theState The state of the sub-shapes to find (see GEOM::shape_state)
5171 theName Object name; when specified, this parameter is used
5172 for result publication in the study. Otherwise, if automatic
5173 publication is switched on, default value is used for result name.
5176 List of all found sub-shapes.
5178 # Example: see GEOM_TestOthers.py
5179 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5180 theShapeType, theState)
5181 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5182 self._autoPublish(aList, theName, "shapeOnShape")
5185 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5186 # situated relatively the specified \a theCheckShape by the
5187 # certain way, defined through \a theState parameter.
5188 # @param theCheckShape Shape for relative comparing. It must be a solid.
5189 # @param theShape Shape to find sub-shapes of.
5190 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5191 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5192 # @param theName Object name; when specified, this parameter is used
5193 # for result publication in the study. Otherwise, if automatic
5194 # publication is switched on, default value is used for result name.
5196 # @return All found sub-shapes as compound.
5198 # @ref swig_GetShapesOnShapeAsCompound "Example"
5199 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5201 Find in theShape all sub-shapes of type theShapeType,
5202 situated relatively the specified theCheckShape by the
5203 certain way, defined through theState parameter.
5206 theCheckShape Shape for relative comparing. It must be a solid.
5207 theShape Shape to find sub-shapes of.
5208 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5209 theState The state of the sub-shapes to find (see GEOM::shape_state)
5210 theName Object name; when specified, this parameter is used
5211 for result publication in the study. Otherwise, if automatic
5212 publication is switched on, default value is used for result name.
5215 All found sub-shapes as compound.
5217 # Example: see GEOM_TestOthers.py
5218 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5219 theShapeType, theState)
5220 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5221 self._autoPublish(anObj, theName, "shapeOnShape")
5224 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5225 # situated relatively the specified \a theCheckShape by the
5226 # certain way, defined through \a theState parameter.
5227 # @param theCheckShape Shape for relative comparing. It must be a solid.
5228 # @param theShape Shape to find sub-shapes of.
5229 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5230 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5232 # @return List of all found sub-shapes indices.
5234 # @ref swig_GetShapesOnShapeIDs "Example"
5235 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5237 Find in theShape all sub-shapes of type theShapeType,
5238 situated relatively the specified theCheckShape by the
5239 certain way, defined through theState parameter.
5242 theCheckShape Shape for relative comparing. It must be a solid.
5243 theShape Shape to find sub-shapes of.
5244 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5245 theState The state of the sub-shapes to find (see GEOM::shape_state)
5248 List of all found sub-shapes indices.
5250 # Example: see GEOM_TestOthers.py
5251 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5252 theShapeType, theState)
5253 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5256 ## Get sub-shape(s) of theShapeWhere, which are
5257 # coincident with \a theShapeWhat or could be a part of it.
5258 # @param theShapeWhere Shape to find sub-shapes of.
5259 # @param theShapeWhat Shape, specifying what to find.
5260 # @param isNewImplementation implementation of GetInPlace functionality
5261 # (default = False, old alghorithm based on shape properties)
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 Group of all found sub-shapes or a single found sub-shape.
5268 # @note This function has a restriction on argument shapes.
5269 # If \a theShapeWhere has curved parts with significantly
5270 # outstanding centres (i.e. the mass centre of a part is closer to
5271 # \a theShapeWhat than to the part), such parts will not be found.
5272 # @image html get_in_place_lost_part.png
5274 # @ref swig_GetInPlace "Example"
5275 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5277 Get sub-shape(s) of theShapeWhere, which are
5278 coincident with theShapeWhat or could be a part of it.
5281 theShapeWhere Shape to find sub-shapes of.
5282 theShapeWhat Shape, specifying what to find.
5283 isNewImplementation Implementation of GetInPlace functionality
5284 (default = False, old alghorithm based on shape properties)
5285 theName Object name; when specified, this parameter is used
5286 for result publication in the study. Otherwise, if automatic
5287 publication is switched on, default value is used for result name.
5290 Group of all found sub-shapes or a single found sub-shape.
5294 This function has a restriction on argument shapes.
5295 If theShapeWhere has curved parts with significantly
5296 outstanding centres (i.e. the mass centre of a part is closer to
5297 theShapeWhat than to the part), such parts will not be found.
5299 # Example: see GEOM_TestOthers.py
5301 if isNewImplementation:
5302 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5304 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5306 RaiseIfFailed("GetInPlace", self.ShapesOp)
5307 self._autoPublish(anObj, theName, "inplace")
5310 ## Get sub-shape(s) of \a theShapeWhere, which are
5311 # coincident with \a theShapeWhat or could be a part of it.
5313 # Implementation of this method is based on a saved history of an operation,
5314 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5315 # arguments (an argument shape or a sub-shape of an argument shape).
5316 # The operation could be the Partition or one of boolean operations,
5317 # performed on simple shapes (not on compounds).
5319 # @param theShapeWhere Shape to find sub-shapes of.
5320 # @param theShapeWhat Shape, specifying what to find (must be in the
5321 # building history of the ShapeWhere).
5322 # @param theName Object name; when specified, this parameter is used
5323 # for result publication in the study. Otherwise, if automatic
5324 # publication is switched on, default value is used for result name.
5326 # @return Group of all found sub-shapes or a single found sub-shape.
5328 # @ref swig_GetInPlace "Example"
5329 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5331 Implementation of this method is based on a saved history of an operation,
5332 produced theShapeWhere. The theShapeWhat must be among this operation's
5333 arguments (an argument shape or a sub-shape of an argument shape).
5334 The operation could be the Partition or one of boolean operations,
5335 performed on simple shapes (not on compounds).
5338 theShapeWhere Shape to find sub-shapes of.
5339 theShapeWhat Shape, specifying what to find (must be in the
5340 building history of the ShapeWhere).
5341 theName Object name; when specified, this parameter is used
5342 for result publication in the study. Otherwise, if automatic
5343 publication is switched on, default value is used for result name.
5346 Group of all found sub-shapes or a single found sub-shape.
5348 # Example: see GEOM_TestOthers.py
5349 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5350 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5351 self._autoPublish(anObj, theName, "inplace")
5354 ## Get sub-shape of theShapeWhere, which is
5355 # equal to \a theShapeWhat.
5356 # @param theShapeWhere Shape to find sub-shape of.
5357 # @param theShapeWhat Shape, specifying what to find.
5358 # @param theName Object name; when specified, this parameter is used
5359 # for result publication in the study. Otherwise, if automatic
5360 # publication is switched on, default value is used for result name.
5362 # @return New GEOM.GEOM_Object for found sub-shape.
5364 # @ref swig_GetSame "Example"
5365 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5367 Get sub-shape of theShapeWhere, which is
5368 equal to theShapeWhat.
5371 theShapeWhere Shape to find sub-shape of.
5372 theShapeWhat Shape, specifying what to find.
5373 theName Object name; when specified, this parameter is used
5374 for result publication in the study. Otherwise, if automatic
5375 publication is switched on, default value is used for result name.
5378 New GEOM.GEOM_Object for found sub-shape.
5380 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5381 RaiseIfFailed("GetSame", self.ShapesOp)
5382 self._autoPublish(anObj, theName, "sameShape")
5386 ## Get sub-shape indices of theShapeWhere, which is
5387 # equal to \a theShapeWhat.
5388 # @param theShapeWhere Shape to find sub-shape of.
5389 # @param theShapeWhat Shape, specifying what to find.
5390 # @return List of all found sub-shapes indices.
5392 # @ref swig_GetSame "Example"
5393 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5395 Get sub-shape indices of theShapeWhere, which is
5396 equal to theShapeWhat.
5399 theShapeWhere Shape to find sub-shape of.
5400 theShapeWhat Shape, specifying what to find.
5403 List of all found sub-shapes indices.
5405 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5406 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5413 ## @addtogroup l4_access
5416 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5417 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5418 # @param aShape Shape to get sub-shape of.
5419 # @param ListOfID List of sub-shapes indices.
5420 # @param theName Object name; when specified, this parameter is used
5421 # for result publication in the study. Otherwise, if automatic
5422 # publication is switched on, default value is used for result name.
5424 # @return Found sub-shape.
5426 # @ref swig_all_decompose "Example"
5427 def GetSubShape(self, aShape, ListOfID, theName=None):
5429 Obtain a composite sub-shape of aShape, composed from sub-shapes
5430 of aShape, selected by their unique IDs inside aShape
5433 aShape Shape to get sub-shape of.
5434 ListOfID List of sub-shapes indices.
5435 theName Object name; when specified, this parameter is used
5436 for result publication in the study. Otherwise, if automatic
5437 publication is switched on, default value is used for result name.
5442 # Example: see GEOM_TestAll.py
5443 anObj = self.AddSubShape(aShape,ListOfID)
5444 self._autoPublish(anObj, theName, "subshape")
5447 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5448 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5449 # @param aShape Shape to get sub-shape of.
5450 # @param aSubShape Sub-shapes of aShape.
5451 # @return ID of found sub-shape.
5453 # @ref swig_all_decompose "Example"
5454 def GetSubShapeID(self, aShape, aSubShape):
5456 Obtain unique ID of sub-shape aSubShape inside aShape
5457 of aShape, selected by their unique IDs inside aShape
5460 aShape Shape to get sub-shape of.
5461 aSubShape Sub-shapes of aShape.
5464 ID of found sub-shape.
5466 # Example: see GEOM_TestAll.py
5467 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5468 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5471 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5472 # This function is provided for performance purpose. The complexity is O(n) with n
5473 # the number of subobjects of aShape
5474 # @param aShape Shape to get sub-shape of.
5475 # @param aSubShapes Sub-shapes of aShape.
5476 # @return list of IDs of found sub-shapes.
5478 # @ref swig_all_decompose "Example"
5479 def GetSubShapesIDs(self, aShape, aSubShapes):
5481 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5482 This function is provided for performance purpose. The complexity is O(n) with n
5483 the number of subobjects of aShape
5486 aShape Shape to get sub-shape of.
5487 aSubShapes Sub-shapes of aShape.
5490 List of IDs of found sub-shape.
5492 # Example: see GEOM_TestAll.py
5493 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5494 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5500 ## @addtogroup l4_decompose
5503 ## Get all sub-shapes and groups of \a theShape,
5504 # that were created already by any other methods.
5505 # @param theShape Any shape.
5506 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5507 # returned, else all found sub-shapes and groups.
5508 # @return List of existing sub-objects of \a theShape.
5510 # @ref swig_all_decompose "Example"
5511 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5513 Get all sub-shapes and groups of theShape,
5514 that were created already by any other methods.
5518 theGroupsOnly If this parameter is TRUE, only groups will be
5519 returned, else all found sub-shapes and groups.
5522 List of existing sub-objects of theShape.
5524 # Example: see GEOM_TestAll.py
5525 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5526 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5529 ## Get all groups of \a theShape,
5530 # that were created already by any other methods.
5531 # @param theShape Any shape.
5532 # @return List of existing groups of \a theShape.
5534 # @ref swig_all_decompose "Example"
5535 def GetGroups(self, theShape):
5537 Get all groups of theShape,
5538 that were created already by any other methods.
5544 List of existing groups of theShape.
5546 # Example: see GEOM_TestAll.py
5547 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5548 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5551 ## Explode a shape on sub-shapes of a given type.
5552 # If the shape itself matches the type, it is also returned.
5553 # @param aShape Shape to be exploded.
5554 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5555 # @param theName Object name; when specified, this parameter is used
5556 # for result publication in the study. Otherwise, if automatic
5557 # publication is switched on, default value is used for result name.
5559 # @return List of sub-shapes of type theShapeType, contained in theShape.
5561 # @ref swig_all_decompose "Example"
5562 def SubShapeAll(self, aShape, aType, theName=None):
5564 Explode a shape on sub-shapes of a given type.
5565 If the shape itself matches the type, it is also returned.
5568 aShape Shape to be exploded.
5569 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5570 theName Object name; when specified, this parameter is used
5571 for result publication in the study. Otherwise, if automatic
5572 publication is switched on, default value is used for result name.
5575 List of sub-shapes of type theShapeType, contained in theShape.
5577 # Example: see GEOM_TestAll.py
5578 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5579 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5580 self._autoPublish(ListObj, theName, "subshape")
5583 ## Explode a shape on sub-shapes of a given type.
5584 # @param aShape Shape to be exploded.
5585 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5586 # @return List of IDs of sub-shapes.
5588 # @ref swig_all_decompose "Example"
5589 def SubShapeAllIDs(self, aShape, aType):
5591 Explode a shape on sub-shapes of a given type.
5594 aShape Shape to be exploded (see geompy.ShapeType)
5595 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5598 List of IDs of sub-shapes.
5600 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5601 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5604 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5605 # selected by their indices in 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 SubShape(self, aShape, aType, ListOfInd, theName=None):
5619 Obtain a compound of sub-shapes of aShape,
5620 selected by their indices in 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.SubShapeAllIDs(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 ## Explode a shape on sub-shapes of a given type.
5644 # Sub-shapes will be sorted by coordinates of their gravity centers.
5645 # If the shape itself matches the type, it is also returned.
5646 # @param aShape Shape to be exploded.
5647 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5648 # @param theName Object name; when specified, this parameter is used
5649 # for result publication in the study. Otherwise, if automatic
5650 # publication is switched on, default value is used for result name.
5652 # @return List of sub-shapes of type theShapeType, contained in theShape.
5654 # @ref swig_SubShapeAllSorted "Example"
5655 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5657 Explode a shape on sub-shapes of a given type.
5658 Sub-shapes will be sorted by coordinates of their gravity centers.
5659 If the shape itself matches the type, it is also returned.
5662 aShape Shape to be exploded.
5663 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5664 theName Object name; when specified, this parameter is used
5665 for result publication in the study. Otherwise, if automatic
5666 publication is switched on, default value is used for result name.
5669 List of sub-shapes of type theShapeType, contained in theShape.
5671 # Example: see GEOM_TestAll.py
5672 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5673 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5674 self._autoPublish(ListObj, theName, "subshape")
5677 ## Explode a shape on sub-shapes of a given type.
5678 # Sub-shapes will be sorted by coordinates of their gravity centers.
5679 # @param aShape Shape to be exploded.
5680 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5681 # @return List of IDs of sub-shapes.
5683 # @ref swig_all_decompose "Example"
5684 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5686 Explode a shape on sub-shapes of a given type.
5687 Sub-shapes will be sorted by coordinates of their gravity centers.
5690 aShape Shape to be exploded.
5691 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5694 List of IDs of sub-shapes.
5696 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5697 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5700 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5701 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5702 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5703 # @param aShape Shape to get sub-shape of.
5704 # @param ListOfInd List of sub-shapes indices.
5705 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5706 # @param theName Object name; when specified, this parameter is used
5707 # for result publication in the study. Otherwise, if automatic
5708 # publication is switched on, default value is used for result name.
5710 # @return A compound of sub-shapes of aShape.
5712 # @ref swig_all_decompose "Example"
5713 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5715 Obtain a compound of sub-shapes of aShape,
5716 selected by they indices in sorted list of all sub-shapes of type aType.
5717 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5720 aShape Shape to get sub-shape of.
5721 ListOfID List of sub-shapes indices.
5722 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5723 theName Object name; when specified, this parameter is used
5724 for result publication in the study. Otherwise, if automatic
5725 publication is switched on, default value is used for result name.
5728 A compound of sub-shapes of aShape.
5730 # Example: see GEOM_TestAll.py
5732 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5733 for ind in ListOfInd:
5734 ListOfIDs.append(AllShapeIDsList[ind - 1])
5735 # note: auto-publishing is done in self.GetSubShape()
5736 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5739 ## Extract shapes (excluding the main shape) of given type.
5740 # @param aShape The shape.
5741 # @param aType The shape type (see ShapeType())
5742 # @param isSorted Boolean flag to switch sorting on/off.
5743 # @param theName Object name; when specified, this parameter is used
5744 # for result publication in the study. Otherwise, if automatic
5745 # publication is switched on, default value is used for result name.
5747 # @return List of sub-shapes of type aType, contained in aShape.
5749 # @ref swig_FilletChamfer "Example"
5750 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5752 Extract shapes (excluding the main shape) of given type.
5756 aType The shape type (see geompy.ShapeType)
5757 isSorted Boolean flag to switch sorting on/off.
5758 theName Object name; when specified, this parameter is used
5759 for result publication in the study. Otherwise, if automatic
5760 publication is switched on, default value is used for result name.
5763 List of sub-shapes of type aType, contained in aShape.
5765 # Example: see GEOM_TestAll.py
5766 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5767 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5768 self._autoPublish(ListObj, theName, "subshape")
5771 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5772 # @param aShape Main shape.
5773 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5774 # @param theName Object name; when specified, this parameter is used
5775 # for result publication in the study. Otherwise, if automatic
5776 # publication is switched on, default value is used for result name.
5777 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5779 # @ref swig_all_decompose "Example"
5780 def SubShapes(self, aShape, anIDs, theName=None):
5782 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5786 anIDs List of unique IDs of sub-shapes inside theMainShape.
5787 theName Object name; when specified, this parameter is used
5788 for result publication in the study. Otherwise, if automatic
5789 publication is switched on, default value is used for result name.
5792 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5794 # Example: see GEOM_TestAll.py
5795 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5796 RaiseIfFailed("SubShapes", self.ShapesOp)
5797 self._autoPublish(ListObj, theName, "subshape")
5800 # end of l4_decompose
5803 ## @addtogroup l4_decompose_d
5806 ## Deprecated method
5807 # It works like SubShapeAllSortedCentres(), but wrongly
5808 # defines centres of faces, shells and solids.
5809 def SubShapeAllSorted(self, aShape, aType, theName=None):
5812 It works like geompy.SubShapeAllSortedCentres, but wrongly
5813 defines centres of faces, shells and solids.
5815 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5816 RaiseIfFailed("MakeExplode", self.ShapesOp)
5817 self._autoPublish(ListObj, theName, "subshape")
5820 ## Deprecated method
5821 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5822 # defines centres of faces, shells and solids.
5823 def SubShapeAllSortedIDs(self, aShape, aType):
5826 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5827 defines centres of faces, shells and solids.
5829 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5830 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5833 ## Deprecated method
5834 # It works like SubShapeSortedCentres(), but has a bug
5835 # (wrongly defines centres of faces, shells and solids).
5836 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5839 It works like geompy.SubShapeSortedCentres, but has a bug
5840 (wrongly defines centres of faces, shells and solids).
5843 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5844 for ind in ListOfInd:
5845 ListOfIDs.append(AllShapeIDsList[ind - 1])
5846 # note: auto-publishing is done in self.GetSubShape()
5847 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5850 # end of l4_decompose_d
5853 ## @addtogroup l3_healing
5856 ## Apply a sequence of Shape Healing operators to the given object.
5857 # @param theShape Shape to be processed.
5858 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5859 # @param theParameters List of names of parameters
5860 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5861 # @param theValues List of values of parameters, in the same order
5862 # as parameters are listed in <VAR>theParameters</VAR> list.
5863 # @param theName Object name; when specified, this parameter is used
5864 # for result publication in the study. Otherwise, if automatic
5865 # publication is switched on, default value is used for result name.
5867 # <b> Operators and Parameters: </b> \n
5869 # * \b FixShape - corrects invalid shapes. \n
5870 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5871 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5873 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5874 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5875 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5876 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5878 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5879 # surfaces in segments using a certain angle. \n
5880 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5881 # if Angle=180, four if Angle=90, etc). \n
5882 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5884 # * \b SplitClosedFaces - splits closed faces in segments.
5885 # The number of segments depends on the number of splitting points.\n
5886 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5888 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5889 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5890 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5891 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5892 # This and the previous parameters can take the following values:\n
5893 # \b Parametric \b Continuity \n
5894 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5895 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5896 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5897 # ruling out sharp edges).\n
5898 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5899 # are of the same magnitude).\n
5900 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5901 # or surfaces (d/du C(u)) are the same at junction. \n
5902 # \b Geometric \b Continuity \n
5903 # \b G1: first derivatives are proportional at junction.\n
5904 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5905 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5906 # \b G2: first and second derivatives are proportional at junction.
5907 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5908 # continuity requires that the underlying parameterization was continuous as well.
5909 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5911 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5912 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5913 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5914 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5915 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5916 # with the specified parameters.\n
5917 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5918 # with the specified parameters.\n
5919 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5920 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5921 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5922 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5924 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5925 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5926 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5927 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5928 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5930 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5931 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5934 # @return New GEOM.GEOM_Object, containing processed shape.
5936 # \n @ref tui_shape_processing "Example"
5937 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5939 Apply a sequence of Shape Healing operators to the given object.
5942 theShape Shape to be processed.
5943 theValues List of values of parameters, in the same order
5944 as parameters are listed in theParameters list.
5945 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5946 theParameters List of names of parameters
5947 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5948 theName Object name; when specified, this parameter is used
5949 for result publication in the study. Otherwise, if automatic
5950 publication is switched on, default value is used for result name.
5952 Operators and Parameters:
5954 * FixShape - corrects invalid shapes.
5955 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5956 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5957 * FixFaceSize - removes small faces, such as spots and strips.
5958 * FixFaceSize.Tolerance - defines minimum possible face size.
5959 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5960 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5961 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5962 in segments using a certain angle.
5963 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5964 if Angle=180, four if Angle=90, etc).
5965 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5966 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5968 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5969 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5970 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5971 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5972 * SplitContinuity.CurveContinuity - required continuity for curves.
5973 This and the previous parameters can take the following values:
5975 Parametric Continuity:
5976 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5977 coincidental. The curves or surfaces may still meet at an angle,
5978 giving rise to a sharp corner or edge).
5979 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5980 are parallel, ruling out sharp edges).
5981 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5982 or surfaces are of the same magnitude).
5983 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5984 curves or surfaces (d/du C(u)) are the same at junction.
5986 Geometric Continuity:
5987 G1: first derivatives are proportional at junction.
5988 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5989 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5990 G2: first and second derivatives are proportional at junction. As the names imply,
5991 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5992 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5993 geometric continuity of order n, but not vice-versa.
5994 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5995 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5996 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5997 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5998 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5999 the specified parameters.
6000 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6001 the specified parameters.
6002 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6003 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6004 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6005 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6006 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6007 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6008 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6009 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6010 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6011 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6012 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6015 New GEOM.GEOM_Object, containing processed shape.
6017 Note: For more information look through SALOME Geometry User's Guide->
6018 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6020 # Example: see GEOM_TestHealing.py
6021 theValues,Parameters = ParseList(theValues)
6022 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6023 # To avoid script failure in case of good argument shape
6024 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6026 RaiseIfFailed("ProcessShape", self.HealOp)
6027 for string in (theOperators + theParameters):
6028 Parameters = ":" + Parameters
6030 anObj.SetParameters(Parameters)
6031 self._autoPublish(anObj, theName, "healed")
6034 ## Remove faces from the given object (shape).
6035 # @param theObject Shape to be processed.
6036 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6037 # removes ALL faces of the given object.
6038 # @param theName Object name; when specified, this parameter is used
6039 # for result publication in the study. Otherwise, if automatic
6040 # publication is switched on, default value is used for result name.
6042 # @return New GEOM.GEOM_Object, containing processed shape.
6044 # @ref tui_suppress_faces "Example"
6045 def SuppressFaces(self, theObject, theFaces, theName=None):
6047 Remove faces from the given object (shape).
6050 theObject Shape to be processed.
6051 theFaces Indices of faces to be removed, if EMPTY then the method
6052 removes ALL faces of the given object.
6053 theName Object name; when specified, this parameter is used
6054 for result publication in the study. Otherwise, if automatic
6055 publication is switched on, default value is used for result name.
6058 New GEOM.GEOM_Object, containing processed shape.
6060 # Example: see GEOM_TestHealing.py
6061 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6062 RaiseIfFailed("SuppressFaces", self.HealOp)
6063 self._autoPublish(anObj, theName, "suppressFaces")
6066 ## Sewing of some shapes into single shape.
6067 # @param ListShape Shapes to be processed.
6068 # @param theTolerance Required tolerance value.
6069 # @param AllowNonManifold Flag that allows non-manifold sewing.
6070 # @param theName Object name; when specified, this parameter is used
6071 # for result publication in the study. Otherwise, if automatic
6072 # publication is switched on, default value is used for result name.
6074 # @return New GEOM.GEOM_Object, containing processed shape.
6076 # @ref tui_sewing "Example"
6077 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6079 Sewing of some shapes into single shape.
6082 ListShape Shapes to be processed.
6083 theTolerance Required tolerance value.
6084 AllowNonManifold Flag that allows non-manifold sewing.
6085 theName Object name; when specified, this parameter is used
6086 for result publication in the study. Otherwise, if automatic
6087 publication is switched on, default value is used for result name.
6090 New GEOM.GEOM_Object, containing processed shape.
6092 # Example: see GEOM_TestHealing.py
6093 comp = self.MakeCompound(ListShape)
6094 # note: auto-publishing is done in self.Sew()
6095 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6098 ## Sewing of the given object.
6099 # @param theObject Shape to be processed.
6100 # @param theTolerance Required tolerance value.
6101 # @param AllowNonManifold Flag that allows non-manifold sewing.
6102 # @param theName Object name; when specified, this parameter is used
6103 # for result publication in the study. Otherwise, if automatic
6104 # publication is switched on, default value is used for result name.
6106 # @return New GEOM.GEOM_Object, containing processed shape.
6107 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6109 Sewing of the given object.
6112 theObject Shape to be processed.
6113 theTolerance Required tolerance value.
6114 AllowNonManifold Flag that allows non-manifold sewing.
6115 theName Object name; when specified, this parameter is used
6116 for result publication in the study. Otherwise, if automatic
6117 publication is switched on, default value is used for result name.
6120 New GEOM.GEOM_Object, containing processed shape.
6122 # Example: see MakeSewing() above
6123 theTolerance,Parameters = ParseParameters(theTolerance)
6124 if AllowNonManifold:
6125 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6127 anObj = self.HealOp.Sew(theObject, theTolerance)
6128 # To avoid script failure in case of good argument shape
6129 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6131 RaiseIfFailed("Sew", self.HealOp)
6132 anObj.SetParameters(Parameters)
6133 self._autoPublish(anObj, theName, "sewed")
6136 ## Rebuild the topology of theCompound of solids by removing
6137 # of the faces that are shared by several solids.
6138 # @param theCompound Shape to be processed.
6139 # @param theName Object name; when specified, this parameter is used
6140 # for result publication in the study. Otherwise, if automatic
6141 # publication is switched on, default value is used for result name.
6143 # @return New GEOM.GEOM_Object, containing processed shape.
6145 # @ref tui_remove_webs "Example"
6146 def RemoveInternalFaces (self, theCompound, theName=None):
6148 Rebuild the topology of theCompound of solids by removing
6149 of the faces that are shared by several solids.
6152 theCompound Shape to be processed.
6153 theName Object name; when specified, this parameter is used
6154 for result publication in the study. Otherwise, if automatic
6155 publication is switched on, default value is used for result name.
6158 New GEOM.GEOM_Object, containing processed shape.
6160 # Example: see GEOM_TestHealing.py
6161 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6162 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6163 self._autoPublish(anObj, theName, "removeWebs")
6166 ## Remove internal wires and edges from the given object (face).
6167 # @param theObject Shape to be processed.
6168 # @param theWires Indices of wires to be removed, if EMPTY then the method
6169 # removes ALL internal wires of the given object.
6170 # @param theName Object name; when specified, this parameter is used
6171 # for result publication in the study. Otherwise, if automatic
6172 # publication is switched on, default value is used for result name.
6174 # @return New GEOM.GEOM_Object, containing processed shape.
6176 # @ref tui_suppress_internal_wires "Example"
6177 def SuppressInternalWires(self, theObject, theWires, theName=None):
6179 Remove internal wires and edges from the given object (face).
6182 theObject Shape to be processed.
6183 theWires Indices of wires to be removed, if EMPTY then the method
6184 removes ALL internal wires of the given object.
6185 theName Object name; when specified, this parameter is used
6186 for result publication in the study. Otherwise, if automatic
6187 publication is switched on, default value is used for result name.
6190 New GEOM.GEOM_Object, containing processed shape.
6192 # Example: see GEOM_TestHealing.py
6193 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6194 RaiseIfFailed("RemoveIntWires", self.HealOp)
6195 self._autoPublish(anObj, theName, "suppressWires")
6198 ## Remove internal closed contours (holes) from the given object.
6199 # @param theObject Shape to be processed.
6200 # @param theWires Indices of wires to be removed, if EMPTY then the method
6201 # removes ALL internal holes of the given object
6202 # @param theName Object name; when specified, this parameter is used
6203 # for result publication in the study. Otherwise, if automatic
6204 # publication is switched on, default value is used for result name.
6206 # @return New GEOM.GEOM_Object, containing processed shape.
6208 # @ref tui_suppress_holes "Example"
6209 def SuppressHoles(self, theObject, theWires, theName=None):
6211 Remove internal closed contours (holes) from the given object.
6214 theObject Shape to be processed.
6215 theWires Indices of wires to be removed, if EMPTY then the method
6216 removes ALL internal holes of the given object
6217 theName Object name; when specified, this parameter is used
6218 for result publication in the study. Otherwise, if automatic
6219 publication is switched on, default value is used for result name.
6222 New GEOM.GEOM_Object, containing processed shape.
6224 # Example: see GEOM_TestHealing.py
6225 anObj = self.HealOp.FillHoles(theObject, theWires)
6226 RaiseIfFailed("FillHoles", self.HealOp)
6227 self._autoPublish(anObj, theName, "suppressHoles")
6230 ## Close an open wire.
6231 # @param theObject Shape to be processed.
6232 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6233 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6234 # @param isCommonVertex If True : closure by creation of a common vertex,
6235 # If False : closure by creation of an edge between ends.
6236 # @param theName Object name; when specified, this parameter is used
6237 # for result publication in the study. Otherwise, if automatic
6238 # publication is switched on, default value is used for result name.
6240 # @return New GEOM.GEOM_Object, containing processed shape.
6242 # @ref tui_close_contour "Example"
6243 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6248 theObject Shape to be processed.
6249 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6250 if [ ], then theObject itself is a wire.
6251 isCommonVertex If True : closure by creation of a common vertex,
6252 If False : closure by creation of an edge between ends.
6253 theName Object name; when specified, this parameter is used
6254 for result publication in the study. Otherwise, if automatic
6255 publication is switched on, default value is used for result name.
6258 New GEOM.GEOM_Object, containing processed shape.
6260 # Example: see GEOM_TestHealing.py
6261 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6262 RaiseIfFailed("CloseContour", self.HealOp)
6263 self._autoPublish(anObj, theName, "closeContour")
6266 ## Addition of a point to a given edge object.
6267 # @param theObject Shape to be processed.
6268 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6269 # if -1, then theObject itself is the edge.
6270 # @param theValue Value of parameter on edge or length parameter,
6271 # depending on \a isByParameter.
6272 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6273 # if FALSE : \a theValue is treated as a length parameter [0..1]
6274 # @param theName Object name; when specified, this parameter is used
6275 # for result publication in the study. Otherwise, if automatic
6276 # publication is switched on, default value is used for result name.
6278 # @return New GEOM.GEOM_Object, containing processed shape.
6280 # @ref tui_add_point_on_edge "Example"
6281 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6283 Addition of a point to a given edge object.
6286 theObject Shape to be processed.
6287 theEdgeIndex Index of edge to be divided within theObject's shape,
6288 if -1, then theObject itself is the edge.
6289 theValue Value of parameter on edge or length parameter,
6290 depending on isByParameter.
6291 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6292 if FALSE : theValue is treated as a length parameter [0..1]
6293 theName Object name; when specified, this parameter is used
6294 for result publication in the study. Otherwise, if automatic
6295 publication is switched on, default value is used for result name.
6298 New GEOM.GEOM_Object, containing processed shape.
6300 # Example: see GEOM_TestHealing.py
6301 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6302 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6303 RaiseIfFailed("DivideEdge", self.HealOp)
6304 anObj.SetParameters(Parameters)
6305 self._autoPublish(anObj, theName, "divideEdge")
6308 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6309 # @param theWire Wire to minimize the number of C1 continuous edges in.
6310 # @param theVertices A list of vertices to suppress. If the list
6311 # is empty, all vertices in a wire will be assumed.
6312 # @param theName Object name; when specified, this parameter is used
6313 # for result publication in the study. Otherwise, if automatic
6314 # publication is switched on, default value is used for result name.
6316 # @return New GEOM.GEOM_Object with modified wire.
6318 # @ref tui_fuse_collinear_edges "Example"
6319 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6321 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6324 theWire Wire to minimize the number of C1 continuous edges in.
6325 theVertices A list of vertices to suppress. If the list
6326 is empty, all vertices in a wire will be assumed.
6327 theName Object name; when specified, this parameter is used
6328 for result publication in the study. Otherwise, if automatic
6329 publication is switched on, default value is used for result name.
6332 New GEOM.GEOM_Object with modified wire.
6334 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6335 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6336 self._autoPublish(anObj, theName, "fuseEdges")
6339 ## Change orientation of the given object. Updates given shape.
6340 # @param theObject Shape to be processed.
6341 # @return Updated <var>theObject</var>
6343 # @ref swig_todo "Example"
6344 def ChangeOrientationShell(self,theObject):
6346 Change orientation of the given object. Updates given shape.
6349 theObject Shape to be processed.
6354 theObject = self.HealOp.ChangeOrientation(theObject)
6355 RaiseIfFailed("ChangeOrientation", self.HealOp)
6358 ## Change orientation of the given object.
6359 # @param theObject Shape to be processed.
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 processed shape.
6366 # @ref swig_todo "Example"
6367 def ChangeOrientationShellCopy(self, theObject, theName=None):
6369 Change orientation of the given object.
6372 theObject Shape to be processed.
6373 theName Object name; when specified, this parameter is used
6374 for result publication in the study. Otherwise, if automatic
6375 publication is switched on, default value is used for result name.
6378 New GEOM.GEOM_Object, containing processed shape.
6380 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6381 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6382 self._autoPublish(anObj, theName, "reversed")
6385 ## Try to limit tolerance of the given object by value \a theTolerance.
6386 # @param theObject Shape to be processed.
6387 # @param theTolerance Required tolerance value.
6388 # @param theName Object name; when specified, this parameter is used
6389 # for result publication in the study. Otherwise, if automatic
6390 # publication is switched on, default value is used for result name.
6392 # @return New GEOM.GEOM_Object, containing processed shape.
6394 # @ref tui_limit_tolerance "Example"
6395 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6397 Try to limit tolerance of the given object by value theTolerance.
6400 theObject Shape to be processed.
6401 theTolerance Required tolerance value.
6402 theName Object name; when specified, this parameter is used
6403 for result publication in the study. Otherwise, if automatic
6404 publication is switched on, default value is used for result name.
6407 New GEOM.GEOM_Object, containing processed shape.
6409 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6410 RaiseIfFailed("LimitTolerance", self.HealOp)
6411 self._autoPublish(anObj, theName, "limitTolerance")
6414 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6415 # that constitute a free boundary of the given shape.
6416 # @param theObject Shape to get free boundary of.
6417 # @param theName Object name; when specified, this parameter is used
6418 # for result publication in the study. Otherwise, if automatic
6419 # publication is switched on, default value is used for result name.
6421 # @return [\a status, \a theClosedWires, \a theOpenWires]
6422 # \n \a status: FALSE, if an error(s) occured during the method execution.
6423 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6424 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6426 # @ref tui_measurement_tools_page "Example"
6427 def GetFreeBoundary(self, theObject, theName=None):
6429 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6430 that constitute a free boundary of the given shape.
6433 theObject Shape to get free boundary of.
6434 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.
6439 [status, theClosedWires, theOpenWires]
6440 status: FALSE, if an error(s) occured during the method execution.
6441 theClosedWires: Closed wires on the free boundary of the given shape.
6442 theOpenWires: Open wires on the free boundary of the given shape.
6444 # Example: see GEOM_TestHealing.py
6445 anObj = self.HealOp.GetFreeBoundary(theObject)
6446 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6447 self._autoPublish(anObj[1], theName, "closedWire")
6448 self._autoPublish(anObj[2], theName, "openWire")
6451 ## Replace coincident faces in theShape by one face.
6452 # @param theShape Initial shape.
6453 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6454 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6455 # otherwise all initial shapes.
6456 # @param theName Object name; when specified, this parameter is used
6457 # for result publication in the study. Otherwise, if automatic
6458 # publication is switched on, default value is used for result name.
6460 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6462 # @ref tui_glue_faces "Example"
6463 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6465 Replace coincident faces in theShape by one face.
6468 theShape Initial shape.
6469 theTolerance Maximum distance between faces, which can be considered as coincident.
6470 doKeepNonSolids If FALSE, only solids will present in the result,
6471 otherwise all initial shapes.
6472 theName Object name; when specified, this parameter is used
6473 for result publication in the study. Otherwise, if automatic
6474 publication is switched on, default value is used for result name.
6477 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6479 # Example: see GEOM_Spanner.py
6480 theTolerance,Parameters = ParseParameters(theTolerance)
6481 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6483 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6484 anObj.SetParameters(Parameters)
6485 self._autoPublish(anObj, theName, "glueFaces")
6488 ## Find coincident faces in theShape for possible gluing.
6489 # @param theShape Initial shape.
6490 # @param theTolerance Maximum distance between faces,
6491 # which can be considered as coincident.
6492 # @param theName Object name; when specified, this parameter is used
6493 # for result publication in the study. Otherwise, if automatic
6494 # publication is switched on, default value is used for result name.
6496 # @return GEOM.ListOfGO
6498 # @ref tui_glue_faces "Example"
6499 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6501 Find coincident faces in theShape for possible gluing.
6504 theShape Initial shape.
6505 theTolerance Maximum distance between faces,
6506 which can be considered as coincident.
6507 theName Object name; when specified, this parameter is used
6508 for result publication in the study. Otherwise, if automatic
6509 publication is switched on, default value is used for result name.
6514 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6515 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6516 self._autoPublish(anObj, theName, "facesToGlue")
6519 ## Replace coincident faces in theShape by one face
6520 # in compliance with given list of faces
6521 # @param theShape Initial shape.
6522 # @param theTolerance Maximum distance between faces,
6523 # which can be considered as coincident.
6524 # @param theFaces List of faces for gluing.
6525 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6526 # otherwise all initial shapes.
6527 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6528 # will be glued, otherwise only the edges,
6529 # belonging to <VAR>theFaces</VAR>.
6530 # @param theName Object name; when specified, this parameter is used
6531 # for result publication in the study. Otherwise, if automatic
6532 # publication is switched on, default value is used for result name.
6534 # @return New GEOM.GEOM_Object, containing a copy of theShape
6535 # without some faces.
6537 # @ref tui_glue_faces "Example"
6538 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6539 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6541 Replace coincident faces in theShape by one face
6542 in compliance with given list of faces
6545 theShape Initial shape.
6546 theTolerance Maximum distance between faces,
6547 which can be considered as coincident.
6548 theFaces List of faces for gluing.
6549 doKeepNonSolids If FALSE, only solids will present in the result,
6550 otherwise all initial shapes.
6551 doGlueAllEdges If TRUE, all coincident edges of theShape
6552 will be glued, otherwise only the edges,
6553 belonging to theFaces.
6554 theName Object name; when specified, this parameter is used
6555 for result publication in the study. Otherwise, if automatic
6556 publication is switched on, default value is used for result name.
6559 New GEOM.GEOM_Object, containing a copy of theShape
6562 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6563 doKeepNonSolids, doGlueAllEdges)
6565 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6566 self._autoPublish(anObj, theName, "glueFaces")
6569 ## Replace coincident edges in theShape by one edge.
6570 # @param theShape Initial shape.
6571 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6572 # @param theName Object name; when specified, this parameter is used
6573 # for result publication in the study. Otherwise, if automatic
6574 # publication is switched on, default value is used for result name.
6576 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6578 # @ref tui_glue_edges "Example"
6579 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6581 Replace coincident edges in theShape by one edge.
6584 theShape Initial shape.
6585 theTolerance Maximum distance between edges, which can be considered as coincident.
6586 theName Object name; when specified, this parameter is used
6587 for result publication in the study. Otherwise, if automatic
6588 publication is switched on, default value is used for result name.
6591 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6593 theTolerance,Parameters = ParseParameters(theTolerance)
6594 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6596 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6597 anObj.SetParameters(Parameters)
6598 self._autoPublish(anObj, theName, "glueEdges")
6601 ## Find coincident edges in theShape for possible gluing.
6602 # @param theShape Initial shape.
6603 # @param theTolerance Maximum distance between edges,
6604 # which can be considered as coincident.
6605 # @param 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.
6609 # @return GEOM.ListOfGO
6611 # @ref tui_glue_edges "Example"
6612 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6614 Find coincident edges in theShape for possible gluing.
6617 theShape Initial shape.
6618 theTolerance Maximum distance between edges,
6619 which can be considered as coincident.
6620 theName Object name; when specified, this parameter is used
6621 for result publication in the study. Otherwise, if automatic
6622 publication is switched on, default value is used for result name.
6627 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6628 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6629 self._autoPublish(anObj, theName, "edgesToGlue")
6632 ## Replace coincident edges in theShape by one edge
6633 # in compliance with given list of edges.
6634 # @param theShape Initial shape.
6635 # @param theTolerance Maximum distance between edges,
6636 # which can be considered as coincident.
6637 # @param theEdges List of edges for gluing.
6638 # @param theName Object name; when specified, this parameter is used
6639 # for result publication in the study. Otherwise, if automatic
6640 # publication is switched on, default value is used for result name.
6642 # @return New GEOM.GEOM_Object, containing a copy of theShape
6643 # without some edges.
6645 # @ref tui_glue_edges "Example"
6646 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6648 Replace coincident edges in theShape by one edge
6649 in compliance with given list of edges.
6652 theShape Initial shape.
6653 theTolerance Maximum distance between edges,
6654 which can be considered as coincident.
6655 theEdges List of edges for gluing.
6656 theName Object name; when specified, this parameter is used
6657 for result publication in the study. Otherwise, if automatic
6658 publication is switched on, default value is used for result name.
6661 New GEOM.GEOM_Object, containing a copy of theShape
6664 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6666 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6667 self._autoPublish(anObj, theName, "glueEdges")
6673 ## @addtogroup l3_boolean Boolean Operations
6676 # -----------------------------------------------------------------------------
6677 # Boolean (Common, Cut, Fuse, Section)
6678 # -----------------------------------------------------------------------------
6680 ## Perform one of boolean operations on two given shapes.
6681 # @param theShape1 First argument for boolean operation.
6682 # @param theShape2 Second argument for boolean operation.
6683 # @param theOperation Indicates the operation to be done:\n
6684 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6685 # @param checkSelfInte The flag that tells if the arguments should
6686 # be checked for self-intersection prior to the operation.
6687 # @param theName Object name; when specified, this parameter is used
6688 # for result publication in the study. Otherwise, if automatic
6689 # publication is switched on, default value is used for result name.
6691 # @note This algorithm doesn't find all types of self-intersections.
6692 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6693 # vertex/face and edge/face intersections. Face/face
6694 # intersections detection is switched off as it is a
6695 # time-consuming operation that gives an impact on performance.
6696 # To find all self-intersections please use
6697 # CheckSelfIntersections() method.
6699 # @return New GEOM.GEOM_Object, containing the result shape.
6701 # @ref tui_fuse "Example"
6702 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6704 Perform one of boolean operations on two given shapes.
6707 theShape1 First argument for boolean operation.
6708 theShape2 Second argument for boolean operation.
6709 theOperation Indicates the operation to be done:
6710 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6711 checkSelfInte The flag that tells if the arguments should
6712 be checked for self-intersection prior to
6714 theName Object name; when specified, this parameter is used
6715 for result publication in the study. Otherwise, if automatic
6716 publication is switched on, default value is used for result name.
6719 This algorithm doesn't find all types of self-intersections.
6720 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6721 vertex/face and edge/face intersections. Face/face
6722 intersections detection is switched off as it is a
6723 time-consuming operation that gives an impact on performance.
6724 To find all self-intersections please use
6725 CheckSelfIntersections() method.
6728 New GEOM.GEOM_Object, containing the result shape.
6730 # Example: see GEOM_TestAll.py
6731 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6732 RaiseIfFailed("MakeBoolean", self.BoolOp)
6733 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6734 self._autoPublish(anObj, theName, def_names[theOperation])
6737 ## Perform Common boolean operation on two given shapes.
6738 # @param theShape1 First argument for boolean operation.
6739 # @param theShape2 Second argument for boolean operation.
6740 # @param checkSelfInte The flag that tells if the arguments should
6741 # be checked for self-intersection prior to the operation.
6742 # @param theName Object name; when specified, this parameter is used
6743 # for result publication in the study. Otherwise, if automatic
6744 # publication is switched on, default value is used for result name.
6746 # @note This algorithm doesn't find all types of self-intersections.
6747 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6748 # vertex/face and edge/face intersections. Face/face
6749 # intersections detection is switched off as it is a
6750 # time-consuming operation that gives an impact on performance.
6751 # To find all self-intersections please use
6752 # CheckSelfIntersections() method.
6754 # @return New GEOM.GEOM_Object, containing the result shape.
6756 # @ref tui_common "Example 1"
6757 # \n @ref swig_MakeCommon "Example 2"
6758 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6760 Perform Common boolean operation on two given shapes.
6763 theShape1 First argument for boolean operation.
6764 theShape2 Second argument for boolean operation.
6765 checkSelfInte The flag that tells if the arguments should
6766 be checked for self-intersection prior to
6768 theName Object name; when specified, this parameter is used
6769 for result publication in the study. Otherwise, if automatic
6770 publication is switched on, default value is used for result name.
6773 This algorithm doesn't find all types of self-intersections.
6774 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6775 vertex/face and edge/face intersections. Face/face
6776 intersections detection is switched off as it is a
6777 time-consuming operation that gives an impact on performance.
6778 To find all self-intersections please use
6779 CheckSelfIntersections() method.
6782 New GEOM.GEOM_Object, containing the result shape.
6784 # Example: see GEOM_TestOthers.py
6785 # note: auto-publishing is done in self.MakeBoolean()
6786 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6788 ## Perform Cut boolean operation on two given shapes.
6789 # @param theShape1 First argument for boolean operation.
6790 # @param theShape2 Second argument for boolean operation.
6791 # @param checkSelfInte The flag that tells if the arguments should
6792 # be checked for self-intersection prior to the operation.
6793 # @param theName Object name; when specified, this parameter is used
6794 # for result publication in the study. Otherwise, if automatic
6795 # publication is switched on, default value is used for result name.
6797 # @note This algorithm doesn't find all types of self-intersections.
6798 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6799 # vertex/face and edge/face intersections. Face/face
6800 # intersections detection is switched off as it is a
6801 # time-consuming operation that gives an impact on performance.
6802 # To find all self-intersections please use
6803 # CheckSelfIntersections() method.
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 MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6811 Perform Cut boolean operation on two given shapes.
6814 theShape1 First argument for boolean operation.
6815 theShape2 Second argument for boolean operation.
6816 checkSelfInte The flag that tells if the arguments should
6817 be checked for self-intersection prior to
6819 theName Object name; when specified, this parameter is used
6820 for result publication in the study. Otherwise, if automatic
6821 publication is switched on, default value is used for result name.
6824 This algorithm doesn't find all types of self-intersections.
6825 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6826 vertex/face and edge/face intersections. Face/face
6827 intersections detection is switched off as it is a
6828 time-consuming operation that gives an impact on performance.
6829 To find all self-intersections please use
6830 CheckSelfIntersections() method.
6833 New GEOM.GEOM_Object, containing the result shape.
6836 # Example: see GEOM_TestOthers.py
6837 # note: auto-publishing is done in self.MakeBoolean()
6838 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
6840 ## Perform Fuse boolean operation on two given shapes.
6841 # @param theShape1 First argument for boolean operation.
6842 # @param theShape2 Second argument for boolean operation.
6843 # @param checkSelfInte The flag that tells if the arguments should
6844 # be checked for self-intersection prior to the operation.
6845 # @param theName Object name; when specified, this parameter is used
6846 # for result publication in the study. Otherwise, if automatic
6847 # publication is switched on, default value is used for result name.
6849 # @note This algorithm doesn't find all types of self-intersections.
6850 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6851 # vertex/face and edge/face intersections. Face/face
6852 # intersections detection is switched off as it is a
6853 # time-consuming operation that gives an impact on performance.
6854 # To find all self-intersections please use
6855 # CheckSelfIntersections() method.
6857 # @return New GEOM.GEOM_Object, containing the result shape.
6859 # @ref tui_fuse "Example 1"
6860 # \n @ref swig_MakeCommon "Example 2"
6861 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6863 Perform Fuse boolean operation on two given shapes.
6866 theShape1 First argument for boolean operation.
6867 theShape2 Second argument for boolean operation.
6868 checkSelfInte The flag that tells if the arguments should
6869 be checked for self-intersection prior to
6871 theName Object name; when specified, this parameter is used
6872 for result publication in the study. Otherwise, if automatic
6873 publication is switched on, default value is used for result name.
6876 This algorithm doesn't find all types of self-intersections.
6877 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6878 vertex/face and edge/face intersections. Face/face
6879 intersections detection is switched off as it is a
6880 time-consuming operation that gives an impact on performance.
6881 To find all self-intersections please use
6882 CheckSelfIntersections() method.
6885 New GEOM.GEOM_Object, containing the result shape.
6888 # Example: see GEOM_TestOthers.py
6889 # note: auto-publishing is done in self.MakeBoolean()
6890 return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
6892 ## Perform Section boolean operation on two given shapes.
6893 # @param theShape1 First argument for boolean operation.
6894 # @param theShape2 Second argument for boolean operation.
6895 # @param checkSelfInte The flag that tells if the arguments should
6896 # be checked for self-intersection prior to the operation.
6897 # @param theName Object name; when specified, this parameter is used
6898 # for result publication in the study. Otherwise, if automatic
6899 # publication is switched on, default value is used for result name.
6901 # @note This algorithm doesn't find all types of self-intersections.
6902 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6903 # vertex/face and edge/face intersections. Face/face
6904 # intersections detection is switched off as it is a
6905 # time-consuming operation that gives an impact on performance.
6906 # To find all self-intersections please use
6907 # CheckSelfIntersections() method.
6909 # @return New GEOM.GEOM_Object, containing the result shape.
6911 # @ref tui_section "Example 1"
6912 # \n @ref swig_MakeCommon "Example 2"
6913 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6915 Perform Section boolean operation on two given shapes.
6918 theShape1 First argument for boolean operation.
6919 theShape2 Second argument for boolean operation.
6920 checkSelfInte The flag that tells if the arguments should
6921 be checked for self-intersection prior to
6923 theName Object name; when specified, this parameter is used
6924 for result publication in the study. Otherwise, if automatic
6925 publication is switched on, default value is used for result name.
6928 This algorithm doesn't find all types of self-intersections.
6929 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6930 vertex/face and edge/face intersections. Face/face
6931 intersections detection is switched off as it is a
6932 time-consuming operation that gives an impact on performance.
6933 To find all self-intersections please use
6934 CheckSelfIntersections() method.
6937 New GEOM.GEOM_Object, containing the result shape.
6940 # Example: see GEOM_TestOthers.py
6941 # note: auto-publishing is done in self.MakeBoolean()
6942 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
6944 ## Perform Fuse boolean operation on the list of shapes.
6945 # @param theShapesList Shapes to be fused.
6946 # @param checkSelfInte The flag that tells if the arguments should
6947 # be checked for self-intersection prior to the operation.
6948 # @param theName Object name; when specified, this parameter is used
6949 # for result publication in the study. Otherwise, if automatic
6950 # publication is switched on, default value is used for result name.
6952 # @note This algorithm doesn't find all types of self-intersections.
6953 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6954 # vertex/face and edge/face intersections. Face/face
6955 # intersections detection is switched off as it is a
6956 # time-consuming operation that gives an impact on performance.
6957 # To find all self-intersections please use
6958 # CheckSelfIntersections() method.
6960 # @return New GEOM.GEOM_Object, containing the result shape.
6962 # @ref tui_fuse "Example 1"
6963 # \n @ref swig_MakeCommon "Example 2"
6964 def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
6966 Perform Fuse boolean operation on the list of shapes.
6969 theShapesList Shapes to be fused.
6970 checkSelfInte The flag that tells if the arguments should
6971 be checked for self-intersection prior to
6973 theName Object name; when specified, this parameter is used
6974 for result publication in the study. Otherwise, if automatic
6975 publication is switched on, default value is used for result name.
6978 This algorithm doesn't find all types of self-intersections.
6979 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6980 vertex/face and edge/face intersections. Face/face
6981 intersections detection is switched off as it is a
6982 time-consuming operation that gives an impact on performance.
6983 To find all self-intersections please use
6984 CheckSelfIntersections() method.
6987 New GEOM.GEOM_Object, containing the result shape.
6990 # Example: see GEOM_TestOthers.py
6991 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
6992 RaiseIfFailed("MakeFuseList", self.BoolOp)
6993 self._autoPublish(anObj, theName, "fuse")
6996 ## Perform Common boolean operation on the list of shapes.
6997 # @param theShapesList Shapes for Common operation.
6998 # @param checkSelfInte The flag that tells if the arguments should
6999 # be checked for self-intersection prior to the operation.
7000 # @param theName Object name; when specified, this parameter is used
7001 # for result publication in the study. Otherwise, if automatic
7002 # publication is switched on, default value is used for result name.
7004 # @note This algorithm doesn't find all types of self-intersections.
7005 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7006 # vertex/face and edge/face intersections. Face/face
7007 # intersections detection is switched off as it is a
7008 # time-consuming operation that gives an impact on performance.
7009 # To find all self-intersections please use
7010 # CheckSelfIntersections() method.
7012 # @return New GEOM.GEOM_Object, containing the result shape.
7014 # @ref tui_common "Example 1"
7015 # \n @ref swig_MakeCommon "Example 2"
7016 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7018 Perform Common boolean operation on the list of shapes.
7021 theShapesList Shapes for Common operation.
7022 checkSelfInte The flag that tells if the arguments should
7023 be checked for self-intersection prior to
7025 theName Object name; when specified, this parameter is used
7026 for result publication in the study. Otherwise, if automatic
7027 publication is switched on, default value is used for result name.
7030 This algorithm doesn't find all types of self-intersections.
7031 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7032 vertex/face and edge/face intersections. Face/face
7033 intersections detection is switched off as it is a
7034 time-consuming operation that gives an impact on performance.
7035 To find all self-intersections please use
7036 CheckSelfIntersections() method.
7039 New GEOM.GEOM_Object, containing the result shape.
7042 # Example: see GEOM_TestOthers.py
7043 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7044 RaiseIfFailed("MakeCommonList", self.BoolOp)
7045 self._autoPublish(anObj, theName, "common")
7048 ## Perform Cut boolean operation on one object and the list of tools.
7049 # @param theMainShape The object of the operation.
7050 # @param theShapesList The list of tools of the operation.
7051 # @param checkSelfInte The flag that tells if the arguments should
7052 # be checked for self-intersection prior to the operation.
7053 # @param theName Object name; when specified, this parameter is used
7054 # for result publication in the study. Otherwise, if automatic
7055 # publication is switched on, default value is used for result name.
7057 # @note This algorithm doesn't find all types of self-intersections.
7058 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7059 # vertex/face and edge/face intersections. Face/face
7060 # intersections detection is switched off as it is a
7061 # time-consuming operation that gives an impact on performance.
7062 # To find all self-intersections please use
7063 # CheckSelfIntersections() method.
7065 # @return New GEOM.GEOM_Object, containing the result shape.
7067 # @ref tui_cut "Example 1"
7068 # \n @ref swig_MakeCommon "Example 2"
7069 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7071 Perform Cut boolean operation on one object and the list of tools.
7074 theMainShape The object of the operation.
7075 theShapesList The list of tools of the operation.
7076 checkSelfInte The flag that tells if the arguments should
7077 be checked for self-intersection prior to
7079 theName Object name; when specified, this parameter is used
7080 for result publication in the study. Otherwise, if automatic
7081 publication is switched on, default value is used for result name.
7084 This algorithm doesn't find all types of self-intersections.
7085 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7086 vertex/face and edge/face intersections. Face/face
7087 intersections detection is switched off as it is a
7088 time-consuming operation that gives an impact on performance.
7089 To find all self-intersections please use
7090 CheckSelfIntersections() method.
7093 New GEOM.GEOM_Object, containing the result shape.
7096 # Example: see GEOM_TestOthers.py
7097 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7098 RaiseIfFailed("MakeCutList", self.BoolOp)
7099 self._autoPublish(anObj, theName, "cut")
7105 ## @addtogroup l3_basic_op
7108 ## Perform partition operation.
7109 # @param ListShapes Shapes to be intersected.
7110 # @param ListTools Shapes to intersect theShapes.
7111 # @param Limit Type of resulting shapes (see ShapeType()).\n
7112 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7113 # type will be detected automatically.
7114 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7115 # target type (equal to Limit) are kept in the result,
7116 # else standalone shapes of lower dimension
7117 # are kept also (if they exist).
7119 # @param theName Object name; when specified, this parameter is used
7120 # for result publication in the study. Otherwise, if automatic
7121 # publication is switched on, default value is used for result name.
7123 # @note Each compound from ListShapes and ListTools will be exploded
7124 # in order to avoid possible intersection between shapes from this compound.
7126 # After implementation new version of PartitionAlgo (October 2006)
7127 # other parameters are ignored by current functionality. They are kept
7128 # in this function only for support old versions.
7129 # @param ListKeepInside Shapes, outside which the results will be deleted.
7130 # Each shape from theKeepInside must belong to theShapes also.
7131 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7132 # Each shape from theRemoveInside must belong to theShapes also.
7133 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7134 # @param ListMaterials Material indices for each shape. Make sence,
7135 # only if theRemoveWebs is TRUE.
7137 # @return New GEOM.GEOM_Object, containing the result shapes.
7139 # @ref tui_partition "Example"
7140 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7141 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7142 KeepNonlimitShapes=0, theName=None):
7144 Perform partition operation.
7147 ListShapes Shapes to be intersected.
7148 ListTools Shapes to intersect theShapes.
7149 Limit Type of resulting shapes (see geompy.ShapeType)
7150 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7151 type will be detected automatically.
7152 KeepNonlimitShapes if this parameter == 0, then only shapes of
7153 target type (equal to Limit) are kept in the result,
7154 else standalone shapes of lower dimension
7155 are kept also (if they exist).
7157 theName Object name; when specified, this parameter is used
7158 for result publication in the study. Otherwise, if automatic
7159 publication is switched on, default value is used for result name.
7161 Each compound from ListShapes and ListTools will be exploded
7162 in order to avoid possible intersection between shapes from
7165 After implementation new version of PartitionAlgo (October 2006) other
7166 parameters are ignored by current functionality. They are kept in this
7167 function only for support old versions.
7170 ListKeepInside Shapes, outside which the results will be deleted.
7171 Each shape from theKeepInside must belong to theShapes also.
7172 ListRemoveInside Shapes, inside which the results will be deleted.
7173 Each shape from theRemoveInside must belong to theShapes also.
7174 RemoveWebs If TRUE, perform Glue 3D algorithm.
7175 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7178 New GEOM.GEOM_Object, containing the result shapes.
7180 # Example: see GEOM_TestAll.py
7181 if Limit == self.ShapeType["AUTO"]:
7182 # automatic detection of the most appropriate shape limit type
7184 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7185 Limit = EnumToLong(lim)
7187 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7188 ListKeepInside, ListRemoveInside,
7189 Limit, RemoveWebs, ListMaterials,
7190 KeepNonlimitShapes);
7191 RaiseIfFailed("MakePartition", self.BoolOp)
7192 self._autoPublish(anObj, theName, "partition")
7195 ## Perform partition operation.
7196 # This method may be useful if it is needed to make a partition for
7197 # compound contains nonintersected shapes. Performance will be better
7198 # since intersection between shapes from compound is not performed.
7200 # Description of all parameters as in previous method MakePartition().
7201 # One additional parameter is provided:
7202 # @param checkSelfInte The flag that tells if the arguments should
7203 # be checked for self-intersection prior to the operation.
7205 # @note This algorithm doesn't find all types of self-intersections.
7206 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7207 # vertex/face and edge/face intersections. Face/face
7208 # intersections detection is switched off as it is a
7209 # time-consuming operation that gives an impact on performance.
7210 # To find all self-intersections please use
7211 # CheckSelfIntersections() method.
7213 # @note Passed compounds (via ListShapes or via ListTools)
7214 # have to consist of nonintersecting shapes.
7216 # @return New GEOM.GEOM_Object, containing the result shapes.
7218 # @ref swig_todo "Example"
7219 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7220 ListKeepInside=[], ListRemoveInside=[],
7221 Limit=ShapeType["AUTO"], RemoveWebs=0,
7222 ListMaterials=[], KeepNonlimitShapes=0,
7223 checkSelfInte=False, theName=None):
7225 Perform partition operation.
7226 This method may be useful if it is needed to make a partition for
7227 compound contains nonintersected shapes. Performance will be better
7228 since intersection between shapes from compound is not performed.
7231 Description of all parameters as in method geompy.MakePartition.
7232 One additional parameter is provided:
7233 checkSelfInte The flag that tells if the arguments should
7234 be checked for self-intersection prior to
7238 This algorithm doesn't find all types of self-intersections.
7239 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7240 vertex/face and edge/face intersections. Face/face
7241 intersections detection is switched off as it is a
7242 time-consuming operation that gives an impact on performance.
7243 To find all self-intersections please use
7244 CheckSelfIntersections() method.
7247 Passed compounds (via ListShapes or via ListTools)
7248 have to consist of nonintersecting shapes.
7251 New GEOM.GEOM_Object, containing the result shapes.
7253 if Limit == self.ShapeType["AUTO"]:
7254 # automatic detection of the most appropriate shape limit type
7256 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7257 Limit = EnumToLong(lim)
7259 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7260 ListKeepInside, ListRemoveInside,
7261 Limit, RemoveWebs, ListMaterials,
7262 KeepNonlimitShapes, checkSelfInte);
7263 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7264 self._autoPublish(anObj, theName, "partition")
7267 ## See method MakePartition() for more information.
7269 # @ref tui_partition "Example 1"
7270 # \n @ref swig_Partition "Example 2"
7271 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7272 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7273 KeepNonlimitShapes=0, theName=None):
7275 See method geompy.MakePartition for more information.
7277 # Example: see GEOM_TestOthers.py
7278 # note: auto-publishing is done in self.MakePartition()
7279 anObj = self.MakePartition(ListShapes, ListTools,
7280 ListKeepInside, ListRemoveInside,
7281 Limit, RemoveWebs, ListMaterials,
7282 KeepNonlimitShapes, theName);
7285 ## Perform partition of the Shape with the Plane
7286 # @param theShape Shape to be intersected.
7287 # @param thePlane Tool shape, to intersect theShape.
7288 # @param theName Object name; when specified, this parameter is used
7289 # for result publication in the study. Otherwise, if automatic
7290 # publication is switched on, default value is used for result name.
7292 # @return New GEOM.GEOM_Object, containing the result shape.
7294 # @ref tui_partition "Example"
7295 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7297 Perform partition of the Shape with the Plane
7300 theShape Shape to be intersected.
7301 thePlane Tool shape, to intersect theShape.
7302 theName Object name; when specified, this parameter is used
7303 for result publication in the study. Otherwise, if automatic
7304 publication is switched on, default value is used for result name.
7307 New GEOM.GEOM_Object, containing the result shape.
7309 # Example: see GEOM_TestAll.py
7310 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7311 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7312 self._autoPublish(anObj, theName, "partition")
7315 # end of l3_basic_op
7318 ## @addtogroup l3_transform
7321 ## Translate the given object along the vector, specified
7322 # by its end points.
7323 # @param theObject The object to be translated.
7324 # @param thePoint1 Start point of translation vector.
7325 # @param thePoint2 End point of translation vector.
7326 # @param theCopy Flag used to translate object itself or create a copy.
7327 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7328 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7329 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7331 Translate the given object along the vector, specified by its end points.
7334 theObject The object to be translated.
7335 thePoint1 Start point of translation vector.
7336 thePoint2 End point of translation vector.
7337 theCopy Flag used to translate object itself or create a copy.
7340 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7341 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7344 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7346 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7347 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7350 ## Translate the given object along the vector, specified
7351 # by its end points, creating its copy before the translation.
7352 # @param theObject The object to be translated.
7353 # @param thePoint1 Start point of translation vector.
7354 # @param thePoint2 End point of translation vector.
7355 # @param theName Object name; when specified, this parameter is used
7356 # for result publication in the study. Otherwise, if automatic
7357 # publication is switched on, default value is used for result name.
7359 # @return New GEOM.GEOM_Object, containing the translated object.
7361 # @ref tui_translation "Example 1"
7362 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7363 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7365 Translate the given object along the vector, specified
7366 by its end points, creating its copy before the translation.
7369 theObject The object to be translated.
7370 thePoint1 Start point of translation vector.
7371 thePoint2 End point of translation vector.
7372 theName Object name; when specified, this parameter is used
7373 for result publication in the study. Otherwise, if automatic
7374 publication is switched on, default value is used for result name.
7377 New GEOM.GEOM_Object, containing the translated object.
7379 # Example: see GEOM_TestAll.py
7380 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7381 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7382 self._autoPublish(anObj, theName, "translated")
7385 ## Translate the given object along the vector, specified by its components.
7386 # @param theObject The object to be translated.
7387 # @param theDX,theDY,theDZ Components of translation vector.
7388 # @param theCopy Flag used to translate object itself or create a copy.
7389 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7390 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7392 # @ref tui_translation "Example"
7393 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7395 Translate the given object along the vector, specified by its components.
7398 theObject The object to be translated.
7399 theDX,theDY,theDZ Components of translation vector.
7400 theCopy Flag used to translate object itself or create a copy.
7403 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7404 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7406 # Example: see GEOM_TestAll.py
7407 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7409 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7411 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7412 anObj.SetParameters(Parameters)
7413 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7416 ## Translate the given object along the vector, specified
7417 # by its components, creating its copy before the translation.
7418 # @param theObject The object to be translated.
7419 # @param theDX,theDY,theDZ Components of translation vector.
7420 # @param theName Object name; when specified, this parameter is used
7421 # for result publication in the study. Otherwise, if automatic
7422 # publication is switched on, default value is used for result name.
7424 # @return New GEOM.GEOM_Object, containing the translated object.
7426 # @ref tui_translation "Example"
7427 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7429 Translate the given object along the vector, specified
7430 by its components, creating its copy before the translation.
7433 theObject The object to be translated.
7434 theDX,theDY,theDZ Components of translation vector.
7435 theName Object name; when specified, this parameter is used
7436 for result publication in the study. Otherwise, if automatic
7437 publication is switched on, default value is used for result name.
7440 New GEOM.GEOM_Object, containing the translated object.
7442 # Example: see GEOM_TestAll.py
7443 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7444 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7445 anObj.SetParameters(Parameters)
7446 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7447 self._autoPublish(anObj, theName, "translated")
7450 ## Translate the given object along the given vector.
7451 # @param theObject The object to be translated.
7452 # @param theVector The translation vector.
7453 # @param theCopy Flag used to translate object itself or create a copy.
7454 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7455 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7456 def TranslateVector(self, theObject, theVector, theCopy=False):
7458 Translate the given object along the given vector.
7461 theObject The object to be translated.
7462 theVector The translation vector.
7463 theCopy Flag used to translate object itself or create a copy.
7466 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7467 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7470 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7472 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7473 RaiseIfFailed("TranslateVector", self.TrsfOp)
7476 ## Translate the given object along the given vector,
7477 # creating its copy before the translation.
7478 # @param theObject The object to be translated.
7479 # @param theVector The translation vector.
7480 # @param theName Object name; when specified, this parameter is used
7481 # for result publication in the study. Otherwise, if automatic
7482 # publication is switched on, default value is used for result name.
7484 # @return New GEOM.GEOM_Object, containing the translated object.
7486 # @ref tui_translation "Example"
7487 def MakeTranslationVector(self, theObject, theVector, theName=None):
7489 Translate the given object along the given vector,
7490 creating its copy before the translation.
7493 theObject The object to be translated.
7494 theVector The translation vector.
7495 theName Object name; when specified, this parameter is used
7496 for result publication in the study. Otherwise, if automatic
7497 publication is switched on, default value is used for result name.
7500 New GEOM.GEOM_Object, containing the translated object.
7502 # Example: see GEOM_TestAll.py
7503 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7504 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7505 self._autoPublish(anObj, theName, "translated")
7508 ## Translate the given object along the given vector on given distance.
7509 # @param theObject The object to be translated.
7510 # @param theVector The translation vector.
7511 # @param theDistance The translation distance.
7512 # @param theCopy Flag used to translate object itself or create a copy.
7513 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7514 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7516 # @ref tui_translation "Example"
7517 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7519 Translate the given object along the given vector on given distance.
7522 theObject The object to be translated.
7523 theVector The translation vector.
7524 theDistance The translation distance.
7525 theCopy Flag used to translate object itself or create a copy.
7528 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7529 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7531 # Example: see GEOM_TestAll.py
7532 theDistance,Parameters = ParseParameters(theDistance)
7533 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7534 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7535 anObj.SetParameters(Parameters)
7538 ## Translate the given object along the given vector on given distance,
7539 # creating its copy before the translation.
7540 # @param theObject The object to be translated.
7541 # @param theVector The translation vector.
7542 # @param theDistance The translation distance.
7543 # @param theName Object name; when specified, this parameter is used
7544 # for result publication in the study. Otherwise, if automatic
7545 # publication is switched on, default value is used for result name.
7547 # @return New GEOM.GEOM_Object, containing the translated object.
7549 # @ref tui_translation "Example"
7550 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7552 Translate the given object along the given vector on given distance,
7553 creating its copy before the translation.
7556 theObject The object to be translated.
7557 theVector The translation vector.
7558 theDistance The translation distance.
7559 theName Object name; when specified, this parameter is used
7560 for result publication in the study. Otherwise, if automatic
7561 publication is switched on, default value is used for result name.
7564 New GEOM.GEOM_Object, containing the translated object.
7566 # Example: see GEOM_TestAll.py
7567 theDistance,Parameters = ParseParameters(theDistance)
7568 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7569 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7570 anObj.SetParameters(Parameters)
7571 self._autoPublish(anObj, theName, "translated")
7574 ## Rotate the given object around the given axis on the given angle.
7575 # @param theObject The object to be rotated.
7576 # @param theAxis Rotation axis.
7577 # @param theAngle Rotation angle in radians.
7578 # @param theCopy Flag used to rotate object itself or create a copy.
7580 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7581 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7583 # @ref tui_rotation "Example"
7584 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7586 Rotate the given object around the given axis on the given angle.
7589 theObject The object to be rotated.
7590 theAxis Rotation axis.
7591 theAngle Rotation angle in radians.
7592 theCopy Flag used to rotate object itself or create a copy.
7595 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7596 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7598 # Example: see GEOM_TestAll.py
7600 if isinstance(theAngle,str):
7602 theAngle, Parameters = ParseParameters(theAngle)
7604 theAngle = theAngle*math.pi/180.0
7606 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7608 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7609 RaiseIfFailed("Rotate", self.TrsfOp)
7610 anObj.SetParameters(Parameters)
7613 ## Rotate the given object around the given axis
7614 # on the given angle, creating its copy before the rotatation.
7615 # @param theObject The object to be rotated.
7616 # @param theAxis Rotation axis.
7617 # @param theAngle Rotation angle in radians.
7618 # @param theName Object name; when specified, this parameter is used
7619 # for result publication in the study. Otherwise, if automatic
7620 # publication is switched on, default value is used for result name.
7622 # @return New GEOM.GEOM_Object, containing the rotated object.
7624 # @ref tui_rotation "Example"
7625 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7627 Rotate the given object around the given axis
7628 on the given angle, creating its copy before the rotatation.
7631 theObject The object to be rotated.
7632 theAxis Rotation axis.
7633 theAngle Rotation angle in radians.
7634 theName Object name; when specified, this parameter is used
7635 for result publication in the study. Otherwise, if automatic
7636 publication is switched on, default value is used for result name.
7639 New GEOM.GEOM_Object, containing the rotated object.
7641 # Example: see GEOM_TestAll.py
7643 if isinstance(theAngle,str):
7645 theAngle, Parameters = ParseParameters(theAngle)
7647 theAngle = theAngle*math.pi/180.0
7648 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7649 RaiseIfFailed("RotateCopy", self.TrsfOp)
7650 anObj.SetParameters(Parameters)
7651 self._autoPublish(anObj, theName, "rotated")
7654 ## Rotate given object around vector perpendicular to plane
7655 # containing three points.
7656 # @param theObject The object to be rotated.
7657 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7658 # containing the three points.
7659 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7660 # @param theCopy Flag used to rotate object itself or create a copy.
7661 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7662 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7663 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7665 Rotate given object around vector perpendicular to plane
7666 containing three points.
7669 theObject The object to be rotated.
7670 theCentPoint central point the axis is the vector perpendicular to the plane
7671 containing the three points.
7672 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7673 theCopy Flag used to rotate object itself or create a copy.
7676 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7677 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7680 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7682 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7683 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7686 ## Rotate given object around vector perpendicular to plane
7687 # containing three points, creating its copy before the rotatation.
7688 # @param theObject The object to be rotated.
7689 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7690 # containing the three points.
7691 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7692 # @param theName Object name; when specified, this parameter is used
7693 # for result publication in the study. Otherwise, if automatic
7694 # publication is switched on, default value is used for result name.
7696 # @return New GEOM.GEOM_Object, containing the rotated object.
7698 # @ref tui_rotation "Example"
7699 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7701 Rotate given object around vector perpendicular to plane
7702 containing three points, creating its copy before the rotatation.
7705 theObject The object to be rotated.
7706 theCentPoint central point the axis is the vector perpendicular to the plane
7707 containing the three points.
7708 thePoint1,thePoint2 in a perpendicular plane of the axis.
7709 theName Object name; when specified, this parameter is used
7710 for result publication in the study. Otherwise, if automatic
7711 publication is switched on, default value is used for result name.
7714 New GEOM.GEOM_Object, containing the rotated object.
7716 # Example: see GEOM_TestAll.py
7717 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7718 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7719 self._autoPublish(anObj, theName, "rotated")
7722 ## Scale the given object by the specified factor.
7723 # @param theObject The object to be scaled.
7724 # @param thePoint Center point for scaling.
7725 # Passing None for it means scaling relatively the origin of global CS.
7726 # @param theFactor Scaling factor value.
7727 # @param theCopy Flag used to scale object itself or create a copy.
7728 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7729 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7730 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7732 Scale the given object by the specified factor.
7735 theObject The object to be scaled.
7736 thePoint Center point for scaling.
7737 Passing None for it means scaling relatively the origin of global CS.
7738 theFactor Scaling factor value.
7739 theCopy Flag used to scale object itself or create a copy.
7742 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7743 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7745 # Example: see GEOM_TestAll.py
7746 theFactor, Parameters = ParseParameters(theFactor)
7748 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7750 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7751 RaiseIfFailed("Scale", self.TrsfOp)
7752 anObj.SetParameters(Parameters)
7755 ## Scale the given object by the factor, creating its copy before the scaling.
7756 # @param theObject The object to be scaled.
7757 # @param thePoint Center point for scaling.
7758 # Passing None for it means scaling relatively the origin of global CS.
7759 # @param theFactor Scaling factor value.
7760 # @param theName Object name; when specified, this parameter is used
7761 # for result publication in the study. Otherwise, if automatic
7762 # publication is switched on, default value is used for result name.
7764 # @return New GEOM.GEOM_Object, containing the scaled shape.
7766 # @ref tui_scale "Example"
7767 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7769 Scale the given object by the factor, creating its copy before the scaling.
7772 theObject The object to be scaled.
7773 thePoint Center point for scaling.
7774 Passing None for it means scaling relatively the origin of global CS.
7775 theFactor Scaling factor value.
7776 theName Object name; when specified, this parameter is used
7777 for result publication in the study. Otherwise, if automatic
7778 publication is switched on, default value is used for result name.
7781 New GEOM.GEOM_Object, containing the scaled shape.
7783 # Example: see GEOM_TestAll.py
7784 theFactor, Parameters = ParseParameters(theFactor)
7785 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7786 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7787 anObj.SetParameters(Parameters)
7788 self._autoPublish(anObj, theName, "scaled")
7791 ## Scale the given object by different factors along coordinate axes.
7792 # @param theObject The object to be scaled.
7793 # @param thePoint Center point for scaling.
7794 # Passing None for it means scaling relatively the origin of global CS.
7795 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7796 # @param theCopy Flag used to scale object itself or create a copy.
7797 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7798 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7799 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7801 Scale the given object by different factors along coordinate axes.
7804 theObject The object to be scaled.
7805 thePoint Center point for scaling.
7806 Passing None for it means scaling relatively the origin of global CS.
7807 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7808 theCopy Flag used to scale object itself or create a copy.
7811 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7812 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7814 # Example: see GEOM_TestAll.py
7815 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7817 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7818 theFactorX, theFactorY, theFactorZ)
7820 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7821 theFactorX, theFactorY, theFactorZ)
7822 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7823 anObj.SetParameters(Parameters)
7826 ## Scale the given object by different factors along coordinate axes,
7827 # creating its copy before the scaling.
7828 # @param theObject The object to be scaled.
7829 # @param thePoint Center point for scaling.
7830 # Passing None for it means scaling relatively the origin of global CS.
7831 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7832 # @param theName Object name; when specified, this parameter is used
7833 # for result publication in the study. Otherwise, if automatic
7834 # publication is switched on, default value is used for result name.
7836 # @return New GEOM.GEOM_Object, containing the scaled shape.
7838 # @ref swig_scale "Example"
7839 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7841 Scale the given object by different factors along coordinate axes,
7842 creating its copy before the scaling.
7845 theObject The object to be scaled.
7846 thePoint Center point for scaling.
7847 Passing None for it means scaling relatively the origin of global CS.
7848 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7849 theName Object name; when specified, this parameter is used
7850 for result publication in the study. Otherwise, if automatic
7851 publication is switched on, default value is used for result name.
7854 New GEOM.GEOM_Object, containing the scaled shape.
7856 # Example: see GEOM_TestAll.py
7857 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7858 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7859 theFactorX, theFactorY, theFactorZ)
7860 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7861 anObj.SetParameters(Parameters)
7862 self._autoPublish(anObj, theName, "scaled")
7865 ## Mirror an object relatively the given plane.
7866 # @param theObject The object to be mirrored.
7867 # @param thePlane Plane of symmetry.
7868 # @param theCopy Flag used to mirror object itself or create a copy.
7869 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7870 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7871 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7873 Mirror an object relatively the given plane.
7876 theObject The object to be mirrored.
7877 thePlane Plane of symmetry.
7878 theCopy Flag used to mirror object itself or create a copy.
7881 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7882 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7885 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7887 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7888 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7891 ## Create an object, symmetrical
7892 # to the given one relatively the given plane.
7893 # @param theObject The object to be mirrored.
7894 # @param thePlane Plane of symmetry.
7895 # @param theName Object name; when specified, this parameter is used
7896 # for result publication in the study. Otherwise, if automatic
7897 # publication is switched on, default value is used for result name.
7899 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7901 # @ref tui_mirror "Example"
7902 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7904 Create an object, symmetrical to the given one relatively the given plane.
7907 theObject The object to be mirrored.
7908 thePlane Plane of symmetry.
7909 theName Object name; when specified, this parameter is used
7910 for result publication in the study. Otherwise, if automatic
7911 publication is switched on, default value is used for result name.
7914 New GEOM.GEOM_Object, containing the mirrored shape.
7916 # Example: see GEOM_TestAll.py
7917 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7918 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7919 self._autoPublish(anObj, theName, "mirrored")
7922 ## Mirror an object relatively the given axis.
7923 # @param theObject The object to be mirrored.
7924 # @param theAxis Axis of symmetry.
7925 # @param theCopy Flag used to mirror object itself or create a copy.
7926 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7927 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7928 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7930 Mirror an object relatively the given axis.
7933 theObject The object to be mirrored.
7934 theAxis Axis of symmetry.
7935 theCopy Flag used to mirror object itself or create a copy.
7938 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7939 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7942 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7944 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7945 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7948 ## Create an object, symmetrical
7949 # to the given one relatively the given axis.
7950 # @param theObject The object to be mirrored.
7951 # @param theAxis Axis of symmetry.
7952 # @param theName Object name; when specified, this parameter is used
7953 # for result publication in the study. Otherwise, if automatic
7954 # publication is switched on, default value is used for result name.
7956 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7958 # @ref tui_mirror "Example"
7959 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7961 Create an object, symmetrical to the given one relatively the given axis.
7964 theObject The object to be mirrored.
7965 theAxis Axis of symmetry.
7966 theName Object name; when specified, this parameter is used
7967 for result publication in the study. Otherwise, if automatic
7968 publication is switched on, default value is used for result name.
7971 New GEOM.GEOM_Object, containing the mirrored shape.
7973 # Example: see GEOM_TestAll.py
7974 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7975 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7976 self._autoPublish(anObj, theName, "mirrored")
7979 ## Mirror an object relatively the given point.
7980 # @param theObject The object to be mirrored.
7981 # @param thePoint Point of symmetry.
7982 # @param theCopy Flag used to mirror object itself or create a copy.
7983 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7984 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7985 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7987 Mirror an object relatively the given point.
7990 theObject The object to be mirrored.
7991 thePoint Point of symmetry.
7992 theCopy Flag used to mirror object itself or create a copy.
7995 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7996 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7998 # Example: see GEOM_TestAll.py
8000 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8002 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8003 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8006 ## Create an object, symmetrical
8007 # to the given one relatively the given point.
8008 # @param theObject The object to be mirrored.
8009 # @param thePoint Point of symmetry.
8010 # @param theName Object name; when specified, this parameter is used
8011 # for result publication in the study. Otherwise, if automatic
8012 # publication is switched on, default value is used for result name.
8014 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8016 # @ref tui_mirror "Example"
8017 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8019 Create an object, symmetrical
8020 to the given one relatively the given point.
8023 theObject The object to be mirrored.
8024 thePoint Point of symmetry.
8025 theName Object name; when specified, this parameter is used
8026 for result publication in the study. Otherwise, if automatic
8027 publication is switched on, default value is used for result name.
8030 New GEOM.GEOM_Object, containing the mirrored shape.
8032 # Example: see GEOM_TestAll.py
8033 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8034 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8035 self._autoPublish(anObj, theName, "mirrored")
8038 ## Modify the location of the given object.
8039 # @param theObject The object to be displaced.
8040 # @param theStartLCS Coordinate system to perform displacement from it.\n
8041 # If \a theStartLCS is NULL, displacement
8042 # will be performed from global CS.\n
8043 # If \a theObject itself is used as \a theStartLCS,
8044 # its location will be changed to \a theEndLCS.
8045 # @param theEndLCS Coordinate system to perform displacement to it.
8046 # @param theCopy Flag used to displace object itself or create a copy.
8047 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8048 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8049 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8051 Modify the Location of the given object by LCS, creating its copy before the setting.
8054 theObject The object to be displaced.
8055 theStartLCS Coordinate system to perform displacement from it.
8056 If theStartLCS is NULL, displacement
8057 will be performed from global CS.
8058 If theObject itself is used as theStartLCS,
8059 its location will be changed to theEndLCS.
8060 theEndLCS Coordinate system to perform displacement to it.
8061 theCopy Flag used to displace object itself or create a copy.
8064 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8065 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8067 # Example: see GEOM_TestAll.py
8069 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8071 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8072 RaiseIfFailed("Displace", self.TrsfOp)
8075 ## Modify the Location of the given object by LCS,
8076 # creating its copy before the setting.
8077 # @param theObject The object to be displaced.
8078 # @param theStartLCS Coordinate system to perform displacement from it.\n
8079 # If \a theStartLCS is NULL, displacement
8080 # will be performed from global CS.\n
8081 # If \a theObject itself is used as \a theStartLCS,
8082 # its location will be changed to \a theEndLCS.
8083 # @param theEndLCS Coordinate system to perform displacement to it.
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 the displaced shape.
8090 # @ref tui_modify_location "Example"
8091 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8093 Modify the Location of the given object by LCS, creating its copy before the setting.
8096 theObject The object to be displaced.
8097 theStartLCS Coordinate system to perform displacement from it.
8098 If theStartLCS is NULL, displacement
8099 will be performed from global CS.
8100 If theObject itself is used as theStartLCS,
8101 its location will be changed to theEndLCS.
8102 theEndLCS Coordinate system to perform displacement to it.
8103 theName Object name; when specified, this parameter is used
8104 for result publication in the study. Otherwise, if automatic
8105 publication is switched on, default value is used for result name.
8108 New GEOM.GEOM_Object, containing the displaced shape.
8111 # create local coordinate systems
8112 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8113 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8114 # modify the location of the given object
8115 position = geompy.MakePosition(cylinder, cs1, cs2)
8117 # Example: see GEOM_TestAll.py
8118 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8119 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8120 self._autoPublish(anObj, theName, "displaced")
8123 ## Modify the Location of the given object by Path.
8124 # @param theObject The object to be displaced.
8125 # @param thePath Wire or Edge along that the object will be translated.
8126 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8127 # @param theCopy is to create a copy objects if true.
8128 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8129 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8130 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8132 # @ref tui_modify_location "Example"
8133 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8135 Modify the Location of the given object by Path.
8138 theObject The object to be displaced.
8139 thePath Wire or Edge along that the object will be translated.
8140 theDistance progress of Path (0 = start location, 1 = end of path location).
8141 theCopy is to create a copy objects if true.
8142 theReverse 0 - for usual direction, 1 - to reverse path direction.
8145 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8146 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8149 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8151 # Example: see GEOM_TestAll.py
8152 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8153 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8156 ## Modify the Location of the given object by Path, creating its copy before the operation.
8157 # @param theObject The object to be displaced.
8158 # @param thePath Wire or Edge along that the object will be translated.
8159 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8160 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8161 # @param theName Object name; when specified, this parameter is used
8162 # for result publication in the study. Otherwise, if automatic
8163 # publication is switched on, default value is used for result name.
8165 # @return New GEOM.GEOM_Object, containing the displaced shape.
8166 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8168 Modify the Location of the given object by Path, creating its copy before the operation.
8171 theObject The object to be displaced.
8172 thePath Wire or Edge along that the object will be translated.
8173 theDistance progress of Path (0 = start location, 1 = end of path location).
8174 theReverse 0 - for usual direction, 1 - to reverse path direction.
8175 theName Object name; when specified, this parameter is used
8176 for result publication in the study. Otherwise, if automatic
8177 publication is switched on, default value is used for result name.
8180 New GEOM.GEOM_Object, containing the displaced shape.
8182 # Example: see GEOM_TestAll.py
8183 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8184 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8185 self._autoPublish(anObj, theName, "displaced")
8188 ## Offset given shape.
8189 # @param theObject The base object for the offset.
8190 # @param theOffset Offset value.
8191 # @param theCopy Flag used to offset object itself or create a copy.
8192 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8193 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8194 def Offset(self, theObject, theOffset, theCopy=False):
8199 theObject The base object for the offset.
8200 theOffset Offset value.
8201 theCopy Flag used to offset object itself or create a copy.
8204 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8205 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8207 theOffset, Parameters = ParseParameters(theOffset)
8209 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8211 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8212 RaiseIfFailed("Offset", self.TrsfOp)
8213 anObj.SetParameters(Parameters)
8216 ## Create new object as offset of the given one.
8217 # @param theObject The base object for the offset.
8218 # @param theOffset Offset value.
8219 # @param theName Object name; when specified, this parameter is used
8220 # for result publication in the study. Otherwise, if automatic
8221 # publication is switched on, default value is used for result name.
8223 # @return New GEOM.GEOM_Object, containing the offset object.
8225 # @ref tui_offset "Example"
8226 def MakeOffset(self, theObject, theOffset, theName=None):
8228 Create new object as offset of the given one.
8231 theObject The base object for the offset.
8232 theOffset Offset value.
8233 theName Object name; when specified, this parameter is used
8234 for result publication in the study. Otherwise, if automatic
8235 publication is switched on, default value is used for result name.
8238 New GEOM.GEOM_Object, containing the offset object.
8241 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8242 # create a new object as offset of the given object
8243 offset = geompy.MakeOffset(box, 70.)
8245 # Example: see GEOM_TestAll.py
8246 theOffset, Parameters = ParseParameters(theOffset)
8247 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8248 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8249 anObj.SetParameters(Parameters)
8250 self._autoPublish(anObj, theName, "offset")
8253 ## Create new object as projection of the given one on a 2D surface.
8254 # @param theSource The source object for the projection. It can be a point, edge or wire.
8255 # @param theTarget The target object. It can be planar or cylindrical face.
8256 # @param theName Object name; when specified, this parameter is used
8257 # for result publication in the study. Otherwise, if automatic
8258 # publication is switched on, default value is used for result name.
8260 # @return New GEOM.GEOM_Object, containing the projection.
8262 # @ref tui_projection "Example"
8263 def MakeProjection(self, theSource, theTarget, theName=None):
8265 Create new object as projection of the given one on a 2D surface.
8268 theSource The source object for the projection. It can be a point, edge or wire.
8269 theTarget The target object. It can be planar or cylindrical face.
8270 theName Object name; when specified, this parameter is used
8271 for result publication in the study. Otherwise, if automatic
8272 publication is switched on, default value is used for result name.
8275 New GEOM.GEOM_Object, containing the projection.
8277 # Example: see GEOM_TestAll.py
8278 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8279 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8280 self._autoPublish(anObj, theName, "projection")
8283 ## Create a projection projection of the given point on a wire or an edge.
8284 # If there are no solutions or there are 2 or more solutions It throws an
8286 # @param thePoint the point to be projected.
8287 # @param theWire the wire. The edge is accepted as well.
8288 # @param theName Object name; when specified, this parameter is used
8289 # for result publication in the study. Otherwise, if automatic
8290 # publication is switched on, default value is used for result name.
8292 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8293 # \n \a u: The parameter of projection point on edge.
8294 # \n \a PointOnEdge: The projection point.
8295 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8297 # @ref tui_projection "Example"
8298 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8300 Create a projection projection of the given point on a wire or an edge.
8301 If there are no solutions or there are 2 or more solutions It throws an
8305 thePoint the point to be projected.
8306 theWire the wire. The edge is accepted as well.
8307 theName Object name; when specified, this parameter is used
8308 for result publication in the study. Otherwise, if automatic
8309 publication is switched on, default value is used for result name.
8312 [u, PointOnEdge, EdgeInWireIndex]
8313 u: The parameter of projection point on edge.
8314 PointOnEdge: The projection point.
8315 EdgeInWireIndex: The index of an edge in a wire.
8317 # Example: see GEOM_TestAll.py
8318 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8319 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8320 self._autoPublish(anObj[1], theName, "projection")
8323 # -----------------------------------------------------------------------------
8325 # -----------------------------------------------------------------------------
8327 ## Translate the given object along the given vector a given number times
8328 # @param theObject The object to be translated.
8329 # @param theVector Direction of the translation. DX if None.
8330 # @param theStep Distance to translate on.
8331 # @param theNbTimes Quantity of translations to be done.
8332 # @param theName Object name; when specified, this parameter is used
8333 # for result publication in the study. Otherwise, if automatic
8334 # publication is switched on, default value is used for result name.
8336 # @return New GEOM.GEOM_Object, containing compound of all
8337 # the shapes, obtained after each translation.
8339 # @ref tui_multi_translation "Example"
8340 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8342 Translate the given object along the given vector a given number times
8345 theObject The object to be translated.
8346 theVector Direction of the translation. DX if None.
8347 theStep Distance to translate on.
8348 theNbTimes Quantity of translations to be done.
8349 theName Object name; when specified, this parameter is used
8350 for result publication in the study. Otherwise, if automatic
8351 publication is switched on, default value is used for result name.
8354 New GEOM.GEOM_Object, containing compound of all
8355 the shapes, obtained after each translation.
8358 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8360 # Example: see GEOM_TestAll.py
8361 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8362 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8363 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8364 anObj.SetParameters(Parameters)
8365 self._autoPublish(anObj, theName, "multitranslation")
8368 ## Conseqently apply two specified translations to theObject specified number of times.
8369 # @param theObject The object to be translated.
8370 # @param theVector1 Direction of the first translation. DX if None.
8371 # @param theStep1 Step of the first translation.
8372 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8373 # @param theVector2 Direction of the second translation. DY if None.
8374 # @param theStep2 Step of the second translation.
8375 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8376 # @param theName Object name; when specified, this parameter is used
8377 # for result publication in the study. Otherwise, if automatic
8378 # publication is switched on, default value is used for result name.
8380 # @return New GEOM.GEOM_Object, containing compound of all
8381 # the shapes, obtained after each translation.
8383 # @ref tui_multi_translation "Example"
8384 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8385 theVector2, theStep2, theNbTimes2, theName=None):
8387 Conseqently apply two specified translations to theObject specified number of times.
8390 theObject The object to be translated.
8391 theVector1 Direction of the first translation. DX if None.
8392 theStep1 Step of the first translation.
8393 theNbTimes1 Quantity of translations to be done along theVector1.
8394 theVector2 Direction of the second translation. DY if None.
8395 theStep2 Step of the second translation.
8396 theNbTimes2 Quantity of translations to be done along theVector2.
8397 theName Object name; when specified, this parameter is used
8398 for result publication in the study. Otherwise, if automatic
8399 publication is switched on, default value is used for result name.
8402 New GEOM.GEOM_Object, containing compound of all
8403 the shapes, obtained after each translation.
8406 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8408 # Example: see GEOM_TestAll.py
8409 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8410 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8411 theVector2, theStep2, theNbTimes2)
8412 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8413 anObj.SetParameters(Parameters)
8414 self._autoPublish(anObj, theName, "multitranslation")
8417 ## Rotate the given object around the given axis a given number times.
8418 # Rotation angle will be 2*PI/theNbTimes.
8419 # @param theObject The object to be rotated.
8420 # @param theAxis The rotation axis. DZ if None.
8421 # @param theNbTimes Quantity of rotations to be done.
8422 # @param theName Object name; when specified, this parameter is used
8423 # for result publication in the study. Otherwise, if automatic
8424 # publication is switched on, default value is used for result name.
8426 # @return New GEOM.GEOM_Object, containing compound of all the
8427 # shapes, obtained after each rotation.
8429 # @ref tui_multi_rotation "Example"
8430 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8432 Rotate the given object around the given axis a given number times.
8433 Rotation angle will be 2*PI/theNbTimes.
8436 theObject The object to be rotated.
8437 theAxis The rotation axis. DZ if None.
8438 theNbTimes Quantity of rotations to be done.
8439 theName Object name; when specified, this parameter is used
8440 for result publication in the study. Otherwise, if automatic
8441 publication is switched on, default value is used for result name.
8444 New GEOM.GEOM_Object, containing compound of all the
8445 shapes, obtained after each rotation.
8448 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8450 # Example: see GEOM_TestAll.py
8451 theNbTimes, Parameters = ParseParameters(theNbTimes)
8452 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8453 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8454 anObj.SetParameters(Parameters)
8455 self._autoPublish(anObj, theName, "multirotation")
8458 ## Rotate the given object around the given axis
8459 # a given number times on the given angle.
8460 # @param theObject The object to be rotated.
8461 # @param theAxis The rotation axis. DZ if None.
8462 # @param theAngleStep Rotation angle in radians.
8463 # @param theNbTimes Quantity of rotations to be done.
8464 # @param theName Object name; when specified, this parameter is used
8465 # for result publication in the study. Otherwise, if automatic
8466 # publication is switched on, default value is used for result name.
8468 # @return New GEOM.GEOM_Object, containing compound of all the
8469 # shapes, obtained after each rotation.
8471 # @ref tui_multi_rotation "Example"
8472 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8474 Rotate the given object around the given axis
8475 a given number times on the given angle.
8478 theObject The object to be rotated.
8479 theAxis The rotation axis. DZ if None.
8480 theAngleStep Rotation angle in radians.
8481 theNbTimes Quantity of rotations to be done.
8482 theName Object name; when specified, this parameter is used
8483 for result publication in the study. Otherwise, if automatic
8484 publication is switched on, default value is used for result name.
8487 New GEOM.GEOM_Object, containing compound of all the
8488 shapes, obtained after each rotation.
8491 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8493 # Example: see GEOM_TestAll.py
8494 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8495 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8496 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8497 anObj.SetParameters(Parameters)
8498 self._autoPublish(anObj, theName, "multirotation")
8501 ## Rotate the given object around the given axis a given
8502 # number times and multi-translate each rotation result.
8503 # Rotation angle will be 2*PI/theNbTimes1.
8504 # Translation direction passes through center of gravity
8505 # of rotated shape and its projection on the rotation axis.
8506 # @param theObject The object to be rotated.
8507 # @param theAxis Rotation axis. DZ if None.
8508 # @param theNbTimes1 Quantity of rotations to be done.
8509 # @param theRadialStep Translation distance.
8510 # @param theNbTimes2 Quantity of translations to be done.
8511 # @param theName Object name; when specified, this parameter is used
8512 # for result publication in the study. Otherwise, if automatic
8513 # publication is switched on, default value is used for result name.
8515 # @return New GEOM.GEOM_Object, containing compound of all the
8516 # shapes, obtained after each transformation.
8518 # @ref tui_multi_rotation "Example"
8519 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8521 Rotate the given object around the
8522 given axis on the given angle a given number
8523 times and multi-translate each rotation result.
8524 Translation direction passes through center of gravity
8525 of rotated shape and its projection on the rotation axis.
8528 theObject The object to be rotated.
8529 theAxis Rotation axis. DZ if None.
8530 theNbTimes1 Quantity of rotations to be done.
8531 theRadialStep Translation distance.
8532 theNbTimes2 Quantity of translations to be done.
8533 theName Object name; when specified, this parameter is used
8534 for result publication in the study. Otherwise, if automatic
8535 publication is switched on, default value is used for result name.
8538 New GEOM.GEOM_Object, containing compound of all the
8539 shapes, obtained after each transformation.
8542 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8544 # Example: see GEOM_TestAll.py
8545 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8546 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8547 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8548 anObj.SetParameters(Parameters)
8549 self._autoPublish(anObj, theName, "multirotation")
8552 ## Rotate the given object around the
8553 # given axis on the given angle a given number
8554 # times and multi-translate each rotation result.
8555 # Translation direction passes through center of gravity
8556 # of rotated shape and its projection on the rotation axis.
8557 # @param theObject The object to be rotated.
8558 # @param theAxis Rotation axis. DZ if None.
8559 # @param theAngleStep Rotation angle in radians.
8560 # @param theNbTimes1 Quantity of rotations to be done.
8561 # @param theRadialStep Translation distance.
8562 # @param theNbTimes2 Quantity of translations to be done.
8563 # @param theName Object name; when specified, this parameter is used
8564 # for result publication in the study. Otherwise, if automatic
8565 # publication is switched on, default value is used for result name.
8567 # @return New GEOM.GEOM_Object, containing compound of all the
8568 # shapes, obtained after each transformation.
8570 # @ref tui_multi_rotation "Example"
8571 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8573 Rotate the given object around the
8574 given axis on the given angle a given number
8575 times and multi-translate each rotation result.
8576 Translation direction passes through center of gravity
8577 of rotated shape and its projection on the rotation axis.
8580 theObject The object to be rotated.
8581 theAxis Rotation axis. DZ if None.
8582 theAngleStep Rotation angle in radians.
8583 theNbTimes1 Quantity of rotations to be done.
8584 theRadialStep Translation distance.
8585 theNbTimes2 Quantity of translations to be done.
8586 theName Object name; when specified, this parameter is used
8587 for result publication in the study. Otherwise, if automatic
8588 publication is switched on, default value is used for result name.
8591 New GEOM.GEOM_Object, containing compound of all the
8592 shapes, obtained after each transformation.
8595 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8597 # Example: see GEOM_TestAll.py
8598 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8599 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8600 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8601 anObj.SetParameters(Parameters)
8602 self._autoPublish(anObj, theName, "multirotation")
8605 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8607 # @ref swig_MakeMultiRotation "Example"
8608 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8610 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8613 pz = geompy.MakeVertex(0, 0, 100)
8614 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8615 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8617 # Example: see GEOM_TestOthers.py
8618 aVec = self.MakeLine(aPoint,aDir)
8619 # note: auto-publishing is done in self.MultiRotate1D()
8620 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8623 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8625 # @ref swig_MakeMultiRotation "Example"
8626 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8628 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8631 pz = geompy.MakeVertex(0, 0, 100)
8632 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8633 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8635 # Example: see GEOM_TestOthers.py
8636 aVec = self.MakeLine(aPoint,aDir)
8637 # note: auto-publishing is done in self.MultiRotate1D()
8638 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8641 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8643 # @ref swig_MakeMultiRotation "Example"
8644 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8646 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8649 pz = geompy.MakeVertex(0, 0, 100)
8650 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8651 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8653 # Example: see GEOM_TestOthers.py
8654 aVec = self.MakeLine(aPoint,aDir)
8655 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8656 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8659 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8661 # @ref swig_MakeMultiRotation "Example"
8662 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8664 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8667 pz = geompy.MakeVertex(0, 0, 100)
8668 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8669 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8671 # Example: see GEOM_TestOthers.py
8672 aVec = self.MakeLine(aPoint,aDir)
8673 # note: auto-publishing is done in self.MultiRotate2D()
8674 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8677 # end of l3_transform
8680 ## @addtogroup l3_transform_d
8683 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8684 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8686 Deprecated method. Use MultiRotate1DNbTimes instead.
8688 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8689 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8691 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8692 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8693 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8695 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8696 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8699 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8701 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8702 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8703 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8704 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8705 anObj.SetParameters(Parameters)
8706 self._autoPublish(anObj, theName, "multirotation")
8709 ## The same, as MultiRotate1D(), but axis is given by direction and point
8710 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8711 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8713 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8714 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8717 pz = geompy.MakeVertex(0, 0, 100)
8718 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8719 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8721 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8722 aVec = self.MakeLine(aPoint,aDir)
8723 # note: auto-publishing is done in self.MultiRotate1D()
8724 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8727 ## The same, as MultiRotate2D(), but axis is given by direction and point
8728 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8729 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8731 The same, as MultiRotate2D(), but axis is given by direction and point
8732 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8735 pz = geompy.MakeVertex(0, 0, 100)
8736 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8737 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8739 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8740 aVec = self.MakeLine(aPoint,aDir)
8741 # note: auto-publishing is done in self.MultiRotate2D()
8742 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8745 # end of l3_transform_d
8748 ## @addtogroup l3_local
8751 ## Perform a fillet on all edges of the given shape.
8752 # @param theShape Shape, to perform fillet on.
8753 # @param theR Fillet radius.
8754 # @param theName Object name; when specified, this parameter is used
8755 # for result publication in the study. Otherwise, if automatic
8756 # publication is switched on, default value is used for result name.
8758 # @return New GEOM.GEOM_Object, containing the result shape.
8760 # @ref tui_fillet "Example 1"
8761 # \n @ref swig_MakeFilletAll "Example 2"
8762 def MakeFilletAll(self, theShape, theR, theName=None):
8764 Perform a fillet on all edges of the given shape.
8767 theShape Shape, to perform fillet on.
8769 theName Object name; when specified, this parameter is used
8770 for result publication in the study. Otherwise, if automatic
8771 publication is switched on, default value is used for result name.
8774 New GEOM.GEOM_Object, containing the result shape.
8777 filletall = geompy.MakeFilletAll(prism, 10.)
8779 # Example: see GEOM_TestOthers.py
8780 theR,Parameters = ParseParameters(theR)
8781 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8782 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8783 anObj.SetParameters(Parameters)
8784 self._autoPublish(anObj, theName, "fillet")
8787 ## Perform a fillet on the specified edges/faces of the given shape
8788 # @param theShape Shape, to perform fillet on.
8789 # @param theR Fillet radius.
8790 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8791 # @param theListShapes Global indices of edges/faces to perform fillet on.
8792 # @param theName Object name; when specified, this parameter is used
8793 # for result publication in the study. Otherwise, if automatic
8794 # publication is switched on, default value is used for result name.
8796 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8798 # @return New GEOM.GEOM_Object, containing the result shape.
8800 # @ref tui_fillet "Example"
8801 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8803 Perform a fillet on the specified edges/faces of the given shape
8806 theShape Shape, to perform fillet on.
8808 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8809 theListShapes Global indices of edges/faces to perform fillet on.
8810 theName Object name; when specified, this parameter is used
8811 for result publication in the study. Otherwise, if automatic
8812 publication is switched on, default value is used for result name.
8815 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8818 New GEOM.GEOM_Object, containing the result shape.
8821 # get the list of IDs (IDList) for the fillet
8822 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8824 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8825 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8826 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8827 # make a fillet on the specified edges of the given shape
8828 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8830 # Example: see GEOM_TestAll.py
8831 theR,Parameters = ParseParameters(theR)
8833 if theShapeType == self.ShapeType["EDGE"]:
8834 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8835 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8837 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8838 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8839 anObj.SetParameters(Parameters)
8840 self._autoPublish(anObj, theName, "fillet")
8843 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8844 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8846 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8849 # get the list of IDs (IDList) for the fillet
8850 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8852 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8853 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8854 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8855 # make a fillet on the specified edges of the given shape
8856 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8858 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8860 if theShapeType == self.ShapeType["EDGE"]:
8861 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8862 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8864 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8865 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8866 anObj.SetParameters(Parameters)
8867 self._autoPublish(anObj, theName, "fillet")
8870 ## Perform a fillet on the specified edges of the given shape
8871 # @param theShape Wire Shape to perform fillet on.
8872 # @param theR Fillet radius.
8873 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8874 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8875 # \note The list of vertices could be empty,
8876 # in this case fillet will done done at all vertices in wire
8877 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8878 # by the length of the edges, nearest to the fillet vertex.
8879 # But sometimes the next edge is C1 continuous with the one, nearest to
8880 # the fillet point, and such two (or more) edges can be united to allow
8881 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8882 # thus ignoring the secant vertex (vertices).
8883 # @param theName Object name; when specified, this parameter is used
8884 # for result publication in the study. Otherwise, if automatic
8885 # publication is switched on, default value is used for result name.
8887 # @return New GEOM.GEOM_Object, containing the result shape.
8889 # @ref tui_fillet2d "Example"
8890 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8892 Perform a fillet on the specified edges of the given shape
8895 theShape Wire Shape to perform fillet on.
8897 theListOfVertexes Global indices of vertexes to perform fillet on.
8898 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8899 by the length of the edges, nearest to the fillet vertex.
8900 But sometimes the next edge is C1 continuous with the one, nearest to
8901 the fillet point, and such two (or more) edges can be united to allow
8902 bigger radius. Set this flag to TRUE to allow collinear edges union,
8903 thus ignoring the secant vertex (vertices).
8904 theName Object name; when specified, this parameter is used
8905 for result publication in the study. Otherwise, if automatic
8906 publication is switched on, default value is used for result name.
8908 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8910 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8913 New GEOM.GEOM_Object, containing the result shape.
8917 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8918 # make fillet at given wire vertices with giver radius
8919 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8921 # Example: see GEOM_TestAll.py
8922 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8923 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8924 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8925 anObj.SetParameters(Parameters)
8926 self._autoPublish(anObj, theName, "fillet")
8929 ## Perform a fillet at the specified vertices of the given face/shell.
8930 # @param theShape Face or Shell shape to perform fillet on.
8931 # @param theR Fillet radius.
8932 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8933 # @param theName Object name; when specified, this parameter is used
8934 # for result publication in the study. Otherwise, if automatic
8935 # publication is switched on, default value is used for result name.
8937 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8939 # @return New GEOM.GEOM_Object, containing the result shape.
8941 # @ref tui_fillet2d "Example"
8942 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8944 Perform a fillet at the specified vertices of the given face/shell.
8947 theShape Face or Shell shape to perform fillet on.
8949 theListOfVertexes Global indices of vertexes to perform fillet on.
8950 theName Object name; when specified, this parameter is used
8951 for result publication in the study. Otherwise, if automatic
8952 publication is switched on, default value is used for result name.
8954 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8957 New GEOM.GEOM_Object, containing the result shape.
8960 face = geompy.MakeFaceHW(100, 100, 1)
8961 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8963 # Example: see GEOM_TestAll.py
8964 theR,Parameters = ParseParameters(theR)
8965 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8966 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8967 anObj.SetParameters(Parameters)
8968 self._autoPublish(anObj, theName, "fillet")
8971 ## Perform a symmetric chamfer on all edges of the given shape.
8972 # @param theShape Shape, to perform chamfer on.
8973 # @param theD Chamfer size along each face.
8974 # @param theName Object name; when specified, this parameter is used
8975 # for result publication in the study. Otherwise, if automatic
8976 # publication is switched on, default value is used for result name.
8978 # @return New GEOM.GEOM_Object, containing the result shape.
8980 # @ref tui_chamfer "Example 1"
8981 # \n @ref swig_MakeChamferAll "Example 2"
8982 def MakeChamferAll(self, theShape, theD, theName=None):
8984 Perform a symmetric chamfer on all edges of the given shape.
8987 theShape Shape, to perform chamfer on.
8988 theD Chamfer size along each face.
8989 theName Object name; when specified, this parameter is used
8990 for result publication in the study. Otherwise, if automatic
8991 publication is switched on, default value is used for result name.
8994 New GEOM.GEOM_Object, containing the result shape.
8997 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8999 # Example: see GEOM_TestOthers.py
9000 theD,Parameters = ParseParameters(theD)
9001 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9002 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9003 anObj.SetParameters(Parameters)
9004 self._autoPublish(anObj, theName, "chamfer")
9007 ## Perform a chamfer on edges, common to the specified faces,
9008 # with distance D1 on the Face1
9009 # @param theShape Shape, to perform chamfer on.
9010 # @param theD1 Chamfer size along \a theFace1.
9011 # @param theD2 Chamfer size along \a theFace2.
9012 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9013 # @param theName Object name; when specified, this parameter is used
9014 # for result publication in the study. Otherwise, if automatic
9015 # publication is switched on, default value is used for result name.
9017 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9019 # @return New GEOM.GEOM_Object, containing the result shape.
9021 # @ref tui_chamfer "Example"
9022 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9024 Perform a chamfer on edges, common to the specified faces,
9025 with distance D1 on the Face1
9028 theShape Shape, to perform chamfer on.
9029 theD1 Chamfer size along theFace1.
9030 theD2 Chamfer size along theFace2.
9031 theFace1,theFace2 Global indices of two faces of theShape.
9032 theName Object name; when specified, this parameter is used
9033 for result publication in the study. Otherwise, if automatic
9034 publication is switched on, default value is used for result name.
9037 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9040 New GEOM.GEOM_Object, containing the result shape.
9043 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9044 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9045 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9046 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9048 # Example: see GEOM_TestAll.py
9049 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9050 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9051 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9052 anObj.SetParameters(Parameters)
9053 self._autoPublish(anObj, theName, "chamfer")
9056 ## Perform a chamfer on edges
9057 # @param theShape Shape, to perform chamfer on.
9058 # @param theD Chamfer length
9059 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9060 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9061 # @param theName Object name; when specified, this parameter is used
9062 # for result publication in the study. Otherwise, if automatic
9063 # publication is switched on, default value is used for result name.
9065 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9067 # @return New GEOM.GEOM_Object, containing the result shape.
9068 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9070 Perform a chamfer on edges
9073 theShape Shape, to perform chamfer on.
9074 theD1 Chamfer size along theFace1.
9075 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9076 theFace1,theFace2 Global indices of two faces of theShape.
9077 theName Object name; when specified, this parameter is used
9078 for result publication in the study. Otherwise, if automatic
9079 publication is switched on, default value is used for result name.
9082 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9085 New GEOM.GEOM_Object, containing the result shape.
9088 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9089 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9090 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9092 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9095 if isinstance(theAngle,str):
9097 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9099 theAngle = theAngle*math.pi/180.0
9100 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9101 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9102 anObj.SetParameters(Parameters)
9103 self._autoPublish(anObj, theName, "chamfer")
9106 ## Perform a chamfer on all edges of the specified faces,
9107 # with distance D1 on the first specified face (if several for one edge)
9108 # @param theShape Shape, to perform chamfer on.
9109 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9110 # connected to the edge, are in \a theFaces, \a theD1
9111 # will be get along face, which is nearer to \a theFaces beginning.
9112 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9113 # @param theFaces Sequence of global indices of faces of \a theShape.
9114 # @param theName Object name; when specified, this parameter is used
9115 # for result publication in the study. Otherwise, if automatic
9116 # publication is switched on, default value is used for result name.
9118 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9120 # @return New GEOM.GEOM_Object, containing the result shape.
9122 # @ref tui_chamfer "Example"
9123 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9125 Perform a chamfer on all edges of the specified faces,
9126 with distance D1 on the first specified face (if several for one edge)
9129 theShape Shape, to perform chamfer on.
9130 theD1 Chamfer size along face from theFaces. If both faces,
9131 connected to the edge, are in theFaces, theD1
9132 will be get along face, which is nearer to theFaces beginning.
9133 theD2 Chamfer size along another of two faces, connected to the edge.
9134 theFaces Sequence of global indices of faces of theShape.
9135 theName Object name; when specified, this parameter is used
9136 for result publication in the study. Otherwise, if automatic
9137 publication is switched on, default value is used for result name.
9139 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9142 New GEOM.GEOM_Object, containing the result shape.
9144 # Example: see GEOM_TestAll.py
9145 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9146 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9147 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9148 anObj.SetParameters(Parameters)
9149 self._autoPublish(anObj, theName, "chamfer")
9152 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9153 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9155 # @ref swig_FilletChamfer "Example"
9156 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9158 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9159 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9162 if isinstance(theAngle,str):
9164 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9166 theAngle = theAngle*math.pi/180.0
9167 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9168 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9169 anObj.SetParameters(Parameters)
9170 self._autoPublish(anObj, theName, "chamfer")
9173 ## Perform a chamfer on edges,
9174 # with distance D1 on the first specified face (if several for one edge)
9175 # @param theShape Shape, to perform chamfer on.
9176 # @param theD1,theD2 Chamfer size
9177 # @param theEdges Sequence of edges of \a theShape.
9178 # @param theName Object name; when specified, this parameter is used
9179 # for result publication in the study. Otherwise, if automatic
9180 # publication is switched on, default value is used for result name.
9182 # @return New GEOM.GEOM_Object, containing the result shape.
9184 # @ref swig_FilletChamfer "Example"
9185 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9187 Perform a chamfer on edges,
9188 with distance D1 on the first specified face (if several for one edge)
9191 theShape Shape, to perform chamfer on.
9192 theD1,theD2 Chamfer size
9193 theEdges Sequence of edges of theShape.
9194 theName Object name; when specified, this parameter is used
9195 for result publication in the study. Otherwise, if automatic
9196 publication is switched on, default value is used for result name.
9199 New GEOM.GEOM_Object, containing the result shape.
9201 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9202 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9203 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9204 anObj.SetParameters(Parameters)
9205 self._autoPublish(anObj, theName, "chamfer")
9208 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9209 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9210 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9212 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9213 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9216 if isinstance(theAngle,str):
9218 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9220 theAngle = theAngle*math.pi/180.0
9221 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9222 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9223 anObj.SetParameters(Parameters)
9224 self._autoPublish(anObj, theName, "chamfer")
9227 ## @sa MakeChamferEdge(), MakeChamferFaces()
9229 # @ref swig_MakeChamfer "Example"
9230 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9232 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9234 # Example: see GEOM_TestOthers.py
9236 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9237 if aShapeType == self.ShapeType["EDGE"]:
9238 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9240 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9243 ## Remove material from a solid by extrusion of the base shape on the given distance.
9244 # @param theInit Shape to remove material from. It must be a solid or
9245 # a compound made of a single solid.
9246 # @param theBase Closed edge or wire defining the base shape to be extruded.
9247 # @param theH Prism dimension along the normal to theBase
9248 # @param theAngle Draft angle in degrees.
9249 # @param theName Object name; when specified, this parameter is used
9250 # for result publication in the study. Otherwise, if automatic
9251 # publication is switched on, default value is used for result name.
9253 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9255 # @ref tui_creation_prism "Example"
9256 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9258 Add material to a solid by extrusion of the base shape on the given distance.
9261 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9262 theBase Closed edge or wire defining the base shape to be extruded.
9263 theH Prism dimension along the normal to theBase
9264 theAngle Draft angle in degrees.
9265 theName Object name; when specified, this parameter is used
9266 for result publication in the study. Otherwise, if automatic
9267 publication is switched on, default value is used for result name.
9270 New GEOM.GEOM_Object, containing the initial shape with removed material.
9272 # Example: see GEOM_TestAll.py
9273 #theH,Parameters = ParseParameters(theH)
9274 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9275 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9276 #anObj.SetParameters(Parameters)
9277 self._autoPublish(anObj, theName, "extrudedCut")
9280 ## Add material to a solid by extrusion of the base shape on the given distance.
9281 # @param theInit Shape to add material to. It must be a solid or
9282 # a compound made of a single solid.
9283 # @param theBase Closed edge or wire defining the base shape to be extruded.
9284 # @param theH Prism dimension along the normal to theBase
9285 # @param theAngle Draft angle in degrees.
9286 # @param theName Object name; when specified, this parameter is used
9287 # for result publication in the study. Otherwise, if automatic
9288 # publication is switched on, default value is used for result name.
9290 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9292 # @ref tui_creation_prism "Example"
9293 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9295 Add material to a solid by extrusion of the base shape on the given distance.
9298 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9299 theBase Closed edge or wire defining the base shape to be extruded.
9300 theH Prism dimension along the normal to theBase
9301 theAngle Draft angle in degrees.
9302 theName Object name; when specified, this parameter is used
9303 for result publication in the study. Otherwise, if automatic
9304 publication is switched on, default value is used for result name.
9307 New GEOM.GEOM_Object, containing the initial shape with added material.
9309 # Example: see GEOM_TestAll.py
9310 #theH,Parameters = ParseParameters(theH)
9311 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9312 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9313 #anObj.SetParameters(Parameters)
9314 self._autoPublish(anObj, theName, "extrudedBoss")
9320 ## @addtogroup l3_basic_op
9323 ## Perform an Archimde operation on the given shape with given parameters.
9324 # The object presenting the resulting face is returned.
9325 # @param theShape Shape to be put in water.
9326 # @param theWeight Weight og the shape.
9327 # @param theWaterDensity Density of the water.
9328 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9329 # @param theName Object name; when specified, this parameter is used
9330 # for result publication in the study. Otherwise, if automatic
9331 # publication is switched on, default value is used for result name.
9333 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9334 # by a plane, corresponding to water level.
9336 # @ref tui_archimede "Example"
9337 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9339 Perform an Archimde operation on the given shape with given parameters.
9340 The object presenting the resulting face is returned.
9343 theShape Shape to be put in water.
9344 theWeight Weight og the shape.
9345 theWaterDensity Density of the water.
9346 theMeshDeflection Deflection of the mesh, using to compute the section.
9347 theName Object name; when specified, this parameter is used
9348 for result publication in the study. Otherwise, if automatic
9349 publication is switched on, default value is used for result name.
9352 New GEOM.GEOM_Object, containing a section of theShape
9353 by a plane, corresponding to water level.
9355 # Example: see GEOM_TestAll.py
9356 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9357 theWeight,theWaterDensity,theMeshDeflection)
9358 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9359 RaiseIfFailed("MakeArchimede", self.LocalOp)
9360 anObj.SetParameters(Parameters)
9361 self._autoPublish(anObj, theName, "archimede")
9364 # end of l3_basic_op
9367 ## @addtogroup l2_measure
9370 ## Get point coordinates
9373 # @ref tui_measurement_tools_page "Example"
9374 def PointCoordinates(self,Point):
9376 Get point coordinates
9381 # Example: see GEOM_TestMeasures.py
9382 aTuple = self.MeasuOp.PointCoordinates(Point)
9383 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9386 ## Get vector coordinates
9389 # @ref tui_measurement_tools_page "Example"
9390 def VectorCoordinates(self,Vector):
9392 Get vector coordinates
9398 p1=self.GetFirstVertex(Vector)
9399 p2=self.GetLastVertex(Vector)
9401 X1=self.PointCoordinates(p1)
9402 X2=self.PointCoordinates(p2)
9404 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9407 ## Compute cross product
9408 # @return vector w=u^v
9410 # @ref tui_measurement_tools_page "Example"
9411 def CrossProduct(self, Vector1, Vector2):
9413 Compute cross product
9415 Returns: vector w=u^v
9417 u=self.VectorCoordinates(Vector1)
9418 v=self.VectorCoordinates(Vector2)
9419 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])
9423 ## Compute cross product
9424 # @return dot product p=u.v
9426 # @ref tui_measurement_tools_page "Example"
9427 def DotProduct(self, Vector1, Vector2):
9429 Compute cross product
9431 Returns: dot product p=u.v
9433 u=self.VectorCoordinates(Vector1)
9434 v=self.VectorCoordinates(Vector2)
9435 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9440 ## Get summarized length of all wires,
9441 # area of surface and volume of the given shape.
9442 # @param theShape Shape to define properties of.
9443 # @return [theLength, theSurfArea, theVolume]\n
9444 # theLength: Summarized length of all wires of the given shape.\n
9445 # theSurfArea: Area of surface of the given shape.\n
9446 # theVolume: Volume of the given shape.
9448 # @ref tui_measurement_tools_page "Example"
9449 def BasicProperties(self,theShape):
9451 Get summarized length of all wires,
9452 area of surface and volume of the given shape.
9455 theShape Shape to define properties of.
9458 [theLength, theSurfArea, theVolume]
9459 theLength: Summarized length of all wires of the given shape.
9460 theSurfArea: Area of surface of the given shape.
9461 theVolume: Volume of the given shape.
9463 # Example: see GEOM_TestMeasures.py
9464 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9465 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9468 ## Get parameters of bounding box of the given shape
9469 # @param theShape Shape to obtain bounding box of.
9470 # @param precise TRUE for precise computation; FALSE for fast one.
9471 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9472 # Xmin,Xmax: Limits of shape along OX axis.
9473 # Ymin,Ymax: Limits of shape along OY axis.
9474 # Zmin,Zmax: Limits of shape along OZ axis.
9476 # @ref tui_measurement_tools_page "Example"
9477 def BoundingBox (self, theShape, precise=False):
9479 Get parameters of bounding box of the given shape
9482 theShape Shape to obtain bounding box of.
9483 precise TRUE for precise computation; FALSE for fast one.
9486 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9487 Xmin,Xmax: Limits of shape along OX axis.
9488 Ymin,Ymax: Limits of shape along OY axis.
9489 Zmin,Zmax: Limits of shape along OZ axis.
9491 # Example: see GEOM_TestMeasures.py
9492 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9493 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9496 ## Get bounding box of the given shape
9497 # @param theShape Shape to obtain bounding box of.
9498 # @param precise TRUE for precise computation; FALSE for fast one.
9499 # @param theName Object name; when specified, this parameter is used
9500 # for result publication in the study. Otherwise, if automatic
9501 # publication is switched on, default value is used for result name.
9503 # @return New GEOM.GEOM_Object, containing the created box.
9505 # @ref tui_measurement_tools_page "Example"
9506 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9508 Get bounding box of the given shape
9511 theShape Shape to obtain bounding box of.
9512 precise TRUE for precise computation; FALSE for fast one.
9513 theName Object name; when specified, this parameter is used
9514 for result publication in the study. Otherwise, if automatic
9515 publication is switched on, default value is used for result name.
9518 New GEOM.GEOM_Object, containing the created box.
9520 # Example: see GEOM_TestMeasures.py
9521 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9522 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9523 self._autoPublish(anObj, theName, "bndbox")
9526 ## Get inertia matrix and moments of inertia of theShape.
9527 # @param theShape Shape to calculate inertia of.
9528 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9529 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9530 # Ix,Iy,Iz: Moments of inertia of the given shape.
9532 # @ref tui_measurement_tools_page "Example"
9533 def Inertia(self,theShape):
9535 Get inertia matrix and moments of inertia of theShape.
9538 theShape Shape to calculate inertia of.
9541 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9542 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9543 Ix,Iy,Iz: Moments of inertia of the given shape.
9545 # Example: see GEOM_TestMeasures.py
9546 aTuple = self.MeasuOp.GetInertia(theShape)
9547 RaiseIfFailed("GetInertia", self.MeasuOp)
9550 ## Get if coords are included in the shape (ST_IN or ST_ON)
9551 # @param theShape Shape
9552 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9553 # @param tolerance to be used (default is 1.0e-7)
9554 # @return list_of_boolean = [res1, res2, ...]
9555 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9557 Get if coords are included in the shape (ST_IN or ST_ON)
9561 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9562 tolerance to be used (default is 1.0e-7)
9565 list_of_boolean = [res1, res2, ...]
9567 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9569 ## Get minimal distance between the given shapes.
9570 # @param theShape1,theShape2 Shapes to find minimal distance between.
9571 # @return Value of the minimal distance between the given shapes.
9573 # @ref tui_measurement_tools_page "Example"
9574 def MinDistance(self, theShape1, theShape2):
9576 Get minimal distance between the given shapes.
9579 theShape1,theShape2 Shapes to find minimal distance between.
9582 Value of the minimal distance between the given shapes.
9584 # Example: see GEOM_TestMeasures.py
9585 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9586 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9589 ## Get minimal distance between the given shapes.
9590 # @param theShape1,theShape2 Shapes to find minimal distance between.
9591 # @return Value of the minimal distance between the given shapes, in form of list
9592 # [Distance, DX, DY, DZ].
9594 # @ref swig_all_measure "Example"
9595 def MinDistanceComponents(self, theShape1, theShape2):
9597 Get minimal distance between the given shapes.
9600 theShape1,theShape2 Shapes to find minimal distance between.
9603 Value of the minimal distance between the given shapes, in form of list
9604 [Distance, DX, DY, DZ]
9606 # Example: see GEOM_TestMeasures.py
9607 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9608 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9609 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9612 ## Get closest points of the given shapes.
9613 # @param theShape1,theShape2 Shapes to find closest points of.
9614 # @return The number of found solutions (-1 in case of infinite number of
9615 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9617 # @ref tui_measurement_tools_page "Example"
9618 def ClosestPoints (self, theShape1, theShape2):
9620 Get closest points of the given shapes.
9623 theShape1,theShape2 Shapes to find closest points of.
9626 The number of found solutions (-1 in case of infinite number of
9627 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9629 # Example: see GEOM_TestMeasures.py
9630 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9631 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9634 ## Get angle between the given shapes in degrees.
9635 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9636 # @note If both arguments are vectors, the angle is computed in accordance
9637 # with their orientations, otherwise the minimum angle is computed.
9638 # @return Value of the angle between the given shapes in degrees.
9640 # @ref tui_measurement_tools_page "Example"
9641 def GetAngle(self, theShape1, theShape2):
9643 Get angle between the given shapes in degrees.
9646 theShape1,theShape2 Lines or linear edges to find angle between.
9649 If both arguments are vectors, the angle is computed in accordance
9650 with their orientations, otherwise the minimum angle is computed.
9653 Value of the angle between the given shapes in degrees.
9655 # Example: see GEOM_TestMeasures.py
9656 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9657 RaiseIfFailed("GetAngle", self.MeasuOp)
9660 ## Get angle between the given shapes in radians.
9661 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9662 # @note If both arguments are vectors, the angle is computed in accordance
9663 # with their orientations, otherwise the minimum angle is computed.
9664 # @return Value of the angle between the given shapes in radians.
9666 # @ref tui_measurement_tools_page "Example"
9667 def GetAngleRadians(self, theShape1, theShape2):
9669 Get angle between the given shapes in radians.
9672 theShape1,theShape2 Lines or linear edges to find angle between.
9676 If both arguments are vectors, the angle is computed in accordance
9677 with their orientations, otherwise the minimum angle is computed.
9680 Value of the angle between the given shapes in radians.
9682 # Example: see GEOM_TestMeasures.py
9683 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9684 RaiseIfFailed("GetAngle", self.MeasuOp)
9687 ## Get angle between the given vectors in degrees.
9688 # @param theShape1,theShape2 Vectors to find angle between.
9689 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9690 # if False, the opposite vector to the normal vector is used.
9691 # @return Value of the angle between the given vectors in degrees.
9693 # @ref tui_measurement_tools_page "Example"
9694 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9696 Get angle between the given vectors in degrees.
9699 theShape1,theShape2 Vectors to find angle between.
9700 theFlag If True, the normal vector is defined by the two vectors cross,
9701 if False, the opposite vector to the normal vector is used.
9704 Value of the angle between the given vectors in degrees.
9706 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9708 anAngle = 360. - anAngle
9709 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9712 ## The same as GetAngleVectors, but the result is in radians.
9713 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9715 Get angle between the given vectors in radians.
9718 theShape1,theShape2 Vectors to find angle between.
9719 theFlag If True, the normal vector is defined by the two vectors cross,
9720 if False, the opposite vector to the normal vector is used.
9723 Value of the angle between the given vectors in radians.
9725 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9728 ## @name Curve Curvature Measurement
9729 # Methods for receiving radius of curvature of curves
9730 # in the given point
9733 ## Measure curvature of a curve at a point, set by parameter.
9734 # @param theCurve a curve.
9735 # @param theParam parameter.
9736 # @return radius of curvature of \a theCurve.
9738 # @ref swig_todo "Example"
9739 def CurveCurvatureByParam(self, theCurve, theParam):
9741 Measure curvature of a curve at a point, set by parameter.
9748 radius of curvature of theCurve.
9750 # Example: see GEOM_TestMeasures.py
9751 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9752 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9755 ## Measure curvature of a curve at a point.
9756 # @param theCurve a curve.
9757 # @param thePoint given point.
9758 # @return radius of curvature of \a theCurve.
9760 # @ref swig_todo "Example"
9761 def CurveCurvatureByPoint(self, theCurve, thePoint):
9763 Measure curvature of a curve at a point.
9767 thePoint given point.
9770 radius of curvature of theCurve.
9772 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9773 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9777 ## @name Surface Curvature Measurement
9778 # Methods for receiving max and min radius of curvature of surfaces
9779 # in the given point
9782 ## Measure max radius of curvature of surface.
9783 # @param theSurf the given surface.
9784 # @param theUParam Value of U-parameter on the referenced surface.
9785 # @param theVParam Value of V-parameter on the referenced surface.
9786 # @return max radius of curvature of theSurf.
9788 ## @ref swig_todo "Example"
9789 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9791 Measure max radius of curvature of surface.
9794 theSurf the given surface.
9795 theUParam Value of U-parameter on the referenced surface.
9796 theVParam Value of V-parameter on the referenced surface.
9799 max radius of curvature of theSurf.
9801 # Example: see GEOM_TestMeasures.py
9802 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9803 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9806 ## Measure max radius of curvature of surface in the given point
9807 # @param theSurf the given surface.
9808 # @param thePoint given point.
9809 # @return max radius of curvature of theSurf.
9811 ## @ref swig_todo "Example"
9812 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9814 Measure max radius of curvature of surface in the given point.
9817 theSurf the given surface.
9818 thePoint given point.
9821 max radius of curvature of theSurf.
9823 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9824 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9827 ## Measure min radius of curvature of surface.
9828 # @param theSurf the given surface.
9829 # @param theUParam Value of U-parameter on the referenced surface.
9830 # @param theVParam Value of V-parameter on the referenced surface.
9831 # @return min radius of curvature of theSurf.
9833 ## @ref swig_todo "Example"
9834 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9836 Measure min radius of curvature of surface.
9839 theSurf the given surface.
9840 theUParam Value of U-parameter on the referenced surface.
9841 theVParam Value of V-parameter on the referenced surface.
9844 Min radius of curvature of theSurf.
9846 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9847 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9850 ## Measure min radius of curvature of surface in the given point
9851 # @param theSurf the given surface.
9852 # @param thePoint given point.
9853 # @return min radius of curvature of theSurf.
9855 ## @ref swig_todo "Example"
9856 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9858 Measure min radius of curvature of surface in the given point.
9861 theSurf the given surface.
9862 thePoint given point.
9865 Min radius of curvature of theSurf.
9867 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9868 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9872 ## Get min and max tolerances of sub-shapes of theShape
9873 # @param theShape Shape, to get tolerances of.
9874 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9875 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9876 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9877 # VertMin,VertMax: Min and max tolerances of the vertices.
9879 # @ref tui_measurement_tools_page "Example"
9880 def Tolerance(self,theShape):
9882 Get min and max tolerances of sub-shapes of theShape
9885 theShape Shape, to get tolerances of.
9888 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9889 FaceMin,FaceMax: Min and max tolerances of the faces.
9890 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9891 VertMin,VertMax: Min and max tolerances of the vertices.
9893 # Example: see GEOM_TestMeasures.py
9894 aTuple = self.MeasuOp.GetTolerance(theShape)
9895 RaiseIfFailed("GetTolerance", self.MeasuOp)
9898 ## Obtain description of the given shape (number of sub-shapes of each type)
9899 # @param theShape Shape to be described.
9900 # @return Description of the given shape.
9902 # @ref tui_measurement_tools_page "Example"
9903 def WhatIs(self,theShape):
9905 Obtain description of the given shape (number of sub-shapes of each type)
9908 theShape Shape to be described.
9911 Description of the given shape.
9913 # Example: see GEOM_TestMeasures.py
9914 aDescr = self.MeasuOp.WhatIs(theShape)
9915 RaiseIfFailed("WhatIs", self.MeasuOp)
9918 ## Obtain quantity of shapes of the given type in \a theShape.
9919 # If \a theShape is of type \a theType, it is also counted.
9920 # @param theShape Shape to be described.
9921 # @param theType the given ShapeType().
9922 # @return Quantity of shapes of type \a theType in \a theShape.
9924 # @ref tui_measurement_tools_page "Example"
9925 def NbShapes (self, theShape, theType):
9927 Obtain quantity of shapes of the given type in theShape.
9928 If theShape is of type theType, it is also counted.
9931 theShape Shape to be described.
9932 theType the given geompy.ShapeType
9935 Quantity of shapes of type theType in theShape.
9937 # Example: see GEOM_TestMeasures.py
9938 listSh = self.SubShapeAllIDs(theShape, theType)
9942 ## Obtain quantity of shapes of each type in \a theShape.
9943 # The \a theShape is also counted.
9944 # @param theShape Shape to be described.
9945 # @return Dictionary of ShapeType() with bound quantities of shapes.
9947 # @ref tui_measurement_tools_page "Example"
9948 def ShapeInfo (self, theShape):
9950 Obtain quantity of shapes of each type in theShape.
9951 The theShape is also counted.
9954 theShape Shape to be described.
9957 Dictionary of geompy.ShapeType with bound quantities of shapes.
9959 # Example: see GEOM_TestMeasures.py
9961 for typeSh in self.ShapeType:
9962 if typeSh in ( "AUTO", "SHAPE" ): continue
9963 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9969 def GetCreationInformation(self, theShape):
9970 info = theShape.GetCreationInformation()
9972 opName = info.operationName
9973 if not opName: opName = "no info available"
9974 res = "Operation: " + opName
9976 for parVal in info.params:
9977 res += " \n %s = %s" % ( parVal.name, parVal.value )
9980 ## Get a point, situated at the centre of mass of theShape.
9981 # @param theShape Shape to define centre of mass of.
9982 # @param theName Object name; when specified, this parameter is used
9983 # for result publication in the study. Otherwise, if automatic
9984 # publication is switched on, default value is used for result name.
9986 # @return New GEOM.GEOM_Object, containing the created point.
9988 # @ref tui_measurement_tools_page "Example"
9989 def MakeCDG(self, theShape, theName=None):
9991 Get a point, situated at the centre of mass of theShape.
9994 theShape Shape to define centre of mass of.
9995 theName Object name; when specified, this parameter is used
9996 for result publication in the study. Otherwise, if automatic
9997 publication is switched on, default value is used for result name.
10000 New GEOM.GEOM_Object, containing the created point.
10002 # Example: see GEOM_TestMeasures.py
10003 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10004 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10005 self._autoPublish(anObj, theName, "centerOfMass")
10008 ## Get a vertex sub-shape by index depended with orientation.
10009 # @param theShape Shape to find sub-shape.
10010 # @param theIndex Index to find vertex by this index (starting from zero)
10011 # @param theName Object name; when specified, this parameter is used
10012 # for result publication in the study. Otherwise, if automatic
10013 # publication is switched on, default value is used for result name.
10015 # @return New GEOM.GEOM_Object, containing the created vertex.
10017 # @ref tui_measurement_tools_page "Example"
10018 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10020 Get a vertex sub-shape by index depended with orientation.
10023 theShape Shape to find sub-shape.
10024 theIndex Index to find vertex by this index (starting from zero)
10025 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.
10030 New GEOM.GEOM_Object, containing the created vertex.
10032 # Example: see GEOM_TestMeasures.py
10033 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10034 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10035 self._autoPublish(anObj, theName, "vertex")
10038 ## Get the first vertex of wire/edge depended orientation.
10039 # @param theShape Shape to find first vertex.
10040 # @param theName Object name; when specified, this parameter is used
10041 # for result publication in the study. Otherwise, if automatic
10042 # publication is switched on, default value is used for result name.
10044 # @return New GEOM.GEOM_Object, containing the created vertex.
10046 # @ref tui_measurement_tools_page "Example"
10047 def GetFirstVertex(self, theShape, theName=None):
10049 Get the first vertex of wire/edge depended orientation.
10052 theShape Shape to find first vertex.
10053 theName Object name; when specified, this parameter is used
10054 for result publication in the study. Otherwise, if automatic
10055 publication is switched on, default value is used for result name.
10058 New GEOM.GEOM_Object, containing the created vertex.
10060 # Example: see GEOM_TestMeasures.py
10061 # note: auto-publishing is done in self.GetVertexByIndex()
10062 anObj = self.GetVertexByIndex(theShape, 0, theName)
10063 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
10066 ## Get the last vertex of wire/edge depended orientation.
10067 # @param theShape Shape to find last vertex.
10068 # @param theName Object name; when specified, this parameter is used
10069 # for result publication in the study. Otherwise, if automatic
10070 # publication is switched on, default value is used for result name.
10072 # @return New GEOM.GEOM_Object, containing the created vertex.
10074 # @ref tui_measurement_tools_page "Example"
10075 def GetLastVertex(self, theShape, theName=None):
10077 Get the last vertex of wire/edge depended orientation.
10080 theShape Shape to find last vertex.
10081 theName Object name; when specified, this parameter is used
10082 for result publication in the study. Otherwise, if automatic
10083 publication is switched on, default value is used for result name.
10086 New GEOM.GEOM_Object, containing the created vertex.
10088 # Example: see GEOM_TestMeasures.py
10089 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10090 # note: auto-publishing is done in self.GetVertexByIndex()
10091 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10092 RaiseIfFailed("GetLastVertex", self.MeasuOp)
10095 ## Get a normale to the given face. If the point is not given,
10096 # the normale is calculated at the center of mass.
10097 # @param theFace Face to define normale of.
10098 # @param theOptionalPoint Point to compute the normale at.
10099 # @param theName Object name; when specified, this parameter is used
10100 # for result publication in the study. Otherwise, if automatic
10101 # publication is switched on, default value is used for result name.
10103 # @return New GEOM.GEOM_Object, containing the created vector.
10105 # @ref swig_todo "Example"
10106 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10108 Get a normale to the given face. If the point is not given,
10109 the normale is calculated at the center of mass.
10112 theFace Face to define normale of.
10113 theOptionalPoint Point to compute the normale at.
10114 theName Object name; when specified, this parameter is used
10115 for result publication in the study. Otherwise, if automatic
10116 publication is switched on, default value is used for result name.
10119 New GEOM.GEOM_Object, containing the created vector.
10121 # Example: see GEOM_TestMeasures.py
10122 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10123 RaiseIfFailed("GetNormal", self.MeasuOp)
10124 self._autoPublish(anObj, theName, "normal")
10127 ## Check a topology of the given shape.
10128 # @param theShape Shape to check validity of.
10129 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10130 # if TRUE, the shape's geometry will be checked also.
10131 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
10132 # of problem is printed.
10133 # if TRUE and if theShape is invalid, the description
10134 # of problem is also returned.
10135 # @return TRUE, if the shape "seems to be valid".
10137 # @ref tui_measurement_tools_page "Example"
10138 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10140 Check a topology of the given shape.
10143 theShape Shape to check validity of.
10144 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10145 if TRUE, the shape's geometry will be checked also.
10146 theReturnStatus If FALSE and if theShape is invalid, a description
10147 of problem is printed.
10148 if TRUE and if theShape is invalid, the description
10149 of problem is returned.
10152 TRUE, if the shape "seems to be valid".
10153 If theShape is invalid, prints a description of problem.
10154 This description can also be returned.
10156 # Example: see GEOM_TestMeasures.py
10158 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10159 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10161 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
10162 RaiseIfFailed("CheckShape", self.MeasuOp)
10164 if theReturnStatus == 0:
10166 if theReturnStatus == 1:
10167 return (IsValid, Status)
10170 ## Detect self-intersections in the given shape.
10171 # @param theShape Shape to check.
10172 # @return TRUE, if the shape contains no self-intersections.
10174 # @ref tui_measurement_tools_page "Example"
10175 def CheckSelfIntersections(self, theShape):
10177 Detect self-intersections in the given shape.
10180 theShape Shape to check.
10183 TRUE, if the shape contains no self-intersections.
10185 # Example: see GEOM_TestMeasures.py
10186 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10187 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10190 ## Get position (LCS) of theShape.
10192 # Origin of the LCS is situated at the shape's center of mass.
10193 # Axes of the LCS are obtained from shape's location or,
10194 # if the shape is a planar face, from position of its plane.
10196 # @param theShape Shape to calculate position of.
10197 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10198 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10199 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10200 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10202 # @ref swig_todo "Example"
10203 def GetPosition(self,theShape):
10205 Get position (LCS) of theShape.
10206 Origin of the LCS is situated at the shape's center of mass.
10207 Axes of the LCS are obtained from shape's location or,
10208 if the shape is a planar face, from position of its plane.
10211 theShape Shape to calculate position of.
10214 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10215 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10216 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10217 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10219 # Example: see GEOM_TestMeasures.py
10220 aTuple = self.MeasuOp.GetPosition(theShape)
10221 RaiseIfFailed("GetPosition", self.MeasuOp)
10224 ## Get kind of theShape.
10226 # @param theShape Shape to get a kind of.
10227 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10228 # and a list of parameters, describing the shape.
10229 # @note Concrete meaning of each value, returned via \a theIntegers
10230 # or \a theDoubles list depends on the kind() of the shape.
10232 # @ref swig_todo "Example"
10233 def KindOfShape(self,theShape):
10235 Get kind of theShape.
10238 theShape Shape to get a kind of.
10241 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10242 and a list of parameters, describing the shape.
10244 Concrete meaning of each value, returned via theIntegers
10245 or theDoubles list depends on the geompy.kind of the shape
10247 # Example: see GEOM_TestMeasures.py
10248 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10249 RaiseIfFailed("KindOfShape", self.MeasuOp)
10251 aKind = aRoughTuple[0]
10252 anInts = aRoughTuple[1]
10253 aDbls = aRoughTuple[2]
10255 # Now there is no exception from this rule:
10256 aKindTuple = [aKind] + aDbls + anInts
10258 # If they are we will regroup parameters for such kind of shape.
10260 #if aKind == kind.SOME_KIND:
10261 # # SOME_KIND int int double int double double
10262 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10266 # end of l2_measure
10269 ## @addtogroup l2_import_export
10272 ## Import a shape from the BREP or IGES or STEP file
10273 # (depends on given format) with given name.
10274 # @param theFileName The file, containing the shape.
10275 # @param theFormatName Specify format for the file reading.
10276 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10277 # If format 'IGES_SCALE' is used instead of 'IGES' or
10278 # format 'STEP_SCALE' is used instead of 'STEP',
10279 # length unit will be set to 'meter' and result model will be scaled.
10280 # @param theName Object name; when specified, this parameter is used
10281 # for result publication in the study. Otherwise, if automatic
10282 # publication is switched on, default value is used for result name.
10284 # @return New GEOM.GEOM_Object, containing the imported shape.
10285 # If material names are imported it returns the list of
10286 # objects. The first one is the imported object followed by
10288 # @note Auto publishing is allowed for the shape itself. Imported
10289 # material groups are not automatically published.
10291 # @ref swig_Import_Export "Example"
10292 def ImportFile(self, theFileName, theFormatName, theName=None):
10294 Import a shape from the BREP or IGES or STEP file
10295 (depends on given format) with given name.
10298 theFileName The file, containing the shape.
10299 theFormatName Specify format for the file reading.
10300 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10301 If format 'IGES_SCALE' is used instead of 'IGES' or
10302 format 'STEP_SCALE' is used instead of 'STEP',
10303 length unit will be set to 'meter' and result model will be scaled.
10304 theName Object name; when specified, this parameter is used
10305 for result publication in the study. Otherwise, if automatic
10306 publication is switched on, default value is used for result name.
10309 New GEOM.GEOM_Object, containing the imported shape.
10310 If material names are imported it returns the list of
10311 objects. The first one is the imported object followed by
10314 Auto publishing is allowed for the shape itself. Imported
10315 material groups are not automatically published.
10317 # Example: see GEOM_TestOthers.py
10318 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10319 RaiseIfFailed("ImportFile", self.InsertOp)
10320 aNbObj = len(aListObj)
10322 self._autoPublish(aListObj[0], theName, "imported")
10327 ## Deprecated analog of ImportFile()
10328 def Import(self, theFileName, theFormatName, theName=None):
10330 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10332 print "WARNING: Function Import is deprecated, use ImportFile instead"
10333 # note: auto-publishing is done in self.ImportFile()
10334 return self.ImportFile(theFileName, theFormatName, theName)
10336 ## Shortcut to ImportFile() for BREP format.
10337 # Import a shape from the BREP file with given name.
10338 # @param theFileName The file, containing the shape.
10339 # @param theName Object name; when specified, this parameter is used
10340 # for result publication in the study. Otherwise, if automatic
10341 # publication is switched on, default value is used for result name.
10343 # @return New GEOM.GEOM_Object, containing the imported shape.
10345 # @ref swig_Import_Export "Example"
10346 def ImportBREP(self, theFileName, theName=None):
10348 geompy.ImportFile(...) function for BREP format
10349 Import a shape from the BREP file with given name.
10352 theFileName The file, containing the shape.
10353 theName Object name; when specified, this parameter is used
10354 for result publication in the study. Otherwise, if automatic
10355 publication is switched on, default value is used for result name.
10358 New GEOM.GEOM_Object, containing the imported shape.
10360 # Example: see GEOM_TestOthers.py
10361 # note: auto-publishing is done in self.ImportFile()
10362 return self.ImportFile(theFileName, "BREP", theName)
10364 ## Shortcut to ImportFile() for IGES format
10365 # Import a shape from the IGES file with given name.
10366 # @param theFileName The file, containing the shape.
10367 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10368 # and result model will be scaled, if its units are not meters.
10369 # If False (default), file length units will be taken into account.
10370 # @param theName Object name; when specified, this parameter is used
10371 # for result publication in the study. Otherwise, if automatic
10372 # publication is switched on, default value is used for result name.
10374 # @return New GEOM.GEOM_Object, containing the imported shape.
10376 # @ref swig_Import_Export "Example"
10377 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10379 geompy.ImportFile(...) function for IGES format
10382 theFileName The file, containing the shape.
10383 ignoreUnits If True, file length units will be ignored (set to 'meter')
10384 and result model will be scaled, if its units are not meters.
10385 If False (default), file length units will be taken into account.
10386 theName Object name; when specified, this parameter is used
10387 for result publication in the study. Otherwise, if automatic
10388 publication is switched on, default value is used for result name.
10391 New GEOM.GEOM_Object, containing the imported shape.
10393 # Example: see GEOM_TestOthers.py
10394 # note: auto-publishing is done in self.ImportFile()
10396 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10397 return self.ImportFile(theFileName, "IGES", theName)
10399 ## Return length unit from given IGES file
10400 # @param theFileName The file, containing the shape.
10401 # @return String, containing the units name.
10403 # @ref swig_Import_Export "Example"
10404 def GetIGESUnit(self, theFileName):
10406 Return length units from given IGES file
10409 theFileName The file, containing the shape.
10412 String, containing the units name.
10414 # Example: see GEOM_TestOthers.py
10415 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10418 ## Shortcut to ImportFile() for STEP format
10419 # Import a shape from the STEP file with given name.
10420 # @param theFileName The file, containing the shape.
10421 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10422 # and result model will be scaled, if its units are not meters.
10423 # If False (default), file length units will be taken into account.
10424 # @param theName Object name; when specified, this parameter is used
10425 # for result publication in the study. Otherwise, if automatic
10426 # publication is switched on, default value is used for result name.
10428 # @return New GEOM.GEOM_Object, containing the imported shape.
10429 # If material names are imported it returns the list of
10430 # objects. The first one is the imported object followed by
10432 # @note Auto publishing is allowed for the shape itself. Imported
10433 # material groups are not automatically published.
10435 # @ref swig_Import_Export "Example"
10436 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10438 geompy.ImportFile(...) function for STEP format
10441 theFileName The file, containing the shape.
10442 ignoreUnits If True, file length units will be ignored (set to 'meter')
10443 and result model will be scaled, if its units are not meters.
10444 If False (default), file length units will be taken into account.
10445 theName Object name; when specified, this parameter is used
10446 for result publication in the study. Otherwise, if automatic
10447 publication is switched on, default value is used for result name.
10450 New GEOM.GEOM_Object, containing the imported shape.
10451 If material names are imported it returns the list of
10452 objects. The first one is the imported object followed by
10455 Auto publishing is allowed for the shape itself. Imported
10456 material groups are not automatically published.
10458 # Example: see GEOM_TestOthers.py
10459 # note: auto-publishing is done in self.ImportFile()
10461 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10462 return self.ImportFile(theFileName, "STEP", theName)
10464 ## Return length unit from given IGES or STEP file
10465 # @param theFileName The file, containing the shape.
10466 # @return String, containing the units name.
10468 # @ref swig_Import_Export "Example"
10469 def GetSTEPUnit(self, theFileName):
10471 Return length units from given STEP file
10474 theFileName The file, containing the shape.
10477 String, containing the units name.
10479 # Example: see GEOM_TestOthers.py
10480 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10483 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10484 # @note This method will not be dumped to the python script by DumpStudy functionality.
10485 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10486 # @param theStream The BRep binary stream.
10487 # @param theName Object name; when specified, this parameter is used
10488 # for result publication in the study. Otherwise, if automatic
10489 # publication is switched on, default value is used for result name.
10491 # @return New GEOM_Object, containing the shape, read from theStream.
10493 # @ref swig_Import_Export "Example"
10494 def RestoreShape (self, theStream, theName=None):
10496 Read a shape from the binary stream, containing its bounding representation (BRep).
10499 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10502 theStream The BRep binary stream.
10503 theName Object name; when specified, this parameter is used
10504 for result publication in the study. Otherwise, if automatic
10505 publication is switched on, default value is used for result name.
10508 New GEOM_Object, containing the shape, read from theStream.
10510 # Example: see GEOM_TestOthers.py
10511 anObj = self.InsertOp.RestoreShape(theStream)
10512 RaiseIfFailed("RestoreShape", self.InsertOp)
10513 self._autoPublish(anObj, theName, "restored")
10516 ## Export the given shape into a file with given name.
10517 # @param theObject Shape to be stored in the file.
10518 # @param theFileName Name of the file to store the given shape in.
10519 # @param theFormatName Specify format for the shape storage.
10520 # Available formats can be obtained with
10521 # geompy.InsertOp.ExportTranslators()[0] method.
10523 # @ref swig_Import_Export "Example"
10524 def Export(self, theObject, theFileName, theFormatName):
10526 Export the given shape into a file with given name.
10529 theObject Shape to be stored in the file.
10530 theFileName Name of the file to store the given shape in.
10531 theFormatName Specify format for the shape storage.
10532 Available formats can be obtained with
10533 geompy.InsertOp.ExportTranslators()[0] method.
10535 # Example: see GEOM_TestOthers.py
10536 self.InsertOp.Export(theObject, theFileName, theFormatName)
10537 if self.InsertOp.IsDone() == 0:
10538 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10542 ## Shortcut to Export() for BREP format
10544 # @ref swig_Import_Export "Example"
10545 def ExportBREP(self,theObject, theFileName):
10547 geompy.Export(...) function for BREP format
10549 # Example: see GEOM_TestOthers.py
10550 return self.Export(theObject, theFileName, "BREP")
10552 ## Shortcut to Export() for IGES format
10554 # @ref swig_Import_Export "Example"
10555 def ExportIGES(self,theObject, theFileName):
10557 geompy.Export(...) function for IGES format
10559 # Example: see GEOM_TestOthers.py
10560 return self.Export(theObject, theFileName, "IGES")
10562 ## Shortcut to Export() for STEP format
10564 # @ref swig_Import_Export "Example"
10565 def ExportSTEP(self,theObject, theFileName):
10567 geompy.Export(...) function for STEP format
10569 # Example: see GEOM_TestOthers.py
10570 return self.Export(theObject, theFileName, "STEP")
10572 # end of l2_import_export
10575 ## @addtogroup l3_blocks
10578 ## Create a quadrangle face from four edges. Order of Edges is not
10579 # important. It is not necessary that edges share the same vertex.
10580 # @param E1,E2,E3,E4 Edges for the face bound.
10581 # @param theName Object name; when specified, this parameter is used
10582 # for result publication in the study. Otherwise, if automatic
10583 # publication is switched on, default value is used for result name.
10585 # @return New GEOM.GEOM_Object, containing the created face.
10587 # @ref tui_building_by_blocks_page "Example"
10588 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10590 Create a quadrangle face from four edges. Order of Edges is not
10591 important. It is not necessary that edges share the same vertex.
10594 E1,E2,E3,E4 Edges for the face bound.
10595 theName Object name; when specified, this parameter is used
10596 for result publication in the study. Otherwise, if automatic
10597 publication is switched on, default value is used for result name.
10600 New GEOM.GEOM_Object, containing the created face.
10603 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10605 # Example: see GEOM_Spanner.py
10606 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10607 RaiseIfFailed("MakeQuad", self.BlocksOp)
10608 self._autoPublish(anObj, theName, "quad")
10611 ## Create a quadrangle face on two edges.
10612 # The missing edges will be built by creating the shortest ones.
10613 # @param E1,E2 Two opposite edges for the face.
10614 # @param theName Object name; when specified, this parameter is used
10615 # for result publication in the study. Otherwise, if automatic
10616 # publication is switched on, default value is used for result name.
10618 # @return New GEOM.GEOM_Object, containing the created face.
10620 # @ref tui_building_by_blocks_page "Example"
10621 def MakeQuad2Edges(self, E1, E2, theName=None):
10623 Create a quadrangle face on two edges.
10624 The missing edges will be built by creating the shortest ones.
10627 E1,E2 Two opposite edges for the face.
10628 theName Object name; when specified, this parameter is used
10629 for result publication in the study. Otherwise, if automatic
10630 publication is switched on, default value is used for result name.
10633 New GEOM.GEOM_Object, containing the created face.
10637 p1 = geompy.MakeVertex( 0., 0., 0.)
10638 p2 = geompy.MakeVertex(150., 30., 0.)
10639 p3 = geompy.MakeVertex( 0., 120., 50.)
10640 p4 = geompy.MakeVertex( 0., 40., 70.)
10642 edge1 = geompy.MakeEdge(p1, p2)
10643 edge2 = geompy.MakeEdge(p3, p4)
10644 # create a quadrangle face from two edges
10645 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10647 # Example: see GEOM_Spanner.py
10648 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10649 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10650 self._autoPublish(anObj, theName, "quad")
10653 ## Create a quadrangle face with specified corners.
10654 # The missing edges will be built by creating the shortest ones.
10655 # @param V1,V2,V3,V4 Corner vertices for the face.
10656 # @param theName Object name; when specified, this parameter is used
10657 # for result publication in the study. Otherwise, if automatic
10658 # publication is switched on, default value is used for result name.
10660 # @return New GEOM.GEOM_Object, containing the created face.
10662 # @ref tui_building_by_blocks_page "Example 1"
10663 # \n @ref swig_MakeQuad4Vertices "Example 2"
10664 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10666 Create a quadrangle face with specified corners.
10667 The missing edges will be built by creating the shortest ones.
10670 V1,V2,V3,V4 Corner vertices for the face.
10671 theName Object name; when specified, this parameter is used
10672 for result publication in the study. Otherwise, if automatic
10673 publication is switched on, default value is used for result name.
10676 New GEOM.GEOM_Object, containing the created face.
10680 p1 = geompy.MakeVertex( 0., 0., 0.)
10681 p2 = geompy.MakeVertex(150., 30., 0.)
10682 p3 = geompy.MakeVertex( 0., 120., 50.)
10683 p4 = geompy.MakeVertex( 0., 40., 70.)
10684 # create a quadrangle from four points in its corners
10685 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10687 # Example: see GEOM_Spanner.py
10688 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10689 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10690 self._autoPublish(anObj, theName, "quad")
10693 ## Create a hexahedral solid, bounded by the six given faces. Order of
10694 # faces is not important. It is not necessary that Faces share the same edge.
10695 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10696 # @param theName Object name; when specified, this parameter is used
10697 # for result publication in the study. Otherwise, if automatic
10698 # publication is switched on, default value is used for result name.
10700 # @return New GEOM.GEOM_Object, containing the created solid.
10702 # @ref tui_building_by_blocks_page "Example 1"
10703 # \n @ref swig_MakeHexa "Example 2"
10704 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10706 Create a hexahedral solid, bounded by the six given faces. Order of
10707 faces is not important. It is not necessary that Faces share the same edge.
10710 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10711 theName Object name; when specified, this parameter is used
10712 for result publication in the study. Otherwise, if automatic
10713 publication is switched on, default value is used for result name.
10716 New GEOM.GEOM_Object, containing the created solid.
10719 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10721 # Example: see GEOM_Spanner.py
10722 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10723 RaiseIfFailed("MakeHexa", self.BlocksOp)
10724 self._autoPublish(anObj, theName, "hexa")
10727 ## Create a hexahedral solid between two given faces.
10728 # The missing faces will be built by creating the smallest ones.
10729 # @param F1,F2 Two opposite faces for the hexahedral solid.
10730 # @param theName Object name; when specified, this parameter is used
10731 # for result publication in the study. Otherwise, if automatic
10732 # publication is switched on, default value is used for result name.
10734 # @return New GEOM.GEOM_Object, containing the created solid.
10736 # @ref tui_building_by_blocks_page "Example 1"
10737 # \n @ref swig_MakeHexa2Faces "Example 2"
10738 def MakeHexa2Faces(self, F1, F2, theName=None):
10740 Create a hexahedral solid between two given faces.
10741 The missing faces will be built by creating the smallest ones.
10744 F1,F2 Two opposite faces for the hexahedral solid.
10745 theName Object name; when specified, this parameter is used
10746 for result publication in the study. Otherwise, if automatic
10747 publication is switched on, default value is used for result name.
10750 New GEOM.GEOM_Object, containing the created solid.
10753 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10755 # Example: see GEOM_Spanner.py
10756 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10757 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10758 self._autoPublish(anObj, theName, "hexa")
10764 ## @addtogroup l3_blocks_op
10767 ## Get a vertex, found in the given shape by its coordinates.
10768 # @param theShape Block or a compound of blocks.
10769 # @param theX,theY,theZ Coordinates of the sought vertex.
10770 # @param theEpsilon Maximum allowed distance between the resulting
10771 # vertex and point with the given coordinates.
10772 # @param theName Object name; when specified, this parameter is used
10773 # for result publication in the study. Otherwise, if automatic
10774 # publication is switched on, default value is used for result name.
10776 # @return New GEOM.GEOM_Object, containing the found vertex.
10778 # @ref swig_GetPoint "Example"
10779 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10781 Get a vertex, found in the given shape by its coordinates.
10784 theShape Block or a compound of blocks.
10785 theX,theY,theZ Coordinates of the sought vertex.
10786 theEpsilon Maximum allowed distance between the resulting
10787 vertex and point with the given coordinates.
10788 theName Object name; when specified, this parameter is used
10789 for result publication in the study. Otherwise, if automatic
10790 publication is switched on, default value is used for result name.
10793 New GEOM.GEOM_Object, containing the found vertex.
10796 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10798 # Example: see GEOM_TestOthers.py
10799 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10800 RaiseIfFailed("GetPoint", self.BlocksOp)
10801 self._autoPublish(anObj, theName, "vertex")
10804 ## Find a vertex of the given shape, which has minimal distance to the given point.
10805 # @param theShape Any shape.
10806 # @param thePoint Point, close to the desired vertex.
10807 # @param theName Object name; when specified, this parameter is used
10808 # for result publication in the study. Otherwise, if automatic
10809 # publication is switched on, default value is used for result name.
10811 # @return New GEOM.GEOM_Object, containing the found vertex.
10813 # @ref swig_GetVertexNearPoint "Example"
10814 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10816 Find a vertex of the given shape, which has minimal distance to the given point.
10819 theShape Any shape.
10820 thePoint Point, close to the desired vertex.
10821 theName Object name; when specified, this parameter is used
10822 for result publication in the study. Otherwise, if automatic
10823 publication is switched on, default value is used for result name.
10826 New GEOM.GEOM_Object, containing the found vertex.
10829 pmidle = geompy.MakeVertex(50, 0, 50)
10830 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10832 # Example: see GEOM_TestOthers.py
10833 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10834 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10835 self._autoPublish(anObj, theName, "vertex")
10838 ## Get an edge, found in the given shape by two given vertices.
10839 # @param theShape Block or a compound of blocks.
10840 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10841 # @param theName Object name; when specified, this parameter is used
10842 # for result publication in the study. Otherwise, if automatic
10843 # publication is switched on, default value is used for result name.
10845 # @return New GEOM.GEOM_Object, containing the found edge.
10847 # @ref swig_GetEdge "Example"
10848 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10850 Get an edge, found in the given shape by two given vertices.
10853 theShape Block or a compound of blocks.
10854 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10855 theName Object name; when specified, this parameter is used
10856 for result publication in the study. Otherwise, if automatic
10857 publication is switched on, default value is used for result name.
10860 New GEOM.GEOM_Object, containing the found edge.
10862 # Example: see GEOM_Spanner.py
10863 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10864 RaiseIfFailed("GetEdge", self.BlocksOp)
10865 self._autoPublish(anObj, theName, "edge")
10868 ## Find an edge of the given shape, which has minimal distance to the given point.
10869 # @param theShape Block or a compound of blocks.
10870 # @param thePoint Point, close to the desired edge.
10871 # @param theName Object name; when specified, this parameter is used
10872 # for result publication in the study. Otherwise, if automatic
10873 # publication is switched on, default value is used for result name.
10875 # @return New GEOM.GEOM_Object, containing the found edge.
10877 # @ref swig_GetEdgeNearPoint "Example"
10878 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10880 Find an edge of the given shape, which has minimal distance to the given point.
10883 theShape Block or a compound of blocks.
10884 thePoint Point, close to the desired edge.
10885 theName Object name; when specified, this parameter is used
10886 for result publication in the study. Otherwise, if automatic
10887 publication is switched on, default value is used for result name.
10890 New GEOM.GEOM_Object, containing the found edge.
10892 # Example: see GEOM_TestOthers.py
10893 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10894 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10895 self._autoPublish(anObj, theName, "edge")
10898 ## Returns a face, found in the given shape by four given corner vertices.
10899 # @param theShape Block or a compound of blocks.
10900 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10901 # @param theName Object name; when specified, this parameter is used
10902 # for result publication in the study. Otherwise, if automatic
10903 # publication is switched on, default value is used for result name.
10905 # @return New GEOM.GEOM_Object, containing the found face.
10907 # @ref swig_todo "Example"
10908 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10910 Returns a face, found in the given shape by four given corner vertices.
10913 theShape Block or a compound of blocks.
10914 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10915 theName Object name; when specified, this parameter is used
10916 for result publication in the study. Otherwise, if automatic
10917 publication is switched on, default value is used for result name.
10920 New GEOM.GEOM_Object, containing the found face.
10922 # Example: see GEOM_Spanner.py
10923 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10924 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10925 self._autoPublish(anObj, theName, "face")
10928 ## Get a face of block, found in the given shape by two given edges.
10929 # @param theShape Block or a compound of blocks.
10930 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10931 # @param theName Object name; when specified, this parameter is used
10932 # for result publication in the study. Otherwise, if automatic
10933 # publication is switched on, default value is used for result name.
10935 # @return New GEOM.GEOM_Object, containing the found face.
10937 # @ref swig_todo "Example"
10938 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10940 Get a face of block, found in the given shape by two given edges.
10943 theShape Block or a compound of blocks.
10944 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10945 theName Object name; when specified, this parameter is used
10946 for result publication in the study. Otherwise, if automatic
10947 publication is switched on, default value is used for result name.
10950 New GEOM.GEOM_Object, containing the found face.
10952 # Example: see GEOM_Spanner.py
10953 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10954 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10955 self._autoPublish(anObj, theName, "face")
10958 ## Find a face, opposite to the given one in the given block.
10959 # @param theBlock Must be a hexahedral solid.
10960 # @param theFace Face of \a theBlock, opposite to the desired face.
10961 # @param theName Object name; when specified, this parameter is used
10962 # for result publication in the study. Otherwise, if automatic
10963 # publication is switched on, default value is used for result name.
10965 # @return New GEOM.GEOM_Object, containing the found face.
10967 # @ref swig_GetOppositeFace "Example"
10968 def GetOppositeFace(self, theBlock, theFace, theName=None):
10970 Find a face, opposite to the given one in the given block.
10973 theBlock Must be a hexahedral solid.
10974 theFace Face of theBlock, opposite to the desired face.
10975 theName Object name; when specified, this parameter is used
10976 for result publication in the study. Otherwise, if automatic
10977 publication is switched on, default value is used for result name.
10980 New GEOM.GEOM_Object, containing the found face.
10982 # Example: see GEOM_Spanner.py
10983 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10984 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10985 self._autoPublish(anObj, theName, "face")
10988 ## Find a face of the given shape, which has minimal distance to the given point.
10989 # @param theShape Block or a compound of blocks.
10990 # @param thePoint Point, close to the desired face.
10991 # @param theName Object name; when specified, this parameter is used
10992 # for result publication in the study. Otherwise, if automatic
10993 # publication is switched on, default value is used for result name.
10995 # @return New GEOM.GEOM_Object, containing the found face.
10997 # @ref swig_GetFaceNearPoint "Example"
10998 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11000 Find a face of the given shape, which has minimal distance to the given point.
11003 theShape Block or a compound of blocks.
11004 thePoint Point, close to the desired face.
11005 theName Object name; when specified, this parameter is used
11006 for result publication in the study. Otherwise, if automatic
11007 publication is switched on, default value is used for result name.
11010 New GEOM.GEOM_Object, containing the found face.
11012 # Example: see GEOM_Spanner.py
11013 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11014 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11015 self._autoPublish(anObj, theName, "face")
11018 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11019 # @param theBlock Block or a compound of blocks.
11020 # @param theVector Vector, close to the normale of the desired face.
11021 # @param theName Object name; when specified, this parameter is used
11022 # for result publication in the study. Otherwise, if automatic
11023 # publication is switched on, default value is used for result name.
11025 # @return New GEOM.GEOM_Object, containing the found face.
11027 # @ref swig_todo "Example"
11028 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11030 Find a face of block, whose outside normale has minimal angle with the given vector.
11033 theBlock Block or a compound of blocks.
11034 theVector Vector, close to the normale of the desired face.
11035 theName Object name; when specified, this parameter is used
11036 for result publication in the study. Otherwise, if automatic
11037 publication is switched on, default value is used for result name.
11040 New GEOM.GEOM_Object, containing the found face.
11042 # Example: see GEOM_Spanner.py
11043 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11044 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11045 self._autoPublish(anObj, theName, "face")
11048 ## Find all sub-shapes of type \a theShapeType of the given shape,
11049 # which have minimal distance to the given point.
11050 # @param theShape Any shape.
11051 # @param thePoint Point, close to the desired shape.
11052 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11053 # @param theTolerance The tolerance for distances comparison. All shapes
11054 # with distances to the given point in interval
11055 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11056 # @param theName Object name; when specified, this parameter is used
11057 # for result publication in the study. Otherwise, if automatic
11058 # publication is switched on, default value is used for result name.
11060 # @return New GEOM_Object, containing a group of all found shapes.
11062 # @ref swig_GetShapesNearPoint "Example"
11063 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11065 Find all sub-shapes of type theShapeType of the given shape,
11066 which have minimal distance to the given point.
11069 theShape Any shape.
11070 thePoint Point, close to the desired shape.
11071 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11072 theTolerance The tolerance for distances comparison. All shapes
11073 with distances to the given point in interval
11074 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11075 theName Object name; when specified, this parameter is used
11076 for result publication in the study. Otherwise, if automatic
11077 publication is switched on, default value is used for result name.
11080 New GEOM_Object, containing a group of all found shapes.
11082 # Example: see GEOM_TestOthers.py
11083 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11084 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11085 self._autoPublish(anObj, theName, "group")
11088 # end of l3_blocks_op
11091 ## @addtogroup l4_blocks_measure
11094 ## Check, if the compound of blocks is given.
11095 # To be considered as a compound of blocks, the
11096 # given shape must satisfy the following conditions:
11097 # - Each element of the compound should be a Block (6 faces and 12 edges).
11098 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11099 # - The compound should be connexe.
11100 # - The glue between two quadrangle faces should be applied.
11101 # @param theCompound The compound to check.
11102 # @return TRUE, if the given shape is a compound of blocks.
11103 # If theCompound is not valid, prints all discovered errors.
11105 # @ref tui_measurement_tools_page "Example 1"
11106 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11107 def CheckCompoundOfBlocks(self,theCompound):
11109 Check, if the compound of blocks is given.
11110 To be considered as a compound of blocks, the
11111 given shape must satisfy the following conditions:
11112 - Each element of the compound should be a Block (6 faces and 12 edges).
11113 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11114 - The compound should be connexe.
11115 - The glue between two quadrangle faces should be applied.
11118 theCompound The compound to check.
11121 TRUE, if the given shape is a compound of blocks.
11122 If theCompound is not valid, prints all discovered errors.
11124 # Example: see GEOM_Spanner.py
11125 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11126 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11128 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11132 ## Retrieve all non blocks solids and faces from \a theShape.
11133 # @param theShape The shape to explore.
11134 # @param theName Object name; when specified, this parameter is used
11135 # for result publication in the study. Otherwise, if automatic
11136 # publication is switched on, default value is used for result name.
11138 # @return A tuple of two GEOM_Objects. The first object is a group of all
11139 # non block solids (= not 6 faces, or with 6 faces, but with the
11140 # presence of non-quadrangular faces). The second object is a
11141 # group of all non quadrangular faces.
11143 # @ref tui_measurement_tools_page "Example 1"
11144 # \n @ref swig_GetNonBlocks "Example 2"
11145 def GetNonBlocks (self, theShape, theName=None):
11147 Retrieve all non blocks solids and faces from theShape.
11150 theShape The shape to explore.
11151 theName Object name; when specified, this parameter is used
11152 for result publication in the study. Otherwise, if automatic
11153 publication is switched on, default value is used for result name.
11156 A tuple of two GEOM_Objects. The first object is a group of all
11157 non block solids (= not 6 faces, or with 6 faces, but with the
11158 presence of non-quadrangular faces). The second object is a
11159 group of all non quadrangular faces.
11162 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11164 # Example: see GEOM_Spanner.py
11165 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11166 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11167 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11170 ## Remove all seam and degenerated edges from \a theShape.
11171 # Unite faces and edges, sharing one surface. It means that
11172 # this faces must have references to one C++ surface object (handle).
11173 # @param theShape The compound or single solid to remove irregular edges from.
11174 # @param doUnionFaces If True, then unite faces. If False (the default value),
11175 # do not unite faces.
11176 # @param theName Object name; when specified, this parameter is used
11177 # for result publication in the study. Otherwise, if automatic
11178 # publication is switched on, default value is used for result name.
11180 # @return Improved shape.
11182 # @ref swig_RemoveExtraEdges "Example"
11183 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11185 Remove all seam and degenerated edges from theShape.
11186 Unite faces and edges, sharing one surface. It means that
11187 this faces must have references to one C++ surface object (handle).
11190 theShape The compound or single solid to remove irregular edges from.
11191 doUnionFaces If True, then unite faces. If False (the default value),
11192 do not unite faces.
11193 theName Object name; when specified, this parameter is used
11194 for result publication in the study. Otherwise, if automatic
11195 publication is switched on, default value is used for result name.
11200 # Example: see GEOM_TestOthers.py
11201 nbFacesOptimum = -1 # -1 means do not unite faces
11202 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11203 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11204 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11205 self._autoPublish(anObj, theName, "removeExtraEdges")
11208 ## Performs union faces of \a theShape
11209 # Unite faces sharing one surface. It means that
11210 # these faces must have references to one C++ surface object (handle).
11211 # @param theShape The compound or single solid that contains faces
11212 # to perform union.
11213 # @param theName Object name; when specified, this parameter is used
11214 # for result publication in the study. Otherwise, if automatic
11215 # publication is switched on, default value is used for result name.
11217 # @return Improved shape.
11219 # @ref swig_UnionFaces "Example"
11220 def UnionFaces(self, theShape, theName=None):
11222 Performs union faces of theShape.
11223 Unite faces sharing one surface. It means that
11224 these faces must have references to one C++ surface object (handle).
11227 theShape The compound or single solid that contains faces
11229 theName Object name; when specified, this parameter is used
11230 for result publication in the study. Otherwise, if automatic
11231 publication is switched on, default value is used for result name.
11236 # Example: see GEOM_TestOthers.py
11237 anObj = self.BlocksOp.UnionFaces(theShape)
11238 RaiseIfFailed("UnionFaces", self.BlocksOp)
11239 self._autoPublish(anObj, theName, "unionFaces")
11242 ## Check, if the given shape is a blocks compound.
11243 # Fix all detected errors.
11244 # \note Single block can be also fixed by this method.
11245 # @param theShape The compound to check and improve.
11246 # @param theName Object name; when specified, this parameter is used
11247 # for result publication in the study. Otherwise, if automatic
11248 # publication is switched on, default value is used for result name.
11250 # @return Improved compound.
11252 # @ref swig_CheckAndImprove "Example"
11253 def CheckAndImprove(self, theShape, theName=None):
11255 Check, if the given shape is a blocks compound.
11256 Fix all detected errors.
11259 Single block can be also fixed by this method.
11262 theShape The compound to check and improve.
11263 theName Object name; when specified, this parameter is used
11264 for result publication in the study. Otherwise, if automatic
11265 publication is switched on, default value is used for result name.
11270 # Example: see GEOM_TestOthers.py
11271 anObj = self.BlocksOp.CheckAndImprove(theShape)
11272 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11273 self._autoPublish(anObj, theName, "improved")
11276 # end of l4_blocks_measure
11279 ## @addtogroup l3_blocks_op
11282 ## Get all the blocks, contained in the given compound.
11283 # @param theCompound The compound to explode.
11284 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11285 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11286 # @param theName Object name; when specified, this parameter is used
11287 # for result publication in the study. Otherwise, if automatic
11288 # publication is switched on, default value is used for result name.
11290 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11292 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11294 # @ref tui_explode_on_blocks "Example 1"
11295 # \n @ref swig_MakeBlockExplode "Example 2"
11296 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11298 Get all the blocks, contained in the given compound.
11301 theCompound The compound to explode.
11302 theMinNbFaces If solid has lower number of faces, it is not a block.
11303 theMaxNbFaces If solid has higher number of faces, it is not a block.
11304 theName Object name; when specified, this parameter is used
11305 for result publication in the study. Otherwise, if automatic
11306 publication is switched on, default value is used for result name.
11309 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11312 List of GEOM.GEOM_Object, containing the retrieved blocks.
11314 # Example: see GEOM_TestOthers.py
11315 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11316 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11317 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11318 for anObj in aList:
11319 anObj.SetParameters(Parameters)
11321 self._autoPublish(aList, theName, "block")
11324 ## Find block, containing the given point inside its volume or on boundary.
11325 # @param theCompound Compound, to find block in.
11326 # @param thePoint Point, close to the desired block. If the point lays on
11327 # boundary between some blocks, we return block with nearest center.
11328 # @param theName Object name; when specified, this parameter is used
11329 # for result publication in the study. Otherwise, if automatic
11330 # publication is switched on, default value is used for result name.
11332 # @return New GEOM.GEOM_Object, containing the found block.
11334 # @ref swig_todo "Example"
11335 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11337 Find block, containing the given point inside its volume or on boundary.
11340 theCompound Compound, to find block in.
11341 thePoint Point, close to the desired block. If the point lays on
11342 boundary between some blocks, we return block with nearest center.
11343 theName Object name; when specified, this parameter is used
11344 for result publication in the study. Otherwise, if automatic
11345 publication is switched on, default value is used for result name.
11348 New GEOM.GEOM_Object, containing the found block.
11350 # Example: see GEOM_Spanner.py
11351 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11352 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11353 self._autoPublish(anObj, theName, "block")
11356 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11357 # @param theCompound Compound, to find block in.
11358 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11359 # @param theName Object name; when specified, this parameter is used
11360 # for result publication in the study. Otherwise, if automatic
11361 # publication is switched on, default value is used for result name.
11363 # @return New GEOM.GEOM_Object, containing the found block.
11365 # @ref swig_GetBlockByParts "Example"
11366 def GetBlockByParts(self, theCompound, theParts, theName=None):
11368 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11371 theCompound Compound, to find block in.
11372 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11373 theName Object name; when specified, this parameter is used
11374 for result publication in the study. Otherwise, if automatic
11375 publication is switched on, default value is used for result name.
11378 New GEOM_Object, containing the found block.
11380 # Example: see GEOM_TestOthers.py
11381 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11382 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11383 self._autoPublish(anObj, theName, "block")
11386 ## Return all blocks, containing all the elements, passed as the parts.
11387 # @param theCompound Compound, to find blocks in.
11388 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11389 # @param 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.
11393 # @return List of GEOM.GEOM_Object, containing the found blocks.
11395 # @ref swig_todo "Example"
11396 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11398 Return all blocks, containing all the elements, passed as the parts.
11401 theCompound Compound, to find blocks in.
11402 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11403 theName Object name; when specified, this parameter is used
11404 for result publication in the study. Otherwise, if automatic
11405 publication is switched on, default value is used for result name.
11408 List of GEOM.GEOM_Object, containing the found blocks.
11410 # Example: see GEOM_Spanner.py
11411 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11412 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11413 self._autoPublish(aList, theName, "block")
11416 ## Multi-transformate block and glue the result.
11417 # Transformation is defined so, as to superpose direction faces.
11418 # @param Block Hexahedral solid to be multi-transformed.
11419 # @param DirFace1 ID of First direction face.
11420 # @param DirFace2 ID of Second direction face.
11421 # @param NbTimes Quantity of transformations to be done.
11422 # @param theName Object name; when specified, this parameter is used
11423 # for result publication in the study. Otherwise, if automatic
11424 # publication is switched on, default value is used for result name.
11426 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11428 # @return New GEOM.GEOM_Object, containing the result shape.
11430 # @ref tui_multi_transformation "Example"
11431 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11433 Multi-transformate block and glue the result.
11434 Transformation is defined so, as to superpose direction faces.
11437 Block Hexahedral solid to be multi-transformed.
11438 DirFace1 ID of First direction face.
11439 DirFace2 ID of Second direction face.
11440 NbTimes Quantity of transformations to be done.
11441 theName Object name; when specified, this parameter is used
11442 for result publication in the study. Otherwise, if automatic
11443 publication is switched on, default value is used for result name.
11446 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11449 New GEOM.GEOM_Object, containing the result shape.
11451 # Example: see GEOM_Spanner.py
11452 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11453 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11454 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11455 anObj.SetParameters(Parameters)
11456 self._autoPublish(anObj, theName, "transformed")
11459 ## Multi-transformate block and glue the result.
11460 # @param Block Hexahedral solid to be multi-transformed.
11461 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11462 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11463 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11464 # @param theName Object name; when specified, this parameter is used
11465 # for result publication in the study. Otherwise, if automatic
11466 # publication is switched on, default value is used for result name.
11468 # @return New GEOM.GEOM_Object, containing the result shape.
11470 # @ref tui_multi_transformation "Example"
11471 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11472 DirFace1V, DirFace2V, NbTimesV, theName=None):
11474 Multi-transformate block and glue the result.
11477 Block Hexahedral solid to be multi-transformed.
11478 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11479 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11480 NbTimesU,NbTimesV Quantity of transformations to be done.
11481 theName Object name; when specified, this parameter is used
11482 for result publication in the study. Otherwise, if automatic
11483 publication is switched on, default value is used for result name.
11486 New GEOM.GEOM_Object, containing the result shape.
11488 # Example: see GEOM_Spanner.py
11489 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11490 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11491 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11492 DirFace1V, DirFace2V, NbTimesV)
11493 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11494 anObj.SetParameters(Parameters)
11495 self._autoPublish(anObj, theName, "transformed")
11498 ## Build all possible propagation groups.
11499 # Propagation group is a set of all edges, opposite to one (main)
11500 # edge of this group directly or through other opposite edges.
11501 # Notion of Opposite Edge make sence only on quadrangle face.
11502 # @param theShape Shape to build propagation groups on.
11503 # @param theName Object name; when specified, this parameter is used
11504 # for result publication in the study. Otherwise, if automatic
11505 # publication is switched on, default value is used for result name.
11507 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11509 # @ref swig_Propagate "Example"
11510 def Propagate(self, theShape, theName=None):
11512 Build all possible propagation groups.
11513 Propagation group is a set of all edges, opposite to one (main)
11514 edge of this group directly or through other opposite edges.
11515 Notion of Opposite Edge make sence only on quadrangle face.
11518 theShape Shape to build propagation groups on.
11519 theName Object name; when specified, this parameter is used
11520 for result publication in the study. Otherwise, if automatic
11521 publication is switched on, default value is used for result name.
11524 List of GEOM.GEOM_Object, each of them is a propagation group.
11526 # Example: see GEOM_TestOthers.py
11527 listChains = self.BlocksOp.Propagate(theShape)
11528 RaiseIfFailed("Propagate", self.BlocksOp)
11529 self._autoPublish(listChains, theName, "propagate")
11532 # end of l3_blocks_op
11535 ## @addtogroup l3_groups
11538 ## Creates a new group which will store sub-shapes of theMainShape
11539 # @param theMainShape is a GEOM object on which the group is selected
11540 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11541 # @param theName Object name; when specified, this parameter is used
11542 # for result publication in the study. Otherwise, if automatic
11543 # publication is switched on, default value is used for result name.
11545 # @return a newly created GEOM group (GEOM.GEOM_Object)
11547 # @ref tui_working_with_groups_page "Example 1"
11548 # \n @ref swig_CreateGroup "Example 2"
11549 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11551 Creates a new group which will store sub-shapes of theMainShape
11554 theMainShape is a GEOM object on which the group is selected
11555 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11556 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11557 theName Object name; when specified, this parameter is used
11558 for result publication in the study. Otherwise, if automatic
11559 publication is switched on, default value is used for result name.
11562 a newly created GEOM group
11565 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11568 # Example: see GEOM_TestOthers.py
11569 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11570 RaiseIfFailed("CreateGroup", self.GroupOp)
11571 self._autoPublish(anObj, theName, "group")
11574 ## Adds a sub-object with ID theSubShapeId to the group
11575 # @param theGroup is a GEOM group to which the new sub-shape is added
11576 # @param theSubShapeID is a sub-shape ID in the main object.
11577 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11579 # @ref tui_working_with_groups_page "Example"
11580 def AddObject(self,theGroup, theSubShapeID):
11582 Adds a sub-object with ID theSubShapeId to the group
11585 theGroup is a GEOM group to which the new sub-shape is added
11586 theSubShapeID is a sub-shape ID in the main object.
11589 Use method GetSubShapeID() to get an unique ID of the sub-shape
11591 # Example: see GEOM_TestOthers.py
11592 self.GroupOp.AddObject(theGroup, theSubShapeID)
11593 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11594 RaiseIfFailed("AddObject", self.GroupOp)
11598 ## Removes a sub-object with ID \a theSubShapeId from the group
11599 # @param theGroup is a GEOM group from which the new sub-shape is removed
11600 # @param theSubShapeID is a sub-shape ID in the main object.
11601 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11603 # @ref tui_working_with_groups_page "Example"
11604 def RemoveObject(self,theGroup, theSubShapeID):
11606 Removes a sub-object with ID theSubShapeId from the group
11609 theGroup is a GEOM group from which the new sub-shape is removed
11610 theSubShapeID is a sub-shape ID in the main object.
11613 Use method GetSubShapeID() to get an unique ID of the sub-shape
11615 # Example: see GEOM_TestOthers.py
11616 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11617 RaiseIfFailed("RemoveObject", self.GroupOp)
11620 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11621 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11622 # @param theSubShapes is a list of sub-shapes to be added.
11624 # @ref tui_working_with_groups_page "Example"
11625 def UnionList (self,theGroup, theSubShapes):
11627 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11630 theGroup is a GEOM group to which the new sub-shapes are added.
11631 theSubShapes is a list of sub-shapes to be added.
11633 # Example: see GEOM_TestOthers.py
11634 self.GroupOp.UnionList(theGroup, theSubShapes)
11635 RaiseIfFailed("UnionList", self.GroupOp)
11638 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11639 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11640 # @param theSubShapes is a list of indices of sub-shapes to be added.
11642 # @ref swig_UnionIDs "Example"
11643 def UnionIDs(self,theGroup, theSubShapes):
11645 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11648 theGroup is a GEOM group to which the new sub-shapes are added.
11649 theSubShapes is a list of indices of sub-shapes to be added.
11651 # Example: see GEOM_TestOthers.py
11652 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11653 RaiseIfFailed("UnionIDs", self.GroupOp)
11656 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11657 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11658 # @param theSubShapes is a list of sub-shapes to be removed.
11660 # @ref tui_working_with_groups_page "Example"
11661 def DifferenceList (self,theGroup, theSubShapes):
11663 Removes from the group all the given shapes. No errors, if some shapes are not included.
11666 theGroup is a GEOM group from which the sub-shapes are removed.
11667 theSubShapes is a list of sub-shapes to be removed.
11669 # Example: see GEOM_TestOthers.py
11670 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11671 RaiseIfFailed("DifferenceList", self.GroupOp)
11674 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11675 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11676 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11678 # @ref swig_DifferenceIDs "Example"
11679 def DifferenceIDs(self,theGroup, theSubShapes):
11681 Removes from the group all the given shapes. No errors, if some shapes are not included.
11684 theGroup is a GEOM group from which the sub-shapes are removed.
11685 theSubShapes is a list of indices of sub-shapes to be removed.
11687 # Example: see GEOM_TestOthers.py
11688 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11689 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11692 ## Union of two groups.
11693 # New group is created. It will contain all entities
11694 # which are present in groups theGroup1 and theGroup2.
11695 # @param theGroup1, theGroup2 are the initial GEOM groups
11696 # to create the united group from.
11697 # @param theName Object name; when specified, this parameter is used
11698 # for result publication in the study. Otherwise, if automatic
11699 # publication is switched on, default value is used for result name.
11701 # @return a newly created GEOM group.
11703 # @ref tui_union_groups_anchor "Example"
11704 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11706 Union of two groups.
11707 New group is created. It will contain all entities
11708 which are present in groups theGroup1 and theGroup2.
11711 theGroup1, theGroup2 are the initial GEOM groups
11712 to create the united group from.
11713 theName Object name; when specified, this parameter is used
11714 for result publication in the study. Otherwise, if automatic
11715 publication is switched on, default value is used for result name.
11718 a newly created GEOM group.
11720 # Example: see GEOM_TestOthers.py
11721 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11722 RaiseIfFailed("UnionGroups", self.GroupOp)
11723 self._autoPublish(aGroup, theName, "group")
11726 ## Intersection of two groups.
11727 # New group is created. It will contain only those entities
11728 # which are present in both groups theGroup1 and theGroup2.
11729 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11730 # @param theName Object name; when specified, this parameter is used
11731 # for result publication in the study. Otherwise, if automatic
11732 # publication is switched on, default value is used for result name.
11734 # @return a newly created GEOM group.
11736 # @ref tui_intersect_groups_anchor "Example"
11737 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11739 Intersection of two groups.
11740 New group is created. It will contain only those entities
11741 which are present in both groups theGroup1 and theGroup2.
11744 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11745 theName Object name; when specified, this parameter is used
11746 for result publication in the study. Otherwise, if automatic
11747 publication is switched on, default value is used for result name.
11750 a newly created GEOM group.
11752 # Example: see GEOM_TestOthers.py
11753 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11754 RaiseIfFailed("IntersectGroups", self.GroupOp)
11755 self._autoPublish(aGroup, theName, "group")
11758 ## Cut of two groups.
11759 # New group is created. It will contain entities which are
11760 # present in group theGroup1 but are not present in group theGroup2.
11761 # @param theGroup1 is a GEOM group to include elements of.
11762 # @param theGroup2 is a GEOM group to exclude elements of.
11763 # @param theName Object name; when specified, this parameter is used
11764 # for result publication in the study. Otherwise, if automatic
11765 # publication is switched on, default value is used for result name.
11767 # @return a newly created GEOM group.
11769 # @ref tui_cut_groups_anchor "Example"
11770 def CutGroups (self, theGroup1, theGroup2, theName=None):
11773 New group is created. It will contain entities which are
11774 present in group theGroup1 but are not present in group theGroup2.
11777 theGroup1 is a GEOM group to include elements of.
11778 theGroup2 is a GEOM group to exclude elements of.
11779 theName Object name; when specified, this parameter is used
11780 for result publication in the study. Otherwise, if automatic
11781 publication is switched on, default value is used for result name.
11784 a newly created GEOM group.
11786 # Example: see GEOM_TestOthers.py
11787 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11788 RaiseIfFailed("CutGroups", self.GroupOp)
11789 self._autoPublish(aGroup, theName, "group")
11792 ## Union of list of groups.
11793 # New group is created. It will contain all entities that are
11794 # present in groups listed in theGList.
11795 # @param theGList is a list of GEOM groups to create the united group from.
11796 # @param theName Object name; when specified, this parameter is used
11797 # for result publication in the study. Otherwise, if automatic
11798 # publication is switched on, default value is used for result name.
11800 # @return a newly created GEOM group.
11802 # @ref tui_union_groups_anchor "Example"
11803 def UnionListOfGroups (self, theGList, theName=None):
11805 Union of list of groups.
11806 New group is created. It will contain all entities that are
11807 present in groups listed in theGList.
11810 theGList is a list of GEOM groups to create the united group from.
11811 theName Object name; when specified, this parameter is used
11812 for result publication in the study. Otherwise, if automatic
11813 publication is switched on, default value is used for result name.
11816 a newly created GEOM group.
11818 # Example: see GEOM_TestOthers.py
11819 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11820 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11821 self._autoPublish(aGroup, theName, "group")
11824 ## Cut of lists of groups.
11825 # New group is created. It will contain only entities
11826 # which are present in groups listed in theGList.
11827 # @param theGList is a list of GEOM groups to include elements of.
11828 # @param theName Object name; when specified, this parameter is used
11829 # for result publication in the study. Otherwise, if automatic
11830 # publication is switched on, default value is used for result name.
11832 # @return a newly created GEOM group.
11834 # @ref tui_intersect_groups_anchor "Example"
11835 def IntersectListOfGroups (self, theGList, theName=None):
11837 Cut of lists of groups.
11838 New group is created. It will contain only entities
11839 which are present in groups listed in theGList.
11842 theGList is a list of GEOM groups to include elements of.
11843 theName Object name; when specified, this parameter is used
11844 for result publication in the study. Otherwise, if automatic
11845 publication is switched on, default value is used for result name.
11848 a newly created GEOM group.
11850 # Example: see GEOM_TestOthers.py
11851 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11852 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11853 self._autoPublish(aGroup, theName, "group")
11856 ## Cut of lists of groups.
11857 # New group is created. It will contain only entities
11858 # which are present in groups listed in theGList1 but
11859 # are not present in groups from theGList2.
11860 # @param theGList1 is a list of GEOM groups to include elements of.
11861 # @param theGList2 is a list of GEOM groups to exclude elements of.
11862 # @param theName Object name; when specified, this parameter is used
11863 # for result publication in the study. Otherwise, if automatic
11864 # publication is switched on, default value is used for result name.
11866 # @return a newly created GEOM group.
11868 # @ref tui_cut_groups_anchor "Example"
11869 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11871 Cut of lists of groups.
11872 New group is created. It will contain only entities
11873 which are present in groups listed in theGList1 but
11874 are not present in groups from theGList2.
11877 theGList1 is a list of GEOM groups to include elements of.
11878 theGList2 is a list of GEOM groups to exclude elements of.
11879 theName Object name; when specified, this parameter is used
11880 for result publication in the study. Otherwise, if automatic
11881 publication is switched on, default value is used for result name.
11884 a newly created GEOM group.
11886 # Example: see GEOM_TestOthers.py
11887 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11888 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11889 self._autoPublish(aGroup, theName, "group")
11892 ## Returns a list of sub-objects ID stored in the group
11893 # @param theGroup is a GEOM group for which a list of IDs is requested
11895 # @ref swig_GetObjectIDs "Example"
11896 def GetObjectIDs(self,theGroup):
11898 Returns a list of sub-objects ID stored in the group
11901 theGroup is a GEOM group for which a list of IDs is requested
11903 # Example: see GEOM_TestOthers.py
11904 ListIDs = self.GroupOp.GetObjects(theGroup)
11905 RaiseIfFailed("GetObjects", self.GroupOp)
11908 ## Returns a type of sub-objects stored in the group
11909 # @param theGroup is a GEOM group which type is returned.
11911 # @ref swig_GetType "Example"
11912 def GetType(self,theGroup):
11914 Returns a type of sub-objects stored in the group
11917 theGroup is a GEOM group which type is returned.
11919 # Example: see GEOM_TestOthers.py
11920 aType = self.GroupOp.GetType(theGroup)
11921 RaiseIfFailed("GetType", self.GroupOp)
11924 ## Convert a type of geom object from id to string value
11925 # @param theId is a GEOM obect type id.
11926 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11927 # @ref swig_GetType "Example"
11928 def ShapeIdToType(self, theId):
11930 Convert a type of geom object from id to string value
11933 theId is a GEOM obect type id.
11936 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11963 return "REVOLUTION"
12011 return "FREE_BOUNDS"
12019 return "THRUSECTIONS"
12021 return "COMPOUNDFILTER"
12023 return "SHAPES_ON_SHAPE"
12025 return "ELLIPSE_ARC"
12027 return "3DSKETCHER"
12033 return "PIPETSHAPE"
12034 return "Shape Id not exist."
12036 ## Returns a main shape associated with the group
12037 # @param theGroup is a GEOM group for which a main shape object is requested
12038 # @return a GEOM object which is a main shape for theGroup
12040 # @ref swig_GetMainShape "Example"
12041 def GetMainShape(self,theGroup):
12043 Returns a main shape associated with the group
12046 theGroup is a GEOM group for which a main shape object is requested
12049 a GEOM object which is a main shape for theGroup
12051 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12053 # Example: see GEOM_TestOthers.py
12054 anObj = self.GroupOp.GetMainShape(theGroup)
12055 RaiseIfFailed("GetMainShape", self.GroupOp)
12058 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12059 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12060 # @param theShape given shape (see GEOM.GEOM_Object)
12061 # @param min_length minimum length of edges of theShape
12062 # @param max_length maximum length of edges of theShape
12063 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12064 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12065 # @param theName Object name; when specified, this parameter is used
12066 # for result publication in the study. Otherwise, if automatic
12067 # publication is switched on, default value is used for result name.
12069 # @return a newly created GEOM group of edges
12071 # @@ref swig_todo "Example"
12072 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12074 Create group of edges of theShape, whose length is in range [min_length, max_length].
12075 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12078 theShape given shape
12079 min_length minimum length of edges of theShape
12080 max_length maximum length of edges of theShape
12081 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12082 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12083 theName Object name; when specified, this parameter is used
12084 for result publication in the study. Otherwise, if automatic
12085 publication is switched on, default value is used for result name.
12088 a newly created GEOM group of edges.
12090 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12091 edges_in_range = []
12093 Props = self.BasicProperties(edge)
12094 if min_length <= Props[0] and Props[0] <= max_length:
12095 if (not include_min) and (min_length == Props[0]):
12098 if (not include_max) and (Props[0] == max_length):
12101 edges_in_range.append(edge)
12103 if len(edges_in_range) <= 0:
12104 print "No edges found by given criteria"
12107 # note: auto-publishing is done in self.CreateGroup()
12108 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12109 self.UnionList(group_edges, edges_in_range)
12113 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12114 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12115 # @param min_length minimum length of edges of selected shape
12116 # @param max_length maximum length of edges of selected shape
12117 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12118 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12119 # @return a newly created GEOM group of edges
12120 # @ref swig_todo "Example"
12121 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12123 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12124 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12127 min_length minimum length of edges of selected shape
12128 max_length maximum length of edges of selected shape
12129 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12130 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12133 a newly created GEOM group of edges.
12135 nb_selected = sg.SelectedCount()
12136 if nb_selected < 1:
12137 print "Select a shape before calling this function, please."
12139 if nb_selected > 1:
12140 print "Only one shape must be selected"
12143 id_shape = sg.getSelected(0)
12144 shape = IDToObject( id_shape )
12146 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12150 if include_min: left_str = " <= "
12151 if include_max: right_str = " <= "
12153 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12154 + left_str + "length" + right_str + `max_length`)
12156 sg.updateObjBrowser(1)
12163 ## @addtogroup l4_advanced
12166 ## Create a T-shape object with specified caracteristics for the main
12167 # and the incident pipes (radius, width, half-length).
12168 # The extremities of the main pipe are located on junctions points P1 and P2.
12169 # The extremity of the incident pipe is located on junction point P3.
12170 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12171 # the main plane of the T-shape is XOY.
12173 # @param theR1 Internal radius of main pipe
12174 # @param theW1 Width of main pipe
12175 # @param theL1 Half-length of main pipe
12176 # @param theR2 Internal radius of incident pipe (R2 < R1)
12177 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12178 # @param theL2 Half-length of incident pipe
12180 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12181 # @param theP1 1st junction point of main pipe
12182 # @param theP2 2nd junction point of main pipe
12183 # @param theP3 Junction point of incident pipe
12185 # @param theRL Internal radius of left thickness reduction
12186 # @param theWL Width of left thickness reduction
12187 # @param theLtransL Length of left transition part
12188 # @param theLthinL Length of left thin part
12190 # @param theRR Internal radius of right thickness reduction
12191 # @param theWR Width of right thickness reduction
12192 # @param theLtransR Length of right transition part
12193 # @param theLthinR Length of right thin part
12195 # @param theRI Internal radius of incident thickness reduction
12196 # @param theWI Width of incident thickness reduction
12197 # @param theLtransI Length of incident transition part
12198 # @param theLthinI Length of incident thin part
12200 # @param theName Object name; when specified, this parameter is used
12201 # for result publication in the study. Otherwise, if automatic
12202 # publication is switched on, default value is used for result name.
12204 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12206 # @ref tui_creation_pipetshape "Example"
12207 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12208 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12209 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12210 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12211 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12214 Create a T-shape object with specified caracteristics for the main
12215 and the incident pipes (radius, width, half-length).
12216 The extremities of the main pipe are located on junctions points P1 and P2.
12217 The extremity of the incident pipe is located on junction point P3.
12218 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12219 the main plane of the T-shape is XOY.
12222 theR1 Internal radius of main pipe
12223 theW1 Width of main pipe
12224 theL1 Half-length of main pipe
12225 theR2 Internal radius of incident pipe (R2 < R1)
12226 theW2 Width of incident pipe (R2+W2 < R1+W1)
12227 theL2 Half-length of incident pipe
12228 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12229 theP1 1st junction point of main pipe
12230 theP2 2nd junction point of main pipe
12231 theP3 Junction point of incident pipe
12233 theRL Internal radius of left thickness reduction
12234 theWL Width of left thickness reduction
12235 theLtransL Length of left transition part
12236 theLthinL Length of left thin part
12238 theRR Internal radius of right thickness reduction
12239 theWR Width of right thickness reduction
12240 theLtransR Length of right transition part
12241 theLthinR Length of right thin part
12243 theRI Internal radius of incident thickness reduction
12244 theWI Width of incident thickness reduction
12245 theLtransI Length of incident transition part
12246 theLthinI Length of incident thin part
12248 theName Object name; when specified, this parameter is used
12249 for result publication in the study. Otherwise, if automatic
12250 publication is switched on, default value is used for result name.
12253 List of GEOM_Object, containing the created shape and propagation groups.
12256 # create PipeTShape object
12257 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12258 # create PipeTShape object with position
12259 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12260 # create PipeTShape object with left thickness reduction
12261 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12263 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)
12264 if (theP1 and theP2 and theP3):
12265 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12266 theRL, theWL, theLtransL, theLthinL,
12267 theRR, theWR, theLtransR, theLthinR,
12268 theRI, theWI, theLtransI, theLthinI,
12269 theHexMesh, theP1, theP2, theP3)
12271 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12272 theRL, theWL, theLtransL, theLthinL,
12273 theRR, theWR, theLtransR, theLthinR,
12274 theRI, theWI, theLtransI, theLthinI,
12276 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12277 if Parameters: anObj[0].SetParameters(Parameters)
12278 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12279 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12282 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12283 # and the incident pipes (radius, width, half-length). The chamfer is
12284 # created on the junction of the pipes.
12285 # The extremities of the main pipe are located on junctions points P1 and P2.
12286 # The extremity of the incident pipe is located on junction point P3.
12287 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12288 # the main plane of the T-shape is XOY.
12289 # @param theR1 Internal radius of main pipe
12290 # @param theW1 Width of main pipe
12291 # @param theL1 Half-length of main pipe
12292 # @param theR2 Internal radius of incident pipe (R2 < R1)
12293 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12294 # @param theL2 Half-length of incident pipe
12295 # @param theH Height of the chamfer.
12296 # @param theW Width of the chamfer.
12297 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12298 # @param theP1 1st junction point of main pipe
12299 # @param theP2 2nd junction point of main pipe
12300 # @param theP3 Junction point of incident pipe
12302 # @param theRL Internal radius of left thickness reduction
12303 # @param theWL Width of left thickness reduction
12304 # @param theLtransL Length of left transition part
12305 # @param theLthinL Length of left thin part
12307 # @param theRR Internal radius of right thickness reduction
12308 # @param theWR Width of right thickness reduction
12309 # @param theLtransR Length of right transition part
12310 # @param theLthinR Length of right thin part
12312 # @param theRI Internal radius of incident thickness reduction
12313 # @param theWI Width of incident thickness reduction
12314 # @param theLtransI Length of incident transition part
12315 # @param theLthinI Length of incident thin part
12317 # @param theName Object name; when specified, this parameter is used
12318 # for result publication in the study. Otherwise, if automatic
12319 # publication is switched on, default value is used for result name.
12321 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12323 # @ref tui_creation_pipetshape "Example"
12324 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12325 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12326 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12327 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12328 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12331 Create a T-shape object with chamfer and with specified caracteristics for the main
12332 and the incident pipes (radius, width, half-length). The chamfer is
12333 created on the junction of the pipes.
12334 The extremities of the main pipe are located on junctions points P1 and P2.
12335 The extremity of the incident pipe is located on junction point P3.
12336 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12337 the main plane of the T-shape is XOY.
12340 theR1 Internal radius of main pipe
12341 theW1 Width of main pipe
12342 theL1 Half-length of main pipe
12343 theR2 Internal radius of incident pipe (R2 < R1)
12344 theW2 Width of incident pipe (R2+W2 < R1+W1)
12345 theL2 Half-length of incident pipe
12346 theH Height of the chamfer.
12347 theW Width of the chamfer.
12348 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12349 theP1 1st junction point of main pipe
12350 theP2 2nd junction point of main pipe
12351 theP3 Junction point of incident pipe
12353 theRL Internal radius of left thickness reduction
12354 theWL Width of left thickness reduction
12355 theLtransL Length of left transition part
12356 theLthinL Length of left thin part
12358 theRR Internal radius of right thickness reduction
12359 theWR Width of right thickness reduction
12360 theLtransR Length of right transition part
12361 theLthinR Length of right thin part
12363 theRI Internal radius of incident thickness reduction
12364 theWI Width of incident thickness reduction
12365 theLtransI Length of incident transition part
12366 theLthinI Length of incident thin part
12368 theName Object name; when specified, this parameter is used
12369 for result publication in the study. Otherwise, if automatic
12370 publication is switched on, default value is used for result name.
12373 List of GEOM_Object, containing the created shape and propagation groups.
12376 # create PipeTShape with chamfer object
12377 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12378 # create PipeTShape with chamfer object with position
12379 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12380 # create PipeTShape with chamfer object with left thickness reduction
12381 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)
12383 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)
12384 if (theP1 and theP2 and theP3):
12385 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12386 theRL, theWL, theLtransL, theLthinL,
12387 theRR, theWR, theLtransR, theLthinR,
12388 theRI, theWI, theLtransI, theLthinI,
12389 theH, theW, theHexMesh, theP1, theP2, theP3)
12391 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12392 theRL, theWL, theLtransL, theLthinL,
12393 theRR, theWR, theLtransR, theLthinR,
12394 theRI, theWI, theLtransI, theLthinI,
12395 theH, theW, theHexMesh)
12396 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12397 if Parameters: anObj[0].SetParameters(Parameters)
12398 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12399 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12402 ## Create a T-shape object with fillet and with specified caracteristics for the main
12403 # and the incident pipes (radius, width, half-length). The fillet is
12404 # created on the junction of the pipes.
12405 # The extremities of the main pipe are located on junctions points P1 and P2.
12406 # The extremity of the incident pipe is located on junction point P3.
12407 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12408 # the main plane of the T-shape is XOY.
12409 # @param theR1 Internal radius of main pipe
12410 # @param theW1 Width of main pipe
12411 # @param theL1 Half-length of main pipe
12412 # @param theR2 Internal radius of incident pipe (R2 < R1)
12413 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12414 # @param theL2 Half-length of incident pipe
12415 # @param theRF Radius of curvature of fillet.
12416 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12417 # @param theP1 1st junction point of main pipe
12418 # @param theP2 2nd junction point of main pipe
12419 # @param theP3 Junction point of incident pipe
12421 # @param theRL Internal radius of left thickness reduction
12422 # @param theWL Width of left thickness reduction
12423 # @param theLtransL Length of left transition part
12424 # @param theLthinL Length of left thin part
12426 # @param theRR Internal radius of right thickness reduction
12427 # @param theWR Width of right thickness reduction
12428 # @param theLtransR Length of right transition part
12429 # @param theLthinR Length of right thin part
12431 # @param theRI Internal radius of incident thickness reduction
12432 # @param theWI Width of incident thickness reduction
12433 # @param theLtransI Length of incident transition part
12434 # @param theLthinI Length of incident thin part
12436 # @param theName Object name; when specified, this parameter is used
12437 # for result publication in the study. Otherwise, if automatic
12438 # publication is switched on, default value is used for result name.
12440 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12442 # @ref tui_creation_pipetshape "Example"
12443 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12444 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12445 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12446 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12447 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12450 Create a T-shape object with fillet and with specified caracteristics for the main
12451 and the incident pipes (radius, width, half-length). The fillet is
12452 created on the junction of the pipes.
12453 The extremities of the main pipe are located on junctions points P1 and P2.
12454 The extremity of the incident pipe is located on junction point P3.
12457 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12458 the main plane of the T-shape is XOY.
12459 theR1 Internal radius of main pipe
12460 theW1 Width of main pipe
12461 heL1 Half-length of main pipe
12462 theR2 Internal radius of incident pipe (R2 < R1)
12463 theW2 Width of incident pipe (R2+W2 < R1+W1)
12464 theL2 Half-length of incident pipe
12465 theRF Radius of curvature of fillet.
12466 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12467 theP1 1st junction point of main pipe
12468 theP2 2nd junction point of main pipe
12469 theP3 Junction point of incident pipe
12471 theRL Internal radius of left thickness reduction
12472 theWL Width of left thickness reduction
12473 theLtransL Length of left transition part
12474 theLthinL Length of left thin part
12476 theRR Internal radius of right thickness reduction
12477 theWR Width of right thickness reduction
12478 theLtransR Length of right transition part
12479 theLthinR Length of right thin part
12481 theRI Internal radius of incident thickness reduction
12482 theWI Width of incident thickness reduction
12483 theLtransI Length of incident transition part
12484 theLthinI Length of incident thin part
12486 theName Object name; when specified, this parameter is used
12487 for result publication in the study. Otherwise, if automatic
12488 publication is switched on, default value is used for result name.
12491 List of GEOM_Object, containing the created shape and propagation groups.
12494 # create PipeTShape with fillet object
12495 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12496 # create PipeTShape with fillet object with position
12497 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12498 # create PipeTShape with fillet object with left thickness reduction
12499 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)
12501 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)
12502 if (theP1 and theP2 and theP3):
12503 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12504 theRL, theWL, theLtransL, theLthinL,
12505 theRR, theWR, theLtransR, theLthinR,
12506 theRI, theWI, theLtransI, theLthinI,
12507 theRF, theHexMesh, theP1, theP2, theP3)
12509 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12510 theRL, theWL, theLtransL, theLthinL,
12511 theRR, theWR, theLtransR, theLthinR,
12512 theRI, theWI, theLtransI, theLthinI,
12514 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12515 if Parameters: anObj[0].SetParameters(Parameters)
12516 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12517 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12520 ## This function allows creating a disk already divided into blocks. It
12521 # can be used to create divided pipes for later meshing in hexaedra.
12522 # @param theR Radius of the disk
12523 # @param theOrientation Orientation of the plane on which the disk will be built
12524 # 1 = XOY, 2 = OYZ, 3 = OZX
12525 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12526 # @param theName Object name; when specified, this parameter is used
12527 # for result publication in the study. Otherwise, if automatic
12528 # publication is switched on, default value is used for result name.
12530 # @return New GEOM_Object, containing the created shape.
12532 # @ref tui_creation_divideddisk "Example"
12533 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12535 Creates a disk, divided into blocks. It can be used to create divided pipes
12536 for later meshing in hexaedra.
12539 theR Radius of the disk
12540 theOrientation Orientation of the plane on which the disk will be built:
12541 1 = XOY, 2 = OYZ, 3 = OZX
12542 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12543 theName Object name; when specified, this parameter is used
12544 for result publication in the study. Otherwise, if automatic
12545 publication is switched on, default value is used for result name.
12548 New GEOM_Object, containing the created shape.
12550 theR, Parameters = ParseParameters(theR)
12551 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12552 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12553 if Parameters: anObj.SetParameters(Parameters)
12554 self._autoPublish(anObj, theName, "dividedDisk")
12557 ## This function allows creating a disk already divided into blocks. It
12558 # can be used to create divided pipes for later meshing in hexaedra.
12559 # @param theCenter Center of the disk
12560 # @param theVector Normal vector to the plane of the created disk
12561 # @param theRadius Radius of the disk
12562 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12563 # @param theName Object name; when specified, this parameter is used
12564 # for result publication in the study. Otherwise, if automatic
12565 # publication is switched on, default value is used for result name.
12567 # @return New GEOM_Object, containing the created shape.
12569 # @ref tui_creation_divideddisk "Example"
12570 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12572 Creates a disk already divided into blocks. It can be used to create divided pipes
12573 for later meshing in hexaedra.
12576 theCenter Center of the disk
12577 theVector Normal vector to the plane of the created disk
12578 theRadius Radius of the disk
12579 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12580 theName Object name; when specified, this parameter is used
12581 for result publication in the study. Otherwise, if automatic
12582 publication is switched on, default value is used for result name.
12585 New GEOM_Object, containing the created shape.
12587 theRadius, Parameters = ParseParameters(theRadius)
12588 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12589 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12590 if Parameters: anObj.SetParameters(Parameters)
12591 self._autoPublish(anObj, theName, "dividedDisk")
12594 ## Builds a cylinder prepared for hexa meshes
12595 # @param theR Radius of the cylinder
12596 # @param theH Height of the cylinder
12597 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12598 # @param theName Object name; when specified, this parameter is used
12599 # for result publication in the study. Otherwise, if automatic
12600 # publication is switched on, default value is used for result name.
12602 # @return New GEOM_Object, containing the created shape.
12604 # @ref tui_creation_dividedcylinder "Example"
12605 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12607 Builds a cylinder prepared for hexa meshes
12610 theR Radius of the cylinder
12611 theH Height of the cylinder
12612 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12613 theName Object name; when specified, this parameter is used
12614 for result publication in the study. Otherwise, if automatic
12615 publication is switched on, default value is used for result name.
12618 New GEOM_Object, containing the created shape.
12620 theR, theH, Parameters = ParseParameters(theR, theH)
12621 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12622 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12623 if Parameters: anObj.SetParameters(Parameters)
12624 self._autoPublish(anObj, theName, "dividedCylinder")
12627 ## Create a surface from a cloud of points
12628 # @param thelPoints list of points
12629 # @return New GEOM_Object, containing the created shape.
12631 # @ref tui_creation_smoothingsurface "Example"
12632 def MakeSmoothingSurface(self, thelPoints):
12633 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12634 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12637 ## Export a shape to XAO format
12638 # @param shape The shape to export
12639 # @param groups The list of groups to export
12640 # @param fields The list of fields to export
12641 # @param author The author of the export
12642 # @param fileName The name of the file to export
12645 # @ref tui_exportxao "Example"
12646 def ExportXAO(self, shape, groups, fields, author, fileName):
12647 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12648 RaiseIfFailed("ExportXAO", self.InsertOp)
12651 ## Import a shape from XAO format
12652 # @param shape Shape to export
12653 # @param fileName The name of the file to import
12654 # @return tuple (res, shape, subShapes, groups, fields)
12655 # res Flag indicating if the import was successful
12656 # shape The imported shape
12657 # subShapes The list of imported subShapes
12658 # groups The list of imported groups
12659 # fields The list of imported fields
12661 # @ref tui_importxao "Example"
12662 def ImportXAO(self, fileName):
12663 res = self.InsertOp.ImportXAO(fileName)
12664 RaiseIfFailed("ImportXAO", self.InsertOp)
12667 #@@ insert new functions before this line @@ do not remove this line @@#
12669 # end of l4_advanced
12672 ## Create a copy of the given object
12674 # @param theOriginal geometry object for copy
12675 # @param theName Object name; when specified, this parameter is used
12676 # for result publication in the study. Otherwise, if automatic
12677 # publication is switched on, default value is used for result name.
12679 # @return New GEOM_Object, containing the copied shape.
12681 # @ingroup l1_geomBuilder_auxiliary
12682 # @ref swig_MakeCopy "Example"
12683 def MakeCopy(self, theOriginal, theName=None):
12685 Create a copy of the given object
12688 theOriginal geometry object for copy
12689 theName Object name; when specified, this parameter is used
12690 for result publication in the study. Otherwise, if automatic
12691 publication is switched on, default value is used for result name.
12694 New GEOM_Object, containing the copied shape.
12696 Example of usage: Copy = geompy.MakeCopy(Box)
12698 # Example: see GEOM_TestAll.py
12699 anObj = self.InsertOp.MakeCopy(theOriginal)
12700 RaiseIfFailed("MakeCopy", self.InsertOp)
12701 self._autoPublish(anObj, theName, "copy")
12704 ## Add Path to load python scripts from
12705 # @param Path a path to load python scripts from
12706 # @ingroup l1_geomBuilder_auxiliary
12707 def addPath(self,Path):
12709 Add Path to load python scripts from
12712 Path a path to load python scripts from
12714 if (sys.path.count(Path) < 1):
12715 sys.path.append(Path)
12719 ## Load marker texture from the file
12720 # @param Path a path to the texture file
12721 # @return unique texture identifier
12722 # @ingroup l1_geomBuilder_auxiliary
12723 def LoadTexture(self, Path):
12725 Load marker texture from the file
12728 Path a path to the texture file
12731 unique texture identifier
12733 # Example: see GEOM_TestAll.py
12734 ID = self.InsertOp.LoadTexture(Path)
12735 RaiseIfFailed("LoadTexture", self.InsertOp)
12738 ## Get internal name of the object based on its study entry
12739 # @note This method does not provide an unique identifier of the geometry object.
12740 # @note This is internal function of GEOM component, though it can be used outside it for
12741 # appropriate reason (e.g. for identification of geometry object).
12742 # @param obj geometry object
12743 # @return unique object identifier
12744 # @ingroup l1_geomBuilder_auxiliary
12745 def getObjectID(self, obj):
12747 Get internal name of the object based on its study entry.
12748 Note: this method does not provide an unique identifier of the geometry object.
12749 It is an internal function of GEOM component, though it can be used outside GEOM for
12750 appropriate reason (e.g. for identification of geometry object).
12753 obj geometry object
12756 unique object identifier
12759 entry = salome.ObjectToID(obj)
12760 if entry is not None:
12761 lst = entry.split(":")
12763 ID = lst[-1] # -1 means last item in the list
12764 return "GEOM_" + ID
12769 ## Add marker texture. @a Width and @a Height parameters
12770 # specify width and height of the texture in pixels.
12771 # If @a RowData is @c True, @a Texture parameter should represent texture data
12772 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12773 # parameter should be unpacked string, in which '1' symbols represent opaque
12774 # pixels and '0' represent transparent pixels of the texture bitmap.
12776 # @param Width texture width in pixels
12777 # @param Height texture height in pixels
12778 # @param Texture texture data
12779 # @param RowData if @c True, @a Texture data are packed in the byte stream
12780 # @return unique texture identifier
12781 # @ingroup l1_geomBuilder_auxiliary
12782 def AddTexture(self, Width, Height, Texture, RowData=False):
12784 Add marker texture. Width and Height parameters
12785 specify width and height of the texture in pixels.
12786 If RowData is True, Texture parameter should represent texture data
12787 packed into the byte array. If RowData is False (default), Texture
12788 parameter should be unpacked string, in which '1' symbols represent opaque
12789 pixels and '0' represent transparent pixels of the texture bitmap.
12792 Width texture width in pixels
12793 Height texture height in pixels
12794 Texture texture data
12795 RowData if True, Texture data are packed in the byte stream
12798 return unique texture identifier
12800 if not RowData: Texture = PackData(Texture)
12801 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12802 RaiseIfFailed("AddTexture", self.InsertOp)
12805 ## Creates a new folder object. It is a container for any GEOM objects.
12806 # @param Name name of the container
12807 # @param Father parent object. If None,
12808 # folder under 'Geometry' root object will be created.
12809 # @return a new created folder
12810 # @ingroup l1_publish_data
12811 def NewFolder(self, Name, Father=None):
12813 Create a new folder object. It is an auxiliary container for any GEOM objects.
12816 Name name of the container
12817 Father parent object. If None,
12818 folder under 'Geometry' root object will be created.
12821 a new created folder
12823 if not Father: Father = self.father
12824 return self.CreateFolder(Name, Father)
12826 ## Move object to the specified folder
12827 # @param Object object to move
12828 # @param Folder target folder
12829 # @ingroup l1_publish_data
12830 def PutToFolder(self, Object, Folder):
12832 Move object to the specified folder
12835 Object object to move
12836 Folder target folder
12838 self.MoveToFolder(Object, Folder)
12841 ## Move list of objects to the specified folder
12842 # @param ListOfSO list of objects to move
12843 # @param Folder target folder
12844 # @ingroup l1_publish_data
12845 def PutListToFolder(self, ListOfSO, Folder):
12847 Move list of objects to the specified folder
12850 ListOfSO list of objects to move
12851 Folder target folder
12853 self.MoveListToFolder(ListOfSO, Folder)
12856 ## @addtogroup l2_field
12860 # @param shape the shape the field lies on
12861 # @param name the field name
12862 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12863 # @param dimension dimension of the shape the field lies on
12864 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12865 # @param componentNames names of components
12866 # @return a created field
12867 def CreateField(self, shape, name, type, dimension, componentNames):
12872 shape the shape the field lies on
12873 name the field name
12874 type type of field data
12875 dimension dimension of the shape the field lies on
12876 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12877 componentNames names of components
12882 if isinstance( type, int ):
12883 if type < 0 or type > 3:
12884 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12885 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12887 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12888 RaiseIfFailed("CreateField", self.FieldOp)
12890 geom._autoPublish( f, "", name)
12893 ## Removes a field from the GEOM component
12894 # @param field the field to remove
12895 def RemoveField(self, field):
12896 "Removes a field from the GEOM component"
12898 if isinstance( field, GEOM._objref_GEOM_Field ):
12899 geom.RemoveObject( field )
12900 elif isinstance( field, geomField ):
12901 geom.RemoveObject( field.field )
12903 raise RuntimeError, "RemoveField() : the object is not a field"
12906 ## Returns number of fields on a shape
12907 def CountFields(self, shape):
12908 "Returns number of fields on a shape"
12909 nb = self.FieldOp.CountFields( shape )
12910 RaiseIfFailed("CountFields", self.FieldOp)
12913 ## Returns all fields on a shape
12914 def GetFields(self, shape):
12915 "Returns all fields on a shape"
12916 ff = self.FieldOp.GetFields( shape )
12917 RaiseIfFailed("GetFields", self.FieldOp)
12920 ## Returns a field on a shape by its name
12921 def GetField(self, shape, name):
12922 "Returns a field on a shape by its name"
12923 f = self.FieldOp.GetField( shape, name )
12924 RaiseIfFailed("GetField", self.FieldOp)
12932 # Register the new proxy for GEOM_Gen
12933 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12936 ## Field on Geometry
12937 # @ingroup l2_field
12938 class geomField( GEOM._objref_GEOM_Field ):
12940 def __init__(self):
12941 GEOM._objref_GEOM_Field.__init__(self)
12942 self.field = GEOM._objref_GEOM_Field
12945 ## Returns the shape the field lies on
12946 def getShape(self):
12947 "Returns the shape the field lies on"
12948 return self.field.GetShape(self)
12950 ## Returns the field name
12952 "Returns the field name"
12953 return self.field.GetName(self)
12955 ## Returns type of field data as integer [0-3]
12957 "Returns type of field data"
12958 return self.field.GetDataType(self)._v
12960 ## Returns type of field data:
12961 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12962 def getTypeEnum(self):
12963 "Returns type of field data"
12964 return self.field.GetDataType(self)
12966 ## Returns dimension of the shape the field lies on:
12967 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12968 def getDimension(self):
12969 """Returns dimension of the shape the field lies on:
12970 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12971 return self.field.GetDimension(self)
12973 ## Returns names of components
12974 def getComponents(self):
12975 "Returns names of components"
12976 return self.field.GetComponents(self)
12978 ## Adds a time step to the field
12979 # @param step the time step number futher used as the step identifier
12980 # @param stamp the time step time
12981 # @param values the values of the time step
12982 def addStep(self, step, stamp, values):
12983 "Adds a time step to the field"
12984 stp = self.field.AddStep( self, step, stamp )
12986 raise RuntimeError, \
12987 "Field.addStep() : Error: step %s already exists in this field"%step
12989 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12990 self.setValues( step, values )
12993 ## Remove a time step from the field
12994 def removeStep(self,step):
12995 "Remove a time step from the field"
12998 stepObj = self.field.GetStep( self, step )
13000 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13003 #traceback.print_exc()
13005 self.field.RemoveStep( self, step )
13007 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13010 ## Returns number of time steps in the field
13011 def countSteps(self):
13012 "Returns number of time steps in the field"
13013 return self.field.CountSteps(self)
13015 ## Returns a list of time step IDs in the field
13016 def getSteps(self):
13017 "Returns a list of time step IDs in the field"
13018 return self.field.GetSteps(self)
13020 ## Returns a time step by its ID
13021 def getStep(self,step):
13022 "Returns a time step by its ID"
13023 stp = self.field.GetStep(self, step)
13025 raise RuntimeError, "Step %s is missing from this field"%step
13028 ## Returns the time of the field step
13029 def getStamp(self,step):
13030 "Returns the time of the field step"
13031 return self.getStep(step).GetStamp()
13033 ## Changes the time of the field step
13034 def setStamp(self, step, stamp):
13035 "Changes the time of the field step"
13036 return self.getStep(step).SetStamp(stamp)
13038 ## Returns values of the field step
13039 def getValues(self, step):
13040 "Returns values of the field step"
13041 return self.getStep(step).GetValues()
13043 ## Changes values of the field step
13044 def setValues(self, step, values):
13045 "Changes values of the field step"
13046 stp = self.getStep(step)
13047 errBeg = "Field.setValues(values) : Error: "
13049 ok = stp.SetValues( values )
13050 except Exception, e:
13052 if excStr.find("WrongPythonType") > 0:
13053 raise RuntimeError, errBeg +\
13054 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13055 raise RuntimeError, errBeg + str(e)
13057 nbOK = self.field.GetArraySize(self)
13060 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13062 raise RuntimeError, errBeg + "failed"
13065 pass # end of class geomField
13067 # Register the new proxy for GEOM_Field
13068 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13071 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13072 # interface to GEOM operations.
13077 # salome.salome_init()
13078 # from salome.geom import geomBuilder
13079 # geompy = geomBuilder.New(salome.myStudy)
13081 # @param study SALOME study, generally obtained by salome.myStudy.
13082 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13083 # @return geomBuilder instance
13084 def New( study, instance=None):
13086 Create a new geomBuilder instance.The geomBuilder class provides the Python
13087 interface to GEOM operations.
13091 salome.salome_init()
13092 from salome.geom import geomBuilder
13093 geompy = geomBuilder.New(salome.myStudy)
13096 study SALOME study, generally obtained by salome.myStudy.
13097 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13099 geomBuilder instance
13101 #print "New geomBuilder ", study, instance
13108 geom = geomBuilder()
13109 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13110 geom.init_geom(study)