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 geomBuilder geomBuilder Python module
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.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
258 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
261 def _toListOfNames(_names, _size=-1):
264 if type(_names) in [types.ListType, types.TupleType]:
265 for i in _names: l.append(i)
268 if l and len(l) < _size:
269 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
272 ## Raise an Error, containing the Method_name, if Operation is Failed
273 ## @ingroup l1_geomBuilder_auxiliary
274 def RaiseIfFailed (Method_name, Operation):
275 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
276 Operation.AbortOperation()
277 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
279 Operation.FinishOperation()
282 ## Return list of variables value from salome notebook
283 ## @ingroup l1_geomBuilder_auxiliary
284 def ParseParameters(*parameters):
287 for parameter in parameters:
288 if isinstance(parameter, list):
289 lResults = ParseParameters(*parameter)
290 if len(lResults) > 0:
291 Result.append(lResults[:-1])
292 StringResult += lResults[-1].split(":")
296 if isinstance(parameter,str):
297 if notebook.isVariable(parameter):
298 Result.append(notebook.get(parameter))
300 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
303 Result.append(parameter)
305 StringResult.append(str(parameter))
309 Result.append(":".join(StringResult))
311 Result = ":".join(StringResult)
314 ## Return list of variables value from salome notebook
315 ## @ingroup l1_geomBuilder_auxiliary
319 for parameter in list:
320 if isinstance(parameter,str) and notebook.isVariable(parameter):
321 Result.append(str(notebook.get(parameter)))
324 Result.append(str(parameter))
327 StringResult = StringResult + str(parameter)
328 StringResult = StringResult + ":"
330 StringResult = StringResult[:len(StringResult)-1]
331 return Result, StringResult
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
335 def ParseSketcherCommand(command):
338 sections = command.split(":")
339 for section in sections:
340 parameters = section.split(" ")
342 for parameter in parameters:
343 if paramIndex > 1 and parameter.find("'") != -1:
344 parameter = parameter.replace("'","")
345 if notebook.isVariable(parameter):
346 Result = Result + str(notebook.get(parameter)) + " "
349 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
353 Result = Result + str(parameter) + " "
356 StringResult = StringResult + parameter
357 StringResult = StringResult + ":"
359 paramIndex = paramIndex + 1
361 Result = Result[:len(Result)-1] + ":"
363 Result = Result[:len(Result)-1]
364 return Result, StringResult
366 ## Helper function which can be used to pack the passed string to the byte data.
367 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
368 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
371 ## val = PackData("10001110") # val = 0xAE
372 ## val = PackData("1") # val = 0x80
374 ## @param data unpacked data - a string containing '1' and '0' symbols
375 ## @return data packed to the byte stream
376 ## @ingroup l1_geomBuilder_auxiliary
379 Helper function which can be used to pack the passed string to the byte data.
380 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
381 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
384 data unpacked data - a string containing '1' and '0' symbols
387 data packed to the byte stream
390 val = PackData("10001110") # val = 0xAE
391 val = PackData("1") # val = 0x80
394 if len(data)%8: bytes += 1
396 for b in range(bytes):
397 d = data[b*8:(b+1)*8]
402 if d[i] == "1": val += 1
404 raise "Invalid symbol %s" % d[i]
411 ## Read bitmap texture from the text file.
412 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
413 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
414 ## The function returns width and height of the pixmap in pixels and byte stream representing
415 ## texture bitmap itself.
417 ## This function can be used to read the texture to the byte stream in order to pass it to
418 ## the AddTexture() function of geomBuilder class.
421 ## from salome.geom import geomBuilder
422 ## geompy = geomBuilder.New(salome.myStudy)
423 ## texture = geompy.readtexture('mytexture.dat')
424 ## texture = geompy.AddTexture(*texture)
425 ## obj.SetMarkerTexture(texture)
427 ## @param fname texture file name
428 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
429 ## @ingroup l1_geomBuilder_auxiliary
430 def ReadTexture(fname):
432 Read bitmap texture from the text file.
433 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
434 A zero symbol ('0') represents transparent pixel of the texture bitmap.
435 The function returns width and height of the pixmap in pixels and byte stream representing
436 texture bitmap itself.
437 This function can be used to read the texture to the byte stream in order to pass it to
438 the AddTexture() function of geomBuilder class.
441 fname texture file name
444 sequence of tree values: texture's width, height in pixels and its byte stream
447 from salome.geom import geomBuilder
448 geompy = geomBuilder.New(salome.myStudy)
449 texture = geompy.readtexture('mytexture.dat')
450 texture = geompy.AddTexture(*texture)
451 obj.SetMarkerTexture(texture)
455 lines = [ l.strip() for l in f.readlines()]
458 if lines: maxlen = max([len(x) for x in lines])
460 if maxlen%8: lenbytes += 1
464 lenline = (len(line)/8+1)*8
467 lenline = (len(line)/8)*8
469 for i in range(lenline/8):
472 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
475 bytedata += PackData(byte)
477 for i in range(lenline/8, lenbytes):
478 bytedata += PackData("0")
480 return lenbytes*8, len(lines), bytedata
485 ## Returns a long value from enumeration type
486 # Can be used for CORBA enumerator types like GEOM.shape_type
487 # @param theItem enumeration type
488 # @ingroup l1_geomBuilder_auxiliary
489 def EnumToLong(theItem):
491 Returns a long value from enumeration type
492 Can be used for CORBA enumerator types like geomBuilder.ShapeType
495 theItem enumeration type
498 if hasattr(theItem, "_v"): ret = theItem._v
501 ## Information about closed/unclosed state of shell or wire
502 # @ingroup l1_geomBuilder_auxiliary
505 Information about closed/unclosed state of shell or wire
511 ## Private class used to bind calls of plugin operations to geomBuilder
512 class PluginOperation:
513 def __init__(self, operation, function):
514 self.operation = operation
515 self.function = function
518 def __call__(self, *args):
519 res = self.function(self.operation, *args)
520 RaiseIfFailed(self.function.__name__, self.operation)
523 # Warning: geom is a singleton
529 class geomBuilder(object, GEOM._objref_GEOM_Gen):
531 ## Enumeration ShapeType as a dictionary. \n
532 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
533 # @ingroup l1_geomBuilder_auxiliary
534 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
536 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
537 # and a list of parameters, describing the shape.
538 # List of parameters, describing the shape:
539 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
540 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
542 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
544 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
546 # - SPHERE: [xc yc zc R]
547 # - CYLINDER: [xb yb zb dx dy dz R H]
548 # - BOX: [xc yc zc ax ay az]
549 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
550 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
551 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
552 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
553 # - SOLID: [nb_faces nb_edges nb_vertices]
555 # - SPHERE2D: [xc yc zc R]
556 # - CYLINDER2D: [xb yb zb dx dy dz R H]
557 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
558 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
559 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
560 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
561 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
562 # - PLANE: [xo yo zo dx dy dz]
563 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
564 # - FACE: [nb_edges nb_vertices]
566 # - CIRCLE: [xc yc zc dx dy dz R]
567 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
568 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
569 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
570 # - LINE: [xo yo zo dx dy dz]
571 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
572 # - EDGE: [nb_vertices]
575 # @ingroup l1_geomBuilder_auxiliary
576 kind = GEOM.GEOM_IKindOfShape
583 #print "==== __new__ ", engine, geom, doLcc, created
585 # geom engine is either retrieved from engine, or created
587 # Following test avoids a recursive loop
590 # geom engine not created: existing engine found
592 if doLcc and not created:
594 # FindOrLoadComponent called:
595 # 1. CORBA resolution of server
596 # 2. the __new__ method is called again
597 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
598 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
601 # FindOrLoadComponent not called
603 # geomBuilder instance is created from lcc.FindOrLoadComponent
604 #print "==== super ", engine, geom, doLcc, created
605 geom = super(geomBuilder,cls).__new__(cls)
608 # geom engine not created: existing engine found
609 #print "==== existing ", engine, geom, doLcc, created
611 #print "return geom 1 ", geom
614 #print "return geom 2 ", geom
619 #print "-------- geomBuilder __init__ --- ", created, self
622 GEOM._objref_GEOM_Gen.__init__(self)
623 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
624 self.myBuilder = None
644 ## Process object publication in the study, as follows:
645 # - if @a theName is specified (not None), the object is published in the study
646 # with this name, not taking into account "auto-publishing" option;
647 # - if @a theName is NOT specified, the object is published in the study
648 # (using default name, which can be customized using @a theDefaultName parameter)
649 # only if auto-publishing is switched on.
651 # @param theObj object, a subject for publishing
652 # @param theName object name for study
653 # @param theDefaultName default name for the auto-publishing
655 # @sa addToStudyAuto()
656 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
658 def _item_name(_names, _defname, _idx=-1):
659 if not _names: _names = _defname
660 if type(_names) in [types.ListType, types.TupleType]:
662 if _idx >= len(_names) or not _names[_idx]:
663 if type(_defname) not in [types.ListType, types.TupleType]:
664 _name = "%s_%d"%(_defname, _idx+1)
665 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
666 _name = _defname[_idx]
668 _name = "%noname_%d"%(dn, _idx+1)
674 # must be wrong usage
679 _name = "%s_%d"%(_names, _idx+1)
685 def _publish( _name, _obj ):
687 if isinstance( _obj, GEOM._objref_GEOM_Field ):
688 fatherObj = _obj.GetShape()
689 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
690 fatherObj = _obj.GetField()
691 elif not _obj.IsMainShape():
692 fatherObj = _obj.GetMainShape()
694 if fatherObj and fatherObj.GetStudyEntry():
695 self.addToStudyInFather(fatherObj, _obj, _name)
697 self.addToStudy(_obj, _name)
703 if not theName and not self.myMaxNbSubShapesAllowed:
704 return # nothing to do: auto-publishing is disabled
705 if not theName and not theDefaultName:
706 return # neither theName nor theDefaultName is given
708 if type(theObj) in [types.ListType, types.TupleType]:
709 # list of objects is being published
712 if not obj: continue # bad object
713 name = _item_name(theName, theDefaultName, idx)
714 _publish( name, obj )
716 if not theName and idx == self.myMaxNbSubShapesAllowed: break
720 # single object is published
721 name = _item_name(theName, theDefaultName)
722 _publish( name, theObj )
725 ## @addtogroup l1_geomBuilder_auxiliary
727 def init_geom(self,theStudy):
728 self.myStudy = theStudy
729 self.myStudyId = self.myStudy._get_StudyId()
730 self.myBuilder = self.myStudy.NewBuilder()
731 self.father = self.myStudy.FindComponent("GEOM")
732 if self.father is None:
733 self.father = self.myBuilder.NewComponent("GEOM")
734 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
735 FName = A1._narrow(SALOMEDS.AttributeName)
736 FName.SetValue("Geometry")
737 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
738 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
739 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
740 self.myBuilder.DefineComponentInstance(self.father,self)
742 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
743 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
744 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
745 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
746 self.HealOp = self.GetIHealingOperations (self.myStudyId)
747 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
748 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
749 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
750 self.LocalOp = self.GetILocalOperations (self.myStudyId)
751 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
752 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
753 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
754 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
756 # The below line is a right way to map all plugin functions to geomBuilder,
757 # but AdvancedOperations are already mapped, that is why this line is commented
758 # and presents here only as an axample
759 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
761 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
762 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
764 # set GEOM as root in the use case tree
765 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
766 self.myUseCaseBuilder.SetRootCurrent()
767 self.myUseCaseBuilder.Append(self.father)
770 def GetPluginOperations(self, studyID, libraryName):
771 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
773 # bind methods of operations to self
774 methods = op.__class__.__dict__['__methods__']
775 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
776 for meth_name in methods:
777 if not meth_name in avoid_methods: # avoid basic methods
778 function = getattr(op.__class__, meth_name)
779 if callable(function):
780 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
781 self.__dict__[meth_name] = PluginOperation(op, function)
784 ## Enable / disable results auto-publishing
786 # The automatic publishing is managed in the following way:
787 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
788 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
789 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
790 # value passed as parameter has the same effect.
791 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
792 # maximum number of sub-shapes allowed for publishing is set to specified value.
794 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
795 # @ingroup l1_publish_data
796 def addToStudyAuto(self, maxNbSubShapes=-1):
798 Enable / disable results auto-publishing
800 The automatic publishing is managed in the following way:
801 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
802 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
803 maximum number of sub-shapes allowed for publishing is unlimited; any negative
804 value passed as parameter has the same effect.
805 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
806 maximum number of sub-shapes allowed for publishing is set to this value.
809 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
812 geompy.addToStudyAuto() # enable auto-publishing
813 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
814 geompy.addToStudyAuto(0) # disable auto-publishing
816 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
819 ## Dump component to the Python script
820 # This method overrides IDL function to allow default values for the parameters.
821 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
823 Dump component to the Python script
824 This method overrides IDL function to allow default values for the parameters.
826 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
828 ## Get name for sub-shape aSubObj of shape aMainObj
830 # @ref swig_SubShapeName "Example"
831 def SubShapeName(self,aSubObj, aMainObj):
833 Get name for sub-shape aSubObj of shape aMainObj
835 # Example: see GEOM_TestAll.py
837 #aSubId = orb.object_to_string(aSubObj)
838 #aMainId = orb.object_to_string(aMainObj)
839 #index = gg.getIndexTopology(aSubId, aMainId)
840 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
841 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
842 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
845 ## Publish in study aShape with name aName
847 # \param aShape the shape to be published
848 # \param aName the name for the shape
849 # \param doRestoreSubShapes if True, finds and publishes also
850 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
851 # and published sub-shapes of arguments
852 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
853 # these arguments description
854 # \return study entry of the published shape in form of string
856 # @ingroup l1_publish_data
857 # @ref swig_all_addtostudy "Example"
858 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
859 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
861 Publish in study aShape with name aName
864 aShape the shape to be published
865 aName the name for the shape
866 doRestoreSubShapes if True, finds and publishes also
867 sub-shapes of aShape, corresponding to its arguments
868 and published sub-shapes of arguments
869 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
870 these arguments description
873 study entry of the published shape in form of string
876 id_block1 = geompy.addToStudy(Block1, "Block 1")
878 # Example: see GEOM_TestAll.py
880 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
881 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
882 if doRestoreSubShapes:
883 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
884 theFindMethod, theInheritFirstArg, True )
886 print "addToStudy() failed"
888 return aShape.GetStudyEntry()
890 ## Publish in study aShape with name aName as sub-object of previously published aFather
891 # \param aFather previously published object
892 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
893 # \param aName the name for the shape
895 # \return study entry of the published shape in form of string
897 # @ingroup l1_publish_data
898 # @ref swig_all_addtostudyInFather "Example"
899 def addToStudyInFather(self, aFather, aShape, aName):
901 Publish in study aShape with name aName as sub-object of previously published aFather
904 aFather previously published object
905 aShape the shape to be published as sub-object of aFather
906 aName the name for the shape
909 study entry of the published shape in form of string
911 # Example: see GEOM_TestAll.py
913 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
914 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
916 print "addToStudyInFather() failed"
918 return aShape.GetStudyEntry()
920 ## Unpublish object in study
922 # \param obj the object to be unpublished
923 def hideInStudy(self, obj):
925 Unpublish object in study
928 obj the object to be unpublished
930 ior = salome.orb.object_to_string(obj)
931 aSObject = self.myStudy.FindObjectIOR(ior)
932 if aSObject is not None:
933 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
934 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
935 drwAttribute.SetDrawable(False)
938 # end of l1_geomBuilder_auxiliary
941 ## @addtogroup l3_restore_ss
944 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
945 # To be used from python scripts out of addToStudy() (non-default usage)
946 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
947 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
948 # If this list is empty, all operation arguments will be published
949 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
950 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
951 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
952 # Do not publish sub-shapes in place of arguments, but only
953 # in place of sub-shapes of the first argument,
954 # because the whole shape corresponds to the first argument.
955 # Mainly to be used after transformations, but it also can be
956 # usefull after partition with one object shape, and some other
957 # operations, where only the first argument has to be considered.
958 # If theObject has only one argument shape, this flag is automatically
959 # considered as True, not regarding really passed value.
960 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
961 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
962 # \return list of published sub-shapes
964 # @ref tui_restore_prs_params "Example"
965 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
966 theInheritFirstArg=False, theAddPrefix=True):
968 Publish sub-shapes, standing for arguments and sub-shapes of arguments
969 To be used from python scripts out of geompy.addToStudy (non-default usage)
972 theObject published GEOM.GEOM_Object, arguments of which will be published
973 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
974 If this list is empty, all operation arguments will be published
975 theFindMethod method to search sub-shapes, corresponding to arguments and
976 their sub-shapes. Value from enumeration GEOM.find_shape_method.
977 theInheritFirstArg set properties of the first argument for theObject.
978 Do not publish sub-shapes in place of arguments, but only
979 in place of sub-shapes of the first argument,
980 because the whole shape corresponds to the first argument.
981 Mainly to be used after transformations, but it also can be
982 usefull after partition with one object shape, and some other
983 operations, where only the first argument has to be considered.
984 If theObject has only one argument shape, this flag is automatically
985 considered as True, not regarding really passed value.
986 theAddPrefix add prefix "from_" to names of restored sub-shapes,
987 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
989 list of published sub-shapes
991 # Example: see GEOM_TestAll.py
992 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
993 theFindMethod, theInheritFirstArg, theAddPrefix)
995 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
996 # To be used from python scripts out of addToStudy() (non-default usage)
997 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
998 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
999 # If this list is empty, all operation arguments will be published
1000 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1001 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1002 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1003 # Do not publish sub-shapes in place of arguments, but only
1004 # in place of sub-shapes of the first argument,
1005 # because the whole shape corresponds to the first argument.
1006 # Mainly to be used after transformations, but it also can be
1007 # usefull after partition with one object shape, and some other
1008 # operations, where only the first argument has to be considered.
1009 # If theObject has only one argument shape, this flag is automatically
1010 # considered as True, not regarding really passed value.
1011 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1012 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1013 # \return list of published sub-shapes
1015 # @ref tui_restore_prs_params "Example"
1016 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1017 theInheritFirstArg=False, theAddPrefix=True):
1019 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1020 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1023 theObject published GEOM.GEOM_Object, arguments of which will be published
1024 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1025 If this list is empty, all operation arguments will be published
1026 theFindMethod method to search sub-shapes, corresponding to arguments and
1027 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1028 theInheritFirstArg set properties of the first argument for theObject.
1029 Do not publish sub-shapes in place of arguments, but only
1030 in place of sub-shapes of the first argument,
1031 because the whole shape corresponds to the first argument.
1032 Mainly to be used after transformations, but it also can be
1033 usefull after partition with one object shape, and some other
1034 operations, where only the first argument has to be considered.
1035 If theObject has only one argument shape, this flag is automatically
1036 considered as True, not regarding really passed value.
1037 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1038 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1041 list of published sub-shapes
1043 # Example: see GEOM_TestAll.py
1044 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1045 theFindMethod, theInheritFirstArg, theAddPrefix)
1047 # end of l3_restore_ss
1050 ## @addtogroup l3_basic_go
1053 ## Create point by three coordinates.
1054 # @param theX The X coordinate of the point.
1055 # @param theY The Y coordinate of the point.
1056 # @param theZ The Z coordinate of the point.
1057 # @param theName Object name; when specified, this parameter is used
1058 # for result publication in the study. Otherwise, if automatic
1059 # publication is switched on, default value is used for result name.
1061 # @return New GEOM.GEOM_Object, containing the created point.
1063 # @ref tui_creation_point "Example"
1064 def MakeVertex(self, theX, theY, theZ, theName=None):
1066 Create point by three coordinates.
1069 theX The X coordinate of the point.
1070 theY The Y coordinate of the point.
1071 theZ The Z coordinate of the point.
1072 theName Object name; when specified, this parameter is used
1073 for result publication in the study. Otherwise, if automatic
1074 publication is switched on, default value is used for result name.
1077 New GEOM.GEOM_Object, containing the created point.
1079 # Example: see GEOM_TestAll.py
1080 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1081 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1082 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1083 anObj.SetParameters(Parameters)
1084 self._autoPublish(anObj, theName, "vertex")
1087 ## Create a point, distant from the referenced point
1088 # on the given distances along the coordinate axes.
1089 # @param theReference The referenced point.
1090 # @param theX Displacement from the referenced point along OX axis.
1091 # @param theY Displacement from the referenced point along OY axis.
1092 # @param theZ Displacement from the referenced point along OZ axis.
1093 # @param theName Object name; when specified, this parameter is used
1094 # for result publication in the study. Otherwise, if automatic
1095 # publication is switched on, default value is used for result name.
1097 # @return New GEOM.GEOM_Object, containing the created point.
1099 # @ref tui_creation_point "Example"
1100 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1102 Create a point, distant from the referenced point
1103 on the given distances along the coordinate axes.
1106 theReference The referenced point.
1107 theX Displacement from the referenced point along OX axis.
1108 theY Displacement from the referenced point along OY axis.
1109 theZ Displacement from the referenced point along OZ axis.
1110 theName Object name; when specified, this parameter is used
1111 for result publication in the study. Otherwise, if automatic
1112 publication is switched on, default value is used for result name.
1115 New GEOM.GEOM_Object, containing the created point.
1117 # Example: see GEOM_TestAll.py
1118 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1119 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1120 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1121 anObj.SetParameters(Parameters)
1122 self._autoPublish(anObj, theName, "vertex")
1125 ## Create a point, corresponding to the given parameter on the given curve.
1126 # @param theRefCurve The referenced curve.
1127 # @param theParameter Value of parameter on the referenced curve.
1128 # @param theName Object name; when specified, this parameter is used
1129 # for result publication in the study. Otherwise, if automatic
1130 # publication is switched on, default value is used for result name.
1132 # @return New GEOM.GEOM_Object, containing the created point.
1134 # @ref tui_creation_point "Example"
1135 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1137 Create a point, corresponding to the given parameter on the given curve.
1140 theRefCurve The referenced curve.
1141 theParameter Value of parameter on the referenced curve.
1142 theName Object name; when specified, this parameter is used
1143 for result publication in the study. Otherwise, if automatic
1144 publication is switched on, default value is used for result name.
1147 New GEOM.GEOM_Object, containing the created point.
1150 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1152 # Example: see GEOM_TestAll.py
1153 theParameter, Parameters = ParseParameters(theParameter)
1154 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1155 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1156 anObj.SetParameters(Parameters)
1157 self._autoPublish(anObj, theName, "vertex")
1160 ## Create a point by projection give coordinates on the given curve
1161 # @param theRefCurve The referenced curve.
1162 # @param theX X-coordinate in 3D space
1163 # @param theY Y-coordinate in 3D space
1164 # @param theZ Z-coordinate in 3D space
1165 # @param theName Object name; when specified, this parameter is used
1166 # for result publication in the study. Otherwise, if automatic
1167 # publication is switched on, default value is used for result name.
1169 # @return New GEOM.GEOM_Object, containing the created point.
1171 # @ref tui_creation_point "Example"
1172 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1174 Create a point by projection give coordinates on the given curve
1177 theRefCurve The referenced curve.
1178 theX X-coordinate in 3D space
1179 theY Y-coordinate in 3D space
1180 theZ Z-coordinate in 3D space
1181 theName Object name; when specified, this parameter is used
1182 for result publication in the study. Otherwise, if automatic
1183 publication is switched on, default value is used for result name.
1186 New GEOM.GEOM_Object, containing the created point.
1189 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1191 # Example: see GEOM_TestAll.py
1192 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1193 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1194 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1195 anObj.SetParameters(Parameters)
1196 self._autoPublish(anObj, theName, "vertex")
1199 ## Create a point, corresponding to the given length on the given curve.
1200 # @param theRefCurve The referenced curve.
1201 # @param theLength Length on the referenced curve. It can be negative.
1202 # @param theStartPoint Point allowing to choose the direction for the calculation
1203 # of the length. If None, start from the first point of theRefCurve.
1204 # @param theName Object name; when specified, this parameter is used
1205 # for result publication in the study. Otherwise, if automatic
1206 # publication is switched on, default value is used for result name.
1208 # @return New GEOM.GEOM_Object, containing the created point.
1210 # @ref tui_creation_point "Example"
1211 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1213 Create a point, corresponding to the given length on the given curve.
1216 theRefCurve The referenced curve.
1217 theLength Length on the referenced curve. It can be negative.
1218 theStartPoint Point allowing to choose the direction for the calculation
1219 of the length. If None, start from the first point of theRefCurve.
1220 theName Object name; when specified, this parameter is used
1221 for result publication in the study. Otherwise, if automatic
1222 publication is switched on, default value is used for result name.
1225 New GEOM.GEOM_Object, containing the created point.
1227 # Example: see GEOM_TestAll.py
1228 theLength, Parameters = ParseParameters(theLength)
1229 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1230 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1231 anObj.SetParameters(Parameters)
1232 self._autoPublish(anObj, theName, "vertex")
1235 ## Create a point, corresponding to the given parameters on the
1237 # @param theRefSurf The referenced surface.
1238 # @param theUParameter Value of U-parameter on the referenced surface.
1239 # @param theVParameter Value of V-parameter on the referenced surface.
1240 # @param theName Object name; when specified, this parameter is used
1241 # for result publication in the study. Otherwise, if automatic
1242 # publication is switched on, default value is used for result name.
1244 # @return New GEOM.GEOM_Object, containing the created point.
1246 # @ref swig_MakeVertexOnSurface "Example"
1247 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1249 Create a point, corresponding to the given parameters on the
1253 theRefSurf The referenced surface.
1254 theUParameter Value of U-parameter on the referenced surface.
1255 theVParameter Value of V-parameter on the referenced surface.
1256 theName Object name; when specified, this parameter is used
1257 for result publication in the study. Otherwise, if automatic
1258 publication is switched on, default value is used for result name.
1261 New GEOM.GEOM_Object, containing the created point.
1264 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1266 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1267 # Example: see GEOM_TestAll.py
1268 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1269 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1270 anObj.SetParameters(Parameters);
1271 self._autoPublish(anObj, theName, "vertex")
1274 ## Create a point by projection give coordinates on the given surface
1275 # @param theRefSurf The referenced surface.
1276 # @param theX X-coordinate in 3D space
1277 # @param theY Y-coordinate in 3D space
1278 # @param theZ Z-coordinate in 3D space
1279 # @param theName Object name; when specified, this parameter is used
1280 # for result publication in the study. Otherwise, if automatic
1281 # publication is switched on, default value is used for result name.
1283 # @return New GEOM.GEOM_Object, containing the created point.
1285 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1286 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1288 Create a point by projection give coordinates on the given surface
1291 theRefSurf The referenced surface.
1292 theX X-coordinate in 3D space
1293 theY Y-coordinate in 3D space
1294 theZ Z-coordinate in 3D space
1295 theName Object name; when specified, this parameter is used
1296 for result publication in the study. Otherwise, if automatic
1297 publication is switched on, default value is used for result name.
1300 New GEOM.GEOM_Object, containing the created point.
1303 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1305 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1306 # Example: see GEOM_TestAll.py
1307 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1308 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1309 anObj.SetParameters(Parameters);
1310 self._autoPublish(anObj, theName, "vertex")
1313 ## Create a point, which lays on the given face.
1314 # The point will lay in arbitrary place of the face.
1315 # The only condition on it is a non-zero distance to the face boundary.
1316 # Such point can be used to uniquely identify the face inside any
1317 # shape in case, when the shape does not contain overlapped faces.
1318 # @param theFace The referenced face.
1319 # @param theName Object name; when specified, this parameter is used
1320 # for result publication in the study. Otherwise, if automatic
1321 # publication is switched on, default value is used for result name.
1323 # @return New GEOM.GEOM_Object, containing the created point.
1325 # @ref swig_MakeVertexInsideFace "Example"
1326 def MakeVertexInsideFace (self, theFace, theName=None):
1328 Create a point, which lays on the given face.
1329 The point will lay in arbitrary place of the face.
1330 The only condition on it is a non-zero distance to the face boundary.
1331 Such point can be used to uniquely identify the face inside any
1332 shape in case, when the shape does not contain overlapped faces.
1335 theFace The referenced face.
1336 theName Object name; when specified, this parameter is used
1337 for result publication in the study. Otherwise, if automatic
1338 publication is switched on, default value is used for result name.
1341 New GEOM.GEOM_Object, containing the created point.
1344 p_on_face = geompy.MakeVertexInsideFace(Face)
1346 # Example: see GEOM_TestAll.py
1347 anObj = self.BasicOp.MakePointOnFace(theFace)
1348 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1349 self._autoPublish(anObj, theName, "vertex")
1352 ## Create a point on intersection of two lines.
1353 # @param theRefLine1, theRefLine2 The referenced lines.
1354 # @param theName Object name; when specified, this parameter is used
1355 # for result publication in the study. Otherwise, if automatic
1356 # publication is switched on, default value is used for result name.
1358 # @return New GEOM.GEOM_Object, containing the created point.
1360 # @ref swig_MakeVertexOnLinesIntersection "Example"
1361 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1363 Create a point on intersection of two lines.
1366 theRefLine1, theRefLine2 The referenced lines.
1367 theName Object name; when specified, this parameter is used
1368 for result publication in the study. Otherwise, if automatic
1369 publication is switched on, default value is used for result name.
1372 New GEOM.GEOM_Object, containing the created point.
1374 # Example: see GEOM_TestAll.py
1375 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1376 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1377 self._autoPublish(anObj, theName, "vertex")
1380 ## Create a tangent, corresponding to the given parameter on the given curve.
1381 # @param theRefCurve The referenced curve.
1382 # @param theParameter Value of parameter on the referenced curve.
1383 # @param theName Object name; when specified, this parameter is used
1384 # for result publication in the study. Otherwise, if automatic
1385 # publication is switched on, default value is used for result name.
1387 # @return New GEOM.GEOM_Object, containing the created tangent.
1389 # @ref swig_MakeTangentOnCurve "Example"
1390 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1392 Create a tangent, corresponding to the given parameter on the given curve.
1395 theRefCurve The referenced curve.
1396 theParameter Value of parameter on the referenced curve.
1397 theName Object name; when specified, this parameter is used
1398 for result publication in the study. Otherwise, if automatic
1399 publication is switched on, default value is used for result name.
1402 New GEOM.GEOM_Object, containing the created tangent.
1405 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1407 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1408 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1409 self._autoPublish(anObj, theName, "tangent")
1412 ## Create a tangent plane, corresponding to the given parameter on the given face.
1413 # @param theFace The face for which tangent plane should be built.
1414 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1415 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1416 # @param theTrimSize the size of plane.
1417 # @param theName Object name; when specified, this parameter is used
1418 # for result publication in the study. Otherwise, if automatic
1419 # publication is switched on, default value is used for result name.
1421 # @return New GEOM.GEOM_Object, containing the created tangent.
1423 # @ref swig_MakeTangentPlaneOnFace "Example"
1424 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1426 Create a tangent plane, corresponding to the given parameter on the given face.
1429 theFace The face for which tangent plane should be built.
1430 theParameterV vertical value of the center point (0.0 - 1.0).
1431 theParameterU horisontal value of the center point (0.0 - 1.0).
1432 theTrimSize the size of plane.
1433 theName Object name; when specified, this parameter is used
1434 for result publication in the study. Otherwise, if automatic
1435 publication is switched on, default value is used for result name.
1438 New GEOM.GEOM_Object, containing the created tangent.
1441 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1443 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1444 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1445 self._autoPublish(anObj, theName, "tangent")
1448 ## Create a vector with the given components.
1449 # @param theDX X component of the vector.
1450 # @param theDY Y component of the vector.
1451 # @param theDZ Z component of the vector.
1452 # @param theName Object name; when specified, this parameter is used
1453 # for result publication in the study. Otherwise, if automatic
1454 # publication is switched on, default value is used for result name.
1456 # @return New GEOM.GEOM_Object, containing the created vector.
1458 # @ref tui_creation_vector "Example"
1459 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1461 Create a vector with the given components.
1464 theDX X component of the vector.
1465 theDY Y component of the vector.
1466 theDZ Z component of the vector.
1467 theName Object name; when specified, this parameter is used
1468 for result publication in the study. Otherwise, if automatic
1469 publication is switched on, default value is used for result name.
1472 New GEOM.GEOM_Object, containing the created vector.
1474 # Example: see GEOM_TestAll.py
1475 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1476 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1477 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1478 anObj.SetParameters(Parameters)
1479 self._autoPublish(anObj, theName, "vector")
1482 ## Create a vector between two points.
1483 # @param thePnt1 Start point for the vector.
1484 # @param thePnt2 End point for the vector.
1485 # @param theName Object name; when specified, this parameter is used
1486 # for result publication in the study. Otherwise, if automatic
1487 # publication is switched on, default value is used for result name.
1489 # @return New GEOM.GEOM_Object, containing the created vector.
1491 # @ref tui_creation_vector "Example"
1492 def MakeVector(self, thePnt1, thePnt2, theName=None):
1494 Create a vector between two points.
1497 thePnt1 Start point for the vector.
1498 thePnt2 End point for the vector.
1499 theName Object name; when specified, this parameter is used
1500 for result publication in the study. Otherwise, if automatic
1501 publication is switched on, default value is used for result name.
1504 New GEOM.GEOM_Object, containing the created vector.
1506 # Example: see GEOM_TestAll.py
1507 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1508 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1509 self._autoPublish(anObj, theName, "vector")
1512 ## Create a line, passing through the given point
1513 # and parrallel to the given direction
1514 # @param thePnt Point. The resulting line will pass through it.
1515 # @param theDir Direction. The resulting line will be parallel to it.
1516 # @param theName Object name; when specified, this parameter is used
1517 # for result publication in the study. Otherwise, if automatic
1518 # publication is switched on, default value is used for result name.
1520 # @return New GEOM.GEOM_Object, containing the created line.
1522 # @ref tui_creation_line "Example"
1523 def MakeLine(self, thePnt, theDir, theName=None):
1525 Create a line, passing through the given point
1526 and parrallel to the given direction
1529 thePnt Point. The resulting line will pass through it.
1530 theDir Direction. The resulting line will be parallel to it.
1531 theName Object name; when specified, this parameter is used
1532 for result publication in the study. Otherwise, if automatic
1533 publication is switched on, default value is used for result name.
1536 New GEOM.GEOM_Object, containing the created line.
1538 # Example: see GEOM_TestAll.py
1539 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1540 RaiseIfFailed("MakeLine", self.BasicOp)
1541 self._autoPublish(anObj, theName, "line")
1544 ## Create a line, passing through the given points
1545 # @param thePnt1 First of two points, defining the line.
1546 # @param thePnt2 Second of two points, defining the line.
1547 # @param theName Object name; when specified, this parameter is used
1548 # for result publication in the study. Otherwise, if automatic
1549 # publication is switched on, default value is used for result name.
1551 # @return New GEOM.GEOM_Object, containing the created line.
1553 # @ref tui_creation_line "Example"
1554 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1556 Create a line, passing through the given points
1559 thePnt1 First of two points, defining the line.
1560 thePnt2 Second of two points, defining the line.
1561 theName Object name; when specified, this parameter is used
1562 for result publication in the study. Otherwise, if automatic
1563 publication is switched on, default value is used for result name.
1566 New GEOM.GEOM_Object, containing the created line.
1568 # Example: see GEOM_TestAll.py
1569 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1570 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1571 self._autoPublish(anObj, theName, "line")
1574 ## Create a line on two faces intersection.
1575 # @param theFace1 First of two faces, defining the line.
1576 # @param theFace2 Second of two faces, defining the line.
1577 # @param theName Object name; when specified, this parameter is used
1578 # for result publication in the study. Otherwise, if automatic
1579 # publication is switched on, default value is used for result name.
1581 # @return New GEOM.GEOM_Object, containing the created line.
1583 # @ref swig_MakeLineTwoFaces "Example"
1584 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1586 Create a line on two faces intersection.
1589 theFace1 First of two faces, defining the line.
1590 theFace2 Second of two faces, defining the line.
1591 theName Object name; when specified, this parameter is used
1592 for result publication in the study. Otherwise, if automatic
1593 publication is switched on, default value is used for result name.
1596 New GEOM.GEOM_Object, containing the created line.
1598 # Example: see GEOM_TestAll.py
1599 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1600 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1601 self._autoPublish(anObj, theName, "line")
1604 ## Create a plane, passing through the given point
1605 # and normal to the given vector.
1606 # @param thePnt Point, the plane has to pass through.
1607 # @param theVec Vector, defining the plane normal direction.
1608 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1609 # @param theName Object name; when specified, this parameter is used
1610 # for result publication in the study. Otherwise, if automatic
1611 # publication is switched on, default value is used for result name.
1613 # @return New GEOM.GEOM_Object, containing the created plane.
1615 # @ref tui_creation_plane "Example"
1616 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1618 Create a plane, passing through the given point
1619 and normal to the given vector.
1622 thePnt Point, the plane has to pass through.
1623 theVec Vector, defining the plane normal direction.
1624 theTrimSize Half size of a side of quadrangle face, representing the plane.
1625 theName Object name; when specified, this parameter is used
1626 for result publication in the study. Otherwise, if automatic
1627 publication is switched on, default value is used for result name.
1630 New GEOM.GEOM_Object, containing the created plane.
1632 # Example: see GEOM_TestAll.py
1633 theTrimSize, Parameters = ParseParameters(theTrimSize);
1634 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1635 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1636 anObj.SetParameters(Parameters)
1637 self._autoPublish(anObj, theName, "plane")
1640 ## Create a plane, passing through the three given points
1641 # @param thePnt1 First of three points, defining the plane.
1642 # @param thePnt2 Second of three points, defining the plane.
1643 # @param thePnt3 Fird of three points, defining the plane.
1644 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1645 # @param theName Object name; when specified, this parameter is used
1646 # for result publication in the study. Otherwise, if automatic
1647 # publication is switched on, default value is used for result name.
1649 # @return New GEOM.GEOM_Object, containing the created plane.
1651 # @ref tui_creation_plane "Example"
1652 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1654 Create a plane, passing through the three given points
1657 thePnt1 First of three points, defining the plane.
1658 thePnt2 Second of three points, defining the plane.
1659 thePnt3 Fird of three points, defining the plane.
1660 theTrimSize Half size of a side of quadrangle face, representing the plane.
1661 theName Object name; when specified, this parameter is used
1662 for result publication in the study. Otherwise, if automatic
1663 publication is switched on, default value is used for result name.
1666 New GEOM.GEOM_Object, containing the created plane.
1668 # Example: see GEOM_TestAll.py
1669 theTrimSize, Parameters = ParseParameters(theTrimSize);
1670 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1671 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1672 anObj.SetParameters(Parameters)
1673 self._autoPublish(anObj, theName, "plane")
1676 ## Create a plane, similar to the existing one, but with another size of representing face.
1677 # @param theFace Referenced plane or LCS(Marker).
1678 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1679 # @param theName Object name; when specified, this parameter is used
1680 # for result publication in the study. Otherwise, if automatic
1681 # publication is switched on, default value is used for result name.
1683 # @return New GEOM.GEOM_Object, containing the created plane.
1685 # @ref tui_creation_plane "Example"
1686 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1688 Create a plane, similar to the existing one, but with another size of representing face.
1691 theFace Referenced plane or LCS(Marker).
1692 theTrimSize New half size of a side of quadrangle face, representing the plane.
1693 theName Object name; when specified, this parameter is used
1694 for result publication in the study. Otherwise, if automatic
1695 publication is switched on, default value is used for result name.
1698 New GEOM.GEOM_Object, containing the created plane.
1700 # Example: see GEOM_TestAll.py
1701 theTrimSize, Parameters = ParseParameters(theTrimSize);
1702 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1703 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1704 anObj.SetParameters(Parameters)
1705 self._autoPublish(anObj, theName, "plane")
1708 ## Create a plane, passing through the 2 vectors
1709 # with center in a start point of the first vector.
1710 # @param theVec1 Vector, defining center point and plane direction.
1711 # @param theVec2 Vector, defining the plane normal direction.
1712 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1713 # @param theName Object name; when specified, this parameter is used
1714 # for result publication in the study. Otherwise, if automatic
1715 # publication is switched on, default value is used for result name.
1717 # @return New GEOM.GEOM_Object, containing the created plane.
1719 # @ref tui_creation_plane "Example"
1720 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1722 Create a plane, passing through the 2 vectors
1723 with center in a start point of the first vector.
1726 theVec1 Vector, defining center point and plane direction.
1727 theVec2 Vector, defining the plane normal direction.
1728 theTrimSize Half size of a side of quadrangle face, representing the plane.
1729 theName Object name; when specified, this parameter is used
1730 for result publication in the study. Otherwise, if automatic
1731 publication is switched on, default value is used for result name.
1734 New GEOM.GEOM_Object, containing the created plane.
1736 # Example: see GEOM_TestAll.py
1737 theTrimSize, Parameters = ParseParameters(theTrimSize);
1738 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1739 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1740 anObj.SetParameters(Parameters)
1741 self._autoPublish(anObj, theName, "plane")
1744 ## Create a plane, based on a Local coordinate system.
1745 # @param theLCS coordinate system, defining plane.
1746 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1747 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1748 # @param theName Object name; when specified, this parameter is used
1749 # for result publication in the study. Otherwise, if automatic
1750 # publication is switched on, default value is used for result name.
1752 # @return New GEOM.GEOM_Object, containing the created plane.
1754 # @ref tui_creation_plane "Example"
1755 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1757 Create a plane, based on a Local coordinate system.
1760 theLCS coordinate system, defining plane.
1761 theTrimSize Half size of a side of quadrangle face, representing the plane.
1762 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1763 theName Object name; when specified, this parameter is used
1764 for result publication in the study. Otherwise, if automatic
1765 publication is switched on, default value is used for result name.
1768 New GEOM.GEOM_Object, containing the created plane.
1770 # Example: see GEOM_TestAll.py
1771 theTrimSize, Parameters = ParseParameters(theTrimSize);
1772 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1773 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1774 anObj.SetParameters(Parameters)
1775 self._autoPublish(anObj, theName, "plane")
1778 ## Create a local coordinate system.
1779 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1780 # @param XDX,XDY,XDZ Three components of OX direction
1781 # @param YDX,YDY,YDZ Three components of OY direction
1782 # @param theName Object name; when specified, this parameter is used
1783 # for result publication in the study. Otherwise, if automatic
1784 # publication is switched on, default value is used for result name.
1786 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1788 # @ref swig_MakeMarker "Example"
1789 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1791 Create a local coordinate system.
1794 OX,OY,OZ Three coordinates of coordinate system origin.
1795 XDX,XDY,XDZ Three components of OX direction
1796 YDX,YDY,YDZ Three components of OY direction
1797 theName Object name; when specified, this parameter is used
1798 for result publication in the study. Otherwise, if automatic
1799 publication is switched on, default value is used for result name.
1802 New GEOM.GEOM_Object, containing the created coordinate system.
1804 # Example: see GEOM_TestAll.py
1805 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1806 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1807 RaiseIfFailed("MakeMarker", self.BasicOp)
1808 anObj.SetParameters(Parameters)
1809 self._autoPublish(anObj, theName, "lcs")
1812 ## Create a local coordinate system from shape.
1813 # @param theShape The initial shape to detect the coordinate system.
1814 # @param theName Object name; when specified, this parameter is used
1815 # for result publication in the study. Otherwise, if automatic
1816 # publication is switched on, default value is used for result name.
1818 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1820 # @ref tui_creation_lcs "Example"
1821 def MakeMarkerFromShape(self, theShape, theName=None):
1823 Create a local coordinate system from shape.
1826 theShape The initial shape to detect the coordinate system.
1827 theName Object name; when specified, this parameter is used
1828 for result publication in the study. Otherwise, if automatic
1829 publication is switched on, default value is used for result name.
1832 New GEOM.GEOM_Object, containing the created coordinate system.
1834 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1835 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1836 self._autoPublish(anObj, theName, "lcs")
1839 ## Create a local coordinate system from point and two vectors.
1840 # @param theOrigin Point of coordinate system origin.
1841 # @param theXVec Vector of X direction
1842 # @param theYVec Vector of Y direction
1843 # @param theName Object name; when specified, this parameter is used
1844 # for result publication in the study. Otherwise, if automatic
1845 # publication is switched on, default value is used for result name.
1847 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1849 # @ref tui_creation_lcs "Example"
1850 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1852 Create a local coordinate system from point and two vectors.
1855 theOrigin Point of coordinate system origin.
1856 theXVec Vector of X direction
1857 theYVec Vector of Y direction
1858 theName Object name; when specified, this parameter is used
1859 for result publication in the study. Otherwise, if automatic
1860 publication is switched on, default value is used for result name.
1863 New GEOM.GEOM_Object, containing the created coordinate system.
1866 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1867 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1868 self._autoPublish(anObj, theName, "lcs")
1871 # end of l3_basic_go
1874 ## @addtogroup l4_curves
1877 ## Create an arc of circle, passing through three given points.
1878 # @param thePnt1 Start point of the arc.
1879 # @param thePnt2 Middle point of the arc.
1880 # @param thePnt3 End point of the arc.
1881 # @param theName Object name; when specified, this parameter is used
1882 # for result publication in the study. Otherwise, if automatic
1883 # publication is switched on, default value is used for result name.
1885 # @return New GEOM.GEOM_Object, containing the created arc.
1887 # @ref swig_MakeArc "Example"
1888 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1890 Create an arc of circle, passing through three given points.
1893 thePnt1 Start point of the arc.
1894 thePnt2 Middle point of the arc.
1895 thePnt3 End point of the arc.
1896 theName Object name; when specified, this parameter is used
1897 for result publication in the study. Otherwise, if automatic
1898 publication is switched on, default value is used for result name.
1901 New GEOM.GEOM_Object, containing the created arc.
1903 # Example: see GEOM_TestAll.py
1904 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1905 RaiseIfFailed("MakeArc", self.CurvesOp)
1906 self._autoPublish(anObj, theName, "arc")
1909 ## Create an arc of circle from a center and 2 points.
1910 # @param thePnt1 Center of the arc
1911 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1912 # @param thePnt3 End point of the arc (Gives also a direction)
1913 # @param theSense Orientation of the arc
1914 # @param theName Object name; when specified, this parameter is used
1915 # for result publication in the study. Otherwise, if automatic
1916 # publication is switched on, default value is used for result name.
1918 # @return New GEOM.GEOM_Object, containing the created arc.
1920 # @ref swig_MakeArc "Example"
1921 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1923 Create an arc of circle from a center and 2 points.
1926 thePnt1 Center of the arc
1927 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1928 thePnt3 End point of the arc (Gives also a direction)
1929 theSense Orientation of the arc
1930 theName Object name; when specified, this parameter is used
1931 for result publication in the study. Otherwise, if automatic
1932 publication is switched on, default value is used for result name.
1935 New GEOM.GEOM_Object, containing the created arc.
1937 # Example: see GEOM_TestAll.py
1938 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1939 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1940 self._autoPublish(anObj, theName, "arc")
1943 ## Create an arc of ellipse, of center and two points.
1944 # @param theCenter Center of the arc.
1945 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1946 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1947 # @param theName Object name; when specified, this parameter is used
1948 # for result publication in the study. Otherwise, if automatic
1949 # publication is switched on, default value is used for result name.
1951 # @return New GEOM.GEOM_Object, containing the created arc.
1953 # @ref swig_MakeArc "Example"
1954 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1956 Create an arc of ellipse, of center and two points.
1959 theCenter Center of the arc.
1960 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1961 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1962 theName Object name; when specified, this parameter is used
1963 for result publication in the study. Otherwise, if automatic
1964 publication is switched on, default value is used for result name.
1967 New GEOM.GEOM_Object, containing the created arc.
1969 # Example: see GEOM_TestAll.py
1970 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1971 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1972 self._autoPublish(anObj, theName, "arc")
1975 ## Create a circle with given center, normal vector and radius.
1976 # @param thePnt Circle center.
1977 # @param theVec Vector, normal to the plane of the circle.
1978 # @param theR Circle radius.
1979 # @param theName Object name; when specified, this parameter is used
1980 # for result publication in the study. Otherwise, if automatic
1981 # publication is switched on, default value is used for result name.
1983 # @return New GEOM.GEOM_Object, containing the created circle.
1985 # @ref tui_creation_circle "Example"
1986 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1988 Create a circle with given center, normal vector and radius.
1991 thePnt Circle center.
1992 theVec Vector, normal to the plane of the circle.
1994 theName Object name; when specified, this parameter is used
1995 for result publication in the study. Otherwise, if automatic
1996 publication is switched on, default value is used for result name.
1999 New GEOM.GEOM_Object, containing the created circle.
2001 # Example: see GEOM_TestAll.py
2002 theR, Parameters = ParseParameters(theR)
2003 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2004 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2005 anObj.SetParameters(Parameters)
2006 self._autoPublish(anObj, theName, "circle")
2009 ## Create a circle with given radius.
2010 # Center of the circle will be in the origin of global
2011 # coordinate system and normal vector will be codirected with Z axis
2012 # @param theR Circle radius.
2013 # @param theName Object name; when specified, this parameter is used
2014 # for result publication in the study. Otherwise, if automatic
2015 # publication is switched on, default value is used for result name.
2017 # @return New GEOM.GEOM_Object, containing the created circle.
2018 def MakeCircleR(self, theR, theName=None):
2020 Create a circle with given radius.
2021 Center of the circle will be in the origin of global
2022 coordinate system and normal vector will be codirected with Z axis
2026 theName Object name; when specified, this parameter is used
2027 for result publication in the study. Otherwise, if automatic
2028 publication is switched on, default value is used for result name.
2031 New GEOM.GEOM_Object, containing the created circle.
2033 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2034 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2035 self._autoPublish(anObj, theName, "circle")
2038 ## Create a circle, passing through three given points
2039 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2040 # @param theName Object name; when specified, this parameter is used
2041 # for result publication in the study. Otherwise, if automatic
2042 # publication is switched on, default value is used for result name.
2044 # @return New GEOM.GEOM_Object, containing the created circle.
2046 # @ref tui_creation_circle "Example"
2047 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2049 Create a circle, passing through three given points
2052 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2053 theName Object name; when specified, this parameter is used
2054 for result publication in the study. Otherwise, if automatic
2055 publication is switched on, default value is used for result name.
2058 New GEOM.GEOM_Object, containing the created circle.
2060 # Example: see GEOM_TestAll.py
2061 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2062 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2063 self._autoPublish(anObj, theName, "circle")
2066 ## Create a circle, with given point1 as center,
2067 # passing through the point2 as radius and laying in the plane,
2068 # defined by all three given points.
2069 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2070 # @param theName Object name; when specified, this parameter is used
2071 # for result publication in the study. Otherwise, if automatic
2072 # publication is switched on, default value is used for result name.
2074 # @return New GEOM.GEOM_Object, containing the created circle.
2076 # @ref swig_MakeCircle "Example"
2077 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2079 Create a circle, with given point1 as center,
2080 passing through the point2 as radius and laying in the plane,
2081 defined by all three given points.
2084 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2085 theName Object name; when specified, this parameter is used
2086 for result publication in the study. Otherwise, if automatic
2087 publication is switched on, default value is used for result name.
2090 New GEOM.GEOM_Object, containing the created circle.
2092 # Example: see GEOM_example6.py
2093 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2094 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2095 self._autoPublish(anObj, theName, "circle")
2098 ## Create an ellipse with given center, normal vector and radiuses.
2099 # @param thePnt Ellipse center.
2100 # @param theVec Vector, normal to the plane of the ellipse.
2101 # @param theRMajor Major ellipse radius.
2102 # @param theRMinor Minor ellipse radius.
2103 # @param theVecMaj Vector, direction of the ellipse's main axis.
2104 # @param theName Object name; when specified, this parameter is used
2105 # for result publication in the study. Otherwise, if automatic
2106 # publication is switched on, default value is used for result name.
2108 # @return New GEOM.GEOM_Object, containing the created ellipse.
2110 # @ref tui_creation_ellipse "Example"
2111 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2113 Create an ellipse with given center, normal vector and radiuses.
2116 thePnt Ellipse center.
2117 theVec Vector, normal to the plane of the ellipse.
2118 theRMajor Major ellipse radius.
2119 theRMinor Minor ellipse radius.
2120 theVecMaj Vector, direction of the ellipse's main axis.
2121 theName Object name; when specified, this parameter is used
2122 for result publication in the study. Otherwise, if automatic
2123 publication is switched on, default value is used for result name.
2126 New GEOM.GEOM_Object, containing the created ellipse.
2128 # Example: see GEOM_TestAll.py
2129 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2130 if theVecMaj is not None:
2131 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2133 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2135 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2136 anObj.SetParameters(Parameters)
2137 self._autoPublish(anObj, theName, "ellipse")
2140 ## Create an ellipse with given radiuses.
2141 # Center of the ellipse will be in the origin of global
2142 # coordinate system and normal vector will be codirected with Z axis
2143 # @param theRMajor Major ellipse radius.
2144 # @param theRMinor Minor ellipse radius.
2145 # @param theName Object name; when specified, this parameter is used
2146 # for result publication in the study. Otherwise, if automatic
2147 # publication is switched on, default value is used for result name.
2149 # @return New GEOM.GEOM_Object, containing the created ellipse.
2150 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2152 Create an ellipse with given radiuses.
2153 Center of the ellipse will be in the origin of global
2154 coordinate system and normal vector will be codirected with Z axis
2157 theRMajor Major ellipse radius.
2158 theRMinor Minor ellipse radius.
2159 theName Object name; when specified, this parameter is used
2160 for result publication in the study. Otherwise, if automatic
2161 publication is switched on, default value is used for result name.
2164 New GEOM.GEOM_Object, containing the created ellipse.
2166 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2167 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2168 self._autoPublish(anObj, theName, "ellipse")
2171 ## Create a polyline on the set of points.
2172 # @param thePoints Sequence of points for the polyline.
2173 # @param theIsClosed If True, build a closed wire.
2174 # @param theName Object name; when specified, this parameter is used
2175 # for result publication in the study. Otherwise, if automatic
2176 # publication is switched on, default value is used for result name.
2178 # @return New GEOM.GEOM_Object, containing the created polyline.
2180 # @ref tui_creation_curve "Example"
2181 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2183 Create a polyline on the set of points.
2186 thePoints Sequence of points for the polyline.
2187 theIsClosed If True, build a closed wire.
2188 theName Object name; when specified, this parameter is used
2189 for result publication in the study. Otherwise, if automatic
2190 publication is switched on, default value is used for result name.
2193 New GEOM.GEOM_Object, containing the created polyline.
2195 # Example: see GEOM_TestAll.py
2196 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2197 RaiseIfFailed("MakePolyline", self.CurvesOp)
2198 self._autoPublish(anObj, theName, "polyline")
2201 ## Create bezier curve on the set of points.
2202 # @param thePoints Sequence of points for the bezier curve.
2203 # @param theIsClosed If True, build a closed curve.
2204 # @param theName Object name; when specified, this parameter is used
2205 # for result publication in the study. Otherwise, if automatic
2206 # publication is switched on, default value is used for result name.
2208 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2210 # @ref tui_creation_curve "Example"
2211 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2213 Create bezier curve on the set of points.
2216 thePoints Sequence of points for the bezier curve.
2217 theIsClosed If True, build a closed curve.
2218 theName Object name; when specified, this parameter is used
2219 for result publication in the study. Otherwise, if automatic
2220 publication is switched on, default value is used for result name.
2223 New GEOM.GEOM_Object, containing the created bezier curve.
2225 # Example: see GEOM_TestAll.py
2226 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2227 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2228 self._autoPublish(anObj, theName, "bezier")
2231 ## Create B-Spline curve on the set of points.
2232 # @param thePoints Sequence of points for the B-Spline curve.
2233 # @param theIsClosed If True, build a closed curve.
2234 # @param theDoReordering If TRUE, the algo does not follow the order of
2235 # \a thePoints but searches for the closest vertex.
2236 # @param theName Object name; when specified, this parameter is used
2237 # for result publication in the study. Otherwise, if automatic
2238 # publication is switched on, default value is used for result name.
2240 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2242 # @ref tui_creation_curve "Example"
2243 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2245 Create B-Spline curve on the set of points.
2248 thePoints Sequence of points for the B-Spline curve.
2249 theIsClosed If True, build a closed curve.
2250 theDoReordering If True, the algo does not follow the order of
2251 thePoints but searches for the closest vertex.
2252 theName Object name; when specified, this parameter is used
2253 for result publication in the study. Otherwise, if automatic
2254 publication is switched on, default value is used for result name.
2257 New GEOM.GEOM_Object, containing the created B-Spline curve.
2259 # Example: see GEOM_TestAll.py
2260 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2261 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2262 self._autoPublish(anObj, theName, "bspline")
2265 ## Create B-Spline curve on the set of points.
2266 # @param thePoints Sequence of points for the B-Spline curve.
2267 # @param theFirstVec Vector object, defining the curve direction at its first point.
2268 # @param theLastVec Vector object, defining the curve direction at its last point.
2269 # @param theName Object name; when specified, this parameter is used
2270 # for result publication in the study. Otherwise, if automatic
2271 # publication is switched on, default value is used for result name.
2273 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2275 # @ref tui_creation_curve "Example"
2276 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2278 Create B-Spline curve on the set of points.
2281 thePoints Sequence of points for the B-Spline curve.
2282 theFirstVec Vector object, defining the curve direction at its first point.
2283 theLastVec Vector object, defining the curve direction at its last point.
2284 theName Object name; when specified, this parameter is used
2285 for result publication in the study. Otherwise, if automatic
2286 publication is switched on, default value is used for result name.
2289 New GEOM.GEOM_Object, containing the created B-Spline curve.
2291 # Example: see GEOM_TestAll.py
2292 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2293 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2294 self._autoPublish(anObj, theName, "bspline")
2297 ## Creates a curve using the parametric definition of the basic points.
2298 # @param thexExpr parametric equation of the coordinates X.
2299 # @param theyExpr parametric equation of the coordinates Y.
2300 # @param thezExpr parametric equation of the coordinates Z.
2301 # @param theParamMin the minimal value of the parameter.
2302 # @param theParamMax the maximum value of the parameter.
2303 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2304 # @param theCurveType the type of the curve,
2305 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2306 # @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.
2307 # @param theName Object name; when specified, this parameter is used
2308 # for result publication in the study. Otherwise, if automatic
2309 # publication is switched on, default value is used for result name.
2311 # @return New GEOM.GEOM_Object, containing the created curve.
2313 # @ref tui_creation_curve "Example"
2314 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2315 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2317 Creates a curve using the parametric definition of the basic points.
2320 thexExpr parametric equation of the coordinates X.
2321 theyExpr parametric equation of the coordinates Y.
2322 thezExpr parametric equation of the coordinates Z.
2323 theParamMin the minimal value of the parameter.
2324 theParamMax the maximum value of the parameter.
2325 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2326 theCurveType the type of the curve,
2327 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2328 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2329 method is used which can lead to a bug.
2330 theName Object name; when specified, this parameter is used
2331 for result publication in the study. Otherwise, if automatic
2332 publication is switched on, default value is used for result name.
2335 New GEOM.GEOM_Object, containing the created curve.
2337 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2339 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2341 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2342 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2343 anObj.SetParameters(Parameters)
2344 self._autoPublish(anObj, theName, "curve")
2347 ## Create an isoline curve on a face.
2348 # @param theFace the face for which an isoline is created.
2349 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2351 # @param theParameter the U parameter for U-isoline or V parameter
2353 # @param theName Object name; when specified, this parameter is used
2354 # for result publication in the study. Otherwise, if automatic
2355 # publication is switched on, default value is used for result name.
2357 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2358 # a compound of edges.
2360 # @ref tui_creation_curve "Example"
2361 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2363 Create an isoline curve on a face.
2366 theFace the face for which an isoline is created.
2367 IsUIsoline True for U-isoline creation; False for V-isoline
2369 theParameter the U parameter for U-isoline or V parameter
2371 theName Object name; when specified, this parameter is used
2372 for result publication in the study. Otherwise, if automatic
2373 publication is switched on, default value is used for result name.
2376 New GEOM.GEOM_Object, containing the created isoline edge or a
2379 # Example: see GEOM_TestAll.py
2380 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2381 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2383 self._autoPublish(anObj, theName, "U-Isoline")
2385 self._autoPublish(anObj, theName, "V-Isoline")
2391 ## @addtogroup l3_sketcher
2394 ## Create a sketcher (wire or face), following the textual description,
2395 # passed through <VAR>theCommand</VAR> argument. \n
2396 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2397 # Format of the description string have to be the following:
2399 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2402 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2404 # - "R angle" : Set the direction by angle
2405 # - "D dx dy" : Set the direction by DX & DY
2408 # - "TT x y" : Create segment by point at X & Y
2409 # - "T dx dy" : Create segment by point with DX & DY
2410 # - "L length" : Create segment by direction & Length
2411 # - "IX x" : Create segment by direction & Intersect. X
2412 # - "IY y" : Create segment by direction & Intersect. Y
2415 # - "C radius length" : Create arc by direction, radius and length(in degree)
2416 # - "AA x y": Create arc by point at X & Y
2417 # - "A dx dy" : Create arc by point with DX & DY
2418 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2419 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2420 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2421 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2424 # - "WW" : Close Wire (to finish)
2425 # - "WF" : Close Wire and build face (to finish)
2428 # - Flag1 (= reverse) is 0 or 2 ...
2429 # - if 0 the drawn arc is the one of lower angle (< Pi)
2430 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2433 # - Flag2 (= control tolerance) is 0 or 1 ...
2434 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2435 # - if 1 the wire is built only if the end point is on the arc
2436 # with a tolerance of 10^-7 on the distance else the creation fails
2438 # @param theCommand String, defining the sketcher in local
2439 # coordinates of the working plane.
2440 # @param theWorkingPlane Nine double values, defining origin,
2441 # OZ and OX directions of the working plane.
2442 # @param theName Object name; when specified, this parameter is used
2443 # for result publication in the study. Otherwise, if automatic
2444 # publication is switched on, default value is used for result name.
2446 # @return New GEOM.GEOM_Object, containing the created wire.
2448 # @ref tui_sketcher_page "Example"
2449 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2451 Create a sketcher (wire or face), following the textual description, passed
2452 through theCommand argument.
2453 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2454 Format of the description string have to be the following:
2455 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2457 - x1, y1 are coordinates of the first sketcher point (zero by default),
2459 - "R angle" : Set the direction by angle
2460 - "D dx dy" : Set the direction by DX & DY
2462 - "TT x y" : Create segment by point at X & Y
2463 - "T dx dy" : Create segment by point with DX & DY
2464 - "L length" : Create segment by direction & Length
2465 - "IX x" : Create segment by direction & Intersect. X
2466 - "IY y" : Create segment by direction & Intersect. Y
2468 - "C radius length" : Create arc by direction, radius and length(in degree)
2469 - "AA x y": Create arc by point at X & Y
2470 - "A dx dy" : Create arc by point with DX & DY
2471 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2472 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2473 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2474 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2476 - "WW" : Close Wire (to finish)
2477 - "WF" : Close Wire and build face (to finish)
2479 - Flag1 (= reverse) is 0 or 2 ...
2480 - if 0 the drawn arc is the one of lower angle (< Pi)
2481 - if 2 the drawn arc ius the one of greater angle (> Pi)
2483 - Flag2 (= control tolerance) is 0 or 1 ...
2484 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2485 - if 1 the wire is built only if the end point is on the arc
2486 with a tolerance of 10^-7 on the distance else the creation fails
2489 theCommand String, defining the sketcher in local
2490 coordinates of the working plane.
2491 theWorkingPlane Nine double values, defining origin,
2492 OZ and OX directions of the working plane.
2493 theName Object name; when specified, this parameter is used
2494 for result publication in the study. Otherwise, if automatic
2495 publication is switched on, default value is used for result name.
2498 New GEOM.GEOM_Object, containing the created wire.
2500 # Example: see GEOM_TestAll.py
2501 theCommand,Parameters = ParseSketcherCommand(theCommand)
2502 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2503 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2504 anObj.SetParameters(Parameters)
2505 self._autoPublish(anObj, theName, "wire")
2508 ## Create a sketcher (wire or face), following the textual description,
2509 # passed through <VAR>theCommand</VAR> argument. \n
2510 # For format of the description string see MakeSketcher() method.\n
2511 # @param theCommand String, defining the sketcher in local
2512 # coordinates of the working plane.
2513 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2514 # @param theName Object name; when specified, this parameter is used
2515 # for result publication in the study. Otherwise, if automatic
2516 # publication is switched on, default value is used for result name.
2518 # @return New GEOM.GEOM_Object, containing the created wire.
2520 # @ref tui_sketcher_page "Example"
2521 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2523 Create a sketcher (wire or face), following the textual description,
2524 passed through theCommand argument.
2525 For format of the description string see geompy.MakeSketcher() method.
2528 theCommand String, defining the sketcher in local
2529 coordinates of the working plane.
2530 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2531 theName Object name; when specified, this parameter is used
2532 for result publication in the study. Otherwise, if automatic
2533 publication is switched on, default value is used for result name.
2536 New GEOM.GEOM_Object, containing the created wire.
2538 theCommand,Parameters = ParseSketcherCommand(theCommand)
2539 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2540 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2541 anObj.SetParameters(Parameters)
2542 self._autoPublish(anObj, theName, "wire")
2545 ## Obtain a 2D sketcher interface
2546 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2547 def Sketcher2D (self):
2549 Obtain a 2D sketcher interface.
2552 sk = geompy.Sketcher2D()
2554 sk.addSegmentRelative(15, 70)
2555 sk.addSegmentPerpY(50)
2556 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2557 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2558 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2560 Sketch_1 = sk.wire(geomObj_1)
2562 sk = Sketcher2D (self)
2565 ## Create a sketcher wire, following the numerical description,
2566 # passed through <VAR>theCoordinates</VAR> argument. \n
2567 # @param theCoordinates double values, defining points to create a wire,
2569 # @param theName Object name; when specified, this parameter is used
2570 # for result publication in the study. Otherwise, if automatic
2571 # publication is switched on, default value is used for result name.
2573 # @return New GEOM.GEOM_Object, containing the created wire.
2575 # @ref tui_3dsketcher_page "Example"
2576 def Make3DSketcher(self, theCoordinates, theName=None):
2578 Create a sketcher wire, following the numerical description,
2579 passed through theCoordinates argument.
2582 theCoordinates double values, defining points to create a wire,
2584 theName Object name; when specified, this parameter is used
2585 for result publication in the study. Otherwise, if automatic
2586 publication is switched on, default value is used for result name.
2589 New GEOM_Object, containing the created wire.
2591 theCoordinates,Parameters = ParseParameters(theCoordinates)
2592 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2593 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2594 anObj.SetParameters(Parameters)
2595 self._autoPublish(anObj, theName, "wire")
2598 ## Obtain a 3D sketcher interface
2599 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2601 # @ref tui_3dsketcher_page "Example"
2602 def Sketcher3D (self):
2604 Obtain a 3D sketcher interface.
2607 sk = geompy.Sketcher3D()
2608 sk.addPointsAbsolute(0,0,0, 70,0,0)
2609 sk.addPointsRelative(0, 0, 130)
2610 sk.addPointAnglesLength("OXY", 50, 0, 100)
2611 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2613 a3D_Sketcher_1 = sk.wire()
2615 sk = Sketcher3D (self)
2618 # end of l3_sketcher
2621 ## @addtogroup l3_3d_primitives
2624 ## Create a box by coordinates of two opposite vertices.
2626 # @param x1,y1,z1 double values, defining first point it.
2627 # @param x2,y2,z2 double values, defining first point it.
2628 # @param theName Object name; when specified, this parameter is used
2629 # for result publication in the study. Otherwise, if automatic
2630 # publication is switched on, default value is used for result name.
2632 # @return New GEOM.GEOM_Object, containing the created box.
2634 # @ref tui_creation_box "Example"
2635 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2637 Create a box by coordinates of two opposite vertices.
2640 x1,y1,z1 double values, defining first point.
2641 x2,y2,z2 double values, defining second point.
2642 theName Object name; when specified, this parameter is used
2643 for result publication in the study. Otherwise, if automatic
2644 publication is switched on, default value is used for result name.
2647 New GEOM.GEOM_Object, containing the created box.
2649 # Example: see GEOM_TestAll.py
2650 pnt1 = self.MakeVertex(x1,y1,z1)
2651 pnt2 = self.MakeVertex(x2,y2,z2)
2652 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2653 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2655 ## Create a box with specified dimensions along the coordinate axes
2656 # and with edges, parallel to the coordinate axes.
2657 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2658 # @param theDX Length of Box edges, parallel to OX axis.
2659 # @param theDY Length of Box edges, parallel to OY axis.
2660 # @param theDZ Length of Box edges, parallel to OZ axis.
2661 # @param theName Object name; when specified, this parameter is used
2662 # for result publication in the study. Otherwise, if automatic
2663 # publication is switched on, default value is used for result name.
2665 # @return New GEOM.GEOM_Object, containing the created box.
2667 # @ref tui_creation_box "Example"
2668 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2670 Create a box with specified dimensions along the coordinate axes
2671 and with edges, parallel to the coordinate axes.
2672 Center of the box will be at point (DX/2, DY/2, DZ/2).
2675 theDX Length of Box edges, parallel to OX axis.
2676 theDY Length of Box edges, parallel to OY axis.
2677 theDZ Length of Box edges, parallel to OZ axis.
2678 theName Object name; when specified, this parameter is used
2679 for result publication in the study. Otherwise, if automatic
2680 publication is switched on, default value is used for result name.
2683 New GEOM.GEOM_Object, containing the created box.
2685 # Example: see GEOM_TestAll.py
2686 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2687 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2688 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2689 anObj.SetParameters(Parameters)
2690 self._autoPublish(anObj, theName, "box")
2693 ## Create a box with two specified opposite vertices,
2694 # and with edges, parallel to the coordinate axes
2695 # @param thePnt1 First of two opposite vertices.
2696 # @param thePnt2 Second of two opposite vertices.
2697 # @param theName Object name; when specified, this parameter is used
2698 # for result publication in the study. Otherwise, if automatic
2699 # publication is switched on, default value is used for result name.
2701 # @return New GEOM.GEOM_Object, containing the created box.
2703 # @ref tui_creation_box "Example"
2704 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2706 Create a box with two specified opposite vertices,
2707 and with edges, parallel to the coordinate axes
2710 thePnt1 First of two opposite vertices.
2711 thePnt2 Second of two opposite vertices.
2712 theName Object name; when specified, this parameter is used
2713 for result publication in the study. Otherwise, if automatic
2714 publication is switched on, default value is used for result name.
2717 New GEOM.GEOM_Object, containing the created box.
2719 # Example: see GEOM_TestAll.py
2720 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2721 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2722 self._autoPublish(anObj, theName, "box")
2725 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2726 # @param theH height of Face.
2727 # @param theW width of Face.
2728 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2729 # @param theName Object name; when specified, this parameter is used
2730 # for result publication in the study. Otherwise, if automatic
2731 # publication is switched on, default value is used for result name.
2733 # @return New GEOM.GEOM_Object, containing the created face.
2735 # @ref tui_creation_face "Example"
2736 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2738 Create a face with specified dimensions with edges parallel to coordinate axes.
2741 theH height of Face.
2743 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2744 theName Object name; when specified, this parameter is used
2745 for result publication in the study. Otherwise, if automatic
2746 publication is switched on, default value is used for result name.
2749 New GEOM.GEOM_Object, containing the created face.
2751 # Example: see GEOM_TestAll.py
2752 theH,theW,Parameters = ParseParameters(theH, theW)
2753 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2754 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2755 anObj.SetParameters(Parameters)
2756 self._autoPublish(anObj, theName, "rectangle")
2759 ## Create a face from another plane and two sizes,
2760 # vertical size and horisontal size.
2761 # @param theObj Normale vector to the creating face or
2763 # @param theH Height (vertical size).
2764 # @param theW Width (horisontal size).
2765 # @param theName Object name; when specified, this parameter is used
2766 # for result publication in the study. Otherwise, if automatic
2767 # publication is switched on, default value is used for result name.
2769 # @return New GEOM.GEOM_Object, containing the created face.
2771 # @ref tui_creation_face "Example"
2772 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2774 Create a face from another plane and two sizes,
2775 vertical size and horisontal size.
2778 theObj Normale vector to the creating face or
2780 theH Height (vertical size).
2781 theW Width (horisontal size).
2782 theName Object name; when specified, this parameter is used
2783 for result publication in the study. Otherwise, if automatic
2784 publication is switched on, default value is used for result name.
2787 New GEOM_Object, containing the created face.
2789 # Example: see GEOM_TestAll.py
2790 theH,theW,Parameters = ParseParameters(theH, theW)
2791 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2792 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2793 anObj.SetParameters(Parameters)
2794 self._autoPublish(anObj, theName, "rectangle")
2797 ## Create a disk with given center, normal vector and radius.
2798 # @param thePnt Disk center.
2799 # @param theVec Vector, normal to the plane of the disk.
2800 # @param theR Disk radius.
2801 # @param theName Object name; when specified, this parameter is used
2802 # for result publication in the study. Otherwise, if automatic
2803 # publication is switched on, default value is used for result name.
2805 # @return New GEOM.GEOM_Object, containing the created disk.
2807 # @ref tui_creation_disk "Example"
2808 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2810 Create a disk with given center, normal vector and radius.
2814 theVec Vector, normal to the plane of the disk.
2816 theName Object name; when specified, this parameter is used
2817 for result publication in the study. Otherwise, if automatic
2818 publication is switched on, default value is used for result name.
2821 New GEOM.GEOM_Object, containing the created disk.
2823 # Example: see GEOM_TestAll.py
2824 theR,Parameters = ParseParameters(theR)
2825 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2826 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2827 anObj.SetParameters(Parameters)
2828 self._autoPublish(anObj, theName, "disk")
2831 ## Create a disk, passing through three given points
2832 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2833 # @param theName Object name; when specified, this parameter is used
2834 # for result publication in the study. Otherwise, if automatic
2835 # publication is switched on, default value is used for result name.
2837 # @return New GEOM.GEOM_Object, containing the created disk.
2839 # @ref tui_creation_disk "Example"
2840 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2842 Create a disk, passing through three given points
2845 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2846 theName Object name; when specified, this parameter is used
2847 for result publication in the study. Otherwise, if automatic
2848 publication is switched on, default value is used for result name.
2851 New GEOM.GEOM_Object, containing the created disk.
2853 # Example: see GEOM_TestAll.py
2854 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2855 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2856 self._autoPublish(anObj, theName, "disk")
2859 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2860 # @param theR Radius of Face.
2861 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2862 # @param theName Object name; when specified, this parameter is used
2863 # for result publication in the study. Otherwise, if automatic
2864 # publication is switched on, default value is used for result name.
2866 # @return New GEOM.GEOM_Object, containing the created disk.
2868 # @ref tui_creation_face "Example"
2869 def MakeDiskR(self, theR, theOrientation, theName=None):
2871 Create a disk with specified dimensions along OX-OY coordinate axes.
2874 theR Radius of Face.
2875 theOrientation set the orientation belong axis OXY or OYZ or OZX
2876 theName Object name; when specified, this parameter is used
2877 for result publication in the study. Otherwise, if automatic
2878 publication is switched on, default value is used for result name.
2881 New GEOM.GEOM_Object, containing the created disk.
2884 Disk3 = geompy.MakeDiskR(100., 1)
2886 # Example: see GEOM_TestAll.py
2887 theR,Parameters = ParseParameters(theR)
2888 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2889 RaiseIfFailed("MakeDiskR", self.PrimOp)
2890 anObj.SetParameters(Parameters)
2891 self._autoPublish(anObj, theName, "disk")
2894 ## Create a cylinder with given base point, axis, radius and height.
2895 # @param thePnt Central point of cylinder base.
2896 # @param theAxis Cylinder axis.
2897 # @param theR Cylinder radius.
2898 # @param theH Cylinder height.
2899 # @param theName Object name; when specified, this parameter is used
2900 # for result publication in the study. Otherwise, if automatic
2901 # publication is switched on, default value is used for result name.
2903 # @return New GEOM.GEOM_Object, containing the created cylinder.
2905 # @ref tui_creation_cylinder "Example"
2906 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2908 Create a cylinder with given base point, axis, radius and height.
2911 thePnt Central point of cylinder base.
2912 theAxis Cylinder axis.
2913 theR Cylinder radius.
2914 theH Cylinder height.
2915 theName Object name; when specified, this parameter is used
2916 for result publication in the study. Otherwise, if automatic
2917 publication is switched on, default value is used for result name.
2920 New GEOM.GEOM_Object, containing the created cylinder.
2922 # Example: see GEOM_TestAll.py
2923 theR,theH,Parameters = ParseParameters(theR, theH)
2924 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2925 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2926 anObj.SetParameters(Parameters)
2927 self._autoPublish(anObj, theName, "cylinder")
2930 ## Create a cylinder with given radius and height at
2931 # the origin of coordinate system. Axis of the cylinder
2932 # will be collinear to the OZ axis of the coordinate system.
2933 # @param theR Cylinder radius.
2934 # @param theH Cylinder height.
2935 # @param theName Object name; when specified, this parameter is used
2936 # for result publication in the study. Otherwise, if automatic
2937 # publication is switched on, default value is used for result name.
2939 # @return New GEOM.GEOM_Object, containing the created cylinder.
2941 # @ref tui_creation_cylinder "Example"
2942 def MakeCylinderRH(self, theR, theH, theName=None):
2944 Create a cylinder with given radius and height at
2945 the origin of coordinate system. Axis of the cylinder
2946 will be collinear to the OZ axis of the coordinate system.
2949 theR Cylinder radius.
2950 theH Cylinder height.
2951 theName Object name; when specified, this parameter is used
2952 for result publication in the study. Otherwise, if automatic
2953 publication is switched on, default value is used for result name.
2956 New GEOM.GEOM_Object, containing the created cylinder.
2958 # Example: see GEOM_TestAll.py
2959 theR,theH,Parameters = ParseParameters(theR, theH)
2960 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2961 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2962 anObj.SetParameters(Parameters)
2963 self._autoPublish(anObj, theName, "cylinder")
2966 ## Create a sphere with given center and radius.
2967 # @param thePnt Sphere center.
2968 # @param theR Sphere radius.
2969 # @param theName Object name; when specified, this parameter is used
2970 # for result publication in the study. Otherwise, if automatic
2971 # publication is switched on, default value is used for result name.
2973 # @return New GEOM.GEOM_Object, containing the created sphere.
2975 # @ref tui_creation_sphere "Example"
2976 def MakeSpherePntR(self, thePnt, theR, theName=None):
2978 Create a sphere with given center and radius.
2981 thePnt Sphere center.
2983 theName Object name; when specified, this parameter is used
2984 for result publication in the study. Otherwise, if automatic
2985 publication is switched on, default value is used for result name.
2988 New GEOM.GEOM_Object, containing the created sphere.
2990 # Example: see GEOM_TestAll.py
2991 theR,Parameters = ParseParameters(theR)
2992 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2993 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2994 anObj.SetParameters(Parameters)
2995 self._autoPublish(anObj, theName, "sphere")
2998 ## Create a sphere with given center and radius.
2999 # @param x,y,z Coordinates of sphere center.
3000 # @param theR Sphere radius.
3001 # @param theName Object name; when specified, this parameter is used
3002 # for result publication in the study. Otherwise, if automatic
3003 # publication is switched on, default value is used for result name.
3005 # @return New GEOM.GEOM_Object, containing the created sphere.
3007 # @ref tui_creation_sphere "Example"
3008 def MakeSphere(self, x, y, z, theR, theName=None):
3010 Create a sphere with given center and radius.
3013 x,y,z Coordinates of sphere center.
3015 theName Object name; when specified, this parameter is used
3016 for result publication in the study. Otherwise, if automatic
3017 publication is switched on, default value is used for result name.
3020 New GEOM.GEOM_Object, containing the created sphere.
3022 # Example: see GEOM_TestAll.py
3023 point = self.MakeVertex(x, y, z)
3024 # note: auto-publishing is done in self.MakeSpherePntR()
3025 anObj = self.MakeSpherePntR(point, theR, theName)
3028 ## Create a sphere with given radius at the origin of coordinate system.
3029 # @param theR Sphere radius.
3030 # @param theName Object name; when specified, this parameter is used
3031 # for result publication in the study. Otherwise, if automatic
3032 # publication is switched on, default value is used for result name.
3034 # @return New GEOM.GEOM_Object, containing the created sphere.
3036 # @ref tui_creation_sphere "Example"
3037 def MakeSphereR(self, theR, theName=None):
3039 Create a sphere with given radius at the origin of coordinate system.
3043 theName Object name; when specified, this parameter is used
3044 for result publication in the study. Otherwise, if automatic
3045 publication is switched on, default value is used for result name.
3048 New GEOM.GEOM_Object, containing the created sphere.
3050 # Example: see GEOM_TestAll.py
3051 theR,Parameters = ParseParameters(theR)
3052 anObj = self.PrimOp.MakeSphereR(theR)
3053 RaiseIfFailed("MakeSphereR", self.PrimOp)
3054 anObj.SetParameters(Parameters)
3055 self._autoPublish(anObj, theName, "sphere")
3058 ## Create a cone with given base point, axis, height and radiuses.
3059 # @param thePnt Central point of the first cone base.
3060 # @param theAxis Cone axis.
3061 # @param theR1 Radius of the first cone base.
3062 # @param theR2 Radius of the second cone base.
3063 # \note If both radiuses are non-zero, the cone will be truncated.
3064 # \note If the radiuses are equal, a cylinder will be created instead.
3065 # @param theH Cone height.
3066 # @param theName Object name; when specified, this parameter is used
3067 # for result publication in the study. Otherwise, if automatic
3068 # publication is switched on, default value is used for result name.
3070 # @return New GEOM.GEOM_Object, containing the created cone.
3072 # @ref tui_creation_cone "Example"
3073 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3075 Create a cone with given base point, axis, height and radiuses.
3078 thePnt Central point of the first cone base.
3080 theR1 Radius of the first cone base.
3081 theR2 Radius of the second cone base.
3083 theName Object name; when specified, this parameter is used
3084 for result publication in the study. Otherwise, if automatic
3085 publication is switched on, default value is used for result name.
3088 If both radiuses are non-zero, the cone will be truncated.
3089 If the radiuses are equal, a cylinder will be created instead.
3092 New GEOM.GEOM_Object, containing the created cone.
3094 # Example: see GEOM_TestAll.py
3095 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3096 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3097 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3098 anObj.SetParameters(Parameters)
3099 self._autoPublish(anObj, theName, "cone")
3102 ## Create a cone with given height and radiuses at
3103 # the origin of coordinate system. Axis of the cone will
3104 # be collinear to the OZ axis of the coordinate system.
3105 # @param theR1 Radius of the first cone base.
3106 # @param theR2 Radius of the second cone base.
3107 # \note If both radiuses are non-zero, the cone will be truncated.
3108 # \note If the radiuses are equal, a cylinder will be created instead.
3109 # @param theH Cone height.
3110 # @param theName Object name; when specified, this parameter is used
3111 # for result publication in the study. Otherwise, if automatic
3112 # publication is switched on, default value is used for result name.
3114 # @return New GEOM.GEOM_Object, containing the created cone.
3116 # @ref tui_creation_cone "Example"
3117 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3119 Create a cone with given height and radiuses at
3120 the origin of coordinate system. Axis of the cone will
3121 be collinear to the OZ axis of the coordinate system.
3124 theR1 Radius of the first cone base.
3125 theR2 Radius of the second cone base.
3127 theName Object name; when specified, this parameter is used
3128 for result publication in the study. Otherwise, if automatic
3129 publication is switched on, default value is used for result name.
3132 If both radiuses are non-zero, the cone will be truncated.
3133 If the radiuses are equal, a cylinder will be created instead.
3136 New GEOM.GEOM_Object, containing the created cone.
3138 # Example: see GEOM_TestAll.py
3139 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3140 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3141 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3142 anObj.SetParameters(Parameters)
3143 self._autoPublish(anObj, theName, "cone")
3146 ## Create a torus with given center, normal vector and radiuses.
3147 # @param thePnt Torus central point.
3148 # @param theVec Torus axis of symmetry.
3149 # @param theRMajor Torus major radius.
3150 # @param theRMinor Torus minor radius.
3151 # @param theName Object name; when specified, this parameter is used
3152 # for result publication in the study. Otherwise, if automatic
3153 # publication is switched on, default value is used for result name.
3155 # @return New GEOM.GEOM_Object, containing the created torus.
3157 # @ref tui_creation_torus "Example"
3158 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3160 Create a torus with given center, normal vector and radiuses.
3163 thePnt Torus central point.
3164 theVec Torus axis of symmetry.
3165 theRMajor Torus major radius.
3166 theRMinor Torus minor radius.
3167 theName Object name; when specified, this parameter is used
3168 for result publication in the study. Otherwise, if automatic
3169 publication is switched on, default value is used for result name.
3172 New GEOM.GEOM_Object, containing the created torus.
3174 # Example: see GEOM_TestAll.py
3175 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3176 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3177 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3178 anObj.SetParameters(Parameters)
3179 self._autoPublish(anObj, theName, "torus")
3182 ## Create a torus with given radiuses at the origin of coordinate system.
3183 # @param theRMajor Torus major radius.
3184 # @param theRMinor Torus minor radius.
3185 # @param theName Object name; when specified, this parameter is used
3186 # for result publication in the study. Otherwise, if automatic
3187 # publication is switched on, default value is used for result name.
3189 # @return New GEOM.GEOM_Object, containing the created torus.
3191 # @ref tui_creation_torus "Example"
3192 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3194 Create a torus with given radiuses at the origin of coordinate system.
3197 theRMajor Torus major radius.
3198 theRMinor Torus minor radius.
3199 theName Object name; when specified, this parameter is used
3200 for result publication in the study. Otherwise, if automatic
3201 publication is switched on, default value is used for result name.
3204 New GEOM.GEOM_Object, containing the created torus.
3206 # Example: see GEOM_TestAll.py
3207 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3208 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3209 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3210 anObj.SetParameters(Parameters)
3211 self._autoPublish(anObj, theName, "torus")
3214 # end of l3_3d_primitives
3217 ## @addtogroup l3_complex
3220 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3221 # @param theBase Base shape to be extruded.
3222 # @param thePoint1 First end of extrusion vector.
3223 # @param thePoint2 Second end of extrusion vector.
3224 # @param theScaleFactor Use it to make prism with scaled second base.
3225 # Nagative value means not scaled second base.
3226 # @param theName Object name; when specified, this parameter is used
3227 # for result publication in the study. Otherwise, if automatic
3228 # publication is switched on, default value is used for result name.
3230 # @return New GEOM.GEOM_Object, containing the created prism.
3232 # @ref tui_creation_prism "Example"
3233 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3235 Create a shape by extrusion of the base shape along a vector, defined by two points.
3238 theBase Base shape to be extruded.
3239 thePoint1 First end of extrusion vector.
3240 thePoint2 Second end of extrusion vector.
3241 theScaleFactor Use it to make prism with scaled second base.
3242 Nagative value means not scaled second base.
3243 theName Object name; when specified, this parameter is used
3244 for result publication in the study. Otherwise, if automatic
3245 publication is switched on, default value is used for result name.
3248 New GEOM.GEOM_Object, containing the created prism.
3250 # Example: see GEOM_TestAll.py
3253 if theScaleFactor > 0:
3254 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3255 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3257 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3258 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3259 anObj.SetParameters(Parameters)
3260 self._autoPublish(anObj, theName, "prism")
3263 ## Create a shape by extrusion of the base shape along a
3264 # vector, defined by two points, in 2 Ways (forward/backward).
3265 # @param theBase Base shape to be extruded.
3266 # @param thePoint1 First end of extrusion vector.
3267 # @param thePoint2 Second end of extrusion vector.
3268 # @param theName Object name; when specified, this parameter is used
3269 # for result publication in the study. Otherwise, if automatic
3270 # publication is switched on, default value is used for result name.
3272 # @return New GEOM.GEOM_Object, containing the created prism.
3274 # @ref tui_creation_prism "Example"
3275 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3277 Create a shape by extrusion of the base shape along a
3278 vector, defined by two points, in 2 Ways (forward/backward).
3281 theBase Base shape to be extruded.
3282 thePoint1 First end of extrusion vector.
3283 thePoint2 Second end of extrusion vector.
3284 theName Object name; when specified, this parameter is used
3285 for result publication in the study. Otherwise, if automatic
3286 publication is switched on, default value is used for result name.
3289 New GEOM.GEOM_Object, containing the created prism.
3291 # Example: see GEOM_TestAll.py
3292 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3293 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3294 self._autoPublish(anObj, theName, "prism")
3297 ## Create a shape by extrusion of the base shape along the vector,
3298 # i.e. all the space, transfixed by the base shape during its translation
3299 # along the vector on the given distance.
3300 # @param theBase Base shape to be extruded.
3301 # @param theVec Direction of extrusion.
3302 # @param theH Prism dimension along theVec.
3303 # @param theScaleFactor Use it to make prism with scaled second base.
3304 # Negative value means not scaled second base.
3305 # @param theName Object name; when specified, this parameter is used
3306 # for result publication in the study. Otherwise, if automatic
3307 # publication is switched on, default value is used for result name.
3309 # @return New GEOM.GEOM_Object, containing the created prism.
3311 # @ref tui_creation_prism "Example"
3312 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3314 Create a shape by extrusion of the base shape along the vector,
3315 i.e. all the space, transfixed by the base shape during its translation
3316 along the vector on the given distance.
3319 theBase Base shape to be extruded.
3320 theVec Direction of extrusion.
3321 theH Prism dimension along theVec.
3322 theScaleFactor Use it to make prism with scaled second base.
3323 Negative value means not scaled second base.
3324 theName Object name; when specified, this parameter is used
3325 for result publication in the study. Otherwise, if automatic
3326 publication is switched on, default value is used for result name.
3329 New GEOM.GEOM_Object, containing the created prism.
3331 # Example: see GEOM_TestAll.py
3334 if theScaleFactor > 0:
3335 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3336 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3338 theH,Parameters = ParseParameters(theH)
3339 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3340 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3341 anObj.SetParameters(Parameters)
3342 self._autoPublish(anObj, theName, "prism")
3345 ## Create a shape by extrusion of the base shape along the vector,
3346 # i.e. all the space, transfixed by the base shape during its translation
3347 # along the vector on the given distance in 2 Ways (forward/backward).
3348 # @param theBase Base shape to be extruded.
3349 # @param theVec Direction of extrusion.
3350 # @param theH Prism dimension along theVec in forward direction.
3351 # @param theName Object name; when specified, this parameter is used
3352 # for result publication in the study. Otherwise, if automatic
3353 # publication is switched on, default value is used for result name.
3355 # @return New GEOM.GEOM_Object, containing the created prism.
3357 # @ref tui_creation_prism "Example"
3358 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3360 Create a shape by extrusion of the base shape along the vector,
3361 i.e. all the space, transfixed by the base shape during its translation
3362 along the vector on the given distance in 2 Ways (forward/backward).
3365 theBase Base shape to be extruded.
3366 theVec Direction of extrusion.
3367 theH Prism dimension along theVec in forward direction.
3368 theName Object name; when specified, this parameter is used
3369 for result publication in the study. Otherwise, if automatic
3370 publication is switched on, default value is used for result name.
3373 New GEOM.GEOM_Object, containing the created prism.
3375 # Example: see GEOM_TestAll.py
3376 theH,Parameters = ParseParameters(theH)
3377 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3378 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3379 anObj.SetParameters(Parameters)
3380 self._autoPublish(anObj, theName, "prism")
3383 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3384 # @param theBase Base shape to be extruded.
3385 # @param theDX, theDY, theDZ Directions of extrusion.
3386 # @param theScaleFactor Use it to make prism with scaled second base.
3387 # Nagative value means not scaled second base.
3388 # @param theName Object name; when specified, this parameter is used
3389 # for result publication in the study. Otherwise, if automatic
3390 # publication is switched on, default value is used for result name.
3392 # @return New GEOM.GEOM_Object, containing the created prism.
3394 # @ref tui_creation_prism "Example"
3395 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3397 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3400 theBase Base shape to be extruded.
3401 theDX, theDY, theDZ Directions of extrusion.
3402 theScaleFactor Use it to make prism with scaled second base.
3403 Nagative value means not scaled second base.
3404 theName Object name; when specified, this parameter is used
3405 for result publication in the study. Otherwise, if automatic
3406 publication is switched on, default value is used for result name.
3409 New GEOM.GEOM_Object, containing the created prism.
3411 # Example: see GEOM_TestAll.py
3414 if theScaleFactor > 0:
3415 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3416 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3418 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3419 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3420 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3421 anObj.SetParameters(Parameters)
3422 self._autoPublish(anObj, theName, "prism")
3425 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3426 # i.e. all the space, transfixed by the base shape during its translation
3427 # along the vector on the given distance in 2 Ways (forward/backward).
3428 # @param theBase Base shape to be extruded.
3429 # @param theDX, theDY, theDZ Directions of extrusion.
3430 # @param theName Object name; when specified, this parameter is used
3431 # for result publication in the study. Otherwise, if automatic
3432 # publication is switched on, default value is used for result name.
3434 # @return New GEOM.GEOM_Object, containing the created prism.
3436 # @ref tui_creation_prism "Example"
3437 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3439 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3440 i.e. all the space, transfixed by the base shape during its translation
3441 along the vector on the given distance in 2 Ways (forward/backward).
3444 theBase Base shape to be extruded.
3445 theDX, theDY, theDZ Directions of extrusion.
3446 theName Object name; when specified, this parameter is used
3447 for result publication in the study. Otherwise, if automatic
3448 publication is switched on, default value is used for result name.
3451 New GEOM.GEOM_Object, containing the created prism.
3453 # Example: see GEOM_TestAll.py
3454 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3455 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3456 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3457 anObj.SetParameters(Parameters)
3458 self._autoPublish(anObj, theName, "prism")
3461 ## Create a shape by revolution of the base shape around the axis
3462 # on the given angle, i.e. all the space, transfixed by the base
3463 # shape during its rotation around the axis on the given angle.
3464 # @param theBase Base shape to be rotated.
3465 # @param theAxis Rotation axis.
3466 # @param theAngle Rotation angle in radians.
3467 # @param theName Object name; when specified, this parameter is used
3468 # for result publication in the study. Otherwise, if automatic
3469 # publication is switched on, default value is used for result name.
3471 # @return New GEOM.GEOM_Object, containing the created revolution.
3473 # @ref tui_creation_revolution "Example"
3474 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3476 Create a shape by revolution of the base shape around the axis
3477 on the given angle, i.e. all the space, transfixed by the base
3478 shape during its rotation around the axis on the given angle.
3481 theBase Base shape to be rotated.
3482 theAxis Rotation axis.
3483 theAngle Rotation angle in radians.
3484 theName Object name; when specified, this parameter is used
3485 for result publication in the study. Otherwise, if automatic
3486 publication is switched on, default value is used for result name.
3489 New GEOM.GEOM_Object, containing the created revolution.
3491 # Example: see GEOM_TestAll.py
3492 theAngle,Parameters = ParseParameters(theAngle)
3493 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3494 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3495 anObj.SetParameters(Parameters)
3496 self._autoPublish(anObj, theName, "revolution")
3499 ## Create a shape by revolution of the base shape around the axis
3500 # on the given angle, i.e. all the space, transfixed by the base
3501 # shape during its rotation around the axis on the given angle in
3502 # both directions (forward/backward)
3503 # @param theBase Base shape to be rotated.
3504 # @param theAxis Rotation axis.
3505 # @param theAngle Rotation angle in radians.
3506 # @param theName Object name; when specified, this parameter is used
3507 # for result publication in the study. Otherwise, if automatic
3508 # publication is switched on, default value is used for result name.
3510 # @return New GEOM.GEOM_Object, containing the created revolution.
3512 # @ref tui_creation_revolution "Example"
3513 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3515 Create a shape by revolution of the base shape around the axis
3516 on the given angle, i.e. all the space, transfixed by the base
3517 shape during its rotation around the axis on the given angle in
3518 both directions (forward/backward).
3521 theBase Base shape to be rotated.
3522 theAxis Rotation axis.
3523 theAngle Rotation angle in radians.
3524 theName Object name; when specified, this parameter is used
3525 for result publication in the study. Otherwise, if automatic
3526 publication is switched on, default value is used for result name.
3529 New GEOM.GEOM_Object, containing the created revolution.
3531 theAngle,Parameters = ParseParameters(theAngle)
3532 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3533 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3534 anObj.SetParameters(Parameters)
3535 self._autoPublish(anObj, theName, "revolution")
3538 ## Create a filling from the given compound of contours.
3539 # @param theShape the compound of contours
3540 # @param theMinDeg a minimal degree of BSpline surface to create
3541 # @param theMaxDeg a maximal degree of BSpline surface to create
3542 # @param theTol2D a 2d tolerance to be reached
3543 # @param theTol3D a 3d tolerance to be reached
3544 # @param theNbIter a number of iteration of approximation algorithm
3545 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3546 # @param isApprox if True, BSpline curves are generated in the process
3547 # of surface construction. By default it is False, that means
3548 # the surface is created using given curves. The usage of
3549 # Approximation makes the algorithm work slower, but allows
3550 # building the surface for rather complex cases.
3551 # @param theName Object name; when specified, this parameter is used
3552 # for result publication in the study. Otherwise, if automatic
3553 # publication is switched on, default value is used for result name.
3555 # @return New GEOM.GEOM_Object, containing the created filling surface.
3557 # @ref tui_creation_filling "Example"
3558 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3559 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3561 Create a filling from the given compound of contours.
3564 theShape the compound of contours
3565 theMinDeg a minimal degree of BSpline surface to create
3566 theMaxDeg a maximal degree of BSpline surface to create
3567 theTol2D a 2d tolerance to be reached
3568 theTol3D a 3d tolerance to be reached
3569 theNbIter a number of iteration of approximation algorithm
3570 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3571 isApprox if True, BSpline curves are generated in the process
3572 of surface construction. By default it is False, that means
3573 the surface is created using given curves. The usage of
3574 Approximation makes the algorithm work slower, but allows
3575 building the surface for rather complex cases
3576 theName Object name; when specified, this parameter is used
3577 for result publication in the study. Otherwise, if automatic
3578 publication is switched on, default value is used for result name.
3581 New GEOM.GEOM_Object, containing the created filling surface.
3584 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3586 # Example: see GEOM_TestAll.py
3587 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3588 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3589 theTol2D, theTol3D, theNbIter,
3590 theMethod, isApprox)
3591 RaiseIfFailed("MakeFilling", self.PrimOp)
3592 anObj.SetParameters(Parameters)
3593 self._autoPublish(anObj, theName, "filling")
3597 ## Create a filling from the given compound of contours.
3598 # This method corresponds to MakeFilling with isApprox=True
3599 # @param theShape the compound of contours
3600 # @param theMinDeg a minimal degree of BSpline surface to create
3601 # @param theMaxDeg a maximal degree of BSpline surface to create
3602 # @param theTol3D a 3d tolerance to be reached
3603 # @param theName Object name; when specified, this parameter is used
3604 # for result publication in the study. Otherwise, if automatic
3605 # publication is switched on, default value is used for result name.
3607 # @return New GEOM.GEOM_Object, containing the created filling surface.
3609 # @ref tui_creation_filling "Example"
3610 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3612 Create a filling from the given compound of contours.
3613 This method corresponds to MakeFilling with isApprox=True
3616 theShape the compound of contours
3617 theMinDeg a minimal degree of BSpline surface to create
3618 theMaxDeg a maximal degree of BSpline surface to create
3619 theTol3D a 3d tolerance to be reached
3620 theName Object name; when specified, this parameter is used
3621 for result publication in the study. Otherwise, if automatic
3622 publication is switched on, default value is used for result name.
3625 New GEOM.GEOM_Object, containing the created filling surface.
3628 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3630 # Example: see GEOM_TestAll.py
3631 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3632 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3633 0, theTol3D, 0, GEOM.FOM_Default, True)
3634 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3635 anObj.SetParameters(Parameters)
3636 self._autoPublish(anObj, theName, "filling")
3639 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3640 # @param theSeqSections - set of specified sections.
3641 # @param theModeSolid - mode defining building solid or shell
3642 # @param thePreci - precision 3D used for smoothing
3643 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3644 # @param theName Object name; when specified, this parameter is used
3645 # for result publication in the study. Otherwise, if automatic
3646 # publication is switched on, default value is used for result name.
3648 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3650 # @ref swig_todo "Example"
3651 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3653 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3656 theSeqSections - set of specified sections.
3657 theModeSolid - mode defining building solid or shell
3658 thePreci - precision 3D used for smoothing
3659 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3660 theName Object name; when specified, this parameter is used
3661 for result publication in the study. Otherwise, if automatic
3662 publication is switched on, default value is used for result name.
3665 New GEOM.GEOM_Object, containing the created shell or solid.
3667 # Example: see GEOM_TestAll.py
3668 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3669 RaiseIfFailed("MakeThruSections", self.PrimOp)
3670 self._autoPublish(anObj, theName, "filling")
3673 ## Create a shape by extrusion of the base shape along
3674 # the path shape. The path shape can be a wire or an edge.
3675 # @param theBase Base shape to be extruded.
3676 # @param thePath Path shape to extrude the base shape along it.
3677 # @param theName Object name; when specified, this parameter is used
3678 # for result publication in the study. Otherwise, if automatic
3679 # publication is switched on, default value is used for result name.
3681 # @return New GEOM.GEOM_Object, containing the created pipe.
3683 # @ref tui_creation_pipe "Example"
3684 def MakePipe(self, theBase, thePath, theName=None):
3686 Create a shape by extrusion of the base shape along
3687 the path shape. The path shape can be a wire or an edge.
3690 theBase Base shape to be extruded.
3691 thePath Path shape to extrude the base shape along it.
3692 theName Object name; when specified, this parameter is used
3693 for result publication in the study. Otherwise, if automatic
3694 publication is switched on, default value is used for result name.
3697 New GEOM.GEOM_Object, containing the created pipe.
3699 # Example: see GEOM_TestAll.py
3700 anObj = self.PrimOp.MakePipe(theBase, thePath)
3701 RaiseIfFailed("MakePipe", self.PrimOp)
3702 self._autoPublish(anObj, theName, "pipe")
3705 ## Create a shape by extrusion of the profile shape along
3706 # the path shape. The path shape can be a wire or an edge.
3707 # the several profiles can be specified in the several locations of path.
3708 # @param theSeqBases - list of Bases shape to be extruded.
3709 # @param theLocations - list of locations on the path corresponding
3710 # specified list of the Bases shapes. Number of locations
3711 # should be equal to number of bases or list of locations can be empty.
3712 # @param thePath - Path shape to extrude the base shape along it.
3713 # @param theWithContact - the mode defining that the section is translated to be in
3714 # contact with the spine.
3715 # @param theWithCorrection - defining that the section is rotated to be
3716 # orthogonal to the spine tangent in the correspondent point
3717 # @param theName Object name; when specified, this parameter is used
3718 # for result publication in the study. Otherwise, if automatic
3719 # publication is switched on, default value is used for result name.
3721 # @return New GEOM.GEOM_Object, containing the created pipe.
3723 # @ref tui_creation_pipe_with_diff_sec "Example"
3724 def MakePipeWithDifferentSections(self, theSeqBases,
3725 theLocations, thePath,
3726 theWithContact, theWithCorrection, theName=None):
3728 Create a shape by extrusion of the profile shape along
3729 the path shape. The path shape can be a wire or an edge.
3730 the several profiles can be specified in the several locations of path.
3733 theSeqBases - list of Bases shape to be extruded.
3734 theLocations - list of locations on the path corresponding
3735 specified list of the Bases shapes. Number of locations
3736 should be equal to number of bases or list of locations can be empty.
3737 thePath - Path shape to extrude the base shape along it.
3738 theWithContact - the mode defining that the section is translated to be in
3739 contact with the spine(0/1)
3740 theWithCorrection - defining that the section is rotated to be
3741 orthogonal to the spine tangent in the correspondent point (0/1)
3742 theName Object name; when specified, this parameter is used
3743 for result publication in the study. Otherwise, if automatic
3744 publication is switched on, default value is used for result name.
3747 New GEOM.GEOM_Object, containing the created pipe.
3749 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3750 theLocations, thePath,
3751 theWithContact, theWithCorrection)
3752 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3753 self._autoPublish(anObj, theName, "pipe")
3756 ## Create a shape by extrusion of the profile shape along
3757 # the path shape. The path shape can be a wire or a edge.
3758 # the several profiles can be specified in the several locations of path.
3759 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3760 # shell or face. If number of faces in neighbour sections
3761 # aren't coincided result solid between such sections will
3762 # be created using external boundaries of this shells.
3763 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3764 # This list is used for searching correspondences between
3765 # faces in the sections. Size of this list must be equal
3766 # to size of list of base shapes.
3767 # @param theLocations - list of locations on the path corresponding
3768 # specified list of the Bases shapes. Number of locations
3769 # should be equal to number of bases. First and last
3770 # locations must be coincided with first and last vertexes
3771 # of path correspondingly.
3772 # @param thePath - Path shape to extrude the base shape along it.
3773 # @param theWithContact - the mode defining that the section is translated to be in
3774 # contact with the spine.
3775 # @param theWithCorrection - defining that the section is rotated to be
3776 # orthogonal to the spine tangent in the correspondent point
3777 # @param theName Object name; when specified, this parameter is used
3778 # for result publication in the study. Otherwise, if automatic
3779 # publication is switched on, default value is used for result name.
3781 # @return New GEOM.GEOM_Object, containing the created solids.
3783 # @ref tui_creation_pipe_with_shell_sec "Example"
3784 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3785 theLocations, thePath,
3786 theWithContact, theWithCorrection, theName=None):
3788 Create a shape by extrusion of the profile shape along
3789 the path shape. The path shape can be a wire or a edge.
3790 the several profiles can be specified in the several locations of path.
3793 theSeqBases - list of Bases shape to be extruded. Base shape must be
3794 shell or face. If number of faces in neighbour sections
3795 aren't coincided result solid between such sections will
3796 be created using external boundaries of this shells.
3797 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3798 This list is used for searching correspondences between
3799 faces in the sections. Size of this list must be equal
3800 to size of list of base shapes.
3801 theLocations - list of locations on the path corresponding
3802 specified list of the Bases shapes. Number of locations
3803 should be equal to number of bases. First and last
3804 locations must be coincided with first and last vertexes
3805 of path correspondingly.
3806 thePath - Path shape to extrude the base shape along it.
3807 theWithContact - the mode defining that the section is translated to be in
3808 contact with the spine (0/1)
3809 theWithCorrection - defining that the section is rotated to be
3810 orthogonal to the spine tangent in the correspondent point (0/1)
3811 theName Object name; when specified, this parameter is used
3812 for result publication in the study. Otherwise, if automatic
3813 publication is switched on, default value is used for result name.
3816 New GEOM.GEOM_Object, containing the created solids.
3818 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3819 theLocations, thePath,
3820 theWithContact, theWithCorrection)
3821 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3822 self._autoPublish(anObj, theName, "pipe")
3825 ## Create a shape by extrusion of the profile shape along
3826 # the path shape. This function is used only for debug pipe
3827 # functionality - it is a version of function MakePipeWithShellSections()
3828 # which give a possibility to recieve information about
3829 # creating pipe between each pair of sections step by step.
3830 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3831 theLocations, thePath,
3832 theWithContact, theWithCorrection, theName=None):
3834 Create a shape by extrusion of the profile shape along
3835 the path shape. This function is used only for debug pipe
3836 functionality - it is a version of previous function
3837 geompy.MakePipeWithShellSections() which give a possibility to
3838 recieve information about creating pipe between each pair of
3839 sections step by step.
3842 nbsect = len(theSeqBases)
3843 nbsubsect = len(theSeqSubBases)
3844 #print "nbsect = ",nbsect
3845 for i in range(1,nbsect):
3847 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3848 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3850 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3851 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3852 tmpLocations, thePath,
3853 theWithContact, theWithCorrection)
3854 if self.PrimOp.IsDone() == 0:
3855 print "Problems with pipe creation between ",i," and ",i+1," sections"
3856 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3859 print "Pipe between ",i," and ",i+1," sections is OK"
3864 resc = self.MakeCompound(res)
3865 #resc = self.MakeSewing(res, 0.001)
3866 #print "resc: ",resc
3867 self._autoPublish(resc, theName, "pipe")
3870 ## Create solids between given sections
3871 # @param theSeqBases - list of sections (shell or face).
3872 # @param theLocations - list of corresponding vertexes
3873 # @param theName Object name; when specified, this parameter is used
3874 # for result publication in the study. Otherwise, if automatic
3875 # publication is switched on, default value is used for result name.
3877 # @return New GEOM.GEOM_Object, containing the created solids.
3879 # @ref tui_creation_pipe_without_path "Example"
3880 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3882 Create solids between given sections
3885 theSeqBases - list of sections (shell or face).
3886 theLocations - list of corresponding vertexes
3887 theName Object name; when specified, this parameter is used
3888 for result publication in the study. Otherwise, if automatic
3889 publication is switched on, default value is used for result name.
3892 New GEOM.GEOM_Object, containing the created solids.
3894 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3895 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3896 self._autoPublish(anObj, theName, "pipe")
3899 ## Create a shape by extrusion of the base shape along
3900 # the path shape with constant bi-normal direction along the given vector.
3901 # The path shape can be a wire or an edge.
3902 # @param theBase Base shape to be extruded.
3903 # @param thePath Path shape to extrude the base shape along it.
3904 # @param theVec Vector defines a constant binormal direction to keep the
3905 # same angle beetween the direction and the sections
3906 # along the sweep surface.
3907 # @param theName Object name; when specified, this parameter is used
3908 # for result publication in the study. Otherwise, if automatic
3909 # publication is switched on, default value is used for result name.
3911 # @return New GEOM.GEOM_Object, containing the created pipe.
3913 # @ref tui_creation_pipe "Example"
3914 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3916 Create a shape by extrusion of the base shape along
3917 the path shape with constant bi-normal direction along the given vector.
3918 The path shape can be a wire or an edge.
3921 theBase Base shape to be extruded.
3922 thePath Path shape to extrude the base shape along it.
3923 theVec Vector defines a constant binormal direction to keep the
3924 same angle beetween the direction and the sections
3925 along the sweep surface.
3926 theName Object name; when specified, this parameter is used
3927 for result publication in the study. Otherwise, if automatic
3928 publication is switched on, default value is used for result name.
3931 New GEOM.GEOM_Object, containing the created pipe.
3933 # Example: see GEOM_TestAll.py
3934 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3935 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3936 self._autoPublish(anObj, theName, "pipe")
3939 ## Makes a thick solid from a face or a shell
3940 # @param theShape Face or Shell to be thicken
3941 # @param theThickness Thickness of the resulting solid
3942 # @param theName Object name; when specified, this parameter is used
3943 # for result publication in the study. Otherwise, if automatic
3944 # publication is switched on, default value is used for result name.
3946 # @return New GEOM.GEOM_Object, containing the created solid
3948 def MakeThickSolid(self, theShape, theThickness, theName=None):
3950 Make a thick solid from a face or a shell
3953 theShape Face or Shell to be thicken
3954 theThickness Thickness of the resulting solid
3955 theName Object name; when specified, this parameter is used
3956 for result publication in the study. Otherwise, if automatic
3957 publication is switched on, default value is used for result name.
3960 New GEOM.GEOM_Object, containing the created solid
3962 # Example: see GEOM_TestAll.py
3963 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3964 RaiseIfFailed("MakeThickening", self.PrimOp)
3965 self._autoPublish(anObj, theName, "pipe")
3969 ## Modifies a face or a shell to make it a thick solid
3970 # @param theShape Face or Shell to be thicken
3971 # @param theThickness Thickness of the resulting solid
3973 # @return The modified shape
3975 def Thicken(self, theShape, theThickness):
3977 Modifies a face or a shell to make it a thick solid
3980 theBase Base shape to be extruded.
3981 thePath Path shape to extrude the base shape along it.
3982 theName Object name; when specified, this parameter is used
3983 for result publication in the study. Otherwise, if automatic
3984 publication is switched on, default value is used for result name.
3989 # Example: see GEOM_TestAll.py
3990 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3991 RaiseIfFailed("MakeThickening", self.PrimOp)
3994 ## Build a middle path of a pipe-like shape.
3995 # The path shape can be a wire or an edge.
3996 # @param theShape It can be closed or unclosed pipe-like shell
3997 # or a pipe-like solid.
3998 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3999 # should be wires or faces of theShape.
4000 # @param theName Object name; when specified, this parameter is used
4001 # for result publication in the study. Otherwise, if automatic
4002 # publication is switched on, default value is used for result name.
4004 # @note It is not assumed that exact or approximate copy of theShape
4005 # can be obtained by applying existing Pipe operation on the
4006 # resulting "Path" wire taking theBase1 as the base - it is not
4007 # always possible; though in some particular cases it might work
4008 # it is not guaranteed. Thus, RestorePath function should not be
4009 # considered as an exact reverse operation of the Pipe.
4011 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4012 # source pipe's "path".
4014 # @ref tui_creation_pipe_path "Example"
4015 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4017 Build a middle path of a pipe-like shape.
4018 The path shape can be a wire or an edge.
4021 theShape It can be closed or unclosed pipe-like shell
4022 or a pipe-like solid.
4023 theBase1, theBase2 Two bases of the supposed pipe. This
4024 should be wires or faces of theShape.
4025 theName Object name; when specified, this parameter is used
4026 for result publication in the study. Otherwise, if automatic
4027 publication is switched on, default value is used for result name.
4030 New GEOM_Object, containing an edge or wire that represent
4033 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4034 RaiseIfFailed("RestorePath", self.PrimOp)
4035 self._autoPublish(anObj, theName, "path")
4038 ## Build a middle path of a pipe-like shape.
4039 # The path shape can be a wire or an edge.
4040 # @param theShape It can be closed or unclosed pipe-like shell
4041 # or a pipe-like solid.
4042 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4043 # should be lists of edges of theShape.
4044 # @param theName Object name; when specified, this parameter is used
4045 # for result publication in the study. Otherwise, if automatic
4046 # publication is switched on, default value is used for result name.
4048 # @note It is not assumed that exact or approximate copy of theShape
4049 # can be obtained by applying existing Pipe operation on the
4050 # resulting "Path" wire taking theBase1 as the base - it is not
4051 # always possible; though in some particular cases it might work
4052 # it is not guaranteed. Thus, RestorePath function should not be
4053 # considered as an exact reverse operation of the Pipe.
4055 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4056 # source pipe's "path".
4058 # @ref tui_creation_pipe_path "Example"
4059 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4061 Build a middle path of a pipe-like shape.
4062 The path shape can be a wire or an edge.
4065 theShape It can be closed or unclosed pipe-like shell
4066 or a pipe-like solid.
4067 listEdges1, listEdges2 Two bases of the supposed pipe. This
4068 should be lists of edges of theShape.
4069 theName Object name; when specified, this parameter is used
4070 for result publication in the study. Otherwise, if automatic
4071 publication is switched on, default value is used for result name.
4074 New GEOM_Object, containing an edge or wire that represent
4077 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4078 RaiseIfFailed("RestorePath", self.PrimOp)
4079 self._autoPublish(anObj, theName, "path")
4085 ## @addtogroup l3_advanced
4088 ## Create a linear edge with specified ends.
4089 # @param thePnt1 Point for the first end of edge.
4090 # @param thePnt2 Point for the second end of edge.
4091 # @param theName Object name; when specified, this parameter is used
4092 # for result publication in the study. Otherwise, if automatic
4093 # publication is switched on, default value is used for result name.
4095 # @return New GEOM.GEOM_Object, containing the created edge.
4097 # @ref tui_creation_edge "Example"
4098 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4100 Create a linear edge with specified ends.
4103 thePnt1 Point for the first end of edge.
4104 thePnt2 Point for the second end of edge.
4105 theName Object name; when specified, this parameter is used
4106 for result publication in the study. Otherwise, if automatic
4107 publication is switched on, default value is used for result name.
4110 New GEOM.GEOM_Object, containing the created edge.
4112 # Example: see GEOM_TestAll.py
4113 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4114 RaiseIfFailed("MakeEdge", self.ShapesOp)
4115 self._autoPublish(anObj, theName, "edge")
4118 ## Create a new edge, corresponding to the given length on the given curve.
4119 # @param theRefCurve The referenced curve (edge).
4120 # @param theLength Length on the referenced curve. It can be negative.
4121 # @param theStartPoint Any point can be selected for it, the new edge will begin
4122 # at the end of \a theRefCurve, close to the selected point.
4123 # If None, start from the first point of \a theRefCurve.
4124 # @param theName Object name; when specified, this parameter is used
4125 # for result publication in the study. Otherwise, if automatic
4126 # publication is switched on, default value is used for result name.
4128 # @return New GEOM.GEOM_Object, containing the created edge.
4130 # @ref tui_creation_edge "Example"
4131 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4133 Create a new edge, corresponding to the given length on the given curve.
4136 theRefCurve The referenced curve (edge).
4137 theLength Length on the referenced curve. It can be negative.
4138 theStartPoint Any point can be selected for it, the new edge will begin
4139 at the end of theRefCurve, close to the selected point.
4140 If None, start from the first point of theRefCurve.
4141 theName Object name; when specified, this parameter is used
4142 for result publication in the study. Otherwise, if automatic
4143 publication is switched on, default value is used for result name.
4146 New GEOM.GEOM_Object, containing the created edge.
4148 # Example: see GEOM_TestAll.py
4149 theLength, Parameters = ParseParameters(theLength)
4150 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4151 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4152 anObj.SetParameters(Parameters)
4153 self._autoPublish(anObj, theName, "edge")
4156 ## Create an edge from specified wire.
4157 # @param theWire source Wire
4158 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4159 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4160 # @param theName Object name; when specified, this parameter is used
4161 # for result publication in the study. Otherwise, if automatic
4162 # publication is switched on, default value is used for result name.
4164 # @return New GEOM.GEOM_Object, containing the created edge.
4166 # @ref tui_creation_edge "Example"
4167 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4169 Create an edge from specified wire.
4173 theLinearTolerance linear tolerance value (default = 1e-07)
4174 theAngularTolerance angular tolerance value (default = 1e-12)
4175 theName Object name; when specified, this parameter is used
4176 for result publication in the study. Otherwise, if automatic
4177 publication is switched on, default value is used for result name.
4180 New GEOM.GEOM_Object, containing the created edge.
4182 # Example: see GEOM_TestAll.py
4183 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4184 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4185 self._autoPublish(anObj, theName, "edge")
4188 ## Create a wire from the set of edges and wires.
4189 # @param theEdgesAndWires List of edges and/or wires.
4190 # @param theTolerance Maximum distance between vertices, that will be merged.
4191 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4192 # @param theName Object name; when specified, this parameter is used
4193 # for result publication in the study. Otherwise, if automatic
4194 # publication is switched on, default value is used for result name.
4196 # @return New GEOM.GEOM_Object, containing the created wire.
4198 # @ref tui_creation_wire "Example"
4199 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4201 Create a wire from the set of edges and wires.
4204 theEdgesAndWires List of edges and/or wires.
4205 theTolerance Maximum distance between vertices, that will be merged.
4206 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4207 theName Object name; when specified, this parameter is used
4208 for result publication in the study. Otherwise, if automatic
4209 publication is switched on, default value is used for result name.
4212 New GEOM.GEOM_Object, containing the created wire.
4214 # Example: see GEOM_TestAll.py
4215 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4216 RaiseIfFailed("MakeWire", self.ShapesOp)
4217 self._autoPublish(anObj, theName, "wire")
4220 ## Create a face on the given wire.
4221 # @param theWire closed Wire or Edge to build the face on.
4222 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4223 # If the tolerance of the obtained planar face is less
4224 # than 1e-06, this face will be returned, otherwise the
4225 # algorithm tries to build any suitable face on the given
4226 # wire and prints a warning message.
4227 # @param theName Object name; when specified, this parameter is used
4228 # for result publication in the study. Otherwise, if automatic
4229 # publication is switched on, default value is used for result name.
4231 # @return New GEOM.GEOM_Object, containing the created face.
4233 # @ref tui_creation_face "Example"
4234 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4236 Create a face on the given wire.
4239 theWire closed Wire or Edge to build the face on.
4240 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4241 If the tolerance of the obtained planar face is less
4242 than 1e-06, this face will be returned, otherwise the
4243 algorithm tries to build any suitable face on the given
4244 wire and prints a warning message.
4245 theName Object name; when specified, this parameter is used
4246 for result publication in the study. Otherwise, if automatic
4247 publication is switched on, default value is used for result name.
4250 New GEOM.GEOM_Object, containing the created face.
4252 # Example: see GEOM_TestAll.py
4253 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4254 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4255 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4257 RaiseIfFailed("MakeFace", self.ShapesOp)
4258 self._autoPublish(anObj, theName, "face")
4261 ## Create a face on the given wires set.
4262 # @param theWires List of closed wires or edges to build the face on.
4263 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4264 # If the tolerance of the obtained planar face is less
4265 # than 1e-06, this face will be returned, otherwise the
4266 # algorithm tries to build any suitable face on the given
4267 # wire and prints a warning message.
4268 # @param theName Object name; when specified, this parameter is used
4269 # for result publication in the study. Otherwise, if automatic
4270 # publication is switched on, default value is used for result name.
4272 # @return New GEOM.GEOM_Object, containing the created face.
4274 # @ref tui_creation_face "Example"
4275 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4277 Create a face on the given wires set.
4280 theWires List of closed wires or edges to build the face on.
4281 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4282 If the tolerance of the obtained planar face is less
4283 than 1e-06, this face will be returned, otherwise the
4284 algorithm tries to build any suitable face on the given
4285 wire and prints a warning message.
4286 theName Object name; when specified, this parameter is used
4287 for result publication in the study. Otherwise, if automatic
4288 publication is switched on, default value is used for result name.
4291 New GEOM.GEOM_Object, containing the created face.
4293 # Example: see GEOM_TestAll.py
4294 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4295 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4296 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4298 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4299 self._autoPublish(anObj, theName, "face")
4302 ## See MakeFaceWires() method for details.
4304 # @ref tui_creation_face "Example 1"
4305 # \n @ref swig_MakeFaces "Example 2"
4306 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4308 See geompy.MakeFaceWires() method for details.
4310 # Example: see GEOM_TestOthers.py
4311 # note: auto-publishing is done in self.MakeFaceWires()
4312 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4315 ## Create a shell from the set of faces and shells.
4316 # @param theFacesAndShells List of faces and/or shells.
4317 # @param theName Object name; when specified, this parameter is used
4318 # for result publication in the study. Otherwise, if automatic
4319 # publication is switched on, default value is used for result name.
4321 # @return New GEOM.GEOM_Object, containing the created shell.
4323 # @ref tui_creation_shell "Example"
4324 def MakeShell(self, theFacesAndShells, theName=None):
4326 Create a shell from the set of faces and shells.
4329 theFacesAndShells List of faces and/or shells.
4330 theName Object name; when specified, this parameter is used
4331 for result publication in the study. Otherwise, if automatic
4332 publication is switched on, default value is used for result name.
4335 New GEOM.GEOM_Object, containing the created shell.
4337 # Example: see GEOM_TestAll.py
4338 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4339 RaiseIfFailed("MakeShell", self.ShapesOp)
4340 self._autoPublish(anObj, theName, "shell")
4343 ## Create a solid, bounded by the given shells.
4344 # @param theShells Sequence of bounding shells.
4345 # @param theName Object name; when specified, this parameter is used
4346 # for result publication in the study. Otherwise, if automatic
4347 # publication is switched on, default value is used for result name.
4349 # @return New GEOM.GEOM_Object, containing the created solid.
4351 # @ref tui_creation_solid "Example"
4352 def MakeSolid(self, theShells, theName=None):
4354 Create a solid, bounded by the given shells.
4357 theShells Sequence of bounding shells.
4358 theName Object name; when specified, this parameter is used
4359 for result publication in the study. Otherwise, if automatic
4360 publication is switched on, default value is used for result name.
4363 New GEOM.GEOM_Object, containing the created solid.
4365 # Example: see GEOM_TestAll.py
4366 if len(theShells) == 1:
4367 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4369 # raise RuntimeError, "MakeSolidShells : " + descr
4370 if descr == "WRN_SHAPE_UNCLOSED":
4371 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4372 anObj = self.ShapesOp.MakeSolidShells(theShells)
4373 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4374 self._autoPublish(anObj, theName, "solid")
4377 ## Create a compound of the given shapes.
4378 # @param theShapes List of shapes to put in compound.
4379 # @param theName Object name; when specified, this parameter is used
4380 # for result publication in the study. Otherwise, if automatic
4381 # publication is switched on, default value is used for result name.
4383 # @return New GEOM.GEOM_Object, containing the created compound.
4385 # @ref tui_creation_compound "Example"
4386 def MakeCompound(self, theShapes, theName=None):
4388 Create a compound of the given shapes.
4391 theShapes List of shapes to put in compound.
4392 theName Object name; when specified, this parameter is used
4393 for result publication in the study. Otherwise, if automatic
4394 publication is switched on, default value is used for result name.
4397 New GEOM.GEOM_Object, containing the created compound.
4399 # Example: see GEOM_TestAll.py
4400 self.ShapesOp.StartOperation()
4401 anObj = self.ShapesOp.MakeCompound(theShapes)
4402 RaiseIfFailed("MakeCompound", self.ShapesOp)
4403 self._autoPublish(anObj, theName, "compound")
4406 # end of l3_advanced
4409 ## @addtogroup l2_measure
4412 ## Gives quantity of faces in the given shape.
4413 # @param theShape Shape to count faces of.
4414 # @return Quantity of faces.
4416 # @ref swig_NumberOf "Example"
4417 def NumberOfFaces(self, theShape):
4419 Gives quantity of faces in the given shape.
4422 theShape Shape to count faces of.
4427 # Example: see GEOM_TestOthers.py
4428 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4429 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4432 ## Gives quantity of edges in the given shape.
4433 # @param theShape Shape to count edges of.
4434 # @return Quantity of edges.
4436 # @ref swig_NumberOf "Example"
4437 def NumberOfEdges(self, theShape):
4439 Gives quantity of edges in the given shape.
4442 theShape Shape to count edges of.
4447 # Example: see GEOM_TestOthers.py
4448 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4449 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4452 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4453 # @param theShape Shape to count sub-shapes of.
4454 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4455 # @return Quantity of sub-shapes of given type.
4457 # @ref swig_NumberOf "Example"
4458 def NumberOfSubShapes(self, theShape, theShapeType):
4460 Gives quantity of sub-shapes of type theShapeType in the given shape.
4463 theShape Shape to count sub-shapes of.
4464 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4467 Quantity of sub-shapes of given type.
4469 # Example: see GEOM_TestOthers.py
4470 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4471 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4474 ## Gives quantity of solids in the given shape.
4475 # @param theShape Shape to count solids in.
4476 # @return Quantity of solids.
4478 # @ref swig_NumberOf "Example"
4479 def NumberOfSolids(self, theShape):
4481 Gives quantity of solids in the given shape.
4484 theShape Shape to count solids in.
4489 # Example: see GEOM_TestOthers.py
4490 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4491 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4497 ## @addtogroup l3_healing
4500 ## Reverses an orientation the given shape.
4501 # @param theShape Shape to be reversed.
4502 # @param theName Object name; when specified, this parameter is used
4503 # for result publication in the study. Otherwise, if automatic
4504 # publication is switched on, default value is used for result name.
4506 # @return The reversed copy of theShape.
4508 # @ref swig_ChangeOrientation "Example"
4509 def ChangeOrientation(self, theShape, theName=None):
4511 Reverses an orientation the given shape.
4514 theShape Shape to be reversed.
4515 theName Object name; when specified, this parameter is used
4516 for result publication in the study. Otherwise, if automatic
4517 publication is switched on, default value is used for result name.
4520 The reversed copy of theShape.
4522 # Example: see GEOM_TestAll.py
4523 anObj = self.ShapesOp.ChangeOrientation(theShape)
4524 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4525 self._autoPublish(anObj, theName, "reversed")
4528 ## See ChangeOrientation() method for details.
4530 # @ref swig_OrientationChange "Example"
4531 def OrientationChange(self, theShape, theName=None):
4533 See geompy.ChangeOrientation method for details.
4535 # Example: see GEOM_TestOthers.py
4536 # note: auto-publishing is done in self.ChangeOrientation()
4537 anObj = self.ChangeOrientation(theShape, theName)
4543 ## @addtogroup l4_obtain
4546 ## Retrieve all free faces from the given shape.
4547 # Free face is a face, which is not shared between two shells of the shape.
4548 # @param theShape Shape to find free faces in.
4549 # @return List of IDs of all free faces, contained in theShape.
4551 # @ref tui_measurement_tools_page "Example"
4552 def GetFreeFacesIDs(self,theShape):
4554 Retrieve all free faces from the given shape.
4555 Free face is a face, which is not shared between two shells of the shape.
4558 theShape Shape to find free faces in.
4561 List of IDs of all free faces, contained in theShape.
4563 # Example: see GEOM_TestOthers.py
4564 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4565 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4568 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4569 # @param theShape1 Shape to find sub-shapes in.
4570 # @param theShape2 Shape to find shared sub-shapes with.
4571 # @param theShapeType Type of sub-shapes to be retrieved.
4572 # @param theName Object name; when specified, this parameter is used
4573 # for result publication in the study. Otherwise, if automatic
4574 # publication is switched on, default value is used for result name.
4576 # @return List of sub-shapes of theShape1, shared with theShape2.
4578 # @ref swig_GetSharedShapes "Example"
4579 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4581 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4584 theShape1 Shape to find sub-shapes in.
4585 theShape2 Shape to find shared sub-shapes with.
4586 theShapeType Type of sub-shapes to be retrieved.
4587 theName Object name; when specified, this parameter is used
4588 for result publication in the study. Otherwise, if automatic
4589 publication is switched on, default value is used for result name.
4592 List of sub-shapes of theShape1, shared with theShape2.
4594 # Example: see GEOM_TestOthers.py
4595 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4596 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4597 self._autoPublish(aList, theName, "shared")
4600 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4601 # @param theShapes Shapes to find common sub-shapes of.
4602 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4603 # @param theName Object name; when specified, this parameter is used
4604 # for result publication in the study. Otherwise, if automatic
4605 # publication is switched on, default value is used for result name.
4607 # @return List of objects, that are sub-shapes of all given shapes.
4609 # @ref swig_GetSharedShapes "Example"
4610 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4612 Get all sub-shapes, shared by all shapes in the list theShapes.
4615 theShapes Shapes to find common sub-shapes of.
4616 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4617 theName Object name; when specified, this parameter is used
4618 for result publication in the study. Otherwise, if automatic
4619 publication is switched on, default value is used for result name.
4622 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4624 # Example: see GEOM_TestOthers.py
4625 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4626 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4627 self._autoPublish(aList, theName, "shared")
4630 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4631 # situated relatively the specified plane by the certain way,
4632 # defined through <VAR>theState</VAR> parameter.
4633 # @param theShape Shape to find sub-shapes of.
4634 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4635 # @param theAx1 Vector (or line, or linear edge), specifying normal
4636 # direction and location of the plane to find shapes on.
4637 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4638 # @param theName Object name; when specified, this parameter is used
4639 # for result publication in the study. Otherwise, if automatic
4640 # publication is switched on, default value is used for result name.
4642 # @return List of all found sub-shapes.
4644 # @ref swig_GetShapesOnPlane "Example"
4645 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4647 Find in theShape all sub-shapes of type theShapeType,
4648 situated relatively the specified plane by the certain way,
4649 defined through theState parameter.
4652 theShape Shape to find sub-shapes of.
4653 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4654 theAx1 Vector (or line, or linear edge), specifying normal
4655 direction and location of the plane to find shapes on.
4656 theState The state of the sub-shapes to find (see GEOM::shape_state)
4657 theName Object name; when specified, this parameter is used
4658 for result publication in the study. Otherwise, if automatic
4659 publication is switched on, default value is used for result name.
4662 List of all found sub-shapes.
4664 # Example: see GEOM_TestOthers.py
4665 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4666 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4667 self._autoPublish(aList, theName, "shapeOnPlane")
4670 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4671 # situated relatively the specified plane by the certain way,
4672 # defined through <VAR>theState</VAR> parameter.
4673 # @param theShape Shape to find sub-shapes of.
4674 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4675 # @param theAx1 Vector (or line, or linear edge), specifying normal
4676 # direction and location of the plane to find shapes on.
4677 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4679 # @return List of all found sub-shapes indices.
4681 # @ref swig_GetShapesOnPlaneIDs "Example"
4682 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4684 Find in theShape all sub-shapes of type theShapeType,
4685 situated relatively the specified plane by the certain way,
4686 defined through theState parameter.
4689 theShape Shape to find sub-shapes of.
4690 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4691 theAx1 Vector (or line, or linear edge), specifying normal
4692 direction and location of the plane to find shapes on.
4693 theState The state of the sub-shapes to find (see GEOM::shape_state)
4696 List of all found sub-shapes indices.
4698 # Example: see GEOM_TestOthers.py
4699 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4700 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4703 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4704 # situated relatively the specified plane by the certain way,
4705 # defined through <VAR>theState</VAR> parameter.
4706 # @param theShape Shape to find sub-shapes of.
4707 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4708 # @param theAx1 Vector (or line, or linear edge), specifying normal
4709 # direction of the plane to find shapes on.
4710 # @param thePnt Point specifying location of the plane to find shapes on.
4711 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4712 # @param theName Object name; when specified, this parameter is used
4713 # for result publication in the study. Otherwise, if automatic
4714 # publication is switched on, default value is used for result name.
4716 # @return List of all found sub-shapes.
4718 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4719 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4721 Find in theShape all sub-shapes of type theShapeType,
4722 situated relatively the specified plane by the certain way,
4723 defined through theState parameter.
4726 theShape Shape to find sub-shapes of.
4727 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4728 theAx1 Vector (or line, or linear edge), specifying normal
4729 direction and location of the plane to find shapes on.
4730 thePnt Point specifying location of the plane to find shapes on.
4731 theState The state of the sub-shapes to find (see GEOM::shape_state)
4732 theName Object name; when specified, this parameter is used
4733 for result publication in the study. Otherwise, if automatic
4734 publication is switched on, default value is used for result name.
4737 List of all found sub-shapes.
4739 # Example: see GEOM_TestOthers.py
4740 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4741 theAx1, thePnt, theState)
4742 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4743 self._autoPublish(aList, theName, "shapeOnPlane")
4746 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4747 # situated relatively the specified plane by the certain way,
4748 # defined through <VAR>theState</VAR> parameter.
4749 # @param theShape Shape to find sub-shapes of.
4750 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4751 # @param theAx1 Vector (or line, or linear edge), specifying normal
4752 # direction of the plane to find shapes on.
4753 # @param thePnt Point specifying location of the plane to find shapes on.
4754 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4756 # @return List of all found sub-shapes indices.
4758 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4759 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4761 Find in theShape all sub-shapes of type theShapeType,
4762 situated relatively the specified plane by the certain way,
4763 defined through theState parameter.
4766 theShape Shape to find sub-shapes of.
4767 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4768 theAx1 Vector (or line, or linear edge), specifying normal
4769 direction and location of the plane to find shapes on.
4770 thePnt Point specifying location of the plane to find shapes on.
4771 theState The state of the sub-shapes to find (see GEOM::shape_state)
4774 List of all found sub-shapes indices.
4776 # Example: see GEOM_TestOthers.py
4777 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4778 theAx1, thePnt, theState)
4779 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4782 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4783 # the specified cylinder by the certain way, defined through \a theState parameter.
4784 # @param theShape Shape to find sub-shapes of.
4785 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4786 # @param theAxis Vector (or line, or linear edge), specifying
4787 # axis of the cylinder to find shapes on.
4788 # @param theRadius Radius of the cylinder to find shapes on.
4789 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4790 # @param theName Object name; when specified, this parameter is used
4791 # for result publication in the study. Otherwise, if automatic
4792 # publication is switched on, default value is used for result name.
4794 # @return List of all found sub-shapes.
4796 # @ref swig_GetShapesOnCylinder "Example"
4797 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4799 Find in theShape all sub-shapes of type theShapeType, situated relatively
4800 the specified cylinder by the certain way, defined through theState parameter.
4803 theShape Shape to find sub-shapes of.
4804 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4805 theAxis Vector (or line, or linear edge), specifying
4806 axis of the cylinder to find shapes on.
4807 theRadius Radius of the cylinder to find shapes on.
4808 theState The state of the sub-shapes to find (see GEOM::shape_state)
4809 theName Object name; when specified, this parameter is used
4810 for result publication in the study. Otherwise, if automatic
4811 publication is switched on, default value is used for result name.
4814 List of all found sub-shapes.
4816 # Example: see GEOM_TestOthers.py
4817 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4818 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4819 self._autoPublish(aList, theName, "shapeOnCylinder")
4822 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4823 # the specified cylinder by the certain way, defined through \a theState parameter.
4824 # @param theShape Shape to find sub-shapes of.
4825 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4826 # @param theAxis Vector (or line, or linear edge), specifying
4827 # axis of the cylinder to find shapes on.
4828 # @param theRadius Radius of the cylinder to find shapes on.
4829 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4831 # @return List of all found sub-shapes indices.
4833 # @ref swig_GetShapesOnCylinderIDs "Example"
4834 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4836 Find in theShape all sub-shapes of type theShapeType, situated relatively
4837 the specified cylinder by the certain way, defined through theState parameter.
4840 theShape Shape to find sub-shapes of.
4841 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4842 theAxis Vector (or line, or linear edge), specifying
4843 axis of the cylinder to find shapes on.
4844 theRadius Radius of the cylinder to find shapes on.
4845 theState The state of the sub-shapes to find (see GEOM::shape_state)
4848 List of all found sub-shapes indices.
4850 # Example: see GEOM_TestOthers.py
4851 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4852 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4855 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4856 # the specified cylinder by the certain way, defined through \a theState parameter.
4857 # @param theShape Shape to find sub-shapes of.
4858 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4859 # @param theAxis Vector (or line, or linear edge), specifying
4860 # axis of the cylinder to find shapes on.
4861 # @param thePnt Point specifying location of the bottom of the cylinder.
4862 # @param theRadius Radius of the cylinder to find shapes on.
4863 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4864 # @param theName Object name; when specified, this parameter is used
4865 # for result publication in the study. Otherwise, if automatic
4866 # publication is switched on, default value is used for result name.
4868 # @return List of all found sub-shapes.
4870 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4871 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4873 Find in theShape all sub-shapes of type theShapeType, situated relatively
4874 the specified cylinder by the certain way, defined through theState parameter.
4877 theShape Shape to find sub-shapes of.
4878 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4879 theAxis Vector (or line, or linear edge), specifying
4880 axis of the cylinder to find shapes on.
4881 theRadius Radius of the cylinder to find shapes on.
4882 theState The state of the sub-shapes to find (see GEOM::shape_state)
4883 theName Object name; when specified, this parameter is used
4884 for result publication in the study. Otherwise, if automatic
4885 publication is switched on, default value is used for result name.
4888 List of all found sub-shapes.
4890 # Example: see GEOM_TestOthers.py
4891 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4892 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4893 self._autoPublish(aList, theName, "shapeOnCylinder")
4896 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4897 # the specified cylinder by the certain way, defined through \a theState parameter.
4898 # @param theShape Shape to find sub-shapes of.
4899 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4900 # @param theAxis Vector (or line, or linear edge), specifying
4901 # axis of the cylinder to find shapes on.
4902 # @param thePnt Point specifying location of the bottom of the cylinder.
4903 # @param theRadius Radius of the cylinder to find shapes on.
4904 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4906 # @return List of all found sub-shapes indices
4908 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4909 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4911 Find in theShape all sub-shapes of type theShapeType, situated relatively
4912 the specified cylinder by the certain way, defined through theState parameter.
4915 theShape Shape to find sub-shapes of.
4916 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4917 theAxis Vector (or line, or linear edge), specifying
4918 axis of the cylinder to find shapes on.
4919 theRadius Radius of the cylinder to find shapes on.
4920 theState The state of the sub-shapes to find (see GEOM::shape_state)
4923 List of all found sub-shapes indices.
4925 # Example: see GEOM_TestOthers.py
4926 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4927 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4930 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4931 # the specified sphere by the certain way, defined through \a theState parameter.
4932 # @param theShape Shape to find sub-shapes of.
4933 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4934 # @param theCenter Point, specifying center of the sphere to find shapes on.
4935 # @param theRadius Radius of the sphere to find shapes on.
4936 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4937 # @param theName Object name; when specified, this parameter is used
4938 # for result publication in the study. Otherwise, if automatic
4939 # publication is switched on, default value is used for result name.
4941 # @return List of all found sub-shapes.
4943 # @ref swig_GetShapesOnSphere "Example"
4944 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4946 Find in theShape all sub-shapes of type theShapeType, situated relatively
4947 the specified sphere by the certain way, defined through theState parameter.
4950 theShape Shape to find sub-shapes of.
4951 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4952 theCenter Point, specifying center of the sphere to find shapes on.
4953 theRadius Radius of the sphere to find shapes on.
4954 theState The state of the sub-shapes to find (see GEOM::shape_state)
4955 theName Object name; when specified, this parameter is used
4956 for result publication in the study. Otherwise, if automatic
4957 publication is switched on, default value is used for result name.
4960 List of all found sub-shapes.
4962 # Example: see GEOM_TestOthers.py
4963 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4964 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4965 self._autoPublish(aList, theName, "shapeOnSphere")
4968 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4969 # the specified sphere by the certain way, defined through \a theState parameter.
4970 # @param theShape Shape to find sub-shapes of.
4971 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4972 # @param theCenter Point, specifying center of the sphere to find shapes on.
4973 # @param theRadius Radius of the sphere to find shapes on.
4974 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4976 # @return List of all found sub-shapes indices.
4978 # @ref swig_GetShapesOnSphereIDs "Example"
4979 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4981 Find in theShape all sub-shapes of type theShapeType, situated relatively
4982 the specified sphere by the certain way, defined through theState parameter.
4985 theShape Shape to find sub-shapes of.
4986 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4987 theCenter Point, specifying center of the sphere to find shapes on.
4988 theRadius Radius of the sphere to find shapes on.
4989 theState The state of the sub-shapes to find (see GEOM::shape_state)
4992 List of all found sub-shapes indices.
4994 # Example: see GEOM_TestOthers.py
4995 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4996 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4999 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5000 # the specified quadrangle by the certain way, defined through \a theState parameter.
5001 # @param theShape Shape to find sub-shapes of.
5002 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5003 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5004 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5005 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5006 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5007 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5008 # @param theName Object name; when specified, this parameter is used
5009 # for result publication in the study. Otherwise, if automatic
5010 # publication is switched on, default value is used for result name.
5012 # @return List of all found sub-shapes.
5014 # @ref swig_GetShapesOnQuadrangle "Example"
5015 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5016 theTopLeftPoint, theTopRigthPoint,
5017 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5019 Find in theShape all sub-shapes of type theShapeType, situated relatively
5020 the specified quadrangle by the certain way, defined through theState parameter.
5023 theShape Shape to find sub-shapes of.
5024 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5025 theTopLeftPoint Point, specifying top left corner of a quadrangle
5026 theTopRigthPoint Point, specifying top right corner of a quadrangle
5027 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5028 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5029 theState The state of the sub-shapes to find (see GEOM::shape_state)
5030 theName Object name; when specified, this parameter is used
5031 for result publication in the study. Otherwise, if automatic
5032 publication is switched on, default value is used for result name.
5035 List of all found sub-shapes.
5037 # Example: see GEOM_TestOthers.py
5038 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5039 theTopLeftPoint, theTopRigthPoint,
5040 theBottomLeftPoint, theBottomRigthPoint, theState)
5041 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5042 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5045 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5046 # the specified quadrangle by the certain way, defined through \a theState parameter.
5047 # @param theShape Shape to find sub-shapes of.
5048 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5049 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5050 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5051 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5052 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5053 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5055 # @return List of all found sub-shapes indices.
5057 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5058 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5059 theTopLeftPoint, theTopRigthPoint,
5060 theBottomLeftPoint, theBottomRigthPoint, theState):
5062 Find in theShape all sub-shapes of type theShapeType, situated relatively
5063 the specified quadrangle by the certain way, defined through theState parameter.
5066 theShape Shape to find sub-shapes of.
5067 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5068 theTopLeftPoint Point, specifying top left corner of a quadrangle
5069 theTopRigthPoint Point, specifying top right corner of a quadrangle
5070 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5071 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5072 theState The state of the sub-shapes to find (see GEOM::shape_state)
5075 List of all found sub-shapes indices.
5078 # Example: see GEOM_TestOthers.py
5079 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5080 theTopLeftPoint, theTopRigthPoint,
5081 theBottomLeftPoint, theBottomRigthPoint, theState)
5082 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5085 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5086 # the specified \a theBox by the certain way, defined through \a theState parameter.
5087 # @param theBox Shape for relative comparing.
5088 # @param theShape Shape to find sub-shapes of.
5089 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5090 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5091 # @param theName Object name; when specified, this parameter is used
5092 # for result publication in the study. Otherwise, if automatic
5093 # publication is switched on, default value is used for result name.
5095 # @return List of all found sub-shapes.
5097 # @ref swig_GetShapesOnBox "Example"
5098 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5100 Find in theShape all sub-shapes of type theShapeType, situated relatively
5101 the specified theBox by the certain way, defined through theState parameter.
5104 theBox Shape for relative comparing.
5105 theShape Shape to find sub-shapes of.
5106 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5107 theState The state of the sub-shapes to find (see GEOM::shape_state)
5108 theName Object name; when specified, this parameter is used
5109 for result publication in the study. Otherwise, if automatic
5110 publication is switched on, default value is used for result name.
5113 List of all found sub-shapes.
5115 # Example: see GEOM_TestOthers.py
5116 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5117 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5118 self._autoPublish(aList, theName, "shapeOnBox")
5121 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5122 # the specified \a theBox by the certain way, defined through \a theState parameter.
5123 # @param theBox Shape for relative comparing.
5124 # @param theShape Shape to find sub-shapes of.
5125 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5126 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5128 # @return List of all found sub-shapes indices.
5130 # @ref swig_GetShapesOnBoxIDs "Example"
5131 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5133 Find in theShape all sub-shapes of type theShapeType, situated relatively
5134 the specified theBox by the certain way, defined through theState parameter.
5137 theBox Shape for relative comparing.
5138 theShape Shape to find sub-shapes of.
5139 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5140 theState The state of the sub-shapes to find (see GEOM::shape_state)
5143 List of all found sub-shapes indices.
5145 # Example: see GEOM_TestOthers.py
5146 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5147 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5150 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5151 # situated relatively the specified \a theCheckShape by the
5152 # certain way, defined through \a theState parameter.
5153 # @param theCheckShape Shape for relative comparing. It must be a solid.
5154 # @param theShape Shape to find sub-shapes of.
5155 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5156 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5157 # @param theName Object name; when specified, this parameter is used
5158 # for result publication in the study. Otherwise, if automatic
5159 # publication is switched on, default value is used for result name.
5161 # @return List of all found sub-shapes.
5163 # @ref swig_GetShapesOnShape "Example"
5164 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5166 Find in theShape all sub-shapes of type theShapeType,
5167 situated relatively the specified theCheckShape by the
5168 certain way, defined through theState parameter.
5171 theCheckShape Shape for relative comparing. It must be a solid.
5172 theShape Shape to find sub-shapes of.
5173 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5174 theState The state of the sub-shapes to find (see GEOM::shape_state)
5175 theName Object name; when specified, this parameter is used
5176 for result publication in the study. Otherwise, if automatic
5177 publication is switched on, default value is used for result name.
5180 List of all found sub-shapes.
5182 # Example: see GEOM_TestOthers.py
5183 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5184 theShapeType, theState)
5185 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5186 self._autoPublish(aList, theName, "shapeOnShape")
5189 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5190 # situated relatively the specified \a theCheckShape by the
5191 # certain way, defined through \a theState parameter.
5192 # @param theCheckShape Shape for relative comparing. It must be a solid.
5193 # @param theShape Shape to find sub-shapes of.
5194 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5195 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5196 # @param theName Object name; when specified, this parameter is used
5197 # for result publication in the study. Otherwise, if automatic
5198 # publication is switched on, default value is used for result name.
5200 # @return All found sub-shapes as compound.
5202 # @ref swig_GetShapesOnShapeAsCompound "Example"
5203 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5205 Find in theShape all sub-shapes of type theShapeType,
5206 situated relatively the specified theCheckShape by the
5207 certain way, defined through theState parameter.
5210 theCheckShape Shape for relative comparing. It must be a solid.
5211 theShape Shape to find sub-shapes of.
5212 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5213 theState The state of the sub-shapes to find (see GEOM::shape_state)
5214 theName Object name; when specified, this parameter is used
5215 for result publication in the study. Otherwise, if automatic
5216 publication is switched on, default value is used for result name.
5219 All found sub-shapes as compound.
5221 # Example: see GEOM_TestOthers.py
5222 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5223 theShapeType, theState)
5224 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5225 self._autoPublish(anObj, theName, "shapeOnShape")
5228 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5229 # situated relatively the specified \a theCheckShape by the
5230 # certain way, defined through \a theState parameter.
5231 # @param theCheckShape Shape for relative comparing. It must be a solid.
5232 # @param theShape Shape to find sub-shapes of.
5233 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5234 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5236 # @return List of all found sub-shapes indices.
5238 # @ref swig_GetShapesOnShapeIDs "Example"
5239 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5241 Find in theShape all sub-shapes of type theShapeType,
5242 situated relatively the specified theCheckShape by the
5243 certain way, defined through theState parameter.
5246 theCheckShape Shape for relative comparing. It must be a solid.
5247 theShape Shape to find sub-shapes of.
5248 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5249 theState The state of the sub-shapes to find (see GEOM::shape_state)
5252 List of all found sub-shapes indices.
5254 # Example: see GEOM_TestOthers.py
5255 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5256 theShapeType, theState)
5257 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5260 ## Get sub-shape(s) of theShapeWhere, which are
5261 # coincident with \a theShapeWhat or could be a part of it.
5262 # @param theShapeWhere Shape to find sub-shapes of.
5263 # @param theShapeWhat Shape, specifying what to find.
5264 # @param isNewImplementation implementation of GetInPlace functionality
5265 # (default = False, old alghorithm based on shape properties)
5266 # @param theName Object name; when specified, this parameter is used
5267 # for result publication in the study. Otherwise, if automatic
5268 # publication is switched on, default value is used for result name.
5270 # @return Group of all found sub-shapes or a single found sub-shape.
5272 # @note This function has a restriction on argument shapes.
5273 # If \a theShapeWhere has curved parts with significantly
5274 # outstanding centres (i.e. the mass centre of a part is closer to
5275 # \a theShapeWhat than to the part), such parts will not be found.
5276 # @image html get_in_place_lost_part.png
5278 # @ref swig_GetInPlace "Example"
5279 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5281 Get sub-shape(s) of theShapeWhere, which are
5282 coincident with theShapeWhat or could be a part of it.
5285 theShapeWhere Shape to find sub-shapes of.
5286 theShapeWhat Shape, specifying what to find.
5287 isNewImplementation Implementation of GetInPlace functionality
5288 (default = False, old alghorithm based on shape properties)
5289 theName Object name; when specified, this parameter is used
5290 for result publication in the study. Otherwise, if automatic
5291 publication is switched on, default value is used for result name.
5294 Group of all found sub-shapes or a single found sub-shape.
5298 This function has a restriction on argument shapes.
5299 If theShapeWhere has curved parts with significantly
5300 outstanding centres (i.e. the mass centre of a part is closer to
5301 theShapeWhat than to the part), such parts will not be found.
5303 # Example: see GEOM_TestOthers.py
5305 if isNewImplementation:
5306 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5308 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5310 RaiseIfFailed("GetInPlace", self.ShapesOp)
5311 self._autoPublish(anObj, theName, "inplace")
5314 ## Get sub-shape(s) of \a theShapeWhere, which are
5315 # coincident with \a theShapeWhat or could be a part of it.
5317 # Implementation of this method is based on a saved history of an operation,
5318 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5319 # arguments (an argument shape or a sub-shape of an argument shape).
5320 # The operation could be the Partition or one of boolean operations,
5321 # performed on simple shapes (not on compounds).
5323 # @param theShapeWhere Shape to find sub-shapes of.
5324 # @param theShapeWhat Shape, specifying what to find (must be in the
5325 # building history of the ShapeWhere).
5326 # @param theName Object name; when specified, this parameter is used
5327 # for result publication in the study. Otherwise, if automatic
5328 # publication is switched on, default value is used for result name.
5330 # @return Group of all found sub-shapes or a single found sub-shape.
5332 # @ref swig_GetInPlace "Example"
5333 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5335 Implementation of this method is based on a saved history of an operation,
5336 produced theShapeWhere. The theShapeWhat must be among this operation's
5337 arguments (an argument shape or a sub-shape of an argument shape).
5338 The operation could be the Partition or one of boolean operations,
5339 performed on simple shapes (not on compounds).
5342 theShapeWhere Shape to find sub-shapes of.
5343 theShapeWhat Shape, specifying what to find (must be in the
5344 building history of the ShapeWhere).
5345 theName Object name; when specified, this parameter is used
5346 for result publication in the study. Otherwise, if automatic
5347 publication is switched on, default value is used for result name.
5350 Group of all found sub-shapes or a single found sub-shape.
5352 # Example: see GEOM_TestOthers.py
5353 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5354 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5355 self._autoPublish(anObj, theName, "inplace")
5358 ## Get sub-shape of theShapeWhere, which is
5359 # equal to \a theShapeWhat.
5360 # @param theShapeWhere Shape to find sub-shape of.
5361 # @param theShapeWhat Shape, specifying what to find.
5362 # @param theName Object name; when specified, this parameter is used
5363 # for result publication in the study. Otherwise, if automatic
5364 # publication is switched on, default value is used for result name.
5366 # @return New GEOM.GEOM_Object for found sub-shape.
5368 # @ref swig_GetSame "Example"
5369 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5371 Get sub-shape of theShapeWhere, which is
5372 equal to theShapeWhat.
5375 theShapeWhere Shape to find sub-shape of.
5376 theShapeWhat Shape, specifying what to find.
5377 theName Object name; when specified, this parameter is used
5378 for result publication in the study. Otherwise, if automatic
5379 publication is switched on, default value is used for result name.
5382 New GEOM.GEOM_Object for found sub-shape.
5384 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5385 RaiseIfFailed("GetSame", self.ShapesOp)
5386 self._autoPublish(anObj, theName, "sameShape")
5390 ## Get sub-shape indices of theShapeWhere, which is
5391 # equal to \a theShapeWhat.
5392 # @param theShapeWhere Shape to find sub-shape of.
5393 # @param theShapeWhat Shape, specifying what to find.
5394 # @return List of all found sub-shapes indices.
5396 # @ref swig_GetSame "Example"
5397 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5399 Get sub-shape indices of theShapeWhere, which is
5400 equal to theShapeWhat.
5403 theShapeWhere Shape to find sub-shape of.
5404 theShapeWhat Shape, specifying what to find.
5407 List of all found sub-shapes indices.
5409 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5410 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5417 ## @addtogroup l4_access
5420 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5421 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5422 # @param aShape Shape to get sub-shape of.
5423 # @param ListOfID List of sub-shapes indices.
5424 # @param theName Object name; when specified, this parameter is used
5425 # for result publication in the study. Otherwise, if automatic
5426 # publication is switched on, default value is used for result name.
5428 # @return Found sub-shape.
5430 # @ref swig_all_decompose "Example"
5431 def GetSubShape(self, aShape, ListOfID, theName=None):
5433 Obtain a composite sub-shape of aShape, composed from sub-shapes
5434 of aShape, selected by their unique IDs inside aShape
5437 aShape Shape to get sub-shape of.
5438 ListOfID List of sub-shapes indices.
5439 theName Object name; when specified, this parameter is used
5440 for result publication in the study. Otherwise, if automatic
5441 publication is switched on, default value is used for result name.
5446 # Example: see GEOM_TestAll.py
5447 anObj = self.AddSubShape(aShape,ListOfID)
5448 self._autoPublish(anObj, theName, "subshape")
5451 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5452 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5453 # @param aShape Shape to get sub-shape of.
5454 # @param aSubShape Sub-shapes of aShape.
5455 # @return ID of found sub-shape.
5457 # @ref swig_all_decompose "Example"
5458 def GetSubShapeID(self, aShape, aSubShape):
5460 Obtain unique ID of sub-shape aSubShape inside aShape
5461 of aShape, selected by their unique IDs inside aShape
5464 aShape Shape to get sub-shape of.
5465 aSubShape Sub-shapes of aShape.
5468 ID of found sub-shape.
5470 # Example: see GEOM_TestAll.py
5471 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5472 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5475 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5476 # This function is provided for performance purpose. The complexity is O(n) with n
5477 # the number of subobjects of aShape
5478 # @param aShape Shape to get sub-shape of.
5479 # @param aSubShapes Sub-shapes of aShape.
5480 # @return list of IDs of found sub-shapes.
5482 # @ref swig_all_decompose "Example"
5483 def GetSubShapesIDs(self, aShape, aSubShapes):
5485 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5486 This function is provided for performance purpose. The complexity is O(n) with n
5487 the number of subobjects of aShape
5490 aShape Shape to get sub-shape of.
5491 aSubShapes Sub-shapes of aShape.
5494 List of IDs of found sub-shape.
5496 # Example: see GEOM_TestAll.py
5497 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5498 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5504 ## @addtogroup l4_decompose
5507 ## Get all sub-shapes and groups of \a theShape,
5508 # that were created already by any other methods.
5509 # @param theShape Any shape.
5510 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5511 # returned, else all found sub-shapes and groups.
5512 # @return List of existing sub-objects of \a theShape.
5514 # @ref swig_all_decompose "Example"
5515 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5517 Get all sub-shapes and groups of theShape,
5518 that were created already by any other methods.
5522 theGroupsOnly If this parameter is TRUE, only groups will be
5523 returned, else all found sub-shapes and groups.
5526 List of existing sub-objects of theShape.
5528 # Example: see GEOM_TestAll.py
5529 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5530 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5533 ## Get all groups of \a theShape,
5534 # that were created already by any other methods.
5535 # @param theShape Any shape.
5536 # @return List of existing groups of \a theShape.
5538 # @ref swig_all_decompose "Example"
5539 def GetGroups(self, theShape):
5541 Get all groups of theShape,
5542 that were created already by any other methods.
5548 List of existing groups of theShape.
5550 # Example: see GEOM_TestAll.py
5551 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5552 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5555 ## Explode a shape on sub-shapes of a given type.
5556 # If the shape itself matches the type, it is also returned.
5557 # @param aShape Shape to be exploded.
5558 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5559 # @param theName Object name; when specified, this parameter is used
5560 # for result publication in the study. Otherwise, if automatic
5561 # publication is switched on, default value is used for result name.
5563 # @return List of sub-shapes of type theShapeType, contained in theShape.
5565 # @ref swig_all_decompose "Example"
5566 def SubShapeAll(self, aShape, aType, theName=None):
5568 Explode a shape on sub-shapes of a given type.
5569 If the shape itself matches the type, it is also returned.
5572 aShape Shape to be exploded.
5573 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5574 theName Object name; when specified, this parameter is used
5575 for result publication in the study. Otherwise, if automatic
5576 publication is switched on, default value is used for result name.
5579 List of sub-shapes of type theShapeType, contained in theShape.
5581 # Example: see GEOM_TestAll.py
5582 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5583 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5584 self._autoPublish(ListObj, theName, "subshape")
5587 ## Explode a shape on sub-shapes of a given type.
5588 # @param aShape Shape to be exploded.
5589 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5590 # @return List of IDs of sub-shapes.
5592 # @ref swig_all_decompose "Example"
5593 def SubShapeAllIDs(self, aShape, aType):
5595 Explode a shape on sub-shapes of a given type.
5598 aShape Shape to be exploded (see geompy.ShapeType)
5599 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5602 List of IDs of sub-shapes.
5604 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5605 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5608 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5609 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5610 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5611 # @param aShape Shape to get sub-shape of.
5612 # @param ListOfInd List of sub-shapes indices.
5613 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5614 # @param theName Object name; when specified, this parameter is used
5615 # for result publication in the study. Otherwise, if automatic
5616 # publication is switched on, default value is used for result name.
5618 # @return A compound of sub-shapes of aShape.
5620 # @ref swig_all_decompose "Example"
5621 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5623 Obtain a compound of sub-shapes of aShape,
5624 selected by their indices in list of all sub-shapes of type aType.
5625 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5628 aShape Shape to get sub-shape of.
5629 ListOfID List of sub-shapes indices.
5630 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5631 theName Object name; when specified, this parameter is used
5632 for result publication in the study. Otherwise, if automatic
5633 publication is switched on, default value is used for result name.
5636 A compound of sub-shapes of aShape.
5638 # Example: see GEOM_TestAll.py
5640 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5641 for ind in ListOfInd:
5642 ListOfIDs.append(AllShapeIDsList[ind - 1])
5643 # note: auto-publishing is done in self.GetSubShape()
5644 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5647 ## Explode a shape on sub-shapes of a given type.
5648 # Sub-shapes will be sorted by coordinates of their gravity centers.
5649 # If the shape itself matches the type, it is also returned.
5650 # @param aShape Shape to be exploded.
5651 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5652 # @param theName Object name; when specified, this parameter is used
5653 # for result publication in the study. Otherwise, if automatic
5654 # publication is switched on, default value is used for result name.
5656 # @return List of sub-shapes of type theShapeType, contained in theShape.
5658 # @ref swig_SubShapeAllSorted "Example"
5659 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5661 Explode a shape on sub-shapes of a given type.
5662 Sub-shapes will be sorted by coordinates of their gravity centers.
5663 If the shape itself matches the type, it is also returned.
5666 aShape Shape to be exploded.
5667 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5668 theName Object name; when specified, this parameter is used
5669 for result publication in the study. Otherwise, if automatic
5670 publication is switched on, default value is used for result name.
5673 List of sub-shapes of type theShapeType, contained in theShape.
5675 # Example: see GEOM_TestAll.py
5676 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5677 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5678 self._autoPublish(ListObj, theName, "subshape")
5681 ## Explode a shape on sub-shapes of a given type.
5682 # Sub-shapes will be sorted by coordinates of their gravity centers.
5683 # @param aShape Shape to be exploded.
5684 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5685 # @return List of IDs of sub-shapes.
5687 # @ref swig_all_decompose "Example"
5688 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5690 Explode a shape on sub-shapes of a given type.
5691 Sub-shapes will be sorted by coordinates of their gravity centers.
5694 aShape Shape to be exploded.
5695 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5698 List of IDs of sub-shapes.
5700 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5701 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5704 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5705 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5706 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5707 # @param aShape Shape to get sub-shape of.
5708 # @param ListOfInd List of sub-shapes indices.
5709 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5710 # @param theName Object name; when specified, this parameter is used
5711 # for result publication in the study. Otherwise, if automatic
5712 # publication is switched on, default value is used for result name.
5714 # @return A compound of sub-shapes of aShape.
5716 # @ref swig_all_decompose "Example"
5717 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5719 Obtain a compound of sub-shapes of aShape,
5720 selected by they indices in sorted list of all sub-shapes of type aType.
5721 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5724 aShape Shape to get sub-shape of.
5725 ListOfID List of sub-shapes indices.
5726 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5727 theName Object name; when specified, this parameter is used
5728 for result publication in the study. Otherwise, if automatic
5729 publication is switched on, default value is used for result name.
5732 A compound of sub-shapes of aShape.
5734 # Example: see GEOM_TestAll.py
5736 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5737 for ind in ListOfInd:
5738 ListOfIDs.append(AllShapeIDsList[ind - 1])
5739 # note: auto-publishing is done in self.GetSubShape()
5740 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5743 ## Extract shapes (excluding the main shape) of given type.
5744 # @param aShape The shape.
5745 # @param aType The shape type (see ShapeType())
5746 # @param isSorted Boolean flag to switch sorting on/off.
5747 # @param theName Object name; when specified, this parameter is used
5748 # for result publication in the study. Otherwise, if automatic
5749 # publication is switched on, default value is used for result name.
5751 # @return List of sub-shapes of type aType, contained in aShape.
5753 # @ref swig_FilletChamfer "Example"
5754 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5756 Extract shapes (excluding the main shape) of given type.
5760 aType The shape type (see geompy.ShapeType)
5761 isSorted Boolean flag to switch sorting on/off.
5762 theName Object name; when specified, this parameter is used
5763 for result publication in the study. Otherwise, if automatic
5764 publication is switched on, default value is used for result name.
5767 List of sub-shapes of type aType, contained in aShape.
5769 # Example: see GEOM_TestAll.py
5770 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5771 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5772 self._autoPublish(ListObj, theName, "subshape")
5775 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5776 # @param aShape Main shape.
5777 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5778 # @param theName Object name; when specified, this parameter is used
5779 # for result publication in the study. Otherwise, if automatic
5780 # publication is switched on, default value is used for result name.
5781 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5783 # @ref swig_all_decompose "Example"
5784 def SubShapes(self, aShape, anIDs, theName=None):
5786 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5790 anIDs List of unique IDs of sub-shapes inside theMainShape.
5791 theName Object name; when specified, this parameter is used
5792 for result publication in the study. Otherwise, if automatic
5793 publication is switched on, default value is used for result name.
5796 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5798 # Example: see GEOM_TestAll.py
5799 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5800 RaiseIfFailed("SubShapes", self.ShapesOp)
5801 self._autoPublish(ListObj, theName, "subshape")
5804 # end of l4_decompose
5807 ## @addtogroup l4_decompose_d
5810 ## Deprecated method
5811 # It works like SubShapeAllSortedCentres(), but wrongly
5812 # defines centres of faces, shells and solids.
5813 def SubShapeAllSorted(self, aShape, aType, theName=None):
5816 It works like geompy.SubShapeAllSortedCentres, but wrongly
5817 defines centres of faces, shells and solids.
5819 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5820 RaiseIfFailed("MakeExplode", self.ShapesOp)
5821 self._autoPublish(ListObj, theName, "subshape")
5824 ## Deprecated method
5825 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5826 # defines centres of faces, shells and solids.
5827 def SubShapeAllSortedIDs(self, aShape, aType):
5830 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5831 defines centres of faces, shells and solids.
5833 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5834 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5837 ## Deprecated method
5838 # It works like SubShapeSortedCentres(), but has a bug
5839 # (wrongly defines centres of faces, shells and solids).
5840 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5843 It works like geompy.SubShapeSortedCentres, but has a bug
5844 (wrongly defines centres of faces, shells and solids).
5847 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5848 for ind in ListOfInd:
5849 ListOfIDs.append(AllShapeIDsList[ind - 1])
5850 # note: auto-publishing is done in self.GetSubShape()
5851 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5854 # end of l4_decompose_d
5857 ## @addtogroup l3_healing
5860 ## Apply a sequence of Shape Healing operators to the given object.
5861 # @param theShape Shape to be processed.
5862 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5863 # @param theParameters List of names of parameters
5864 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5865 # @param theValues List of values of parameters, in the same order
5866 # as parameters are listed in <VAR>theParameters</VAR> list.
5867 # @param theName Object name; when specified, this parameter is used
5868 # for result publication in the study. Otherwise, if automatic
5869 # publication is switched on, default value is used for result name.
5871 # <b> Operators and Parameters: </b> \n
5873 # * \b FixShape - corrects invalid shapes. \n
5874 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5875 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5877 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5878 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5879 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5880 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5882 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5883 # surfaces in segments using a certain angle. \n
5884 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5885 # if Angle=180, four if Angle=90, etc). \n
5886 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5888 # * \b SplitClosedFaces - splits closed faces in segments.
5889 # The number of segments depends on the number of splitting points.\n
5890 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5892 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5893 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5894 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5895 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5896 # This and the previous parameters can take the following values:\n
5897 # \b Parametric \b Continuity \n
5898 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5899 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5900 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5901 # ruling out sharp edges).\n
5902 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5903 # are of the same magnitude).\n
5904 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5905 # or surfaces (d/du C(u)) are the same at junction. \n
5906 # \b Geometric \b Continuity \n
5907 # \b G1: first derivatives are proportional at junction.\n
5908 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5909 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5910 # \b G2: first and second derivatives are proportional at junction.
5911 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5912 # continuity requires that the underlying parameterization was continuous as well.
5913 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5915 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5916 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5917 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5918 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5919 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5920 # with the specified parameters.\n
5921 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5922 # with the specified parameters.\n
5923 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5924 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5925 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5926 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5928 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5929 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5930 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5931 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5932 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5934 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5935 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5938 # @return New GEOM.GEOM_Object, containing processed shape.
5940 # \n @ref tui_shape_processing "Example"
5941 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5943 Apply a sequence of Shape Healing operators to the given object.
5946 theShape Shape to be processed.
5947 theValues List of values of parameters, in the same order
5948 as parameters are listed in theParameters list.
5949 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5950 theParameters List of names of parameters
5951 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5952 theName Object name; when specified, this parameter is used
5953 for result publication in the study. Otherwise, if automatic
5954 publication is switched on, default value is used for result name.
5956 Operators and Parameters:
5958 * FixShape - corrects invalid shapes.
5959 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5960 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5961 * FixFaceSize - removes small faces, such as spots and strips.
5962 * FixFaceSize.Tolerance - defines minimum possible face size.
5963 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5964 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5965 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5966 in segments using a certain angle.
5967 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5968 if Angle=180, four if Angle=90, etc).
5969 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5970 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5972 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5973 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5974 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5975 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5976 * SplitContinuity.CurveContinuity - required continuity for curves.
5977 This and the previous parameters can take the following values:
5979 Parametric Continuity:
5980 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5981 coincidental. The curves or surfaces may still meet at an angle,
5982 giving rise to a sharp corner or edge).
5983 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5984 are parallel, ruling out sharp edges).
5985 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5986 or surfaces are of the same magnitude).
5987 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5988 curves or surfaces (d/du C(u)) are the same at junction.
5990 Geometric Continuity:
5991 G1: first derivatives are proportional at junction.
5992 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5993 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5994 G2: first and second derivatives are proportional at junction. As the names imply,
5995 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5996 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5997 geometric continuity of order n, but not vice-versa.
5998 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5999 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6000 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6001 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6002 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6003 the specified parameters.
6004 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6005 the specified parameters.
6006 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6007 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6008 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6009 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6010 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6011 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6012 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6013 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6014 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6015 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6016 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6019 New GEOM.GEOM_Object, containing processed shape.
6021 Note: For more information look through SALOME Geometry User's Guide->
6022 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6024 # Example: see GEOM_TestHealing.py
6025 theValues,Parameters = ParseList(theValues)
6026 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6027 # To avoid script failure in case of good argument shape
6028 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6030 RaiseIfFailed("ProcessShape", self.HealOp)
6031 for string in (theOperators + theParameters):
6032 Parameters = ":" + Parameters
6034 anObj.SetParameters(Parameters)
6035 self._autoPublish(anObj, theName, "healed")
6038 ## Remove faces from the given object (shape).
6039 # @param theObject Shape to be processed.
6040 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6041 # removes ALL faces of the given object.
6042 # @param theName Object name; when specified, this parameter is used
6043 # for result publication in the study. Otherwise, if automatic
6044 # publication is switched on, default value is used for result name.
6046 # @return New GEOM.GEOM_Object, containing processed shape.
6048 # @ref tui_suppress_faces "Example"
6049 def SuppressFaces(self, theObject, theFaces, theName=None):
6051 Remove faces from the given object (shape).
6054 theObject Shape to be processed.
6055 theFaces Indices of faces to be removed, if EMPTY then the method
6056 removes ALL faces of the given object.
6057 theName Object name; when specified, this parameter is used
6058 for result publication in the study. Otherwise, if automatic
6059 publication is switched on, default value is used for result name.
6062 New GEOM.GEOM_Object, containing processed shape.
6064 # Example: see GEOM_TestHealing.py
6065 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6066 RaiseIfFailed("SuppressFaces", self.HealOp)
6067 self._autoPublish(anObj, theName, "suppressFaces")
6070 ## Sewing of some shapes into single shape.
6071 # @param ListShape Shapes to be processed.
6072 # @param theTolerance Required tolerance value.
6073 # @param AllowNonManifold Flag that allows non-manifold sewing.
6074 # @param theName Object name; when specified, this parameter is used
6075 # for result publication in the study. Otherwise, if automatic
6076 # publication is switched on, default value is used for result name.
6078 # @return New GEOM.GEOM_Object, containing processed shape.
6080 # @ref tui_sewing "Example"
6081 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6083 Sewing of some shapes into single shape.
6086 ListShape Shapes to be processed.
6087 theTolerance Required tolerance value.
6088 AllowNonManifold Flag that allows non-manifold sewing.
6089 theName Object name; when specified, this parameter is used
6090 for result publication in the study. Otherwise, if automatic
6091 publication is switched on, default value is used for result name.
6094 New GEOM.GEOM_Object, containing processed shape.
6096 # Example: see GEOM_TestHealing.py
6097 comp = self.MakeCompound(ListShape)
6098 # note: auto-publishing is done in self.Sew()
6099 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6102 ## Sewing of the given object.
6103 # @param theObject Shape to be processed.
6104 # @param theTolerance Required tolerance value.
6105 # @param AllowNonManifold Flag that allows non-manifold sewing.
6106 # @param theName Object name; when specified, this parameter is used
6107 # for result publication in the study. Otherwise, if automatic
6108 # publication is switched on, default value is used for result name.
6110 # @return New GEOM.GEOM_Object, containing processed shape.
6111 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6113 Sewing of the given object.
6116 theObject Shape to be processed.
6117 theTolerance Required tolerance value.
6118 AllowNonManifold Flag that allows non-manifold sewing.
6119 theName Object name; when specified, this parameter is used
6120 for result publication in the study. Otherwise, if automatic
6121 publication is switched on, default value is used for result name.
6124 New GEOM.GEOM_Object, containing processed shape.
6126 # Example: see MakeSewing() above
6127 theTolerance,Parameters = ParseParameters(theTolerance)
6128 if AllowNonManifold:
6129 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6131 anObj = self.HealOp.Sew(theObject, theTolerance)
6132 # To avoid script failure in case of good argument shape
6133 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6135 RaiseIfFailed("Sew", self.HealOp)
6136 anObj.SetParameters(Parameters)
6137 self._autoPublish(anObj, theName, "sewed")
6140 ## Rebuild the topology of theCompound of solids by removing
6141 # of the faces that are shared by several solids.
6142 # @param theCompound Shape to be processed.
6143 # @param theName Object name; when specified, this parameter is used
6144 # for result publication in the study. Otherwise, if automatic
6145 # publication is switched on, default value is used for result name.
6147 # @return New GEOM.GEOM_Object, containing processed shape.
6149 # @ref tui_remove_webs "Example"
6150 def RemoveInternalFaces (self, theCompound, theName=None):
6152 Rebuild the topology of theCompound of solids by removing
6153 of the faces that are shared by several solids.
6156 theCompound Shape to be processed.
6157 theName Object name; when specified, this parameter is used
6158 for result publication in the study. Otherwise, if automatic
6159 publication is switched on, default value is used for result name.
6162 New GEOM.GEOM_Object, containing processed shape.
6164 # Example: see GEOM_TestHealing.py
6165 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6166 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6167 self._autoPublish(anObj, theName, "removeWebs")
6170 ## Remove internal wires and edges from the given object (face).
6171 # @param theObject Shape to be processed.
6172 # @param theWires Indices of wires to be removed, if EMPTY then the method
6173 # removes ALL internal wires of the given object.
6174 # @param theName Object name; when specified, this parameter is used
6175 # for result publication in the study. Otherwise, if automatic
6176 # publication is switched on, default value is used for result name.
6178 # @return New GEOM.GEOM_Object, containing processed shape.
6180 # @ref tui_suppress_internal_wires "Example"
6181 def SuppressInternalWires(self, theObject, theWires, theName=None):
6183 Remove internal wires and edges from the given object (face).
6186 theObject Shape to be processed.
6187 theWires Indices of wires to be removed, if EMPTY then the method
6188 removes ALL internal wires of the given object.
6189 theName Object name; when specified, this parameter is used
6190 for result publication in the study. Otherwise, if automatic
6191 publication is switched on, default value is used for result name.
6194 New GEOM.GEOM_Object, containing processed shape.
6196 # Example: see GEOM_TestHealing.py
6197 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6198 RaiseIfFailed("RemoveIntWires", self.HealOp)
6199 self._autoPublish(anObj, theName, "suppressWires")
6202 ## Remove internal closed contours (holes) from the given object.
6203 # @param theObject Shape to be processed.
6204 # @param theWires Indices of wires to be removed, if EMPTY then the method
6205 # removes ALL internal holes of the given object
6206 # @param theName Object name; when specified, this parameter is used
6207 # for result publication in the study. Otherwise, if automatic
6208 # publication is switched on, default value is used for result name.
6210 # @return New GEOM.GEOM_Object, containing processed shape.
6212 # @ref tui_suppress_holes "Example"
6213 def SuppressHoles(self, theObject, theWires, theName=None):
6215 Remove internal closed contours (holes) from the given object.
6218 theObject Shape to be processed.
6219 theWires Indices of wires to be removed, if EMPTY then the method
6220 removes ALL internal holes of the given object
6221 theName Object name; when specified, this parameter is used
6222 for result publication in the study. Otherwise, if automatic
6223 publication is switched on, default value is used for result name.
6226 New GEOM.GEOM_Object, containing processed shape.
6228 # Example: see GEOM_TestHealing.py
6229 anObj = self.HealOp.FillHoles(theObject, theWires)
6230 RaiseIfFailed("FillHoles", self.HealOp)
6231 self._autoPublish(anObj, theName, "suppressHoles")
6234 ## Close an open wire.
6235 # @param theObject Shape to be processed.
6236 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6237 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6238 # @param isCommonVertex If True : closure by creation of a common vertex,
6239 # If False : closure by creation of an edge between ends.
6240 # @param theName Object name; when specified, this parameter is used
6241 # for result publication in the study. Otherwise, if automatic
6242 # publication is switched on, default value is used for result name.
6244 # @return New GEOM.GEOM_Object, containing processed shape.
6246 # @ref tui_close_contour "Example"
6247 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6252 theObject Shape to be processed.
6253 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6254 if [ ], then theObject itself is a wire.
6255 isCommonVertex If True : closure by creation of a common vertex,
6256 If False : closure by creation of an edge between ends.
6257 theName Object name; when specified, this parameter is used
6258 for result publication in the study. Otherwise, if automatic
6259 publication is switched on, default value is used for result name.
6262 New GEOM.GEOM_Object, containing processed shape.
6264 # Example: see GEOM_TestHealing.py
6265 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6266 RaiseIfFailed("CloseContour", self.HealOp)
6267 self._autoPublish(anObj, theName, "closeContour")
6270 ## Addition of a point to a given edge object.
6271 # @param theObject Shape to be processed.
6272 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6273 # if -1, then theObject itself is the edge.
6274 # @param theValue Value of parameter on edge or length parameter,
6275 # depending on \a isByParameter.
6276 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6277 # if FALSE : \a theValue is treated as a length parameter [0..1]
6278 # @param theName Object name; when specified, this parameter is used
6279 # for result publication in the study. Otherwise, if automatic
6280 # publication is switched on, default value is used for result name.
6282 # @return New GEOM.GEOM_Object, containing processed shape.
6284 # @ref tui_add_point_on_edge "Example"
6285 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6287 Addition of a point to a given edge object.
6290 theObject Shape to be processed.
6291 theEdgeIndex Index of edge to be divided within theObject's shape,
6292 if -1, then theObject itself is the edge.
6293 theValue Value of parameter on edge or length parameter,
6294 depending on isByParameter.
6295 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6296 if FALSE : theValue is treated as a length parameter [0..1]
6297 theName Object name; when specified, this parameter is used
6298 for result publication in the study. Otherwise, if automatic
6299 publication is switched on, default value is used for result name.
6302 New GEOM.GEOM_Object, containing processed shape.
6304 # Example: see GEOM_TestHealing.py
6305 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6306 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6307 RaiseIfFailed("DivideEdge", self.HealOp)
6308 anObj.SetParameters(Parameters)
6309 self._autoPublish(anObj, theName, "divideEdge")
6312 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6313 # @param theWire Wire to minimize the number of C1 continuous edges in.
6314 # @param theVertices A list of vertices to suppress. If the list
6315 # is empty, all vertices in a wire will be assumed.
6316 # @param theName Object name; when specified, this parameter is used
6317 # for result publication in the study. Otherwise, if automatic
6318 # publication is switched on, default value is used for result name.
6320 # @return New GEOM.GEOM_Object with modified wire.
6322 # @ref tui_fuse_collinear_edges "Example"
6323 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6325 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6328 theWire Wire to minimize the number of C1 continuous edges in.
6329 theVertices A list of vertices to suppress. If the list
6330 is empty, all vertices in a wire will be assumed.
6331 theName Object name; when specified, this parameter is used
6332 for result publication in the study. Otherwise, if automatic
6333 publication is switched on, default value is used for result name.
6336 New GEOM.GEOM_Object with modified wire.
6338 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6339 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6340 self._autoPublish(anObj, theName, "fuseEdges")
6343 ## Change orientation of the given object. Updates given shape.
6344 # @param theObject Shape to be processed.
6345 # @return Updated <var>theObject</var>
6347 # @ref swig_todo "Example"
6348 def ChangeOrientationShell(self,theObject):
6350 Change orientation of the given object. Updates given shape.
6353 theObject Shape to be processed.
6358 theObject = self.HealOp.ChangeOrientation(theObject)
6359 RaiseIfFailed("ChangeOrientation", self.HealOp)
6362 ## Change orientation of the given object.
6363 # @param theObject Shape to be processed.
6364 # @param theName Object name; when specified, this parameter is used
6365 # for result publication in the study. Otherwise, if automatic
6366 # publication is switched on, default value is used for result name.
6368 # @return New GEOM.GEOM_Object, containing processed shape.
6370 # @ref swig_todo "Example"
6371 def ChangeOrientationShellCopy(self, theObject, theName=None):
6373 Change orientation of the given object.
6376 theObject Shape to be processed.
6377 theName Object name; when specified, this parameter is used
6378 for result publication in the study. Otherwise, if automatic
6379 publication is switched on, default value is used for result name.
6382 New GEOM.GEOM_Object, containing processed shape.
6384 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6385 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6386 self._autoPublish(anObj, theName, "reversed")
6389 ## Try to limit tolerance of the given object by value \a theTolerance.
6390 # @param theObject Shape to be processed.
6391 # @param theTolerance Required tolerance value.
6392 # @param theName Object name; when specified, this parameter is used
6393 # for result publication in the study. Otherwise, if automatic
6394 # publication is switched on, default value is used for result name.
6396 # @return New GEOM.GEOM_Object, containing processed shape.
6398 # @ref tui_limit_tolerance "Example"
6399 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6401 Try to limit tolerance of the given object by value theTolerance.
6404 theObject Shape to be processed.
6405 theTolerance Required tolerance value.
6406 theName Object name; when specified, this parameter is used
6407 for result publication in the study. Otherwise, if automatic
6408 publication is switched on, default value is used for result name.
6411 New GEOM.GEOM_Object, containing processed shape.
6413 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6414 RaiseIfFailed("LimitTolerance", self.HealOp)
6415 self._autoPublish(anObj, theName, "limitTolerance")
6418 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6419 # that constitute a free boundary of the given shape.
6420 # @param theObject Shape to get free boundary of.
6421 # @param theName Object name; when specified, this parameter is used
6422 # for result publication in the study. Otherwise, if automatic
6423 # publication is switched on, default value is used for result name.
6425 # @return [\a status, \a theClosedWires, \a theOpenWires]
6426 # \n \a status: FALSE, if an error(s) occured during the method execution.
6427 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6428 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6430 # @ref tui_measurement_tools_page "Example"
6431 def GetFreeBoundary(self, theObject, theName=None):
6433 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6434 that constitute a free boundary of the given shape.
6437 theObject Shape to get free boundary of.
6438 theName Object name; when specified, this parameter is used
6439 for result publication in the study. Otherwise, if automatic
6440 publication is switched on, default value is used for result name.
6443 [status, theClosedWires, theOpenWires]
6444 status: FALSE, if an error(s) occured during the method execution.
6445 theClosedWires: Closed wires on the free boundary of the given shape.
6446 theOpenWires: Open wires on the free boundary of the given shape.
6448 # Example: see GEOM_TestHealing.py
6449 anObj = self.HealOp.GetFreeBoundary(theObject)
6450 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6451 self._autoPublish(anObj[1], theName, "closedWire")
6452 self._autoPublish(anObj[2], theName, "openWire")
6455 ## Replace coincident faces in theShape by one face.
6456 # @param theShape Initial shape.
6457 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6458 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6459 # otherwise all initial shapes.
6460 # @param theName Object name; when specified, this parameter is used
6461 # for result publication in the study. Otherwise, if automatic
6462 # publication is switched on, default value is used for result name.
6464 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6466 # @ref tui_glue_faces "Example"
6467 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6469 Replace coincident faces in theShape by one face.
6472 theShape Initial shape.
6473 theTolerance Maximum distance between faces, which can be considered as coincident.
6474 doKeepNonSolids If FALSE, only solids will present in the result,
6475 otherwise all initial shapes.
6476 theName Object name; when specified, this parameter is used
6477 for result publication in the study. Otherwise, if automatic
6478 publication is switched on, default value is used for result name.
6481 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6483 # Example: see GEOM_Spanner.py
6484 theTolerance,Parameters = ParseParameters(theTolerance)
6485 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6487 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6488 anObj.SetParameters(Parameters)
6489 self._autoPublish(anObj, theName, "glueFaces")
6492 ## Find coincident faces in theShape for possible gluing.
6493 # @param theShape Initial shape.
6494 # @param theTolerance Maximum distance between faces,
6495 # which can be considered as coincident.
6496 # @param theName Object name; when specified, this parameter is used
6497 # for result publication in the study. Otherwise, if automatic
6498 # publication is switched on, default value is used for result name.
6500 # @return GEOM.ListOfGO
6502 # @ref tui_glue_faces "Example"
6503 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6505 Find coincident faces in theShape for possible gluing.
6508 theShape Initial shape.
6509 theTolerance Maximum distance between faces,
6510 which can be considered as coincident.
6511 theName Object name; when specified, this parameter is used
6512 for result publication in the study. Otherwise, if automatic
6513 publication is switched on, default value is used for result name.
6518 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6519 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6520 self._autoPublish(anObj, theName, "facesToGlue")
6523 ## Replace coincident faces in theShape by one face
6524 # in compliance with given list of faces
6525 # @param theShape Initial shape.
6526 # @param theTolerance Maximum distance between faces,
6527 # which can be considered as coincident.
6528 # @param theFaces List of faces for gluing.
6529 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6530 # otherwise all initial shapes.
6531 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6532 # will be glued, otherwise only the edges,
6533 # belonging to <VAR>theFaces</VAR>.
6534 # @param theName Object name; when specified, this parameter is used
6535 # for result publication in the study. Otherwise, if automatic
6536 # publication is switched on, default value is used for result name.
6538 # @return New GEOM.GEOM_Object, containing a copy of theShape
6539 # without some faces.
6541 # @ref tui_glue_faces "Example"
6542 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6543 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6545 Replace coincident faces in theShape by one face
6546 in compliance with given list of faces
6549 theShape Initial shape.
6550 theTolerance Maximum distance between faces,
6551 which can be considered as coincident.
6552 theFaces List of faces for gluing.
6553 doKeepNonSolids If FALSE, only solids will present in the result,
6554 otherwise all initial shapes.
6555 doGlueAllEdges If TRUE, all coincident edges of theShape
6556 will be glued, otherwise only the edges,
6557 belonging to theFaces.
6558 theName Object name; when specified, this parameter is used
6559 for result publication in the study. Otherwise, if automatic
6560 publication is switched on, default value is used for result name.
6563 New GEOM.GEOM_Object, containing a copy of theShape
6566 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6567 doKeepNonSolids, doGlueAllEdges)
6569 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6570 self._autoPublish(anObj, theName, "glueFaces")
6573 ## Replace coincident edges in theShape by one edge.
6574 # @param theShape Initial shape.
6575 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6576 # @param theName Object name; when specified, this parameter is used
6577 # for result publication in the study. Otherwise, if automatic
6578 # publication is switched on, default value is used for result name.
6580 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6582 # @ref tui_glue_edges "Example"
6583 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6585 Replace coincident edges in theShape by one edge.
6588 theShape Initial shape.
6589 theTolerance Maximum distance between edges, which can be considered as coincident.
6590 theName Object name; when specified, this parameter is used
6591 for result publication in the study. Otherwise, if automatic
6592 publication is switched on, default value is used for result name.
6595 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6597 theTolerance,Parameters = ParseParameters(theTolerance)
6598 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6600 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6601 anObj.SetParameters(Parameters)
6602 self._autoPublish(anObj, theName, "glueEdges")
6605 ## Find coincident edges in theShape for possible gluing.
6606 # @param theShape Initial shape.
6607 # @param theTolerance Maximum distance between edges,
6608 # which can be considered as coincident.
6609 # @param theName Object name; when specified, this parameter is used
6610 # for result publication in the study. Otherwise, if automatic
6611 # publication is switched on, default value is used for result name.
6613 # @return GEOM.ListOfGO
6615 # @ref tui_glue_edges "Example"
6616 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6618 Find coincident edges in theShape for possible gluing.
6621 theShape Initial shape.
6622 theTolerance Maximum distance between edges,
6623 which can be considered as coincident.
6624 theName Object name; when specified, this parameter is used
6625 for result publication in the study. Otherwise, if automatic
6626 publication is switched on, default value is used for result name.
6631 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6632 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6633 self._autoPublish(anObj, theName, "edgesToGlue")
6636 ## Replace coincident edges in theShape by one edge
6637 # in compliance with given list of edges.
6638 # @param theShape Initial shape.
6639 # @param theTolerance Maximum distance between edges,
6640 # which can be considered as coincident.
6641 # @param theEdges List of edges for gluing.
6642 # @param theName Object name; when specified, this parameter is used
6643 # for result publication in the study. Otherwise, if automatic
6644 # publication is switched on, default value is used for result name.
6646 # @return New GEOM.GEOM_Object, containing a copy of theShape
6647 # without some edges.
6649 # @ref tui_glue_edges "Example"
6650 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6652 Replace coincident edges in theShape by one edge
6653 in compliance with given list of edges.
6656 theShape Initial shape.
6657 theTolerance Maximum distance between edges,
6658 which can be considered as coincident.
6659 theEdges List of edges for gluing.
6660 theName Object name; when specified, this parameter is used
6661 for result publication in the study. Otherwise, if automatic
6662 publication is switched on, default value is used for result name.
6665 New GEOM.GEOM_Object, containing a copy of theShape
6668 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6670 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6671 self._autoPublish(anObj, theName, "glueEdges")
6677 ## @addtogroup l3_boolean Boolean Operations
6680 # -----------------------------------------------------------------------------
6681 # Boolean (Common, Cut, Fuse, Section)
6682 # -----------------------------------------------------------------------------
6684 ## Perform one of boolean operations on two given shapes.
6685 # @param theShape1 First argument for boolean operation.
6686 # @param theShape2 Second argument for boolean operation.
6687 # @param theOperation Indicates the operation to be done:\n
6688 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6689 # @param checkSelfInte The flag that tells if the arguments should
6690 # be checked for self-intersection prior to the operation.
6691 # @param theName Object name; when specified, this parameter is used
6692 # for result publication in the study. Otherwise, if automatic
6693 # publication is switched on, default value is used for result name.
6695 # @note This algorithm doesn't find all types of self-intersections.
6696 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6697 # vertex/face and edge/face intersections. Face/face
6698 # intersections detection is switched off as it is a
6699 # time-consuming operation that gives an impact on performance.
6700 # To find all self-intersections please use
6701 # CheckSelfIntersections() method.
6703 # @return New GEOM.GEOM_Object, containing the result shape.
6705 # @ref tui_fuse "Example"
6706 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6708 Perform one of boolean operations on two given shapes.
6711 theShape1 First argument for boolean operation.
6712 theShape2 Second argument for boolean operation.
6713 theOperation Indicates the operation to be done:
6714 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6715 checkSelfInte The flag that tells if the arguments should
6716 be checked for self-intersection prior to
6718 theName Object name; when specified, this parameter is used
6719 for result publication in the study. Otherwise, if automatic
6720 publication is switched on, default value is used for result name.
6723 This algorithm doesn't find all types of self-intersections.
6724 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6725 vertex/face and edge/face intersections. Face/face
6726 intersections detection is switched off as it is a
6727 time-consuming operation that gives an impact on performance.
6728 To find all self-intersections please use
6729 CheckSelfIntersections() method.
6732 New GEOM.GEOM_Object, containing the result shape.
6734 # Example: see GEOM_TestAll.py
6735 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6736 RaiseIfFailed("MakeBoolean", self.BoolOp)
6737 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6738 self._autoPublish(anObj, theName, def_names[theOperation])
6741 ## Perform Common boolean operation on two given shapes.
6742 # @param theShape1 First argument for boolean operation.
6743 # @param theShape2 Second argument for boolean operation.
6744 # @param checkSelfInte The flag that tells if the arguments should
6745 # be checked for self-intersection prior to the operation.
6746 # @param theName Object name; when specified, this parameter is used
6747 # for result publication in the study. Otherwise, if automatic
6748 # publication is switched on, default value is used for result name.
6750 # @note This algorithm doesn't find all types of self-intersections.
6751 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6752 # vertex/face and edge/face intersections. Face/face
6753 # intersections detection is switched off as it is a
6754 # time-consuming operation that gives an impact on performance.
6755 # To find all self-intersections please use
6756 # CheckSelfIntersections() method.
6758 # @return New GEOM.GEOM_Object, containing the result shape.
6760 # @ref tui_common "Example 1"
6761 # \n @ref swig_MakeCommon "Example 2"
6762 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6764 Perform Common boolean operation on two given shapes.
6767 theShape1 First argument for boolean operation.
6768 theShape2 Second argument for boolean operation.
6769 checkSelfInte The flag that tells if the arguments should
6770 be checked for self-intersection prior to
6772 theName Object name; when specified, this parameter is used
6773 for result publication in the study. Otherwise, if automatic
6774 publication is switched on, default value is used for result name.
6777 This algorithm doesn't find all types of self-intersections.
6778 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6779 vertex/face and edge/face intersections. Face/face
6780 intersections detection is switched off as it is a
6781 time-consuming operation that gives an impact on performance.
6782 To find all self-intersections please use
6783 CheckSelfIntersections() method.
6786 New GEOM.GEOM_Object, containing the result shape.
6788 # Example: see GEOM_TestOthers.py
6789 # note: auto-publishing is done in self.MakeBoolean()
6790 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6792 ## Perform Cut boolean operation on two given shapes.
6793 # @param theShape1 First argument for boolean operation.
6794 # @param theShape2 Second argument for boolean operation.
6795 # @param checkSelfInte The flag that tells if the arguments should
6796 # be checked for self-intersection prior to the operation.
6797 # @param theName Object name; when specified, this parameter is used
6798 # for result publication in the study. Otherwise, if automatic
6799 # publication is switched on, default value is used for result name.
6801 # @note This algorithm doesn't find all types of self-intersections.
6802 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6803 # vertex/face and edge/face intersections. Face/face
6804 # intersections detection is switched off as it is a
6805 # time-consuming operation that gives an impact on performance.
6806 # To find all self-intersections please use
6807 # CheckSelfIntersections() method.
6809 # @return New GEOM.GEOM_Object, containing the result shape.
6811 # @ref tui_cut "Example 1"
6812 # \n @ref swig_MakeCommon "Example 2"
6813 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6815 Perform Cut boolean operation on two given shapes.
6818 theShape1 First argument for boolean operation.
6819 theShape2 Second argument for boolean operation.
6820 checkSelfInte The flag that tells if the arguments should
6821 be checked for self-intersection prior to
6823 theName Object name; when specified, this parameter is used
6824 for result publication in the study. Otherwise, if automatic
6825 publication is switched on, default value is used for result name.
6828 This algorithm doesn't find all types of self-intersections.
6829 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6830 vertex/face and edge/face intersections. Face/face
6831 intersections detection is switched off as it is a
6832 time-consuming operation that gives an impact on performance.
6833 To find all self-intersections please use
6834 CheckSelfIntersections() method.
6837 New GEOM.GEOM_Object, containing the result shape.
6840 # Example: see GEOM_TestOthers.py
6841 # note: auto-publishing is done in self.MakeBoolean()
6842 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
6844 ## Perform Fuse boolean operation on two given shapes.
6845 # @param theShape1 First argument for boolean operation.
6846 # @param theShape2 Second argument for boolean operation.
6847 # @param checkSelfInte The flag that tells if the arguments should
6848 # be checked for self-intersection prior to the operation.
6849 # @param theName Object name; when specified, this parameter is used
6850 # for result publication in the study. Otherwise, if automatic
6851 # publication is switched on, default value is used for result name.
6853 # @note This algorithm doesn't find all types of self-intersections.
6854 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6855 # vertex/face and edge/face intersections. Face/face
6856 # intersections detection is switched off as it is a
6857 # time-consuming operation that gives an impact on performance.
6858 # To find all self-intersections please use
6859 # CheckSelfIntersections() method.
6861 # @return New GEOM.GEOM_Object, containing the result shape.
6863 # @ref tui_fuse "Example 1"
6864 # \n @ref swig_MakeCommon "Example 2"
6865 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6867 Perform Fuse boolean operation on two given shapes.
6870 theShape1 First argument for boolean operation.
6871 theShape2 Second argument for boolean operation.
6872 checkSelfInte The flag that tells if the arguments should
6873 be checked for self-intersection prior to
6875 theName Object name; when specified, this parameter is used
6876 for result publication in the study. Otherwise, if automatic
6877 publication is switched on, default value is used for result name.
6880 This algorithm doesn't find all types of self-intersections.
6881 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6882 vertex/face and edge/face intersections. Face/face
6883 intersections detection is switched off as it is a
6884 time-consuming operation that gives an impact on performance.
6885 To find all self-intersections please use
6886 CheckSelfIntersections() method.
6889 New GEOM.GEOM_Object, containing the result shape.
6892 # Example: see GEOM_TestOthers.py
6893 # note: auto-publishing is done in self.MakeBoolean()
6894 return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
6896 ## Perform Section boolean operation on two given shapes.
6897 # @param theShape1 First argument for boolean operation.
6898 # @param theShape2 Second argument for boolean operation.
6899 # @param checkSelfInte The flag that tells if the arguments should
6900 # be checked for self-intersection prior to the operation.
6901 # @param theName Object name; when specified, this parameter is used
6902 # for result publication in the study. Otherwise, if automatic
6903 # publication is switched on, default value is used for result name.
6905 # @note This algorithm doesn't find all types of self-intersections.
6906 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6907 # vertex/face and edge/face intersections. Face/face
6908 # intersections detection is switched off as it is a
6909 # time-consuming operation that gives an impact on performance.
6910 # To find all self-intersections please use
6911 # CheckSelfIntersections() method.
6913 # @return New GEOM.GEOM_Object, containing the result shape.
6915 # @ref tui_section "Example 1"
6916 # \n @ref swig_MakeCommon "Example 2"
6917 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6919 Perform Section boolean operation on two given shapes.
6922 theShape1 First argument for boolean operation.
6923 theShape2 Second argument for boolean operation.
6924 checkSelfInte The flag that tells if the arguments should
6925 be checked for self-intersection prior to
6927 theName Object name; when specified, this parameter is used
6928 for result publication in the study. Otherwise, if automatic
6929 publication is switched on, default value is used for result name.
6932 This algorithm doesn't find all types of self-intersections.
6933 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6934 vertex/face and edge/face intersections. Face/face
6935 intersections detection is switched off as it is a
6936 time-consuming operation that gives an impact on performance.
6937 To find all self-intersections please use
6938 CheckSelfIntersections() method.
6941 New GEOM.GEOM_Object, containing the result shape.
6944 # Example: see GEOM_TestOthers.py
6945 # note: auto-publishing is done in self.MakeBoolean()
6946 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
6948 ## Perform Fuse boolean operation on the list of shapes.
6949 # @param theShapesList Shapes to be fused.
6950 # @param checkSelfInte The flag that tells if the arguments should
6951 # be checked for self-intersection prior to the operation.
6952 # @param theName Object name; when specified, this parameter is used
6953 # for result publication in the study. Otherwise, if automatic
6954 # publication is switched on, default value is used for result name.
6956 # @note This algorithm doesn't find all types of self-intersections.
6957 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6958 # vertex/face and edge/face intersections. Face/face
6959 # intersections detection is switched off as it is a
6960 # time-consuming operation that gives an impact on performance.
6961 # To find all self-intersections please use
6962 # CheckSelfIntersections() method.
6964 # @return New GEOM.GEOM_Object, containing the result shape.
6966 # @ref tui_fuse "Example 1"
6967 # \n @ref swig_MakeCommon "Example 2"
6968 def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
6970 Perform Fuse boolean operation on the list of shapes.
6973 theShapesList Shapes to be fused.
6974 checkSelfInte The flag that tells if the arguments should
6975 be checked for self-intersection prior to
6977 theName Object name; when specified, this parameter is used
6978 for result publication in the study. Otherwise, if automatic
6979 publication is switched on, default value is used for result name.
6982 This algorithm doesn't find all types of self-intersections.
6983 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6984 vertex/face and edge/face intersections. Face/face
6985 intersections detection is switched off as it is a
6986 time-consuming operation that gives an impact on performance.
6987 To find all self-intersections please use
6988 CheckSelfIntersections() method.
6991 New GEOM.GEOM_Object, containing the result shape.
6994 # Example: see GEOM_TestOthers.py
6995 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
6996 RaiseIfFailed("MakeFuseList", self.BoolOp)
6997 self._autoPublish(anObj, theName, "fuse")
7000 ## Perform Common boolean operation on the list of shapes.
7001 # @param theShapesList Shapes for Common operation.
7002 # @param checkSelfInte The flag that tells if the arguments should
7003 # be checked for self-intersection prior to the operation.
7004 # @param theName Object name; when specified, this parameter is used
7005 # for result publication in the study. Otherwise, if automatic
7006 # publication is switched on, default value is used for result name.
7008 # @note This algorithm doesn't find all types of self-intersections.
7009 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7010 # vertex/face and edge/face intersections. Face/face
7011 # intersections detection is switched off as it is a
7012 # time-consuming operation that gives an impact on performance.
7013 # To find all self-intersections please use
7014 # CheckSelfIntersections() method.
7016 # @return New GEOM.GEOM_Object, containing the result shape.
7018 # @ref tui_common "Example 1"
7019 # \n @ref swig_MakeCommon "Example 2"
7020 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7022 Perform Common boolean operation on the list of shapes.
7025 theShapesList Shapes for Common operation.
7026 checkSelfInte The flag that tells if the arguments should
7027 be checked for self-intersection prior to
7029 theName Object name; when specified, this parameter is used
7030 for result publication in the study. Otherwise, if automatic
7031 publication is switched on, default value is used for result name.
7034 This algorithm doesn't find all types of self-intersections.
7035 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7036 vertex/face and edge/face intersections. Face/face
7037 intersections detection is switched off as it is a
7038 time-consuming operation that gives an impact on performance.
7039 To find all self-intersections please use
7040 CheckSelfIntersections() method.
7043 New GEOM.GEOM_Object, containing the result shape.
7046 # Example: see GEOM_TestOthers.py
7047 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7048 RaiseIfFailed("MakeCommonList", self.BoolOp)
7049 self._autoPublish(anObj, theName, "common")
7052 ## Perform Cut boolean operation on one object and the list of tools.
7053 # @param theMainShape The object of the operation.
7054 # @param theShapesList The list of tools of the operation.
7055 # @param checkSelfInte The flag that tells if the arguments should
7056 # be checked for self-intersection prior to the operation.
7057 # @param theName Object name; when specified, this parameter is used
7058 # for result publication in the study. Otherwise, if automatic
7059 # publication is switched on, default value is used for result name.
7061 # @note This algorithm doesn't find all types of self-intersections.
7062 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7063 # vertex/face and edge/face intersections. Face/face
7064 # intersections detection is switched off as it is a
7065 # time-consuming operation that gives an impact on performance.
7066 # To find all self-intersections please use
7067 # CheckSelfIntersections() method.
7069 # @return New GEOM.GEOM_Object, containing the result shape.
7071 # @ref tui_cut "Example 1"
7072 # \n @ref swig_MakeCommon "Example 2"
7073 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7075 Perform Cut boolean operation on one object and the list of tools.
7078 theMainShape The object of the operation.
7079 theShapesList The list of tools of the operation.
7080 checkSelfInte The flag that tells if the arguments should
7081 be checked for self-intersection prior to
7083 theName Object name; when specified, this parameter is used
7084 for result publication in the study. Otherwise, if automatic
7085 publication is switched on, default value is used for result name.
7088 This algorithm doesn't find all types of self-intersections.
7089 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7090 vertex/face and edge/face intersections. Face/face
7091 intersections detection is switched off as it is a
7092 time-consuming operation that gives an impact on performance.
7093 To find all self-intersections please use
7094 CheckSelfIntersections() method.
7097 New GEOM.GEOM_Object, containing the result shape.
7100 # Example: see GEOM_TestOthers.py
7101 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7102 RaiseIfFailed("MakeCutList", self.BoolOp)
7103 self._autoPublish(anObj, theName, "cut")
7109 ## @addtogroup l3_basic_op
7112 ## Perform partition operation.
7113 # @param ListShapes Shapes to be intersected.
7114 # @param ListTools Shapes to intersect theShapes.
7115 # @param Limit Type of resulting shapes (see ShapeType()).\n
7116 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7117 # type will be detected automatically.
7118 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7119 # target type (equal to Limit) are kept in the result,
7120 # else standalone shapes of lower dimension
7121 # are kept also (if they exist).
7123 # @param theName Object name; when specified, this parameter is used
7124 # for result publication in the study. Otherwise, if automatic
7125 # publication is switched on, default value is used for result name.
7127 # @note Each compound from ListShapes and ListTools will be exploded
7128 # in order to avoid possible intersection between shapes from this compound.
7130 # After implementation new version of PartitionAlgo (October 2006)
7131 # other parameters are ignored by current functionality. They are kept
7132 # in this function only for support old versions.
7133 # @param ListKeepInside Shapes, outside which the results will be deleted.
7134 # Each shape from theKeepInside must belong to theShapes also.
7135 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7136 # Each shape from theRemoveInside must belong to theShapes also.
7137 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7138 # @param ListMaterials Material indices for each shape. Make sence,
7139 # only if theRemoveWebs is TRUE.
7141 # @return New GEOM.GEOM_Object, containing the result shapes.
7143 # @ref tui_partition "Example"
7144 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7145 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7146 KeepNonlimitShapes=0, theName=None):
7148 Perform partition operation.
7151 ListShapes Shapes to be intersected.
7152 ListTools Shapes to intersect theShapes.
7153 Limit Type of resulting shapes (see geompy.ShapeType)
7154 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7155 type will be detected automatically.
7156 KeepNonlimitShapes if this parameter == 0, then only shapes of
7157 target type (equal to Limit) are kept in the result,
7158 else standalone shapes of lower dimension
7159 are kept also (if they exist).
7161 theName Object name; when specified, this parameter is used
7162 for result publication in the study. Otherwise, if automatic
7163 publication is switched on, default value is used for result name.
7165 Each compound from ListShapes and ListTools will be exploded
7166 in order to avoid possible intersection between shapes from
7169 After implementation new version of PartitionAlgo (October 2006) other
7170 parameters are ignored by current functionality. They are kept in this
7171 function only for support old versions.
7174 ListKeepInside Shapes, outside which the results will be deleted.
7175 Each shape from theKeepInside must belong to theShapes also.
7176 ListRemoveInside Shapes, inside which the results will be deleted.
7177 Each shape from theRemoveInside must belong to theShapes also.
7178 RemoveWebs If TRUE, perform Glue 3D algorithm.
7179 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7182 New GEOM.GEOM_Object, containing the result shapes.
7184 # Example: see GEOM_TestAll.py
7185 if Limit == self.ShapeType["AUTO"]:
7186 # automatic detection of the most appropriate shape limit type
7188 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7189 Limit = EnumToLong(lim)
7191 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7192 ListKeepInside, ListRemoveInside,
7193 Limit, RemoveWebs, ListMaterials,
7194 KeepNonlimitShapes);
7195 RaiseIfFailed("MakePartition", self.BoolOp)
7196 self._autoPublish(anObj, theName, "partition")
7199 ## Perform partition operation.
7200 # This method may be useful if it is needed to make a partition for
7201 # compound contains nonintersected shapes. Performance will be better
7202 # since intersection between shapes from compound is not performed.
7204 # Description of all parameters as in previous method MakePartition().
7205 # One additional parameter is provided:
7206 # @param checkSelfInte The flag that tells if the arguments should
7207 # be checked for self-intersection prior to the operation.
7209 # @note This algorithm doesn't find all types of self-intersections.
7210 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7211 # vertex/face and edge/face intersections. Face/face
7212 # intersections detection is switched off as it is a
7213 # time-consuming operation that gives an impact on performance.
7214 # To find all self-intersections please use
7215 # CheckSelfIntersections() method.
7217 # @note Passed compounds (via ListShapes or via ListTools)
7218 # have to consist of nonintersecting shapes.
7220 # @return New GEOM.GEOM_Object, containing the result shapes.
7222 # @ref swig_todo "Example"
7223 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7224 ListKeepInside=[], ListRemoveInside=[],
7225 Limit=ShapeType["AUTO"], RemoveWebs=0,
7226 ListMaterials=[], KeepNonlimitShapes=0,
7227 checkSelfInte=False, theName=None):
7229 Perform partition operation.
7230 This method may be useful if it is needed to make a partition for
7231 compound contains nonintersected shapes. Performance will be better
7232 since intersection between shapes from compound is not performed.
7235 Description of all parameters as in method geompy.MakePartition.
7236 One additional parameter is provided:
7237 checkSelfInte The flag that tells if the arguments should
7238 be checked for self-intersection prior to
7242 This algorithm doesn't find all types of self-intersections.
7243 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7244 vertex/face and edge/face intersections. Face/face
7245 intersections detection is switched off as it is a
7246 time-consuming operation that gives an impact on performance.
7247 To find all self-intersections please use
7248 CheckSelfIntersections() method.
7251 Passed compounds (via ListShapes or via ListTools)
7252 have to consist of nonintersecting shapes.
7255 New GEOM.GEOM_Object, containing the result shapes.
7257 if Limit == self.ShapeType["AUTO"]:
7258 # automatic detection of the most appropriate shape limit type
7260 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7261 Limit = EnumToLong(lim)
7263 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7264 ListKeepInside, ListRemoveInside,
7265 Limit, RemoveWebs, ListMaterials,
7266 KeepNonlimitShapes, checkSelfInte);
7267 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7268 self._autoPublish(anObj, theName, "partition")
7271 ## See method MakePartition() for more information.
7273 # @ref tui_partition "Example 1"
7274 # \n @ref swig_Partition "Example 2"
7275 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7276 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7277 KeepNonlimitShapes=0, theName=None):
7279 See method geompy.MakePartition for more information.
7281 # Example: see GEOM_TestOthers.py
7282 # note: auto-publishing is done in self.MakePartition()
7283 anObj = self.MakePartition(ListShapes, ListTools,
7284 ListKeepInside, ListRemoveInside,
7285 Limit, RemoveWebs, ListMaterials,
7286 KeepNonlimitShapes, theName);
7289 ## Perform partition of the Shape with the Plane
7290 # @param theShape Shape to be intersected.
7291 # @param thePlane Tool shape, to intersect theShape.
7292 # @param theName Object name; when specified, this parameter is used
7293 # for result publication in the study. Otherwise, if automatic
7294 # publication is switched on, default value is used for result name.
7296 # @return New GEOM.GEOM_Object, containing the result shape.
7298 # @ref tui_partition "Example"
7299 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7301 Perform partition of the Shape with the Plane
7304 theShape Shape to be intersected.
7305 thePlane Tool shape, to intersect theShape.
7306 theName Object name; when specified, this parameter is used
7307 for result publication in the study. Otherwise, if automatic
7308 publication is switched on, default value is used for result name.
7311 New GEOM.GEOM_Object, containing the result shape.
7313 # Example: see GEOM_TestAll.py
7314 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7315 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7316 self._autoPublish(anObj, theName, "partition")
7319 # end of l3_basic_op
7322 ## @addtogroup l3_transform
7325 ## Translate the given object along the vector, specified
7326 # by its end points.
7327 # @param theObject The object to be translated.
7328 # @param thePoint1 Start point of translation vector.
7329 # @param thePoint2 End point of translation vector.
7330 # @param theCopy Flag used to translate object itself or create a copy.
7331 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7332 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7333 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7335 Translate the given object along the vector, specified by its end points.
7338 theObject The object to be translated.
7339 thePoint1 Start point of translation vector.
7340 thePoint2 End point of translation vector.
7341 theCopy Flag used to translate object itself or create a copy.
7344 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7345 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7348 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7350 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7351 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7354 ## Translate the given object along the vector, specified
7355 # by its end points, creating its copy before the translation.
7356 # @param theObject The object to be translated.
7357 # @param thePoint1 Start point of translation vector.
7358 # @param thePoint2 End point of translation vector.
7359 # @param theName Object name; when specified, this parameter is used
7360 # for result publication in the study. Otherwise, if automatic
7361 # publication is switched on, default value is used for result name.
7363 # @return New GEOM.GEOM_Object, containing the translated object.
7365 # @ref tui_translation "Example 1"
7366 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7367 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7369 Translate the given object along the vector, specified
7370 by its end points, creating its copy before the translation.
7373 theObject The object to be translated.
7374 thePoint1 Start point of translation vector.
7375 thePoint2 End point of translation vector.
7376 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.
7381 New GEOM.GEOM_Object, containing the translated object.
7383 # Example: see GEOM_TestAll.py
7384 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7385 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7386 self._autoPublish(anObj, theName, "translated")
7389 ## Translate the given object along the vector, specified by its components.
7390 # @param theObject The object to be translated.
7391 # @param theDX,theDY,theDZ Components of translation vector.
7392 # @param theCopy Flag used to translate object itself or create a copy.
7393 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7394 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7396 # @ref tui_translation "Example"
7397 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7399 Translate the given object along the vector, specified by its components.
7402 theObject The object to be translated.
7403 theDX,theDY,theDZ Components of translation vector.
7404 theCopy Flag used to translate object itself or create a copy.
7407 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7408 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7410 # Example: see GEOM_TestAll.py
7411 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7413 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7415 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7416 anObj.SetParameters(Parameters)
7417 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7420 ## Translate the given object along the vector, specified
7421 # by its components, creating its copy before the translation.
7422 # @param theObject The object to be translated.
7423 # @param theDX,theDY,theDZ Components of translation vector.
7424 # @param theName Object name; when specified, this parameter is used
7425 # for result publication in the study. Otherwise, if automatic
7426 # publication is switched on, default value is used for result name.
7428 # @return New GEOM.GEOM_Object, containing the translated object.
7430 # @ref tui_translation "Example"
7431 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7433 Translate the given object along the vector, specified
7434 by its components, creating its copy before the translation.
7437 theObject The object to be translated.
7438 theDX,theDY,theDZ Components of translation vector.
7439 theName Object name; when specified, this parameter is used
7440 for result publication in the study. Otherwise, if automatic
7441 publication is switched on, default value is used for result name.
7444 New GEOM.GEOM_Object, containing the translated object.
7446 # Example: see GEOM_TestAll.py
7447 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7448 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7449 anObj.SetParameters(Parameters)
7450 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7451 self._autoPublish(anObj, theName, "translated")
7454 ## Translate the given object along the given vector.
7455 # @param theObject The object to be translated.
7456 # @param theVector The translation vector.
7457 # @param theCopy Flag used to translate object itself or create a copy.
7458 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7459 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7460 def TranslateVector(self, theObject, theVector, theCopy=False):
7462 Translate the given object along the given vector.
7465 theObject The object to be translated.
7466 theVector The translation vector.
7467 theCopy Flag used to translate object itself or create a copy.
7470 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7471 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7474 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7476 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7477 RaiseIfFailed("TranslateVector", self.TrsfOp)
7480 ## Translate the given object along the given vector,
7481 # creating its copy before the translation.
7482 # @param theObject The object to be translated.
7483 # @param theVector The translation vector.
7484 # @param theName Object name; when specified, this parameter is used
7485 # for result publication in the study. Otherwise, if automatic
7486 # publication is switched on, default value is used for result name.
7488 # @return New GEOM.GEOM_Object, containing the translated object.
7490 # @ref tui_translation "Example"
7491 def MakeTranslationVector(self, theObject, theVector, theName=None):
7493 Translate the given object along the given vector,
7494 creating its copy before the translation.
7497 theObject The object to be translated.
7498 theVector The translation vector.
7499 theName Object name; when specified, this parameter is used
7500 for result publication in the study. Otherwise, if automatic
7501 publication is switched on, default value is used for result name.
7504 New GEOM.GEOM_Object, containing the translated object.
7506 # Example: see GEOM_TestAll.py
7507 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7508 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7509 self._autoPublish(anObj, theName, "translated")
7512 ## Translate the given object along the given vector on given distance.
7513 # @param theObject The object to be translated.
7514 # @param theVector The translation vector.
7515 # @param theDistance The translation distance.
7516 # @param theCopy Flag used to translate object itself or create a copy.
7517 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7518 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7520 # @ref tui_translation "Example"
7521 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7523 Translate the given object along the given vector on given distance.
7526 theObject The object to be translated.
7527 theVector The translation vector.
7528 theDistance The translation distance.
7529 theCopy Flag used to translate object itself or create a copy.
7532 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7533 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7535 # Example: see GEOM_TestAll.py
7536 theDistance,Parameters = ParseParameters(theDistance)
7537 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7538 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7539 anObj.SetParameters(Parameters)
7542 ## Translate the given object along the given vector on given distance,
7543 # creating its copy before the translation.
7544 # @param theObject The object to be translated.
7545 # @param theVector The translation vector.
7546 # @param theDistance The translation distance.
7547 # @param theName Object name; when specified, this parameter is used
7548 # for result publication in the study. Otherwise, if automatic
7549 # publication is switched on, default value is used for result name.
7551 # @return New GEOM.GEOM_Object, containing the translated object.
7553 # @ref tui_translation "Example"
7554 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7556 Translate the given object along the given vector on given distance,
7557 creating its copy before the translation.
7560 theObject The object to be translated.
7561 theVector The translation vector.
7562 theDistance The translation distance.
7563 theName Object name; when specified, this parameter is used
7564 for result publication in the study. Otherwise, if automatic
7565 publication is switched on, default value is used for result name.
7568 New GEOM.GEOM_Object, containing the translated object.
7570 # Example: see GEOM_TestAll.py
7571 theDistance,Parameters = ParseParameters(theDistance)
7572 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7573 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7574 anObj.SetParameters(Parameters)
7575 self._autoPublish(anObj, theName, "translated")
7578 ## Rotate the given object around the given axis on the given angle.
7579 # @param theObject The object to be rotated.
7580 # @param theAxis Rotation axis.
7581 # @param theAngle Rotation angle in radians.
7582 # @param theCopy Flag used to rotate object itself or create a copy.
7584 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7585 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7587 # @ref tui_rotation "Example"
7588 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7590 Rotate the given object around the given axis on the given angle.
7593 theObject The object to be rotated.
7594 theAxis Rotation axis.
7595 theAngle Rotation angle in radians.
7596 theCopy Flag used to rotate object itself or create a copy.
7599 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7600 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7602 # Example: see GEOM_TestAll.py
7604 if isinstance(theAngle,str):
7606 theAngle, Parameters = ParseParameters(theAngle)
7608 theAngle = theAngle*math.pi/180.0
7610 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7612 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7613 RaiseIfFailed("Rotate", self.TrsfOp)
7614 anObj.SetParameters(Parameters)
7617 ## Rotate the given object around the given axis
7618 # on the given angle, creating its copy before the rotatation.
7619 # @param theObject The object to be rotated.
7620 # @param theAxis Rotation axis.
7621 # @param theAngle Rotation angle in radians.
7622 # @param theName Object name; when specified, this parameter is used
7623 # for result publication in the study. Otherwise, if automatic
7624 # publication is switched on, default value is used for result name.
7626 # @return New GEOM.GEOM_Object, containing the rotated object.
7628 # @ref tui_rotation "Example"
7629 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7631 Rotate the given object around the given axis
7632 on the given angle, creating its copy before the rotatation.
7635 theObject The object to be rotated.
7636 theAxis Rotation axis.
7637 theAngle Rotation angle in radians.
7638 theName Object name; when specified, this parameter is used
7639 for result publication in the study. Otherwise, if automatic
7640 publication is switched on, default value is used for result name.
7643 New GEOM.GEOM_Object, containing the rotated object.
7645 # Example: see GEOM_TestAll.py
7647 if isinstance(theAngle,str):
7649 theAngle, Parameters = ParseParameters(theAngle)
7651 theAngle = theAngle*math.pi/180.0
7652 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7653 RaiseIfFailed("RotateCopy", self.TrsfOp)
7654 anObj.SetParameters(Parameters)
7655 self._autoPublish(anObj, theName, "rotated")
7658 ## Rotate given object around vector perpendicular to plane
7659 # containing three points.
7660 # @param theObject The object to be rotated.
7661 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7662 # containing the three points.
7663 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7664 # @param theCopy Flag used to rotate object itself or create a copy.
7665 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7666 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7667 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7669 Rotate given object around vector perpendicular to plane
7670 containing three points.
7673 theObject The object to be rotated.
7674 theCentPoint central point the axis is the vector perpendicular to the plane
7675 containing the three points.
7676 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7677 theCopy Flag used to rotate object itself or create a copy.
7680 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7681 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7684 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7686 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7687 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7690 ## Rotate given object around vector perpendicular to plane
7691 # containing three points, creating its copy before the rotatation.
7692 # @param theObject The object to be rotated.
7693 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7694 # containing the three points.
7695 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7696 # @param theName Object name; when specified, this parameter is used
7697 # for result publication in the study. Otherwise, if automatic
7698 # publication is switched on, default value is used for result name.
7700 # @return New GEOM.GEOM_Object, containing the rotated object.
7702 # @ref tui_rotation "Example"
7703 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7705 Rotate given object around vector perpendicular to plane
7706 containing three points, creating its copy before the rotatation.
7709 theObject The object to be rotated.
7710 theCentPoint central point the axis is the vector perpendicular to the plane
7711 containing the three points.
7712 thePoint1,thePoint2 in a perpendicular plane of the axis.
7713 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.
7718 New GEOM.GEOM_Object, containing the rotated object.
7720 # Example: see GEOM_TestAll.py
7721 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7722 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7723 self._autoPublish(anObj, theName, "rotated")
7726 ## Scale the given object by the specified factor.
7727 # @param theObject The object to be scaled.
7728 # @param thePoint Center point for scaling.
7729 # Passing None for it means scaling relatively the origin of global CS.
7730 # @param theFactor Scaling factor value.
7731 # @param theCopy Flag used to scale object itself or create a copy.
7732 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7733 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7734 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7736 Scale the given object by the specified factor.
7739 theObject The object to be scaled.
7740 thePoint Center point for scaling.
7741 Passing None for it means scaling relatively the origin of global CS.
7742 theFactor Scaling factor value.
7743 theCopy Flag used to scale object itself or create a copy.
7746 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7747 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7749 # Example: see GEOM_TestAll.py
7750 theFactor, Parameters = ParseParameters(theFactor)
7752 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7754 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7755 RaiseIfFailed("Scale", self.TrsfOp)
7756 anObj.SetParameters(Parameters)
7759 ## Scale the given object by the factor, creating its copy before the scaling.
7760 # @param theObject The object to be scaled.
7761 # @param thePoint Center point for scaling.
7762 # Passing None for it means scaling relatively the origin of global CS.
7763 # @param theFactor Scaling factor value.
7764 # @param theName Object name; when specified, this parameter is used
7765 # for result publication in the study. Otherwise, if automatic
7766 # publication is switched on, default value is used for result name.
7768 # @return New GEOM.GEOM_Object, containing the scaled shape.
7770 # @ref tui_scale "Example"
7771 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7773 Scale the given object by the factor, creating its copy before the scaling.
7776 theObject The object to be scaled.
7777 thePoint Center point for scaling.
7778 Passing None for it means scaling relatively the origin of global CS.
7779 theFactor Scaling factor value.
7780 theName Object name; when specified, this parameter is used
7781 for result publication in the study. Otherwise, if automatic
7782 publication is switched on, default value is used for result name.
7785 New GEOM.GEOM_Object, containing the scaled shape.
7787 # Example: see GEOM_TestAll.py
7788 theFactor, Parameters = ParseParameters(theFactor)
7789 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7790 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7791 anObj.SetParameters(Parameters)
7792 self._autoPublish(anObj, theName, "scaled")
7795 ## Scale the given object by different factors along coordinate axes.
7796 # @param theObject The object to be scaled.
7797 # @param thePoint Center point for scaling.
7798 # Passing None for it means scaling relatively the origin of global CS.
7799 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7800 # @param theCopy Flag used to scale object itself or create a copy.
7801 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7802 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7803 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7805 Scale the given object by different factors along coordinate axes.
7808 theObject The object to be scaled.
7809 thePoint Center point for scaling.
7810 Passing None for it means scaling relatively the origin of global CS.
7811 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7812 theCopy Flag used to scale object itself or create a copy.
7815 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7816 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7818 # Example: see GEOM_TestAll.py
7819 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7821 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7822 theFactorX, theFactorY, theFactorZ)
7824 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7825 theFactorX, theFactorY, theFactorZ)
7826 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7827 anObj.SetParameters(Parameters)
7830 ## Scale the given object by different factors along coordinate axes,
7831 # creating its copy before the scaling.
7832 # @param theObject The object to be scaled.
7833 # @param thePoint Center point for scaling.
7834 # Passing None for it means scaling relatively the origin of global CS.
7835 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7836 # @param theName Object name; when specified, this parameter is used
7837 # for result publication in the study. Otherwise, if automatic
7838 # publication is switched on, default value is used for result name.
7840 # @return New GEOM.GEOM_Object, containing the scaled shape.
7842 # @ref swig_scale "Example"
7843 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7845 Scale the given object by different factors along coordinate axes,
7846 creating its copy before the scaling.
7849 theObject The object to be scaled.
7850 thePoint Center point for scaling.
7851 Passing None for it means scaling relatively the origin of global CS.
7852 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7853 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.
7858 New GEOM.GEOM_Object, containing the scaled shape.
7860 # Example: see GEOM_TestAll.py
7861 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7862 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7863 theFactorX, theFactorY, theFactorZ)
7864 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7865 anObj.SetParameters(Parameters)
7866 self._autoPublish(anObj, theName, "scaled")
7869 ## Mirror an object relatively the given plane.
7870 # @param theObject The object to be mirrored.
7871 # @param thePlane Plane of symmetry.
7872 # @param theCopy Flag used to mirror object itself or create a copy.
7873 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7874 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7875 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7877 Mirror an object relatively the given plane.
7880 theObject The object to be mirrored.
7881 thePlane Plane of symmetry.
7882 theCopy Flag used to mirror object itself or create a copy.
7885 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7886 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7889 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7891 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7892 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7895 ## Create an object, symmetrical
7896 # to the given one relatively the given plane.
7897 # @param theObject The object to be mirrored.
7898 # @param thePlane Plane of symmetry.
7899 # @param theName Object name; when specified, this parameter is used
7900 # for result publication in the study. Otherwise, if automatic
7901 # publication is switched on, default value is used for result name.
7903 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7905 # @ref tui_mirror "Example"
7906 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7908 Create an object, symmetrical to the given one relatively the given plane.
7911 theObject The object to be mirrored.
7912 thePlane Plane of symmetry.
7913 theName Object name; when specified, this parameter is used
7914 for result publication in the study. Otherwise, if automatic
7915 publication is switched on, default value is used for result name.
7918 New GEOM.GEOM_Object, containing the mirrored shape.
7920 # Example: see GEOM_TestAll.py
7921 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7922 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7923 self._autoPublish(anObj, theName, "mirrored")
7926 ## Mirror an object relatively the given axis.
7927 # @param theObject The object to be mirrored.
7928 # @param theAxis Axis of symmetry.
7929 # @param theCopy Flag used to mirror object itself or create a copy.
7930 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7931 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7932 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7934 Mirror an object relatively the given axis.
7937 theObject The object to be mirrored.
7938 theAxis Axis of symmetry.
7939 theCopy Flag used to mirror object itself or create a copy.
7942 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7943 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7946 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7948 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7949 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7952 ## Create an object, symmetrical
7953 # to the given one relatively the given axis.
7954 # @param theObject The object to be mirrored.
7955 # @param theAxis Axis of symmetry.
7956 # @param theName Object name; when specified, this parameter is used
7957 # for result publication in the study. Otherwise, if automatic
7958 # publication is switched on, default value is used for result name.
7960 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7962 # @ref tui_mirror "Example"
7963 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7965 Create an object, symmetrical to the given one relatively the given axis.
7968 theObject The object to be mirrored.
7969 theAxis Axis of symmetry.
7970 theName Object name; when specified, this parameter is used
7971 for result publication in the study. Otherwise, if automatic
7972 publication is switched on, default value is used for result name.
7975 New GEOM.GEOM_Object, containing the mirrored shape.
7977 # Example: see GEOM_TestAll.py
7978 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7979 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7980 self._autoPublish(anObj, theName, "mirrored")
7983 ## Mirror an object relatively the given point.
7984 # @param theObject The object to be mirrored.
7985 # @param thePoint Point of symmetry.
7986 # @param theCopy Flag used to mirror object itself or create a copy.
7987 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7988 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7989 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7991 Mirror an object relatively the given point.
7994 theObject The object to be mirrored.
7995 thePoint Point of symmetry.
7996 theCopy Flag used to mirror object itself or create a copy.
7999 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8000 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8002 # Example: see GEOM_TestAll.py
8004 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8006 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8007 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8010 ## Create an object, symmetrical
8011 # to the given one relatively the given point.
8012 # @param theObject The object to be mirrored.
8013 # @param thePoint Point of symmetry.
8014 # @param theName Object name; when specified, this parameter is used
8015 # for result publication in the study. Otherwise, if automatic
8016 # publication is switched on, default value is used for result name.
8018 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8020 # @ref tui_mirror "Example"
8021 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8023 Create an object, symmetrical
8024 to the given one relatively the given point.
8027 theObject The object to be mirrored.
8028 thePoint Point of symmetry.
8029 theName Object name; when specified, this parameter is used
8030 for result publication in the study. Otherwise, if automatic
8031 publication is switched on, default value is used for result name.
8034 New GEOM.GEOM_Object, containing the mirrored shape.
8036 # Example: see GEOM_TestAll.py
8037 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8038 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8039 self._autoPublish(anObj, theName, "mirrored")
8042 ## Modify the location of the given object.
8043 # @param theObject The object to be displaced.
8044 # @param theStartLCS Coordinate system to perform displacement from it.\n
8045 # If \a theStartLCS is NULL, displacement
8046 # will be performed from global CS.\n
8047 # If \a theObject itself is used as \a theStartLCS,
8048 # its location will be changed to \a theEndLCS.
8049 # @param theEndLCS Coordinate system to perform displacement to it.
8050 # @param theCopy Flag used to displace object itself or create a copy.
8051 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8052 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8053 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8055 Modify the Location of the given object by LCS, creating its copy before the setting.
8058 theObject The object to be displaced.
8059 theStartLCS Coordinate system to perform displacement from it.
8060 If theStartLCS is NULL, displacement
8061 will be performed from global CS.
8062 If theObject itself is used as theStartLCS,
8063 its location will be changed to theEndLCS.
8064 theEndLCS Coordinate system to perform displacement to it.
8065 theCopy Flag used to displace object itself or create a copy.
8068 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8069 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8071 # Example: see GEOM_TestAll.py
8073 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8075 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8076 RaiseIfFailed("Displace", self.TrsfOp)
8079 ## Modify the Location of the given object by LCS,
8080 # creating its copy before the setting.
8081 # @param theObject The object to be displaced.
8082 # @param theStartLCS Coordinate system to perform displacement from it.\n
8083 # If \a theStartLCS is NULL, displacement
8084 # will be performed from global CS.\n
8085 # If \a theObject itself is used as \a theStartLCS,
8086 # its location will be changed to \a theEndLCS.
8087 # @param theEndLCS Coordinate system to perform displacement to it.
8088 # @param theName Object name; when specified, this parameter is used
8089 # for result publication in the study. Otherwise, if automatic
8090 # publication is switched on, default value is used for result name.
8092 # @return New GEOM.GEOM_Object, containing the displaced shape.
8094 # @ref tui_modify_location "Example"
8095 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8097 Modify the Location of the given object by LCS, creating its copy before the setting.
8100 theObject The object to be displaced.
8101 theStartLCS Coordinate system to perform displacement from it.
8102 If theStartLCS is NULL, displacement
8103 will be performed from global CS.
8104 If theObject itself is used as theStartLCS,
8105 its location will be changed to theEndLCS.
8106 theEndLCS Coordinate system to perform displacement to it.
8107 theName Object name; when specified, this parameter is used
8108 for result publication in the study. Otherwise, if automatic
8109 publication is switched on, default value is used for result name.
8112 New GEOM.GEOM_Object, containing the displaced shape.
8115 # create local coordinate systems
8116 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8117 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8118 # modify the location of the given object
8119 position = geompy.MakePosition(cylinder, cs1, cs2)
8121 # Example: see GEOM_TestAll.py
8122 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8123 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8124 self._autoPublish(anObj, theName, "displaced")
8127 ## Modify the Location of the given object by Path.
8128 # @param theObject The object to be displaced.
8129 # @param thePath Wire or Edge along that the object will be translated.
8130 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8131 # @param theCopy is to create a copy objects if true.
8132 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8133 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8134 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8136 # @ref tui_modify_location "Example"
8137 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8139 Modify the Location of the given object by Path.
8142 theObject The object to be displaced.
8143 thePath Wire or Edge along that the object will be translated.
8144 theDistance progress of Path (0 = start location, 1 = end of path location).
8145 theCopy is to create a copy objects if true.
8146 theReverse 0 - for usual direction, 1 - to reverse path direction.
8149 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8150 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8153 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8155 # Example: see GEOM_TestAll.py
8156 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8157 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8160 ## Modify the Location of the given object by Path, creating its copy before the operation.
8161 # @param theObject The object to be displaced.
8162 # @param thePath Wire or Edge along that the object will be translated.
8163 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8164 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8165 # @param theName Object name; when specified, this parameter is used
8166 # for result publication in the study. Otherwise, if automatic
8167 # publication is switched on, default value is used for result name.
8169 # @return New GEOM.GEOM_Object, containing the displaced shape.
8170 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8172 Modify the Location of the given object by Path, creating its copy before the operation.
8175 theObject The object to be displaced.
8176 thePath Wire or Edge along that the object will be translated.
8177 theDistance progress of Path (0 = start location, 1 = end of path location).
8178 theReverse 0 - for usual direction, 1 - to reverse path direction.
8179 theName Object name; when specified, this parameter is used
8180 for result publication in the study. Otherwise, if automatic
8181 publication is switched on, default value is used for result name.
8184 New GEOM.GEOM_Object, containing the displaced shape.
8186 # Example: see GEOM_TestAll.py
8187 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8188 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8189 self._autoPublish(anObj, theName, "displaced")
8192 ## Offset given shape.
8193 # @param theObject The base object for the offset.
8194 # @param theOffset Offset value.
8195 # @param theCopy Flag used to offset object itself or create a copy.
8196 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8197 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8198 def Offset(self, theObject, theOffset, theCopy=False):
8203 theObject The base object for the offset.
8204 theOffset Offset value.
8205 theCopy Flag used to offset object itself or create a copy.
8208 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8209 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8211 theOffset, Parameters = ParseParameters(theOffset)
8213 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8215 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8216 RaiseIfFailed("Offset", self.TrsfOp)
8217 anObj.SetParameters(Parameters)
8220 ## Create new object as offset of the given one.
8221 # @param theObject The base object for the offset.
8222 # @param theOffset Offset value.
8223 # @param theName Object name; when specified, this parameter is used
8224 # for result publication in the study. Otherwise, if automatic
8225 # publication is switched on, default value is used for result name.
8227 # @return New GEOM.GEOM_Object, containing the offset object.
8229 # @ref tui_offset "Example"
8230 def MakeOffset(self, theObject, theOffset, theName=None):
8232 Create new object as offset of the given one.
8235 theObject The base object for the offset.
8236 theOffset Offset value.
8237 theName Object name; when specified, this parameter is used
8238 for result publication in the study. Otherwise, if automatic
8239 publication is switched on, default value is used for result name.
8242 New GEOM.GEOM_Object, containing the offset object.
8245 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8246 # create a new object as offset of the given object
8247 offset = geompy.MakeOffset(box, 70.)
8249 # Example: see GEOM_TestAll.py
8250 theOffset, Parameters = ParseParameters(theOffset)
8251 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8252 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8253 anObj.SetParameters(Parameters)
8254 self._autoPublish(anObj, theName, "offset")
8257 ## Create new object as projection of the given one on a 2D surface.
8258 # @param theSource The source object for the projection. It can be a point, edge or wire.
8259 # @param theTarget The target object. It can be planar or cylindrical face.
8260 # @param theName Object name; when specified, this parameter is used
8261 # for result publication in the study. Otherwise, if automatic
8262 # publication is switched on, default value is used for result name.
8264 # @return New GEOM.GEOM_Object, containing the projection.
8266 # @ref tui_projection "Example"
8267 def MakeProjection(self, theSource, theTarget, theName=None):
8269 Create new object as projection of the given one on a 2D surface.
8272 theSource The source object for the projection. It can be a point, edge or wire.
8273 theTarget The target object. It can be planar or cylindrical face.
8274 theName Object name; when specified, this parameter is used
8275 for result publication in the study. Otherwise, if automatic
8276 publication is switched on, default value is used for result name.
8279 New GEOM.GEOM_Object, containing the projection.
8281 # Example: see GEOM_TestAll.py
8282 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8283 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8284 self._autoPublish(anObj, theName, "projection")
8287 ## Create a projection projection of the given point on a wire or an edge.
8288 # If there are no solutions or there are 2 or more solutions It throws an
8290 # @param thePoint the point to be projected.
8291 # @param theWire the wire. The edge is accepted as well.
8292 # @param theName Object name; when specified, this parameter is used
8293 # for result publication in the study. Otherwise, if automatic
8294 # publication is switched on, default value is used for result name.
8296 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8297 # \n \a u: The parameter of projection point on edge.
8298 # \n \a PointOnEdge: The projection point.
8299 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8301 # @ref tui_projection "Example"
8302 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
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
8309 thePoint the point to be projected.
8310 theWire the wire. The edge is accepted as well.
8311 theName Object name; when specified, this parameter is used
8312 for result publication in the study. Otherwise, if automatic
8313 publication is switched on, default value is used for result name.
8316 [u, PointOnEdge, EdgeInWireIndex]
8317 u: The parameter of projection point on edge.
8318 PointOnEdge: The projection point.
8319 EdgeInWireIndex: The index of an edge in a wire.
8321 # Example: see GEOM_TestAll.py
8322 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8323 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8324 self._autoPublish(anObj[1], theName, "projection")
8327 # -----------------------------------------------------------------------------
8329 # -----------------------------------------------------------------------------
8331 ## Translate the given object along the given vector a given number times
8332 # @param theObject The object to be translated.
8333 # @param theVector Direction of the translation. DX if None.
8334 # @param theStep Distance to translate on.
8335 # @param theNbTimes Quantity of translations to be done.
8336 # @param theName Object name; when specified, this parameter is used
8337 # for result publication in the study. Otherwise, if automatic
8338 # publication is switched on, default value is used for result name.
8340 # @return New GEOM.GEOM_Object, containing compound of all
8341 # the shapes, obtained after each translation.
8343 # @ref tui_multi_translation "Example"
8344 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8346 Translate the given object along the given vector a given number times
8349 theObject The object to be translated.
8350 theVector Direction of the translation. DX if None.
8351 theStep Distance to translate on.
8352 theNbTimes Quantity of translations to be done.
8353 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.
8358 New GEOM.GEOM_Object, containing compound of all
8359 the shapes, obtained after each translation.
8362 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8364 # Example: see GEOM_TestAll.py
8365 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8366 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8367 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8368 anObj.SetParameters(Parameters)
8369 self._autoPublish(anObj, theName, "multitranslation")
8372 ## Conseqently apply two specified translations to theObject specified number of times.
8373 # @param theObject The object to be translated.
8374 # @param theVector1 Direction of the first translation. DX if None.
8375 # @param theStep1 Step of the first translation.
8376 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8377 # @param theVector2 Direction of the second translation. DY if None.
8378 # @param theStep2 Step of the second translation.
8379 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8380 # @param theName Object name; when specified, this parameter is used
8381 # for result publication in the study. Otherwise, if automatic
8382 # publication is switched on, default value is used for result name.
8384 # @return New GEOM.GEOM_Object, containing compound of all
8385 # the shapes, obtained after each translation.
8387 # @ref tui_multi_translation "Example"
8388 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8389 theVector2, theStep2, theNbTimes2, theName=None):
8391 Conseqently apply two specified translations to theObject specified number of times.
8394 theObject The object to be translated.
8395 theVector1 Direction of the first translation. DX if None.
8396 theStep1 Step of the first translation.
8397 theNbTimes1 Quantity of translations to be done along theVector1.
8398 theVector2 Direction of the second translation. DY if None.
8399 theStep2 Step of the second translation.
8400 theNbTimes2 Quantity of translations to be done along theVector2.
8401 theName Object name; when specified, this parameter is used
8402 for result publication in the study. Otherwise, if automatic
8403 publication is switched on, default value is used for result name.
8406 New GEOM.GEOM_Object, containing compound of all
8407 the shapes, obtained after each translation.
8410 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8412 # Example: see GEOM_TestAll.py
8413 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8414 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8415 theVector2, theStep2, theNbTimes2)
8416 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8417 anObj.SetParameters(Parameters)
8418 self._autoPublish(anObj, theName, "multitranslation")
8421 ## Rotate the given object around the given axis a given number times.
8422 # Rotation angle will be 2*PI/theNbTimes.
8423 # @param theObject The object to be rotated.
8424 # @param theAxis The rotation axis. DZ if None.
8425 # @param theNbTimes Quantity of rotations to be done.
8426 # @param theName Object name; when specified, this parameter is used
8427 # for result publication in the study. Otherwise, if automatic
8428 # publication is switched on, default value is used for result name.
8430 # @return New GEOM.GEOM_Object, containing compound of all the
8431 # shapes, obtained after each rotation.
8433 # @ref tui_multi_rotation "Example"
8434 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8436 Rotate the given object around the given axis a given number times.
8437 Rotation angle will be 2*PI/theNbTimes.
8440 theObject The object to be rotated.
8441 theAxis The rotation axis. DZ if None.
8442 theNbTimes Quantity of rotations to be done.
8443 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.
8448 New GEOM.GEOM_Object, containing compound of all the
8449 shapes, obtained after each rotation.
8452 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8454 # Example: see GEOM_TestAll.py
8455 theNbTimes, Parameters = ParseParameters(theNbTimes)
8456 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8457 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8458 anObj.SetParameters(Parameters)
8459 self._autoPublish(anObj, theName, "multirotation")
8462 ## Rotate the given object around the given axis
8463 # a given number times on the given angle.
8464 # @param theObject The object to be rotated.
8465 # @param theAxis The rotation axis. DZ if None.
8466 # @param theAngleStep Rotation angle in radians.
8467 # @param theNbTimes Quantity of rotations to be done.
8468 # @param theName Object name; when specified, this parameter is used
8469 # for result publication in the study. Otherwise, if automatic
8470 # publication is switched on, default value is used for result name.
8472 # @return New GEOM.GEOM_Object, containing compound of all the
8473 # shapes, obtained after each rotation.
8475 # @ref tui_multi_rotation "Example"
8476 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8478 Rotate the given object around the given axis
8479 a given number times on the given angle.
8482 theObject The object to be rotated.
8483 theAxis The rotation axis. DZ if None.
8484 theAngleStep Rotation angle in radians.
8485 theNbTimes Quantity of rotations to be done.
8486 theName Object name; when specified, this parameter is used
8487 for result publication in the study. Otherwise, if automatic
8488 publication is switched on, default value is used for result name.
8491 New GEOM.GEOM_Object, containing compound of all the
8492 shapes, obtained after each rotation.
8495 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8497 # Example: see GEOM_TestAll.py
8498 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8499 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8500 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8501 anObj.SetParameters(Parameters)
8502 self._autoPublish(anObj, theName, "multirotation")
8505 ## Rotate the given object around the given axis a given
8506 # number times and multi-translate each rotation result.
8507 # Rotation angle will be 2*PI/theNbTimes1.
8508 # Translation direction passes through center of gravity
8509 # of rotated shape and its projection on the rotation axis.
8510 # @param theObject The object to be rotated.
8511 # @param theAxis Rotation axis. DZ if None.
8512 # @param theNbTimes1 Quantity of rotations to be done.
8513 # @param theRadialStep Translation distance.
8514 # @param theNbTimes2 Quantity of translations to be done.
8515 # @param theName Object name; when specified, this parameter is used
8516 # for result publication in the study. Otherwise, if automatic
8517 # publication is switched on, default value is used for result name.
8519 # @return New GEOM.GEOM_Object, containing compound of all the
8520 # shapes, obtained after each transformation.
8522 # @ref tui_multi_rotation "Example"
8523 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8525 Rotate the given object around the
8526 given axis on the given angle a given number
8527 times and multi-translate each rotation result.
8528 Translation direction passes through center of gravity
8529 of rotated shape and its projection on the rotation axis.
8532 theObject The object to be rotated.
8533 theAxis Rotation axis. DZ if None.
8534 theNbTimes1 Quantity of rotations to be done.
8535 theRadialStep Translation distance.
8536 theNbTimes2 Quantity of translations to be done.
8537 theName Object name; when specified, this parameter is used
8538 for result publication in the study. Otherwise, if automatic
8539 publication is switched on, default value is used for result name.
8542 New GEOM.GEOM_Object, containing compound of all the
8543 shapes, obtained after each transformation.
8546 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8548 # Example: see GEOM_TestAll.py
8549 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8550 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8551 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8552 anObj.SetParameters(Parameters)
8553 self._autoPublish(anObj, theName, "multirotation")
8556 ## Rotate the given object around the
8557 # given axis on the given angle a given number
8558 # times and multi-translate each rotation result.
8559 # Translation direction passes through center of gravity
8560 # of rotated shape and its projection on the rotation axis.
8561 # @param theObject The object to be rotated.
8562 # @param theAxis Rotation axis. DZ if None.
8563 # @param theAngleStep Rotation angle in radians.
8564 # @param theNbTimes1 Quantity of rotations to be done.
8565 # @param theRadialStep Translation distance.
8566 # @param theNbTimes2 Quantity of translations to be done.
8567 # @param theName Object name; when specified, this parameter is used
8568 # for result publication in the study. Otherwise, if automatic
8569 # publication is switched on, default value is used for result name.
8571 # @return New GEOM.GEOM_Object, containing compound of all the
8572 # shapes, obtained after each transformation.
8574 # @ref tui_multi_rotation "Example"
8575 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8577 Rotate the given object around the
8578 given axis on the given angle a given number
8579 times and multi-translate each rotation result.
8580 Translation direction passes through center of gravity
8581 of rotated shape and its projection on the rotation axis.
8584 theObject The object to be rotated.
8585 theAxis Rotation axis. DZ if None.
8586 theAngleStep Rotation angle in radians.
8587 theNbTimes1 Quantity of rotations to be done.
8588 theRadialStep Translation distance.
8589 theNbTimes2 Quantity of translations to be done.
8590 theName Object name; when specified, this parameter is used
8591 for result publication in the study. Otherwise, if automatic
8592 publication is switched on, default value is used for result name.
8595 New GEOM.GEOM_Object, containing compound of all the
8596 shapes, obtained after each transformation.
8599 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8601 # Example: see GEOM_TestAll.py
8602 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8603 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8604 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8605 anObj.SetParameters(Parameters)
8606 self._autoPublish(anObj, theName, "multirotation")
8609 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8611 # @ref swig_MakeMultiRotation "Example"
8612 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8614 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8617 pz = geompy.MakeVertex(0, 0, 100)
8618 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8619 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8621 # Example: see GEOM_TestOthers.py
8622 aVec = self.MakeLine(aPoint,aDir)
8623 # note: auto-publishing is done in self.MultiRotate1D()
8624 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8627 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8629 # @ref swig_MakeMultiRotation "Example"
8630 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8632 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8635 pz = geompy.MakeVertex(0, 0, 100)
8636 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8637 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8639 # Example: see GEOM_TestOthers.py
8640 aVec = self.MakeLine(aPoint,aDir)
8641 # note: auto-publishing is done in self.MultiRotate1D()
8642 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8645 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8647 # @ref swig_MakeMultiRotation "Example"
8648 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8650 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8653 pz = geompy.MakeVertex(0, 0, 100)
8654 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8655 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8657 # Example: see GEOM_TestOthers.py
8658 aVec = self.MakeLine(aPoint,aDir)
8659 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8660 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8663 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8665 # @ref swig_MakeMultiRotation "Example"
8666 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8668 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8671 pz = geompy.MakeVertex(0, 0, 100)
8672 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8673 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8675 # Example: see GEOM_TestOthers.py
8676 aVec = self.MakeLine(aPoint,aDir)
8677 # note: auto-publishing is done in self.MultiRotate2D()
8678 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8681 # end of l3_transform
8684 ## @addtogroup l3_transform_d
8687 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8688 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8690 Deprecated method. Use MultiRotate1DNbTimes instead.
8692 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8693 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8695 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8696 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8697 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8699 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8700 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8703 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8705 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8706 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8707 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8708 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8709 anObj.SetParameters(Parameters)
8710 self._autoPublish(anObj, theName, "multirotation")
8713 ## The same, as MultiRotate1D(), but axis is given by direction and point
8714 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8715 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8717 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8718 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8721 pz = geompy.MakeVertex(0, 0, 100)
8722 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8723 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8725 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8726 aVec = self.MakeLine(aPoint,aDir)
8727 # note: auto-publishing is done in self.MultiRotate1D()
8728 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8731 ## The same, as MultiRotate2D(), but axis is given by direction and point
8732 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8733 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8735 The same, as MultiRotate2D(), but axis is given by direction and point
8736 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8739 pz = geompy.MakeVertex(0, 0, 100)
8740 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8741 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8743 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8744 aVec = self.MakeLine(aPoint,aDir)
8745 # note: auto-publishing is done in self.MultiRotate2D()
8746 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8749 # end of l3_transform_d
8752 ## @addtogroup l3_local
8755 ## Perform a fillet on all edges of the given shape.
8756 # @param theShape Shape, to perform fillet on.
8757 # @param theR Fillet radius.
8758 # @param theName Object name; when specified, this parameter is used
8759 # for result publication in the study. Otherwise, if automatic
8760 # publication is switched on, default value is used for result name.
8762 # @return New GEOM.GEOM_Object, containing the result shape.
8764 # @ref tui_fillet "Example 1"
8765 # \n @ref swig_MakeFilletAll "Example 2"
8766 def MakeFilletAll(self, theShape, theR, theName=None):
8768 Perform a fillet on all edges of the given shape.
8771 theShape Shape, to perform fillet on.
8773 theName Object name; when specified, this parameter is used
8774 for result publication in the study. Otherwise, if automatic
8775 publication is switched on, default value is used for result name.
8778 New GEOM.GEOM_Object, containing the result shape.
8781 filletall = geompy.MakeFilletAll(prism, 10.)
8783 # Example: see GEOM_TestOthers.py
8784 theR,Parameters = ParseParameters(theR)
8785 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8786 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8787 anObj.SetParameters(Parameters)
8788 self._autoPublish(anObj, theName, "fillet")
8791 ## Perform a fillet on the specified edges/faces of the given shape
8792 # @param theShape Shape, to perform fillet on.
8793 # @param theR Fillet radius.
8794 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8795 # @param theListShapes Global indices of edges/faces to perform fillet on.
8796 # @param theName Object name; when specified, this parameter is used
8797 # for result publication in the study. Otherwise, if automatic
8798 # publication is switched on, default value is used for result name.
8800 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8802 # @return New GEOM.GEOM_Object, containing the result shape.
8804 # @ref tui_fillet "Example"
8805 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8807 Perform a fillet on the specified edges/faces of the given shape
8810 theShape Shape, to perform fillet on.
8812 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8813 theListShapes Global indices of edges/faces to perform fillet on.
8814 theName Object name; when specified, this parameter is used
8815 for result publication in the study. Otherwise, if automatic
8816 publication is switched on, default value is used for result name.
8819 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8822 New GEOM.GEOM_Object, containing the result shape.
8825 # get the list of IDs (IDList) for the fillet
8826 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8828 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8829 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8830 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8831 # make a fillet on the specified edges of the given shape
8832 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8834 # Example: see GEOM_TestAll.py
8835 theR,Parameters = ParseParameters(theR)
8837 if theShapeType == self.ShapeType["EDGE"]:
8838 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8839 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8841 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8842 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8843 anObj.SetParameters(Parameters)
8844 self._autoPublish(anObj, theName, "fillet")
8847 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8848 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8850 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8853 # get the list of IDs (IDList) for the fillet
8854 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8856 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8857 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8858 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8859 # make a fillet on the specified edges of the given shape
8860 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8862 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8864 if theShapeType == self.ShapeType["EDGE"]:
8865 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8866 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8868 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8869 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8870 anObj.SetParameters(Parameters)
8871 self._autoPublish(anObj, theName, "fillet")
8874 ## Perform a fillet on the specified edges of the given shape
8875 # @param theShape Wire Shape to perform fillet on.
8876 # @param theR Fillet radius.
8877 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8878 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8879 # \note The list of vertices could be empty,
8880 # in this case fillet will done done at all vertices in wire
8881 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8882 # by the length of the edges, nearest to the fillet vertex.
8883 # But sometimes the next edge is C1 continuous with the one, nearest to
8884 # the fillet point, and such two (or more) edges can be united to allow
8885 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8886 # thus ignoring the secant vertex (vertices).
8887 # @param theName Object name; when specified, this parameter is used
8888 # for result publication in the study. Otherwise, if automatic
8889 # publication is switched on, default value is used for result name.
8891 # @return New GEOM.GEOM_Object, containing the result shape.
8893 # @ref tui_fillet2d "Example"
8894 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8896 Perform a fillet on the specified edges of the given shape
8899 theShape Wire Shape to perform fillet on.
8901 theListOfVertexes Global indices of vertexes to perform fillet on.
8902 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8903 by the length of the edges, nearest to the fillet vertex.
8904 But sometimes the next edge is C1 continuous with the one, nearest to
8905 the fillet point, and such two (or more) edges can be united to allow
8906 bigger radius. Set this flag to TRUE to allow collinear edges union,
8907 thus ignoring the secant vertex (vertices).
8908 theName Object name; when specified, this parameter is used
8909 for result publication in the study. Otherwise, if automatic
8910 publication is switched on, default value is used for result name.
8912 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8914 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8917 New GEOM.GEOM_Object, containing the result shape.
8921 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8922 # make fillet at given wire vertices with giver radius
8923 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8925 # Example: see GEOM_TestAll.py
8926 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8927 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8928 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8929 anObj.SetParameters(Parameters)
8930 self._autoPublish(anObj, theName, "fillet")
8933 ## Perform a fillet at the specified vertices of the given face/shell.
8934 # @param theShape Face or Shell shape to perform fillet on.
8935 # @param theR Fillet radius.
8936 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8937 # @param theName Object name; when specified, this parameter is used
8938 # for result publication in the study. Otherwise, if automatic
8939 # publication is switched on, default value is used for result name.
8941 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8943 # @return New GEOM.GEOM_Object, containing the result shape.
8945 # @ref tui_fillet2d "Example"
8946 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8948 Perform a fillet at the specified vertices of the given face/shell.
8951 theShape Face or Shell shape to perform fillet on.
8953 theListOfVertexes Global indices of vertexes to perform fillet on.
8954 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 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8961 New GEOM.GEOM_Object, containing the result shape.
8964 face = geompy.MakeFaceHW(100, 100, 1)
8965 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8967 # Example: see GEOM_TestAll.py
8968 theR,Parameters = ParseParameters(theR)
8969 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8970 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8971 anObj.SetParameters(Parameters)
8972 self._autoPublish(anObj, theName, "fillet")
8975 ## Perform a symmetric chamfer on all edges of the given shape.
8976 # @param theShape Shape, to perform chamfer on.
8977 # @param theD Chamfer size along each face.
8978 # @param theName Object name; when specified, this parameter is used
8979 # for result publication in the study. Otherwise, if automatic
8980 # publication is switched on, default value is used for result name.
8982 # @return New GEOM.GEOM_Object, containing the result shape.
8984 # @ref tui_chamfer "Example 1"
8985 # \n @ref swig_MakeChamferAll "Example 2"
8986 def MakeChamferAll(self, theShape, theD, theName=None):
8988 Perform a symmetric chamfer on all edges of the given shape.
8991 theShape Shape, to perform chamfer on.
8992 theD Chamfer size along each face.
8993 theName Object name; when specified, this parameter is used
8994 for result publication in the study. Otherwise, if automatic
8995 publication is switched on, default value is used for result name.
8998 New GEOM.GEOM_Object, containing the result shape.
9001 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9003 # Example: see GEOM_TestOthers.py
9004 theD,Parameters = ParseParameters(theD)
9005 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9006 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9007 anObj.SetParameters(Parameters)
9008 self._autoPublish(anObj, theName, "chamfer")
9011 ## Perform a chamfer on edges, common to the specified faces,
9012 # with distance D1 on the Face1
9013 # @param theShape Shape, to perform chamfer on.
9014 # @param theD1 Chamfer size along \a theFace1.
9015 # @param theD2 Chamfer size along \a theFace2.
9016 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9017 # @param theName Object name; when specified, this parameter is used
9018 # for result publication in the study. Otherwise, if automatic
9019 # publication is switched on, default value is used for result name.
9021 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9023 # @return New GEOM.GEOM_Object, containing the result shape.
9025 # @ref tui_chamfer "Example"
9026 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9028 Perform a chamfer on edges, common to the specified faces,
9029 with distance D1 on the Face1
9032 theShape Shape, to perform chamfer on.
9033 theD1 Chamfer size along theFace1.
9034 theD2 Chamfer size along theFace2.
9035 theFace1,theFace2 Global indices of two faces of theShape.
9036 theName Object name; when specified, this parameter is used
9037 for result publication in the study. Otherwise, if automatic
9038 publication is switched on, default value is used for result name.
9041 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9044 New GEOM.GEOM_Object, containing the result shape.
9047 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9048 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9049 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9050 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9052 # Example: see GEOM_TestAll.py
9053 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9054 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9055 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9056 anObj.SetParameters(Parameters)
9057 self._autoPublish(anObj, theName, "chamfer")
9060 ## Perform a chamfer on edges
9061 # @param theShape Shape, to perform chamfer on.
9062 # @param theD Chamfer length
9063 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9064 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9065 # @param theName Object name; when specified, this parameter is used
9066 # for result publication in the study. Otherwise, if automatic
9067 # publication is switched on, default value is used for result name.
9069 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9071 # @return New GEOM.GEOM_Object, containing the result shape.
9072 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9074 Perform a chamfer on edges
9077 theShape Shape, to perform chamfer on.
9078 theD1 Chamfer size along theFace1.
9079 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9080 theFace1,theFace2 Global indices of two faces of theShape.
9081 theName Object name; when specified, this parameter is used
9082 for result publication in the study. Otherwise, if automatic
9083 publication is switched on, default value is used for result name.
9086 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9089 New GEOM.GEOM_Object, containing the result shape.
9092 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9093 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9094 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9096 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9099 if isinstance(theAngle,str):
9101 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9103 theAngle = theAngle*math.pi/180.0
9104 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9105 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9106 anObj.SetParameters(Parameters)
9107 self._autoPublish(anObj, theName, "chamfer")
9110 ## Perform a chamfer on all edges of the specified faces,
9111 # with distance D1 on the first specified face (if several for one edge)
9112 # @param theShape Shape, to perform chamfer on.
9113 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9114 # connected to the edge, are in \a theFaces, \a theD1
9115 # will be get along face, which is nearer to \a theFaces beginning.
9116 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9117 # @param theFaces Sequence of global indices of faces of \a theShape.
9118 # @param theName Object name; when specified, this parameter is used
9119 # for result publication in the study. Otherwise, if automatic
9120 # publication is switched on, default value is used for result name.
9122 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9124 # @return New GEOM.GEOM_Object, containing the result shape.
9126 # @ref tui_chamfer "Example"
9127 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9129 Perform a chamfer on all edges of the specified faces,
9130 with distance D1 on the first specified face (if several for one edge)
9133 theShape Shape, to perform chamfer on.
9134 theD1 Chamfer size along face from theFaces. If both faces,
9135 connected to the edge, are in theFaces, theD1
9136 will be get along face, which is nearer to theFaces beginning.
9137 theD2 Chamfer size along another of two faces, connected to the edge.
9138 theFaces Sequence of global indices of faces of theShape.
9139 theName Object name; when specified, this parameter is used
9140 for result publication in the study. Otherwise, if automatic
9141 publication is switched on, default value is used for result name.
9143 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9146 New GEOM.GEOM_Object, containing the result shape.
9148 # Example: see GEOM_TestAll.py
9149 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9150 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9151 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9152 anObj.SetParameters(Parameters)
9153 self._autoPublish(anObj, theName, "chamfer")
9156 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9157 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9159 # @ref swig_FilletChamfer "Example"
9160 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9162 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9163 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9166 if isinstance(theAngle,str):
9168 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9170 theAngle = theAngle*math.pi/180.0
9171 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9172 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9173 anObj.SetParameters(Parameters)
9174 self._autoPublish(anObj, theName, "chamfer")
9177 ## Perform a chamfer on edges,
9178 # with distance D1 on the first specified face (if several for one edge)
9179 # @param theShape Shape, to perform chamfer on.
9180 # @param theD1,theD2 Chamfer size
9181 # @param theEdges Sequence of edges of \a theShape.
9182 # @param theName Object name; when specified, this parameter is used
9183 # for result publication in the study. Otherwise, if automatic
9184 # publication is switched on, default value is used for result name.
9186 # @return New GEOM.GEOM_Object, containing the result shape.
9188 # @ref swig_FilletChamfer "Example"
9189 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9191 Perform a chamfer on edges,
9192 with distance D1 on the first specified face (if several for one edge)
9195 theShape Shape, to perform chamfer on.
9196 theD1,theD2 Chamfer size
9197 theEdges Sequence of edges of theShape.
9198 theName Object name; when specified, this parameter is used
9199 for result publication in the study. Otherwise, if automatic
9200 publication is switched on, default value is used for result name.
9203 New GEOM.GEOM_Object, containing the result shape.
9205 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9206 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9207 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9208 anObj.SetParameters(Parameters)
9209 self._autoPublish(anObj, theName, "chamfer")
9212 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9213 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9214 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9216 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9217 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9220 if isinstance(theAngle,str):
9222 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9224 theAngle = theAngle*math.pi/180.0
9225 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9226 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9227 anObj.SetParameters(Parameters)
9228 self._autoPublish(anObj, theName, "chamfer")
9231 ## @sa MakeChamferEdge(), MakeChamferFaces()
9233 # @ref swig_MakeChamfer "Example"
9234 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9236 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9238 # Example: see GEOM_TestOthers.py
9240 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9241 if aShapeType == self.ShapeType["EDGE"]:
9242 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9244 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9247 ## Remove material from a solid by extrusion of the base shape on the given distance.
9248 # @param theInit Shape to remove material from. It must be a solid or
9249 # a compound made of a single solid.
9250 # @param theBase Closed edge or wire defining the base shape to be extruded.
9251 # @param theH Prism dimension along the normal to theBase
9252 # @param theAngle Draft angle in degrees.
9253 # @param theName Object name; when specified, this parameter is used
9254 # for result publication in the study. Otherwise, if automatic
9255 # publication is switched on, default value is used for result name.
9257 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9259 # @ref tui_creation_prism "Example"
9260 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9262 Add material to a solid by extrusion of the base shape on the given distance.
9265 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9266 theBase Closed edge or wire defining the base shape to be extruded.
9267 theH Prism dimension along the normal to theBase
9268 theAngle Draft angle in degrees.
9269 theName Object name; when specified, this parameter is used
9270 for result publication in the study. Otherwise, if automatic
9271 publication is switched on, default value is used for result name.
9274 New GEOM.GEOM_Object, containing the initial shape with removed material.
9276 # Example: see GEOM_TestAll.py
9277 #theH,Parameters = ParseParameters(theH)
9278 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9279 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9280 #anObj.SetParameters(Parameters)
9281 self._autoPublish(anObj, theName, "extrudedCut")
9284 ## Add material to a solid by extrusion of the base shape on the given distance.
9285 # @param theInit Shape to add material to. It must be a solid or
9286 # a compound made of a single solid.
9287 # @param theBase Closed edge or wire defining the base shape to be extruded.
9288 # @param theH Prism dimension along the normal to theBase
9289 # @param theAngle Draft angle in degrees.
9290 # @param theName Object name; when specified, this parameter is used
9291 # for result publication in the study. Otherwise, if automatic
9292 # publication is switched on, default value is used for result name.
9294 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9296 # @ref tui_creation_prism "Example"
9297 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9299 Add material to a solid by extrusion of the base shape on the given distance.
9302 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9303 theBase Closed edge or wire defining the base shape to be extruded.
9304 theH Prism dimension along the normal to theBase
9305 theAngle Draft angle in degrees.
9306 theName Object name; when specified, this parameter is used
9307 for result publication in the study. Otherwise, if automatic
9308 publication is switched on, default value is used for result name.
9311 New GEOM.GEOM_Object, containing the initial shape with added material.
9313 # Example: see GEOM_TestAll.py
9314 #theH,Parameters = ParseParameters(theH)
9315 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9316 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9317 #anObj.SetParameters(Parameters)
9318 self._autoPublish(anObj, theName, "extrudedBoss")
9324 ## @addtogroup l3_basic_op
9327 ## Perform an Archimde operation on the given shape with given parameters.
9328 # The object presenting the resulting face is returned.
9329 # @param theShape Shape to be put in water.
9330 # @param theWeight Weight og the shape.
9331 # @param theWaterDensity Density of the water.
9332 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9333 # @param theName Object name; when specified, this parameter is used
9334 # for result publication in the study. Otherwise, if automatic
9335 # publication is switched on, default value is used for result name.
9337 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9338 # by a plane, corresponding to water level.
9340 # @ref tui_archimede "Example"
9341 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9343 Perform an Archimde operation on the given shape with given parameters.
9344 The object presenting the resulting face is returned.
9347 theShape Shape to be put in water.
9348 theWeight Weight og the shape.
9349 theWaterDensity Density of the water.
9350 theMeshDeflection Deflection of the mesh, using to compute the section.
9351 theName Object name; when specified, this parameter is used
9352 for result publication in the study. Otherwise, if automatic
9353 publication is switched on, default value is used for result name.
9356 New GEOM.GEOM_Object, containing a section of theShape
9357 by a plane, corresponding to water level.
9359 # Example: see GEOM_TestAll.py
9360 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9361 theWeight,theWaterDensity,theMeshDeflection)
9362 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9363 RaiseIfFailed("MakeArchimede", self.LocalOp)
9364 anObj.SetParameters(Parameters)
9365 self._autoPublish(anObj, theName, "archimede")
9368 # end of l3_basic_op
9371 ## @addtogroup l2_measure
9374 ## Get point coordinates
9377 # @ref tui_measurement_tools_page "Example"
9378 def PointCoordinates(self,Point):
9380 Get point coordinates
9385 # Example: see GEOM_TestMeasures.py
9386 aTuple = self.MeasuOp.PointCoordinates(Point)
9387 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9390 ## Get vector coordinates
9393 # @ref tui_measurement_tools_page "Example"
9394 def VectorCoordinates(self,Vector):
9396 Get vector coordinates
9402 p1=self.GetFirstVertex(Vector)
9403 p2=self.GetLastVertex(Vector)
9405 X1=self.PointCoordinates(p1)
9406 X2=self.PointCoordinates(p2)
9408 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9411 ## Compute cross product
9412 # @return vector w=u^v
9414 # @ref tui_measurement_tools_page "Example"
9415 def CrossProduct(self, Vector1, Vector2):
9417 Compute cross product
9419 Returns: vector w=u^v
9421 u=self.VectorCoordinates(Vector1)
9422 v=self.VectorCoordinates(Vector2)
9423 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])
9427 ## Compute cross product
9428 # @return dot product p=u.v
9430 # @ref tui_measurement_tools_page "Example"
9431 def DotProduct(self, Vector1, Vector2):
9433 Compute cross product
9435 Returns: dot product p=u.v
9437 u=self.VectorCoordinates(Vector1)
9438 v=self.VectorCoordinates(Vector2)
9439 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9444 ## Get summarized length of all wires,
9445 # area of surface and volume of the given shape.
9446 # @param theShape Shape to define properties of.
9447 # @return [theLength, theSurfArea, theVolume]\n
9448 # theLength: Summarized length of all wires of the given shape.\n
9449 # theSurfArea: Area of surface of the given shape.\n
9450 # theVolume: Volume of the given shape.
9452 # @ref tui_measurement_tools_page "Example"
9453 def BasicProperties(self,theShape):
9455 Get summarized length of all wires,
9456 area of surface and volume of the given shape.
9459 theShape Shape to define properties of.
9462 [theLength, theSurfArea, theVolume]
9463 theLength: Summarized length of all wires of the given shape.
9464 theSurfArea: Area of surface of the given shape.
9465 theVolume: Volume of the given shape.
9467 # Example: see GEOM_TestMeasures.py
9468 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9469 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9472 ## Get parameters of bounding box of the given shape
9473 # @param theShape Shape to obtain bounding box of.
9474 # @param precise TRUE for precise computation; FALSE for fast one.
9475 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9476 # Xmin,Xmax: Limits of shape along OX axis.
9477 # Ymin,Ymax: Limits of shape along OY axis.
9478 # Zmin,Zmax: Limits of shape along OZ axis.
9480 # @ref tui_measurement_tools_page "Example"
9481 def BoundingBox (self, theShape, precise=False):
9483 Get parameters of bounding box of the given shape
9486 theShape Shape to obtain bounding box of.
9487 precise TRUE for precise computation; FALSE for fast one.
9490 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9491 Xmin,Xmax: Limits of shape along OX axis.
9492 Ymin,Ymax: Limits of shape along OY axis.
9493 Zmin,Zmax: Limits of shape along OZ axis.
9495 # Example: see GEOM_TestMeasures.py
9496 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9497 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9500 ## Get bounding box of the given shape
9501 # @param theShape Shape to obtain bounding box of.
9502 # @param precise TRUE for precise computation; FALSE for fast one.
9503 # @param theName Object name; when specified, this parameter is used
9504 # for result publication in the study. Otherwise, if automatic
9505 # publication is switched on, default value is used for result name.
9507 # @return New GEOM.GEOM_Object, containing the created box.
9509 # @ref tui_measurement_tools_page "Example"
9510 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9512 Get bounding box of the given shape
9515 theShape Shape to obtain bounding box of.
9516 precise TRUE for precise computation; FALSE for fast one.
9517 theName Object name; when specified, this parameter is used
9518 for result publication in the study. Otherwise, if automatic
9519 publication is switched on, default value is used for result name.
9522 New GEOM.GEOM_Object, containing the created box.
9524 # Example: see GEOM_TestMeasures.py
9525 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9526 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9527 self._autoPublish(anObj, theName, "bndbox")
9530 ## Get inertia matrix and moments of inertia of theShape.
9531 # @param theShape Shape to calculate inertia of.
9532 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9533 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9534 # Ix,Iy,Iz: Moments of inertia of the given shape.
9536 # @ref tui_measurement_tools_page "Example"
9537 def Inertia(self,theShape):
9539 Get inertia matrix and moments of inertia of theShape.
9542 theShape Shape to calculate inertia of.
9545 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9546 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9547 Ix,Iy,Iz: Moments of inertia of the given shape.
9549 # Example: see GEOM_TestMeasures.py
9550 aTuple = self.MeasuOp.GetInertia(theShape)
9551 RaiseIfFailed("GetInertia", self.MeasuOp)
9554 ## Get if coords are included in the shape (ST_IN or ST_ON)
9555 # @param theShape Shape
9556 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9557 # @param tolerance to be used (default is 1.0e-7)
9558 # @return list_of_boolean = [res1, res2, ...]
9559 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9561 Get if coords are included in the shape (ST_IN or ST_ON)
9565 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9566 tolerance to be used (default is 1.0e-7)
9569 list_of_boolean = [res1, res2, ...]
9571 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9573 ## Get minimal distance between the given shapes.
9574 # @param theShape1,theShape2 Shapes to find minimal distance between.
9575 # @return Value of the minimal distance between the given shapes.
9577 # @ref tui_measurement_tools_page "Example"
9578 def MinDistance(self, theShape1, theShape2):
9580 Get minimal distance between the given shapes.
9583 theShape1,theShape2 Shapes to find minimal distance between.
9586 Value of the minimal distance between the given shapes.
9588 # Example: see GEOM_TestMeasures.py
9589 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9590 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9593 ## Get minimal distance between the given shapes.
9594 # @param theShape1,theShape2 Shapes to find minimal distance between.
9595 # @return Value of the minimal distance between the given shapes, in form of list
9596 # [Distance, DX, DY, DZ].
9598 # @ref swig_all_measure "Example"
9599 def MinDistanceComponents(self, theShape1, theShape2):
9601 Get minimal distance between the given shapes.
9604 theShape1,theShape2 Shapes to find minimal distance between.
9607 Value of the minimal distance between the given shapes, in form of list
9608 [Distance, DX, DY, DZ]
9610 # Example: see GEOM_TestMeasures.py
9611 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9612 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9613 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9616 ## Get closest points of the given shapes.
9617 # @param theShape1,theShape2 Shapes to find closest points of.
9618 # @return The number of found solutions (-1 in case of infinite number of
9619 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9621 # @ref tui_measurement_tools_page "Example"
9622 def ClosestPoints (self, theShape1, theShape2):
9624 Get closest points of the given shapes.
9627 theShape1,theShape2 Shapes to find closest points of.
9630 The number of found solutions (-1 in case of infinite number of
9631 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9633 # Example: see GEOM_TestMeasures.py
9634 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9635 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9638 ## Get angle between the given shapes in degrees.
9639 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9640 # @note If both arguments are vectors, the angle is computed in accordance
9641 # with their orientations, otherwise the minimum angle is computed.
9642 # @return Value of the angle between the given shapes in degrees.
9644 # @ref tui_measurement_tools_page "Example"
9645 def GetAngle(self, theShape1, theShape2):
9647 Get angle between the given shapes in degrees.
9650 theShape1,theShape2 Lines or linear edges to find angle between.
9653 If both arguments are vectors, the angle is computed in accordance
9654 with their orientations, otherwise the minimum angle is computed.
9657 Value of the angle between the given shapes in degrees.
9659 # Example: see GEOM_TestMeasures.py
9660 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9661 RaiseIfFailed("GetAngle", self.MeasuOp)
9664 ## Get angle between the given shapes in radians.
9665 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9666 # @note If both arguments are vectors, the angle is computed in accordance
9667 # with their orientations, otherwise the minimum angle is computed.
9668 # @return Value of the angle between the given shapes in radians.
9670 # @ref tui_measurement_tools_page "Example"
9671 def GetAngleRadians(self, theShape1, theShape2):
9673 Get angle between the given shapes in radians.
9676 theShape1,theShape2 Lines or linear edges to find angle between.
9680 If both arguments are vectors, the angle is computed in accordance
9681 with their orientations, otherwise the minimum angle is computed.
9684 Value of the angle between the given shapes in radians.
9686 # Example: see GEOM_TestMeasures.py
9687 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9688 RaiseIfFailed("GetAngle", self.MeasuOp)
9691 ## Get angle between the given vectors in degrees.
9692 # @param theShape1,theShape2 Vectors to find angle between.
9693 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9694 # if False, the opposite vector to the normal vector is used.
9695 # @return Value of the angle between the given vectors in degrees.
9697 # @ref tui_measurement_tools_page "Example"
9698 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9700 Get angle between the given vectors in degrees.
9703 theShape1,theShape2 Vectors to find angle between.
9704 theFlag If True, the normal vector is defined by the two vectors cross,
9705 if False, the opposite vector to the normal vector is used.
9708 Value of the angle between the given vectors in degrees.
9710 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9712 anAngle = 360. - anAngle
9713 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9716 ## The same as GetAngleVectors, but the result is in radians.
9717 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9719 Get angle between the given vectors in radians.
9722 theShape1,theShape2 Vectors to find angle between.
9723 theFlag If True, the normal vector is defined by the two vectors cross,
9724 if False, the opposite vector to the normal vector is used.
9727 Value of the angle between the given vectors in radians.
9729 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9732 ## @name Curve Curvature Measurement
9733 # Methods for receiving radius of curvature of curves
9734 # in the given point
9737 ## Measure curvature of a curve at a point, set by parameter.
9738 # @param theCurve a curve.
9739 # @param theParam parameter.
9740 # @return radius of curvature of \a theCurve.
9742 # @ref swig_todo "Example"
9743 def CurveCurvatureByParam(self, theCurve, theParam):
9745 Measure curvature of a curve at a point, set by parameter.
9752 radius of curvature of theCurve.
9754 # Example: see GEOM_TestMeasures.py
9755 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9756 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9759 ## Measure curvature of a curve at a point.
9760 # @param theCurve a curve.
9761 # @param thePoint given point.
9762 # @return radius of curvature of \a theCurve.
9764 # @ref swig_todo "Example"
9765 def CurveCurvatureByPoint(self, theCurve, thePoint):
9767 Measure curvature of a curve at a point.
9771 thePoint given point.
9774 radius of curvature of theCurve.
9776 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9777 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9781 ## @name Surface Curvature Measurement
9782 # Methods for receiving max and min radius of curvature of surfaces
9783 # in the given point
9786 ## Measure max radius of curvature of surface.
9787 # @param theSurf the given surface.
9788 # @param theUParam Value of U-parameter on the referenced surface.
9789 # @param theVParam Value of V-parameter on the referenced surface.
9790 # @return max radius of curvature of theSurf.
9792 ## @ref swig_todo "Example"
9793 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9795 Measure max radius of curvature of surface.
9798 theSurf the given surface.
9799 theUParam Value of U-parameter on the referenced surface.
9800 theVParam Value of V-parameter on the referenced surface.
9803 max radius of curvature of theSurf.
9805 # Example: see GEOM_TestMeasures.py
9806 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9807 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9810 ## Measure max radius of curvature of surface in the given point
9811 # @param theSurf the given surface.
9812 # @param thePoint given point.
9813 # @return max radius of curvature of theSurf.
9815 ## @ref swig_todo "Example"
9816 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9818 Measure max radius of curvature of surface in the given point.
9821 theSurf the given surface.
9822 thePoint given point.
9825 max radius of curvature of theSurf.
9827 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9828 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9831 ## Measure min radius of curvature of surface.
9832 # @param theSurf the given surface.
9833 # @param theUParam Value of U-parameter on the referenced surface.
9834 # @param theVParam Value of V-parameter on the referenced surface.
9835 # @return min radius of curvature of theSurf.
9837 ## @ref swig_todo "Example"
9838 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9840 Measure min radius of curvature of surface.
9843 theSurf the given surface.
9844 theUParam Value of U-parameter on the referenced surface.
9845 theVParam Value of V-parameter on the referenced surface.
9848 Min radius of curvature of theSurf.
9850 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9851 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9854 ## Measure min radius of curvature of surface in the given point
9855 # @param theSurf the given surface.
9856 # @param thePoint given point.
9857 # @return min radius of curvature of theSurf.
9859 ## @ref swig_todo "Example"
9860 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9862 Measure min radius of curvature of surface in the given point.
9865 theSurf the given surface.
9866 thePoint given point.
9869 Min radius of curvature of theSurf.
9871 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9872 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9876 ## Get min and max tolerances of sub-shapes of theShape
9877 # @param theShape Shape, to get tolerances of.
9878 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9879 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9880 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9881 # VertMin,VertMax: Min and max tolerances of the vertices.
9883 # @ref tui_measurement_tools_page "Example"
9884 def Tolerance(self,theShape):
9886 Get min and max tolerances of sub-shapes of theShape
9889 theShape Shape, to get tolerances of.
9892 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9893 FaceMin,FaceMax: Min and max tolerances of the faces.
9894 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9895 VertMin,VertMax: Min and max tolerances of the vertices.
9897 # Example: see GEOM_TestMeasures.py
9898 aTuple = self.MeasuOp.GetTolerance(theShape)
9899 RaiseIfFailed("GetTolerance", self.MeasuOp)
9902 ## Obtain description of the given shape (number of sub-shapes of each type)
9903 # @param theShape Shape to be described.
9904 # @return Description of the given shape.
9906 # @ref tui_measurement_tools_page "Example"
9907 def WhatIs(self,theShape):
9909 Obtain description of the given shape (number of sub-shapes of each type)
9912 theShape Shape to be described.
9915 Description of the given shape.
9917 # Example: see GEOM_TestMeasures.py
9918 aDescr = self.MeasuOp.WhatIs(theShape)
9919 RaiseIfFailed("WhatIs", self.MeasuOp)
9922 ## Obtain quantity of shapes of the given type in \a theShape.
9923 # If \a theShape is of type \a theType, it is also counted.
9924 # @param theShape Shape to be described.
9925 # @param theType the given ShapeType().
9926 # @return Quantity of shapes of type \a theType in \a theShape.
9928 # @ref tui_measurement_tools_page "Example"
9929 def NbShapes (self, theShape, theType):
9931 Obtain quantity of shapes of the given type in theShape.
9932 If theShape is of type theType, it is also counted.
9935 theShape Shape to be described.
9936 theType the given geompy.ShapeType
9939 Quantity of shapes of type theType in theShape.
9941 # Example: see GEOM_TestMeasures.py
9942 listSh = self.SubShapeAllIDs(theShape, theType)
9946 ## Obtain quantity of shapes of each type in \a theShape.
9947 # The \a theShape is also counted.
9948 # @param theShape Shape to be described.
9949 # @return Dictionary of ShapeType() with bound quantities of shapes.
9951 # @ref tui_measurement_tools_page "Example"
9952 def ShapeInfo (self, theShape):
9954 Obtain quantity of shapes of each type in theShape.
9955 The theShape is also counted.
9958 theShape Shape to be described.
9961 Dictionary of geompy.ShapeType with bound quantities of shapes.
9963 # Example: see GEOM_TestMeasures.py
9965 for typeSh in self.ShapeType:
9966 if typeSh in ( "AUTO", "SHAPE" ): continue
9967 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9973 def GetCreationInformation(self, theShape):
9974 info = theShape.GetCreationInformation()
9976 opName = info.operationName
9977 if not opName: opName = "no info available"
9978 res = "Operation: " + opName
9980 for parVal in info.params:
9981 res += " \n %s = %s" % ( parVal.name, parVal.value )
9984 ## Get a point, situated at the centre of mass of theShape.
9985 # @param theShape Shape to define centre of mass of.
9986 # @param theName Object name; when specified, this parameter is used
9987 # for result publication in the study. Otherwise, if automatic
9988 # publication is switched on, default value is used for result name.
9990 # @return New GEOM.GEOM_Object, containing the created point.
9992 # @ref tui_measurement_tools_page "Example"
9993 def MakeCDG(self, theShape, theName=None):
9995 Get a point, situated at the centre of mass of theShape.
9998 theShape Shape to define centre of mass of.
9999 theName Object name; when specified, this parameter is used
10000 for result publication in the study. Otherwise, if automatic
10001 publication is switched on, default value is used for result name.
10004 New GEOM.GEOM_Object, containing the created point.
10006 # Example: see GEOM_TestMeasures.py
10007 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10008 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10009 self._autoPublish(anObj, theName, "centerOfMass")
10012 ## Get a vertex sub-shape by index depended with orientation.
10013 # @param theShape Shape to find sub-shape.
10014 # @param theIndex Index to find vertex by this index (starting from zero)
10015 # @param theName Object name; when specified, this parameter is used
10016 # for result publication in the study. Otherwise, if automatic
10017 # publication is switched on, default value is used for result name.
10019 # @return New GEOM.GEOM_Object, containing the created vertex.
10021 # @ref tui_measurement_tools_page "Example"
10022 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10024 Get a vertex sub-shape by index depended with orientation.
10027 theShape Shape to find sub-shape.
10028 theIndex Index to find vertex by this index (starting from zero)
10029 theName Object name; when specified, this parameter is used
10030 for result publication in the study. Otherwise, if automatic
10031 publication is switched on, default value is used for result name.
10034 New GEOM.GEOM_Object, containing the created vertex.
10036 # Example: see GEOM_TestMeasures.py
10037 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10038 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10039 self._autoPublish(anObj, theName, "vertex")
10042 ## Get the first vertex of wire/edge depended orientation.
10043 # @param theShape Shape to find first vertex.
10044 # @param theName Object name; when specified, this parameter is used
10045 # for result publication in the study. Otherwise, if automatic
10046 # publication is switched on, default value is used for result name.
10048 # @return New GEOM.GEOM_Object, containing the created vertex.
10050 # @ref tui_measurement_tools_page "Example"
10051 def GetFirstVertex(self, theShape, theName=None):
10053 Get the first vertex of wire/edge depended orientation.
10056 theShape Shape to find first vertex.
10057 theName Object name; when specified, this parameter is used
10058 for result publication in the study. Otherwise, if automatic
10059 publication is switched on, default value is used for result name.
10062 New GEOM.GEOM_Object, containing the created vertex.
10064 # Example: see GEOM_TestMeasures.py
10065 # note: auto-publishing is done in self.GetVertexByIndex()
10066 anObj = self.GetVertexByIndex(theShape, 0, theName)
10067 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
10070 ## Get the last vertex of wire/edge depended orientation.
10071 # @param theShape Shape to find last vertex.
10072 # @param theName Object name; when specified, this parameter is used
10073 # for result publication in the study. Otherwise, if automatic
10074 # publication is switched on, default value is used for result name.
10076 # @return New GEOM.GEOM_Object, containing the created vertex.
10078 # @ref tui_measurement_tools_page "Example"
10079 def GetLastVertex(self, theShape, theName=None):
10081 Get the last vertex of wire/edge depended orientation.
10084 theShape Shape to find last vertex.
10085 theName Object name; when specified, this parameter is used
10086 for result publication in the study. Otherwise, if automatic
10087 publication is switched on, default value is used for result name.
10090 New GEOM.GEOM_Object, containing the created vertex.
10092 # Example: see GEOM_TestMeasures.py
10093 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10094 # note: auto-publishing is done in self.GetVertexByIndex()
10095 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10096 RaiseIfFailed("GetLastVertex", self.MeasuOp)
10099 ## Get a normale to the given face. If the point is not given,
10100 # the normale is calculated at the center of mass.
10101 # @param theFace Face to define normale of.
10102 # @param theOptionalPoint Point to compute the normale at.
10103 # @param theName Object name; when specified, this parameter is used
10104 # for result publication in the study. Otherwise, if automatic
10105 # publication is switched on, default value is used for result name.
10107 # @return New GEOM.GEOM_Object, containing the created vector.
10109 # @ref swig_todo "Example"
10110 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10112 Get a normale to the given face. If the point is not given,
10113 the normale is calculated at the center of mass.
10116 theFace Face to define normale of.
10117 theOptionalPoint Point to compute the normale at.
10118 theName Object name; when specified, this parameter is used
10119 for result publication in the study. Otherwise, if automatic
10120 publication is switched on, default value is used for result name.
10123 New GEOM.GEOM_Object, containing the created vector.
10125 # Example: see GEOM_TestMeasures.py
10126 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10127 RaiseIfFailed("GetNormal", self.MeasuOp)
10128 self._autoPublish(anObj, theName, "normal")
10131 ## Check a topology of the given shape.
10132 # @param theShape Shape to check validity of.
10133 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10134 # if TRUE, the shape's geometry will be checked also.
10135 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
10136 # of problem is printed.
10137 # if TRUE and if theShape is invalid, the description
10138 # of problem is also returned.
10139 # @return TRUE, if the shape "seems to be valid".
10141 # @ref tui_measurement_tools_page "Example"
10142 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10144 Check a topology of the given shape.
10147 theShape Shape to check validity of.
10148 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10149 if TRUE, the shape's geometry will be checked also.
10150 theReturnStatus If FALSE and if theShape is invalid, a description
10151 of problem is printed.
10152 if TRUE and if theShape is invalid, the description
10153 of problem is returned.
10156 TRUE, if the shape "seems to be valid".
10157 If theShape is invalid, prints a description of problem.
10158 This description can also be returned.
10160 # Example: see GEOM_TestMeasures.py
10162 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10163 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10165 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
10166 RaiseIfFailed("CheckShape", self.MeasuOp)
10168 if theReturnStatus == 0:
10170 if theReturnStatus == 1:
10171 return (IsValid, Status)
10174 ## Detect self-intersections in the given shape.
10175 # @param theShape Shape to check.
10176 # @return TRUE, if the shape contains no self-intersections.
10178 # @ref tui_measurement_tools_page "Example"
10179 def CheckSelfIntersections(self, theShape):
10181 Detect self-intersections in the given shape.
10184 theShape Shape to check.
10187 TRUE, if the shape contains no self-intersections.
10189 # Example: see GEOM_TestMeasures.py
10190 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10191 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10194 ## Get position (LCS) of theShape.
10196 # Origin of the LCS is situated at the shape's center of mass.
10197 # Axes of the LCS are obtained from shape's location or,
10198 # if the shape is a planar face, from position of its plane.
10200 # @param theShape Shape to calculate position of.
10201 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10202 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10203 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10204 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10206 # @ref swig_todo "Example"
10207 def GetPosition(self,theShape):
10209 Get position (LCS) of theShape.
10210 Origin of the LCS is situated at the shape's center of mass.
10211 Axes of the LCS are obtained from shape's location or,
10212 if the shape is a planar face, from position of its plane.
10215 theShape Shape to calculate position of.
10218 [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 # Example: see GEOM_TestMeasures.py
10224 aTuple = self.MeasuOp.GetPosition(theShape)
10225 RaiseIfFailed("GetPosition", self.MeasuOp)
10228 ## Get kind of theShape.
10230 # @param theShape Shape to get a kind of.
10231 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10232 # and a list of parameters, describing the shape.
10233 # @note Concrete meaning of each value, returned via \a theIntegers
10234 # or \a theDoubles list depends on the kind() of the shape.
10236 # @ref swig_todo "Example"
10237 def KindOfShape(self,theShape):
10239 Get kind of theShape.
10242 theShape Shape to get a kind of.
10245 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10246 and a list of parameters, describing the shape.
10248 Concrete meaning of each value, returned via theIntegers
10249 or theDoubles list depends on the geompy.kind of the shape
10251 # Example: see GEOM_TestMeasures.py
10252 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10253 RaiseIfFailed("KindOfShape", self.MeasuOp)
10255 aKind = aRoughTuple[0]
10256 anInts = aRoughTuple[1]
10257 aDbls = aRoughTuple[2]
10259 # Now there is no exception from this rule:
10260 aKindTuple = [aKind] + aDbls + anInts
10262 # If they are we will regroup parameters for such kind of shape.
10264 #if aKind == kind.SOME_KIND:
10265 # # SOME_KIND int int double int double double
10266 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10270 # end of l2_measure
10273 ## @addtogroup l2_import_export
10276 ## Import a shape from the BREP or IGES or STEP file
10277 # (depends on given format) with given name.
10278 # @param theFileName The file, containing the shape.
10279 # @param theFormatName Specify format for the file reading.
10280 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10281 # If format 'IGES_SCALE' is used instead of 'IGES' or
10282 # format 'STEP_SCALE' is used instead of 'STEP',
10283 # length unit will be set to 'meter' and result model will be scaled.
10284 # @param theName Object name; when specified, this parameter is used
10285 # for result publication in the study. Otherwise, if automatic
10286 # publication is switched on, default value is used for result name.
10288 # @return New GEOM.GEOM_Object, containing the imported shape.
10289 # If material names are imported it returns the list of
10290 # objects. The first one is the imported object followed by
10292 # @note Auto publishing is allowed for the shape itself. Imported
10293 # material groups are not automatically published.
10295 # @ref swig_Import_Export "Example"
10296 def ImportFile(self, theFileName, theFormatName, theName=None):
10298 Import a shape from the BREP or IGES or STEP file
10299 (depends on given format) with given name.
10302 theFileName The file, containing the shape.
10303 theFormatName Specify format for the file reading.
10304 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10305 If format 'IGES_SCALE' is used instead of 'IGES' or
10306 format 'STEP_SCALE' is used instead of 'STEP',
10307 length unit will be set to 'meter' and result model will be scaled.
10308 theName Object name; when specified, this parameter is used
10309 for result publication in the study. Otherwise, if automatic
10310 publication is switched on, default value is used for result name.
10313 New GEOM.GEOM_Object, containing the imported shape.
10314 If material names are imported it returns the list of
10315 objects. The first one is the imported object followed by
10318 Auto publishing is allowed for the shape itself. Imported
10319 material groups are not automatically published.
10321 # Example: see GEOM_TestOthers.py
10322 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10323 RaiseIfFailed("ImportFile", self.InsertOp)
10324 aNbObj = len(aListObj)
10326 self._autoPublish(aListObj[0], theName, "imported")
10331 ## Deprecated analog of ImportFile()
10332 def Import(self, theFileName, theFormatName, theName=None):
10334 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10336 print "WARNING: Function Import is deprecated, use ImportFile instead"
10337 # note: auto-publishing is done in self.ImportFile()
10338 return self.ImportFile(theFileName, theFormatName, theName)
10340 ## Shortcut to ImportFile() for BREP format.
10341 # Import a shape from the BREP file with given name.
10342 # @param theFileName The file, containing the shape.
10343 # @param theName Object name; when specified, this parameter is used
10344 # for result publication in the study. Otherwise, if automatic
10345 # publication is switched on, default value is used for result name.
10347 # @return New GEOM.GEOM_Object, containing the imported shape.
10349 # @ref swig_Import_Export "Example"
10350 def ImportBREP(self, theFileName, theName=None):
10352 geompy.ImportFile(...) function for BREP format
10353 Import a shape from the BREP file with given name.
10356 theFileName The file, containing the shape.
10357 theName Object name; when specified, this parameter is used
10358 for result publication in the study. Otherwise, if automatic
10359 publication is switched on, default value is used for result name.
10362 New GEOM.GEOM_Object, containing the imported shape.
10364 # Example: see GEOM_TestOthers.py
10365 # note: auto-publishing is done in self.ImportFile()
10366 return self.ImportFile(theFileName, "BREP", theName)
10368 ## Shortcut to ImportFile() for IGES format
10369 # Import a shape from the IGES file with given name.
10370 # @param theFileName The file, containing the shape.
10371 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10372 # and result model will be scaled, if its units are not meters.
10373 # If False (default), file length units will be taken into account.
10374 # @param theName Object name; when specified, this parameter is used
10375 # for result publication in the study. Otherwise, if automatic
10376 # publication is switched on, default value is used for result name.
10378 # @return New GEOM.GEOM_Object, containing the imported shape.
10380 # @ref swig_Import_Export "Example"
10381 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10383 geompy.ImportFile(...) function for IGES format
10386 theFileName The file, containing the shape.
10387 ignoreUnits If True, file length units will be ignored (set to 'meter')
10388 and result model will be scaled, if its units are not meters.
10389 If False (default), file length units will be taken into account.
10390 theName Object name; when specified, this parameter is used
10391 for result publication in the study. Otherwise, if automatic
10392 publication is switched on, default value is used for result name.
10395 New GEOM.GEOM_Object, containing the imported shape.
10397 # Example: see GEOM_TestOthers.py
10398 # note: auto-publishing is done in self.ImportFile()
10400 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10401 return self.ImportFile(theFileName, "IGES", theName)
10403 ## Return length unit from given IGES file
10404 # @param theFileName The file, containing the shape.
10405 # @return String, containing the units name.
10407 # @ref swig_Import_Export "Example"
10408 def GetIGESUnit(self, theFileName):
10410 Return length units from given IGES file
10413 theFileName The file, containing the shape.
10416 String, containing the units name.
10418 # Example: see GEOM_TestOthers.py
10419 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10422 ## Shortcut to ImportFile() for STEP format
10423 # Import a shape from the STEP file with given name.
10424 # @param theFileName The file, containing the shape.
10425 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10426 # and result model will be scaled, if its units are not meters.
10427 # If False (default), file length units will be taken into account.
10428 # @param theName Object name; when specified, this parameter is used
10429 # for result publication in the study. Otherwise, if automatic
10430 # publication is switched on, default value is used for result name.
10432 # @return New GEOM.GEOM_Object, containing the imported shape.
10433 # If material names are imported it returns the list of
10434 # objects. The first one is the imported object followed by
10436 # @note Auto publishing is allowed for the shape itself. Imported
10437 # material groups are not automatically published.
10439 # @ref swig_Import_Export "Example"
10440 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10442 geompy.ImportFile(...) function for STEP format
10445 theFileName The file, containing the shape.
10446 ignoreUnits If True, file length units will be ignored (set to 'meter')
10447 and result model will be scaled, if its units are not meters.
10448 If False (default), file length units will be taken into account.
10449 theName Object name; when specified, this parameter is used
10450 for result publication in the study. Otherwise, if automatic
10451 publication is switched on, default value is used for result name.
10454 New GEOM.GEOM_Object, containing the imported shape.
10455 If material names are imported it returns the list of
10456 objects. The first one is the imported object followed by
10459 Auto publishing is allowed for the shape itself. Imported
10460 material groups are not automatically published.
10462 # Example: see GEOM_TestOthers.py
10463 # note: auto-publishing is done in self.ImportFile()
10465 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10466 return self.ImportFile(theFileName, "STEP", theName)
10468 ## Return length unit from given IGES or STEP file
10469 # @param theFileName The file, containing the shape.
10470 # @return String, containing the units name.
10472 # @ref swig_Import_Export "Example"
10473 def GetSTEPUnit(self, theFileName):
10475 Return length units from given STEP file
10478 theFileName The file, containing the shape.
10481 String, containing the units name.
10483 # Example: see GEOM_TestOthers.py
10484 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10487 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10488 # @note This method will not be dumped to the python script by DumpStudy functionality.
10489 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10490 # @param theStream The BRep binary stream.
10491 # @param theName Object name; when specified, this parameter is used
10492 # for result publication in the study. Otherwise, if automatic
10493 # publication is switched on, default value is used for result name.
10495 # @return New GEOM_Object, containing the shape, read from theStream.
10497 # @ref swig_Import_Export "Example"
10498 def RestoreShape (self, theStream, theName=None):
10500 Read a shape from the binary stream, containing its bounding representation (BRep).
10503 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10506 theStream The BRep binary stream.
10507 theName Object name; when specified, this parameter is used
10508 for result publication in the study. Otherwise, if automatic
10509 publication is switched on, default value is used for result name.
10512 New GEOM_Object, containing the shape, read from theStream.
10514 # Example: see GEOM_TestOthers.py
10515 anObj = self.InsertOp.RestoreShape(theStream)
10516 RaiseIfFailed("RestoreShape", self.InsertOp)
10517 self._autoPublish(anObj, theName, "restored")
10520 ## Export the given shape into a file with given name.
10521 # @param theObject Shape to be stored in the file.
10522 # @param theFileName Name of the file to store the given shape in.
10523 # @param theFormatName Specify format for the shape storage.
10524 # Available formats can be obtained with
10525 # geompy.InsertOp.ExportTranslators()[0] method.
10527 # @ref swig_Import_Export "Example"
10528 def Export(self, theObject, theFileName, theFormatName):
10530 Export the given shape into a file with given name.
10533 theObject Shape to be stored in the file.
10534 theFileName Name of the file to store the given shape in.
10535 theFormatName Specify format for the shape storage.
10536 Available formats can be obtained with
10537 geompy.InsertOp.ExportTranslators()[0] method.
10539 # Example: see GEOM_TestOthers.py
10540 self.InsertOp.Export(theObject, theFileName, theFormatName)
10541 if self.InsertOp.IsDone() == 0:
10542 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10546 ## Shortcut to Export() for BREP format
10548 # @ref swig_Import_Export "Example"
10549 def ExportBREP(self,theObject, theFileName):
10551 geompy.Export(...) function for BREP format
10553 # Example: see GEOM_TestOthers.py
10554 return self.Export(theObject, theFileName, "BREP")
10556 ## Shortcut to Export() for IGES format
10558 # @ref swig_Import_Export "Example"
10559 def ExportIGES(self,theObject, theFileName):
10561 geompy.Export(...) function for IGES format
10563 # Example: see GEOM_TestOthers.py
10564 return self.Export(theObject, theFileName, "IGES")
10566 ## Shortcut to Export() for STEP format
10568 # @ref swig_Import_Export "Example"
10569 def ExportSTEP(self,theObject, theFileName):
10571 geompy.Export(...) function for STEP format
10573 # Example: see GEOM_TestOthers.py
10574 return self.Export(theObject, theFileName, "STEP")
10576 # end of l2_import_export
10579 ## @addtogroup l3_blocks
10582 ## Create a quadrangle face from four edges. Order of Edges is not
10583 # important. It is not necessary that edges share the same vertex.
10584 # @param E1,E2,E3,E4 Edges for the face bound.
10585 # @param theName Object name; when specified, this parameter is used
10586 # for result publication in the study. Otherwise, if automatic
10587 # publication is switched on, default value is used for result name.
10589 # @return New GEOM.GEOM_Object, containing the created face.
10591 # @ref tui_building_by_blocks_page "Example"
10592 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10594 Create a quadrangle face from four edges. Order of Edges is not
10595 important. It is not necessary that edges share the same vertex.
10598 E1,E2,E3,E4 Edges for the face bound.
10599 theName Object name; when specified, this parameter is used
10600 for result publication in the study. Otherwise, if automatic
10601 publication is switched on, default value is used for result name.
10604 New GEOM.GEOM_Object, containing the created face.
10607 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10609 # Example: see GEOM_Spanner.py
10610 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10611 RaiseIfFailed("MakeQuad", self.BlocksOp)
10612 self._autoPublish(anObj, theName, "quad")
10615 ## Create a quadrangle face on two edges.
10616 # The missing edges will be built by creating the shortest ones.
10617 # @param E1,E2 Two opposite edges for the face.
10618 # @param theName Object name; when specified, this parameter is used
10619 # for result publication in the study. Otherwise, if automatic
10620 # publication is switched on, default value is used for result name.
10622 # @return New GEOM.GEOM_Object, containing the created face.
10624 # @ref tui_building_by_blocks_page "Example"
10625 def MakeQuad2Edges(self, E1, E2, theName=None):
10627 Create a quadrangle face on two edges.
10628 The missing edges will be built by creating the shortest ones.
10631 E1,E2 Two opposite edges for the face.
10632 theName Object name; when specified, this parameter is used
10633 for result publication in the study. Otherwise, if automatic
10634 publication is switched on, default value is used for result name.
10637 New GEOM.GEOM_Object, containing the created face.
10641 p1 = geompy.MakeVertex( 0., 0., 0.)
10642 p2 = geompy.MakeVertex(150., 30., 0.)
10643 p3 = geompy.MakeVertex( 0., 120., 50.)
10644 p4 = geompy.MakeVertex( 0., 40., 70.)
10646 edge1 = geompy.MakeEdge(p1, p2)
10647 edge2 = geompy.MakeEdge(p3, p4)
10648 # create a quadrangle face from two edges
10649 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10651 # Example: see GEOM_Spanner.py
10652 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10653 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10654 self._autoPublish(anObj, theName, "quad")
10657 ## Create a quadrangle face with specified corners.
10658 # The missing edges will be built by creating the shortest ones.
10659 # @param V1,V2,V3,V4 Corner vertices for the face.
10660 # @param theName Object name; when specified, this parameter is used
10661 # for result publication in the study. Otherwise, if automatic
10662 # publication is switched on, default value is used for result name.
10664 # @return New GEOM.GEOM_Object, containing the created face.
10666 # @ref tui_building_by_blocks_page "Example 1"
10667 # \n @ref swig_MakeQuad4Vertices "Example 2"
10668 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10670 Create a quadrangle face with specified corners.
10671 The missing edges will be built by creating the shortest ones.
10674 V1,V2,V3,V4 Corner vertices for the face.
10675 theName Object name; when specified, this parameter is used
10676 for result publication in the study. Otherwise, if automatic
10677 publication is switched on, default value is used for result name.
10680 New GEOM.GEOM_Object, containing the created face.
10684 p1 = geompy.MakeVertex( 0., 0., 0.)
10685 p2 = geompy.MakeVertex(150., 30., 0.)
10686 p3 = geompy.MakeVertex( 0., 120., 50.)
10687 p4 = geompy.MakeVertex( 0., 40., 70.)
10688 # create a quadrangle from four points in its corners
10689 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10691 # Example: see GEOM_Spanner.py
10692 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10693 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10694 self._autoPublish(anObj, theName, "quad")
10697 ## Create a hexahedral solid, bounded by the six given faces. Order of
10698 # faces is not important. It is not necessary that Faces share the same edge.
10699 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10700 # @param theName Object name; when specified, this parameter is used
10701 # for result publication in the study. Otherwise, if automatic
10702 # publication is switched on, default value is used for result name.
10704 # @return New GEOM.GEOM_Object, containing the created solid.
10706 # @ref tui_building_by_blocks_page "Example 1"
10707 # \n @ref swig_MakeHexa "Example 2"
10708 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10710 Create a hexahedral solid, bounded by the six given faces. Order of
10711 faces is not important. It is not necessary that Faces share the same edge.
10714 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10715 theName Object name; when specified, this parameter is used
10716 for result publication in the study. Otherwise, if automatic
10717 publication is switched on, default value is used for result name.
10720 New GEOM.GEOM_Object, containing the created solid.
10723 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10725 # Example: see GEOM_Spanner.py
10726 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10727 RaiseIfFailed("MakeHexa", self.BlocksOp)
10728 self._autoPublish(anObj, theName, "hexa")
10731 ## Create a hexahedral solid between two given faces.
10732 # The missing faces will be built by creating the smallest ones.
10733 # @param F1,F2 Two opposite faces for the hexahedral solid.
10734 # @param theName Object name; when specified, this parameter is used
10735 # for result publication in the study. Otherwise, if automatic
10736 # publication is switched on, default value is used for result name.
10738 # @return New GEOM.GEOM_Object, containing the created solid.
10740 # @ref tui_building_by_blocks_page "Example 1"
10741 # \n @ref swig_MakeHexa2Faces "Example 2"
10742 def MakeHexa2Faces(self, F1, F2, theName=None):
10744 Create a hexahedral solid between two given faces.
10745 The missing faces will be built by creating the smallest ones.
10748 F1,F2 Two opposite faces for the hexahedral solid.
10749 theName Object name; when specified, this parameter is used
10750 for result publication in the study. Otherwise, if automatic
10751 publication is switched on, default value is used for result name.
10754 New GEOM.GEOM_Object, containing the created solid.
10757 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10759 # Example: see GEOM_Spanner.py
10760 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10761 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10762 self._autoPublish(anObj, theName, "hexa")
10768 ## @addtogroup l3_blocks_op
10771 ## Get a vertex, found in the given shape by its coordinates.
10772 # @param theShape Block or a compound of blocks.
10773 # @param theX,theY,theZ Coordinates of the sought vertex.
10774 # @param theEpsilon Maximum allowed distance between the resulting
10775 # vertex and point with the given coordinates.
10776 # @param theName Object name; when specified, this parameter is used
10777 # for result publication in the study. Otherwise, if automatic
10778 # publication is switched on, default value is used for result name.
10780 # @return New GEOM.GEOM_Object, containing the found vertex.
10782 # @ref swig_GetPoint "Example"
10783 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10785 Get a vertex, found in the given shape by its coordinates.
10788 theShape Block or a compound of blocks.
10789 theX,theY,theZ Coordinates of the sought vertex.
10790 theEpsilon Maximum allowed distance between the resulting
10791 vertex and point with the given coordinates.
10792 theName Object name; when specified, this parameter is used
10793 for result publication in the study. Otherwise, if automatic
10794 publication is switched on, default value is used for result name.
10797 New GEOM.GEOM_Object, containing the found vertex.
10800 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10802 # Example: see GEOM_TestOthers.py
10803 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10804 RaiseIfFailed("GetPoint", self.BlocksOp)
10805 self._autoPublish(anObj, theName, "vertex")
10808 ## Find a vertex of the given shape, which has minimal distance to the given point.
10809 # @param theShape Any shape.
10810 # @param thePoint Point, close to the desired vertex.
10811 # @param theName Object name; when specified, this parameter is used
10812 # for result publication in the study. Otherwise, if automatic
10813 # publication is switched on, default value is used for result name.
10815 # @return New GEOM.GEOM_Object, containing the found vertex.
10817 # @ref swig_GetVertexNearPoint "Example"
10818 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10820 Find a vertex of the given shape, which has minimal distance to the given point.
10823 theShape Any shape.
10824 thePoint Point, close to the desired vertex.
10825 theName Object name; when specified, this parameter is used
10826 for result publication in the study. Otherwise, if automatic
10827 publication is switched on, default value is used for result name.
10830 New GEOM.GEOM_Object, containing the found vertex.
10833 pmidle = geompy.MakeVertex(50, 0, 50)
10834 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10836 # Example: see GEOM_TestOthers.py
10837 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10838 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10839 self._autoPublish(anObj, theName, "vertex")
10842 ## Get an edge, found in the given shape by two given vertices.
10843 # @param theShape Block or a compound of blocks.
10844 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10845 # @param theName Object name; when specified, this parameter is used
10846 # for result publication in the study. Otherwise, if automatic
10847 # publication is switched on, default value is used for result name.
10849 # @return New GEOM.GEOM_Object, containing the found edge.
10851 # @ref swig_GetEdge "Example"
10852 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10854 Get an edge, found in the given shape by two given vertices.
10857 theShape Block or a compound of blocks.
10858 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10859 theName Object name; when specified, this parameter is used
10860 for result publication in the study. Otherwise, if automatic
10861 publication is switched on, default value is used for result name.
10864 New GEOM.GEOM_Object, containing the found edge.
10866 # Example: see GEOM_Spanner.py
10867 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10868 RaiseIfFailed("GetEdge", self.BlocksOp)
10869 self._autoPublish(anObj, theName, "edge")
10872 ## Find an edge of the given shape, which has minimal distance to the given point.
10873 # @param theShape Block or a compound of blocks.
10874 # @param thePoint Point, close to the desired edge.
10875 # @param theName Object name; when specified, this parameter is used
10876 # for result publication in the study. Otherwise, if automatic
10877 # publication is switched on, default value is used for result name.
10879 # @return New GEOM.GEOM_Object, containing the found edge.
10881 # @ref swig_GetEdgeNearPoint "Example"
10882 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10884 Find an edge of the given shape, which has minimal distance to the given point.
10887 theShape Block or a compound of blocks.
10888 thePoint Point, close to the desired edge.
10889 theName Object name; when specified, this parameter is used
10890 for result publication in the study. Otherwise, if automatic
10891 publication is switched on, default value is used for result name.
10894 New GEOM.GEOM_Object, containing the found edge.
10896 # Example: see GEOM_TestOthers.py
10897 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10898 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10899 self._autoPublish(anObj, theName, "edge")
10902 ## Returns a face, found in the given shape by four given corner vertices.
10903 # @param theShape Block or a compound of blocks.
10904 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10905 # @param theName Object name; when specified, this parameter is used
10906 # for result publication in the study. Otherwise, if automatic
10907 # publication is switched on, default value is used for result name.
10909 # @return New GEOM.GEOM_Object, containing the found face.
10911 # @ref swig_todo "Example"
10912 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10914 Returns a face, found in the given shape by four given corner vertices.
10917 theShape Block or a compound of blocks.
10918 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10919 theName Object name; when specified, this parameter is used
10920 for result publication in the study. Otherwise, if automatic
10921 publication is switched on, default value is used for result name.
10924 New GEOM.GEOM_Object, containing the found face.
10926 # Example: see GEOM_Spanner.py
10927 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10928 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10929 self._autoPublish(anObj, theName, "face")
10932 ## Get a face of block, found in the given shape by two given edges.
10933 # @param theShape Block or a compound of blocks.
10934 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10935 # @param theName Object name; when specified, this parameter is used
10936 # for result publication in the study. Otherwise, if automatic
10937 # publication is switched on, default value is used for result name.
10939 # @return New GEOM.GEOM_Object, containing the found face.
10941 # @ref swig_todo "Example"
10942 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10944 Get a face of block, found in the given shape by two given edges.
10947 theShape Block or a compound of blocks.
10948 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10949 theName Object name; when specified, this parameter is used
10950 for result publication in the study. Otherwise, if automatic
10951 publication is switched on, default value is used for result name.
10954 New GEOM.GEOM_Object, containing the found face.
10956 # Example: see GEOM_Spanner.py
10957 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10958 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10959 self._autoPublish(anObj, theName, "face")
10962 ## Find a face, opposite to the given one in the given block.
10963 # @param theBlock Must be a hexahedral solid.
10964 # @param theFace Face of \a theBlock, opposite to the desired face.
10965 # @param theName Object name; when specified, this parameter is used
10966 # for result publication in the study. Otherwise, if automatic
10967 # publication is switched on, default value is used for result name.
10969 # @return New GEOM.GEOM_Object, containing the found face.
10971 # @ref swig_GetOppositeFace "Example"
10972 def GetOppositeFace(self, theBlock, theFace, theName=None):
10974 Find a face, opposite to the given one in the given block.
10977 theBlock Must be a hexahedral solid.
10978 theFace Face of theBlock, opposite to the desired face.
10979 theName Object name; when specified, this parameter is used
10980 for result publication in the study. Otherwise, if automatic
10981 publication is switched on, default value is used for result name.
10984 New GEOM.GEOM_Object, containing the found face.
10986 # Example: see GEOM_Spanner.py
10987 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10988 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10989 self._autoPublish(anObj, theName, "face")
10992 ## Find a face of the given shape, which has minimal distance to the given point.
10993 # @param theShape Block or a compound of blocks.
10994 # @param thePoint Point, close to the desired face.
10995 # @param theName Object name; when specified, this parameter is used
10996 # for result publication in the study. Otherwise, if automatic
10997 # publication is switched on, default value is used for result name.
10999 # @return New GEOM.GEOM_Object, containing the found face.
11001 # @ref swig_GetFaceNearPoint "Example"
11002 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11004 Find a face of the given shape, which has minimal distance to the given point.
11007 theShape Block or a compound of blocks.
11008 thePoint Point, close to the desired face.
11009 theName Object name; when specified, this parameter is used
11010 for result publication in the study. Otherwise, if automatic
11011 publication is switched on, default value is used for result name.
11014 New GEOM.GEOM_Object, containing the found face.
11016 # Example: see GEOM_Spanner.py
11017 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11018 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11019 self._autoPublish(anObj, theName, "face")
11022 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11023 # @param theBlock Block or a compound of blocks.
11024 # @param theVector Vector, close to the normale of the desired face.
11025 # @param theName Object name; when specified, this parameter is used
11026 # for result publication in the study. Otherwise, if automatic
11027 # publication is switched on, default value is used for result name.
11029 # @return New GEOM.GEOM_Object, containing the found face.
11031 # @ref swig_todo "Example"
11032 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11034 Find a face of block, whose outside normale has minimal angle with the given vector.
11037 theBlock Block or a compound of blocks.
11038 theVector Vector, close to the normale of the desired face.
11039 theName Object name; when specified, this parameter is used
11040 for result publication in the study. Otherwise, if automatic
11041 publication is switched on, default value is used for result name.
11044 New GEOM.GEOM_Object, containing the found face.
11046 # Example: see GEOM_Spanner.py
11047 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11048 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11049 self._autoPublish(anObj, theName, "face")
11052 ## Find all sub-shapes of type \a theShapeType of the given shape,
11053 # which have minimal distance to the given point.
11054 # @param theShape Any shape.
11055 # @param thePoint Point, close to the desired shape.
11056 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11057 # @param theTolerance The tolerance for distances comparison. All shapes
11058 # with distances to the given point in interval
11059 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11060 # @param theName Object name; when specified, this parameter is used
11061 # for result publication in the study. Otherwise, if automatic
11062 # publication is switched on, default value is used for result name.
11064 # @return New GEOM_Object, containing a group of all found shapes.
11066 # @ref swig_GetShapesNearPoint "Example"
11067 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11069 Find all sub-shapes of type theShapeType of the given shape,
11070 which have minimal distance to the given point.
11073 theShape Any shape.
11074 thePoint Point, close to the desired shape.
11075 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11076 theTolerance The tolerance for distances comparison. All shapes
11077 with distances to the given point in interval
11078 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11079 theName Object name; when specified, this parameter is used
11080 for result publication in the study. Otherwise, if automatic
11081 publication is switched on, default value is used for result name.
11084 New GEOM_Object, containing a group of all found shapes.
11086 # Example: see GEOM_TestOthers.py
11087 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11088 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11089 self._autoPublish(anObj, theName, "group")
11092 # end of l3_blocks_op
11095 ## @addtogroup l4_blocks_measure
11098 ## Check, if the compound of blocks is given.
11099 # To be considered as a compound of blocks, the
11100 # given shape must satisfy the following conditions:
11101 # - Each element of the compound should be a Block (6 faces and 12 edges).
11102 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11103 # - The compound should be connexe.
11104 # - The glue between two quadrangle faces should be applied.
11105 # @param theCompound The compound to check.
11106 # @return TRUE, if the given shape is a compound of blocks.
11107 # If theCompound is not valid, prints all discovered errors.
11109 # @ref tui_measurement_tools_page "Example 1"
11110 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11111 def CheckCompoundOfBlocks(self,theCompound):
11113 Check, if the compound of blocks is given.
11114 To be considered as a compound of blocks, the
11115 given shape must satisfy the following conditions:
11116 - Each element of the compound should be a Block (6 faces and 12 edges).
11117 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11118 - The compound should be connexe.
11119 - The glue between two quadrangle faces should be applied.
11122 theCompound The compound to check.
11125 TRUE, if the given shape is a compound of blocks.
11126 If theCompound is not valid, prints all discovered errors.
11128 # Example: see GEOM_Spanner.py
11129 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11130 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11132 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11136 ## Retrieve all non blocks solids and faces from \a theShape.
11137 # @param theShape The shape to explore.
11138 # @param theName Object name; when specified, this parameter is used
11139 # for result publication in the study. Otherwise, if automatic
11140 # publication is switched on, default value is used for result name.
11142 # @return A tuple of two GEOM_Objects. The first object is a group of all
11143 # non block solids (= not 6 faces, or with 6 faces, but with the
11144 # presence of non-quadrangular faces). The second object is a
11145 # group of all non quadrangular faces.
11147 # @ref tui_measurement_tools_page "Example 1"
11148 # \n @ref swig_GetNonBlocks "Example 2"
11149 def GetNonBlocks (self, theShape, theName=None):
11151 Retrieve all non blocks solids and faces from theShape.
11154 theShape The shape to explore.
11155 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.
11160 A tuple of two GEOM_Objects. The first object is a group of all
11161 non block solids (= not 6 faces, or with 6 faces, but with the
11162 presence of non-quadrangular faces). The second object is a
11163 group of all non quadrangular faces.
11166 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11168 # Example: see GEOM_Spanner.py
11169 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11170 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11171 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11174 ## Remove all seam and degenerated edges from \a theShape.
11175 # Unite faces and edges, sharing one surface. It means that
11176 # this faces must have references to one C++ surface object (handle).
11177 # @param theShape The compound or single solid to remove irregular edges from.
11178 # @param doUnionFaces If True, then unite faces. If False (the default value),
11179 # do not unite faces.
11180 # @param theName Object name; when specified, this parameter is used
11181 # for result publication in the study. Otherwise, if automatic
11182 # publication is switched on, default value is used for result name.
11184 # @return Improved shape.
11186 # @ref swig_RemoveExtraEdges "Example"
11187 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11189 Remove all seam and degenerated edges from theShape.
11190 Unite faces and edges, sharing one surface. It means that
11191 this faces must have references to one C++ surface object (handle).
11194 theShape The compound or single solid to remove irregular edges from.
11195 doUnionFaces If True, then unite faces. If False (the default value),
11196 do not unite faces.
11197 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.
11204 # Example: see GEOM_TestOthers.py
11205 nbFacesOptimum = -1 # -1 means do not unite faces
11206 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11207 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11208 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11209 self._autoPublish(anObj, theName, "removeExtraEdges")
11212 ## Performs union faces of \a theShape
11213 # Unite faces sharing one surface. It means that
11214 # these faces must have references to one C++ surface object (handle).
11215 # @param theShape The compound or single solid that contains faces
11216 # to perform union.
11217 # @param theName Object name; when specified, this parameter is used
11218 # for result publication in the study. Otherwise, if automatic
11219 # publication is switched on, default value is used for result name.
11221 # @return Improved shape.
11223 # @ref swig_UnionFaces "Example"
11224 def UnionFaces(self, theShape, theName=None):
11226 Performs union faces of theShape.
11227 Unite faces sharing one surface. It means that
11228 these faces must have references to one C++ surface object (handle).
11231 theShape The compound or single solid that contains faces
11233 theName Object name; when specified, this parameter is used
11234 for result publication in the study. Otherwise, if automatic
11235 publication is switched on, default value is used for result name.
11240 # Example: see GEOM_TestOthers.py
11241 anObj = self.BlocksOp.UnionFaces(theShape)
11242 RaiseIfFailed("UnionFaces", self.BlocksOp)
11243 self._autoPublish(anObj, theName, "unionFaces")
11246 ## Check, if the given shape is a blocks compound.
11247 # Fix all detected errors.
11248 # \note Single block can be also fixed by this method.
11249 # @param theShape The compound to check and improve.
11250 # @param 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.
11254 # @return Improved compound.
11256 # @ref swig_CheckAndImprove "Example"
11257 def CheckAndImprove(self, theShape, theName=None):
11259 Check, if the given shape is a blocks compound.
11260 Fix all detected errors.
11263 Single block can be also fixed by this method.
11266 theShape The compound to check and improve.
11267 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.
11274 # Example: see GEOM_TestOthers.py
11275 anObj = self.BlocksOp.CheckAndImprove(theShape)
11276 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11277 self._autoPublish(anObj, theName, "improved")
11280 # end of l4_blocks_measure
11283 ## @addtogroup l3_blocks_op
11286 ## Get all the blocks, contained in the given compound.
11287 # @param theCompound The compound to explode.
11288 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11289 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11290 # @param theName Object name; when specified, this parameter is used
11291 # for result publication in the study. Otherwise, if automatic
11292 # publication is switched on, default value is used for result name.
11294 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11296 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11298 # @ref tui_explode_on_blocks "Example 1"
11299 # \n @ref swig_MakeBlockExplode "Example 2"
11300 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11302 Get all the blocks, contained in the given compound.
11305 theCompound The compound to explode.
11306 theMinNbFaces If solid has lower number of faces, it is not a block.
11307 theMaxNbFaces If solid has higher number of faces, it is not a block.
11308 theName Object name; when specified, this parameter is used
11309 for result publication in the study. Otherwise, if automatic
11310 publication is switched on, default value is used for result name.
11313 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11316 List of GEOM.GEOM_Object, containing the retrieved blocks.
11318 # Example: see GEOM_TestOthers.py
11319 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11320 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11321 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11322 for anObj in aList:
11323 anObj.SetParameters(Parameters)
11325 self._autoPublish(aList, theName, "block")
11328 ## Find block, containing the given point inside its volume or on boundary.
11329 # @param theCompound Compound, to find block in.
11330 # @param thePoint Point, close to the desired block. If the point lays on
11331 # boundary between some blocks, we return block with nearest center.
11332 # @param theName Object name; when specified, this parameter is used
11333 # for result publication in the study. Otherwise, if automatic
11334 # publication is switched on, default value is used for result name.
11336 # @return New GEOM.GEOM_Object, containing the found block.
11338 # @ref swig_todo "Example"
11339 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11341 Find block, containing the given point inside its volume or on boundary.
11344 theCompound Compound, to find block in.
11345 thePoint Point, close to the desired block. If the point lays on
11346 boundary between some blocks, we return block with nearest center.
11347 theName Object name; when specified, this parameter is used
11348 for result publication in the study. Otherwise, if automatic
11349 publication is switched on, default value is used for result name.
11352 New GEOM.GEOM_Object, containing the found block.
11354 # Example: see GEOM_Spanner.py
11355 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11356 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11357 self._autoPublish(anObj, theName, "block")
11360 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11361 # @param theCompound Compound, to find block in.
11362 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11363 # @param theName Object name; when specified, this parameter is used
11364 # for result publication in the study. Otherwise, if automatic
11365 # publication is switched on, default value is used for result name.
11367 # @return New GEOM.GEOM_Object, containing the found block.
11369 # @ref swig_GetBlockByParts "Example"
11370 def GetBlockByParts(self, theCompound, theParts, theName=None):
11372 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11375 theCompound Compound, to find block in.
11376 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11377 theName Object name; when specified, this parameter is used
11378 for result publication in the study. Otherwise, if automatic
11379 publication is switched on, default value is used for result name.
11382 New GEOM_Object, containing the found block.
11384 # Example: see GEOM_TestOthers.py
11385 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11386 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11387 self._autoPublish(anObj, theName, "block")
11390 ## Return all blocks, containing all the elements, passed as the parts.
11391 # @param theCompound Compound, to find blocks in.
11392 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11393 # @param theName Object name; when specified, this parameter is used
11394 # for result publication in the study. Otherwise, if automatic
11395 # publication is switched on, default value is used for result name.
11397 # @return List of GEOM.GEOM_Object, containing the found blocks.
11399 # @ref swig_todo "Example"
11400 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11402 Return all blocks, containing all the elements, passed as the parts.
11405 theCompound Compound, to find blocks in.
11406 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11407 theName Object name; when specified, this parameter is used
11408 for result publication in the study. Otherwise, if automatic
11409 publication is switched on, default value is used for result name.
11412 List of GEOM.GEOM_Object, containing the found blocks.
11414 # Example: see GEOM_Spanner.py
11415 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11416 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11417 self._autoPublish(aList, theName, "block")
11420 ## Multi-transformate block and glue the result.
11421 # Transformation is defined so, as to superpose direction faces.
11422 # @param Block Hexahedral solid to be multi-transformed.
11423 # @param DirFace1 ID of First direction face.
11424 # @param DirFace2 ID of Second direction face.
11425 # @param NbTimes Quantity of transformations to be done.
11426 # @param theName Object name; when specified, this parameter is used
11427 # for result publication in the study. Otherwise, if automatic
11428 # publication is switched on, default value is used for result name.
11430 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11432 # @return New GEOM.GEOM_Object, containing the result shape.
11434 # @ref tui_multi_transformation "Example"
11435 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11437 Multi-transformate block and glue the result.
11438 Transformation is defined so, as to superpose direction faces.
11441 Block Hexahedral solid to be multi-transformed.
11442 DirFace1 ID of First direction face.
11443 DirFace2 ID of Second direction face.
11444 NbTimes Quantity of transformations to be done.
11445 theName Object name; when specified, this parameter is used
11446 for result publication in the study. Otherwise, if automatic
11447 publication is switched on, default value is used for result name.
11450 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11453 New GEOM.GEOM_Object, containing the result shape.
11455 # Example: see GEOM_Spanner.py
11456 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11457 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11458 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11459 anObj.SetParameters(Parameters)
11460 self._autoPublish(anObj, theName, "transformed")
11463 ## Multi-transformate block and glue the result.
11464 # @param Block Hexahedral solid to be multi-transformed.
11465 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11466 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11467 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11468 # @param theName Object name; when specified, this parameter is used
11469 # for result publication in the study. Otherwise, if automatic
11470 # publication is switched on, default value is used for result name.
11472 # @return New GEOM.GEOM_Object, containing the result shape.
11474 # @ref tui_multi_transformation "Example"
11475 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11476 DirFace1V, DirFace2V, NbTimesV, theName=None):
11478 Multi-transformate block and glue the result.
11481 Block Hexahedral solid to be multi-transformed.
11482 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11483 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11484 NbTimesU,NbTimesV Quantity of transformations to be done.
11485 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.
11490 New GEOM.GEOM_Object, containing the result shape.
11492 # Example: see GEOM_Spanner.py
11493 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11494 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11495 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11496 DirFace1V, DirFace2V, NbTimesV)
11497 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11498 anObj.SetParameters(Parameters)
11499 self._autoPublish(anObj, theName, "transformed")
11502 ## Build all possible propagation groups.
11503 # Propagation group is a set of all edges, opposite to one (main)
11504 # edge of this group directly or through other opposite edges.
11505 # Notion of Opposite Edge make sence only on quadrangle face.
11506 # @param theShape Shape to build propagation groups on.
11507 # @param theName Object name; when specified, this parameter is used
11508 # for result publication in the study. Otherwise, if automatic
11509 # publication is switched on, default value is used for result name.
11511 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11513 # @ref swig_Propagate "Example"
11514 def Propagate(self, theShape, theName=None):
11516 Build all possible propagation groups.
11517 Propagation group is a set of all edges, opposite to one (main)
11518 edge of this group directly or through other opposite edges.
11519 Notion of Opposite Edge make sence only on quadrangle face.
11522 theShape Shape to build propagation groups on.
11523 theName Object name; when specified, this parameter is used
11524 for result publication in the study. Otherwise, if automatic
11525 publication is switched on, default value is used for result name.
11528 List of GEOM.GEOM_Object, each of them is a propagation group.
11530 # Example: see GEOM_TestOthers.py
11531 listChains = self.BlocksOp.Propagate(theShape)
11532 RaiseIfFailed("Propagate", self.BlocksOp)
11533 self._autoPublish(listChains, theName, "propagate")
11536 # end of l3_blocks_op
11539 ## @addtogroup l3_groups
11542 ## Creates a new group which will store sub-shapes of theMainShape
11543 # @param theMainShape is a GEOM object on which the group is selected
11544 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11545 # @param theName Object name; when specified, this parameter is used
11546 # for result publication in the study. Otherwise, if automatic
11547 # publication is switched on, default value is used for result name.
11549 # @return a newly created GEOM group (GEOM.GEOM_Object)
11551 # @ref tui_working_with_groups_page "Example 1"
11552 # \n @ref swig_CreateGroup "Example 2"
11553 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11555 Creates a new group which will store sub-shapes of theMainShape
11558 theMainShape is a GEOM object on which the group is selected
11559 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11560 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11561 theName Object name; when specified, this parameter is used
11562 for result publication in the study. Otherwise, if automatic
11563 publication is switched on, default value is used for result name.
11566 a newly created GEOM group
11569 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11572 # Example: see GEOM_TestOthers.py
11573 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11574 RaiseIfFailed("CreateGroup", self.GroupOp)
11575 self._autoPublish(anObj, theName, "group")
11578 ## Adds a sub-object with ID theSubShapeId to the group
11579 # @param theGroup is a GEOM group to which the new sub-shape is added
11580 # @param theSubShapeID is a sub-shape ID in the main object.
11581 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11583 # @ref tui_working_with_groups_page "Example"
11584 def AddObject(self,theGroup, theSubShapeID):
11586 Adds a sub-object with ID theSubShapeId to the group
11589 theGroup is a GEOM group to which the new sub-shape is added
11590 theSubShapeID is a sub-shape ID in the main object.
11593 Use method GetSubShapeID() to get an unique ID of the sub-shape
11595 # Example: see GEOM_TestOthers.py
11596 self.GroupOp.AddObject(theGroup, theSubShapeID)
11597 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11598 RaiseIfFailed("AddObject", self.GroupOp)
11602 ## Removes a sub-object with ID \a theSubShapeId from the group
11603 # @param theGroup is a GEOM group from which the new sub-shape is removed
11604 # @param theSubShapeID is a sub-shape ID in the main object.
11605 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11607 # @ref tui_working_with_groups_page "Example"
11608 def RemoveObject(self,theGroup, theSubShapeID):
11610 Removes a sub-object with ID theSubShapeId from the group
11613 theGroup is a GEOM group from which the new sub-shape is removed
11614 theSubShapeID is a sub-shape ID in the main object.
11617 Use method GetSubShapeID() to get an unique ID of the sub-shape
11619 # Example: see GEOM_TestOthers.py
11620 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11621 RaiseIfFailed("RemoveObject", self.GroupOp)
11624 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11625 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11626 # @param theSubShapes is a list of sub-shapes to be added.
11628 # @ref tui_working_with_groups_page "Example"
11629 def UnionList (self,theGroup, theSubShapes):
11631 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11634 theGroup is a GEOM group to which the new sub-shapes are added.
11635 theSubShapes is a list of sub-shapes to be added.
11637 # Example: see GEOM_TestOthers.py
11638 self.GroupOp.UnionList(theGroup, theSubShapes)
11639 RaiseIfFailed("UnionList", self.GroupOp)
11642 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11643 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11644 # @param theSubShapes is a list of indices of sub-shapes to be added.
11646 # @ref swig_UnionIDs "Example"
11647 def UnionIDs(self,theGroup, theSubShapes):
11649 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11652 theGroup is a GEOM group to which the new sub-shapes are added.
11653 theSubShapes is a list of indices of sub-shapes to be added.
11655 # Example: see GEOM_TestOthers.py
11656 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11657 RaiseIfFailed("UnionIDs", self.GroupOp)
11660 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11661 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11662 # @param theSubShapes is a list of sub-shapes to be removed.
11664 # @ref tui_working_with_groups_page "Example"
11665 def DifferenceList (self,theGroup, theSubShapes):
11667 Removes from the group all the given shapes. No errors, if some shapes are not included.
11670 theGroup is a GEOM group from which the sub-shapes are removed.
11671 theSubShapes is a list of sub-shapes to be removed.
11673 # Example: see GEOM_TestOthers.py
11674 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11675 RaiseIfFailed("DifferenceList", self.GroupOp)
11678 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11679 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11680 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11682 # @ref swig_DifferenceIDs "Example"
11683 def DifferenceIDs(self,theGroup, theSubShapes):
11685 Removes from the group all the given shapes. No errors, if some shapes are not included.
11688 theGroup is a GEOM group from which the sub-shapes are removed.
11689 theSubShapes is a list of indices of sub-shapes to be removed.
11691 # Example: see GEOM_TestOthers.py
11692 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11693 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11696 ## Union of two groups.
11697 # New group is created. It will contain all entities
11698 # which are present in groups theGroup1 and theGroup2.
11699 # @param theGroup1, theGroup2 are the initial GEOM groups
11700 # to create the united group from.
11701 # @param theName Object name; when specified, this parameter is used
11702 # for result publication in the study. Otherwise, if automatic
11703 # publication is switched on, default value is used for result name.
11705 # @return a newly created GEOM group.
11707 # @ref tui_union_groups_anchor "Example"
11708 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11710 Union of two groups.
11711 New group is created. It will contain all entities
11712 which are present in groups theGroup1 and theGroup2.
11715 theGroup1, theGroup2 are the initial GEOM groups
11716 to create the united group from.
11717 theName Object name; when specified, this parameter is used
11718 for result publication in the study. Otherwise, if automatic
11719 publication is switched on, default value is used for result name.
11722 a newly created GEOM group.
11724 # Example: see GEOM_TestOthers.py
11725 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11726 RaiseIfFailed("UnionGroups", self.GroupOp)
11727 self._autoPublish(aGroup, theName, "group")
11730 ## Intersection of two groups.
11731 # New group is created. It will contain only those entities
11732 # which are present in both groups theGroup1 and theGroup2.
11733 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11734 # @param 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.
11738 # @return a newly created GEOM group.
11740 # @ref tui_intersect_groups_anchor "Example"
11741 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11743 Intersection of two groups.
11744 New group is created. It will contain only those entities
11745 which are present in both groups theGroup1 and theGroup2.
11748 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11749 theName Object name; when specified, this parameter is used
11750 for result publication in the study. Otherwise, if automatic
11751 publication is switched on, default value is used for result name.
11754 a newly created GEOM group.
11756 # Example: see GEOM_TestOthers.py
11757 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11758 RaiseIfFailed("IntersectGroups", self.GroupOp)
11759 self._autoPublish(aGroup, theName, "group")
11762 ## Cut of two groups.
11763 # New group is created. It will contain entities which are
11764 # present in group theGroup1 but are not present in group theGroup2.
11765 # @param theGroup1 is a GEOM group to include elements of.
11766 # @param theGroup2 is a GEOM group to exclude elements of.
11767 # @param theName Object name; when specified, this parameter is used
11768 # for result publication in the study. Otherwise, if automatic
11769 # publication is switched on, default value is used for result name.
11771 # @return a newly created GEOM group.
11773 # @ref tui_cut_groups_anchor "Example"
11774 def CutGroups (self, theGroup1, theGroup2, theName=None):
11777 New group is created. It will contain entities which are
11778 present in group theGroup1 but are not present in group theGroup2.
11781 theGroup1 is a GEOM group to include elements of.
11782 theGroup2 is a GEOM group to exclude elements of.
11783 theName Object name; when specified, this parameter is used
11784 for result publication in the study. Otherwise, if automatic
11785 publication is switched on, default value is used for result name.
11788 a newly created GEOM group.
11790 # Example: see GEOM_TestOthers.py
11791 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11792 RaiseIfFailed("CutGroups", self.GroupOp)
11793 self._autoPublish(aGroup, theName, "group")
11796 ## Union of list of groups.
11797 # New group is created. It will contain all entities that are
11798 # present in groups listed in theGList.
11799 # @param theGList is a list of GEOM groups to create the united group from.
11800 # @param 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.
11804 # @return a newly created GEOM group.
11806 # @ref tui_union_groups_anchor "Example"
11807 def UnionListOfGroups (self, theGList, theName=None):
11809 Union of list of groups.
11810 New group is created. It will contain all entities that are
11811 present in groups listed in theGList.
11814 theGList is a list of GEOM groups to create the united group from.
11815 theName Object name; when specified, this parameter is used
11816 for result publication in the study. Otherwise, if automatic
11817 publication is switched on, default value is used for result name.
11820 a newly created GEOM group.
11822 # Example: see GEOM_TestOthers.py
11823 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11824 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11825 self._autoPublish(aGroup, theName, "group")
11828 ## Cut of lists of groups.
11829 # New group is created. It will contain only entities
11830 # which are present in groups listed in theGList.
11831 # @param theGList is a list of GEOM groups to include elements of.
11832 # @param 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.
11836 # @return a newly created GEOM group.
11838 # @ref tui_intersect_groups_anchor "Example"
11839 def IntersectListOfGroups (self, theGList, theName=None):
11841 Cut of lists of groups.
11842 New group is created. It will contain only entities
11843 which are present in groups listed in theGList.
11846 theGList is a list of GEOM groups to include elements of.
11847 theName Object name; when specified, this parameter is used
11848 for result publication in the study. Otherwise, if automatic
11849 publication is switched on, default value is used for result name.
11852 a newly created GEOM group.
11854 # Example: see GEOM_TestOthers.py
11855 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11856 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11857 self._autoPublish(aGroup, theName, "group")
11860 ## Cut of lists of groups.
11861 # New group is created. It will contain only entities
11862 # which are present in groups listed in theGList1 but
11863 # are not present in groups from theGList2.
11864 # @param theGList1 is a list of GEOM groups to include elements of.
11865 # @param theGList2 is a list of GEOM groups to exclude elements of.
11866 # @param theName Object name; when specified, this parameter is used
11867 # for result publication in the study. Otherwise, if automatic
11868 # publication is switched on, default value is used for result name.
11870 # @return a newly created GEOM group.
11872 # @ref tui_cut_groups_anchor "Example"
11873 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11875 Cut of lists of groups.
11876 New group is created. It will contain only entities
11877 which are present in groups listed in theGList1 but
11878 are not present in groups from theGList2.
11881 theGList1 is a list of GEOM groups to include elements of.
11882 theGList2 is a list of GEOM groups to exclude elements of.
11883 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.
11888 a newly created GEOM group.
11890 # Example: see GEOM_TestOthers.py
11891 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11892 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11893 self._autoPublish(aGroup, theName, "group")
11896 ## Returns a list of sub-objects ID stored in the group
11897 # @param theGroup is a GEOM group for which a list of IDs is requested
11899 # @ref swig_GetObjectIDs "Example"
11900 def GetObjectIDs(self,theGroup):
11902 Returns a list of sub-objects ID stored in the group
11905 theGroup is a GEOM group for which a list of IDs is requested
11907 # Example: see GEOM_TestOthers.py
11908 ListIDs = self.GroupOp.GetObjects(theGroup)
11909 RaiseIfFailed("GetObjects", self.GroupOp)
11912 ## Returns a type of sub-objects stored in the group
11913 # @param theGroup is a GEOM group which type is returned.
11915 # @ref swig_GetType "Example"
11916 def GetType(self,theGroup):
11918 Returns a type of sub-objects stored in the group
11921 theGroup is a GEOM group which type is returned.
11923 # Example: see GEOM_TestOthers.py
11924 aType = self.GroupOp.GetType(theGroup)
11925 RaiseIfFailed("GetType", self.GroupOp)
11928 ## Convert a type of geom object from id to string value
11929 # @param theId is a GEOM obect type id.
11930 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11931 # @ref swig_GetType "Example"
11932 def ShapeIdToType(self, theId):
11934 Convert a type of geom object from id to string value
11937 theId is a GEOM obect type id.
11940 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11967 return "REVOLUTION"
12015 return "FREE_BOUNDS"
12023 return "THRUSECTIONS"
12025 return "COMPOUNDFILTER"
12027 return "SHAPES_ON_SHAPE"
12029 return "ELLIPSE_ARC"
12031 return "3DSKETCHER"
12037 return "PIPETSHAPE"
12038 return "Shape Id not exist."
12040 ## Returns a main shape associated with the group
12041 # @param theGroup is a GEOM group for which a main shape object is requested
12042 # @return a GEOM object which is a main shape for theGroup
12044 # @ref swig_GetMainShape "Example"
12045 def GetMainShape(self,theGroup):
12047 Returns a main shape associated with the group
12050 theGroup is a GEOM group for which a main shape object is requested
12053 a GEOM object which is a main shape for theGroup
12055 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12057 # Example: see GEOM_TestOthers.py
12058 anObj = self.GroupOp.GetMainShape(theGroup)
12059 RaiseIfFailed("GetMainShape", self.GroupOp)
12062 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12063 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12064 # @param theShape given shape (see GEOM.GEOM_Object)
12065 # @param min_length minimum length of edges of theShape
12066 # @param max_length maximum length of edges of theShape
12067 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12068 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12069 # @param theName Object name; when specified, this parameter is used
12070 # for result publication in the study. Otherwise, if automatic
12071 # publication is switched on, default value is used for result name.
12073 # @return a newly created GEOM group of edges
12075 # @@ref swig_todo "Example"
12076 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12078 Create group of edges of theShape, whose length is in range [min_length, max_length].
12079 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12082 theShape given shape
12083 min_length minimum length of edges of theShape
12084 max_length maximum length of edges of theShape
12085 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12086 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12087 theName Object name; when specified, this parameter is used
12088 for result publication in the study. Otherwise, if automatic
12089 publication is switched on, default value is used for result name.
12092 a newly created GEOM group of edges.
12094 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12095 edges_in_range = []
12097 Props = self.BasicProperties(edge)
12098 if min_length <= Props[0] and Props[0] <= max_length:
12099 if (not include_min) and (min_length == Props[0]):
12102 if (not include_max) and (Props[0] == max_length):
12105 edges_in_range.append(edge)
12107 if len(edges_in_range) <= 0:
12108 print "No edges found by given criteria"
12111 # note: auto-publishing is done in self.CreateGroup()
12112 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12113 self.UnionList(group_edges, edges_in_range)
12117 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12118 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12119 # @param min_length minimum length of edges of selected shape
12120 # @param max_length maximum length of edges of selected shape
12121 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12122 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12123 # @return a newly created GEOM group of edges
12124 # @ref swig_todo "Example"
12125 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12127 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12128 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12131 min_length minimum length of edges of selected shape
12132 max_length maximum length of edges of selected shape
12133 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12134 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12137 a newly created GEOM group of edges.
12139 nb_selected = sg.SelectedCount()
12140 if nb_selected < 1:
12141 print "Select a shape before calling this function, please."
12143 if nb_selected > 1:
12144 print "Only one shape must be selected"
12147 id_shape = sg.getSelected(0)
12148 shape = IDToObject( id_shape )
12150 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12154 if include_min: left_str = " <= "
12155 if include_max: right_str = " <= "
12157 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12158 + left_str + "length" + right_str + `max_length`)
12160 sg.updateObjBrowser(1)
12167 ## @addtogroup l4_advanced
12170 ## Create a T-shape object with specified caracteristics for the main
12171 # and the incident pipes (radius, width, half-length).
12172 # The extremities of the main pipe are located on junctions points P1 and P2.
12173 # The extremity of the incident pipe is located on junction point P3.
12174 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12175 # the main plane of the T-shape is XOY.
12177 # @param theR1 Internal radius of main pipe
12178 # @param theW1 Width of main pipe
12179 # @param theL1 Half-length of main pipe
12180 # @param theR2 Internal radius of incident pipe (R2 < R1)
12181 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12182 # @param theL2 Half-length of incident pipe
12184 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12185 # @param theP1 1st junction point of main pipe
12186 # @param theP2 2nd junction point of main pipe
12187 # @param theP3 Junction point of incident pipe
12189 # @param theRL Internal radius of left thickness reduction
12190 # @param theWL Width of left thickness reduction
12191 # @param theLtransL Length of left transition part
12192 # @param theLthinL Length of left thin part
12194 # @param theRR Internal radius of right thickness reduction
12195 # @param theWR Width of right thickness reduction
12196 # @param theLtransR Length of right transition part
12197 # @param theLthinR Length of right thin part
12199 # @param theRI Internal radius of incident thickness reduction
12200 # @param theWI Width of incident thickness reduction
12201 # @param theLtransI Length of incident transition part
12202 # @param theLthinI Length of incident thin part
12204 # @param theName Object name; when specified, this parameter is used
12205 # for result publication in the study. Otherwise, if automatic
12206 # publication is switched on, default value is used for result name.
12208 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12210 # @ref tui_creation_pipetshape "Example"
12211 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12212 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12213 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12214 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12215 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12218 Create a T-shape object with specified caracteristics for the main
12219 and the incident pipes (radius, width, half-length).
12220 The extremities of the main pipe are located on junctions points P1 and P2.
12221 The extremity of the incident pipe is located on junction point P3.
12222 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12223 the main plane of the T-shape is XOY.
12226 theR1 Internal radius of main pipe
12227 theW1 Width of main pipe
12228 theL1 Half-length of main pipe
12229 theR2 Internal radius of incident pipe (R2 < R1)
12230 theW2 Width of incident pipe (R2+W2 < R1+W1)
12231 theL2 Half-length of incident pipe
12232 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12233 theP1 1st junction point of main pipe
12234 theP2 2nd junction point of main pipe
12235 theP3 Junction point of incident pipe
12237 theRL Internal radius of left thickness reduction
12238 theWL Width of left thickness reduction
12239 theLtransL Length of left transition part
12240 theLthinL Length of left thin part
12242 theRR Internal radius of right thickness reduction
12243 theWR Width of right thickness reduction
12244 theLtransR Length of right transition part
12245 theLthinR Length of right thin part
12247 theRI Internal radius of incident thickness reduction
12248 theWI Width of incident thickness reduction
12249 theLtransI Length of incident transition part
12250 theLthinI Length of incident thin part
12252 theName Object name; when specified, this parameter is used
12253 for result publication in the study. Otherwise, if automatic
12254 publication is switched on, default value is used for result name.
12257 List of GEOM_Object, containing the created shape and propagation groups.
12260 # create PipeTShape object
12261 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12262 # create PipeTShape object with position
12263 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12264 # create PipeTShape object with left thickness reduction
12265 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12267 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)
12268 if (theP1 and theP2 and theP3):
12269 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12270 theRL, theWL, theLtransL, theLthinL,
12271 theRR, theWR, theLtransR, theLthinR,
12272 theRI, theWI, theLtransI, theLthinI,
12273 theHexMesh, theP1, theP2, theP3)
12275 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12276 theRL, theWL, theLtransL, theLthinL,
12277 theRR, theWR, theLtransR, theLthinR,
12278 theRI, theWI, theLtransI, theLthinI,
12280 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12281 if Parameters: anObj[0].SetParameters(Parameters)
12282 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12283 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12286 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12287 # and the incident pipes (radius, width, half-length). The chamfer is
12288 # created on the junction of the pipes.
12289 # The extremities of the main pipe are located on junctions points P1 and P2.
12290 # The extremity of the incident pipe is located on junction point P3.
12291 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12292 # the main plane of the T-shape is XOY.
12293 # @param theR1 Internal radius of main pipe
12294 # @param theW1 Width of main pipe
12295 # @param theL1 Half-length of main pipe
12296 # @param theR2 Internal radius of incident pipe (R2 < R1)
12297 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12298 # @param theL2 Half-length of incident pipe
12299 # @param theH Height of the chamfer.
12300 # @param theW Width of the chamfer.
12301 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12302 # @param theP1 1st junction point of main pipe
12303 # @param theP2 2nd junction point of main pipe
12304 # @param theP3 Junction point of incident pipe
12306 # @param theRL Internal radius of left thickness reduction
12307 # @param theWL Width of left thickness reduction
12308 # @param theLtransL Length of left transition part
12309 # @param theLthinL Length of left thin part
12311 # @param theRR Internal radius of right thickness reduction
12312 # @param theWR Width of right thickness reduction
12313 # @param theLtransR Length of right transition part
12314 # @param theLthinR Length of right thin part
12316 # @param theRI Internal radius of incident thickness reduction
12317 # @param theWI Width of incident thickness reduction
12318 # @param theLtransI Length of incident transition part
12319 # @param theLthinI Length of incident thin part
12321 # @param theName Object name; when specified, this parameter is used
12322 # for result publication in the study. Otherwise, if automatic
12323 # publication is switched on, default value is used for result name.
12325 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12327 # @ref tui_creation_pipetshape "Example"
12328 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12329 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12330 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12331 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12332 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12335 Create a T-shape object with chamfer and with specified caracteristics for the main
12336 and the incident pipes (radius, width, half-length). The chamfer is
12337 created on the junction of the pipes.
12338 The extremities of the main pipe are located on junctions points P1 and P2.
12339 The extremity of the incident pipe is located on junction point P3.
12340 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12341 the main plane of the T-shape is XOY.
12344 theR1 Internal radius of main pipe
12345 theW1 Width of main pipe
12346 theL1 Half-length of main pipe
12347 theR2 Internal radius of incident pipe (R2 < R1)
12348 theW2 Width of incident pipe (R2+W2 < R1+W1)
12349 theL2 Half-length of incident pipe
12350 theH Height of the chamfer.
12351 theW Width of the chamfer.
12352 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12353 theP1 1st junction point of main pipe
12354 theP2 2nd junction point of main pipe
12355 theP3 Junction point of incident pipe
12357 theRL Internal radius of left thickness reduction
12358 theWL Width of left thickness reduction
12359 theLtransL Length of left transition part
12360 theLthinL Length of left thin part
12362 theRR Internal radius of right thickness reduction
12363 theWR Width of right thickness reduction
12364 theLtransR Length of right transition part
12365 theLthinR Length of right thin part
12367 theRI Internal radius of incident thickness reduction
12368 theWI Width of incident thickness reduction
12369 theLtransI Length of incident transition part
12370 theLthinI Length of incident thin part
12372 theName Object name; when specified, this parameter is used
12373 for result publication in the study. Otherwise, if automatic
12374 publication is switched on, default value is used for result name.
12377 List of GEOM_Object, containing the created shape and propagation groups.
12380 # create PipeTShape with chamfer object
12381 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12382 # create PipeTShape with chamfer object with position
12383 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12384 # create PipeTShape with chamfer object with left thickness reduction
12385 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)
12387 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)
12388 if (theP1 and theP2 and theP3):
12389 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12390 theRL, theWL, theLtransL, theLthinL,
12391 theRR, theWR, theLtransR, theLthinR,
12392 theRI, theWI, theLtransI, theLthinI,
12393 theH, theW, theHexMesh, theP1, theP2, theP3)
12395 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12396 theRL, theWL, theLtransL, theLthinL,
12397 theRR, theWR, theLtransR, theLthinR,
12398 theRI, theWI, theLtransI, theLthinI,
12399 theH, theW, theHexMesh)
12400 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12401 if Parameters: anObj[0].SetParameters(Parameters)
12402 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12403 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12406 ## Create a T-shape object with fillet and with specified caracteristics for the main
12407 # and the incident pipes (radius, width, half-length). The fillet is
12408 # created on the junction of the pipes.
12409 # The extremities of the main pipe are located on junctions points P1 and P2.
12410 # The extremity of the incident pipe is located on junction point P3.
12411 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12412 # the main plane of the T-shape is XOY.
12413 # @param theR1 Internal radius of main pipe
12414 # @param theW1 Width of main pipe
12415 # @param theL1 Half-length of main pipe
12416 # @param theR2 Internal radius of incident pipe (R2 < R1)
12417 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12418 # @param theL2 Half-length of incident pipe
12419 # @param theRF Radius of curvature of fillet.
12420 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12421 # @param theP1 1st junction point of main pipe
12422 # @param theP2 2nd junction point of main pipe
12423 # @param theP3 Junction point of incident pipe
12425 # @param theRL Internal radius of left thickness reduction
12426 # @param theWL Width of left thickness reduction
12427 # @param theLtransL Length of left transition part
12428 # @param theLthinL Length of left thin part
12430 # @param theRR Internal radius of right thickness reduction
12431 # @param theWR Width of right thickness reduction
12432 # @param theLtransR Length of right transition part
12433 # @param theLthinR Length of right thin part
12435 # @param theRI Internal radius of incident thickness reduction
12436 # @param theWI Width of incident thickness reduction
12437 # @param theLtransI Length of incident transition part
12438 # @param theLthinI Length of incident thin part
12440 # @param theName Object name; when specified, this parameter is used
12441 # for result publication in the study. Otherwise, if automatic
12442 # publication is switched on, default value is used for result name.
12444 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12446 # @ref tui_creation_pipetshape "Example"
12447 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12448 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12449 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12450 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12451 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12454 Create a T-shape object with fillet and with specified caracteristics for the main
12455 and the incident pipes (radius, width, half-length). The fillet is
12456 created on the junction of the pipes.
12457 The extremities of the main pipe are located on junctions points P1 and P2.
12458 The extremity of the incident pipe is located on junction point P3.
12461 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12462 the main plane of the T-shape is XOY.
12463 theR1 Internal radius of main pipe
12464 theW1 Width of main pipe
12465 heL1 Half-length of main pipe
12466 theR2 Internal radius of incident pipe (R2 < R1)
12467 theW2 Width of incident pipe (R2+W2 < R1+W1)
12468 theL2 Half-length of incident pipe
12469 theRF Radius of curvature of fillet.
12470 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12471 theP1 1st junction point of main pipe
12472 theP2 2nd junction point of main pipe
12473 theP3 Junction point of incident pipe
12475 theRL Internal radius of left thickness reduction
12476 theWL Width of left thickness reduction
12477 theLtransL Length of left transition part
12478 theLthinL Length of left thin part
12480 theRR Internal radius of right thickness reduction
12481 theWR Width of right thickness reduction
12482 theLtransR Length of right transition part
12483 theLthinR Length of right thin part
12485 theRI Internal radius of incident thickness reduction
12486 theWI Width of incident thickness reduction
12487 theLtransI Length of incident transition part
12488 theLthinI Length of incident thin part
12490 theName Object name; when specified, this parameter is used
12491 for result publication in the study. Otherwise, if automatic
12492 publication is switched on, default value is used for result name.
12495 List of GEOM_Object, containing the created shape and propagation groups.
12498 # create PipeTShape with fillet object
12499 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12500 # create PipeTShape with fillet object with position
12501 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12502 # create PipeTShape with fillet object with left thickness reduction
12503 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)
12505 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)
12506 if (theP1 and theP2 and theP3):
12507 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12508 theRL, theWL, theLtransL, theLthinL,
12509 theRR, theWR, theLtransR, theLthinR,
12510 theRI, theWI, theLtransI, theLthinI,
12511 theRF, theHexMesh, theP1, theP2, theP3)
12513 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12514 theRL, theWL, theLtransL, theLthinL,
12515 theRR, theWR, theLtransR, theLthinR,
12516 theRI, theWI, theLtransI, theLthinI,
12518 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12519 if Parameters: anObj[0].SetParameters(Parameters)
12520 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12521 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12524 ## This function allows creating a disk already divided into blocks. It
12525 # can be used to create divided pipes for later meshing in hexaedra.
12526 # @param theR Radius of the disk
12527 # @param theOrientation Orientation of the plane on which the disk will be built
12528 # 1 = XOY, 2 = OYZ, 3 = OZX
12529 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12530 # @param theName Object name; when specified, this parameter is used
12531 # for result publication in the study. Otherwise, if automatic
12532 # publication is switched on, default value is used for result name.
12534 # @return New GEOM_Object, containing the created shape.
12536 # @ref tui_creation_divideddisk "Example"
12537 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12539 Creates a disk, divided into blocks. It can be used to create divided pipes
12540 for later meshing in hexaedra.
12543 theR Radius of the disk
12544 theOrientation Orientation of the plane on which the disk will be built:
12545 1 = XOY, 2 = OYZ, 3 = OZX
12546 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12547 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.
12552 New GEOM_Object, containing the created shape.
12554 theR, Parameters = ParseParameters(theR)
12555 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12556 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12557 if Parameters: anObj.SetParameters(Parameters)
12558 self._autoPublish(anObj, theName, "dividedDisk")
12561 ## This function allows creating a disk already divided into blocks. It
12562 # can be used to create divided pipes for later meshing in hexaedra.
12563 # @param theCenter Center of the disk
12564 # @param theVector Normal vector to the plane of the created disk
12565 # @param theRadius Radius of the disk
12566 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12567 # @param theName Object name; when specified, this parameter is used
12568 # for result publication in the study. Otherwise, if automatic
12569 # publication is switched on, default value is used for result name.
12571 # @return New GEOM_Object, containing the created shape.
12573 # @ref tui_creation_divideddisk "Example"
12574 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12576 Creates a disk already divided into blocks. It can be used to create divided pipes
12577 for later meshing in hexaedra.
12580 theCenter Center of the disk
12581 theVector Normal vector to the plane of the created disk
12582 theRadius Radius of the disk
12583 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12584 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.
12589 New GEOM_Object, containing the created shape.
12591 theRadius, Parameters = ParseParameters(theRadius)
12592 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12593 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12594 if Parameters: anObj.SetParameters(Parameters)
12595 self._autoPublish(anObj, theName, "dividedDisk")
12598 ## Builds a cylinder prepared for hexa meshes
12599 # @param theR Radius of the cylinder
12600 # @param theH Height of the cylinder
12601 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12602 # @param theName Object name; when specified, this parameter is used
12603 # for result publication in the study. Otherwise, if automatic
12604 # publication is switched on, default value is used for result name.
12606 # @return New GEOM_Object, containing the created shape.
12608 # @ref tui_creation_dividedcylinder "Example"
12609 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12611 Builds a cylinder prepared for hexa meshes
12614 theR Radius of the cylinder
12615 theH Height of the cylinder
12616 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12617 theName Object name; when specified, this parameter is used
12618 for result publication in the study. Otherwise, if automatic
12619 publication is switched on, default value is used for result name.
12622 New GEOM_Object, containing the created shape.
12624 theR, theH, Parameters = ParseParameters(theR, theH)
12625 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12626 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12627 if Parameters: anObj.SetParameters(Parameters)
12628 self._autoPublish(anObj, theName, "dividedCylinder")
12631 ## Create a surface from a cloud of points
12632 # @param thelPoints list of points. Compounds of points are
12633 # accepted as well.
12634 # @return New GEOM_Object, containing the created shape.
12636 # @ref tui_creation_smoothingsurface "Example"
12637 def MakeSmoothingSurface(self, thelPoints):
12638 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12639 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12642 ## Export a shape to XAO format
12643 # @param shape The shape to export
12644 # @param groups The list of groups to export
12645 # @param fields The list of fields to export
12646 # @param author The author of the export
12647 # @param fileName The name of the file to export
12650 # @ref tui_exportxao "Example"
12651 def ExportXAO(self, shape, groups, fields, author, fileName):
12652 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12653 RaiseIfFailed("ExportXAO", self.InsertOp)
12656 ## Import a shape from XAO format
12657 # @param shape Shape to export
12658 # @param fileName The name of the file to import
12659 # @return tuple (res, shape, subShapes, groups, fields)
12660 # res Flag indicating if the import was successful
12661 # shape The imported shape
12662 # subShapes The list of imported subShapes
12663 # groups The list of imported groups
12664 # fields The list of imported fields
12666 # @ref tui_importxao "Example"
12667 def ImportXAO(self, fileName):
12668 res = self.InsertOp.ImportXAO(fileName)
12669 RaiseIfFailed("ImportXAO", self.InsertOp)
12672 #@@ insert new functions before this line @@ do not remove this line @@#
12674 # end of l4_advanced
12677 ## Create a copy of the given object
12679 # @param theOriginal geometry object for copy
12680 # @param theName Object name; when specified, this parameter is used
12681 # for result publication in the study. Otherwise, if automatic
12682 # publication is switched on, default value is used for result name.
12684 # @return New GEOM_Object, containing the copied shape.
12686 # @ingroup l1_geomBuilder_auxiliary
12687 # @ref swig_MakeCopy "Example"
12688 def MakeCopy(self, theOriginal, theName=None):
12690 Create a copy of the given object
12693 theOriginal geometry object for copy
12694 theName Object name; when specified, this parameter is used
12695 for result publication in the study. Otherwise, if automatic
12696 publication is switched on, default value is used for result name.
12699 New GEOM_Object, containing the copied shape.
12701 Example of usage: Copy = geompy.MakeCopy(Box)
12703 # Example: see GEOM_TestAll.py
12704 anObj = self.InsertOp.MakeCopy(theOriginal)
12705 RaiseIfFailed("MakeCopy", self.InsertOp)
12706 self._autoPublish(anObj, theName, "copy")
12709 ## Add Path to load python scripts from
12710 # @param Path a path to load python scripts from
12711 # @ingroup l1_geomBuilder_auxiliary
12712 def addPath(self,Path):
12714 Add Path to load python scripts from
12717 Path a path to load python scripts from
12719 if (sys.path.count(Path) < 1):
12720 sys.path.append(Path)
12724 ## Load marker texture from the file
12725 # @param Path a path to the texture file
12726 # @return unique texture identifier
12727 # @ingroup l1_geomBuilder_auxiliary
12728 def LoadTexture(self, Path):
12730 Load marker texture from the file
12733 Path a path to the texture file
12736 unique texture identifier
12738 # Example: see GEOM_TestAll.py
12739 ID = self.InsertOp.LoadTexture(Path)
12740 RaiseIfFailed("LoadTexture", self.InsertOp)
12743 ## Get internal name of the object based on its study entry
12744 # @note This method does not provide an unique identifier of the geometry object.
12745 # @note This is internal function of GEOM component, though it can be used outside it for
12746 # appropriate reason (e.g. for identification of geometry object).
12747 # @param obj geometry object
12748 # @return unique object identifier
12749 # @ingroup l1_geomBuilder_auxiliary
12750 def getObjectID(self, obj):
12752 Get internal name of the object based on its study entry.
12753 Note: this method does not provide an unique identifier of the geometry object.
12754 It is an internal function of GEOM component, though it can be used outside GEOM for
12755 appropriate reason (e.g. for identification of geometry object).
12758 obj geometry object
12761 unique object identifier
12764 entry = salome.ObjectToID(obj)
12765 if entry is not None:
12766 lst = entry.split(":")
12768 ID = lst[-1] # -1 means last item in the list
12769 return "GEOM_" + ID
12774 ## Add marker texture. @a Width and @a Height parameters
12775 # specify width and height of the texture in pixels.
12776 # If @a RowData is @c True, @a Texture parameter should represent texture data
12777 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12778 # parameter should be unpacked string, in which '1' symbols represent opaque
12779 # pixels and '0' represent transparent pixels of the texture bitmap.
12781 # @param Width texture width in pixels
12782 # @param Height texture height in pixels
12783 # @param Texture texture data
12784 # @param RowData if @c True, @a Texture data are packed in the byte stream
12785 # @return unique texture identifier
12786 # @ingroup l1_geomBuilder_auxiliary
12787 def AddTexture(self, Width, Height, Texture, RowData=False):
12789 Add marker texture. Width and Height parameters
12790 specify width and height of the texture in pixels.
12791 If RowData is True, Texture parameter should represent texture data
12792 packed into the byte array. If RowData is False (default), Texture
12793 parameter should be unpacked string, in which '1' symbols represent opaque
12794 pixels and '0' represent transparent pixels of the texture bitmap.
12797 Width texture width in pixels
12798 Height texture height in pixels
12799 Texture texture data
12800 RowData if True, Texture data are packed in the byte stream
12803 return unique texture identifier
12805 if not RowData: Texture = PackData(Texture)
12806 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12807 RaiseIfFailed("AddTexture", self.InsertOp)
12810 ## Creates a new folder object. It is a container for any GEOM objects.
12811 # @param Name name of the container
12812 # @param Father parent object. If None,
12813 # folder under 'Geometry' root object will be created.
12814 # @return a new created folder
12815 # @ingroup l1_publish_data
12816 def NewFolder(self, Name, Father=None):
12818 Create a new folder object. It is an auxiliary container for any GEOM objects.
12821 Name name of the container
12822 Father parent object. If None,
12823 folder under 'Geometry' root object will be created.
12826 a new created folder
12828 if not Father: Father = self.father
12829 return self.CreateFolder(Name, Father)
12831 ## Move object to the specified folder
12832 # @param Object object to move
12833 # @param Folder target folder
12834 # @ingroup l1_publish_data
12835 def PutToFolder(self, Object, Folder):
12837 Move object to the specified folder
12840 Object object to move
12841 Folder target folder
12843 self.MoveToFolder(Object, Folder)
12846 ## Move list of objects to the specified folder
12847 # @param ListOfSO list of objects to move
12848 # @param Folder target folder
12849 # @ingroup l1_publish_data
12850 def PutListToFolder(self, ListOfSO, Folder):
12852 Move list of objects to the specified folder
12855 ListOfSO list of objects to move
12856 Folder target folder
12858 self.MoveListToFolder(ListOfSO, Folder)
12861 ## @addtogroup l2_field
12865 # @param shape the shape the field lies on
12866 # @param name the field name
12867 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12868 # @param dimension dimension of the shape the field lies on
12869 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12870 # @param componentNames names of components
12871 # @return a created field
12872 def CreateField(self, shape, name, type, dimension, componentNames):
12877 shape the shape the field lies on
12878 name the field name
12879 type type of field data
12880 dimension dimension of the shape the field lies on
12881 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12882 componentNames names of components
12887 if isinstance( type, int ):
12888 if type < 0 or type > 3:
12889 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12890 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12892 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12893 RaiseIfFailed("CreateField", self.FieldOp)
12895 geom._autoPublish( f, "", name)
12898 ## Removes a field from the GEOM component
12899 # @param field the field to remove
12900 def RemoveField(self, field):
12901 "Removes a field from the GEOM component"
12903 if isinstance( field, GEOM._objref_GEOM_Field ):
12904 geom.RemoveObject( field )
12905 elif isinstance( field, geomField ):
12906 geom.RemoveObject( field.field )
12908 raise RuntimeError, "RemoveField() : the object is not a field"
12911 ## Returns number of fields on a shape
12912 def CountFields(self, shape):
12913 "Returns number of fields on a shape"
12914 nb = self.FieldOp.CountFields( shape )
12915 RaiseIfFailed("CountFields", self.FieldOp)
12918 ## Returns all fields on a shape
12919 def GetFields(self, shape):
12920 "Returns all fields on a shape"
12921 ff = self.FieldOp.GetFields( shape )
12922 RaiseIfFailed("GetFields", self.FieldOp)
12925 ## Returns a field on a shape by its name
12926 def GetField(self, shape, name):
12927 "Returns a field on a shape by its name"
12928 f = self.FieldOp.GetField( shape, name )
12929 RaiseIfFailed("GetField", self.FieldOp)
12937 # Register the new proxy for GEOM_Gen
12938 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12941 ## Field on Geometry
12942 # @ingroup l2_field
12943 class geomField( GEOM._objref_GEOM_Field ):
12945 def __init__(self):
12946 GEOM._objref_GEOM_Field.__init__(self)
12947 self.field = GEOM._objref_GEOM_Field
12950 ## Returns the shape the field lies on
12951 def getShape(self):
12952 "Returns the shape the field lies on"
12953 return self.field.GetShape(self)
12955 ## Returns the field name
12957 "Returns the field name"
12958 return self.field.GetName(self)
12960 ## Returns type of field data as integer [0-3]
12962 "Returns type of field data"
12963 return self.field.GetDataType(self)._v
12965 ## Returns type of field data:
12966 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12967 def getTypeEnum(self):
12968 "Returns type of field data"
12969 return self.field.GetDataType(self)
12971 ## Returns dimension of the shape the field lies on:
12972 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12973 def getDimension(self):
12974 """Returns dimension of the shape the field lies on:
12975 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12976 return self.field.GetDimension(self)
12978 ## Returns names of components
12979 def getComponents(self):
12980 "Returns names of components"
12981 return self.field.GetComponents(self)
12983 ## Adds a time step to the field
12984 # @param step the time step number futher used as the step identifier
12985 # @param stamp the time step time
12986 # @param values the values of the time step
12987 def addStep(self, step, stamp, values):
12988 "Adds a time step to the field"
12989 stp = self.field.AddStep( self, step, stamp )
12991 raise RuntimeError, \
12992 "Field.addStep() : Error: step %s already exists in this field"%step
12994 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12995 self.setValues( step, values )
12998 ## Remove a time step from the field
12999 def removeStep(self,step):
13000 "Remove a time step from the field"
13003 stepObj = self.field.GetStep( self, step )
13005 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13008 #traceback.print_exc()
13010 self.field.RemoveStep( self, step )
13012 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13015 ## Returns number of time steps in the field
13016 def countSteps(self):
13017 "Returns number of time steps in the field"
13018 return self.field.CountSteps(self)
13020 ## Returns a list of time step IDs in the field
13021 def getSteps(self):
13022 "Returns a list of time step IDs in the field"
13023 return self.field.GetSteps(self)
13025 ## Returns a time step by its ID
13026 def getStep(self,step):
13027 "Returns a time step by its ID"
13028 stp = self.field.GetStep(self, step)
13030 raise RuntimeError, "Step %s is missing from this field"%step
13033 ## Returns the time of the field step
13034 def getStamp(self,step):
13035 "Returns the time of the field step"
13036 return self.getStep(step).GetStamp()
13038 ## Changes the time of the field step
13039 def setStamp(self, step, stamp):
13040 "Changes the time of the field step"
13041 return self.getStep(step).SetStamp(stamp)
13043 ## Returns values of the field step
13044 def getValues(self, step):
13045 "Returns values of the field step"
13046 return self.getStep(step).GetValues()
13048 ## Changes values of the field step
13049 def setValues(self, step, values):
13050 "Changes values of the field step"
13051 stp = self.getStep(step)
13052 errBeg = "Field.setValues(values) : Error: "
13054 ok = stp.SetValues( values )
13055 except Exception, e:
13057 if excStr.find("WrongPythonType") > 0:
13058 raise RuntimeError, errBeg +\
13059 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13060 raise RuntimeError, errBeg + str(e)
13062 nbOK = self.field.GetArraySize(self)
13065 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13067 raise RuntimeError, errBeg + "failed"
13070 pass # end of class geomField
13072 # Register the new proxy for GEOM_Field
13073 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13076 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13077 # interface to GEOM operations.
13082 # salome.salome_init()
13083 # from salome.geom import geomBuilder
13084 # geompy = geomBuilder.New(salome.myStudy)
13086 # @param study SALOME study, generally obtained by salome.myStudy.
13087 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13088 # @return geomBuilder instance
13089 def New( study, instance=None):
13091 Create a new geomBuilder instance.The geomBuilder class provides the Python
13092 interface to GEOM operations.
13096 salome.salome_init()
13097 from salome.geom import geomBuilder
13098 geompy = geomBuilder.New(salome.myStudy)
13101 study SALOME study, generally obtained by salome.myStudy.
13102 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13104 geomBuilder instance
13106 #print "New geomBuilder ", study, instance
13113 geom = geomBuilder()
13114 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13115 geom.init_geom(study)