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.
10306 # If material names are imported it returns the list of
10307 # objects. The first one is the imported object followed by
10309 # @note Auto publishing is allowed for the shape itself. Imported
10310 # material groups are not automatically published.
10312 # @ref swig_Import_Export "Example"
10313 def ImportFile(self, theFileName, theFormatName, theName=None):
10315 Import a shape from the BREP or IGES or STEP file
10316 (depends on given format) with given name.
10319 theFileName The file, containing the shape.
10320 theFormatName Specify format for the file reading.
10321 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10322 If format 'IGES_SCALE' is used instead of 'IGES' or
10323 format 'STEP_SCALE' is used instead of 'STEP',
10324 length unit will be set to 'meter' and result model will be scaled.
10325 theName Object name; when specified, this parameter is used
10326 for result publication in the study. Otherwise, if automatic
10327 publication is switched on, default value is used for result name.
10330 New GEOM.GEOM_Object, containing the imported shape.
10331 If material names are imported it returns the list of
10332 objects. The first one is the imported object followed by
10335 Auto publishing is allowed for the shape itself. Imported
10336 material groups are not automatically published.
10338 # Example: see GEOM_TestOthers.py
10339 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10340 RaiseIfFailed("ImportFile", self.InsertOp)
10341 aNbObj = len(aListObj)
10343 self._autoPublish(aListObj[0], theName, "imported")
10348 ## Deprecated analog of ImportFile()
10349 def Import(self, theFileName, theFormatName, theName=None):
10351 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10353 print "WARNING: Function Import is deprecated, use ImportFile instead"
10354 # note: auto-publishing is done in self.ImportFile()
10355 return self.ImportFile(theFileName, theFormatName, theName)
10357 ## Shortcut to ImportFile() for BREP format.
10358 # Import a shape from the BREP file with given name.
10359 # @param theFileName The file, containing the shape.
10360 # @param theName Object name; when specified, this parameter is used
10361 # for result publication in the study. Otherwise, if automatic
10362 # publication is switched on, default value is used for result name.
10364 # @return New GEOM.GEOM_Object, containing the imported shape.
10366 # @ref swig_Import_Export "Example"
10367 def ImportBREP(self, theFileName, theName=None):
10369 geompy.ImportFile(...) function for BREP format
10370 Import a shape from the BREP file with given name.
10373 theFileName The file, containing the shape.
10374 theName Object name; when specified, this parameter is used
10375 for result publication in the study. Otherwise, if automatic
10376 publication is switched on, default value is used for result name.
10379 New GEOM.GEOM_Object, containing the imported shape.
10381 # Example: see GEOM_TestOthers.py
10382 # note: auto-publishing is done in self.ImportFile()
10383 return self.ImportFile(theFileName, "BREP", theName)
10385 ## Shortcut to ImportFile() for IGES format
10386 # Import a shape from the IGES file with given name.
10387 # @param theFileName The file, containing the shape.
10388 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10389 # and result model will be scaled, if its units are not meters.
10390 # If False (default), file length units will be taken into account.
10391 # @param theName Object name; when specified, this parameter is used
10392 # for result publication in the study. Otherwise, if automatic
10393 # publication is switched on, default value is used for result name.
10395 # @return New GEOM.GEOM_Object, containing the imported shape.
10397 # @ref swig_Import_Export "Example"
10398 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10400 geompy.ImportFile(...) function for IGES format
10403 theFileName The file, containing the shape.
10404 ignoreUnits If True, file length units will be ignored (set to 'meter')
10405 and result model will be scaled, if its units are not meters.
10406 If False (default), file length units will be taken into account.
10407 theName Object name; when specified, this parameter is used
10408 for result publication in the study. Otherwise, if automatic
10409 publication is switched on, default value is used for result name.
10412 New GEOM.GEOM_Object, containing the imported shape.
10414 # Example: see GEOM_TestOthers.py
10415 # note: auto-publishing is done in self.ImportFile()
10417 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10418 return self.ImportFile(theFileName, "IGES", theName)
10420 ## Return length unit from given IGES file
10421 # @param theFileName The file, containing the shape.
10422 # @return String, containing the units name.
10424 # @ref swig_Import_Export "Example"
10425 def GetIGESUnit(self, theFileName):
10427 Return length units from given IGES file
10430 theFileName The file, containing the shape.
10433 String, containing the units name.
10435 # Example: see GEOM_TestOthers.py
10436 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10439 ## Shortcut to ImportFile() for STEP format
10440 # Import a shape from the STEP file with given name.
10441 # @param theFileName The file, containing the shape.
10442 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10443 # and result model will be scaled, if its units are not meters.
10444 # If False (default), file length units will be taken into account.
10445 # @param theName Object name; when specified, this parameter is used
10446 # for result publication in the study. Otherwise, if automatic
10447 # publication is switched on, default value is used for result name.
10449 # @return New GEOM.GEOM_Object, containing the imported shape.
10450 # If material names are imported it returns the list of
10451 # objects. The first one is the imported object followed by
10453 # @note Auto publishing is allowed for the shape itself. Imported
10454 # material groups are not automatically published.
10456 # @ref swig_Import_Export "Example"
10457 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10459 geompy.ImportFile(...) function for STEP format
10462 theFileName The file, containing the shape.
10463 ignoreUnits If True, file length units will be ignored (set to 'meter')
10464 and result model will be scaled, if its units are not meters.
10465 If False (default), file length units will be taken into account.
10466 theName Object name; when specified, this parameter is used
10467 for result publication in the study. Otherwise, if automatic
10468 publication is switched on, default value is used for result name.
10471 New GEOM.GEOM_Object, containing the imported shape.
10472 If material names are imported it returns the list of
10473 objects. The first one is the imported object followed by
10476 Auto publishing is allowed for the shape itself. Imported
10477 material groups are not automatically published.
10479 # Example: see GEOM_TestOthers.py
10480 # note: auto-publishing is done in self.ImportFile()
10482 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10483 return self.ImportFile(theFileName, "STEP", theName)
10485 ## Return length unit from given IGES or STEP file
10486 # @param theFileName The file, containing the shape.
10487 # @return String, containing the units name.
10489 # @ref swig_Import_Export "Example"
10490 def GetSTEPUnit(self, theFileName):
10492 Return length units from given STEP file
10495 theFileName The file, containing the shape.
10498 String, containing the units name.
10500 # Example: see GEOM_TestOthers.py
10501 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10504 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10505 # @note This method will not be dumped to the python script by DumpStudy functionality.
10506 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10507 # @param theStream The BRep binary stream.
10508 # @param theName Object name; when specified, this parameter is used
10509 # for result publication in the study. Otherwise, if automatic
10510 # publication is switched on, default value is used for result name.
10512 # @return New GEOM_Object, containing the shape, read from theStream.
10514 # @ref swig_Import_Export "Example"
10515 def RestoreShape (self, theStream, theName=None):
10517 Read a shape from the binary stream, containing its bounding representation (BRep).
10520 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10523 theStream The BRep binary stream.
10524 theName Object name; when specified, this parameter is used
10525 for result publication in the study. Otherwise, if automatic
10526 publication is switched on, default value is used for result name.
10529 New GEOM_Object, containing the shape, read from theStream.
10531 # Example: see GEOM_TestOthers.py
10532 anObj = self.InsertOp.RestoreShape(theStream)
10533 RaiseIfFailed("RestoreShape", self.InsertOp)
10534 self._autoPublish(anObj, theName, "restored")
10537 ## Export the given shape into a file with given name.
10538 # @param theObject Shape to be stored in the file.
10539 # @param theFileName Name of the file to store the given shape in.
10540 # @param theFormatName Specify format for the shape storage.
10541 # Available formats can be obtained with
10542 # geompy.InsertOp.ExportTranslators()[0] method.
10544 # @ref swig_Import_Export "Example"
10545 def Export(self, theObject, theFileName, theFormatName):
10547 Export the given shape into a file with given name.
10550 theObject Shape to be stored in the file.
10551 theFileName Name of the file to store the given shape in.
10552 theFormatName Specify format for the shape storage.
10553 Available formats can be obtained with
10554 geompy.InsertOp.ExportTranslators()[0] method.
10556 # Example: see GEOM_TestOthers.py
10557 self.InsertOp.Export(theObject, theFileName, theFormatName)
10558 if self.InsertOp.IsDone() == 0:
10559 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10563 ## Shortcut to Export() for BREP format
10565 # @ref swig_Import_Export "Example"
10566 def ExportBREP(self,theObject, theFileName):
10568 geompy.Export(...) function for BREP format
10570 # Example: see GEOM_TestOthers.py
10571 return self.Export(theObject, theFileName, "BREP")
10573 ## Shortcut to Export() for IGES format
10575 # @ref swig_Import_Export "Example"
10576 def ExportIGES(self,theObject, theFileName):
10578 geompy.Export(...) function for IGES format
10580 # Example: see GEOM_TestOthers.py
10581 return self.Export(theObject, theFileName, "IGES")
10583 ## Shortcut to Export() for STEP format
10585 # @ref swig_Import_Export "Example"
10586 def ExportSTEP(self,theObject, theFileName):
10588 geompy.Export(...) function for STEP format
10590 # Example: see GEOM_TestOthers.py
10591 return self.Export(theObject, theFileName, "STEP")
10593 # end of l2_import_export
10596 ## @addtogroup l3_blocks
10599 ## Create a quadrangle face from four edges. Order of Edges is not
10600 # important. It is not necessary that edges share the same vertex.
10601 # @param E1,E2,E3,E4 Edges for the face bound.
10602 # @param theName Object name; when specified, this parameter is used
10603 # for result publication in the study. Otherwise, if automatic
10604 # publication is switched on, default value is used for result name.
10606 # @return New GEOM.GEOM_Object, containing the created face.
10608 # @ref tui_building_by_blocks_page "Example"
10609 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10611 Create a quadrangle face from four edges. Order of Edges is not
10612 important. It is not necessary that edges share the same vertex.
10615 E1,E2,E3,E4 Edges for the face bound.
10616 theName Object name; when specified, this parameter is used
10617 for result publication in the study. Otherwise, if automatic
10618 publication is switched on, default value is used for result name.
10621 New GEOM.GEOM_Object, containing the created face.
10624 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10626 # Example: see GEOM_Spanner.py
10627 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10628 RaiseIfFailed("MakeQuad", self.BlocksOp)
10629 self._autoPublish(anObj, theName, "quad")
10632 ## Create a quadrangle face on two edges.
10633 # The missing edges will be built by creating the shortest ones.
10634 # @param E1,E2 Two opposite edges for the face.
10635 # @param theName Object name; when specified, this parameter is used
10636 # for result publication in the study. Otherwise, if automatic
10637 # publication is switched on, default value is used for result name.
10639 # @return New GEOM.GEOM_Object, containing the created face.
10641 # @ref tui_building_by_blocks_page "Example"
10642 def MakeQuad2Edges(self, E1, E2, theName=None):
10644 Create a quadrangle face on two edges.
10645 The missing edges will be built by creating the shortest ones.
10648 E1,E2 Two opposite edges for the face.
10649 theName Object name; when specified, this parameter is used
10650 for result publication in the study. Otherwise, if automatic
10651 publication is switched on, default value is used for result name.
10654 New GEOM.GEOM_Object, containing the created face.
10658 p1 = geompy.MakeVertex( 0., 0., 0.)
10659 p2 = geompy.MakeVertex(150., 30., 0.)
10660 p3 = geompy.MakeVertex( 0., 120., 50.)
10661 p4 = geompy.MakeVertex( 0., 40., 70.)
10663 edge1 = geompy.MakeEdge(p1, p2)
10664 edge2 = geompy.MakeEdge(p3, p4)
10665 # create a quadrangle face from two edges
10666 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10668 # Example: see GEOM_Spanner.py
10669 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10670 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10671 self._autoPublish(anObj, theName, "quad")
10674 ## Create a quadrangle face with specified corners.
10675 # The missing edges will be built by creating the shortest ones.
10676 # @param V1,V2,V3,V4 Corner vertices for the face.
10677 # @param theName Object name; when specified, this parameter is used
10678 # for result publication in the study. Otherwise, if automatic
10679 # publication is switched on, default value is used for result name.
10681 # @return New GEOM.GEOM_Object, containing the created face.
10683 # @ref tui_building_by_blocks_page "Example 1"
10684 # \n @ref swig_MakeQuad4Vertices "Example 2"
10685 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10687 Create a quadrangle face with specified corners.
10688 The missing edges will be built by creating the shortest ones.
10691 V1,V2,V3,V4 Corner vertices for the face.
10692 theName Object name; when specified, this parameter is used
10693 for result publication in the study. Otherwise, if automatic
10694 publication is switched on, default value is used for result name.
10697 New GEOM.GEOM_Object, containing the created face.
10701 p1 = geompy.MakeVertex( 0., 0., 0.)
10702 p2 = geompy.MakeVertex(150., 30., 0.)
10703 p3 = geompy.MakeVertex( 0., 120., 50.)
10704 p4 = geompy.MakeVertex( 0., 40., 70.)
10705 # create a quadrangle from four points in its corners
10706 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10708 # Example: see GEOM_Spanner.py
10709 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10710 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10711 self._autoPublish(anObj, theName, "quad")
10714 ## Create a hexahedral solid, bounded by the six given faces. Order of
10715 # faces is not important. It is not necessary that Faces share the same edge.
10716 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10717 # @param theName Object name; when specified, this parameter is used
10718 # for result publication in the study. Otherwise, if automatic
10719 # publication is switched on, default value is used for result name.
10721 # @return New GEOM.GEOM_Object, containing the created solid.
10723 # @ref tui_building_by_blocks_page "Example 1"
10724 # \n @ref swig_MakeHexa "Example 2"
10725 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10727 Create a hexahedral solid, bounded by the six given faces. Order of
10728 faces is not important. It is not necessary that Faces share the same edge.
10731 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10732 theName Object name; when specified, this parameter is used
10733 for result publication in the study. Otherwise, if automatic
10734 publication is switched on, default value is used for result name.
10737 New GEOM.GEOM_Object, containing the created solid.
10740 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10742 # Example: see GEOM_Spanner.py
10743 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10744 RaiseIfFailed("MakeHexa", self.BlocksOp)
10745 self._autoPublish(anObj, theName, "hexa")
10748 ## Create a hexahedral solid between two given faces.
10749 # The missing faces will be built by creating the smallest ones.
10750 # @param F1,F2 Two opposite faces for the hexahedral solid.
10751 # @param theName Object name; when specified, this parameter is used
10752 # for result publication in the study. Otherwise, if automatic
10753 # publication is switched on, default value is used for result name.
10755 # @return New GEOM.GEOM_Object, containing the created solid.
10757 # @ref tui_building_by_blocks_page "Example 1"
10758 # \n @ref swig_MakeHexa2Faces "Example 2"
10759 def MakeHexa2Faces(self, F1, F2, theName=None):
10761 Create a hexahedral solid between two given faces.
10762 The missing faces will be built by creating the smallest ones.
10765 F1,F2 Two opposite faces for the hexahedral solid.
10766 theName Object name; when specified, this parameter is used
10767 for result publication in the study. Otherwise, if automatic
10768 publication is switched on, default value is used for result name.
10771 New GEOM.GEOM_Object, containing the created solid.
10774 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10776 # Example: see GEOM_Spanner.py
10777 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10778 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10779 self._autoPublish(anObj, theName, "hexa")
10785 ## @addtogroup l3_blocks_op
10788 ## Get a vertex, found in the given shape by its coordinates.
10789 # @param theShape Block or a compound of blocks.
10790 # @param theX,theY,theZ Coordinates of the sought vertex.
10791 # @param theEpsilon Maximum allowed distance between the resulting
10792 # vertex and point with the given coordinates.
10793 # @param theName Object name; when specified, this parameter is used
10794 # for result publication in the study. Otherwise, if automatic
10795 # publication is switched on, default value is used for result name.
10797 # @return New GEOM.GEOM_Object, containing the found vertex.
10799 # @ref swig_GetPoint "Example"
10800 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10802 Get a vertex, found in the given shape by its coordinates.
10805 theShape Block or a compound of blocks.
10806 theX,theY,theZ Coordinates of the sought vertex.
10807 theEpsilon Maximum allowed distance between the resulting
10808 vertex and point with the given coordinates.
10809 theName Object name; when specified, this parameter is used
10810 for result publication in the study. Otherwise, if automatic
10811 publication is switched on, default value is used for result name.
10814 New GEOM.GEOM_Object, containing the found vertex.
10817 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10819 # Example: see GEOM_TestOthers.py
10820 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10821 RaiseIfFailed("GetPoint", self.BlocksOp)
10822 self._autoPublish(anObj, theName, "vertex")
10825 ## Find a vertex of the given shape, which has minimal distance to the given point.
10826 # @param theShape Any shape.
10827 # @param thePoint Point, close to the desired vertex.
10828 # @param theName Object name; when specified, this parameter is used
10829 # for result publication in the study. Otherwise, if automatic
10830 # publication is switched on, default value is used for result name.
10832 # @return New GEOM.GEOM_Object, containing the found vertex.
10834 # @ref swig_GetVertexNearPoint "Example"
10835 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10837 Find a vertex of the given shape, which has minimal distance to the given point.
10840 theShape Any shape.
10841 thePoint Point, close to the desired vertex.
10842 theName Object name; when specified, this parameter is used
10843 for result publication in the study. Otherwise, if automatic
10844 publication is switched on, default value is used for result name.
10847 New GEOM.GEOM_Object, containing the found vertex.
10850 pmidle = geompy.MakeVertex(50, 0, 50)
10851 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10853 # Example: see GEOM_TestOthers.py
10854 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10855 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10856 self._autoPublish(anObj, theName, "vertex")
10859 ## Get an edge, found in the given shape by two given vertices.
10860 # @param theShape Block or a compound of blocks.
10861 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10862 # @param theName Object name; when specified, this parameter is used
10863 # for result publication in the study. Otherwise, if automatic
10864 # publication is switched on, default value is used for result name.
10866 # @return New GEOM.GEOM_Object, containing the found edge.
10868 # @ref swig_GetEdge "Example"
10869 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10871 Get an edge, found in the given shape by two given vertices.
10874 theShape Block or a compound of blocks.
10875 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10876 theName Object name; when specified, this parameter is used
10877 for result publication in the study. Otherwise, if automatic
10878 publication is switched on, default value is used for result name.
10881 New GEOM.GEOM_Object, containing the found edge.
10883 # Example: see GEOM_Spanner.py
10884 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10885 RaiseIfFailed("GetEdge", self.BlocksOp)
10886 self._autoPublish(anObj, theName, "edge")
10889 ## Find an edge of the given shape, which has minimal distance to the given point.
10890 # @param theShape Block or a compound of blocks.
10891 # @param thePoint Point, close to the desired edge.
10892 # @param theName Object name; when specified, this parameter is used
10893 # for result publication in the study. Otherwise, if automatic
10894 # publication is switched on, default value is used for result name.
10896 # @return New GEOM.GEOM_Object, containing the found edge.
10898 # @ref swig_GetEdgeNearPoint "Example"
10899 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10901 Find an edge of the given shape, which has minimal distance to the given point.
10904 theShape Block or a compound of blocks.
10905 thePoint Point, close to the desired edge.
10906 theName Object name; when specified, this parameter is used
10907 for result publication in the study. Otherwise, if automatic
10908 publication is switched on, default value is used for result name.
10911 New GEOM.GEOM_Object, containing the found edge.
10913 # Example: see GEOM_TestOthers.py
10914 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10915 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10916 self._autoPublish(anObj, theName, "edge")
10919 ## Returns a face, found in the given shape by four given corner vertices.
10920 # @param theShape Block or a compound of blocks.
10921 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10922 # @param theName Object name; when specified, this parameter is used
10923 # for result publication in the study. Otherwise, if automatic
10924 # publication is switched on, default value is used for result name.
10926 # @return New GEOM.GEOM_Object, containing the found face.
10928 # @ref swig_todo "Example"
10929 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10931 Returns a face, found in the given shape by four given corner vertices.
10934 theShape Block or a compound of blocks.
10935 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10936 theName Object name; when specified, this parameter is used
10937 for result publication in the study. Otherwise, if automatic
10938 publication is switched on, default value is used for result name.
10941 New GEOM.GEOM_Object, containing the found face.
10943 # Example: see GEOM_Spanner.py
10944 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10945 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10946 self._autoPublish(anObj, theName, "face")
10949 ## Get a face of block, found in the given shape by two given edges.
10950 # @param theShape Block or a compound of blocks.
10951 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10952 # @param theName Object name; when specified, this parameter is used
10953 # for result publication in the study. Otherwise, if automatic
10954 # publication is switched on, default value is used for result name.
10956 # @return New GEOM.GEOM_Object, containing the found face.
10958 # @ref swig_todo "Example"
10959 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10961 Get a face of block, found in the given shape by two given edges.
10964 theShape Block or a compound of blocks.
10965 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10966 theName Object name; when specified, this parameter is used
10967 for result publication in the study. Otherwise, if automatic
10968 publication is switched on, default value is used for result name.
10971 New GEOM.GEOM_Object, containing the found face.
10973 # Example: see GEOM_Spanner.py
10974 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10975 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10976 self._autoPublish(anObj, theName, "face")
10979 ## Find a face, opposite to the given one in the given block.
10980 # @param theBlock Must be a hexahedral solid.
10981 # @param theFace Face of \a theBlock, opposite to the desired face.
10982 # @param theName Object name; when specified, this parameter is used
10983 # for result publication in the study. Otherwise, if automatic
10984 # publication is switched on, default value is used for result name.
10986 # @return New GEOM.GEOM_Object, containing the found face.
10988 # @ref swig_GetOppositeFace "Example"
10989 def GetOppositeFace(self, theBlock, theFace, theName=None):
10991 Find a face, opposite to the given one in the given block.
10994 theBlock Must be a hexahedral solid.
10995 theFace Face of theBlock, opposite to the desired face.
10996 theName Object name; when specified, this parameter is used
10997 for result publication in the study. Otherwise, if automatic
10998 publication is switched on, default value is used for result name.
11001 New GEOM.GEOM_Object, containing the found face.
11003 # Example: see GEOM_Spanner.py
11004 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11005 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11006 self._autoPublish(anObj, theName, "face")
11009 ## Find a face of the given shape, which has minimal distance to the given point.
11010 # @param theShape Block or a compound of blocks.
11011 # @param thePoint Point, close to the desired face.
11012 # @param theName Object name; when specified, this parameter is used
11013 # for result publication in the study. Otherwise, if automatic
11014 # publication is switched on, default value is used for result name.
11016 # @return New GEOM.GEOM_Object, containing the found face.
11018 # @ref swig_GetFaceNearPoint "Example"
11019 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11021 Find a face of the given shape, which has minimal distance to the given point.
11024 theShape Block or a compound of blocks.
11025 thePoint Point, close to the desired face.
11026 theName Object name; when specified, this parameter is used
11027 for result publication in the study. Otherwise, if automatic
11028 publication is switched on, default value is used for result name.
11031 New GEOM.GEOM_Object, containing the found face.
11033 # Example: see GEOM_Spanner.py
11034 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11035 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11036 self._autoPublish(anObj, theName, "face")
11039 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11040 # @param theBlock Block or a compound of blocks.
11041 # @param theVector Vector, close to the normale of the desired face.
11042 # @param theName Object name; when specified, this parameter is used
11043 # for result publication in the study. Otherwise, if automatic
11044 # publication is switched on, default value is used for result name.
11046 # @return New GEOM.GEOM_Object, containing the found face.
11048 # @ref swig_todo "Example"
11049 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11051 Find a face of block, whose outside normale has minimal angle with the given vector.
11054 theBlock Block or a compound of blocks.
11055 theVector Vector, close to the normale of the desired face.
11056 theName Object name; when specified, this parameter is used
11057 for result publication in the study. Otherwise, if automatic
11058 publication is switched on, default value is used for result name.
11061 New GEOM.GEOM_Object, containing the found face.
11063 # Example: see GEOM_Spanner.py
11064 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11065 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11066 self._autoPublish(anObj, theName, "face")
11069 ## Find all sub-shapes of type \a theShapeType of the given shape,
11070 # which have minimal distance to the given point.
11071 # @param theShape Any shape.
11072 # @param thePoint Point, close to the desired shape.
11073 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11074 # @param theTolerance The tolerance for distances comparison. All shapes
11075 # with distances to the given point in interval
11076 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11077 # @param theName Object name; when specified, this parameter is used
11078 # for result publication in the study. Otherwise, if automatic
11079 # publication is switched on, default value is used for result name.
11081 # @return New GEOM_Object, containing a group of all found shapes.
11083 # @ref swig_GetShapesNearPoint "Example"
11084 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11086 Find all sub-shapes of type theShapeType of the given shape,
11087 which have minimal distance to the given point.
11090 theShape Any shape.
11091 thePoint Point, close to the desired shape.
11092 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11093 theTolerance The tolerance for distances comparison. All shapes
11094 with distances to the given point in interval
11095 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11096 theName Object name; when specified, this parameter is used
11097 for result publication in the study. Otherwise, if automatic
11098 publication is switched on, default value is used for result name.
11101 New GEOM_Object, containing a group of all found shapes.
11103 # Example: see GEOM_TestOthers.py
11104 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11105 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11106 self._autoPublish(anObj, theName, "group")
11109 # end of l3_blocks_op
11112 ## @addtogroup l4_blocks_measure
11115 ## Check, if the compound of blocks is given.
11116 # To be considered as a compound of blocks, the
11117 # given shape must satisfy the following conditions:
11118 # - Each element of the compound should be a Block (6 faces and 12 edges).
11119 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11120 # - The compound should be connexe.
11121 # - The glue between two quadrangle faces should be applied.
11122 # @param theCompound The compound to check.
11123 # @return TRUE, if the given shape is a compound of blocks.
11124 # If theCompound is not valid, prints all discovered errors.
11126 # @ref tui_measurement_tools_page "Example 1"
11127 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11128 def CheckCompoundOfBlocks(self,theCompound):
11130 Check, if the compound of blocks is given.
11131 To be considered as a compound of blocks, the
11132 given shape must satisfy the following conditions:
11133 - Each element of the compound should be a Block (6 faces and 12 edges).
11134 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11135 - The compound should be connexe.
11136 - The glue between two quadrangle faces should be applied.
11139 theCompound The compound to check.
11142 TRUE, if the given shape is a compound of blocks.
11143 If theCompound is not valid, prints all discovered errors.
11145 # Example: see GEOM_Spanner.py
11146 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11147 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11149 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11153 ## Retrieve all non blocks solids and faces from \a theShape.
11154 # @param theShape The shape to explore.
11155 # @param theName Object name; when specified, this parameter is used
11156 # for result publication in the study. Otherwise, if automatic
11157 # publication is switched on, default value is used for result name.
11159 # @return A tuple of two GEOM_Objects. The first object is a group of all
11160 # non block solids (= not 6 faces, or with 6 faces, but with the
11161 # presence of non-quadrangular faces). The second object is a
11162 # group of all non quadrangular faces.
11164 # @ref tui_measurement_tools_page "Example 1"
11165 # \n @ref swig_GetNonBlocks "Example 2"
11166 def GetNonBlocks (self, theShape, theName=None):
11168 Retrieve all non blocks solids and faces from theShape.
11171 theShape The shape to explore.
11172 theName Object name; when specified, this parameter is used
11173 for result publication in the study. Otherwise, if automatic
11174 publication is switched on, default value is used for result name.
11177 A tuple of two GEOM_Objects. The first object is a group of all
11178 non block solids (= not 6 faces, or with 6 faces, but with the
11179 presence of non-quadrangular faces). The second object is a
11180 group of all non quadrangular faces.
11183 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11185 # Example: see GEOM_Spanner.py
11186 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11187 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11188 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11191 ## Remove all seam and degenerated edges from \a theShape.
11192 # Unite faces and edges, sharing one surface. It means that
11193 # this faces must have references to one C++ surface object (handle).
11194 # @param theShape The compound or single solid to remove irregular edges from.
11195 # @param doUnionFaces If True, then unite faces. If False (the default value),
11196 # do not unite faces.
11197 # @param theName Object name; when specified, this parameter is used
11198 # for result publication in the study. Otherwise, if automatic
11199 # publication is switched on, default value is used for result name.
11201 # @return Improved shape.
11203 # @ref swig_RemoveExtraEdges "Example"
11204 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11206 Remove all seam and degenerated edges from theShape.
11207 Unite faces and edges, sharing one surface. It means that
11208 this faces must have references to one C++ surface object (handle).
11211 theShape The compound or single solid to remove irregular edges from.
11212 doUnionFaces If True, then unite faces. If False (the default value),
11213 do not unite faces.
11214 theName Object name; when specified, this parameter is used
11215 for result publication in the study. Otherwise, if automatic
11216 publication is switched on, default value is used for result name.
11221 # Example: see GEOM_TestOthers.py
11222 nbFacesOptimum = -1 # -1 means do not unite faces
11223 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11224 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11225 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11226 self._autoPublish(anObj, theName, "removeExtraEdges")
11229 ## Performs union faces of \a theShape
11230 # Unite faces sharing one surface. It means that
11231 # these faces must have references to one C++ surface object (handle).
11232 # @param theShape The compound or single solid that contains faces
11233 # to perform union.
11234 # @param theName Object name; when specified, this parameter is used
11235 # for result publication in the study. Otherwise, if automatic
11236 # publication is switched on, default value is used for result name.
11238 # @return Improved shape.
11240 # @ref swig_UnionFaces "Example"
11241 def UnionFaces(self, theShape, theName=None):
11243 Performs union faces of theShape.
11244 Unite faces sharing one surface. It means that
11245 these faces must have references to one C++ surface object (handle).
11248 theShape The compound or single solid that contains faces
11250 theName Object name; when specified, this parameter is used
11251 for result publication in the study. Otherwise, if automatic
11252 publication is switched on, default value is used for result name.
11257 # Example: see GEOM_TestOthers.py
11258 anObj = self.BlocksOp.UnionFaces(theShape)
11259 RaiseIfFailed("UnionFaces", self.BlocksOp)
11260 self._autoPublish(anObj, theName, "unionFaces")
11263 ## Check, if the given shape is a blocks compound.
11264 # Fix all detected errors.
11265 # \note Single block can be also fixed by this method.
11266 # @param theShape The compound to check and improve.
11267 # @param theName Object name; when specified, this parameter is used
11268 # for result publication in the study. Otherwise, if automatic
11269 # publication is switched on, default value is used for result name.
11271 # @return Improved compound.
11273 # @ref swig_CheckAndImprove "Example"
11274 def CheckAndImprove(self, theShape, theName=None):
11276 Check, if the given shape is a blocks compound.
11277 Fix all detected errors.
11280 Single block can be also fixed by this method.
11283 theShape The compound to check and improve.
11284 theName Object name; when specified, this parameter is used
11285 for result publication in the study. Otherwise, if automatic
11286 publication is switched on, default value is used for result name.
11291 # Example: see GEOM_TestOthers.py
11292 anObj = self.BlocksOp.CheckAndImprove(theShape)
11293 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11294 self._autoPublish(anObj, theName, "improved")
11297 # end of l4_blocks_measure
11300 ## @addtogroup l3_blocks_op
11303 ## Get all the blocks, contained in the given compound.
11304 # @param theCompound The compound to explode.
11305 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11306 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11307 # @param theName Object name; when specified, this parameter is used
11308 # for result publication in the study. Otherwise, if automatic
11309 # publication is switched on, default value is used for result name.
11311 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11313 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11315 # @ref tui_explode_on_blocks "Example 1"
11316 # \n @ref swig_MakeBlockExplode "Example 2"
11317 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11319 Get all the blocks, contained in the given compound.
11322 theCompound The compound to explode.
11323 theMinNbFaces If solid has lower number of faces, it is not a block.
11324 theMaxNbFaces If solid has higher number of faces, it is not a block.
11325 theName Object name; when specified, this parameter is used
11326 for result publication in the study. Otherwise, if automatic
11327 publication is switched on, default value is used for result name.
11330 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11333 List of GEOM.GEOM_Object, containing the retrieved blocks.
11335 # Example: see GEOM_TestOthers.py
11336 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11337 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11338 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11339 for anObj in aList:
11340 anObj.SetParameters(Parameters)
11342 self._autoPublish(aList, theName, "block")
11345 ## Find block, containing the given point inside its volume or on boundary.
11346 # @param theCompound Compound, to find block in.
11347 # @param thePoint Point, close to the desired block. If the point lays on
11348 # boundary between some blocks, we return block with nearest center.
11349 # @param theName Object name; when specified, this parameter is used
11350 # for result publication in the study. Otherwise, if automatic
11351 # publication is switched on, default value is used for result name.
11353 # @return New GEOM.GEOM_Object, containing the found block.
11355 # @ref swig_todo "Example"
11356 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11358 Find block, containing the given point inside its volume or on boundary.
11361 theCompound Compound, to find block in.
11362 thePoint Point, close to the desired block. If the point lays on
11363 boundary between some blocks, we return block with nearest center.
11364 theName Object name; when specified, this parameter is used
11365 for result publication in the study. Otherwise, if automatic
11366 publication is switched on, default value is used for result name.
11369 New GEOM.GEOM_Object, containing the found block.
11371 # Example: see GEOM_Spanner.py
11372 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11373 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11374 self._autoPublish(anObj, theName, "block")
11377 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11378 # @param theCompound Compound, to find block in.
11379 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11380 # @param theName Object name; when specified, this parameter is used
11381 # for result publication in the study. Otherwise, if automatic
11382 # publication is switched on, default value is used for result name.
11384 # @return New GEOM.GEOM_Object, containing the found block.
11386 # @ref swig_GetBlockByParts "Example"
11387 def GetBlockByParts(self, theCompound, theParts, theName=None):
11389 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11392 theCompound Compound, to find block in.
11393 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11394 theName Object name; when specified, this parameter is used
11395 for result publication in the study. Otherwise, if automatic
11396 publication is switched on, default value is used for result name.
11399 New GEOM_Object, containing the found block.
11401 # Example: see GEOM_TestOthers.py
11402 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11403 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11404 self._autoPublish(anObj, theName, "block")
11407 ## Return all blocks, containing all the elements, passed as the parts.
11408 # @param theCompound Compound, to find blocks in.
11409 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11410 # @param theName Object name; when specified, this parameter is used
11411 # for result publication in the study. Otherwise, if automatic
11412 # publication is switched on, default value is used for result name.
11414 # @return List of GEOM.GEOM_Object, containing the found blocks.
11416 # @ref swig_todo "Example"
11417 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11419 Return all blocks, containing all the elements, passed as the parts.
11422 theCompound Compound, to find blocks in.
11423 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11424 theName Object name; when specified, this parameter is used
11425 for result publication in the study. Otherwise, if automatic
11426 publication is switched on, default value is used for result name.
11429 List of GEOM.GEOM_Object, containing the found blocks.
11431 # Example: see GEOM_Spanner.py
11432 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11433 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11434 self._autoPublish(aList, theName, "block")
11437 ## Multi-transformate block and glue the result.
11438 # Transformation is defined so, as to superpose direction faces.
11439 # @param Block Hexahedral solid to be multi-transformed.
11440 # @param DirFace1 ID of First direction face.
11441 # @param DirFace2 ID of Second direction face.
11442 # @param NbTimes Quantity of transformations to be done.
11443 # @param theName Object name; when specified, this parameter is used
11444 # for result publication in the study. Otherwise, if automatic
11445 # publication is switched on, default value is used for result name.
11447 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11449 # @return New GEOM.GEOM_Object, containing the result shape.
11451 # @ref tui_multi_transformation "Example"
11452 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11454 Multi-transformate block and glue the result.
11455 Transformation is defined so, as to superpose direction faces.
11458 Block Hexahedral solid to be multi-transformed.
11459 DirFace1 ID of First direction face.
11460 DirFace2 ID of Second direction face.
11461 NbTimes Quantity of transformations to be done.
11462 theName Object name; when specified, this parameter is used
11463 for result publication in the study. Otherwise, if automatic
11464 publication is switched on, default value is used for result name.
11467 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11470 New GEOM.GEOM_Object, containing the result shape.
11472 # Example: see GEOM_Spanner.py
11473 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11474 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11475 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11476 anObj.SetParameters(Parameters)
11477 self._autoPublish(anObj, theName, "transformed")
11480 ## Multi-transformate block and glue the result.
11481 # @param Block Hexahedral solid to be multi-transformed.
11482 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11483 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11484 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11485 # @param theName Object name; when specified, this parameter is used
11486 # for result publication in the study. Otherwise, if automatic
11487 # publication is switched on, default value is used for result name.
11489 # @return New GEOM.GEOM_Object, containing the result shape.
11491 # @ref tui_multi_transformation "Example"
11492 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11493 DirFace1V, DirFace2V, NbTimesV, theName=None):
11495 Multi-transformate block and glue the result.
11498 Block Hexahedral solid to be multi-transformed.
11499 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11500 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11501 NbTimesU,NbTimesV Quantity of transformations to be done.
11502 theName Object name; when specified, this parameter is used
11503 for result publication in the study. Otherwise, if automatic
11504 publication is switched on, default value is used for result name.
11507 New GEOM.GEOM_Object, containing the result shape.
11509 # Example: see GEOM_Spanner.py
11510 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11511 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11512 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11513 DirFace1V, DirFace2V, NbTimesV)
11514 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11515 anObj.SetParameters(Parameters)
11516 self._autoPublish(anObj, theName, "transformed")
11519 ## Build all possible propagation groups.
11520 # Propagation group is a set of all edges, opposite to one (main)
11521 # edge of this group directly or through other opposite edges.
11522 # Notion of Opposite Edge make sence only on quadrangle face.
11523 # @param theShape Shape to build propagation groups on.
11524 # @param theName Object name; when specified, this parameter is used
11525 # for result publication in the study. Otherwise, if automatic
11526 # publication is switched on, default value is used for result name.
11528 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11530 # @ref swig_Propagate "Example"
11531 def Propagate(self, theShape, theName=None):
11533 Build all possible propagation groups.
11534 Propagation group is a set of all edges, opposite to one (main)
11535 edge of this group directly or through other opposite edges.
11536 Notion of Opposite Edge make sence only on quadrangle face.
11539 theShape Shape to build propagation groups on.
11540 theName Object name; when specified, this parameter is used
11541 for result publication in the study. Otherwise, if automatic
11542 publication is switched on, default value is used for result name.
11545 List of GEOM.GEOM_Object, each of them is a propagation group.
11547 # Example: see GEOM_TestOthers.py
11548 listChains = self.BlocksOp.Propagate(theShape)
11549 RaiseIfFailed("Propagate", self.BlocksOp)
11550 self._autoPublish(listChains, theName, "propagate")
11553 # end of l3_blocks_op
11556 ## @addtogroup l3_groups
11559 ## Creates a new group which will store sub-shapes of theMainShape
11560 # @param theMainShape is a GEOM object on which the group is selected
11561 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11562 # @param theName Object name; when specified, this parameter is used
11563 # for result publication in the study. Otherwise, if automatic
11564 # publication is switched on, default value is used for result name.
11566 # @return a newly created GEOM group (GEOM.GEOM_Object)
11568 # @ref tui_working_with_groups_page "Example 1"
11569 # \n @ref swig_CreateGroup "Example 2"
11570 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11572 Creates a new group which will store sub-shapes of theMainShape
11575 theMainShape is a GEOM object on which the group is selected
11576 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11577 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11578 theName Object name; when specified, this parameter is used
11579 for result publication in the study. Otherwise, if automatic
11580 publication is switched on, default value is used for result name.
11583 a newly created GEOM group
11586 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11589 # Example: see GEOM_TestOthers.py
11590 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11591 RaiseIfFailed("CreateGroup", self.GroupOp)
11592 self._autoPublish(anObj, theName, "group")
11595 ## Adds a sub-object with ID theSubShapeId to the group
11596 # @param theGroup is a GEOM group to which the new sub-shape is added
11597 # @param theSubShapeID is a sub-shape ID in the main object.
11598 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11600 # @ref tui_working_with_groups_page "Example"
11601 def AddObject(self,theGroup, theSubShapeID):
11603 Adds a sub-object with ID theSubShapeId to the group
11606 theGroup is a GEOM group to which the new sub-shape is added
11607 theSubShapeID is a sub-shape ID in the main object.
11610 Use method GetSubShapeID() to get an unique ID of the sub-shape
11612 # Example: see GEOM_TestOthers.py
11613 self.GroupOp.AddObject(theGroup, theSubShapeID)
11614 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11615 RaiseIfFailed("AddObject", self.GroupOp)
11619 ## Removes a sub-object with ID \a theSubShapeId from the group
11620 # @param theGroup is a GEOM group from which the new sub-shape is removed
11621 # @param theSubShapeID is a sub-shape ID in the main object.
11622 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11624 # @ref tui_working_with_groups_page "Example"
11625 def RemoveObject(self,theGroup, theSubShapeID):
11627 Removes a sub-object with ID theSubShapeId from the group
11630 theGroup is a GEOM group from which the new sub-shape is removed
11631 theSubShapeID is a sub-shape ID in the main object.
11634 Use method GetSubShapeID() to get an unique ID of the sub-shape
11636 # Example: see GEOM_TestOthers.py
11637 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11638 RaiseIfFailed("RemoveObject", self.GroupOp)
11641 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11642 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11643 # @param theSubShapes is a list of sub-shapes to be added.
11645 # @ref tui_working_with_groups_page "Example"
11646 def UnionList (self,theGroup, theSubShapes):
11648 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11651 theGroup is a GEOM group to which the new sub-shapes are added.
11652 theSubShapes is a list of sub-shapes to be added.
11654 # Example: see GEOM_TestOthers.py
11655 self.GroupOp.UnionList(theGroup, theSubShapes)
11656 RaiseIfFailed("UnionList", self.GroupOp)
11659 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11660 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11661 # @param theSubShapes is a list of indices of sub-shapes to be added.
11663 # @ref swig_UnionIDs "Example"
11664 def UnionIDs(self,theGroup, theSubShapes):
11666 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11669 theGroup is a GEOM group to which the new sub-shapes are added.
11670 theSubShapes is a list of indices of sub-shapes to be added.
11672 # Example: see GEOM_TestOthers.py
11673 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11674 RaiseIfFailed("UnionIDs", self.GroupOp)
11677 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11678 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11679 # @param theSubShapes is a list of sub-shapes to be removed.
11681 # @ref tui_working_with_groups_page "Example"
11682 def DifferenceList (self,theGroup, theSubShapes):
11684 Removes from the group all the given shapes. No errors, if some shapes are not included.
11687 theGroup is a GEOM group from which the sub-shapes are removed.
11688 theSubShapes is a list of sub-shapes to be removed.
11690 # Example: see GEOM_TestOthers.py
11691 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11692 RaiseIfFailed("DifferenceList", self.GroupOp)
11695 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11696 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11697 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11699 # @ref swig_DifferenceIDs "Example"
11700 def DifferenceIDs(self,theGroup, theSubShapes):
11702 Removes from the group all the given shapes. No errors, if some shapes are not included.
11705 theGroup is a GEOM group from which the sub-shapes are removed.
11706 theSubShapes is a list of indices of sub-shapes to be removed.
11708 # Example: see GEOM_TestOthers.py
11709 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11710 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11713 ## Union of two groups.
11714 # New group is created. It will contain all entities
11715 # which are present in groups theGroup1 and theGroup2.
11716 # @param theGroup1, theGroup2 are the initial GEOM groups
11717 # to create the united group from.
11718 # @param theName Object name; when specified, this parameter is used
11719 # for result publication in the study. Otherwise, if automatic
11720 # publication is switched on, default value is used for result name.
11722 # @return a newly created GEOM group.
11724 # @ref tui_union_groups_anchor "Example"
11725 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11727 Union of two groups.
11728 New group is created. It will contain all entities
11729 which are present in groups theGroup1 and theGroup2.
11732 theGroup1, theGroup2 are the initial GEOM groups
11733 to create the united group from.
11734 theName Object name; when specified, this parameter is used
11735 for result publication in the study. Otherwise, if automatic
11736 publication is switched on, default value is used for result name.
11739 a newly created GEOM group.
11741 # Example: see GEOM_TestOthers.py
11742 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11743 RaiseIfFailed("UnionGroups", self.GroupOp)
11744 self._autoPublish(aGroup, theName, "group")
11747 ## Intersection of two groups.
11748 # New group is created. It will contain only those entities
11749 # which are present in both groups theGroup1 and theGroup2.
11750 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11751 # @param theName Object name; when specified, this parameter is used
11752 # for result publication in the study. Otherwise, if automatic
11753 # publication is switched on, default value is used for result name.
11755 # @return a newly created GEOM group.
11757 # @ref tui_intersect_groups_anchor "Example"
11758 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11760 Intersection of two groups.
11761 New group is created. It will contain only those entities
11762 which are present in both groups theGroup1 and theGroup2.
11765 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11766 theName Object name; when specified, this parameter is used
11767 for result publication in the study. Otherwise, if automatic
11768 publication is switched on, default value is used for result name.
11771 a newly created GEOM group.
11773 # Example: see GEOM_TestOthers.py
11774 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11775 RaiseIfFailed("IntersectGroups", self.GroupOp)
11776 self._autoPublish(aGroup, theName, "group")
11779 ## Cut of two groups.
11780 # New group is created. It will contain entities which are
11781 # present in group theGroup1 but are not present in group theGroup2.
11782 # @param theGroup1 is a GEOM group to include elements of.
11783 # @param theGroup2 is a GEOM group to exclude elements of.
11784 # @param theName Object name; when specified, this parameter is used
11785 # for result publication in the study. Otherwise, if automatic
11786 # publication is switched on, default value is used for result name.
11788 # @return a newly created GEOM group.
11790 # @ref tui_cut_groups_anchor "Example"
11791 def CutGroups (self, theGroup1, theGroup2, theName=None):
11794 New group is created. It will contain entities which are
11795 present in group theGroup1 but are not present in group theGroup2.
11798 theGroup1 is a GEOM group to include elements of.
11799 theGroup2 is a GEOM group to exclude elements of.
11800 theName Object name; when specified, this parameter is used
11801 for result publication in the study. Otherwise, if automatic
11802 publication is switched on, default value is used for result name.
11805 a newly created GEOM group.
11807 # Example: see GEOM_TestOthers.py
11808 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11809 RaiseIfFailed("CutGroups", self.GroupOp)
11810 self._autoPublish(aGroup, theName, "group")
11813 ## Union of list of groups.
11814 # New group is created. It will contain all entities that are
11815 # present in groups listed in theGList.
11816 # @param theGList is a list of GEOM groups to create the united group from.
11817 # @param theName Object name; when specified, this parameter is used
11818 # for result publication in the study. Otherwise, if automatic
11819 # publication is switched on, default value is used for result name.
11821 # @return a newly created GEOM group.
11823 # @ref tui_union_groups_anchor "Example"
11824 def UnionListOfGroups (self, theGList, theName=None):
11826 Union of list of groups.
11827 New group is created. It will contain all entities that are
11828 present in groups listed in theGList.
11831 theGList is a list of GEOM groups to create the united group from.
11832 theName Object name; when specified, this parameter is used
11833 for result publication in the study. Otherwise, if automatic
11834 publication is switched on, default value is used for result name.
11837 a newly created GEOM group.
11839 # Example: see GEOM_TestOthers.py
11840 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11841 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11842 self._autoPublish(aGroup, theName, "group")
11845 ## Cut of lists of groups.
11846 # New group is created. It will contain only entities
11847 # which are present in groups listed in theGList.
11848 # @param theGList is a list of GEOM groups to include elements of.
11849 # @param theName Object name; when specified, this parameter is used
11850 # for result publication in the study. Otherwise, if automatic
11851 # publication is switched on, default value is used for result name.
11853 # @return a newly created GEOM group.
11855 # @ref tui_intersect_groups_anchor "Example"
11856 def IntersectListOfGroups (self, theGList, theName=None):
11858 Cut of lists of groups.
11859 New group is created. It will contain only entities
11860 which are present in groups listed in theGList.
11863 theGList is a list of GEOM groups to include elements of.
11864 theName Object name; when specified, this parameter is used
11865 for result publication in the study. Otherwise, if automatic
11866 publication is switched on, default value is used for result name.
11869 a newly created GEOM group.
11871 # Example: see GEOM_TestOthers.py
11872 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11873 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11874 self._autoPublish(aGroup, theName, "group")
11877 ## Cut of lists of groups.
11878 # New group is created. It will contain only entities
11879 # which are present in groups listed in theGList1 but
11880 # are not present in groups from theGList2.
11881 # @param theGList1 is a list of GEOM groups to include elements of.
11882 # @param theGList2 is a list of GEOM groups to exclude elements of.
11883 # @param theName Object name; when specified, this parameter is used
11884 # for result publication in the study. Otherwise, if automatic
11885 # publication is switched on, default value is used for result name.
11887 # @return a newly created GEOM group.
11889 # @ref tui_cut_groups_anchor "Example"
11890 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11892 Cut of lists of groups.
11893 New group is created. It will contain only entities
11894 which are present in groups listed in theGList1 but
11895 are not present in groups from theGList2.
11898 theGList1 is a list of GEOM groups to include elements of.
11899 theGList2 is a list of GEOM groups to exclude elements of.
11900 theName Object name; when specified, this parameter is used
11901 for result publication in the study. Otherwise, if automatic
11902 publication is switched on, default value is used for result name.
11905 a newly created GEOM group.
11907 # Example: see GEOM_TestOthers.py
11908 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11909 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11910 self._autoPublish(aGroup, theName, "group")
11913 ## Returns a list of sub-objects ID stored in the group
11914 # @param theGroup is a GEOM group for which a list of IDs is requested
11916 # @ref swig_GetObjectIDs "Example"
11917 def GetObjectIDs(self,theGroup):
11919 Returns a list of sub-objects ID stored in the group
11922 theGroup is a GEOM group for which a list of IDs is requested
11924 # Example: see GEOM_TestOthers.py
11925 ListIDs = self.GroupOp.GetObjects(theGroup)
11926 RaiseIfFailed("GetObjects", self.GroupOp)
11929 ## Returns a type of sub-objects stored in the group
11930 # @param theGroup is a GEOM group which type is returned.
11932 # @ref swig_GetType "Example"
11933 def GetType(self,theGroup):
11935 Returns a type of sub-objects stored in the group
11938 theGroup is a GEOM group which type is returned.
11940 # Example: see GEOM_TestOthers.py
11941 aType = self.GroupOp.GetType(theGroup)
11942 RaiseIfFailed("GetType", self.GroupOp)
11945 ## Convert a type of geom object from id to string value
11946 # @param theId is a GEOM obect type id.
11947 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11948 # @ref swig_GetType "Example"
11949 def ShapeIdToType(self, theId):
11951 Convert a type of geom object from id to string value
11954 theId is a GEOM obect type id.
11957 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11984 return "REVOLUTION"
12032 return "FREE_BOUNDS"
12040 return "THRUSECTIONS"
12042 return "COMPOUNDFILTER"
12044 return "SHAPES_ON_SHAPE"
12046 return "ELLIPSE_ARC"
12048 return "3DSKETCHER"
12054 return "PIPETSHAPE"
12055 return "Shape Id not exist."
12057 ## Returns a main shape associated with the group
12058 # @param theGroup is a GEOM group for which a main shape object is requested
12059 # @return a GEOM object which is a main shape for theGroup
12061 # @ref swig_GetMainShape "Example"
12062 def GetMainShape(self,theGroup):
12064 Returns a main shape associated with the group
12067 theGroup is a GEOM group for which a main shape object is requested
12070 a GEOM object which is a main shape for theGroup
12072 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12074 # Example: see GEOM_TestOthers.py
12075 anObj = self.GroupOp.GetMainShape(theGroup)
12076 RaiseIfFailed("GetMainShape", self.GroupOp)
12079 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12080 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12081 # @param theShape given shape (see GEOM.GEOM_Object)
12082 # @param min_length minimum length of edges of theShape
12083 # @param max_length maximum length of edges of theShape
12084 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12085 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12086 # @param theName Object name; when specified, this parameter is used
12087 # for result publication in the study. Otherwise, if automatic
12088 # publication is switched on, default value is used for result name.
12090 # @return a newly created GEOM group of edges
12092 # @@ref swig_todo "Example"
12093 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12095 Create group of edges of theShape, whose length is in range [min_length, max_length].
12096 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12099 theShape given shape
12100 min_length minimum length of edges of theShape
12101 max_length maximum length of edges of theShape
12102 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12103 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12104 theName Object name; when specified, this parameter is used
12105 for result publication in the study. Otherwise, if automatic
12106 publication is switched on, default value is used for result name.
12109 a newly created GEOM group of edges.
12111 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12112 edges_in_range = []
12114 Props = self.BasicProperties(edge)
12115 if min_length <= Props[0] and Props[0] <= max_length:
12116 if (not include_min) and (min_length == Props[0]):
12119 if (not include_max) and (Props[0] == max_length):
12122 edges_in_range.append(edge)
12124 if len(edges_in_range) <= 0:
12125 print "No edges found by given criteria"
12128 # note: auto-publishing is done in self.CreateGroup()
12129 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12130 self.UnionList(group_edges, edges_in_range)
12134 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12135 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12136 # @param min_length minimum length of edges of selected shape
12137 # @param max_length maximum length of edges of selected shape
12138 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12139 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12140 # @return a newly created GEOM group of edges
12141 # @ref swig_todo "Example"
12142 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12144 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12145 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12148 min_length minimum length of edges of selected shape
12149 max_length maximum length of edges of selected shape
12150 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12151 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12154 a newly created GEOM group of edges.
12156 nb_selected = sg.SelectedCount()
12157 if nb_selected < 1:
12158 print "Select a shape before calling this function, please."
12160 if nb_selected > 1:
12161 print "Only one shape must be selected"
12164 id_shape = sg.getSelected(0)
12165 shape = IDToObject( id_shape )
12167 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12171 if include_min: left_str = " <= "
12172 if include_max: right_str = " <= "
12174 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12175 + left_str + "length" + right_str + `max_length`)
12177 sg.updateObjBrowser(1)
12184 ## @addtogroup l4_advanced
12187 ## Create a T-shape object with specified caracteristics for the main
12188 # and the incident pipes (radius, width, half-length).
12189 # The extremities of the main pipe are located on junctions points P1 and P2.
12190 # The extremity of the incident pipe is located on junction point P3.
12191 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12192 # the main plane of the T-shape is XOY.
12194 # @param theR1 Internal radius of main pipe
12195 # @param theW1 Width of main pipe
12196 # @param theL1 Half-length of main pipe
12197 # @param theR2 Internal radius of incident pipe (R2 < R1)
12198 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12199 # @param theL2 Half-length of incident pipe
12201 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12202 # @param theP1 1st junction point of main pipe
12203 # @param theP2 2nd junction point of main pipe
12204 # @param theP3 Junction point of incident pipe
12206 # @param theRL Internal radius of left thickness reduction
12207 # @param theWL Width of left thickness reduction
12208 # @param theLtransL Length of left transition part
12209 # @param theLthinL Length of left thin part
12211 # @param theRR Internal radius of right thickness reduction
12212 # @param theWR Width of right thickness reduction
12213 # @param theLtransR Length of right transition part
12214 # @param theLthinR Length of right thin part
12216 # @param theRI Internal radius of incident thickness reduction
12217 # @param theWI Width of incident thickness reduction
12218 # @param theLtransI Length of incident transition part
12219 # @param theLthinI Length of incident thin part
12221 # @param theName Object name; when specified, this parameter is used
12222 # for result publication in the study. Otherwise, if automatic
12223 # publication is switched on, default value is used for result name.
12225 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12227 # @ref tui_creation_pipetshape "Example"
12228 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12229 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12230 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12231 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12232 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12235 Create a T-shape object with specified caracteristics for the main
12236 and the incident pipes (radius, width, half-length).
12237 The extremities of the main pipe are located on junctions points P1 and P2.
12238 The extremity of the incident pipe is located on junction point P3.
12239 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12240 the main plane of the T-shape is XOY.
12243 theR1 Internal radius of main pipe
12244 theW1 Width of main pipe
12245 theL1 Half-length of main pipe
12246 theR2 Internal radius of incident pipe (R2 < R1)
12247 theW2 Width of incident pipe (R2+W2 < R1+W1)
12248 theL2 Half-length of incident pipe
12249 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12250 theP1 1st junction point of main pipe
12251 theP2 2nd junction point of main pipe
12252 theP3 Junction point of incident pipe
12254 theRL Internal radius of left thickness reduction
12255 theWL Width of left thickness reduction
12256 theLtransL Length of left transition part
12257 theLthinL Length of left thin part
12259 theRR Internal radius of right thickness reduction
12260 theWR Width of right thickness reduction
12261 theLtransR Length of right transition part
12262 theLthinR Length of right thin part
12264 theRI Internal radius of incident thickness reduction
12265 theWI Width of incident thickness reduction
12266 theLtransI Length of incident transition part
12267 theLthinI Length of incident thin part
12269 theName Object name; when specified, this parameter is used
12270 for result publication in the study. Otherwise, if automatic
12271 publication is switched on, default value is used for result name.
12274 List of GEOM_Object, containing the created shape and propagation groups.
12277 # create PipeTShape object
12278 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12279 # create PipeTShape object with position
12280 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12281 # create PipeTShape object with left thickness reduction
12282 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12284 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)
12285 if (theP1 and theP2 and theP3):
12286 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12287 theRL, theWL, theLtransL, theLthinL,
12288 theRR, theWR, theLtransR, theLthinR,
12289 theRI, theWI, theLtransI, theLthinI,
12290 theHexMesh, theP1, theP2, theP3)
12292 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12293 theRL, theWL, theLtransL, theLthinL,
12294 theRR, theWR, theLtransR, theLthinR,
12295 theRI, theWI, theLtransI, theLthinI,
12297 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12298 if Parameters: anObj[0].SetParameters(Parameters)
12299 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12300 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12303 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12304 # and the incident pipes (radius, width, half-length). The chamfer is
12305 # created on the junction of the pipes.
12306 # The extremities of the main pipe are located on junctions points P1 and P2.
12307 # The extremity of the incident pipe is located on junction point P3.
12308 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12309 # the main plane of the T-shape is XOY.
12310 # @param theR1 Internal radius of main pipe
12311 # @param theW1 Width of main pipe
12312 # @param theL1 Half-length of main pipe
12313 # @param theR2 Internal radius of incident pipe (R2 < R1)
12314 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12315 # @param theL2 Half-length of incident pipe
12316 # @param theH Height of the chamfer.
12317 # @param theW Width of the chamfer.
12318 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12319 # @param theP1 1st junction point of main pipe
12320 # @param theP2 2nd junction point of main pipe
12321 # @param theP3 Junction point of incident pipe
12323 # @param theRL Internal radius of left thickness reduction
12324 # @param theWL Width of left thickness reduction
12325 # @param theLtransL Length of left transition part
12326 # @param theLthinL Length of left thin part
12328 # @param theRR Internal radius of right thickness reduction
12329 # @param theWR Width of right thickness reduction
12330 # @param theLtransR Length of right transition part
12331 # @param theLthinR Length of right thin part
12333 # @param theRI Internal radius of incident thickness reduction
12334 # @param theWI Width of incident thickness reduction
12335 # @param theLtransI Length of incident transition part
12336 # @param theLthinI Length of incident thin part
12338 # @param theName Object name; when specified, this parameter is used
12339 # for result publication in the study. Otherwise, if automatic
12340 # publication is switched on, default value is used for result name.
12342 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12344 # @ref tui_creation_pipetshape "Example"
12345 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12346 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12347 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12348 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12349 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12352 Create a T-shape object with chamfer and with specified caracteristics for the main
12353 and the incident pipes (radius, width, half-length). The chamfer is
12354 created on the junction of the pipes.
12355 The extremities of the main pipe are located on junctions points P1 and P2.
12356 The extremity of the incident pipe is located on junction point P3.
12357 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12358 the main plane of the T-shape is XOY.
12361 theR1 Internal radius of main pipe
12362 theW1 Width of main pipe
12363 theL1 Half-length of main pipe
12364 theR2 Internal radius of incident pipe (R2 < R1)
12365 theW2 Width of incident pipe (R2+W2 < R1+W1)
12366 theL2 Half-length of incident pipe
12367 theH Height of the chamfer.
12368 theW Width of the chamfer.
12369 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12370 theP1 1st junction point of main pipe
12371 theP2 2nd junction point of main pipe
12372 theP3 Junction point of incident pipe
12374 theRL Internal radius of left thickness reduction
12375 theWL Width of left thickness reduction
12376 theLtransL Length of left transition part
12377 theLthinL Length of left thin part
12379 theRR Internal radius of right thickness reduction
12380 theWR Width of right thickness reduction
12381 theLtransR Length of right transition part
12382 theLthinR Length of right thin part
12384 theRI Internal radius of incident thickness reduction
12385 theWI Width of incident thickness reduction
12386 theLtransI Length of incident transition part
12387 theLthinI Length of incident thin part
12389 theName Object name; when specified, this parameter is used
12390 for result publication in the study. Otherwise, if automatic
12391 publication is switched on, default value is used for result name.
12394 List of GEOM_Object, containing the created shape and propagation groups.
12397 # create PipeTShape with chamfer object
12398 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12399 # create PipeTShape with chamfer object with position
12400 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12401 # create PipeTShape with chamfer object with left thickness reduction
12402 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)
12404 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)
12405 if (theP1 and theP2 and theP3):
12406 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12407 theRL, theWL, theLtransL, theLthinL,
12408 theRR, theWR, theLtransR, theLthinR,
12409 theRI, theWI, theLtransI, theLthinI,
12410 theH, theW, theHexMesh, theP1, theP2, theP3)
12412 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12413 theRL, theWL, theLtransL, theLthinL,
12414 theRR, theWR, theLtransR, theLthinR,
12415 theRI, theWI, theLtransI, theLthinI,
12416 theH, theW, theHexMesh)
12417 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12418 if Parameters: anObj[0].SetParameters(Parameters)
12419 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12420 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12423 ## Create a T-shape object with fillet and with specified caracteristics for the main
12424 # and the incident pipes (radius, width, half-length). The fillet is
12425 # created on the junction of the pipes.
12426 # The extremities of the main pipe are located on junctions points P1 and P2.
12427 # The extremity of the incident pipe is located on junction point P3.
12428 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12429 # the main plane of the T-shape is XOY.
12430 # @param theR1 Internal radius of main pipe
12431 # @param theW1 Width of main pipe
12432 # @param theL1 Half-length of main pipe
12433 # @param theR2 Internal radius of incident pipe (R2 < R1)
12434 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12435 # @param theL2 Half-length of incident pipe
12436 # @param theRF Radius of curvature of fillet.
12437 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12438 # @param theP1 1st junction point of main pipe
12439 # @param theP2 2nd junction point of main pipe
12440 # @param theP3 Junction point of incident pipe
12442 # @param theRL Internal radius of left thickness reduction
12443 # @param theWL Width of left thickness reduction
12444 # @param theLtransL Length of left transition part
12445 # @param theLthinL Length of left thin part
12447 # @param theRR Internal radius of right thickness reduction
12448 # @param theWR Width of right thickness reduction
12449 # @param theLtransR Length of right transition part
12450 # @param theLthinR Length of right thin part
12452 # @param theRI Internal radius of incident thickness reduction
12453 # @param theWI Width of incident thickness reduction
12454 # @param theLtransI Length of incident transition part
12455 # @param theLthinI Length of incident thin part
12457 # @param theName Object name; when specified, this parameter is used
12458 # for result publication in the study. Otherwise, if automatic
12459 # publication is switched on, default value is used for result name.
12461 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12463 # @ref tui_creation_pipetshape "Example"
12464 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12465 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12466 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12467 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12468 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12471 Create a T-shape object with fillet and with specified caracteristics for the main
12472 and the incident pipes (radius, width, half-length). The fillet is
12473 created on the junction of the pipes.
12474 The extremities of the main pipe are located on junctions points P1 and P2.
12475 The extremity of the incident pipe is located on junction point P3.
12478 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12479 the main plane of the T-shape is XOY.
12480 theR1 Internal radius of main pipe
12481 theW1 Width of main pipe
12482 heL1 Half-length of main pipe
12483 theR2 Internal radius of incident pipe (R2 < R1)
12484 theW2 Width of incident pipe (R2+W2 < R1+W1)
12485 theL2 Half-length of incident pipe
12486 theRF Radius of curvature of fillet.
12487 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12488 theP1 1st junction point of main pipe
12489 theP2 2nd junction point of main pipe
12490 theP3 Junction point of incident pipe
12492 theRL Internal radius of left thickness reduction
12493 theWL Width of left thickness reduction
12494 theLtransL Length of left transition part
12495 theLthinL Length of left thin part
12497 theRR Internal radius of right thickness reduction
12498 theWR Width of right thickness reduction
12499 theLtransR Length of right transition part
12500 theLthinR Length of right thin part
12502 theRI Internal radius of incident thickness reduction
12503 theWI Width of incident thickness reduction
12504 theLtransI Length of incident transition part
12505 theLthinI Length of incident thin part
12507 theName Object name; when specified, this parameter is used
12508 for result publication in the study. Otherwise, if automatic
12509 publication is switched on, default value is used for result name.
12512 List of GEOM_Object, containing the created shape and propagation groups.
12515 # create PipeTShape with fillet object
12516 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12517 # create PipeTShape with fillet object with position
12518 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12519 # create PipeTShape with fillet object with left thickness reduction
12520 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)
12522 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)
12523 if (theP1 and theP2 and theP3):
12524 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12525 theRL, theWL, theLtransL, theLthinL,
12526 theRR, theWR, theLtransR, theLthinR,
12527 theRI, theWI, theLtransI, theLthinI,
12528 theRF, theHexMesh, theP1, theP2, theP3)
12530 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12531 theRL, theWL, theLtransL, theLthinL,
12532 theRR, theWR, theLtransR, theLthinR,
12533 theRI, theWI, theLtransI, theLthinI,
12535 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12536 if Parameters: anObj[0].SetParameters(Parameters)
12537 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12538 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12541 ## This function allows creating a disk already divided into blocks. It
12542 # can be used to create divided pipes for later meshing in hexaedra.
12543 # @param theR Radius of the disk
12544 # @param theOrientation Orientation of the plane on which the disk will be built
12545 # 1 = XOY, 2 = OYZ, 3 = OZX
12546 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12547 # @param theName Object name; when specified, this parameter is used
12548 # for result publication in the study. Otherwise, if automatic
12549 # publication is switched on, default value is used for result name.
12551 # @return New GEOM_Object, containing the created shape.
12553 # @ref tui_creation_divideddisk "Example"
12554 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12556 Creates a disk, divided into blocks. It can be used to create divided pipes
12557 for later meshing in hexaedra.
12560 theR Radius of the disk
12561 theOrientation Orientation of the plane on which the disk will be built:
12562 1 = XOY, 2 = OYZ, 3 = OZX
12563 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12564 theName Object name; when specified, this parameter is used
12565 for result publication in the study. Otherwise, if automatic
12566 publication is switched on, default value is used for result name.
12569 New GEOM_Object, containing the created shape.
12571 theR, Parameters = ParseParameters(theR)
12572 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12573 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12574 if Parameters: anObj.SetParameters(Parameters)
12575 self._autoPublish(anObj, theName, "dividedDisk")
12578 ## This function allows creating a disk already divided into blocks. It
12579 # can be used to create divided pipes for later meshing in hexaedra.
12580 # @param theCenter Center of the disk
12581 # @param theVector Normal vector to the plane of the created disk
12582 # @param theRadius Radius of the disk
12583 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12584 # @param theName Object name; when specified, this parameter is used
12585 # for result publication in the study. Otherwise, if automatic
12586 # publication is switched on, default value is used for result name.
12588 # @return New GEOM_Object, containing the created shape.
12590 # @ref tui_creation_divideddisk "Example"
12591 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12593 Creates a disk already divided into blocks. It can be used to create divided pipes
12594 for later meshing in hexaedra.
12597 theCenter Center of the disk
12598 theVector Normal vector to the plane of the created disk
12599 theRadius Radius of the disk
12600 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12601 theName Object name; when specified, this parameter is used
12602 for result publication in the study. Otherwise, if automatic
12603 publication is switched on, default value is used for result name.
12606 New GEOM_Object, containing the created shape.
12608 theRadius, Parameters = ParseParameters(theRadius)
12609 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12610 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12611 if Parameters: anObj.SetParameters(Parameters)
12612 self._autoPublish(anObj, theName, "dividedDisk")
12615 ## Builds a cylinder prepared for hexa meshes
12616 # @param theR Radius of the cylinder
12617 # @param theH Height of the cylinder
12618 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12619 # @param theName Object name; when specified, this parameter is used
12620 # for result publication in the study. Otherwise, if automatic
12621 # publication is switched on, default value is used for result name.
12623 # @return New GEOM_Object, containing the created shape.
12625 # @ref tui_creation_dividedcylinder "Example"
12626 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12628 Builds a cylinder prepared for hexa meshes
12631 theR Radius of the cylinder
12632 theH Height of the cylinder
12633 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12634 theName Object name; when specified, this parameter is used
12635 for result publication in the study. Otherwise, if automatic
12636 publication is switched on, default value is used for result name.
12639 New GEOM_Object, containing the created shape.
12641 theR, theH, Parameters = ParseParameters(theR, theH)
12642 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12643 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12644 if Parameters: anObj.SetParameters(Parameters)
12645 self._autoPublish(anObj, theName, "dividedCylinder")
12648 ## Create a surface from a cloud of points
12649 # @param thelPoints list of points
12650 # @return New GEOM_Object, containing the created shape.
12652 # @ref tui_creation_smoothingsurface "Example"
12653 def MakeSmoothingSurface(self, thelPoints):
12654 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12655 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12658 ## Export a shape to XAO format
12659 # @param shape The shape to export
12660 # @param groups The list of groups to export
12661 # @param fields The list of fields to export
12662 # @param author The author of the export
12663 # @param fileName The name of the file to export
12666 # @ref tui_exportxao "Example"
12667 def ExportXAO(self, shape, groups, fields, author, fileName):
12668 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12669 RaiseIfFailed("ExportXAO", self.InsertOp)
12672 ## Import a shape from XAO format
12673 # @param shape Shape to export
12674 # @param fileName The name of the file to import
12675 # @return tuple (res, shape, subShapes, groups, fields)
12676 # res Flag indicating if the import was successful
12677 # shape The imported shape
12678 # subShapes The list of imported subShapes
12679 # groups The list of imported groups
12680 # fields The list of imported fields
12682 # @ref tui_importxao "Example"
12683 def ImportXAO(self, fileName):
12684 res = self.InsertOp.ImportXAO(fileName)
12685 RaiseIfFailed("ImportXAO", self.InsertOp)
12688 #@@ insert new functions before this line @@ do not remove this line @@#
12690 # end of l4_advanced
12693 ## Create a copy of the given object
12695 # @param theOriginal geometry object for copy
12696 # @param theName Object name; when specified, this parameter is used
12697 # for result publication in the study. Otherwise, if automatic
12698 # publication is switched on, default value is used for result name.
12700 # @return New GEOM_Object, containing the copied shape.
12702 # @ingroup l1_geomBuilder_auxiliary
12703 # @ref swig_MakeCopy "Example"
12704 def MakeCopy(self, theOriginal, theName=None):
12706 Create a copy of the given object
12709 theOriginal geometry object for copy
12710 theName Object name; when specified, this parameter is used
12711 for result publication in the study. Otherwise, if automatic
12712 publication is switched on, default value is used for result name.
12715 New GEOM_Object, containing the copied shape.
12717 Example of usage: Copy = geompy.MakeCopy(Box)
12719 # Example: see GEOM_TestAll.py
12720 anObj = self.InsertOp.MakeCopy(theOriginal)
12721 RaiseIfFailed("MakeCopy", self.InsertOp)
12722 self._autoPublish(anObj, theName, "copy")
12725 ## Add Path to load python scripts from
12726 # @param Path a path to load python scripts from
12727 # @ingroup l1_geomBuilder_auxiliary
12728 def addPath(self,Path):
12730 Add Path to load python scripts from
12733 Path a path to load python scripts from
12735 if (sys.path.count(Path) < 1):
12736 sys.path.append(Path)
12740 ## Load marker texture from the file
12741 # @param Path a path to the texture file
12742 # @return unique texture identifier
12743 # @ingroup l1_geomBuilder_auxiliary
12744 def LoadTexture(self, Path):
12746 Load marker texture from the file
12749 Path a path to the texture file
12752 unique texture identifier
12754 # Example: see GEOM_TestAll.py
12755 ID = self.InsertOp.LoadTexture(Path)
12756 RaiseIfFailed("LoadTexture", self.InsertOp)
12759 ## Get internal name of the object based on its study entry
12760 # @note This method does not provide an unique identifier of the geometry object.
12761 # @note This is internal function of GEOM component, though it can be used outside it for
12762 # appropriate reason (e.g. for identification of geometry object).
12763 # @param obj geometry object
12764 # @return unique object identifier
12765 # @ingroup l1_geomBuilder_auxiliary
12766 def getObjectID(self, obj):
12768 Get internal name of the object based on its study entry.
12769 Note: this method does not provide an unique identifier of the geometry object.
12770 It is an internal function of GEOM component, though it can be used outside GEOM for
12771 appropriate reason (e.g. for identification of geometry object).
12774 obj geometry object
12777 unique object identifier
12780 entry = salome.ObjectToID(obj)
12781 if entry is not None:
12782 lst = entry.split(":")
12784 ID = lst[-1] # -1 means last item in the list
12785 return "GEOM_" + ID
12790 ## Add marker texture. @a Width and @a Height parameters
12791 # specify width and height of the texture in pixels.
12792 # If @a RowData is @c True, @a Texture parameter should represent texture data
12793 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12794 # parameter should be unpacked string, in which '1' symbols represent opaque
12795 # pixels and '0' represent transparent pixels of the texture bitmap.
12797 # @param Width texture width in pixels
12798 # @param Height texture height in pixels
12799 # @param Texture texture data
12800 # @param RowData if @c True, @a Texture data are packed in the byte stream
12801 # @return unique texture identifier
12802 # @ingroup l1_geomBuilder_auxiliary
12803 def AddTexture(self, Width, Height, Texture, RowData=False):
12805 Add marker texture. Width and Height parameters
12806 specify width and height of the texture in pixels.
12807 If RowData is True, Texture parameter should represent texture data
12808 packed into the byte array. If RowData is False (default), Texture
12809 parameter should be unpacked string, in which '1' symbols represent opaque
12810 pixels and '0' represent transparent pixels of the texture bitmap.
12813 Width texture width in pixels
12814 Height texture height in pixels
12815 Texture texture data
12816 RowData if True, Texture data are packed in the byte stream
12819 return unique texture identifier
12821 if not RowData: Texture = PackData(Texture)
12822 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12823 RaiseIfFailed("AddTexture", self.InsertOp)
12826 ## Creates a new folder object. It is a container for any GEOM objects.
12827 # @param Name name of the container
12828 # @param Father parent object. If None,
12829 # folder under 'Geometry' root object will be created.
12830 # @return a new created folder
12831 # @ingroup l1_publish_data
12832 def NewFolder(self, Name, Father=None):
12834 Create a new folder object. It is an auxiliary container for any GEOM objects.
12837 Name name of the container
12838 Father parent object. If None,
12839 folder under 'Geometry' root object will be created.
12842 a new created folder
12844 if not Father: Father = self.father
12845 return self.CreateFolder(Name, Father)
12847 ## Move object to the specified folder
12848 # @param Object object to move
12849 # @param Folder target folder
12850 # @ingroup l1_publish_data
12851 def PutToFolder(self, Object, Folder):
12853 Move object to the specified folder
12856 Object object to move
12857 Folder target folder
12859 self.MoveToFolder(Object, Folder)
12862 ## Move list of objects to the specified folder
12863 # @param ListOfSO list of objects to move
12864 # @param Folder target folder
12865 # @ingroup l1_publish_data
12866 def PutListToFolder(self, ListOfSO, Folder):
12868 Move list of objects to the specified folder
12871 ListOfSO list of objects to move
12872 Folder target folder
12874 self.MoveListToFolder(ListOfSO, Folder)
12877 ## @addtogroup l2_field
12881 # @param shape the shape the field lies on
12882 # @param name the field name
12883 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12884 # @param dimension dimension of the shape the field lies on
12885 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12886 # @param componentNames names of components
12887 # @return a created field
12888 def CreateField(self, shape, name, type, dimension, componentNames):
12893 shape the shape the field lies on
12894 name the field name
12895 type type of field data
12896 dimension dimension of the shape the field lies on
12897 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12898 componentNames names of components
12903 if isinstance( type, int ):
12904 if type < 0 or type > 3:
12905 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12906 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12908 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12909 RaiseIfFailed("CreateField", self.FieldOp)
12911 geom._autoPublish( f, "", name)
12914 ## Removes a field from the GEOM component
12915 # @param field the field to remove
12916 def RemoveField(self, field):
12917 "Removes a field from the GEOM component"
12919 if isinstance( field, GEOM._objref_GEOM_Field ):
12920 geom.RemoveObject( field )
12921 elif isinstance( field, geomField ):
12922 geom.RemoveObject( field.field )
12924 raise RuntimeError, "RemoveField() : the object is not a field"
12927 ## Returns number of fields on a shape
12928 def CountFields(self, shape):
12929 "Returns number of fields on a shape"
12930 nb = self.FieldOp.CountFields( shape )
12931 RaiseIfFailed("CountFields", self.FieldOp)
12934 ## Returns all fields on a shape
12935 def GetFields(self, shape):
12936 "Returns all fields on a shape"
12937 ff = self.FieldOp.GetFields( shape )
12938 RaiseIfFailed("GetFields", self.FieldOp)
12941 ## Returns a field on a shape by its name
12942 def GetField(self, shape, name):
12943 "Returns a field on a shape by its name"
12944 f = self.FieldOp.GetField( shape, name )
12945 RaiseIfFailed("GetField", self.FieldOp)
12953 # Register the new proxy for GEOM_Gen
12954 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12957 ## Field on Geometry
12958 # @ingroup l2_field
12959 class geomField( GEOM._objref_GEOM_Field ):
12961 def __init__(self):
12962 GEOM._objref_GEOM_Field.__init__(self)
12963 self.field = GEOM._objref_GEOM_Field
12966 ## Returns the shape the field lies on
12967 def getShape(self):
12968 "Returns the shape the field lies on"
12969 return self.field.GetShape(self)
12971 ## Returns the field name
12973 "Returns the field name"
12974 return self.field.GetName(self)
12976 ## Returns type of field data as integer [0-3]
12978 "Returns type of field data"
12979 return self.field.GetDataType(self)._v
12981 ## Returns type of field data:
12982 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12983 def getTypeEnum(self):
12984 "Returns type of field data"
12985 return self.field.GetDataType(self)
12987 ## Returns dimension of the shape the field lies on:
12988 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12989 def getDimension(self):
12990 """Returns dimension of the shape the field lies on:
12991 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12992 return self.field.GetDimension(self)
12994 ## Returns names of components
12995 def getComponents(self):
12996 "Returns names of components"
12997 return self.field.GetComponents(self)
12999 ## Adds a time step to the field
13000 # @param step the time step number futher used as the step identifier
13001 # @param stamp the time step time
13002 # @param values the values of the time step
13003 def addStep(self, step, stamp, values):
13004 "Adds a time step to the field"
13005 stp = self.field.AddStep( self, step, stamp )
13007 raise RuntimeError, \
13008 "Field.addStep() : Error: step %s already exists in this field"%step
13010 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13011 self.setValues( step, values )
13014 ## Remove a time step from the field
13015 def removeStep(self,step):
13016 "Remove a time step from the field"
13019 stepObj = self.field.GetStep( self, step )
13021 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13024 #traceback.print_exc()
13026 self.field.RemoveStep( self, step )
13028 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13031 ## Returns number of time steps in the field
13032 def countSteps(self):
13033 "Returns number of time steps in the field"
13034 return self.field.CountSteps(self)
13036 ## Returns a list of time step IDs in the field
13037 def getSteps(self):
13038 "Returns a list of time step IDs in the field"
13039 return self.field.GetSteps(self)
13041 ## Returns a time step by its ID
13042 def getStep(self,step):
13043 "Returns a time step by its ID"
13044 stp = self.field.GetStep(self, step)
13046 raise RuntimeError, "Step %s is missing from this field"%step
13049 ## Returns the time of the field step
13050 def getStamp(self,step):
13051 "Returns the time of the field step"
13052 return self.getStep(step).GetStamp()
13054 ## Changes the time of the field step
13055 def setStamp(self, step, stamp):
13056 "Changes the time of the field step"
13057 return self.getStep(step).SetStamp(stamp)
13059 ## Returns values of the field step
13060 def getValues(self, step):
13061 "Returns values of the field step"
13062 return self.getStep(step).GetValues()
13064 ## Changes values of the field step
13065 def setValues(self, step, values):
13066 "Changes values of the field step"
13067 stp = self.getStep(step)
13068 errBeg = "Field.setValues(values) : Error: "
13070 ok = stp.SetValues( values )
13071 except Exception, e:
13073 if excStr.find("WrongPythonType") > 0:
13074 raise RuntimeError, errBeg +\
13075 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13076 raise RuntimeError, errBeg + str(e)
13078 nbOK = self.field.GetArraySize(self)
13081 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13083 raise RuntimeError, errBeg + "failed"
13086 pass # end of class geomField
13088 # Register the new proxy for GEOM_Field
13089 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13092 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13093 # interface to GEOM operations.
13098 # salome.salome_init()
13099 # from salome.geom import geomBuilder
13100 # geompy = geomBuilder.New(salome.myStudy)
13102 # @param study SALOME study, generally obtained by salome.myStudy.
13103 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13104 # @return geomBuilder instance
13105 def New( study, instance=None):
13107 Create a new geomBuilder instance.The geomBuilder class provides the Python
13108 interface to GEOM operations.
13112 salome.salome_init()
13113 from salome.geom import geomBuilder
13114 geompy = geomBuilder.New(salome.myStudy)
13117 study SALOME study, generally obtained by salome.myStudy.
13118 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13120 geomBuilder instance
13122 #print "New geomBuilder ", study, instance
13129 geom = geomBuilder()
13130 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13131 geom.init_geom(study)