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 notebook.myStudy = theStudy
733 if self.father is None:
734 self.father = self.myBuilder.NewComponent("GEOM")
735 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
736 FName = A1._narrow(SALOMEDS.AttributeName)
737 FName.SetValue("Geometry")
738 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
739 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
740 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
741 self.myBuilder.DefineComponentInstance(self.father,self)
743 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
744 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
745 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
746 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
747 self.HealOp = self.GetIHealingOperations (self.myStudyId)
748 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
749 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
750 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
751 self.LocalOp = self.GetILocalOperations (self.myStudyId)
752 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
753 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
754 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
755 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
757 # The below line is a right way to map all plugin functions to geomBuilder,
758 # but AdvancedOperations are already mapped, that is why this line is commented
759 # and presents here only as an axample
760 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
762 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
763 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
765 # set GEOM as root in the use case tree
766 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
767 self.myUseCaseBuilder.SetRootCurrent()
768 self.myUseCaseBuilder.Append(self.father)
771 def GetPluginOperations(self, studyID, libraryName):
772 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
774 # bind methods of operations to self
775 methods = op.__class__.__dict__['__methods__']
776 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
777 for meth_name in methods:
778 if not meth_name in avoid_methods: # avoid basic methods
779 function = getattr(op.__class__, meth_name)
780 if callable(function):
781 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
782 self.__dict__[meth_name] = PluginOperation(op, function)
785 ## Enable / disable results auto-publishing
787 # The automatic publishing is managed in the following way:
788 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
789 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
790 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
791 # value passed as parameter has the same effect.
792 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
793 # maximum number of sub-shapes allowed for publishing is set to specified value.
795 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
796 # @ingroup l1_publish_data
797 def addToStudyAuto(self, maxNbSubShapes=-1):
799 Enable / disable results auto-publishing
801 The automatic publishing is managed in the following way:
802 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
803 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
804 maximum number of sub-shapes allowed for publishing is unlimited; any negative
805 value passed as parameter has the same effect.
806 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
807 maximum number of sub-shapes allowed for publishing is set to this value.
810 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
813 geompy.addToStudyAuto() # enable auto-publishing
814 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
815 geompy.addToStudyAuto(0) # disable auto-publishing
817 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
820 ## Dump component to the Python script
821 # This method overrides IDL function to allow default values for the parameters.
822 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
824 Dump component to the Python script
825 This method overrides IDL function to allow default values for the parameters.
827 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
829 ## Get name for sub-shape aSubObj of shape aMainObj
831 # @ref swig_SubShapeName "Example"
832 def SubShapeName(self,aSubObj, aMainObj):
834 Get name for sub-shape aSubObj of shape aMainObj
836 # Example: see GEOM_TestAll.py
838 #aSubId = orb.object_to_string(aSubObj)
839 #aMainId = orb.object_to_string(aMainObj)
840 #index = gg.getIndexTopology(aSubId, aMainId)
841 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
842 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
843 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
846 ## Publish in study aShape with name aName
848 # \param aShape the shape to be published
849 # \param aName the name for the shape
850 # \param doRestoreSubShapes if True, finds and publishes also
851 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
852 # and published sub-shapes of arguments
853 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
854 # these arguments description
855 # \return study entry of the published shape in form of string
857 # @ingroup l1_publish_data
858 # @ref swig_all_addtostudy "Example"
859 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
860 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
862 Publish in study aShape with name aName
865 aShape the shape to be published
866 aName the name for the shape
867 doRestoreSubShapes if True, finds and publishes also
868 sub-shapes of aShape, corresponding to its arguments
869 and published sub-shapes of arguments
870 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
871 these arguments description
874 study entry of the published shape in form of string
877 id_block1 = geompy.addToStudy(Block1, "Block 1")
879 # Example: see GEOM_TestAll.py
881 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
882 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
883 if doRestoreSubShapes:
884 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
885 theFindMethod, theInheritFirstArg, True )
887 print "addToStudy() failed"
889 return aShape.GetStudyEntry()
891 ## Publish in study aShape with name aName as sub-object of previously published aFather
892 # \param aFather previously published object
893 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
894 # \param aName the name for the shape
896 # \return study entry of the published shape in form of string
898 # @ingroup l1_publish_data
899 # @ref swig_all_addtostudyInFather "Example"
900 def addToStudyInFather(self, aFather, aShape, aName):
902 Publish in study aShape with name aName as sub-object of previously published aFather
905 aFather previously published object
906 aShape the shape to be published as sub-object of aFather
907 aName the name for the shape
910 study entry of the published shape in form of string
912 # Example: see GEOM_TestAll.py
914 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
915 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
917 print "addToStudyInFather() failed"
919 return aShape.GetStudyEntry()
921 ## Unpublish object in study
923 # \param obj the object to be unpublished
924 def hideInStudy(self, obj):
926 Unpublish object in study
929 obj the object to be unpublished
931 ior = salome.orb.object_to_string(obj)
932 aSObject = self.myStudy.FindObjectIOR(ior)
933 if aSObject is not None:
934 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
935 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
936 drwAttribute.SetDrawable(False)
939 # end of l1_geomBuilder_auxiliary
942 ## @addtogroup l3_restore_ss
945 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
946 # To be used from python scripts out of addToStudy() (non-default usage)
947 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
948 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
949 # If this list is empty, all operation arguments will be published
950 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
951 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
952 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
953 # Do not publish sub-shapes in place of arguments, but only
954 # in place of sub-shapes of the first argument,
955 # because the whole shape corresponds to the first argument.
956 # Mainly to be used after transformations, but it also can be
957 # usefull after partition with one object shape, and some other
958 # operations, where only the first argument has to be considered.
959 # If theObject has only one argument shape, this flag is automatically
960 # considered as True, not regarding really passed value.
961 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
962 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
963 # \return list of published sub-shapes
965 # @ref tui_restore_prs_params "Example"
966 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
967 theInheritFirstArg=False, theAddPrefix=True):
969 Publish sub-shapes, standing for arguments and sub-shapes of arguments
970 To be used from python scripts out of geompy.addToStudy (non-default usage)
973 theObject published GEOM.GEOM_Object, arguments of which will be published
974 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
975 If this list is empty, all operation arguments will be published
976 theFindMethod method to search sub-shapes, corresponding to arguments and
977 their sub-shapes. Value from enumeration GEOM.find_shape_method.
978 theInheritFirstArg set properties of the first argument for theObject.
979 Do not publish sub-shapes in place of arguments, but only
980 in place of sub-shapes of the first argument,
981 because the whole shape corresponds to the first argument.
982 Mainly to be used after transformations, but it also can be
983 usefull after partition with one object shape, and some other
984 operations, where only the first argument has to be considered.
985 If theObject has only one argument shape, this flag is automatically
986 considered as True, not regarding really passed value.
987 theAddPrefix add prefix "from_" to names of restored sub-shapes,
988 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
990 list of published sub-shapes
992 # Example: see GEOM_TestAll.py
993 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
994 theFindMethod, theInheritFirstArg, theAddPrefix)
996 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
997 # To be used from python scripts out of addToStudy() (non-default usage)
998 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
999 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1000 # If this list is empty, all operation arguments will be published
1001 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1002 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1003 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1004 # Do not publish sub-shapes in place of arguments, but only
1005 # in place of sub-shapes of the first argument,
1006 # because the whole shape corresponds to the first argument.
1007 # Mainly to be used after transformations, but it also can be
1008 # usefull after partition with one object shape, and some other
1009 # operations, where only the first argument has to be considered.
1010 # If theObject has only one argument shape, this flag is automatically
1011 # considered as True, not regarding really passed value.
1012 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1013 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1014 # \return list of published sub-shapes
1016 # @ref tui_restore_prs_params "Example"
1017 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1018 theInheritFirstArg=False, theAddPrefix=True):
1020 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1021 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1024 theObject published GEOM.GEOM_Object, arguments of which will be published
1025 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1026 If this list is empty, all operation arguments will be published
1027 theFindMethod method to search sub-shapes, corresponding to arguments and
1028 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1029 theInheritFirstArg set properties of the first argument for theObject.
1030 Do not publish sub-shapes in place of arguments, but only
1031 in place of sub-shapes of the first argument,
1032 because the whole shape corresponds to the first argument.
1033 Mainly to be used after transformations, but it also can be
1034 usefull after partition with one object shape, and some other
1035 operations, where only the first argument has to be considered.
1036 If theObject has only one argument shape, this flag is automatically
1037 considered as True, not regarding really passed value.
1038 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1039 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1042 list of published sub-shapes
1044 # Example: see GEOM_TestAll.py
1045 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1046 theFindMethod, theInheritFirstArg, theAddPrefix)
1048 # end of l3_restore_ss
1051 ## @addtogroup l3_basic_go
1054 ## Create point by three coordinates.
1055 # @param theX The X coordinate of the point.
1056 # @param theY The Y coordinate of the point.
1057 # @param theZ The Z coordinate of the point.
1058 # @param theName Object name; when specified, this parameter is used
1059 # for result publication in the study. Otherwise, if automatic
1060 # publication is switched on, default value is used for result name.
1062 # @return New GEOM.GEOM_Object, containing the created point.
1064 # @ref tui_creation_point "Example"
1065 def MakeVertex(self, theX, theY, theZ, theName=None):
1067 Create point by three coordinates.
1070 theX The X coordinate of the point.
1071 theY The Y coordinate of the point.
1072 theZ The Z coordinate of the point.
1073 theName Object name; when specified, this parameter is used
1074 for result publication in the study. Otherwise, if automatic
1075 publication is switched on, default value is used for result name.
1078 New GEOM.GEOM_Object, containing the created point.
1080 # Example: see GEOM_TestAll.py
1081 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1082 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1083 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1084 anObj.SetParameters(Parameters)
1085 self._autoPublish(anObj, theName, "vertex")
1088 ## Create a point, distant from the referenced point
1089 # on the given distances along the coordinate axes.
1090 # @param theReference The referenced point.
1091 # @param theX Displacement from the referenced point along OX axis.
1092 # @param theY Displacement from the referenced point along OY axis.
1093 # @param theZ Displacement from the referenced point along OZ axis.
1094 # @param theName Object name; when specified, this parameter is used
1095 # for result publication in the study. Otherwise, if automatic
1096 # publication is switched on, default value is used for result name.
1098 # @return New GEOM.GEOM_Object, containing the created point.
1100 # @ref tui_creation_point "Example"
1101 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1103 Create a point, distant from the referenced point
1104 on the given distances along the coordinate axes.
1107 theReference The referenced point.
1108 theX Displacement from the referenced point along OX axis.
1109 theY Displacement from the referenced point along OY axis.
1110 theZ Displacement from the referenced point along OZ axis.
1111 theName Object name; when specified, this parameter is used
1112 for result publication in the study. Otherwise, if automatic
1113 publication is switched on, default value is used for result name.
1116 New GEOM.GEOM_Object, containing the created point.
1118 # Example: see GEOM_TestAll.py
1119 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1120 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1121 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1122 anObj.SetParameters(Parameters)
1123 self._autoPublish(anObj, theName, "vertex")
1126 ## Create a point, corresponding to the given parameter on the given curve.
1127 # @param theRefCurve The referenced curve.
1128 # @param theParameter Value of parameter on the referenced curve.
1129 # @param theName Object name; when specified, this parameter is used
1130 # for result publication in the study. Otherwise, if automatic
1131 # publication is switched on, default value is used for result name.
1133 # @return New GEOM.GEOM_Object, containing the created point.
1135 # @ref tui_creation_point "Example"
1136 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1138 Create a point, corresponding to the given parameter on the given curve.
1141 theRefCurve The referenced curve.
1142 theParameter Value of parameter on the referenced curve.
1143 theName Object name; when specified, this parameter is used
1144 for result publication in the study. Otherwise, if automatic
1145 publication is switched on, default value is used for result name.
1148 New GEOM.GEOM_Object, containing the created point.
1151 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1153 # Example: see GEOM_TestAll.py
1154 theParameter, Parameters = ParseParameters(theParameter)
1155 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1156 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1157 anObj.SetParameters(Parameters)
1158 self._autoPublish(anObj, theName, "vertex")
1161 ## Create a point by projection give coordinates on the given curve
1162 # @param theRefCurve The referenced curve.
1163 # @param theX X-coordinate in 3D space
1164 # @param theY Y-coordinate in 3D space
1165 # @param theZ Z-coordinate in 3D space
1166 # @param theName Object name; when specified, this parameter is used
1167 # for result publication in the study. Otherwise, if automatic
1168 # publication is switched on, default value is used for result name.
1170 # @return New GEOM.GEOM_Object, containing the created point.
1172 # @ref tui_creation_point "Example"
1173 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1175 Create a point by projection give coordinates on the given curve
1178 theRefCurve The referenced curve.
1179 theX X-coordinate in 3D space
1180 theY Y-coordinate in 3D space
1181 theZ Z-coordinate in 3D space
1182 theName Object name; when specified, this parameter is used
1183 for result publication in the study. Otherwise, if automatic
1184 publication is switched on, default value is used for result name.
1187 New GEOM.GEOM_Object, containing the created point.
1190 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1192 # Example: see GEOM_TestAll.py
1193 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1194 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1195 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1196 anObj.SetParameters(Parameters)
1197 self._autoPublish(anObj, theName, "vertex")
1200 ## Create a point, corresponding to the given length on the given curve.
1201 # @param theRefCurve The referenced curve.
1202 # @param theLength Length on the referenced curve. It can be negative.
1203 # @param theStartPoint Point allowing to choose the direction for the calculation
1204 # of the length. If None, start from the first point of theRefCurve.
1205 # @param theName Object name; when specified, this parameter is used
1206 # for result publication in the study. Otherwise, if automatic
1207 # publication is switched on, default value is used for result name.
1209 # @return New GEOM.GEOM_Object, containing the created point.
1211 # @ref tui_creation_point "Example"
1212 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1214 Create a point, corresponding to the given length on the given curve.
1217 theRefCurve The referenced curve.
1218 theLength Length on the referenced curve. It can be negative.
1219 theStartPoint Point allowing to choose the direction for the calculation
1220 of the length. If None, start from the first point of theRefCurve.
1221 theName Object name; when specified, this parameter is used
1222 for result publication in the study. Otherwise, if automatic
1223 publication is switched on, default value is used for result name.
1226 New GEOM.GEOM_Object, containing the created point.
1228 # Example: see GEOM_TestAll.py
1229 theLength, Parameters = ParseParameters(theLength)
1230 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1231 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1232 anObj.SetParameters(Parameters)
1233 self._autoPublish(anObj, theName, "vertex")
1236 ## Create a point, corresponding to the given parameters on the
1238 # @param theRefSurf The referenced surface.
1239 # @param theUParameter Value of U-parameter on the referenced surface.
1240 # @param theVParameter Value of V-parameter on the referenced surface.
1241 # @param theName Object name; when specified, this parameter is used
1242 # for result publication in the study. Otherwise, if automatic
1243 # publication is switched on, default value is used for result name.
1245 # @return New GEOM.GEOM_Object, containing the created point.
1247 # @ref swig_MakeVertexOnSurface "Example"
1248 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1250 Create a point, corresponding to the given parameters on the
1254 theRefSurf The referenced surface.
1255 theUParameter Value of U-parameter on the referenced surface.
1256 theVParameter Value of V-parameter on the referenced surface.
1257 theName Object name; when specified, this parameter is used
1258 for result publication in the study. Otherwise, if automatic
1259 publication is switched on, default value is used for result name.
1262 New GEOM.GEOM_Object, containing the created point.
1265 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1267 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1268 # Example: see GEOM_TestAll.py
1269 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1270 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1271 anObj.SetParameters(Parameters);
1272 self._autoPublish(anObj, theName, "vertex")
1275 ## Create a point by projection give coordinates on the given surface
1276 # @param theRefSurf The referenced surface.
1277 # @param theX X-coordinate in 3D space
1278 # @param theY Y-coordinate in 3D space
1279 # @param theZ Z-coordinate in 3D space
1280 # @param theName Object name; when specified, this parameter is used
1281 # for result publication in the study. Otherwise, if automatic
1282 # publication is switched on, default value is used for result name.
1284 # @return New GEOM.GEOM_Object, containing the created point.
1286 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1287 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1289 Create a point by projection give coordinates on the given surface
1292 theRefSurf The referenced surface.
1293 theX X-coordinate in 3D space
1294 theY Y-coordinate in 3D space
1295 theZ Z-coordinate in 3D space
1296 theName Object name; when specified, this parameter is used
1297 for result publication in the study. Otherwise, if automatic
1298 publication is switched on, default value is used for result name.
1301 New GEOM.GEOM_Object, containing the created point.
1304 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1306 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1307 # Example: see GEOM_TestAll.py
1308 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1309 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1310 anObj.SetParameters(Parameters);
1311 self._autoPublish(anObj, theName, "vertex")
1314 ## Create a point, which lays on the given face.
1315 # The point will lay in arbitrary place of the face.
1316 # The only condition on it is a non-zero distance to the face boundary.
1317 # Such point can be used to uniquely identify the face inside any
1318 # shape in case, when the shape does not contain overlapped faces.
1319 # @param theFace The referenced face.
1320 # @param theName Object name; when specified, this parameter is used
1321 # for result publication in the study. Otherwise, if automatic
1322 # publication is switched on, default value is used for result name.
1324 # @return New GEOM.GEOM_Object, containing the created point.
1326 # @ref swig_MakeVertexInsideFace "Example"
1327 def MakeVertexInsideFace (self, theFace, theName=None):
1329 Create a point, which lays on the given face.
1330 The point will lay in arbitrary place of the face.
1331 The only condition on it is a non-zero distance to the face boundary.
1332 Such point can be used to uniquely identify the face inside any
1333 shape in case, when the shape does not contain overlapped faces.
1336 theFace The referenced face.
1337 theName Object name; when specified, this parameter is used
1338 for result publication in the study. Otherwise, if automatic
1339 publication is switched on, default value is used for result name.
1342 New GEOM.GEOM_Object, containing the created point.
1345 p_on_face = geompy.MakeVertexInsideFace(Face)
1347 # Example: see GEOM_TestAll.py
1348 anObj = self.BasicOp.MakePointOnFace(theFace)
1349 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1350 self._autoPublish(anObj, theName, "vertex")
1353 ## Create a point on intersection of two lines.
1354 # @param theRefLine1, theRefLine2 The referenced lines.
1355 # @param theName Object name; when specified, this parameter is used
1356 # for result publication in the study. Otherwise, if automatic
1357 # publication is switched on, default value is used for result name.
1359 # @return New GEOM.GEOM_Object, containing the created point.
1361 # @ref swig_MakeVertexOnLinesIntersection "Example"
1362 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1364 Create a point on intersection of two lines.
1367 theRefLine1, theRefLine2 The referenced lines.
1368 theName Object name; when specified, this parameter is used
1369 for result publication in the study. Otherwise, if automatic
1370 publication is switched on, default value is used for result name.
1373 New GEOM.GEOM_Object, containing the created point.
1375 # Example: see GEOM_TestAll.py
1376 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1377 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1378 self._autoPublish(anObj, theName, "vertex")
1381 ## Create a tangent, corresponding to the given parameter on the given curve.
1382 # @param theRefCurve The referenced curve.
1383 # @param theParameter Value of parameter on the referenced curve.
1384 # @param theName Object name; when specified, this parameter is used
1385 # for result publication in the study. Otherwise, if automatic
1386 # publication is switched on, default value is used for result name.
1388 # @return New GEOM.GEOM_Object, containing the created tangent.
1390 # @ref swig_MakeTangentOnCurve "Example"
1391 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1393 Create a tangent, corresponding to the given parameter on the given curve.
1396 theRefCurve The referenced curve.
1397 theParameter Value of parameter on the referenced curve.
1398 theName Object name; when specified, this parameter is used
1399 for result publication in the study. Otherwise, if automatic
1400 publication is switched on, default value is used for result name.
1403 New GEOM.GEOM_Object, containing the created tangent.
1406 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1408 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1409 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1410 self._autoPublish(anObj, theName, "tangent")
1413 ## Create a tangent plane, corresponding to the given parameter on the given face.
1414 # @param theFace The face for which tangent plane should be built.
1415 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1416 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1417 # @param theTrimSize the size of plane.
1418 # @param theName Object name; when specified, this parameter is used
1419 # for result publication in the study. Otherwise, if automatic
1420 # publication is switched on, default value is used for result name.
1422 # @return New GEOM.GEOM_Object, containing the created tangent.
1424 # @ref swig_MakeTangentPlaneOnFace "Example"
1425 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1427 Create a tangent plane, corresponding to the given parameter on the given face.
1430 theFace The face for which tangent plane should be built.
1431 theParameterV vertical value of the center point (0.0 - 1.0).
1432 theParameterU horisontal value of the center point (0.0 - 1.0).
1433 theTrimSize the size of plane.
1434 theName Object name; when specified, this parameter is used
1435 for result publication in the study. Otherwise, if automatic
1436 publication is switched on, default value is used for result name.
1439 New GEOM.GEOM_Object, containing the created tangent.
1442 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1444 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1445 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1446 self._autoPublish(anObj, theName, "tangent")
1449 ## Create a vector with the given components.
1450 # @param theDX X component of the vector.
1451 # @param theDY Y component of the vector.
1452 # @param theDZ Z component of the vector.
1453 # @param theName Object name; when specified, this parameter is used
1454 # for result publication in the study. Otherwise, if automatic
1455 # publication is switched on, default value is used for result name.
1457 # @return New GEOM.GEOM_Object, containing the created vector.
1459 # @ref tui_creation_vector "Example"
1460 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1462 Create a vector with the given components.
1465 theDX X component of the vector.
1466 theDY Y component of the vector.
1467 theDZ Z component of the vector.
1468 theName Object name; when specified, this parameter is used
1469 for result publication in the study. Otherwise, if automatic
1470 publication is switched on, default value is used for result name.
1473 New GEOM.GEOM_Object, containing the created vector.
1475 # Example: see GEOM_TestAll.py
1476 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1477 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1478 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1479 anObj.SetParameters(Parameters)
1480 self._autoPublish(anObj, theName, "vector")
1483 ## Create a vector between two points.
1484 # @param thePnt1 Start point for the vector.
1485 # @param thePnt2 End point for the vector.
1486 # @param theName Object name; when specified, this parameter is used
1487 # for result publication in the study. Otherwise, if automatic
1488 # publication is switched on, default value is used for result name.
1490 # @return New GEOM.GEOM_Object, containing the created vector.
1492 # @ref tui_creation_vector "Example"
1493 def MakeVector(self, thePnt1, thePnt2, theName=None):
1495 Create a vector between two points.
1498 thePnt1 Start point for the vector.
1499 thePnt2 End point for the vector.
1500 theName Object name; when specified, this parameter is used
1501 for result publication in the study. Otherwise, if automatic
1502 publication is switched on, default value is used for result name.
1505 New GEOM.GEOM_Object, containing the created vector.
1507 # Example: see GEOM_TestAll.py
1508 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1509 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1510 self._autoPublish(anObj, theName, "vector")
1513 ## Create a line, passing through the given point
1514 # and parrallel to the given direction
1515 # @param thePnt Point. The resulting line will pass through it.
1516 # @param theDir Direction. The resulting line will be parallel to it.
1517 # @param theName Object name; when specified, this parameter is used
1518 # for result publication in the study. Otherwise, if automatic
1519 # publication is switched on, default value is used for result name.
1521 # @return New GEOM.GEOM_Object, containing the created line.
1523 # @ref tui_creation_line "Example"
1524 def MakeLine(self, thePnt, theDir, theName=None):
1526 Create a line, passing through the given point
1527 and parrallel to the given direction
1530 thePnt Point. The resulting line will pass through it.
1531 theDir Direction. The resulting line will be parallel to it.
1532 theName Object name; when specified, this parameter is used
1533 for result publication in the study. Otherwise, if automatic
1534 publication is switched on, default value is used for result name.
1537 New GEOM.GEOM_Object, containing the created line.
1539 # Example: see GEOM_TestAll.py
1540 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1541 RaiseIfFailed("MakeLine", self.BasicOp)
1542 self._autoPublish(anObj, theName, "line")
1545 ## Create a line, passing through the given points
1546 # @param thePnt1 First of two points, defining the line.
1547 # @param thePnt2 Second of two points, defining the line.
1548 # @param theName Object name; when specified, this parameter is used
1549 # for result publication in the study. Otherwise, if automatic
1550 # publication is switched on, default value is used for result name.
1552 # @return New GEOM.GEOM_Object, containing the created line.
1554 # @ref tui_creation_line "Example"
1555 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1557 Create a line, passing through the given points
1560 thePnt1 First of two points, defining the line.
1561 thePnt2 Second of two points, defining the line.
1562 theName Object name; when specified, this parameter is used
1563 for result publication in the study. Otherwise, if automatic
1564 publication is switched on, default value is used for result name.
1567 New GEOM.GEOM_Object, containing the created line.
1569 # Example: see GEOM_TestAll.py
1570 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1571 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1572 self._autoPublish(anObj, theName, "line")
1575 ## Create a line on two faces intersection.
1576 # @param theFace1 First of two faces, defining the line.
1577 # @param theFace2 Second of two faces, defining the line.
1578 # @param theName Object name; when specified, this parameter is used
1579 # for result publication in the study. Otherwise, if automatic
1580 # publication is switched on, default value is used for result name.
1582 # @return New GEOM.GEOM_Object, containing the created line.
1584 # @ref swig_MakeLineTwoFaces "Example"
1585 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1587 Create a line on two faces intersection.
1590 theFace1 First of two faces, defining the line.
1591 theFace2 Second of two faces, defining the line.
1592 theName Object name; when specified, this parameter is used
1593 for result publication in the study. Otherwise, if automatic
1594 publication is switched on, default value is used for result name.
1597 New GEOM.GEOM_Object, containing the created line.
1599 # Example: see GEOM_TestAll.py
1600 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1601 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1602 self._autoPublish(anObj, theName, "line")
1605 ## Create a plane, passing through the given point
1606 # and normal to the given vector.
1607 # @param thePnt Point, the plane has to pass through.
1608 # @param theVec Vector, defining the plane normal direction.
1609 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1610 # @param theName Object name; when specified, this parameter is used
1611 # for result publication in the study. Otherwise, if automatic
1612 # publication is switched on, default value is used for result name.
1614 # @return New GEOM.GEOM_Object, containing the created plane.
1616 # @ref tui_creation_plane "Example"
1617 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1619 Create a plane, passing through the given point
1620 and normal to the given vector.
1623 thePnt Point, the plane has to pass through.
1624 theVec Vector, defining the plane normal direction.
1625 theTrimSize Half size of a side of quadrangle face, representing the plane.
1626 theName Object name; when specified, this parameter is used
1627 for result publication in the study. Otherwise, if automatic
1628 publication is switched on, default value is used for result name.
1631 New GEOM.GEOM_Object, containing the created plane.
1633 # Example: see GEOM_TestAll.py
1634 theTrimSize, Parameters = ParseParameters(theTrimSize);
1635 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1636 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1637 anObj.SetParameters(Parameters)
1638 self._autoPublish(anObj, theName, "plane")
1641 ## Create a plane, passing through the three given points
1642 # @param thePnt1 First of three points, defining the plane.
1643 # @param thePnt2 Second of three points, defining the plane.
1644 # @param thePnt3 Fird of three points, defining the plane.
1645 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1646 # @param theName Object name; when specified, this parameter is used
1647 # for result publication in the study. Otherwise, if automatic
1648 # publication is switched on, default value is used for result name.
1650 # @return New GEOM.GEOM_Object, containing the created plane.
1652 # @ref tui_creation_plane "Example"
1653 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1655 Create a plane, passing through the three given points
1658 thePnt1 First of three points, defining the plane.
1659 thePnt2 Second of three points, defining the plane.
1660 thePnt3 Fird of three points, defining the plane.
1661 theTrimSize Half size of a side of quadrangle face, representing the plane.
1662 theName Object name; when specified, this parameter is used
1663 for result publication in the study. Otherwise, if automatic
1664 publication is switched on, default value is used for result name.
1667 New GEOM.GEOM_Object, containing the created plane.
1669 # Example: see GEOM_TestAll.py
1670 theTrimSize, Parameters = ParseParameters(theTrimSize);
1671 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1672 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1673 anObj.SetParameters(Parameters)
1674 self._autoPublish(anObj, theName, "plane")
1677 ## Create a plane, similar to the existing one, but with another size of representing face.
1678 # @param theFace Referenced plane or LCS(Marker).
1679 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1680 # @param theName Object name; when specified, this parameter is used
1681 # for result publication in the study. Otherwise, if automatic
1682 # publication is switched on, default value is used for result name.
1684 # @return New GEOM.GEOM_Object, containing the created plane.
1686 # @ref tui_creation_plane "Example"
1687 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1689 Create a plane, similar to the existing one, but with another size of representing face.
1692 theFace Referenced plane or LCS(Marker).
1693 theTrimSize New half size of a side of quadrangle face, representing the plane.
1694 theName Object name; when specified, this parameter is used
1695 for result publication in the study. Otherwise, if automatic
1696 publication is switched on, default value is used for result name.
1699 New GEOM.GEOM_Object, containing the created plane.
1701 # Example: see GEOM_TestAll.py
1702 theTrimSize, Parameters = ParseParameters(theTrimSize);
1703 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1704 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1705 anObj.SetParameters(Parameters)
1706 self._autoPublish(anObj, theName, "plane")
1709 ## Create a plane, passing through the 2 vectors
1710 # with center in a start point of the first vector.
1711 # @param theVec1 Vector, defining center point and plane direction.
1712 # @param theVec2 Vector, defining the plane normal direction.
1713 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1714 # @param theName Object name; when specified, this parameter is used
1715 # for result publication in the study. Otherwise, if automatic
1716 # publication is switched on, default value is used for result name.
1718 # @return New GEOM.GEOM_Object, containing the created plane.
1720 # @ref tui_creation_plane "Example"
1721 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1723 Create a plane, passing through the 2 vectors
1724 with center in a start point of the first vector.
1727 theVec1 Vector, defining center point and plane direction.
1728 theVec2 Vector, defining the plane normal direction.
1729 theTrimSize Half size of a side of quadrangle face, representing the plane.
1730 theName Object name; when specified, this parameter is used
1731 for result publication in the study. Otherwise, if automatic
1732 publication is switched on, default value is used for result name.
1735 New GEOM.GEOM_Object, containing the created plane.
1737 # Example: see GEOM_TestAll.py
1738 theTrimSize, Parameters = ParseParameters(theTrimSize);
1739 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1740 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1741 anObj.SetParameters(Parameters)
1742 self._autoPublish(anObj, theName, "plane")
1745 ## Create a plane, based on a Local coordinate system.
1746 # @param theLCS coordinate system, defining plane.
1747 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1748 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1749 # @param theName Object name; when specified, this parameter is used
1750 # for result publication in the study. Otherwise, if automatic
1751 # publication is switched on, default value is used for result name.
1753 # @return New GEOM.GEOM_Object, containing the created plane.
1755 # @ref tui_creation_plane "Example"
1756 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1758 Create a plane, based on a Local coordinate system.
1761 theLCS coordinate system, defining plane.
1762 theTrimSize Half size of a side of quadrangle face, representing the plane.
1763 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1764 theName Object name; when specified, this parameter is used
1765 for result publication in the study. Otherwise, if automatic
1766 publication is switched on, default value is used for result name.
1769 New GEOM.GEOM_Object, containing the created plane.
1771 # Example: see GEOM_TestAll.py
1772 theTrimSize, Parameters = ParseParameters(theTrimSize);
1773 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1774 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1775 anObj.SetParameters(Parameters)
1776 self._autoPublish(anObj, theName, "plane")
1779 ## Create a local coordinate system.
1780 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1781 # @param XDX,XDY,XDZ Three components of OX direction
1782 # @param YDX,YDY,YDZ Three components of OY direction
1783 # @param theName Object name; when specified, this parameter is used
1784 # for result publication in the study. Otherwise, if automatic
1785 # publication is switched on, default value is used for result name.
1787 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1789 # @ref swig_MakeMarker "Example"
1790 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1792 Create a local coordinate system.
1795 OX,OY,OZ Three coordinates of coordinate system origin.
1796 XDX,XDY,XDZ Three components of OX direction
1797 YDX,YDY,YDZ Three components of OY direction
1798 theName Object name; when specified, this parameter is used
1799 for result publication in the study. Otherwise, if automatic
1800 publication is switched on, default value is used for result name.
1803 New GEOM.GEOM_Object, containing the created coordinate system.
1805 # Example: see GEOM_TestAll.py
1806 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1807 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1808 RaiseIfFailed("MakeMarker", self.BasicOp)
1809 anObj.SetParameters(Parameters)
1810 self._autoPublish(anObj, theName, "lcs")
1813 ## Create a local coordinate system from shape.
1814 # @param theShape The initial shape to detect the coordinate system.
1815 # @param theName Object name; when specified, this parameter is used
1816 # for result publication in the study. Otherwise, if automatic
1817 # publication is switched on, default value is used for result name.
1819 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1821 # @ref tui_creation_lcs "Example"
1822 def MakeMarkerFromShape(self, theShape, theName=None):
1824 Create a local coordinate system from shape.
1827 theShape The initial shape to detect the coordinate system.
1828 theName Object name; when specified, this parameter is used
1829 for result publication in the study. Otherwise, if automatic
1830 publication is switched on, default value is used for result name.
1833 New GEOM.GEOM_Object, containing the created coordinate system.
1835 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1836 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1837 self._autoPublish(anObj, theName, "lcs")
1840 ## Create a local coordinate system from point and two vectors.
1841 # @param theOrigin Point of coordinate system origin.
1842 # @param theXVec Vector of X direction
1843 # @param theYVec Vector of Y direction
1844 # @param theName Object name; when specified, this parameter is used
1845 # for result publication in the study. Otherwise, if automatic
1846 # publication is switched on, default value is used for result name.
1848 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1850 # @ref tui_creation_lcs "Example"
1851 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1853 Create a local coordinate system from point and two vectors.
1856 theOrigin Point of coordinate system origin.
1857 theXVec Vector of X direction
1858 theYVec Vector of Y direction
1859 theName Object name; when specified, this parameter is used
1860 for result publication in the study. Otherwise, if automatic
1861 publication is switched on, default value is used for result name.
1864 New GEOM.GEOM_Object, containing the created coordinate system.
1867 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1868 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1869 self._autoPublish(anObj, theName, "lcs")
1872 # end of l3_basic_go
1875 ## @addtogroup l4_curves
1878 ## Create an arc of circle, passing through three given points.
1879 # @param thePnt1 Start point of the arc.
1880 # @param thePnt2 Middle point of the arc.
1881 # @param thePnt3 End point of the arc.
1882 # @param theName Object name; when specified, this parameter is used
1883 # for result publication in the study. Otherwise, if automatic
1884 # publication is switched on, default value is used for result name.
1886 # @return New GEOM.GEOM_Object, containing the created arc.
1888 # @ref swig_MakeArc "Example"
1889 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1891 Create an arc of circle, passing through three given points.
1894 thePnt1 Start point of the arc.
1895 thePnt2 Middle point of the arc.
1896 thePnt3 End point of the arc.
1897 theName Object name; when specified, this parameter is used
1898 for result publication in the study. Otherwise, if automatic
1899 publication is switched on, default value is used for result name.
1902 New GEOM.GEOM_Object, containing the created arc.
1904 # Example: see GEOM_TestAll.py
1905 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1906 RaiseIfFailed("MakeArc", self.CurvesOp)
1907 self._autoPublish(anObj, theName, "arc")
1910 ## Create an arc of circle from a center and 2 points.
1911 # @param thePnt1 Center of the arc
1912 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1913 # @param thePnt3 End point of the arc (Gives also a direction)
1914 # @param theSense Orientation of the arc
1915 # @param theName Object name; when specified, this parameter is used
1916 # for result publication in the study. Otherwise, if automatic
1917 # publication is switched on, default value is used for result name.
1919 # @return New GEOM.GEOM_Object, containing the created arc.
1921 # @ref swig_MakeArc "Example"
1922 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1924 Create an arc of circle from a center and 2 points.
1927 thePnt1 Center of the arc
1928 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1929 thePnt3 End point of the arc (Gives also a direction)
1930 theSense Orientation of the arc
1931 theName Object name; when specified, this parameter is used
1932 for result publication in the study. Otherwise, if automatic
1933 publication is switched on, default value is used for result name.
1936 New GEOM.GEOM_Object, containing the created arc.
1938 # Example: see GEOM_TestAll.py
1939 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1940 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1941 self._autoPublish(anObj, theName, "arc")
1944 ## Create an arc of ellipse, of center and two points.
1945 # @param theCenter Center of the arc.
1946 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1947 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1948 # @param theName Object name; when specified, this parameter is used
1949 # for result publication in the study. Otherwise, if automatic
1950 # publication is switched on, default value is used for result name.
1952 # @return New GEOM.GEOM_Object, containing the created arc.
1954 # @ref swig_MakeArc "Example"
1955 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1957 Create an arc of ellipse, of center and two points.
1960 theCenter Center of the arc.
1961 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1962 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1963 theName Object name; when specified, this parameter is used
1964 for result publication in the study. Otherwise, if automatic
1965 publication is switched on, default value is used for result name.
1968 New GEOM.GEOM_Object, containing the created arc.
1970 # Example: see GEOM_TestAll.py
1971 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1972 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1973 self._autoPublish(anObj, theName, "arc")
1976 ## Create a circle with given center, normal vector and radius.
1977 # @param thePnt Circle center.
1978 # @param theVec Vector, normal to the plane of the circle.
1979 # @param theR Circle radius.
1980 # @param theName Object name; when specified, this parameter is used
1981 # for result publication in the study. Otherwise, if automatic
1982 # publication is switched on, default value is used for result name.
1984 # @return New GEOM.GEOM_Object, containing the created circle.
1986 # @ref tui_creation_circle "Example"
1987 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1989 Create a circle with given center, normal vector and radius.
1992 thePnt Circle center.
1993 theVec Vector, normal to the plane of the circle.
1995 theName Object name; when specified, this parameter is used
1996 for result publication in the study. Otherwise, if automatic
1997 publication is switched on, default value is used for result name.
2000 New GEOM.GEOM_Object, containing the created circle.
2002 # Example: see GEOM_TestAll.py
2003 theR, Parameters = ParseParameters(theR)
2004 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2005 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2006 anObj.SetParameters(Parameters)
2007 self._autoPublish(anObj, theName, "circle")
2010 ## Create a circle with given radius.
2011 # Center of the circle will be in the origin of global
2012 # coordinate system and normal vector will be codirected with Z axis
2013 # @param theR Circle radius.
2014 # @param theName Object name; when specified, this parameter is used
2015 # for result publication in the study. Otherwise, if automatic
2016 # publication is switched on, default value is used for result name.
2018 # @return New GEOM.GEOM_Object, containing the created circle.
2019 def MakeCircleR(self, theR, theName=None):
2021 Create a circle with given radius.
2022 Center of the circle will be in the origin of global
2023 coordinate system and normal vector will be codirected with Z axis
2027 theName Object name; when specified, this parameter is used
2028 for result publication in the study. Otherwise, if automatic
2029 publication is switched on, default value is used for result name.
2032 New GEOM.GEOM_Object, containing the created circle.
2034 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2035 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2036 self._autoPublish(anObj, theName, "circle")
2039 ## Create a circle, passing through three given points
2040 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2041 # @param theName Object name; when specified, this parameter is used
2042 # for result publication in the study. Otherwise, if automatic
2043 # publication is switched on, default value is used for result name.
2045 # @return New GEOM.GEOM_Object, containing the created circle.
2047 # @ref tui_creation_circle "Example"
2048 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2050 Create a circle, passing through three given points
2053 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2054 theName Object name; when specified, this parameter is used
2055 for result publication in the study. Otherwise, if automatic
2056 publication is switched on, default value is used for result name.
2059 New GEOM.GEOM_Object, containing the created circle.
2061 # Example: see GEOM_TestAll.py
2062 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2063 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2064 self._autoPublish(anObj, theName, "circle")
2067 ## Create a circle, with given point1 as center,
2068 # passing through the point2 as radius and laying in the plane,
2069 # defined by all three given points.
2070 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2071 # @param theName Object name; when specified, this parameter is used
2072 # for result publication in the study. Otherwise, if automatic
2073 # publication is switched on, default value is used for result name.
2075 # @return New GEOM.GEOM_Object, containing the created circle.
2077 # @ref swig_MakeCircle "Example"
2078 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2080 Create a circle, with given point1 as center,
2081 passing through the point2 as radius and laying in the plane,
2082 defined by all three given points.
2085 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2086 theName Object name; when specified, this parameter is used
2087 for result publication in the study. Otherwise, if automatic
2088 publication is switched on, default value is used for result name.
2091 New GEOM.GEOM_Object, containing the created circle.
2093 # Example: see GEOM_example6.py
2094 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2095 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2096 self._autoPublish(anObj, theName, "circle")
2099 ## Create an ellipse with given center, normal vector and radiuses.
2100 # @param thePnt Ellipse center.
2101 # @param theVec Vector, normal to the plane of the ellipse.
2102 # @param theRMajor Major ellipse radius.
2103 # @param theRMinor Minor ellipse radius.
2104 # @param theVecMaj Vector, direction of the ellipse's main axis.
2105 # @param theName Object name; when specified, this parameter is used
2106 # for result publication in the study. Otherwise, if automatic
2107 # publication is switched on, default value is used for result name.
2109 # @return New GEOM.GEOM_Object, containing the created ellipse.
2111 # @ref tui_creation_ellipse "Example"
2112 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2114 Create an ellipse with given center, normal vector and radiuses.
2117 thePnt Ellipse center.
2118 theVec Vector, normal to the plane of the ellipse.
2119 theRMajor Major ellipse radius.
2120 theRMinor Minor ellipse radius.
2121 theVecMaj Vector, direction of the ellipse's main axis.
2122 theName Object name; when specified, this parameter is used
2123 for result publication in the study. Otherwise, if automatic
2124 publication is switched on, default value is used for result name.
2127 New GEOM.GEOM_Object, containing the created ellipse.
2129 # Example: see GEOM_TestAll.py
2130 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2131 if theVecMaj is not None:
2132 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2134 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2136 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2137 anObj.SetParameters(Parameters)
2138 self._autoPublish(anObj, theName, "ellipse")
2141 ## Create an ellipse with given radiuses.
2142 # Center of the ellipse will be in the origin of global
2143 # coordinate system and normal vector will be codirected with Z axis
2144 # @param theRMajor Major ellipse radius.
2145 # @param theRMinor Minor ellipse radius.
2146 # @param theName Object name; when specified, this parameter is used
2147 # for result publication in the study. Otherwise, if automatic
2148 # publication is switched on, default value is used for result name.
2150 # @return New GEOM.GEOM_Object, containing the created ellipse.
2151 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2153 Create an ellipse with given radiuses.
2154 Center of the ellipse will be in the origin of global
2155 coordinate system and normal vector will be codirected with Z axis
2158 theRMajor Major ellipse radius.
2159 theRMinor Minor ellipse radius.
2160 theName Object name; when specified, this parameter is used
2161 for result publication in the study. Otherwise, if automatic
2162 publication is switched on, default value is used for result name.
2165 New GEOM.GEOM_Object, containing the created ellipse.
2167 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2168 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2169 self._autoPublish(anObj, theName, "ellipse")
2172 ## Create a polyline on the set of points.
2173 # @param thePoints Sequence of points for the polyline.
2174 # @param theIsClosed If True, build a closed wire.
2175 # @param theName Object name; when specified, this parameter is used
2176 # for result publication in the study. Otherwise, if automatic
2177 # publication is switched on, default value is used for result name.
2179 # @return New GEOM.GEOM_Object, containing the created polyline.
2181 # @ref tui_creation_curve "Example"
2182 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2184 Create a polyline on the set of points.
2187 thePoints Sequence of points for the polyline.
2188 theIsClosed If True, build a closed wire.
2189 theName Object name; when specified, this parameter is used
2190 for result publication in the study. Otherwise, if automatic
2191 publication is switched on, default value is used for result name.
2194 New GEOM.GEOM_Object, containing the created polyline.
2196 # Example: see GEOM_TestAll.py
2197 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2198 RaiseIfFailed("MakePolyline", self.CurvesOp)
2199 self._autoPublish(anObj, theName, "polyline")
2202 ## Create bezier curve on the set of points.
2203 # @param thePoints Sequence of points for the bezier curve.
2204 # @param theIsClosed If True, build a closed curve.
2205 # @param theName Object name; when specified, this parameter is used
2206 # for result publication in the study. Otherwise, if automatic
2207 # publication is switched on, default value is used for result name.
2209 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2211 # @ref tui_creation_curve "Example"
2212 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2214 Create bezier curve on the set of points.
2217 thePoints Sequence of points for the bezier curve.
2218 theIsClosed If True, build a closed curve.
2219 theName Object name; when specified, this parameter is used
2220 for result publication in the study. Otherwise, if automatic
2221 publication is switched on, default value is used for result name.
2224 New GEOM.GEOM_Object, containing the created bezier curve.
2226 # Example: see GEOM_TestAll.py
2227 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2228 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2229 self._autoPublish(anObj, theName, "bezier")
2232 ## Create B-Spline curve on the set of points.
2233 # @param thePoints Sequence of points for the B-Spline curve.
2234 # @param theIsClosed If True, build a closed curve.
2235 # @param theDoReordering If TRUE, the algo does not follow the order of
2236 # \a thePoints but searches for the closest vertex.
2237 # @param theName Object name; when specified, this parameter is used
2238 # for result publication in the study. Otherwise, if automatic
2239 # publication is switched on, default value is used for result name.
2241 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2243 # @ref tui_creation_curve "Example"
2244 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2246 Create B-Spline curve on the set of points.
2249 thePoints Sequence of points for the B-Spline curve.
2250 theIsClosed If True, build a closed curve.
2251 theDoReordering If True, the algo does not follow the order of
2252 thePoints but searches for the closest vertex.
2253 theName Object name; when specified, this parameter is used
2254 for result publication in the study. Otherwise, if automatic
2255 publication is switched on, default value is used for result name.
2258 New GEOM.GEOM_Object, containing the created B-Spline curve.
2260 # Example: see GEOM_TestAll.py
2261 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2262 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2263 self._autoPublish(anObj, theName, "bspline")
2266 ## Create B-Spline curve on the set of points.
2267 # @param thePoints Sequence of points for the B-Spline curve.
2268 # @param theFirstVec Vector object, defining the curve direction at its first point.
2269 # @param theLastVec Vector object, defining the curve direction at its last point.
2270 # @param theName Object name; when specified, this parameter is used
2271 # for result publication in the study. Otherwise, if automatic
2272 # publication is switched on, default value is used for result name.
2274 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2276 # @ref tui_creation_curve "Example"
2277 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2279 Create B-Spline curve on the set of points.
2282 thePoints Sequence of points for the B-Spline curve.
2283 theFirstVec Vector object, defining the curve direction at its first point.
2284 theLastVec Vector object, defining the curve direction at its last point.
2285 theName Object name; when specified, this parameter is used
2286 for result publication in the study. Otherwise, if automatic
2287 publication is switched on, default value is used for result name.
2290 New GEOM.GEOM_Object, containing the created B-Spline curve.
2292 # Example: see GEOM_TestAll.py
2293 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2294 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2295 self._autoPublish(anObj, theName, "bspline")
2298 ## Creates a curve using the parametric definition of the basic points.
2299 # @param thexExpr parametric equation of the coordinates X.
2300 # @param theyExpr parametric equation of the coordinates Y.
2301 # @param thezExpr parametric equation of the coordinates Z.
2302 # @param theParamMin the minimal value of the parameter.
2303 # @param theParamMax the maximum value of the parameter.
2304 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2305 # @param theCurveType the type of the curve,
2306 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2307 # @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.
2308 # @param theName Object name; when specified, this parameter is used
2309 # for result publication in the study. Otherwise, if automatic
2310 # publication is switched on, default value is used for result name.
2312 # @return New GEOM.GEOM_Object, containing the created curve.
2314 # @ref tui_creation_curve "Example"
2315 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2316 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2318 Creates a curve using the parametric definition of the basic points.
2321 thexExpr parametric equation of the coordinates X.
2322 theyExpr parametric equation of the coordinates Y.
2323 thezExpr parametric equation of the coordinates Z.
2324 theParamMin the minimal value of the parameter.
2325 theParamMax the maximum value of the parameter.
2326 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2327 theCurveType the type of the curve,
2328 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2329 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2330 method is used which can lead to a bug.
2331 theName Object name; when specified, this parameter is used
2332 for result publication in the study. Otherwise, if automatic
2333 publication is switched on, default value is used for result name.
2336 New GEOM.GEOM_Object, containing the created curve.
2338 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2340 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2342 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2343 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2344 anObj.SetParameters(Parameters)
2345 self._autoPublish(anObj, theName, "curve")
2348 ## Create an isoline curve on a face.
2349 # @param theFace the face for which an isoline is created.
2350 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2352 # @param theParameter the U parameter for U-isoline or V parameter
2354 # @param theName Object name; when specified, this parameter is used
2355 # for result publication in the study. Otherwise, if automatic
2356 # publication is switched on, default value is used for result name.
2358 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2359 # a compound of edges.
2361 # @ref tui_creation_curve "Example"
2362 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2364 Create an isoline curve on a face.
2367 theFace the face for which an isoline is created.
2368 IsUIsoline True for U-isoline creation; False for V-isoline
2370 theParameter the U parameter for U-isoline or V parameter
2372 theName Object name; when specified, this parameter is used
2373 for result publication in the study. Otherwise, if automatic
2374 publication is switched on, default value is used for result name.
2377 New GEOM.GEOM_Object, containing the created isoline edge or a
2380 # Example: see GEOM_TestAll.py
2381 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2382 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2384 self._autoPublish(anObj, theName, "U-Isoline")
2386 self._autoPublish(anObj, theName, "V-Isoline")
2392 ## @addtogroup l3_sketcher
2395 ## Create a sketcher (wire or face), following the textual description,
2396 # passed through <VAR>theCommand</VAR> argument. \n
2397 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2398 # Format of the description string have to be the following:
2400 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2403 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2405 # - "R angle" : Set the direction by angle
2406 # - "D dx dy" : Set the direction by DX & DY
2409 # - "TT x y" : Create segment by point at X & Y
2410 # - "T dx dy" : Create segment by point with DX & DY
2411 # - "L length" : Create segment by direction & Length
2412 # - "IX x" : Create segment by direction & Intersect. X
2413 # - "IY y" : Create segment by direction & Intersect. Y
2416 # - "C radius length" : Create arc by direction, radius and length(in degree)
2417 # - "AA x y": Create arc by point at X & Y
2418 # - "A dx dy" : Create arc by point with DX & DY
2419 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2420 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2421 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2422 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2425 # - "WW" : Close Wire (to finish)
2426 # - "WF" : Close Wire and build face (to finish)
2429 # - Flag1 (= reverse) is 0 or 2 ...
2430 # - if 0 the drawn arc is the one of lower angle (< Pi)
2431 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2434 # - Flag2 (= control tolerance) is 0 or 1 ...
2435 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2436 # - if 1 the wire is built only if the end point is on the arc
2437 # with a tolerance of 10^-7 on the distance else the creation fails
2439 # @param theCommand String, defining the sketcher in local
2440 # coordinates of the working plane.
2441 # @param theWorkingPlane Nine double values, defining origin,
2442 # OZ and OX directions of the working plane.
2443 # @param theName Object name; when specified, this parameter is used
2444 # for result publication in the study. Otherwise, if automatic
2445 # publication is switched on, default value is used for result name.
2447 # @return New GEOM.GEOM_Object, containing the created wire.
2449 # @ref tui_sketcher_page "Example"
2450 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2452 Create a sketcher (wire or face), following the textual description, passed
2453 through theCommand argument.
2454 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2455 Format of the description string have to be the following:
2456 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2458 - x1, y1 are coordinates of the first sketcher point (zero by default),
2460 - "R angle" : Set the direction by angle
2461 - "D dx dy" : Set the direction by DX & DY
2463 - "TT x y" : Create segment by point at X & Y
2464 - "T dx dy" : Create segment by point with DX & DY
2465 - "L length" : Create segment by direction & Length
2466 - "IX x" : Create segment by direction & Intersect. X
2467 - "IY y" : Create segment by direction & Intersect. Y
2469 - "C radius length" : Create arc by direction, radius and length(in degree)
2470 - "AA x y": Create arc by point at X & Y
2471 - "A dx dy" : Create arc by point with DX & DY
2472 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2473 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2474 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2475 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2477 - "WW" : Close Wire (to finish)
2478 - "WF" : Close Wire and build face (to finish)
2480 - Flag1 (= reverse) is 0 or 2 ...
2481 - if 0 the drawn arc is the one of lower angle (< Pi)
2482 - if 2 the drawn arc ius the one of greater angle (> Pi)
2484 - Flag2 (= control tolerance) is 0 or 1 ...
2485 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2486 - if 1 the wire is built only if the end point is on the arc
2487 with a tolerance of 10^-7 on the distance else the creation fails
2490 theCommand String, defining the sketcher in local
2491 coordinates of the working plane.
2492 theWorkingPlane Nine double values, defining origin,
2493 OZ and OX directions of the working plane.
2494 theName Object name; when specified, this parameter is used
2495 for result publication in the study. Otherwise, if automatic
2496 publication is switched on, default value is used for result name.
2499 New GEOM.GEOM_Object, containing the created wire.
2501 # Example: see GEOM_TestAll.py
2502 theCommand,Parameters = ParseSketcherCommand(theCommand)
2503 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2504 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2505 anObj.SetParameters(Parameters)
2506 self._autoPublish(anObj, theName, "wire")
2509 ## Create a sketcher (wire or face), following the textual description,
2510 # passed through <VAR>theCommand</VAR> argument. \n
2511 # For format of the description string see MakeSketcher() method.\n
2512 # @param theCommand String, defining the sketcher in local
2513 # coordinates of the working plane.
2514 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2515 # @param theName Object name; when specified, this parameter is used
2516 # for result publication in the study. Otherwise, if automatic
2517 # publication is switched on, default value is used for result name.
2519 # @return New GEOM.GEOM_Object, containing the created wire.
2521 # @ref tui_sketcher_page "Example"
2522 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2524 Create a sketcher (wire or face), following the textual description,
2525 passed through theCommand argument.
2526 For format of the description string see geompy.MakeSketcher() method.
2529 theCommand String, defining the sketcher in local
2530 coordinates of the working plane.
2531 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2532 theName Object name; when specified, this parameter is used
2533 for result publication in the study. Otherwise, if automatic
2534 publication is switched on, default value is used for result name.
2537 New GEOM.GEOM_Object, containing the created wire.
2539 theCommand,Parameters = ParseSketcherCommand(theCommand)
2540 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2541 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2542 anObj.SetParameters(Parameters)
2543 self._autoPublish(anObj, theName, "wire")
2546 ## Obtain a 2D sketcher interface
2547 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2548 def Sketcher2D (self):
2550 Obtain a 2D sketcher interface.
2553 sk = geompy.Sketcher2D()
2555 sk.addSegmentRelative(15, 70)
2556 sk.addSegmentPerpY(50)
2557 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2558 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2559 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2561 Sketch_1 = sk.wire(geomObj_1)
2563 sk = Sketcher2D (self)
2566 ## Create a sketcher wire, following the numerical description,
2567 # passed through <VAR>theCoordinates</VAR> argument. \n
2568 # @param theCoordinates double values, defining points to create a wire,
2570 # @param theName Object name; when specified, this parameter is used
2571 # for result publication in the study. Otherwise, if automatic
2572 # publication is switched on, default value is used for result name.
2574 # @return New GEOM.GEOM_Object, containing the created wire.
2576 # @ref tui_3dsketcher_page "Example"
2577 def Make3DSketcher(self, theCoordinates, theName=None):
2579 Create a sketcher wire, following the numerical description,
2580 passed through theCoordinates argument.
2583 theCoordinates double values, defining points to create a wire,
2585 theName Object name; when specified, this parameter is used
2586 for result publication in the study. Otherwise, if automatic
2587 publication is switched on, default value is used for result name.
2590 New GEOM_Object, containing the created wire.
2592 theCoordinates,Parameters = ParseParameters(theCoordinates)
2593 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2594 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2595 anObj.SetParameters(Parameters)
2596 self._autoPublish(anObj, theName, "wire")
2599 ## Obtain a 3D sketcher interface
2600 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2602 # @ref tui_3dsketcher_page "Example"
2603 def Sketcher3D (self):
2605 Obtain a 3D sketcher interface.
2608 sk = geompy.Sketcher3D()
2609 sk.addPointsAbsolute(0,0,0, 70,0,0)
2610 sk.addPointsRelative(0, 0, 130)
2611 sk.addPointAnglesLength("OXY", 50, 0, 100)
2612 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2614 a3D_Sketcher_1 = sk.wire()
2616 sk = Sketcher3D (self)
2619 # end of l3_sketcher
2622 ## @addtogroup l3_3d_primitives
2625 ## Create a box by coordinates of two opposite vertices.
2627 # @param x1,y1,z1 double values, defining first point it.
2628 # @param x2,y2,z2 double values, defining first point it.
2629 # @param theName Object name; when specified, this parameter is used
2630 # for result publication in the study. Otherwise, if automatic
2631 # publication is switched on, default value is used for result name.
2633 # @return New GEOM.GEOM_Object, containing the created box.
2635 # @ref tui_creation_box "Example"
2636 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2638 Create a box by coordinates of two opposite vertices.
2641 x1,y1,z1 double values, defining first point.
2642 x2,y2,z2 double values, defining second point.
2643 theName Object name; when specified, this parameter is used
2644 for result publication in the study. Otherwise, if automatic
2645 publication is switched on, default value is used for result name.
2648 New GEOM.GEOM_Object, containing the created box.
2650 # Example: see GEOM_TestAll.py
2651 pnt1 = self.MakeVertex(x1,y1,z1)
2652 pnt2 = self.MakeVertex(x2,y2,z2)
2653 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2654 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2656 ## Create a box with specified dimensions along the coordinate axes
2657 # and with edges, parallel to the coordinate axes.
2658 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2659 # @param theDX Length of Box edges, parallel to OX axis.
2660 # @param theDY Length of Box edges, parallel to OY axis.
2661 # @param theDZ Length of Box edges, parallel to OZ axis.
2662 # @param theName Object name; when specified, this parameter is used
2663 # for result publication in the study. Otherwise, if automatic
2664 # publication is switched on, default value is used for result name.
2666 # @return New GEOM.GEOM_Object, containing the created box.
2668 # @ref tui_creation_box "Example"
2669 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2671 Create a box with specified dimensions along the coordinate axes
2672 and with edges, parallel to the coordinate axes.
2673 Center of the box will be at point (DX/2, DY/2, DZ/2).
2676 theDX Length of Box edges, parallel to OX axis.
2677 theDY Length of Box edges, parallel to OY axis.
2678 theDZ Length of Box edges, parallel to OZ axis.
2679 theName Object name; when specified, this parameter is used
2680 for result publication in the study. Otherwise, if automatic
2681 publication is switched on, default value is used for result name.
2684 New GEOM.GEOM_Object, containing the created box.
2686 # Example: see GEOM_TestAll.py
2687 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2688 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2689 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2690 anObj.SetParameters(Parameters)
2691 self._autoPublish(anObj, theName, "box")
2694 ## Create a box with two specified opposite vertices,
2695 # and with edges, parallel to the coordinate axes
2696 # @param thePnt1 First of two opposite vertices.
2697 # @param thePnt2 Second of two opposite vertices.
2698 # @param theName Object name; when specified, this parameter is used
2699 # for result publication in the study. Otherwise, if automatic
2700 # publication is switched on, default value is used for result name.
2702 # @return New GEOM.GEOM_Object, containing the created box.
2704 # @ref tui_creation_box "Example"
2705 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2707 Create a box with two specified opposite vertices,
2708 and with edges, parallel to the coordinate axes
2711 thePnt1 First of two opposite vertices.
2712 thePnt2 Second of two opposite vertices.
2713 theName Object name; when specified, this parameter is used
2714 for result publication in the study. Otherwise, if automatic
2715 publication is switched on, default value is used for result name.
2718 New GEOM.GEOM_Object, containing the created box.
2720 # Example: see GEOM_TestAll.py
2721 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2722 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2723 self._autoPublish(anObj, theName, "box")
2726 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2727 # @param theH height of Face.
2728 # @param theW width of Face.
2729 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2730 # @param theName Object name; when specified, this parameter is used
2731 # for result publication in the study. Otherwise, if automatic
2732 # publication is switched on, default value is used for result name.
2734 # @return New GEOM.GEOM_Object, containing the created face.
2736 # @ref tui_creation_face "Example"
2737 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2739 Create a face with specified dimensions with edges parallel to coordinate axes.
2742 theH height of Face.
2744 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2745 theName Object name; when specified, this parameter is used
2746 for result publication in the study. Otherwise, if automatic
2747 publication is switched on, default value is used for result name.
2750 New GEOM.GEOM_Object, containing the created face.
2752 # Example: see GEOM_TestAll.py
2753 theH,theW,Parameters = ParseParameters(theH, theW)
2754 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2755 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2756 anObj.SetParameters(Parameters)
2757 self._autoPublish(anObj, theName, "rectangle")
2760 ## Create a face from another plane and two sizes,
2761 # vertical size and horisontal size.
2762 # @param theObj Normale vector to the creating face or
2764 # @param theH Height (vertical size).
2765 # @param theW Width (horisontal size).
2766 # @param theName Object name; when specified, this parameter is used
2767 # for result publication in the study. Otherwise, if automatic
2768 # publication is switched on, default value is used for result name.
2770 # @return New GEOM.GEOM_Object, containing the created face.
2772 # @ref tui_creation_face "Example"
2773 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2775 Create a face from another plane and two sizes,
2776 vertical size and horisontal size.
2779 theObj Normale vector to the creating face or
2781 theH Height (vertical size).
2782 theW Width (horisontal size).
2783 theName Object name; when specified, this parameter is used
2784 for result publication in the study. Otherwise, if automatic
2785 publication is switched on, default value is used for result name.
2788 New GEOM_Object, containing the created face.
2790 # Example: see GEOM_TestAll.py
2791 theH,theW,Parameters = ParseParameters(theH, theW)
2792 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2793 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2794 anObj.SetParameters(Parameters)
2795 self._autoPublish(anObj, theName, "rectangle")
2798 ## Create a disk with given center, normal vector and radius.
2799 # @param thePnt Disk center.
2800 # @param theVec Vector, normal to the plane of the disk.
2801 # @param theR Disk radius.
2802 # @param theName Object name; when specified, this parameter is used
2803 # for result publication in the study. Otherwise, if automatic
2804 # publication is switched on, default value is used for result name.
2806 # @return New GEOM.GEOM_Object, containing the created disk.
2808 # @ref tui_creation_disk "Example"
2809 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2811 Create a disk with given center, normal vector and radius.
2815 theVec Vector, normal to the plane of the disk.
2817 theName Object name; when specified, this parameter is used
2818 for result publication in the study. Otherwise, if automatic
2819 publication is switched on, default value is used for result name.
2822 New GEOM.GEOM_Object, containing the created disk.
2824 # Example: see GEOM_TestAll.py
2825 theR,Parameters = ParseParameters(theR)
2826 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2827 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2828 anObj.SetParameters(Parameters)
2829 self._autoPublish(anObj, theName, "disk")
2832 ## Create a disk, passing through three given points
2833 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2834 # @param theName Object name; when specified, this parameter is used
2835 # for result publication in the study. Otherwise, if automatic
2836 # publication is switched on, default value is used for result name.
2838 # @return New GEOM.GEOM_Object, containing the created disk.
2840 # @ref tui_creation_disk "Example"
2841 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2843 Create a disk, passing through three given points
2846 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2847 theName Object name; when specified, this parameter is used
2848 for result publication in the study. Otherwise, if automatic
2849 publication is switched on, default value is used for result name.
2852 New GEOM.GEOM_Object, containing the created disk.
2854 # Example: see GEOM_TestAll.py
2855 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2856 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2857 self._autoPublish(anObj, theName, "disk")
2860 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2861 # @param theR Radius of Face.
2862 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2863 # @param theName Object name; when specified, this parameter is used
2864 # for result publication in the study. Otherwise, if automatic
2865 # publication is switched on, default value is used for result name.
2867 # @return New GEOM.GEOM_Object, containing the created disk.
2869 # @ref tui_creation_face "Example"
2870 def MakeDiskR(self, theR, theOrientation, theName=None):
2872 Create a disk with specified dimensions along OX-OY coordinate axes.
2875 theR Radius of Face.
2876 theOrientation set the orientation belong axis OXY or OYZ or OZX
2877 theName Object name; when specified, this parameter is used
2878 for result publication in the study. Otherwise, if automatic
2879 publication is switched on, default value is used for result name.
2882 New GEOM.GEOM_Object, containing the created disk.
2885 Disk3 = geompy.MakeDiskR(100., 1)
2887 # Example: see GEOM_TestAll.py
2888 theR,Parameters = ParseParameters(theR)
2889 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2890 RaiseIfFailed("MakeDiskR", self.PrimOp)
2891 anObj.SetParameters(Parameters)
2892 self._autoPublish(anObj, theName, "disk")
2895 ## Create a cylinder with given base point, axis, radius and height.
2896 # @param thePnt Central point of cylinder base.
2897 # @param theAxis Cylinder axis.
2898 # @param theR Cylinder radius.
2899 # @param theH Cylinder height.
2900 # @param theName Object name; when specified, this parameter is used
2901 # for result publication in the study. Otherwise, if automatic
2902 # publication is switched on, default value is used for result name.
2904 # @return New GEOM.GEOM_Object, containing the created cylinder.
2906 # @ref tui_creation_cylinder "Example"
2907 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2909 Create a cylinder with given base point, axis, radius and height.
2912 thePnt Central point of cylinder base.
2913 theAxis Cylinder axis.
2914 theR Cylinder radius.
2915 theH Cylinder height.
2916 theName Object name; when specified, this parameter is used
2917 for result publication in the study. Otherwise, if automatic
2918 publication is switched on, default value is used for result name.
2921 New GEOM.GEOM_Object, containing the created cylinder.
2923 # Example: see GEOM_TestAll.py
2924 theR,theH,Parameters = ParseParameters(theR, theH)
2925 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2926 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2927 anObj.SetParameters(Parameters)
2928 self._autoPublish(anObj, theName, "cylinder")
2931 ## Create a cylinder with given radius and height at
2932 # the origin of coordinate system. Axis of the cylinder
2933 # will be collinear to the OZ axis of the coordinate system.
2934 # @param theR Cylinder radius.
2935 # @param theH Cylinder height.
2936 # @param theName Object name; when specified, this parameter is used
2937 # for result publication in the study. Otherwise, if automatic
2938 # publication is switched on, default value is used for result name.
2940 # @return New GEOM.GEOM_Object, containing the created cylinder.
2942 # @ref tui_creation_cylinder "Example"
2943 def MakeCylinderRH(self, theR, theH, theName=None):
2945 Create a cylinder with given radius and height at
2946 the origin of coordinate system. Axis of the cylinder
2947 will be collinear to the OZ axis of the coordinate system.
2950 theR Cylinder radius.
2951 theH Cylinder height.
2952 theName Object name; when specified, this parameter is used
2953 for result publication in the study. Otherwise, if automatic
2954 publication is switched on, default value is used for result name.
2957 New GEOM.GEOM_Object, containing the created cylinder.
2959 # Example: see GEOM_TestAll.py
2960 theR,theH,Parameters = ParseParameters(theR, theH)
2961 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2962 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2963 anObj.SetParameters(Parameters)
2964 self._autoPublish(anObj, theName, "cylinder")
2967 ## Create a sphere with given center and radius.
2968 # @param thePnt Sphere center.
2969 # @param theR Sphere radius.
2970 # @param theName Object name; when specified, this parameter is used
2971 # for result publication in the study. Otherwise, if automatic
2972 # publication is switched on, default value is used for result name.
2974 # @return New GEOM.GEOM_Object, containing the created sphere.
2976 # @ref tui_creation_sphere "Example"
2977 def MakeSpherePntR(self, thePnt, theR, theName=None):
2979 Create a sphere with given center and radius.
2982 thePnt Sphere center.
2984 theName Object name; when specified, this parameter is used
2985 for result publication in the study. Otherwise, if automatic
2986 publication is switched on, default value is used for result name.
2989 New GEOM.GEOM_Object, containing the created sphere.
2991 # Example: see GEOM_TestAll.py
2992 theR,Parameters = ParseParameters(theR)
2993 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2994 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2995 anObj.SetParameters(Parameters)
2996 self._autoPublish(anObj, theName, "sphere")
2999 ## Create a sphere with given center and radius.
3000 # @param x,y,z Coordinates of sphere center.
3001 # @param theR Sphere radius.
3002 # @param theName Object name; when specified, this parameter is used
3003 # for result publication in the study. Otherwise, if automatic
3004 # publication is switched on, default value is used for result name.
3006 # @return New GEOM.GEOM_Object, containing the created sphere.
3008 # @ref tui_creation_sphere "Example"
3009 def MakeSphere(self, x, y, z, theR, theName=None):
3011 Create a sphere with given center and radius.
3014 x,y,z Coordinates of sphere center.
3016 theName Object name; when specified, this parameter is used
3017 for result publication in the study. Otherwise, if automatic
3018 publication is switched on, default value is used for result name.
3021 New GEOM.GEOM_Object, containing the created sphere.
3023 # Example: see GEOM_TestAll.py
3024 point = self.MakeVertex(x, y, z)
3025 # note: auto-publishing is done in self.MakeSpherePntR()
3026 anObj = self.MakeSpherePntR(point, theR, theName)
3029 ## Create a sphere with given radius at the origin of coordinate system.
3030 # @param theR Sphere radius.
3031 # @param theName Object name; when specified, this parameter is used
3032 # for result publication in the study. Otherwise, if automatic
3033 # publication is switched on, default value is used for result name.
3035 # @return New GEOM.GEOM_Object, containing the created sphere.
3037 # @ref tui_creation_sphere "Example"
3038 def MakeSphereR(self, theR, theName=None):
3040 Create a sphere with given radius at the origin of coordinate system.
3044 theName Object name; when specified, this parameter is used
3045 for result publication in the study. Otherwise, if automatic
3046 publication is switched on, default value is used for result name.
3049 New GEOM.GEOM_Object, containing the created sphere.
3051 # Example: see GEOM_TestAll.py
3052 theR,Parameters = ParseParameters(theR)
3053 anObj = self.PrimOp.MakeSphereR(theR)
3054 RaiseIfFailed("MakeSphereR", self.PrimOp)
3055 anObj.SetParameters(Parameters)
3056 self._autoPublish(anObj, theName, "sphere")
3059 ## Create a cone with given base point, axis, height and radiuses.
3060 # @param thePnt Central point of the first cone base.
3061 # @param theAxis Cone axis.
3062 # @param theR1 Radius of the first cone base.
3063 # @param theR2 Radius of the second cone base.
3064 # \note If both radiuses are non-zero, the cone will be truncated.
3065 # \note If the radiuses are equal, a cylinder will be created instead.
3066 # @param theH Cone height.
3067 # @param theName Object name; when specified, this parameter is used
3068 # for result publication in the study. Otherwise, if automatic
3069 # publication is switched on, default value is used for result name.
3071 # @return New GEOM.GEOM_Object, containing the created cone.
3073 # @ref tui_creation_cone "Example"
3074 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3076 Create a cone with given base point, axis, height and radiuses.
3079 thePnt Central point of the first cone base.
3081 theR1 Radius of the first cone base.
3082 theR2 Radius of the second cone base.
3084 theName Object name; when specified, this parameter is used
3085 for result publication in the study. Otherwise, if automatic
3086 publication is switched on, default value is used for result name.
3089 If both radiuses are non-zero, the cone will be truncated.
3090 If the radiuses are equal, a cylinder will be created instead.
3093 New GEOM.GEOM_Object, containing the created cone.
3095 # Example: see GEOM_TestAll.py
3096 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3097 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3098 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3099 anObj.SetParameters(Parameters)
3100 self._autoPublish(anObj, theName, "cone")
3103 ## Create a cone with given height and radiuses at
3104 # the origin of coordinate system. Axis of the cone will
3105 # be collinear to the OZ axis of the coordinate system.
3106 # @param theR1 Radius of the first cone base.
3107 # @param theR2 Radius of the second cone base.
3108 # \note If both radiuses are non-zero, the cone will be truncated.
3109 # \note If the radiuses are equal, a cylinder will be created instead.
3110 # @param theH Cone height.
3111 # @param theName Object name; when specified, this parameter is used
3112 # for result publication in the study. Otherwise, if automatic
3113 # publication is switched on, default value is used for result name.
3115 # @return New GEOM.GEOM_Object, containing the created cone.
3117 # @ref tui_creation_cone "Example"
3118 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3120 Create a cone with given height and radiuses at
3121 the origin of coordinate system. Axis of the cone will
3122 be collinear to the OZ axis of the coordinate system.
3125 theR1 Radius of the first cone base.
3126 theR2 Radius of the second cone base.
3128 theName Object name; when specified, this parameter is used
3129 for result publication in the study. Otherwise, if automatic
3130 publication is switched on, default value is used for result name.
3133 If both radiuses are non-zero, the cone will be truncated.
3134 If the radiuses are equal, a cylinder will be created instead.
3137 New GEOM.GEOM_Object, containing the created cone.
3139 # Example: see GEOM_TestAll.py
3140 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3141 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3142 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3143 anObj.SetParameters(Parameters)
3144 self._autoPublish(anObj, theName, "cone")
3147 ## Create a torus with given center, normal vector and radiuses.
3148 # @param thePnt Torus central point.
3149 # @param theVec Torus axis of symmetry.
3150 # @param theRMajor Torus major radius.
3151 # @param theRMinor Torus minor radius.
3152 # @param theName Object name; when specified, this parameter is used
3153 # for result publication in the study. Otherwise, if automatic
3154 # publication is switched on, default value is used for result name.
3156 # @return New GEOM.GEOM_Object, containing the created torus.
3158 # @ref tui_creation_torus "Example"
3159 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3161 Create a torus with given center, normal vector and radiuses.
3164 thePnt Torus central point.
3165 theVec Torus axis of symmetry.
3166 theRMajor Torus major radius.
3167 theRMinor Torus minor radius.
3168 theName Object name; when specified, this parameter is used
3169 for result publication in the study. Otherwise, if automatic
3170 publication is switched on, default value is used for result name.
3173 New GEOM.GEOM_Object, containing the created torus.
3175 # Example: see GEOM_TestAll.py
3176 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3177 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3178 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3179 anObj.SetParameters(Parameters)
3180 self._autoPublish(anObj, theName, "torus")
3183 ## Create a torus with given radiuses at the origin of coordinate system.
3184 # @param theRMajor Torus major radius.
3185 # @param theRMinor Torus minor radius.
3186 # @param theName Object name; when specified, this parameter is used
3187 # for result publication in the study. Otherwise, if automatic
3188 # publication is switched on, default value is used for result name.
3190 # @return New GEOM.GEOM_Object, containing the created torus.
3192 # @ref tui_creation_torus "Example"
3193 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3195 Create a torus with given radiuses at the origin of coordinate system.
3198 theRMajor Torus major radius.
3199 theRMinor Torus minor radius.
3200 theName Object name; when specified, this parameter is used
3201 for result publication in the study. Otherwise, if automatic
3202 publication is switched on, default value is used for result name.
3205 New GEOM.GEOM_Object, containing the created torus.
3207 # Example: see GEOM_TestAll.py
3208 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3209 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3210 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3211 anObj.SetParameters(Parameters)
3212 self._autoPublish(anObj, theName, "torus")
3215 # end of l3_3d_primitives
3218 ## @addtogroup l3_complex
3221 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3222 # @param theBase Base shape to be extruded.
3223 # @param thePoint1 First end of extrusion vector.
3224 # @param thePoint2 Second end of extrusion vector.
3225 # @param theScaleFactor Use it to make prism with scaled second base.
3226 # Nagative value means not scaled second base.
3227 # @param theName Object name; when specified, this parameter is used
3228 # for result publication in the study. Otherwise, if automatic
3229 # publication is switched on, default value is used for result name.
3231 # @return New GEOM.GEOM_Object, containing the created prism.
3233 # @ref tui_creation_prism "Example"
3234 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3236 Create a shape by extrusion of the base shape along a vector, defined by two points.
3239 theBase Base shape to be extruded.
3240 thePoint1 First end of extrusion vector.
3241 thePoint2 Second end of extrusion vector.
3242 theScaleFactor Use it to make prism with scaled second base.
3243 Nagative value means not scaled second base.
3244 theName Object name; when specified, this parameter is used
3245 for result publication in the study. Otherwise, if automatic
3246 publication is switched on, default value is used for result name.
3249 New GEOM.GEOM_Object, containing the created prism.
3251 # Example: see GEOM_TestAll.py
3254 if theScaleFactor > 0:
3255 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3256 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3258 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3259 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3260 anObj.SetParameters(Parameters)
3261 self._autoPublish(anObj, theName, "prism")
3264 ## Create a shape by extrusion of the base shape along a
3265 # vector, defined by two points, in 2 Ways (forward/backward).
3266 # @param theBase Base shape to be extruded.
3267 # @param thePoint1 First end of extrusion vector.
3268 # @param thePoint2 Second end of extrusion vector.
3269 # @param theName Object name; when specified, this parameter is used
3270 # for result publication in the study. Otherwise, if automatic
3271 # publication is switched on, default value is used for result name.
3273 # @return New GEOM.GEOM_Object, containing the created prism.
3275 # @ref tui_creation_prism "Example"
3276 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3278 Create a shape by extrusion of the base shape along a
3279 vector, defined by two points, in 2 Ways (forward/backward).
3282 theBase Base shape to be extruded.
3283 thePoint1 First end of extrusion vector.
3284 thePoint2 Second end of extrusion vector.
3285 theName Object name; when specified, this parameter is used
3286 for result publication in the study. Otherwise, if automatic
3287 publication is switched on, default value is used for result name.
3290 New GEOM.GEOM_Object, containing the created prism.
3292 # Example: see GEOM_TestAll.py
3293 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3294 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3295 self._autoPublish(anObj, theName, "prism")
3298 ## Create a shape by extrusion of the base shape along the vector,
3299 # i.e. all the space, transfixed by the base shape during its translation
3300 # along the vector on the given distance.
3301 # @param theBase Base shape to be extruded.
3302 # @param theVec Direction of extrusion.
3303 # @param theH Prism dimension along theVec.
3304 # @param theScaleFactor Use it to make prism with scaled second base.
3305 # Negative value means not scaled second base.
3306 # @param theName Object name; when specified, this parameter is used
3307 # for result publication in the study. Otherwise, if automatic
3308 # publication is switched on, default value is used for result name.
3310 # @return New GEOM.GEOM_Object, containing the created prism.
3312 # @ref tui_creation_prism "Example"
3313 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3315 Create a shape by extrusion of the base shape along the vector,
3316 i.e. all the space, transfixed by the base shape during its translation
3317 along the vector on the given distance.
3320 theBase Base shape to be extruded.
3321 theVec Direction of extrusion.
3322 theH Prism dimension along theVec.
3323 theScaleFactor Use it to make prism with scaled second base.
3324 Negative value means not scaled second base.
3325 theName Object name; when specified, this parameter is used
3326 for result publication in the study. Otherwise, if automatic
3327 publication is switched on, default value is used for result name.
3330 New GEOM.GEOM_Object, containing the created prism.
3332 # Example: see GEOM_TestAll.py
3335 if theScaleFactor > 0:
3336 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3337 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3339 theH,Parameters = ParseParameters(theH)
3340 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3341 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3342 anObj.SetParameters(Parameters)
3343 self._autoPublish(anObj, theName, "prism")
3346 ## Create a shape by extrusion of the base shape along the vector,
3347 # i.e. all the space, transfixed by the base shape during its translation
3348 # along the vector on the given distance in 2 Ways (forward/backward).
3349 # @param theBase Base shape to be extruded.
3350 # @param theVec Direction of extrusion.
3351 # @param theH Prism dimension along theVec in forward direction.
3352 # @param theName Object name; when specified, this parameter is used
3353 # for result publication in the study. Otherwise, if automatic
3354 # publication is switched on, default value is used for result name.
3356 # @return New GEOM.GEOM_Object, containing the created prism.
3358 # @ref tui_creation_prism "Example"
3359 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3361 Create a shape by extrusion of the base shape along the vector,
3362 i.e. all the space, transfixed by the base shape during its translation
3363 along the vector on the given distance in 2 Ways (forward/backward).
3366 theBase Base shape to be extruded.
3367 theVec Direction of extrusion.
3368 theH Prism dimension along theVec in forward direction.
3369 theName Object name; when specified, this parameter is used
3370 for result publication in the study. Otherwise, if automatic
3371 publication is switched on, default value is used for result name.
3374 New GEOM.GEOM_Object, containing the created prism.
3376 # Example: see GEOM_TestAll.py
3377 theH,Parameters = ParseParameters(theH)
3378 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3379 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3380 anObj.SetParameters(Parameters)
3381 self._autoPublish(anObj, theName, "prism")
3384 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3385 # @param theBase Base shape to be extruded.
3386 # @param theDX, theDY, theDZ Directions of extrusion.
3387 # @param theScaleFactor Use it to make prism with scaled second base.
3388 # Nagative value means not scaled second base.
3389 # @param theName Object name; when specified, this parameter is used
3390 # for result publication in the study. Otherwise, if automatic
3391 # publication is switched on, default value is used for result name.
3393 # @return New GEOM.GEOM_Object, containing the created prism.
3395 # @ref tui_creation_prism "Example"
3396 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3398 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3401 theBase Base shape to be extruded.
3402 theDX, theDY, theDZ Directions of extrusion.
3403 theScaleFactor Use it to make prism with scaled second base.
3404 Nagative value means not scaled second base.
3405 theName Object name; when specified, this parameter is used
3406 for result publication in the study. Otherwise, if automatic
3407 publication is switched on, default value is used for result name.
3410 New GEOM.GEOM_Object, containing the created prism.
3412 # Example: see GEOM_TestAll.py
3415 if theScaleFactor > 0:
3416 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3417 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3419 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3420 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3421 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3422 anObj.SetParameters(Parameters)
3423 self._autoPublish(anObj, theName, "prism")
3426 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3427 # i.e. all the space, transfixed by the base shape during its translation
3428 # along the vector on the given distance in 2 Ways (forward/backward).
3429 # @param theBase Base shape to be extruded.
3430 # @param theDX, theDY, theDZ Directions of extrusion.
3431 # @param theName Object name; when specified, this parameter is used
3432 # for result publication in the study. Otherwise, if automatic
3433 # publication is switched on, default value is used for result name.
3435 # @return New GEOM.GEOM_Object, containing the created prism.
3437 # @ref tui_creation_prism "Example"
3438 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3440 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3441 i.e. all the space, transfixed by the base shape during its translation
3442 along the vector on the given distance in 2 Ways (forward/backward).
3445 theBase Base shape to be extruded.
3446 theDX, theDY, theDZ Directions of extrusion.
3447 theName Object name; when specified, this parameter is used
3448 for result publication in the study. Otherwise, if automatic
3449 publication is switched on, default value is used for result name.
3452 New GEOM.GEOM_Object, containing the created prism.
3454 # Example: see GEOM_TestAll.py
3455 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3456 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3457 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3458 anObj.SetParameters(Parameters)
3459 self._autoPublish(anObj, theName, "prism")
3462 ## Create a shape by revolution of the base shape around the axis
3463 # on the given angle, i.e. all the space, transfixed by the base
3464 # shape during its rotation around the axis on the given angle.
3465 # @param theBase Base shape to be rotated.
3466 # @param theAxis Rotation axis.
3467 # @param theAngle Rotation angle in radians.
3468 # @param theName Object name; when specified, this parameter is used
3469 # for result publication in the study. Otherwise, if automatic
3470 # publication is switched on, default value is used for result name.
3472 # @return New GEOM.GEOM_Object, containing the created revolution.
3474 # @ref tui_creation_revolution "Example"
3475 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3477 Create a shape by revolution of the base shape around the axis
3478 on the given angle, i.e. all the space, transfixed by the base
3479 shape during its rotation around the axis on the given angle.
3482 theBase Base shape to be rotated.
3483 theAxis Rotation axis.
3484 theAngle Rotation angle in radians.
3485 theName Object name; when specified, this parameter is used
3486 for result publication in the study. Otherwise, if automatic
3487 publication is switched on, default value is used for result name.
3490 New GEOM.GEOM_Object, containing the created revolution.
3492 # Example: see GEOM_TestAll.py
3493 theAngle,Parameters = ParseParameters(theAngle)
3494 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3495 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3496 anObj.SetParameters(Parameters)
3497 self._autoPublish(anObj, theName, "revolution")
3500 ## Create a shape by revolution of the base shape around the axis
3501 # on the given angle, i.e. all the space, transfixed by the base
3502 # shape during its rotation around the axis on the given angle in
3503 # both directions (forward/backward)
3504 # @param theBase Base shape to be rotated.
3505 # @param theAxis Rotation axis.
3506 # @param theAngle Rotation angle in radians.
3507 # @param theName Object name; when specified, this parameter is used
3508 # for result publication in the study. Otherwise, if automatic
3509 # publication is switched on, default value is used for result name.
3511 # @return New GEOM.GEOM_Object, containing the created revolution.
3513 # @ref tui_creation_revolution "Example"
3514 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3516 Create a shape by revolution of the base shape around the axis
3517 on the given angle, i.e. all the space, transfixed by the base
3518 shape during its rotation around the axis on the given angle in
3519 both directions (forward/backward).
3522 theBase Base shape to be rotated.
3523 theAxis Rotation axis.
3524 theAngle Rotation angle in radians.
3525 theName Object name; when specified, this parameter is used
3526 for result publication in the study. Otherwise, if automatic
3527 publication is switched on, default value is used for result name.
3530 New GEOM.GEOM_Object, containing the created revolution.
3532 theAngle,Parameters = ParseParameters(theAngle)
3533 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3534 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3535 anObj.SetParameters(Parameters)
3536 self._autoPublish(anObj, theName, "revolution")
3539 ## Create a filling from the given compound of contours.
3540 # @param theShape the compound of contours
3541 # @param theMinDeg a minimal degree of BSpline surface to create
3542 # @param theMaxDeg a maximal degree of BSpline surface to create
3543 # @param theTol2D a 2d tolerance to be reached
3544 # @param theTol3D a 3d tolerance to be reached
3545 # @param theNbIter a number of iteration of approximation algorithm
3546 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3547 # @param isApprox if True, BSpline curves are generated in the process
3548 # of surface construction. By default it is False, that means
3549 # the surface is created using given curves. The usage of
3550 # Approximation makes the algorithm work slower, but allows
3551 # building the surface for rather complex cases.
3552 # @param theName Object name; when specified, this parameter is used
3553 # for result publication in the study. Otherwise, if automatic
3554 # publication is switched on, default value is used for result name.
3556 # @return New GEOM.GEOM_Object, containing the created filling surface.
3558 # @ref tui_creation_filling "Example"
3559 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3560 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3562 Create a filling from the given compound of contours.
3565 theShape the compound of contours
3566 theMinDeg a minimal degree of BSpline surface to create
3567 theMaxDeg a maximal degree of BSpline surface to create
3568 theTol2D a 2d tolerance to be reached
3569 theTol3D a 3d tolerance to be reached
3570 theNbIter a number of iteration of approximation algorithm
3571 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3572 isApprox if True, BSpline curves are generated in the process
3573 of surface construction. By default it is False, that means
3574 the surface is created using given curves. The usage of
3575 Approximation makes the algorithm work slower, but allows
3576 building the surface for rather complex cases
3577 theName Object name; when specified, this parameter is used
3578 for result publication in the study. Otherwise, if automatic
3579 publication is switched on, default value is used for result name.
3582 New GEOM.GEOM_Object, containing the created filling surface.
3585 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3587 # Example: see GEOM_TestAll.py
3588 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3589 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3590 theTol2D, theTol3D, theNbIter,
3591 theMethod, isApprox)
3592 RaiseIfFailed("MakeFilling", self.PrimOp)
3593 anObj.SetParameters(Parameters)
3594 self._autoPublish(anObj, theName, "filling")
3598 ## Create a filling from the given compound of contours.
3599 # This method corresponds to MakeFilling with isApprox=True
3600 # @param theShape the compound of contours
3601 # @param theMinDeg a minimal degree of BSpline surface to create
3602 # @param theMaxDeg a maximal degree of BSpline surface to create
3603 # @param theTol3D a 3d tolerance to be reached
3604 # @param theName Object name; when specified, this parameter is used
3605 # for result publication in the study. Otherwise, if automatic
3606 # publication is switched on, default value is used for result name.
3608 # @return New GEOM.GEOM_Object, containing the created filling surface.
3610 # @ref tui_creation_filling "Example"
3611 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3613 Create a filling from the given compound of contours.
3614 This method corresponds to MakeFilling with isApprox=True
3617 theShape the compound of contours
3618 theMinDeg a minimal degree of BSpline surface to create
3619 theMaxDeg a maximal degree of BSpline surface to create
3620 theTol3D a 3d tolerance to be reached
3621 theName Object name; when specified, this parameter is used
3622 for result publication in the study. Otherwise, if automatic
3623 publication is switched on, default value is used for result name.
3626 New GEOM.GEOM_Object, containing the created filling surface.
3629 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3631 # Example: see GEOM_TestAll.py
3632 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3633 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3634 0, theTol3D, 0, GEOM.FOM_Default, True)
3635 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3636 anObj.SetParameters(Parameters)
3637 self._autoPublish(anObj, theName, "filling")
3640 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3641 # @param theSeqSections - set of specified sections.
3642 # @param theModeSolid - mode defining building solid or shell
3643 # @param thePreci - precision 3D used for smoothing
3644 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3645 # @param theName Object name; when specified, this parameter is used
3646 # for result publication in the study. Otherwise, if automatic
3647 # publication is switched on, default value is used for result name.
3649 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3651 # @ref swig_todo "Example"
3652 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3654 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3657 theSeqSections - set of specified sections.
3658 theModeSolid - mode defining building solid or shell
3659 thePreci - precision 3D used for smoothing
3660 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3661 theName Object name; when specified, this parameter is used
3662 for result publication in the study. Otherwise, if automatic
3663 publication is switched on, default value is used for result name.
3666 New GEOM.GEOM_Object, containing the created shell or solid.
3668 # Example: see GEOM_TestAll.py
3669 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3670 RaiseIfFailed("MakeThruSections", self.PrimOp)
3671 self._autoPublish(anObj, theName, "filling")
3674 ## Create a shape by extrusion of the base shape along
3675 # the path shape. The path shape can be a wire or an edge.
3676 # @param theBase Base shape to be extruded.
3677 # @param thePath Path shape to extrude the base shape along it.
3678 # @param theName Object name; when specified, this parameter is used
3679 # for result publication in the study. Otherwise, if automatic
3680 # publication is switched on, default value is used for result name.
3682 # @return New GEOM.GEOM_Object, containing the created pipe.
3684 # @ref tui_creation_pipe "Example"
3685 def MakePipe(self, theBase, thePath, theName=None):
3687 Create a shape by extrusion of the base shape along
3688 the path shape. The path shape can be a wire or an edge.
3691 theBase Base shape to be extruded.
3692 thePath Path shape to extrude the base shape along it.
3693 theName Object name; when specified, this parameter is used
3694 for result publication in the study. Otherwise, if automatic
3695 publication is switched on, default value is used for result name.
3698 New GEOM.GEOM_Object, containing the created pipe.
3700 # Example: see GEOM_TestAll.py
3701 anObj = self.PrimOp.MakePipe(theBase, thePath)
3702 RaiseIfFailed("MakePipe", self.PrimOp)
3703 self._autoPublish(anObj, theName, "pipe")
3706 ## Create a shape by extrusion of the profile shape along
3707 # the path shape. The path shape can be a wire or an edge.
3708 # the several profiles can be specified in the several locations of path.
3709 # @param theSeqBases - list of Bases shape to be extruded.
3710 # @param theLocations - list of locations on the path corresponding
3711 # specified list of the Bases shapes. Number of locations
3712 # should be equal to number of bases or list of locations can be empty.
3713 # @param thePath - Path shape to extrude the base shape along it.
3714 # @param theWithContact - the mode defining that the section is translated to be in
3715 # contact with the spine.
3716 # @param theWithCorrection - defining that the section is rotated to be
3717 # orthogonal to the spine tangent in the correspondent point
3718 # @param theName Object name; when specified, this parameter is used
3719 # for result publication in the study. Otherwise, if automatic
3720 # publication is switched on, default value is used for result name.
3722 # @return New GEOM.GEOM_Object, containing the created pipe.
3724 # @ref tui_creation_pipe_with_diff_sec "Example"
3725 def MakePipeWithDifferentSections(self, theSeqBases,
3726 theLocations, thePath,
3727 theWithContact, theWithCorrection, theName=None):
3729 Create a shape by extrusion of the profile shape along
3730 the path shape. The path shape can be a wire or an edge.
3731 the several profiles can be specified in the several locations of path.
3734 theSeqBases - list of Bases shape to be extruded.
3735 theLocations - list of locations on the path corresponding
3736 specified list of the Bases shapes. Number of locations
3737 should be equal to number of bases or list of locations can be empty.
3738 thePath - Path shape to extrude the base shape along it.
3739 theWithContact - the mode defining that the section is translated to be in
3740 contact with the spine(0/1)
3741 theWithCorrection - defining that the section is rotated to be
3742 orthogonal to the spine tangent in the correspondent point (0/1)
3743 theName Object name; when specified, this parameter is used
3744 for result publication in the study. Otherwise, if automatic
3745 publication is switched on, default value is used for result name.
3748 New GEOM.GEOM_Object, containing the created pipe.
3750 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3751 theLocations, thePath,
3752 theWithContact, theWithCorrection)
3753 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3754 self._autoPublish(anObj, theName, "pipe")
3757 ## Create a shape by extrusion of the profile shape along
3758 # the path shape. The path shape can be a wire or a edge.
3759 # the several profiles can be specified in the several locations of path.
3760 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3761 # shell or face. If number of faces in neighbour sections
3762 # aren't coincided result solid between such sections will
3763 # be created using external boundaries of this shells.
3764 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3765 # This list is used for searching correspondences between
3766 # faces in the sections. Size of this list must be equal
3767 # to size of list of base shapes.
3768 # @param theLocations - list of locations on the path corresponding
3769 # specified list of the Bases shapes. Number of locations
3770 # should be equal to number of bases. First and last
3771 # locations must be coincided with first and last vertexes
3772 # of path correspondingly.
3773 # @param thePath - Path shape to extrude the base shape along it.
3774 # @param theWithContact - the mode defining that the section is translated to be in
3775 # contact with the spine.
3776 # @param theWithCorrection - defining that the section is rotated to be
3777 # orthogonal to the spine tangent in the correspondent point
3778 # @param theName Object name; when specified, this parameter is used
3779 # for result publication in the study. Otherwise, if automatic
3780 # publication is switched on, default value is used for result name.
3782 # @return New GEOM.GEOM_Object, containing the created solids.
3784 # @ref tui_creation_pipe_with_shell_sec "Example"
3785 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3786 theLocations, thePath,
3787 theWithContact, theWithCorrection, theName=None):
3789 Create a shape by extrusion of the profile shape along
3790 the path shape. The path shape can be a wire or a edge.
3791 the several profiles can be specified in the several locations of path.
3794 theSeqBases - list of Bases shape to be extruded. Base shape must be
3795 shell or face. If number of faces in neighbour sections
3796 aren't coincided result solid between such sections will
3797 be created using external boundaries of this shells.
3798 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3799 This list is used for searching correspondences between
3800 faces in the sections. Size of this list must be equal
3801 to size of list of base shapes.
3802 theLocations - list of locations on the path corresponding
3803 specified list of the Bases shapes. Number of locations
3804 should be equal to number of bases. First and last
3805 locations must be coincided with first and last vertexes
3806 of path correspondingly.
3807 thePath - Path shape to extrude the base shape along it.
3808 theWithContact - the mode defining that the section is translated to be in
3809 contact with the spine (0/1)
3810 theWithCorrection - defining that the section is rotated to be
3811 orthogonal to the spine tangent in the correspondent point (0/1)
3812 theName Object name; when specified, this parameter is used
3813 for result publication in the study. Otherwise, if automatic
3814 publication is switched on, default value is used for result name.
3817 New GEOM.GEOM_Object, containing the created solids.
3819 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3820 theLocations, thePath,
3821 theWithContact, theWithCorrection)
3822 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3823 self._autoPublish(anObj, theName, "pipe")
3826 ## Create a shape by extrusion of the profile shape along
3827 # the path shape. This function is used only for debug pipe
3828 # functionality - it is a version of function MakePipeWithShellSections()
3829 # which give a possibility to recieve information about
3830 # creating pipe between each pair of sections step by step.
3831 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3832 theLocations, thePath,
3833 theWithContact, theWithCorrection, theName=None):
3835 Create a shape by extrusion of the profile shape along
3836 the path shape. This function is used only for debug pipe
3837 functionality - it is a version of previous function
3838 geompy.MakePipeWithShellSections() which give a possibility to
3839 recieve information about creating pipe between each pair of
3840 sections step by step.
3843 nbsect = len(theSeqBases)
3844 nbsubsect = len(theSeqSubBases)
3845 #print "nbsect = ",nbsect
3846 for i in range(1,nbsect):
3848 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3849 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3851 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3852 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3853 tmpLocations, thePath,
3854 theWithContact, theWithCorrection)
3855 if self.PrimOp.IsDone() == 0:
3856 print "Problems with pipe creation between ",i," and ",i+1," sections"
3857 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3860 print "Pipe between ",i," and ",i+1," sections is OK"
3865 resc = self.MakeCompound(res)
3866 #resc = self.MakeSewing(res, 0.001)
3867 #print "resc: ",resc
3868 self._autoPublish(resc, theName, "pipe")
3871 ## Create solids between given sections
3872 # @param theSeqBases - list of sections (shell or face).
3873 # @param theLocations - list of corresponding vertexes
3874 # @param theName Object name; when specified, this parameter is used
3875 # for result publication in the study. Otherwise, if automatic
3876 # publication is switched on, default value is used for result name.
3878 # @return New GEOM.GEOM_Object, containing the created solids.
3880 # @ref tui_creation_pipe_without_path "Example"
3881 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3883 Create solids between given sections
3886 theSeqBases - list of sections (shell or face).
3887 theLocations - list of corresponding vertexes
3888 theName Object name; when specified, this parameter is used
3889 for result publication in the study. Otherwise, if automatic
3890 publication is switched on, default value is used for result name.
3893 New GEOM.GEOM_Object, containing the created solids.
3895 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3896 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3897 self._autoPublish(anObj, theName, "pipe")
3900 ## Create a shape by extrusion of the base shape along
3901 # the path shape with constant bi-normal direction along the given vector.
3902 # The path shape can be a wire or an edge.
3903 # @param theBase Base shape to be extruded.
3904 # @param thePath Path shape to extrude the base shape along it.
3905 # @param theVec Vector defines a constant binormal direction to keep the
3906 # same angle beetween the direction and the sections
3907 # along the sweep surface.
3908 # @param theName Object name; when specified, this parameter is used
3909 # for result publication in the study. Otherwise, if automatic
3910 # publication is switched on, default value is used for result name.
3912 # @return New GEOM.GEOM_Object, containing the created pipe.
3914 # @ref tui_creation_pipe "Example"
3915 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3917 Create a shape by extrusion of the base shape along
3918 the path shape with constant bi-normal direction along the given vector.
3919 The path shape can be a wire or an edge.
3922 theBase Base shape to be extruded.
3923 thePath Path shape to extrude the base shape along it.
3924 theVec Vector defines a constant binormal direction to keep the
3925 same angle beetween the direction and the sections
3926 along the sweep surface.
3927 theName Object name; when specified, this parameter is used
3928 for result publication in the study. Otherwise, if automatic
3929 publication is switched on, default value is used for result name.
3932 New GEOM.GEOM_Object, containing the created pipe.
3934 # Example: see GEOM_TestAll.py
3935 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3936 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3937 self._autoPublish(anObj, theName, "pipe")
3940 ## Makes a thick solid from a face or a shell
3941 # @param theShape Face or Shell to be thicken
3942 # @param theThickness Thickness of the resulting solid
3943 # @param theName Object name; when specified, this parameter is used
3944 # for result publication in the study. Otherwise, if automatic
3945 # publication is switched on, default value is used for result name.
3947 # @return New GEOM.GEOM_Object, containing the created solid
3949 def MakeThickSolid(self, theShape, theThickness, theName=None):
3951 Make a thick solid from a face or a shell
3954 theShape Face or Shell to be thicken
3955 theThickness Thickness of the resulting solid
3956 theName Object name; when specified, this parameter is used
3957 for result publication in the study. Otherwise, if automatic
3958 publication is switched on, default value is used for result name.
3961 New GEOM.GEOM_Object, containing the created solid
3963 # Example: see GEOM_TestAll.py
3964 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3965 RaiseIfFailed("MakeThickening", self.PrimOp)
3966 self._autoPublish(anObj, theName, "pipe")
3970 ## Modifies a face or a shell to make it a thick solid
3971 # @param theShape Face or Shell to be thicken
3972 # @param theThickness Thickness of the resulting solid
3974 # @return The modified shape
3976 def Thicken(self, theShape, theThickness):
3978 Modifies a face or a shell to make it a thick solid
3981 theBase Base shape to be extruded.
3982 thePath Path shape to extrude the base shape along it.
3983 theName Object name; when specified, this parameter is used
3984 for result publication in the study. Otherwise, if automatic
3985 publication is switched on, default value is used for result name.
3990 # Example: see GEOM_TestAll.py
3991 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3992 RaiseIfFailed("MakeThickening", self.PrimOp)
3995 ## Build a middle path of a pipe-like shape.
3996 # The path shape can be a wire or an edge.
3997 # @param theShape It can be closed or unclosed pipe-like shell
3998 # or a pipe-like solid.
3999 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4000 # should be wires or faces of theShape.
4001 # @param theName Object name; when specified, this parameter is used
4002 # for result publication in the study. Otherwise, if automatic
4003 # publication is switched on, default value is used for result name.
4005 # @note It is not assumed that exact or approximate copy of theShape
4006 # can be obtained by applying existing Pipe operation on the
4007 # resulting "Path" wire taking theBase1 as the base - it is not
4008 # always possible; though in some particular cases it might work
4009 # it is not guaranteed. Thus, RestorePath function should not be
4010 # considered as an exact reverse operation of the Pipe.
4012 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4013 # source pipe's "path".
4015 # @ref tui_creation_pipe_path "Example"
4016 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4018 Build a middle path of a pipe-like shape.
4019 The path shape can be a wire or an edge.
4022 theShape It can be closed or unclosed pipe-like shell
4023 or a pipe-like solid.
4024 theBase1, theBase2 Two bases of the supposed pipe. This
4025 should be wires or faces of theShape.
4026 theName Object name; when specified, this parameter is used
4027 for result publication in the study. Otherwise, if automatic
4028 publication is switched on, default value is used for result name.
4031 New GEOM_Object, containing an edge or wire that represent
4034 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4035 RaiseIfFailed("RestorePath", self.PrimOp)
4036 self._autoPublish(anObj, theName, "path")
4039 ## Build a middle path of a pipe-like shape.
4040 # The path shape can be a wire or an edge.
4041 # @param theShape It can be closed or unclosed pipe-like shell
4042 # or a pipe-like solid.
4043 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4044 # should be lists of edges of theShape.
4045 # @param theName Object name; when specified, this parameter is used
4046 # for result publication in the study. Otherwise, if automatic
4047 # publication is switched on, default value is used for result name.
4049 # @note It is not assumed that exact or approximate copy of theShape
4050 # can be obtained by applying existing Pipe operation on the
4051 # resulting "Path" wire taking theBase1 as the base - it is not
4052 # always possible; though in some particular cases it might work
4053 # it is not guaranteed. Thus, RestorePath function should not be
4054 # considered as an exact reverse operation of the Pipe.
4056 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4057 # source pipe's "path".
4059 # @ref tui_creation_pipe_path "Example"
4060 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4062 Build a middle path of a pipe-like shape.
4063 The path shape can be a wire or an edge.
4066 theShape It can be closed or unclosed pipe-like shell
4067 or a pipe-like solid.
4068 listEdges1, listEdges2 Two bases of the supposed pipe. This
4069 should be lists of edges of theShape.
4070 theName Object name; when specified, this parameter is used
4071 for result publication in the study. Otherwise, if automatic
4072 publication is switched on, default value is used for result name.
4075 New GEOM_Object, containing an edge or wire that represent
4078 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4079 RaiseIfFailed("RestorePath", self.PrimOp)
4080 self._autoPublish(anObj, theName, "path")
4086 ## @addtogroup l3_advanced
4089 ## Create a linear edge with specified ends.
4090 # @param thePnt1 Point for the first end of edge.
4091 # @param thePnt2 Point for the second end of edge.
4092 # @param theName Object name; when specified, this parameter is used
4093 # for result publication in the study. Otherwise, if automatic
4094 # publication is switched on, default value is used for result name.
4096 # @return New GEOM.GEOM_Object, containing the created edge.
4098 # @ref tui_creation_edge "Example"
4099 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4101 Create a linear edge with specified ends.
4104 thePnt1 Point for the first end of edge.
4105 thePnt2 Point for the second end of edge.
4106 theName Object name; when specified, this parameter is used
4107 for result publication in the study. Otherwise, if automatic
4108 publication is switched on, default value is used for result name.
4111 New GEOM.GEOM_Object, containing the created edge.
4113 # Example: see GEOM_TestAll.py
4114 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4115 RaiseIfFailed("MakeEdge", self.ShapesOp)
4116 self._autoPublish(anObj, theName, "edge")
4119 ## Create a new edge, corresponding to the given length on the given curve.
4120 # @param theRefCurve The referenced curve (edge).
4121 # @param theLength Length on the referenced curve. It can be negative.
4122 # @param theStartPoint Any point can be selected for it, the new edge will begin
4123 # at the end of \a theRefCurve, close to the selected point.
4124 # If None, start from the first point of \a theRefCurve.
4125 # @param theName Object name; when specified, this parameter is used
4126 # for result publication in the study. Otherwise, if automatic
4127 # publication is switched on, default value is used for result name.
4129 # @return New GEOM.GEOM_Object, containing the created edge.
4131 # @ref tui_creation_edge "Example"
4132 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4134 Create a new edge, corresponding to the given length on the given curve.
4137 theRefCurve The referenced curve (edge).
4138 theLength Length on the referenced curve. It can be negative.
4139 theStartPoint Any point can be selected for it, the new edge will begin
4140 at the end of theRefCurve, close to the selected point.
4141 If None, start from the first point of theRefCurve.
4142 theName Object name; when specified, this parameter is used
4143 for result publication in the study. Otherwise, if automatic
4144 publication is switched on, default value is used for result name.
4147 New GEOM.GEOM_Object, containing the created edge.
4149 # Example: see GEOM_TestAll.py
4150 theLength, Parameters = ParseParameters(theLength)
4151 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4152 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4153 anObj.SetParameters(Parameters)
4154 self._autoPublish(anObj, theName, "edge")
4157 ## Create an edge from specified wire.
4158 # @param theWire source Wire
4159 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4160 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4161 # @param theName Object name; when specified, this parameter is used
4162 # for result publication in the study. Otherwise, if automatic
4163 # publication is switched on, default value is used for result name.
4165 # @return New GEOM.GEOM_Object, containing the created edge.
4167 # @ref tui_creation_edge "Example"
4168 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4170 Create an edge from specified wire.
4174 theLinearTolerance linear tolerance value (default = 1e-07)
4175 theAngularTolerance angular tolerance value (default = 1e-12)
4176 theName Object name; when specified, this parameter is used
4177 for result publication in the study. Otherwise, if automatic
4178 publication is switched on, default value is used for result name.
4181 New GEOM.GEOM_Object, containing the created edge.
4183 # Example: see GEOM_TestAll.py
4184 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4185 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4186 self._autoPublish(anObj, theName, "edge")
4189 ## Create a wire from the set of edges and wires.
4190 # @param theEdgesAndWires List of edges and/or wires.
4191 # @param theTolerance Maximum distance between vertices, that will be merged.
4192 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4193 # @param theName Object name; when specified, this parameter is used
4194 # for result publication in the study. Otherwise, if automatic
4195 # publication is switched on, default value is used for result name.
4197 # @return New GEOM.GEOM_Object, containing the created wire.
4199 # @ref tui_creation_wire "Example"
4200 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4202 Create a wire from the set of edges and wires.
4205 theEdgesAndWires List of edges and/or wires.
4206 theTolerance Maximum distance between vertices, that will be merged.
4207 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4208 theName Object name; when specified, this parameter is used
4209 for result publication in the study. Otherwise, if automatic
4210 publication is switched on, default value is used for result name.
4213 New GEOM.GEOM_Object, containing the created wire.
4215 # Example: see GEOM_TestAll.py
4216 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4217 RaiseIfFailed("MakeWire", self.ShapesOp)
4218 self._autoPublish(anObj, theName, "wire")
4221 ## Create a face on the given wire.
4222 # @param theWire closed Wire or Edge to build the face on.
4223 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4224 # If the tolerance of the obtained planar face is less
4225 # than 1e-06, this face will be returned, otherwise the
4226 # algorithm tries to build any suitable face on the given
4227 # wire and prints a warning message.
4228 # @param theName Object name; when specified, this parameter is used
4229 # for result publication in the study. Otherwise, if automatic
4230 # publication is switched on, default value is used for result name.
4232 # @return New GEOM.GEOM_Object, containing the created face.
4234 # @ref tui_creation_face "Example"
4235 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4237 Create a face on the given wire.
4240 theWire closed Wire or Edge to build the face on.
4241 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4242 If the tolerance of the obtained planar face is less
4243 than 1e-06, this face will be returned, otherwise the
4244 algorithm tries to build any suitable face on the given
4245 wire and prints a warning message.
4246 theName Object name; when specified, this parameter is used
4247 for result publication in the study. Otherwise, if automatic
4248 publication is switched on, default value is used for result name.
4251 New GEOM.GEOM_Object, containing the created face.
4253 # Example: see GEOM_TestAll.py
4254 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4255 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4256 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4258 RaiseIfFailed("MakeFace", self.ShapesOp)
4259 self._autoPublish(anObj, theName, "face")
4262 ## Create a face on the given wires set.
4263 # @param theWires List of closed wires or edges to build the face on.
4264 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4265 # If the tolerance of the obtained planar face is less
4266 # than 1e-06, this face will be returned, otherwise the
4267 # algorithm tries to build any suitable face on the given
4268 # wire and prints a warning message.
4269 # @param theName Object name; when specified, this parameter is used
4270 # for result publication in the study. Otherwise, if automatic
4271 # publication is switched on, default value is used for result name.
4273 # @return New GEOM.GEOM_Object, containing the created face.
4275 # @ref tui_creation_face "Example"
4276 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4278 Create a face on the given wires set.
4281 theWires List of closed wires or edges to build the face on.
4282 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4283 If the tolerance of the obtained planar face is less
4284 than 1e-06, this face will be returned, otherwise the
4285 algorithm tries to build any suitable face on the given
4286 wire and prints a warning message.
4287 theName Object name; when specified, this parameter is used
4288 for result publication in the study. Otherwise, if automatic
4289 publication is switched on, default value is used for result name.
4292 New GEOM.GEOM_Object, containing the created face.
4294 # Example: see GEOM_TestAll.py
4295 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4296 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4297 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4299 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4300 self._autoPublish(anObj, theName, "face")
4303 ## See MakeFaceWires() method for details.
4305 # @ref tui_creation_face "Example 1"
4306 # \n @ref swig_MakeFaces "Example 2"
4307 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4309 See geompy.MakeFaceWires() method for details.
4311 # Example: see GEOM_TestOthers.py
4312 # note: auto-publishing is done in self.MakeFaceWires()
4313 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4316 ## Create a shell from the set of faces and shells.
4317 # @param theFacesAndShells List of faces and/or shells.
4318 # @param theName Object name; when specified, this parameter is used
4319 # for result publication in the study. Otherwise, if automatic
4320 # publication is switched on, default value is used for result name.
4322 # @return New GEOM.GEOM_Object, containing the created shell.
4324 # @ref tui_creation_shell "Example"
4325 def MakeShell(self, theFacesAndShells, theName=None):
4327 Create a shell from the set of faces and shells.
4330 theFacesAndShells List of faces and/or shells.
4331 theName Object name; when specified, this parameter is used
4332 for result publication in the study. Otherwise, if automatic
4333 publication is switched on, default value is used for result name.
4336 New GEOM.GEOM_Object, containing the created shell.
4338 # Example: see GEOM_TestAll.py
4339 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4340 RaiseIfFailed("MakeShell", self.ShapesOp)
4341 self._autoPublish(anObj, theName, "shell")
4344 ## Create a solid, bounded by the given shells.
4345 # @param theShells Sequence of bounding shells.
4346 # @param theName Object name; when specified, this parameter is used
4347 # for result publication in the study. Otherwise, if automatic
4348 # publication is switched on, default value is used for result name.
4350 # @return New GEOM.GEOM_Object, containing the created solid.
4352 # @ref tui_creation_solid "Example"
4353 def MakeSolid(self, theShells, theName=None):
4355 Create a solid, bounded by the given shells.
4358 theShells Sequence of bounding shells.
4359 theName Object name; when specified, this parameter is used
4360 for result publication in the study. Otherwise, if automatic
4361 publication is switched on, default value is used for result name.
4364 New GEOM.GEOM_Object, containing the created solid.
4366 # Example: see GEOM_TestAll.py
4367 if len(theShells) == 1:
4368 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4370 # raise RuntimeError, "MakeSolidShells : " + descr
4371 if descr == "WRN_SHAPE_UNCLOSED":
4372 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4373 anObj = self.ShapesOp.MakeSolidShells(theShells)
4374 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4375 self._autoPublish(anObj, theName, "solid")
4378 ## Create a compound of the given shapes.
4379 # @param theShapes List of shapes to put in compound.
4380 # @param theName Object name; when specified, this parameter is used
4381 # for result publication in the study. Otherwise, if automatic
4382 # publication is switched on, default value is used for result name.
4384 # @return New GEOM.GEOM_Object, containing the created compound.
4386 # @ref tui_creation_compound "Example"
4387 def MakeCompound(self, theShapes, theName=None):
4389 Create a compound of the given shapes.
4392 theShapes List of shapes to put in compound.
4393 theName Object name; when specified, this parameter is used
4394 for result publication in the study. Otherwise, if automatic
4395 publication is switched on, default value is used for result name.
4398 New GEOM.GEOM_Object, containing the created compound.
4400 # Example: see GEOM_TestAll.py
4401 self.ShapesOp.StartOperation()
4402 anObj = self.ShapesOp.MakeCompound(theShapes)
4403 RaiseIfFailed("MakeCompound", self.ShapesOp)
4404 self._autoPublish(anObj, theName, "compound")
4407 # end of l3_advanced
4410 ## @addtogroup l2_measure
4413 ## Gives quantity of faces in the given shape.
4414 # @param theShape Shape to count faces of.
4415 # @return Quantity of faces.
4417 # @ref swig_NumberOf "Example"
4418 def NumberOfFaces(self, theShape):
4420 Gives quantity of faces in the given shape.
4423 theShape Shape to count faces of.
4428 # Example: see GEOM_TestOthers.py
4429 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4430 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4433 ## Gives quantity of edges in the given shape.
4434 # @param theShape Shape to count edges of.
4435 # @return Quantity of edges.
4437 # @ref swig_NumberOf "Example"
4438 def NumberOfEdges(self, theShape):
4440 Gives quantity of edges in the given shape.
4443 theShape Shape to count edges of.
4448 # Example: see GEOM_TestOthers.py
4449 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4450 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4453 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4454 # @param theShape Shape to count sub-shapes of.
4455 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4456 # @return Quantity of sub-shapes of given type.
4458 # @ref swig_NumberOf "Example"
4459 def NumberOfSubShapes(self, theShape, theShapeType):
4461 Gives quantity of sub-shapes of type theShapeType in the given shape.
4464 theShape Shape to count sub-shapes of.
4465 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4468 Quantity of sub-shapes of given type.
4470 # Example: see GEOM_TestOthers.py
4471 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4472 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4475 ## Gives quantity of solids in the given shape.
4476 # @param theShape Shape to count solids in.
4477 # @return Quantity of solids.
4479 # @ref swig_NumberOf "Example"
4480 def NumberOfSolids(self, theShape):
4482 Gives quantity of solids in the given shape.
4485 theShape Shape to count solids in.
4490 # Example: see GEOM_TestOthers.py
4491 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4492 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4498 ## @addtogroup l3_healing
4501 ## Reverses an orientation the given shape.
4502 # @param theShape Shape to be reversed.
4503 # @param theName Object name; when specified, this parameter is used
4504 # for result publication in the study. Otherwise, if automatic
4505 # publication is switched on, default value is used for result name.
4507 # @return The reversed copy of theShape.
4509 # @ref swig_ChangeOrientation "Example"
4510 def ChangeOrientation(self, theShape, theName=None):
4512 Reverses an orientation the given shape.
4515 theShape Shape to be reversed.
4516 theName Object name; when specified, this parameter is used
4517 for result publication in the study. Otherwise, if automatic
4518 publication is switched on, default value is used for result name.
4521 The reversed copy of theShape.
4523 # Example: see GEOM_TestAll.py
4524 anObj = self.ShapesOp.ChangeOrientation(theShape)
4525 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4526 self._autoPublish(anObj, theName, "reversed")
4529 ## See ChangeOrientation() method for details.
4531 # @ref swig_OrientationChange "Example"
4532 def OrientationChange(self, theShape, theName=None):
4534 See geompy.ChangeOrientation method for details.
4536 # Example: see GEOM_TestOthers.py
4537 # note: auto-publishing is done in self.ChangeOrientation()
4538 anObj = self.ChangeOrientation(theShape, theName)
4544 ## @addtogroup l4_obtain
4547 ## Retrieve all free faces from the given shape.
4548 # Free face is a face, which is not shared between two shells of the shape.
4549 # @param theShape Shape to find free faces in.
4550 # @return List of IDs of all free faces, contained in theShape.
4552 # @ref tui_measurement_tools_page "Example"
4553 def GetFreeFacesIDs(self,theShape):
4555 Retrieve all free faces from the given shape.
4556 Free face is a face, which is not shared between two shells of the shape.
4559 theShape Shape to find free faces in.
4562 List of IDs of all free faces, contained in theShape.
4564 # Example: see GEOM_TestOthers.py
4565 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4566 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4569 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4570 # @param theShape1 Shape to find sub-shapes in.
4571 # @param theShape2 Shape to find shared sub-shapes with.
4572 # @param theShapeType Type of sub-shapes to be retrieved.
4573 # @param theName Object name; when specified, this parameter is used
4574 # for result publication in the study. Otherwise, if automatic
4575 # publication is switched on, default value is used for result name.
4577 # @return List of sub-shapes of theShape1, shared with theShape2.
4579 # @ref swig_GetSharedShapes "Example"
4580 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4582 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4585 theShape1 Shape to find sub-shapes in.
4586 theShape2 Shape to find shared sub-shapes with.
4587 theShapeType Type of sub-shapes to be retrieved.
4588 theName Object name; when specified, this parameter is used
4589 for result publication in the study. Otherwise, if automatic
4590 publication is switched on, default value is used for result name.
4593 List of sub-shapes of theShape1, shared with theShape2.
4595 # Example: see GEOM_TestOthers.py
4596 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4597 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4598 self._autoPublish(aList, theName, "shared")
4601 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4602 # @param theShapes Shapes to find common sub-shapes of.
4603 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4604 # @param theName Object name; when specified, this parameter is used
4605 # for result publication in the study. Otherwise, if automatic
4606 # publication is switched on, default value is used for result name.
4608 # @return List of objects, that are sub-shapes of all given shapes.
4610 # @ref swig_GetSharedShapes "Example"
4611 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4613 Get all sub-shapes, shared by all shapes in the list theShapes.
4616 theShapes Shapes to find common sub-shapes of.
4617 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4618 theName Object name; when specified, this parameter is used
4619 for result publication in the study. Otherwise, if automatic
4620 publication is switched on, default value is used for result name.
4623 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4625 # Example: see GEOM_TestOthers.py
4626 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4627 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4628 self._autoPublish(aList, theName, "shared")
4631 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4632 # situated relatively the specified plane by the certain way,
4633 # defined through <VAR>theState</VAR> parameter.
4634 # @param theShape Shape to find sub-shapes of.
4635 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4636 # @param theAx1 Vector (or line, or linear edge), specifying normal
4637 # direction and location of the plane to find shapes on.
4638 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4639 # @param theName Object name; when specified, this parameter is used
4640 # for result publication in the study. Otherwise, if automatic
4641 # publication is switched on, default value is used for result name.
4643 # @return List of all found sub-shapes.
4645 # @ref swig_GetShapesOnPlane "Example"
4646 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4648 Find in theShape all sub-shapes of type theShapeType,
4649 situated relatively the specified plane by the certain way,
4650 defined through theState parameter.
4653 theShape Shape to find sub-shapes of.
4654 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4655 theAx1 Vector (or line, or linear edge), specifying normal
4656 direction and location of the plane to find shapes on.
4657 theState The state of the sub-shapes to find (see GEOM::shape_state)
4658 theName Object name; when specified, this parameter is used
4659 for result publication in the study. Otherwise, if automatic
4660 publication is switched on, default value is used for result name.
4663 List of all found sub-shapes.
4665 # Example: see GEOM_TestOthers.py
4666 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4667 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4668 self._autoPublish(aList, theName, "shapeOnPlane")
4671 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4672 # situated relatively the specified plane by the certain way,
4673 # defined through <VAR>theState</VAR> parameter.
4674 # @param theShape Shape to find sub-shapes of.
4675 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4676 # @param theAx1 Vector (or line, or linear edge), specifying normal
4677 # direction and location of the plane to find shapes on.
4678 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4680 # @return List of all found sub-shapes indices.
4682 # @ref swig_GetShapesOnPlaneIDs "Example"
4683 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4685 Find in theShape all sub-shapes of type theShapeType,
4686 situated relatively the specified plane by the certain way,
4687 defined through theState parameter.
4690 theShape Shape to find sub-shapes of.
4691 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4692 theAx1 Vector (or line, or linear edge), specifying normal
4693 direction and location of the plane to find shapes on.
4694 theState The state of the sub-shapes to find (see GEOM::shape_state)
4697 List of all found sub-shapes indices.
4699 # Example: see GEOM_TestOthers.py
4700 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4701 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4704 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4705 # situated relatively the specified plane by the certain way,
4706 # defined through <VAR>theState</VAR> parameter.
4707 # @param theShape Shape to find sub-shapes of.
4708 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4709 # @param theAx1 Vector (or line, or linear edge), specifying normal
4710 # direction of the plane to find shapes on.
4711 # @param thePnt Point specifying location of the plane to find shapes on.
4712 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4713 # @param theName Object name; when specified, this parameter is used
4714 # for result publication in the study. Otherwise, if automatic
4715 # publication is switched on, default value is used for result name.
4717 # @return List of all found sub-shapes.
4719 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4720 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4722 Find in theShape all sub-shapes of type theShapeType,
4723 situated relatively the specified plane by the certain way,
4724 defined through theState parameter.
4727 theShape Shape to find sub-shapes of.
4728 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4729 theAx1 Vector (or line, or linear edge), specifying normal
4730 direction and location of the plane to find shapes on.
4731 thePnt Point specifying location of the plane to find shapes on.
4732 theState The state of the sub-shapes to find (see GEOM::shape_state)
4733 theName Object name; when specified, this parameter is used
4734 for result publication in the study. Otherwise, if automatic
4735 publication is switched on, default value is used for result name.
4738 List of all found sub-shapes.
4740 # Example: see GEOM_TestOthers.py
4741 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4742 theAx1, thePnt, theState)
4743 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4744 self._autoPublish(aList, theName, "shapeOnPlane")
4747 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4748 # situated relatively the specified plane by the certain way,
4749 # defined through <VAR>theState</VAR> parameter.
4750 # @param theShape Shape to find sub-shapes of.
4751 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4752 # @param theAx1 Vector (or line, or linear edge), specifying normal
4753 # direction of the plane to find shapes on.
4754 # @param thePnt Point specifying location of the plane to find shapes on.
4755 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4757 # @return List of all found sub-shapes indices.
4759 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4760 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4762 Find in theShape all sub-shapes of type theShapeType,
4763 situated relatively the specified plane by the certain way,
4764 defined through theState parameter.
4767 theShape Shape to find sub-shapes of.
4768 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4769 theAx1 Vector (or line, or linear edge), specifying normal
4770 direction and location of the plane to find shapes on.
4771 thePnt Point specifying location of the plane to find shapes on.
4772 theState The state of the sub-shapes to find (see GEOM::shape_state)
4775 List of all found sub-shapes indices.
4777 # Example: see GEOM_TestOthers.py
4778 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4779 theAx1, thePnt, theState)
4780 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4783 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4784 # the specified cylinder by the certain way, defined through \a theState parameter.
4785 # @param theShape Shape to find sub-shapes of.
4786 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4787 # @param theAxis Vector (or line, or linear edge), specifying
4788 # axis of the cylinder to find shapes on.
4789 # @param theRadius Radius of the cylinder to find shapes on.
4790 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4791 # @param theName Object name; when specified, this parameter is used
4792 # for result publication in the study. Otherwise, if automatic
4793 # publication is switched on, default value is used for result name.
4795 # @return List of all found sub-shapes.
4797 # @ref swig_GetShapesOnCylinder "Example"
4798 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4800 Find in theShape all sub-shapes of type theShapeType, situated relatively
4801 the specified cylinder by the certain way, defined through theState parameter.
4804 theShape Shape to find sub-shapes of.
4805 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4806 theAxis Vector (or line, or linear edge), specifying
4807 axis of the cylinder to find shapes on.
4808 theRadius Radius of the cylinder to find shapes on.
4809 theState The state of the sub-shapes to find (see GEOM::shape_state)
4810 theName Object name; when specified, this parameter is used
4811 for result publication in the study. Otherwise, if automatic
4812 publication is switched on, default value is used for result name.
4815 List of all found sub-shapes.
4817 # Example: see GEOM_TestOthers.py
4818 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4819 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4820 self._autoPublish(aList, theName, "shapeOnCylinder")
4823 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4824 # the specified cylinder by the certain way, defined through \a theState parameter.
4825 # @param theShape Shape to find sub-shapes of.
4826 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4827 # @param theAxis Vector (or line, or linear edge), specifying
4828 # axis of the cylinder to find shapes on.
4829 # @param theRadius Radius of the cylinder to find shapes on.
4830 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4832 # @return List of all found sub-shapes indices.
4834 # @ref swig_GetShapesOnCylinderIDs "Example"
4835 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4837 Find in theShape all sub-shapes of type theShapeType, situated relatively
4838 the specified cylinder by the certain way, defined through theState parameter.
4841 theShape Shape to find sub-shapes of.
4842 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4843 theAxis Vector (or line, or linear edge), specifying
4844 axis of the cylinder to find shapes on.
4845 theRadius Radius of the cylinder to find shapes on.
4846 theState The state of the sub-shapes to find (see GEOM::shape_state)
4849 List of all found sub-shapes indices.
4851 # Example: see GEOM_TestOthers.py
4852 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4853 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4856 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4857 # the specified cylinder by the certain way, defined through \a theState parameter.
4858 # @param theShape Shape to find sub-shapes of.
4859 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4860 # @param theAxis Vector (or line, or linear edge), specifying
4861 # axis of the cylinder to find shapes on.
4862 # @param thePnt Point specifying location of the bottom of the cylinder.
4863 # @param theRadius Radius of the cylinder to find shapes on.
4864 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4865 # @param theName Object name; when specified, this parameter is used
4866 # for result publication in the study. Otherwise, if automatic
4867 # publication is switched on, default value is used for result name.
4869 # @return List of all found sub-shapes.
4871 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4872 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4874 Find in theShape all sub-shapes of type theShapeType, situated relatively
4875 the specified cylinder by the certain way, defined through theState parameter.
4878 theShape Shape to find sub-shapes of.
4879 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4880 theAxis Vector (or line, or linear edge), specifying
4881 axis of the cylinder to find shapes on.
4882 theRadius Radius of the cylinder to find shapes on.
4883 theState The state of the sub-shapes to find (see GEOM::shape_state)
4884 theName Object name; when specified, this parameter is used
4885 for result publication in the study. Otherwise, if automatic
4886 publication is switched on, default value is used for result name.
4889 List of all found sub-shapes.
4891 # Example: see GEOM_TestOthers.py
4892 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4893 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4894 self._autoPublish(aList, theName, "shapeOnCylinder")
4897 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4898 # the specified cylinder by the certain way, defined through \a theState parameter.
4899 # @param theShape Shape to find sub-shapes of.
4900 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4901 # @param theAxis Vector (or line, or linear edge), specifying
4902 # axis of the cylinder to find shapes on.
4903 # @param thePnt Point specifying location of the bottom of the cylinder.
4904 # @param theRadius Radius of the cylinder to find shapes on.
4905 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4907 # @return List of all found sub-shapes indices
4909 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4910 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4912 Find in theShape all sub-shapes of type theShapeType, situated relatively
4913 the specified cylinder by the certain way, defined through theState parameter.
4916 theShape Shape to find sub-shapes of.
4917 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4918 theAxis Vector (or line, or linear edge), specifying
4919 axis of the cylinder to find shapes on.
4920 theRadius Radius of the cylinder to find shapes on.
4921 theState The state of the sub-shapes to find (see GEOM::shape_state)
4924 List of all found sub-shapes indices.
4926 # Example: see GEOM_TestOthers.py
4927 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4928 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4931 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4932 # the specified sphere by the certain way, defined through \a theState parameter.
4933 # @param theShape Shape to find sub-shapes of.
4934 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4935 # @param theCenter Point, specifying center of the sphere to find shapes on.
4936 # @param theRadius Radius of the sphere to find shapes on.
4937 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4938 # @param theName Object name; when specified, this parameter is used
4939 # for result publication in the study. Otherwise, if automatic
4940 # publication is switched on, default value is used for result name.
4942 # @return List of all found sub-shapes.
4944 # @ref swig_GetShapesOnSphere "Example"
4945 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4947 Find in theShape all sub-shapes of type theShapeType, situated relatively
4948 the specified sphere by the certain way, defined through theState parameter.
4951 theShape Shape to find sub-shapes of.
4952 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4953 theCenter Point, specifying center of the sphere to find shapes on.
4954 theRadius Radius of the sphere to find shapes on.
4955 theState The state of the sub-shapes to find (see GEOM::shape_state)
4956 theName Object name; when specified, this parameter is used
4957 for result publication in the study. Otherwise, if automatic
4958 publication is switched on, default value is used for result name.
4961 List of all found sub-shapes.
4963 # Example: see GEOM_TestOthers.py
4964 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4965 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4966 self._autoPublish(aList, theName, "shapeOnSphere")
4969 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4970 # the specified sphere by the certain way, defined through \a theState parameter.
4971 # @param theShape Shape to find sub-shapes of.
4972 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4973 # @param theCenter Point, specifying center of the sphere to find shapes on.
4974 # @param theRadius Radius of the sphere to find shapes on.
4975 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4977 # @return List of all found sub-shapes indices.
4979 # @ref swig_GetShapesOnSphereIDs "Example"
4980 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4982 Find in theShape all sub-shapes of type theShapeType, situated relatively
4983 the specified sphere by the certain way, defined through theState parameter.
4986 theShape Shape to find sub-shapes of.
4987 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4988 theCenter Point, specifying center of the sphere to find shapes on.
4989 theRadius Radius of the sphere to find shapes on.
4990 theState The state of the sub-shapes to find (see GEOM::shape_state)
4993 List of all found sub-shapes indices.
4995 # Example: see GEOM_TestOthers.py
4996 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4997 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5000 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5001 # the specified quadrangle by the certain way, defined through \a theState parameter.
5002 # @param theShape Shape to find sub-shapes of.
5003 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5004 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5005 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5006 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5007 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5008 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5009 # @param theName Object name; when specified, this parameter is used
5010 # for result publication in the study. Otherwise, if automatic
5011 # publication is switched on, default value is used for result name.
5013 # @return List of all found sub-shapes.
5015 # @ref swig_GetShapesOnQuadrangle "Example"
5016 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5017 theTopLeftPoint, theTopRigthPoint,
5018 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5020 Find in theShape all sub-shapes of type theShapeType, situated relatively
5021 the specified quadrangle by the certain way, defined through theState parameter.
5024 theShape Shape to find sub-shapes of.
5025 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5026 theTopLeftPoint Point, specifying top left corner of a quadrangle
5027 theTopRigthPoint Point, specifying top right corner of a quadrangle
5028 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5029 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5030 theState The state of the sub-shapes to find (see GEOM::shape_state)
5031 theName Object name; when specified, this parameter is used
5032 for result publication in the study. Otherwise, if automatic
5033 publication is switched on, default value is used for result name.
5036 List of all found sub-shapes.
5038 # Example: see GEOM_TestOthers.py
5039 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5040 theTopLeftPoint, theTopRigthPoint,
5041 theBottomLeftPoint, theBottomRigthPoint, theState)
5042 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5043 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5046 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5047 # the specified quadrangle by the certain way, defined through \a theState parameter.
5048 # @param theShape Shape to find sub-shapes of.
5049 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5050 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5051 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5052 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5053 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5054 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5056 # @return List of all found sub-shapes indices.
5058 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5059 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5060 theTopLeftPoint, theTopRigthPoint,
5061 theBottomLeftPoint, theBottomRigthPoint, theState):
5063 Find in theShape all sub-shapes of type theShapeType, situated relatively
5064 the specified quadrangle by the certain way, defined through theState parameter.
5067 theShape Shape to find sub-shapes of.
5068 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5069 theTopLeftPoint Point, specifying top left corner of a quadrangle
5070 theTopRigthPoint Point, specifying top right corner of a quadrangle
5071 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5072 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5073 theState The state of the sub-shapes to find (see GEOM::shape_state)
5076 List of all found sub-shapes indices.
5079 # Example: see GEOM_TestOthers.py
5080 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5081 theTopLeftPoint, theTopRigthPoint,
5082 theBottomLeftPoint, theBottomRigthPoint, theState)
5083 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5086 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5087 # the specified \a theBox by the certain way, defined through \a theState parameter.
5088 # @param theBox Shape for relative comparing.
5089 # @param theShape Shape to find sub-shapes of.
5090 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5091 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5092 # @param theName Object name; when specified, this parameter is used
5093 # for result publication in the study. Otherwise, if automatic
5094 # publication is switched on, default value is used for result name.
5096 # @return List of all found sub-shapes.
5098 # @ref swig_GetShapesOnBox "Example"
5099 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5101 Find in theShape all sub-shapes of type theShapeType, situated relatively
5102 the specified theBox by the certain way, defined through theState parameter.
5105 theBox Shape for relative comparing.
5106 theShape Shape to find sub-shapes of.
5107 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5108 theState The state of the sub-shapes to find (see GEOM::shape_state)
5109 theName Object name; when specified, this parameter is used
5110 for result publication in the study. Otherwise, if automatic
5111 publication is switched on, default value is used for result name.
5114 List of all found sub-shapes.
5116 # Example: see GEOM_TestOthers.py
5117 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5118 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5119 self._autoPublish(aList, theName, "shapeOnBox")
5122 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5123 # the specified \a theBox by the certain way, defined through \a theState parameter.
5124 # @param theBox Shape for relative comparing.
5125 # @param theShape Shape to find sub-shapes of.
5126 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5127 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5129 # @return List of all found sub-shapes indices.
5131 # @ref swig_GetShapesOnBoxIDs "Example"
5132 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5134 Find in theShape all sub-shapes of type theShapeType, situated relatively
5135 the specified theBox by the certain way, defined through theState parameter.
5138 theBox Shape for relative comparing.
5139 theShape Shape to find sub-shapes of.
5140 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5141 theState The state of the sub-shapes to find (see GEOM::shape_state)
5144 List of all found sub-shapes indices.
5146 # Example: see GEOM_TestOthers.py
5147 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5148 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5151 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5152 # situated relatively the specified \a theCheckShape by the
5153 # certain way, defined through \a theState parameter.
5154 # @param theCheckShape Shape for relative comparing. It must be a solid.
5155 # @param theShape Shape to find sub-shapes of.
5156 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5157 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5158 # @param theName Object name; when specified, this parameter is used
5159 # for result publication in the study. Otherwise, if automatic
5160 # publication is switched on, default value is used for result name.
5162 # @return List of all found sub-shapes.
5164 # @ref swig_GetShapesOnShape "Example"
5165 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5167 Find in theShape all sub-shapes of type theShapeType,
5168 situated relatively the specified theCheckShape by the
5169 certain way, defined through theState parameter.
5172 theCheckShape Shape for relative comparing. It must be a solid.
5173 theShape Shape to find sub-shapes of.
5174 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5175 theState The state of the sub-shapes to find (see GEOM::shape_state)
5176 theName Object name; when specified, this parameter is used
5177 for result publication in the study. Otherwise, if automatic
5178 publication is switched on, default value is used for result name.
5181 List of all found sub-shapes.
5183 # Example: see GEOM_TestOthers.py
5184 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5185 theShapeType, theState)
5186 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5187 self._autoPublish(aList, theName, "shapeOnShape")
5190 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5191 # situated relatively the specified \a theCheckShape by the
5192 # certain way, defined through \a theState parameter.
5193 # @param theCheckShape Shape for relative comparing. It must be a solid.
5194 # @param theShape Shape to find sub-shapes of.
5195 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5196 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5197 # @param theName Object name; when specified, this parameter is used
5198 # for result publication in the study. Otherwise, if automatic
5199 # publication is switched on, default value is used for result name.
5201 # @return All found sub-shapes as compound.
5203 # @ref swig_GetShapesOnShapeAsCompound "Example"
5204 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5206 Find in theShape all sub-shapes of type theShapeType,
5207 situated relatively the specified theCheckShape by the
5208 certain way, defined through theState parameter.
5211 theCheckShape Shape for relative comparing. It must be a solid.
5212 theShape Shape to find sub-shapes of.
5213 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5214 theState The state of the sub-shapes to find (see GEOM::shape_state)
5215 theName Object name; when specified, this parameter is used
5216 for result publication in the study. Otherwise, if automatic
5217 publication is switched on, default value is used for result name.
5220 All found sub-shapes as compound.
5222 # Example: see GEOM_TestOthers.py
5223 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5224 theShapeType, theState)
5225 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5226 self._autoPublish(anObj, theName, "shapeOnShape")
5229 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5230 # situated relatively the specified \a theCheckShape by the
5231 # certain way, defined through \a theState parameter.
5232 # @param theCheckShape Shape for relative comparing. It must be a solid.
5233 # @param theShape Shape to find sub-shapes of.
5234 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5235 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5237 # @return List of all found sub-shapes indices.
5239 # @ref swig_GetShapesOnShapeIDs "Example"
5240 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5242 Find in theShape all sub-shapes of type theShapeType,
5243 situated relatively the specified theCheckShape by the
5244 certain way, defined through theState parameter.
5247 theCheckShape Shape for relative comparing. It must be a solid.
5248 theShape Shape to find sub-shapes of.
5249 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5250 theState The state of the sub-shapes to find (see GEOM::shape_state)
5253 List of all found sub-shapes indices.
5255 # Example: see GEOM_TestOthers.py
5256 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5257 theShapeType, theState)
5258 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5261 ## Get sub-shape(s) of theShapeWhere, which are
5262 # coincident with \a theShapeWhat or could be a part of it.
5263 # @param theShapeWhere Shape to find sub-shapes of.
5264 # @param theShapeWhat Shape, specifying what to find.
5265 # @param isNewImplementation implementation of GetInPlace functionality
5266 # (default = False, old alghorithm based on shape properties)
5267 # @param theName Object name; when specified, this parameter is used
5268 # for result publication in the study. Otherwise, if automatic
5269 # publication is switched on, default value is used for result name.
5271 # @return Group of all found sub-shapes or a single found sub-shape.
5273 # @note This function has a restriction on argument shapes.
5274 # If \a theShapeWhere has curved parts with significantly
5275 # outstanding centres (i.e. the mass centre of a part is closer to
5276 # \a theShapeWhat than to the part), such parts will not be found.
5277 # @image html get_in_place_lost_part.png
5279 # @ref swig_GetInPlace "Example"
5280 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5282 Get sub-shape(s) of theShapeWhere, which are
5283 coincident with theShapeWhat or could be a part of it.
5286 theShapeWhere Shape to find sub-shapes of.
5287 theShapeWhat Shape, specifying what to find.
5288 isNewImplementation Implementation of GetInPlace functionality
5289 (default = False, old alghorithm based on shape properties)
5290 theName Object name; when specified, this parameter is used
5291 for result publication in the study. Otherwise, if automatic
5292 publication is switched on, default value is used for result name.
5295 Group of all found sub-shapes or a single found sub-shape.
5299 This function has a restriction on argument shapes.
5300 If theShapeWhere has curved parts with significantly
5301 outstanding centres (i.e. the mass centre of a part is closer to
5302 theShapeWhat than to the part), such parts will not be found.
5304 # Example: see GEOM_TestOthers.py
5306 if isNewImplementation:
5307 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5309 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5311 RaiseIfFailed("GetInPlace", self.ShapesOp)
5312 self._autoPublish(anObj, theName, "inplace")
5315 ## Get sub-shape(s) of \a theShapeWhere, which are
5316 # coincident with \a theShapeWhat or could be a part of it.
5318 # Implementation of this method is based on a saved history of an operation,
5319 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5320 # arguments (an argument shape or a sub-shape of an argument shape).
5321 # The operation could be the Partition or one of boolean operations,
5322 # performed on simple shapes (not on compounds).
5324 # @param theShapeWhere Shape to find sub-shapes of.
5325 # @param theShapeWhat Shape, specifying what to find (must be in the
5326 # building history of the ShapeWhere).
5327 # @param theName Object name; when specified, this parameter is used
5328 # for result publication in the study. Otherwise, if automatic
5329 # publication is switched on, default value is used for result name.
5331 # @return Group of all found sub-shapes or a single found sub-shape.
5333 # @ref swig_GetInPlace "Example"
5334 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5336 Implementation of this method is based on a saved history of an operation,
5337 produced theShapeWhere. The theShapeWhat must be among this operation's
5338 arguments (an argument shape or a sub-shape of an argument shape).
5339 The operation could be the Partition or one of boolean operations,
5340 performed on simple shapes (not on compounds).
5343 theShapeWhere Shape to find sub-shapes of.
5344 theShapeWhat Shape, specifying what to find (must be in the
5345 building history of the ShapeWhere).
5346 theName Object name; when specified, this parameter is used
5347 for result publication in the study. Otherwise, if automatic
5348 publication is switched on, default value is used for result name.
5351 Group of all found sub-shapes or a single found sub-shape.
5353 # Example: see GEOM_TestOthers.py
5354 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5355 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5356 self._autoPublish(anObj, theName, "inplace")
5359 ## Get sub-shape of theShapeWhere, which is
5360 # equal to \a theShapeWhat.
5361 # @param theShapeWhere Shape to find sub-shape of.
5362 # @param theShapeWhat Shape, specifying what to find.
5363 # @param theName Object name; when specified, this parameter is used
5364 # for result publication in the study. Otherwise, if automatic
5365 # publication is switched on, default value is used for result name.
5367 # @return New GEOM.GEOM_Object for found sub-shape.
5369 # @ref swig_GetSame "Example"
5370 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5372 Get sub-shape of theShapeWhere, which is
5373 equal to theShapeWhat.
5376 theShapeWhere Shape to find sub-shape of.
5377 theShapeWhat Shape, specifying what to find.
5378 theName Object name; when specified, this parameter is used
5379 for result publication in the study. Otherwise, if automatic
5380 publication is switched on, default value is used for result name.
5383 New GEOM.GEOM_Object for found sub-shape.
5385 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5386 RaiseIfFailed("GetSame", self.ShapesOp)
5387 self._autoPublish(anObj, theName, "sameShape")
5391 ## Get sub-shape indices of theShapeWhere, which is
5392 # equal to \a theShapeWhat.
5393 # @param theShapeWhere Shape to find sub-shape of.
5394 # @param theShapeWhat Shape, specifying what to find.
5395 # @return List of all found sub-shapes indices.
5397 # @ref swig_GetSame "Example"
5398 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5400 Get sub-shape indices of theShapeWhere, which is
5401 equal to theShapeWhat.
5404 theShapeWhere Shape to find sub-shape of.
5405 theShapeWhat Shape, specifying what to find.
5408 List of all found sub-shapes indices.
5410 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5411 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5418 ## @addtogroup l4_access
5421 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5422 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5423 # @param aShape Shape to get sub-shape of.
5424 # @param ListOfID List of sub-shapes indices.
5425 # @param theName Object name; when specified, this parameter is used
5426 # for result publication in the study. Otherwise, if automatic
5427 # publication is switched on, default value is used for result name.
5429 # @return Found sub-shape.
5431 # @ref swig_all_decompose "Example"
5432 def GetSubShape(self, aShape, ListOfID, theName=None):
5434 Obtain a composite sub-shape of aShape, composed from sub-shapes
5435 of aShape, selected by their unique IDs inside aShape
5438 aShape Shape to get sub-shape of.
5439 ListOfID List of sub-shapes indices.
5440 theName Object name; when specified, this parameter is used
5441 for result publication in the study. Otherwise, if automatic
5442 publication is switched on, default value is used for result name.
5447 # Example: see GEOM_TestAll.py
5448 anObj = self.AddSubShape(aShape,ListOfID)
5449 self._autoPublish(anObj, theName, "subshape")
5452 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5453 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5454 # @param aShape Shape to get sub-shape of.
5455 # @param aSubShape Sub-shapes of aShape.
5456 # @return ID of found sub-shape.
5458 # @ref swig_all_decompose "Example"
5459 def GetSubShapeID(self, aShape, aSubShape):
5461 Obtain unique ID of sub-shape aSubShape inside aShape
5462 of aShape, selected by their unique IDs inside aShape
5465 aShape Shape to get sub-shape of.
5466 aSubShape Sub-shapes of aShape.
5469 ID of found sub-shape.
5471 # Example: see GEOM_TestAll.py
5472 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5473 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5476 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5477 # This function is provided for performance purpose. The complexity is O(n) with n
5478 # the number of subobjects of aShape
5479 # @param aShape Shape to get sub-shape of.
5480 # @param aSubShapes Sub-shapes of aShape.
5481 # @return list of IDs of found sub-shapes.
5483 # @ref swig_all_decompose "Example"
5484 def GetSubShapesIDs(self, aShape, aSubShapes):
5486 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5487 This function is provided for performance purpose. The complexity is O(n) with n
5488 the number of subobjects of aShape
5491 aShape Shape to get sub-shape of.
5492 aSubShapes Sub-shapes of aShape.
5495 List of IDs of found sub-shape.
5497 # Example: see GEOM_TestAll.py
5498 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5499 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5505 ## @addtogroup l4_decompose
5508 ## Get all sub-shapes and groups of \a theShape,
5509 # that were created already by any other methods.
5510 # @param theShape Any shape.
5511 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5512 # returned, else all found sub-shapes and groups.
5513 # @return List of existing sub-objects of \a theShape.
5515 # @ref swig_all_decompose "Example"
5516 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5518 Get all sub-shapes and groups of theShape,
5519 that were created already by any other methods.
5523 theGroupsOnly If this parameter is TRUE, only groups will be
5524 returned, else all found sub-shapes and groups.
5527 List of existing sub-objects of theShape.
5529 # Example: see GEOM_TestAll.py
5530 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5531 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5534 ## Get all groups of \a theShape,
5535 # that were created already by any other methods.
5536 # @param theShape Any shape.
5537 # @return List of existing groups of \a theShape.
5539 # @ref swig_all_decompose "Example"
5540 def GetGroups(self, theShape):
5542 Get all groups of theShape,
5543 that were created already by any other methods.
5549 List of existing groups of theShape.
5551 # Example: see GEOM_TestAll.py
5552 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5553 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5556 ## Explode a shape on sub-shapes of a given type.
5557 # If the shape itself matches the type, it is also returned.
5558 # @param aShape Shape to be exploded.
5559 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5560 # @param theName Object name; when specified, this parameter is used
5561 # for result publication in the study. Otherwise, if automatic
5562 # publication is switched on, default value is used for result name.
5564 # @return List of sub-shapes of type theShapeType, contained in theShape.
5566 # @ref swig_all_decompose "Example"
5567 def SubShapeAll(self, aShape, aType, theName=None):
5569 Explode a shape on sub-shapes of a given type.
5570 If the shape itself matches the type, it is also returned.
5573 aShape Shape to be exploded.
5574 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5575 theName Object name; when specified, this parameter is used
5576 for result publication in the study. Otherwise, if automatic
5577 publication is switched on, default value is used for result name.
5580 List of sub-shapes of type theShapeType, contained in theShape.
5582 # Example: see GEOM_TestAll.py
5583 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5584 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5585 self._autoPublish(ListObj, theName, "subshape")
5588 ## Explode a shape on sub-shapes of a given type.
5589 # @param aShape Shape to be exploded.
5590 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5591 # @return List of IDs of sub-shapes.
5593 # @ref swig_all_decompose "Example"
5594 def SubShapeAllIDs(self, aShape, aType):
5596 Explode a shape on sub-shapes of a given type.
5599 aShape Shape to be exploded (see geompy.ShapeType)
5600 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5603 List of IDs of sub-shapes.
5605 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5606 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5609 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5610 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5611 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5612 # @param aShape Shape to get sub-shape of.
5613 # @param ListOfInd List of sub-shapes indices.
5614 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5615 # @param theName Object name; when specified, this parameter is used
5616 # for result publication in the study. Otherwise, if automatic
5617 # publication is switched on, default value is used for result name.
5619 # @return A compound of sub-shapes of aShape.
5621 # @ref swig_all_decompose "Example"
5622 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5624 Obtain a compound of sub-shapes of aShape,
5625 selected by their indices in list of all sub-shapes of type aType.
5626 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5629 aShape Shape to get sub-shape of.
5630 ListOfID List of sub-shapes indices.
5631 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5632 theName Object name; when specified, this parameter is used
5633 for result publication in the study. Otherwise, if automatic
5634 publication is switched on, default value is used for result name.
5637 A compound of sub-shapes of aShape.
5639 # Example: see GEOM_TestAll.py
5641 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5642 for ind in ListOfInd:
5643 ListOfIDs.append(AllShapeIDsList[ind - 1])
5644 # note: auto-publishing is done in self.GetSubShape()
5645 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5648 ## Explode a shape on sub-shapes of a given type.
5649 # Sub-shapes will be sorted by coordinates of their gravity centers.
5650 # If the shape itself matches the type, it is also returned.
5651 # @param aShape Shape to be exploded.
5652 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5653 # @param theName Object name; when specified, this parameter is used
5654 # for result publication in the study. Otherwise, if automatic
5655 # publication is switched on, default value is used for result name.
5657 # @return List of sub-shapes of type theShapeType, contained in theShape.
5659 # @ref swig_SubShapeAllSorted "Example"
5660 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5662 Explode a shape on sub-shapes of a given type.
5663 Sub-shapes will be sorted by coordinates of their gravity centers.
5664 If the shape itself matches the type, it is also returned.
5667 aShape Shape to be exploded.
5668 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5669 theName Object name; when specified, this parameter is used
5670 for result publication in the study. Otherwise, if automatic
5671 publication is switched on, default value is used for result name.
5674 List of sub-shapes of type theShapeType, contained in theShape.
5676 # Example: see GEOM_TestAll.py
5677 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5678 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5679 self._autoPublish(ListObj, theName, "subshape")
5682 ## Explode a shape on sub-shapes of a given type.
5683 # Sub-shapes will be sorted by coordinates of their gravity centers.
5684 # @param aShape Shape to be exploded.
5685 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5686 # @return List of IDs of sub-shapes.
5688 # @ref swig_all_decompose "Example"
5689 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5691 Explode a shape on sub-shapes of a given type.
5692 Sub-shapes will be sorted by coordinates of their gravity centers.
5695 aShape Shape to be exploded.
5696 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5699 List of IDs of sub-shapes.
5701 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5702 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5705 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5706 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5707 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5708 # @param aShape Shape to get sub-shape of.
5709 # @param ListOfInd List of sub-shapes indices.
5710 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5711 # @param theName Object name; when specified, this parameter is used
5712 # for result publication in the study. Otherwise, if automatic
5713 # publication is switched on, default value is used for result name.
5715 # @return A compound of sub-shapes of aShape.
5717 # @ref swig_all_decompose "Example"
5718 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5720 Obtain a compound of sub-shapes of aShape,
5721 selected by they indices in sorted list of all sub-shapes of type aType.
5722 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5725 aShape Shape to get sub-shape of.
5726 ListOfID List of sub-shapes indices.
5727 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5728 theName Object name; when specified, this parameter is used
5729 for result publication in the study. Otherwise, if automatic
5730 publication is switched on, default value is used for result name.
5733 A compound of sub-shapes of aShape.
5735 # Example: see GEOM_TestAll.py
5737 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5738 for ind in ListOfInd:
5739 ListOfIDs.append(AllShapeIDsList[ind - 1])
5740 # note: auto-publishing is done in self.GetSubShape()
5741 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5744 ## Extract shapes (excluding the main shape) of given type.
5745 # @param aShape The shape.
5746 # @param aType The shape type (see ShapeType())
5747 # @param isSorted Boolean flag to switch sorting on/off.
5748 # @param theName Object name; when specified, this parameter is used
5749 # for result publication in the study. Otherwise, if automatic
5750 # publication is switched on, default value is used for result name.
5752 # @return List of sub-shapes of type aType, contained in aShape.
5754 # @ref swig_FilletChamfer "Example"
5755 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5757 Extract shapes (excluding the main shape) of given type.
5761 aType The shape type (see geompy.ShapeType)
5762 isSorted Boolean flag to switch sorting on/off.
5763 theName Object name; when specified, this parameter is used
5764 for result publication in the study. Otherwise, if automatic
5765 publication is switched on, default value is used for result name.
5768 List of sub-shapes of type aType, contained in aShape.
5770 # Example: see GEOM_TestAll.py
5771 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5772 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5773 self._autoPublish(ListObj, theName, "subshape")
5776 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5777 # @param aShape Main shape.
5778 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5779 # @param theName Object name; when specified, this parameter is used
5780 # for result publication in the study. Otherwise, if automatic
5781 # publication is switched on, default value is used for result name.
5782 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5784 # @ref swig_all_decompose "Example"
5785 def SubShapes(self, aShape, anIDs, theName=None):
5787 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5791 anIDs List of unique IDs of sub-shapes inside theMainShape.
5792 theName Object name; when specified, this parameter is used
5793 for result publication in the study. Otherwise, if automatic
5794 publication is switched on, default value is used for result name.
5797 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5799 # Example: see GEOM_TestAll.py
5800 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5801 RaiseIfFailed("SubShapes", self.ShapesOp)
5802 self._autoPublish(ListObj, theName, "subshape")
5805 # end of l4_decompose
5808 ## @addtogroup l4_decompose_d
5811 ## Deprecated method
5812 # It works like SubShapeAllSortedCentres(), but wrongly
5813 # defines centres of faces, shells and solids.
5814 def SubShapeAllSorted(self, aShape, aType, theName=None):
5817 It works like geompy.SubShapeAllSortedCentres, but wrongly
5818 defines centres of faces, shells and solids.
5820 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5821 RaiseIfFailed("MakeExplode", self.ShapesOp)
5822 self._autoPublish(ListObj, theName, "subshape")
5825 ## Deprecated method
5826 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5827 # defines centres of faces, shells and solids.
5828 def SubShapeAllSortedIDs(self, aShape, aType):
5831 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5832 defines centres of faces, shells and solids.
5834 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5835 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5838 ## Deprecated method
5839 # It works like SubShapeSortedCentres(), but has a bug
5840 # (wrongly defines centres of faces, shells and solids).
5841 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5844 It works like geompy.SubShapeSortedCentres, but has a bug
5845 (wrongly defines centres of faces, shells and solids).
5848 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5849 for ind in ListOfInd:
5850 ListOfIDs.append(AllShapeIDsList[ind - 1])
5851 # note: auto-publishing is done in self.GetSubShape()
5852 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5855 # end of l4_decompose_d
5858 ## @addtogroup l3_healing
5861 ## Apply a sequence of Shape Healing operators to the given object.
5862 # @param theShape Shape to be processed.
5863 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5864 # @param theParameters List of names of parameters
5865 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5866 # @param theValues List of values of parameters, in the same order
5867 # as parameters are listed in <VAR>theParameters</VAR> list.
5868 # @param theName Object name; when specified, this parameter is used
5869 # for result publication in the study. Otherwise, if automatic
5870 # publication is switched on, default value is used for result name.
5872 # <b> Operators and Parameters: </b> \n
5874 # * \b FixShape - corrects invalid shapes. \n
5875 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5876 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5878 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5879 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5880 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5881 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5883 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5884 # surfaces in segments using a certain angle. \n
5885 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5886 # if Angle=180, four if Angle=90, etc). \n
5887 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5889 # * \b SplitClosedFaces - splits closed faces in segments.
5890 # The number of segments depends on the number of splitting points.\n
5891 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5893 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5894 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5895 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5896 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5897 # This and the previous parameters can take the following values:\n
5898 # \b Parametric \b Continuity \n
5899 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5900 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5901 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5902 # ruling out sharp edges).\n
5903 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5904 # are of the same magnitude).\n
5905 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5906 # or surfaces (d/du C(u)) are the same at junction. \n
5907 # \b Geometric \b Continuity \n
5908 # \b G1: first derivatives are proportional at junction.\n
5909 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5910 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5911 # \b G2: first and second derivatives are proportional at junction.
5912 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5913 # continuity requires that the underlying parameterization was continuous as well.
5914 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5916 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5917 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5918 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5919 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5920 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5921 # with the specified parameters.\n
5922 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5923 # with the specified parameters.\n
5924 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5925 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5926 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5927 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5929 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5930 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5931 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5932 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5933 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5935 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5936 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5939 # @return New GEOM.GEOM_Object, containing processed shape.
5941 # \n @ref tui_shape_processing "Example"
5942 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5944 Apply a sequence of Shape Healing operators to the given object.
5947 theShape Shape to be processed.
5948 theValues List of values of parameters, in the same order
5949 as parameters are listed in theParameters list.
5950 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5951 theParameters List of names of parameters
5952 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5953 theName Object name; when specified, this parameter is used
5954 for result publication in the study. Otherwise, if automatic
5955 publication is switched on, default value is used for result name.
5957 Operators and Parameters:
5959 * FixShape - corrects invalid shapes.
5960 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5961 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5962 * FixFaceSize - removes small faces, such as spots and strips.
5963 * FixFaceSize.Tolerance - defines minimum possible face size.
5964 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5965 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5966 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5967 in segments using a certain angle.
5968 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5969 if Angle=180, four if Angle=90, etc).
5970 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5971 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5973 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5974 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5975 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5976 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5977 * SplitContinuity.CurveContinuity - required continuity for curves.
5978 This and the previous parameters can take the following values:
5980 Parametric Continuity:
5981 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5982 coincidental. The curves or surfaces may still meet at an angle,
5983 giving rise to a sharp corner or edge).
5984 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5985 are parallel, ruling out sharp edges).
5986 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5987 or surfaces are of the same magnitude).
5988 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5989 curves or surfaces (d/du C(u)) are the same at junction.
5991 Geometric Continuity:
5992 G1: first derivatives are proportional at junction.
5993 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5994 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5995 G2: first and second derivatives are proportional at junction. As the names imply,
5996 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5997 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5998 geometric continuity of order n, but not vice-versa.
5999 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6000 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6001 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6002 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6003 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6004 the specified parameters.
6005 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6006 the specified parameters.
6007 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6008 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6009 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6010 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6011 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6012 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6013 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6014 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6015 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6016 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6017 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6020 New GEOM.GEOM_Object, containing processed shape.
6022 Note: For more information look through SALOME Geometry User's Guide->
6023 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6025 # Example: see GEOM_TestHealing.py
6026 theValues,Parameters = ParseList(theValues)
6027 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6028 # To avoid script failure in case of good argument shape
6029 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6031 RaiseIfFailed("ProcessShape", self.HealOp)
6032 for string in (theOperators + theParameters):
6033 Parameters = ":" + Parameters
6035 anObj.SetParameters(Parameters)
6036 self._autoPublish(anObj, theName, "healed")
6039 ## Remove faces from the given object (shape).
6040 # @param theObject Shape to be processed.
6041 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6042 # removes ALL faces of the given object.
6043 # @param theName Object name; when specified, this parameter is used
6044 # for result publication in the study. Otherwise, if automatic
6045 # publication is switched on, default value is used for result name.
6047 # @return New GEOM.GEOM_Object, containing processed shape.
6049 # @ref tui_suppress_faces "Example"
6050 def SuppressFaces(self, theObject, theFaces, theName=None):
6052 Remove faces from the given object (shape).
6055 theObject Shape to be processed.
6056 theFaces Indices of faces to be removed, if EMPTY then the method
6057 removes ALL faces of the given object.
6058 theName Object name; when specified, this parameter is used
6059 for result publication in the study. Otherwise, if automatic
6060 publication is switched on, default value is used for result name.
6063 New GEOM.GEOM_Object, containing processed shape.
6065 # Example: see GEOM_TestHealing.py
6066 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6067 RaiseIfFailed("SuppressFaces", self.HealOp)
6068 self._autoPublish(anObj, theName, "suppressFaces")
6071 ## Sewing of some shapes into single shape.
6072 # @param ListShape Shapes to be processed.
6073 # @param theTolerance Required tolerance value.
6074 # @param AllowNonManifold Flag that allows non-manifold sewing.
6075 # @param theName Object name; when specified, this parameter is used
6076 # for result publication in the study. Otherwise, if automatic
6077 # publication is switched on, default value is used for result name.
6079 # @return New GEOM.GEOM_Object, containing processed shape.
6081 # @ref tui_sewing "Example"
6082 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6084 Sewing of some shapes into single shape.
6087 ListShape Shapes to be processed.
6088 theTolerance Required tolerance value.
6089 AllowNonManifold Flag that allows non-manifold sewing.
6090 theName Object name; when specified, this parameter is used
6091 for result publication in the study. Otherwise, if automatic
6092 publication is switched on, default value is used for result name.
6095 New GEOM.GEOM_Object, containing processed shape.
6097 # Example: see GEOM_TestHealing.py
6098 comp = self.MakeCompound(ListShape)
6099 # note: auto-publishing is done in self.Sew()
6100 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6103 ## Sewing of the given object.
6104 # @param theObject Shape to be processed.
6105 # @param theTolerance Required tolerance value.
6106 # @param AllowNonManifold Flag that allows non-manifold sewing.
6107 # @param theName Object name; when specified, this parameter is used
6108 # for result publication in the study. Otherwise, if automatic
6109 # publication is switched on, default value is used for result name.
6111 # @return New GEOM.GEOM_Object, containing processed shape.
6112 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6114 Sewing of the given object.
6117 theObject Shape to be processed.
6118 theTolerance Required tolerance value.
6119 AllowNonManifold Flag that allows non-manifold sewing.
6120 theName Object name; when specified, this parameter is used
6121 for result publication in the study. Otherwise, if automatic
6122 publication is switched on, default value is used for result name.
6125 New GEOM.GEOM_Object, containing processed shape.
6127 # Example: see MakeSewing() above
6128 theTolerance,Parameters = ParseParameters(theTolerance)
6129 if AllowNonManifold:
6130 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6132 anObj = self.HealOp.Sew(theObject, theTolerance)
6133 # To avoid script failure in case of good argument shape
6134 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6136 RaiseIfFailed("Sew", self.HealOp)
6137 anObj.SetParameters(Parameters)
6138 self._autoPublish(anObj, theName, "sewed")
6141 ## Rebuild the topology of theCompound of solids by removing
6142 # of the faces that are shared by several solids.
6143 # @param theCompound Shape to be processed.
6144 # @param theName Object name; when specified, this parameter is used
6145 # for result publication in the study. Otherwise, if automatic
6146 # publication is switched on, default value is used for result name.
6148 # @return New GEOM.GEOM_Object, containing processed shape.
6150 # @ref tui_remove_webs "Example"
6151 def RemoveInternalFaces (self, theCompound, theName=None):
6153 Rebuild the topology of theCompound of solids by removing
6154 of the faces that are shared by several solids.
6157 theCompound Shape to be processed.
6158 theName Object name; when specified, this parameter is used
6159 for result publication in the study. Otherwise, if automatic
6160 publication is switched on, default value is used for result name.
6163 New GEOM.GEOM_Object, containing processed shape.
6165 # Example: see GEOM_TestHealing.py
6166 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6167 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6168 self._autoPublish(anObj, theName, "removeWebs")
6171 ## Remove internal wires and edges from the given object (face).
6172 # @param theObject Shape to be processed.
6173 # @param theWires Indices of wires to be removed, if EMPTY then the method
6174 # removes ALL internal wires of the given object.
6175 # @param theName Object name; when specified, this parameter is used
6176 # for result publication in the study. Otherwise, if automatic
6177 # publication is switched on, default value is used for result name.
6179 # @return New GEOM.GEOM_Object, containing processed shape.
6181 # @ref tui_suppress_internal_wires "Example"
6182 def SuppressInternalWires(self, theObject, theWires, theName=None):
6184 Remove internal wires and edges from the given object (face).
6187 theObject Shape to be processed.
6188 theWires Indices of wires to be removed, if EMPTY then the method
6189 removes ALL internal wires of the given object.
6190 theName Object name; when specified, this parameter is used
6191 for result publication in the study. Otherwise, if automatic
6192 publication is switched on, default value is used for result name.
6195 New GEOM.GEOM_Object, containing processed shape.
6197 # Example: see GEOM_TestHealing.py
6198 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6199 RaiseIfFailed("RemoveIntWires", self.HealOp)
6200 self._autoPublish(anObj, theName, "suppressWires")
6203 ## Remove internal closed contours (holes) from the given object.
6204 # @param theObject Shape to be processed.
6205 # @param theWires Indices of wires to be removed, if EMPTY then the method
6206 # removes ALL internal holes of the given object
6207 # @param theName Object name; when specified, this parameter is used
6208 # for result publication in the study. Otherwise, if automatic
6209 # publication is switched on, default value is used for result name.
6211 # @return New GEOM.GEOM_Object, containing processed shape.
6213 # @ref tui_suppress_holes "Example"
6214 def SuppressHoles(self, theObject, theWires, theName=None):
6216 Remove internal closed contours (holes) from the given object.
6219 theObject Shape to be processed.
6220 theWires Indices of wires to be removed, if EMPTY then the method
6221 removes ALL internal holes of the given object
6222 theName Object name; when specified, this parameter is used
6223 for result publication in the study. Otherwise, if automatic
6224 publication is switched on, default value is used for result name.
6227 New GEOM.GEOM_Object, containing processed shape.
6229 # Example: see GEOM_TestHealing.py
6230 anObj = self.HealOp.FillHoles(theObject, theWires)
6231 RaiseIfFailed("FillHoles", self.HealOp)
6232 self._autoPublish(anObj, theName, "suppressHoles")
6235 ## Close an open wire.
6236 # @param theObject Shape to be processed.
6237 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6238 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6239 # @param isCommonVertex If True : closure by creation of a common vertex,
6240 # If False : closure by creation of an edge between ends.
6241 # @param theName Object name; when specified, this parameter is used
6242 # for result publication in the study. Otherwise, if automatic
6243 # publication is switched on, default value is used for result name.
6245 # @return New GEOM.GEOM_Object, containing processed shape.
6247 # @ref tui_close_contour "Example"
6248 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6253 theObject Shape to be processed.
6254 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6255 if [ ], then theObject itself is a wire.
6256 isCommonVertex If True : closure by creation of a common vertex,
6257 If False : closure by creation of an edge between ends.
6258 theName Object name; when specified, this parameter is used
6259 for result publication in the study. Otherwise, if automatic
6260 publication is switched on, default value is used for result name.
6263 New GEOM.GEOM_Object, containing processed shape.
6265 # Example: see GEOM_TestHealing.py
6266 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6267 RaiseIfFailed("CloseContour", self.HealOp)
6268 self._autoPublish(anObj, theName, "closeContour")
6271 ## Addition of a point to a given edge object.
6272 # @param theObject Shape to be processed.
6273 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6274 # if -1, then theObject itself is the edge.
6275 # @param theValue Value of parameter on edge or length parameter,
6276 # depending on \a isByParameter.
6277 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6278 # if FALSE : \a theValue is treated as a length parameter [0..1]
6279 # @param theName Object name; when specified, this parameter is used
6280 # for result publication in the study. Otherwise, if automatic
6281 # publication is switched on, default value is used for result name.
6283 # @return New GEOM.GEOM_Object, containing processed shape.
6285 # @ref tui_add_point_on_edge "Example"
6286 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6288 Addition of a point to a given edge object.
6291 theObject Shape to be processed.
6292 theEdgeIndex Index of edge to be divided within theObject's shape,
6293 if -1, then theObject itself is the edge.
6294 theValue Value of parameter on edge or length parameter,
6295 depending on isByParameter.
6296 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6297 if FALSE : theValue is treated as a length parameter [0..1]
6298 theName Object name; when specified, this parameter is used
6299 for result publication in the study. Otherwise, if automatic
6300 publication is switched on, default value is used for result name.
6303 New GEOM.GEOM_Object, containing processed shape.
6305 # Example: see GEOM_TestHealing.py
6306 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6307 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6308 RaiseIfFailed("DivideEdge", self.HealOp)
6309 anObj.SetParameters(Parameters)
6310 self._autoPublish(anObj, theName, "divideEdge")
6313 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6314 # @param theWire Wire to minimize the number of C1 continuous edges in.
6315 # @param theVertices A list of vertices to suppress. If the list
6316 # is empty, all vertices in a wire will be assumed.
6317 # @param theName Object name; when specified, this parameter is used
6318 # for result publication in the study. Otherwise, if automatic
6319 # publication is switched on, default value is used for result name.
6321 # @return New GEOM.GEOM_Object with modified wire.
6323 # @ref tui_fuse_collinear_edges "Example"
6324 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6326 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6329 theWire Wire to minimize the number of C1 continuous edges in.
6330 theVertices A list of vertices to suppress. If the list
6331 is empty, all vertices in a wire will be assumed.
6332 theName Object name; when specified, this parameter is used
6333 for result publication in the study. Otherwise, if automatic
6334 publication is switched on, default value is used for result name.
6337 New GEOM.GEOM_Object with modified wire.
6339 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6340 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6341 self._autoPublish(anObj, theName, "fuseEdges")
6344 ## Change orientation of the given object. Updates given shape.
6345 # @param theObject Shape to be processed.
6346 # @return Updated <var>theObject</var>
6348 # @ref swig_todo "Example"
6349 def ChangeOrientationShell(self,theObject):
6351 Change orientation of the given object. Updates given shape.
6354 theObject Shape to be processed.
6359 theObject = self.HealOp.ChangeOrientation(theObject)
6360 RaiseIfFailed("ChangeOrientation", self.HealOp)
6363 ## Change orientation of the given object.
6364 # @param theObject Shape to be processed.
6365 # @param theName Object name; when specified, this parameter is used
6366 # for result publication in the study. Otherwise, if automatic
6367 # publication is switched on, default value is used for result name.
6369 # @return New GEOM.GEOM_Object, containing processed shape.
6371 # @ref swig_todo "Example"
6372 def ChangeOrientationShellCopy(self, theObject, theName=None):
6374 Change orientation of the given object.
6377 theObject Shape to be processed.
6378 theName Object name; when specified, this parameter is used
6379 for result publication in the study. Otherwise, if automatic
6380 publication is switched on, default value is used for result name.
6383 New GEOM.GEOM_Object, containing processed shape.
6385 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6386 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6387 self._autoPublish(anObj, theName, "reversed")
6390 ## Try to limit tolerance of the given object by value \a theTolerance.
6391 # @param theObject Shape to be processed.
6392 # @param theTolerance Required tolerance value.
6393 # @param theName Object name; when specified, this parameter is used
6394 # for result publication in the study. Otherwise, if automatic
6395 # publication is switched on, default value is used for result name.
6397 # @return New GEOM.GEOM_Object, containing processed shape.
6399 # @ref tui_limit_tolerance "Example"
6400 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6402 Try to limit tolerance of the given object by value theTolerance.
6405 theObject Shape to be processed.
6406 theTolerance Required tolerance value.
6407 theName Object name; when specified, this parameter is used
6408 for result publication in the study. Otherwise, if automatic
6409 publication is switched on, default value is used for result name.
6412 New GEOM.GEOM_Object, containing processed shape.
6414 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6415 RaiseIfFailed("LimitTolerance", self.HealOp)
6416 self._autoPublish(anObj, theName, "limitTolerance")
6419 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6420 # that constitute a free boundary of the given shape.
6421 # @param theObject Shape to get free boundary of.
6422 # @param theName Object name; when specified, this parameter is used
6423 # for result publication in the study. Otherwise, if automatic
6424 # publication is switched on, default value is used for result name.
6426 # @return [\a status, \a theClosedWires, \a theOpenWires]
6427 # \n \a status: FALSE, if an error(s) occured during the method execution.
6428 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6429 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6431 # @ref tui_measurement_tools_page "Example"
6432 def GetFreeBoundary(self, theObject, theName=None):
6434 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6435 that constitute a free boundary of the given shape.
6438 theObject Shape to get free boundary of.
6439 theName Object name; when specified, this parameter is used
6440 for result publication in the study. Otherwise, if automatic
6441 publication is switched on, default value is used for result name.
6444 [status, theClosedWires, theOpenWires]
6445 status: FALSE, if an error(s) occured during the method execution.
6446 theClosedWires: Closed wires on the free boundary of the given shape.
6447 theOpenWires: Open wires on the free boundary of the given shape.
6449 # Example: see GEOM_TestHealing.py
6450 anObj = self.HealOp.GetFreeBoundary(theObject)
6451 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6452 self._autoPublish(anObj[1], theName, "closedWire")
6453 self._autoPublish(anObj[2], theName, "openWire")
6456 ## Replace coincident faces in theShape by one face.
6457 # @param theShape Initial shape.
6458 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6459 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6460 # otherwise all initial shapes.
6461 # @param theName Object name; when specified, this parameter is used
6462 # for result publication in the study. Otherwise, if automatic
6463 # publication is switched on, default value is used for result name.
6465 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6467 # @ref tui_glue_faces "Example"
6468 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6470 Replace coincident faces in theShape by one face.
6473 theShape Initial shape.
6474 theTolerance Maximum distance between faces, which can be considered as coincident.
6475 doKeepNonSolids If FALSE, only solids will present in the result,
6476 otherwise all initial shapes.
6477 theName Object name; when specified, this parameter is used
6478 for result publication in the study. Otherwise, if automatic
6479 publication is switched on, default value is used for result name.
6482 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6484 # Example: see GEOM_Spanner.py
6485 theTolerance,Parameters = ParseParameters(theTolerance)
6486 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6488 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6489 anObj.SetParameters(Parameters)
6490 self._autoPublish(anObj, theName, "glueFaces")
6493 ## Find coincident faces in theShape for possible gluing.
6494 # @param theShape Initial shape.
6495 # @param theTolerance Maximum distance between faces,
6496 # which can be considered as coincident.
6497 # @param theName Object name; when specified, this parameter is used
6498 # for result publication in the study. Otherwise, if automatic
6499 # publication is switched on, default value is used for result name.
6501 # @return GEOM.ListOfGO
6503 # @ref tui_glue_faces "Example"
6504 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6506 Find coincident faces in theShape for possible gluing.
6509 theShape Initial shape.
6510 theTolerance Maximum distance between faces,
6511 which can be considered as coincident.
6512 theName Object name; when specified, this parameter is used
6513 for result publication in the study. Otherwise, if automatic
6514 publication is switched on, default value is used for result name.
6519 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6520 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6521 self._autoPublish(anObj, theName, "facesToGlue")
6524 ## Replace coincident faces in theShape by one face
6525 # in compliance with given list of faces
6526 # @param theShape Initial shape.
6527 # @param theTolerance Maximum distance between faces,
6528 # which can be considered as coincident.
6529 # @param theFaces List of faces for gluing.
6530 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6531 # otherwise all initial shapes.
6532 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6533 # will be glued, otherwise only the edges,
6534 # belonging to <VAR>theFaces</VAR>.
6535 # @param theName Object name; when specified, this parameter is used
6536 # for result publication in the study. Otherwise, if automatic
6537 # publication is switched on, default value is used for result name.
6539 # @return New GEOM.GEOM_Object, containing a copy of theShape
6540 # without some faces.
6542 # @ref tui_glue_faces "Example"
6543 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6544 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6546 Replace coincident faces in theShape by one face
6547 in compliance with given list of faces
6550 theShape Initial shape.
6551 theTolerance Maximum distance between faces,
6552 which can be considered as coincident.
6553 theFaces List of faces for gluing.
6554 doKeepNonSolids If FALSE, only solids will present in the result,
6555 otherwise all initial shapes.
6556 doGlueAllEdges If TRUE, all coincident edges of theShape
6557 will be glued, otherwise only the edges,
6558 belonging to theFaces.
6559 theName Object name; when specified, this parameter is used
6560 for result publication in the study. Otherwise, if automatic
6561 publication is switched on, default value is used for result name.
6564 New GEOM.GEOM_Object, containing a copy of theShape
6567 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6568 doKeepNonSolids, doGlueAllEdges)
6570 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6571 self._autoPublish(anObj, theName, "glueFaces")
6574 ## Replace coincident edges in theShape by one edge.
6575 # @param theShape Initial shape.
6576 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6577 # @param theName Object name; when specified, this parameter is used
6578 # for result publication in the study. Otherwise, if automatic
6579 # publication is switched on, default value is used for result name.
6581 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6583 # @ref tui_glue_edges "Example"
6584 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6586 Replace coincident edges in theShape by one edge.
6589 theShape Initial shape.
6590 theTolerance Maximum distance between edges, which can be considered as coincident.
6591 theName Object name; when specified, this parameter is used
6592 for result publication in the study. Otherwise, if automatic
6593 publication is switched on, default value is used for result name.
6596 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6598 theTolerance,Parameters = ParseParameters(theTolerance)
6599 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6601 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6602 anObj.SetParameters(Parameters)
6603 self._autoPublish(anObj, theName, "glueEdges")
6606 ## Find coincident edges in theShape for possible gluing.
6607 # @param theShape Initial shape.
6608 # @param theTolerance Maximum distance between edges,
6609 # which can be considered as coincident.
6610 # @param theName Object name; when specified, this parameter is used
6611 # for result publication in the study. Otherwise, if automatic
6612 # publication is switched on, default value is used for result name.
6614 # @return GEOM.ListOfGO
6616 # @ref tui_glue_edges "Example"
6617 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6619 Find coincident edges in theShape for possible gluing.
6622 theShape Initial shape.
6623 theTolerance Maximum distance between edges,
6624 which can be considered as coincident.
6625 theName Object name; when specified, this parameter is used
6626 for result publication in the study. Otherwise, if automatic
6627 publication is switched on, default value is used for result name.
6632 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6633 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6634 self._autoPublish(anObj, theName, "edgesToGlue")
6637 ## Replace coincident edges in theShape by one edge
6638 # in compliance with given list of edges.
6639 # @param theShape Initial shape.
6640 # @param theTolerance Maximum distance between edges,
6641 # which can be considered as coincident.
6642 # @param theEdges List of edges for gluing.
6643 # @param theName Object name; when specified, this parameter is used
6644 # for result publication in the study. Otherwise, if automatic
6645 # publication is switched on, default value is used for result name.
6647 # @return New GEOM.GEOM_Object, containing a copy of theShape
6648 # without some edges.
6650 # @ref tui_glue_edges "Example"
6651 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6653 Replace coincident edges in theShape by one edge
6654 in compliance with given list of edges.
6657 theShape Initial shape.
6658 theTolerance Maximum distance between edges,
6659 which can be considered as coincident.
6660 theEdges List of edges for gluing.
6661 theName Object name; when specified, this parameter is used
6662 for result publication in the study. Otherwise, if automatic
6663 publication is switched on, default value is used for result name.
6666 New GEOM.GEOM_Object, containing a copy of theShape
6669 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6671 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6672 self._autoPublish(anObj, theName, "glueEdges")
6678 ## @addtogroup l3_boolean Boolean Operations
6681 # -----------------------------------------------------------------------------
6682 # Boolean (Common, Cut, Fuse, Section)
6683 # -----------------------------------------------------------------------------
6685 ## Perform one of boolean operations on two given shapes.
6686 # @param theShape1 First argument for boolean operation.
6687 # @param theShape2 Second argument for boolean operation.
6688 # @param theOperation Indicates the operation to be done:\n
6689 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6690 # @param checkSelfInte The flag that tells if the arguments should
6691 # be checked for self-intersection prior to the operation.
6692 # @param theName Object name; when specified, this parameter is used
6693 # for result publication in the study. Otherwise, if automatic
6694 # publication is switched on, default value is used for result name.
6696 # @note This algorithm doesn't find all types of self-intersections.
6697 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6698 # vertex/face and edge/face intersections. Face/face
6699 # intersections detection is switched off as it is a
6700 # time-consuming operation that gives an impact on performance.
6701 # To find all self-intersections please use
6702 # CheckSelfIntersections() method.
6704 # @return New GEOM.GEOM_Object, containing the result shape.
6706 # @ref tui_fuse "Example"
6707 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6709 Perform one of boolean operations on two given shapes.
6712 theShape1 First argument for boolean operation.
6713 theShape2 Second argument for boolean operation.
6714 theOperation Indicates the operation to be done:
6715 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6716 checkSelfInte The flag that tells if the arguments should
6717 be checked for self-intersection prior to
6719 theName Object name; when specified, this parameter is used
6720 for result publication in the study. Otherwise, if automatic
6721 publication is switched on, default value is used for result name.
6724 This algorithm doesn't find all types of self-intersections.
6725 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6726 vertex/face and edge/face intersections. Face/face
6727 intersections detection is switched off as it is a
6728 time-consuming operation that gives an impact on performance.
6729 To find all self-intersections please use
6730 CheckSelfIntersections() method.
6733 New GEOM.GEOM_Object, containing the result shape.
6735 # Example: see GEOM_TestAll.py
6736 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6737 RaiseIfFailed("MakeBoolean", self.BoolOp)
6738 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6739 self._autoPublish(anObj, theName, def_names[theOperation])
6742 ## Perform Common boolean operation on two given shapes.
6743 # @param theShape1 First argument for boolean operation.
6744 # @param theShape2 Second argument for boolean operation.
6745 # @param checkSelfInte The flag that tells if the arguments should
6746 # be checked for self-intersection prior to the operation.
6747 # @param theName Object name; when specified, this parameter is used
6748 # for result publication in the study. Otherwise, if automatic
6749 # publication is switched on, default value is used for result name.
6751 # @note This algorithm doesn't find all types of self-intersections.
6752 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6753 # vertex/face and edge/face intersections. Face/face
6754 # intersections detection is switched off as it is a
6755 # time-consuming operation that gives an impact on performance.
6756 # To find all self-intersections please use
6757 # CheckSelfIntersections() method.
6759 # @return New GEOM.GEOM_Object, containing the result shape.
6761 # @ref tui_common "Example 1"
6762 # \n @ref swig_MakeCommon "Example 2"
6763 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6765 Perform Common boolean operation on two given shapes.
6768 theShape1 First argument for boolean operation.
6769 theShape2 Second argument for boolean operation.
6770 checkSelfInte The flag that tells if the arguments should
6771 be checked for self-intersection prior to
6773 theName Object name; when specified, this parameter is used
6774 for result publication in the study. Otherwise, if automatic
6775 publication is switched on, default value is used for result name.
6778 This algorithm doesn't find all types of self-intersections.
6779 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6780 vertex/face and edge/face intersections. Face/face
6781 intersections detection is switched off as it is a
6782 time-consuming operation that gives an impact on performance.
6783 To find all self-intersections please use
6784 CheckSelfIntersections() method.
6787 New GEOM.GEOM_Object, containing the result shape.
6789 # Example: see GEOM_TestOthers.py
6790 # note: auto-publishing is done in self.MakeBoolean()
6791 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6793 ## Perform Cut boolean operation on two given shapes.
6794 # @param theShape1 First argument for boolean operation.
6795 # @param theShape2 Second argument for boolean operation.
6796 # @param checkSelfInte The flag that tells if the arguments should
6797 # be checked for self-intersection prior to the operation.
6798 # @param theName Object name; when specified, this parameter is used
6799 # for result publication in the study. Otherwise, if automatic
6800 # publication is switched on, default value is used for result name.
6802 # @note This algorithm doesn't find all types of self-intersections.
6803 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6804 # vertex/face and edge/face intersections. Face/face
6805 # intersections detection is switched off as it is a
6806 # time-consuming operation that gives an impact on performance.
6807 # To find all self-intersections please use
6808 # CheckSelfIntersections() method.
6810 # @return New GEOM.GEOM_Object, containing the result shape.
6812 # @ref tui_cut "Example 1"
6813 # \n @ref swig_MakeCommon "Example 2"
6814 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6816 Perform Cut boolean operation on two given shapes.
6819 theShape1 First argument for boolean operation.
6820 theShape2 Second argument for boolean operation.
6821 checkSelfInte The flag that tells if the arguments should
6822 be checked for self-intersection prior to
6824 theName Object name; when specified, this parameter is used
6825 for result publication in the study. Otherwise, if automatic
6826 publication is switched on, default value is used for result name.
6829 This algorithm doesn't find all types of self-intersections.
6830 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6831 vertex/face and edge/face intersections. Face/face
6832 intersections detection is switched off as it is a
6833 time-consuming operation that gives an impact on performance.
6834 To find all self-intersections please use
6835 CheckSelfIntersections() method.
6838 New GEOM.GEOM_Object, containing the result shape.
6841 # Example: see GEOM_TestOthers.py
6842 # note: auto-publishing is done in self.MakeBoolean()
6843 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
6845 ## Perform Fuse boolean operation on two given shapes.
6846 # @param theShape1 First argument for boolean operation.
6847 # @param theShape2 Second argument for boolean operation.
6848 # @param checkSelfInte The flag that tells if the arguments should
6849 # be checked for self-intersection prior to the operation.
6850 # @param rmExtraEdges The flag that tells if Remove Extra Edges
6851 # operation should be performed during the operation.
6852 # @param theName Object name; when specified, this parameter is used
6853 # for result publication in the study. Otherwise, if automatic
6854 # publication is switched on, default value is used for result name.
6856 # @note This algorithm doesn't find all types of self-intersections.
6857 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6858 # vertex/face and edge/face intersections. Face/face
6859 # intersections detection is switched off as it is a
6860 # time-consuming operation that gives an impact on performance.
6861 # To find all self-intersections please use
6862 # CheckSelfIntersections() method.
6864 # @return New GEOM.GEOM_Object, containing the result shape.
6866 # @ref tui_fuse "Example 1"
6867 # \n @ref swig_MakeCommon "Example 2"
6868 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
6869 rmExtraEdges=False, theName=None):
6871 Perform Fuse boolean operation on two given shapes.
6874 theShape1 First argument for boolean operation.
6875 theShape2 Second argument for boolean operation.
6876 checkSelfInte The flag that tells if the arguments should
6877 be checked for self-intersection prior to
6879 rmExtraEdges The flag that tells if Remove Extra Edges
6880 operation should be performed during the operation.
6881 theName Object name; when specified, this parameter is used
6882 for result publication in the study. Otherwise, if automatic
6883 publication is switched on, default value is used for result name.
6886 This algorithm doesn't find all types of self-intersections.
6887 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6888 vertex/face and edge/face intersections. Face/face
6889 intersections detection is switched off as it is a
6890 time-consuming operation that gives an impact on performance.
6891 To find all self-intersections please use
6892 CheckSelfIntersections() method.
6895 New GEOM.GEOM_Object, containing the result shape.
6898 # Example: see GEOM_TestOthers.py
6899 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
6900 checkSelfInte, rmExtraEdges)
6901 RaiseIfFailed("MakeFuse", self.BoolOp)
6902 self._autoPublish(anObj, theName, "fuse")
6905 ## Perform Section boolean operation on two given shapes.
6906 # @param theShape1 First argument for boolean operation.
6907 # @param theShape2 Second argument for boolean operation.
6908 # @param checkSelfInte The flag that tells if the arguments should
6909 # be checked for self-intersection prior to the operation.
6910 # @param theName Object name; when specified, this parameter is used
6911 # for result publication in the study. Otherwise, if automatic
6912 # publication is switched on, default value is used for result name.
6914 # @note This algorithm doesn't find all types of self-intersections.
6915 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6916 # vertex/face and edge/face intersections. Face/face
6917 # intersections detection is switched off as it is a
6918 # time-consuming operation that gives an impact on performance.
6919 # To find all self-intersections please use
6920 # CheckSelfIntersections() method.
6922 # @return New GEOM.GEOM_Object, containing the result shape.
6924 # @ref tui_section "Example 1"
6925 # \n @ref swig_MakeCommon "Example 2"
6926 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6928 Perform Section boolean operation on two given shapes.
6931 theShape1 First argument for boolean operation.
6932 theShape2 Second argument for boolean operation.
6933 checkSelfInte The flag that tells if the arguments should
6934 be checked for self-intersection prior to
6936 theName Object name; when specified, this parameter is used
6937 for result publication in the study. Otherwise, if automatic
6938 publication is switched on, default value is used for result name.
6941 This algorithm doesn't find all types of self-intersections.
6942 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6943 vertex/face and edge/face intersections. Face/face
6944 intersections detection is switched off as it is a
6945 time-consuming operation that gives an impact on performance.
6946 To find all self-intersections please use
6947 CheckSelfIntersections() method.
6950 New GEOM.GEOM_Object, containing the result shape.
6953 # Example: see GEOM_TestOthers.py
6954 # note: auto-publishing is done in self.MakeBoolean()
6955 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
6957 ## Perform Fuse boolean operation on the list of shapes.
6958 # @param theShapesList Shapes to be fused.
6959 # @param checkSelfInte The flag that tells if the arguments should
6960 # be checked for self-intersection prior to the operation.
6961 # @param rmExtraEdges The flag that tells if Remove Extra Edges
6962 # operation should be performed during the operation.
6963 # @param theName Object name; when specified, this parameter is used
6964 # for result publication in the study. Otherwise, if automatic
6965 # publication is switched on, default value is used for result name.
6967 # @note This algorithm doesn't find all types of self-intersections.
6968 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6969 # vertex/face and edge/face intersections. Face/face
6970 # intersections detection is switched off as it is a
6971 # time-consuming operation that gives an impact on performance.
6972 # To find all self-intersections please use
6973 # CheckSelfIntersections() method.
6975 # @return New GEOM.GEOM_Object, containing the result shape.
6977 # @ref tui_fuse "Example 1"
6978 # \n @ref swig_MakeCommon "Example 2"
6979 def MakeFuseList(self, theShapesList, checkSelfInte=False,
6980 rmExtraEdges=False, theName=None):
6982 Perform Fuse boolean operation on the list of shapes.
6985 theShapesList Shapes to be fused.
6986 checkSelfInte The flag that tells if the arguments should
6987 be checked for self-intersection prior to
6989 rmExtraEdges The flag that tells if Remove Extra Edges
6990 operation should be performed during the operation.
6991 theName Object name; when specified, this parameter is used
6992 for result publication in the study. Otherwise, if automatic
6993 publication is switched on, default value is used for result name.
6996 This algorithm doesn't find all types of self-intersections.
6997 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6998 vertex/face and edge/face intersections. Face/face
6999 intersections detection is switched off as it is a
7000 time-consuming operation that gives an impact on performance.
7001 To find all self-intersections please use
7002 CheckSelfIntersections() method.
7005 New GEOM.GEOM_Object, containing the result shape.
7008 # Example: see GEOM_TestOthers.py
7009 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7011 RaiseIfFailed("MakeFuseList", self.BoolOp)
7012 self._autoPublish(anObj, theName, "fuse")
7015 ## Perform Common boolean operation on the list of shapes.
7016 # @param theShapesList Shapes for Common operation.
7017 # @param checkSelfInte The flag that tells if the arguments should
7018 # be checked for self-intersection prior to the operation.
7019 # @param theName Object name; when specified, this parameter is used
7020 # for result publication in the study. Otherwise, if automatic
7021 # publication is switched on, default value is used for result name.
7023 # @note This algorithm doesn't find all types of self-intersections.
7024 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7025 # vertex/face and edge/face intersections. Face/face
7026 # intersections detection is switched off as it is a
7027 # time-consuming operation that gives an impact on performance.
7028 # To find all self-intersections please use
7029 # CheckSelfIntersections() method.
7031 # @return New GEOM.GEOM_Object, containing the result shape.
7033 # @ref tui_common "Example 1"
7034 # \n @ref swig_MakeCommon "Example 2"
7035 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7037 Perform Common boolean operation on the list of shapes.
7040 theShapesList Shapes for Common operation.
7041 checkSelfInte The flag that tells if the arguments should
7042 be checked for self-intersection prior to
7044 theName Object name; when specified, this parameter is used
7045 for result publication in the study. Otherwise, if automatic
7046 publication is switched on, default value is used for result name.
7049 This algorithm doesn't find all types of self-intersections.
7050 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7051 vertex/face and edge/face intersections. Face/face
7052 intersections detection is switched off as it is a
7053 time-consuming operation that gives an impact on performance.
7054 To find all self-intersections please use
7055 CheckSelfIntersections() method.
7058 New GEOM.GEOM_Object, containing the result shape.
7061 # Example: see GEOM_TestOthers.py
7062 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7063 RaiseIfFailed("MakeCommonList", self.BoolOp)
7064 self._autoPublish(anObj, theName, "common")
7067 ## Perform Cut boolean operation on one object and the list of tools.
7068 # @param theMainShape The object of the operation.
7069 # @param theShapesList The list of tools of the operation.
7070 # @param checkSelfInte The flag that tells if the arguments should
7071 # be checked for self-intersection prior to the operation.
7072 # @param theName Object name; when specified, this parameter is used
7073 # for result publication in the study. Otherwise, if automatic
7074 # publication is switched on, default value is used for result name.
7076 # @note This algorithm doesn't find all types of self-intersections.
7077 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7078 # vertex/face and edge/face intersections. Face/face
7079 # intersections detection is switched off as it is a
7080 # time-consuming operation that gives an impact on performance.
7081 # To find all self-intersections please use
7082 # CheckSelfIntersections() method.
7084 # @return New GEOM.GEOM_Object, containing the result shape.
7086 # @ref tui_cut "Example 1"
7087 # \n @ref swig_MakeCommon "Example 2"
7088 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7090 Perform Cut boolean operation on one object and the list of tools.
7093 theMainShape The object of the operation.
7094 theShapesList The list of tools of the operation.
7095 checkSelfInte The flag that tells if the arguments should
7096 be checked for self-intersection prior to
7098 theName Object name; when specified, this parameter is used
7099 for result publication in the study. Otherwise, if automatic
7100 publication is switched on, default value is used for result name.
7103 This algorithm doesn't find all types of self-intersections.
7104 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7105 vertex/face and edge/face intersections. Face/face
7106 intersections detection is switched off as it is a
7107 time-consuming operation that gives an impact on performance.
7108 To find all self-intersections please use
7109 CheckSelfIntersections() method.
7112 New GEOM.GEOM_Object, containing the result shape.
7115 # Example: see GEOM_TestOthers.py
7116 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7117 RaiseIfFailed("MakeCutList", self.BoolOp)
7118 self._autoPublish(anObj, theName, "cut")
7124 ## @addtogroup l3_basic_op
7127 ## Perform partition operation.
7128 # @param ListShapes Shapes to be intersected.
7129 # @param ListTools Shapes to intersect theShapes.
7130 # @param Limit Type of resulting shapes (see ShapeType()).\n
7131 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7132 # type will be detected automatically.
7133 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7134 # target type (equal to Limit) are kept in the result,
7135 # else standalone shapes of lower dimension
7136 # are kept also (if they exist).
7138 # @param theName Object name; when specified, this parameter is used
7139 # for result publication in the study. Otherwise, if automatic
7140 # publication is switched on, default value is used for result name.
7142 # @note Each compound from ListShapes and ListTools will be exploded
7143 # in order to avoid possible intersection between shapes from this compound.
7145 # After implementation new version of PartitionAlgo (October 2006)
7146 # other parameters are ignored by current functionality. They are kept
7147 # in this function only for support old versions.
7148 # @param ListKeepInside Shapes, outside which the results will be deleted.
7149 # Each shape from theKeepInside must belong to theShapes also.
7150 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7151 # Each shape from theRemoveInside must belong to theShapes also.
7152 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7153 # @param ListMaterials Material indices for each shape. Make sence,
7154 # only if theRemoveWebs is TRUE.
7156 # @return New GEOM.GEOM_Object, containing the result shapes.
7158 # @ref tui_partition "Example"
7159 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7160 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7161 KeepNonlimitShapes=0, theName=None):
7163 Perform partition operation.
7166 ListShapes Shapes to be intersected.
7167 ListTools Shapes to intersect theShapes.
7168 Limit Type of resulting shapes (see geompy.ShapeType)
7169 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7170 type will be detected automatically.
7171 KeepNonlimitShapes if this parameter == 0, then only shapes of
7172 target type (equal to Limit) are kept in the result,
7173 else standalone shapes of lower dimension
7174 are kept also (if they exist).
7176 theName Object name; when specified, this parameter is used
7177 for result publication in the study. Otherwise, if automatic
7178 publication is switched on, default value is used for result name.
7180 Each compound from ListShapes and ListTools will be exploded
7181 in order to avoid possible intersection between shapes from
7184 After implementation new version of PartitionAlgo (October 2006) other
7185 parameters are ignored by current functionality. They are kept in this
7186 function only for support old versions.
7189 ListKeepInside Shapes, outside which the results will be deleted.
7190 Each shape from theKeepInside must belong to theShapes also.
7191 ListRemoveInside Shapes, inside which the results will be deleted.
7192 Each shape from theRemoveInside must belong to theShapes also.
7193 RemoveWebs If TRUE, perform Glue 3D algorithm.
7194 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7197 New GEOM.GEOM_Object, containing the result shapes.
7199 # Example: see GEOM_TestAll.py
7200 if Limit == self.ShapeType["AUTO"]:
7201 # automatic detection of the most appropriate shape limit type
7203 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7204 Limit = EnumToLong(lim)
7206 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7207 ListKeepInside, ListRemoveInside,
7208 Limit, RemoveWebs, ListMaterials,
7209 KeepNonlimitShapes);
7210 RaiseIfFailed("MakePartition", self.BoolOp)
7211 self._autoPublish(anObj, theName, "partition")
7214 ## Perform partition operation.
7215 # This method may be useful if it is needed to make a partition for
7216 # compound contains nonintersected shapes. Performance will be better
7217 # since intersection between shapes from compound is not performed.
7219 # Description of all parameters as in previous method MakePartition().
7220 # One additional parameter is provided:
7221 # @param checkSelfInte The flag that tells if the arguments should
7222 # be checked for self-intersection prior to the operation.
7224 # @note This algorithm doesn't find all types of self-intersections.
7225 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7226 # vertex/face and edge/face intersections. Face/face
7227 # intersections detection is switched off as it is a
7228 # time-consuming operation that gives an impact on performance.
7229 # To find all self-intersections please use
7230 # CheckSelfIntersections() method.
7232 # @note Passed compounds (via ListShapes or via ListTools)
7233 # have to consist of nonintersecting shapes.
7235 # @return New GEOM.GEOM_Object, containing the result shapes.
7237 # @ref swig_todo "Example"
7238 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7239 ListKeepInside=[], ListRemoveInside=[],
7240 Limit=ShapeType["AUTO"], RemoveWebs=0,
7241 ListMaterials=[], KeepNonlimitShapes=0,
7242 checkSelfInte=False, theName=None):
7244 Perform partition operation.
7245 This method may be useful if it is needed to make a partition for
7246 compound contains nonintersected shapes. Performance will be better
7247 since intersection between shapes from compound is not performed.
7250 Description of all parameters as in method geompy.MakePartition.
7251 One additional parameter is provided:
7252 checkSelfInte The flag that tells if the arguments should
7253 be checked for self-intersection prior to
7257 This algorithm doesn't find all types of self-intersections.
7258 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7259 vertex/face and edge/face intersections. Face/face
7260 intersections detection is switched off as it is a
7261 time-consuming operation that gives an impact on performance.
7262 To find all self-intersections please use
7263 CheckSelfIntersections() method.
7266 Passed compounds (via ListShapes or via ListTools)
7267 have to consist of nonintersecting shapes.
7270 New GEOM.GEOM_Object, containing the result shapes.
7272 if Limit == self.ShapeType["AUTO"]:
7273 # automatic detection of the most appropriate shape limit type
7275 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7276 Limit = EnumToLong(lim)
7278 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7279 ListKeepInside, ListRemoveInside,
7280 Limit, RemoveWebs, ListMaterials,
7281 KeepNonlimitShapes, checkSelfInte);
7282 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7283 self._autoPublish(anObj, theName, "partition")
7286 ## See method MakePartition() for more information.
7288 # @ref tui_partition "Example 1"
7289 # \n @ref swig_Partition "Example 2"
7290 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7291 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7292 KeepNonlimitShapes=0, theName=None):
7294 See method geompy.MakePartition for more information.
7296 # Example: see GEOM_TestOthers.py
7297 # note: auto-publishing is done in self.MakePartition()
7298 anObj = self.MakePartition(ListShapes, ListTools,
7299 ListKeepInside, ListRemoveInside,
7300 Limit, RemoveWebs, ListMaterials,
7301 KeepNonlimitShapes, theName);
7304 ## Perform partition of the Shape with the Plane
7305 # @param theShape Shape to be intersected.
7306 # @param thePlane Tool shape, to intersect theShape.
7307 # @param theName Object name; when specified, this parameter is used
7308 # for result publication in the study. Otherwise, if automatic
7309 # publication is switched on, default value is used for result name.
7311 # @return New GEOM.GEOM_Object, containing the result shape.
7313 # @ref tui_partition "Example"
7314 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7316 Perform partition of the Shape with the Plane
7319 theShape Shape to be intersected.
7320 thePlane Tool shape, to intersect theShape.
7321 theName Object name; when specified, this parameter is used
7322 for result publication in the study. Otherwise, if automatic
7323 publication is switched on, default value is used for result name.
7326 New GEOM.GEOM_Object, containing the result shape.
7328 # Example: see GEOM_TestAll.py
7329 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7330 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7331 self._autoPublish(anObj, theName, "partition")
7334 # end of l3_basic_op
7337 ## @addtogroup l3_transform
7340 ## Translate the given object along the vector, specified
7341 # by its end points.
7342 # @param theObject The object to be translated.
7343 # @param thePoint1 Start point of translation vector.
7344 # @param thePoint2 End point of translation vector.
7345 # @param theCopy Flag used to translate object itself or create a copy.
7346 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7347 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7348 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7350 Translate the given object along the vector, specified by its end points.
7353 theObject The object to be translated.
7354 thePoint1 Start point of translation vector.
7355 thePoint2 End point of translation vector.
7356 theCopy Flag used to translate object itself or create a copy.
7359 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7360 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7363 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7365 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7366 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7369 ## Translate the given object along the vector, specified
7370 # by its end points, creating its copy before the translation.
7371 # @param theObject The object to be translated.
7372 # @param thePoint1 Start point of translation vector.
7373 # @param thePoint2 End point of translation vector.
7374 # @param theName Object name; when specified, this parameter is used
7375 # for result publication in the study. Otherwise, if automatic
7376 # publication is switched on, default value is used for result name.
7378 # @return New GEOM.GEOM_Object, containing the translated object.
7380 # @ref tui_translation "Example 1"
7381 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7382 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7384 Translate the given object along the vector, specified
7385 by its end points, creating its copy before the translation.
7388 theObject The object to be translated.
7389 thePoint1 Start point of translation vector.
7390 thePoint2 End point of translation vector.
7391 theName Object name; when specified, this parameter is used
7392 for result publication in the study. Otherwise, if automatic
7393 publication is switched on, default value is used for result name.
7396 New GEOM.GEOM_Object, containing the translated object.
7398 # Example: see GEOM_TestAll.py
7399 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7400 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7401 self._autoPublish(anObj, theName, "translated")
7404 ## Translate the given object along the vector, specified by its components.
7405 # @param theObject The object to be translated.
7406 # @param theDX,theDY,theDZ Components of translation vector.
7407 # @param theCopy Flag used to translate object itself or create a copy.
7408 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7409 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7411 # @ref tui_translation "Example"
7412 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7414 Translate the given object along the vector, specified by its components.
7417 theObject The object to be translated.
7418 theDX,theDY,theDZ Components of translation vector.
7419 theCopy Flag used to translate object itself or create a copy.
7422 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7423 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7425 # Example: see GEOM_TestAll.py
7426 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7428 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7430 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7431 anObj.SetParameters(Parameters)
7432 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7435 ## Translate the given object along the vector, specified
7436 # by its components, creating its copy before the translation.
7437 # @param theObject The object to be translated.
7438 # @param theDX,theDY,theDZ Components of translation vector.
7439 # @param 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.
7443 # @return New GEOM.GEOM_Object, containing the translated object.
7445 # @ref tui_translation "Example"
7446 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7448 Translate the given object along the vector, specified
7449 by its components, creating its copy before the translation.
7452 theObject The object to be translated.
7453 theDX,theDY,theDZ Components of translation vector.
7454 theName Object name; when specified, this parameter is used
7455 for result publication in the study. Otherwise, if automatic
7456 publication is switched on, default value is used for result name.
7459 New GEOM.GEOM_Object, containing the translated object.
7461 # Example: see GEOM_TestAll.py
7462 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7463 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7464 anObj.SetParameters(Parameters)
7465 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7466 self._autoPublish(anObj, theName, "translated")
7469 ## Translate the given object along the given vector.
7470 # @param theObject The object to be translated.
7471 # @param theVector The translation vector.
7472 # @param theCopy Flag used to translate object itself or create a copy.
7473 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7474 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7475 def TranslateVector(self, theObject, theVector, theCopy=False):
7477 Translate the given object along the given vector.
7480 theObject The object to be translated.
7481 theVector The translation vector.
7482 theCopy Flag used to translate object itself or create a copy.
7485 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7486 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7489 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7491 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7492 RaiseIfFailed("TranslateVector", self.TrsfOp)
7495 ## Translate the given object along the given vector,
7496 # creating its copy before the translation.
7497 # @param theObject The object to be translated.
7498 # @param theVector The translation vector.
7499 # @param 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.
7503 # @return New GEOM.GEOM_Object, containing the translated object.
7505 # @ref tui_translation "Example"
7506 def MakeTranslationVector(self, theObject, theVector, theName=None):
7508 Translate the given object along the given vector,
7509 creating its copy before the translation.
7512 theObject The object to be translated.
7513 theVector The translation vector.
7514 theName Object name; when specified, this parameter is used
7515 for result publication in the study. Otherwise, if automatic
7516 publication is switched on, default value is used for result name.
7519 New GEOM.GEOM_Object, containing the translated object.
7521 # Example: see GEOM_TestAll.py
7522 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7523 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7524 self._autoPublish(anObj, theName, "translated")
7527 ## Translate the given object along the given vector on given distance.
7528 # @param theObject The object to be translated.
7529 # @param theVector The translation vector.
7530 # @param theDistance The translation distance.
7531 # @param theCopy Flag used to translate object itself or create a copy.
7532 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7533 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7535 # @ref tui_translation "Example"
7536 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7538 Translate the given object along the given vector on given distance.
7541 theObject The object to be translated.
7542 theVector The translation vector.
7543 theDistance The translation distance.
7544 theCopy Flag used to translate object itself or create a copy.
7547 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7548 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7550 # Example: see GEOM_TestAll.py
7551 theDistance,Parameters = ParseParameters(theDistance)
7552 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7553 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7554 anObj.SetParameters(Parameters)
7557 ## Translate the given object along the given vector on given distance,
7558 # creating its copy before the translation.
7559 # @param theObject The object to be translated.
7560 # @param theVector The translation vector.
7561 # @param theDistance The translation distance.
7562 # @param theName Object name; when specified, this parameter is used
7563 # for result publication in the study. Otherwise, if automatic
7564 # publication is switched on, default value is used for result name.
7566 # @return New GEOM.GEOM_Object, containing the translated object.
7568 # @ref tui_translation "Example"
7569 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7571 Translate the given object along the given vector on given distance,
7572 creating its copy before the translation.
7575 theObject The object to be translated.
7576 theVector The translation vector.
7577 theDistance The translation distance.
7578 theName Object name; when specified, this parameter is used
7579 for result publication in the study. Otherwise, if automatic
7580 publication is switched on, default value is used for result name.
7583 New GEOM.GEOM_Object, containing the translated object.
7585 # Example: see GEOM_TestAll.py
7586 theDistance,Parameters = ParseParameters(theDistance)
7587 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7588 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7589 anObj.SetParameters(Parameters)
7590 self._autoPublish(anObj, theName, "translated")
7593 ## Rotate the given object around the given axis on the given angle.
7594 # @param theObject The object to be rotated.
7595 # @param theAxis Rotation axis.
7596 # @param theAngle Rotation angle in radians.
7597 # @param theCopy Flag used to rotate object itself or create a copy.
7599 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7600 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7602 # @ref tui_rotation "Example"
7603 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7605 Rotate the given object around the given axis on the given angle.
7608 theObject The object to be rotated.
7609 theAxis Rotation axis.
7610 theAngle Rotation angle in radians.
7611 theCopy Flag used to rotate object itself or create a copy.
7614 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7615 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7617 # Example: see GEOM_TestAll.py
7619 if isinstance(theAngle,str):
7621 theAngle, Parameters = ParseParameters(theAngle)
7623 theAngle = theAngle*math.pi/180.0
7625 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7627 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7628 RaiseIfFailed("Rotate", self.TrsfOp)
7629 anObj.SetParameters(Parameters)
7632 ## Rotate the given object around the given axis
7633 # on the given angle, creating its copy before the rotatation.
7634 # @param theObject The object to be rotated.
7635 # @param theAxis Rotation axis.
7636 # @param theAngle Rotation angle in radians.
7637 # @param theName Object name; when specified, this parameter is used
7638 # for result publication in the study. Otherwise, if automatic
7639 # publication is switched on, default value is used for result name.
7641 # @return New GEOM.GEOM_Object, containing the rotated object.
7643 # @ref tui_rotation "Example"
7644 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7646 Rotate the given object around the given axis
7647 on the given angle, creating its copy before the rotatation.
7650 theObject The object to be rotated.
7651 theAxis Rotation axis.
7652 theAngle Rotation angle in radians.
7653 theName Object name; when specified, this parameter is used
7654 for result publication in the study. Otherwise, if automatic
7655 publication is switched on, default value is used for result name.
7658 New GEOM.GEOM_Object, containing the rotated object.
7660 # Example: see GEOM_TestAll.py
7662 if isinstance(theAngle,str):
7664 theAngle, Parameters = ParseParameters(theAngle)
7666 theAngle = theAngle*math.pi/180.0
7667 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7668 RaiseIfFailed("RotateCopy", self.TrsfOp)
7669 anObj.SetParameters(Parameters)
7670 self._autoPublish(anObj, theName, "rotated")
7673 ## Rotate given object around vector perpendicular to plane
7674 # containing three points.
7675 # @param theObject The object to be rotated.
7676 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7677 # containing the three points.
7678 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7679 # @param theCopy Flag used to rotate object itself or create a copy.
7680 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7681 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7682 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7684 Rotate given object around vector perpendicular to plane
7685 containing three points.
7688 theObject The object to be rotated.
7689 theCentPoint central point the axis is the vector perpendicular to the plane
7690 containing the three points.
7691 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7692 theCopy Flag used to rotate object itself or create a copy.
7695 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7696 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7699 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7701 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7702 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7705 ## Rotate given object around vector perpendicular to plane
7706 # containing three points, creating its copy before the rotatation.
7707 # @param theObject The object to be rotated.
7708 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7709 # containing the three points.
7710 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7711 # @param theName Object name; when specified, this parameter is used
7712 # for result publication in the study. Otherwise, if automatic
7713 # publication is switched on, default value is used for result name.
7715 # @return New GEOM.GEOM_Object, containing the rotated object.
7717 # @ref tui_rotation "Example"
7718 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7720 Rotate given object around vector perpendicular to plane
7721 containing three points, creating its copy before the rotatation.
7724 theObject The object to be rotated.
7725 theCentPoint central point the axis is the vector perpendicular to the plane
7726 containing the three points.
7727 thePoint1,thePoint2 in a perpendicular plane of the axis.
7728 theName Object name; when specified, this parameter is used
7729 for result publication in the study. Otherwise, if automatic
7730 publication is switched on, default value is used for result name.
7733 New GEOM.GEOM_Object, containing the rotated object.
7735 # Example: see GEOM_TestAll.py
7736 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7737 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7738 self._autoPublish(anObj, theName, "rotated")
7741 ## Scale the given object by the specified factor.
7742 # @param theObject The object to be scaled.
7743 # @param thePoint Center point for scaling.
7744 # Passing None for it means scaling relatively the origin of global CS.
7745 # @param theFactor Scaling factor value.
7746 # @param theCopy Flag used to scale object itself or create a copy.
7747 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7748 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7749 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7751 Scale the given object by the specified factor.
7754 theObject The object to be scaled.
7755 thePoint Center point for scaling.
7756 Passing None for it means scaling relatively the origin of global CS.
7757 theFactor Scaling factor value.
7758 theCopy Flag used to scale object itself or create a copy.
7761 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7762 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7764 # Example: see GEOM_TestAll.py
7765 theFactor, Parameters = ParseParameters(theFactor)
7767 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7769 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7770 RaiseIfFailed("Scale", self.TrsfOp)
7771 anObj.SetParameters(Parameters)
7774 ## Scale the given object by the factor, creating its copy before the scaling.
7775 # @param theObject The object to be scaled.
7776 # @param thePoint Center point for scaling.
7777 # Passing None for it means scaling relatively the origin of global CS.
7778 # @param theFactor Scaling factor value.
7779 # @param theName Object name; when specified, this parameter is used
7780 # for result publication in the study. Otherwise, if automatic
7781 # publication is switched on, default value is used for result name.
7783 # @return New GEOM.GEOM_Object, containing the scaled shape.
7785 # @ref tui_scale "Example"
7786 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7788 Scale the given object by the factor, creating its copy before the scaling.
7791 theObject The object to be scaled.
7792 thePoint Center point for scaling.
7793 Passing None for it means scaling relatively the origin of global CS.
7794 theFactor Scaling factor value.
7795 theName Object name; when specified, this parameter is used
7796 for result publication in the study. Otherwise, if automatic
7797 publication is switched on, default value is used for result name.
7800 New GEOM.GEOM_Object, containing the scaled shape.
7802 # Example: see GEOM_TestAll.py
7803 theFactor, Parameters = ParseParameters(theFactor)
7804 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7805 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7806 anObj.SetParameters(Parameters)
7807 self._autoPublish(anObj, theName, "scaled")
7810 ## Scale the given object by different factors along coordinate axes.
7811 # @param theObject The object to be scaled.
7812 # @param thePoint Center point for scaling.
7813 # Passing None for it means scaling relatively the origin of global CS.
7814 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7815 # @param theCopy Flag used to scale object itself or create a copy.
7816 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7817 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7818 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7820 Scale the given object by different factors along coordinate axes.
7823 theObject The object to be scaled.
7824 thePoint Center point for scaling.
7825 Passing None for it means scaling relatively the origin of global CS.
7826 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7827 theCopy Flag used to scale object itself or create a copy.
7830 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7831 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7833 # Example: see GEOM_TestAll.py
7834 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7836 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7837 theFactorX, theFactorY, theFactorZ)
7839 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7840 theFactorX, theFactorY, theFactorZ)
7841 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7842 anObj.SetParameters(Parameters)
7845 ## Scale the given object by different factors along coordinate axes,
7846 # creating its copy before the scaling.
7847 # @param theObject The object to be scaled.
7848 # @param thePoint Center point for scaling.
7849 # Passing None for it means scaling relatively the origin of global CS.
7850 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7851 # @param theName Object name; when specified, this parameter is used
7852 # for result publication in the study. Otherwise, if automatic
7853 # publication is switched on, default value is used for result name.
7855 # @return New GEOM.GEOM_Object, containing the scaled shape.
7857 # @ref swig_scale "Example"
7858 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7860 Scale the given object by different factors along coordinate axes,
7861 creating its copy before the scaling.
7864 theObject The object to be scaled.
7865 thePoint Center point for scaling.
7866 Passing None for it means scaling relatively the origin of global CS.
7867 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7868 theName Object name; when specified, this parameter is used
7869 for result publication in the study. Otherwise, if automatic
7870 publication is switched on, default value is used for result name.
7873 New GEOM.GEOM_Object, containing the scaled shape.
7875 # Example: see GEOM_TestAll.py
7876 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7877 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7878 theFactorX, theFactorY, theFactorZ)
7879 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7880 anObj.SetParameters(Parameters)
7881 self._autoPublish(anObj, theName, "scaled")
7884 ## Mirror an object relatively the given plane.
7885 # @param theObject The object to be mirrored.
7886 # @param thePlane Plane of symmetry.
7887 # @param theCopy Flag used to mirror object itself or create a copy.
7888 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7889 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7890 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7892 Mirror an object relatively the given plane.
7895 theObject The object to be mirrored.
7896 thePlane Plane of symmetry.
7897 theCopy Flag used to mirror object itself or create a copy.
7900 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7901 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7904 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7906 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7907 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7910 ## Create an object, symmetrical
7911 # to the given one relatively the given plane.
7912 # @param theObject The object to be mirrored.
7913 # @param thePlane Plane of symmetry.
7914 # @param theName Object name; when specified, this parameter is used
7915 # for result publication in the study. Otherwise, if automatic
7916 # publication is switched on, default value is used for result name.
7918 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7920 # @ref tui_mirror "Example"
7921 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7923 Create an object, symmetrical to the given one relatively the given plane.
7926 theObject The object to be mirrored.
7927 thePlane Plane of symmetry.
7928 theName Object name; when specified, this parameter is used
7929 for result publication in the study. Otherwise, if automatic
7930 publication is switched on, default value is used for result name.
7933 New GEOM.GEOM_Object, containing the mirrored shape.
7935 # Example: see GEOM_TestAll.py
7936 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7937 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7938 self._autoPublish(anObj, theName, "mirrored")
7941 ## Mirror an object relatively the given axis.
7942 # @param theObject The object to be mirrored.
7943 # @param theAxis Axis of symmetry.
7944 # @param theCopy Flag used to mirror object itself or create a copy.
7945 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7946 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7947 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7949 Mirror an object relatively the given axis.
7952 theObject The object to be mirrored.
7953 theAxis Axis of symmetry.
7954 theCopy Flag used to mirror object itself or create a copy.
7957 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7958 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7961 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7963 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7964 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7967 ## Create an object, symmetrical
7968 # to the given one relatively the given axis.
7969 # @param theObject The object to be mirrored.
7970 # @param theAxis Axis of symmetry.
7971 # @param theName Object name; when specified, this parameter is used
7972 # for result publication in the study. Otherwise, if automatic
7973 # publication is switched on, default value is used for result name.
7975 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7977 # @ref tui_mirror "Example"
7978 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7980 Create an object, symmetrical to the given one relatively the given axis.
7983 theObject The object to be mirrored.
7984 theAxis Axis of symmetry.
7985 theName Object name; when specified, this parameter is used
7986 for result publication in the study. Otherwise, if automatic
7987 publication is switched on, default value is used for result name.
7990 New GEOM.GEOM_Object, containing the mirrored shape.
7992 # Example: see GEOM_TestAll.py
7993 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7994 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7995 self._autoPublish(anObj, theName, "mirrored")
7998 ## Mirror an object relatively the given point.
7999 # @param theObject The object to be mirrored.
8000 # @param thePoint Point of symmetry.
8001 # @param theCopy Flag used to mirror object itself or create a copy.
8002 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8003 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8004 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8006 Mirror an object relatively the given point.
8009 theObject The object to be mirrored.
8010 thePoint Point of symmetry.
8011 theCopy Flag used to mirror object itself or create a copy.
8014 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8015 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8017 # Example: see GEOM_TestAll.py
8019 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8021 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8022 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8025 ## Create an object, symmetrical
8026 # to the given one relatively the given point.
8027 # @param theObject The object to be mirrored.
8028 # @param thePoint Point of symmetry.
8029 # @param 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.
8033 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8035 # @ref tui_mirror "Example"
8036 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8038 Create an object, symmetrical
8039 to the given one relatively the given point.
8042 theObject The object to be mirrored.
8043 thePoint Point of symmetry.
8044 theName Object name; when specified, this parameter is used
8045 for result publication in the study. Otherwise, if automatic
8046 publication is switched on, default value is used for result name.
8049 New GEOM.GEOM_Object, containing the mirrored shape.
8051 # Example: see GEOM_TestAll.py
8052 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8053 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8054 self._autoPublish(anObj, theName, "mirrored")
8057 ## Modify the location of the given object.
8058 # @param theObject The object to be displaced.
8059 # @param theStartLCS Coordinate system to perform displacement from it.\n
8060 # If \a theStartLCS is NULL, displacement
8061 # will be performed from global CS.\n
8062 # If \a theObject itself is used as \a theStartLCS,
8063 # its location will be changed to \a theEndLCS.
8064 # @param theEndLCS Coordinate system to perform displacement to it.
8065 # @param theCopy Flag used to displace object itself or create a copy.
8066 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8067 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8068 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8070 Modify the Location of the given object by LCS, creating its copy before the setting.
8073 theObject The object to be displaced.
8074 theStartLCS Coordinate system to perform displacement from it.
8075 If theStartLCS is NULL, displacement
8076 will be performed from global CS.
8077 If theObject itself is used as theStartLCS,
8078 its location will be changed to theEndLCS.
8079 theEndLCS Coordinate system to perform displacement to it.
8080 theCopy Flag used to displace object itself or create a copy.
8083 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8084 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8086 # Example: see GEOM_TestAll.py
8088 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8090 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8091 RaiseIfFailed("Displace", self.TrsfOp)
8094 ## Modify the Location of the given object by LCS,
8095 # creating its copy before the setting.
8096 # @param theObject The object to be displaced.
8097 # @param theStartLCS Coordinate system to perform displacement from it.\n
8098 # If \a theStartLCS is NULL, displacement
8099 # will be performed from global CS.\n
8100 # If \a theObject itself is used as \a theStartLCS,
8101 # its location will be changed to \a theEndLCS.
8102 # @param theEndLCS Coordinate system to perform displacement to it.
8103 # @param theName Object name; when specified, this parameter is used
8104 # for result publication in the study. Otherwise, if automatic
8105 # publication is switched on, default value is used for result name.
8107 # @return New GEOM.GEOM_Object, containing the displaced shape.
8109 # @ref tui_modify_location "Example"
8110 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8112 Modify the Location of the given object by LCS, creating its copy before the setting.
8115 theObject The object to be displaced.
8116 theStartLCS Coordinate system to perform displacement from it.
8117 If theStartLCS is NULL, displacement
8118 will be performed from global CS.
8119 If theObject itself is used as theStartLCS,
8120 its location will be changed to theEndLCS.
8121 theEndLCS Coordinate system to perform displacement to it.
8122 theName Object name; when specified, this parameter is used
8123 for result publication in the study. Otherwise, if automatic
8124 publication is switched on, default value is used for result name.
8127 New GEOM.GEOM_Object, containing the displaced shape.
8130 # create local coordinate systems
8131 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8132 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8133 # modify the location of the given object
8134 position = geompy.MakePosition(cylinder, cs1, cs2)
8136 # Example: see GEOM_TestAll.py
8137 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8138 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8139 self._autoPublish(anObj, theName, "displaced")
8142 ## Modify the Location of the given object by Path.
8143 # @param theObject The object to be displaced.
8144 # @param thePath Wire or Edge along that the object will be translated.
8145 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8146 # @param theCopy is to create a copy objects if true.
8147 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8148 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8149 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8151 # @ref tui_modify_location "Example"
8152 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8154 Modify the Location of the given object by Path.
8157 theObject The object to be displaced.
8158 thePath Wire or Edge along that the object will be translated.
8159 theDistance progress of Path (0 = start location, 1 = end of path location).
8160 theCopy is to create a copy objects if true.
8161 theReverse 0 - for usual direction, 1 - to reverse path direction.
8164 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8165 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8168 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8170 # Example: see GEOM_TestAll.py
8171 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8172 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8175 ## Modify the Location of the given object by Path, creating its copy before the operation.
8176 # @param theObject The object to be displaced.
8177 # @param thePath Wire or Edge along that the object will be translated.
8178 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8179 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8180 # @param theName Object name; when specified, this parameter is used
8181 # for result publication in the study. Otherwise, if automatic
8182 # publication is switched on, default value is used for result name.
8184 # @return New GEOM.GEOM_Object, containing the displaced shape.
8185 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8187 Modify the Location of the given object by Path, creating its copy before the operation.
8190 theObject The object to be displaced.
8191 thePath Wire or Edge along that the object will be translated.
8192 theDistance progress of Path (0 = start location, 1 = end of path location).
8193 theReverse 0 - for usual direction, 1 - to reverse path direction.
8194 theName Object name; when specified, this parameter is used
8195 for result publication in the study. Otherwise, if automatic
8196 publication is switched on, default value is used for result name.
8199 New GEOM.GEOM_Object, containing the displaced shape.
8201 # Example: see GEOM_TestAll.py
8202 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8203 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8204 self._autoPublish(anObj, theName, "displaced")
8207 ## Offset given shape.
8208 # @param theObject The base object for the offset.
8209 # @param theOffset Offset value.
8210 # @param theCopy Flag used to offset object itself or create a copy.
8211 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8212 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8213 def Offset(self, theObject, theOffset, theCopy=False):
8218 theObject The base object for the offset.
8219 theOffset Offset value.
8220 theCopy Flag used to offset object itself or create a copy.
8223 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8224 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8226 theOffset, Parameters = ParseParameters(theOffset)
8228 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8230 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8231 RaiseIfFailed("Offset", self.TrsfOp)
8232 anObj.SetParameters(Parameters)
8235 ## Create new object as offset of the given one.
8236 # @param theObject The base object for the offset.
8237 # @param theOffset Offset value.
8238 # @param theName Object name; when specified, this parameter is used
8239 # for result publication in the study. Otherwise, if automatic
8240 # publication is switched on, default value is used for result name.
8242 # @return New GEOM.GEOM_Object, containing the offset object.
8244 # @ref tui_offset "Example"
8245 def MakeOffset(self, theObject, theOffset, theName=None):
8247 Create new object as offset of the given one.
8250 theObject The base object for the offset.
8251 theOffset Offset value.
8252 theName Object name; when specified, this parameter is used
8253 for result publication in the study. Otherwise, if automatic
8254 publication is switched on, default value is used for result name.
8257 New GEOM.GEOM_Object, containing the offset object.
8260 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8261 # create a new object as offset of the given object
8262 offset = geompy.MakeOffset(box, 70.)
8264 # Example: see GEOM_TestAll.py
8265 theOffset, Parameters = ParseParameters(theOffset)
8266 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8267 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8268 anObj.SetParameters(Parameters)
8269 self._autoPublish(anObj, theName, "offset")
8272 ## Create new object as projection of the given one on a 2D surface.
8273 # @param theSource The source object for the projection. It can be a point, edge or wire.
8274 # @param theTarget The target object. It can be planar or cylindrical face.
8275 # @param theName Object name; when specified, this parameter is used
8276 # for result publication in the study. Otherwise, if automatic
8277 # publication is switched on, default value is used for result name.
8279 # @return New GEOM.GEOM_Object, containing the projection.
8281 # @ref tui_projection "Example"
8282 def MakeProjection(self, theSource, theTarget, theName=None):
8284 Create new object as projection of the given one on a 2D surface.
8287 theSource The source object for the projection. It can be a point, edge or wire.
8288 theTarget The target object. It can be planar or cylindrical face.
8289 theName Object name; when specified, this parameter is used
8290 for result publication in the study. Otherwise, if automatic
8291 publication is switched on, default value is used for result name.
8294 New GEOM.GEOM_Object, containing the projection.
8296 # Example: see GEOM_TestAll.py
8297 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8298 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8299 self._autoPublish(anObj, theName, "projection")
8302 ## Create a projection projection of the given point on a wire or an edge.
8303 # If there are no solutions or there are 2 or more solutions It throws an
8305 # @param thePoint the point to be projected.
8306 # @param theWire the wire. The edge is accepted as well.
8307 # @param theName Object name; when specified, this parameter is used
8308 # for result publication in the study. Otherwise, if automatic
8309 # publication is switched on, default value is used for result name.
8311 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8312 # \n \a u: The parameter of projection point on edge.
8313 # \n \a PointOnEdge: The projection point.
8314 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8316 # @ref tui_projection "Example"
8317 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8319 Create a projection projection of the given point on a wire or an edge.
8320 If there are no solutions or there are 2 or more solutions It throws an
8324 thePoint the point to be projected.
8325 theWire the wire. The edge is accepted as well.
8326 theName Object name; when specified, this parameter is used
8327 for result publication in the study. Otherwise, if automatic
8328 publication is switched on, default value is used for result name.
8331 [u, PointOnEdge, EdgeInWireIndex]
8332 u: The parameter of projection point on edge.
8333 PointOnEdge: The projection point.
8334 EdgeInWireIndex: The index of an edge in a wire.
8336 # Example: see GEOM_TestAll.py
8337 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8338 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8339 self._autoPublish(anObj[1], theName, "projection")
8342 # -----------------------------------------------------------------------------
8344 # -----------------------------------------------------------------------------
8346 ## Translate the given object along the given vector a given number times
8347 # @param theObject The object to be translated.
8348 # @param theVector Direction of the translation. DX if None.
8349 # @param theStep Distance to translate on.
8350 # @param theNbTimes Quantity of translations to be done.
8351 # @param theName Object name; when specified, this parameter is used
8352 # for result publication in the study. Otherwise, if automatic
8353 # publication is switched on, default value is used for result name.
8355 # @return New GEOM.GEOM_Object, containing compound of all
8356 # the shapes, obtained after each translation.
8358 # @ref tui_multi_translation "Example"
8359 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8361 Translate the given object along the given vector a given number times
8364 theObject The object to be translated.
8365 theVector Direction of the translation. DX if None.
8366 theStep Distance to translate on.
8367 theNbTimes Quantity of translations to be done.
8368 theName Object name; when specified, this parameter is used
8369 for result publication in the study. Otherwise, if automatic
8370 publication is switched on, default value is used for result name.
8373 New GEOM.GEOM_Object, containing compound of all
8374 the shapes, obtained after each translation.
8377 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8379 # Example: see GEOM_TestAll.py
8380 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8381 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8382 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8383 anObj.SetParameters(Parameters)
8384 self._autoPublish(anObj, theName, "multitranslation")
8387 ## Conseqently apply two specified translations to theObject specified number of times.
8388 # @param theObject The object to be translated.
8389 # @param theVector1 Direction of the first translation. DX if None.
8390 # @param theStep1 Step of the first translation.
8391 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8392 # @param theVector2 Direction of the second translation. DY if None.
8393 # @param theStep2 Step of the second translation.
8394 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8395 # @param theName Object name; when specified, this parameter is used
8396 # for result publication in the study. Otherwise, if automatic
8397 # publication is switched on, default value is used for result name.
8399 # @return New GEOM.GEOM_Object, containing compound of all
8400 # the shapes, obtained after each translation.
8402 # @ref tui_multi_translation "Example"
8403 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8404 theVector2, theStep2, theNbTimes2, theName=None):
8406 Conseqently apply two specified translations to theObject specified number of times.
8409 theObject The object to be translated.
8410 theVector1 Direction of the first translation. DX if None.
8411 theStep1 Step of the first translation.
8412 theNbTimes1 Quantity of translations to be done along theVector1.
8413 theVector2 Direction of the second translation. DY if None.
8414 theStep2 Step of the second translation.
8415 theNbTimes2 Quantity of translations to be done along theVector2.
8416 theName Object name; when specified, this parameter is used
8417 for result publication in the study. Otherwise, if automatic
8418 publication is switched on, default value is used for result name.
8421 New GEOM.GEOM_Object, containing compound of all
8422 the shapes, obtained after each translation.
8425 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8427 # Example: see GEOM_TestAll.py
8428 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8429 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8430 theVector2, theStep2, theNbTimes2)
8431 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8432 anObj.SetParameters(Parameters)
8433 self._autoPublish(anObj, theName, "multitranslation")
8436 ## Rotate the given object around the given axis a given number times.
8437 # Rotation angle will be 2*PI/theNbTimes.
8438 # @param theObject The object to be rotated.
8439 # @param theAxis The rotation axis. DZ if None.
8440 # @param theNbTimes Quantity of rotations to be done.
8441 # @param theName Object name; when specified, this parameter is used
8442 # for result publication in the study. Otherwise, if automatic
8443 # publication is switched on, default value is used for result name.
8445 # @return New GEOM.GEOM_Object, containing compound of all the
8446 # shapes, obtained after each rotation.
8448 # @ref tui_multi_rotation "Example"
8449 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8451 Rotate the given object around the given axis a given number times.
8452 Rotation angle will be 2*PI/theNbTimes.
8455 theObject The object to be rotated.
8456 theAxis The rotation axis. DZ if None.
8457 theNbTimes Quantity of rotations to be done.
8458 theName Object name; when specified, this parameter is used
8459 for result publication in the study. Otherwise, if automatic
8460 publication is switched on, default value is used for result name.
8463 New GEOM.GEOM_Object, containing compound of all the
8464 shapes, obtained after each rotation.
8467 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8469 # Example: see GEOM_TestAll.py
8470 theNbTimes, Parameters = ParseParameters(theNbTimes)
8471 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8472 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8473 anObj.SetParameters(Parameters)
8474 self._autoPublish(anObj, theName, "multirotation")
8477 ## Rotate the given object around the given axis
8478 # a given number times on the given angle.
8479 # @param theObject The object to be rotated.
8480 # @param theAxis The rotation axis. DZ if None.
8481 # @param theAngleStep Rotation angle in radians.
8482 # @param theNbTimes Quantity of rotations to be done.
8483 # @param theName Object name; when specified, this parameter is used
8484 # for result publication in the study. Otherwise, if automatic
8485 # publication is switched on, default value is used for result name.
8487 # @return New GEOM.GEOM_Object, containing compound of all the
8488 # shapes, obtained after each rotation.
8490 # @ref tui_multi_rotation "Example"
8491 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8493 Rotate the given object around the given axis
8494 a given number times on the given angle.
8497 theObject The object to be rotated.
8498 theAxis The rotation axis. DZ if None.
8499 theAngleStep Rotation angle in radians.
8500 theNbTimes Quantity of rotations to be done.
8501 theName Object name; when specified, this parameter is used
8502 for result publication in the study. Otherwise, if automatic
8503 publication is switched on, default value is used for result name.
8506 New GEOM.GEOM_Object, containing compound of all the
8507 shapes, obtained after each rotation.
8510 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8512 # Example: see GEOM_TestAll.py
8513 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8514 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8515 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8516 anObj.SetParameters(Parameters)
8517 self._autoPublish(anObj, theName, "multirotation")
8520 ## Rotate the given object around the given axis a given
8521 # number times and multi-translate each rotation result.
8522 # Rotation angle will be 2*PI/theNbTimes1.
8523 # Translation direction passes through center of gravity
8524 # of rotated shape and its projection on the rotation axis.
8525 # @param theObject The object to be rotated.
8526 # @param theAxis Rotation axis. DZ if None.
8527 # @param theNbTimes1 Quantity of rotations to be done.
8528 # @param theRadialStep Translation distance.
8529 # @param theNbTimes2 Quantity of translations to be done.
8530 # @param theName Object name; when specified, this parameter is used
8531 # for result publication in the study. Otherwise, if automatic
8532 # publication is switched on, default value is used for result name.
8534 # @return New GEOM.GEOM_Object, containing compound of all the
8535 # shapes, obtained after each transformation.
8537 # @ref tui_multi_rotation "Example"
8538 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8540 Rotate the given object around the
8541 given axis on the given angle a given number
8542 times and multi-translate each rotation result.
8543 Translation direction passes through center of gravity
8544 of rotated shape and its projection on the rotation axis.
8547 theObject The object to be rotated.
8548 theAxis Rotation axis. DZ if None.
8549 theNbTimes1 Quantity of rotations to be done.
8550 theRadialStep Translation distance.
8551 theNbTimes2 Quantity of translations to be done.
8552 theName Object name; when specified, this parameter is used
8553 for result publication in the study. Otherwise, if automatic
8554 publication is switched on, default value is used for result name.
8557 New GEOM.GEOM_Object, containing compound of all the
8558 shapes, obtained after each transformation.
8561 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8563 # Example: see GEOM_TestAll.py
8564 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8565 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8566 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8567 anObj.SetParameters(Parameters)
8568 self._autoPublish(anObj, theName, "multirotation")
8571 ## Rotate the given object around the
8572 # given axis on the given angle a given number
8573 # times and multi-translate each rotation result.
8574 # Translation direction passes through center of gravity
8575 # of rotated shape and its projection on the rotation axis.
8576 # @param theObject The object to be rotated.
8577 # @param theAxis Rotation axis. DZ if None.
8578 # @param theAngleStep Rotation angle in radians.
8579 # @param theNbTimes1 Quantity of rotations to be done.
8580 # @param theRadialStep Translation distance.
8581 # @param theNbTimes2 Quantity of translations to be done.
8582 # @param theName Object name; when specified, this parameter is used
8583 # for result publication in the study. Otherwise, if automatic
8584 # publication is switched on, default value is used for result name.
8586 # @return New GEOM.GEOM_Object, containing compound of all the
8587 # shapes, obtained after each transformation.
8589 # @ref tui_multi_rotation "Example"
8590 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8592 Rotate the given object around the
8593 given axis on the given angle a given number
8594 times and multi-translate each rotation result.
8595 Translation direction passes through center of gravity
8596 of rotated shape and its projection on the rotation axis.
8599 theObject The object to be rotated.
8600 theAxis Rotation axis. DZ if None.
8601 theAngleStep Rotation angle in radians.
8602 theNbTimes1 Quantity of rotations to be done.
8603 theRadialStep Translation distance.
8604 theNbTimes2 Quantity of translations to be done.
8605 theName Object name; when specified, this parameter is used
8606 for result publication in the study. Otherwise, if automatic
8607 publication is switched on, default value is used for result name.
8610 New GEOM.GEOM_Object, containing compound of all the
8611 shapes, obtained after each transformation.
8614 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8616 # Example: see GEOM_TestAll.py
8617 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8618 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8619 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8620 anObj.SetParameters(Parameters)
8621 self._autoPublish(anObj, theName, "multirotation")
8624 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8626 # @ref swig_MakeMultiRotation "Example"
8627 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8629 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8632 pz = geompy.MakeVertex(0, 0, 100)
8633 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8634 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8636 # Example: see GEOM_TestOthers.py
8637 aVec = self.MakeLine(aPoint,aDir)
8638 # note: auto-publishing is done in self.MultiRotate1D()
8639 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8642 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8644 # @ref swig_MakeMultiRotation "Example"
8645 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8647 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8650 pz = geompy.MakeVertex(0, 0, 100)
8651 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8652 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8654 # Example: see GEOM_TestOthers.py
8655 aVec = self.MakeLine(aPoint,aDir)
8656 # note: auto-publishing is done in self.MultiRotate1D()
8657 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8660 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8662 # @ref swig_MakeMultiRotation "Example"
8663 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8665 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8668 pz = geompy.MakeVertex(0, 0, 100)
8669 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8670 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8672 # Example: see GEOM_TestOthers.py
8673 aVec = self.MakeLine(aPoint,aDir)
8674 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8675 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8678 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8680 # @ref swig_MakeMultiRotation "Example"
8681 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8683 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8686 pz = geompy.MakeVertex(0, 0, 100)
8687 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8688 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8690 # Example: see GEOM_TestOthers.py
8691 aVec = self.MakeLine(aPoint,aDir)
8692 # note: auto-publishing is done in self.MultiRotate2D()
8693 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8696 # end of l3_transform
8699 ## @addtogroup l3_transform_d
8702 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8703 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8705 Deprecated method. Use MultiRotate1DNbTimes instead.
8707 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8708 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8710 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8711 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8712 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8714 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8715 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8718 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8720 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8721 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8722 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8723 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8724 anObj.SetParameters(Parameters)
8725 self._autoPublish(anObj, theName, "multirotation")
8728 ## The same, as MultiRotate1D(), but axis is given by direction and point
8729 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8730 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8732 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8733 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8736 pz = geompy.MakeVertex(0, 0, 100)
8737 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8738 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8740 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8741 aVec = self.MakeLine(aPoint,aDir)
8742 # note: auto-publishing is done in self.MultiRotate1D()
8743 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8746 ## The same, as MultiRotate2D(), but axis is given by direction and point
8747 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8748 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8750 The same, as MultiRotate2D(), but axis is given by direction and point
8751 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8754 pz = geompy.MakeVertex(0, 0, 100)
8755 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8756 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8758 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8759 aVec = self.MakeLine(aPoint,aDir)
8760 # note: auto-publishing is done in self.MultiRotate2D()
8761 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8764 # end of l3_transform_d
8767 ## @addtogroup l3_local
8770 ## Perform a fillet on all edges of the given shape.
8771 # @param theShape Shape, to perform fillet on.
8772 # @param theR Fillet radius.
8773 # @param 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.
8777 # @return New GEOM.GEOM_Object, containing the result shape.
8779 # @ref tui_fillet "Example 1"
8780 # \n @ref swig_MakeFilletAll "Example 2"
8781 def MakeFilletAll(self, theShape, theR, theName=None):
8783 Perform a fillet on all edges of the given shape.
8786 theShape Shape, to perform fillet on.
8788 theName Object name; when specified, this parameter is used
8789 for result publication in the study. Otherwise, if automatic
8790 publication is switched on, default value is used for result name.
8793 New GEOM.GEOM_Object, containing the result shape.
8796 filletall = geompy.MakeFilletAll(prism, 10.)
8798 # Example: see GEOM_TestOthers.py
8799 theR,Parameters = ParseParameters(theR)
8800 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8801 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8802 anObj.SetParameters(Parameters)
8803 self._autoPublish(anObj, theName, "fillet")
8806 ## Perform a fillet on the specified edges/faces of the given shape
8807 # @param theShape Shape, to perform fillet on.
8808 # @param theR Fillet radius.
8809 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8810 # @param theListShapes Global indices of edges/faces to perform fillet on.
8811 # @param theName Object name; when specified, this parameter is used
8812 # for result publication in the study. Otherwise, if automatic
8813 # publication is switched on, default value is used for result name.
8815 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8817 # @return New GEOM.GEOM_Object, containing the result shape.
8819 # @ref tui_fillet "Example"
8820 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8822 Perform a fillet on the specified edges/faces of the given shape
8825 theShape Shape, to perform fillet on.
8827 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8828 theListShapes Global indices of edges/faces to perform fillet on.
8829 theName Object name; when specified, this parameter is used
8830 for result publication in the study. Otherwise, if automatic
8831 publication is switched on, default value is used for result name.
8834 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8837 New GEOM.GEOM_Object, containing the result shape.
8840 # get the list of IDs (IDList) for the fillet
8841 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8843 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8844 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8845 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8846 # make a fillet on the specified edges of the given shape
8847 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8849 # Example: see GEOM_TestAll.py
8850 theR,Parameters = ParseParameters(theR)
8852 if theShapeType == self.ShapeType["EDGE"]:
8853 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8854 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8856 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8857 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8858 anObj.SetParameters(Parameters)
8859 self._autoPublish(anObj, theName, "fillet")
8862 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8863 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8865 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8868 # get the list of IDs (IDList) for the fillet
8869 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8871 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8872 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8873 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8874 # make a fillet on the specified edges of the given shape
8875 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8877 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8879 if theShapeType == self.ShapeType["EDGE"]:
8880 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8881 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8883 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8884 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8885 anObj.SetParameters(Parameters)
8886 self._autoPublish(anObj, theName, "fillet")
8889 ## Perform a fillet on the specified edges of the given shape
8890 # @param theShape Wire Shape to perform fillet on.
8891 # @param theR Fillet radius.
8892 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8893 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8894 # \note The list of vertices could be empty,
8895 # in this case fillet will done done at all vertices in wire
8896 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8897 # by the length of the edges, nearest to the fillet vertex.
8898 # But sometimes the next edge is C1 continuous with the one, nearest to
8899 # the fillet point, and such two (or more) edges can be united to allow
8900 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8901 # thus ignoring the secant vertex (vertices).
8902 # @param theName Object name; when specified, this parameter is used
8903 # for result publication in the study. Otherwise, if automatic
8904 # publication is switched on, default value is used for result name.
8906 # @return New GEOM.GEOM_Object, containing the result shape.
8908 # @ref tui_fillet2d "Example"
8909 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8911 Perform a fillet on the specified edges of the given shape
8914 theShape Wire Shape to perform fillet on.
8916 theListOfVertexes Global indices of vertexes to perform fillet on.
8917 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8918 by the length of the edges, nearest to the fillet vertex.
8919 But sometimes the next edge is C1 continuous with the one, nearest to
8920 the fillet point, and such two (or more) edges can be united to allow
8921 bigger radius. Set this flag to TRUE to allow collinear edges union,
8922 thus ignoring the secant vertex (vertices).
8923 theName Object name; when specified, this parameter is used
8924 for result publication in the study. Otherwise, if automatic
8925 publication is switched on, default value is used for result name.
8927 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8929 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8932 New GEOM.GEOM_Object, containing the result shape.
8936 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8937 # make fillet at given wire vertices with giver radius
8938 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8940 # Example: see GEOM_TestAll.py
8941 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8942 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8943 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8944 anObj.SetParameters(Parameters)
8945 self._autoPublish(anObj, theName, "fillet")
8948 ## Perform a fillet at the specified vertices of the given face/shell.
8949 # @param theShape Face or Shell shape to perform fillet on.
8950 # @param theR Fillet radius.
8951 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8952 # @param theName Object name; when specified, this parameter is used
8953 # for result publication in the study. Otherwise, if automatic
8954 # publication is switched on, default value is used for result name.
8956 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8958 # @return New GEOM.GEOM_Object, containing the result shape.
8960 # @ref tui_fillet2d "Example"
8961 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8963 Perform a fillet at the specified vertices of the given face/shell.
8966 theShape Face or Shell shape to perform fillet on.
8968 theListOfVertexes Global indices of vertexes to perform fillet on.
8969 theName Object name; when specified, this parameter is used
8970 for result publication in the study. Otherwise, if automatic
8971 publication is switched on, default value is used for result name.
8973 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8976 New GEOM.GEOM_Object, containing the result shape.
8979 face = geompy.MakeFaceHW(100, 100, 1)
8980 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8982 # Example: see GEOM_TestAll.py
8983 theR,Parameters = ParseParameters(theR)
8984 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8985 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8986 anObj.SetParameters(Parameters)
8987 self._autoPublish(anObj, theName, "fillet")
8990 ## Perform a symmetric chamfer on all edges of the given shape.
8991 # @param theShape Shape, to perform chamfer on.
8992 # @param theD Chamfer size along each face.
8993 # @param 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.
8997 # @return New GEOM.GEOM_Object, containing the result shape.
8999 # @ref tui_chamfer "Example 1"
9000 # \n @ref swig_MakeChamferAll "Example 2"
9001 def MakeChamferAll(self, theShape, theD, theName=None):
9003 Perform a symmetric chamfer on all edges of the given shape.
9006 theShape Shape, to perform chamfer on.
9007 theD Chamfer size along each face.
9008 theName Object name; when specified, this parameter is used
9009 for result publication in the study. Otherwise, if automatic
9010 publication is switched on, default value is used for result name.
9013 New GEOM.GEOM_Object, containing the result shape.
9016 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9018 # Example: see GEOM_TestOthers.py
9019 theD,Parameters = ParseParameters(theD)
9020 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9021 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9022 anObj.SetParameters(Parameters)
9023 self._autoPublish(anObj, theName, "chamfer")
9026 ## Perform a chamfer on edges, common to the specified faces,
9027 # with distance D1 on the Face1
9028 # @param theShape Shape, to perform chamfer on.
9029 # @param theD1 Chamfer size along \a theFace1.
9030 # @param theD2 Chamfer size along \a theFace2.
9031 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9032 # @param theName Object name; when specified, this parameter is used
9033 # for result publication in the study. Otherwise, if automatic
9034 # publication is switched on, default value is used for result name.
9036 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9038 # @return New GEOM.GEOM_Object, containing the result shape.
9040 # @ref tui_chamfer "Example"
9041 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9043 Perform a chamfer on edges, common to the specified faces,
9044 with distance D1 on the Face1
9047 theShape Shape, to perform chamfer on.
9048 theD1 Chamfer size along theFace1.
9049 theD2 Chamfer size along theFace2.
9050 theFace1,theFace2 Global indices of two faces of theShape.
9051 theName Object name; when specified, this parameter is used
9052 for result publication in the study. Otherwise, if automatic
9053 publication is switched on, default value is used for result name.
9056 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9059 New GEOM.GEOM_Object, containing the result shape.
9062 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9063 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9064 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9065 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9067 # Example: see GEOM_TestAll.py
9068 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9069 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9070 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9071 anObj.SetParameters(Parameters)
9072 self._autoPublish(anObj, theName, "chamfer")
9075 ## Perform a chamfer on edges
9076 # @param theShape Shape, to perform chamfer on.
9077 # @param theD Chamfer length
9078 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9079 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9080 # @param theName Object name; when specified, this parameter is used
9081 # for result publication in the study. Otherwise, if automatic
9082 # publication is switched on, default value is used for result name.
9084 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9086 # @return New GEOM.GEOM_Object, containing the result shape.
9087 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9089 Perform a chamfer on edges
9092 theShape Shape, to perform chamfer on.
9093 theD1 Chamfer size along theFace1.
9094 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9095 theFace1,theFace2 Global indices of two faces of theShape.
9096 theName Object name; when specified, this parameter is used
9097 for result publication in the study. Otherwise, if automatic
9098 publication is switched on, default value is used for result name.
9101 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9104 New GEOM.GEOM_Object, containing the result shape.
9107 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9108 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9109 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9111 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9114 if isinstance(theAngle,str):
9116 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9118 theAngle = theAngle*math.pi/180.0
9119 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9120 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9121 anObj.SetParameters(Parameters)
9122 self._autoPublish(anObj, theName, "chamfer")
9125 ## Perform a chamfer on all edges of the specified faces,
9126 # with distance D1 on the first specified face (if several for one edge)
9127 # @param theShape Shape, to perform chamfer on.
9128 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9129 # connected to the edge, are in \a theFaces, \a theD1
9130 # will be get along face, which is nearer to \a theFaces beginning.
9131 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9132 # @param theFaces Sequence of global indices of faces of \a theShape.
9133 # @param theName Object name; when specified, this parameter is used
9134 # for result publication in the study. Otherwise, if automatic
9135 # publication is switched on, default value is used for result name.
9137 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9139 # @return New GEOM.GEOM_Object, containing the result shape.
9141 # @ref tui_chamfer "Example"
9142 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9144 Perform a chamfer on all edges of the specified faces,
9145 with distance D1 on the first specified face (if several for one edge)
9148 theShape Shape, to perform chamfer on.
9149 theD1 Chamfer size along face from theFaces. If both faces,
9150 connected to the edge, are in theFaces, theD1
9151 will be get along face, which is nearer to theFaces beginning.
9152 theD2 Chamfer size along another of two faces, connected to the edge.
9153 theFaces Sequence of global indices of faces of theShape.
9154 theName Object name; when specified, this parameter is used
9155 for result publication in the study. Otherwise, if automatic
9156 publication is switched on, default value is used for result name.
9158 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9161 New GEOM.GEOM_Object, containing the result shape.
9163 # Example: see GEOM_TestAll.py
9164 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9165 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9166 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9167 anObj.SetParameters(Parameters)
9168 self._autoPublish(anObj, theName, "chamfer")
9171 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9172 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9174 # @ref swig_FilletChamfer "Example"
9175 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9177 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9178 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9181 if isinstance(theAngle,str):
9183 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9185 theAngle = theAngle*math.pi/180.0
9186 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9187 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9188 anObj.SetParameters(Parameters)
9189 self._autoPublish(anObj, theName, "chamfer")
9192 ## Perform a chamfer on edges,
9193 # with distance D1 on the first specified face (if several for one edge)
9194 # @param theShape Shape, to perform chamfer on.
9195 # @param theD1,theD2 Chamfer size
9196 # @param theEdges Sequence of edges of \a theShape.
9197 # @param theName Object name; when specified, this parameter is used
9198 # for result publication in the study. Otherwise, if automatic
9199 # publication is switched on, default value is used for result name.
9201 # @return New GEOM.GEOM_Object, containing the result shape.
9203 # @ref swig_FilletChamfer "Example"
9204 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9206 Perform a chamfer on edges,
9207 with distance D1 on the first specified face (if several for one edge)
9210 theShape Shape, to perform chamfer on.
9211 theD1,theD2 Chamfer size
9212 theEdges Sequence of edges of theShape.
9213 theName Object name; when specified, this parameter is used
9214 for result publication in the study. Otherwise, if automatic
9215 publication is switched on, default value is used for result name.
9218 New GEOM.GEOM_Object, containing the result shape.
9220 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9221 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9222 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9223 anObj.SetParameters(Parameters)
9224 self._autoPublish(anObj, theName, "chamfer")
9227 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9228 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9229 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9231 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9232 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9235 if isinstance(theAngle,str):
9237 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9239 theAngle = theAngle*math.pi/180.0
9240 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9241 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9242 anObj.SetParameters(Parameters)
9243 self._autoPublish(anObj, theName, "chamfer")
9246 ## @sa MakeChamferEdge(), MakeChamferFaces()
9248 # @ref swig_MakeChamfer "Example"
9249 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9251 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9253 # Example: see GEOM_TestOthers.py
9255 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9256 if aShapeType == self.ShapeType["EDGE"]:
9257 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9259 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9262 ## Remove material from a solid by extrusion of the base shape on the given distance.
9263 # @param theInit Shape to remove material from. It must be a solid or
9264 # a compound made of a single solid.
9265 # @param theBase Closed edge or wire defining the base shape to be extruded.
9266 # @param theH Prism dimension along the normal to theBase
9267 # @param theAngle Draft angle in degrees.
9268 # @param theName Object name; when specified, this parameter is used
9269 # for result publication in the study. Otherwise, if automatic
9270 # publication is switched on, default value is used for result name.
9272 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9274 # @ref tui_creation_prism "Example"
9275 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9277 Add material to a solid by extrusion of the base shape on the given distance.
9280 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9281 theBase Closed edge or wire defining the base shape to be extruded.
9282 theH Prism dimension along the normal to theBase
9283 theAngle Draft angle in degrees.
9284 theName Object name; when specified, this parameter is used
9285 for result publication in the study. Otherwise, if automatic
9286 publication is switched on, default value is used for result name.
9289 New GEOM.GEOM_Object, containing the initial shape with removed material.
9291 # Example: see GEOM_TestAll.py
9292 #theH,Parameters = ParseParameters(theH)
9293 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9294 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9295 #anObj.SetParameters(Parameters)
9296 self._autoPublish(anObj, theName, "extrudedCut")
9299 ## Add material to a solid by extrusion of the base shape on the given distance.
9300 # @param theInit Shape to add material to. It must be a solid or
9301 # a compound made of a single solid.
9302 # @param theBase Closed edge or wire defining the base shape to be extruded.
9303 # @param theH Prism dimension along the normal to theBase
9304 # @param theAngle Draft angle in degrees.
9305 # @param theName Object name; when specified, this parameter is used
9306 # for result publication in the study. Otherwise, if automatic
9307 # publication is switched on, default value is used for result name.
9309 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9311 # @ref tui_creation_prism "Example"
9312 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9314 Add material to a solid by extrusion of the base shape on the given distance.
9317 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9318 theBase Closed edge or wire defining the base shape to be extruded.
9319 theH Prism dimension along the normal to theBase
9320 theAngle Draft angle in degrees.
9321 theName Object name; when specified, this parameter is used
9322 for result publication in the study. Otherwise, if automatic
9323 publication is switched on, default value is used for result name.
9326 New GEOM.GEOM_Object, containing the initial shape with added material.
9328 # Example: see GEOM_TestAll.py
9329 #theH,Parameters = ParseParameters(theH)
9330 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9331 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9332 #anObj.SetParameters(Parameters)
9333 self._autoPublish(anObj, theName, "extrudedBoss")
9339 ## @addtogroup l3_basic_op
9342 ## Perform an Archimde operation on the given shape with given parameters.
9343 # The object presenting the resulting face is returned.
9344 # @param theShape Shape to be put in water.
9345 # @param theWeight Weight og the shape.
9346 # @param theWaterDensity Density of the water.
9347 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9348 # @param theName Object name; when specified, this parameter is used
9349 # for result publication in the study. Otherwise, if automatic
9350 # publication is switched on, default value is used for result name.
9352 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9353 # by a plane, corresponding to water level.
9355 # @ref tui_archimede "Example"
9356 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9358 Perform an Archimde operation on the given shape with given parameters.
9359 The object presenting the resulting face is returned.
9362 theShape Shape to be put in water.
9363 theWeight Weight og the shape.
9364 theWaterDensity Density of the water.
9365 theMeshDeflection Deflection of the mesh, using to compute the section.
9366 theName Object name; when specified, this parameter is used
9367 for result publication in the study. Otherwise, if automatic
9368 publication is switched on, default value is used for result name.
9371 New GEOM.GEOM_Object, containing a section of theShape
9372 by a plane, corresponding to water level.
9374 # Example: see GEOM_TestAll.py
9375 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9376 theWeight,theWaterDensity,theMeshDeflection)
9377 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9378 RaiseIfFailed("MakeArchimede", self.LocalOp)
9379 anObj.SetParameters(Parameters)
9380 self._autoPublish(anObj, theName, "archimede")
9383 # end of l3_basic_op
9386 ## @addtogroup l2_measure
9389 ## Get point coordinates
9392 # @ref tui_measurement_tools_page "Example"
9393 def PointCoordinates(self,Point):
9395 Get point coordinates
9400 # Example: see GEOM_TestMeasures.py
9401 aTuple = self.MeasuOp.PointCoordinates(Point)
9402 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9405 ## Get vector coordinates
9408 # @ref tui_measurement_tools_page "Example"
9409 def VectorCoordinates(self,Vector):
9411 Get vector coordinates
9417 p1=self.GetFirstVertex(Vector)
9418 p2=self.GetLastVertex(Vector)
9420 X1=self.PointCoordinates(p1)
9421 X2=self.PointCoordinates(p2)
9423 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9426 ## Compute cross product
9427 # @return vector w=u^v
9429 # @ref tui_measurement_tools_page "Example"
9430 def CrossProduct(self, Vector1, Vector2):
9432 Compute cross product
9434 Returns: vector w=u^v
9436 u=self.VectorCoordinates(Vector1)
9437 v=self.VectorCoordinates(Vector2)
9438 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])
9442 ## Compute cross product
9443 # @return dot product p=u.v
9445 # @ref tui_measurement_tools_page "Example"
9446 def DotProduct(self, Vector1, Vector2):
9448 Compute cross product
9450 Returns: dot product p=u.v
9452 u=self.VectorCoordinates(Vector1)
9453 v=self.VectorCoordinates(Vector2)
9454 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9459 ## Get summarized length of all wires,
9460 # area of surface and volume of the given shape.
9461 # @param theShape Shape to define properties of.
9462 # @return [theLength, theSurfArea, theVolume]\n
9463 # theLength: Summarized length of all wires of the given shape.\n
9464 # theSurfArea: Area of surface of the given shape.\n
9465 # theVolume: Volume of the given shape.
9467 # @ref tui_measurement_tools_page "Example"
9468 def BasicProperties(self,theShape):
9470 Get summarized length of all wires,
9471 area of surface and volume of the given shape.
9474 theShape Shape to define properties of.
9477 [theLength, theSurfArea, theVolume]
9478 theLength: Summarized length of all wires of the given shape.
9479 theSurfArea: Area of surface of the given shape.
9480 theVolume: Volume of the given shape.
9482 # Example: see GEOM_TestMeasures.py
9483 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9484 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9487 ## Get parameters of bounding box of the given shape
9488 # @param theShape Shape to obtain bounding box of.
9489 # @param precise TRUE for precise computation; FALSE for fast one.
9490 # @return [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 # @ref tui_measurement_tools_page "Example"
9496 def BoundingBox (self, theShape, precise=False):
9498 Get parameters of bounding box of the given shape
9501 theShape Shape to obtain bounding box of.
9502 precise TRUE for precise computation; FALSE for fast one.
9505 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9506 Xmin,Xmax: Limits of shape along OX axis.
9507 Ymin,Ymax: Limits of shape along OY axis.
9508 Zmin,Zmax: Limits of shape along OZ axis.
9510 # Example: see GEOM_TestMeasures.py
9511 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9512 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9515 ## Get bounding box of the given shape
9516 # @param theShape Shape to obtain bounding box of.
9517 # @param precise TRUE for precise computation; FALSE for fast one.
9518 # @param theName Object name; when specified, this parameter is used
9519 # for result publication in the study. Otherwise, if automatic
9520 # publication is switched on, default value is used for result name.
9522 # @return New GEOM.GEOM_Object, containing the created box.
9524 # @ref tui_measurement_tools_page "Example"
9525 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9527 Get bounding box of the given shape
9530 theShape Shape to obtain bounding box of.
9531 precise TRUE for precise computation; FALSE for fast one.
9532 theName Object name; when specified, this parameter is used
9533 for result publication in the study. Otherwise, if automatic
9534 publication is switched on, default value is used for result name.
9537 New GEOM.GEOM_Object, containing the created box.
9539 # Example: see GEOM_TestMeasures.py
9540 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9541 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9542 self._autoPublish(anObj, theName, "bndbox")
9545 ## Get inertia matrix and moments of inertia of theShape.
9546 # @param theShape Shape to calculate inertia of.
9547 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9548 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9549 # Ix,Iy,Iz: Moments of inertia of the given shape.
9551 # @ref tui_measurement_tools_page "Example"
9552 def Inertia(self,theShape):
9554 Get inertia matrix and moments of inertia of theShape.
9557 theShape Shape to calculate inertia of.
9560 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9561 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9562 Ix,Iy,Iz: Moments of inertia of the given shape.
9564 # Example: see GEOM_TestMeasures.py
9565 aTuple = self.MeasuOp.GetInertia(theShape)
9566 RaiseIfFailed("GetInertia", self.MeasuOp)
9569 ## Get if coords are included in the shape (ST_IN or ST_ON)
9570 # @param theShape Shape
9571 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9572 # @param tolerance to be used (default is 1.0e-7)
9573 # @return list_of_boolean = [res1, res2, ...]
9574 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9576 Get if coords are included in the shape (ST_IN or ST_ON)
9580 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9581 tolerance to be used (default is 1.0e-7)
9584 list_of_boolean = [res1, res2, ...]
9586 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9588 ## Get minimal distance between the given shapes.
9589 # @param theShape1,theShape2 Shapes to find minimal distance between.
9590 # @return Value of the minimal distance between the given shapes.
9592 # @ref tui_measurement_tools_page "Example"
9593 def MinDistance(self, theShape1, theShape2):
9595 Get minimal distance between the given shapes.
9598 theShape1,theShape2 Shapes to find minimal distance between.
9601 Value of the minimal distance between the given shapes.
9603 # Example: see GEOM_TestMeasures.py
9604 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9605 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9608 ## Get minimal distance between the given shapes.
9609 # @param theShape1,theShape2 Shapes to find minimal distance between.
9610 # @return Value of the minimal distance between the given shapes, in form of list
9611 # [Distance, DX, DY, DZ].
9613 # @ref swig_all_measure "Example"
9614 def MinDistanceComponents(self, theShape1, theShape2):
9616 Get minimal distance between the given shapes.
9619 theShape1,theShape2 Shapes to find minimal distance between.
9622 Value of the minimal distance between the given shapes, in form of list
9623 [Distance, DX, DY, DZ]
9625 # Example: see GEOM_TestMeasures.py
9626 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9627 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9628 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9631 ## Get closest points of the given shapes.
9632 # @param theShape1,theShape2 Shapes to find closest points of.
9633 # @return The number of found solutions (-1 in case of infinite number of
9634 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9636 # @ref tui_measurement_tools_page "Example"
9637 def ClosestPoints (self, theShape1, theShape2):
9639 Get closest points of the given shapes.
9642 theShape1,theShape2 Shapes to find closest points of.
9645 The number of found solutions (-1 in case of infinite number of
9646 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9648 # Example: see GEOM_TestMeasures.py
9649 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9650 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9653 ## Get angle between the given shapes in degrees.
9654 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9655 # @note If both arguments are vectors, the angle is computed in accordance
9656 # with their orientations, otherwise the minimum angle is computed.
9657 # @return Value of the angle between the given shapes in degrees.
9659 # @ref tui_measurement_tools_page "Example"
9660 def GetAngle(self, theShape1, theShape2):
9662 Get angle between the given shapes in degrees.
9665 theShape1,theShape2 Lines or linear edges to find angle between.
9668 If both arguments are vectors, the angle is computed in accordance
9669 with their orientations, otherwise the minimum angle is computed.
9672 Value of the angle between the given shapes in degrees.
9674 # Example: see GEOM_TestMeasures.py
9675 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9676 RaiseIfFailed("GetAngle", self.MeasuOp)
9679 ## Get angle between the given shapes in radians.
9680 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9681 # @note If both arguments are vectors, the angle is computed in accordance
9682 # with their orientations, otherwise the minimum angle is computed.
9683 # @return Value of the angle between the given shapes in radians.
9685 # @ref tui_measurement_tools_page "Example"
9686 def GetAngleRadians(self, theShape1, theShape2):
9688 Get angle between the given shapes in radians.
9691 theShape1,theShape2 Lines or linear edges to find angle between.
9695 If both arguments are vectors, the angle is computed in accordance
9696 with their orientations, otherwise the minimum angle is computed.
9699 Value of the angle between the given shapes in radians.
9701 # Example: see GEOM_TestMeasures.py
9702 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9703 RaiseIfFailed("GetAngle", self.MeasuOp)
9706 ## Get angle between the given vectors in degrees.
9707 # @param theShape1,theShape2 Vectors to find angle between.
9708 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9709 # if False, the opposite vector to the normal vector is used.
9710 # @return Value of the angle between the given vectors in degrees.
9712 # @ref tui_measurement_tools_page "Example"
9713 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9715 Get angle between the given vectors in degrees.
9718 theShape1,theShape2 Vectors to find angle between.
9719 theFlag If True, the normal vector is defined by the two vectors cross,
9720 if False, the opposite vector to the normal vector is used.
9723 Value of the angle between the given vectors in degrees.
9725 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9727 anAngle = 360. - anAngle
9728 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9731 ## The same as GetAngleVectors, but the result is in radians.
9732 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9734 Get angle between the given vectors in radians.
9737 theShape1,theShape2 Vectors to find angle between.
9738 theFlag If True, the normal vector is defined by the two vectors cross,
9739 if False, the opposite vector to the normal vector is used.
9742 Value of the angle between the given vectors in radians.
9744 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9747 ## @name Curve Curvature Measurement
9748 # Methods for receiving radius of curvature of curves
9749 # in the given point
9752 ## Measure curvature of a curve at a point, set by parameter.
9753 # @param theCurve a curve.
9754 # @param theParam parameter.
9755 # @return radius of curvature of \a theCurve.
9757 # @ref swig_todo "Example"
9758 def CurveCurvatureByParam(self, theCurve, theParam):
9760 Measure curvature of a curve at a point, set by parameter.
9767 radius of curvature of theCurve.
9769 # Example: see GEOM_TestMeasures.py
9770 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9771 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9774 ## Measure curvature of a curve at a point.
9775 # @param theCurve a curve.
9776 # @param thePoint given point.
9777 # @return radius of curvature of \a theCurve.
9779 # @ref swig_todo "Example"
9780 def CurveCurvatureByPoint(self, theCurve, thePoint):
9782 Measure curvature of a curve at a point.
9786 thePoint given point.
9789 radius of curvature of theCurve.
9791 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9792 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9796 ## @name Surface Curvature Measurement
9797 # Methods for receiving max and min radius of curvature of surfaces
9798 # in the given point
9801 ## Measure max radius of curvature of surface.
9802 # @param theSurf the given surface.
9803 # @param theUParam Value of U-parameter on the referenced surface.
9804 # @param theVParam Value of V-parameter on the referenced surface.
9805 # @return max radius of curvature of theSurf.
9807 ## @ref swig_todo "Example"
9808 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9810 Measure max radius of curvature of surface.
9813 theSurf the given surface.
9814 theUParam Value of U-parameter on the referenced surface.
9815 theVParam Value of V-parameter on the referenced surface.
9818 max radius of curvature of theSurf.
9820 # Example: see GEOM_TestMeasures.py
9821 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9822 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9825 ## Measure max radius of curvature of surface in the given point
9826 # @param theSurf the given surface.
9827 # @param thePoint given point.
9828 # @return max radius of curvature of theSurf.
9830 ## @ref swig_todo "Example"
9831 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9833 Measure max radius of curvature of surface in the given point.
9836 theSurf the given surface.
9837 thePoint given point.
9840 max radius of curvature of theSurf.
9842 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9843 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9846 ## Measure min radius of curvature of surface.
9847 # @param theSurf the given surface.
9848 # @param theUParam Value of U-parameter on the referenced surface.
9849 # @param theVParam Value of V-parameter on the referenced surface.
9850 # @return min radius of curvature of theSurf.
9852 ## @ref swig_todo "Example"
9853 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9855 Measure min radius of curvature of surface.
9858 theSurf the given surface.
9859 theUParam Value of U-parameter on the referenced surface.
9860 theVParam Value of V-parameter on the referenced surface.
9863 Min radius of curvature of theSurf.
9865 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9866 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9869 ## Measure min radius of curvature of surface in the given point
9870 # @param theSurf the given surface.
9871 # @param thePoint given point.
9872 # @return min radius of curvature of theSurf.
9874 ## @ref swig_todo "Example"
9875 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9877 Measure min radius of curvature of surface in the given point.
9880 theSurf the given surface.
9881 thePoint given point.
9884 Min radius of curvature of theSurf.
9886 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9887 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9891 ## Get min and max tolerances of sub-shapes of theShape
9892 # @param theShape Shape, to get tolerances of.
9893 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9894 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9895 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9896 # VertMin,VertMax: Min and max tolerances of the vertices.
9898 # @ref tui_measurement_tools_page "Example"
9899 def Tolerance(self,theShape):
9901 Get min and max tolerances of sub-shapes of theShape
9904 theShape Shape, to get tolerances of.
9907 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9908 FaceMin,FaceMax: Min and max tolerances of the faces.
9909 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9910 VertMin,VertMax: Min and max tolerances of the vertices.
9912 # Example: see GEOM_TestMeasures.py
9913 aTuple = self.MeasuOp.GetTolerance(theShape)
9914 RaiseIfFailed("GetTolerance", self.MeasuOp)
9917 ## Obtain description of the given shape (number of sub-shapes of each type)
9918 # @param theShape Shape to be described.
9919 # @return Description of the given shape.
9921 # @ref tui_measurement_tools_page "Example"
9922 def WhatIs(self,theShape):
9924 Obtain description of the given shape (number of sub-shapes of each type)
9927 theShape Shape to be described.
9930 Description of the given shape.
9932 # Example: see GEOM_TestMeasures.py
9933 aDescr = self.MeasuOp.WhatIs(theShape)
9934 RaiseIfFailed("WhatIs", self.MeasuOp)
9937 ## Obtain quantity of shapes of the given type in \a theShape.
9938 # If \a theShape is of type \a theType, it is also counted.
9939 # @param theShape Shape to be described.
9940 # @param theType the given ShapeType().
9941 # @return Quantity of shapes of type \a theType in \a theShape.
9943 # @ref tui_measurement_tools_page "Example"
9944 def NbShapes (self, theShape, theType):
9946 Obtain quantity of shapes of the given type in theShape.
9947 If theShape is of type theType, it is also counted.
9950 theShape Shape to be described.
9951 theType the given geompy.ShapeType
9954 Quantity of shapes of type theType in theShape.
9956 # Example: see GEOM_TestMeasures.py
9957 listSh = self.SubShapeAllIDs(theShape, theType)
9961 ## Obtain quantity of shapes of each type in \a theShape.
9962 # The \a theShape is also counted.
9963 # @param theShape Shape to be described.
9964 # @return Dictionary of ShapeType() with bound quantities of shapes.
9966 # @ref tui_measurement_tools_page "Example"
9967 def ShapeInfo (self, theShape):
9969 Obtain quantity of shapes of each type in theShape.
9970 The theShape is also counted.
9973 theShape Shape to be described.
9976 Dictionary of geompy.ShapeType with bound quantities of shapes.
9978 # Example: see GEOM_TestMeasures.py
9980 for typeSh in self.ShapeType:
9981 if typeSh in ( "AUTO", "SHAPE" ): continue
9982 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9988 def GetCreationInformation(self, theShape):
9989 info = theShape.GetCreationInformation()
9991 opName = info.operationName
9992 if not opName: opName = "no info available"
9993 res = "Operation: " + opName
9995 for parVal in info.params:
9996 res += " \n %s = %s" % ( parVal.name, parVal.value )
9999 ## Get a point, situated at the centre of mass of theShape.
10000 # @param theShape Shape to define centre of mass of.
10001 # @param theName Object name; when specified, this parameter is used
10002 # for result publication in the study. Otherwise, if automatic
10003 # publication is switched on, default value is used for result name.
10005 # @return New GEOM.GEOM_Object, containing the created point.
10007 # @ref tui_measurement_tools_page "Example"
10008 def MakeCDG(self, theShape, theName=None):
10010 Get a point, situated at the centre of mass of theShape.
10013 theShape Shape to define centre of mass of.
10014 theName Object name; when specified, this parameter is used
10015 for result publication in the study. Otherwise, if automatic
10016 publication is switched on, default value is used for result name.
10019 New GEOM.GEOM_Object, containing the created point.
10021 # Example: see GEOM_TestMeasures.py
10022 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10023 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10024 self._autoPublish(anObj, theName, "centerOfMass")
10027 ## Get a vertex sub-shape by index depended with orientation.
10028 # @param theShape Shape to find sub-shape.
10029 # @param theIndex Index to find vertex by this index (starting from zero)
10030 # @param theName Object name; when specified, this parameter is used
10031 # for result publication in the study. Otherwise, if automatic
10032 # publication is switched on, default value is used for result name.
10034 # @return New GEOM.GEOM_Object, containing the created vertex.
10036 # @ref tui_measurement_tools_page "Example"
10037 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10039 Get a vertex sub-shape by index depended with orientation.
10042 theShape Shape to find sub-shape.
10043 theIndex Index to find vertex by this index (starting from zero)
10044 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.
10049 New GEOM.GEOM_Object, containing the created vertex.
10051 # Example: see GEOM_TestMeasures.py
10052 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10053 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10054 self._autoPublish(anObj, theName, "vertex")
10057 ## Get the first vertex of wire/edge depended orientation.
10058 # @param theShape Shape to find first vertex.
10059 # @param theName Object name; when specified, this parameter is used
10060 # for result publication in the study. Otherwise, if automatic
10061 # publication is switched on, default value is used for result name.
10063 # @return New GEOM.GEOM_Object, containing the created vertex.
10065 # @ref tui_measurement_tools_page "Example"
10066 def GetFirstVertex(self, theShape, theName=None):
10068 Get the first vertex of wire/edge depended orientation.
10071 theShape Shape to find first vertex.
10072 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.
10077 New GEOM.GEOM_Object, containing the created vertex.
10079 # Example: see GEOM_TestMeasures.py
10080 # note: auto-publishing is done in self.GetVertexByIndex()
10081 anObj = self.GetVertexByIndex(theShape, 0, theName)
10082 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
10085 ## Get the last vertex of wire/edge depended orientation.
10086 # @param theShape Shape to find last vertex.
10087 # @param theName Object name; when specified, this parameter is used
10088 # for result publication in the study. Otherwise, if automatic
10089 # publication is switched on, default value is used for result name.
10091 # @return New GEOM.GEOM_Object, containing the created vertex.
10093 # @ref tui_measurement_tools_page "Example"
10094 def GetLastVertex(self, theShape, theName=None):
10096 Get the last vertex of wire/edge depended orientation.
10099 theShape Shape to find last vertex.
10100 theName Object name; when specified, this parameter is used
10101 for result publication in the study. Otherwise, if automatic
10102 publication is switched on, default value is used for result name.
10105 New GEOM.GEOM_Object, containing the created vertex.
10107 # Example: see GEOM_TestMeasures.py
10108 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10109 # note: auto-publishing is done in self.GetVertexByIndex()
10110 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10111 RaiseIfFailed("GetLastVertex", self.MeasuOp)
10114 ## Get a normale to the given face. If the point is not given,
10115 # the normale is calculated at the center of mass.
10116 # @param theFace Face to define normale of.
10117 # @param theOptionalPoint Point to compute the normale at.
10118 # @param 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.
10122 # @return New GEOM.GEOM_Object, containing the created vector.
10124 # @ref swig_todo "Example"
10125 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10127 Get a normale to the given face. If the point is not given,
10128 the normale is calculated at the center of mass.
10131 theFace Face to define normale of.
10132 theOptionalPoint Point to compute the normale at.
10133 theName Object name; when specified, this parameter is used
10134 for result publication in the study. Otherwise, if automatic
10135 publication is switched on, default value is used for result name.
10138 New GEOM.GEOM_Object, containing the created vector.
10140 # Example: see GEOM_TestMeasures.py
10141 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10142 RaiseIfFailed("GetNormal", self.MeasuOp)
10143 self._autoPublish(anObj, theName, "normal")
10146 ## Print shape errors obtained from CheckShape.
10147 # @param theShape Shape that was checked.
10148 # @param theShapeErrors the shape errors obtained by CheckShape.
10149 # @param theReturnStatus If 0 the description of problem is printed.
10150 # If 1 the description of problem is returned.
10151 # @return If theReturnStatus is equal to 1 the description is returned.
10152 # Otherwise doesn't return anything.
10154 # @ref tui_measurement_tools_page "Example"
10155 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10157 Print shape errors obtained from CheckShape.
10160 theShape Shape that was checked.
10161 theShapeErrors the shape errors obtained by CheckShape.
10162 theReturnStatus If 0 the description of problem is printed.
10163 If 1 the description of problem is returned.
10166 If theReturnStatus is equal to 1 the description is returned.
10167 Otherwise doesn't return anything.
10169 # Example: see GEOM_TestMeasures.py
10170 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10171 if theReturnStatus == 1:
10176 ## Check a topology of the given shape.
10177 # @param theShape Shape to check validity of.
10178 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10179 # if TRUE, the shape's geometry will be checked also.
10180 # @param theReturnStatus If 0 and if theShape is invalid, a description
10181 # of problem is printed.
10182 # If 1 isValid flag and the description of
10183 # problem is returned.
10184 # If 2 isValid flag and the list of error data
10186 # @return TRUE, if the shape "seems to be valid".
10187 # If theShape is invalid, prints a description of problem.
10188 # If theReturnStatus is equal to 1 the description is returned
10189 # along with IsValid flag.
10190 # If theReturnStatus is equal to 2 the list of error data is
10191 # returned along with IsValid flag.
10193 # @ref tui_measurement_tools_page "Example"
10194 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10196 Check a topology of the given shape.
10199 theShape Shape to check validity of.
10200 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10201 if TRUE, the shape's geometry will be checked also.
10202 theReturnStatus If 0 and if theShape is invalid, a description
10203 of problem is printed.
10204 If 1 IsValid flag and the description of
10205 problem is returned.
10206 If 2 IsValid flag and the list of error data
10210 TRUE, if the shape "seems to be valid".
10211 If theShape is invalid, prints a description of problem.
10212 If theReturnStatus is equal to 1 the description is returned
10213 along with IsValid flag.
10214 If theReturnStatus is equal to 2 the list of error data is
10215 returned along with IsValid flag.
10217 # Example: see GEOM_TestMeasures.py
10219 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10220 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10222 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10223 RaiseIfFailed("CheckShape", self.MeasuOp)
10225 if theReturnStatus == 0:
10226 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10228 if theReturnStatus == 1:
10229 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10230 return (IsValid, Descr)
10231 elif theReturnStatus == 2:
10232 return (IsValid, ShapeErrors)
10235 ## Detect self-intersections in the given shape.
10236 # @param theShape Shape to check.
10237 # @return TRUE, if the shape contains no self-intersections.
10239 # @ref tui_measurement_tools_page "Example"
10240 def CheckSelfIntersections(self, theShape):
10242 Detect self-intersections in the given shape.
10245 theShape Shape to check.
10248 TRUE, if the shape contains no self-intersections.
10250 # Example: see GEOM_TestMeasures.py
10251 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10252 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10255 ## Get position (LCS) of theShape.
10257 # Origin of the LCS is situated at the shape's center of mass.
10258 # Axes of the LCS are obtained from shape's location or,
10259 # if the shape is a planar face, from position of its plane.
10261 # @param theShape Shape to calculate position of.
10262 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10263 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10264 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10265 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10267 # @ref swig_todo "Example"
10268 def GetPosition(self,theShape):
10270 Get position (LCS) of theShape.
10271 Origin of the LCS is situated at the shape's center of mass.
10272 Axes of the LCS are obtained from shape's location or,
10273 if the shape is a planar face, from position of its plane.
10276 theShape Shape to calculate position of.
10279 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10280 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10281 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10282 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10284 # Example: see GEOM_TestMeasures.py
10285 aTuple = self.MeasuOp.GetPosition(theShape)
10286 RaiseIfFailed("GetPosition", self.MeasuOp)
10289 ## Get kind of theShape.
10291 # @param theShape Shape to get a kind of.
10292 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10293 # and a list of parameters, describing the shape.
10294 # @note Concrete meaning of each value, returned via \a theIntegers
10295 # or \a theDoubles list depends on the kind() of the shape.
10297 # @ref swig_todo "Example"
10298 def KindOfShape(self,theShape):
10300 Get kind of theShape.
10303 theShape Shape to get a kind of.
10306 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10307 and a list of parameters, describing the shape.
10309 Concrete meaning of each value, returned via theIntegers
10310 or theDoubles list depends on the geompy.kind of the shape
10312 # Example: see GEOM_TestMeasures.py
10313 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10314 RaiseIfFailed("KindOfShape", self.MeasuOp)
10316 aKind = aRoughTuple[0]
10317 anInts = aRoughTuple[1]
10318 aDbls = aRoughTuple[2]
10320 # Now there is no exception from this rule:
10321 aKindTuple = [aKind] + aDbls + anInts
10323 # If they are we will regroup parameters for such kind of shape.
10325 #if aKind == kind.SOME_KIND:
10326 # # SOME_KIND int int double int double double
10327 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10331 # end of l2_measure
10334 ## @addtogroup l2_import_export
10337 ## Import a shape from the BREP or IGES or STEP file
10338 # (depends on given format) with given name.
10339 # @param theFileName The file, containing the shape.
10340 # @param theFormatName Specify format for the file reading.
10341 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10342 # If format 'IGES_SCALE' is used instead of 'IGES' or
10343 # format 'STEP_SCALE' is used instead of 'STEP',
10344 # length unit will be set to 'meter' and result model will be scaled.
10345 # @param theName Object name; when specified, this parameter is used
10346 # for result publication in the study. Otherwise, if automatic
10347 # publication is switched on, default value is used for result name.
10349 # @return New GEOM.GEOM_Object, containing the imported shape.
10350 # If material names are imported it returns the list of
10351 # objects. The first one is the imported object followed by
10353 # @note Auto publishing is allowed for the shape itself. Imported
10354 # material groups are not automatically published.
10356 # @ref swig_Import_Export "Example"
10357 def ImportFile(self, theFileName, theFormatName, theName=None):
10359 Import a shape from the BREP or IGES or STEP file
10360 (depends on given format) with given name.
10363 theFileName The file, containing the shape.
10364 theFormatName Specify format for the file reading.
10365 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10366 If format 'IGES_SCALE' is used instead of 'IGES' or
10367 format 'STEP_SCALE' is used instead of 'STEP',
10368 length unit will be set to 'meter' and result model will be scaled.
10369 theName Object name; when specified, this parameter is used
10370 for result publication in the study. Otherwise, if automatic
10371 publication is switched on, default value is used for result name.
10374 New GEOM.GEOM_Object, containing the imported shape.
10375 If material names are imported it returns the list of
10376 objects. The first one is the imported object followed by
10379 Auto publishing is allowed for the shape itself. Imported
10380 material groups are not automatically published.
10382 # Example: see GEOM_TestOthers.py
10383 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10384 RaiseIfFailed("ImportFile", self.InsertOp)
10385 aNbObj = len(aListObj)
10387 self._autoPublish(aListObj[0], theName, "imported")
10392 ## Deprecated analog of ImportFile()
10393 def Import(self, theFileName, theFormatName, theName=None):
10395 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10397 print "WARNING: Function Import is deprecated, use ImportFile instead"
10398 # note: auto-publishing is done in self.ImportFile()
10399 return self.ImportFile(theFileName, theFormatName, theName)
10401 ## Shortcut to ImportFile() for BREP format.
10402 # Import a shape from the BREP file with given name.
10403 # @param theFileName The file, containing the shape.
10404 # @param theName Object name; when specified, this parameter is used
10405 # for result publication in the study. Otherwise, if automatic
10406 # publication is switched on, default value is used for result name.
10408 # @return New GEOM.GEOM_Object, containing the imported shape.
10410 # @ref swig_Import_Export "Example"
10411 def ImportBREP(self, theFileName, theName=None):
10413 geompy.ImportFile(...) function for BREP format
10414 Import a shape from the BREP file with given name.
10417 theFileName The file, containing the shape.
10418 theName Object name; when specified, this parameter is used
10419 for result publication in the study. Otherwise, if automatic
10420 publication is switched on, default value is used for result name.
10423 New GEOM.GEOM_Object, containing the imported shape.
10425 # Example: see GEOM_TestOthers.py
10426 # note: auto-publishing is done in self.ImportFile()
10427 return self.ImportFile(theFileName, "BREP", theName)
10429 ## Shortcut to ImportFile() for IGES format
10430 # Import a shape from the IGES file with given name.
10431 # @param theFileName The file, containing the shape.
10432 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10433 # and result model will be scaled, if its units are not meters.
10434 # If False (default), file length units will be taken into account.
10435 # @param theName Object name; when specified, this parameter is used
10436 # for result publication in the study. Otherwise, if automatic
10437 # publication is switched on, default value is used for result name.
10439 # @return New GEOM.GEOM_Object, containing the imported shape.
10441 # @ref swig_Import_Export "Example"
10442 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10444 geompy.ImportFile(...) function for IGES format
10447 theFileName The file, containing the shape.
10448 ignoreUnits If True, file length units will be ignored (set to 'meter')
10449 and result model will be scaled, if its units are not meters.
10450 If False (default), file length units will be taken into account.
10451 theName Object name; when specified, this parameter is used
10452 for result publication in the study. Otherwise, if automatic
10453 publication is switched on, default value is used for result name.
10456 New GEOM.GEOM_Object, containing the imported shape.
10458 # Example: see GEOM_TestOthers.py
10459 # note: auto-publishing is done in self.ImportFile()
10461 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10462 return self.ImportFile(theFileName, "IGES", theName)
10464 ## Return length unit from given IGES file
10465 # @param theFileName The file, containing the shape.
10466 # @return String, containing the units name.
10468 # @ref swig_Import_Export "Example"
10469 def GetIGESUnit(self, theFileName):
10471 Return length units from given IGES file
10474 theFileName The file, containing the shape.
10477 String, containing the units name.
10479 # Example: see GEOM_TestOthers.py
10480 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10483 ## Shortcut to ImportFile() for STEP format
10484 # Import a shape from the STEP file with given name.
10485 # @param theFileName The file, containing the shape.
10486 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10487 # and result model will be scaled, if its units are not meters.
10488 # If False (default), file length units will be taken into account.
10489 # @param theName Object name; when specified, this parameter is used
10490 # for result publication in the study. Otherwise, if automatic
10491 # publication is switched on, default value is used for result name.
10493 # @return New GEOM.GEOM_Object, containing the imported shape.
10494 # If material names are imported it returns the list of
10495 # objects. The first one is the imported object followed by
10497 # @note Auto publishing is allowed for the shape itself. Imported
10498 # material groups are not automatically published.
10500 # @ref swig_Import_Export "Example"
10501 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10503 geompy.ImportFile(...) function for STEP format
10506 theFileName The file, containing the shape.
10507 ignoreUnits If True, file length units will be ignored (set to 'meter')
10508 and result model will be scaled, if its units are not meters.
10509 If False (default), file length units will be taken into account.
10510 theName Object name; when specified, this parameter is used
10511 for result publication in the study. Otherwise, if automatic
10512 publication is switched on, default value is used for result name.
10515 New GEOM.GEOM_Object, containing the imported shape.
10516 If material names are imported it returns the list of
10517 objects. The first one is the imported object followed by
10520 Auto publishing is allowed for the shape itself. Imported
10521 material groups are not automatically published.
10523 # Example: see GEOM_TestOthers.py
10524 # note: auto-publishing is done in self.ImportFile()
10526 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10527 return self.ImportFile(theFileName, "STEP", theName)
10529 ## Return length unit from given IGES or STEP file
10530 # @param theFileName The file, containing the shape.
10531 # @return String, containing the units name.
10533 # @ref swig_Import_Export "Example"
10534 def GetSTEPUnit(self, theFileName):
10536 Return length units from given STEP file
10539 theFileName The file, containing the shape.
10542 String, containing the units name.
10544 # Example: see GEOM_TestOthers.py
10545 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10548 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10549 # @note This method will not be dumped to the python script by DumpStudy functionality.
10550 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10551 # @param theStream The BRep binary stream.
10552 # @param theName Object name; when specified, this parameter is used
10553 # for result publication in the study. Otherwise, if automatic
10554 # publication is switched on, default value is used for result name.
10556 # @return New GEOM_Object, containing the shape, read from theStream.
10558 # @ref swig_Import_Export "Example"
10559 def RestoreShape (self, theStream, theName=None):
10561 Read a shape from the binary stream, containing its bounding representation (BRep).
10564 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10567 theStream The BRep binary stream.
10568 theName Object name; when specified, this parameter is used
10569 for result publication in the study. Otherwise, if automatic
10570 publication is switched on, default value is used for result name.
10573 New GEOM_Object, containing the shape, read from theStream.
10575 # Example: see GEOM_TestOthers.py
10576 anObj = self.InsertOp.RestoreShape(theStream)
10577 RaiseIfFailed("RestoreShape", self.InsertOp)
10578 self._autoPublish(anObj, theName, "restored")
10581 ## Export the given shape into a file with given name.
10582 # @param theObject Shape to be stored in the file.
10583 # @param theFileName Name of the file to store the given shape in.
10584 # @param theFormatName Specify format for the shape storage.
10585 # Available formats can be obtained with
10586 # geompy.InsertOp.ExportTranslators()[0] method.
10588 # @ref swig_Import_Export "Example"
10589 def Export(self, theObject, theFileName, theFormatName):
10591 Export the given shape into a file with given name.
10594 theObject Shape to be stored in the file.
10595 theFileName Name of the file to store the given shape in.
10596 theFormatName Specify format for the shape storage.
10597 Available formats can be obtained with
10598 geompy.InsertOp.ExportTranslators()[0] method.
10600 # Example: see GEOM_TestOthers.py
10601 self.InsertOp.Export(theObject, theFileName, theFormatName)
10602 if self.InsertOp.IsDone() == 0:
10603 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10607 ## Shortcut to Export() for BREP format
10609 # @ref swig_Import_Export "Example"
10610 def ExportBREP(self,theObject, theFileName):
10612 geompy.Export(...) function for BREP format
10614 # Example: see GEOM_TestOthers.py
10615 return self.Export(theObject, theFileName, "BREP")
10617 ## Shortcut to Export() for IGES format
10619 # @ref swig_Import_Export "Example"
10620 def ExportIGES(self,theObject, theFileName):
10622 geompy.Export(...) function for IGES format
10624 # Example: see GEOM_TestOthers.py
10625 return self.Export(theObject, theFileName, "IGES")
10627 ## Shortcut to Export() for STEP format
10629 # @ref swig_Import_Export "Example"
10630 def ExportSTEP(self,theObject, theFileName):
10632 geompy.Export(...) function for STEP format
10634 # Example: see GEOM_TestOthers.py
10635 return self.Export(theObject, theFileName, "STEP")
10637 # end of l2_import_export
10640 ## @addtogroup l3_blocks
10643 ## Create a quadrangle face from four edges. Order of Edges is not
10644 # important. It is not necessary that edges share the same vertex.
10645 # @param E1,E2,E3,E4 Edges for the face bound.
10646 # @param theName Object name; when specified, this parameter is used
10647 # for result publication in the study. Otherwise, if automatic
10648 # publication is switched on, default value is used for result name.
10650 # @return New GEOM.GEOM_Object, containing the created face.
10652 # @ref tui_building_by_blocks_page "Example"
10653 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10655 Create a quadrangle face from four edges. Order of Edges is not
10656 important. It is not necessary that edges share the same vertex.
10659 E1,E2,E3,E4 Edges for the face bound.
10660 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.
10665 New GEOM.GEOM_Object, containing the created face.
10668 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10670 # Example: see GEOM_Spanner.py
10671 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10672 RaiseIfFailed("MakeQuad", self.BlocksOp)
10673 self._autoPublish(anObj, theName, "quad")
10676 ## Create a quadrangle face on two edges.
10677 # The missing edges will be built by creating the shortest ones.
10678 # @param E1,E2 Two opposite edges for the face.
10679 # @param theName Object name; when specified, this parameter is used
10680 # for result publication in the study. Otherwise, if automatic
10681 # publication is switched on, default value is used for result name.
10683 # @return New GEOM.GEOM_Object, containing the created face.
10685 # @ref tui_building_by_blocks_page "Example"
10686 def MakeQuad2Edges(self, E1, E2, theName=None):
10688 Create a quadrangle face on two edges.
10689 The missing edges will be built by creating the shortest ones.
10692 E1,E2 Two opposite edges for the face.
10693 theName Object name; when specified, this parameter is used
10694 for result publication in the study. Otherwise, if automatic
10695 publication is switched on, default value is used for result name.
10698 New GEOM.GEOM_Object, containing the created face.
10702 p1 = geompy.MakeVertex( 0., 0., 0.)
10703 p2 = geompy.MakeVertex(150., 30., 0.)
10704 p3 = geompy.MakeVertex( 0., 120., 50.)
10705 p4 = geompy.MakeVertex( 0., 40., 70.)
10707 edge1 = geompy.MakeEdge(p1, p2)
10708 edge2 = geompy.MakeEdge(p3, p4)
10709 # create a quadrangle face from two edges
10710 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10712 # Example: see GEOM_Spanner.py
10713 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10714 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10715 self._autoPublish(anObj, theName, "quad")
10718 ## Create a quadrangle face with specified corners.
10719 # The missing edges will be built by creating the shortest ones.
10720 # @param V1,V2,V3,V4 Corner vertices for the face.
10721 # @param theName Object name; when specified, this parameter is used
10722 # for result publication in the study. Otherwise, if automatic
10723 # publication is switched on, default value is used for result name.
10725 # @return New GEOM.GEOM_Object, containing the created face.
10727 # @ref tui_building_by_blocks_page "Example 1"
10728 # \n @ref swig_MakeQuad4Vertices "Example 2"
10729 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10731 Create a quadrangle face with specified corners.
10732 The missing edges will be built by creating the shortest ones.
10735 V1,V2,V3,V4 Corner vertices for the face.
10736 theName Object name; when specified, this parameter is used
10737 for result publication in the study. Otherwise, if automatic
10738 publication is switched on, default value is used for result name.
10741 New GEOM.GEOM_Object, containing the created face.
10745 p1 = geompy.MakeVertex( 0., 0., 0.)
10746 p2 = geompy.MakeVertex(150., 30., 0.)
10747 p3 = geompy.MakeVertex( 0., 120., 50.)
10748 p4 = geompy.MakeVertex( 0., 40., 70.)
10749 # create a quadrangle from four points in its corners
10750 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10752 # Example: see GEOM_Spanner.py
10753 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10754 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10755 self._autoPublish(anObj, theName, "quad")
10758 ## Create a hexahedral solid, bounded by the six given faces. Order of
10759 # faces is not important. It is not necessary that Faces share the same edge.
10760 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10761 # @param theName Object name; when specified, this parameter is used
10762 # for result publication in the study. Otherwise, if automatic
10763 # publication is switched on, default value is used for result name.
10765 # @return New GEOM.GEOM_Object, containing the created solid.
10767 # @ref tui_building_by_blocks_page "Example 1"
10768 # \n @ref swig_MakeHexa "Example 2"
10769 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10771 Create a hexahedral solid, bounded by the six given faces. Order of
10772 faces is not important. It is not necessary that Faces share the same edge.
10775 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10776 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.
10781 New GEOM.GEOM_Object, containing the created solid.
10784 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10786 # Example: see GEOM_Spanner.py
10787 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10788 RaiseIfFailed("MakeHexa", self.BlocksOp)
10789 self._autoPublish(anObj, theName, "hexa")
10792 ## Create a hexahedral solid between two given faces.
10793 # The missing faces will be built by creating the smallest ones.
10794 # @param F1,F2 Two opposite faces for the hexahedral solid.
10795 # @param theName Object name; when specified, this parameter is used
10796 # for result publication in the study. Otherwise, if automatic
10797 # publication is switched on, default value is used for result name.
10799 # @return New GEOM.GEOM_Object, containing the created solid.
10801 # @ref tui_building_by_blocks_page "Example 1"
10802 # \n @ref swig_MakeHexa2Faces "Example 2"
10803 def MakeHexa2Faces(self, F1, F2, theName=None):
10805 Create a hexahedral solid between two given faces.
10806 The missing faces will be built by creating the smallest ones.
10809 F1,F2 Two opposite faces for the hexahedral solid.
10810 theName Object name; when specified, this parameter is used
10811 for result publication in the study. Otherwise, if automatic
10812 publication is switched on, default value is used for result name.
10815 New GEOM.GEOM_Object, containing the created solid.
10818 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10820 # Example: see GEOM_Spanner.py
10821 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10822 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10823 self._autoPublish(anObj, theName, "hexa")
10829 ## @addtogroup l3_blocks_op
10832 ## Get a vertex, found in the given shape by its coordinates.
10833 # @param theShape Block or a compound of blocks.
10834 # @param theX,theY,theZ Coordinates of the sought vertex.
10835 # @param theEpsilon Maximum allowed distance between the resulting
10836 # vertex and point with the given coordinates.
10837 # @param theName Object name; when specified, this parameter is used
10838 # for result publication in the study. Otherwise, if automatic
10839 # publication is switched on, default value is used for result name.
10841 # @return New GEOM.GEOM_Object, containing the found vertex.
10843 # @ref swig_GetPoint "Example"
10844 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10846 Get a vertex, found in the given shape by its coordinates.
10849 theShape Block or a compound of blocks.
10850 theX,theY,theZ Coordinates of the sought vertex.
10851 theEpsilon Maximum allowed distance between the resulting
10852 vertex and point with the given coordinates.
10853 theName Object name; when specified, this parameter is used
10854 for result publication in the study. Otherwise, if automatic
10855 publication is switched on, default value is used for result name.
10858 New GEOM.GEOM_Object, containing the found vertex.
10861 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10863 # Example: see GEOM_TestOthers.py
10864 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10865 RaiseIfFailed("GetPoint", self.BlocksOp)
10866 self._autoPublish(anObj, theName, "vertex")
10869 ## Find a vertex of the given shape, which has minimal distance to the given point.
10870 # @param theShape Any shape.
10871 # @param thePoint Point, close to the desired vertex.
10872 # @param theName Object name; when specified, this parameter is used
10873 # for result publication in the study. Otherwise, if automatic
10874 # publication is switched on, default value is used for result name.
10876 # @return New GEOM.GEOM_Object, containing the found vertex.
10878 # @ref swig_GetVertexNearPoint "Example"
10879 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10881 Find a vertex of the given shape, which has minimal distance to the given point.
10884 theShape Any shape.
10885 thePoint Point, close to the desired vertex.
10886 theName Object name; when specified, this parameter is used
10887 for result publication in the study. Otherwise, if automatic
10888 publication is switched on, default value is used for result name.
10891 New GEOM.GEOM_Object, containing the found vertex.
10894 pmidle = geompy.MakeVertex(50, 0, 50)
10895 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10897 # Example: see GEOM_TestOthers.py
10898 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10899 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10900 self._autoPublish(anObj, theName, "vertex")
10903 ## Get an edge, found in the given shape by two given vertices.
10904 # @param theShape Block or a compound of blocks.
10905 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10906 # @param theName Object name; when specified, this parameter is used
10907 # for result publication in the study. Otherwise, if automatic
10908 # publication is switched on, default value is used for result name.
10910 # @return New GEOM.GEOM_Object, containing the found edge.
10912 # @ref swig_GetEdge "Example"
10913 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10915 Get an edge, found in the given shape by two given vertices.
10918 theShape Block or a compound of blocks.
10919 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10920 theName Object name; when specified, this parameter is used
10921 for result publication in the study. Otherwise, if automatic
10922 publication is switched on, default value is used for result name.
10925 New GEOM.GEOM_Object, containing the found edge.
10927 # Example: see GEOM_Spanner.py
10928 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10929 RaiseIfFailed("GetEdge", self.BlocksOp)
10930 self._autoPublish(anObj, theName, "edge")
10933 ## Find an edge of the given shape, which has minimal distance to the given point.
10934 # @param theShape Block or a compound of blocks.
10935 # @param thePoint Point, close to the desired edge.
10936 # @param theName Object name; when specified, this parameter is used
10937 # for result publication in the study. Otherwise, if automatic
10938 # publication is switched on, default value is used for result name.
10940 # @return New GEOM.GEOM_Object, containing the found edge.
10942 # @ref swig_GetEdgeNearPoint "Example"
10943 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10945 Find an edge of the given shape, which has minimal distance to the given point.
10948 theShape Block or a compound of blocks.
10949 thePoint Point, close to the desired edge.
10950 theName Object name; when specified, this parameter is used
10951 for result publication in the study. Otherwise, if automatic
10952 publication is switched on, default value is used for result name.
10955 New GEOM.GEOM_Object, containing the found edge.
10957 # Example: see GEOM_TestOthers.py
10958 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10959 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10960 self._autoPublish(anObj, theName, "edge")
10963 ## Returns a face, found in the given shape by four given corner vertices.
10964 # @param theShape Block or a compound of blocks.
10965 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10966 # @param theName Object name; when specified, this parameter is used
10967 # for result publication in the study. Otherwise, if automatic
10968 # publication is switched on, default value is used for result name.
10970 # @return New GEOM.GEOM_Object, containing the found face.
10972 # @ref swig_todo "Example"
10973 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10975 Returns a face, found in the given shape by four given corner vertices.
10978 theShape Block or a compound of blocks.
10979 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10980 theName Object name; when specified, this parameter is used
10981 for result publication in the study. Otherwise, if automatic
10982 publication is switched on, default value is used for result name.
10985 New GEOM.GEOM_Object, containing the found face.
10987 # Example: see GEOM_Spanner.py
10988 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10989 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10990 self._autoPublish(anObj, theName, "face")
10993 ## Get a face of block, found in the given shape by two given edges.
10994 # @param theShape Block or a compound of blocks.
10995 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10996 # @param theName Object name; when specified, this parameter is used
10997 # for result publication in the study. Otherwise, if automatic
10998 # publication is switched on, default value is used for result name.
11000 # @return New GEOM.GEOM_Object, containing the found face.
11002 # @ref swig_todo "Example"
11003 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11005 Get a face of block, found in the given shape by two given edges.
11008 theShape Block or a compound of blocks.
11009 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11010 theName Object name; when specified, this parameter is used
11011 for result publication in the study. Otherwise, if automatic
11012 publication is switched on, default value is used for result name.
11015 New GEOM.GEOM_Object, containing the found face.
11017 # Example: see GEOM_Spanner.py
11018 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11019 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11020 self._autoPublish(anObj, theName, "face")
11023 ## Find a face, opposite to the given one in the given block.
11024 # @param theBlock Must be a hexahedral solid.
11025 # @param theFace Face of \a theBlock, opposite to the desired face.
11026 # @param theName Object name; when specified, this parameter is used
11027 # for result publication in the study. Otherwise, if automatic
11028 # publication is switched on, default value is used for result name.
11030 # @return New GEOM.GEOM_Object, containing the found face.
11032 # @ref swig_GetOppositeFace "Example"
11033 def GetOppositeFace(self, theBlock, theFace, theName=None):
11035 Find a face, opposite to the given one in the given block.
11038 theBlock Must be a hexahedral solid.
11039 theFace Face of theBlock, opposite to the desired face.
11040 theName Object name; when specified, this parameter is used
11041 for result publication in the study. Otherwise, if automatic
11042 publication is switched on, default value is used for result name.
11045 New GEOM.GEOM_Object, containing the found face.
11047 # Example: see GEOM_Spanner.py
11048 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11049 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11050 self._autoPublish(anObj, theName, "face")
11053 ## Find a face of the given shape, which has minimal distance to the given point.
11054 # @param theShape Block or a compound of blocks.
11055 # @param thePoint Point, close to the desired face.
11056 # @param theName Object name; when specified, this parameter is used
11057 # for result publication in the study. Otherwise, if automatic
11058 # publication is switched on, default value is used for result name.
11060 # @return New GEOM.GEOM_Object, containing the found face.
11062 # @ref swig_GetFaceNearPoint "Example"
11063 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11065 Find a face of the given shape, which has minimal distance to the given point.
11068 theShape Block or a compound of blocks.
11069 thePoint Point, close to the desired face.
11070 theName Object name; when specified, this parameter is used
11071 for result publication in the study. Otherwise, if automatic
11072 publication is switched on, default value is used for result name.
11075 New GEOM.GEOM_Object, containing the found face.
11077 # Example: see GEOM_Spanner.py
11078 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11079 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11080 self._autoPublish(anObj, theName, "face")
11083 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11084 # @param theBlock Block or a compound of blocks.
11085 # @param theVector Vector, close to the normale of the desired face.
11086 # @param theName Object name; when specified, this parameter is used
11087 # for result publication in the study. Otherwise, if automatic
11088 # publication is switched on, default value is used for result name.
11090 # @return New GEOM.GEOM_Object, containing the found face.
11092 # @ref swig_todo "Example"
11093 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11095 Find a face of block, whose outside normale has minimal angle with the given vector.
11098 theBlock Block or a compound of blocks.
11099 theVector Vector, close to the normale of the desired face.
11100 theName Object name; when specified, this parameter is used
11101 for result publication in the study. Otherwise, if automatic
11102 publication is switched on, default value is used for result name.
11105 New GEOM.GEOM_Object, containing the found face.
11107 # Example: see GEOM_Spanner.py
11108 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11109 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11110 self._autoPublish(anObj, theName, "face")
11113 ## Find all sub-shapes of type \a theShapeType of the given shape,
11114 # which have minimal distance to the given point.
11115 # @param theShape Any shape.
11116 # @param thePoint Point, close to the desired shape.
11117 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11118 # @param theTolerance The tolerance for distances comparison. All shapes
11119 # with distances to the given point in interval
11120 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11121 # @param theName Object name; when specified, this parameter is used
11122 # for result publication in the study. Otherwise, if automatic
11123 # publication is switched on, default value is used for result name.
11125 # @return New GEOM_Object, containing a group of all found shapes.
11127 # @ref swig_GetShapesNearPoint "Example"
11128 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11130 Find all sub-shapes of type theShapeType of the given shape,
11131 which have minimal distance to the given point.
11134 theShape Any shape.
11135 thePoint Point, close to the desired shape.
11136 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11137 theTolerance The tolerance for distances comparison. All shapes
11138 with distances to the given point in interval
11139 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11140 theName Object name; when specified, this parameter is used
11141 for result publication in the study. Otherwise, if automatic
11142 publication is switched on, default value is used for result name.
11145 New GEOM_Object, containing a group of all found shapes.
11147 # Example: see GEOM_TestOthers.py
11148 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11149 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11150 self._autoPublish(anObj, theName, "group")
11153 # end of l3_blocks_op
11156 ## @addtogroup l4_blocks_measure
11159 ## Check, if the compound of blocks is given.
11160 # To be considered as a compound of blocks, the
11161 # given shape must satisfy the following conditions:
11162 # - Each element of the compound should be a Block (6 faces and 12 edges).
11163 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11164 # - The compound should be connexe.
11165 # - The glue between two quadrangle faces should be applied.
11166 # @param theCompound The compound to check.
11167 # @return TRUE, if the given shape is a compound of blocks.
11168 # If theCompound is not valid, prints all discovered errors.
11170 # @ref tui_measurement_tools_page "Example 1"
11171 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11172 def CheckCompoundOfBlocks(self,theCompound):
11174 Check, if the compound of blocks is given.
11175 To be considered as a compound of blocks, the
11176 given shape must satisfy the following conditions:
11177 - Each element of the compound should be a Block (6 faces and 12 edges).
11178 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11179 - The compound should be connexe.
11180 - The glue between two quadrangle faces should be applied.
11183 theCompound The compound to check.
11186 TRUE, if the given shape is a compound of blocks.
11187 If theCompound is not valid, prints all discovered errors.
11189 # Example: see GEOM_Spanner.py
11190 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11191 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11193 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11197 ## Retrieve all non blocks solids and faces from \a theShape.
11198 # @param theShape The shape to explore.
11199 # @param theName Object name; when specified, this parameter is used
11200 # for result publication in the study. Otherwise, if automatic
11201 # publication is switched on, default value is used for result name.
11203 # @return A tuple of two GEOM_Objects. The first object is a group of all
11204 # non block solids (= not 6 faces, or with 6 faces, but with the
11205 # presence of non-quadrangular faces). The second object is a
11206 # group of all non quadrangular faces.
11208 # @ref tui_measurement_tools_page "Example 1"
11209 # \n @ref swig_GetNonBlocks "Example 2"
11210 def GetNonBlocks (self, theShape, theName=None):
11212 Retrieve all non blocks solids and faces from theShape.
11215 theShape The shape to explore.
11216 theName Object name; when specified, this parameter is used
11217 for result publication in the study. Otherwise, if automatic
11218 publication is switched on, default value is used for result name.
11221 A tuple of two GEOM_Objects. The first object is a group of all
11222 non block solids (= not 6 faces, or with 6 faces, but with the
11223 presence of non-quadrangular faces). The second object is a
11224 group of all non quadrangular faces.
11227 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11229 # Example: see GEOM_Spanner.py
11230 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11231 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11232 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11235 ## Remove all seam and degenerated edges from \a theShape.
11236 # Unite faces and edges, sharing one surface. It means that
11237 # this faces must have references to one C++ surface object (handle).
11238 # @param theShape The compound or single solid to remove irregular edges from.
11239 # @param doUnionFaces If True, then unite faces. If False (the default value),
11240 # do not unite faces.
11241 # @param theName Object name; when specified, this parameter is used
11242 # for result publication in the study. Otherwise, if automatic
11243 # publication is switched on, default value is used for result name.
11245 # @return Improved shape.
11247 # @ref swig_RemoveExtraEdges "Example"
11248 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11250 Remove all seam and degenerated edges from theShape.
11251 Unite faces and edges, sharing one surface. It means that
11252 this faces must have references to one C++ surface object (handle).
11255 theShape The compound or single solid to remove irregular edges from.
11256 doUnionFaces If True, then unite faces. If False (the default value),
11257 do not unite faces.
11258 theName Object name; when specified, this parameter is used
11259 for result publication in the study. Otherwise, if automatic
11260 publication is switched on, default value is used for result name.
11265 # Example: see GEOM_TestOthers.py
11266 nbFacesOptimum = -1 # -1 means do not unite faces
11267 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11268 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11269 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11270 self._autoPublish(anObj, theName, "removeExtraEdges")
11273 ## Performs union faces of \a theShape
11274 # Unite faces sharing one surface. It means that
11275 # these faces must have references to one C++ surface object (handle).
11276 # @param theShape The compound or single solid that contains faces
11277 # to perform union.
11278 # @param theName Object name; when specified, this parameter is used
11279 # for result publication in the study. Otherwise, if automatic
11280 # publication is switched on, default value is used for result name.
11282 # @return Improved shape.
11284 # @ref swig_UnionFaces "Example"
11285 def UnionFaces(self, theShape, theName=None):
11287 Performs union faces of theShape.
11288 Unite faces sharing one surface. It means that
11289 these faces must have references to one C++ surface object (handle).
11292 theShape The compound or single solid that contains faces
11294 theName Object name; when specified, this parameter is used
11295 for result publication in the study. Otherwise, if automatic
11296 publication is switched on, default value is used for result name.
11301 # Example: see GEOM_TestOthers.py
11302 anObj = self.BlocksOp.UnionFaces(theShape)
11303 RaiseIfFailed("UnionFaces", self.BlocksOp)
11304 self._autoPublish(anObj, theName, "unionFaces")
11307 ## Check, if the given shape is a blocks compound.
11308 # Fix all detected errors.
11309 # \note Single block can be also fixed by this method.
11310 # @param theShape The compound to check and improve.
11311 # @param theName Object name; when specified, this parameter is used
11312 # for result publication in the study. Otherwise, if automatic
11313 # publication is switched on, default value is used for result name.
11315 # @return Improved compound.
11317 # @ref swig_CheckAndImprove "Example"
11318 def CheckAndImprove(self, theShape, theName=None):
11320 Check, if the given shape is a blocks compound.
11321 Fix all detected errors.
11324 Single block can be also fixed by this method.
11327 theShape The compound to check and improve.
11328 theName Object name; when specified, this parameter is used
11329 for result publication in the study. Otherwise, if automatic
11330 publication is switched on, default value is used for result name.
11335 # Example: see GEOM_TestOthers.py
11336 anObj = self.BlocksOp.CheckAndImprove(theShape)
11337 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11338 self._autoPublish(anObj, theName, "improved")
11341 # end of l4_blocks_measure
11344 ## @addtogroup l3_blocks_op
11347 ## Get all the blocks, contained in the given compound.
11348 # @param theCompound The compound to explode.
11349 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11350 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11351 # @param theName Object name; when specified, this parameter is used
11352 # for result publication in the study. Otherwise, if automatic
11353 # publication is switched on, default value is used for result name.
11355 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11357 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11359 # @ref tui_explode_on_blocks "Example 1"
11360 # \n @ref swig_MakeBlockExplode "Example 2"
11361 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11363 Get all the blocks, contained in the given compound.
11366 theCompound The compound to explode.
11367 theMinNbFaces If solid has lower number of faces, it is not a block.
11368 theMaxNbFaces If solid has higher number of faces, it is not a block.
11369 theName Object name; when specified, this parameter is used
11370 for result publication in the study. Otherwise, if automatic
11371 publication is switched on, default value is used for result name.
11374 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11377 List of GEOM.GEOM_Object, containing the retrieved blocks.
11379 # Example: see GEOM_TestOthers.py
11380 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11381 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11382 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11383 for anObj in aList:
11384 anObj.SetParameters(Parameters)
11386 self._autoPublish(aList, theName, "block")
11389 ## Find block, containing the given point inside its volume or on boundary.
11390 # @param theCompound Compound, to find block in.
11391 # @param thePoint Point, close to the desired block. If the point lays on
11392 # boundary between some blocks, we return block with nearest center.
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 New GEOM.GEOM_Object, containing the found block.
11399 # @ref swig_todo "Example"
11400 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11402 Find block, containing the given point inside its volume or on boundary.
11405 theCompound Compound, to find block in.
11406 thePoint Point, close to the desired block. If the point lays on
11407 boundary between some blocks, we return block with nearest center.
11408 theName Object name; when specified, this parameter is used
11409 for result publication in the study. Otherwise, if automatic
11410 publication is switched on, default value is used for result name.
11413 New GEOM.GEOM_Object, containing the found block.
11415 # Example: see GEOM_Spanner.py
11416 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11417 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11418 self._autoPublish(anObj, theName, "block")
11421 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11422 # @param theCompound Compound, to find block in.
11423 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11424 # @param theName Object name; when specified, this parameter is used
11425 # for result publication in the study. Otherwise, if automatic
11426 # publication is switched on, default value is used for result name.
11428 # @return New GEOM.GEOM_Object, containing the found block.
11430 # @ref swig_GetBlockByParts "Example"
11431 def GetBlockByParts(self, theCompound, theParts, theName=None):
11433 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11436 theCompound Compound, to find block in.
11437 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11438 theName Object name; when specified, this parameter is used
11439 for result publication in the study. Otherwise, if automatic
11440 publication is switched on, default value is used for result name.
11443 New GEOM_Object, containing the found block.
11445 # Example: see GEOM_TestOthers.py
11446 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11447 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11448 self._autoPublish(anObj, theName, "block")
11451 ## Return all blocks, containing all the elements, passed as the parts.
11452 # @param theCompound Compound, to find blocks in.
11453 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11454 # @param theName Object name; when specified, this parameter is used
11455 # for result publication in the study. Otherwise, if automatic
11456 # publication is switched on, default value is used for result name.
11458 # @return List of GEOM.GEOM_Object, containing the found blocks.
11460 # @ref swig_todo "Example"
11461 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11463 Return all blocks, containing all the elements, passed as the parts.
11466 theCompound Compound, to find blocks in.
11467 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11468 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.
11473 List of GEOM.GEOM_Object, containing the found blocks.
11475 # Example: see GEOM_Spanner.py
11476 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11477 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11478 self._autoPublish(aList, theName, "block")
11481 ## Multi-transformate block and glue the result.
11482 # Transformation is defined so, as to superpose direction faces.
11483 # @param Block Hexahedral solid to be multi-transformed.
11484 # @param DirFace1 ID of First direction face.
11485 # @param DirFace2 ID of Second direction face.
11486 # @param NbTimes Quantity of transformations to be done.
11487 # @param theName Object name; when specified, this parameter is used
11488 # for result publication in the study. Otherwise, if automatic
11489 # publication is switched on, default value is used for result name.
11491 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11493 # @return New GEOM.GEOM_Object, containing the result shape.
11495 # @ref tui_multi_transformation "Example"
11496 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11498 Multi-transformate block and glue the result.
11499 Transformation is defined so, as to superpose direction faces.
11502 Block Hexahedral solid to be multi-transformed.
11503 DirFace1 ID of First direction face.
11504 DirFace2 ID of Second direction face.
11505 NbTimes Quantity of transformations to be done.
11506 theName Object name; when specified, this parameter is used
11507 for result publication in the study. Otherwise, if automatic
11508 publication is switched on, default value is used for result name.
11511 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11514 New GEOM.GEOM_Object, containing the result shape.
11516 # Example: see GEOM_Spanner.py
11517 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11518 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11519 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11520 anObj.SetParameters(Parameters)
11521 self._autoPublish(anObj, theName, "transformed")
11524 ## Multi-transformate block and glue the result.
11525 # @param Block Hexahedral solid to be multi-transformed.
11526 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11527 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11528 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11529 # @param theName Object name; when specified, this parameter is used
11530 # for result publication in the study. Otherwise, if automatic
11531 # publication is switched on, default value is used for result name.
11533 # @return New GEOM.GEOM_Object, containing the result shape.
11535 # @ref tui_multi_transformation "Example"
11536 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11537 DirFace1V, DirFace2V, NbTimesV, theName=None):
11539 Multi-transformate block and glue the result.
11542 Block Hexahedral solid to be multi-transformed.
11543 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11544 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11545 NbTimesU,NbTimesV Quantity of transformations to be done.
11546 theName Object name; when specified, this parameter is used
11547 for result publication in the study. Otherwise, if automatic
11548 publication is switched on, default value is used for result name.
11551 New GEOM.GEOM_Object, containing the result shape.
11553 # Example: see GEOM_Spanner.py
11554 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11555 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11556 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11557 DirFace1V, DirFace2V, NbTimesV)
11558 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11559 anObj.SetParameters(Parameters)
11560 self._autoPublish(anObj, theName, "transformed")
11563 ## Build all possible propagation groups.
11564 # Propagation group is a set of all edges, opposite to one (main)
11565 # edge of this group directly or through other opposite edges.
11566 # Notion of Opposite Edge make sence only on quadrangle face.
11567 # @param theShape Shape to build propagation groups on.
11568 # @param theName Object name; when specified, this parameter is used
11569 # for result publication in the study. Otherwise, if automatic
11570 # publication is switched on, default value is used for result name.
11572 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11574 # @ref swig_Propagate "Example"
11575 def Propagate(self, theShape, theName=None):
11577 Build all possible propagation groups.
11578 Propagation group is a set of all edges, opposite to one (main)
11579 edge of this group directly or through other opposite edges.
11580 Notion of Opposite Edge make sence only on quadrangle face.
11583 theShape Shape to build propagation groups on.
11584 theName Object name; when specified, this parameter is used
11585 for result publication in the study. Otherwise, if automatic
11586 publication is switched on, default value is used for result name.
11589 List of GEOM.GEOM_Object, each of them is a propagation group.
11591 # Example: see GEOM_TestOthers.py
11592 listChains = self.BlocksOp.Propagate(theShape)
11593 RaiseIfFailed("Propagate", self.BlocksOp)
11594 self._autoPublish(listChains, theName, "propagate")
11597 # end of l3_blocks_op
11600 ## @addtogroup l3_groups
11603 ## Creates a new group which will store sub-shapes of theMainShape
11604 # @param theMainShape is a GEOM object on which the group is selected
11605 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11606 # @param theName Object name; when specified, this parameter is used
11607 # for result publication in the study. Otherwise, if automatic
11608 # publication is switched on, default value is used for result name.
11610 # @return a newly created GEOM group (GEOM.GEOM_Object)
11612 # @ref tui_working_with_groups_page "Example 1"
11613 # \n @ref swig_CreateGroup "Example 2"
11614 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11616 Creates a new group which will store sub-shapes of theMainShape
11619 theMainShape is a GEOM object on which the group is selected
11620 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11621 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11622 theName Object name; when specified, this parameter is used
11623 for result publication in the study. Otherwise, if automatic
11624 publication is switched on, default value is used for result name.
11627 a newly created GEOM group
11630 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11633 # Example: see GEOM_TestOthers.py
11634 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11635 RaiseIfFailed("CreateGroup", self.GroupOp)
11636 self._autoPublish(anObj, theName, "group")
11639 ## Adds a sub-object with ID theSubShapeId to the group
11640 # @param theGroup is a GEOM group to which the new sub-shape is added
11641 # @param theSubShapeID is a sub-shape ID in the main object.
11642 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11644 # @ref tui_working_with_groups_page "Example"
11645 def AddObject(self,theGroup, theSubShapeID):
11647 Adds a sub-object with ID theSubShapeId to the group
11650 theGroup is a GEOM group to which the new sub-shape is added
11651 theSubShapeID is a sub-shape ID in the main object.
11654 Use method GetSubShapeID() to get an unique ID of the sub-shape
11656 # Example: see GEOM_TestOthers.py
11657 self.GroupOp.AddObject(theGroup, theSubShapeID)
11658 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11659 RaiseIfFailed("AddObject", self.GroupOp)
11663 ## Removes a sub-object with ID \a theSubShapeId from the group
11664 # @param theGroup is a GEOM group from which the new sub-shape is removed
11665 # @param theSubShapeID is a sub-shape ID in the main object.
11666 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11668 # @ref tui_working_with_groups_page "Example"
11669 def RemoveObject(self,theGroup, theSubShapeID):
11671 Removes a sub-object with ID theSubShapeId from the group
11674 theGroup is a GEOM group from which the new sub-shape is removed
11675 theSubShapeID is a sub-shape ID in the main object.
11678 Use method GetSubShapeID() to get an unique ID of the sub-shape
11680 # Example: see GEOM_TestOthers.py
11681 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11682 RaiseIfFailed("RemoveObject", self.GroupOp)
11685 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11686 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11687 # @param theSubShapes is a list of sub-shapes to be added.
11689 # @ref tui_working_with_groups_page "Example"
11690 def UnionList (self,theGroup, theSubShapes):
11692 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11695 theGroup is a GEOM group to which the new sub-shapes are added.
11696 theSubShapes is a list of sub-shapes to be added.
11698 # Example: see GEOM_TestOthers.py
11699 self.GroupOp.UnionList(theGroup, theSubShapes)
11700 RaiseIfFailed("UnionList", self.GroupOp)
11703 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11704 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11705 # @param theSubShapes is a list of indices of sub-shapes to be added.
11707 # @ref swig_UnionIDs "Example"
11708 def UnionIDs(self,theGroup, theSubShapes):
11710 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11713 theGroup is a GEOM group to which the new sub-shapes are added.
11714 theSubShapes is a list of indices of sub-shapes to be added.
11716 # Example: see GEOM_TestOthers.py
11717 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11718 RaiseIfFailed("UnionIDs", self.GroupOp)
11721 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11722 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11723 # @param theSubShapes is a list of sub-shapes to be removed.
11725 # @ref tui_working_with_groups_page "Example"
11726 def DifferenceList (self,theGroup, theSubShapes):
11728 Removes from the group all the given shapes. No errors, if some shapes are not included.
11731 theGroup is a GEOM group from which the sub-shapes are removed.
11732 theSubShapes is a list of sub-shapes to be removed.
11734 # Example: see GEOM_TestOthers.py
11735 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11736 RaiseIfFailed("DifferenceList", self.GroupOp)
11739 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11740 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11741 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11743 # @ref swig_DifferenceIDs "Example"
11744 def DifferenceIDs(self,theGroup, theSubShapes):
11746 Removes from the group all the given shapes. No errors, if some shapes are not included.
11749 theGroup is a GEOM group from which the sub-shapes are removed.
11750 theSubShapes is a list of indices of sub-shapes to be removed.
11752 # Example: see GEOM_TestOthers.py
11753 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11754 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11757 ## Union of two groups.
11758 # New group is created. It will contain all entities
11759 # which are present in groups theGroup1 and theGroup2.
11760 # @param theGroup1, theGroup2 are the initial GEOM groups
11761 # to create the united group from.
11762 # @param theName Object name; when specified, this parameter is used
11763 # for result publication in the study. Otherwise, if automatic
11764 # publication is switched on, default value is used for result name.
11766 # @return a newly created GEOM group.
11768 # @ref tui_union_groups_anchor "Example"
11769 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11771 Union of two groups.
11772 New group is created. It will contain all entities
11773 which are present in groups theGroup1 and theGroup2.
11776 theGroup1, theGroup2 are the initial GEOM groups
11777 to create the united group from.
11778 theName Object name; when specified, this parameter is used
11779 for result publication in the study. Otherwise, if automatic
11780 publication is switched on, default value is used for result name.
11783 a newly created GEOM group.
11785 # Example: see GEOM_TestOthers.py
11786 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11787 RaiseIfFailed("UnionGroups", self.GroupOp)
11788 self._autoPublish(aGroup, theName, "group")
11791 ## Intersection of two groups.
11792 # New group is created. It will contain only those entities
11793 # which are present in both groups theGroup1 and theGroup2.
11794 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11795 # @param theName Object name; when specified, this parameter is used
11796 # for result publication in the study. Otherwise, if automatic
11797 # publication is switched on, default value is used for result name.
11799 # @return a newly created GEOM group.
11801 # @ref tui_intersect_groups_anchor "Example"
11802 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11804 Intersection of two groups.
11805 New group is created. It will contain only those entities
11806 which are present in both groups theGroup1 and theGroup2.
11809 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11810 theName Object name; when specified, this parameter is used
11811 for result publication in the study. Otherwise, if automatic
11812 publication is switched on, default value is used for result name.
11815 a newly created GEOM group.
11817 # Example: see GEOM_TestOthers.py
11818 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11819 RaiseIfFailed("IntersectGroups", self.GroupOp)
11820 self._autoPublish(aGroup, theName, "group")
11823 ## Cut of two groups.
11824 # New group is created. It will contain entities which are
11825 # present in group theGroup1 but are not present in group theGroup2.
11826 # @param theGroup1 is a GEOM group to include elements of.
11827 # @param theGroup2 is a GEOM group to exclude elements of.
11828 # @param theName Object name; when specified, this parameter is used
11829 # for result publication in the study. Otherwise, if automatic
11830 # publication is switched on, default value is used for result name.
11832 # @return a newly created GEOM group.
11834 # @ref tui_cut_groups_anchor "Example"
11835 def CutGroups (self, theGroup1, theGroup2, theName=None):
11838 New group is created. It will contain entities which are
11839 present in group theGroup1 but are not present in group theGroup2.
11842 theGroup1 is a GEOM group to include elements of.
11843 theGroup2 is a GEOM group to exclude elements of.
11844 theName Object name; when specified, this parameter is used
11845 for result publication in the study. Otherwise, if automatic
11846 publication is switched on, default value is used for result name.
11849 a newly created GEOM group.
11851 # Example: see GEOM_TestOthers.py
11852 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11853 RaiseIfFailed("CutGroups", self.GroupOp)
11854 self._autoPublish(aGroup, theName, "group")
11857 ## Union of list of groups.
11858 # New group is created. It will contain all entities that are
11859 # present in groups listed in theGList.
11860 # @param theGList is a list of GEOM groups to create the united group from.
11861 # @param theName Object name; when specified, this parameter is used
11862 # for result publication in the study. Otherwise, if automatic
11863 # publication is switched on, default value is used for result name.
11865 # @return a newly created GEOM group.
11867 # @ref tui_union_groups_anchor "Example"
11868 def UnionListOfGroups (self, theGList, theName=None):
11870 Union of list of groups.
11871 New group is created. It will contain all entities that are
11872 present in groups listed in theGList.
11875 theGList is a list of GEOM groups to create the united group from.
11876 theName Object name; when specified, this parameter is used
11877 for result publication in the study. Otherwise, if automatic
11878 publication is switched on, default value is used for result name.
11881 a newly created GEOM group.
11883 # Example: see GEOM_TestOthers.py
11884 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11885 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11886 self._autoPublish(aGroup, theName, "group")
11889 ## Cut of lists of groups.
11890 # New group is created. It will contain only entities
11891 # which are present in groups listed in theGList.
11892 # @param theGList is a list of GEOM groups to include elements of.
11893 # @param theName Object name; when specified, this parameter is used
11894 # for result publication in the study. Otherwise, if automatic
11895 # publication is switched on, default value is used for result name.
11897 # @return a newly created GEOM group.
11899 # @ref tui_intersect_groups_anchor "Example"
11900 def IntersectListOfGroups (self, theGList, theName=None):
11902 Cut of lists of groups.
11903 New group is created. It will contain only entities
11904 which are present in groups listed in theGList.
11907 theGList is a list of GEOM groups to include elements of.
11908 theName Object name; when specified, this parameter is used
11909 for result publication in the study. Otherwise, if automatic
11910 publication is switched on, default value is used for result name.
11913 a newly created GEOM group.
11915 # Example: see GEOM_TestOthers.py
11916 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11917 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11918 self._autoPublish(aGroup, theName, "group")
11921 ## Cut of lists of groups.
11922 # New group is created. It will contain only entities
11923 # which are present in groups listed in theGList1 but
11924 # are not present in groups from theGList2.
11925 # @param theGList1 is a list of GEOM groups to include elements of.
11926 # @param theGList2 is a list of GEOM groups to exclude elements of.
11927 # @param theName Object name; when specified, this parameter is used
11928 # for result publication in the study. Otherwise, if automatic
11929 # publication is switched on, default value is used for result name.
11931 # @return a newly created GEOM group.
11933 # @ref tui_cut_groups_anchor "Example"
11934 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11936 Cut of lists of groups.
11937 New group is created. It will contain only entities
11938 which are present in groups listed in theGList1 but
11939 are not present in groups from theGList2.
11942 theGList1 is a list of GEOM groups to include elements of.
11943 theGList2 is a list of GEOM groups to exclude elements of.
11944 theName Object name; when specified, this parameter is used
11945 for result publication in the study. Otherwise, if automatic
11946 publication is switched on, default value is used for result name.
11949 a newly created GEOM group.
11951 # Example: see GEOM_TestOthers.py
11952 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11953 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11954 self._autoPublish(aGroup, theName, "group")
11957 ## Returns a list of sub-objects ID stored in the group
11958 # @param theGroup is a GEOM group for which a list of IDs is requested
11960 # @ref swig_GetObjectIDs "Example"
11961 def GetObjectIDs(self,theGroup):
11963 Returns a list of sub-objects ID stored in the group
11966 theGroup is a GEOM group for which a list of IDs is requested
11968 # Example: see GEOM_TestOthers.py
11969 ListIDs = self.GroupOp.GetObjects(theGroup)
11970 RaiseIfFailed("GetObjects", self.GroupOp)
11973 ## Returns a type of sub-objects stored in the group
11974 # @param theGroup is a GEOM group which type is returned.
11976 # @ref swig_GetType "Example"
11977 def GetType(self,theGroup):
11979 Returns a type of sub-objects stored in the group
11982 theGroup is a GEOM group which type is returned.
11984 # Example: see GEOM_TestOthers.py
11985 aType = self.GroupOp.GetType(theGroup)
11986 RaiseIfFailed("GetType", self.GroupOp)
11989 ## Convert a type of geom object from id to string value
11990 # @param theId is a GEOM obect type id.
11991 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11992 # @ref swig_GetType "Example"
11993 def ShapeIdToType(self, theId):
11995 Convert a type of geom object from id to string value
11998 theId is a GEOM obect type id.
12001 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12028 return "REVOLUTION"
12076 return "FREE_BOUNDS"
12084 return "THRUSECTIONS"
12086 return "COMPOUNDFILTER"
12088 return "SHAPES_ON_SHAPE"
12090 return "ELLIPSE_ARC"
12092 return "3DSKETCHER"
12098 return "PIPETSHAPE"
12099 return "Shape Id not exist."
12101 ## Returns a main shape associated with the group
12102 # @param theGroup is a GEOM group for which a main shape object is requested
12103 # @return a GEOM object which is a main shape for theGroup
12105 # @ref swig_GetMainShape "Example"
12106 def GetMainShape(self,theGroup):
12108 Returns a main shape associated with the group
12111 theGroup is a GEOM group for which a main shape object is requested
12114 a GEOM object which is a main shape for theGroup
12116 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12118 # Example: see GEOM_TestOthers.py
12119 anObj = self.GroupOp.GetMainShape(theGroup)
12120 RaiseIfFailed("GetMainShape", self.GroupOp)
12123 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12124 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12125 # @param theShape given shape (see GEOM.GEOM_Object)
12126 # @param min_length minimum length of edges of theShape
12127 # @param max_length maximum length of edges of theShape
12128 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12129 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12130 # @param theName Object name; when specified, this parameter is used
12131 # for result publication in the study. Otherwise, if automatic
12132 # publication is switched on, default value is used for result name.
12134 # @return a newly created GEOM group of edges
12136 # @@ref swig_todo "Example"
12137 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12139 Create group of edges of theShape, whose length is in range [min_length, max_length].
12140 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12143 theShape given shape
12144 min_length minimum length of edges of theShape
12145 max_length maximum length of edges of theShape
12146 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12147 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12148 theName Object name; when specified, this parameter is used
12149 for result publication in the study. Otherwise, if automatic
12150 publication is switched on, default value is used for result name.
12153 a newly created GEOM group of edges.
12155 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12156 edges_in_range = []
12158 Props = self.BasicProperties(edge)
12159 if min_length <= Props[0] and Props[0] <= max_length:
12160 if (not include_min) and (min_length == Props[0]):
12163 if (not include_max) and (Props[0] == max_length):
12166 edges_in_range.append(edge)
12168 if len(edges_in_range) <= 0:
12169 print "No edges found by given criteria"
12172 # note: auto-publishing is done in self.CreateGroup()
12173 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12174 self.UnionList(group_edges, edges_in_range)
12178 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12179 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12180 # @param min_length minimum length of edges of selected shape
12181 # @param max_length maximum length of edges of selected shape
12182 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12183 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12184 # @return a newly created GEOM group of edges
12185 # @ref swig_todo "Example"
12186 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12188 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12189 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12192 min_length minimum length of edges of selected shape
12193 max_length maximum length of edges of selected shape
12194 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12195 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12198 a newly created GEOM group of edges.
12200 nb_selected = sg.SelectedCount()
12201 if nb_selected < 1:
12202 print "Select a shape before calling this function, please."
12204 if nb_selected > 1:
12205 print "Only one shape must be selected"
12208 id_shape = sg.getSelected(0)
12209 shape = IDToObject( id_shape )
12211 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12215 if include_min: left_str = " <= "
12216 if include_max: right_str = " <= "
12218 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12219 + left_str + "length" + right_str + `max_length`)
12221 sg.updateObjBrowser(1)
12228 ## @addtogroup l4_advanced
12231 ## Create a T-shape object with specified caracteristics for the main
12232 # and the incident pipes (radius, width, half-length).
12233 # The extremities of the main pipe are located on junctions points P1 and P2.
12234 # The extremity of the incident pipe is located on junction point P3.
12235 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12236 # the main plane of the T-shape is XOY.
12238 # @param theR1 Internal radius of main pipe
12239 # @param theW1 Width of main pipe
12240 # @param theL1 Half-length of main pipe
12241 # @param theR2 Internal radius of incident pipe (R2 < R1)
12242 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12243 # @param theL2 Half-length of incident pipe
12245 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12246 # @param theP1 1st junction point of main pipe
12247 # @param theP2 2nd junction point of main pipe
12248 # @param theP3 Junction point of incident pipe
12250 # @param theRL Internal radius of left thickness reduction
12251 # @param theWL Width of left thickness reduction
12252 # @param theLtransL Length of left transition part
12253 # @param theLthinL Length of left thin part
12255 # @param theRR Internal radius of right thickness reduction
12256 # @param theWR Width of right thickness reduction
12257 # @param theLtransR Length of right transition part
12258 # @param theLthinR Length of right thin part
12260 # @param theRI Internal radius of incident thickness reduction
12261 # @param theWI Width of incident thickness reduction
12262 # @param theLtransI Length of incident transition part
12263 # @param theLthinI Length of incident thin part
12265 # @param theName Object name; when specified, this parameter is used
12266 # for result publication in the study. Otherwise, if automatic
12267 # publication is switched on, default value is used for result name.
12269 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12271 # @ref tui_creation_pipetshape "Example"
12272 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12273 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12274 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12275 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12276 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12279 Create a T-shape object with specified caracteristics for the main
12280 and the incident pipes (radius, width, half-length).
12281 The extremities of the main pipe are located on junctions points P1 and P2.
12282 The extremity of the incident pipe is located on junction point P3.
12283 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12284 the main plane of the T-shape is XOY.
12287 theR1 Internal radius of main pipe
12288 theW1 Width of main pipe
12289 theL1 Half-length of main pipe
12290 theR2 Internal radius of incident pipe (R2 < R1)
12291 theW2 Width of incident pipe (R2+W2 < R1+W1)
12292 theL2 Half-length of incident pipe
12293 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12294 theP1 1st junction point of main pipe
12295 theP2 2nd junction point of main pipe
12296 theP3 Junction point of incident pipe
12298 theRL Internal radius of left thickness reduction
12299 theWL Width of left thickness reduction
12300 theLtransL Length of left transition part
12301 theLthinL Length of left thin part
12303 theRR Internal radius of right thickness reduction
12304 theWR Width of right thickness reduction
12305 theLtransR Length of right transition part
12306 theLthinR Length of right thin part
12308 theRI Internal radius of incident thickness reduction
12309 theWI Width of incident thickness reduction
12310 theLtransI Length of incident transition part
12311 theLthinI Length of incident thin part
12313 theName Object name; when specified, this parameter is used
12314 for result publication in the study. Otherwise, if automatic
12315 publication is switched on, default value is used for result name.
12318 List of GEOM_Object, containing the created shape and propagation groups.
12321 # create PipeTShape object
12322 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12323 # create PipeTShape object with position
12324 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12325 # create PipeTShape object with left thickness reduction
12326 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12328 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)
12329 if (theP1 and theP2 and theP3):
12330 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12331 theRL, theWL, theLtransL, theLthinL,
12332 theRR, theWR, theLtransR, theLthinR,
12333 theRI, theWI, theLtransI, theLthinI,
12334 theHexMesh, theP1, theP2, theP3)
12336 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12337 theRL, theWL, theLtransL, theLthinL,
12338 theRR, theWR, theLtransR, theLthinR,
12339 theRI, theWI, theLtransI, theLthinI,
12341 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12342 if Parameters: anObj[0].SetParameters(Parameters)
12343 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12344 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12347 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12348 # and the incident pipes (radius, width, half-length). The chamfer is
12349 # created on the junction of the pipes.
12350 # The extremities of the main pipe are located on junctions points P1 and P2.
12351 # The extremity of the incident pipe is located on junction point P3.
12352 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12353 # the main plane of the T-shape is XOY.
12354 # @param theR1 Internal radius of main pipe
12355 # @param theW1 Width of main pipe
12356 # @param theL1 Half-length of main pipe
12357 # @param theR2 Internal radius of incident pipe (R2 < R1)
12358 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12359 # @param theL2 Half-length of incident pipe
12360 # @param theH Height of the chamfer.
12361 # @param theW Width of the chamfer.
12362 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12363 # @param theP1 1st junction point of main pipe
12364 # @param theP2 2nd junction point of main pipe
12365 # @param theP3 Junction point of incident pipe
12367 # @param theRL Internal radius of left thickness reduction
12368 # @param theWL Width of left thickness reduction
12369 # @param theLtransL Length of left transition part
12370 # @param theLthinL Length of left thin part
12372 # @param theRR Internal radius of right thickness reduction
12373 # @param theWR Width of right thickness reduction
12374 # @param theLtransR Length of right transition part
12375 # @param theLthinR Length of right thin part
12377 # @param theRI Internal radius of incident thickness reduction
12378 # @param theWI Width of incident thickness reduction
12379 # @param theLtransI Length of incident transition part
12380 # @param theLthinI Length of incident thin part
12382 # @param theName Object name; when specified, this parameter is used
12383 # for result publication in the study. Otherwise, if automatic
12384 # publication is switched on, default value is used for result name.
12386 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12388 # @ref tui_creation_pipetshape "Example"
12389 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12390 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12391 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12392 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12393 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12396 Create a T-shape object with chamfer and with specified caracteristics for the main
12397 and the incident pipes (radius, width, half-length). The chamfer is
12398 created on the junction of the pipes.
12399 The extremities of the main pipe are located on junctions points P1 and P2.
12400 The extremity of the incident pipe is located on junction point P3.
12401 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12402 the main plane of the T-shape is XOY.
12405 theR1 Internal radius of main pipe
12406 theW1 Width of main pipe
12407 theL1 Half-length of main pipe
12408 theR2 Internal radius of incident pipe (R2 < R1)
12409 theW2 Width of incident pipe (R2+W2 < R1+W1)
12410 theL2 Half-length of incident pipe
12411 theH Height of the chamfer.
12412 theW Width of the chamfer.
12413 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12414 theP1 1st junction point of main pipe
12415 theP2 2nd junction point of main pipe
12416 theP3 Junction point of incident pipe
12418 theRL Internal radius of left thickness reduction
12419 theWL Width of left thickness reduction
12420 theLtransL Length of left transition part
12421 theLthinL Length of left thin part
12423 theRR Internal radius of right thickness reduction
12424 theWR Width of right thickness reduction
12425 theLtransR Length of right transition part
12426 theLthinR Length of right thin part
12428 theRI Internal radius of incident thickness reduction
12429 theWI Width of incident thickness reduction
12430 theLtransI Length of incident transition part
12431 theLthinI Length of incident thin part
12433 theName Object name; when specified, this parameter is used
12434 for result publication in the study. Otherwise, if automatic
12435 publication is switched on, default value is used for result name.
12438 List of GEOM_Object, containing the created shape and propagation groups.
12441 # create PipeTShape with chamfer object
12442 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12443 # create PipeTShape with chamfer object with position
12444 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12445 # create PipeTShape with chamfer object with left thickness reduction
12446 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)
12448 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)
12449 if (theP1 and theP2 and theP3):
12450 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12451 theRL, theWL, theLtransL, theLthinL,
12452 theRR, theWR, theLtransR, theLthinR,
12453 theRI, theWI, theLtransI, theLthinI,
12454 theH, theW, theHexMesh, theP1, theP2, theP3)
12456 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12457 theRL, theWL, theLtransL, theLthinL,
12458 theRR, theWR, theLtransR, theLthinR,
12459 theRI, theWI, theLtransI, theLthinI,
12460 theH, theW, theHexMesh)
12461 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12462 if Parameters: anObj[0].SetParameters(Parameters)
12463 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12464 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12467 ## Create a T-shape object with fillet and with specified caracteristics for the main
12468 # and the incident pipes (radius, width, half-length). The fillet is
12469 # created on the junction of the pipes.
12470 # The extremities of the main pipe are located on junctions points P1 and P2.
12471 # The extremity of the incident pipe is located on junction point P3.
12472 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12473 # the main plane of the T-shape is XOY.
12474 # @param theR1 Internal radius of main pipe
12475 # @param theW1 Width of main pipe
12476 # @param theL1 Half-length of main pipe
12477 # @param theR2 Internal radius of incident pipe (R2 < R1)
12478 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12479 # @param theL2 Half-length of incident pipe
12480 # @param theRF Radius of curvature of fillet.
12481 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12482 # @param theP1 1st junction point of main pipe
12483 # @param theP2 2nd junction point of main pipe
12484 # @param theP3 Junction point of incident pipe
12486 # @param theRL Internal radius of left thickness reduction
12487 # @param theWL Width of left thickness reduction
12488 # @param theLtransL Length of left transition part
12489 # @param theLthinL Length of left thin part
12491 # @param theRR Internal radius of right thickness reduction
12492 # @param theWR Width of right thickness reduction
12493 # @param theLtransR Length of right transition part
12494 # @param theLthinR Length of right thin part
12496 # @param theRI Internal radius of incident thickness reduction
12497 # @param theWI Width of incident thickness reduction
12498 # @param theLtransI Length of incident transition part
12499 # @param theLthinI Length of incident thin part
12501 # @param theName Object name; when specified, this parameter is used
12502 # for result publication in the study. Otherwise, if automatic
12503 # publication is switched on, default value is used for result name.
12505 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12507 # @ref tui_creation_pipetshape "Example"
12508 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12509 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12510 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12511 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12512 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12515 Create a T-shape object with fillet and with specified caracteristics for the main
12516 and the incident pipes (radius, width, half-length). The fillet is
12517 created on the junction of the pipes.
12518 The extremities of the main pipe are located on junctions points P1 and P2.
12519 The extremity of the incident pipe is located on junction point P3.
12522 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12523 the main plane of the T-shape is XOY.
12524 theR1 Internal radius of main pipe
12525 theW1 Width of main pipe
12526 heL1 Half-length of main pipe
12527 theR2 Internal radius of incident pipe (R2 < R1)
12528 theW2 Width of incident pipe (R2+W2 < R1+W1)
12529 theL2 Half-length of incident pipe
12530 theRF Radius of curvature of fillet.
12531 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12532 theP1 1st junction point of main pipe
12533 theP2 2nd junction point of main pipe
12534 theP3 Junction point of incident pipe
12536 theRL Internal radius of left thickness reduction
12537 theWL Width of left thickness reduction
12538 theLtransL Length of left transition part
12539 theLthinL Length of left thin part
12541 theRR Internal radius of right thickness reduction
12542 theWR Width of right thickness reduction
12543 theLtransR Length of right transition part
12544 theLthinR Length of right thin part
12546 theRI Internal radius of incident thickness reduction
12547 theWI Width of incident thickness reduction
12548 theLtransI Length of incident transition part
12549 theLthinI Length of incident thin part
12551 theName Object name; when specified, this parameter is used
12552 for result publication in the study. Otherwise, if automatic
12553 publication is switched on, default value is used for result name.
12556 List of GEOM_Object, containing the created shape and propagation groups.
12559 # create PipeTShape with fillet object
12560 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12561 # create PipeTShape with fillet object with position
12562 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12563 # create PipeTShape with fillet object with left thickness reduction
12564 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)
12566 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)
12567 if (theP1 and theP2 and theP3):
12568 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12569 theRL, theWL, theLtransL, theLthinL,
12570 theRR, theWR, theLtransR, theLthinR,
12571 theRI, theWI, theLtransI, theLthinI,
12572 theRF, theHexMesh, theP1, theP2, theP3)
12574 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12575 theRL, theWL, theLtransL, theLthinL,
12576 theRR, theWR, theLtransR, theLthinR,
12577 theRI, theWI, theLtransI, theLthinI,
12579 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12580 if Parameters: anObj[0].SetParameters(Parameters)
12581 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12582 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12585 ## This function allows creating a disk already divided into blocks. It
12586 # can be used to create divided pipes for later meshing in hexaedra.
12587 # @param theR Radius of the disk
12588 # @param theOrientation Orientation of the plane on which the disk will be built
12589 # 1 = XOY, 2 = OYZ, 3 = OZX
12590 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12591 # @param theName Object name; when specified, this parameter is used
12592 # for result publication in the study. Otherwise, if automatic
12593 # publication is switched on, default value is used for result name.
12595 # @return New GEOM_Object, containing the created shape.
12597 # @ref tui_creation_divideddisk "Example"
12598 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12600 Creates a disk, divided into blocks. It can be used to create divided pipes
12601 for later meshing in hexaedra.
12604 theR Radius of the disk
12605 theOrientation Orientation of the plane on which the disk will be built:
12606 1 = XOY, 2 = OYZ, 3 = OZX
12607 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12608 theName Object name; when specified, this parameter is used
12609 for result publication in the study. Otherwise, if automatic
12610 publication is switched on, default value is used for result name.
12613 New GEOM_Object, containing the created shape.
12615 theR, Parameters = ParseParameters(theR)
12616 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12617 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12618 if Parameters: anObj.SetParameters(Parameters)
12619 self._autoPublish(anObj, theName, "dividedDisk")
12622 ## This function allows creating a disk already divided into blocks. It
12623 # can be used to create divided pipes for later meshing in hexaedra.
12624 # @param theCenter Center of the disk
12625 # @param theVector Normal vector to the plane of the created disk
12626 # @param theRadius Radius of the disk
12627 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12628 # @param theName Object name; when specified, this parameter is used
12629 # for result publication in the study. Otherwise, if automatic
12630 # publication is switched on, default value is used for result name.
12632 # @return New GEOM_Object, containing the created shape.
12634 # @ref tui_creation_divideddisk "Example"
12635 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12637 Creates a disk already divided into blocks. It can be used to create divided pipes
12638 for later meshing in hexaedra.
12641 theCenter Center of the disk
12642 theVector Normal vector to the plane of the created disk
12643 theRadius Radius of the disk
12644 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12645 theName Object name; when specified, this parameter is used
12646 for result publication in the study. Otherwise, if automatic
12647 publication is switched on, default value is used for result name.
12650 New GEOM_Object, containing the created shape.
12652 theRadius, Parameters = ParseParameters(theRadius)
12653 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12654 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12655 if Parameters: anObj.SetParameters(Parameters)
12656 self._autoPublish(anObj, theName, "dividedDisk")
12659 ## Builds a cylinder prepared for hexa meshes
12660 # @param theR Radius of the cylinder
12661 # @param theH Height of the cylinder
12662 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12663 # @param theName Object name; when specified, this parameter is used
12664 # for result publication in the study. Otherwise, if automatic
12665 # publication is switched on, default value is used for result name.
12667 # @return New GEOM_Object, containing the created shape.
12669 # @ref tui_creation_dividedcylinder "Example"
12670 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12672 Builds a cylinder prepared for hexa meshes
12675 theR Radius of the cylinder
12676 theH Height of the cylinder
12677 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12678 theName Object name; when specified, this parameter is used
12679 for result publication in the study. Otherwise, if automatic
12680 publication is switched on, default value is used for result name.
12683 New GEOM_Object, containing the created shape.
12685 theR, theH, Parameters = ParseParameters(theR, theH)
12686 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12687 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12688 if Parameters: anObj.SetParameters(Parameters)
12689 self._autoPublish(anObj, theName, "dividedCylinder")
12692 ## Create a surface from a cloud of points
12693 # @param thelPoints list of points. Compounds of points are
12694 # accepted as well.
12695 # @param theNbMax maximum number of Bezier pieces in the resulting
12697 # @param theDegMax maximum degree of the resulting BSpline surface.
12698 # @param theDMax 3D tolerance of initial approximation.
12699 # @param theName Object name; when specified, this parameter is used
12700 # for result publication in the study. Otherwise, if automatic
12701 # publication is switched on, default value is used for result name.
12702 # @return New GEOM_Object, containing the created shape.
12703 # @note 3D tolerance of initial approximation represents a tolerance of
12704 # initial plate surface approximation. If this parameter is equal
12705 # to 0 (default value) it is computed. In this case an error of
12706 # initial plate surface computation is used as the approximation
12707 # tolerance. This error represents a maximal distance between
12708 # computed plate surface and given points.
12710 # @ref tui_creation_smoothingsurface "Example"
12711 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
12712 theDMax=0.0, theName=None):
12714 Create a surface from a cloud of points
12717 thelPoints list of points. Compounds of points are
12719 theNbMax maximum number of Bezier pieces in the resulting
12721 theDegMax maximum degree of the resulting BSpline surface.
12722 theDMax 3D tolerance of initial approximation.
12723 theName Object name; when specified, this parameter is used
12724 for result publication in the study. Otherwise, if automatic
12725 publication is switched on, default value is used for result name.
12728 New GEOM_Object, containing the created shape.
12731 3D tolerance of initial approximation represents a tolerance of
12732 initial plate surface approximation. If this parameter is equal
12733 to 0 (default value) it is computed. In this case an error of
12734 initial plate surface computation is used as the approximation
12735 tolerance. This error represents a maximal distance between
12736 computed plate surface and given points.
12738 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
12739 theDegMax, theDMax)
12740 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12741 self._autoPublish(anObj, theName, "smoothing")
12744 ## Export a shape to XAO format
12745 # @param shape The shape to export
12746 # @param groups The list of groups to export
12747 # @param fields The list of fields to export
12748 # @param author The author of the export
12749 # @param fileName The name of the file to export
12752 # @ref tui_exportxao "Example"
12753 def ExportXAO(self, shape, groups, fields, author, fileName):
12754 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12755 RaiseIfFailed("ExportXAO", self.InsertOp)
12758 ## Import a shape from XAO format
12759 # @param shape Shape to export
12760 # @param fileName The name of the file to import
12761 # @return tuple (res, shape, subShapes, groups, fields)
12762 # res Flag indicating if the import was successful
12763 # shape The imported shape
12764 # subShapes The list of imported subShapes
12765 # groups The list of imported groups
12766 # fields The list of imported fields
12768 # @ref tui_importxao "Example"
12769 def ImportXAO(self, fileName):
12770 res = self.InsertOp.ImportXAO(fileName)
12771 RaiseIfFailed("ImportXAO", self.InsertOp)
12774 #@@ insert new functions before this line @@ do not remove this line @@#
12776 # end of l4_advanced
12779 ## Create a copy of the given object
12781 # @param theOriginal geometry object for copy
12782 # @param theName Object name; when specified, this parameter is used
12783 # for result publication in the study. Otherwise, if automatic
12784 # publication is switched on, default value is used for result name.
12786 # @return New GEOM_Object, containing the copied shape.
12788 # @ingroup l1_geomBuilder_auxiliary
12789 # @ref swig_MakeCopy "Example"
12790 def MakeCopy(self, theOriginal, theName=None):
12792 Create a copy of the given object
12795 theOriginal geometry object for copy
12796 theName Object name; when specified, this parameter is used
12797 for result publication in the study. Otherwise, if automatic
12798 publication is switched on, default value is used for result name.
12801 New GEOM_Object, containing the copied shape.
12803 Example of usage: Copy = geompy.MakeCopy(Box)
12805 # Example: see GEOM_TestAll.py
12806 anObj = self.InsertOp.MakeCopy(theOriginal)
12807 RaiseIfFailed("MakeCopy", self.InsertOp)
12808 self._autoPublish(anObj, theName, "copy")
12811 ## Add Path to load python scripts from
12812 # @param Path a path to load python scripts from
12813 # @ingroup l1_geomBuilder_auxiliary
12814 def addPath(self,Path):
12816 Add Path to load python scripts from
12819 Path a path to load python scripts from
12821 if (sys.path.count(Path) < 1):
12822 sys.path.append(Path)
12826 ## Load marker texture from the file
12827 # @param Path a path to the texture file
12828 # @return unique texture identifier
12829 # @ingroup l1_geomBuilder_auxiliary
12830 def LoadTexture(self, Path):
12832 Load marker texture from the file
12835 Path a path to the texture file
12838 unique texture identifier
12840 # Example: see GEOM_TestAll.py
12841 ID = self.InsertOp.LoadTexture(Path)
12842 RaiseIfFailed("LoadTexture", self.InsertOp)
12845 ## Get internal name of the object based on its study entry
12846 # @note This method does not provide an unique identifier of the geometry object.
12847 # @note This is internal function of GEOM component, though it can be used outside it for
12848 # appropriate reason (e.g. for identification of geometry object).
12849 # @param obj geometry object
12850 # @return unique object identifier
12851 # @ingroup l1_geomBuilder_auxiliary
12852 def getObjectID(self, obj):
12854 Get internal name of the object based on its study entry.
12855 Note: this method does not provide an unique identifier of the geometry object.
12856 It is an internal function of GEOM component, though it can be used outside GEOM for
12857 appropriate reason (e.g. for identification of geometry object).
12860 obj geometry object
12863 unique object identifier
12866 entry = salome.ObjectToID(obj)
12867 if entry is not None:
12868 lst = entry.split(":")
12870 ID = lst[-1] # -1 means last item in the list
12871 return "GEOM_" + ID
12876 ## Add marker texture. @a Width and @a Height parameters
12877 # specify width and height of the texture in pixels.
12878 # If @a RowData is @c True, @a Texture parameter should represent texture data
12879 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12880 # parameter should be unpacked string, in which '1' symbols represent opaque
12881 # pixels and '0' represent transparent pixels of the texture bitmap.
12883 # @param Width texture width in pixels
12884 # @param Height texture height in pixels
12885 # @param Texture texture data
12886 # @param RowData if @c True, @a Texture data are packed in the byte stream
12887 # @return unique texture identifier
12888 # @ingroup l1_geomBuilder_auxiliary
12889 def AddTexture(self, Width, Height, Texture, RowData=False):
12891 Add marker texture. Width and Height parameters
12892 specify width and height of the texture in pixels.
12893 If RowData is True, Texture parameter should represent texture data
12894 packed into the byte array. If RowData is False (default), Texture
12895 parameter should be unpacked string, in which '1' symbols represent opaque
12896 pixels and '0' represent transparent pixels of the texture bitmap.
12899 Width texture width in pixels
12900 Height texture height in pixels
12901 Texture texture data
12902 RowData if True, Texture data are packed in the byte stream
12905 return unique texture identifier
12907 if not RowData: Texture = PackData(Texture)
12908 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12909 RaiseIfFailed("AddTexture", self.InsertOp)
12912 ## Creates a new folder object. It is a container for any GEOM objects.
12913 # @param Name name of the container
12914 # @param Father parent object. If None,
12915 # folder under 'Geometry' root object will be created.
12916 # @return a new created folder
12917 # @ingroup l1_publish_data
12918 def NewFolder(self, Name, Father=None):
12920 Create a new folder object. It is an auxiliary container for any GEOM objects.
12923 Name name of the container
12924 Father parent object. If None,
12925 folder under 'Geometry' root object will be created.
12928 a new created folder
12930 if not Father: Father = self.father
12931 return self.CreateFolder(Name, Father)
12933 ## Move object to the specified folder
12934 # @param Object object to move
12935 # @param Folder target folder
12936 # @ingroup l1_publish_data
12937 def PutToFolder(self, Object, Folder):
12939 Move object to the specified folder
12942 Object object to move
12943 Folder target folder
12945 self.MoveToFolder(Object, Folder)
12948 ## Move list of objects to the specified folder
12949 # @param ListOfSO list of objects to move
12950 # @param Folder target folder
12951 # @ingroup l1_publish_data
12952 def PutListToFolder(self, ListOfSO, Folder):
12954 Move list of objects to the specified folder
12957 ListOfSO list of objects to move
12958 Folder target folder
12960 self.MoveListToFolder(ListOfSO, Folder)
12963 ## @addtogroup l2_field
12967 # @param shape the shape the field lies on
12968 # @param name the field name
12969 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12970 # @param dimension dimension of the shape the field lies on
12971 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12972 # @param componentNames names of components
12973 # @return a created field
12974 def CreateField(self, shape, name, type, dimension, componentNames):
12979 shape the shape the field lies on
12980 name the field name
12981 type type of field data
12982 dimension dimension of the shape the field lies on
12983 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12984 componentNames names of components
12989 if isinstance( type, int ):
12990 if type < 0 or type > 3:
12991 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12992 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12994 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12995 RaiseIfFailed("CreateField", self.FieldOp)
12997 geom._autoPublish( f, "", name)
13000 ## Removes a field from the GEOM component
13001 # @param field the field to remove
13002 def RemoveField(self, field):
13003 "Removes a field from the GEOM component"
13005 if isinstance( field, GEOM._objref_GEOM_Field ):
13006 geom.RemoveObject( field )
13007 elif isinstance( field, geomField ):
13008 geom.RemoveObject( field.field )
13010 raise RuntimeError, "RemoveField() : the object is not a field"
13013 ## Returns number of fields on a shape
13014 def CountFields(self, shape):
13015 "Returns number of fields on a shape"
13016 nb = self.FieldOp.CountFields( shape )
13017 RaiseIfFailed("CountFields", self.FieldOp)
13020 ## Returns all fields on a shape
13021 def GetFields(self, shape):
13022 "Returns all fields on a shape"
13023 ff = self.FieldOp.GetFields( shape )
13024 RaiseIfFailed("GetFields", self.FieldOp)
13027 ## Returns a field on a shape by its name
13028 def GetField(self, shape, name):
13029 "Returns a field on a shape by its name"
13030 f = self.FieldOp.GetField( shape, name )
13031 RaiseIfFailed("GetField", self.FieldOp)
13039 # Register the new proxy for GEOM_Gen
13040 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13043 ## Field on Geometry
13044 # @ingroup l2_field
13045 class geomField( GEOM._objref_GEOM_Field ):
13047 def __init__(self):
13048 GEOM._objref_GEOM_Field.__init__(self)
13049 self.field = GEOM._objref_GEOM_Field
13052 ## Returns the shape the field lies on
13053 def getShape(self):
13054 "Returns the shape the field lies on"
13055 return self.field.GetShape(self)
13057 ## Returns the field name
13059 "Returns the field name"
13060 return self.field.GetName(self)
13062 ## Returns type of field data as integer [0-3]
13064 "Returns type of field data"
13065 return self.field.GetDataType(self)._v
13067 ## Returns type of field data:
13068 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13069 def getTypeEnum(self):
13070 "Returns type of field data"
13071 return self.field.GetDataType(self)
13073 ## Returns dimension of the shape the field lies on:
13074 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13075 def getDimension(self):
13076 """Returns dimension of the shape the field lies on:
13077 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13078 return self.field.GetDimension(self)
13080 ## Returns names of components
13081 def getComponents(self):
13082 "Returns names of components"
13083 return self.field.GetComponents(self)
13085 ## Adds a time step to the field
13086 # @param step the time step number futher used as the step identifier
13087 # @param stamp the time step time
13088 # @param values the values of the time step
13089 def addStep(self, step, stamp, values):
13090 "Adds a time step to the field"
13091 stp = self.field.AddStep( self, step, stamp )
13093 raise RuntimeError, \
13094 "Field.addStep() : Error: step %s already exists in this field"%step
13096 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13097 self.setValues( step, values )
13100 ## Remove a time step from the field
13101 def removeStep(self,step):
13102 "Remove a time step from the field"
13105 stepObj = self.field.GetStep( self, step )
13107 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13110 #traceback.print_exc()
13112 self.field.RemoveStep( self, step )
13114 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13117 ## Returns number of time steps in the field
13118 def countSteps(self):
13119 "Returns number of time steps in the field"
13120 return self.field.CountSteps(self)
13122 ## Returns a list of time step IDs in the field
13123 def getSteps(self):
13124 "Returns a list of time step IDs in the field"
13125 return self.field.GetSteps(self)
13127 ## Returns a time step by its ID
13128 def getStep(self,step):
13129 "Returns a time step by its ID"
13130 stp = self.field.GetStep(self, step)
13132 raise RuntimeError, "Step %s is missing from this field"%step
13135 ## Returns the time of the field step
13136 def getStamp(self,step):
13137 "Returns the time of the field step"
13138 return self.getStep(step).GetStamp()
13140 ## Changes the time of the field step
13141 def setStamp(self, step, stamp):
13142 "Changes the time of the field step"
13143 return self.getStep(step).SetStamp(stamp)
13145 ## Returns values of the field step
13146 def getValues(self, step):
13147 "Returns values of the field step"
13148 return self.getStep(step).GetValues()
13150 ## Changes values of the field step
13151 def setValues(self, step, values):
13152 "Changes values of the field step"
13153 stp = self.getStep(step)
13154 errBeg = "Field.setValues(values) : Error: "
13156 ok = stp.SetValues( values )
13157 except Exception, e:
13159 if excStr.find("WrongPythonType") > 0:
13160 raise RuntimeError, errBeg +\
13161 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13162 raise RuntimeError, errBeg + str(e)
13164 nbOK = self.field.GetArraySize(self)
13167 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13169 raise RuntimeError, errBeg + "failed"
13172 pass # end of class geomField
13174 # Register the new proxy for GEOM_Field
13175 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13178 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13179 # interface to GEOM operations.
13184 # salome.salome_init()
13185 # from salome.geom import geomBuilder
13186 # geompy = geomBuilder.New(salome.myStudy)
13188 # @param study SALOME study, generally obtained by salome.myStudy.
13189 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13190 # @return geomBuilder instance
13191 def New( study, instance=None):
13193 Create a new geomBuilder instance.The geomBuilder class provides the Python
13194 interface to GEOM operations.
13198 salome.salome_init()
13199 from salome.geom import geomBuilder
13200 geompy = geomBuilder.New(salome.myStudy)
13203 study SALOME study, generally obtained by salome.myStudy.
13204 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13206 geomBuilder instance
13208 #print "New geomBuilder ", study, instance
13215 geom = geomBuilder()
13216 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13217 geom.init_geom(study)