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).
7118 # @param checkSelfInte The flag that tells if the arguments should
7119 # be checked for self-intersection prior to the operation.
7121 # @note This algorithm doesn't find all types of self-intersections.
7122 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7123 # vertex/face and edge/face intersections. Face/face
7124 # intersections detection is switched off as it is a
7125 # time-consuming operation that gives an impact on performance.
7126 # To find all self-intersections please use
7127 # CheckSelfIntersections() method.
7129 # @param theName Object name; when specified, this parameter is used
7130 # for result publication in the study. Otherwise, if automatic
7131 # publication is switched on, default value is used for result name.
7133 # @note Each compound from ListShapes and ListTools will be exploded
7134 # in order to avoid possible intersection between shapes from this compound.
7136 # After implementation new version of PartitionAlgo (October 2006)
7137 # other parameters are ignored by current functionality. They are kept
7138 # in this function only for support old versions.
7139 # @param ListKeepInside Shapes, outside which the results will be deleted.
7140 # Each shape from theKeepInside must belong to theShapes also.
7141 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7142 # Each shape from theRemoveInside must belong to theShapes also.
7143 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7144 # @param ListMaterials Material indices for each shape. Make sence,
7145 # only if theRemoveWebs is TRUE.
7147 # @return New GEOM.GEOM_Object, containing the result shapes.
7149 # @ref tui_partition "Example"
7150 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7151 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7152 KeepNonlimitShapes=0, checkSelfInte=False, theName=None):
7154 Perform partition operation.
7157 ListShapes Shapes to be intersected.
7158 ListTools Shapes to intersect theShapes.
7159 Limit Type of resulting shapes (see geompy.ShapeType)
7160 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7161 type will be detected automatically.
7162 KeepNonlimitShapes if this parameter == 0, then only shapes of
7163 target type (equal to Limit) are kept in the result,
7164 else standalone shapes of lower dimension
7165 are kept also (if they exist).
7166 checkSelfInte The flag that tells if the arguments should
7167 be checked for self-intersection prior to
7171 This algorithm doesn't find all types of self-intersections.
7172 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7173 vertex/face and edge/face intersections. Face/face
7174 intersections detection is switched off as it is a
7175 time-consuming operation that gives an impact on performance.
7176 To find all self-intersections please use
7177 CheckSelfIntersections() method.
7179 theName Object name; when specified, this parameter is used
7180 for result publication in the study. Otherwise, if automatic
7181 publication is switched on, default value is used for result name.
7183 Each compound from ListShapes and ListTools will be exploded
7184 in order to avoid possible intersection between shapes from
7187 After implementation new version of PartitionAlgo (October 2006) other
7188 parameters are ignored by current functionality. They are kept in this
7189 function only for support old versions.
7192 ListKeepInside Shapes, outside which the results will be deleted.
7193 Each shape from theKeepInside must belong to theShapes also.
7194 ListRemoveInside Shapes, inside which the results will be deleted.
7195 Each shape from theRemoveInside must belong to theShapes also.
7196 RemoveWebs If TRUE, perform Glue 3D algorithm.
7197 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7200 New GEOM.GEOM_Object, containing the result shapes.
7202 # Example: see GEOM_TestAll.py
7203 if Limit == self.ShapeType["AUTO"]:
7204 # automatic detection of the most appropriate shape limit type
7206 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7207 Limit = EnumToLong(lim)
7209 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7210 ListKeepInside, ListRemoveInside,
7211 Limit, RemoveWebs, ListMaterials,
7212 KeepNonlimitShapes, checkSelfInte);
7213 RaiseIfFailed("MakePartition", self.BoolOp)
7214 self._autoPublish(anObj, theName, "partition")
7217 ## Perform partition operation.
7218 # This method may be useful if it is needed to make a partition for
7219 # compound contains nonintersected shapes. Performance will be better
7220 # since intersection between shapes from compound is not performed.
7222 # Description of all parameters as in previous method MakePartition()
7224 # @note Passed compounds (via ListShapes or via ListTools)
7225 # have to consist of nonintersecting shapes.
7227 # @return New GEOM.GEOM_Object, containing the result shapes.
7229 # @ref swig_todo "Example"
7230 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7231 ListKeepInside=[], ListRemoveInside=[],
7232 Limit=ShapeType["AUTO"], RemoveWebs=0,
7233 ListMaterials=[], KeepNonlimitShapes=0,
7234 checkSelfInte=False, theName=None):
7236 Perform partition operation.
7237 This method may be useful if it is needed to make a partition for
7238 compound contains nonintersected shapes. Performance will be better
7239 since intersection between shapes from compound is not performed.
7242 Description of all parameters as in method geompy.MakePartition
7245 Passed compounds (via ListShapes or via ListTools)
7246 have to consist of nonintersecting shapes.
7249 New GEOM.GEOM_Object, containing the result shapes.
7251 if Limit == self.ShapeType["AUTO"]:
7252 # automatic detection of the most appropriate shape limit type
7254 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7255 Limit = EnumToLong(lim)
7257 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7258 ListKeepInside, ListRemoveInside,
7259 Limit, RemoveWebs, ListMaterials,
7260 KeepNonlimitShapes, checkSelfInte);
7261 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7262 self._autoPublish(anObj, theName, "partition")
7265 ## See method MakePartition() for more information.
7267 # @ref tui_partition "Example 1"
7268 # \n @ref swig_Partition "Example 2"
7269 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7270 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7271 KeepNonlimitShapes=0, checkSelfInte=False, theName=None):
7273 See method geompy.MakePartition for more information.
7275 # Example: see GEOM_TestOthers.py
7276 # note: auto-publishing is done in self.MakePartition()
7277 anObj = self.MakePartition(ListShapes, ListTools,
7278 ListKeepInside, ListRemoveInside,
7279 Limit, RemoveWebs, ListMaterials,
7280 KeepNonlimitShapes, checkSelfInte,
7284 ## Perform partition of the Shape with the Plane
7285 # @param theShape Shape to be intersected.
7286 # @param thePlane Tool shape, to intersect theShape.
7287 # @param checkSelfInte The flag that tells if the arguments should
7288 # be checked for self-intersection prior to the operation.
7289 # @param theName Object name; when specified, this parameter is used
7290 # for result publication in the study. Otherwise, if automatic
7291 # publication is switched on, default value is used for result name.
7293 # @note This algorithm doesn't find all types of self-intersections.
7294 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7295 # vertex/face and edge/face intersections. Face/face
7296 # intersections detection is switched off as it is a
7297 # time-consuming operation that gives an impact on performance.
7298 # To find all self-intersections please use
7299 # CheckSelfIntersections() method.
7301 # @return New GEOM.GEOM_Object, containing the result shape.
7303 # @ref tui_partition "Example"
7304 def MakeHalfPartition(self, theShape, thePlane, checkSelfInte=False, theName=None):
7306 Perform partition of the Shape with the Plane
7309 theShape Shape to be intersected.
7310 thePlane Tool shape, to intersect theShape.
7311 checkSelfInte The flag that tells if the arguments should
7312 be checked for self-intersection prior to
7314 theName Object name; when specified, this parameter is used
7315 for result publication in the study. Otherwise, if automatic
7316 publication is switched on, default value is used for result name.
7319 This algorithm doesn't find all types of self-intersections.
7320 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7321 vertex/face and edge/face intersections. Face/face
7322 intersections detection is switched off as it is a
7323 time-consuming operation that gives an impact on performance.
7324 To find all self-intersections please use
7325 CheckSelfIntersections() method.
7328 New GEOM.GEOM_Object, containing the result shape.
7330 # Example: see GEOM_TestAll.py
7331 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane, checkSelfInte)
7332 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7333 self._autoPublish(anObj, theName, "partition")
7336 # end of l3_basic_op
7339 ## @addtogroup l3_transform
7342 ## Translate the given object along the vector, specified
7343 # by its end points.
7344 # @param theObject The object to be translated.
7345 # @param thePoint1 Start point of translation vector.
7346 # @param thePoint2 End point of translation vector.
7347 # @param theCopy Flag used to translate object itself or create a copy.
7348 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7349 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7350 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7352 Translate the given object along the vector, specified by its end points.
7355 theObject The object to be translated.
7356 thePoint1 Start point of translation vector.
7357 thePoint2 End point of translation vector.
7358 theCopy Flag used to translate object itself or create a copy.
7361 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7362 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7365 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7367 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7368 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7371 ## Translate the given object along the vector, specified
7372 # by its end points, creating its copy before the translation.
7373 # @param theObject The object to be translated.
7374 # @param thePoint1 Start point of translation vector.
7375 # @param thePoint2 End point of translation vector.
7376 # @param theName Object name; when specified, this parameter is used
7377 # for result publication in the study. Otherwise, if automatic
7378 # publication is switched on, default value is used for result name.
7380 # @return New GEOM.GEOM_Object, containing the translated object.
7382 # @ref tui_translation "Example 1"
7383 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7384 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7386 Translate the given object along the vector, specified
7387 by its end points, creating its copy before the translation.
7390 theObject The object to be translated.
7391 thePoint1 Start point of translation vector.
7392 thePoint2 End point of translation vector.
7393 theName Object name; when specified, this parameter is used
7394 for result publication in the study. Otherwise, if automatic
7395 publication is switched on, default value is used for result name.
7398 New GEOM.GEOM_Object, containing the translated object.
7400 # Example: see GEOM_TestAll.py
7401 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7402 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7403 self._autoPublish(anObj, theName, "translated")
7406 ## Translate the given object along the vector, specified by its components.
7407 # @param theObject The object to be translated.
7408 # @param theDX,theDY,theDZ Components of translation vector.
7409 # @param theCopy Flag used to translate object itself or create a copy.
7410 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7411 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7413 # @ref tui_translation "Example"
7414 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7416 Translate the given object along the vector, specified by its components.
7419 theObject The object to be translated.
7420 theDX,theDY,theDZ Components of translation vector.
7421 theCopy Flag used to translate object itself or create a copy.
7424 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7425 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7427 # Example: see GEOM_TestAll.py
7428 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7430 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7432 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7433 anObj.SetParameters(Parameters)
7434 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7437 ## Translate the given object along the vector, specified
7438 # by its components, creating its copy before the translation.
7439 # @param theObject The object to be translated.
7440 # @param theDX,theDY,theDZ Components of translation vector.
7441 # @param theName Object name; when specified, this parameter is used
7442 # for result publication in the study. Otherwise, if automatic
7443 # publication is switched on, default value is used for result name.
7445 # @return New GEOM.GEOM_Object, containing the translated object.
7447 # @ref tui_translation "Example"
7448 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7450 Translate the given object along the vector, specified
7451 by its components, creating its copy before the translation.
7454 theObject The object to be translated.
7455 theDX,theDY,theDZ Components of translation vector.
7456 theName Object name; when specified, this parameter is used
7457 for result publication in the study. Otherwise, if automatic
7458 publication is switched on, default value is used for result name.
7461 New GEOM.GEOM_Object, containing the translated object.
7463 # Example: see GEOM_TestAll.py
7464 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7465 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7466 anObj.SetParameters(Parameters)
7467 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7468 self._autoPublish(anObj, theName, "translated")
7471 ## Translate the given object along the given vector.
7472 # @param theObject The object to be translated.
7473 # @param theVector The translation vector.
7474 # @param theCopy Flag used to translate object itself or create a copy.
7475 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7476 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7477 def TranslateVector(self, theObject, theVector, theCopy=False):
7479 Translate the given object along the given vector.
7482 theObject The object to be translated.
7483 theVector The translation vector.
7484 theCopy Flag used to translate object itself or create a copy.
7487 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7488 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7491 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7493 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7494 RaiseIfFailed("TranslateVector", self.TrsfOp)
7497 ## Translate the given object along the given vector,
7498 # creating its copy before the translation.
7499 # @param theObject The object to be translated.
7500 # @param theVector The translation vector.
7501 # @param theName Object name; when specified, this parameter is used
7502 # for result publication in the study. Otherwise, if automatic
7503 # publication is switched on, default value is used for result name.
7505 # @return New GEOM.GEOM_Object, containing the translated object.
7507 # @ref tui_translation "Example"
7508 def MakeTranslationVector(self, theObject, theVector, theName=None):
7510 Translate the given object along the given vector,
7511 creating its copy before the translation.
7514 theObject The object to be translated.
7515 theVector The translation vector.
7516 theName Object name; when specified, this parameter is used
7517 for result publication in the study. Otherwise, if automatic
7518 publication is switched on, default value is used for result name.
7521 New GEOM.GEOM_Object, containing the translated object.
7523 # Example: see GEOM_TestAll.py
7524 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7525 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7526 self._autoPublish(anObj, theName, "translated")
7529 ## Translate the given object along the given vector on given distance.
7530 # @param theObject The object to be translated.
7531 # @param theVector The translation vector.
7532 # @param theDistance The translation distance.
7533 # @param theCopy Flag used to translate object itself or create a copy.
7534 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7535 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7537 # @ref tui_translation "Example"
7538 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7540 Translate the given object along the given vector on given distance.
7543 theObject The object to be translated.
7544 theVector The translation vector.
7545 theDistance The translation distance.
7546 theCopy Flag used to translate object itself or create a copy.
7549 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7550 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7552 # Example: see GEOM_TestAll.py
7553 theDistance,Parameters = ParseParameters(theDistance)
7554 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7555 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7556 anObj.SetParameters(Parameters)
7559 ## Translate the given object along the given vector on given distance,
7560 # creating its copy before the translation.
7561 # @param theObject The object to be translated.
7562 # @param theVector The translation vector.
7563 # @param theDistance The translation distance.
7564 # @param theName Object name; when specified, this parameter is used
7565 # for result publication in the study. Otherwise, if automatic
7566 # publication is switched on, default value is used for result name.
7568 # @return New GEOM.GEOM_Object, containing the translated object.
7570 # @ref tui_translation "Example"
7571 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7573 Translate the given object along the given vector on given distance,
7574 creating its copy before the translation.
7577 theObject The object to be translated.
7578 theVector The translation vector.
7579 theDistance The translation distance.
7580 theName Object name; when specified, this parameter is used
7581 for result publication in the study. Otherwise, if automatic
7582 publication is switched on, default value is used for result name.
7585 New GEOM.GEOM_Object, containing the translated object.
7587 # Example: see GEOM_TestAll.py
7588 theDistance,Parameters = ParseParameters(theDistance)
7589 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7590 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7591 anObj.SetParameters(Parameters)
7592 self._autoPublish(anObj, theName, "translated")
7595 ## Rotate the given object around the given axis on the given angle.
7596 # @param theObject The object to be rotated.
7597 # @param theAxis Rotation axis.
7598 # @param theAngle Rotation angle in radians.
7599 # @param theCopy Flag used to rotate object itself or create a copy.
7601 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7602 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7604 # @ref tui_rotation "Example"
7605 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7607 Rotate the given object around the given axis on the given angle.
7610 theObject The object to be rotated.
7611 theAxis Rotation axis.
7612 theAngle Rotation angle in radians.
7613 theCopy Flag used to rotate object itself or create a copy.
7616 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7617 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7619 # Example: see GEOM_TestAll.py
7621 if isinstance(theAngle,str):
7623 theAngle, Parameters = ParseParameters(theAngle)
7625 theAngle = theAngle*math.pi/180.0
7627 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7629 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7630 RaiseIfFailed("Rotate", self.TrsfOp)
7631 anObj.SetParameters(Parameters)
7634 ## Rotate the given object around the given axis
7635 # on the given angle, creating its copy before the rotatation.
7636 # @param theObject The object to be rotated.
7637 # @param theAxis Rotation axis.
7638 # @param theAngle Rotation angle in radians.
7639 # @param theName Object name; when specified, this parameter is used
7640 # for result publication in the study. Otherwise, if automatic
7641 # publication is switched on, default value is used for result name.
7643 # @return New GEOM.GEOM_Object, containing the rotated object.
7645 # @ref tui_rotation "Example"
7646 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7648 Rotate the given object around the given axis
7649 on the given angle, creating its copy before the rotatation.
7652 theObject The object to be rotated.
7653 theAxis Rotation axis.
7654 theAngle Rotation angle in radians.
7655 theName Object name; when specified, this parameter is used
7656 for result publication in the study. Otherwise, if automatic
7657 publication is switched on, default value is used for result name.
7660 New GEOM.GEOM_Object, containing the rotated object.
7662 # Example: see GEOM_TestAll.py
7664 if isinstance(theAngle,str):
7666 theAngle, Parameters = ParseParameters(theAngle)
7668 theAngle = theAngle*math.pi/180.0
7669 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7670 RaiseIfFailed("RotateCopy", self.TrsfOp)
7671 anObj.SetParameters(Parameters)
7672 self._autoPublish(anObj, theName, "rotated")
7675 ## Rotate given object around vector perpendicular to plane
7676 # containing three points.
7677 # @param theObject The object to be rotated.
7678 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7679 # containing the three points.
7680 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7681 # @param theCopy Flag used to rotate object itself or create a copy.
7682 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7683 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7684 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7686 Rotate given object around vector perpendicular to plane
7687 containing three points.
7690 theObject The object to be rotated.
7691 theCentPoint central point the axis is the vector perpendicular to the plane
7692 containing the three points.
7693 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7694 theCopy Flag used to rotate object itself or create a copy.
7697 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7698 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7701 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7703 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7704 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7707 ## Rotate given object around vector perpendicular to plane
7708 # containing three points, creating its copy before the rotatation.
7709 # @param theObject The object to be rotated.
7710 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7711 # containing the three points.
7712 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7713 # @param theName Object name; when specified, this parameter is used
7714 # for result publication in the study. Otherwise, if automatic
7715 # publication is switched on, default value is used for result name.
7717 # @return New GEOM.GEOM_Object, containing the rotated object.
7719 # @ref tui_rotation "Example"
7720 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7722 Rotate given object around vector perpendicular to plane
7723 containing three points, creating its copy before the rotatation.
7726 theObject The object to be rotated.
7727 theCentPoint central point the axis is the vector perpendicular to the plane
7728 containing the three points.
7729 thePoint1,thePoint2 in a perpendicular plane of the axis.
7730 theName Object name; when specified, this parameter is used
7731 for result publication in the study. Otherwise, if automatic
7732 publication is switched on, default value is used for result name.
7735 New GEOM.GEOM_Object, containing the rotated object.
7737 # Example: see GEOM_TestAll.py
7738 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7739 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7740 self._autoPublish(anObj, theName, "rotated")
7743 ## Scale the given object by the specified factor.
7744 # @param theObject The object to be scaled.
7745 # @param thePoint Center point for scaling.
7746 # Passing None for it means scaling relatively the origin of global CS.
7747 # @param theFactor Scaling factor value.
7748 # @param theCopy Flag used to scale object itself or create a copy.
7749 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7750 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7751 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7753 Scale the given object by the specified factor.
7756 theObject The object to be scaled.
7757 thePoint Center point for scaling.
7758 Passing None for it means scaling relatively the origin of global CS.
7759 theFactor Scaling factor value.
7760 theCopy Flag used to scale object itself or create a copy.
7763 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7764 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7766 # Example: see GEOM_TestAll.py
7767 theFactor, Parameters = ParseParameters(theFactor)
7769 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7771 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7772 RaiseIfFailed("Scale", self.TrsfOp)
7773 anObj.SetParameters(Parameters)
7776 ## Scale the given object by the factor, creating its copy before the scaling.
7777 # @param theObject The object to be scaled.
7778 # @param thePoint Center point for scaling.
7779 # Passing None for it means scaling relatively the origin of global CS.
7780 # @param theFactor Scaling factor value.
7781 # @param theName Object name; when specified, this parameter is used
7782 # for result publication in the study. Otherwise, if automatic
7783 # publication is switched on, default value is used for result name.
7785 # @return New GEOM.GEOM_Object, containing the scaled shape.
7787 # @ref tui_scale "Example"
7788 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7790 Scale the given object by the factor, creating its copy before the scaling.
7793 theObject The object to be scaled.
7794 thePoint Center point for scaling.
7795 Passing None for it means scaling relatively the origin of global CS.
7796 theFactor Scaling factor value.
7797 theName Object name; when specified, this parameter is used
7798 for result publication in the study. Otherwise, if automatic
7799 publication is switched on, default value is used for result name.
7802 New GEOM.GEOM_Object, containing the scaled shape.
7804 # Example: see GEOM_TestAll.py
7805 theFactor, Parameters = ParseParameters(theFactor)
7806 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7807 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7808 anObj.SetParameters(Parameters)
7809 self._autoPublish(anObj, theName, "scaled")
7812 ## Scale the given object by different factors along coordinate axes.
7813 # @param theObject The object to be scaled.
7814 # @param thePoint Center point for scaling.
7815 # Passing None for it means scaling relatively the origin of global CS.
7816 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7817 # @param theCopy Flag used to scale object itself or create a copy.
7818 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7819 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7820 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7822 Scale the given object by different factors along coordinate axes.
7825 theObject The object to be scaled.
7826 thePoint Center point for scaling.
7827 Passing None for it means scaling relatively the origin of global CS.
7828 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7829 theCopy Flag used to scale object itself or create a copy.
7832 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7833 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7835 # Example: see GEOM_TestAll.py
7836 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7838 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7839 theFactorX, theFactorY, theFactorZ)
7841 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7842 theFactorX, theFactorY, theFactorZ)
7843 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7844 anObj.SetParameters(Parameters)
7847 ## Scale the given object by different factors along coordinate axes,
7848 # creating its copy before the scaling.
7849 # @param theObject The object to be scaled.
7850 # @param thePoint Center point for scaling.
7851 # Passing None for it means scaling relatively the origin of global CS.
7852 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7853 # @param theName Object name; when specified, this parameter is used
7854 # for result publication in the study. Otherwise, if automatic
7855 # publication is switched on, default value is used for result name.
7857 # @return New GEOM.GEOM_Object, containing the scaled shape.
7859 # @ref swig_scale "Example"
7860 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7862 Scale the given object by different factors along coordinate axes,
7863 creating its copy before the scaling.
7866 theObject The object to be scaled.
7867 thePoint Center point for scaling.
7868 Passing None for it means scaling relatively the origin of global CS.
7869 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7870 theName Object name; when specified, this parameter is used
7871 for result publication in the study. Otherwise, if automatic
7872 publication is switched on, default value is used for result name.
7875 New GEOM.GEOM_Object, containing the scaled shape.
7877 # Example: see GEOM_TestAll.py
7878 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7879 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7880 theFactorX, theFactorY, theFactorZ)
7881 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7882 anObj.SetParameters(Parameters)
7883 self._autoPublish(anObj, theName, "scaled")
7886 ## Mirror an object relatively the given plane.
7887 # @param theObject The object to be mirrored.
7888 # @param thePlane Plane of symmetry.
7889 # @param theCopy Flag used to mirror object itself or create a copy.
7890 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7891 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7892 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7894 Mirror an object relatively the given plane.
7897 theObject The object to be mirrored.
7898 thePlane Plane of symmetry.
7899 theCopy Flag used to mirror object itself or create a copy.
7902 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7903 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7906 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7908 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7909 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7912 ## Create an object, symmetrical
7913 # to the given one relatively the given plane.
7914 # @param theObject The object to be mirrored.
7915 # @param thePlane Plane of symmetry.
7916 # @param theName Object name; when specified, this parameter is used
7917 # for result publication in the study. Otherwise, if automatic
7918 # publication is switched on, default value is used for result name.
7920 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7922 # @ref tui_mirror "Example"
7923 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7925 Create an object, symmetrical to the given one relatively the given plane.
7928 theObject The object to be mirrored.
7929 thePlane Plane of symmetry.
7930 theName Object name; when specified, this parameter is used
7931 for result publication in the study. Otherwise, if automatic
7932 publication is switched on, default value is used for result name.
7935 New GEOM.GEOM_Object, containing the mirrored shape.
7937 # Example: see GEOM_TestAll.py
7938 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7939 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7940 self._autoPublish(anObj, theName, "mirrored")
7943 ## Mirror an object relatively the given axis.
7944 # @param theObject The object to be mirrored.
7945 # @param theAxis Axis of symmetry.
7946 # @param theCopy Flag used to mirror object itself or create a copy.
7947 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7948 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7949 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7951 Mirror an object relatively the given axis.
7954 theObject The object to be mirrored.
7955 theAxis Axis of symmetry.
7956 theCopy Flag used to mirror object itself or create a copy.
7959 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7960 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7963 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7965 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7966 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7969 ## Create an object, symmetrical
7970 # to the given one relatively the given axis.
7971 # @param theObject The object to be mirrored.
7972 # @param theAxis Axis of symmetry.
7973 # @param theName Object name; when specified, this parameter is used
7974 # for result publication in the study. Otherwise, if automatic
7975 # publication is switched on, default value is used for result name.
7977 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7979 # @ref tui_mirror "Example"
7980 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7982 Create an object, symmetrical to the given one relatively the given axis.
7985 theObject The object to be mirrored.
7986 theAxis Axis of symmetry.
7987 theName Object name; when specified, this parameter is used
7988 for result publication in the study. Otherwise, if automatic
7989 publication is switched on, default value is used for result name.
7992 New GEOM.GEOM_Object, containing the mirrored shape.
7994 # Example: see GEOM_TestAll.py
7995 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7996 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7997 self._autoPublish(anObj, theName, "mirrored")
8000 ## Mirror an object relatively the given point.
8001 # @param theObject The object to be mirrored.
8002 # @param thePoint Point of symmetry.
8003 # @param theCopy Flag used to mirror object itself or create a copy.
8004 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8005 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8006 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8008 Mirror an object relatively the given point.
8011 theObject The object to be mirrored.
8012 thePoint Point of symmetry.
8013 theCopy Flag used to mirror object itself or create a copy.
8016 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8017 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8019 # Example: see GEOM_TestAll.py
8021 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8023 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8024 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8027 ## Create an object, symmetrical
8028 # to the given one relatively the given point.
8029 # @param theObject The object to be mirrored.
8030 # @param thePoint Point of symmetry.
8031 # @param theName Object name; when specified, this parameter is used
8032 # for result publication in the study. Otherwise, if automatic
8033 # publication is switched on, default value is used for result name.
8035 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8037 # @ref tui_mirror "Example"
8038 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8040 Create an object, symmetrical
8041 to the given one relatively the given point.
8044 theObject The object to be mirrored.
8045 thePoint Point of symmetry.
8046 theName Object name; when specified, this parameter is used
8047 for result publication in the study. Otherwise, if automatic
8048 publication is switched on, default value is used for result name.
8051 New GEOM.GEOM_Object, containing the mirrored shape.
8053 # Example: see GEOM_TestAll.py
8054 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8055 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8056 self._autoPublish(anObj, theName, "mirrored")
8059 ## Modify the location of the given object.
8060 # @param theObject The object to be displaced.
8061 # @param theStartLCS Coordinate system to perform displacement from it.\n
8062 # If \a theStartLCS is NULL, displacement
8063 # will be performed from global CS.\n
8064 # If \a theObject itself is used as \a theStartLCS,
8065 # its location will be changed to \a theEndLCS.
8066 # @param theEndLCS Coordinate system to perform displacement to it.
8067 # @param theCopy Flag used to displace object itself or create a copy.
8068 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8069 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8070 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8072 Modify the Location of the given object by LCS, creating its copy before the setting.
8075 theObject The object to be displaced.
8076 theStartLCS Coordinate system to perform displacement from it.
8077 If theStartLCS is NULL, displacement
8078 will be performed from global CS.
8079 If theObject itself is used as theStartLCS,
8080 its location will be changed to theEndLCS.
8081 theEndLCS Coordinate system to perform displacement to it.
8082 theCopy Flag used to displace object itself or create a copy.
8085 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8086 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8088 # Example: see GEOM_TestAll.py
8090 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8092 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8093 RaiseIfFailed("Displace", self.TrsfOp)
8096 ## Modify the Location of the given object by LCS,
8097 # creating its copy before the setting.
8098 # @param theObject The object to be displaced.
8099 # @param theStartLCS Coordinate system to perform displacement from it.\n
8100 # If \a theStartLCS is NULL, displacement
8101 # will be performed from global CS.\n
8102 # If \a theObject itself is used as \a theStartLCS,
8103 # its location will be changed to \a theEndLCS.
8104 # @param theEndLCS Coordinate system to perform displacement to it.
8105 # @param theName Object name; when specified, this parameter is used
8106 # for result publication in the study. Otherwise, if automatic
8107 # publication is switched on, default value is used for result name.
8109 # @return New GEOM.GEOM_Object, containing the displaced shape.
8111 # @ref tui_modify_location "Example"
8112 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8114 Modify the Location of the given object by LCS, creating its copy before the setting.
8117 theObject The object to be displaced.
8118 theStartLCS Coordinate system to perform displacement from it.
8119 If theStartLCS is NULL, displacement
8120 will be performed from global CS.
8121 If theObject itself is used as theStartLCS,
8122 its location will be changed to theEndLCS.
8123 theEndLCS Coordinate system to perform displacement to it.
8124 theName Object name; when specified, this parameter is used
8125 for result publication in the study. Otherwise, if automatic
8126 publication is switched on, default value is used for result name.
8129 New GEOM.GEOM_Object, containing the displaced shape.
8132 # create local coordinate systems
8133 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8134 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8135 # modify the location of the given object
8136 position = geompy.MakePosition(cylinder, cs1, cs2)
8138 # Example: see GEOM_TestAll.py
8139 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8140 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8141 self._autoPublish(anObj, theName, "displaced")
8144 ## Modify the Location of the given object by Path.
8145 # @param theObject The object to be displaced.
8146 # @param thePath Wire or Edge along that the object will be translated.
8147 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8148 # @param theCopy is to create a copy objects if true.
8149 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8150 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8151 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8153 # @ref tui_modify_location "Example"
8154 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8156 Modify the Location of the given object by Path.
8159 theObject The object to be displaced.
8160 thePath Wire or Edge along that the object will be translated.
8161 theDistance progress of Path (0 = start location, 1 = end of path location).
8162 theCopy is to create a copy objects if true.
8163 theReverse 0 - for usual direction, 1 - to reverse path direction.
8166 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8167 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8170 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8172 # Example: see GEOM_TestAll.py
8173 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8174 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8177 ## Modify the Location of the given object by Path, creating its copy before the operation.
8178 # @param theObject The object to be displaced.
8179 # @param thePath Wire or Edge along that the object will be translated.
8180 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8181 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8182 # @param theName Object name; when specified, this parameter is used
8183 # for result publication in the study. Otherwise, if automatic
8184 # publication is switched on, default value is used for result name.
8186 # @return New GEOM.GEOM_Object, containing the displaced shape.
8187 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8189 Modify the Location of the given object by Path, creating its copy before the operation.
8192 theObject The object to be displaced.
8193 thePath Wire or Edge along that the object will be translated.
8194 theDistance progress of Path (0 = start location, 1 = end of path location).
8195 theReverse 0 - for usual direction, 1 - to reverse path direction.
8196 theName Object name; when specified, this parameter is used
8197 for result publication in the study. Otherwise, if automatic
8198 publication is switched on, default value is used for result name.
8201 New GEOM.GEOM_Object, containing the displaced shape.
8203 # Example: see GEOM_TestAll.py
8204 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8205 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8206 self._autoPublish(anObj, theName, "displaced")
8209 ## Offset given shape.
8210 # @param theObject The base object for the offset.
8211 # @param theOffset Offset value.
8212 # @param theCopy Flag used to offset object itself or create a copy.
8213 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8214 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8215 def Offset(self, theObject, theOffset, theCopy=False):
8220 theObject The base object for the offset.
8221 theOffset Offset value.
8222 theCopy Flag used to offset object itself or create a copy.
8225 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8226 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8228 theOffset, Parameters = ParseParameters(theOffset)
8230 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8232 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8233 RaiseIfFailed("Offset", self.TrsfOp)
8234 anObj.SetParameters(Parameters)
8237 ## Create new object as offset of the given one.
8238 # @param theObject The base object for the offset.
8239 # @param theOffset Offset value.
8240 # @param theName Object name; when specified, this parameter is used
8241 # for result publication in the study. Otherwise, if automatic
8242 # publication is switched on, default value is used for result name.
8244 # @return New GEOM.GEOM_Object, containing the offset object.
8246 # @ref tui_offset "Example"
8247 def MakeOffset(self, theObject, theOffset, theName=None):
8249 Create new object as offset of the given one.
8252 theObject The base object for the offset.
8253 theOffset Offset value.
8254 theName Object name; when specified, this parameter is used
8255 for result publication in the study. Otherwise, if automatic
8256 publication is switched on, default value is used for result name.
8259 New GEOM.GEOM_Object, containing the offset object.
8262 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8263 # create a new object as offset of the given object
8264 offset = geompy.MakeOffset(box, 70.)
8266 # Example: see GEOM_TestAll.py
8267 theOffset, Parameters = ParseParameters(theOffset)
8268 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8269 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8270 anObj.SetParameters(Parameters)
8271 self._autoPublish(anObj, theName, "offset")
8274 ## Create new object as projection of the given one on a 2D surface.
8275 # @param theSource The source object for the projection. It can be a point, edge or wire.
8276 # @param theTarget The target object. It can be planar or cylindrical face.
8277 # @param theName Object name; when specified, this parameter is used
8278 # for result publication in the study. Otherwise, if automatic
8279 # publication is switched on, default value is used for result name.
8281 # @return New GEOM.GEOM_Object, containing the projection.
8283 # @ref tui_projection "Example"
8284 def MakeProjection(self, theSource, theTarget, theName=None):
8286 Create new object as projection of the given one on a 2D surface.
8289 theSource The source object for the projection. It can be a point, edge or wire.
8290 theTarget The target object. It can be planar or cylindrical face.
8291 theName Object name; when specified, this parameter is used
8292 for result publication in the study. Otherwise, if automatic
8293 publication is switched on, default value is used for result name.
8296 New GEOM.GEOM_Object, containing the projection.
8298 # Example: see GEOM_TestAll.py
8299 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8300 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8301 self._autoPublish(anObj, theName, "projection")
8304 ## Create a projection projection of the given point on a wire or an edge.
8305 # If there are no solutions or there are 2 or more solutions It throws an
8307 # @param thePoint the point to be projected.
8308 # @param theWire the wire. The edge is accepted as well.
8309 # @param theName Object name; when specified, this parameter is used
8310 # for result publication in the study. Otherwise, if automatic
8311 # publication is switched on, default value is used for result name.
8313 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8314 # \n \a u: The parameter of projection point on edge.
8315 # \n \a PointOnEdge: The projection point.
8316 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8318 # @ref tui_projection "Example"
8319 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8321 Create a projection projection of the given point on a wire or an edge.
8322 If there are no solutions or there are 2 or more solutions It throws an
8326 thePoint the point to be projected.
8327 theWire the wire. The edge is accepted as well.
8328 theName Object name; when specified, this parameter is used
8329 for result publication in the study. Otherwise, if automatic
8330 publication is switched on, default value is used for result name.
8333 [u, PointOnEdge, EdgeInWireIndex]
8334 u: The parameter of projection point on edge.
8335 PointOnEdge: The projection point.
8336 EdgeInWireIndex: The index of an edge in a wire.
8338 # Example: see GEOM_TestAll.py
8339 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8340 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8341 self._autoPublish(anObj[1], theName, "projection")
8344 # -----------------------------------------------------------------------------
8346 # -----------------------------------------------------------------------------
8348 ## Translate the given object along the given vector a given number times
8349 # @param theObject The object to be translated.
8350 # @param theVector Direction of the translation. DX if None.
8351 # @param theStep Distance to translate on.
8352 # @param theNbTimes Quantity of translations to be done.
8353 # @param theName Object name; when specified, this parameter is used
8354 # for result publication in the study. Otherwise, if automatic
8355 # publication is switched on, default value is used for result name.
8357 # @return New GEOM.GEOM_Object, containing compound of all
8358 # the shapes, obtained after each translation.
8360 # @ref tui_multi_translation "Example"
8361 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8363 Translate the given object along the given vector a given number times
8366 theObject The object to be translated.
8367 theVector Direction of the translation. DX if None.
8368 theStep Distance to translate on.
8369 theNbTimes Quantity of translations to be done.
8370 theName Object name; when specified, this parameter is used
8371 for result publication in the study. Otherwise, if automatic
8372 publication is switched on, default value is used for result name.
8375 New GEOM.GEOM_Object, containing compound of all
8376 the shapes, obtained after each translation.
8379 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8381 # Example: see GEOM_TestAll.py
8382 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8383 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8384 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8385 anObj.SetParameters(Parameters)
8386 self._autoPublish(anObj, theName, "multitranslation")
8389 ## Conseqently apply two specified translations to theObject specified number of times.
8390 # @param theObject The object to be translated.
8391 # @param theVector1 Direction of the first translation. DX if None.
8392 # @param theStep1 Step of the first translation.
8393 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8394 # @param theVector2 Direction of the second translation. DY if None.
8395 # @param theStep2 Step of the second translation.
8396 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8397 # @param 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.
8401 # @return New GEOM.GEOM_Object, containing compound of all
8402 # the shapes, obtained after each translation.
8404 # @ref tui_multi_translation "Example"
8405 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8406 theVector2, theStep2, theNbTimes2, theName=None):
8408 Conseqently apply two specified translations to theObject specified number of times.
8411 theObject The object to be translated.
8412 theVector1 Direction of the first translation. DX if None.
8413 theStep1 Step of the first translation.
8414 theNbTimes1 Quantity of translations to be done along theVector1.
8415 theVector2 Direction of the second translation. DY if None.
8416 theStep2 Step of the second translation.
8417 theNbTimes2 Quantity of translations to be done along theVector2.
8418 theName Object name; when specified, this parameter is used
8419 for result publication in the study. Otherwise, if automatic
8420 publication is switched on, default value is used for result name.
8423 New GEOM.GEOM_Object, containing compound of all
8424 the shapes, obtained after each translation.
8427 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8429 # Example: see GEOM_TestAll.py
8430 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8431 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8432 theVector2, theStep2, theNbTimes2)
8433 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8434 anObj.SetParameters(Parameters)
8435 self._autoPublish(anObj, theName, "multitranslation")
8438 ## Rotate the given object around the given axis a given number times.
8439 # Rotation angle will be 2*PI/theNbTimes.
8440 # @param theObject The object to be rotated.
8441 # @param theAxis The rotation axis. DZ if None.
8442 # @param theNbTimes Quantity of rotations to be done.
8443 # @param theName Object name; when specified, this parameter is used
8444 # for result publication in the study. Otherwise, if automatic
8445 # publication is switched on, default value is used for result name.
8447 # @return New GEOM.GEOM_Object, containing compound of all the
8448 # shapes, obtained after each rotation.
8450 # @ref tui_multi_rotation "Example"
8451 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8453 Rotate the given object around the given axis a given number times.
8454 Rotation angle will be 2*PI/theNbTimes.
8457 theObject The object to be rotated.
8458 theAxis The rotation axis. DZ if None.
8459 theNbTimes Quantity of rotations to be done.
8460 theName Object name; when specified, this parameter is used
8461 for result publication in the study. Otherwise, if automatic
8462 publication is switched on, default value is used for result name.
8465 New GEOM.GEOM_Object, containing compound of all the
8466 shapes, obtained after each rotation.
8469 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8471 # Example: see GEOM_TestAll.py
8472 theNbTimes, Parameters = ParseParameters(theNbTimes)
8473 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8474 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8475 anObj.SetParameters(Parameters)
8476 self._autoPublish(anObj, theName, "multirotation")
8479 ## Rotate the given object around the given axis
8480 # a given number times on the given angle.
8481 # @param theObject The object to be rotated.
8482 # @param theAxis The rotation axis. DZ if None.
8483 # @param theAngleStep Rotation angle in radians.
8484 # @param theNbTimes Quantity of rotations to be done.
8485 # @param theName Object name; when specified, this parameter is used
8486 # for result publication in the study. Otherwise, if automatic
8487 # publication is switched on, default value is used for result name.
8489 # @return New GEOM.GEOM_Object, containing compound of all the
8490 # shapes, obtained after each rotation.
8492 # @ref tui_multi_rotation "Example"
8493 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8495 Rotate the given object around the given axis
8496 a given number times on the given angle.
8499 theObject The object to be rotated.
8500 theAxis The rotation axis. DZ if None.
8501 theAngleStep Rotation angle in radians.
8502 theNbTimes Quantity of rotations to be done.
8503 theName Object name; when specified, this parameter is used
8504 for result publication in the study. Otherwise, if automatic
8505 publication is switched on, default value is used for result name.
8508 New GEOM.GEOM_Object, containing compound of all the
8509 shapes, obtained after each rotation.
8512 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8514 # Example: see GEOM_TestAll.py
8515 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8516 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8517 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8518 anObj.SetParameters(Parameters)
8519 self._autoPublish(anObj, theName, "multirotation")
8522 ## Rotate the given object around the given axis a given
8523 # number times and multi-translate each rotation result.
8524 # Rotation angle will be 2*PI/theNbTimes1.
8525 # Translation direction passes through center of gravity
8526 # of rotated shape and its projection on the rotation axis.
8527 # @param theObject The object to be rotated.
8528 # @param theAxis Rotation axis. DZ if None.
8529 # @param theNbTimes1 Quantity of rotations to be done.
8530 # @param theRadialStep Translation distance.
8531 # @param theNbTimes2 Quantity of translations to be done.
8532 # @param theName Object name; when specified, this parameter is used
8533 # for result publication in the study. Otherwise, if automatic
8534 # publication is switched on, default value is used for result name.
8536 # @return New GEOM.GEOM_Object, containing compound of all the
8537 # shapes, obtained after each transformation.
8539 # @ref tui_multi_rotation "Example"
8540 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8542 Rotate the given object around the
8543 given axis on the given angle a given number
8544 times and multi-translate each rotation result.
8545 Translation direction passes through center of gravity
8546 of rotated shape and its projection on the rotation axis.
8549 theObject The object to be rotated.
8550 theAxis Rotation axis. DZ if None.
8551 theNbTimes1 Quantity of rotations to be done.
8552 theRadialStep Translation distance.
8553 theNbTimes2 Quantity of translations to be done.
8554 theName Object name; when specified, this parameter is used
8555 for result publication in the study. Otherwise, if automatic
8556 publication is switched on, default value is used for result name.
8559 New GEOM.GEOM_Object, containing compound of all the
8560 shapes, obtained after each transformation.
8563 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8565 # Example: see GEOM_TestAll.py
8566 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8567 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8568 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8569 anObj.SetParameters(Parameters)
8570 self._autoPublish(anObj, theName, "multirotation")
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.
8578 # @param theObject The object to be rotated.
8579 # @param theAxis Rotation axis. DZ if None.
8580 # @param theAngleStep Rotation angle in radians.
8581 # @param theNbTimes1 Quantity of rotations to be done.
8582 # @param theRadialStep Translation distance.
8583 # @param theNbTimes2 Quantity of translations to be done.
8584 # @param theName Object name; when specified, this parameter is used
8585 # for result publication in the study. Otherwise, if automatic
8586 # publication is switched on, default value is used for result name.
8588 # @return New GEOM.GEOM_Object, containing compound of all the
8589 # shapes, obtained after each transformation.
8591 # @ref tui_multi_rotation "Example"
8592 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8594 Rotate the given object around the
8595 given axis on the given angle a given number
8596 times and multi-translate each rotation result.
8597 Translation direction passes through center of gravity
8598 of rotated shape and its projection on the rotation axis.
8601 theObject The object to be rotated.
8602 theAxis Rotation axis. DZ if None.
8603 theAngleStep Rotation angle in radians.
8604 theNbTimes1 Quantity of rotations to be done.
8605 theRadialStep Translation distance.
8606 theNbTimes2 Quantity of translations to be done.
8607 theName Object name; when specified, this parameter is used
8608 for result publication in the study. Otherwise, if automatic
8609 publication is switched on, default value is used for result name.
8612 New GEOM.GEOM_Object, containing compound of all the
8613 shapes, obtained after each transformation.
8616 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8618 # Example: see GEOM_TestAll.py
8619 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8620 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8621 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8622 anObj.SetParameters(Parameters)
8623 self._autoPublish(anObj, theName, "multirotation")
8626 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8628 # @ref swig_MakeMultiRotation "Example"
8629 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8631 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8634 pz = geompy.MakeVertex(0, 0, 100)
8635 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8636 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8638 # Example: see GEOM_TestOthers.py
8639 aVec = self.MakeLine(aPoint,aDir)
8640 # note: auto-publishing is done in self.MultiRotate1D()
8641 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8644 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8646 # @ref swig_MakeMultiRotation "Example"
8647 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8649 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8652 pz = geompy.MakeVertex(0, 0, 100)
8653 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8654 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8656 # Example: see GEOM_TestOthers.py
8657 aVec = self.MakeLine(aPoint,aDir)
8658 # note: auto-publishing is done in self.MultiRotate1D()
8659 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8662 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8664 # @ref swig_MakeMultiRotation "Example"
8665 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8667 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8670 pz = geompy.MakeVertex(0, 0, 100)
8671 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8672 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8674 # Example: see GEOM_TestOthers.py
8675 aVec = self.MakeLine(aPoint,aDir)
8676 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8677 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8680 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8682 # @ref swig_MakeMultiRotation "Example"
8683 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8685 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8688 pz = geompy.MakeVertex(0, 0, 100)
8689 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8690 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8692 # Example: see GEOM_TestOthers.py
8693 aVec = self.MakeLine(aPoint,aDir)
8694 # note: auto-publishing is done in self.MultiRotate2D()
8695 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8698 # end of l3_transform
8701 ## @addtogroup l3_transform_d
8704 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8705 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8707 Deprecated method. Use MultiRotate1DNbTimes instead.
8709 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8710 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8712 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8713 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8714 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8716 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8717 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8720 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8722 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8723 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8724 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8725 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8726 anObj.SetParameters(Parameters)
8727 self._autoPublish(anObj, theName, "multirotation")
8730 ## The same, as MultiRotate1D(), but axis is given by direction and point
8731 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8732 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8734 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8735 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8738 pz = geompy.MakeVertex(0, 0, 100)
8739 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8740 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8742 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8743 aVec = self.MakeLine(aPoint,aDir)
8744 # note: auto-publishing is done in self.MultiRotate1D()
8745 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8748 ## The same, as MultiRotate2D(), but axis is given by direction and point
8749 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8750 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8752 The same, as MultiRotate2D(), but axis is given by direction and point
8753 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8756 pz = geompy.MakeVertex(0, 0, 100)
8757 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8758 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8760 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8761 aVec = self.MakeLine(aPoint,aDir)
8762 # note: auto-publishing is done in self.MultiRotate2D()
8763 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8766 # end of l3_transform_d
8769 ## @addtogroup l3_local
8772 ## Perform a fillet on all edges of the given shape.
8773 # @param theShape Shape, to perform fillet on.
8774 # @param theR Fillet radius.
8775 # @param theName Object name; when specified, this parameter is used
8776 # for result publication in the study. Otherwise, if automatic
8777 # publication is switched on, default value is used for result name.
8779 # @return New GEOM.GEOM_Object, containing the result shape.
8781 # @ref tui_fillet "Example 1"
8782 # \n @ref swig_MakeFilletAll "Example 2"
8783 def MakeFilletAll(self, theShape, theR, theName=None):
8785 Perform a fillet on all edges of the given shape.
8788 theShape Shape, to perform fillet on.
8790 theName Object name; when specified, this parameter is used
8791 for result publication in the study. Otherwise, if automatic
8792 publication is switched on, default value is used for result name.
8795 New GEOM.GEOM_Object, containing the result shape.
8798 filletall = geompy.MakeFilletAll(prism, 10.)
8800 # Example: see GEOM_TestOthers.py
8801 theR,Parameters = ParseParameters(theR)
8802 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8803 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8804 anObj.SetParameters(Parameters)
8805 self._autoPublish(anObj, theName, "fillet")
8808 ## Perform a fillet on the specified edges/faces of the given shape
8809 # @param theShape Shape, to perform fillet on.
8810 # @param theR Fillet radius.
8811 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8812 # @param theListShapes Global indices of edges/faces to perform fillet on.
8813 # @param theName Object name; when specified, this parameter is used
8814 # for result publication in the study. Otherwise, if automatic
8815 # publication is switched on, default value is used for result name.
8817 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8819 # @return New GEOM.GEOM_Object, containing the result shape.
8821 # @ref tui_fillet "Example"
8822 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8824 Perform a fillet on the specified edges/faces of the given shape
8827 theShape Shape, to perform fillet on.
8829 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8830 theListShapes Global indices of edges/faces to perform fillet on.
8831 theName Object name; when specified, this parameter is used
8832 for result publication in the study. Otherwise, if automatic
8833 publication is switched on, default value is used for result name.
8836 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8839 New GEOM.GEOM_Object, containing the result shape.
8842 # get the list of IDs (IDList) for the fillet
8843 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8845 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8846 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8847 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8848 # make a fillet on the specified edges of the given shape
8849 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8851 # Example: see GEOM_TestAll.py
8852 theR,Parameters = ParseParameters(theR)
8854 if theShapeType == self.ShapeType["EDGE"]:
8855 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8856 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8858 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8859 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8860 anObj.SetParameters(Parameters)
8861 self._autoPublish(anObj, theName, "fillet")
8864 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8865 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8867 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8870 # get the list of IDs (IDList) for the fillet
8871 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8873 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8874 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8875 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8876 # make a fillet on the specified edges of the given shape
8877 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8879 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8881 if theShapeType == self.ShapeType["EDGE"]:
8882 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8883 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8885 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8886 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8887 anObj.SetParameters(Parameters)
8888 self._autoPublish(anObj, theName, "fillet")
8891 ## Perform a fillet on the specified edges of the given shape
8892 # @param theShape Wire Shape to perform fillet on.
8893 # @param theR Fillet radius.
8894 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8895 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8896 # \note The list of vertices could be empty,
8897 # in this case fillet will done done at all vertices in wire
8898 # @param 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 # @param theName Object name; when specified, this parameter is used
8905 # for result publication in the study. Otherwise, if automatic
8906 # publication is switched on, default value is used for result name.
8908 # @return New GEOM.GEOM_Object, containing the result shape.
8910 # @ref tui_fillet2d "Example"
8911 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8913 Perform a fillet on the specified edges of the given shape
8916 theShape Wire Shape to perform fillet on.
8918 theListOfVertexes Global indices of vertexes to perform fillet on.
8919 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8920 by the length of the edges, nearest to the fillet vertex.
8921 But sometimes the next edge is C1 continuous with the one, nearest to
8922 the fillet point, and such two (or more) edges can be united to allow
8923 bigger radius. Set this flag to TRUE to allow collinear edges union,
8924 thus ignoring the secant vertex (vertices).
8925 theName Object name; when specified, this parameter is used
8926 for result publication in the study. Otherwise, if automatic
8927 publication is switched on, default value is used for result name.
8929 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8931 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8934 New GEOM.GEOM_Object, containing the result shape.
8938 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8939 # make fillet at given wire vertices with giver radius
8940 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8942 # Example: see GEOM_TestAll.py
8943 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8944 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8945 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8946 anObj.SetParameters(Parameters)
8947 self._autoPublish(anObj, theName, "fillet")
8950 ## Perform a fillet at the specified vertices of the given face/shell.
8951 # @param theShape Face or Shell shape to perform fillet on.
8952 # @param theR Fillet radius.
8953 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8954 # @param theName Object name; when specified, this parameter is used
8955 # for result publication in the study. Otherwise, if automatic
8956 # publication is switched on, default value is used for result name.
8958 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8960 # @return New GEOM.GEOM_Object, containing the result shape.
8962 # @ref tui_fillet2d "Example"
8963 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8965 Perform a fillet at the specified vertices of the given face/shell.
8968 theShape Face or Shell shape to perform fillet on.
8970 theListOfVertexes Global indices of vertexes to perform fillet on.
8971 theName Object name; when specified, this parameter is used
8972 for result publication in the study. Otherwise, if automatic
8973 publication is switched on, default value is used for result name.
8975 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8978 New GEOM.GEOM_Object, containing the result shape.
8981 face = geompy.MakeFaceHW(100, 100, 1)
8982 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8984 # Example: see GEOM_TestAll.py
8985 theR,Parameters = ParseParameters(theR)
8986 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8987 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8988 anObj.SetParameters(Parameters)
8989 self._autoPublish(anObj, theName, "fillet")
8992 ## Perform a symmetric chamfer on all edges of the given shape.
8993 # @param theShape Shape, to perform chamfer on.
8994 # @param theD Chamfer size along each face.
8995 # @param theName Object name; when specified, this parameter is used
8996 # for result publication in the study. Otherwise, if automatic
8997 # publication is switched on, default value is used for result name.
8999 # @return New GEOM.GEOM_Object, containing the result shape.
9001 # @ref tui_chamfer "Example 1"
9002 # \n @ref swig_MakeChamferAll "Example 2"
9003 def MakeChamferAll(self, theShape, theD, theName=None):
9005 Perform a symmetric chamfer on all edges of the given shape.
9008 theShape Shape, to perform chamfer on.
9009 theD Chamfer size along each face.
9010 theName Object name; when specified, this parameter is used
9011 for result publication in the study. Otherwise, if automatic
9012 publication is switched on, default value is used for result name.
9015 New GEOM.GEOM_Object, containing the result shape.
9018 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9020 # Example: see GEOM_TestOthers.py
9021 theD,Parameters = ParseParameters(theD)
9022 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9023 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9024 anObj.SetParameters(Parameters)
9025 self._autoPublish(anObj, theName, "chamfer")
9028 ## Perform a chamfer on edges, common to the specified faces,
9029 # with distance D1 on the Face1
9030 # @param theShape Shape, to perform chamfer on.
9031 # @param theD1 Chamfer size along \a theFace1.
9032 # @param theD2 Chamfer size along \a theFace2.
9033 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9034 # @param theName Object name; when specified, this parameter is used
9035 # for result publication in the study. Otherwise, if automatic
9036 # publication is switched on, default value is used for result name.
9038 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9040 # @return New GEOM.GEOM_Object, containing the result shape.
9042 # @ref tui_chamfer "Example"
9043 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9045 Perform a chamfer on edges, common to the specified faces,
9046 with distance D1 on the Face1
9049 theShape Shape, to perform chamfer on.
9050 theD1 Chamfer size along theFace1.
9051 theD2 Chamfer size along theFace2.
9052 theFace1,theFace2 Global indices of two faces of theShape.
9053 theName Object name; when specified, this parameter is used
9054 for result publication in the study. Otherwise, if automatic
9055 publication is switched on, default value is used for result name.
9058 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9061 New GEOM.GEOM_Object, containing the result shape.
9064 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9065 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9066 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9067 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9069 # Example: see GEOM_TestAll.py
9070 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9071 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9072 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9073 anObj.SetParameters(Parameters)
9074 self._autoPublish(anObj, theName, "chamfer")
9077 ## Perform a chamfer on edges
9078 # @param theShape Shape, to perform chamfer on.
9079 # @param theD Chamfer length
9080 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9081 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9082 # @param theName Object name; when specified, this parameter is used
9083 # for result publication in the study. Otherwise, if automatic
9084 # publication is switched on, default value is used for result name.
9086 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9088 # @return New GEOM.GEOM_Object, containing the result shape.
9089 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9091 Perform a chamfer on edges
9094 theShape Shape, to perform chamfer on.
9095 theD1 Chamfer size along theFace1.
9096 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9097 theFace1,theFace2 Global indices of two faces of theShape.
9098 theName Object name; when specified, this parameter is used
9099 for result publication in the study. Otherwise, if automatic
9100 publication is switched on, default value is used for result name.
9103 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9106 New GEOM.GEOM_Object, containing the result shape.
9109 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9110 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9111 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9113 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9116 if isinstance(theAngle,str):
9118 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9120 theAngle = theAngle*math.pi/180.0
9121 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9122 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9123 anObj.SetParameters(Parameters)
9124 self._autoPublish(anObj, theName, "chamfer")
9127 ## Perform a chamfer on all edges of the specified faces,
9128 # with distance D1 on the first specified face (if several for one edge)
9129 # @param theShape Shape, to perform chamfer on.
9130 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9131 # connected to the edge, are in \a theFaces, \a theD1
9132 # will be get along face, which is nearer to \a theFaces beginning.
9133 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9134 # @param theFaces Sequence of global indices of faces of \a theShape.
9135 # @param 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 GetSubShapeID().
9141 # @return New GEOM.GEOM_Object, containing the result shape.
9143 # @ref tui_chamfer "Example"
9144 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9146 Perform a chamfer on all edges of the specified faces,
9147 with distance D1 on the first specified face (if several for one edge)
9150 theShape Shape, to perform chamfer on.
9151 theD1 Chamfer size along face from theFaces. If both faces,
9152 connected to the edge, are in theFaces, theD1
9153 will be get along face, which is nearer to theFaces beginning.
9154 theD2 Chamfer size along another of two faces, connected to the edge.
9155 theFaces Sequence of global indices of faces of theShape.
9156 theName Object name; when specified, this parameter is used
9157 for result publication in the study. Otherwise, if automatic
9158 publication is switched on, default value is used for result name.
9160 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9163 New GEOM.GEOM_Object, containing the result shape.
9165 # Example: see GEOM_TestAll.py
9166 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9167 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9168 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9169 anObj.SetParameters(Parameters)
9170 self._autoPublish(anObj, theName, "chamfer")
9173 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9174 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9176 # @ref swig_FilletChamfer "Example"
9177 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9179 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9180 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9183 if isinstance(theAngle,str):
9185 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9187 theAngle = theAngle*math.pi/180.0
9188 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9189 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9190 anObj.SetParameters(Parameters)
9191 self._autoPublish(anObj, theName, "chamfer")
9194 ## Perform a chamfer on edges,
9195 # with distance D1 on the first specified face (if several for one edge)
9196 # @param theShape Shape, to perform chamfer on.
9197 # @param theD1,theD2 Chamfer size
9198 # @param theEdges Sequence of edges of \a theShape.
9199 # @param theName Object name; when specified, this parameter is used
9200 # for result publication in the study. Otherwise, if automatic
9201 # publication is switched on, default value is used for result name.
9203 # @return New GEOM.GEOM_Object, containing the result shape.
9205 # @ref swig_FilletChamfer "Example"
9206 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9208 Perform a chamfer on edges,
9209 with distance D1 on the first specified face (if several for one edge)
9212 theShape Shape, to perform chamfer on.
9213 theD1,theD2 Chamfer size
9214 theEdges Sequence of edges of theShape.
9215 theName Object name; when specified, this parameter is used
9216 for result publication in the study. Otherwise, if automatic
9217 publication is switched on, default value is used for result name.
9220 New GEOM.GEOM_Object, containing the result shape.
9222 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9223 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9224 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9225 anObj.SetParameters(Parameters)
9226 self._autoPublish(anObj, theName, "chamfer")
9229 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9230 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9231 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9233 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9234 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9237 if isinstance(theAngle,str):
9239 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9241 theAngle = theAngle*math.pi/180.0
9242 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9243 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9244 anObj.SetParameters(Parameters)
9245 self._autoPublish(anObj, theName, "chamfer")
9248 ## @sa MakeChamferEdge(), MakeChamferFaces()
9250 # @ref swig_MakeChamfer "Example"
9251 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9253 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9255 # Example: see GEOM_TestOthers.py
9257 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9258 if aShapeType == self.ShapeType["EDGE"]:
9259 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9261 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9264 ## Remove material from a solid by extrusion of the base shape on the given distance.
9265 # @param theInit Shape to remove material from. It must be a solid or
9266 # a compound made of a single solid.
9267 # @param theBase Closed edge or wire defining the base shape to be extruded.
9268 # @param theH Prism dimension along the normal to theBase
9269 # @param theAngle Draft angle in degrees.
9270 # @param theName Object name; when specified, this parameter is used
9271 # for result publication in the study. Otherwise, if automatic
9272 # publication is switched on, default value is used for result name.
9274 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9276 # @ref tui_creation_prism "Example"
9277 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9279 Add material to a solid by extrusion of the base shape on the given distance.
9282 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9283 theBase Closed edge or wire defining the base shape to be extruded.
9284 theH Prism dimension along the normal to theBase
9285 theAngle Draft angle in degrees.
9286 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.
9291 New GEOM.GEOM_Object, containing the initial shape with removed material.
9293 # Example: see GEOM_TestAll.py
9294 #theH,Parameters = ParseParameters(theH)
9295 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9296 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9297 #anObj.SetParameters(Parameters)
9298 self._autoPublish(anObj, theName, "extrudedCut")
9301 ## Add material to a solid by extrusion of the base shape on the given distance.
9302 # @param theInit Shape to add material to. It must be a solid or
9303 # a compound made of a single solid.
9304 # @param theBase Closed edge or wire defining the base shape to be extruded.
9305 # @param theH Prism dimension along the normal to theBase
9306 # @param theAngle Draft angle in degrees.
9307 # @param theName Object name; when specified, this parameter is used
9308 # for result publication in the study. Otherwise, if automatic
9309 # publication is switched on, default value is used for result name.
9311 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9313 # @ref tui_creation_prism "Example"
9314 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9316 Add material to a solid by extrusion of the base shape on the given distance.
9319 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9320 theBase Closed edge or wire defining the base shape to be extruded.
9321 theH Prism dimension along the normal to theBase
9322 theAngle Draft angle in degrees.
9323 theName Object name; when specified, this parameter is used
9324 for result publication in the study. Otherwise, if automatic
9325 publication is switched on, default value is used for result name.
9328 New GEOM.GEOM_Object, containing the initial shape with added material.
9330 # Example: see GEOM_TestAll.py
9331 #theH,Parameters = ParseParameters(theH)
9332 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9333 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9334 #anObj.SetParameters(Parameters)
9335 self._autoPublish(anObj, theName, "extrudedBoss")
9341 ## @addtogroup l3_basic_op
9344 ## Perform an Archimde operation on the given shape with given parameters.
9345 # The object presenting the resulting face is returned.
9346 # @param theShape Shape to be put in water.
9347 # @param theWeight Weight og the shape.
9348 # @param theWaterDensity Density of the water.
9349 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9350 # @param theName Object name; when specified, this parameter is used
9351 # for result publication in the study. Otherwise, if automatic
9352 # publication is switched on, default value is used for result name.
9354 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9355 # by a plane, corresponding to water level.
9357 # @ref tui_archimede "Example"
9358 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9360 Perform an Archimde operation on the given shape with given parameters.
9361 The object presenting the resulting face is returned.
9364 theShape Shape to be put in water.
9365 theWeight Weight og the shape.
9366 theWaterDensity Density of the water.
9367 theMeshDeflection Deflection of the mesh, using to compute the section.
9368 theName Object name; when specified, this parameter is used
9369 for result publication in the study. Otherwise, if automatic
9370 publication is switched on, default value is used for result name.
9373 New GEOM.GEOM_Object, containing a section of theShape
9374 by a plane, corresponding to water level.
9376 # Example: see GEOM_TestAll.py
9377 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9378 theWeight,theWaterDensity,theMeshDeflection)
9379 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9380 RaiseIfFailed("MakeArchimede", self.LocalOp)
9381 anObj.SetParameters(Parameters)
9382 self._autoPublish(anObj, theName, "archimede")
9385 # end of l3_basic_op
9388 ## @addtogroup l2_measure
9391 ## Get point coordinates
9394 # @ref tui_measurement_tools_page "Example"
9395 def PointCoordinates(self,Point):
9397 Get point coordinates
9402 # Example: see GEOM_TestMeasures.py
9403 aTuple = self.MeasuOp.PointCoordinates(Point)
9404 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9407 ## Get vector coordinates
9410 # @ref tui_measurement_tools_page "Example"
9411 def VectorCoordinates(self,Vector):
9413 Get vector coordinates
9419 p1=self.GetFirstVertex(Vector)
9420 p2=self.GetLastVertex(Vector)
9422 X1=self.PointCoordinates(p1)
9423 X2=self.PointCoordinates(p2)
9425 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9428 ## Compute cross product
9429 # @return vector w=u^v
9431 # @ref tui_measurement_tools_page "Example"
9432 def CrossProduct(self, Vector1, Vector2):
9434 Compute cross product
9436 Returns: vector w=u^v
9438 u=self.VectorCoordinates(Vector1)
9439 v=self.VectorCoordinates(Vector2)
9440 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])
9444 ## Compute cross product
9445 # @return dot product p=u.v
9447 # @ref tui_measurement_tools_page "Example"
9448 def DotProduct(self, Vector1, Vector2):
9450 Compute cross product
9452 Returns: dot product p=u.v
9454 u=self.VectorCoordinates(Vector1)
9455 v=self.VectorCoordinates(Vector2)
9456 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9461 ## Get summarized length of all wires,
9462 # area of surface and volume of the given shape.
9463 # @param theShape Shape to define properties of.
9464 # @return [theLength, theSurfArea, theVolume]\n
9465 # theLength: Summarized length of all wires of the given shape.\n
9466 # theSurfArea: Area of surface of the given shape.\n
9467 # theVolume: Volume of the given shape.
9469 # @ref tui_measurement_tools_page "Example"
9470 def BasicProperties(self,theShape):
9472 Get summarized length of all wires,
9473 area of surface and volume of the given shape.
9476 theShape Shape to define properties of.
9479 [theLength, theSurfArea, theVolume]
9480 theLength: Summarized length of all wires of the given shape.
9481 theSurfArea: Area of surface of the given shape.
9482 theVolume: Volume of the given shape.
9484 # Example: see GEOM_TestMeasures.py
9485 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9486 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9489 ## Get parameters of bounding box of the given shape
9490 # @param theShape Shape to obtain bounding box of.
9491 # @param precise TRUE for precise computation; FALSE for fast one.
9492 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9493 # Xmin,Xmax: Limits of shape along OX axis.
9494 # Ymin,Ymax: Limits of shape along OY axis.
9495 # Zmin,Zmax: Limits of shape along OZ axis.
9497 # @ref tui_measurement_tools_page "Example"
9498 def BoundingBox (self, theShape, precise=False):
9500 Get parameters of bounding box of the given shape
9503 theShape Shape to obtain bounding box of.
9504 precise TRUE for precise computation; FALSE for fast one.
9507 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9508 Xmin,Xmax: Limits of shape along OX axis.
9509 Ymin,Ymax: Limits of shape along OY axis.
9510 Zmin,Zmax: Limits of shape along OZ axis.
9512 # Example: see GEOM_TestMeasures.py
9513 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9514 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9517 ## Get bounding box of the given shape
9518 # @param theShape Shape to obtain bounding box of.
9519 # @param precise TRUE for precise computation; FALSE for fast one.
9520 # @param theName Object name; when specified, this parameter is used
9521 # for result publication in the study. Otherwise, if automatic
9522 # publication is switched on, default value is used for result name.
9524 # @return New GEOM.GEOM_Object, containing the created box.
9526 # @ref tui_measurement_tools_page "Example"
9527 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9529 Get bounding box of the given shape
9532 theShape Shape to obtain bounding box of.
9533 precise TRUE for precise computation; FALSE for fast one.
9534 theName Object name; when specified, this parameter is used
9535 for result publication in the study. Otherwise, if automatic
9536 publication is switched on, default value is used for result name.
9539 New GEOM.GEOM_Object, containing the created box.
9541 # Example: see GEOM_TestMeasures.py
9542 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9543 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9544 self._autoPublish(anObj, theName, "bndbox")
9547 ## Get inertia matrix and moments of inertia of theShape.
9548 # @param theShape Shape to calculate inertia of.
9549 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9550 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9551 # Ix,Iy,Iz: Moments of inertia of the given shape.
9553 # @ref tui_measurement_tools_page "Example"
9554 def Inertia(self,theShape):
9556 Get inertia matrix and moments of inertia of theShape.
9559 theShape Shape to calculate inertia of.
9562 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9563 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9564 Ix,Iy,Iz: Moments of inertia of the given shape.
9566 # Example: see GEOM_TestMeasures.py
9567 aTuple = self.MeasuOp.GetInertia(theShape)
9568 RaiseIfFailed("GetInertia", self.MeasuOp)
9571 ## Get if coords are included in the shape (ST_IN or ST_ON)
9572 # @param theShape Shape
9573 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9574 # @param tolerance to be used (default is 1.0e-7)
9575 # @return list_of_boolean = [res1, res2, ...]
9576 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9578 Get if coords are included in the shape (ST_IN or ST_ON)
9582 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9583 tolerance to be used (default is 1.0e-7)
9586 list_of_boolean = [res1, res2, ...]
9588 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9590 ## Get minimal distance between the given shapes.
9591 # @param theShape1,theShape2 Shapes to find minimal distance between.
9592 # @return Value of the minimal distance between the given shapes.
9594 # @ref tui_measurement_tools_page "Example"
9595 def MinDistance(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.
9605 # Example: see GEOM_TestMeasures.py
9606 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9607 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9610 ## Get minimal distance between the given shapes.
9611 # @param theShape1,theShape2 Shapes to find minimal distance between.
9612 # @return Value of the minimal distance between the given shapes, in form of list
9613 # [Distance, DX, DY, DZ].
9615 # @ref swig_all_measure "Example"
9616 def MinDistanceComponents(self, theShape1, theShape2):
9618 Get minimal distance between the given shapes.
9621 theShape1,theShape2 Shapes to find minimal distance between.
9624 Value of the minimal distance between the given shapes, in form of list
9625 [Distance, DX, DY, DZ]
9627 # Example: see GEOM_TestMeasures.py
9628 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9629 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9630 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9633 ## Get closest points of the given shapes.
9634 # @param theShape1,theShape2 Shapes to find closest points of.
9635 # @return The number of found solutions (-1 in case of infinite number of
9636 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9638 # @ref tui_measurement_tools_page "Example"
9639 def ClosestPoints (self, theShape1, theShape2):
9641 Get closest points of the given shapes.
9644 theShape1,theShape2 Shapes to find closest points of.
9647 The number of found solutions (-1 in case of infinite number of
9648 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9650 # Example: see GEOM_TestMeasures.py
9651 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9652 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9655 ## Get angle between the given shapes in degrees.
9656 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9657 # @note If both arguments are vectors, the angle is computed in accordance
9658 # with their orientations, otherwise the minimum angle is computed.
9659 # @return Value of the angle between the given shapes in degrees.
9661 # @ref tui_measurement_tools_page "Example"
9662 def GetAngle(self, theShape1, theShape2):
9664 Get angle between the given shapes in degrees.
9667 theShape1,theShape2 Lines or linear edges to find angle between.
9670 If both arguments are vectors, the angle is computed in accordance
9671 with their orientations, otherwise the minimum angle is computed.
9674 Value of the angle between the given shapes in degrees.
9676 # Example: see GEOM_TestMeasures.py
9677 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9678 RaiseIfFailed("GetAngle", self.MeasuOp)
9681 ## Get angle between the given shapes in radians.
9682 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9683 # @note If both arguments are vectors, the angle is computed in accordance
9684 # with their orientations, otherwise the minimum angle is computed.
9685 # @return Value of the angle between the given shapes in radians.
9687 # @ref tui_measurement_tools_page "Example"
9688 def GetAngleRadians(self, theShape1, theShape2):
9690 Get angle between the given shapes in radians.
9693 theShape1,theShape2 Lines or linear edges to find angle between.
9697 If both arguments are vectors, the angle is computed in accordance
9698 with their orientations, otherwise the minimum angle is computed.
9701 Value of the angle between the given shapes in radians.
9703 # Example: see GEOM_TestMeasures.py
9704 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9705 RaiseIfFailed("GetAngle", self.MeasuOp)
9708 ## Get angle between the given vectors in degrees.
9709 # @param theShape1,theShape2 Vectors to find angle between.
9710 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9711 # if False, the opposite vector to the normal vector is used.
9712 # @return Value of the angle between the given vectors in degrees.
9714 # @ref tui_measurement_tools_page "Example"
9715 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9717 Get angle between the given vectors in degrees.
9720 theShape1,theShape2 Vectors to find angle between.
9721 theFlag If True, the normal vector is defined by the two vectors cross,
9722 if False, the opposite vector to the normal vector is used.
9725 Value of the angle between the given vectors in degrees.
9727 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9729 anAngle = 360. - anAngle
9730 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9733 ## The same as GetAngleVectors, but the result is in radians.
9734 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9736 Get angle between the given vectors in radians.
9739 theShape1,theShape2 Vectors to find angle between.
9740 theFlag If True, the normal vector is defined by the two vectors cross,
9741 if False, the opposite vector to the normal vector is used.
9744 Value of the angle between the given vectors in radians.
9746 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9749 ## @name Curve Curvature Measurement
9750 # Methods for receiving radius of curvature of curves
9751 # in the given point
9754 ## Measure curvature of a curve at a point, set by parameter.
9755 # @param theCurve a curve.
9756 # @param theParam parameter.
9757 # @return radius of curvature of \a theCurve.
9759 # @ref swig_todo "Example"
9760 def CurveCurvatureByParam(self, theCurve, theParam):
9762 Measure curvature of a curve at a point, set by parameter.
9769 radius of curvature of theCurve.
9771 # Example: see GEOM_TestMeasures.py
9772 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9773 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9776 ## Measure curvature of a curve at a point.
9777 # @param theCurve a curve.
9778 # @param thePoint given point.
9779 # @return radius of curvature of \a theCurve.
9781 # @ref swig_todo "Example"
9782 def CurveCurvatureByPoint(self, theCurve, thePoint):
9784 Measure curvature of a curve at a point.
9788 thePoint given point.
9791 radius of curvature of theCurve.
9793 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9794 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9798 ## @name Surface Curvature Measurement
9799 # Methods for receiving max and min radius of curvature of surfaces
9800 # in the given point
9803 ## Measure max radius of curvature of surface.
9804 # @param theSurf the given surface.
9805 # @param theUParam Value of U-parameter on the referenced surface.
9806 # @param theVParam Value of V-parameter on the referenced surface.
9807 # @return max radius of curvature of theSurf.
9809 ## @ref swig_todo "Example"
9810 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9812 Measure max radius of curvature of surface.
9815 theSurf the given surface.
9816 theUParam Value of U-parameter on the referenced surface.
9817 theVParam Value of V-parameter on the referenced surface.
9820 max radius of curvature of theSurf.
9822 # Example: see GEOM_TestMeasures.py
9823 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9824 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9827 ## Measure max radius of curvature of surface in the given point
9828 # @param theSurf the given surface.
9829 # @param thePoint given point.
9830 # @return max radius of curvature of theSurf.
9832 ## @ref swig_todo "Example"
9833 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9835 Measure max radius of curvature of surface in the given point.
9838 theSurf the given surface.
9839 thePoint given point.
9842 max radius of curvature of theSurf.
9844 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9845 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9848 ## Measure min radius of curvature of surface.
9849 # @param theSurf the given surface.
9850 # @param theUParam Value of U-parameter on the referenced surface.
9851 # @param theVParam Value of V-parameter on the referenced surface.
9852 # @return min radius of curvature of theSurf.
9854 ## @ref swig_todo "Example"
9855 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9857 Measure min radius of curvature of surface.
9860 theSurf the given surface.
9861 theUParam Value of U-parameter on the referenced surface.
9862 theVParam Value of V-parameter on the referenced surface.
9865 Min radius of curvature of theSurf.
9867 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9868 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9871 ## Measure min radius of curvature of surface in the given point
9872 # @param theSurf the given surface.
9873 # @param thePoint given point.
9874 # @return min radius of curvature of theSurf.
9876 ## @ref swig_todo "Example"
9877 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9879 Measure min radius of curvature of surface in the given point.
9882 theSurf the given surface.
9883 thePoint given point.
9886 Min radius of curvature of theSurf.
9888 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9889 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9893 ## Get min and max tolerances of sub-shapes of theShape
9894 # @param theShape Shape, to get tolerances of.
9895 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9896 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9897 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9898 # VertMin,VertMax: Min and max tolerances of the vertices.
9900 # @ref tui_measurement_tools_page "Example"
9901 def Tolerance(self,theShape):
9903 Get min and max tolerances of sub-shapes of theShape
9906 theShape Shape, to get tolerances of.
9909 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9910 FaceMin,FaceMax: Min and max tolerances of the faces.
9911 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9912 VertMin,VertMax: Min and max tolerances of the vertices.
9914 # Example: see GEOM_TestMeasures.py
9915 aTuple = self.MeasuOp.GetTolerance(theShape)
9916 RaiseIfFailed("GetTolerance", self.MeasuOp)
9919 ## Obtain description of the given shape (number of sub-shapes of each type)
9920 # @param theShape Shape to be described.
9921 # @return Description of the given shape.
9923 # @ref tui_measurement_tools_page "Example"
9924 def WhatIs(self,theShape):
9926 Obtain description of the given shape (number of sub-shapes of each type)
9929 theShape Shape to be described.
9932 Description of the given shape.
9934 # Example: see GEOM_TestMeasures.py
9935 aDescr = self.MeasuOp.WhatIs(theShape)
9936 RaiseIfFailed("WhatIs", self.MeasuOp)
9939 ## Obtain quantity of shapes of the given type in \a theShape.
9940 # If \a theShape is of type \a theType, it is also counted.
9941 # @param theShape Shape to be described.
9942 # @param theType the given ShapeType().
9943 # @return Quantity of shapes of type \a theType in \a theShape.
9945 # @ref tui_measurement_tools_page "Example"
9946 def NbShapes (self, theShape, theType):
9948 Obtain quantity of shapes of the given type in theShape.
9949 If theShape is of type theType, it is also counted.
9952 theShape Shape to be described.
9953 theType the given geompy.ShapeType
9956 Quantity of shapes of type theType in theShape.
9958 # Example: see GEOM_TestMeasures.py
9959 listSh = self.SubShapeAllIDs(theShape, theType)
9963 ## Obtain quantity of shapes of each type in \a theShape.
9964 # The \a theShape is also counted.
9965 # @param theShape Shape to be described.
9966 # @return Dictionary of ShapeType() with bound quantities of shapes.
9968 # @ref tui_measurement_tools_page "Example"
9969 def ShapeInfo (self, theShape):
9971 Obtain quantity of shapes of each type in theShape.
9972 The theShape is also counted.
9975 theShape Shape to be described.
9978 Dictionary of geompy.ShapeType with bound quantities of shapes.
9980 # Example: see GEOM_TestMeasures.py
9982 for typeSh in self.ShapeType:
9983 if typeSh in ( "AUTO", "SHAPE" ): continue
9984 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9990 def GetCreationInformation(self, theShape):
9991 info = theShape.GetCreationInformation()
9993 opName = info.operationName
9994 if not opName: opName = "no info available"
9995 res = "Operation: " + opName
9997 for parVal in info.params:
9998 res += " \n %s = %s" % ( parVal.name, parVal.value )
10001 ## Get a point, situated at the centre of mass of theShape.
10002 # @param theShape Shape to define centre of mass of.
10003 # @param theName Object name; when specified, this parameter is used
10004 # for result publication in the study. Otherwise, if automatic
10005 # publication is switched on, default value is used for result name.
10007 # @return New GEOM.GEOM_Object, containing the created point.
10009 # @ref tui_measurement_tools_page "Example"
10010 def MakeCDG(self, theShape, theName=None):
10012 Get a point, situated at the centre of mass of theShape.
10015 theShape Shape to define centre of mass of.
10016 theName Object name; when specified, this parameter is used
10017 for result publication in the study. Otherwise, if automatic
10018 publication is switched on, default value is used for result name.
10021 New GEOM.GEOM_Object, containing the created point.
10023 # Example: see GEOM_TestMeasures.py
10024 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10025 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10026 self._autoPublish(anObj, theName, "centerOfMass")
10029 ## Get a vertex sub-shape by index depended with orientation.
10030 # @param theShape Shape to find sub-shape.
10031 # @param theIndex Index to find vertex by this index (starting from zero)
10032 # @param theName Object name; when specified, this parameter is used
10033 # for result publication in the study. Otherwise, if automatic
10034 # publication is switched on, default value is used for result name.
10036 # @return New GEOM.GEOM_Object, containing the created vertex.
10038 # @ref tui_measurement_tools_page "Example"
10039 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10041 Get a vertex sub-shape by index depended with orientation.
10044 theShape Shape to find sub-shape.
10045 theIndex Index to find vertex by this index (starting from zero)
10046 theName Object name; when specified, this parameter is used
10047 for result publication in the study. Otherwise, if automatic
10048 publication is switched on, default value is used for result name.
10051 New GEOM.GEOM_Object, containing the created vertex.
10053 # Example: see GEOM_TestMeasures.py
10054 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10055 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10056 self._autoPublish(anObj, theName, "vertex")
10059 ## Get the first vertex of wire/edge depended orientation.
10060 # @param theShape Shape to find first vertex.
10061 # @param theName Object name; when specified, this parameter is used
10062 # for result publication in the study. Otherwise, if automatic
10063 # publication is switched on, default value is used for result name.
10065 # @return New GEOM.GEOM_Object, containing the created vertex.
10067 # @ref tui_measurement_tools_page "Example"
10068 def GetFirstVertex(self, theShape, theName=None):
10070 Get the first vertex of wire/edge depended orientation.
10073 theShape Shape to find first vertex.
10074 theName Object name; when specified, this parameter is used
10075 for result publication in the study. Otherwise, if automatic
10076 publication is switched on, default value is used for result name.
10079 New GEOM.GEOM_Object, containing the created vertex.
10081 # Example: see GEOM_TestMeasures.py
10082 # note: auto-publishing is done in self.GetVertexByIndex()
10083 anObj = self.GetVertexByIndex(theShape, 0, theName)
10084 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
10087 ## Get the last vertex of wire/edge depended orientation.
10088 # @param theShape Shape to find last vertex.
10089 # @param theName Object name; when specified, this parameter is used
10090 # for result publication in the study. Otherwise, if automatic
10091 # publication is switched on, default value is used for result name.
10093 # @return New GEOM.GEOM_Object, containing the created vertex.
10095 # @ref tui_measurement_tools_page "Example"
10096 def GetLastVertex(self, theShape, theName=None):
10098 Get the last vertex of wire/edge depended orientation.
10101 theShape Shape to find last vertex.
10102 theName Object name; when specified, this parameter is used
10103 for result publication in the study. Otherwise, if automatic
10104 publication is switched on, default value is used for result name.
10107 New GEOM.GEOM_Object, containing the created vertex.
10109 # Example: see GEOM_TestMeasures.py
10110 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10111 # note: auto-publishing is done in self.GetVertexByIndex()
10112 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10113 RaiseIfFailed("GetLastVertex", self.MeasuOp)
10116 ## Get a normale to the given face. If the point is not given,
10117 # the normale is calculated at the center of mass.
10118 # @param theFace Face to define normale of.
10119 # @param theOptionalPoint Point to compute the normale at.
10120 # @param theName Object name; when specified, this parameter is used
10121 # for result publication in the study. Otherwise, if automatic
10122 # publication is switched on, default value is used for result name.
10124 # @return New GEOM.GEOM_Object, containing the created vector.
10126 # @ref swig_todo "Example"
10127 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10129 Get a normale to the given face. If the point is not given,
10130 the normale is calculated at the center of mass.
10133 theFace Face to define normale of.
10134 theOptionalPoint Point to compute the normale at.
10135 theName Object name; when specified, this parameter is used
10136 for result publication in the study. Otherwise, if automatic
10137 publication is switched on, default value is used for result name.
10140 New GEOM.GEOM_Object, containing the created vector.
10142 # Example: see GEOM_TestMeasures.py
10143 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10144 RaiseIfFailed("GetNormal", self.MeasuOp)
10145 self._autoPublish(anObj, theName, "normal")
10148 ## Check a topology of the given shape.
10149 # @param theShape Shape to check validity of.
10150 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10151 # if TRUE, the shape's geometry will be checked also.
10152 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
10153 # of problem is printed.
10154 # if TRUE and if theShape is invalid, the description
10155 # of problem is also returned.
10156 # @return TRUE, if the shape "seems to be valid".
10158 # @ref tui_measurement_tools_page "Example"
10159 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10161 Check a topology of the given shape.
10164 theShape Shape to check validity of.
10165 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10166 if TRUE, the shape's geometry will be checked also.
10167 theReturnStatus If FALSE and if theShape is invalid, a description
10168 of problem is printed.
10169 if TRUE and if theShape is invalid, the description
10170 of problem is returned.
10173 TRUE, if the shape "seems to be valid".
10174 If theShape is invalid, prints a description of problem.
10175 This description can also be returned.
10177 # Example: see GEOM_TestMeasures.py
10179 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10180 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10182 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
10183 RaiseIfFailed("CheckShape", self.MeasuOp)
10185 if theReturnStatus == 0:
10187 if theReturnStatus == 1:
10188 return (IsValid, Status)
10191 ## Detect self-intersections in the given shape.
10192 # @param theShape Shape to check.
10193 # @return TRUE, if the shape contains no self-intersections.
10195 # @ref tui_measurement_tools_page "Example"
10196 def CheckSelfIntersections(self, theShape):
10198 Detect self-intersections in the given shape.
10201 theShape Shape to check.
10204 TRUE, if the shape contains no self-intersections.
10206 # Example: see GEOM_TestMeasures.py
10207 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10208 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10211 ## Get position (LCS) of theShape.
10213 # Origin of the LCS is situated at the shape's center of mass.
10214 # Axes of the LCS are obtained from shape's location or,
10215 # if the shape is a planar face, from position of its plane.
10217 # @param theShape Shape to calculate position of.
10218 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10219 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10220 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10221 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10223 # @ref swig_todo "Example"
10224 def GetPosition(self,theShape):
10226 Get position (LCS) of theShape.
10227 Origin of the LCS is situated at the shape's center of mass.
10228 Axes of the LCS are obtained from shape's location or,
10229 if the shape is a planar face, from position of its plane.
10232 theShape Shape to calculate position of.
10235 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10236 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10237 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10238 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10240 # Example: see GEOM_TestMeasures.py
10241 aTuple = self.MeasuOp.GetPosition(theShape)
10242 RaiseIfFailed("GetPosition", self.MeasuOp)
10245 ## Get kind of theShape.
10247 # @param theShape Shape to get a kind of.
10248 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10249 # and a list of parameters, describing the shape.
10250 # @note Concrete meaning of each value, returned via \a theIntegers
10251 # or \a theDoubles list depends on the kind() of the shape.
10253 # @ref swig_todo "Example"
10254 def KindOfShape(self,theShape):
10256 Get kind of theShape.
10259 theShape Shape to get a kind of.
10262 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10263 and a list of parameters, describing the shape.
10265 Concrete meaning of each value, returned via theIntegers
10266 or theDoubles list depends on the geompy.kind of the shape
10268 # Example: see GEOM_TestMeasures.py
10269 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10270 RaiseIfFailed("KindOfShape", self.MeasuOp)
10272 aKind = aRoughTuple[0]
10273 anInts = aRoughTuple[1]
10274 aDbls = aRoughTuple[2]
10276 # Now there is no exception from this rule:
10277 aKindTuple = [aKind] + aDbls + anInts
10279 # If they are we will regroup parameters for such kind of shape.
10281 #if aKind == kind.SOME_KIND:
10282 # # SOME_KIND int int double int double double
10283 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10287 # end of l2_measure
10290 ## @addtogroup l2_import_export
10293 ## Import a shape from the BREP or IGES or STEP file
10294 # (depends on given format) with given name.
10295 # @param theFileName The file, containing the shape.
10296 # @param theFormatName Specify format for the file reading.
10297 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10298 # If format 'IGES_SCALE' is used instead of 'IGES' or
10299 # format 'STEP_SCALE' is used instead of 'STEP',
10300 # length unit will be set to 'meter' and result model will be scaled.
10301 # @param theName Object name; when specified, this parameter is used
10302 # for result publication in the study. Otherwise, if automatic
10303 # publication is switched on, default value is used for result name.
10305 # @return New GEOM.GEOM_Object, containing the imported shape.
10307 # @ref swig_Import_Export "Example"
10308 def ImportFile(self, theFileName, theFormatName, theName=None):
10310 Import a shape from the BREP or IGES or STEP file
10311 (depends on given format) with given name.
10314 theFileName The file, containing the shape.
10315 theFormatName Specify format for the file reading.
10316 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10317 If format 'IGES_SCALE' is used instead of 'IGES' or
10318 format 'STEP_SCALE' is used instead of 'STEP',
10319 length unit will be set to 'meter' and result model will be scaled.
10320 theName Object name; when specified, this parameter is used
10321 for result publication in the study. Otherwise, if automatic
10322 publication is switched on, default value is used for result name.
10325 New GEOM.GEOM_Object, containing the imported shape.
10327 # Example: see GEOM_TestOthers.py
10328 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10329 RaiseIfFailed("ImportFile", self.InsertOp)
10330 self._autoPublish(anObj, theName, "imported")
10333 ## Deprecated analog of ImportFile()
10334 def Import(self, theFileName, theFormatName, theName=None):
10336 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10338 print "WARNING: Function Import is deprecated, use ImportFile instead"
10339 # note: auto-publishing is done in self.ImportFile()
10340 return self.ImportFile(theFileName, theFormatName, theName)
10342 ## Shortcut to ImportFile() for BREP format.
10343 # Import a shape from the BREP file with given name.
10344 # @param theFileName The file, containing the shape.
10345 # @param theName Object name; when specified, this parameter is used
10346 # for result publication in the study. Otherwise, if automatic
10347 # publication is switched on, default value is used for result name.
10349 # @return New GEOM.GEOM_Object, containing the imported shape.
10351 # @ref swig_Import_Export "Example"
10352 def ImportBREP(self, theFileName, theName=None):
10354 geompy.ImportFile(...) function for BREP format
10355 Import a shape from the BREP file with given name.
10358 theFileName The file, containing the shape.
10359 theName Object name; when specified, this parameter is used
10360 for result publication in the study. Otherwise, if automatic
10361 publication is switched on, default value is used for result name.
10364 New GEOM.GEOM_Object, containing the imported shape.
10366 # Example: see GEOM_TestOthers.py
10367 # note: auto-publishing is done in self.ImportFile()
10368 return self.ImportFile(theFileName, "BREP", theName)
10370 ## Shortcut to ImportFile() for IGES format
10371 # Import a shape from the IGES file with given name.
10372 # @param theFileName The file, containing the shape.
10373 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10374 # and result model will be scaled, if its units are not meters.
10375 # If False (default), file length units will be taken into account.
10376 # @param theName Object name; when specified, this parameter is used
10377 # for result publication in the study. Otherwise, if automatic
10378 # publication is switched on, default value is used for result name.
10380 # @return New GEOM.GEOM_Object, containing the imported shape.
10382 # @ref swig_Import_Export "Example"
10383 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10385 geompy.ImportFile(...) function for IGES format
10388 theFileName The file, containing the shape.
10389 ignoreUnits If True, file length units will be ignored (set to 'meter')
10390 and result model will be scaled, if its units are not meters.
10391 If False (default), file length units will be taken into account.
10392 theName Object name; when specified, this parameter is used
10393 for result publication in the study. Otherwise, if automatic
10394 publication is switched on, default value is used for result name.
10397 New GEOM.GEOM_Object, containing the imported shape.
10399 # Example: see GEOM_TestOthers.py
10400 # note: auto-publishing is done in self.ImportFile()
10402 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10403 return self.ImportFile(theFileName, "IGES", theName)
10405 ## Return length unit from given IGES file
10406 # @param theFileName The file, containing the shape.
10407 # @return String, containing the units name.
10409 # @ref swig_Import_Export "Example"
10410 def GetIGESUnit(self, theFileName):
10412 Return length units from given IGES file
10415 theFileName The file, containing the shape.
10418 String, containing the units name.
10420 # Example: see GEOM_TestOthers.py
10421 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10424 ## Shortcut to ImportFile() for STEP format
10425 # Import a shape from the STEP file with given name.
10426 # @param theFileName The file, containing the shape.
10427 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10428 # and result model will be scaled, if its units are not meters.
10429 # If False (default), file length units will be taken into account.
10430 # @param theName Object name; when specified, this parameter is used
10431 # for result publication in the study. Otherwise, if automatic
10432 # publication is switched on, default value is used for result name.
10434 # @return New GEOM.GEOM_Object, containing the imported shape.
10436 # @ref swig_Import_Export "Example"
10437 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10439 geompy.ImportFile(...) function for STEP format
10442 theFileName The file, containing the shape.
10443 ignoreUnits If True, file length units will be ignored (set to 'meter')
10444 and result model will be scaled, if its units are not meters.
10445 If False (default), file length units will be taken into account.
10446 theName Object name; when specified, this parameter is used
10447 for result publication in the study. Otherwise, if automatic
10448 publication is switched on, default value is used for result name.
10451 New GEOM.GEOM_Object, containing the imported shape.
10453 # Example: see GEOM_TestOthers.py
10454 # note: auto-publishing is done in self.ImportFile()
10456 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10457 return self.ImportFile(theFileName, "STEP", theName)
10459 ## Return length unit from given IGES or STEP file
10460 # @param theFileName The file, containing the shape.
10461 # @return String, containing the units name.
10463 # @ref swig_Import_Export "Example"
10464 def GetSTEPUnit(self, theFileName):
10466 Return length units from given STEP file
10469 theFileName The file, containing the shape.
10472 String, containing the units name.
10474 # Example: see GEOM_TestOthers.py
10475 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10478 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10479 # @note This method will not be dumped to the python script by DumpStudy functionality.
10480 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10481 # @param theStream The BRep binary stream.
10482 # @param theName Object name; when specified, this parameter is used
10483 # for result publication in the study. Otherwise, if automatic
10484 # publication is switched on, default value is used for result name.
10486 # @return New GEOM_Object, containing the shape, read from theStream.
10488 # @ref swig_Import_Export "Example"
10489 def RestoreShape (self, theStream, theName=None):
10491 Read a shape from the binary stream, containing its bounding representation (BRep).
10494 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10497 theStream The BRep binary stream.
10498 theName Object name; when specified, this parameter is used
10499 for result publication in the study. Otherwise, if automatic
10500 publication is switched on, default value is used for result name.
10503 New GEOM_Object, containing the shape, read from theStream.
10505 # Example: see GEOM_TestOthers.py
10506 anObj = self.InsertOp.RestoreShape(theStream)
10507 RaiseIfFailed("RestoreShape", self.InsertOp)
10508 self._autoPublish(anObj, theName, "restored")
10511 ## Export the given shape into a file with given name.
10512 # @param theObject Shape to be stored in the file.
10513 # @param theFileName Name of the file to store the given shape in.
10514 # @param theFormatName Specify format for the shape storage.
10515 # Available formats can be obtained with
10516 # geompy.InsertOp.ExportTranslators()[0] method.
10518 # @ref swig_Import_Export "Example"
10519 def Export(self, theObject, theFileName, theFormatName):
10521 Export the given shape into a file with given name.
10524 theObject Shape to be stored in the file.
10525 theFileName Name of the file to store the given shape in.
10526 theFormatName Specify format for the shape storage.
10527 Available formats can be obtained with
10528 geompy.InsertOp.ExportTranslators()[0] method.
10530 # Example: see GEOM_TestOthers.py
10531 self.InsertOp.Export(theObject, theFileName, theFormatName)
10532 if self.InsertOp.IsDone() == 0:
10533 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10537 ## Shortcut to Export() for BREP format
10539 # @ref swig_Import_Export "Example"
10540 def ExportBREP(self,theObject, theFileName):
10542 geompy.Export(...) function for BREP format
10544 # Example: see GEOM_TestOthers.py
10545 return self.Export(theObject, theFileName, "BREP")
10547 ## Shortcut to Export() for IGES format
10549 # @ref swig_Import_Export "Example"
10550 def ExportIGES(self,theObject, theFileName):
10552 geompy.Export(...) function for IGES format
10554 # Example: see GEOM_TestOthers.py
10555 return self.Export(theObject, theFileName, "IGES")
10557 ## Shortcut to Export() for STEP format
10559 # @ref swig_Import_Export "Example"
10560 def ExportSTEP(self,theObject, theFileName):
10562 geompy.Export(...) function for STEP format
10564 # Example: see GEOM_TestOthers.py
10565 return self.Export(theObject, theFileName, "STEP")
10567 # end of l2_import_export
10570 ## @addtogroup l3_blocks
10573 ## Create a quadrangle face from four edges. Order of Edges is not
10574 # important. It is not necessary that edges share the same vertex.
10575 # @param E1,E2,E3,E4 Edges for the face bound.
10576 # @param theName Object name; when specified, this parameter is used
10577 # for result publication in the study. Otherwise, if automatic
10578 # publication is switched on, default value is used for result name.
10580 # @return New GEOM.GEOM_Object, containing the created face.
10582 # @ref tui_building_by_blocks_page "Example"
10583 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10585 Create a quadrangle face from four edges. Order of Edges is not
10586 important. It is not necessary that edges share the same vertex.
10589 E1,E2,E3,E4 Edges for the face bound.
10590 theName Object name; when specified, this parameter is used
10591 for result publication in the study. Otherwise, if automatic
10592 publication is switched on, default value is used for result name.
10595 New GEOM.GEOM_Object, containing the created face.
10598 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10600 # Example: see GEOM_Spanner.py
10601 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10602 RaiseIfFailed("MakeQuad", self.BlocksOp)
10603 self._autoPublish(anObj, theName, "quad")
10606 ## Create a quadrangle face on two edges.
10607 # The missing edges will be built by creating the shortest ones.
10608 # @param E1,E2 Two opposite edges for the face.
10609 # @param theName Object name; when specified, this parameter is used
10610 # for result publication in the study. Otherwise, if automatic
10611 # publication is switched on, default value is used for result name.
10613 # @return New GEOM.GEOM_Object, containing the created face.
10615 # @ref tui_building_by_blocks_page "Example"
10616 def MakeQuad2Edges(self, E1, E2, theName=None):
10618 Create a quadrangle face on two edges.
10619 The missing edges will be built by creating the shortest ones.
10622 E1,E2 Two opposite edges for the face.
10623 theName Object name; when specified, this parameter is used
10624 for result publication in the study. Otherwise, if automatic
10625 publication is switched on, default value is used for result name.
10628 New GEOM.GEOM_Object, containing the created face.
10632 p1 = geompy.MakeVertex( 0., 0., 0.)
10633 p2 = geompy.MakeVertex(150., 30., 0.)
10634 p3 = geompy.MakeVertex( 0., 120., 50.)
10635 p4 = geompy.MakeVertex( 0., 40., 70.)
10637 edge1 = geompy.MakeEdge(p1, p2)
10638 edge2 = geompy.MakeEdge(p3, p4)
10639 # create a quadrangle face from two edges
10640 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10642 # Example: see GEOM_Spanner.py
10643 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10644 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10645 self._autoPublish(anObj, theName, "quad")
10648 ## Create a quadrangle face with specified corners.
10649 # The missing edges will be built by creating the shortest ones.
10650 # @param V1,V2,V3,V4 Corner vertices for the face.
10651 # @param theName Object name; when specified, this parameter is used
10652 # for result publication in the study. Otherwise, if automatic
10653 # publication is switched on, default value is used for result name.
10655 # @return New GEOM.GEOM_Object, containing the created face.
10657 # @ref tui_building_by_blocks_page "Example 1"
10658 # \n @ref swig_MakeQuad4Vertices "Example 2"
10659 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10661 Create a quadrangle face with specified corners.
10662 The missing edges will be built by creating the shortest ones.
10665 V1,V2,V3,V4 Corner vertices for the face.
10666 theName Object name; when specified, this parameter is used
10667 for result publication in the study. Otherwise, if automatic
10668 publication is switched on, default value is used for result name.
10671 New GEOM.GEOM_Object, containing the created face.
10675 p1 = geompy.MakeVertex( 0., 0., 0.)
10676 p2 = geompy.MakeVertex(150., 30., 0.)
10677 p3 = geompy.MakeVertex( 0., 120., 50.)
10678 p4 = geompy.MakeVertex( 0., 40., 70.)
10679 # create a quadrangle from four points in its corners
10680 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10682 # Example: see GEOM_Spanner.py
10683 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10684 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10685 self._autoPublish(anObj, theName, "quad")
10688 ## Create a hexahedral solid, bounded by the six given faces. Order of
10689 # faces is not important. It is not necessary that Faces share the same edge.
10690 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10691 # @param theName Object name; when specified, this parameter is used
10692 # for result publication in the study. Otherwise, if automatic
10693 # publication is switched on, default value is used for result name.
10695 # @return New GEOM.GEOM_Object, containing the created solid.
10697 # @ref tui_building_by_blocks_page "Example 1"
10698 # \n @ref swig_MakeHexa "Example 2"
10699 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10701 Create a hexahedral solid, bounded by the six given faces. Order of
10702 faces is not important. It is not necessary that Faces share the same edge.
10705 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10706 theName Object name; when specified, this parameter is used
10707 for result publication in the study. Otherwise, if automatic
10708 publication is switched on, default value is used for result name.
10711 New GEOM.GEOM_Object, containing the created solid.
10714 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10716 # Example: see GEOM_Spanner.py
10717 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10718 RaiseIfFailed("MakeHexa", self.BlocksOp)
10719 self._autoPublish(anObj, theName, "hexa")
10722 ## Create a hexahedral solid between two given faces.
10723 # The missing faces will be built by creating the smallest ones.
10724 # @param F1,F2 Two opposite faces for the hexahedral solid.
10725 # @param theName Object name; when specified, this parameter is used
10726 # for result publication in the study. Otherwise, if automatic
10727 # publication is switched on, default value is used for result name.
10729 # @return New GEOM.GEOM_Object, containing the created solid.
10731 # @ref tui_building_by_blocks_page "Example 1"
10732 # \n @ref swig_MakeHexa2Faces "Example 2"
10733 def MakeHexa2Faces(self, F1, F2, theName=None):
10735 Create a hexahedral solid between two given faces.
10736 The missing faces will be built by creating the smallest ones.
10739 F1,F2 Two opposite faces for the hexahedral solid.
10740 theName Object name; when specified, this parameter is used
10741 for result publication in the study. Otherwise, if automatic
10742 publication is switched on, default value is used for result name.
10745 New GEOM.GEOM_Object, containing the created solid.
10748 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10750 # Example: see GEOM_Spanner.py
10751 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10752 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10753 self._autoPublish(anObj, theName, "hexa")
10759 ## @addtogroup l3_blocks_op
10762 ## Get a vertex, found in the given shape by its coordinates.
10763 # @param theShape Block or a compound of blocks.
10764 # @param theX,theY,theZ Coordinates of the sought vertex.
10765 # @param theEpsilon Maximum allowed distance between the resulting
10766 # vertex and point with the given coordinates.
10767 # @param theName Object name; when specified, this parameter is used
10768 # for result publication in the study. Otherwise, if automatic
10769 # publication is switched on, default value is used for result name.
10771 # @return New GEOM.GEOM_Object, containing the found vertex.
10773 # @ref swig_GetPoint "Example"
10774 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10776 Get a vertex, found in the given shape by its coordinates.
10779 theShape Block or a compound of blocks.
10780 theX,theY,theZ Coordinates of the sought vertex.
10781 theEpsilon Maximum allowed distance between the resulting
10782 vertex and point with the given coordinates.
10783 theName Object name; when specified, this parameter is used
10784 for result publication in the study. Otherwise, if automatic
10785 publication is switched on, default value is used for result name.
10788 New GEOM.GEOM_Object, containing the found vertex.
10791 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10793 # Example: see GEOM_TestOthers.py
10794 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10795 RaiseIfFailed("GetPoint", self.BlocksOp)
10796 self._autoPublish(anObj, theName, "vertex")
10799 ## Find a vertex of the given shape, which has minimal distance to the given point.
10800 # @param theShape Any shape.
10801 # @param thePoint Point, close to the desired vertex.
10802 # @param theName Object name; when specified, this parameter is used
10803 # for result publication in the study. Otherwise, if automatic
10804 # publication is switched on, default value is used for result name.
10806 # @return New GEOM.GEOM_Object, containing the found vertex.
10808 # @ref swig_GetVertexNearPoint "Example"
10809 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10811 Find a vertex of the given shape, which has minimal distance to the given point.
10814 theShape Any shape.
10815 thePoint Point, close to the desired vertex.
10816 theName Object name; when specified, this parameter is used
10817 for result publication in the study. Otherwise, if automatic
10818 publication is switched on, default value is used for result name.
10821 New GEOM.GEOM_Object, containing the found vertex.
10824 pmidle = geompy.MakeVertex(50, 0, 50)
10825 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10827 # Example: see GEOM_TestOthers.py
10828 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10829 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10830 self._autoPublish(anObj, theName, "vertex")
10833 ## Get an edge, found in the given shape by two given vertices.
10834 # @param theShape Block or a compound of blocks.
10835 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10836 # @param theName Object name; when specified, this parameter is used
10837 # for result publication in the study. Otherwise, if automatic
10838 # publication is switched on, default value is used for result name.
10840 # @return New GEOM.GEOM_Object, containing the found edge.
10842 # @ref swig_GetEdge "Example"
10843 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10845 Get an edge, found in the given shape by two given vertices.
10848 theShape Block or a compound of blocks.
10849 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10850 theName Object name; when specified, this parameter is used
10851 for result publication in the study. Otherwise, if automatic
10852 publication is switched on, default value is used for result name.
10855 New GEOM.GEOM_Object, containing the found edge.
10857 # Example: see GEOM_Spanner.py
10858 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10859 RaiseIfFailed("GetEdge", self.BlocksOp)
10860 self._autoPublish(anObj, theName, "edge")
10863 ## Find an edge of the given shape, which has minimal distance to the given point.
10864 # @param theShape Block or a compound of blocks.
10865 # @param thePoint Point, close to the desired edge.
10866 # @param theName Object name; when specified, this parameter is used
10867 # for result publication in the study. Otherwise, if automatic
10868 # publication is switched on, default value is used for result name.
10870 # @return New GEOM.GEOM_Object, containing the found edge.
10872 # @ref swig_GetEdgeNearPoint "Example"
10873 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10875 Find an edge of the given shape, which has minimal distance to the given point.
10878 theShape Block or a compound of blocks.
10879 thePoint Point, close to the desired edge.
10880 theName Object name; when specified, this parameter is used
10881 for result publication in the study. Otherwise, if automatic
10882 publication is switched on, default value is used for result name.
10885 New GEOM.GEOM_Object, containing the found edge.
10887 # Example: see GEOM_TestOthers.py
10888 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10889 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10890 self._autoPublish(anObj, theName, "edge")
10893 ## Returns a face, found in the given shape by four given corner vertices.
10894 # @param theShape Block or a compound of blocks.
10895 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10896 # @param theName Object name; when specified, this parameter is used
10897 # for result publication in the study. Otherwise, if automatic
10898 # publication is switched on, default value is used for result name.
10900 # @return New GEOM.GEOM_Object, containing the found face.
10902 # @ref swig_todo "Example"
10903 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10905 Returns a face, found in the given shape by four given corner vertices.
10908 theShape Block or a compound of blocks.
10909 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10910 theName Object name; when specified, this parameter is used
10911 for result publication in the study. Otherwise, if automatic
10912 publication is switched on, default value is used for result name.
10915 New GEOM.GEOM_Object, containing the found face.
10917 # Example: see GEOM_Spanner.py
10918 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10919 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10920 self._autoPublish(anObj, theName, "face")
10923 ## Get a face of block, found in the given shape by two given edges.
10924 # @param theShape Block or a compound of blocks.
10925 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10926 # @param theName Object name; when specified, this parameter is used
10927 # for result publication in the study. Otherwise, if automatic
10928 # publication is switched on, default value is used for result name.
10930 # @return New GEOM.GEOM_Object, containing the found face.
10932 # @ref swig_todo "Example"
10933 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10935 Get a face of block, found in the given shape by two given edges.
10938 theShape Block or a compound of blocks.
10939 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10940 theName Object name; when specified, this parameter is used
10941 for result publication in the study. Otherwise, if automatic
10942 publication is switched on, default value is used for result name.
10945 New GEOM.GEOM_Object, containing the found face.
10947 # Example: see GEOM_Spanner.py
10948 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10949 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10950 self._autoPublish(anObj, theName, "face")
10953 ## Find a face, opposite to the given one in the given block.
10954 # @param theBlock Must be a hexahedral solid.
10955 # @param theFace Face of \a theBlock, opposite to the desired face.
10956 # @param theName Object name; when specified, this parameter is used
10957 # for result publication in the study. Otherwise, if automatic
10958 # publication is switched on, default value is used for result name.
10960 # @return New GEOM.GEOM_Object, containing the found face.
10962 # @ref swig_GetOppositeFace "Example"
10963 def GetOppositeFace(self, theBlock, theFace, theName=None):
10965 Find a face, opposite to the given one in the given block.
10968 theBlock Must be a hexahedral solid.
10969 theFace Face of theBlock, opposite to the desired face.
10970 theName Object name; when specified, this parameter is used
10971 for result publication in the study. Otherwise, if automatic
10972 publication is switched on, default value is used for result name.
10975 New GEOM.GEOM_Object, containing the found face.
10977 # Example: see GEOM_Spanner.py
10978 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10979 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10980 self._autoPublish(anObj, theName, "face")
10983 ## Find a face of the given shape, which has minimal distance to the given point.
10984 # @param theShape Block or a compound of blocks.
10985 # @param thePoint Point, close to the desired face.
10986 # @param theName Object name; when specified, this parameter is used
10987 # for result publication in the study. Otherwise, if automatic
10988 # publication is switched on, default value is used for result name.
10990 # @return New GEOM.GEOM_Object, containing the found face.
10992 # @ref swig_GetFaceNearPoint "Example"
10993 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10995 Find a face of the given shape, which has minimal distance to the given point.
10998 theShape Block or a compound of blocks.
10999 thePoint Point, close to the desired face.
11000 theName Object name; when specified, this parameter is used
11001 for result publication in the study. Otherwise, if automatic
11002 publication is switched on, default value is used for result name.
11005 New GEOM.GEOM_Object, containing the found face.
11007 # Example: see GEOM_Spanner.py
11008 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11009 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11010 self._autoPublish(anObj, theName, "face")
11013 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11014 # @param theBlock Block or a compound of blocks.
11015 # @param theVector Vector, close to the normale of the desired face.
11016 # @param theName Object name; when specified, this parameter is used
11017 # for result publication in the study. Otherwise, if automatic
11018 # publication is switched on, default value is used for result name.
11020 # @return New GEOM.GEOM_Object, containing the found face.
11022 # @ref swig_todo "Example"
11023 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11025 Find a face of block, whose outside normale has minimal angle with the given vector.
11028 theBlock Block or a compound of blocks.
11029 theVector Vector, close to the normale of the desired face.
11030 theName Object name; when specified, this parameter is used
11031 for result publication in the study. Otherwise, if automatic
11032 publication is switched on, default value is used for result name.
11035 New GEOM.GEOM_Object, containing the found face.
11037 # Example: see GEOM_Spanner.py
11038 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11039 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11040 self._autoPublish(anObj, theName, "face")
11043 ## Find all sub-shapes of type \a theShapeType of the given shape,
11044 # which have minimal distance to the given point.
11045 # @param theShape Any shape.
11046 # @param thePoint Point, close to the desired shape.
11047 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11048 # @param theTolerance The tolerance for distances comparison. All shapes
11049 # with distances to the given point in interval
11050 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11051 # @param theName Object name; when specified, this parameter is used
11052 # for result publication in the study. Otherwise, if automatic
11053 # publication is switched on, default value is used for result name.
11055 # @return New GEOM_Object, containing a group of all found shapes.
11057 # @ref swig_GetShapesNearPoint "Example"
11058 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11060 Find all sub-shapes of type theShapeType of the given shape,
11061 which have minimal distance to the given point.
11064 theShape Any shape.
11065 thePoint Point, close to the desired shape.
11066 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11067 theTolerance The tolerance for distances comparison. All shapes
11068 with distances to the given point in interval
11069 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11070 theName Object name; when specified, this parameter is used
11071 for result publication in the study. Otherwise, if automatic
11072 publication is switched on, default value is used for result name.
11075 New GEOM_Object, containing a group of all found shapes.
11077 # Example: see GEOM_TestOthers.py
11078 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11079 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11080 self._autoPublish(anObj, theName, "group")
11083 # end of l3_blocks_op
11086 ## @addtogroup l4_blocks_measure
11089 ## Check, if the compound of blocks is given.
11090 # To be considered as a compound of blocks, the
11091 # given shape must satisfy the following conditions:
11092 # - Each element of the compound should be a Block (6 faces and 12 edges).
11093 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11094 # - The compound should be connexe.
11095 # - The glue between two quadrangle faces should be applied.
11096 # @param theCompound The compound to check.
11097 # @return TRUE, if the given shape is a compound of blocks.
11098 # If theCompound is not valid, prints all discovered errors.
11100 # @ref tui_measurement_tools_page "Example 1"
11101 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11102 def CheckCompoundOfBlocks(self,theCompound):
11104 Check, if the compound of blocks is given.
11105 To be considered as a compound of blocks, the
11106 given shape must satisfy the following conditions:
11107 - Each element of the compound should be a Block (6 faces and 12 edges).
11108 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11109 - The compound should be connexe.
11110 - The glue between two quadrangle faces should be applied.
11113 theCompound The compound to check.
11116 TRUE, if the given shape is a compound of blocks.
11117 If theCompound is not valid, prints all discovered errors.
11119 # Example: see GEOM_Spanner.py
11120 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11121 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11123 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11127 ## Retrieve all non blocks solids and faces from \a theShape.
11128 # @param theShape The shape to explore.
11129 # @param theName Object name; when specified, this parameter is used
11130 # for result publication in the study. Otherwise, if automatic
11131 # publication is switched on, default value is used for result name.
11133 # @return A tuple of two GEOM_Objects. The first object is a group of all
11134 # non block solids (= not 6 faces, or with 6 faces, but with the
11135 # presence of non-quadrangular faces). The second object is a
11136 # group of all non quadrangular faces.
11138 # @ref tui_measurement_tools_page "Example 1"
11139 # \n @ref swig_GetNonBlocks "Example 2"
11140 def GetNonBlocks (self, theShape, theName=None):
11142 Retrieve all non blocks solids and faces from theShape.
11145 theShape The shape to explore.
11146 theName Object name; when specified, this parameter is used
11147 for result publication in the study. Otherwise, if automatic
11148 publication is switched on, default value is used for result name.
11151 A tuple of two GEOM_Objects. The first object is a group of all
11152 non block solids (= not 6 faces, or with 6 faces, but with the
11153 presence of non-quadrangular faces). The second object is a
11154 group of all non quadrangular faces.
11157 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11159 # Example: see GEOM_Spanner.py
11160 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11161 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11162 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11165 ## Remove all seam and degenerated edges from \a theShape.
11166 # Unite faces and edges, sharing one surface. It means that
11167 # this faces must have references to one C++ surface object (handle).
11168 # @param theShape The compound or single solid to remove irregular edges from.
11169 # @param doUnionFaces If True, then unite faces. If False (the default value),
11170 # do not unite faces.
11171 # @param theName Object name; when specified, this parameter is used
11172 # for result publication in the study. Otherwise, if automatic
11173 # publication is switched on, default value is used for result name.
11175 # @return Improved shape.
11177 # @ref swig_RemoveExtraEdges "Example"
11178 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11180 Remove all seam and degenerated edges from theShape.
11181 Unite faces and edges, sharing one surface. It means that
11182 this faces must have references to one C++ surface object (handle).
11185 theShape The compound or single solid to remove irregular edges from.
11186 doUnionFaces If True, then unite faces. If False (the default value),
11187 do not unite faces.
11188 theName Object name; when specified, this parameter is used
11189 for result publication in the study. Otherwise, if automatic
11190 publication is switched on, default value is used for result name.
11195 # Example: see GEOM_TestOthers.py
11196 nbFacesOptimum = -1 # -1 means do not unite faces
11197 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11198 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11199 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11200 self._autoPublish(anObj, theName, "removeExtraEdges")
11203 ## Performs union faces of \a theShape
11204 # Unite faces sharing one surface. It means that
11205 # these faces must have references to one C++ surface object (handle).
11206 # @param theShape The compound or single solid that contains faces
11207 # to perform union.
11208 # @param theName Object name; when specified, this parameter is used
11209 # for result publication in the study. Otherwise, if automatic
11210 # publication is switched on, default value is used for result name.
11212 # @return Improved shape.
11214 # @ref swig_UnionFaces "Example"
11215 def UnionFaces(self, theShape, theName=None):
11217 Performs union faces of theShape.
11218 Unite faces sharing one surface. It means that
11219 these faces must have references to one C++ surface object (handle).
11222 theShape The compound or single solid that contains faces
11224 theName Object name; when specified, this parameter is used
11225 for result publication in the study. Otherwise, if automatic
11226 publication is switched on, default value is used for result name.
11231 # Example: see GEOM_TestOthers.py
11232 anObj = self.BlocksOp.UnionFaces(theShape)
11233 RaiseIfFailed("UnionFaces", self.BlocksOp)
11234 self._autoPublish(anObj, theName, "unionFaces")
11237 ## Check, if the given shape is a blocks compound.
11238 # Fix all detected errors.
11239 # \note Single block can be also fixed by this method.
11240 # @param theShape The compound to check and improve.
11241 # @param theName Object name; when specified, this parameter is used
11242 # for result publication in the study. Otherwise, if automatic
11243 # publication is switched on, default value is used for result name.
11245 # @return Improved compound.
11247 # @ref swig_CheckAndImprove "Example"
11248 def CheckAndImprove(self, theShape, theName=None):
11250 Check, if the given shape is a blocks compound.
11251 Fix all detected errors.
11254 Single block can be also fixed by this method.
11257 theShape The compound to check and improve.
11258 theName Object name; when specified, this parameter is used
11259 for result publication in the study. Otherwise, if automatic
11260 publication is switched on, default value is used for result name.
11265 # Example: see GEOM_TestOthers.py
11266 anObj = self.BlocksOp.CheckAndImprove(theShape)
11267 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11268 self._autoPublish(anObj, theName, "improved")
11271 # end of l4_blocks_measure
11274 ## @addtogroup l3_blocks_op
11277 ## Get all the blocks, contained in the given compound.
11278 # @param theCompound The compound to explode.
11279 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11280 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11281 # @param theName Object name; when specified, this parameter is used
11282 # for result publication in the study. Otherwise, if automatic
11283 # publication is switched on, default value is used for result name.
11285 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11287 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11289 # @ref tui_explode_on_blocks "Example 1"
11290 # \n @ref swig_MakeBlockExplode "Example 2"
11291 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11293 Get all the blocks, contained in the given compound.
11296 theCompound The compound to explode.
11297 theMinNbFaces If solid has lower number of faces, it is not a block.
11298 theMaxNbFaces If solid has higher number of faces, it is not a block.
11299 theName Object name; when specified, this parameter is used
11300 for result publication in the study. Otherwise, if automatic
11301 publication is switched on, default value is used for result name.
11304 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11307 List of GEOM.GEOM_Object, containing the retrieved blocks.
11309 # Example: see GEOM_TestOthers.py
11310 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11311 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11312 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11313 for anObj in aList:
11314 anObj.SetParameters(Parameters)
11316 self._autoPublish(aList, theName, "block")
11319 ## Find block, containing the given point inside its volume or on boundary.
11320 # @param theCompound Compound, to find block in.
11321 # @param thePoint Point, close to the desired block. If the point lays on
11322 # boundary between some blocks, we return block with nearest center.
11323 # @param theName Object name; when specified, this parameter is used
11324 # for result publication in the study. Otherwise, if automatic
11325 # publication is switched on, default value is used for result name.
11327 # @return New GEOM.GEOM_Object, containing the found block.
11329 # @ref swig_todo "Example"
11330 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11332 Find block, containing the given point inside its volume or on boundary.
11335 theCompound Compound, to find block in.
11336 thePoint Point, close to the desired block. If the point lays on
11337 boundary between some blocks, we return block with nearest center.
11338 theName Object name; when specified, this parameter is used
11339 for result publication in the study. Otherwise, if automatic
11340 publication is switched on, default value is used for result name.
11343 New GEOM.GEOM_Object, containing the found block.
11345 # Example: see GEOM_Spanner.py
11346 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11347 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11348 self._autoPublish(anObj, theName, "block")
11351 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11352 # @param theCompound Compound, to find block in.
11353 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11354 # @param theName Object name; when specified, this parameter is used
11355 # for result publication in the study. Otherwise, if automatic
11356 # publication is switched on, default value is used for result name.
11358 # @return New GEOM.GEOM_Object, containing the found block.
11360 # @ref swig_GetBlockByParts "Example"
11361 def GetBlockByParts(self, theCompound, theParts, theName=None):
11363 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11366 theCompound Compound, to find block in.
11367 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11368 theName Object name; when specified, this parameter is used
11369 for result publication in the study. Otherwise, if automatic
11370 publication is switched on, default value is used for result name.
11373 New GEOM_Object, containing the found block.
11375 # Example: see GEOM_TestOthers.py
11376 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11377 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11378 self._autoPublish(anObj, theName, "block")
11381 ## Return all blocks, containing all the elements, passed as the parts.
11382 # @param theCompound Compound, to find blocks in.
11383 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11384 # @param theName Object name; when specified, this parameter is used
11385 # for result publication in the study. Otherwise, if automatic
11386 # publication is switched on, default value is used for result name.
11388 # @return List of GEOM.GEOM_Object, containing the found blocks.
11390 # @ref swig_todo "Example"
11391 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11393 Return all blocks, containing all the elements, passed as the parts.
11396 theCompound Compound, to find blocks in.
11397 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11398 theName Object name; when specified, this parameter is used
11399 for result publication in the study. Otherwise, if automatic
11400 publication is switched on, default value is used for result name.
11403 List of GEOM.GEOM_Object, containing the found blocks.
11405 # Example: see GEOM_Spanner.py
11406 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11407 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11408 self._autoPublish(aList, theName, "block")
11411 ## Multi-transformate block and glue the result.
11412 # Transformation is defined so, as to superpose direction faces.
11413 # @param Block Hexahedral solid to be multi-transformed.
11414 # @param DirFace1 ID of First direction face.
11415 # @param DirFace2 ID of Second direction face.
11416 # @param NbTimes Quantity of transformations to be done.
11417 # @param theName Object name; when specified, this parameter is used
11418 # for result publication in the study. Otherwise, if automatic
11419 # publication is switched on, default value is used for result name.
11421 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11423 # @return New GEOM.GEOM_Object, containing the result shape.
11425 # @ref tui_multi_transformation "Example"
11426 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11428 Multi-transformate block and glue the result.
11429 Transformation is defined so, as to superpose direction faces.
11432 Block Hexahedral solid to be multi-transformed.
11433 DirFace1 ID of First direction face.
11434 DirFace2 ID of Second direction face.
11435 NbTimes Quantity of transformations to be done.
11436 theName Object name; when specified, this parameter is used
11437 for result publication in the study. Otherwise, if automatic
11438 publication is switched on, default value is used for result name.
11441 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11444 New GEOM.GEOM_Object, containing the result shape.
11446 # Example: see GEOM_Spanner.py
11447 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11448 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11449 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11450 anObj.SetParameters(Parameters)
11451 self._autoPublish(anObj, theName, "transformed")
11454 ## Multi-transformate block and glue the result.
11455 # @param Block Hexahedral solid to be multi-transformed.
11456 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11457 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11458 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11459 # @param theName Object name; when specified, this parameter is used
11460 # for result publication in the study. Otherwise, if automatic
11461 # publication is switched on, default value is used for result name.
11463 # @return New GEOM.GEOM_Object, containing the result shape.
11465 # @ref tui_multi_transformation "Example"
11466 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11467 DirFace1V, DirFace2V, NbTimesV, theName=None):
11469 Multi-transformate block and glue the result.
11472 Block Hexahedral solid to be multi-transformed.
11473 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11474 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11475 NbTimesU,NbTimesV Quantity of transformations to be done.
11476 theName Object name; when specified, this parameter is used
11477 for result publication in the study. Otherwise, if automatic
11478 publication is switched on, default value is used for result name.
11481 New GEOM.GEOM_Object, containing the result shape.
11483 # Example: see GEOM_Spanner.py
11484 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11485 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11486 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11487 DirFace1V, DirFace2V, NbTimesV)
11488 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11489 anObj.SetParameters(Parameters)
11490 self._autoPublish(anObj, theName, "transformed")
11493 ## Build all possible propagation groups.
11494 # Propagation group is a set of all edges, opposite to one (main)
11495 # edge of this group directly or through other opposite edges.
11496 # Notion of Opposite Edge make sence only on quadrangle face.
11497 # @param theShape Shape to build propagation groups on.
11498 # @param theName Object name; when specified, this parameter is used
11499 # for result publication in the study. Otherwise, if automatic
11500 # publication is switched on, default value is used for result name.
11502 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11504 # @ref swig_Propagate "Example"
11505 def Propagate(self, theShape, theName=None):
11507 Build all possible propagation groups.
11508 Propagation group is a set of all edges, opposite to one (main)
11509 edge of this group directly or through other opposite edges.
11510 Notion of Opposite Edge make sence only on quadrangle face.
11513 theShape Shape to build propagation groups on.
11514 theName Object name; when specified, this parameter is used
11515 for result publication in the study. Otherwise, if automatic
11516 publication is switched on, default value is used for result name.
11519 List of GEOM.GEOM_Object, each of them is a propagation group.
11521 # Example: see GEOM_TestOthers.py
11522 listChains = self.BlocksOp.Propagate(theShape)
11523 RaiseIfFailed("Propagate", self.BlocksOp)
11524 self._autoPublish(listChains, theName, "propagate")
11527 # end of l3_blocks_op
11530 ## @addtogroup l3_groups
11533 ## Creates a new group which will store sub-shapes of theMainShape
11534 # @param theMainShape is a GEOM object on which the group is selected
11535 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11536 # @param theName Object name; when specified, this parameter is used
11537 # for result publication in the study. Otherwise, if automatic
11538 # publication is switched on, default value is used for result name.
11540 # @return a newly created GEOM group (GEOM.GEOM_Object)
11542 # @ref tui_working_with_groups_page "Example 1"
11543 # \n @ref swig_CreateGroup "Example 2"
11544 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11546 Creates a new group which will store sub-shapes of theMainShape
11549 theMainShape is a GEOM object on which the group is selected
11550 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11551 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11552 theName Object name; when specified, this parameter is used
11553 for result publication in the study. Otherwise, if automatic
11554 publication is switched on, default value is used for result name.
11557 a newly created GEOM group
11560 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11563 # Example: see GEOM_TestOthers.py
11564 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11565 RaiseIfFailed("CreateGroup", self.GroupOp)
11566 self._autoPublish(anObj, theName, "group")
11569 ## Adds a sub-object with ID theSubShapeId to the group
11570 # @param theGroup is a GEOM group to which the new sub-shape is added
11571 # @param theSubShapeID is a sub-shape ID in the main object.
11572 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11574 # @ref tui_working_with_groups_page "Example"
11575 def AddObject(self,theGroup, theSubShapeID):
11577 Adds a sub-object with ID theSubShapeId to the group
11580 theGroup is a GEOM group to which the new sub-shape is added
11581 theSubShapeID is a sub-shape ID in the main object.
11584 Use method GetSubShapeID() to get an unique ID of the sub-shape
11586 # Example: see GEOM_TestOthers.py
11587 self.GroupOp.AddObject(theGroup, theSubShapeID)
11588 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11589 RaiseIfFailed("AddObject", self.GroupOp)
11593 ## Removes a sub-object with ID \a theSubShapeId from the group
11594 # @param theGroup is a GEOM group from which the new sub-shape is removed
11595 # @param theSubShapeID is a sub-shape ID in the main object.
11596 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11598 # @ref tui_working_with_groups_page "Example"
11599 def RemoveObject(self,theGroup, theSubShapeID):
11601 Removes a sub-object with ID theSubShapeId from the group
11604 theGroup is a GEOM group from which the new sub-shape is removed
11605 theSubShapeID is a sub-shape ID in the main object.
11608 Use method GetSubShapeID() to get an unique ID of the sub-shape
11610 # Example: see GEOM_TestOthers.py
11611 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11612 RaiseIfFailed("RemoveObject", self.GroupOp)
11615 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11616 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11617 # @param theSubShapes is a list of sub-shapes to be added.
11619 # @ref tui_working_with_groups_page "Example"
11620 def UnionList (self,theGroup, theSubShapes):
11622 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11625 theGroup is a GEOM group to which the new sub-shapes are added.
11626 theSubShapes is a list of sub-shapes to be added.
11628 # Example: see GEOM_TestOthers.py
11629 self.GroupOp.UnionList(theGroup, theSubShapes)
11630 RaiseIfFailed("UnionList", self.GroupOp)
11633 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11634 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11635 # @param theSubShapes is a list of indices of sub-shapes to be added.
11637 # @ref swig_UnionIDs "Example"
11638 def UnionIDs(self,theGroup, theSubShapes):
11640 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11643 theGroup is a GEOM group to which the new sub-shapes are added.
11644 theSubShapes is a list of indices of sub-shapes to be added.
11646 # Example: see GEOM_TestOthers.py
11647 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11648 RaiseIfFailed("UnionIDs", self.GroupOp)
11651 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11652 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11653 # @param theSubShapes is a list of sub-shapes to be removed.
11655 # @ref tui_working_with_groups_page "Example"
11656 def DifferenceList (self,theGroup, theSubShapes):
11658 Removes from the group all the given shapes. No errors, if some shapes are not included.
11661 theGroup is a GEOM group from which the sub-shapes are removed.
11662 theSubShapes is a list of sub-shapes to be removed.
11664 # Example: see GEOM_TestOthers.py
11665 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11666 RaiseIfFailed("DifferenceList", self.GroupOp)
11669 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11670 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11671 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11673 # @ref swig_DifferenceIDs "Example"
11674 def DifferenceIDs(self,theGroup, theSubShapes):
11676 Removes from the group all the given shapes. No errors, if some shapes are not included.
11679 theGroup is a GEOM group from which the sub-shapes are removed.
11680 theSubShapes is a list of indices of sub-shapes to be removed.
11682 # Example: see GEOM_TestOthers.py
11683 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11684 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11687 ## Union of two groups.
11688 # New group is created. It will contain all entities
11689 # which are present in groups theGroup1 and theGroup2.
11690 # @param theGroup1, theGroup2 are the initial GEOM groups
11691 # to create the united group from.
11692 # @param theName Object name; when specified, this parameter is used
11693 # for result publication in the study. Otherwise, if automatic
11694 # publication is switched on, default value is used for result name.
11696 # @return a newly created GEOM group.
11698 # @ref tui_union_groups_anchor "Example"
11699 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11701 Union of two groups.
11702 New group is created. It will contain all entities
11703 which are present in groups theGroup1 and theGroup2.
11706 theGroup1, theGroup2 are the initial GEOM groups
11707 to create the united group from.
11708 theName Object name; when specified, this parameter is used
11709 for result publication in the study. Otherwise, if automatic
11710 publication is switched on, default value is used for result name.
11713 a newly created GEOM group.
11715 # Example: see GEOM_TestOthers.py
11716 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11717 RaiseIfFailed("UnionGroups", self.GroupOp)
11718 self._autoPublish(aGroup, theName, "group")
11721 ## Intersection of two groups.
11722 # New group is created. It will contain only those entities
11723 # which are present in both groups theGroup1 and theGroup2.
11724 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11725 # @param theName Object name; when specified, this parameter is used
11726 # for result publication in the study. Otherwise, if automatic
11727 # publication is switched on, default value is used for result name.
11729 # @return a newly created GEOM group.
11731 # @ref tui_intersect_groups_anchor "Example"
11732 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11734 Intersection of two groups.
11735 New group is created. It will contain only those entities
11736 which are present in both groups theGroup1 and theGroup2.
11739 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11740 theName Object name; when specified, this parameter is used
11741 for result publication in the study. Otherwise, if automatic
11742 publication is switched on, default value is used for result name.
11745 a newly created GEOM group.
11747 # Example: see GEOM_TestOthers.py
11748 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11749 RaiseIfFailed("IntersectGroups", self.GroupOp)
11750 self._autoPublish(aGroup, theName, "group")
11753 ## Cut of two groups.
11754 # New group is created. It will contain entities which are
11755 # present in group theGroup1 but are not present in group theGroup2.
11756 # @param theGroup1 is a GEOM group to include elements of.
11757 # @param theGroup2 is a GEOM group to exclude elements of.
11758 # @param theName Object name; when specified, this parameter is used
11759 # for result publication in the study. Otherwise, if automatic
11760 # publication is switched on, default value is used for result name.
11762 # @return a newly created GEOM group.
11764 # @ref tui_cut_groups_anchor "Example"
11765 def CutGroups (self, theGroup1, theGroup2, theName=None):
11768 New group is created. It will contain entities which are
11769 present in group theGroup1 but are not present in group theGroup2.
11772 theGroup1 is a GEOM group to include elements of.
11773 theGroup2 is a GEOM group to exclude elements of.
11774 theName Object name; when specified, this parameter is used
11775 for result publication in the study. Otherwise, if automatic
11776 publication is switched on, default value is used for result name.
11779 a newly created GEOM group.
11781 # Example: see GEOM_TestOthers.py
11782 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11783 RaiseIfFailed("CutGroups", self.GroupOp)
11784 self._autoPublish(aGroup, theName, "group")
11787 ## Union of list of groups.
11788 # New group is created. It will contain all entities that are
11789 # present in groups listed in theGList.
11790 # @param theGList is a list of GEOM groups to create the united group from.
11791 # @param theName Object name; when specified, this parameter is used
11792 # for result publication in the study. Otherwise, if automatic
11793 # publication is switched on, default value is used for result name.
11795 # @return a newly created GEOM group.
11797 # @ref tui_union_groups_anchor "Example"
11798 def UnionListOfGroups (self, theGList, theName=None):
11800 Union of list of groups.
11801 New group is created. It will contain all entities that are
11802 present in groups listed in theGList.
11805 theGList is a list of GEOM groups to create the united group from.
11806 theName Object name; when specified, this parameter is used
11807 for result publication in the study. Otherwise, if automatic
11808 publication is switched on, default value is used for result name.
11811 a newly created GEOM group.
11813 # Example: see GEOM_TestOthers.py
11814 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11815 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11816 self._autoPublish(aGroup, theName, "group")
11819 ## Cut of lists of groups.
11820 # New group is created. It will contain only entities
11821 # which are present in groups listed in theGList.
11822 # @param theGList is a list of GEOM groups to include elements of.
11823 # @param theName Object name; when specified, this parameter is used
11824 # for result publication in the study. Otherwise, if automatic
11825 # publication is switched on, default value is used for result name.
11827 # @return a newly created GEOM group.
11829 # @ref tui_intersect_groups_anchor "Example"
11830 def IntersectListOfGroups (self, theGList, theName=None):
11832 Cut of lists of groups.
11833 New group is created. It will contain only entities
11834 which are present in groups listed in theGList.
11837 theGList is a list of GEOM groups to include elements of.
11838 theName Object name; when specified, this parameter is used
11839 for result publication in the study. Otherwise, if automatic
11840 publication is switched on, default value is used for result name.
11843 a newly created GEOM group.
11845 # Example: see GEOM_TestOthers.py
11846 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11847 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11848 self._autoPublish(aGroup, theName, "group")
11851 ## Cut of lists of groups.
11852 # New group is created. It will contain only entities
11853 # which are present in groups listed in theGList1 but
11854 # are not present in groups from theGList2.
11855 # @param theGList1 is a list of GEOM groups to include elements of.
11856 # @param theGList2 is a list of GEOM groups to exclude elements of.
11857 # @param theName Object name; when specified, this parameter is used
11858 # for result publication in the study. Otherwise, if automatic
11859 # publication is switched on, default value is used for result name.
11861 # @return a newly created GEOM group.
11863 # @ref tui_cut_groups_anchor "Example"
11864 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11866 Cut of lists of groups.
11867 New group is created. It will contain only entities
11868 which are present in groups listed in theGList1 but
11869 are not present in groups from theGList2.
11872 theGList1 is a list of GEOM groups to include elements of.
11873 theGList2 is a list of GEOM groups to exclude elements of.
11874 theName Object name; when specified, this parameter is used
11875 for result publication in the study. Otherwise, if automatic
11876 publication is switched on, default value is used for result name.
11879 a newly created GEOM group.
11881 # Example: see GEOM_TestOthers.py
11882 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11883 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11884 self._autoPublish(aGroup, theName, "group")
11887 ## Returns a list of sub-objects ID stored in the group
11888 # @param theGroup is a GEOM group for which a list of IDs is requested
11890 # @ref swig_GetObjectIDs "Example"
11891 def GetObjectIDs(self,theGroup):
11893 Returns a list of sub-objects ID stored in the group
11896 theGroup is a GEOM group for which a list of IDs is requested
11898 # Example: see GEOM_TestOthers.py
11899 ListIDs = self.GroupOp.GetObjects(theGroup)
11900 RaiseIfFailed("GetObjects", self.GroupOp)
11903 ## Returns a type of sub-objects stored in the group
11904 # @param theGroup is a GEOM group which type is returned.
11906 # @ref swig_GetType "Example"
11907 def GetType(self,theGroup):
11909 Returns a type of sub-objects stored in the group
11912 theGroup is a GEOM group which type is returned.
11914 # Example: see GEOM_TestOthers.py
11915 aType = self.GroupOp.GetType(theGroup)
11916 RaiseIfFailed("GetType", self.GroupOp)
11919 ## Convert a type of geom object from id to string value
11920 # @param theId is a GEOM obect type id.
11921 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11922 # @ref swig_GetType "Example"
11923 def ShapeIdToType(self, theId):
11925 Convert a type of geom object from id to string value
11928 theId is a GEOM obect type id.
11931 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11958 return "REVOLUTION"
12006 return "FREE_BOUNDS"
12014 return "THRUSECTIONS"
12016 return "COMPOUNDFILTER"
12018 return "SHAPES_ON_SHAPE"
12020 return "ELLIPSE_ARC"
12022 return "3DSKETCHER"
12028 return "PIPETSHAPE"
12029 return "Shape Id not exist."
12031 ## Returns a main shape associated with the group
12032 # @param theGroup is a GEOM group for which a main shape object is requested
12033 # @return a GEOM object which is a main shape for theGroup
12035 # @ref swig_GetMainShape "Example"
12036 def GetMainShape(self,theGroup):
12038 Returns a main shape associated with the group
12041 theGroup is a GEOM group for which a main shape object is requested
12044 a GEOM object which is a main shape for theGroup
12046 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12048 # Example: see GEOM_TestOthers.py
12049 anObj = self.GroupOp.GetMainShape(theGroup)
12050 RaiseIfFailed("GetMainShape", self.GroupOp)
12053 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12054 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12055 # @param theShape given shape (see GEOM.GEOM_Object)
12056 # @param min_length minimum length of edges of theShape
12057 # @param max_length maximum length of edges of theShape
12058 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12059 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12060 # @param theName Object name; when specified, this parameter is used
12061 # for result publication in the study. Otherwise, if automatic
12062 # publication is switched on, default value is used for result name.
12064 # @return a newly created GEOM group of edges
12066 # @@ref swig_todo "Example"
12067 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12069 Create group of edges of theShape, whose length is in range [min_length, max_length].
12070 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12073 theShape given shape
12074 min_length minimum length of edges of theShape
12075 max_length maximum length of edges of theShape
12076 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12077 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12078 theName Object name; when specified, this parameter is used
12079 for result publication in the study. Otherwise, if automatic
12080 publication is switched on, default value is used for result name.
12083 a newly created GEOM group of edges.
12085 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12086 edges_in_range = []
12088 Props = self.BasicProperties(edge)
12089 if min_length <= Props[0] and Props[0] <= max_length:
12090 if (not include_min) and (min_length == Props[0]):
12093 if (not include_max) and (Props[0] == max_length):
12096 edges_in_range.append(edge)
12098 if len(edges_in_range) <= 0:
12099 print "No edges found by given criteria"
12102 # note: auto-publishing is done in self.CreateGroup()
12103 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12104 self.UnionList(group_edges, edges_in_range)
12108 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12109 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12110 # @param min_length minimum length of edges of selected shape
12111 # @param max_length maximum length of edges of selected shape
12112 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12113 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12114 # @return a newly created GEOM group of edges
12115 # @ref swig_todo "Example"
12116 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12118 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12119 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12122 min_length minimum length of edges of selected shape
12123 max_length maximum length of edges of selected shape
12124 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12125 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12128 a newly created GEOM group of edges.
12130 nb_selected = sg.SelectedCount()
12131 if nb_selected < 1:
12132 print "Select a shape before calling this function, please."
12134 if nb_selected > 1:
12135 print "Only one shape must be selected"
12138 id_shape = sg.getSelected(0)
12139 shape = IDToObject( id_shape )
12141 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12145 if include_min: left_str = " <= "
12146 if include_max: right_str = " <= "
12148 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12149 + left_str + "length" + right_str + `max_length`)
12151 sg.updateObjBrowser(1)
12158 ## @addtogroup l4_advanced
12161 ## Create a T-shape object with specified caracteristics for the main
12162 # and the incident pipes (radius, width, half-length).
12163 # The extremities of the main pipe are located on junctions points P1 and P2.
12164 # The extremity of the incident pipe is located on junction point P3.
12165 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12166 # the main plane of the T-shape is XOY.
12168 # @param theR1 Internal radius of main pipe
12169 # @param theW1 Width of main pipe
12170 # @param theL1 Half-length of main pipe
12171 # @param theR2 Internal radius of incident pipe (R2 < R1)
12172 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12173 # @param theL2 Half-length of incident pipe
12175 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12176 # @param theP1 1st junction point of main pipe
12177 # @param theP2 2nd junction point of main pipe
12178 # @param theP3 Junction point of incident pipe
12180 # @param theRL Internal radius of left thickness reduction
12181 # @param theWL Width of left thickness reduction
12182 # @param theLtransL Length of left transition part
12183 # @param theLthinL Length of left thin part
12185 # @param theRR Internal radius of right thickness reduction
12186 # @param theWR Width of right thickness reduction
12187 # @param theLtransR Length of right transition part
12188 # @param theLthinR Length of right thin part
12190 # @param theRI Internal radius of incident thickness reduction
12191 # @param theWI Width of incident thickness reduction
12192 # @param theLtransI Length of incident transition part
12193 # @param theLthinI Length of incident thin part
12195 # @param theName Object name; when specified, this parameter is used
12196 # for result publication in the study. Otherwise, if automatic
12197 # publication is switched on, default value is used for result name.
12199 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12201 # @ref tui_creation_pipetshape "Example"
12202 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12203 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12204 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12205 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12206 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12209 Create a T-shape object with specified caracteristics for the main
12210 and the incident pipes (radius, width, half-length).
12211 The extremities of the main pipe are located on junctions points P1 and P2.
12212 The extremity of the incident pipe is located on junction point P3.
12213 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12214 the main plane of the T-shape is XOY.
12217 theR1 Internal radius of main pipe
12218 theW1 Width of main pipe
12219 theL1 Half-length of main pipe
12220 theR2 Internal radius of incident pipe (R2 < R1)
12221 theW2 Width of incident pipe (R2+W2 < R1+W1)
12222 theL2 Half-length of incident pipe
12223 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12224 theP1 1st junction point of main pipe
12225 theP2 2nd junction point of main pipe
12226 theP3 Junction point of incident pipe
12228 theRL Internal radius of left thickness reduction
12229 theWL Width of left thickness reduction
12230 theLtransL Length of left transition part
12231 theLthinL Length of left thin part
12233 theRR Internal radius of right thickness reduction
12234 theWR Width of right thickness reduction
12235 theLtransR Length of right transition part
12236 theLthinR Length of right thin part
12238 theRI Internal radius of incident thickness reduction
12239 theWI Width of incident thickness reduction
12240 theLtransI Length of incident transition part
12241 theLthinI Length of incident thin part
12243 theName Object name; when specified, this parameter is used
12244 for result publication in the study. Otherwise, if automatic
12245 publication is switched on, default value is used for result name.
12248 List of GEOM_Object, containing the created shape and propagation groups.
12251 # create PipeTShape object
12252 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12253 # create PipeTShape object with position
12254 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12255 # create PipeTShape object with left thickness reduction
12256 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12258 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)
12259 if (theP1 and theP2 and theP3):
12260 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12261 theRL, theWL, theLtransL, theLthinL,
12262 theRR, theWR, theLtransR, theLthinR,
12263 theRI, theWI, theLtransI, theLthinI,
12264 theHexMesh, theP1, theP2, theP3)
12266 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12267 theRL, theWL, theLtransL, theLthinL,
12268 theRR, theWR, theLtransR, theLthinR,
12269 theRI, theWI, theLtransI, theLthinI,
12271 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12272 if Parameters: anObj[0].SetParameters(Parameters)
12273 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12274 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12277 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12278 # and the incident pipes (radius, width, half-length). The chamfer is
12279 # created on the junction of the pipes.
12280 # The extremities of the main pipe are located on junctions points P1 and P2.
12281 # The extremity of the incident pipe is located on junction point P3.
12282 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12283 # the main plane of the T-shape is XOY.
12284 # @param theR1 Internal radius of main pipe
12285 # @param theW1 Width of main pipe
12286 # @param theL1 Half-length of main pipe
12287 # @param theR2 Internal radius of incident pipe (R2 < R1)
12288 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12289 # @param theL2 Half-length of incident pipe
12290 # @param theH Height of the chamfer.
12291 # @param theW Width of the chamfer.
12292 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12293 # @param theP1 1st junction point of main pipe
12294 # @param theP2 2nd junction point of main pipe
12295 # @param theP3 Junction point of incident pipe
12297 # @param theRL Internal radius of left thickness reduction
12298 # @param theWL Width of left thickness reduction
12299 # @param theLtransL Length of left transition part
12300 # @param theLthinL Length of left thin part
12302 # @param theRR Internal radius of right thickness reduction
12303 # @param theWR Width of right thickness reduction
12304 # @param theLtransR Length of right transition part
12305 # @param theLthinR Length of right thin part
12307 # @param theRI Internal radius of incident thickness reduction
12308 # @param theWI Width of incident thickness reduction
12309 # @param theLtransI Length of incident transition part
12310 # @param theLthinI Length of incident thin part
12312 # @param theName Object name; when specified, this parameter is used
12313 # for result publication in the study. Otherwise, if automatic
12314 # publication is switched on, default value is used for result name.
12316 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12318 # @ref tui_creation_pipetshape "Example"
12319 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12320 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12321 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12322 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12323 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12326 Create a T-shape object with chamfer and with specified caracteristics for the main
12327 and the incident pipes (radius, width, half-length). The chamfer is
12328 created on the junction of the pipes.
12329 The extremities of the main pipe are located on junctions points P1 and P2.
12330 The extremity of the incident pipe is located on junction point P3.
12331 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12332 the main plane of the T-shape is XOY.
12335 theR1 Internal radius of main pipe
12336 theW1 Width of main pipe
12337 theL1 Half-length of main pipe
12338 theR2 Internal radius of incident pipe (R2 < R1)
12339 theW2 Width of incident pipe (R2+W2 < R1+W1)
12340 theL2 Half-length of incident pipe
12341 theH Height of the chamfer.
12342 theW Width of the chamfer.
12343 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12344 theP1 1st junction point of main pipe
12345 theP2 2nd junction point of main pipe
12346 theP3 Junction point of incident pipe
12348 theRL Internal radius of left thickness reduction
12349 theWL Width of left thickness reduction
12350 theLtransL Length of left transition part
12351 theLthinL Length of left thin part
12353 theRR Internal radius of right thickness reduction
12354 theWR Width of right thickness reduction
12355 theLtransR Length of right transition part
12356 theLthinR Length of right thin part
12358 theRI Internal radius of incident thickness reduction
12359 theWI Width of incident thickness reduction
12360 theLtransI Length of incident transition part
12361 theLthinI Length of incident thin part
12363 theName Object name; when specified, this parameter is used
12364 for result publication in the study. Otherwise, if automatic
12365 publication is switched on, default value is used for result name.
12368 List of GEOM_Object, containing the created shape and propagation groups.
12371 # create PipeTShape with chamfer object
12372 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12373 # create PipeTShape with chamfer object with position
12374 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12375 # create PipeTShape with chamfer object with left thickness reduction
12376 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)
12378 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)
12379 if (theP1 and theP2 and theP3):
12380 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12381 theRL, theWL, theLtransL, theLthinL,
12382 theRR, theWR, theLtransR, theLthinR,
12383 theRI, theWI, theLtransI, theLthinI,
12384 theH, theW, theHexMesh, theP1, theP2, theP3)
12386 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12387 theRL, theWL, theLtransL, theLthinL,
12388 theRR, theWR, theLtransR, theLthinR,
12389 theRI, theWI, theLtransI, theLthinI,
12390 theH, theW, theHexMesh)
12391 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12392 if Parameters: anObj[0].SetParameters(Parameters)
12393 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12394 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12397 ## Create a T-shape object with fillet and with specified caracteristics for the main
12398 # and the incident pipes (radius, width, half-length). The fillet is
12399 # created on the junction of the pipes.
12400 # The extremities of the main pipe are located on junctions points P1 and P2.
12401 # The extremity of the incident pipe is located on junction point P3.
12402 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12403 # the main plane of the T-shape is XOY.
12404 # @param theR1 Internal radius of main pipe
12405 # @param theW1 Width of main pipe
12406 # @param theL1 Half-length of main pipe
12407 # @param theR2 Internal radius of incident pipe (R2 < R1)
12408 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12409 # @param theL2 Half-length of incident pipe
12410 # @param theRF Radius of curvature of fillet.
12411 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12412 # @param theP1 1st junction point of main pipe
12413 # @param theP2 2nd junction point of main pipe
12414 # @param theP3 Junction point of incident pipe
12416 # @param theRL Internal radius of left thickness reduction
12417 # @param theWL Width of left thickness reduction
12418 # @param theLtransL Length of left transition part
12419 # @param theLthinL Length of left thin part
12421 # @param theRR Internal radius of right thickness reduction
12422 # @param theWR Width of right thickness reduction
12423 # @param theLtransR Length of right transition part
12424 # @param theLthinR Length of right thin part
12426 # @param theRI Internal radius of incident thickness reduction
12427 # @param theWI Width of incident thickness reduction
12428 # @param theLtransI Length of incident transition part
12429 # @param theLthinI Length of incident thin part
12431 # @param theName Object name; when specified, this parameter is used
12432 # for result publication in the study. Otherwise, if automatic
12433 # publication is switched on, default value is used for result name.
12435 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12437 # @ref tui_creation_pipetshape "Example"
12438 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12439 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12440 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12441 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12442 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12445 Create a T-shape object with fillet and with specified caracteristics for the main
12446 and the incident pipes (radius, width, half-length). The fillet is
12447 created on the junction of the pipes.
12448 The extremities of the main pipe are located on junctions points P1 and P2.
12449 The extremity of the incident pipe is located on junction point P3.
12452 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12453 the main plane of the T-shape is XOY.
12454 theR1 Internal radius of main pipe
12455 theW1 Width of main pipe
12456 heL1 Half-length of main pipe
12457 theR2 Internal radius of incident pipe (R2 < R1)
12458 theW2 Width of incident pipe (R2+W2 < R1+W1)
12459 theL2 Half-length of incident pipe
12460 theRF Radius of curvature of fillet.
12461 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12462 theP1 1st junction point of main pipe
12463 theP2 2nd junction point of main pipe
12464 theP3 Junction point of incident pipe
12466 theRL Internal radius of left thickness reduction
12467 theWL Width of left thickness reduction
12468 theLtransL Length of left transition part
12469 theLthinL Length of left thin part
12471 theRR Internal radius of right thickness reduction
12472 theWR Width of right thickness reduction
12473 theLtransR Length of right transition part
12474 theLthinR Length of right thin part
12476 theRI Internal radius of incident thickness reduction
12477 theWI Width of incident thickness reduction
12478 theLtransI Length of incident transition part
12479 theLthinI Length of incident thin part
12481 theName Object name; when specified, this parameter is used
12482 for result publication in the study. Otherwise, if automatic
12483 publication is switched on, default value is used for result name.
12486 List of GEOM_Object, containing the created shape and propagation groups.
12489 # create PipeTShape with fillet object
12490 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12491 # create PipeTShape with fillet object with position
12492 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12493 # create PipeTShape with fillet object with left thickness reduction
12494 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)
12496 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)
12497 if (theP1 and theP2 and theP3):
12498 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12499 theRL, theWL, theLtransL, theLthinL,
12500 theRR, theWR, theLtransR, theLthinR,
12501 theRI, theWI, theLtransI, theLthinI,
12502 theRF, theHexMesh, theP1, theP2, theP3)
12504 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12505 theRL, theWL, theLtransL, theLthinL,
12506 theRR, theWR, theLtransR, theLthinR,
12507 theRI, theWI, theLtransI, theLthinI,
12509 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12510 if Parameters: anObj[0].SetParameters(Parameters)
12511 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12512 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12515 ## This function allows creating a disk already divided into blocks. It
12516 # can be used to create divided pipes for later meshing in hexaedra.
12517 # @param theR Radius of the disk
12518 # @param theOrientation Orientation of the plane on which the disk will be built
12519 # 1 = XOY, 2 = OYZ, 3 = OZX
12520 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12521 # @param theName Object name; when specified, this parameter is used
12522 # for result publication in the study. Otherwise, if automatic
12523 # publication is switched on, default value is used for result name.
12525 # @return New GEOM_Object, containing the created shape.
12527 # @ref tui_creation_divideddisk "Example"
12528 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12530 Creates a disk, divided into blocks. It can be used to create divided pipes
12531 for later meshing in hexaedra.
12534 theR Radius of the disk
12535 theOrientation Orientation of the plane on which the disk will be built:
12536 1 = XOY, 2 = OYZ, 3 = OZX
12537 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12538 theName Object name; when specified, this parameter is used
12539 for result publication in the study. Otherwise, if automatic
12540 publication is switched on, default value is used for result name.
12543 New GEOM_Object, containing the created shape.
12545 theR, Parameters = ParseParameters(theR)
12546 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12547 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12548 if Parameters: anObj.SetParameters(Parameters)
12549 self._autoPublish(anObj, theName, "dividedDisk")
12552 ## This function allows creating a disk already divided into blocks. It
12553 # can be used to create divided pipes for later meshing in hexaedra.
12554 # @param theCenter Center of the disk
12555 # @param theVector Normal vector to the plane of the created disk
12556 # @param theRadius Radius of the disk
12557 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12558 # @param theName Object name; when specified, this parameter is used
12559 # for result publication in the study. Otherwise, if automatic
12560 # publication is switched on, default value is used for result name.
12562 # @return New GEOM_Object, containing the created shape.
12564 # @ref tui_creation_divideddisk "Example"
12565 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12567 Creates a disk already divided into blocks. It can be used to create divided pipes
12568 for later meshing in hexaedra.
12571 theCenter Center of the disk
12572 theVector Normal vector to the plane of the created disk
12573 theRadius Radius of the disk
12574 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12575 theName Object name; when specified, this parameter is used
12576 for result publication in the study. Otherwise, if automatic
12577 publication is switched on, default value is used for result name.
12580 New GEOM_Object, containing the created shape.
12582 theRadius, Parameters = ParseParameters(theRadius)
12583 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12584 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12585 if Parameters: anObj.SetParameters(Parameters)
12586 self._autoPublish(anObj, theName, "dividedDisk")
12589 ## Builds a cylinder prepared for hexa meshes
12590 # @param theR Radius of the cylinder
12591 # @param theH Height of the cylinder
12592 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12593 # @param theName Object name; when specified, this parameter is used
12594 # for result publication in the study. Otherwise, if automatic
12595 # publication is switched on, default value is used for result name.
12597 # @return New GEOM_Object, containing the created shape.
12599 # @ref tui_creation_dividedcylinder "Example"
12600 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12602 Builds a cylinder prepared for hexa meshes
12605 theR Radius of the cylinder
12606 theH Height of the cylinder
12607 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12608 theName Object name; when specified, this parameter is used
12609 for result publication in the study. Otherwise, if automatic
12610 publication is switched on, default value is used for result name.
12613 New GEOM_Object, containing the created shape.
12615 theR, theH, Parameters = ParseParameters(theR, theH)
12616 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12617 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12618 if Parameters: anObj.SetParameters(Parameters)
12619 self._autoPublish(anObj, theName, "dividedCylinder")
12622 ## Create a surface from a cloud of points
12623 # @param thelPoints list of points
12624 # @return New GEOM_Object, containing the created shape.
12626 # @ref tui_creation_smoothingsurface "Example"
12627 def MakeSmoothingSurface(self, thelPoints):
12628 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12629 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12632 ## Export a shape to XAO format
12633 # @param shape The shape to export
12634 # @param groups The list of groups to export
12635 # @param fields The list of fields to export
12636 # @param author The author of the export
12637 # @param fileName The name of the file to export
12640 # @ref tui_exportxao "Example"
12641 def ExportXAO(self, shape, groups, fields, author, fileName):
12642 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12643 RaiseIfFailed("ExportXAO", self.InsertOp)
12646 ## Import a shape from XAO format
12647 # @param shape Shape to export
12648 # @param fileName The name of the file to import
12649 # @return tuple (res, shape, subShapes, groups, fields)
12650 # res Flag indicating if the import was successful
12651 # shape The imported shape
12652 # subShapes The list of imported subShapes
12653 # groups The list of imported groups
12654 # fields The list of imported fields
12656 # @ref tui_importxao "Example"
12657 def ImportXAO(self, fileName):
12658 res = self.InsertOp.ImportXAO(fileName)
12659 RaiseIfFailed("ImportXAO", self.InsertOp)
12662 #@@ insert new functions before this line @@ do not remove this line @@#
12664 # end of l4_advanced
12667 ## Create a copy of the given object
12669 # @param theOriginal geometry object for copy
12670 # @param theName Object name; when specified, this parameter is used
12671 # for result publication in the study. Otherwise, if automatic
12672 # publication is switched on, default value is used for result name.
12674 # @return New GEOM_Object, containing the copied shape.
12676 # @ingroup l1_geomBuilder_auxiliary
12677 # @ref swig_MakeCopy "Example"
12678 def MakeCopy(self, theOriginal, theName=None):
12680 Create a copy of the given object
12683 theOriginal geometry object for copy
12684 theName Object name; when specified, this parameter is used
12685 for result publication in the study. Otherwise, if automatic
12686 publication is switched on, default value is used for result name.
12689 New GEOM_Object, containing the copied shape.
12691 Example of usage: Copy = geompy.MakeCopy(Box)
12693 # Example: see GEOM_TestAll.py
12694 anObj = self.InsertOp.MakeCopy(theOriginal)
12695 RaiseIfFailed("MakeCopy", self.InsertOp)
12696 self._autoPublish(anObj, theName, "copy")
12699 ## Add Path to load python scripts from
12700 # @param Path a path to load python scripts from
12701 # @ingroup l1_geomBuilder_auxiliary
12702 def addPath(self,Path):
12704 Add Path to load python scripts from
12707 Path a path to load python scripts from
12709 if (sys.path.count(Path) < 1):
12710 sys.path.append(Path)
12714 ## Load marker texture from the file
12715 # @param Path a path to the texture file
12716 # @return unique texture identifier
12717 # @ingroup l1_geomBuilder_auxiliary
12718 def LoadTexture(self, Path):
12720 Load marker texture from the file
12723 Path a path to the texture file
12726 unique texture identifier
12728 # Example: see GEOM_TestAll.py
12729 ID = self.InsertOp.LoadTexture(Path)
12730 RaiseIfFailed("LoadTexture", self.InsertOp)
12733 ## Get internal name of the object based on its study entry
12734 # @note This method does not provide an unique identifier of the geometry object.
12735 # @note This is internal function of GEOM component, though it can be used outside it for
12736 # appropriate reason (e.g. for identification of geometry object).
12737 # @param obj geometry object
12738 # @return unique object identifier
12739 # @ingroup l1_geomBuilder_auxiliary
12740 def getObjectID(self, obj):
12742 Get internal name of the object based on its study entry.
12743 Note: this method does not provide an unique identifier of the geometry object.
12744 It is an internal function of GEOM component, though it can be used outside GEOM for
12745 appropriate reason (e.g. for identification of geometry object).
12748 obj geometry object
12751 unique object identifier
12754 entry = salome.ObjectToID(obj)
12755 if entry is not None:
12756 lst = entry.split(":")
12758 ID = lst[-1] # -1 means last item in the list
12759 return "GEOM_" + ID
12764 ## Add marker texture. @a Width and @a Height parameters
12765 # specify width and height of the texture in pixels.
12766 # If @a RowData is @c True, @a Texture parameter should represent texture data
12767 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12768 # parameter should be unpacked string, in which '1' symbols represent opaque
12769 # pixels and '0' represent transparent pixels of the texture bitmap.
12771 # @param Width texture width in pixels
12772 # @param Height texture height in pixels
12773 # @param Texture texture data
12774 # @param RowData if @c True, @a Texture data are packed in the byte stream
12775 # @return unique texture identifier
12776 # @ingroup l1_geomBuilder_auxiliary
12777 def AddTexture(self, Width, Height, Texture, RowData=False):
12779 Add marker texture. Width and Height parameters
12780 specify width and height of the texture in pixels.
12781 If RowData is True, Texture parameter should represent texture data
12782 packed into the byte array. If RowData is False (default), Texture
12783 parameter should be unpacked string, in which '1' symbols represent opaque
12784 pixels and '0' represent transparent pixels of the texture bitmap.
12787 Width texture width in pixels
12788 Height texture height in pixels
12789 Texture texture data
12790 RowData if True, Texture data are packed in the byte stream
12793 return unique texture identifier
12795 if not RowData: Texture = PackData(Texture)
12796 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12797 RaiseIfFailed("AddTexture", self.InsertOp)
12800 ## Creates a new folder object. It is a container for any GEOM objects.
12801 # @param Name name of the container
12802 # @param Father parent object. If None,
12803 # folder under 'Geometry' root object will be created.
12804 # @return a new created folder
12805 # @ingroup l1_publish_data
12806 def NewFolder(self, Name, Father=None):
12808 Create a new folder object. It is an auxiliary container for any GEOM objects.
12811 Name name of the container
12812 Father parent object. If None,
12813 folder under 'Geometry' root object will be created.
12816 a new created folder
12818 if not Father: Father = self.father
12819 return self.CreateFolder(Name, Father)
12821 ## Move object to the specified folder
12822 # @param Object object to move
12823 # @param Folder target folder
12824 # @ingroup l1_publish_data
12825 def PutToFolder(self, Object, Folder):
12827 Move object to the specified folder
12830 Object object to move
12831 Folder target folder
12833 self.MoveToFolder(Object, Folder)
12836 ## Move list of objects to the specified folder
12837 # @param ListOfSO list of objects to move
12838 # @param Folder target folder
12839 # @ingroup l1_publish_data
12840 def PutListToFolder(self, ListOfSO, Folder):
12842 Move list of objects to the specified folder
12845 ListOfSO list of objects to move
12846 Folder target folder
12848 self.MoveListToFolder(ListOfSO, Folder)
12851 ## @addtogroup l2_field
12855 # @param shape the shape the field lies on
12856 # @param name the field name
12857 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12858 # @param dimension dimension of the shape the field lies on
12859 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12860 # @param componentNames names of components
12861 # @return a created field
12862 def CreateField(self, shape, name, type, dimension, componentNames):
12867 shape the shape the field lies on
12868 name the field name
12869 type type of field data
12870 dimension dimension of the shape the field lies on
12871 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12872 componentNames names of components
12877 if isinstance( type, int ):
12878 if type < 0 or type > 3:
12879 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12880 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12882 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12883 RaiseIfFailed("CreateField", self.FieldOp)
12885 geom._autoPublish( f, "", name)
12888 ## Removes a field from the GEOM component
12889 # @param field the field to remove
12890 def RemoveField(self, field):
12891 "Removes a field from the GEOM component"
12893 if isinstance( field, GEOM._objref_GEOM_Field ):
12894 geom.RemoveObject( field )
12895 elif isinstance( field, geomField ):
12896 geom.RemoveObject( field.field )
12898 raise RuntimeError, "RemoveField() : the object is not a field"
12901 ## Returns number of fields on a shape
12902 def CountFields(self, shape):
12903 "Returns number of fields on a shape"
12904 nb = self.FieldOp.CountFields( shape )
12905 RaiseIfFailed("CountFields", self.FieldOp)
12908 ## Returns all fields on a shape
12909 def GetFields(self, shape):
12910 "Returns all fields on a shape"
12911 ff = self.FieldOp.GetFields( shape )
12912 RaiseIfFailed("GetFields", self.FieldOp)
12915 ## Returns a field on a shape by its name
12916 def GetField(self, shape, name):
12917 "Returns a field on a shape by its name"
12918 f = self.FieldOp.GetField( shape, name )
12919 RaiseIfFailed("GetField", self.FieldOp)
12927 # Register the new proxy for GEOM_Gen
12928 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12931 ## Field on Geometry
12932 # @ingroup l2_field
12933 class geomField( GEOM._objref_GEOM_Field ):
12935 def __init__(self):
12936 GEOM._objref_GEOM_Field.__init__(self)
12937 self.field = GEOM._objref_GEOM_Field
12940 ## Returns the shape the field lies on
12941 def getShape(self):
12942 "Returns the shape the field lies on"
12943 return self.field.GetShape(self)
12945 ## Returns the field name
12947 "Returns the field name"
12948 return self.field.GetName(self)
12950 ## Returns type of field data as integer [0-3]
12952 "Returns type of field data"
12953 return self.field.GetDataType(self)._v
12955 ## Returns type of field data:
12956 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12957 def getTypeEnum(self):
12958 "Returns type of field data"
12959 return self.field.GetDataType(self)
12961 ## Returns dimension of the shape the field lies on:
12962 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12963 def getDimension(self):
12964 """Returns dimension of the shape the field lies on:
12965 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12966 return self.field.GetDimension(self)
12968 ## Returns names of components
12969 def getComponents(self):
12970 "Returns names of components"
12971 return self.field.GetComponents(self)
12973 ## Adds a time step to the field
12974 # @param step the time step number futher used as the step identifier
12975 # @param stamp the time step time
12976 # @param values the values of the time step
12977 def addStep(self, step, stamp, values):
12978 "Adds a time step to the field"
12979 stp = self.field.AddStep( self, step, stamp )
12981 raise RuntimeError, \
12982 "Field.addStep() : Error: step %s already exists in this field"%step
12984 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12985 self.setValues( step, values )
12988 ## Remove a time step from the field
12989 def removeStep(self,step):
12990 "Remove a time step from the field"
12993 stepObj = self.field.GetStep( self, step )
12995 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12998 #traceback.print_exc()
13000 self.field.RemoveStep( self, step )
13002 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13005 ## Returns number of time steps in the field
13006 def countSteps(self):
13007 "Returns number of time steps in the field"
13008 return self.field.CountSteps(self)
13010 ## Returns a list of time step IDs in the field
13011 def getSteps(self):
13012 "Returns a list of time step IDs in the field"
13013 return self.field.GetSteps(self)
13015 ## Returns a time step by its ID
13016 def getStep(self,step):
13017 "Returns a time step by its ID"
13018 stp = self.field.GetStep(self, step)
13020 raise RuntimeError, "Step %s is missing from this field"%step
13023 ## Returns the time of the field step
13024 def getStamp(self,step):
13025 "Returns the time of the field step"
13026 return self.getStep(step).GetStamp()
13028 ## Changes the time of the field step
13029 def setStamp(self, step, stamp):
13030 "Changes the time of the field step"
13031 return self.getStep(step).SetStamp(stamp)
13033 ## Returns values of the field step
13034 def getValues(self, step):
13035 "Returns values of the field step"
13036 return self.getStep(step).GetValues()
13038 ## Changes values of the field step
13039 def setValues(self, step, values):
13040 "Changes values of the field step"
13041 stp = self.getStep(step)
13042 errBeg = "Field.setValues(values) : Error: "
13044 ok = stp.SetValues( values )
13045 except Exception, e:
13047 if excStr.find("WrongPythonType") > 0:
13048 raise RuntimeError, errBeg +\
13049 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13050 raise RuntimeError, errBeg + str(e)
13052 nbOK = self.field.GetArraySize(self)
13055 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13057 raise RuntimeError, errBeg + "failed"
13060 pass # end of class geomField
13062 # Register the new proxy for GEOM_Field
13063 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13066 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13067 # interface to GEOM operations.
13072 # salome.salome_init()
13073 # from salome.geom import geomBuilder
13074 # geompy = geomBuilder.New(salome.myStudy)
13076 # @param study SALOME study, generally obtained by salome.myStudy.
13077 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13078 # @return geomBuilder instance
13079 def New( study, instance=None):
13081 Create a new geomBuilder instance.The geomBuilder class provides the Python
13082 interface to GEOM operations.
13086 salome.salome_init()
13087 from salome.geom import geomBuilder
13088 geompy = geomBuilder.New(salome.myStudy)
13091 study SALOME study, generally obtained by salome.myStudy.
13092 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13094 geomBuilder instance
13096 #print "New geomBuilder ", study, instance
13103 geom = geomBuilder()
13104 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13105 geom.init_geom(study)