1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
258 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
261 def _toListOfNames(_names, _size=-1):
264 if type(_names) in [types.ListType, types.TupleType]:
265 for i in _names: l.append(i)
268 if l and len(l) < _size:
269 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
272 ## Raise an Error, containing the Method_name, if Operation is Failed
273 ## @ingroup l1_geomBuilder_auxiliary
274 def RaiseIfFailed (Method_name, Operation):
275 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
276 Operation.AbortOperation()
277 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
279 Operation.FinishOperation()
282 ## Return list of variables value from salome notebook
283 ## @ingroup l1_geomBuilder_auxiliary
284 def ParseParameters(*parameters):
287 for parameter in parameters:
288 if isinstance(parameter, list):
289 lResults = ParseParameters(*parameter)
290 if len(lResults) > 0:
291 Result.append(lResults[:-1])
292 StringResult += lResults[-1].split(":")
296 if isinstance(parameter,str):
297 if notebook.isVariable(parameter):
298 Result.append(notebook.get(parameter))
300 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
303 Result.append(parameter)
305 StringResult.append(str(parameter))
309 Result.append(":".join(StringResult))
311 Result = ":".join(StringResult)
314 ## Return list of variables value from salome notebook
315 ## @ingroup l1_geomBuilder_auxiliary
319 for parameter in list:
320 if isinstance(parameter,str) and notebook.isVariable(parameter):
321 Result.append(str(notebook.get(parameter)))
324 Result.append(str(parameter))
327 StringResult = StringResult + str(parameter)
328 StringResult = StringResult + ":"
330 StringResult = StringResult[:len(StringResult)-1]
331 return Result, StringResult
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
335 def ParseSketcherCommand(command):
338 sections = command.split(":")
339 for section in sections:
340 parameters = section.split(" ")
342 for parameter in parameters:
343 if paramIndex > 1 and parameter.find("'") != -1:
344 parameter = parameter.replace("'","")
345 if notebook.isVariable(parameter):
346 Result = Result + str(notebook.get(parameter)) + " "
349 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
353 Result = Result + str(parameter) + " "
356 StringResult = StringResult + parameter
357 StringResult = StringResult + ":"
359 paramIndex = paramIndex + 1
361 Result = Result[:len(Result)-1] + ":"
363 Result = Result[:len(Result)-1]
364 return Result, StringResult
366 ## Helper function which can be used to pack the passed string to the byte data.
367 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
368 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
371 ## val = PackData("10001110") # val = 0xAE
372 ## val = PackData("1") # val = 0x80
374 ## @param data unpacked data - a string containing '1' and '0' symbols
375 ## @return data packed to the byte stream
376 ## @ingroup l1_geomBuilder_auxiliary
379 Helper function which can be used to pack the passed string to the byte data.
380 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
381 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
384 data unpacked data - a string containing '1' and '0' symbols
387 data packed to the byte stream
390 val = PackData("10001110") # val = 0xAE
391 val = PackData("1") # val = 0x80
394 if len(data)%8: bytes += 1
396 for b in range(bytes):
397 d = data[b*8:(b+1)*8]
402 if d[i] == "1": val += 1
404 raise "Invalid symbol %s" % d[i]
411 ## Read bitmap texture from the text file.
412 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
413 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
414 ## The function returns width and height of the pixmap in pixels and byte stream representing
415 ## texture bitmap itself.
417 ## This function can be used to read the texture to the byte stream in order to pass it to
418 ## the AddTexture() function of geomBuilder class.
421 ## from salome.geom import geomBuilder
422 ## geompy = geomBuilder.New(salome.myStudy)
423 ## texture = geompy.readtexture('mytexture.dat')
424 ## texture = geompy.AddTexture(*texture)
425 ## obj.SetMarkerTexture(texture)
427 ## @param fname texture file name
428 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
429 ## @ingroup l1_geomBuilder_auxiliary
430 def ReadTexture(fname):
432 Read bitmap texture from the text file.
433 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
434 A zero symbol ('0') represents transparent pixel of the texture bitmap.
435 The function returns width and height of the pixmap in pixels and byte stream representing
436 texture bitmap itself.
437 This function can be used to read the texture to the byte stream in order to pass it to
438 the AddTexture() function of geomBuilder class.
441 fname texture file name
444 sequence of tree values: texture's width, height in pixels and its byte stream
447 from salome.geom import geomBuilder
448 geompy = geomBuilder.New(salome.myStudy)
449 texture = geompy.readtexture('mytexture.dat')
450 texture = geompy.AddTexture(*texture)
451 obj.SetMarkerTexture(texture)
455 lines = [ l.strip() for l in f.readlines()]
458 if lines: maxlen = max([len(x) for x in lines])
460 if maxlen%8: lenbytes += 1
464 lenline = (len(line)/8+1)*8
467 lenline = (len(line)/8)*8
469 for i in range(lenline/8):
472 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
475 bytedata += PackData(byte)
477 for i in range(lenline/8, lenbytes):
478 bytedata += PackData("0")
480 return lenbytes*8, len(lines), bytedata
485 ## Returns a long value from enumeration type
486 # Can be used for CORBA enumerator types like GEOM.shape_type
487 # @param theItem enumeration type
488 # @ingroup l1_geomBuilder_auxiliary
489 def EnumToLong(theItem):
491 Returns a long value from enumeration type
492 Can be used for CORBA enumerator types like geomBuilder.ShapeType
495 theItem enumeration type
498 if hasattr(theItem, "_v"): ret = theItem._v
501 ## Information about closed/unclosed state of shell or wire
502 # @ingroup l1_geomBuilder_auxiliary
505 Information about closed/unclosed state of shell or wire
511 ## Private class used to bind calls of plugin operations to geomBuilder
512 class PluginOperation:
513 def __init__(self, operation, function):
514 self.operation = operation
515 self.function = function
518 def __call__(self, *args):
519 res = self.function(self.operation, *args)
520 RaiseIfFailed(self.function.__name__, self.operation)
523 # Warning: geom is a singleton
529 class geomBuilder(object, GEOM._objref_GEOM_Gen):
531 ## Enumeration ShapeType as a dictionary. \n
532 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
533 # @ingroup l1_geomBuilder_auxiliary
534 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
536 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
537 # and a list of parameters, describing the shape.
538 # List of parameters, describing the shape:
539 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
540 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
542 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
544 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
546 # - SPHERE: [xc yc zc R]
547 # - CYLINDER: [xb yb zb dx dy dz R H]
548 # - BOX: [xc yc zc ax ay az]
549 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
550 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
551 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
552 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
553 # - SOLID: [nb_faces nb_edges nb_vertices]
555 # - SPHERE2D: [xc yc zc R]
556 # - CYLINDER2D: [xb yb zb dx dy dz R H]
557 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
558 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
559 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
560 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
561 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
562 # - PLANE: [xo yo zo dx dy dz]
563 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
564 # - FACE: [nb_edges nb_vertices]
566 # - CIRCLE: [xc yc zc dx dy dz R]
567 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
568 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
569 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
570 # - LINE: [xo yo zo dx dy dz]
571 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
572 # - EDGE: [nb_vertices]
575 # @ingroup l1_geomBuilder_auxiliary
576 kind = GEOM.GEOM_IKindOfShape
583 #print "==== __new__ ", engine, geom, doLcc, created
585 # geom engine is either retrieved from engine, or created
587 # Following test avoids a recursive loop
590 # geom engine not created: existing engine found
592 if doLcc and not created:
594 # FindOrLoadComponent called:
595 # 1. CORBA resolution of server
596 # 2. the __new__ method is called again
597 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
598 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
601 # FindOrLoadComponent not called
603 # geomBuilder instance is created from lcc.FindOrLoadComponent
604 #print "==== super ", engine, geom, doLcc, created
605 geom = super(geomBuilder,cls).__new__(cls)
608 # geom engine not created: existing engine found
609 #print "==== existing ", engine, geom, doLcc, created
611 #print "return geom 1 ", geom
614 #print "return geom 2 ", geom
619 #print "-------- geomBuilder __init__ --- ", created, self
622 GEOM._objref_GEOM_Gen.__init__(self)
623 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
624 self.myBuilder = None
644 ## Process object publication in the study, as follows:
645 # - if @a theName is specified (not None), the object is published in the study
646 # with this name, not taking into account "auto-publishing" option;
647 # - if @a theName is NOT specified, the object is published in the study
648 # (using default name, which can be customized using @a theDefaultName parameter)
649 # only if auto-publishing is switched on.
651 # @param theObj object, a subject for publishing
652 # @param theName object name for study
653 # @param theDefaultName default name for the auto-publishing
655 # @sa addToStudyAuto()
656 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
658 def _item_name(_names, _defname, _idx=-1):
659 if not _names: _names = _defname
660 if type(_names) in [types.ListType, types.TupleType]:
662 if _idx >= len(_names) or not _names[_idx]:
663 if type(_defname) not in [types.ListType, types.TupleType]:
664 _name = "%s_%d"%(_defname, _idx+1)
665 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
666 _name = _defname[_idx]
668 _name = "%noname_%d"%(dn, _idx+1)
674 # must be wrong usage
679 _name = "%s_%d"%(_names, _idx+1)
685 def _publish( _name, _obj ):
687 if isinstance( _obj, GEOM._objref_GEOM_Field ):
688 fatherObj = _obj.GetShape()
689 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
690 fatherObj = _obj.GetField()
691 elif not _obj.IsMainShape():
692 fatherObj = _obj.GetMainShape()
694 if fatherObj and fatherObj.GetStudyEntry():
695 self.addToStudyInFather(fatherObj, _obj, _name)
697 self.addToStudy(_obj, _name)
703 if not theName and not self.myMaxNbSubShapesAllowed:
704 return # nothing to do: auto-publishing is disabled
705 if not theName and not theDefaultName:
706 return # neither theName nor theDefaultName is given
708 if type(theObj) in [types.ListType, types.TupleType]:
709 # list of objects is being published
712 if not obj: continue # bad object
713 name = _item_name(theName, theDefaultName, idx)
714 _publish( name, obj )
716 if not theName and idx == self.myMaxNbSubShapesAllowed: break
720 # single object is published
721 name = _item_name(theName, theDefaultName)
722 _publish( name, theObj )
725 ## @addtogroup l1_geomBuilder_auxiliary
727 def init_geom(self,theStudy):
728 self.myStudy = theStudy
729 self.myStudyId = self.myStudy._get_StudyId()
730 self.myBuilder = self.myStudy.NewBuilder()
731 self.father = self.myStudy.FindComponent("GEOM")
732 if self.father is None:
733 self.father = self.myBuilder.NewComponent("GEOM")
734 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
735 FName = A1._narrow(SALOMEDS.AttributeName)
736 FName.SetValue("Geometry")
737 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
738 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
739 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
740 self.myBuilder.DefineComponentInstance(self.father,self)
742 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
743 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
744 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
745 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
746 self.HealOp = self.GetIHealingOperations (self.myStudyId)
747 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
748 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
749 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
750 self.LocalOp = self.GetILocalOperations (self.myStudyId)
751 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
752 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
753 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
754 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
756 # The below line is a right way to map all plugin functions to geomBuilder,
757 # but AdvancedOperations are already mapped, that is why this line is commented
758 # and presents here only as an axample
759 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
761 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
762 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
764 # set GEOM as root in the use case tree
765 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
766 self.myUseCaseBuilder.SetRootCurrent()
767 self.myUseCaseBuilder.Append(self.father)
770 def GetPluginOperations(self, studyID, libraryName):
771 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
773 # bind methods of operations to self
774 methods = op.__class__.__dict__['__methods__']
775 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
776 for meth_name in methods:
777 if not meth_name in avoid_methods: # avoid basic methods
778 function = getattr(op.__class__, meth_name)
779 if callable(function):
780 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
781 self.__dict__[meth_name] = PluginOperation(op, function)
784 ## Enable / disable results auto-publishing
786 # The automatic publishing is managed in the following way:
787 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
788 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
789 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
790 # value passed as parameter has the same effect.
791 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
792 # maximum number of sub-shapes allowed for publishing is set to specified value.
794 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
795 # @ingroup l1_publish_data
796 def addToStudyAuto(self, maxNbSubShapes=-1):
798 Enable / disable results auto-publishing
800 The automatic publishing is managed in the following way:
801 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
802 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
803 maximum number of sub-shapes allowed for publishing is unlimited; any negative
804 value passed as parameter has the same effect.
805 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
806 maximum number of sub-shapes allowed for publishing is set to this value.
809 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
812 geompy.addToStudyAuto() # enable auto-publishing
813 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
814 geompy.addToStudyAuto(0) # disable auto-publishing
816 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
819 ## Dump component to the Python script
820 # This method overrides IDL function to allow default values for the parameters.
821 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
823 Dump component to the Python script
824 This method overrides IDL function to allow default values for the parameters.
826 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
828 ## Get name for sub-shape aSubObj of shape aMainObj
830 # @ref swig_SubShapeName "Example"
831 def SubShapeName(self,aSubObj, aMainObj):
833 Get name for sub-shape aSubObj of shape aMainObj
835 # Example: see GEOM_TestAll.py
837 #aSubId = orb.object_to_string(aSubObj)
838 #aMainId = orb.object_to_string(aMainObj)
839 #index = gg.getIndexTopology(aSubId, aMainId)
840 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
841 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
842 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
845 ## Publish in study aShape with name aName
847 # \param aShape the shape to be published
848 # \param aName the name for the shape
849 # \param doRestoreSubShapes if True, finds and publishes also
850 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
851 # and published sub-shapes of arguments
852 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
853 # these arguments description
854 # \return study entry of the published shape in form of string
856 # @ingroup l1_publish_data
857 # @ref swig_all_addtostudy "Example"
858 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
859 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
861 Publish in study aShape with name aName
864 aShape the shape to be published
865 aName the name for the shape
866 doRestoreSubShapes if True, finds and publishes also
867 sub-shapes of aShape, corresponding to its arguments
868 and published sub-shapes of arguments
869 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
870 these arguments description
873 study entry of the published shape in form of string
876 id_block1 = geompy.addToStudy(Block1, "Block 1")
878 # Example: see GEOM_TestAll.py
880 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
881 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
882 if doRestoreSubShapes:
883 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
884 theFindMethod, theInheritFirstArg, True )
886 print "addToStudy() failed"
888 return aShape.GetStudyEntry()
890 ## Publish in study aShape with name aName as sub-object of previously published aFather
891 # \param aFather previously published object
892 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
893 # \param aName the name for the shape
895 # \return study entry of the published shape in form of string
897 # @ingroup l1_publish_data
898 # @ref swig_all_addtostudyInFather "Example"
899 def addToStudyInFather(self, aFather, aShape, aName):
901 Publish in study aShape with name aName as sub-object of previously published aFather
904 aFather previously published object
905 aShape the shape to be published as sub-object of aFather
906 aName the name for the shape
909 study entry of the published shape in form of string
911 # Example: see GEOM_TestAll.py
913 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
914 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
916 print "addToStudyInFather() failed"
918 return aShape.GetStudyEntry()
920 ## Unpublish object in study
922 # \param obj the object to be unpublished
923 def hideInStudy(self, obj):
925 Unpublish object in study
928 obj the object to be unpublished
930 ior = salome.orb.object_to_string(obj)
931 aSObject = self.myStudy.FindObjectIOR(ior)
932 if aSObject is not None:
933 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
934 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
935 drwAttribute.SetDrawable(False)
938 # end of l1_geomBuilder_auxiliary
941 ## @addtogroup l3_restore_ss
944 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
945 # To be used from python scripts out of addToStudy() (non-default usage)
946 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
947 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
948 # If this list is empty, all operation arguments will be published
949 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
950 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
951 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
952 # Do not publish sub-shapes in place of arguments, but only
953 # in place of sub-shapes of the first argument,
954 # because the whole shape corresponds to the first argument.
955 # Mainly to be used after transformations, but it also can be
956 # usefull after partition with one object shape, and some other
957 # operations, where only the first argument has to be considered.
958 # If theObject has only one argument shape, this flag is automatically
959 # considered as True, not regarding really passed value.
960 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
961 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
962 # \return list of published sub-shapes
964 # @ref tui_restore_prs_params "Example"
965 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
966 theInheritFirstArg=False, theAddPrefix=True):
968 Publish sub-shapes, standing for arguments and sub-shapes of arguments
969 To be used from python scripts out of geompy.addToStudy (non-default usage)
972 theObject published GEOM.GEOM_Object, arguments of which will be published
973 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
974 If this list is empty, all operation arguments will be published
975 theFindMethod method to search sub-shapes, corresponding to arguments and
976 their sub-shapes. Value from enumeration GEOM.find_shape_method.
977 theInheritFirstArg set properties of the first argument for theObject.
978 Do not publish sub-shapes in place of arguments, but only
979 in place of sub-shapes of the first argument,
980 because the whole shape corresponds to the first argument.
981 Mainly to be used after transformations, but it also can be
982 usefull after partition with one object shape, and some other
983 operations, where only the first argument has to be considered.
984 If theObject has only one argument shape, this flag is automatically
985 considered as True, not regarding really passed value.
986 theAddPrefix add prefix "from_" to names of restored sub-shapes,
987 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
989 list of published sub-shapes
991 # Example: see GEOM_TestAll.py
992 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
993 theFindMethod, theInheritFirstArg, theAddPrefix)
995 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
996 # To be used from python scripts out of addToStudy() (non-default usage)
997 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
998 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
999 # If this list is empty, all operation arguments will be published
1000 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1001 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1002 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1003 # Do not publish sub-shapes in place of arguments, but only
1004 # in place of sub-shapes of the first argument,
1005 # because the whole shape corresponds to the first argument.
1006 # Mainly to be used after transformations, but it also can be
1007 # usefull after partition with one object shape, and some other
1008 # operations, where only the first argument has to be considered.
1009 # If theObject has only one argument shape, this flag is automatically
1010 # considered as True, not regarding really passed value.
1011 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1012 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1013 # \return list of published sub-shapes
1015 # @ref tui_restore_prs_params "Example"
1016 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1017 theInheritFirstArg=False, theAddPrefix=True):
1019 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1020 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1023 theObject published GEOM.GEOM_Object, arguments of which will be published
1024 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1025 If this list is empty, all operation arguments will be published
1026 theFindMethod method to search sub-shapes, corresponding to arguments and
1027 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1028 theInheritFirstArg set properties of the first argument for theObject.
1029 Do not publish sub-shapes in place of arguments, but only
1030 in place of sub-shapes of the first argument,
1031 because the whole shape corresponds to the first argument.
1032 Mainly to be used after transformations, but it also can be
1033 usefull after partition with one object shape, and some other
1034 operations, where only the first argument has to be considered.
1035 If theObject has only one argument shape, this flag is automatically
1036 considered as True, not regarding really passed value.
1037 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1038 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1041 list of published sub-shapes
1043 # Example: see GEOM_TestAll.py
1044 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1045 theFindMethod, theInheritFirstArg, theAddPrefix)
1047 # end of l3_restore_ss
1050 ## @addtogroup l3_basic_go
1053 ## Create point by three coordinates.
1054 # @param theX The X coordinate of the point.
1055 # @param theY The Y coordinate of the point.
1056 # @param theZ The Z coordinate of the point.
1057 # @param theName Object name; when specified, this parameter is used
1058 # for result publication in the study. Otherwise, if automatic
1059 # publication is switched on, default value is used for result name.
1061 # @return New GEOM.GEOM_Object, containing the created point.
1063 # @ref tui_creation_point "Example"
1064 def MakeVertex(self, theX, theY, theZ, theName=None):
1066 Create point by three coordinates.
1069 theX The X coordinate of the point.
1070 theY The Y coordinate of the point.
1071 theZ The Z coordinate of the point.
1072 theName Object name; when specified, this parameter is used
1073 for result publication in the study. Otherwise, if automatic
1074 publication is switched on, default value is used for result name.
1077 New GEOM.GEOM_Object, containing the created point.
1079 # Example: see GEOM_TestAll.py
1080 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1081 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1082 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1083 anObj.SetParameters(Parameters)
1084 self._autoPublish(anObj, theName, "vertex")
1087 ## Create a point, distant from the referenced point
1088 # on the given distances along the coordinate axes.
1089 # @param theReference The referenced point.
1090 # @param theX Displacement from the referenced point along OX axis.
1091 # @param theY Displacement from the referenced point along OY axis.
1092 # @param theZ Displacement from the referenced point along OZ axis.
1093 # @param theName Object name; when specified, this parameter is used
1094 # for result publication in the study. Otherwise, if automatic
1095 # publication is switched on, default value is used for result name.
1097 # @return New GEOM.GEOM_Object, containing the created point.
1099 # @ref tui_creation_point "Example"
1100 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1102 Create a point, distant from the referenced point
1103 on the given distances along the coordinate axes.
1106 theReference The referenced point.
1107 theX Displacement from the referenced point along OX axis.
1108 theY Displacement from the referenced point along OY axis.
1109 theZ Displacement from the referenced point along OZ axis.
1110 theName Object name; when specified, this parameter is used
1111 for result publication in the study. Otherwise, if automatic
1112 publication is switched on, default value is used for result name.
1115 New GEOM.GEOM_Object, containing the created point.
1117 # Example: see GEOM_TestAll.py
1118 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1119 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1120 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1121 anObj.SetParameters(Parameters)
1122 self._autoPublish(anObj, theName, "vertex")
1125 ## Create a point, corresponding to the given parameter on the given curve.
1126 # @param theRefCurve The referenced curve.
1127 # @param theParameter Value of parameter on the referenced curve.
1128 # @param theName Object name; when specified, this parameter is used
1129 # for result publication in the study. Otherwise, if automatic
1130 # publication is switched on, default value is used for result name.
1132 # @return New GEOM.GEOM_Object, containing the created point.
1134 # @ref tui_creation_point "Example"
1135 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1137 Create a point, corresponding to the given parameter on the given curve.
1140 theRefCurve The referenced curve.
1141 theParameter Value of parameter on the referenced curve.
1142 theName Object name; when specified, this parameter is used
1143 for result publication in the study. Otherwise, if automatic
1144 publication is switched on, default value is used for result name.
1147 New GEOM.GEOM_Object, containing the created point.
1150 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1152 # Example: see GEOM_TestAll.py
1153 theParameter, Parameters = ParseParameters(theParameter)
1154 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1155 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1156 anObj.SetParameters(Parameters)
1157 self._autoPublish(anObj, theName, "vertex")
1160 ## Create a point by projection give coordinates on the given curve
1161 # @param theRefCurve The referenced curve.
1162 # @param theX X-coordinate in 3D space
1163 # @param theY Y-coordinate in 3D space
1164 # @param theZ Z-coordinate in 3D space
1165 # @param theName Object name; when specified, this parameter is used
1166 # for result publication in the study. Otherwise, if automatic
1167 # publication is switched on, default value is used for result name.
1169 # @return New GEOM.GEOM_Object, containing the created point.
1171 # @ref tui_creation_point "Example"
1172 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1174 Create a point by projection give coordinates on the given curve
1177 theRefCurve The referenced curve.
1178 theX X-coordinate in 3D space
1179 theY Y-coordinate in 3D space
1180 theZ Z-coordinate in 3D space
1181 theName Object name; when specified, this parameter is used
1182 for result publication in the study. Otherwise, if automatic
1183 publication is switched on, default value is used for result name.
1186 New GEOM.GEOM_Object, containing the created point.
1189 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1191 # Example: see GEOM_TestAll.py
1192 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1193 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1194 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1195 anObj.SetParameters(Parameters)
1196 self._autoPublish(anObj, theName, "vertex")
1199 ## Create a point, corresponding to the given length on the given curve.
1200 # @param theRefCurve The referenced curve.
1201 # @param theLength Length on the referenced curve. It can be negative.
1202 # @param theStartPoint Point allowing to choose the direction for the calculation
1203 # of the length. If None, start from the first point of theRefCurve.
1204 # @param theName Object name; when specified, this parameter is used
1205 # for result publication in the study. Otherwise, if automatic
1206 # publication is switched on, default value is used for result name.
1208 # @return New GEOM.GEOM_Object, containing the created point.
1210 # @ref tui_creation_point "Example"
1211 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1213 Create a point, corresponding to the given length on the given curve.
1216 theRefCurve The referenced curve.
1217 theLength Length on the referenced curve. It can be negative.
1218 theStartPoint Point allowing to choose the direction for the calculation
1219 of the length. If None, start from the first point of theRefCurve.
1220 theName Object name; when specified, this parameter is used
1221 for result publication in the study. Otherwise, if automatic
1222 publication is switched on, default value is used for result name.
1225 New GEOM.GEOM_Object, containing the created point.
1227 # Example: see GEOM_TestAll.py
1228 theLength, Parameters = ParseParameters(theLength)
1229 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1230 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1231 anObj.SetParameters(Parameters)
1232 self._autoPublish(anObj, theName, "vertex")
1235 ## Create a point, corresponding to the given parameters on the
1237 # @param theRefSurf The referenced surface.
1238 # @param theUParameter Value of U-parameter on the referenced surface.
1239 # @param theVParameter Value of V-parameter on the referenced surface.
1240 # @param theName Object name; when specified, this parameter is used
1241 # for result publication in the study. Otherwise, if automatic
1242 # publication is switched on, default value is used for result name.
1244 # @return New GEOM.GEOM_Object, containing the created point.
1246 # @ref swig_MakeVertexOnSurface "Example"
1247 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1249 Create a point, corresponding to the given parameters on the
1253 theRefSurf The referenced surface.
1254 theUParameter Value of U-parameter on the referenced surface.
1255 theVParameter Value of V-parameter on the referenced surface.
1256 theName Object name; when specified, this parameter is used
1257 for result publication in the study. Otherwise, if automatic
1258 publication is switched on, default value is used for result name.
1261 New GEOM.GEOM_Object, containing the created point.
1264 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1266 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1267 # Example: see GEOM_TestAll.py
1268 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1269 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1270 anObj.SetParameters(Parameters);
1271 self._autoPublish(anObj, theName, "vertex")
1274 ## Create a point by projection give coordinates on the given surface
1275 # @param theRefSurf The referenced surface.
1276 # @param theX X-coordinate in 3D space
1277 # @param theY Y-coordinate in 3D space
1278 # @param theZ Z-coordinate in 3D space
1279 # @param theName Object name; when specified, this parameter is used
1280 # for result publication in the study. Otherwise, if automatic
1281 # publication is switched on, default value is used for result name.
1283 # @return New GEOM.GEOM_Object, containing the created point.
1285 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1286 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1288 Create a point by projection give coordinates on the given surface
1291 theRefSurf The referenced surface.
1292 theX X-coordinate in 3D space
1293 theY Y-coordinate in 3D space
1294 theZ Z-coordinate in 3D space
1295 theName Object name; when specified, this parameter is used
1296 for result publication in the study. Otherwise, if automatic
1297 publication is switched on, default value is used for result name.
1300 New GEOM.GEOM_Object, containing the created point.
1303 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1305 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1306 # Example: see GEOM_TestAll.py
1307 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1308 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1309 anObj.SetParameters(Parameters);
1310 self._autoPublish(anObj, theName, "vertex")
1313 ## Create a point, which lays on the given face.
1314 # The point will lay in arbitrary place of the face.
1315 # The only condition on it is a non-zero distance to the face boundary.
1316 # Such point can be used to uniquely identify the face inside any
1317 # shape in case, when the shape does not contain overlapped faces.
1318 # @param theFace The referenced face.
1319 # @param theName Object name; when specified, this parameter is used
1320 # for result publication in the study. Otherwise, if automatic
1321 # publication is switched on, default value is used for result name.
1323 # @return New GEOM.GEOM_Object, containing the created point.
1325 # @ref swig_MakeVertexInsideFace "Example"
1326 def MakeVertexInsideFace (self, theFace, theName=None):
1328 Create a point, which lays on the given face.
1329 The point will lay in arbitrary place of the face.
1330 The only condition on it is a non-zero distance to the face boundary.
1331 Such point can be used to uniquely identify the face inside any
1332 shape in case, when the shape does not contain overlapped faces.
1335 theFace The referenced face.
1336 theName Object name; when specified, this parameter is used
1337 for result publication in the study. Otherwise, if automatic
1338 publication is switched on, default value is used for result name.
1341 New GEOM.GEOM_Object, containing the created point.
1344 p_on_face = geompy.MakeVertexInsideFace(Face)
1346 # Example: see GEOM_TestAll.py
1347 anObj = self.BasicOp.MakePointOnFace(theFace)
1348 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1349 self._autoPublish(anObj, theName, "vertex")
1352 ## Create a point on intersection of two lines.
1353 # @param theRefLine1, theRefLine2 The referenced lines.
1354 # @param theName Object name; when specified, this parameter is used
1355 # for result publication in the study. Otherwise, if automatic
1356 # publication is switched on, default value is used for result name.
1358 # @return New GEOM.GEOM_Object, containing the created point.
1360 # @ref swig_MakeVertexOnLinesIntersection "Example"
1361 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1363 Create a point on intersection of two lines.
1366 theRefLine1, theRefLine2 The referenced lines.
1367 theName Object name; when specified, this parameter is used
1368 for result publication in the study. Otherwise, if automatic
1369 publication is switched on, default value is used for result name.
1372 New GEOM.GEOM_Object, containing the created point.
1374 # Example: see GEOM_TestAll.py
1375 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1376 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1377 self._autoPublish(anObj, theName, "vertex")
1380 ## Create a tangent, corresponding to the given parameter on the given curve.
1381 # @param theRefCurve The referenced curve.
1382 # @param theParameter Value of parameter on the referenced curve.
1383 # @param theName Object name; when specified, this parameter is used
1384 # for result publication in the study. Otherwise, if automatic
1385 # publication is switched on, default value is used for result name.
1387 # @return New GEOM.GEOM_Object, containing the created tangent.
1389 # @ref swig_MakeTangentOnCurve "Example"
1390 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1392 Create a tangent, corresponding to the given parameter on the given curve.
1395 theRefCurve The referenced curve.
1396 theParameter Value of parameter on the referenced curve.
1397 theName Object name; when specified, this parameter is used
1398 for result publication in the study. Otherwise, if automatic
1399 publication is switched on, default value is used for result name.
1402 New GEOM.GEOM_Object, containing the created tangent.
1405 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1407 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1408 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1409 self._autoPublish(anObj, theName, "tangent")
1412 ## Create a tangent plane, corresponding to the given parameter on the given face.
1413 # @param theFace The face for which tangent plane should be built.
1414 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1415 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1416 # @param theTrimSize the size of plane.
1417 # @param theName Object name; when specified, this parameter is used
1418 # for result publication in the study. Otherwise, if automatic
1419 # publication is switched on, default value is used for result name.
1421 # @return New GEOM.GEOM_Object, containing the created tangent.
1423 # @ref swig_MakeTangentPlaneOnFace "Example"
1424 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1426 Create a tangent plane, corresponding to the given parameter on the given face.
1429 theFace The face for which tangent plane should be built.
1430 theParameterV vertical value of the center point (0.0 - 1.0).
1431 theParameterU horisontal value of the center point (0.0 - 1.0).
1432 theTrimSize the size of plane.
1433 theName Object name; when specified, this parameter is used
1434 for result publication in the study. Otherwise, if automatic
1435 publication is switched on, default value is used for result name.
1438 New GEOM.GEOM_Object, containing the created tangent.
1441 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1443 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1444 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1445 self._autoPublish(anObj, theName, "tangent")
1448 ## Create a vector with the given components.
1449 # @param theDX X component of the vector.
1450 # @param theDY Y component of the vector.
1451 # @param theDZ Z component of the vector.
1452 # @param theName Object name; when specified, this parameter is used
1453 # for result publication in the study. Otherwise, if automatic
1454 # publication is switched on, default value is used for result name.
1456 # @return New GEOM.GEOM_Object, containing the created vector.
1458 # @ref tui_creation_vector "Example"
1459 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1461 Create a vector with the given components.
1464 theDX X component of the vector.
1465 theDY Y component of the vector.
1466 theDZ Z component of the vector.
1467 theName Object name; when specified, this parameter is used
1468 for result publication in the study. Otherwise, if automatic
1469 publication is switched on, default value is used for result name.
1472 New GEOM.GEOM_Object, containing the created vector.
1474 # Example: see GEOM_TestAll.py
1475 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1476 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1477 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1478 anObj.SetParameters(Parameters)
1479 self._autoPublish(anObj, theName, "vector")
1482 ## Create a vector between two points.
1483 # @param thePnt1 Start point for the vector.
1484 # @param thePnt2 End point for the vector.
1485 # @param theName Object name; when specified, this parameter is used
1486 # for result publication in the study. Otherwise, if automatic
1487 # publication is switched on, default value is used for result name.
1489 # @return New GEOM.GEOM_Object, containing the created vector.
1491 # @ref tui_creation_vector "Example"
1492 def MakeVector(self, thePnt1, thePnt2, theName=None):
1494 Create a vector between two points.
1497 thePnt1 Start point for the vector.
1498 thePnt2 End point for the vector.
1499 theName Object name; when specified, this parameter is used
1500 for result publication in the study. Otherwise, if automatic
1501 publication is switched on, default value is used for result name.
1504 New GEOM.GEOM_Object, containing the created vector.
1506 # Example: see GEOM_TestAll.py
1507 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1508 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1509 self._autoPublish(anObj, theName, "vector")
1512 ## Create a line, passing through the given point
1513 # and parrallel to the given direction
1514 # @param thePnt Point. The resulting line will pass through it.
1515 # @param theDir Direction. The resulting line will be parallel to it.
1516 # @param theName Object name; when specified, this parameter is used
1517 # for result publication in the study. Otherwise, if automatic
1518 # publication is switched on, default value is used for result name.
1520 # @return New GEOM.GEOM_Object, containing the created line.
1522 # @ref tui_creation_line "Example"
1523 def MakeLine(self, thePnt, theDir, theName=None):
1525 Create a line, passing through the given point
1526 and parrallel to the given direction
1529 thePnt Point. The resulting line will pass through it.
1530 theDir Direction. The resulting line will be parallel to it.
1531 theName Object name; when specified, this parameter is used
1532 for result publication in the study. Otherwise, if automatic
1533 publication is switched on, default value is used for result name.
1536 New GEOM.GEOM_Object, containing the created line.
1538 # Example: see GEOM_TestAll.py
1539 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1540 RaiseIfFailed("MakeLine", self.BasicOp)
1541 self._autoPublish(anObj, theName, "line")
1544 ## Create a line, passing through the given points
1545 # @param thePnt1 First of two points, defining the line.
1546 # @param thePnt2 Second of two points, defining the line.
1547 # @param theName Object name; when specified, this parameter is used
1548 # for result publication in the study. Otherwise, if automatic
1549 # publication is switched on, default value is used for result name.
1551 # @return New GEOM.GEOM_Object, containing the created line.
1553 # @ref tui_creation_line "Example"
1554 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1556 Create a line, passing through the given points
1559 thePnt1 First of two points, defining the line.
1560 thePnt2 Second of two points, defining the line.
1561 theName Object name; when specified, this parameter is used
1562 for result publication in the study. Otherwise, if automatic
1563 publication is switched on, default value is used for result name.
1566 New GEOM.GEOM_Object, containing the created line.
1568 # Example: see GEOM_TestAll.py
1569 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1570 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1571 self._autoPublish(anObj, theName, "line")
1574 ## Create a line on two faces intersection.
1575 # @param theFace1 First of two faces, defining the line.
1576 # @param theFace2 Second of two faces, defining the line.
1577 # @param theName Object name; when specified, this parameter is used
1578 # for result publication in the study. Otherwise, if automatic
1579 # publication is switched on, default value is used for result name.
1581 # @return New GEOM.GEOM_Object, containing the created line.
1583 # @ref swig_MakeLineTwoFaces "Example"
1584 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1586 Create a line on two faces intersection.
1589 theFace1 First of two faces, defining the line.
1590 theFace2 Second of two faces, defining the line.
1591 theName Object name; when specified, this parameter is used
1592 for result publication in the study. Otherwise, if automatic
1593 publication is switched on, default value is used for result name.
1596 New GEOM.GEOM_Object, containing the created line.
1598 # Example: see GEOM_TestAll.py
1599 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1600 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1601 self._autoPublish(anObj, theName, "line")
1604 ## Create a plane, passing through the given point
1605 # and normal to the given vector.
1606 # @param thePnt Point, the plane has to pass through.
1607 # @param theVec Vector, defining the plane normal direction.
1608 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1609 # @param theName Object name; when specified, this parameter is used
1610 # for result publication in the study. Otherwise, if automatic
1611 # publication is switched on, default value is used for result name.
1613 # @return New GEOM.GEOM_Object, containing the created plane.
1615 # @ref tui_creation_plane "Example"
1616 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1618 Create a plane, passing through the given point
1619 and normal to the given vector.
1622 thePnt Point, the plane has to pass through.
1623 theVec Vector, defining the plane normal direction.
1624 theTrimSize Half size of a side of quadrangle face, representing the plane.
1625 theName Object name; when specified, this parameter is used
1626 for result publication in the study. Otherwise, if automatic
1627 publication is switched on, default value is used for result name.
1630 New GEOM.GEOM_Object, containing the created plane.
1632 # Example: see GEOM_TestAll.py
1633 theTrimSize, Parameters = ParseParameters(theTrimSize);
1634 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1635 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1636 anObj.SetParameters(Parameters)
1637 self._autoPublish(anObj, theName, "plane")
1640 ## Create a plane, passing through the three given points
1641 # @param thePnt1 First of three points, defining the plane.
1642 # @param thePnt2 Second of three points, defining the plane.
1643 # @param thePnt3 Fird of three points, defining the plane.
1644 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1645 # @param theName Object name; when specified, this parameter is used
1646 # for result publication in the study. Otherwise, if automatic
1647 # publication is switched on, default value is used for result name.
1649 # @return New GEOM.GEOM_Object, containing the created plane.
1651 # @ref tui_creation_plane "Example"
1652 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1654 Create a plane, passing through the three given points
1657 thePnt1 First of three points, defining the plane.
1658 thePnt2 Second of three points, defining the plane.
1659 thePnt3 Fird of three points, defining the plane.
1660 theTrimSize Half size of a side of quadrangle face, representing the plane.
1661 theName Object name; when specified, this parameter is used
1662 for result publication in the study. Otherwise, if automatic
1663 publication is switched on, default value is used for result name.
1666 New GEOM.GEOM_Object, containing the created plane.
1668 # Example: see GEOM_TestAll.py
1669 theTrimSize, Parameters = ParseParameters(theTrimSize);
1670 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1671 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1672 anObj.SetParameters(Parameters)
1673 self._autoPublish(anObj, theName, "plane")
1676 ## Create a plane, similar to the existing one, but with another size of representing face.
1677 # @param theFace Referenced plane or LCS(Marker).
1678 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1679 # @param theName Object name; when specified, this parameter is used
1680 # for result publication in the study. Otherwise, if automatic
1681 # publication is switched on, default value is used for result name.
1683 # @return New GEOM.GEOM_Object, containing the created plane.
1685 # @ref tui_creation_plane "Example"
1686 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1688 Create a plane, similar to the existing one, but with another size of representing face.
1691 theFace Referenced plane or LCS(Marker).
1692 theTrimSize New half size of a side of quadrangle face, representing the plane.
1693 theName Object name; when specified, this parameter is used
1694 for result publication in the study. Otherwise, if automatic
1695 publication is switched on, default value is used for result name.
1698 New GEOM.GEOM_Object, containing the created plane.
1700 # Example: see GEOM_TestAll.py
1701 theTrimSize, Parameters = ParseParameters(theTrimSize);
1702 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1703 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1704 anObj.SetParameters(Parameters)
1705 self._autoPublish(anObj, theName, "plane")
1708 ## Create a plane, passing through the 2 vectors
1709 # with center in a start point of the first vector.
1710 # @param theVec1 Vector, defining center point and plane direction.
1711 # @param theVec2 Vector, defining the plane normal direction.
1712 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1713 # @param theName Object name; when specified, this parameter is used
1714 # for result publication in the study. Otherwise, if automatic
1715 # publication is switched on, default value is used for result name.
1717 # @return New GEOM.GEOM_Object, containing the created plane.
1719 # @ref tui_creation_plane "Example"
1720 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1722 Create a plane, passing through the 2 vectors
1723 with center in a start point of the first vector.
1726 theVec1 Vector, defining center point and plane direction.
1727 theVec2 Vector, defining the plane normal direction.
1728 theTrimSize Half size of a side of quadrangle face, representing the plane.
1729 theName Object name; when specified, this parameter is used
1730 for result publication in the study. Otherwise, if automatic
1731 publication is switched on, default value is used for result name.
1734 New GEOM.GEOM_Object, containing the created plane.
1736 # Example: see GEOM_TestAll.py
1737 theTrimSize, Parameters = ParseParameters(theTrimSize);
1738 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1739 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1740 anObj.SetParameters(Parameters)
1741 self._autoPublish(anObj, theName, "plane")
1744 ## Create a plane, based on a Local coordinate system.
1745 # @param theLCS coordinate system, defining plane.
1746 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1747 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1748 # @param theName Object name; when specified, this parameter is used
1749 # for result publication in the study. Otherwise, if automatic
1750 # publication is switched on, default value is used for result name.
1752 # @return New GEOM.GEOM_Object, containing the created plane.
1754 # @ref tui_creation_plane "Example"
1755 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1757 Create a plane, based on a Local coordinate system.
1760 theLCS coordinate system, defining plane.
1761 theTrimSize Half size of a side of quadrangle face, representing the plane.
1762 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1763 theName Object name; when specified, this parameter is used
1764 for result publication in the study. Otherwise, if automatic
1765 publication is switched on, default value is used for result name.
1768 New GEOM.GEOM_Object, containing the created plane.
1770 # Example: see GEOM_TestAll.py
1771 theTrimSize, Parameters = ParseParameters(theTrimSize);
1772 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1773 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1774 anObj.SetParameters(Parameters)
1775 self._autoPublish(anObj, theName, "plane")
1778 ## Create a local coordinate system.
1779 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1780 # @param XDX,XDY,XDZ Three components of OX direction
1781 # @param YDX,YDY,YDZ Three components of OY direction
1782 # @param theName Object name; when specified, this parameter is used
1783 # for result publication in the study. Otherwise, if automatic
1784 # publication is switched on, default value is used for result name.
1786 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1788 # @ref swig_MakeMarker "Example"
1789 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1791 Create a local coordinate system.
1794 OX,OY,OZ Three coordinates of coordinate system origin.
1795 XDX,XDY,XDZ Three components of OX direction
1796 YDX,YDY,YDZ Three components of OY direction
1797 theName Object name; when specified, this parameter is used
1798 for result publication in the study. Otherwise, if automatic
1799 publication is switched on, default value is used for result name.
1802 New GEOM.GEOM_Object, containing the created coordinate system.
1804 # Example: see GEOM_TestAll.py
1805 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1806 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1807 RaiseIfFailed("MakeMarker", self.BasicOp)
1808 anObj.SetParameters(Parameters)
1809 self._autoPublish(anObj, theName, "lcs")
1812 ## Create a local coordinate system from shape.
1813 # @param theShape The initial shape to detect the coordinate system.
1814 # @param theName Object name; when specified, this parameter is used
1815 # for result publication in the study. Otherwise, if automatic
1816 # publication is switched on, default value is used for result name.
1818 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1820 # @ref tui_creation_lcs "Example"
1821 def MakeMarkerFromShape(self, theShape, theName=None):
1823 Create a local coordinate system from shape.
1826 theShape The initial shape to detect the coordinate system.
1827 theName Object name; when specified, this parameter is used
1828 for result publication in the study. Otherwise, if automatic
1829 publication is switched on, default value is used for result name.
1832 New GEOM.GEOM_Object, containing the created coordinate system.
1834 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1835 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1836 self._autoPublish(anObj, theName, "lcs")
1839 ## Create a local coordinate system from point and two vectors.
1840 # @param theOrigin Point of coordinate system origin.
1841 # @param theXVec Vector of X direction
1842 # @param theYVec Vector of Y direction
1843 # @param theName Object name; when specified, this parameter is used
1844 # for result publication in the study. Otherwise, if automatic
1845 # publication is switched on, default value is used for result name.
1847 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1849 # @ref tui_creation_lcs "Example"
1850 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1852 Create a local coordinate system from point and two vectors.
1855 theOrigin Point of coordinate system origin.
1856 theXVec Vector of X direction
1857 theYVec Vector of Y direction
1858 theName Object name; when specified, this parameter is used
1859 for result publication in the study. Otherwise, if automatic
1860 publication is switched on, default value is used for result name.
1863 New GEOM.GEOM_Object, containing the created coordinate system.
1866 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1867 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1868 self._autoPublish(anObj, theName, "lcs")
1871 # end of l3_basic_go
1874 ## @addtogroup l4_curves
1877 ## Create an arc of circle, passing through three given points.
1878 # @param thePnt1 Start point of the arc.
1879 # @param thePnt2 Middle point of the arc.
1880 # @param thePnt3 End point of the arc.
1881 # @param theName Object name; when specified, this parameter is used
1882 # for result publication in the study. Otherwise, if automatic
1883 # publication is switched on, default value is used for result name.
1885 # @return New GEOM.GEOM_Object, containing the created arc.
1887 # @ref swig_MakeArc "Example"
1888 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1890 Create an arc of circle, passing through three given points.
1893 thePnt1 Start point of the arc.
1894 thePnt2 Middle point of the arc.
1895 thePnt3 End point of the arc.
1896 theName Object name; when specified, this parameter is used
1897 for result publication in the study. Otherwise, if automatic
1898 publication is switched on, default value is used for result name.
1901 New GEOM.GEOM_Object, containing the created arc.
1903 # Example: see GEOM_TestAll.py
1904 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1905 RaiseIfFailed("MakeArc", self.CurvesOp)
1906 self._autoPublish(anObj, theName, "arc")
1909 ## Create an arc of circle from a center and 2 points.
1910 # @param thePnt1 Center of the arc
1911 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1912 # @param thePnt3 End point of the arc (Gives also a direction)
1913 # @param theSense Orientation of the arc
1914 # @param theName Object name; when specified, this parameter is used
1915 # for result publication in the study. Otherwise, if automatic
1916 # publication is switched on, default value is used for result name.
1918 # @return New GEOM.GEOM_Object, containing the created arc.
1920 # @ref swig_MakeArc "Example"
1921 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1923 Create an arc of circle from a center and 2 points.
1926 thePnt1 Center of the arc
1927 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1928 thePnt3 End point of the arc (Gives also a direction)
1929 theSense Orientation of the arc
1930 theName Object name; when specified, this parameter is used
1931 for result publication in the study. Otherwise, if automatic
1932 publication is switched on, default value is used for result name.
1935 New GEOM.GEOM_Object, containing the created arc.
1937 # Example: see GEOM_TestAll.py
1938 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1939 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1940 self._autoPublish(anObj, theName, "arc")
1943 ## Create an arc of ellipse, of center and two points.
1944 # @param theCenter Center of the arc.
1945 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1946 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1947 # @param theName Object name; when specified, this parameter is used
1948 # for result publication in the study. Otherwise, if automatic
1949 # publication is switched on, default value is used for result name.
1951 # @return New GEOM.GEOM_Object, containing the created arc.
1953 # @ref swig_MakeArc "Example"
1954 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1956 Create an arc of ellipse, of center and two points.
1959 theCenter Center of the arc.
1960 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1961 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1962 theName Object name; when specified, this parameter is used
1963 for result publication in the study. Otherwise, if automatic
1964 publication is switched on, default value is used for result name.
1967 New GEOM.GEOM_Object, containing the created arc.
1969 # Example: see GEOM_TestAll.py
1970 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1971 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1972 self._autoPublish(anObj, theName, "arc")
1975 ## Create a circle with given center, normal vector and radius.
1976 # @param thePnt Circle center.
1977 # @param theVec Vector, normal to the plane of the circle.
1978 # @param theR Circle radius.
1979 # @param theName Object name; when specified, this parameter is used
1980 # for result publication in the study. Otherwise, if automatic
1981 # publication is switched on, default value is used for result name.
1983 # @return New GEOM.GEOM_Object, containing the created circle.
1985 # @ref tui_creation_circle "Example"
1986 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1988 Create a circle with given center, normal vector and radius.
1991 thePnt Circle center.
1992 theVec Vector, normal to the plane of the circle.
1994 theName Object name; when specified, this parameter is used
1995 for result publication in the study. Otherwise, if automatic
1996 publication is switched on, default value is used for result name.
1999 New GEOM.GEOM_Object, containing the created circle.
2001 # Example: see GEOM_TestAll.py
2002 theR, Parameters = ParseParameters(theR)
2003 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2004 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2005 anObj.SetParameters(Parameters)
2006 self._autoPublish(anObj, theName, "circle")
2009 ## Create a circle with given radius.
2010 # Center of the circle will be in the origin of global
2011 # coordinate system and normal vector will be codirected with Z axis
2012 # @param theR Circle radius.
2013 # @param theName Object name; when specified, this parameter is used
2014 # for result publication in the study. Otherwise, if automatic
2015 # publication is switched on, default value is used for result name.
2017 # @return New GEOM.GEOM_Object, containing the created circle.
2018 def MakeCircleR(self, theR, theName=None):
2020 Create a circle with given radius.
2021 Center of the circle will be in the origin of global
2022 coordinate system and normal vector will be codirected with Z axis
2026 theName Object name; when specified, this parameter is used
2027 for result publication in the study. Otherwise, if automatic
2028 publication is switched on, default value is used for result name.
2031 New GEOM.GEOM_Object, containing the created circle.
2033 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2034 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2035 self._autoPublish(anObj, theName, "circle")
2038 ## Create a circle, passing through three given points
2039 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2040 # @param theName Object name; when specified, this parameter is used
2041 # for result publication in the study. Otherwise, if automatic
2042 # publication is switched on, default value is used for result name.
2044 # @return New GEOM.GEOM_Object, containing the created circle.
2046 # @ref tui_creation_circle "Example"
2047 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2049 Create a circle, passing through three given points
2052 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2053 theName Object name; when specified, this parameter is used
2054 for result publication in the study. Otherwise, if automatic
2055 publication is switched on, default value is used for result name.
2058 New GEOM.GEOM_Object, containing the created circle.
2060 # Example: see GEOM_TestAll.py
2061 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2062 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2063 self._autoPublish(anObj, theName, "circle")
2066 ## Create a circle, with given point1 as center,
2067 # passing through the point2 as radius and laying in the plane,
2068 # defined by all three given points.
2069 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2070 # @param theName Object name; when specified, this parameter is used
2071 # for result publication in the study. Otherwise, if automatic
2072 # publication is switched on, default value is used for result name.
2074 # @return New GEOM.GEOM_Object, containing the created circle.
2076 # @ref swig_MakeCircle "Example"
2077 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2079 Create a circle, with given point1 as center,
2080 passing through the point2 as radius and laying in the plane,
2081 defined by all three given points.
2084 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2085 theName Object name; when specified, this parameter is used
2086 for result publication in the study. Otherwise, if automatic
2087 publication is switched on, default value is used for result name.
2090 New GEOM.GEOM_Object, containing the created circle.
2092 # Example: see GEOM_example6.py
2093 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2094 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2095 self._autoPublish(anObj, theName, "circle")
2098 ## Create an ellipse with given center, normal vector and radiuses.
2099 # @param thePnt Ellipse center.
2100 # @param theVec Vector, normal to the plane of the ellipse.
2101 # @param theRMajor Major ellipse radius.
2102 # @param theRMinor Minor ellipse radius.
2103 # @param theVecMaj Vector, direction of the ellipse's main axis.
2104 # @param theName Object name; when specified, this parameter is used
2105 # for result publication in the study. Otherwise, if automatic
2106 # publication is switched on, default value is used for result name.
2108 # @return New GEOM.GEOM_Object, containing the created ellipse.
2110 # @ref tui_creation_ellipse "Example"
2111 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2113 Create an ellipse with given center, normal vector and radiuses.
2116 thePnt Ellipse center.
2117 theVec Vector, normal to the plane of the ellipse.
2118 theRMajor Major ellipse radius.
2119 theRMinor Minor ellipse radius.
2120 theVecMaj Vector, direction of the ellipse's main axis.
2121 theName Object name; when specified, this parameter is used
2122 for result publication in the study. Otherwise, if automatic
2123 publication is switched on, default value is used for result name.
2126 New GEOM.GEOM_Object, containing the created ellipse.
2128 # Example: see GEOM_TestAll.py
2129 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2130 if theVecMaj is not None:
2131 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2133 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2135 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2136 anObj.SetParameters(Parameters)
2137 self._autoPublish(anObj, theName, "ellipse")
2140 ## Create an ellipse with given radiuses.
2141 # Center of the ellipse will be in the origin of global
2142 # coordinate system and normal vector will be codirected with Z axis
2143 # @param theRMajor Major ellipse radius.
2144 # @param theRMinor Minor ellipse radius.
2145 # @param theName Object name; when specified, this parameter is used
2146 # for result publication in the study. Otherwise, if automatic
2147 # publication is switched on, default value is used for result name.
2149 # @return New GEOM.GEOM_Object, containing the created ellipse.
2150 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2152 Create an ellipse with given radiuses.
2153 Center of the ellipse will be in the origin of global
2154 coordinate system and normal vector will be codirected with Z axis
2157 theRMajor Major ellipse radius.
2158 theRMinor Minor ellipse radius.
2159 theName Object name; when specified, this parameter is used
2160 for result publication in the study. Otherwise, if automatic
2161 publication is switched on, default value is used for result name.
2164 New GEOM.GEOM_Object, containing the created ellipse.
2166 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2167 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2168 self._autoPublish(anObj, theName, "ellipse")
2171 ## Create a polyline on the set of points.
2172 # @param thePoints Sequence of points for the polyline.
2173 # @param theIsClosed If True, build a closed wire.
2174 # @param theName Object name; when specified, this parameter is used
2175 # for result publication in the study. Otherwise, if automatic
2176 # publication is switched on, default value is used for result name.
2178 # @return New GEOM.GEOM_Object, containing the created polyline.
2180 # @ref tui_creation_curve "Example"
2181 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2183 Create a polyline on the set of points.
2186 thePoints Sequence of points for the polyline.
2187 theIsClosed If True, build a closed wire.
2188 theName Object name; when specified, this parameter is used
2189 for result publication in the study. Otherwise, if automatic
2190 publication is switched on, default value is used for result name.
2193 New GEOM.GEOM_Object, containing the created polyline.
2195 # Example: see GEOM_TestAll.py
2196 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2197 RaiseIfFailed("MakePolyline", self.CurvesOp)
2198 self._autoPublish(anObj, theName, "polyline")
2201 ## Create bezier curve on the set of points.
2202 # @param thePoints Sequence of points for the bezier curve.
2203 # @param theIsClosed If True, build a closed curve.
2204 # @param theName Object name; when specified, this parameter is used
2205 # for result publication in the study. Otherwise, if automatic
2206 # publication is switched on, default value is used for result name.
2208 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2210 # @ref tui_creation_curve "Example"
2211 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2213 Create bezier curve on the set of points.
2216 thePoints Sequence of points for the bezier curve.
2217 theIsClosed If True, build a closed curve.
2218 theName Object name; when specified, this parameter is used
2219 for result publication in the study. Otherwise, if automatic
2220 publication is switched on, default value is used for result name.
2223 New GEOM.GEOM_Object, containing the created bezier curve.
2225 # Example: see GEOM_TestAll.py
2226 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2227 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2228 self._autoPublish(anObj, theName, "bezier")
2231 ## Create B-Spline curve on the set of points.
2232 # @param thePoints Sequence of points for the B-Spline curve.
2233 # @param theIsClosed If True, build a closed curve.
2234 # @param theDoReordering If TRUE, the algo does not follow the order of
2235 # \a thePoints but searches for the closest vertex.
2236 # @param theName Object name; when specified, this parameter is used
2237 # for result publication in the study. Otherwise, if automatic
2238 # publication is switched on, default value is used for result name.
2240 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2242 # @ref tui_creation_curve "Example"
2243 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2245 Create B-Spline curve on the set of points.
2248 thePoints Sequence of points for the B-Spline curve.
2249 theIsClosed If True, build a closed curve.
2250 theDoReordering If True, the algo does not follow the order of
2251 thePoints but searches for the closest vertex.
2252 theName Object name; when specified, this parameter is used
2253 for result publication in the study. Otherwise, if automatic
2254 publication is switched on, default value is used for result name.
2257 New GEOM.GEOM_Object, containing the created B-Spline curve.
2259 # Example: see GEOM_TestAll.py
2260 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2261 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2262 self._autoPublish(anObj, theName, "bspline")
2265 ## Create B-Spline curve on the set of points.
2266 # @param thePoints Sequence of points for the B-Spline curve.
2267 # @param theFirstVec Vector object, defining the curve direction at its first point.
2268 # @param theLastVec Vector object, defining the curve direction at its last point.
2269 # @param theName Object name; when specified, this parameter is used
2270 # for result publication in the study. Otherwise, if automatic
2271 # publication is switched on, default value is used for result name.
2273 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2275 # @ref tui_creation_curve "Example"
2276 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2278 Create B-Spline curve on the set of points.
2281 thePoints Sequence of points for the B-Spline curve.
2282 theFirstVec Vector object, defining the curve direction at its first point.
2283 theLastVec Vector object, defining the curve direction at its last point.
2284 theName Object name; when specified, this parameter is used
2285 for result publication in the study. Otherwise, if automatic
2286 publication is switched on, default value is used for result name.
2289 New GEOM.GEOM_Object, containing the created B-Spline curve.
2291 # Example: see GEOM_TestAll.py
2292 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2293 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2294 self._autoPublish(anObj, theName, "bspline")
2297 ## Creates a curve using the parametric definition of the basic points.
2298 # @param thexExpr parametric equation of the coordinates X.
2299 # @param theyExpr parametric equation of the coordinates Y.
2300 # @param thezExpr parametric equation of the coordinates Z.
2301 # @param theParamMin the minimal value of the parameter.
2302 # @param theParamMax the maximum value of the parameter.
2303 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2304 # @param theCurveType the type of the curve,
2305 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2306 # @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
2307 # @param theName Object name; when specified, this parameter is used
2308 # for result publication in the study. Otherwise, if automatic
2309 # publication is switched on, default value is used for result name.
2311 # @return New GEOM.GEOM_Object, containing the created curve.
2313 # @ref tui_creation_curve "Example"
2314 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2315 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2317 Creates a curve using the parametric definition of the basic points.
2320 thexExpr parametric equation of the coordinates X.
2321 theyExpr parametric equation of the coordinates Y.
2322 thezExpr parametric equation of the coordinates Z.
2323 theParamMin the minimal value of the parameter.
2324 theParamMax the maximum value of the parameter.
2325 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2326 theCurveType the type of the curve,
2327 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2328 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2329 method is used which can lead to a bug.
2330 theName Object name; when specified, this parameter is used
2331 for result publication in the study. Otherwise, if automatic
2332 publication is switched on, default value is used for result name.
2335 New GEOM.GEOM_Object, containing the created curve.
2337 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2339 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2341 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2342 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2343 anObj.SetParameters(Parameters)
2344 self._autoPublish(anObj, theName, "curve")
2347 ## Create an isoline curve on a face.
2348 # @param theFace the face for which an isoline is created.
2349 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2351 # @param theParameter the U parameter for U-isoline or V parameter
2353 # @param theName Object name; when specified, this parameter is used
2354 # for result publication in the study. Otherwise, if automatic
2355 # publication is switched on, default value is used for result name.
2357 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2358 # a compound of edges.
2360 # @ref tui_creation_curve "Example"
2361 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2363 Create an isoline curve on a face.
2366 theFace the face for which an isoline is created.
2367 IsUIsoline True for U-isoline creation; False for V-isoline
2369 theParameter the U parameter for U-isoline or V parameter
2371 theName Object name; when specified, this parameter is used
2372 for result publication in the study. Otherwise, if automatic
2373 publication is switched on, default value is used for result name.
2376 New GEOM.GEOM_Object, containing the created isoline edge or a
2379 # Example: see GEOM_TestAll.py
2380 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2381 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2383 self._autoPublish(anObj, theName, "U-Isoline")
2385 self._autoPublish(anObj, theName, "V-Isoline")
2391 ## @addtogroup l3_sketcher
2394 ## Create a sketcher (wire or face), following the textual description,
2395 # passed through <VAR>theCommand</VAR> argument. \n
2396 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2397 # Format of the description string have to be the following:
2399 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2402 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2404 # - "R angle" : Set the direction by angle
2405 # - "D dx dy" : Set the direction by DX & DY
2408 # - "TT x y" : Create segment by point at X & Y
2409 # - "T dx dy" : Create segment by point with DX & DY
2410 # - "L length" : Create segment by direction & Length
2411 # - "IX x" : Create segment by direction & Intersect. X
2412 # - "IY y" : Create segment by direction & Intersect. Y
2415 # - "C radius length" : Create arc by direction, radius and length(in degree)
2416 # - "AA x y": Create arc by point at X & Y
2417 # - "A dx dy" : Create arc by point with DX & DY
2418 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2419 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2420 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2421 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2424 # - "WW" : Close Wire (to finish)
2425 # - "WF" : Close Wire and build face (to finish)
2428 # - Flag1 (= reverse) is 0 or 2 ...
2429 # - if 0 the drawn arc is the one of lower angle (< Pi)
2430 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2433 # - Flag2 (= control tolerance) is 0 or 1 ...
2434 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2435 # - if 1 the wire is built only if the end point is on the arc
2436 # with a tolerance of 10^-7 on the distance else the creation fails
2438 # @param theCommand String, defining the sketcher in local
2439 # coordinates of the working plane.
2440 # @param theWorkingPlane Nine double values, defining origin,
2441 # OZ and OX directions of the working plane.
2442 # @param theName Object name; when specified, this parameter is used
2443 # for result publication in the study. Otherwise, if automatic
2444 # publication is switched on, default value is used for result name.
2446 # @return New GEOM.GEOM_Object, containing the created wire.
2448 # @ref tui_sketcher_page "Example"
2449 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2451 Create a sketcher (wire or face), following the textual description, passed
2452 through theCommand argument.
2453 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2454 Format of the description string have to be the following:
2455 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2457 - x1, y1 are coordinates of the first sketcher point (zero by default),
2459 - "R angle" : Set the direction by angle
2460 - "D dx dy" : Set the direction by DX & DY
2462 - "TT x y" : Create segment by point at X & Y
2463 - "T dx dy" : Create segment by point with DX & DY
2464 - "L length" : Create segment by direction & Length
2465 - "IX x" : Create segment by direction & Intersect. X
2466 - "IY y" : Create segment by direction & Intersect. Y
2468 - "C radius length" : Create arc by direction, radius and length(in degree)
2469 - "AA x y": Create arc by point at X & Y
2470 - "A dx dy" : Create arc by point with DX & DY
2471 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2472 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2473 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2474 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2476 - "WW" : Close Wire (to finish)
2477 - "WF" : Close Wire and build face (to finish)
2479 - Flag1 (= reverse) is 0 or 2 ...
2480 - if 0 the drawn arc is the one of lower angle (< Pi)
2481 - if 2 the drawn arc ius the one of greater angle (> Pi)
2483 - Flag2 (= control tolerance) is 0 or 1 ...
2484 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2485 - if 1 the wire is built only if the end point is on the arc
2486 with a tolerance of 10^-7 on the distance else the creation fails
2489 theCommand String, defining the sketcher in local
2490 coordinates of the working plane.
2491 theWorkingPlane Nine double values, defining origin,
2492 OZ and OX directions of the working plane.
2493 theName Object name; when specified, this parameter is used
2494 for result publication in the study. Otherwise, if automatic
2495 publication is switched on, default value is used for result name.
2498 New GEOM.GEOM_Object, containing the created wire.
2500 # Example: see GEOM_TestAll.py
2501 theCommand,Parameters = ParseSketcherCommand(theCommand)
2502 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2503 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2504 anObj.SetParameters(Parameters)
2505 self._autoPublish(anObj, theName, "wire")
2508 ## Create a sketcher (wire or face), following the textual description,
2509 # passed through <VAR>theCommand</VAR> argument. \n
2510 # For format of the description string see MakeSketcher() method.\n
2511 # @param theCommand String, defining the sketcher in local
2512 # coordinates of the working plane.
2513 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2514 # @param theName Object name; when specified, this parameter is used
2515 # for result publication in the study. Otherwise, if automatic
2516 # publication is switched on, default value is used for result name.
2518 # @return New GEOM.GEOM_Object, containing the created wire.
2520 # @ref tui_sketcher_page "Example"
2521 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2523 Create a sketcher (wire or face), following the textual description,
2524 passed through theCommand argument.
2525 For format of the description string see geompy.MakeSketcher() method.
2528 theCommand String, defining the sketcher in local
2529 coordinates of the working plane.
2530 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2531 theName Object name; when specified, this parameter is used
2532 for result publication in the study. Otherwise, if automatic
2533 publication is switched on, default value is used for result name.
2536 New GEOM.GEOM_Object, containing the created wire.
2538 theCommand,Parameters = ParseSketcherCommand(theCommand)
2539 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2540 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2541 anObj.SetParameters(Parameters)
2542 self._autoPublish(anObj, theName, "wire")
2545 ## Obtain a 2D sketcher interface
2546 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2547 def Sketcher2D (self):
2549 Obtain a 2D sketcher interface.
2552 sk = geompy.Sketcher2D()
2554 sk.addSegmentRelative(15, 70)
2555 sk.addSegmentPerpY(50)
2556 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2557 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2558 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2560 Sketch_1 = sk.wire(geomObj_1)
2562 sk = Sketcher2D (self)
2565 ## Create a sketcher wire, following the numerical description,
2566 # passed through <VAR>theCoordinates</VAR> argument. \n
2567 # @param theCoordinates double values, defining points to create a wire,
2569 # @param theName Object name; when specified, this parameter is used
2570 # for result publication in the study. Otherwise, if automatic
2571 # publication is switched on, default value is used for result name.
2573 # @return New GEOM.GEOM_Object, containing the created wire.
2575 # @ref tui_3dsketcher_page "Example"
2576 def Make3DSketcher(self, theCoordinates, theName=None):
2578 Create a sketcher wire, following the numerical description,
2579 passed through theCoordinates argument.
2582 theCoordinates double values, defining points to create a wire,
2584 theName Object name; when specified, this parameter is used
2585 for result publication in the study. Otherwise, if automatic
2586 publication is switched on, default value is used for result name.
2589 New GEOM_Object, containing the created wire.
2591 theCoordinates,Parameters = ParseParameters(theCoordinates)
2592 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2593 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2594 anObj.SetParameters(Parameters)
2595 self._autoPublish(anObj, theName, "wire")
2598 ## Obtain a 3D sketcher interface
2599 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2601 # @ref tui_3dsketcher_page "Example"
2602 def Sketcher3D (self):
2604 Obtain a 3D sketcher interface.
2607 sk = geompy.Sketcher3D()
2608 sk.addPointsAbsolute(0,0,0, 70,0,0)
2609 sk.addPointsRelative(0, 0, 130)
2610 sk.addPointAnglesLength("OXY", 50, 0, 100)
2611 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2613 a3D_Sketcher_1 = sk.wire()
2615 sk = Sketcher3D (self)
2618 # end of l3_sketcher
2621 ## @addtogroup l3_3d_primitives
2624 ## Create a box by coordinates of two opposite vertices.
2626 # @param x1,y1,z1 double values, defining first point it.
2627 # @param x2,y2,z2 double values, defining first point it.
2628 # @param theName Object name; when specified, this parameter is used
2629 # for result publication in the study. Otherwise, if automatic
2630 # publication is switched on, default value is used for result name.
2632 # @return New GEOM.GEOM_Object, containing the created box.
2634 # @ref tui_creation_box "Example"
2635 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2637 Create a box by coordinates of two opposite vertices.
2640 x1,y1,z1 double values, defining first point.
2641 x2,y2,z2 double values, defining second point.
2642 theName Object name; when specified, this parameter is used
2643 for result publication in the study. Otherwise, if automatic
2644 publication is switched on, default value is used for result name.
2647 New GEOM.GEOM_Object, containing the created box.
2649 # Example: see GEOM_TestAll.py
2650 pnt1 = self.MakeVertex(x1,y1,z1)
2651 pnt2 = self.MakeVertex(x2,y2,z2)
2652 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2653 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2655 ## Create a box with specified dimensions along the coordinate axes
2656 # and with edges, parallel to the coordinate axes.
2657 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2658 # @param theDX Length of Box edges, parallel to OX axis.
2659 # @param theDY Length of Box edges, parallel to OY axis.
2660 # @param theDZ Length of Box edges, parallel to OZ axis.
2661 # @param theName Object name; when specified, this parameter is used
2662 # for result publication in the study. Otherwise, if automatic
2663 # publication is switched on, default value is used for result name.
2665 # @return New GEOM.GEOM_Object, containing the created box.
2667 # @ref tui_creation_box "Example"
2668 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2670 Create a box with specified dimensions along the coordinate axes
2671 and with edges, parallel to the coordinate axes.
2672 Center of the box will be at point (DX/2, DY/2, DZ/2).
2675 theDX Length of Box edges, parallel to OX axis.
2676 theDY Length of Box edges, parallel to OY axis.
2677 theDZ Length of Box edges, parallel to OZ axis.
2678 theName Object name; when specified, this parameter is used
2679 for result publication in the study. Otherwise, if automatic
2680 publication is switched on, default value is used for result name.
2683 New GEOM.GEOM_Object, containing the created box.
2685 # Example: see GEOM_TestAll.py
2686 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2687 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2688 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2689 anObj.SetParameters(Parameters)
2690 self._autoPublish(anObj, theName, "box")
2693 ## Create a box with two specified opposite vertices,
2694 # and with edges, parallel to the coordinate axes
2695 # @param thePnt1 First of two opposite vertices.
2696 # @param thePnt2 Second of two opposite vertices.
2697 # @param theName Object name; when specified, this parameter is used
2698 # for result publication in the study. Otherwise, if automatic
2699 # publication is switched on, default value is used for result name.
2701 # @return New GEOM.GEOM_Object, containing the created box.
2703 # @ref tui_creation_box "Example"
2704 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2706 Create a box with two specified opposite vertices,
2707 and with edges, parallel to the coordinate axes
2710 thePnt1 First of two opposite vertices.
2711 thePnt2 Second of two opposite vertices.
2712 theName Object name; when specified, this parameter is used
2713 for result publication in the study. Otherwise, if automatic
2714 publication is switched on, default value is used for result name.
2717 New GEOM.GEOM_Object, containing the created box.
2719 # Example: see GEOM_TestAll.py
2720 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2721 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2722 self._autoPublish(anObj, theName, "box")
2725 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2726 # @param theH height of Face.
2727 # @param theW width of Face.
2728 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2729 # @param theName Object name; when specified, this parameter is used
2730 # for result publication in the study. Otherwise, if automatic
2731 # publication is switched on, default value is used for result name.
2733 # @return New GEOM.GEOM_Object, containing the created face.
2735 # @ref tui_creation_face "Example"
2736 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2738 Create a face with specified dimensions with edges parallel to coordinate axes.
2741 theH height of Face.
2743 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2744 theName Object name; when specified, this parameter is used
2745 for result publication in the study. Otherwise, if automatic
2746 publication is switched on, default value is used for result name.
2749 New GEOM.GEOM_Object, containing the created face.
2751 # Example: see GEOM_TestAll.py
2752 theH,theW,Parameters = ParseParameters(theH, theW)
2753 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2754 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2755 anObj.SetParameters(Parameters)
2756 self._autoPublish(anObj, theName, "rectangle")
2759 ## Create a face from another plane and two sizes,
2760 # vertical size and horisontal size.
2761 # @param theObj Normale vector to the creating face or
2763 # @param theH Height (vertical size).
2764 # @param theW Width (horisontal size).
2765 # @param theName Object name; when specified, this parameter is used
2766 # for result publication in the study. Otherwise, if automatic
2767 # publication is switched on, default value is used for result name.
2769 # @return New GEOM.GEOM_Object, containing the created face.
2771 # @ref tui_creation_face "Example"
2772 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2774 Create a face from another plane and two sizes,
2775 vertical size and horisontal size.
2778 theObj Normale vector to the creating face or
2780 theH Height (vertical size).
2781 theW Width (horisontal size).
2782 theName Object name; when specified, this parameter is used
2783 for result publication in the study. Otherwise, if automatic
2784 publication is switched on, default value is used for result name.
2787 New GEOM_Object, containing the created face.
2789 # Example: see GEOM_TestAll.py
2790 theH,theW,Parameters = ParseParameters(theH, theW)
2791 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2792 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2793 anObj.SetParameters(Parameters)
2794 self._autoPublish(anObj, theName, "rectangle")
2797 ## Create a disk with given center, normal vector and radius.
2798 # @param thePnt Disk center.
2799 # @param theVec Vector, normal to the plane of the disk.
2800 # @param theR Disk radius.
2801 # @param theName Object name; when specified, this parameter is used
2802 # for result publication in the study. Otherwise, if automatic
2803 # publication is switched on, default value is used for result name.
2805 # @return New GEOM.GEOM_Object, containing the created disk.
2807 # @ref tui_creation_disk "Example"
2808 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2810 Create a disk with given center, normal vector and radius.
2814 theVec Vector, normal to the plane of the disk.
2816 theName Object name; when specified, this parameter is used
2817 for result publication in the study. Otherwise, if automatic
2818 publication is switched on, default value is used for result name.
2821 New GEOM.GEOM_Object, containing the created disk.
2823 # Example: see GEOM_TestAll.py
2824 theR,Parameters = ParseParameters(theR)
2825 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2826 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2827 anObj.SetParameters(Parameters)
2828 self._autoPublish(anObj, theName, "disk")
2831 ## Create a disk, passing through three given points
2832 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2833 # @param theName Object name; when specified, this parameter is used
2834 # for result publication in the study. Otherwise, if automatic
2835 # publication is switched on, default value is used for result name.
2837 # @return New GEOM.GEOM_Object, containing the created disk.
2839 # @ref tui_creation_disk "Example"
2840 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2842 Create a disk, passing through three given points
2845 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2846 theName Object name; when specified, this parameter is used
2847 for result publication in the study. Otherwise, if automatic
2848 publication is switched on, default value is used for result name.
2851 New GEOM.GEOM_Object, containing the created disk.
2853 # Example: see GEOM_TestAll.py
2854 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2855 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2856 self._autoPublish(anObj, theName, "disk")
2859 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2860 # @param theR Radius of Face.
2861 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2862 # @param theName Object name; when specified, this parameter is used
2863 # for result publication in the study. Otherwise, if automatic
2864 # publication is switched on, default value is used for result name.
2866 # @return New GEOM.GEOM_Object, containing the created disk.
2868 # @ref tui_creation_face "Example"
2869 def MakeDiskR(self, theR, theOrientation, theName=None):
2871 Create a disk with specified dimensions along OX-OY coordinate axes.
2874 theR Radius of Face.
2875 theOrientation set the orientation belong axis OXY or OYZ or OZX
2876 theName Object name; when specified, this parameter is used
2877 for result publication in the study. Otherwise, if automatic
2878 publication is switched on, default value is used for result name.
2881 New GEOM.GEOM_Object, containing the created disk.
2884 Disk3 = geompy.MakeDiskR(100., 1)
2886 # Example: see GEOM_TestAll.py
2887 theR,Parameters = ParseParameters(theR)
2888 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2889 RaiseIfFailed("MakeDiskR", self.PrimOp)
2890 anObj.SetParameters(Parameters)
2891 self._autoPublish(anObj, theName, "disk")
2894 ## Create a cylinder with given base point, axis, radius and height.
2895 # @param thePnt Central point of cylinder base.
2896 # @param theAxis Cylinder axis.
2897 # @param theR Cylinder radius.
2898 # @param theH Cylinder height.
2899 # @param theName Object name; when specified, this parameter is used
2900 # for result publication in the study. Otherwise, if automatic
2901 # publication is switched on, default value is used for result name.
2903 # @return New GEOM.GEOM_Object, containing the created cylinder.
2905 # @ref tui_creation_cylinder "Example"
2906 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2908 Create a cylinder with given base point, axis, radius and height.
2911 thePnt Central point of cylinder base.
2912 theAxis Cylinder axis.
2913 theR Cylinder radius.
2914 theH Cylinder height.
2915 theName Object name; when specified, this parameter is used
2916 for result publication in the study. Otherwise, if automatic
2917 publication is switched on, default value is used for result name.
2920 New GEOM.GEOM_Object, containing the created cylinder.
2922 # Example: see GEOM_TestAll.py
2923 theR,theH,Parameters = ParseParameters(theR, theH)
2924 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2925 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2926 anObj.SetParameters(Parameters)
2927 self._autoPublish(anObj, theName, "cylinder")
2930 ## Create a cylinder with given radius and height at
2931 # the origin of coordinate system. Axis of the cylinder
2932 # will be collinear to the OZ axis of the coordinate system.
2933 # @param theR Cylinder radius.
2934 # @param theH Cylinder height.
2935 # @param theName Object name; when specified, this parameter is used
2936 # for result publication in the study. Otherwise, if automatic
2937 # publication is switched on, default value is used for result name.
2939 # @return New GEOM.GEOM_Object, containing the created cylinder.
2941 # @ref tui_creation_cylinder "Example"
2942 def MakeCylinderRH(self, theR, theH, theName=None):
2944 Create a cylinder with given radius and height at
2945 the origin of coordinate system. Axis of the cylinder
2946 will be collinear to the OZ axis of the coordinate system.
2949 theR Cylinder radius.
2950 theH Cylinder height.
2951 theName Object name; when specified, this parameter is used
2952 for result publication in the study. Otherwise, if automatic
2953 publication is switched on, default value is used for result name.
2956 New GEOM.GEOM_Object, containing the created cylinder.
2958 # Example: see GEOM_TestAll.py
2959 theR,theH,Parameters = ParseParameters(theR, theH)
2960 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2961 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2962 anObj.SetParameters(Parameters)
2963 self._autoPublish(anObj, theName, "cylinder")
2966 ## Create a sphere with given center and radius.
2967 # @param thePnt Sphere center.
2968 # @param theR Sphere radius.
2969 # @param theName Object name; when specified, this parameter is used
2970 # for result publication in the study. Otherwise, if automatic
2971 # publication is switched on, default value is used for result name.
2973 # @return New GEOM.GEOM_Object, containing the created sphere.
2975 # @ref tui_creation_sphere "Example"
2976 def MakeSpherePntR(self, thePnt, theR, theName=None):
2978 Create a sphere with given center and radius.
2981 thePnt Sphere center.
2983 theName Object name; when specified, this parameter is used
2984 for result publication in the study. Otherwise, if automatic
2985 publication is switched on, default value is used for result name.
2988 New GEOM.GEOM_Object, containing the created sphere.
2990 # Example: see GEOM_TestAll.py
2991 theR,Parameters = ParseParameters(theR)
2992 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2993 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2994 anObj.SetParameters(Parameters)
2995 self._autoPublish(anObj, theName, "sphere")
2998 ## Create a sphere with given center and radius.
2999 # @param x,y,z Coordinates of sphere center.
3000 # @param theR Sphere radius.
3001 # @param theName Object name; when specified, this parameter is used
3002 # for result publication in the study. Otherwise, if automatic
3003 # publication is switched on, default value is used for result name.
3005 # @return New GEOM.GEOM_Object, containing the created sphere.
3007 # @ref tui_creation_sphere "Example"
3008 def MakeSphere(self, x, y, z, theR, theName=None):
3010 Create a sphere with given center and radius.
3013 x,y,z Coordinates of sphere center.
3015 theName Object name; when specified, this parameter is used
3016 for result publication in the study. Otherwise, if automatic
3017 publication is switched on, default value is used for result name.
3020 New GEOM.GEOM_Object, containing the created sphere.
3022 # Example: see GEOM_TestAll.py
3023 point = self.MakeVertex(x, y, z)
3024 # note: auto-publishing is done in self.MakeSpherePntR()
3025 anObj = self.MakeSpherePntR(point, theR, theName)
3028 ## Create a sphere with given radius at the origin of coordinate system.
3029 # @param theR Sphere radius.
3030 # @param theName Object name; when specified, this parameter is used
3031 # for result publication in the study. Otherwise, if automatic
3032 # publication is switched on, default value is used for result name.
3034 # @return New GEOM.GEOM_Object, containing the created sphere.
3036 # @ref tui_creation_sphere "Example"
3037 def MakeSphereR(self, theR, theName=None):
3039 Create a sphere with given radius at the origin of coordinate system.
3043 theName Object name; when specified, this parameter is used
3044 for result publication in the study. Otherwise, if automatic
3045 publication is switched on, default value is used for result name.
3048 New GEOM.GEOM_Object, containing the created sphere.
3050 # Example: see GEOM_TestAll.py
3051 theR,Parameters = ParseParameters(theR)
3052 anObj = self.PrimOp.MakeSphereR(theR)
3053 RaiseIfFailed("MakeSphereR", self.PrimOp)
3054 anObj.SetParameters(Parameters)
3055 self._autoPublish(anObj, theName, "sphere")
3058 ## Create a cone with given base point, axis, height and radiuses.
3059 # @param thePnt Central point of the first cone base.
3060 # @param theAxis Cone axis.
3061 # @param theR1 Radius of the first cone base.
3062 # @param theR2 Radius of the second cone base.
3063 # \note If both radiuses are non-zero, the cone will be truncated.
3064 # \note If the radiuses are equal, a cylinder will be created instead.
3065 # @param theH Cone height.
3066 # @param theName Object name; when specified, this parameter is used
3067 # for result publication in the study. Otherwise, if automatic
3068 # publication is switched on, default value is used for result name.
3070 # @return New GEOM.GEOM_Object, containing the created cone.
3072 # @ref tui_creation_cone "Example"
3073 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3075 Create a cone with given base point, axis, height and radiuses.
3078 thePnt Central point of the first cone base.
3080 theR1 Radius of the first cone base.
3081 theR2 Radius of the second cone base.
3083 theName Object name; when specified, this parameter is used
3084 for result publication in the study. Otherwise, if automatic
3085 publication is switched on, default value is used for result name.
3088 If both radiuses are non-zero, the cone will be truncated.
3089 If the radiuses are equal, a cylinder will be created instead.
3092 New GEOM.GEOM_Object, containing the created cone.
3094 # Example: see GEOM_TestAll.py
3095 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3096 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3097 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3098 anObj.SetParameters(Parameters)
3099 self._autoPublish(anObj, theName, "cone")
3102 ## Create a cone with given height and radiuses at
3103 # the origin of coordinate system. Axis of the cone will
3104 # be collinear to the OZ axis of the coordinate system.
3105 # @param theR1 Radius of the first cone base.
3106 # @param theR2 Radius of the second cone base.
3107 # \note If both radiuses are non-zero, the cone will be truncated.
3108 # \note If the radiuses are equal, a cylinder will be created instead.
3109 # @param theH Cone height.
3110 # @param theName Object name; when specified, this parameter is used
3111 # for result publication in the study. Otherwise, if automatic
3112 # publication is switched on, default value is used for result name.
3114 # @return New GEOM.GEOM_Object, containing the created cone.
3116 # @ref tui_creation_cone "Example"
3117 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3119 Create a cone with given height and radiuses at
3120 the origin of coordinate system. Axis of the cone will
3121 be collinear to the OZ axis of the coordinate system.
3124 theR1 Radius of the first cone base.
3125 theR2 Radius of the second cone base.
3127 theName Object name; when specified, this parameter is used
3128 for result publication in the study. Otherwise, if automatic
3129 publication is switched on, default value is used for result name.
3132 If both radiuses are non-zero, the cone will be truncated.
3133 If the radiuses are equal, a cylinder will be created instead.
3136 New GEOM.GEOM_Object, containing the created cone.
3138 # Example: see GEOM_TestAll.py
3139 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3140 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3141 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3142 anObj.SetParameters(Parameters)
3143 self._autoPublish(anObj, theName, "cone")
3146 ## Create a torus with given center, normal vector and radiuses.
3147 # @param thePnt Torus central point.
3148 # @param theVec Torus axis of symmetry.
3149 # @param theRMajor Torus major radius.
3150 # @param theRMinor Torus minor radius.
3151 # @param theName Object name; when specified, this parameter is used
3152 # for result publication in the study. Otherwise, if automatic
3153 # publication is switched on, default value is used for result name.
3155 # @return New GEOM.GEOM_Object, containing the created torus.
3157 # @ref tui_creation_torus "Example"
3158 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3160 Create a torus with given center, normal vector and radiuses.
3163 thePnt Torus central point.
3164 theVec Torus axis of symmetry.
3165 theRMajor Torus major radius.
3166 theRMinor Torus minor radius.
3167 theName Object name; when specified, this parameter is used
3168 for result publication in the study. Otherwise, if automatic
3169 publication is switched on, default value is used for result name.
3172 New GEOM.GEOM_Object, containing the created torus.
3174 # Example: see GEOM_TestAll.py
3175 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3176 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3177 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3178 anObj.SetParameters(Parameters)
3179 self._autoPublish(anObj, theName, "torus")
3182 ## Create a torus with given radiuses at the origin of coordinate system.
3183 # @param theRMajor Torus major radius.
3184 # @param theRMinor Torus minor radius.
3185 # @param theName Object name; when specified, this parameter is used
3186 # for result publication in the study. Otherwise, if automatic
3187 # publication is switched on, default value is used for result name.
3189 # @return New GEOM.GEOM_Object, containing the created torus.
3191 # @ref tui_creation_torus "Example"
3192 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3194 Create a torus with given radiuses at the origin of coordinate system.
3197 theRMajor Torus major radius.
3198 theRMinor Torus minor radius.
3199 theName Object name; when specified, this parameter is used
3200 for result publication in the study. Otherwise, if automatic
3201 publication is switched on, default value is used for result name.
3204 New GEOM.GEOM_Object, containing the created torus.
3206 # Example: see GEOM_TestAll.py
3207 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3208 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3209 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3210 anObj.SetParameters(Parameters)
3211 self._autoPublish(anObj, theName, "torus")
3214 # end of l3_3d_primitives
3217 ## @addtogroup l3_complex
3220 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3221 # @param theBase Base shape to be extruded.
3222 # @param thePoint1 First end of extrusion vector.
3223 # @param thePoint2 Second end of extrusion vector.
3224 # @param theScaleFactor Use it to make prism with scaled second base.
3225 # Nagative value means not scaled second base.
3226 # @param theName Object name; when specified, this parameter is used
3227 # for result publication in the study. Otherwise, if automatic
3228 # publication is switched on, default value is used for result name.
3230 # @return New GEOM.GEOM_Object, containing the created prism.
3232 # @ref tui_creation_prism "Example"
3233 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3235 Create a shape by extrusion of the base shape along a vector, defined by two points.
3238 theBase Base shape to be extruded.
3239 thePoint1 First end of extrusion vector.
3240 thePoint2 Second end of extrusion vector.
3241 theScaleFactor Use it to make prism with scaled second base.
3242 Nagative value means not scaled second base.
3243 theName Object name; when specified, this parameter is used
3244 for result publication in the study. Otherwise, if automatic
3245 publication is switched on, default value is used for result name.
3248 New GEOM.GEOM_Object, containing the created prism.
3250 # Example: see GEOM_TestAll.py
3253 if theScaleFactor > 0:
3254 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3255 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3257 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3258 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3259 anObj.SetParameters(Parameters)
3260 self._autoPublish(anObj, theName, "prism")
3263 ## Create a shape by extrusion of the base shape along a
3264 # vector, defined by two points, in 2 Ways (forward/backward).
3265 # @param theBase Base shape to be extruded.
3266 # @param thePoint1 First end of extrusion vector.
3267 # @param thePoint2 Second end of extrusion vector.
3268 # @param theName Object name; when specified, this parameter is used
3269 # for result publication in the study. Otherwise, if automatic
3270 # publication is switched on, default value is used for result name.
3272 # @return New GEOM.GEOM_Object, containing the created prism.
3274 # @ref tui_creation_prism "Example"
3275 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3277 Create a shape by extrusion of the base shape along a
3278 vector, defined by two points, in 2 Ways (forward/backward).
3281 theBase Base shape to be extruded.
3282 thePoint1 First end of extrusion vector.
3283 thePoint2 Second end of extrusion vector.
3284 theName Object name; when specified, this parameter is used
3285 for result publication in the study. Otherwise, if automatic
3286 publication is switched on, default value is used for result name.
3289 New GEOM.GEOM_Object, containing the created prism.
3291 # Example: see GEOM_TestAll.py
3292 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3293 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3294 self._autoPublish(anObj, theName, "prism")
3297 ## Create a shape by extrusion of the base shape along the vector,
3298 # i.e. all the space, transfixed by the base shape during its translation
3299 # along the vector on the given distance.
3300 # @param theBase Base shape to be extruded.
3301 # @param theVec Direction of extrusion.
3302 # @param theH Prism dimension along theVec.
3303 # @param theScaleFactor Use it to make prism with scaled second base.
3304 # Negative value means not scaled second base.
3305 # @param theName Object name; when specified, this parameter is used
3306 # for result publication in the study. Otherwise, if automatic
3307 # publication is switched on, default value is used for result name.
3309 # @return New GEOM.GEOM_Object, containing the created prism.
3311 # @ref tui_creation_prism "Example"
3312 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3314 Create a shape by extrusion of the base shape along the vector,
3315 i.e. all the space, transfixed by the base shape during its translation
3316 along the vector on the given distance.
3319 theBase Base shape to be extruded.
3320 theVec Direction of extrusion.
3321 theH Prism dimension along theVec.
3322 theScaleFactor Use it to make prism with scaled second base.
3323 Negative value means not scaled second base.
3324 theName Object name; when specified, this parameter is used
3325 for result publication in the study. Otherwise, if automatic
3326 publication is switched on, default value is used for result name.
3329 New GEOM.GEOM_Object, containing the created prism.
3331 # Example: see GEOM_TestAll.py
3334 if theScaleFactor > 0:
3335 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3336 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3338 theH,Parameters = ParseParameters(theH)
3339 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3340 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3341 anObj.SetParameters(Parameters)
3342 self._autoPublish(anObj, theName, "prism")
3345 ## Create a shape by extrusion of the base shape along the vector,
3346 # i.e. all the space, transfixed by the base shape during its translation
3347 # along the vector on the given distance in 2 Ways (forward/backward).
3348 # @param theBase Base shape to be extruded.
3349 # @param theVec Direction of extrusion.
3350 # @param theH Prism dimension along theVec in forward direction.
3351 # @param theName Object name; when specified, this parameter is used
3352 # for result publication in the study. Otherwise, if automatic
3353 # publication is switched on, default value is used for result name.
3355 # @return New GEOM.GEOM_Object, containing the created prism.
3357 # @ref tui_creation_prism "Example"
3358 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3360 Create a shape by extrusion of the base shape along the vector,
3361 i.e. all the space, transfixed by the base shape during its translation
3362 along the vector on the given distance in 2 Ways (forward/backward).
3365 theBase Base shape to be extruded.
3366 theVec Direction of extrusion.
3367 theH Prism dimension along theVec in forward direction.
3368 theName Object name; when specified, this parameter is used
3369 for result publication in the study. Otherwise, if automatic
3370 publication is switched on, default value is used for result name.
3373 New GEOM.GEOM_Object, containing the created prism.
3375 # Example: see GEOM_TestAll.py
3376 theH,Parameters = ParseParameters(theH)
3377 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3378 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3379 anObj.SetParameters(Parameters)
3380 self._autoPublish(anObj, theName, "prism")
3383 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3384 # @param theBase Base shape to be extruded.
3385 # @param theDX, theDY, theDZ Directions of extrusion.
3386 # @param theScaleFactor Use it to make prism with scaled second base.
3387 # Nagative value means not scaled second base.
3388 # @param theName Object name; when specified, this parameter is used
3389 # for result publication in the study. Otherwise, if automatic
3390 # publication is switched on, default value is used for result name.
3392 # @return New GEOM.GEOM_Object, containing the created prism.
3394 # @ref tui_creation_prism "Example"
3395 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3397 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3400 theBase Base shape to be extruded.
3401 theDX, theDY, theDZ Directions of extrusion.
3402 theScaleFactor Use it to make prism with scaled second base.
3403 Nagative value means not scaled second base.
3404 theName Object name; when specified, this parameter is used
3405 for result publication in the study. Otherwise, if automatic
3406 publication is switched on, default value is used for result name.
3409 New GEOM.GEOM_Object, containing the created prism.
3411 # Example: see GEOM_TestAll.py
3414 if theScaleFactor > 0:
3415 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3416 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3418 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3419 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3420 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3421 anObj.SetParameters(Parameters)
3422 self._autoPublish(anObj, theName, "prism")
3425 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3426 # i.e. all the space, transfixed by the base shape during its translation
3427 # along the vector on the given distance in 2 Ways (forward/backward).
3428 # @param theBase Base shape to be extruded.
3429 # @param theDX, theDY, theDZ Directions of extrusion.
3430 # @param theName Object name; when specified, this parameter is used
3431 # for result publication in the study. Otherwise, if automatic
3432 # publication is switched on, default value is used for result name.
3434 # @return New GEOM.GEOM_Object, containing the created prism.
3436 # @ref tui_creation_prism "Example"
3437 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3439 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3440 i.e. all the space, transfixed by the base shape during its translation
3441 along the vector on the given distance in 2 Ways (forward/backward).
3444 theBase Base shape to be extruded.
3445 theDX, theDY, theDZ Directions of extrusion.
3446 theName Object name; when specified, this parameter is used
3447 for result publication in the study. Otherwise, if automatic
3448 publication is switched on, default value is used for result name.
3451 New GEOM.GEOM_Object, containing the created prism.
3453 # Example: see GEOM_TestAll.py
3454 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3455 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3456 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3457 anObj.SetParameters(Parameters)
3458 self._autoPublish(anObj, theName, "prism")
3461 ## Create a shape by revolution of the base shape around the axis
3462 # on the given angle, i.e. all the space, transfixed by the base
3463 # shape during its rotation around the axis on the given angle.
3464 # @param theBase Base shape to be rotated.
3465 # @param theAxis Rotation axis.
3466 # @param theAngle Rotation angle in radians.
3467 # @param theName Object name; when specified, this parameter is used
3468 # for result publication in the study. Otherwise, if automatic
3469 # publication is switched on, default value is used for result name.
3471 # @return New GEOM.GEOM_Object, containing the created revolution.
3473 # @ref tui_creation_revolution "Example"
3474 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3476 Create a shape by revolution of the base shape around the axis
3477 on the given angle, i.e. all the space, transfixed by the base
3478 shape during its rotation around the axis on the given angle.
3481 theBase Base shape to be rotated.
3482 theAxis Rotation axis.
3483 theAngle Rotation angle in radians.
3484 theName Object name; when specified, this parameter is used
3485 for result publication in the study. Otherwise, if automatic
3486 publication is switched on, default value is used for result name.
3489 New GEOM.GEOM_Object, containing the created revolution.
3491 # Example: see GEOM_TestAll.py
3492 theAngle,Parameters = ParseParameters(theAngle)
3493 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3494 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3495 anObj.SetParameters(Parameters)
3496 self._autoPublish(anObj, theName, "revolution")
3499 ## Create a shape by revolution of the base shape around the axis
3500 # on the given angle, i.e. all the space, transfixed by the base
3501 # shape during its rotation around the axis on the given angle in
3502 # both directions (forward/backward)
3503 # @param theBase Base shape to be rotated.
3504 # @param theAxis Rotation axis.
3505 # @param theAngle Rotation angle in radians.
3506 # @param theName Object name; when specified, this parameter is used
3507 # for result publication in the study. Otherwise, if automatic
3508 # publication is switched on, default value is used for result name.
3510 # @return New GEOM.GEOM_Object, containing the created revolution.
3512 # @ref tui_creation_revolution "Example"
3513 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3515 Create a shape by revolution of the base shape around the axis
3516 on the given angle, i.e. all the space, transfixed by the base
3517 shape during its rotation around the axis on the given angle in
3518 both directions (forward/backward).
3521 theBase Base shape to be rotated.
3522 theAxis Rotation axis.
3523 theAngle Rotation angle in radians.
3524 theName Object name; when specified, this parameter is used
3525 for result publication in the study. Otherwise, if automatic
3526 publication is switched on, default value is used for result name.
3529 New GEOM.GEOM_Object, containing the created revolution.
3531 theAngle,Parameters = ParseParameters(theAngle)
3532 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3533 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3534 anObj.SetParameters(Parameters)
3535 self._autoPublish(anObj, theName, "revolution")
3538 ## Create a filling from the given compound of contours.
3539 # @param theShape the compound of contours
3540 # @param theMinDeg a minimal degree of BSpline surface to create
3541 # @param theMaxDeg a maximal degree of BSpline surface to create
3542 # @param theTol2D a 2d tolerance to be reached
3543 # @param theTol3D a 3d tolerance to be reached
3544 # @param theNbIter a number of iteration of approximation algorithm
3545 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3546 # @param isApprox if True, BSpline curves are generated in the process
3547 # of surface construction. By default it is False, that means
3548 # the surface is created using given curves. The usage of
3549 # Approximation makes the algorithm work slower, but allows
3550 # building the surface for rather complex cases.
3551 # @param theName Object name; when specified, this parameter is used
3552 # for result publication in the study. Otherwise, if automatic
3553 # publication is switched on, default value is used for result name.
3555 # @return New GEOM.GEOM_Object, containing the created filling surface.
3557 # @ref tui_creation_filling "Example"
3558 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3559 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3561 Create a filling from the given compound of contours.
3564 theShape the compound of contours
3565 theMinDeg a minimal degree of BSpline surface to create
3566 theMaxDeg a maximal degree of BSpline surface to create
3567 theTol2D a 2d tolerance to be reached
3568 theTol3D a 3d tolerance to be reached
3569 theNbIter a number of iteration of approximation algorithm
3570 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3571 isApprox if True, BSpline curves are generated in the process
3572 of surface construction. By default it is False, that means
3573 the surface is created using given curves. The usage of
3574 Approximation makes the algorithm work slower, but allows
3575 building the surface for rather complex cases
3576 theName Object name; when specified, this parameter is used
3577 for result publication in the study. Otherwise, if automatic
3578 publication is switched on, default value is used for result name.
3581 New GEOM.GEOM_Object, containing the created filling surface.
3584 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3586 # Example: see GEOM_TestAll.py
3587 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3588 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3589 theTol2D, theTol3D, theNbIter,
3590 theMethod, isApprox)
3591 RaiseIfFailed("MakeFilling", self.PrimOp)
3592 anObj.SetParameters(Parameters)
3593 self._autoPublish(anObj, theName, "filling")
3597 ## Create a filling from the given compound of contours.
3598 # This method corresponds to MakeFilling with isApprox=True
3599 # @param theShape the compound of contours
3600 # @param theMinDeg a minimal degree of BSpline surface to create
3601 # @param theMaxDeg a maximal degree of BSpline surface to create
3602 # @param theTol3D a 3d tolerance to be reached
3603 # @param theName Object name; when specified, this parameter is used
3604 # for result publication in the study. Otherwise, if automatic
3605 # publication is switched on, default value is used for result name.
3607 # @return New GEOM.GEOM_Object, containing the created filling surface.
3609 # @ref tui_creation_filling "Example"
3610 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3612 Create a filling from the given compound of contours.
3613 This method corresponds to MakeFilling with isApprox=True
3616 theShape the compound of contours
3617 theMinDeg a minimal degree of BSpline surface to create
3618 theMaxDeg a maximal degree of BSpline surface to create
3619 theTol3D a 3d tolerance to be reached
3620 theName Object name; when specified, this parameter is used
3621 for result publication in the study. Otherwise, if automatic
3622 publication is switched on, default value is used for result name.
3625 New GEOM.GEOM_Object, containing the created filling surface.
3628 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3630 # Example: see GEOM_TestAll.py
3631 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3632 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3633 0, theTol3D, 0, GEOM.FOM_Default, True)
3634 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3635 anObj.SetParameters(Parameters)
3636 self._autoPublish(anObj, theName, "filling")
3639 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3640 # @param theSeqSections - set of specified sections.
3641 # @param theModeSolid - mode defining building solid or shell
3642 # @param thePreci - precision 3D used for smoothing
3643 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3644 # @param theName Object name; when specified, this parameter is used
3645 # for result publication in the study. Otherwise, if automatic
3646 # publication is switched on, default value is used for result name.
3648 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3650 # @ref swig_todo "Example"
3651 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3653 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3656 theSeqSections - set of specified sections.
3657 theModeSolid - mode defining building solid or shell
3658 thePreci - precision 3D used for smoothing
3659 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3660 theName Object name; when specified, this parameter is used
3661 for result publication in the study. Otherwise, if automatic
3662 publication is switched on, default value is used for result name.
3665 New GEOM.GEOM_Object, containing the created shell or solid.
3667 # Example: see GEOM_TestAll.py
3668 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3669 RaiseIfFailed("MakeThruSections", self.PrimOp)
3670 self._autoPublish(anObj, theName, "filling")
3673 ## Create a shape by extrusion of the base shape along
3674 # the path shape. The path shape can be a wire or an edge.
3675 # @param theBase Base shape to be extruded.
3676 # @param thePath Path shape to extrude the base shape along it.
3677 # @param theName Object name; when specified, this parameter is used
3678 # for result publication in the study. Otherwise, if automatic
3679 # publication is switched on, default value is used for result name.
3681 # @return New GEOM.GEOM_Object, containing the created pipe.
3683 # @ref tui_creation_pipe "Example"
3684 def MakePipe(self, theBase, thePath, theName=None):
3686 Create a shape by extrusion of the base shape along
3687 the path shape. The path shape can be a wire or an edge.
3690 theBase Base shape to be extruded.
3691 thePath Path shape to extrude the base shape along it.
3692 theName Object name; when specified, this parameter is used
3693 for result publication in the study. Otherwise, if automatic
3694 publication is switched on, default value is used for result name.
3697 New GEOM.GEOM_Object, containing the created pipe.
3699 # Example: see GEOM_TestAll.py
3700 anObj = self.PrimOp.MakePipe(theBase, thePath)
3701 RaiseIfFailed("MakePipe", self.PrimOp)
3702 self._autoPublish(anObj, theName, "pipe")
3705 ## Create a shape by extrusion of the profile shape along
3706 # the path shape. The path shape can be a wire or an edge.
3707 # the several profiles can be specified in the several locations of path.
3708 # @param theSeqBases - list of Bases shape to be extruded.
3709 # @param theLocations - list of locations on the path corresponding
3710 # specified list of the Bases shapes. Number of locations
3711 # should be equal to number of bases or list of locations can be empty.
3712 # @param thePath - Path shape to extrude the base shape along it.
3713 # @param theWithContact - the mode defining that the section is translated to be in
3714 # contact with the spine.
3715 # @param theWithCorrection - defining that the section is rotated to be
3716 # orthogonal to the spine tangent in the correspondent point
3717 # @param theName Object name; when specified, this parameter is used
3718 # for result publication in the study. Otherwise, if automatic
3719 # publication is switched on, default value is used for result name.
3721 # @return New GEOM.GEOM_Object, containing the created pipe.
3723 # @ref tui_creation_pipe_with_diff_sec "Example"
3724 def MakePipeWithDifferentSections(self, theSeqBases,
3725 theLocations, thePath,
3726 theWithContact, theWithCorrection, theName=None):
3728 Create a shape by extrusion of the profile shape along
3729 the path shape. The path shape can be a wire or an edge.
3730 the several profiles can be specified in the several locations of path.
3733 theSeqBases - list of Bases shape to be extruded.
3734 theLocations - list of locations on the path corresponding
3735 specified list of the Bases shapes. Number of locations
3736 should be equal to number of bases or list of locations can be empty.
3737 thePath - Path shape to extrude the base shape along it.
3738 theWithContact - the mode defining that the section is translated to be in
3739 contact with the spine(0/1)
3740 theWithCorrection - defining that the section is rotated to be
3741 orthogonal to the spine tangent in the correspondent point (0/1)
3742 theName Object name; when specified, this parameter is used
3743 for result publication in the study. Otherwise, if automatic
3744 publication is switched on, default value is used for result name.
3747 New GEOM.GEOM_Object, containing the created pipe.
3749 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3750 theLocations, thePath,
3751 theWithContact, theWithCorrection)
3752 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3753 self._autoPublish(anObj, theName, "pipe")
3756 ## Create a shape by extrusion of the profile shape along
3757 # the path shape. The path shape can be a wire or a edge.
3758 # the several profiles can be specified in the several locations of path.
3759 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3760 # shell or face. If number of faces in neighbour sections
3761 # aren't coincided result solid between such sections will
3762 # be created using external boundaries of this shells.
3763 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3764 # This list is used for searching correspondences between
3765 # faces in the sections. Size of this list must be equal
3766 # to size of list of base shapes.
3767 # @param theLocations - list of locations on the path corresponding
3768 # specified list of the Bases shapes. Number of locations
3769 # should be equal to number of bases. First and last
3770 # locations must be coincided with first and last vertexes
3771 # of path correspondingly.
3772 # @param thePath - Path shape to extrude the base shape along it.
3773 # @param theWithContact - the mode defining that the section is translated to be in
3774 # contact with the spine.
3775 # @param theWithCorrection - defining that the section is rotated to be
3776 # orthogonal to the spine tangent in the correspondent point
3777 # @param theName Object name; when specified, this parameter is used
3778 # for result publication in the study. Otherwise, if automatic
3779 # publication is switched on, default value is used for result name.
3781 # @return New GEOM.GEOM_Object, containing the created solids.
3783 # @ref tui_creation_pipe_with_shell_sec "Example"
3784 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3785 theLocations, thePath,
3786 theWithContact, theWithCorrection, theName=None):
3788 Create a shape by extrusion of the profile shape along
3789 the path shape. The path shape can be a wire or a edge.
3790 the several profiles can be specified in the several locations of path.
3793 theSeqBases - list of Bases shape to be extruded. Base shape must be
3794 shell or face. If number of faces in neighbour sections
3795 aren't coincided result solid between such sections will
3796 be created using external boundaries of this shells.
3797 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3798 This list is used for searching correspondences between
3799 faces in the sections. Size of this list must be equal
3800 to size of list of base shapes.
3801 theLocations - list of locations on the path corresponding
3802 specified list of the Bases shapes. Number of locations
3803 should be equal to number of bases. First and last
3804 locations must be coincided with first and last vertexes
3805 of path correspondingly.
3806 thePath - Path shape to extrude the base shape along it.
3807 theWithContact - the mode defining that the section is translated to be in
3808 contact with the spine (0/1)
3809 theWithCorrection - defining that the section is rotated to be
3810 orthogonal to the spine tangent in the correspondent point (0/1)
3811 theName Object name; when specified, this parameter is used
3812 for result publication in the study. Otherwise, if automatic
3813 publication is switched on, default value is used for result name.
3816 New GEOM.GEOM_Object, containing the created solids.
3818 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3819 theLocations, thePath,
3820 theWithContact, theWithCorrection)
3821 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3822 self._autoPublish(anObj, theName, "pipe")
3825 ## Create a shape by extrusion of the profile shape along
3826 # the path shape. This function is used only for debug pipe
3827 # functionality - it is a version of function MakePipeWithShellSections()
3828 # which give a possibility to recieve information about
3829 # creating pipe between each pair of sections step by step.
3830 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3831 theLocations, thePath,
3832 theWithContact, theWithCorrection, theName=None):
3834 Create a shape by extrusion of the profile shape along
3835 the path shape. This function is used only for debug pipe
3836 functionality - it is a version of previous function
3837 geompy.MakePipeWithShellSections() which give a possibility to
3838 recieve information about creating pipe between each pair of
3839 sections step by step.
3842 nbsect = len(theSeqBases)
3843 nbsubsect = len(theSeqSubBases)
3844 #print "nbsect = ",nbsect
3845 for i in range(1,nbsect):
3847 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3848 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3850 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3851 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3852 tmpLocations, thePath,
3853 theWithContact, theWithCorrection)
3854 if self.PrimOp.IsDone() == 0:
3855 print "Problems with pipe creation between ",i," and ",i+1," sections"
3856 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3859 print "Pipe between ",i," and ",i+1," sections is OK"
3864 resc = self.MakeCompound(res)
3865 #resc = self.MakeSewing(res, 0.001)
3866 #print "resc: ",resc
3867 self._autoPublish(resc, theName, "pipe")
3870 ## Create solids between given sections
3871 # @param theSeqBases - list of sections (shell or face).
3872 # @param theLocations - list of corresponding vertexes
3873 # @param theName Object name; when specified, this parameter is used
3874 # for result publication in the study. Otherwise, if automatic
3875 # publication is switched on, default value is used for result name.
3877 # @return New GEOM.GEOM_Object, containing the created solids.
3879 # @ref tui_creation_pipe_without_path "Example"
3880 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3882 Create solids between given sections
3885 theSeqBases - list of sections (shell or face).
3886 theLocations - list of corresponding vertexes
3887 theName Object name; when specified, this parameter is used
3888 for result publication in the study. Otherwise, if automatic
3889 publication is switched on, default value is used for result name.
3892 New GEOM.GEOM_Object, containing the created solids.
3894 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3895 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3896 self._autoPublish(anObj, theName, "pipe")
3899 ## Create a shape by extrusion of the base shape along
3900 # the path shape with constant bi-normal direction along the given vector.
3901 # The path shape can be a wire or an edge.
3902 # @param theBase Base shape to be extruded.
3903 # @param thePath Path shape to extrude the base shape along it.
3904 # @param theVec Vector defines a constant binormal direction to keep the
3905 # same angle beetween the direction and the sections
3906 # along the sweep surface.
3907 # @param theName Object name; when specified, this parameter is used
3908 # for result publication in the study. Otherwise, if automatic
3909 # publication is switched on, default value is used for result name.
3911 # @return New GEOM.GEOM_Object, containing the created pipe.
3913 # @ref tui_creation_pipe "Example"
3914 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3916 Create a shape by extrusion of the base shape along
3917 the path shape with constant bi-normal direction along the given vector.
3918 The path shape can be a wire or an edge.
3921 theBase Base shape to be extruded.
3922 thePath Path shape to extrude the base shape along it.
3923 theVec Vector defines a constant binormal direction to keep the
3924 same angle beetween the direction and the sections
3925 along the sweep surface.
3926 theName Object name; when specified, this parameter is used
3927 for result publication in the study. Otherwise, if automatic
3928 publication is switched on, default value is used for result name.
3931 New GEOM.GEOM_Object, containing the created pipe.
3933 # Example: see GEOM_TestAll.py
3934 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3935 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3936 self._autoPublish(anObj, theName, "pipe")
3939 ## Makes a thick solid from a face or a shell
3940 # @param theShape Face or Shell to be thicken
3941 # @param theThickness Thickness of the resulting solid
3942 # @param theName Object name; when specified, this parameter is used
3943 # for result publication in the study. Otherwise, if automatic
3944 # publication is switched on, default value is used for result name.
3946 # @return New GEOM.GEOM_Object, containing the created solid
3948 def MakeThickSolid(self, theShape, theThickness, theName=None):
3950 Make a thick solid from a face or a shell
3953 theShape Face or Shell to be thicken
3954 theThickness Thickness of the resulting solid
3955 theName Object name; when specified, this parameter is used
3956 for result publication in the study. Otherwise, if automatic
3957 publication is switched on, default value is used for result name.
3960 New GEOM.GEOM_Object, containing the created solid
3962 # Example: see GEOM_TestAll.py
3963 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3964 RaiseIfFailed("MakeThickening", self.PrimOp)
3965 self._autoPublish(anObj, theName, "pipe")
3969 ## Modifies a face or a shell to make it a thick solid
3970 # @param theShape Face or Shell to be thicken
3971 # @param theThickness Thickness of the resulting solid
3973 # @return The modified shape
3975 def Thicken(self, theShape, theThickness):
3977 Modifies a face or a shell to make it a thick solid
3980 theBase Base shape to be extruded.
3981 thePath Path shape to extrude the base shape along it.
3982 theName Object name; when specified, this parameter is used
3983 for result publication in the study. Otherwise, if automatic
3984 publication is switched on, default value is used for result name.
3989 # Example: see GEOM_TestAll.py
3990 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3991 RaiseIfFailed("MakeThickening", self.PrimOp)
3994 ## Build a middle path of a pipe-like shape.
3995 # The path shape can be a wire or an edge.
3996 # @param theShape It can be closed or unclosed pipe-like shell
3997 # or a pipe-like solid.
3998 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3999 # should be wires or faces of theShape.
4000 # @param theName Object name; when specified, this parameter is used
4001 # for result publication in the study. Otherwise, if automatic
4002 # publication is switched on, default value is used for result name.
4004 # @note It is not assumed that exact or approximate copy of theShape
4005 # can be obtained by applying existing Pipe operation on the
4006 # resulting "Path" wire taking theBase1 as the base - it is not
4007 # always possible; though in some particular cases it might work
4008 # it is not guaranteed. Thus, RestorePath function should not be
4009 # considered as an exact reverse operation of the Pipe.
4011 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4012 # source pipe's "path".
4014 # @ref tui_creation_pipe_path "Example"
4015 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4017 Build a middle path of a pipe-like shape.
4018 The path shape can be a wire or an edge.
4021 theShape It can be closed or unclosed pipe-like shell
4022 or a pipe-like solid.
4023 theBase1, theBase2 Two bases of the supposed pipe. This
4024 should be wires or faces of theShape.
4025 theName Object name; when specified, this parameter is used
4026 for result publication in the study. Otherwise, if automatic
4027 publication is switched on, default value is used for result name.
4030 New GEOM_Object, containing an edge or wire that represent
4033 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4034 RaiseIfFailed("RestorePath", self.PrimOp)
4035 self._autoPublish(anObj, theName, "path")
4038 ## Build a middle path of a pipe-like shape.
4039 # The path shape can be a wire or an edge.
4040 # @param theShape It can be closed or unclosed pipe-like shell
4041 # or a pipe-like solid.
4042 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4043 # should be lists of edges of theShape.
4044 # @param theName Object name; when specified, this parameter is used
4045 # for result publication in the study. Otherwise, if automatic
4046 # publication is switched on, default value is used for result name.
4048 # @note It is not assumed that exact or approximate copy of theShape
4049 # can be obtained by applying existing Pipe operation on the
4050 # resulting "Path" wire taking theBase1 as the base - it is not
4051 # always possible; though in some particular cases it might work
4052 # it is not guaranteed. Thus, RestorePath function should not be
4053 # considered as an exact reverse operation of the Pipe.
4055 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4056 # source pipe's "path".
4058 # @ref tui_creation_pipe_path "Example"
4059 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4061 Build a middle path of a pipe-like shape.
4062 The path shape can be a wire or an edge.
4065 theShape It can be closed or unclosed pipe-like shell
4066 or a pipe-like solid.
4067 listEdges1, listEdges2 Two bases of the supposed pipe. This
4068 should be lists of edges of theShape.
4069 theName Object name; when specified, this parameter is used
4070 for result publication in the study. Otherwise, if automatic
4071 publication is switched on, default value is used for result name.
4074 New GEOM_Object, containing an edge or wire that represent
4077 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4078 RaiseIfFailed("RestorePath", self.PrimOp)
4079 self._autoPublish(anObj, theName, "path")
4085 ## @addtogroup l3_advanced
4088 ## Create a linear edge with specified ends.
4089 # @param thePnt1 Point for the first end of edge.
4090 # @param thePnt2 Point for the second end of edge.
4091 # @param theName Object name; when specified, this parameter is used
4092 # for result publication in the study. Otherwise, if automatic
4093 # publication is switched on, default value is used for result name.
4095 # @return New GEOM.GEOM_Object, containing the created edge.
4097 # @ref tui_creation_edge "Example"
4098 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4100 Create a linear edge with specified ends.
4103 thePnt1 Point for the first end of edge.
4104 thePnt2 Point for the second end of edge.
4105 theName Object name; when specified, this parameter is used
4106 for result publication in the study. Otherwise, if automatic
4107 publication is switched on, default value is used for result name.
4110 New GEOM.GEOM_Object, containing the created edge.
4112 # Example: see GEOM_TestAll.py
4113 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4114 RaiseIfFailed("MakeEdge", self.ShapesOp)
4115 self._autoPublish(anObj, theName, "edge")
4118 ## Create a new edge, corresponding to the given length on the given curve.
4119 # @param theRefCurve The referenced curve (edge).
4120 # @param theLength Length on the referenced curve. It can be negative.
4121 # @param theStartPoint Any point can be selected for it, the new edge will begin
4122 # at the end of \a theRefCurve, close to the selected point.
4123 # If None, start from the first point of \a theRefCurve.
4124 # @param theName Object name; when specified, this parameter is used
4125 # for result publication in the study. Otherwise, if automatic
4126 # publication is switched on, default value is used for result name.
4128 # @return New GEOM.GEOM_Object, containing the created edge.
4130 # @ref tui_creation_edge "Example"
4131 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4133 Create a new edge, corresponding to the given length on the given curve.
4136 theRefCurve The referenced curve (edge).
4137 theLength Length on the referenced curve. It can be negative.
4138 theStartPoint Any point can be selected for it, the new edge will begin
4139 at the end of theRefCurve, close to the selected point.
4140 If None, start from the first point of theRefCurve.
4141 theName Object name; when specified, this parameter is used
4142 for result publication in the study. Otherwise, if automatic
4143 publication is switched on, default value is used for result name.
4146 New GEOM.GEOM_Object, containing the created edge.
4148 # Example: see GEOM_TestAll.py
4149 theLength, Parameters = ParseParameters(theLength)
4150 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4151 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4152 anObj.SetParameters(Parameters)
4153 self._autoPublish(anObj, theName, "edge")
4156 ## Create an edge from specified wire.
4157 # @param theWire source Wire
4158 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4159 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4160 # @param theName Object name; when specified, this parameter is used
4161 # for result publication in the study. Otherwise, if automatic
4162 # publication is switched on, default value is used for result name.
4164 # @return New GEOM.GEOM_Object, containing the created edge.
4166 # @ref tui_creation_edge "Example"
4167 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4169 Create an edge from specified wire.
4173 theLinearTolerance linear tolerance value (default = 1e-07)
4174 theAngularTolerance angular tolerance value (default = 1e-12)
4175 theName Object name; when specified, this parameter is used
4176 for result publication in the study. Otherwise, if automatic
4177 publication is switched on, default value is used for result name.
4180 New GEOM.GEOM_Object, containing the created edge.
4182 # Example: see GEOM_TestAll.py
4183 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4184 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4185 self._autoPublish(anObj, theName, "edge")
4188 ## Create a wire from the set of edges and wires.
4189 # @param theEdgesAndWires List of edges and/or wires.
4190 # @param theTolerance Maximum distance between vertices, that will be merged.
4191 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4192 # @param theName Object name; when specified, this parameter is used
4193 # for result publication in the study. Otherwise, if automatic
4194 # publication is switched on, default value is used for result name.
4196 # @return New GEOM.GEOM_Object, containing the created wire.
4198 # @ref tui_creation_wire "Example"
4199 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4201 Create a wire from the set of edges and wires.
4204 theEdgesAndWires List of edges and/or wires.
4205 theTolerance Maximum distance between vertices, that will be merged.
4206 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4207 theName Object name; when specified, this parameter is used
4208 for result publication in the study. Otherwise, if automatic
4209 publication is switched on, default value is used for result name.
4212 New GEOM.GEOM_Object, containing the created wire.
4214 # Example: see GEOM_TestAll.py
4215 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4216 RaiseIfFailed("MakeWire", self.ShapesOp)
4217 self._autoPublish(anObj, theName, "wire")
4220 ## Create a face on the given wire.
4221 # @param theWire closed Wire or Edge to build the face on.
4222 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4223 # If the tolerance of the obtained planar face is less
4224 # than 1e-06, this face will be returned, otherwise the
4225 # algorithm tries to build any suitable face on the given
4226 # wire and prints a warning message.
4227 # @param theName Object name; when specified, this parameter is used
4228 # for result publication in the study. Otherwise, if automatic
4229 # publication is switched on, default value is used for result name.
4231 # @return New GEOM.GEOM_Object, containing the created face.
4233 # @ref tui_creation_face "Example"
4234 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4236 Create a face on the given wire.
4239 theWire closed Wire or Edge to build the face on.
4240 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4241 If the tolerance of the obtained planar face is less
4242 than 1e-06, this face will be returned, otherwise the
4243 algorithm tries to build any suitable face on the given
4244 wire and prints a warning message.
4245 theName Object name; when specified, this parameter is used
4246 for result publication in the study. Otherwise, if automatic
4247 publication is switched on, default value is used for result name.
4250 New GEOM.GEOM_Object, containing the created face.
4252 # Example: see GEOM_TestAll.py
4253 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4254 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4255 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4257 RaiseIfFailed("MakeFace", self.ShapesOp)
4258 self._autoPublish(anObj, theName, "face")
4261 ## Create a face on the given wires set.
4262 # @param theWires List of closed wires or edges to build the face on.
4263 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4264 # If the tolerance of the obtained planar face is less
4265 # than 1e-06, this face will be returned, otherwise the
4266 # algorithm tries to build any suitable face on the given
4267 # wire and prints a warning message.
4268 # @param theName Object name; when specified, this parameter is used
4269 # for result publication in the study. Otherwise, if automatic
4270 # publication is switched on, default value is used for result name.
4272 # @return New GEOM.GEOM_Object, containing the created face.
4274 # @ref tui_creation_face "Example"
4275 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4277 Create a face on the given wires set.
4280 theWires List of closed wires or edges to build the face on.
4281 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4282 If the tolerance of the obtained planar face is less
4283 than 1e-06, this face will be returned, otherwise the
4284 algorithm tries to build any suitable face on the given
4285 wire and prints a warning message.
4286 theName Object name; when specified, this parameter is used
4287 for result publication in the study. Otherwise, if automatic
4288 publication is switched on, default value is used for result name.
4291 New GEOM.GEOM_Object, containing the created face.
4293 # Example: see GEOM_TestAll.py
4294 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4295 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4296 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4298 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4299 self._autoPublish(anObj, theName, "face")
4302 ## See MakeFaceWires() method for details.
4304 # @ref tui_creation_face "Example 1"
4305 # \n @ref swig_MakeFaces "Example 2"
4306 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4308 See geompy.MakeFaceWires() method for details.
4310 # Example: see GEOM_TestOthers.py
4311 # note: auto-publishing is done in self.MakeFaceWires()
4312 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4315 ## Create a shell from the set of faces and shells.
4316 # @param theFacesAndShells List of faces and/or shells.
4317 # @param theName Object name; when specified, this parameter is used
4318 # for result publication in the study. Otherwise, if automatic
4319 # publication is switched on, default value is used for result name.
4321 # @return New GEOM.GEOM_Object, containing the created shell.
4323 # @ref tui_creation_shell "Example"
4324 def MakeShell(self, theFacesAndShells, theName=None):
4326 Create a shell from the set of faces and shells.
4329 theFacesAndShells List of faces and/or shells.
4330 theName Object name; when specified, this parameter is used
4331 for result publication in the study. Otherwise, if automatic
4332 publication is switched on, default value is used for result name.
4335 New GEOM.GEOM_Object, containing the created shell.
4337 # Example: see GEOM_TestAll.py
4338 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4339 RaiseIfFailed("MakeShell", self.ShapesOp)
4340 self._autoPublish(anObj, theName, "shell")
4343 ## Create a solid, bounded by the given shells.
4344 # @param theShells Sequence of bounding shells.
4345 # @param theName Object name; when specified, this parameter is used
4346 # for result publication in the study. Otherwise, if automatic
4347 # publication is switched on, default value is used for result name.
4349 # @return New GEOM.GEOM_Object, containing the created solid.
4351 # @ref tui_creation_solid "Example"
4352 def MakeSolid(self, theShells, theName=None):
4354 Create a solid, bounded by the given shells.
4357 theShells Sequence of bounding shells.
4358 theName Object name; when specified, this parameter is used
4359 for result publication in the study. Otherwise, if automatic
4360 publication is switched on, default value is used for result name.
4363 New GEOM.GEOM_Object, containing the created solid.
4365 # Example: see GEOM_TestAll.py
4366 if len(theShells) == 1:
4367 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4369 # raise RuntimeError, "MakeSolidShells : " + descr
4370 if descr == "WRN_SHAPE_UNCLOSED":
4371 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4372 anObj = self.ShapesOp.MakeSolidShells(theShells)
4373 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4374 self._autoPublish(anObj, theName, "solid")
4377 ## Create a compound of the given shapes.
4378 # @param theShapes List of shapes to put in compound.
4379 # @param theName Object name; when specified, this parameter is used
4380 # for result publication in the study. Otherwise, if automatic
4381 # publication is switched on, default value is used for result name.
4383 # @return New GEOM.GEOM_Object, containing the created compound.
4385 # @ref tui_creation_compound "Example"
4386 def MakeCompound(self, theShapes, theName=None):
4388 Create a compound of the given shapes.
4391 theShapes List of shapes to put in compound.
4392 theName Object name; when specified, this parameter is used
4393 for result publication in the study. Otherwise, if automatic
4394 publication is switched on, default value is used for result name.
4397 New GEOM.GEOM_Object, containing the created compound.
4399 # Example: see GEOM_TestAll.py
4400 self.ShapesOp.StartOperation()
4401 anObj = self.ShapesOp.MakeCompound(theShapes)
4402 RaiseIfFailed("MakeCompound", self.ShapesOp)
4403 self._autoPublish(anObj, theName, "compound")
4406 # end of l3_advanced
4409 ## @addtogroup l2_measure
4412 ## Gives quantity of faces in the given shape.
4413 # @param theShape Shape to count faces of.
4414 # @return Quantity of faces.
4416 # @ref swig_NumberOf "Example"
4417 def NumberOfFaces(self, theShape):
4419 Gives quantity of faces in the given shape.
4422 theShape Shape to count faces of.
4427 # Example: see GEOM_TestOthers.py
4428 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4429 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4432 ## Gives quantity of edges in the given shape.
4433 # @param theShape Shape to count edges of.
4434 # @return Quantity of edges.
4436 # @ref swig_NumberOf "Example"
4437 def NumberOfEdges(self, theShape):
4439 Gives quantity of edges in the given shape.
4442 theShape Shape to count edges of.
4447 # Example: see GEOM_TestOthers.py
4448 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4449 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4452 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4453 # @param theShape Shape to count sub-shapes of.
4454 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4455 # @return Quantity of sub-shapes of given type.
4457 # @ref swig_NumberOf "Example"
4458 def NumberOfSubShapes(self, theShape, theShapeType):
4460 Gives quantity of sub-shapes of type theShapeType in the given shape.
4463 theShape Shape to count sub-shapes of.
4464 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4467 Quantity of sub-shapes of given type.
4469 # Example: see GEOM_TestOthers.py
4470 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4471 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4474 ## Gives quantity of solids in the given shape.
4475 # @param theShape Shape to count solids in.
4476 # @return Quantity of solids.
4478 # @ref swig_NumberOf "Example"
4479 def NumberOfSolids(self, theShape):
4481 Gives quantity of solids in the given shape.
4484 theShape Shape to count solids in.
4489 # Example: see GEOM_TestOthers.py
4490 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4491 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4497 ## @addtogroup l3_healing
4500 ## Reverses an orientation the given shape.
4501 # @param theShape Shape to be reversed.
4502 # @param theName Object name; when specified, this parameter is used
4503 # for result publication in the study. Otherwise, if automatic
4504 # publication is switched on, default value is used for result name.
4506 # @return The reversed copy of theShape.
4508 # @ref swig_ChangeOrientation "Example"
4509 def ChangeOrientation(self, theShape, theName=None):
4511 Reverses an orientation the given shape.
4514 theShape Shape to be reversed.
4515 theName Object name; when specified, this parameter is used
4516 for result publication in the study. Otherwise, if automatic
4517 publication is switched on, default value is used for result name.
4520 The reversed copy of theShape.
4522 # Example: see GEOM_TestAll.py
4523 anObj = self.ShapesOp.ChangeOrientation(theShape)
4524 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4525 self._autoPublish(anObj, theName, "reversed")
4528 ## See ChangeOrientation() method for details.
4530 # @ref swig_OrientationChange "Example"
4531 def OrientationChange(self, theShape, theName=None):
4533 See geompy.ChangeOrientation method for details.
4535 # Example: see GEOM_TestOthers.py
4536 # note: auto-publishing is done in self.ChangeOrientation()
4537 anObj = self.ChangeOrientation(theShape, theName)
4543 ## @addtogroup l4_obtain
4546 ## Retrieve all free faces from the given shape.
4547 # Free face is a face, which is not shared between two shells of the shape.
4548 # @param theShape Shape to find free faces in.
4549 # @return List of IDs of all free faces, contained in theShape.
4551 # @ref tui_measurement_tools_page "Example"
4552 def GetFreeFacesIDs(self,theShape):
4554 Retrieve all free faces from the given shape.
4555 Free face is a face, which is not shared between two shells of the shape.
4558 theShape Shape to find free faces in.
4561 List of IDs of all free faces, contained in theShape.
4563 # Example: see GEOM_TestOthers.py
4564 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4565 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4568 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4569 # @param theShape1 Shape to find sub-shapes in.
4570 # @param theShape2 Shape to find shared sub-shapes with.
4571 # @param theShapeType Type of sub-shapes to be retrieved.
4572 # @param theName Object name; when specified, this parameter is used
4573 # for result publication in the study. Otherwise, if automatic
4574 # publication is switched on, default value is used for result name.
4576 # @return List of sub-shapes of theShape1, shared with theShape2.
4578 # @ref swig_GetSharedShapes "Example"
4579 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4581 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4584 theShape1 Shape to find sub-shapes in.
4585 theShape2 Shape to find shared sub-shapes with.
4586 theShapeType Type of sub-shapes to be retrieved.
4587 theName Object name; when specified, this parameter is used
4588 for result publication in the study. Otherwise, if automatic
4589 publication is switched on, default value is used for result name.
4592 List of sub-shapes of theShape1, shared with theShape2.
4594 # Example: see GEOM_TestOthers.py
4595 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4596 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4597 self._autoPublish(aList, theName, "shared")
4600 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4601 # @param theShapes Shapes to find common sub-shapes of.
4602 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4603 # @param theName Object name; when specified, this parameter is used
4604 # for result publication in the study. Otherwise, if automatic
4605 # publication is switched on, default value is used for result name.
4607 # @return List of objects, that are sub-shapes of all given shapes.
4609 # @ref swig_GetSharedShapes "Example"
4610 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4612 Get all sub-shapes, shared by all shapes in the list theShapes.
4615 theShapes Shapes to find common sub-shapes of.
4616 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4617 theName Object name; when specified, this parameter is used
4618 for result publication in the study. Otherwise, if automatic
4619 publication is switched on, default value is used for result name.
4622 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4624 # Example: see GEOM_TestOthers.py
4625 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4626 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4627 self._autoPublish(aList, theName, "shared")
4630 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4631 # situated relatively the specified plane by the certain way,
4632 # defined through <VAR>theState</VAR> parameter.
4633 # @param theShape Shape to find sub-shapes of.
4634 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4635 # @param theAx1 Vector (or line, or linear edge), specifying normal
4636 # direction and location of the plane to find shapes on.
4637 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4638 # @param theName Object name; when specified, this parameter is used
4639 # for result publication in the study. Otherwise, if automatic
4640 # publication is switched on, default value is used for result name.
4642 # @return List of all found sub-shapes.
4644 # @ref swig_GetShapesOnPlane "Example"
4645 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4647 Find in theShape all sub-shapes of type theShapeType,
4648 situated relatively the specified plane by the certain way,
4649 defined through theState parameter.
4652 theShape Shape to find sub-shapes of.
4653 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4654 theAx1 Vector (or line, or linear edge), specifying normal
4655 direction and location of the plane to find shapes on.
4656 theState The state of the sub-shapes to find (see GEOM::shape_state)
4657 theName Object name; when specified, this parameter is used
4658 for result publication in the study. Otherwise, if automatic
4659 publication is switched on, default value is used for result name.
4662 List of all found sub-shapes.
4664 # Example: see GEOM_TestOthers.py
4665 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4666 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4667 self._autoPublish(aList, theName, "shapeOnPlane")
4670 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4671 # situated relatively the specified plane by the certain way,
4672 # defined through <VAR>theState</VAR> parameter.
4673 # @param theShape Shape to find sub-shapes of.
4674 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4675 # @param theAx1 Vector (or line, or linear edge), specifying normal
4676 # direction and location of the plane to find shapes on.
4677 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4679 # @return List of all found sub-shapes indices.
4681 # @ref swig_GetShapesOnPlaneIDs "Example"
4682 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4684 Find in theShape all sub-shapes of type theShapeType,
4685 situated relatively the specified plane by the certain way,
4686 defined through theState parameter.
4689 theShape Shape to find sub-shapes of.
4690 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4691 theAx1 Vector (or line, or linear edge), specifying normal
4692 direction and location of the plane to find shapes on.
4693 theState The state of the sub-shapes to find (see GEOM::shape_state)
4696 List of all found sub-shapes indices.
4698 # Example: see GEOM_TestOthers.py
4699 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4700 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4703 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4704 # situated relatively the specified plane by the certain way,
4705 # defined through <VAR>theState</VAR> parameter.
4706 # @param theShape Shape to find sub-shapes of.
4707 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4708 # @param theAx1 Vector (or line, or linear edge), specifying normal
4709 # direction of the plane to find shapes on.
4710 # @param thePnt Point specifying location of the plane to find shapes on.
4711 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4712 # @param theName Object name; when specified, this parameter is used
4713 # for result publication in the study. Otherwise, if automatic
4714 # publication is switched on, default value is used for result name.
4716 # @return List of all found sub-shapes.
4718 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4719 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4721 Find in theShape all sub-shapes of type theShapeType,
4722 situated relatively the specified plane by the certain way,
4723 defined through theState parameter.
4726 theShape Shape to find sub-shapes of.
4727 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4728 theAx1 Vector (or line, or linear edge), specifying normal
4729 direction and location of the plane to find shapes on.
4730 thePnt Point specifying location of the plane to find shapes on.
4731 theState The state of the sub-shapes to find (see GEOM::shape_state)
4732 theName Object name; when specified, this parameter is used
4733 for result publication in the study. Otherwise, if automatic
4734 publication is switched on, default value is used for result name.
4737 List of all found sub-shapes.
4739 # Example: see GEOM_TestOthers.py
4740 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4741 theAx1, thePnt, theState)
4742 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4743 self._autoPublish(aList, theName, "shapeOnPlane")
4746 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4747 # situated relatively the specified plane by the certain way,
4748 # defined through <VAR>theState</VAR> parameter.
4749 # @param theShape Shape to find sub-shapes of.
4750 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4751 # @param theAx1 Vector (or line, or linear edge), specifying normal
4752 # direction of the plane to find shapes on.
4753 # @param thePnt Point specifying location of the plane to find shapes on.
4754 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4756 # @return List of all found sub-shapes indices.
4758 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4759 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4761 Find in theShape all sub-shapes of type theShapeType,
4762 situated relatively the specified plane by the certain way,
4763 defined through theState parameter.
4766 theShape Shape to find sub-shapes of.
4767 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4768 theAx1 Vector (or line, or linear edge), specifying normal
4769 direction and location of the plane to find shapes on.
4770 thePnt Point specifying location of the plane to find shapes on.
4771 theState The state of the sub-shapes to find (see GEOM::shape_state)
4774 List of all found sub-shapes indices.
4776 # Example: see GEOM_TestOthers.py
4777 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4778 theAx1, thePnt, theState)
4779 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4782 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4783 # the specified cylinder by the certain way, defined through \a theState parameter.
4784 # @param theShape Shape to find sub-shapes of.
4785 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4786 # @param theAxis Vector (or line, or linear edge), specifying
4787 # axis of the cylinder to find shapes on.
4788 # @param theRadius Radius of the cylinder to find shapes on.
4789 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4790 # @param theName Object name; when specified, this parameter is used
4791 # for result publication in the study. Otherwise, if automatic
4792 # publication is switched on, default value is used for result name.
4794 # @return List of all found sub-shapes.
4796 # @ref swig_GetShapesOnCylinder "Example"
4797 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4799 Find in theShape all sub-shapes of type theShapeType, situated relatively
4800 the specified cylinder by the certain way, defined through theState parameter.
4803 theShape Shape to find sub-shapes of.
4804 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4805 theAxis Vector (or line, or linear edge), specifying
4806 axis of the cylinder to find shapes on.
4807 theRadius Radius of the cylinder to find shapes on.
4808 theState The state of the sub-shapes to find (see GEOM::shape_state)
4809 theName Object name; when specified, this parameter is used
4810 for result publication in the study. Otherwise, if automatic
4811 publication is switched on, default value is used for result name.
4814 List of all found sub-shapes.
4816 # Example: see GEOM_TestOthers.py
4817 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4818 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4819 self._autoPublish(aList, theName, "shapeOnCylinder")
4822 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4823 # the specified cylinder by the certain way, defined through \a theState parameter.
4824 # @param theShape Shape to find sub-shapes of.
4825 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4826 # @param theAxis Vector (or line, or linear edge), specifying
4827 # axis of the cylinder to find shapes on.
4828 # @param theRadius Radius of the cylinder to find shapes on.
4829 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4831 # @return List of all found sub-shapes indices.
4833 # @ref swig_GetShapesOnCylinderIDs "Example"
4834 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4836 Find in theShape all sub-shapes of type theShapeType, situated relatively
4837 the specified cylinder by the certain way, defined through theState parameter.
4840 theShape Shape to find sub-shapes of.
4841 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4842 theAxis Vector (or line, or linear edge), specifying
4843 axis of the cylinder to find shapes on.
4844 theRadius Radius of the cylinder to find shapes on.
4845 theState The state of the sub-shapes to find (see GEOM::shape_state)
4848 List of all found sub-shapes indices.
4850 # Example: see GEOM_TestOthers.py
4851 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4852 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4855 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4856 # the specified cylinder by the certain way, defined through \a theState parameter.
4857 # @param theShape Shape to find sub-shapes of.
4858 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4859 # @param theAxis Vector (or line, or linear edge), specifying
4860 # axis of the cylinder to find shapes on.
4861 # @param thePnt Point specifying location of the bottom of the cylinder.
4862 # @param theRadius Radius of the cylinder to find shapes on.
4863 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4864 # @param theName Object name; when specified, this parameter is used
4865 # for result publication in the study. Otherwise, if automatic
4866 # publication is switched on, default value is used for result name.
4868 # @return List of all found sub-shapes.
4870 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4871 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4873 Find in theShape all sub-shapes of type theShapeType, situated relatively
4874 the specified cylinder by the certain way, defined through theState parameter.
4877 theShape Shape to find sub-shapes of.
4878 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4879 theAxis Vector (or line, or linear edge), specifying
4880 axis of the cylinder to find shapes on.
4881 theRadius Radius of the cylinder to find shapes on.
4882 theState The state of the sub-shapes to find (see GEOM::shape_state)
4883 theName Object name; when specified, this parameter is used
4884 for result publication in the study. Otherwise, if automatic
4885 publication is switched on, default value is used for result name.
4888 List of all found sub-shapes.
4890 # Example: see GEOM_TestOthers.py
4891 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4892 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4893 self._autoPublish(aList, theName, "shapeOnCylinder")
4896 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4897 # the specified cylinder by the certain way, defined through \a theState parameter.
4898 # @param theShape Shape to find sub-shapes of.
4899 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4900 # @param theAxis Vector (or line, or linear edge), specifying
4901 # axis of the cylinder to find shapes on.
4902 # @param thePnt Point specifying location of the bottom of the cylinder.
4903 # @param theRadius Radius of the cylinder to find shapes on.
4904 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4906 # @return List of all found sub-shapes indices
4908 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4909 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4911 Find in theShape all sub-shapes of type theShapeType, situated relatively
4912 the specified cylinder by the certain way, defined through theState parameter.
4915 theShape Shape to find sub-shapes of.
4916 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4917 theAxis Vector (or line, or linear edge), specifying
4918 axis of the cylinder to find shapes on.
4919 theRadius Radius of the cylinder to find shapes on.
4920 theState The state of the sub-shapes to find (see GEOM::shape_state)
4923 List of all found sub-shapes indices.
4925 # Example: see GEOM_TestOthers.py
4926 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4927 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4930 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4931 # the specified sphere by the certain way, defined through \a theState parameter.
4932 # @param theShape Shape to find sub-shapes of.
4933 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4934 # @param theCenter Point, specifying center of the sphere to find shapes on.
4935 # @param theRadius Radius of the sphere to find shapes on.
4936 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4937 # @param theName Object name; when specified, this parameter is used
4938 # for result publication in the study. Otherwise, if automatic
4939 # publication is switched on, default value is used for result name.
4941 # @return List of all found sub-shapes.
4943 # @ref swig_GetShapesOnSphere "Example"
4944 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4946 Find in theShape all sub-shapes of type theShapeType, situated relatively
4947 the specified sphere by the certain way, defined through theState parameter.
4950 theShape Shape to find sub-shapes of.
4951 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4952 theCenter Point, specifying center of the sphere to find shapes on.
4953 theRadius Radius of the sphere to find shapes on.
4954 theState The state of the sub-shapes to find (see GEOM::shape_state)
4955 theName Object name; when specified, this parameter is used
4956 for result publication in the study. Otherwise, if automatic
4957 publication is switched on, default value is used for result name.
4960 List of all found sub-shapes.
4962 # Example: see GEOM_TestOthers.py
4963 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4964 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4965 self._autoPublish(aList, theName, "shapeOnSphere")
4968 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4969 # the specified sphere by the certain way, defined through \a theState parameter.
4970 # @param theShape Shape to find sub-shapes of.
4971 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4972 # @param theCenter Point, specifying center of the sphere to find shapes on.
4973 # @param theRadius Radius of the sphere to find shapes on.
4974 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4976 # @return List of all found sub-shapes indices.
4978 # @ref swig_GetShapesOnSphereIDs "Example"
4979 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4981 Find in theShape all sub-shapes of type theShapeType, situated relatively
4982 the specified sphere by the certain way, defined through theState parameter.
4985 theShape Shape to find sub-shapes of.
4986 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4987 theCenter Point, specifying center of the sphere to find shapes on.
4988 theRadius Radius of the sphere to find shapes on.
4989 theState The state of the sub-shapes to find (see GEOM::shape_state)
4992 List of all found sub-shapes indices.
4994 # Example: see GEOM_TestOthers.py
4995 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4996 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4999 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5000 # the specified quadrangle by the certain way, defined through \a theState parameter.
5001 # @param theShape Shape to find sub-shapes of.
5002 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5003 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5004 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5005 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5006 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5007 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5008 # @param theName Object name; when specified, this parameter is used
5009 # for result publication in the study. Otherwise, if automatic
5010 # publication is switched on, default value is used for result name.
5012 # @return List of all found sub-shapes.
5014 # @ref swig_GetShapesOnQuadrangle "Example"
5015 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5016 theTopLeftPoint, theTopRigthPoint,
5017 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5019 Find in theShape all sub-shapes of type theShapeType, situated relatively
5020 the specified quadrangle by the certain way, defined through theState parameter.
5023 theShape Shape to find sub-shapes of.
5024 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5025 theTopLeftPoint Point, specifying top left corner of a quadrangle
5026 theTopRigthPoint Point, specifying top right corner of a quadrangle
5027 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5028 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5029 theState The state of the sub-shapes to find (see GEOM::shape_state)
5030 theName Object name; when specified, this parameter is used
5031 for result publication in the study. Otherwise, if automatic
5032 publication is switched on, default value is used for result name.
5035 List of all found sub-shapes.
5037 # Example: see GEOM_TestOthers.py
5038 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5039 theTopLeftPoint, theTopRigthPoint,
5040 theBottomLeftPoint, theBottomRigthPoint, theState)
5041 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5042 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5045 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5046 # the specified quadrangle by the certain way, defined through \a theState parameter.
5047 # @param theShape Shape to find sub-shapes of.
5048 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5049 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5050 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5051 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5052 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5053 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5055 # @return List of all found sub-shapes indices.
5057 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5058 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5059 theTopLeftPoint, theTopRigthPoint,
5060 theBottomLeftPoint, theBottomRigthPoint, theState):
5062 Find in theShape all sub-shapes of type theShapeType, situated relatively
5063 the specified quadrangle by the certain way, defined through theState parameter.
5066 theShape Shape to find sub-shapes of.
5067 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5068 theTopLeftPoint Point, specifying top left corner of a quadrangle
5069 theTopRigthPoint Point, specifying top right corner of a quadrangle
5070 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5071 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5072 theState The state of the sub-shapes to find (see GEOM::shape_state)
5075 List of all found sub-shapes indices.
5078 # Example: see GEOM_TestOthers.py
5079 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5080 theTopLeftPoint, theTopRigthPoint,
5081 theBottomLeftPoint, theBottomRigthPoint, theState)
5082 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5085 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5086 # the specified \a theBox by the certain way, defined through \a theState parameter.
5087 # @param theBox Shape for relative comparing.
5088 # @param theShape Shape to find sub-shapes of.
5089 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5090 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5091 # @param theName Object name; when specified, this parameter is used
5092 # for result publication in the study. Otherwise, if automatic
5093 # publication is switched on, default value is used for result name.
5095 # @return List of all found sub-shapes.
5097 # @ref swig_GetShapesOnBox "Example"
5098 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5100 Find in theShape all sub-shapes of type theShapeType, situated relatively
5101 the specified theBox by the certain way, defined through theState parameter.
5104 theBox Shape for relative comparing.
5105 theShape Shape to find sub-shapes of.
5106 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5107 theState The state of the sub-shapes to find (see GEOM::shape_state)
5108 theName Object name; when specified, this parameter is used
5109 for result publication in the study. Otherwise, if automatic
5110 publication is switched on, default value is used for result name.
5113 List of all found sub-shapes.
5115 # Example: see GEOM_TestOthers.py
5116 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5117 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5118 self._autoPublish(aList, theName, "shapeOnBox")
5121 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5122 # the specified \a theBox by the certain way, defined through \a theState parameter.
5123 # @param theBox Shape for relative comparing.
5124 # @param theShape Shape to find sub-shapes of.
5125 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5126 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5128 # @return List of all found sub-shapes indices.
5130 # @ref swig_GetShapesOnBoxIDs "Example"
5131 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5133 Find in theShape all sub-shapes of type theShapeType, situated relatively
5134 the specified theBox by the certain way, defined through theState parameter.
5137 theBox Shape for relative comparing.
5138 theShape Shape to find sub-shapes of.
5139 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5140 theState The state of the sub-shapes to find (see GEOM::shape_state)
5143 List of all found sub-shapes indices.
5145 # Example: see GEOM_TestOthers.py
5146 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5147 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5150 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5151 # situated relatively the specified \a theCheckShape by the
5152 # certain way, defined through \a theState parameter.
5153 # @param theCheckShape Shape for relative comparing. It must be a solid.
5154 # @param theShape Shape to find sub-shapes of.
5155 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5156 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5157 # @param theName Object name; when specified, this parameter is used
5158 # for result publication in the study. Otherwise, if automatic
5159 # publication is switched on, default value is used for result name.
5161 # @return List of all found sub-shapes.
5163 # @ref swig_GetShapesOnShape "Example"
5164 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5166 Find in theShape all sub-shapes of type theShapeType,
5167 situated relatively the specified theCheckShape by the
5168 certain way, defined through theState parameter.
5171 theCheckShape Shape for relative comparing. It must be a solid.
5172 theShape Shape to find sub-shapes of.
5173 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5174 theState The state of the sub-shapes to find (see GEOM::shape_state)
5175 theName Object name; when specified, this parameter is used
5176 for result publication in the study. Otherwise, if automatic
5177 publication is switched on, default value is used for result name.
5180 List of all found sub-shapes.
5182 # Example: see GEOM_TestOthers.py
5183 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5184 theShapeType, theState)
5185 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5186 self._autoPublish(aList, theName, "shapeOnShape")
5189 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5190 # situated relatively the specified \a theCheckShape by the
5191 # certain way, defined through \a theState parameter.
5192 # @param theCheckShape Shape for relative comparing. It must be a solid.
5193 # @param theShape Shape to find sub-shapes of.
5194 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5195 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5196 # @param theName Object name; when specified, this parameter is used
5197 # for result publication in the study. Otherwise, if automatic
5198 # publication is switched on, default value is used for result name.
5200 # @return All found sub-shapes as compound.
5202 # @ref swig_GetShapesOnShapeAsCompound "Example"
5203 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5205 Find in theShape all sub-shapes of type theShapeType,
5206 situated relatively the specified theCheckShape by the
5207 certain way, defined through theState parameter.
5210 theCheckShape Shape for relative comparing. It must be a solid.
5211 theShape Shape to find sub-shapes of.
5212 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5213 theState The state of the sub-shapes to find (see GEOM::shape_state)
5214 theName Object name; when specified, this parameter is used
5215 for result publication in the study. Otherwise, if automatic
5216 publication is switched on, default value is used for result name.
5219 All found sub-shapes as compound.
5221 # Example: see GEOM_TestOthers.py
5222 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5223 theShapeType, theState)
5224 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5225 self._autoPublish(anObj, theName, "shapeOnShape")
5228 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5229 # situated relatively the specified \a theCheckShape by the
5230 # certain way, defined through \a theState parameter.
5231 # @param theCheckShape Shape for relative comparing. It must be a solid.
5232 # @param theShape Shape to find sub-shapes of.
5233 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5234 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5236 # @return List of all found sub-shapes indices.
5238 # @ref swig_GetShapesOnShapeIDs "Example"
5239 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5241 Find in theShape all sub-shapes of type theShapeType,
5242 situated relatively the specified theCheckShape by the
5243 certain way, defined through theState parameter.
5246 theCheckShape Shape for relative comparing. It must be a solid.
5247 theShape Shape to find sub-shapes of.
5248 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5249 theState The state of the sub-shapes to find (see GEOM::shape_state)
5252 List of all found sub-shapes indices.
5254 # Example: see GEOM_TestOthers.py
5255 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5256 theShapeType, theState)
5257 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5260 ## Get sub-shape(s) of theShapeWhere, which are
5261 # coincident with \a theShapeWhat or could be a part of it.
5262 # @param theShapeWhere Shape to find sub-shapes of.
5263 # @param theShapeWhat Shape, specifying what to find.
5264 # @param isNewImplementation implementation of GetInPlace functionality
5265 # (default = False, old alghorithm based on shape properties)
5266 # @param theName Object name; when specified, this parameter is used
5267 # for result publication in the study. Otherwise, if automatic
5268 # publication is switched on, default value is used for result name.
5270 # @return Group of all found sub-shapes or a single found sub-shape.
5272 # @note This function has a restriction on argument shapes.
5273 # If \a theShapeWhere has curved parts with significantly
5274 # outstanding centres (i.e. the mass centre of a part is closer to
5275 # \a theShapeWhat than to the part), such parts will not be found.
5276 # @image html get_in_place_lost_part.png
5278 # @ref swig_GetInPlace "Example"
5279 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5281 Get sub-shape(s) of theShapeWhere, which are
5282 coincident with theShapeWhat or could be a part of it.
5285 theShapeWhere Shape to find sub-shapes of.
5286 theShapeWhat Shape, specifying what to find.
5287 isNewImplementation Implementation of GetInPlace functionality
5288 (default = False, old alghorithm based on shape properties)
5289 theName Object name; when specified, this parameter is used
5290 for result publication in the study. Otherwise, if automatic
5291 publication is switched on, default value is used for result name.
5294 Group of all found sub-shapes or a single found sub-shape.
5298 This function has a restriction on argument shapes.
5299 If theShapeWhere has curved parts with significantly
5300 outstanding centres (i.e. the mass centre of a part is closer to
5301 theShapeWhat than to the part), such parts will not be found.
5303 # Example: see GEOM_TestOthers.py
5305 if isNewImplementation:
5306 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5308 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5310 RaiseIfFailed("GetInPlace", self.ShapesOp)
5311 self._autoPublish(anObj, theName, "inplace")
5314 ## Get sub-shape(s) of \a theShapeWhere, which are
5315 # coincident with \a theShapeWhat or could be a part of it.
5317 # Implementation of this method is based on a saved history of an operation,
5318 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5319 # arguments (an argument shape or a sub-shape of an argument shape).
5320 # The operation could be the Partition or one of boolean operations,
5321 # performed on simple shapes (not on compounds).
5323 # @param theShapeWhere Shape to find sub-shapes of.
5324 # @param theShapeWhat Shape, specifying what to find (must be in the
5325 # building history of the ShapeWhere).
5326 # @param theName Object name; when specified, this parameter is used
5327 # for result publication in the study. Otherwise, if automatic
5328 # publication is switched on, default value is used for result name.
5330 # @return Group of all found sub-shapes or a single found sub-shape.
5332 # @ref swig_GetInPlace "Example"
5333 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5335 Implementation of this method is based on a saved history of an operation,
5336 produced theShapeWhere. The theShapeWhat must be among this operation's
5337 arguments (an argument shape or a sub-shape of an argument shape).
5338 The operation could be the Partition or one of boolean operations,
5339 performed on simple shapes (not on compounds).
5342 theShapeWhere Shape to find sub-shapes of.
5343 theShapeWhat Shape, specifying what to find (must be in the
5344 building history of the ShapeWhere).
5345 theName Object name; when specified, this parameter is used
5346 for result publication in the study. Otherwise, if automatic
5347 publication is switched on, default value is used for result name.
5350 Group of all found sub-shapes or a single found sub-shape.
5352 # Example: see GEOM_TestOthers.py
5353 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5354 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5355 self._autoPublish(anObj, theName, "inplace")
5358 ## Get sub-shape of theShapeWhere, which is
5359 # equal to \a theShapeWhat.
5360 # @param theShapeWhere Shape to find sub-shape of.
5361 # @param theShapeWhat Shape, specifying what to find.
5362 # @param theName Object name; when specified, this parameter is used
5363 # for result publication in the study. Otherwise, if automatic
5364 # publication is switched on, default value is used for result name.
5366 # @return New GEOM.GEOM_Object for found sub-shape.
5368 # @ref swig_GetSame "Example"
5369 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5371 Get sub-shape of theShapeWhere, which is
5372 equal to theShapeWhat.
5375 theShapeWhere Shape to find sub-shape of.
5376 theShapeWhat Shape, specifying what to find.
5377 theName Object name; when specified, this parameter is used
5378 for result publication in the study. Otherwise, if automatic
5379 publication is switched on, default value is used for result name.
5382 New GEOM.GEOM_Object for found sub-shape.
5384 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5385 RaiseIfFailed("GetSame", self.ShapesOp)
5386 self._autoPublish(anObj, theName, "sameShape")
5390 ## Get sub-shape indices of theShapeWhere, which is
5391 # equal to \a theShapeWhat.
5392 # @param theShapeWhere Shape to find sub-shape of.
5393 # @param theShapeWhat Shape, specifying what to find.
5394 # @return List of all found sub-shapes indices.
5396 # @ref swig_GetSame "Example"
5397 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5399 Get sub-shape indices of theShapeWhere, which is
5400 equal to theShapeWhat.
5403 theShapeWhere Shape to find sub-shape of.
5404 theShapeWhat Shape, specifying what to find.
5407 List of all found sub-shapes indices.
5409 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5410 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5417 ## @addtogroup l4_access
5420 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5421 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5422 # @param aShape Shape to get sub-shape of.
5423 # @param ListOfID List of sub-shapes indices.
5424 # @param theName Object name; when specified, this parameter is used
5425 # for result publication in the study. Otherwise, if automatic
5426 # publication is switched on, default value is used for result name.
5428 # @return Found sub-shape.
5430 # @ref swig_all_decompose "Example"
5431 def GetSubShape(self, aShape, ListOfID, theName=None):
5433 Obtain a composite sub-shape of aShape, composed from sub-shapes
5434 of aShape, selected by their unique IDs inside aShape
5437 aShape Shape to get sub-shape of.
5438 ListOfID List of sub-shapes indices.
5439 theName Object name; when specified, this parameter is used
5440 for result publication in the study. Otherwise, if automatic
5441 publication is switched on, default value is used for result name.
5446 # Example: see GEOM_TestAll.py
5447 anObj = self.AddSubShape(aShape,ListOfID)
5448 self._autoPublish(anObj, theName, "subshape")
5451 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5452 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5453 # @param aShape Shape to get sub-shape of.
5454 # @param aSubShape Sub-shapes of aShape.
5455 # @return ID of found sub-shape.
5457 # @ref swig_all_decompose "Example"
5458 def GetSubShapeID(self, aShape, aSubShape):
5460 Obtain unique ID of sub-shape aSubShape inside aShape
5461 of aShape, selected by their unique IDs inside aShape
5464 aShape Shape to get sub-shape of.
5465 aSubShape Sub-shapes of aShape.
5468 ID of found sub-shape.
5470 # Example: see GEOM_TestAll.py
5471 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5472 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5475 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5476 # This function is provided for performance purpose. The complexity is O(n) with n
5477 # the number of subobjects of aShape
5478 # @param aShape Shape to get sub-shape of.
5479 # @param aSubShapes Sub-shapes of aShape.
5480 # @return list of IDs of found sub-shapes.
5482 # @ref swig_all_decompose "Example"
5483 def GetSubShapesIDs(self, aShape, aSubShapes):
5485 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5486 This function is provided for performance purpose. The complexity is O(n) with n
5487 the number of subobjects of aShape
5490 aShape Shape to get sub-shape of.
5491 aSubShapes Sub-shapes of aShape.
5494 List of IDs of found sub-shape.
5496 # Example: see GEOM_TestAll.py
5497 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5498 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5504 ## @addtogroup l4_decompose
5507 ## Get all sub-shapes and groups of \a theShape,
5508 # that were created already by any other methods.
5509 # @param theShape Any shape.
5510 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5511 # returned, else all found sub-shapes and groups.
5512 # @return List of existing sub-objects of \a theShape.
5514 # @ref swig_all_decompose "Example"
5515 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5517 Get all sub-shapes and groups of theShape,
5518 that were created already by any other methods.
5522 theGroupsOnly If this parameter is TRUE, only groups will be
5523 returned, else all found sub-shapes and groups.
5526 List of existing sub-objects of theShape.
5528 # Example: see GEOM_TestAll.py
5529 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5530 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5533 ## Get all groups of \a theShape,
5534 # that were created already by any other methods.
5535 # @param theShape Any shape.
5536 # @return List of existing groups of \a theShape.
5538 # @ref swig_all_decompose "Example"
5539 def GetGroups(self, theShape):
5541 Get all groups of theShape,
5542 that were created already by any other methods.
5548 List of existing groups of theShape.
5550 # Example: see GEOM_TestAll.py
5551 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5552 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5555 ## Explode a shape on sub-shapes of a given type.
5556 # If the shape itself matches the type, it is also returned.
5557 # @param aShape Shape to be exploded.
5558 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5559 # @param theName Object name; when specified, this parameter is used
5560 # for result publication in the study. Otherwise, if automatic
5561 # publication is switched on, default value is used for result name.
5563 # @return List of sub-shapes of type theShapeType, contained in theShape.
5565 # @ref swig_all_decompose "Example"
5566 def SubShapeAll(self, aShape, aType, theName=None):
5568 Explode a shape on sub-shapes of a given type.
5569 If the shape itself matches the type, it is also returned.
5572 aShape Shape to be exploded.
5573 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5574 theName Object name; when specified, this parameter is used
5575 for result publication in the study. Otherwise, if automatic
5576 publication is switched on, default value is used for result name.
5579 List of sub-shapes of type theShapeType, contained in theShape.
5581 # Example: see GEOM_TestAll.py
5582 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5583 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5584 self._autoPublish(ListObj, theName, "subshape")
5587 ## Explode a shape on sub-shapes of a given type.
5588 # @param aShape Shape to be exploded.
5589 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5590 # @return List of IDs of sub-shapes.
5592 # @ref swig_all_decompose "Example"
5593 def SubShapeAllIDs(self, aShape, aType):
5595 Explode a shape on sub-shapes of a given type.
5598 aShape Shape to be exploded (see geompy.ShapeType)
5599 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5602 List of IDs of sub-shapes.
5604 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5605 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5608 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5609 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5610 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5611 # @param aShape Shape to get sub-shape of.
5612 # @param ListOfInd List of sub-shapes indices.
5613 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5614 # @param theName Object name; when specified, this parameter is used
5615 # for result publication in the study. Otherwise, if automatic
5616 # publication is switched on, default value is used for result name.
5618 # @return A compound of sub-shapes of aShape.
5620 # @ref swig_all_decompose "Example"
5621 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5623 Obtain a compound of sub-shapes of aShape,
5624 selected by their indices in list of all sub-shapes of type aType.
5625 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5628 aShape Shape to get sub-shape of.
5629 ListOfID List of sub-shapes indices.
5630 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5631 theName Object name; when specified, this parameter is used
5632 for result publication in the study. Otherwise, if automatic
5633 publication is switched on, default value is used for result name.
5636 A compound of sub-shapes of aShape.
5638 # Example: see GEOM_TestAll.py
5640 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5641 for ind in ListOfInd:
5642 ListOfIDs.append(AllShapeIDsList[ind - 1])
5643 # note: auto-publishing is done in self.GetSubShape()
5644 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5647 ## Explode a shape on sub-shapes of a given type.
5648 # Sub-shapes will be sorted by coordinates of their gravity centers.
5649 # If the shape itself matches the type, it is also returned.
5650 # @param aShape Shape to be exploded.
5651 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5652 # @param theName Object name; when specified, this parameter is used
5653 # for result publication in the study. Otherwise, if automatic
5654 # publication is switched on, default value is used for result name.
5656 # @return List of sub-shapes of type theShapeType, contained in theShape.
5658 # @ref swig_SubShapeAllSorted "Example"
5659 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5661 Explode a shape on sub-shapes of a given type.
5662 Sub-shapes will be sorted by coordinates of their gravity centers.
5663 If the shape itself matches the type, it is also returned.
5666 aShape Shape to be exploded.
5667 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5668 theName Object name; when specified, this parameter is used
5669 for result publication in the study. Otherwise, if automatic
5670 publication is switched on, default value is used for result name.
5673 List of sub-shapes of type theShapeType, contained in theShape.
5675 # Example: see GEOM_TestAll.py
5676 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5677 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5678 self._autoPublish(ListObj, theName, "subshape")
5681 ## Explode a shape on sub-shapes of a given type.
5682 # Sub-shapes will be sorted by coordinates of their gravity centers.
5683 # @param aShape Shape to be exploded.
5684 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5685 # @return List of IDs of sub-shapes.
5687 # @ref swig_all_decompose "Example"
5688 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5690 Explode a shape on sub-shapes of a given type.
5691 Sub-shapes will be sorted by coordinates of their gravity centers.
5694 aShape Shape to be exploded.
5695 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5698 List of IDs of sub-shapes.
5700 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5701 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5704 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5705 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5706 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5707 # @param aShape Shape to get sub-shape of.
5708 # @param ListOfInd List of sub-shapes indices.
5709 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5710 # @param theName Object name; when specified, this parameter is used
5711 # for result publication in the study. Otherwise, if automatic
5712 # publication is switched on, default value is used for result name.
5714 # @return A compound of sub-shapes of aShape.
5716 # @ref swig_all_decompose "Example"
5717 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5719 Obtain a compound of sub-shapes of aShape,
5720 selected by they indices in sorted list of all sub-shapes of type aType.
5721 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5724 aShape Shape to get sub-shape of.
5725 ListOfID List of sub-shapes indices.
5726 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5727 theName Object name; when specified, this parameter is used
5728 for result publication in the study. Otherwise, if automatic
5729 publication is switched on, default value is used for result name.
5732 A compound of sub-shapes of aShape.
5734 # Example: see GEOM_TestAll.py
5736 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5737 for ind in ListOfInd:
5738 ListOfIDs.append(AllShapeIDsList[ind - 1])
5739 # note: auto-publishing is done in self.GetSubShape()
5740 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5743 ## Extract shapes (excluding the main shape) of given type.
5744 # @param aShape The shape.
5745 # @param aType The shape type (see ShapeType())
5746 # @param isSorted Boolean flag to switch sorting on/off.
5747 # @param theName Object name; when specified, this parameter is used
5748 # for result publication in the study. Otherwise, if automatic
5749 # publication is switched on, default value is used for result name.
5751 # @return List of sub-shapes of type aType, contained in aShape.
5753 # @ref swig_FilletChamfer "Example"
5754 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5756 Extract shapes (excluding the main shape) of given type.
5760 aType The shape type (see geompy.ShapeType)
5761 isSorted Boolean flag to switch sorting on/off.
5762 theName Object name; when specified, this parameter is used
5763 for result publication in the study. Otherwise, if automatic
5764 publication is switched on, default value is used for result name.
5767 List of sub-shapes of type aType, contained in aShape.
5769 # Example: see GEOM_TestAll.py
5770 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5771 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5772 self._autoPublish(ListObj, theName, "subshape")
5775 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5776 # @param aShape Main shape.
5777 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5778 # @param theName Object name; when specified, this parameter is used
5779 # for result publication in the study. Otherwise, if automatic
5780 # publication is switched on, default value is used for result name.
5781 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5783 # @ref swig_all_decompose "Example"
5784 def SubShapes(self, aShape, anIDs, theName=None):
5786 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5790 anIDs List of unique IDs of sub-shapes inside theMainShape.
5791 theName Object name; when specified, this parameter is used
5792 for result publication in the study. Otherwise, if automatic
5793 publication is switched on, default value is used for result name.
5796 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5798 # Example: see GEOM_TestAll.py
5799 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5800 RaiseIfFailed("SubShapes", self.ShapesOp)
5801 self._autoPublish(ListObj, theName, "subshape")
5804 # end of l4_decompose
5807 ## @addtogroup l4_decompose_d
5810 ## Deprecated method
5811 # It works like SubShapeAllSortedCentres(), but wrongly
5812 # defines centres of faces, shells and solids.
5813 def SubShapeAllSorted(self, aShape, aType, theName=None):
5816 It works like geompy.SubShapeAllSortedCentres, but wrongly
5817 defines centres of faces, shells and solids.
5819 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5820 RaiseIfFailed("MakeExplode", self.ShapesOp)
5821 self._autoPublish(ListObj, theName, "subshape")
5824 ## Deprecated method
5825 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5826 # defines centres of faces, shells and solids.
5827 def SubShapeAllSortedIDs(self, aShape, aType):
5830 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5831 defines centres of faces, shells and solids.
5833 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5834 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5837 ## Deprecated method
5838 # It works like SubShapeSortedCentres(), but has a bug
5839 # (wrongly defines centres of faces, shells and solids).
5840 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5843 It works like geompy.SubShapeSortedCentres, but has a bug
5844 (wrongly defines centres of faces, shells and solids).
5847 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5848 for ind in ListOfInd:
5849 ListOfIDs.append(AllShapeIDsList[ind - 1])
5850 # note: auto-publishing is done in self.GetSubShape()
5851 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5854 # end of l4_decompose_d
5857 ## @addtogroup l3_healing
5860 ## Apply a sequence of Shape Healing operators to the given object.
5861 # @param theShape Shape to be processed.
5862 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5863 # @param theParameters List of names of parameters
5864 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5865 # @param theValues List of values of parameters, in the same order
5866 # as parameters are listed in <VAR>theParameters</VAR> list.
5867 # @param theName Object name; when specified, this parameter is used
5868 # for result publication in the study. Otherwise, if automatic
5869 # publication is switched on, default value is used for result name.
5871 # <b> Operators and Parameters: </b> \n
5873 # * \b FixShape - corrects invalid shapes. \n
5874 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5875 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5877 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5878 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5879 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5880 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5882 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5883 # surfaces in segments using a certain angle. \n
5884 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5885 # if Angle=180, four if Angle=90, etc). \n
5886 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5888 # * \b SplitClosedFaces - splits closed faces in segments.
5889 # The number of segments depends on the number of splitting points.\n
5890 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5892 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5893 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5894 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5895 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5896 # This and the previous parameters can take the following values:\n
5897 # \b Parametric \b Continuity \n
5898 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5899 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5900 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5901 # ruling out sharp edges).\n
5902 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5903 # are of the same magnitude).\n
5904 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5905 # or surfaces (d/du C(u)) are the same at junction. \n
5906 # \b Geometric \b Continuity \n
5907 # \b G1: first derivatives are proportional at junction.\n
5908 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5909 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5910 # \b G2: first and second derivatives are proportional at junction.
5911 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5912 # continuity requires that the underlying parameterization was continuous as well.
5913 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5915 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5916 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5917 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5918 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5919 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5920 # with the specified parameters.\n
5921 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5922 # with the specified parameters.\n
5923 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5924 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5925 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5926 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5928 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5929 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5930 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5931 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5932 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5934 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5935 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5938 # @return New GEOM.GEOM_Object, containing processed shape.
5940 # \n @ref tui_shape_processing "Example"
5941 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5943 Apply a sequence of Shape Healing operators to the given object.
5946 theShape Shape to be processed.
5947 theValues List of values of parameters, in the same order
5948 as parameters are listed in theParameters list.
5949 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5950 theParameters List of names of parameters
5951 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5952 theName Object name; when specified, this parameter is used
5953 for result publication in the study. Otherwise, if automatic
5954 publication is switched on, default value is used for result name.
5956 Operators and Parameters:
5958 * FixShape - corrects invalid shapes.
5959 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5960 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5961 * FixFaceSize - removes small faces, such as spots and strips.
5962 * FixFaceSize.Tolerance - defines minimum possible face size.
5963 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5964 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5965 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5966 in segments using a certain angle.
5967 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5968 if Angle=180, four if Angle=90, etc).
5969 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5970 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5972 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5973 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5974 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5975 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5976 * SplitContinuity.CurveContinuity - required continuity for curves.
5977 This and the previous parameters can take the following values:
5979 Parametric Continuity:
5980 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5981 coincidental. The curves or surfaces may still meet at an angle,
5982 giving rise to a sharp corner or edge).
5983 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5984 are parallel, ruling out sharp edges).
5985 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5986 or surfaces are of the same magnitude).
5987 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5988 curves or surfaces (d/du C(u)) are the same at junction.
5990 Geometric Continuity:
5991 G1: first derivatives are proportional at junction.
5992 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5993 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5994 G2: first and second derivatives are proportional at junction. As the names imply,
5995 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5996 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5997 geometric continuity of order n, but not vice-versa.
5998 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5999 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6000 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6001 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6002 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6003 the specified parameters.
6004 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6005 the specified parameters.
6006 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6007 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6008 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6009 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6010 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6011 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6012 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6013 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6014 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6015 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6016 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6019 New GEOM.GEOM_Object, containing processed shape.
6021 Note: For more information look through SALOME Geometry User's Guide->
6022 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6024 # Example: see GEOM_TestHealing.py
6025 theValues,Parameters = ParseList(theValues)
6026 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6027 # To avoid script failure in case of good argument shape
6028 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6030 RaiseIfFailed("ProcessShape", self.HealOp)
6031 for string in (theOperators + theParameters):
6032 Parameters = ":" + Parameters
6034 anObj.SetParameters(Parameters)
6035 self._autoPublish(anObj, theName, "healed")
6038 ## Remove faces from the given object (shape).
6039 # @param theObject Shape to be processed.
6040 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6041 # removes ALL faces of the given object.
6042 # @param theName Object name; when specified, this parameter is used
6043 # for result publication in the study. Otherwise, if automatic
6044 # publication is switched on, default value is used for result name.
6046 # @return New GEOM.GEOM_Object, containing processed shape.
6048 # @ref tui_suppress_faces "Example"
6049 def SuppressFaces(self, theObject, theFaces, theName=None):
6051 Remove faces from the given object (shape).
6054 theObject Shape to be processed.
6055 theFaces Indices of faces to be removed, if EMPTY then the method
6056 removes ALL faces of the given object.
6057 theName Object name; when specified, this parameter is used
6058 for result publication in the study. Otherwise, if automatic
6059 publication is switched on, default value is used for result name.
6062 New GEOM.GEOM_Object, containing processed shape.
6064 # Example: see GEOM_TestHealing.py
6065 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6066 RaiseIfFailed("SuppressFaces", self.HealOp)
6067 self._autoPublish(anObj, theName, "suppressFaces")
6070 ## Sewing of some shapes into single shape.
6071 # @param ListShape Shapes to be processed.
6072 # @param theTolerance Required tolerance value.
6073 # @param AllowNonManifold Flag that allows non-manifold sewing.
6074 # @param theName Object name; when specified, this parameter is used
6075 # for result publication in the study. Otherwise, if automatic
6076 # publication is switched on, default value is used for result name.
6078 # @return New GEOM.GEOM_Object, containing processed shape.
6080 # @ref tui_sewing "Example"
6081 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6083 Sewing of some shapes into single shape.
6086 ListShape Shapes to be processed.
6087 theTolerance Required tolerance value.
6088 AllowNonManifold Flag that allows non-manifold sewing.
6089 theName Object name; when specified, this parameter is used
6090 for result publication in the study. Otherwise, if automatic
6091 publication is switched on, default value is used for result name.
6094 New GEOM.GEOM_Object, containing processed shape.
6096 # Example: see GEOM_TestHealing.py
6097 comp = self.MakeCompound(ListShape)
6098 # note: auto-publishing is done in self.Sew()
6099 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6102 ## Sewing of the given object.
6103 # @param theObject Shape to be processed.
6104 # @param theTolerance Required tolerance value.
6105 # @param AllowNonManifold Flag that allows non-manifold sewing.
6106 # @param theName Object name; when specified, this parameter is used
6107 # for result publication in the study. Otherwise, if automatic
6108 # publication is switched on, default value is used for result name.
6110 # @return New GEOM.GEOM_Object, containing processed shape.
6111 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6113 Sewing of the given object.
6116 theObject Shape to be processed.
6117 theTolerance Required tolerance value.
6118 AllowNonManifold Flag that allows non-manifold sewing.
6119 theName Object name; when specified, this parameter is used
6120 for result publication in the study. Otherwise, if automatic
6121 publication is switched on, default value is used for result name.
6124 New GEOM.GEOM_Object, containing processed shape.
6126 # Example: see MakeSewing() above
6127 theTolerance,Parameters = ParseParameters(theTolerance)
6128 if AllowNonManifold:
6129 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6131 anObj = self.HealOp.Sew(theObject, theTolerance)
6132 # To avoid script failure in case of good argument shape
6133 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6135 RaiseIfFailed("Sew", self.HealOp)
6136 anObj.SetParameters(Parameters)
6137 self._autoPublish(anObj, theName, "sewed")
6140 ## Rebuild the topology of theCompound of solids by removing
6141 # of the faces that are shared by several solids.
6142 # @param theCompound Shape to be processed.
6143 # @param theName Object name; when specified, this parameter is used
6144 # for result publication in the study. Otherwise, if automatic
6145 # publication is switched on, default value is used for result name.
6147 # @return New GEOM.GEOM_Object, containing processed shape.
6149 # @ref tui_remove_webs "Example"
6150 def RemoveInternalFaces (self, theCompound, theName=None):
6152 Rebuild the topology of theCompound of solids by removing
6153 of the faces that are shared by several solids.
6156 theCompound Shape to be processed.
6157 theName Object name; when specified, this parameter is used
6158 for result publication in the study. Otherwise, if automatic
6159 publication is switched on, default value is used for result name.
6162 New GEOM.GEOM_Object, containing processed shape.
6164 # Example: see GEOM_TestHealing.py
6165 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6166 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6167 self._autoPublish(anObj, theName, "removeWebs")
6170 ## Remove internal wires and edges from the given object (face).
6171 # @param theObject Shape to be processed.
6172 # @param theWires Indices of wires to be removed, if EMPTY then the method
6173 # removes ALL internal wires of the given object.
6174 # @param theName Object name; when specified, this parameter is used
6175 # for result publication in the study. Otherwise, if automatic
6176 # publication is switched on, default value is used for result name.
6178 # @return New GEOM.GEOM_Object, containing processed shape.
6180 # @ref tui_suppress_internal_wires "Example"
6181 def SuppressInternalWires(self, theObject, theWires, theName=None):
6183 Remove internal wires and edges from the given object (face).
6186 theObject Shape to be processed.
6187 theWires Indices of wires to be removed, if EMPTY then the method
6188 removes ALL internal wires of the given object.
6189 theName Object name; when specified, this parameter is used
6190 for result publication in the study. Otherwise, if automatic
6191 publication is switched on, default value is used for result name.
6194 New GEOM.GEOM_Object, containing processed shape.
6196 # Example: see GEOM_TestHealing.py
6197 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6198 RaiseIfFailed("RemoveIntWires", self.HealOp)
6199 self._autoPublish(anObj, theName, "suppressWires")
6202 ## Remove internal closed contours (holes) from the given object.
6203 # @param theObject Shape to be processed.
6204 # @param theWires Indices of wires to be removed, if EMPTY then the method
6205 # removes ALL internal holes of the given object
6206 # @param theName Object name; when specified, this parameter is used
6207 # for result publication in the study. Otherwise, if automatic
6208 # publication is switched on, default value is used for result name.
6210 # @return New GEOM.GEOM_Object, containing processed shape.
6212 # @ref tui_suppress_holes "Example"
6213 def SuppressHoles(self, theObject, theWires, theName=None):
6215 Remove internal closed contours (holes) from the given object.
6218 theObject Shape to be processed.
6219 theWires Indices of wires to be removed, if EMPTY then the method
6220 removes ALL internal holes of the given object
6221 theName Object name; when specified, this parameter is used
6222 for result publication in the study. Otherwise, if automatic
6223 publication is switched on, default value is used for result name.
6226 New GEOM.GEOM_Object, containing processed shape.
6228 # Example: see GEOM_TestHealing.py
6229 anObj = self.HealOp.FillHoles(theObject, theWires)
6230 RaiseIfFailed("FillHoles", self.HealOp)
6231 self._autoPublish(anObj, theName, "suppressHoles")
6234 ## Close an open wire.
6235 # @param theObject Shape to be processed.
6236 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6237 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6238 # @param isCommonVertex If True : closure by creation of a common vertex,
6239 # If False : closure by creation of an edge between ends.
6240 # @param theName Object name; when specified, this parameter is used
6241 # for result publication in the study. Otherwise, if automatic
6242 # publication is switched on, default value is used for result name.
6244 # @return New GEOM.GEOM_Object, containing processed shape.
6246 # @ref tui_close_contour "Example"
6247 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6252 theObject Shape to be processed.
6253 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6254 if [ ], then theObject itself is a wire.
6255 isCommonVertex If True : closure by creation of a common vertex,
6256 If False : closure by creation of an edge between ends.
6257 theName Object name; when specified, this parameter is used
6258 for result publication in the study. Otherwise, if automatic
6259 publication is switched on, default value is used for result name.
6262 New GEOM.GEOM_Object, containing processed shape.
6264 # Example: see GEOM_TestHealing.py
6265 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6266 RaiseIfFailed("CloseContour", self.HealOp)
6267 self._autoPublish(anObj, theName, "closeContour")
6270 ## Addition of a point to a given edge object.
6271 # @param theObject Shape to be processed.
6272 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6273 # if -1, then theObject itself is the edge.
6274 # @param theValue Value of parameter on edge or length parameter,
6275 # depending on \a isByParameter.
6276 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6277 # if FALSE : \a theValue is treated as a length parameter [0..1]
6278 # @param theName Object name; when specified, this parameter is used
6279 # for result publication in the study. Otherwise, if automatic
6280 # publication is switched on, default value is used for result name.
6282 # @return New GEOM.GEOM_Object, containing processed shape.
6284 # @ref tui_add_point_on_edge "Example"
6285 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6287 Addition of a point to a given edge object.
6290 theObject Shape to be processed.
6291 theEdgeIndex Index of edge to be divided within theObject's shape,
6292 if -1, then theObject itself is the edge.
6293 theValue Value of parameter on edge or length parameter,
6294 depending on isByParameter.
6295 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6296 if FALSE : theValue is treated as a length parameter [0..1]
6297 theName Object name; when specified, this parameter is used
6298 for result publication in the study. Otherwise, if automatic
6299 publication is switched on, default value is used for result name.
6302 New GEOM.GEOM_Object, containing processed shape.
6304 # Example: see GEOM_TestHealing.py
6305 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6306 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6307 RaiseIfFailed("DivideEdge", self.HealOp)
6308 anObj.SetParameters(Parameters)
6309 self._autoPublish(anObj, theName, "divideEdge")
6312 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6313 # @param theWire Wire to minimize the number of C1 continuous edges in.
6314 # @param theVertices A list of vertices to suppress. If the list
6315 # is empty, all vertices in a wire will be assumed.
6316 # @param theName Object name; when specified, this parameter is used
6317 # for result publication in the study. Otherwise, if automatic
6318 # publication is switched on, default value is used for result name.
6320 # @return New GEOM.GEOM_Object with modified wire.
6322 # @ref tui_fuse_collinear_edges "Example"
6323 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6325 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6328 theWire Wire to minimize the number of C1 continuous edges in.
6329 theVertices A list of vertices to suppress. If the list
6330 is empty, all vertices in a wire will be assumed.
6331 theName Object name; when specified, this parameter is used
6332 for result publication in the study. Otherwise, if automatic
6333 publication is switched on, default value is used for result name.
6336 New GEOM.GEOM_Object with modified wire.
6338 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6339 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6340 self._autoPublish(anObj, theName, "fuseEdges")
6343 ## Change orientation of the given object. Updates given shape.
6344 # @param theObject Shape to be processed.
6345 # @return Updated <var>theObject</var>
6347 # @ref swig_todo "Example"
6348 def ChangeOrientationShell(self,theObject):
6350 Change orientation of the given object. Updates given shape.
6353 theObject Shape to be processed.
6358 theObject = self.HealOp.ChangeOrientation(theObject)
6359 RaiseIfFailed("ChangeOrientation", self.HealOp)
6362 ## Change orientation of the given object.
6363 # @param theObject Shape to be processed.
6364 # @param theName Object name; when specified, this parameter is used
6365 # for result publication in the study. Otherwise, if automatic
6366 # publication is switched on, default value is used for result name.
6368 # @return New GEOM.GEOM_Object, containing processed shape.
6370 # @ref swig_todo "Example"
6371 def ChangeOrientationShellCopy(self, theObject, theName=None):
6373 Change orientation of the given object.
6376 theObject Shape to be processed.
6377 theName Object name; when specified, this parameter is used
6378 for result publication in the study. Otherwise, if automatic
6379 publication is switched on, default value is used for result name.
6382 New GEOM.GEOM_Object, containing processed shape.
6384 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6385 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6386 self._autoPublish(anObj, theName, "reversed")
6389 ## Try to limit tolerance of the given object by value \a theTolerance.
6390 # @param theObject Shape to be processed.
6391 # @param theTolerance Required tolerance value.
6392 # @param theName Object name; when specified, this parameter is used
6393 # for result publication in the study. Otherwise, if automatic
6394 # publication is switched on, default value is used for result name.
6396 # @return New GEOM.GEOM_Object, containing processed shape.
6398 # @ref tui_limit_tolerance "Example"
6399 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6401 Try to limit tolerance of the given object by value theTolerance.
6404 theObject Shape to be processed.
6405 theTolerance Required tolerance value.
6406 theName Object name; when specified, this parameter is used
6407 for result publication in the study. Otherwise, if automatic
6408 publication is switched on, default value is used for result name.
6411 New GEOM.GEOM_Object, containing processed shape.
6413 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6414 RaiseIfFailed("LimitTolerance", self.HealOp)
6415 self._autoPublish(anObj, theName, "limitTolerance")
6418 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6419 # that constitute a free boundary of the given shape.
6420 # @param theObject Shape to get free boundary of.
6421 # @param theName Object name; when specified, this parameter is used
6422 # for result publication in the study. Otherwise, if automatic
6423 # publication is switched on, default value is used for result name.
6425 # @return [\a status, \a theClosedWires, \a theOpenWires]
6426 # \n \a status: FALSE, if an error(s) occured during the method execution.
6427 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6428 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6430 # @ref tui_measurement_tools_page "Example"
6431 def GetFreeBoundary(self, theObject, theName=None):
6433 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6434 that constitute a free boundary of the given shape.
6437 theObject Shape to get free boundary of.
6438 theName Object name; when specified, this parameter is used
6439 for result publication in the study. Otherwise, if automatic
6440 publication is switched on, default value is used for result name.
6443 [status, theClosedWires, theOpenWires]
6444 status: FALSE, if an error(s) occured during the method execution.
6445 theClosedWires: Closed wires on the free boundary of the given shape.
6446 theOpenWires: Open wires on the free boundary of the given shape.
6448 # Example: see GEOM_TestHealing.py
6449 anObj = self.HealOp.GetFreeBoundary(theObject)
6450 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6451 self._autoPublish(anObj[1], theName, "closedWire")
6452 self._autoPublish(anObj[2], theName, "openWire")
6455 ## Replace coincident faces in theShape by one face.
6456 # @param theShape Initial shape.
6457 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6458 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6459 # otherwise all initial shapes.
6460 # @param theName Object name; when specified, this parameter is used
6461 # for result publication in the study. Otherwise, if automatic
6462 # publication is switched on, default value is used for result name.
6464 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6466 # @ref tui_glue_faces "Example"
6467 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6469 Replace coincident faces in theShape by one face.
6472 theShape Initial shape.
6473 theTolerance Maximum distance between faces, which can be considered as coincident.
6474 doKeepNonSolids If FALSE, only solids will present in the result,
6475 otherwise all initial shapes.
6476 theName Object name; when specified, this parameter is used
6477 for result publication in the study. Otherwise, if automatic
6478 publication is switched on, default value is used for result name.
6481 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6483 # Example: see GEOM_Spanner.py
6484 theTolerance,Parameters = ParseParameters(theTolerance)
6485 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6487 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6488 anObj.SetParameters(Parameters)
6489 self._autoPublish(anObj, theName, "glueFaces")
6492 ## Find coincident faces in theShape for possible gluing.
6493 # @param theShape Initial shape.
6494 # @param theTolerance Maximum distance between faces,
6495 # which can be considered as coincident.
6496 # @param theName Object name; when specified, this parameter is used
6497 # for result publication in the study. Otherwise, if automatic
6498 # publication is switched on, default value is used for result name.
6500 # @return GEOM.ListOfGO
6502 # @ref tui_glue_faces "Example"
6503 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6505 Find coincident faces in theShape for possible gluing.
6508 theShape Initial shape.
6509 theTolerance Maximum distance between faces,
6510 which can be considered as coincident.
6511 theName Object name; when specified, this parameter is used
6512 for result publication in the study. Otherwise, if automatic
6513 publication is switched on, default value is used for result name.
6518 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6519 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6520 self._autoPublish(anObj, theName, "facesToGlue")
6523 ## Replace coincident faces in theShape by one face
6524 # in compliance with given list of faces
6525 # @param theShape Initial shape.
6526 # @param theTolerance Maximum distance between faces,
6527 # which can be considered as coincident.
6528 # @param theFaces List of faces for gluing.
6529 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6530 # otherwise all initial shapes.
6531 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6532 # will be glued, otherwise only the edges,
6533 # belonging to <VAR>theFaces</VAR>.
6534 # @param theName Object name; when specified, this parameter is used
6535 # for result publication in the study. Otherwise, if automatic
6536 # publication is switched on, default value is used for result name.
6538 # @return New GEOM.GEOM_Object, containing a copy of theShape
6539 # without some faces.
6541 # @ref tui_glue_faces "Example"
6542 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6543 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6545 Replace coincident faces in theShape by one face
6546 in compliance with given list of faces
6549 theShape Initial shape.
6550 theTolerance Maximum distance between faces,
6551 which can be considered as coincident.
6552 theFaces List of faces for gluing.
6553 doKeepNonSolids If FALSE, only solids will present in the result,
6554 otherwise all initial shapes.
6555 doGlueAllEdges If TRUE, all coincident edges of theShape
6556 will be glued, otherwise only the edges,
6557 belonging to theFaces.
6558 theName Object name; when specified, this parameter is used
6559 for result publication in the study. Otherwise, if automatic
6560 publication is switched on, default value is used for result name.
6563 New GEOM.GEOM_Object, containing a copy of theShape
6566 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6567 doKeepNonSolids, doGlueAllEdges)
6569 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6570 self._autoPublish(anObj, theName, "glueFaces")
6573 ## Replace coincident edges in theShape by one edge.
6574 # @param theShape Initial shape.
6575 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6576 # @param theName Object name; when specified, this parameter is used
6577 # for result publication in the study. Otherwise, if automatic
6578 # publication is switched on, default value is used for result name.
6580 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6582 # @ref tui_glue_edges "Example"
6583 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6585 Replace coincident edges in theShape by one edge.
6588 theShape Initial shape.
6589 theTolerance Maximum distance between edges, which can be considered as coincident.
6590 theName Object name; when specified, this parameter is used
6591 for result publication in the study. Otherwise, if automatic
6592 publication is switched on, default value is used for result name.
6595 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6597 theTolerance,Parameters = ParseParameters(theTolerance)
6598 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6600 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6601 anObj.SetParameters(Parameters)
6602 self._autoPublish(anObj, theName, "glueEdges")
6605 ## Find coincident edges in theShape for possible gluing.
6606 # @param theShape Initial shape.
6607 # @param theTolerance Maximum distance between edges,
6608 # which can be considered as coincident.
6609 # @param theName Object name; when specified, this parameter is used
6610 # for result publication in the study. Otherwise, if automatic
6611 # publication is switched on, default value is used for result name.
6613 # @return GEOM.ListOfGO
6615 # @ref tui_glue_edges "Example"
6616 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6618 Find coincident edges in theShape for possible gluing.
6621 theShape Initial shape.
6622 theTolerance Maximum distance between edges,
6623 which can be considered as coincident.
6624 theName Object name; when specified, this parameter is used
6625 for result publication in the study. Otherwise, if automatic
6626 publication is switched on, default value is used for result name.
6631 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6632 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6633 self._autoPublish(anObj, theName, "edgesToGlue")
6636 ## Replace coincident edges in theShape by one edge
6637 # in compliance with given list of edges.
6638 # @param theShape Initial shape.
6639 # @param theTolerance Maximum distance between edges,
6640 # which can be considered as coincident.
6641 # @param theEdges List of edges for gluing.
6642 # @param theName Object name; when specified, this parameter is used
6643 # for result publication in the study. Otherwise, if automatic
6644 # publication is switched on, default value is used for result name.
6646 # @return New GEOM.GEOM_Object, containing a copy of theShape
6647 # without some edges.
6649 # @ref tui_glue_edges "Example"
6650 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6652 Replace coincident edges in theShape by one edge
6653 in compliance with given list of edges.
6656 theShape Initial shape.
6657 theTolerance Maximum distance between edges,
6658 which can be considered as coincident.
6659 theEdges List of edges for gluing.
6660 theName Object name; when specified, this parameter is used
6661 for result publication in the study. Otherwise, if automatic
6662 publication is switched on, default value is used for result name.
6665 New GEOM.GEOM_Object, containing a copy of theShape
6668 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6670 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6671 self._autoPublish(anObj, theName, "glueEdges")
6677 ## @addtogroup l3_boolean Boolean Operations
6680 # -----------------------------------------------------------------------------
6681 # Boolean (Common, Cut, Fuse, Section)
6682 # -----------------------------------------------------------------------------
6684 ## Perform one of boolean operations on two given shapes.
6685 # @param theShape1 First argument for boolean operation.
6686 # @param theShape2 Second argument for boolean operation.
6687 # @param theOperation Indicates the operation to be done:\n
6688 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6689 # @param checkSelfInte The flag that tells if the arguments should
6690 # be checked for self-intersection prior to the operation.
6691 # @param theName Object name; when specified, this parameter is used
6692 # for result publication in the study. Otherwise, if automatic
6693 # publication is switched on, default value is used for result name.
6695 # @note This algorithm doesn't find all types of self-intersections.
6696 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6697 # vertex/face and edge/face intersections. Face/face
6698 # intersections detection is switched off as it is a
6699 # time-consuming operation that gives an impact on performance.
6700 # To find all self-intersections please use
6701 # CheckSelfIntersections() method.
6703 # @return New GEOM.GEOM_Object, containing the result shape.
6705 # @ref tui_fuse "Example"
6706 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6708 Perform one of boolean operations on two given shapes.
6711 theShape1 First argument for boolean operation.
6712 theShape2 Second argument for boolean operation.
6713 theOperation Indicates the operation to be done:
6714 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6715 checkSelfInte The flag that tells if the arguments should
6716 be checked for self-intersection prior to
6718 theName Object name; when specified, this parameter is used
6719 for result publication in the study. Otherwise, if automatic
6720 publication is switched on, default value is used for result name.
6723 This algorithm doesn't find all types of self-intersections.
6724 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6725 vertex/face and edge/face intersections. Face/face
6726 intersections detection is switched off as it is a
6727 time-consuming operation that gives an impact on performance.
6728 To find all self-intersections please use
6729 CheckSelfIntersections() method.
6732 New GEOM.GEOM_Object, containing the result shape.
6734 # Example: see GEOM_TestAll.py
6735 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6736 RaiseIfFailed("MakeBoolean", self.BoolOp)
6737 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6738 self._autoPublish(anObj, theName, def_names[theOperation])
6741 ## Perform Common boolean operation on two given shapes.
6742 # @param theShape1 First argument for boolean operation.
6743 # @param theShape2 Second argument for boolean operation.
6744 # @param checkSelfInte The flag that tells if the arguments should
6745 # be checked for self-intersection prior to the operation.
6746 # @param theName Object name; when specified, this parameter is used
6747 # for result publication in the study. Otherwise, if automatic
6748 # publication is switched on, default value is used for result name.
6750 # @note This algorithm doesn't find all types of self-intersections.
6751 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6752 # vertex/face and edge/face intersections. Face/face
6753 # intersections detection is switched off as it is a
6754 # time-consuming operation that gives an impact on performance.
6755 # To find all self-intersections please use
6756 # CheckSelfIntersections() method.
6758 # @return New GEOM.GEOM_Object, containing the result shape.
6760 # @ref tui_common "Example 1"
6761 # \n @ref swig_MakeCommon "Example 2"
6762 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6764 Perform Common boolean operation on two given shapes.
6767 theShape1 First argument for boolean operation.
6768 theShape2 Second argument for boolean operation.
6769 checkSelfInte The flag that tells if the arguments should
6770 be checked for self-intersection prior to
6772 theName Object name; when specified, this parameter is used
6773 for result publication in the study. Otherwise, if automatic
6774 publication is switched on, default value is used for result name.
6777 This algorithm doesn't find all types of self-intersections.
6778 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6779 vertex/face and edge/face intersections. Face/face
6780 intersections detection is switched off as it is a
6781 time-consuming operation that gives an impact on performance.
6782 To find all self-intersections please use
6783 CheckSelfIntersections() method.
6786 New GEOM.GEOM_Object, containing the result shape.
6788 # Example: see GEOM_TestOthers.py
6789 # note: auto-publishing is done in self.MakeBoolean()
6790 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6792 ## Perform Cut boolean operation on two given shapes.
6793 # @param theShape1 First argument for boolean operation.
6794 # @param theShape2 Second argument for boolean operation.
6795 # @param checkSelfInte The flag that tells if the arguments should
6796 # be checked for self-intersection prior to the operation.
6797 # @param theName Object name; when specified, this parameter is used
6798 # for result publication in the study. Otherwise, if automatic
6799 # publication is switched on, default value is used for result name.
6801 # @note This algorithm doesn't find all types of self-intersections.
6802 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6803 # vertex/face and edge/face intersections. Face/face
6804 # intersections detection is switched off as it is a
6805 # time-consuming operation that gives an impact on performance.
6806 # To find all self-intersections please use
6807 # CheckSelfIntersections() method.
6809 # @return New GEOM.GEOM_Object, containing the result shape.
6811 # @ref tui_cut "Example 1"
6812 # \n @ref swig_MakeCommon "Example 2"
6813 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6815 Perform Cut boolean operation on two given shapes.
6818 theShape1 First argument for boolean operation.
6819 theShape2 Second argument for boolean operation.
6820 checkSelfInte The flag that tells if the arguments should
6821 be checked for self-intersection prior to
6823 theName Object name; when specified, this parameter is used
6824 for result publication in the study. Otherwise, if automatic
6825 publication is switched on, default value is used for result name.
6828 This algorithm doesn't find all types of self-intersections.
6829 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6830 vertex/face and edge/face intersections. Face/face
6831 intersections detection is switched off as it is a
6832 time-consuming operation that gives an impact on performance.
6833 To find all self-intersections please use
6834 CheckSelfIntersections() method.
6837 New GEOM.GEOM_Object, containing the result shape.
6840 # Example: see GEOM_TestOthers.py
6841 # note: auto-publishing is done in self.MakeBoolean()
6842 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
6844 ## Perform Fuse boolean operation on two given shapes.
6845 # @param theShape1 First argument for boolean operation.
6846 # @param theShape2 Second argument for boolean operation.
6847 # @param checkSelfInte The flag that tells if the arguments should
6848 # be checked for self-intersection prior to the operation.
6849 # @param rmExtraEdges The flag that tells if Remove Extra Edges
6850 # operation should be performed during the operation.
6851 # @param theName Object name; when specified, this parameter is used
6852 # for result publication in the study. Otherwise, if automatic
6853 # publication is switched on, default value is used for result name.
6855 # @note This algorithm doesn't find all types of self-intersections.
6856 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6857 # vertex/face and edge/face intersections. Face/face
6858 # intersections detection is switched off as it is a
6859 # time-consuming operation that gives an impact on performance.
6860 # To find all self-intersections please use
6861 # CheckSelfIntersections() method.
6863 # @return New GEOM.GEOM_Object, containing the result shape.
6865 # @ref tui_fuse "Example 1"
6866 # \n @ref swig_MakeCommon "Example 2"
6867 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
6868 rmExtraEdges=False, theName=None):
6870 Perform Fuse boolean operation on two given shapes.
6873 theShape1 First argument for boolean operation.
6874 theShape2 Second argument for boolean operation.
6875 checkSelfInte The flag that tells if the arguments should
6876 be checked for self-intersection prior to
6878 rmExtraEdges The flag that tells if Remove Extra Edges
6879 operation should be performed during the operation.
6880 theName Object name; when specified, this parameter is used
6881 for result publication in the study. Otherwise, if automatic
6882 publication is switched on, default value is used for result name.
6885 This algorithm doesn't find all types of self-intersections.
6886 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6887 vertex/face and edge/face intersections. Face/face
6888 intersections detection is switched off as it is a
6889 time-consuming operation that gives an impact on performance.
6890 To find all self-intersections please use
6891 CheckSelfIntersections() method.
6894 New GEOM.GEOM_Object, containing the result shape.
6897 # Example: see GEOM_TestOthers.py
6898 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
6899 checkSelfInte, rmExtraEdges)
6900 RaiseIfFailed("MakeFuse", self.BoolOp)
6901 self._autoPublish(anObj, theName, "fuse")
6904 ## Perform Section boolean operation on two given shapes.
6905 # @param theShape1 First argument for boolean operation.
6906 # @param theShape2 Second argument for boolean operation.
6907 # @param checkSelfInte The flag that tells if the arguments should
6908 # be checked for self-intersection prior to the operation.
6909 # @param theName Object name; when specified, this parameter is used
6910 # for result publication in the study. Otherwise, if automatic
6911 # publication is switched on, default value is used for result name.
6913 # @note This algorithm doesn't find all types of self-intersections.
6914 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6915 # vertex/face and edge/face intersections. Face/face
6916 # intersections detection is switched off as it is a
6917 # time-consuming operation that gives an impact on performance.
6918 # To find all self-intersections please use
6919 # CheckSelfIntersections() method.
6921 # @return New GEOM.GEOM_Object, containing the result shape.
6923 # @ref tui_section "Example 1"
6924 # \n @ref swig_MakeCommon "Example 2"
6925 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6927 Perform Section boolean operation on two given shapes.
6930 theShape1 First argument for boolean operation.
6931 theShape2 Second argument for boolean operation.
6932 checkSelfInte The flag that tells if the arguments should
6933 be checked for self-intersection prior to
6935 theName Object name; when specified, this parameter is used
6936 for result publication in the study. Otherwise, if automatic
6937 publication is switched on, default value is used for result name.
6940 This algorithm doesn't find all types of self-intersections.
6941 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6942 vertex/face and edge/face intersections. Face/face
6943 intersections detection is switched off as it is a
6944 time-consuming operation that gives an impact on performance.
6945 To find all self-intersections please use
6946 CheckSelfIntersections() method.
6949 New GEOM.GEOM_Object, containing the result shape.
6952 # Example: see GEOM_TestOthers.py
6953 # note: auto-publishing is done in self.MakeBoolean()
6954 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
6956 ## Perform Fuse boolean operation on the list of shapes.
6957 # @param theShapesList Shapes to be fused.
6958 # @param checkSelfInte The flag that tells if the arguments should
6959 # be checked for self-intersection prior to the operation.
6960 # @param rmExtraEdges The flag that tells if Remove Extra Edges
6961 # operation should be performed during the operation.
6962 # @param theName Object name; when specified, this parameter is used
6963 # for result publication in the study. Otherwise, if automatic
6964 # publication is switched on, default value is used for result name.
6966 # @note This algorithm doesn't find all types of self-intersections.
6967 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6968 # vertex/face and edge/face intersections. Face/face
6969 # intersections detection is switched off as it is a
6970 # time-consuming operation that gives an impact on performance.
6971 # To find all self-intersections please use
6972 # CheckSelfIntersections() method.
6974 # @return New GEOM.GEOM_Object, containing the result shape.
6976 # @ref tui_fuse "Example 1"
6977 # \n @ref swig_MakeCommon "Example 2"
6978 def MakeFuseList(self, theShapesList, checkSelfInte=False,
6979 rmExtraEdges=False, theName=None):
6981 Perform Fuse boolean operation on the list of shapes.
6984 theShapesList Shapes to be fused.
6985 checkSelfInte The flag that tells if the arguments should
6986 be checked for self-intersection prior to
6988 rmExtraEdges The flag that tells if Remove Extra Edges
6989 operation should be performed during the operation.
6990 theName Object name; when specified, this parameter is used
6991 for result publication in the study. Otherwise, if automatic
6992 publication is switched on, default value is used for result name.
6995 This algorithm doesn't find all types of self-intersections.
6996 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6997 vertex/face and edge/face intersections. Face/face
6998 intersections detection is switched off as it is a
6999 time-consuming operation that gives an impact on performance.
7000 To find all self-intersections please use
7001 CheckSelfIntersections() method.
7004 New GEOM.GEOM_Object, containing the result shape.
7007 # Example: see GEOM_TestOthers.py
7008 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7010 RaiseIfFailed("MakeFuseList", self.BoolOp)
7011 self._autoPublish(anObj, theName, "fuse")
7014 ## Perform Common boolean operation on the list of shapes.
7015 # @param theShapesList Shapes for Common operation.
7016 # @param checkSelfInte The flag that tells if the arguments should
7017 # be checked for self-intersection prior to the operation.
7018 # @param theName Object name; when specified, this parameter is used
7019 # for result publication in the study. Otherwise, if automatic
7020 # publication is switched on, default value is used for result name.
7022 # @note This algorithm doesn't find all types of self-intersections.
7023 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7024 # vertex/face and edge/face intersections. Face/face
7025 # intersections detection is switched off as it is a
7026 # time-consuming operation that gives an impact on performance.
7027 # To find all self-intersections please use
7028 # CheckSelfIntersections() method.
7030 # @return New GEOM.GEOM_Object, containing the result shape.
7032 # @ref tui_common "Example 1"
7033 # \n @ref swig_MakeCommon "Example 2"
7034 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7036 Perform Common boolean operation on the list of shapes.
7039 theShapesList Shapes for Common operation.
7040 checkSelfInte The flag that tells if the arguments should
7041 be checked for self-intersection prior to
7043 theName Object name; when specified, this parameter is used
7044 for result publication in the study. Otherwise, if automatic
7045 publication is switched on, default value is used for result name.
7048 This algorithm doesn't find all types of self-intersections.
7049 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7050 vertex/face and edge/face intersections. Face/face
7051 intersections detection is switched off as it is a
7052 time-consuming operation that gives an impact on performance.
7053 To find all self-intersections please use
7054 CheckSelfIntersections() method.
7057 New GEOM.GEOM_Object, containing the result shape.
7060 # Example: see GEOM_TestOthers.py
7061 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7062 RaiseIfFailed("MakeCommonList", self.BoolOp)
7063 self._autoPublish(anObj, theName, "common")
7066 ## Perform Cut boolean operation on one object and the list of tools.
7067 # @param theMainShape The object of the operation.
7068 # @param theShapesList The list of tools of the operation.
7069 # @param checkSelfInte The flag that tells if the arguments should
7070 # be checked for self-intersection prior to the operation.
7071 # @param theName Object name; when specified, this parameter is used
7072 # for result publication in the study. Otherwise, if automatic
7073 # publication is switched on, default value is used for result name.
7075 # @note This algorithm doesn't find all types of self-intersections.
7076 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7077 # vertex/face and edge/face intersections. Face/face
7078 # intersections detection is switched off as it is a
7079 # time-consuming operation that gives an impact on performance.
7080 # To find all self-intersections please use
7081 # CheckSelfIntersections() method.
7083 # @return New GEOM.GEOM_Object, containing the result shape.
7085 # @ref tui_cut "Example 1"
7086 # \n @ref swig_MakeCommon "Example 2"
7087 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7089 Perform Cut boolean operation on one object and the list of tools.
7092 theMainShape The object of the operation.
7093 theShapesList The list of tools of the operation.
7094 checkSelfInte The flag that tells if the arguments should
7095 be checked for self-intersection prior to
7097 theName Object name; when specified, this parameter is used
7098 for result publication in the study. Otherwise, if automatic
7099 publication is switched on, default value is used for result name.
7102 This algorithm doesn't find all types of self-intersections.
7103 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7104 vertex/face and edge/face intersections. Face/face
7105 intersections detection is switched off as it is a
7106 time-consuming operation that gives an impact on performance.
7107 To find all self-intersections please use
7108 CheckSelfIntersections() method.
7111 New GEOM.GEOM_Object, containing the result shape.
7114 # Example: see GEOM_TestOthers.py
7115 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7116 RaiseIfFailed("MakeCutList", self.BoolOp)
7117 self._autoPublish(anObj, theName, "cut")
7123 ## @addtogroup l3_basic_op
7126 ## Perform partition operation.
7127 # @param ListShapes Shapes to be intersected.
7128 # @param ListTools Shapes to intersect theShapes.
7129 # @param Limit Type of resulting shapes (see ShapeType()).\n
7130 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7131 # type will be detected automatically.
7132 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7133 # target type (equal to Limit) are kept in the result,
7134 # else standalone shapes of lower dimension
7135 # are kept also (if they exist).
7137 # @param theName Object name; when specified, this parameter is used
7138 # for result publication in the study. Otherwise, if automatic
7139 # publication is switched on, default value is used for result name.
7141 # @note Each compound from ListShapes and ListTools will be exploded
7142 # in order to avoid possible intersection between shapes from this compound.
7144 # After implementation new version of PartitionAlgo (October 2006)
7145 # other parameters are ignored by current functionality. They are kept
7146 # in this function only for support old versions.
7147 # @param ListKeepInside Shapes, outside which the results will be deleted.
7148 # Each shape from theKeepInside must belong to theShapes also.
7149 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7150 # Each shape from theRemoveInside must belong to theShapes also.
7151 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7152 # @param ListMaterials Material indices for each shape. Make sence,
7153 # only if theRemoveWebs is TRUE.
7155 # @return New GEOM.GEOM_Object, containing the result shapes.
7157 # @ref tui_partition "Example"
7158 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7159 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7160 KeepNonlimitShapes=0, theName=None):
7162 Perform partition operation.
7165 ListShapes Shapes to be intersected.
7166 ListTools Shapes to intersect theShapes.
7167 Limit Type of resulting shapes (see geompy.ShapeType)
7168 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7169 type will be detected automatically.
7170 KeepNonlimitShapes if this parameter == 0, then only shapes of
7171 target type (equal to Limit) are kept in the result,
7172 else standalone shapes of lower dimension
7173 are kept also (if they exist).
7175 theName Object name; when specified, this parameter is used
7176 for result publication in the study. Otherwise, if automatic
7177 publication is switched on, default value is used for result name.
7179 Each compound from ListShapes and ListTools will be exploded
7180 in order to avoid possible intersection between shapes from
7183 After implementation new version of PartitionAlgo (October 2006) other
7184 parameters are ignored by current functionality. They are kept in this
7185 function only for support old versions.
7188 ListKeepInside Shapes, outside which the results will be deleted.
7189 Each shape from theKeepInside must belong to theShapes also.
7190 ListRemoveInside Shapes, inside which the results will be deleted.
7191 Each shape from theRemoveInside must belong to theShapes also.
7192 RemoveWebs If TRUE, perform Glue 3D algorithm.
7193 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7196 New GEOM.GEOM_Object, containing the result shapes.
7198 # Example: see GEOM_TestAll.py
7199 if Limit == self.ShapeType["AUTO"]:
7200 # automatic detection of the most appropriate shape limit type
7202 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7203 Limit = EnumToLong(lim)
7205 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7206 ListKeepInside, ListRemoveInside,
7207 Limit, RemoveWebs, ListMaterials,
7208 KeepNonlimitShapes);
7209 RaiseIfFailed("MakePartition", self.BoolOp)
7210 self._autoPublish(anObj, theName, "partition")
7213 ## Perform partition operation.
7214 # This method may be useful if it is needed to make a partition for
7215 # compound contains nonintersected shapes. Performance will be better
7216 # since intersection between shapes from compound is not performed.
7218 # Description of all parameters as in previous method MakePartition().
7219 # One additional parameter is provided:
7220 # @param checkSelfInte The flag that tells if the arguments should
7221 # be checked for self-intersection prior to the operation.
7223 # @note This algorithm doesn't find all types of self-intersections.
7224 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7225 # vertex/face and edge/face intersections. Face/face
7226 # intersections detection is switched off as it is a
7227 # time-consuming operation that gives an impact on performance.
7228 # To find all self-intersections please use
7229 # CheckSelfIntersections() method.
7231 # @note Passed compounds (via ListShapes or via ListTools)
7232 # have to consist of nonintersecting shapes.
7234 # @return New GEOM.GEOM_Object, containing the result shapes.
7236 # @ref swig_todo "Example"
7237 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7238 ListKeepInside=[], ListRemoveInside=[],
7239 Limit=ShapeType["AUTO"], RemoveWebs=0,
7240 ListMaterials=[], KeepNonlimitShapes=0,
7241 checkSelfInte=False, theName=None):
7243 Perform partition operation.
7244 This method may be useful if it is needed to make a partition for
7245 compound contains nonintersected shapes. Performance will be better
7246 since intersection between shapes from compound is not performed.
7249 Description of all parameters as in method geompy.MakePartition.
7250 One additional parameter is provided:
7251 checkSelfInte The flag that tells if the arguments should
7252 be checked for self-intersection prior to
7256 This algorithm doesn't find all types of self-intersections.
7257 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7258 vertex/face and edge/face intersections. Face/face
7259 intersections detection is switched off as it is a
7260 time-consuming operation that gives an impact on performance.
7261 To find all self-intersections please use
7262 CheckSelfIntersections() method.
7265 Passed compounds (via ListShapes or via ListTools)
7266 have to consist of nonintersecting shapes.
7269 New GEOM.GEOM_Object, containing the result shapes.
7271 if Limit == self.ShapeType["AUTO"]:
7272 # automatic detection of the most appropriate shape limit type
7274 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7275 Limit = EnumToLong(lim)
7277 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7278 ListKeepInside, ListRemoveInside,
7279 Limit, RemoveWebs, ListMaterials,
7280 KeepNonlimitShapes, checkSelfInte);
7281 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7282 self._autoPublish(anObj, theName, "partition")
7285 ## See method MakePartition() for more information.
7287 # @ref tui_partition "Example 1"
7288 # \n @ref swig_Partition "Example 2"
7289 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7290 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7291 KeepNonlimitShapes=0, theName=None):
7293 See method geompy.MakePartition for more information.
7295 # Example: see GEOM_TestOthers.py
7296 # note: auto-publishing is done in self.MakePartition()
7297 anObj = self.MakePartition(ListShapes, ListTools,
7298 ListKeepInside, ListRemoveInside,
7299 Limit, RemoveWebs, ListMaterials,
7300 KeepNonlimitShapes, theName);
7303 ## Perform partition of the Shape with the Plane
7304 # @param theShape Shape to be intersected.
7305 # @param thePlane Tool shape, to intersect theShape.
7306 # @param theName Object name; when specified, this parameter is used
7307 # for result publication in the study. Otherwise, if automatic
7308 # publication is switched on, default value is used for result name.
7310 # @return New GEOM.GEOM_Object, containing the result shape.
7312 # @ref tui_partition "Example"
7313 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7315 Perform partition of the Shape with the Plane
7318 theShape Shape to be intersected.
7319 thePlane Tool shape, to intersect theShape.
7320 theName Object name; when specified, this parameter is used
7321 for result publication in the study. Otherwise, if automatic
7322 publication is switched on, default value is used for result name.
7325 New GEOM.GEOM_Object, containing the result shape.
7327 # Example: see GEOM_TestAll.py
7328 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7329 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7330 self._autoPublish(anObj, theName, "partition")
7333 # end of l3_basic_op
7336 ## @addtogroup l3_transform
7339 ## Translate the given object along the vector, specified
7340 # by its end points.
7341 # @param theObject The object to be translated.
7342 # @param thePoint1 Start point of translation vector.
7343 # @param thePoint2 End point of translation vector.
7344 # @param theCopy Flag used to translate object itself or create a copy.
7345 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7346 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7347 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7349 Translate the given object along the vector, specified by its end points.
7352 theObject The object to be translated.
7353 thePoint1 Start point of translation vector.
7354 thePoint2 End point of translation vector.
7355 theCopy Flag used to translate object itself or create a copy.
7358 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7359 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7362 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7364 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7365 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7368 ## Translate the given object along the vector, specified
7369 # by its end points, creating its copy before the translation.
7370 # @param theObject The object to be translated.
7371 # @param thePoint1 Start point of translation vector.
7372 # @param thePoint2 End point of translation vector.
7373 # @param theName Object name; when specified, this parameter is used
7374 # for result publication in the study. Otherwise, if automatic
7375 # publication is switched on, default value is used for result name.
7377 # @return New GEOM.GEOM_Object, containing the translated object.
7379 # @ref tui_translation "Example 1"
7380 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7381 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7383 Translate the given object along the vector, specified
7384 by its end points, creating its copy before the translation.
7387 theObject The object to be translated.
7388 thePoint1 Start point of translation vector.
7389 thePoint2 End point of translation vector.
7390 theName Object name; when specified, this parameter is used
7391 for result publication in the study. Otherwise, if automatic
7392 publication is switched on, default value is used for result name.
7395 New GEOM.GEOM_Object, containing the translated object.
7397 # Example: see GEOM_TestAll.py
7398 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7399 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7400 self._autoPublish(anObj, theName, "translated")
7403 ## Translate the given object along the vector, specified by its components.
7404 # @param theObject The object to be translated.
7405 # @param theDX,theDY,theDZ Components of translation vector.
7406 # @param theCopy Flag used to translate object itself or create a copy.
7407 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7408 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7410 # @ref tui_translation "Example"
7411 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7413 Translate the given object along the vector, specified by its components.
7416 theObject The object to be translated.
7417 theDX,theDY,theDZ Components of translation vector.
7418 theCopy Flag used to translate object itself or create a copy.
7421 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7422 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7424 # Example: see GEOM_TestAll.py
7425 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7427 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7429 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7430 anObj.SetParameters(Parameters)
7431 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7434 ## Translate the given object along the vector, specified
7435 # by its components, creating its copy before the translation.
7436 # @param theObject The object to be translated.
7437 # @param theDX,theDY,theDZ Components of translation vector.
7438 # @param theName Object name; when specified, this parameter is used
7439 # for result publication in the study. Otherwise, if automatic
7440 # publication is switched on, default value is used for result name.
7442 # @return New GEOM.GEOM_Object, containing the translated object.
7444 # @ref tui_translation "Example"
7445 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7447 Translate the given object along the vector, specified
7448 by its components, creating its copy before the translation.
7451 theObject The object to be translated.
7452 theDX,theDY,theDZ Components of translation vector.
7453 theName Object name; when specified, this parameter is used
7454 for result publication in the study. Otherwise, if automatic
7455 publication is switched on, default value is used for result name.
7458 New GEOM.GEOM_Object, containing the translated object.
7460 # Example: see GEOM_TestAll.py
7461 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7462 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7463 anObj.SetParameters(Parameters)
7464 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7465 self._autoPublish(anObj, theName, "translated")
7468 ## Translate the given object along the given vector.
7469 # @param theObject The object to be translated.
7470 # @param theVector The translation vector.
7471 # @param theCopy Flag used to translate object itself or create a copy.
7472 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7473 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7474 def TranslateVector(self, theObject, theVector, theCopy=False):
7476 Translate the given object along the given vector.
7479 theObject The object to be translated.
7480 theVector The translation vector.
7481 theCopy Flag used to translate object itself or create a copy.
7484 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7485 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7488 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7490 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7491 RaiseIfFailed("TranslateVector", self.TrsfOp)
7494 ## Translate the given object along the given vector,
7495 # creating its copy before the translation.
7496 # @param theObject The object to be translated.
7497 # @param theVector The translation vector.
7498 # @param theName Object name; when specified, this parameter is used
7499 # for result publication in the study. Otherwise, if automatic
7500 # publication is switched on, default value is used for result name.
7502 # @return New GEOM.GEOM_Object, containing the translated object.
7504 # @ref tui_translation "Example"
7505 def MakeTranslationVector(self, theObject, theVector, theName=None):
7507 Translate the given object along the given vector,
7508 creating its copy before the translation.
7511 theObject The object to be translated.
7512 theVector The translation vector.
7513 theName Object name; when specified, this parameter is used
7514 for result publication in the study. Otherwise, if automatic
7515 publication is switched on, default value is used for result name.
7518 New GEOM.GEOM_Object, containing the translated object.
7520 # Example: see GEOM_TestAll.py
7521 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7522 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7523 self._autoPublish(anObj, theName, "translated")
7526 ## Translate the given object along the given vector on given distance.
7527 # @param theObject The object to be translated.
7528 # @param theVector The translation vector.
7529 # @param theDistance The translation distance.
7530 # @param theCopy Flag used to translate object itself or create a copy.
7531 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7532 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7534 # @ref tui_translation "Example"
7535 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7537 Translate the given object along the given vector on given distance.
7540 theObject The object to be translated.
7541 theVector The translation vector.
7542 theDistance The translation distance.
7543 theCopy Flag used to translate object itself or create a copy.
7546 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7547 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7549 # Example: see GEOM_TestAll.py
7550 theDistance,Parameters = ParseParameters(theDistance)
7551 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7552 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7553 anObj.SetParameters(Parameters)
7556 ## Translate the given object along the given vector on given distance,
7557 # creating its copy before the translation.
7558 # @param theObject The object to be translated.
7559 # @param theVector The translation vector.
7560 # @param theDistance The translation distance.
7561 # @param theName Object name; when specified, this parameter is used
7562 # for result publication in the study. Otherwise, if automatic
7563 # publication is switched on, default value is used for result name.
7565 # @return New GEOM.GEOM_Object, containing the translated object.
7567 # @ref tui_translation "Example"
7568 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7570 Translate the given object along the given vector on given distance,
7571 creating its copy before the translation.
7574 theObject The object to be translated.
7575 theVector The translation vector.
7576 theDistance The translation distance.
7577 theName Object name; when specified, this parameter is used
7578 for result publication in the study. Otherwise, if automatic
7579 publication is switched on, default value is used for result name.
7582 New GEOM.GEOM_Object, containing the translated object.
7584 # Example: see GEOM_TestAll.py
7585 theDistance,Parameters = ParseParameters(theDistance)
7586 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7587 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7588 anObj.SetParameters(Parameters)
7589 self._autoPublish(anObj, theName, "translated")
7592 ## Rotate the given object around the given axis on the given angle.
7593 # @param theObject The object to be rotated.
7594 # @param theAxis Rotation axis.
7595 # @param theAngle Rotation angle in radians.
7596 # @param theCopy Flag used to rotate object itself or create a copy.
7598 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7599 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7601 # @ref tui_rotation "Example"
7602 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7604 Rotate the given object around the given axis on the given angle.
7607 theObject The object to be rotated.
7608 theAxis Rotation axis.
7609 theAngle Rotation angle in radians.
7610 theCopy Flag used to rotate object itself or create a copy.
7613 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7614 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7616 # Example: see GEOM_TestAll.py
7618 if isinstance(theAngle,str):
7620 theAngle, Parameters = ParseParameters(theAngle)
7622 theAngle = theAngle*math.pi/180.0
7624 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7626 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7627 RaiseIfFailed("Rotate", self.TrsfOp)
7628 anObj.SetParameters(Parameters)
7631 ## Rotate the given object around the given axis
7632 # on the given angle, creating its copy before the rotatation.
7633 # @param theObject The object to be rotated.
7634 # @param theAxis Rotation axis.
7635 # @param theAngle Rotation angle in radians.
7636 # @param theName Object name; when specified, this parameter is used
7637 # for result publication in the study. Otherwise, if automatic
7638 # publication is switched on, default value is used for result name.
7640 # @return New GEOM.GEOM_Object, containing the rotated object.
7642 # @ref tui_rotation "Example"
7643 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7645 Rotate the given object around the given axis
7646 on the given angle, creating its copy before the rotatation.
7649 theObject The object to be rotated.
7650 theAxis Rotation axis.
7651 theAngle Rotation angle in radians.
7652 theName Object name; when specified, this parameter is used
7653 for result publication in the study. Otherwise, if automatic
7654 publication is switched on, default value is used for result name.
7657 New GEOM.GEOM_Object, containing the rotated object.
7659 # Example: see GEOM_TestAll.py
7661 if isinstance(theAngle,str):
7663 theAngle, Parameters = ParseParameters(theAngle)
7665 theAngle = theAngle*math.pi/180.0
7666 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7667 RaiseIfFailed("RotateCopy", self.TrsfOp)
7668 anObj.SetParameters(Parameters)
7669 self._autoPublish(anObj, theName, "rotated")
7672 ## Rotate given object around vector perpendicular to plane
7673 # containing three points.
7674 # @param theObject The object to be rotated.
7675 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7676 # containing the three points.
7677 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7678 # @param theCopy Flag used to rotate object itself or create a copy.
7679 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7680 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7681 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7683 Rotate given object around vector perpendicular to plane
7684 containing three points.
7687 theObject The object to be rotated.
7688 theCentPoint central point the axis is the vector perpendicular to the plane
7689 containing the three points.
7690 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7691 theCopy Flag used to rotate object itself or create a copy.
7694 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7695 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7698 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7700 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7701 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7704 ## Rotate given object around vector perpendicular to plane
7705 # containing three points, creating its copy before the rotatation.
7706 # @param theObject The object to be rotated.
7707 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7708 # containing the three points.
7709 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7710 # @param theName Object name; when specified, this parameter is used
7711 # for result publication in the study. Otherwise, if automatic
7712 # publication is switched on, default value is used for result name.
7714 # @return New GEOM.GEOM_Object, containing the rotated object.
7716 # @ref tui_rotation "Example"
7717 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7719 Rotate given object around vector perpendicular to plane
7720 containing three points, creating its copy before the rotatation.
7723 theObject The object to be rotated.
7724 theCentPoint central point the axis is the vector perpendicular to the plane
7725 containing the three points.
7726 thePoint1,thePoint2 in a perpendicular plane of the axis.
7727 theName Object name; when specified, this parameter is used
7728 for result publication in the study. Otherwise, if automatic
7729 publication is switched on, default value is used for result name.
7732 New GEOM.GEOM_Object, containing the rotated object.
7734 # Example: see GEOM_TestAll.py
7735 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7736 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7737 self._autoPublish(anObj, theName, "rotated")
7740 ## Scale the given object by the specified factor.
7741 # @param theObject The object to be scaled.
7742 # @param thePoint Center point for scaling.
7743 # Passing None for it means scaling relatively the origin of global CS.
7744 # @param theFactor Scaling factor value.
7745 # @param theCopy Flag used to scale object itself or create a copy.
7746 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7747 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7748 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7750 Scale the given object by the specified factor.
7753 theObject The object to be scaled.
7754 thePoint Center point for scaling.
7755 Passing None for it means scaling relatively the origin of global CS.
7756 theFactor Scaling factor value.
7757 theCopy Flag used to scale object itself or create a copy.
7760 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7761 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7763 # Example: see GEOM_TestAll.py
7764 theFactor, Parameters = ParseParameters(theFactor)
7766 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7768 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7769 RaiseIfFailed("Scale", self.TrsfOp)
7770 anObj.SetParameters(Parameters)
7773 ## Scale the given object by the factor, creating its copy before the scaling.
7774 # @param theObject The object to be scaled.
7775 # @param thePoint Center point for scaling.
7776 # Passing None for it means scaling relatively the origin of global CS.
7777 # @param theFactor Scaling factor value.
7778 # @param theName Object name; when specified, this parameter is used
7779 # for result publication in the study. Otherwise, if automatic
7780 # publication is switched on, default value is used for result name.
7782 # @return New GEOM.GEOM_Object, containing the scaled shape.
7784 # @ref tui_scale "Example"
7785 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7787 Scale the given object by the factor, creating its copy before the scaling.
7790 theObject The object to be scaled.
7791 thePoint Center point for scaling.
7792 Passing None for it means scaling relatively the origin of global CS.
7793 theFactor Scaling factor value.
7794 theName Object name; when specified, this parameter is used
7795 for result publication in the study. Otherwise, if automatic
7796 publication is switched on, default value is used for result name.
7799 New GEOM.GEOM_Object, containing the scaled shape.
7801 # Example: see GEOM_TestAll.py
7802 theFactor, Parameters = ParseParameters(theFactor)
7803 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7804 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7805 anObj.SetParameters(Parameters)
7806 self._autoPublish(anObj, theName, "scaled")
7809 ## Scale the given object by different factors along coordinate axes.
7810 # @param theObject The object to be scaled.
7811 # @param thePoint Center point for scaling.
7812 # Passing None for it means scaling relatively the origin of global CS.
7813 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7814 # @param theCopy Flag used to scale object itself or create a copy.
7815 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7816 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7817 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7819 Scale the given object by different factors along coordinate axes.
7822 theObject The object to be scaled.
7823 thePoint Center point for scaling.
7824 Passing None for it means scaling relatively the origin of global CS.
7825 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7826 theCopy Flag used to scale object itself or create a copy.
7829 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7830 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7832 # Example: see GEOM_TestAll.py
7833 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7835 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7836 theFactorX, theFactorY, theFactorZ)
7838 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7839 theFactorX, theFactorY, theFactorZ)
7840 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7841 anObj.SetParameters(Parameters)
7844 ## Scale the given object by different factors along coordinate axes,
7845 # creating its copy before the scaling.
7846 # @param theObject The object to be scaled.
7847 # @param thePoint Center point for scaling.
7848 # Passing None for it means scaling relatively the origin of global CS.
7849 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7850 # @param theName Object name; when specified, this parameter is used
7851 # for result publication in the study. Otherwise, if automatic
7852 # publication is switched on, default value is used for result name.
7854 # @return New GEOM.GEOM_Object, containing the scaled shape.
7856 # @ref swig_scale "Example"
7857 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7859 Scale the given object by different factors along coordinate axes,
7860 creating its copy before the scaling.
7863 theObject The object to be scaled.
7864 thePoint Center point for scaling.
7865 Passing None for it means scaling relatively the origin of global CS.
7866 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7867 theName Object name; when specified, this parameter is used
7868 for result publication in the study. Otherwise, if automatic
7869 publication is switched on, default value is used for result name.
7872 New GEOM.GEOM_Object, containing the scaled shape.
7874 # Example: see GEOM_TestAll.py
7875 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7876 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7877 theFactorX, theFactorY, theFactorZ)
7878 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7879 anObj.SetParameters(Parameters)
7880 self._autoPublish(anObj, theName, "scaled")
7883 ## Mirror an object relatively the given plane.
7884 # @param theObject The object to be mirrored.
7885 # @param thePlane Plane of symmetry.
7886 # @param theCopy Flag used to mirror object itself or create a copy.
7887 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7888 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7889 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7891 Mirror an object relatively the given plane.
7894 theObject The object to be mirrored.
7895 thePlane Plane of symmetry.
7896 theCopy Flag used to mirror object itself or create a copy.
7899 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7900 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7903 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7905 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7906 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7909 ## Create an object, symmetrical
7910 # to the given one relatively the given plane.
7911 # @param theObject The object to be mirrored.
7912 # @param thePlane Plane of symmetry.
7913 # @param theName Object name; when specified, this parameter is used
7914 # for result publication in the study. Otherwise, if automatic
7915 # publication is switched on, default value is used for result name.
7917 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7919 # @ref tui_mirror "Example"
7920 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7922 Create an object, symmetrical to the given one relatively the given plane.
7925 theObject The object to be mirrored.
7926 thePlane Plane of symmetry.
7927 theName Object name; when specified, this parameter is used
7928 for result publication in the study. Otherwise, if automatic
7929 publication is switched on, default value is used for result name.
7932 New GEOM.GEOM_Object, containing the mirrored shape.
7934 # Example: see GEOM_TestAll.py
7935 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7936 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7937 self._autoPublish(anObj, theName, "mirrored")
7940 ## Mirror an object relatively the given axis.
7941 # @param theObject The object to be mirrored.
7942 # @param theAxis Axis of symmetry.
7943 # @param theCopy Flag used to mirror object itself or create a copy.
7944 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7945 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7946 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7948 Mirror an object relatively the given axis.
7951 theObject The object to be mirrored.
7952 theAxis Axis of symmetry.
7953 theCopy Flag used to mirror object itself or create a copy.
7956 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7957 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7960 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7962 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7963 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7966 ## Create an object, symmetrical
7967 # to the given one relatively the given axis.
7968 # @param theObject The object to be mirrored.
7969 # @param theAxis Axis of symmetry.
7970 # @param theName Object name; when specified, this parameter is used
7971 # for result publication in the study. Otherwise, if automatic
7972 # publication is switched on, default value is used for result name.
7974 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7976 # @ref tui_mirror "Example"
7977 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7979 Create an object, symmetrical to the given one relatively the given axis.
7982 theObject The object to be mirrored.
7983 theAxis Axis of symmetry.
7984 theName Object name; when specified, this parameter is used
7985 for result publication in the study. Otherwise, if automatic
7986 publication is switched on, default value is used for result name.
7989 New GEOM.GEOM_Object, containing the mirrored shape.
7991 # Example: see GEOM_TestAll.py
7992 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7993 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7994 self._autoPublish(anObj, theName, "mirrored")
7997 ## Mirror an object relatively the given point.
7998 # @param theObject The object to be mirrored.
7999 # @param thePoint Point of symmetry.
8000 # @param theCopy Flag used to mirror object itself or create a copy.
8001 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8002 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8003 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8005 Mirror an object relatively the given point.
8008 theObject The object to be mirrored.
8009 thePoint Point of symmetry.
8010 theCopy Flag used to mirror object itself or create a copy.
8013 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8014 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8016 # Example: see GEOM_TestAll.py
8018 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8020 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8021 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8024 ## Create an object, symmetrical
8025 # to the given one relatively the given point.
8026 # @param theObject The object to be mirrored.
8027 # @param thePoint Point of symmetry.
8028 # @param theName Object name; when specified, this parameter is used
8029 # for result publication in the study. Otherwise, if automatic
8030 # publication is switched on, default value is used for result name.
8032 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8034 # @ref tui_mirror "Example"
8035 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8037 Create an object, symmetrical
8038 to the given one relatively the given point.
8041 theObject The object to be mirrored.
8042 thePoint Point of symmetry.
8043 theName Object name; when specified, this parameter is used
8044 for result publication in the study. Otherwise, if automatic
8045 publication is switched on, default value is used for result name.
8048 New GEOM.GEOM_Object, containing the mirrored shape.
8050 # Example: see GEOM_TestAll.py
8051 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8052 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8053 self._autoPublish(anObj, theName, "mirrored")
8056 ## Modify the location of the given object.
8057 # @param theObject The object to be displaced.
8058 # @param theStartLCS Coordinate system to perform displacement from it.\n
8059 # If \a theStartLCS is NULL, displacement
8060 # will be performed from global CS.\n
8061 # If \a theObject itself is used as \a theStartLCS,
8062 # its location will be changed to \a theEndLCS.
8063 # @param theEndLCS Coordinate system to perform displacement to it.
8064 # @param theCopy Flag used to displace object itself or create a copy.
8065 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8066 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8067 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8069 Modify the Location of the given object by LCS, creating its copy before the setting.
8072 theObject The object to be displaced.
8073 theStartLCS Coordinate system to perform displacement from it.
8074 If theStartLCS is NULL, displacement
8075 will be performed from global CS.
8076 If theObject itself is used as theStartLCS,
8077 its location will be changed to theEndLCS.
8078 theEndLCS Coordinate system to perform displacement to it.
8079 theCopy Flag used to displace object itself or create a copy.
8082 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8083 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8085 # Example: see GEOM_TestAll.py
8087 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8089 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8090 RaiseIfFailed("Displace", self.TrsfOp)
8093 ## Modify the Location of the given object by LCS,
8094 # creating its copy before the setting.
8095 # @param theObject The object to be displaced.
8096 # @param theStartLCS Coordinate system to perform displacement from it.\n
8097 # If \a theStartLCS is NULL, displacement
8098 # will be performed from global CS.\n
8099 # If \a theObject itself is used as \a theStartLCS,
8100 # its location will be changed to \a theEndLCS.
8101 # @param theEndLCS Coordinate system to perform displacement to it.
8102 # @param theName Object name; when specified, this parameter is used
8103 # for result publication in the study. Otherwise, if automatic
8104 # publication is switched on, default value is used for result name.
8106 # @return New GEOM.GEOM_Object, containing the displaced shape.
8108 # @ref tui_modify_location "Example"
8109 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8111 Modify the Location of the given object by LCS, creating its copy before the setting.
8114 theObject The object to be displaced.
8115 theStartLCS Coordinate system to perform displacement from it.
8116 If theStartLCS is NULL, displacement
8117 will be performed from global CS.
8118 If theObject itself is used as theStartLCS,
8119 its location will be changed to theEndLCS.
8120 theEndLCS Coordinate system to perform displacement to it.
8121 theName Object name; when specified, this parameter is used
8122 for result publication in the study. Otherwise, if automatic
8123 publication is switched on, default value is used for result name.
8126 New GEOM.GEOM_Object, containing the displaced shape.
8129 # create local coordinate systems
8130 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8131 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8132 # modify the location of the given object
8133 position = geompy.MakePosition(cylinder, cs1, cs2)
8135 # Example: see GEOM_TestAll.py
8136 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8137 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8138 self._autoPublish(anObj, theName, "displaced")
8141 ## Modify the Location of the given object by Path.
8142 # @param theObject The object to be displaced.
8143 # @param thePath Wire or Edge along that the object will be translated.
8144 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8145 # @param theCopy is to create a copy objects if true.
8146 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8147 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8148 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8150 # @ref tui_modify_location "Example"
8151 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8153 Modify the Location of the given object by Path.
8156 theObject The object to be displaced.
8157 thePath Wire or Edge along that the object will be translated.
8158 theDistance progress of Path (0 = start location, 1 = end of path location).
8159 theCopy is to create a copy objects if true.
8160 theReverse 0 - for usual direction, 1 - to reverse path direction.
8163 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8164 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8167 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8169 # Example: see GEOM_TestAll.py
8170 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8171 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8174 ## Modify the Location of the given object by Path, creating its copy before the operation.
8175 # @param theObject The object to be displaced.
8176 # @param thePath Wire or Edge along that the object will be translated.
8177 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8178 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8179 # @param theName Object name; when specified, this parameter is used
8180 # for result publication in the study. Otherwise, if automatic
8181 # publication is switched on, default value is used for result name.
8183 # @return New GEOM.GEOM_Object, containing the displaced shape.
8184 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8186 Modify the Location of the given object by Path, creating its copy before the operation.
8189 theObject The object to be displaced.
8190 thePath Wire or Edge along that the object will be translated.
8191 theDistance progress of Path (0 = start location, 1 = end of path location).
8192 theReverse 0 - for usual direction, 1 - to reverse path direction.
8193 theName Object name; when specified, this parameter is used
8194 for result publication in the study. Otherwise, if automatic
8195 publication is switched on, default value is used for result name.
8198 New GEOM.GEOM_Object, containing the displaced shape.
8200 # Example: see GEOM_TestAll.py
8201 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8202 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8203 self._autoPublish(anObj, theName, "displaced")
8206 ## Offset given shape.
8207 # @param theObject The base object for the offset.
8208 # @param theOffset Offset value.
8209 # @param theCopy Flag used to offset object itself or create a copy.
8210 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8211 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8212 def Offset(self, theObject, theOffset, theCopy=False):
8217 theObject The base object for the offset.
8218 theOffset Offset value.
8219 theCopy Flag used to offset object itself or create a copy.
8222 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8223 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8225 theOffset, Parameters = ParseParameters(theOffset)
8227 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8229 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8230 RaiseIfFailed("Offset", self.TrsfOp)
8231 anObj.SetParameters(Parameters)
8234 ## Create new object as offset of the given one.
8235 # @param theObject The base object for the offset.
8236 # @param theOffset Offset value.
8237 # @param theName Object name; when specified, this parameter is used
8238 # for result publication in the study. Otherwise, if automatic
8239 # publication is switched on, default value is used for result name.
8241 # @return New GEOM.GEOM_Object, containing the offset object.
8243 # @ref tui_offset "Example"
8244 def MakeOffset(self, theObject, theOffset, theName=None):
8246 Create new object as offset of the given one.
8249 theObject The base object for the offset.
8250 theOffset Offset value.
8251 theName Object name; when specified, this parameter is used
8252 for result publication in the study. Otherwise, if automatic
8253 publication is switched on, default value is used for result name.
8256 New GEOM.GEOM_Object, containing the offset object.
8259 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8260 # create a new object as offset of the given object
8261 offset = geompy.MakeOffset(box, 70.)
8263 # Example: see GEOM_TestAll.py
8264 theOffset, Parameters = ParseParameters(theOffset)
8265 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8266 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8267 anObj.SetParameters(Parameters)
8268 self._autoPublish(anObj, theName, "offset")
8271 ## Create new object as projection of the given one on a 2D surface.
8272 # @param theSource The source object for the projection. It can be a point, edge or wire.
8273 # @param theTarget The target object. It can be planar or cylindrical face.
8274 # @param theName Object name; when specified, this parameter is used
8275 # for result publication in the study. Otherwise, if automatic
8276 # publication is switched on, default value is used for result name.
8278 # @return New GEOM.GEOM_Object, containing the projection.
8280 # @ref tui_projection "Example"
8281 def MakeProjection(self, theSource, theTarget, theName=None):
8283 Create new object as projection of the given one on a 2D surface.
8286 theSource The source object for the projection. It can be a point, edge or wire.
8287 theTarget The target object. It can be planar or cylindrical face.
8288 theName Object name; when specified, this parameter is used
8289 for result publication in the study. Otherwise, if automatic
8290 publication is switched on, default value is used for result name.
8293 New GEOM.GEOM_Object, containing the projection.
8295 # Example: see GEOM_TestAll.py
8296 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8297 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8298 self._autoPublish(anObj, theName, "projection")
8301 ## Create a projection projection of the given point on a wire or an edge.
8302 # If there are no solutions or there are 2 or more solutions It throws an
8304 # @param thePoint the point to be projected.
8305 # @param theWire the wire. The edge is accepted as well.
8306 # @param theName Object name; when specified, this parameter is used
8307 # for result publication in the study. Otherwise, if automatic
8308 # publication is switched on, default value is used for result name.
8310 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8311 # \n \a u: The parameter of projection point on edge.
8312 # \n \a PointOnEdge: The projection point.
8313 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8315 # @ref tui_projection "Example"
8316 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8318 Create a projection projection of the given point on a wire or an edge.
8319 If there are no solutions or there are 2 or more solutions It throws an
8323 thePoint the point to be projected.
8324 theWire the wire. The edge is accepted as well.
8325 theName Object name; when specified, this parameter is used
8326 for result publication in the study. Otherwise, if automatic
8327 publication is switched on, default value is used for result name.
8330 [u, PointOnEdge, EdgeInWireIndex]
8331 u: The parameter of projection point on edge.
8332 PointOnEdge: The projection point.
8333 EdgeInWireIndex: The index of an edge in a wire.
8335 # Example: see GEOM_TestAll.py
8336 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8337 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8338 self._autoPublish(anObj[1], theName, "projection")
8341 # -----------------------------------------------------------------------------
8343 # -----------------------------------------------------------------------------
8345 ## Translate the given object along the given vector a given number times
8346 # @param theObject The object to be translated.
8347 # @param theVector Direction of the translation. DX if None.
8348 # @param theStep Distance to translate on.
8349 # @param theNbTimes Quantity of translations to be done.
8350 # @param theName Object name; when specified, this parameter is used
8351 # for result publication in the study. Otherwise, if automatic
8352 # publication is switched on, default value is used for result name.
8354 # @return New GEOM.GEOM_Object, containing compound of all
8355 # the shapes, obtained after each translation.
8357 # @ref tui_multi_translation "Example"
8358 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8360 Translate the given object along the given vector a given number times
8363 theObject The object to be translated.
8364 theVector Direction of the translation. DX if None.
8365 theStep Distance to translate on.
8366 theNbTimes Quantity of translations to be done.
8367 theName Object name; when specified, this parameter is used
8368 for result publication in the study. Otherwise, if automatic
8369 publication is switched on, default value is used for result name.
8372 New GEOM.GEOM_Object, containing compound of all
8373 the shapes, obtained after each translation.
8376 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8378 # Example: see GEOM_TestAll.py
8379 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8380 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8381 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8382 anObj.SetParameters(Parameters)
8383 self._autoPublish(anObj, theName, "multitranslation")
8386 ## Conseqently apply two specified translations to theObject specified number of times.
8387 # @param theObject The object to be translated.
8388 # @param theVector1 Direction of the first translation. DX if None.
8389 # @param theStep1 Step of the first translation.
8390 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8391 # @param theVector2 Direction of the second translation. DY if None.
8392 # @param theStep2 Step of the second translation.
8393 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8394 # @param theName Object name; when specified, this parameter is used
8395 # for result publication in the study. Otherwise, if automatic
8396 # publication is switched on, default value is used for result name.
8398 # @return New GEOM.GEOM_Object, containing compound of all
8399 # the shapes, obtained after each translation.
8401 # @ref tui_multi_translation "Example"
8402 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8403 theVector2, theStep2, theNbTimes2, theName=None):
8405 Conseqently apply two specified translations to theObject specified number of times.
8408 theObject The object to be translated.
8409 theVector1 Direction of the first translation. DX if None.
8410 theStep1 Step of the first translation.
8411 theNbTimes1 Quantity of translations to be done along theVector1.
8412 theVector2 Direction of the second translation. DY if None.
8413 theStep2 Step of the second translation.
8414 theNbTimes2 Quantity of translations to be done along theVector2.
8415 theName Object name; when specified, this parameter is used
8416 for result publication in the study. Otherwise, if automatic
8417 publication is switched on, default value is used for result name.
8420 New GEOM.GEOM_Object, containing compound of all
8421 the shapes, obtained after each translation.
8424 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8426 # Example: see GEOM_TestAll.py
8427 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8428 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8429 theVector2, theStep2, theNbTimes2)
8430 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8431 anObj.SetParameters(Parameters)
8432 self._autoPublish(anObj, theName, "multitranslation")
8435 ## Rotate the given object around the given axis a given number times.
8436 # Rotation angle will be 2*PI/theNbTimes.
8437 # @param theObject The object to be rotated.
8438 # @param theAxis The rotation axis. DZ if None.
8439 # @param theNbTimes Quantity of rotations to be done.
8440 # @param theName Object name; when specified, this parameter is used
8441 # for result publication in the study. Otherwise, if automatic
8442 # publication is switched on, default value is used for result name.
8444 # @return New GEOM.GEOM_Object, containing compound of all the
8445 # shapes, obtained after each rotation.
8447 # @ref tui_multi_rotation "Example"
8448 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8450 Rotate the given object around the given axis a given number times.
8451 Rotation angle will be 2*PI/theNbTimes.
8454 theObject The object to be rotated.
8455 theAxis The rotation axis. DZ if None.
8456 theNbTimes Quantity of rotations to be done.
8457 theName Object name; when specified, this parameter is used
8458 for result publication in the study. Otherwise, if automatic
8459 publication is switched on, default value is used for result name.
8462 New GEOM.GEOM_Object, containing compound of all the
8463 shapes, obtained after each rotation.
8466 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8468 # Example: see GEOM_TestAll.py
8469 theNbTimes, Parameters = ParseParameters(theNbTimes)
8470 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8471 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8472 anObj.SetParameters(Parameters)
8473 self._autoPublish(anObj, theName, "multirotation")
8476 ## Rotate the given object around the given axis
8477 # a given number times on the given angle.
8478 # @param theObject The object to be rotated.
8479 # @param theAxis The rotation axis. DZ if None.
8480 # @param theAngleStep Rotation angle in radians.
8481 # @param theNbTimes Quantity of rotations to be done.
8482 # @param theName Object name; when specified, this parameter is used
8483 # for result publication in the study. Otherwise, if automatic
8484 # publication is switched on, default value is used for result name.
8486 # @return New GEOM.GEOM_Object, containing compound of all the
8487 # shapes, obtained after each rotation.
8489 # @ref tui_multi_rotation "Example"
8490 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8492 Rotate the given object around the given axis
8493 a given number times on the given angle.
8496 theObject The object to be rotated.
8497 theAxis The rotation axis. DZ if None.
8498 theAngleStep Rotation angle in radians.
8499 theNbTimes Quantity of rotations to be done.
8500 theName Object name; when specified, this parameter is used
8501 for result publication in the study. Otherwise, if automatic
8502 publication is switched on, default value is used for result name.
8505 New GEOM.GEOM_Object, containing compound of all the
8506 shapes, obtained after each rotation.
8509 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8511 # Example: see GEOM_TestAll.py
8512 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8513 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8514 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8515 anObj.SetParameters(Parameters)
8516 self._autoPublish(anObj, theName, "multirotation")
8519 ## Rotate the given object around the given axis a given
8520 # number times and multi-translate each rotation result.
8521 # Rotation angle will be 2*PI/theNbTimes1.
8522 # Translation direction passes through center of gravity
8523 # of rotated shape and its projection on the rotation axis.
8524 # @param theObject The object to be rotated.
8525 # @param theAxis Rotation axis. DZ if None.
8526 # @param theNbTimes1 Quantity of rotations to be done.
8527 # @param theRadialStep Translation distance.
8528 # @param theNbTimes2 Quantity of translations to be done.
8529 # @param theName Object name; when specified, this parameter is used
8530 # for result publication in the study. Otherwise, if automatic
8531 # publication is switched on, default value is used for result name.
8533 # @return New GEOM.GEOM_Object, containing compound of all the
8534 # shapes, obtained after each transformation.
8536 # @ref tui_multi_rotation "Example"
8537 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8539 Rotate the given object around the
8540 given axis on the given angle a given number
8541 times and multi-translate each rotation result.
8542 Translation direction passes through center of gravity
8543 of rotated shape and its projection on the rotation axis.
8546 theObject The object to be rotated.
8547 theAxis Rotation axis. DZ if None.
8548 theNbTimes1 Quantity of rotations to be done.
8549 theRadialStep Translation distance.
8550 theNbTimes2 Quantity of translations to be done.
8551 theName Object name; when specified, this parameter is used
8552 for result publication in the study. Otherwise, if automatic
8553 publication is switched on, default value is used for result name.
8556 New GEOM.GEOM_Object, containing compound of all the
8557 shapes, obtained after each transformation.
8560 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8562 # Example: see GEOM_TestAll.py
8563 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8564 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8565 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8566 anObj.SetParameters(Parameters)
8567 self._autoPublish(anObj, theName, "multirotation")
8570 ## Rotate the given object around the
8571 # given axis on the given angle a given number
8572 # times and multi-translate each rotation result.
8573 # Translation direction passes through center of gravity
8574 # of rotated shape and its projection on the rotation axis.
8575 # @param theObject The object to be rotated.
8576 # @param theAxis Rotation axis. DZ if None.
8577 # @param theAngleStep Rotation angle in radians.
8578 # @param theNbTimes1 Quantity of rotations to be done.
8579 # @param theRadialStep Translation distance.
8580 # @param theNbTimes2 Quantity of translations to be done.
8581 # @param theName Object name; when specified, this parameter is used
8582 # for result publication in the study. Otherwise, if automatic
8583 # publication is switched on, default value is used for result name.
8585 # @return New GEOM.GEOM_Object, containing compound of all the
8586 # shapes, obtained after each transformation.
8588 # @ref tui_multi_rotation "Example"
8589 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8591 Rotate the given object around the
8592 given axis on the given angle a given number
8593 times and multi-translate each rotation result.
8594 Translation direction passes through center of gravity
8595 of rotated shape and its projection on the rotation axis.
8598 theObject The object to be rotated.
8599 theAxis Rotation axis. DZ if None.
8600 theAngleStep Rotation angle in radians.
8601 theNbTimes1 Quantity of rotations to be done.
8602 theRadialStep Translation distance.
8603 theNbTimes2 Quantity of translations to be done.
8604 theName Object name; when specified, this parameter is used
8605 for result publication in the study. Otherwise, if automatic
8606 publication is switched on, default value is used for result name.
8609 New GEOM.GEOM_Object, containing compound of all the
8610 shapes, obtained after each transformation.
8613 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8615 # Example: see GEOM_TestAll.py
8616 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8617 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8618 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8619 anObj.SetParameters(Parameters)
8620 self._autoPublish(anObj, theName, "multirotation")
8623 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8625 # @ref swig_MakeMultiRotation "Example"
8626 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8628 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8631 pz = geompy.MakeVertex(0, 0, 100)
8632 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8633 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8635 # Example: see GEOM_TestOthers.py
8636 aVec = self.MakeLine(aPoint,aDir)
8637 # note: auto-publishing is done in self.MultiRotate1D()
8638 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8641 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8643 # @ref swig_MakeMultiRotation "Example"
8644 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8646 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8649 pz = geompy.MakeVertex(0, 0, 100)
8650 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8651 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8653 # Example: see GEOM_TestOthers.py
8654 aVec = self.MakeLine(aPoint,aDir)
8655 # note: auto-publishing is done in self.MultiRotate1D()
8656 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8659 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8661 # @ref swig_MakeMultiRotation "Example"
8662 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8664 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8667 pz = geompy.MakeVertex(0, 0, 100)
8668 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8669 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8671 # Example: see GEOM_TestOthers.py
8672 aVec = self.MakeLine(aPoint,aDir)
8673 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8674 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8677 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8679 # @ref swig_MakeMultiRotation "Example"
8680 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8682 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8685 pz = geompy.MakeVertex(0, 0, 100)
8686 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8687 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8689 # Example: see GEOM_TestOthers.py
8690 aVec = self.MakeLine(aPoint,aDir)
8691 # note: auto-publishing is done in self.MultiRotate2D()
8692 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8695 # end of l3_transform
8698 ## @addtogroup l3_transform_d
8701 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8702 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8704 Deprecated method. Use MultiRotate1DNbTimes instead.
8706 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8707 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8709 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8710 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8711 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8713 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8714 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8717 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8719 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8720 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8721 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8722 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8723 anObj.SetParameters(Parameters)
8724 self._autoPublish(anObj, theName, "multirotation")
8727 ## The same, as MultiRotate1D(), but axis is given by direction and point
8728 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8729 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8731 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8732 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8735 pz = geompy.MakeVertex(0, 0, 100)
8736 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8737 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8739 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8740 aVec = self.MakeLine(aPoint,aDir)
8741 # note: auto-publishing is done in self.MultiRotate1D()
8742 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8745 ## The same, as MultiRotate2D(), but axis is given by direction and point
8746 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8747 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8749 The same, as MultiRotate2D(), but axis is given by direction and point
8750 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8753 pz = geompy.MakeVertex(0, 0, 100)
8754 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8755 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8757 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8758 aVec = self.MakeLine(aPoint,aDir)
8759 # note: auto-publishing is done in self.MultiRotate2D()
8760 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8763 # end of l3_transform_d
8766 ## @addtogroup l3_local
8769 ## Perform a fillet on all edges of the given shape.
8770 # @param theShape Shape, to perform fillet on.
8771 # @param theR Fillet radius.
8772 # @param theName Object name; when specified, this parameter is used
8773 # for result publication in the study. Otherwise, if automatic
8774 # publication is switched on, default value is used for result name.
8776 # @return New GEOM.GEOM_Object, containing the result shape.
8778 # @ref tui_fillet "Example 1"
8779 # \n @ref swig_MakeFilletAll "Example 2"
8780 def MakeFilletAll(self, theShape, theR, theName=None):
8782 Perform a fillet on all edges of the given shape.
8785 theShape Shape, to perform fillet on.
8787 theName Object name; when specified, this parameter is used
8788 for result publication in the study. Otherwise, if automatic
8789 publication is switched on, default value is used for result name.
8792 New GEOM.GEOM_Object, containing the result shape.
8795 filletall = geompy.MakeFilletAll(prism, 10.)
8797 # Example: see GEOM_TestOthers.py
8798 theR,Parameters = ParseParameters(theR)
8799 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8800 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8801 anObj.SetParameters(Parameters)
8802 self._autoPublish(anObj, theName, "fillet")
8805 ## Perform a fillet on the specified edges/faces of the given shape
8806 # @param theShape Shape, to perform fillet on.
8807 # @param theR Fillet radius.
8808 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8809 # @param theListShapes Global indices of edges/faces to perform fillet on.
8810 # @param theName Object name; when specified, this parameter is used
8811 # for result publication in the study. Otherwise, if automatic
8812 # publication is switched on, default value is used for result name.
8814 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8816 # @return New GEOM.GEOM_Object, containing the result shape.
8818 # @ref tui_fillet "Example"
8819 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8821 Perform a fillet on the specified edges/faces of the given shape
8824 theShape Shape, to perform fillet on.
8826 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8827 theListShapes Global indices of edges/faces to perform fillet on.
8828 theName Object name; when specified, this parameter is used
8829 for result publication in the study. Otherwise, if automatic
8830 publication is switched on, default value is used for result name.
8833 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8836 New GEOM.GEOM_Object, containing the result shape.
8839 # get the list of IDs (IDList) for the fillet
8840 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8842 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8843 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8844 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8845 # make a fillet on the specified edges of the given shape
8846 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8848 # Example: see GEOM_TestAll.py
8849 theR,Parameters = ParseParameters(theR)
8851 if theShapeType == self.ShapeType["EDGE"]:
8852 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8853 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8855 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8856 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8857 anObj.SetParameters(Parameters)
8858 self._autoPublish(anObj, theName, "fillet")
8861 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8862 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8864 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8867 # get the list of IDs (IDList) for the fillet
8868 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8870 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8871 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8872 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8873 # make a fillet on the specified edges of the given shape
8874 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8876 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8878 if theShapeType == self.ShapeType["EDGE"]:
8879 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8880 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8882 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8883 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8884 anObj.SetParameters(Parameters)
8885 self._autoPublish(anObj, theName, "fillet")
8888 ## Perform a fillet on the specified edges of the given shape
8889 # @param theShape Wire Shape to perform fillet on.
8890 # @param theR Fillet radius.
8891 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8892 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8893 # \note The list of vertices could be empty,
8894 # in this case fillet will done done at all vertices in wire
8895 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8896 # by the length of the edges, nearest to the fillet vertex.
8897 # But sometimes the next edge is C1 continuous with the one, nearest to
8898 # the fillet point, and such two (or more) edges can be united to allow
8899 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8900 # thus ignoring the secant vertex (vertices).
8901 # @param theName Object name; when specified, this parameter is used
8902 # for result publication in the study. Otherwise, if automatic
8903 # publication is switched on, default value is used for result name.
8905 # @return New GEOM.GEOM_Object, containing the result shape.
8907 # @ref tui_fillet2d "Example"
8908 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8910 Perform a fillet on the specified edges of the given shape
8913 theShape Wire Shape to perform fillet on.
8915 theListOfVertexes Global indices of vertexes to perform fillet on.
8916 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8917 by the length of the edges, nearest to the fillet vertex.
8918 But sometimes the next edge is C1 continuous with the one, nearest to
8919 the fillet point, and such two (or more) edges can be united to allow
8920 bigger radius. Set this flag to TRUE to allow collinear edges union,
8921 thus ignoring the secant vertex (vertices).
8922 theName Object name; when specified, this parameter is used
8923 for result publication in the study. Otherwise, if automatic
8924 publication is switched on, default value is used for result name.
8926 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8928 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8931 New GEOM.GEOM_Object, containing the result shape.
8935 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8936 # make fillet at given wire vertices with giver radius
8937 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8939 # Example: see GEOM_TestAll.py
8940 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8941 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8942 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8943 anObj.SetParameters(Parameters)
8944 self._autoPublish(anObj, theName, "fillet")
8947 ## Perform a fillet at the specified vertices of the given face/shell.
8948 # @param theShape Face or Shell shape to perform fillet on.
8949 # @param theR Fillet radius.
8950 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8951 # @param theName Object name; when specified, this parameter is used
8952 # for result publication in the study. Otherwise, if automatic
8953 # publication is switched on, default value is used for result name.
8955 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8957 # @return New GEOM.GEOM_Object, containing the result shape.
8959 # @ref tui_fillet2d "Example"
8960 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8962 Perform a fillet at the specified vertices of the given face/shell.
8965 theShape Face or Shell shape to perform fillet on.
8967 theListOfVertexes Global indices of vertexes to perform fillet on.
8968 theName Object name; when specified, this parameter is used
8969 for result publication in the study. Otherwise, if automatic
8970 publication is switched on, default value is used for result name.
8972 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8975 New GEOM.GEOM_Object, containing the result shape.
8978 face = geompy.MakeFaceHW(100, 100, 1)
8979 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8981 # Example: see GEOM_TestAll.py
8982 theR,Parameters = ParseParameters(theR)
8983 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8984 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8985 anObj.SetParameters(Parameters)
8986 self._autoPublish(anObj, theName, "fillet")
8989 ## Perform a symmetric chamfer on all edges of the given shape.
8990 # @param theShape Shape, to perform chamfer on.
8991 # @param theD Chamfer size along each face.
8992 # @param theName Object name; when specified, this parameter is used
8993 # for result publication in the study. Otherwise, if automatic
8994 # publication is switched on, default value is used for result name.
8996 # @return New GEOM.GEOM_Object, containing the result shape.
8998 # @ref tui_chamfer "Example 1"
8999 # \n @ref swig_MakeChamferAll "Example 2"
9000 def MakeChamferAll(self, theShape, theD, theName=None):
9002 Perform a symmetric chamfer on all edges of the given shape.
9005 theShape Shape, to perform chamfer on.
9006 theD Chamfer size along each face.
9007 theName Object name; when specified, this parameter is used
9008 for result publication in the study. Otherwise, if automatic
9009 publication is switched on, default value is used for result name.
9012 New GEOM.GEOM_Object, containing the result shape.
9015 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9017 # Example: see GEOM_TestOthers.py
9018 theD,Parameters = ParseParameters(theD)
9019 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9020 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9021 anObj.SetParameters(Parameters)
9022 self._autoPublish(anObj, theName, "chamfer")
9025 ## Perform a chamfer on edges, common to the specified faces,
9026 # with distance D1 on the Face1
9027 # @param theShape Shape, to perform chamfer on.
9028 # @param theD1 Chamfer size along \a theFace1.
9029 # @param theD2 Chamfer size along \a theFace2.
9030 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9031 # @param theName Object name; when specified, this parameter is used
9032 # for result publication in the study. Otherwise, if automatic
9033 # publication is switched on, default value is used for result name.
9035 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9037 # @return New GEOM.GEOM_Object, containing the result shape.
9039 # @ref tui_chamfer "Example"
9040 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9042 Perform a chamfer on edges, common to the specified faces,
9043 with distance D1 on the Face1
9046 theShape Shape, to perform chamfer on.
9047 theD1 Chamfer size along theFace1.
9048 theD2 Chamfer size along theFace2.
9049 theFace1,theFace2 Global indices of two faces of theShape.
9050 theName Object name; when specified, this parameter is used
9051 for result publication in the study. Otherwise, if automatic
9052 publication is switched on, default value is used for result name.
9055 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9058 New GEOM.GEOM_Object, containing the result shape.
9061 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9062 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9063 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9064 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9066 # Example: see GEOM_TestAll.py
9067 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9068 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9069 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9070 anObj.SetParameters(Parameters)
9071 self._autoPublish(anObj, theName, "chamfer")
9074 ## Perform a chamfer on edges
9075 # @param theShape Shape, to perform chamfer on.
9076 # @param theD Chamfer length
9077 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9078 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9079 # @param theName Object name; when specified, this parameter is used
9080 # for result publication in the study. Otherwise, if automatic
9081 # publication is switched on, default value is used for result name.
9083 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9085 # @return New GEOM.GEOM_Object, containing the result shape.
9086 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9088 Perform a chamfer on edges
9091 theShape Shape, to perform chamfer on.
9092 theD1 Chamfer size along theFace1.
9093 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9094 theFace1,theFace2 Global indices of two faces of theShape.
9095 theName Object name; when specified, this parameter is used
9096 for result publication in the study. Otherwise, if automatic
9097 publication is switched on, default value is used for result name.
9100 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9103 New GEOM.GEOM_Object, containing the result shape.
9106 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9107 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9108 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9110 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9113 if isinstance(theAngle,str):
9115 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9117 theAngle = theAngle*math.pi/180.0
9118 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9119 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9120 anObj.SetParameters(Parameters)
9121 self._autoPublish(anObj, theName, "chamfer")
9124 ## Perform a chamfer on all edges of the specified faces,
9125 # with distance D1 on the first specified face (if several for one edge)
9126 # @param theShape Shape, to perform chamfer on.
9127 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9128 # connected to the edge, are in \a theFaces, \a theD1
9129 # will be get along face, which is nearer to \a theFaces beginning.
9130 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9131 # @param theFaces Sequence of global indices of faces of \a theShape.
9132 # @param theName Object name; when specified, this parameter is used
9133 # for result publication in the study. Otherwise, if automatic
9134 # publication is switched on, default value is used for result name.
9136 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9138 # @return New GEOM.GEOM_Object, containing the result shape.
9140 # @ref tui_chamfer "Example"
9141 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9143 Perform a chamfer on all edges of the specified faces,
9144 with distance D1 on the first specified face (if several for one edge)
9147 theShape Shape, to perform chamfer on.
9148 theD1 Chamfer size along face from theFaces. If both faces,
9149 connected to the edge, are in theFaces, theD1
9150 will be get along face, which is nearer to theFaces beginning.
9151 theD2 Chamfer size along another of two faces, connected to the edge.
9152 theFaces Sequence of global indices of faces of theShape.
9153 theName Object name; when specified, this parameter is used
9154 for result publication in the study. Otherwise, if automatic
9155 publication is switched on, default value is used for result name.
9157 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9160 New GEOM.GEOM_Object, containing the result shape.
9162 # Example: see GEOM_TestAll.py
9163 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9164 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9165 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9166 anObj.SetParameters(Parameters)
9167 self._autoPublish(anObj, theName, "chamfer")
9170 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9171 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9173 # @ref swig_FilletChamfer "Example"
9174 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9176 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9177 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9180 if isinstance(theAngle,str):
9182 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9184 theAngle = theAngle*math.pi/180.0
9185 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9186 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9187 anObj.SetParameters(Parameters)
9188 self._autoPublish(anObj, theName, "chamfer")
9191 ## Perform a chamfer on edges,
9192 # with distance D1 on the first specified face (if several for one edge)
9193 # @param theShape Shape, to perform chamfer on.
9194 # @param theD1,theD2 Chamfer size
9195 # @param theEdges Sequence of edges of \a theShape.
9196 # @param theName Object name; when specified, this parameter is used
9197 # for result publication in the study. Otherwise, if automatic
9198 # publication is switched on, default value is used for result name.
9200 # @return New GEOM.GEOM_Object, containing the result shape.
9202 # @ref swig_FilletChamfer "Example"
9203 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9205 Perform a chamfer on edges,
9206 with distance D1 on the first specified face (if several for one edge)
9209 theShape Shape, to perform chamfer on.
9210 theD1,theD2 Chamfer size
9211 theEdges Sequence of edges of theShape.
9212 theName Object name; when specified, this parameter is used
9213 for result publication in the study. Otherwise, if automatic
9214 publication is switched on, default value is used for result name.
9217 New GEOM.GEOM_Object, containing the result shape.
9219 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9220 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9221 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9222 anObj.SetParameters(Parameters)
9223 self._autoPublish(anObj, theName, "chamfer")
9226 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9227 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9228 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9230 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9231 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9234 if isinstance(theAngle,str):
9236 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9238 theAngle = theAngle*math.pi/180.0
9239 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9240 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9241 anObj.SetParameters(Parameters)
9242 self._autoPublish(anObj, theName, "chamfer")
9245 ## @sa MakeChamferEdge(), MakeChamferFaces()
9247 # @ref swig_MakeChamfer "Example"
9248 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9250 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9252 # Example: see GEOM_TestOthers.py
9254 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9255 if aShapeType == self.ShapeType["EDGE"]:
9256 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9258 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9261 ## Remove material from a solid by extrusion of the base shape on the given distance.
9262 # @param theInit Shape to remove material from. It must be a solid or
9263 # a compound made of a single solid.
9264 # @param theBase Closed edge or wire defining the base shape to be extruded.
9265 # @param theH Prism dimension along the normal to theBase
9266 # @param theAngle Draft angle in degrees.
9267 # @param theName Object name; when specified, this parameter is used
9268 # for result publication in the study. Otherwise, if automatic
9269 # publication is switched on, default value is used for result name.
9271 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9273 # @ref tui_creation_prism "Example"
9274 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9276 Add material to a solid by extrusion of the base shape on the given distance.
9279 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9280 theBase Closed edge or wire defining the base shape to be extruded.
9281 theH Prism dimension along the normal to theBase
9282 theAngle Draft angle in degrees.
9283 theName Object name; when specified, this parameter is used
9284 for result publication in the study. Otherwise, if automatic
9285 publication is switched on, default value is used for result name.
9288 New GEOM.GEOM_Object, containing the initial shape with removed material.
9290 # Example: see GEOM_TestAll.py
9291 #theH,Parameters = ParseParameters(theH)
9292 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9293 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9294 #anObj.SetParameters(Parameters)
9295 self._autoPublish(anObj, theName, "extrudedCut")
9298 ## Add material to a solid by extrusion of the base shape on the given distance.
9299 # @param theInit Shape to add material to. It must be a solid or
9300 # a compound made of a single solid.
9301 # @param theBase Closed edge or wire defining the base shape to be extruded.
9302 # @param theH Prism dimension along the normal to theBase
9303 # @param theAngle Draft angle in degrees.
9304 # @param theName Object name; when specified, this parameter is used
9305 # for result publication in the study. Otherwise, if automatic
9306 # publication is switched on, default value is used for result name.
9308 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9310 # @ref tui_creation_prism "Example"
9311 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9313 Add material to a solid by extrusion of the base shape on the given distance.
9316 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9317 theBase Closed edge or wire defining the base shape to be extruded.
9318 theH Prism dimension along the normal to theBase
9319 theAngle Draft angle in degrees.
9320 theName Object name; when specified, this parameter is used
9321 for result publication in the study. Otherwise, if automatic
9322 publication is switched on, default value is used for result name.
9325 New GEOM.GEOM_Object, containing the initial shape with added material.
9327 # Example: see GEOM_TestAll.py
9328 #theH,Parameters = ParseParameters(theH)
9329 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9330 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9331 #anObj.SetParameters(Parameters)
9332 self._autoPublish(anObj, theName, "extrudedBoss")
9338 ## @addtogroup l3_basic_op
9341 ## Perform an Archimde operation on the given shape with given parameters.
9342 # The object presenting the resulting face is returned.
9343 # @param theShape Shape to be put in water.
9344 # @param theWeight Weight og the shape.
9345 # @param theWaterDensity Density of the water.
9346 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9347 # @param theName Object name; when specified, this parameter is used
9348 # for result publication in the study. Otherwise, if automatic
9349 # publication is switched on, default value is used for result name.
9351 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9352 # by a plane, corresponding to water level.
9354 # @ref tui_archimede "Example"
9355 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9357 Perform an Archimde operation on the given shape with given parameters.
9358 The object presenting the resulting face is returned.
9361 theShape Shape to be put in water.
9362 theWeight Weight og the shape.
9363 theWaterDensity Density of the water.
9364 theMeshDeflection Deflection of the mesh, using to compute the section.
9365 theName Object name; when specified, this parameter is used
9366 for result publication in the study. Otherwise, if automatic
9367 publication is switched on, default value is used for result name.
9370 New GEOM.GEOM_Object, containing a section of theShape
9371 by a plane, corresponding to water level.
9373 # Example: see GEOM_TestAll.py
9374 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9375 theWeight,theWaterDensity,theMeshDeflection)
9376 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9377 RaiseIfFailed("MakeArchimede", self.LocalOp)
9378 anObj.SetParameters(Parameters)
9379 self._autoPublish(anObj, theName, "archimede")
9382 # end of l3_basic_op
9385 ## @addtogroup l2_measure
9388 ## Get point coordinates
9391 # @ref tui_measurement_tools_page "Example"
9392 def PointCoordinates(self,Point):
9394 Get point coordinates
9399 # Example: see GEOM_TestMeasures.py
9400 aTuple = self.MeasuOp.PointCoordinates(Point)
9401 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9404 ## Get vector coordinates
9407 # @ref tui_measurement_tools_page "Example"
9408 def VectorCoordinates(self,Vector):
9410 Get vector coordinates
9416 p1=self.GetFirstVertex(Vector)
9417 p2=self.GetLastVertex(Vector)
9419 X1=self.PointCoordinates(p1)
9420 X2=self.PointCoordinates(p2)
9422 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9425 ## Compute cross product
9426 # @return vector w=u^v
9428 # @ref tui_measurement_tools_page "Example"
9429 def CrossProduct(self, Vector1, Vector2):
9431 Compute cross product
9433 Returns: vector w=u^v
9435 u=self.VectorCoordinates(Vector1)
9436 v=self.VectorCoordinates(Vector2)
9437 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])
9441 ## Compute cross product
9442 # @return dot product p=u.v
9444 # @ref tui_measurement_tools_page "Example"
9445 def DotProduct(self, Vector1, Vector2):
9447 Compute cross product
9449 Returns: dot product p=u.v
9451 u=self.VectorCoordinates(Vector1)
9452 v=self.VectorCoordinates(Vector2)
9453 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9458 ## Get summarized length of all wires,
9459 # area of surface and volume of the given shape.
9460 # @param theShape Shape to define properties of.
9461 # @return [theLength, theSurfArea, theVolume]\n
9462 # theLength: Summarized length of all wires of the given shape.\n
9463 # theSurfArea: Area of surface of the given shape.\n
9464 # theVolume: Volume of the given shape.
9466 # @ref tui_measurement_tools_page "Example"
9467 def BasicProperties(self,theShape):
9469 Get summarized length of all wires,
9470 area of surface and volume of the given shape.
9473 theShape Shape to define properties of.
9476 [theLength, theSurfArea, theVolume]
9477 theLength: Summarized length of all wires of the given shape.
9478 theSurfArea: Area of surface of the given shape.
9479 theVolume: Volume of the given shape.
9481 # Example: see GEOM_TestMeasures.py
9482 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9483 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9486 ## Get parameters of bounding box of the given shape
9487 # @param theShape Shape to obtain bounding box of.
9488 # @param precise TRUE for precise computation; FALSE for fast one.
9489 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9490 # Xmin,Xmax: Limits of shape along OX axis.
9491 # Ymin,Ymax: Limits of shape along OY axis.
9492 # Zmin,Zmax: Limits of shape along OZ axis.
9494 # @ref tui_measurement_tools_page "Example"
9495 def BoundingBox (self, theShape, precise=False):
9497 Get parameters of bounding box of the given shape
9500 theShape Shape to obtain bounding box of.
9501 precise TRUE for precise computation; FALSE for fast one.
9504 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9505 Xmin,Xmax: Limits of shape along OX axis.
9506 Ymin,Ymax: Limits of shape along OY axis.
9507 Zmin,Zmax: Limits of shape along OZ axis.
9509 # Example: see GEOM_TestMeasures.py
9510 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9511 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9514 ## Get bounding box of the given shape
9515 # @param theShape Shape to obtain bounding box of.
9516 # @param precise TRUE for precise computation; FALSE for fast one.
9517 # @param theName Object name; when specified, this parameter is used
9518 # for result publication in the study. Otherwise, if automatic
9519 # publication is switched on, default value is used for result name.
9521 # @return New GEOM.GEOM_Object, containing the created box.
9523 # @ref tui_measurement_tools_page "Example"
9524 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9526 Get bounding box of the given shape
9529 theShape Shape to obtain bounding box of.
9530 precise TRUE for precise computation; FALSE for fast one.
9531 theName Object name; when specified, this parameter is used
9532 for result publication in the study. Otherwise, if automatic
9533 publication is switched on, default value is used for result name.
9536 New GEOM.GEOM_Object, containing the created box.
9538 # Example: see GEOM_TestMeasures.py
9539 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9540 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9541 self._autoPublish(anObj, theName, "bndbox")
9544 ## Get inertia matrix and moments of inertia of theShape.
9545 # @param theShape Shape to calculate inertia of.
9546 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9547 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9548 # Ix,Iy,Iz: Moments of inertia of the given shape.
9550 # @ref tui_measurement_tools_page "Example"
9551 def Inertia(self,theShape):
9553 Get inertia matrix and moments of inertia of theShape.
9556 theShape Shape to calculate inertia of.
9559 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9560 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9561 Ix,Iy,Iz: Moments of inertia of the given shape.
9563 # Example: see GEOM_TestMeasures.py
9564 aTuple = self.MeasuOp.GetInertia(theShape)
9565 RaiseIfFailed("GetInertia", self.MeasuOp)
9568 ## Get if coords are included in the shape (ST_IN or ST_ON)
9569 # @param theShape Shape
9570 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9571 # @param tolerance to be used (default is 1.0e-7)
9572 # @return list_of_boolean = [res1, res2, ...]
9573 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9575 Get if coords are included in the shape (ST_IN or ST_ON)
9579 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9580 tolerance to be used (default is 1.0e-7)
9583 list_of_boolean = [res1, res2, ...]
9585 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9587 ## Get minimal distance between the given shapes.
9588 # @param theShape1,theShape2 Shapes to find minimal distance between.
9589 # @return Value of the minimal distance between the given shapes.
9591 # @ref tui_measurement_tools_page "Example"
9592 def MinDistance(self, theShape1, theShape2):
9594 Get minimal distance between the given shapes.
9597 theShape1,theShape2 Shapes to find minimal distance between.
9600 Value of the minimal distance between the given shapes.
9602 # Example: see GEOM_TestMeasures.py
9603 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9604 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9607 ## Get minimal distance between the given shapes.
9608 # @param theShape1,theShape2 Shapes to find minimal distance between.
9609 # @return Value of the minimal distance between the given shapes, in form of list
9610 # [Distance, DX, DY, DZ].
9612 # @ref swig_all_measure "Example"
9613 def MinDistanceComponents(self, theShape1, theShape2):
9615 Get minimal distance between the given shapes.
9618 theShape1,theShape2 Shapes to find minimal distance between.
9621 Value of the minimal distance between the given shapes, in form of list
9622 [Distance, DX, DY, DZ]
9624 # Example: see GEOM_TestMeasures.py
9625 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9626 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9627 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9630 ## Get closest points of the given shapes.
9631 # @param theShape1,theShape2 Shapes to find closest points of.
9632 # @return The number of found solutions (-1 in case of infinite number of
9633 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9635 # @ref tui_measurement_tools_page "Example"
9636 def ClosestPoints (self, theShape1, theShape2):
9638 Get closest points of the given shapes.
9641 theShape1,theShape2 Shapes to find closest points of.
9644 The number of found solutions (-1 in case of infinite number of
9645 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9647 # Example: see GEOM_TestMeasures.py
9648 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9649 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9652 ## Get angle between the given shapes in degrees.
9653 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9654 # @note If both arguments are vectors, the angle is computed in accordance
9655 # with their orientations, otherwise the minimum angle is computed.
9656 # @return Value of the angle between the given shapes in degrees.
9658 # @ref tui_measurement_tools_page "Example"
9659 def GetAngle(self, theShape1, theShape2):
9661 Get angle between the given shapes in degrees.
9664 theShape1,theShape2 Lines or linear edges to find angle between.
9667 If both arguments are vectors, the angle is computed in accordance
9668 with their orientations, otherwise the minimum angle is computed.
9671 Value of the angle between the given shapes in degrees.
9673 # Example: see GEOM_TestMeasures.py
9674 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9675 RaiseIfFailed("GetAngle", self.MeasuOp)
9678 ## Get angle between the given shapes in radians.
9679 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9680 # @note If both arguments are vectors, the angle is computed in accordance
9681 # with their orientations, otherwise the minimum angle is computed.
9682 # @return Value of the angle between the given shapes in radians.
9684 # @ref tui_measurement_tools_page "Example"
9685 def GetAngleRadians(self, theShape1, theShape2):
9687 Get angle between the given shapes in radians.
9690 theShape1,theShape2 Lines or linear edges to find angle between.
9694 If both arguments are vectors, the angle is computed in accordance
9695 with their orientations, otherwise the minimum angle is computed.
9698 Value of the angle between the given shapes in radians.
9700 # Example: see GEOM_TestMeasures.py
9701 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9702 RaiseIfFailed("GetAngle", self.MeasuOp)
9705 ## Get angle between the given vectors in degrees.
9706 # @param theShape1,theShape2 Vectors to find angle between.
9707 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9708 # if False, the opposite vector to the normal vector is used.
9709 # @return Value of the angle between the given vectors in degrees.
9711 # @ref tui_measurement_tools_page "Example"
9712 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9714 Get angle between the given vectors in degrees.
9717 theShape1,theShape2 Vectors to find angle between.
9718 theFlag If True, the normal vector is defined by the two vectors cross,
9719 if False, the opposite vector to the normal vector is used.
9722 Value of the angle between the given vectors in degrees.
9724 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9726 anAngle = 360. - anAngle
9727 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9730 ## The same as GetAngleVectors, but the result is in radians.
9731 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9733 Get angle between the given vectors in radians.
9736 theShape1,theShape2 Vectors to find angle between.
9737 theFlag If True, the normal vector is defined by the two vectors cross,
9738 if False, the opposite vector to the normal vector is used.
9741 Value of the angle between the given vectors in radians.
9743 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9746 ## @name Curve Curvature Measurement
9747 # Methods for receiving radius of curvature of curves
9748 # in the given point
9751 ## Measure curvature of a curve at a point, set by parameter.
9752 # @param theCurve a curve.
9753 # @param theParam parameter.
9754 # @return radius of curvature of \a theCurve.
9756 # @ref swig_todo "Example"
9757 def CurveCurvatureByParam(self, theCurve, theParam):
9759 Measure curvature of a curve at a point, set by parameter.
9766 radius of curvature of theCurve.
9768 # Example: see GEOM_TestMeasures.py
9769 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9770 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9773 ## Measure curvature of a curve at a point.
9774 # @param theCurve a curve.
9775 # @param thePoint given point.
9776 # @return radius of curvature of \a theCurve.
9778 # @ref swig_todo "Example"
9779 def CurveCurvatureByPoint(self, theCurve, thePoint):
9781 Measure curvature of a curve at a point.
9785 thePoint given point.
9788 radius of curvature of theCurve.
9790 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9791 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9795 ## @name Surface Curvature Measurement
9796 # Methods for receiving max and min radius of curvature of surfaces
9797 # in the given point
9800 ## Measure max radius of curvature of surface.
9801 # @param theSurf the given surface.
9802 # @param theUParam Value of U-parameter on the referenced surface.
9803 # @param theVParam Value of V-parameter on the referenced surface.
9804 # @return max radius of curvature of theSurf.
9806 ## @ref swig_todo "Example"
9807 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9809 Measure max radius of curvature of surface.
9812 theSurf the given surface.
9813 theUParam Value of U-parameter on the referenced surface.
9814 theVParam Value of V-parameter on the referenced surface.
9817 max radius of curvature of theSurf.
9819 # Example: see GEOM_TestMeasures.py
9820 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9821 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9824 ## Measure max radius of curvature of surface in the given point
9825 # @param theSurf the given surface.
9826 # @param thePoint given point.
9827 # @return max radius of curvature of theSurf.
9829 ## @ref swig_todo "Example"
9830 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9832 Measure max radius of curvature of surface in the given point.
9835 theSurf the given surface.
9836 thePoint given point.
9839 max radius of curvature of theSurf.
9841 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9842 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9845 ## Measure min radius of curvature of surface.
9846 # @param theSurf the given surface.
9847 # @param theUParam Value of U-parameter on the referenced surface.
9848 # @param theVParam Value of V-parameter on the referenced surface.
9849 # @return min radius of curvature of theSurf.
9851 ## @ref swig_todo "Example"
9852 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9854 Measure min radius of curvature of surface.
9857 theSurf the given surface.
9858 theUParam Value of U-parameter on the referenced surface.
9859 theVParam Value of V-parameter on the referenced surface.
9862 Min radius of curvature of theSurf.
9864 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9865 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9868 ## Measure min radius of curvature of surface in the given point
9869 # @param theSurf the given surface.
9870 # @param thePoint given point.
9871 # @return min radius of curvature of theSurf.
9873 ## @ref swig_todo "Example"
9874 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9876 Measure min radius of curvature of surface in the given point.
9879 theSurf the given surface.
9880 thePoint given point.
9883 Min radius of curvature of theSurf.
9885 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9886 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9890 ## Get min and max tolerances of sub-shapes of theShape
9891 # @param theShape Shape, to get tolerances of.
9892 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9893 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9894 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9895 # VertMin,VertMax: Min and max tolerances of the vertices.
9897 # @ref tui_measurement_tools_page "Example"
9898 def Tolerance(self,theShape):
9900 Get min and max tolerances of sub-shapes of theShape
9903 theShape Shape, to get tolerances of.
9906 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9907 FaceMin,FaceMax: Min and max tolerances of the faces.
9908 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9909 VertMin,VertMax: Min and max tolerances of the vertices.
9911 # Example: see GEOM_TestMeasures.py
9912 aTuple = self.MeasuOp.GetTolerance(theShape)
9913 RaiseIfFailed("GetTolerance", self.MeasuOp)
9916 ## Obtain description of the given shape (number of sub-shapes of each type)
9917 # @param theShape Shape to be described.
9918 # @return Description of the given shape.
9920 # @ref tui_measurement_tools_page "Example"
9921 def WhatIs(self,theShape):
9923 Obtain description of the given shape (number of sub-shapes of each type)
9926 theShape Shape to be described.
9929 Description of the given shape.
9931 # Example: see GEOM_TestMeasures.py
9932 aDescr = self.MeasuOp.WhatIs(theShape)
9933 RaiseIfFailed("WhatIs", self.MeasuOp)
9936 ## Obtain quantity of shapes of the given type in \a theShape.
9937 # If \a theShape is of type \a theType, it is also counted.
9938 # @param theShape Shape to be described.
9939 # @param theType the given ShapeType().
9940 # @return Quantity of shapes of type \a theType in \a theShape.
9942 # @ref tui_measurement_tools_page "Example"
9943 def NbShapes (self, theShape, theType):
9945 Obtain quantity of shapes of the given type in theShape.
9946 If theShape is of type theType, it is also counted.
9949 theShape Shape to be described.
9950 theType the given geompy.ShapeType
9953 Quantity of shapes of type theType in theShape.
9955 # Example: see GEOM_TestMeasures.py
9956 listSh = self.SubShapeAllIDs(theShape, theType)
9960 ## Obtain quantity of shapes of each type in \a theShape.
9961 # The \a theShape is also counted.
9962 # @param theShape Shape to be described.
9963 # @return Dictionary of ShapeType() with bound quantities of shapes.
9965 # @ref tui_measurement_tools_page "Example"
9966 def ShapeInfo (self, theShape):
9968 Obtain quantity of shapes of each type in theShape.
9969 The theShape is also counted.
9972 theShape Shape to be described.
9975 Dictionary of geompy.ShapeType with bound quantities of shapes.
9977 # Example: see GEOM_TestMeasures.py
9979 for typeSh in self.ShapeType:
9980 if typeSh in ( "AUTO", "SHAPE" ): continue
9981 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9987 def GetCreationInformation(self, theShape):
9988 info = theShape.GetCreationInformation()
9990 opName = info.operationName
9991 if not opName: opName = "no info available"
9992 res = "Operation: " + opName
9994 for parVal in info.params:
9995 res += " \n %s = %s" % ( parVal.name, parVal.value )
9998 ## Get a point, situated at the centre of mass of theShape.
9999 # @param theShape Shape to define centre of mass of.
10000 # @param theName Object name; when specified, this parameter is used
10001 # for result publication in the study. Otherwise, if automatic
10002 # publication is switched on, default value is used for result name.
10004 # @return New GEOM.GEOM_Object, containing the created point.
10006 # @ref tui_measurement_tools_page "Example"
10007 def MakeCDG(self, theShape, theName=None):
10009 Get a point, situated at the centre of mass of theShape.
10012 theShape Shape to define centre of mass of.
10013 theName Object name; when specified, this parameter is used
10014 for result publication in the study. Otherwise, if automatic
10015 publication is switched on, default value is used for result name.
10018 New GEOM.GEOM_Object, containing the created point.
10020 # Example: see GEOM_TestMeasures.py
10021 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10022 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10023 self._autoPublish(anObj, theName, "centerOfMass")
10026 ## Get a vertex sub-shape by index depended with orientation.
10027 # @param theShape Shape to find sub-shape.
10028 # @param theIndex Index to find vertex by this index (starting from zero)
10029 # @param theName Object name; when specified, this parameter is used
10030 # for result publication in the study. Otherwise, if automatic
10031 # publication is switched on, default value is used for result name.
10033 # @return New GEOM.GEOM_Object, containing the created vertex.
10035 # @ref tui_measurement_tools_page "Example"
10036 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10038 Get a vertex sub-shape by index depended with orientation.
10041 theShape Shape to find sub-shape.
10042 theIndex Index to find vertex by this index (starting from zero)
10043 theName Object name; when specified, this parameter is used
10044 for result publication in the study. Otherwise, if automatic
10045 publication is switched on, default value is used for result name.
10048 New GEOM.GEOM_Object, containing the created vertex.
10050 # Example: see GEOM_TestMeasures.py
10051 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10052 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10053 self._autoPublish(anObj, theName, "vertex")
10056 ## Get the first vertex of wire/edge depended orientation.
10057 # @param theShape Shape to find first vertex.
10058 # @param theName Object name; when specified, this parameter is used
10059 # for result publication in the study. Otherwise, if automatic
10060 # publication is switched on, default value is used for result name.
10062 # @return New GEOM.GEOM_Object, containing the created vertex.
10064 # @ref tui_measurement_tools_page "Example"
10065 def GetFirstVertex(self, theShape, theName=None):
10067 Get the first vertex of wire/edge depended orientation.
10070 theShape Shape to find first vertex.
10071 theName Object name; when specified, this parameter is used
10072 for result publication in the study. Otherwise, if automatic
10073 publication is switched on, default value is used for result name.
10076 New GEOM.GEOM_Object, containing the created vertex.
10078 # Example: see GEOM_TestMeasures.py
10079 # note: auto-publishing is done in self.GetVertexByIndex()
10080 anObj = self.GetVertexByIndex(theShape, 0, theName)
10081 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
10084 ## Get the last vertex of wire/edge depended orientation.
10085 # @param theShape Shape to find last vertex.
10086 # @param theName Object name; when specified, this parameter is used
10087 # for result publication in the study. Otherwise, if automatic
10088 # publication is switched on, default value is used for result name.
10090 # @return New GEOM.GEOM_Object, containing the created vertex.
10092 # @ref tui_measurement_tools_page "Example"
10093 def GetLastVertex(self, theShape, theName=None):
10095 Get the last vertex of wire/edge depended orientation.
10098 theShape Shape to find last vertex.
10099 theName Object name; when specified, this parameter is used
10100 for result publication in the study. Otherwise, if automatic
10101 publication is switched on, default value is used for result name.
10104 New GEOM.GEOM_Object, containing the created vertex.
10106 # Example: see GEOM_TestMeasures.py
10107 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10108 # note: auto-publishing is done in self.GetVertexByIndex()
10109 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10110 RaiseIfFailed("GetLastVertex", self.MeasuOp)
10113 ## Get a normale to the given face. If the point is not given,
10114 # the normale is calculated at the center of mass.
10115 # @param theFace Face to define normale of.
10116 # @param theOptionalPoint Point to compute the normale at.
10117 # @param theName Object name; when specified, this parameter is used
10118 # for result publication in the study. Otherwise, if automatic
10119 # publication is switched on, default value is used for result name.
10121 # @return New GEOM.GEOM_Object, containing the created vector.
10123 # @ref swig_todo "Example"
10124 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10126 Get a normale to the given face. If the point is not given,
10127 the normale is calculated at the center of mass.
10130 theFace Face to define normale of.
10131 theOptionalPoint Point to compute the normale at.
10132 theName Object name; when specified, this parameter is used
10133 for result publication in the study. Otherwise, if automatic
10134 publication is switched on, default value is used for result name.
10137 New GEOM.GEOM_Object, containing the created vector.
10139 # Example: see GEOM_TestMeasures.py
10140 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10141 RaiseIfFailed("GetNormal", self.MeasuOp)
10142 self._autoPublish(anObj, theName, "normal")
10145 ## Print shape errors obtained from CheckShape.
10146 # @param theShape Shape that was checked.
10147 # @param theShapeErrors the shape errors obtained by CheckShape.
10148 # @param theReturnStatus If 0 the description of problem is printed.
10149 # If 1 the description of problem is returned.
10150 # @return If theReturnStatus is equal to 1 the description is returned.
10151 # Otherwise doesn't return anything.
10153 # @ref tui_measurement_tools_page "Example"
10154 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10156 Print shape errors obtained from CheckShape.
10159 theShape Shape that was checked.
10160 theShapeErrors the shape errors obtained by CheckShape.
10161 theReturnStatus If 0 the description of problem is printed.
10162 If 1 the description of problem is returned.
10165 If theReturnStatus is equal to 1 the description is returned.
10166 Otherwise doesn't return anything.
10168 # Example: see GEOM_TestMeasures.py
10169 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10170 if theReturnStatus == 1:
10175 ## Check a topology of the given shape.
10176 # @param theShape Shape to check validity of.
10177 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10178 # if TRUE, the shape's geometry will be checked also.
10179 # @param theReturnStatus If 0 and if theShape is invalid, a description
10180 # of problem is printed.
10181 # If 1 isValid flag and the description of
10182 # problem is returned.
10183 # If 2 isValid flag and the list of error data
10185 # @return TRUE, if the shape "seems to be valid".
10186 # If theShape is invalid, prints a description of problem.
10187 # If theReturnStatus is equal to 1 the description is returned
10188 # along with IsValid flag.
10189 # If theReturnStatus is equal to 2 the list of error data is
10190 # returned along with IsValid flag.
10192 # @ref tui_measurement_tools_page "Example"
10193 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10195 Check a topology of the given shape.
10198 theShape Shape to check validity of.
10199 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10200 if TRUE, the shape's geometry will be checked also.
10201 theReturnStatus If 0 and if theShape is invalid, a description
10202 of problem is printed.
10203 If 1 IsValid flag and the description of
10204 problem is returned.
10205 If 2 IsValid flag and the list of error data
10209 TRUE, if the shape "seems to be valid".
10210 If theShape is invalid, prints a description of problem.
10211 If theReturnStatus is equal to 1 the description is returned
10212 along with IsValid flag.
10213 If theReturnStatus is equal to 2 the list of error data is
10214 returned along with IsValid flag.
10216 # Example: see GEOM_TestMeasures.py
10218 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10219 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10221 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10222 RaiseIfFailed("CheckShape", self.MeasuOp)
10224 if theReturnStatus == 0:
10225 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10227 if theReturnStatus == 1:
10228 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10229 return (IsValid, Descr)
10230 elif theReturnStatus == 2:
10231 return (IsValid, ShapeErrors)
10234 ## Detect self-intersections in the given shape.
10235 # @param theShape Shape to check.
10236 # @return TRUE, if the shape contains no self-intersections.
10238 # @ref tui_measurement_tools_page "Example"
10239 def CheckSelfIntersections(self, theShape):
10241 Detect self-intersections in the given shape.
10244 theShape Shape to check.
10247 TRUE, if the shape contains no self-intersections.
10249 # Example: see GEOM_TestMeasures.py
10250 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10251 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10254 ## Get position (LCS) of theShape.
10256 # Origin of the LCS is situated at the shape's center of mass.
10257 # Axes of the LCS are obtained from shape's location or,
10258 # if the shape is a planar face, from position of its plane.
10260 # @param theShape Shape to calculate position of.
10261 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10262 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10263 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10264 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10266 # @ref swig_todo "Example"
10267 def GetPosition(self,theShape):
10269 Get position (LCS) of theShape.
10270 Origin of the LCS is situated at the shape's center of mass.
10271 Axes of the LCS are obtained from shape's location or,
10272 if the shape is a planar face, from position of its plane.
10275 theShape Shape to calculate position of.
10278 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10279 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10280 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10281 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10283 # Example: see GEOM_TestMeasures.py
10284 aTuple = self.MeasuOp.GetPosition(theShape)
10285 RaiseIfFailed("GetPosition", self.MeasuOp)
10288 ## Get kind of theShape.
10290 # @param theShape Shape to get a kind of.
10291 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10292 # and a list of parameters, describing the shape.
10293 # @note Concrete meaning of each value, returned via \a theIntegers
10294 # or \a theDoubles list depends on the kind() of the shape.
10296 # @ref swig_todo "Example"
10297 def KindOfShape(self,theShape):
10299 Get kind of theShape.
10302 theShape Shape to get a kind of.
10305 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10306 and a list of parameters, describing the shape.
10308 Concrete meaning of each value, returned via theIntegers
10309 or theDoubles list depends on the geompy.kind of the shape
10311 # Example: see GEOM_TestMeasures.py
10312 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10313 RaiseIfFailed("KindOfShape", self.MeasuOp)
10315 aKind = aRoughTuple[0]
10316 anInts = aRoughTuple[1]
10317 aDbls = aRoughTuple[2]
10319 # Now there is no exception from this rule:
10320 aKindTuple = [aKind] + aDbls + anInts
10322 # If they are we will regroup parameters for such kind of shape.
10324 #if aKind == kind.SOME_KIND:
10325 # # SOME_KIND int int double int double double
10326 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10330 # end of l2_measure
10333 ## @addtogroup l2_import_export
10336 ## Import a shape from the BREP or IGES or STEP file
10337 # (depends on given format) with given name.
10338 # @param theFileName The file, containing the shape.
10339 # @param theFormatName Specify format for the file reading.
10340 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10341 # If format 'IGES_SCALE' is used instead of 'IGES' or
10342 # format 'STEP_SCALE' is used instead of 'STEP',
10343 # length unit will be set to 'meter' and result model will be scaled.
10344 # @param theName Object name; when specified, this parameter is used
10345 # for result publication in the study. Otherwise, if automatic
10346 # publication is switched on, default value is used for result name.
10348 # @return New GEOM.GEOM_Object, containing the imported shape.
10349 # If material names are imported it returns the list of
10350 # objects. The first one is the imported object followed by
10352 # @note Auto publishing is allowed for the shape itself. Imported
10353 # material groups are not automatically published.
10355 # @ref swig_Import_Export "Example"
10356 def ImportFile(self, theFileName, theFormatName, theName=None):
10358 Import a shape from the BREP or IGES or STEP file
10359 (depends on given format) with given name.
10362 theFileName The file, containing the shape.
10363 theFormatName Specify format for the file reading.
10364 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10365 If format 'IGES_SCALE' is used instead of 'IGES' or
10366 format 'STEP_SCALE' is used instead of 'STEP',
10367 length unit will be set to 'meter' and result model will be scaled.
10368 theName Object name; when specified, this parameter is used
10369 for result publication in the study. Otherwise, if automatic
10370 publication is switched on, default value is used for result name.
10373 New GEOM.GEOM_Object, containing the imported shape.
10374 If material names are imported it returns the list of
10375 objects. The first one is the imported object followed by
10378 Auto publishing is allowed for the shape itself. Imported
10379 material groups are not automatically published.
10381 # Example: see GEOM_TestOthers.py
10382 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10383 RaiseIfFailed("ImportFile", self.InsertOp)
10384 aNbObj = len(aListObj)
10386 self._autoPublish(aListObj[0], theName, "imported")
10391 ## Deprecated analog of ImportFile()
10392 def Import(self, theFileName, theFormatName, theName=None):
10394 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10396 print "WARNING: Function Import is deprecated, use ImportFile instead"
10397 # note: auto-publishing is done in self.ImportFile()
10398 return self.ImportFile(theFileName, theFormatName, theName)
10400 ## Shortcut to ImportFile() for BREP format.
10401 # Import a shape from the BREP file with given name.
10402 # @param theFileName The file, containing the shape.
10403 # @param theName Object name; when specified, this parameter is used
10404 # for result publication in the study. Otherwise, if automatic
10405 # publication is switched on, default value is used for result name.
10407 # @return New GEOM.GEOM_Object, containing the imported shape.
10409 # @ref swig_Import_Export "Example"
10410 def ImportBREP(self, theFileName, theName=None):
10412 geompy.ImportFile(...) function for BREP format
10413 Import a shape from the BREP file with given name.
10416 theFileName The file, containing the shape.
10417 theName Object name; when specified, this parameter is used
10418 for result publication in the study. Otherwise, if automatic
10419 publication is switched on, default value is used for result name.
10422 New GEOM.GEOM_Object, containing the imported shape.
10424 # Example: see GEOM_TestOthers.py
10425 # note: auto-publishing is done in self.ImportFile()
10426 return self.ImportFile(theFileName, "BREP", theName)
10428 ## Shortcut to ImportFile() for IGES format
10429 # Import a shape from the IGES file with given name.
10430 # @param theFileName The file, containing the shape.
10431 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10432 # and result model will be scaled, if its units are not meters.
10433 # If False (default), file length units will be taken into account.
10434 # @param theName Object name; when specified, this parameter is used
10435 # for result publication in the study. Otherwise, if automatic
10436 # publication is switched on, default value is used for result name.
10438 # @return New GEOM.GEOM_Object, containing the imported shape.
10440 # @ref swig_Import_Export "Example"
10441 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10443 geompy.ImportFile(...) function for IGES format
10446 theFileName The file, containing the shape.
10447 ignoreUnits If True, file length units will be ignored (set to 'meter')
10448 and result model will be scaled, if its units are not meters.
10449 If False (default), file length units will be taken into account.
10450 theName Object name; when specified, this parameter is used
10451 for result publication in the study. Otherwise, if automatic
10452 publication is switched on, default value is used for result name.
10455 New GEOM.GEOM_Object, containing the imported shape.
10457 # Example: see GEOM_TestOthers.py
10458 # note: auto-publishing is done in self.ImportFile()
10460 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10461 return self.ImportFile(theFileName, "IGES", theName)
10463 ## Return length unit from given IGES file
10464 # @param theFileName The file, containing the shape.
10465 # @return String, containing the units name.
10467 # @ref swig_Import_Export "Example"
10468 def GetIGESUnit(self, theFileName):
10470 Return length units from given IGES file
10473 theFileName The file, containing the shape.
10476 String, containing the units name.
10478 # Example: see GEOM_TestOthers.py
10479 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10482 ## Shortcut to ImportFile() for STEP format
10483 # Import a shape from the STEP file with given name.
10484 # @param theFileName The file, containing the shape.
10485 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10486 # and result model will be scaled, if its units are not meters.
10487 # If False (default), file length units will be taken into account.
10488 # @param theName Object name; when specified, this parameter is used
10489 # for result publication in the study. Otherwise, if automatic
10490 # publication is switched on, default value is used for result name.
10492 # @return New GEOM.GEOM_Object, containing the imported shape.
10493 # If material names are imported it returns the list of
10494 # objects. The first one is the imported object followed by
10496 # @note Auto publishing is allowed for the shape itself. Imported
10497 # material groups are not automatically published.
10499 # @ref swig_Import_Export "Example"
10500 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10502 geompy.ImportFile(...) function for STEP format
10505 theFileName The file, containing the shape.
10506 ignoreUnits If True, file length units will be ignored (set to 'meter')
10507 and result model will be scaled, if its units are not meters.
10508 If False (default), file length units will be taken into account.
10509 theName Object name; when specified, this parameter is used
10510 for result publication in the study. Otherwise, if automatic
10511 publication is switched on, default value is used for result name.
10514 New GEOM.GEOM_Object, containing the imported shape.
10515 If material names are imported it returns the list of
10516 objects. The first one is the imported object followed by
10519 Auto publishing is allowed for the shape itself. Imported
10520 material groups are not automatically published.
10522 # Example: see GEOM_TestOthers.py
10523 # note: auto-publishing is done in self.ImportFile()
10525 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10526 return self.ImportFile(theFileName, "STEP", theName)
10528 ## Return length unit from given IGES or STEP file
10529 # @param theFileName The file, containing the shape.
10530 # @return String, containing the units name.
10532 # @ref swig_Import_Export "Example"
10533 def GetSTEPUnit(self, theFileName):
10535 Return length units from given STEP file
10538 theFileName The file, containing the shape.
10541 String, containing the units name.
10543 # Example: see GEOM_TestOthers.py
10544 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10547 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10548 # @note This method will not be dumped to the python script by DumpStudy functionality.
10549 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10550 # @param theStream The BRep binary stream.
10551 # @param theName Object name; when specified, this parameter is used
10552 # for result publication in the study. Otherwise, if automatic
10553 # publication is switched on, default value is used for result name.
10555 # @return New GEOM_Object, containing the shape, read from theStream.
10557 # @ref swig_Import_Export "Example"
10558 def RestoreShape (self, theStream, theName=None):
10560 Read a shape from the binary stream, containing its bounding representation (BRep).
10563 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10566 theStream The BRep binary stream.
10567 theName Object name; when specified, this parameter is used
10568 for result publication in the study. Otherwise, if automatic
10569 publication is switched on, default value is used for result name.
10572 New GEOM_Object, containing the shape, read from theStream.
10574 # Example: see GEOM_TestOthers.py
10575 anObj = self.InsertOp.RestoreShape(theStream)
10576 RaiseIfFailed("RestoreShape", self.InsertOp)
10577 self._autoPublish(anObj, theName, "restored")
10580 ## Export the given shape into a file with given name.
10581 # @param theObject Shape to be stored in the file.
10582 # @param theFileName Name of the file to store the given shape in.
10583 # @param theFormatName Specify format for the shape storage.
10584 # Available formats can be obtained with
10585 # geompy.InsertOp.ExportTranslators()[0] method.
10587 # @ref swig_Import_Export "Example"
10588 def Export(self, theObject, theFileName, theFormatName):
10590 Export the given shape into a file with given name.
10593 theObject Shape to be stored in the file.
10594 theFileName Name of the file to store the given shape in.
10595 theFormatName Specify format for the shape storage.
10596 Available formats can be obtained with
10597 geompy.InsertOp.ExportTranslators()[0] method.
10599 # Example: see GEOM_TestOthers.py
10600 self.InsertOp.Export(theObject, theFileName, theFormatName)
10601 if self.InsertOp.IsDone() == 0:
10602 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10606 ## Shortcut to Export() for BREP format
10608 # @ref swig_Import_Export "Example"
10609 def ExportBREP(self,theObject, theFileName):
10611 geompy.Export(...) function for BREP format
10613 # Example: see GEOM_TestOthers.py
10614 return self.Export(theObject, theFileName, "BREP")
10616 ## Shortcut to Export() for IGES format
10618 # @ref swig_Import_Export "Example"
10619 def ExportIGES(self,theObject, theFileName):
10621 geompy.Export(...) function for IGES format
10623 # Example: see GEOM_TestOthers.py
10624 return self.Export(theObject, theFileName, "IGES")
10626 ## Shortcut to Export() for STEP format
10628 # @ref swig_Import_Export "Example"
10629 def ExportSTEP(self,theObject, theFileName):
10631 geompy.Export(...) function for STEP format
10633 # Example: see GEOM_TestOthers.py
10634 return self.Export(theObject, theFileName, "STEP")
10636 # end of l2_import_export
10639 ## @addtogroup l3_blocks
10642 ## Create a quadrangle face from four edges. Order of Edges is not
10643 # important. It is not necessary that edges share the same vertex.
10644 # @param E1,E2,E3,E4 Edges for the face bound.
10645 # @param theName Object name; when specified, this parameter is used
10646 # for result publication in the study. Otherwise, if automatic
10647 # publication is switched on, default value is used for result name.
10649 # @return New GEOM.GEOM_Object, containing the created face.
10651 # @ref tui_building_by_blocks_page "Example"
10652 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10654 Create a quadrangle face from four edges. Order of Edges is not
10655 important. It is not necessary that edges share the same vertex.
10658 E1,E2,E3,E4 Edges for the face bound.
10659 theName Object name; when specified, this parameter is used
10660 for result publication in the study. Otherwise, if automatic
10661 publication is switched on, default value is used for result name.
10664 New GEOM.GEOM_Object, containing the created face.
10667 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10669 # Example: see GEOM_Spanner.py
10670 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10671 RaiseIfFailed("MakeQuad", self.BlocksOp)
10672 self._autoPublish(anObj, theName, "quad")
10675 ## Create a quadrangle face on two edges.
10676 # The missing edges will be built by creating the shortest ones.
10677 # @param E1,E2 Two opposite edges for the face.
10678 # @param theName Object name; when specified, this parameter is used
10679 # for result publication in the study. Otherwise, if automatic
10680 # publication is switched on, default value is used for result name.
10682 # @return New GEOM.GEOM_Object, containing the created face.
10684 # @ref tui_building_by_blocks_page "Example"
10685 def MakeQuad2Edges(self, E1, E2, theName=None):
10687 Create a quadrangle face on two edges.
10688 The missing edges will be built by creating the shortest ones.
10691 E1,E2 Two opposite edges for the face.
10692 theName Object name; when specified, this parameter is used
10693 for result publication in the study. Otherwise, if automatic
10694 publication is switched on, default value is used for result name.
10697 New GEOM.GEOM_Object, containing the created face.
10701 p1 = geompy.MakeVertex( 0., 0., 0.)
10702 p2 = geompy.MakeVertex(150., 30., 0.)
10703 p3 = geompy.MakeVertex( 0., 120., 50.)
10704 p4 = geompy.MakeVertex( 0., 40., 70.)
10706 edge1 = geompy.MakeEdge(p1, p2)
10707 edge2 = geompy.MakeEdge(p3, p4)
10708 # create a quadrangle face from two edges
10709 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10711 # Example: see GEOM_Spanner.py
10712 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10713 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10714 self._autoPublish(anObj, theName, "quad")
10717 ## Create a quadrangle face with specified corners.
10718 # The missing edges will be built by creating the shortest ones.
10719 # @param V1,V2,V3,V4 Corner vertices for the face.
10720 # @param theName Object name; when specified, this parameter is used
10721 # for result publication in the study. Otherwise, if automatic
10722 # publication is switched on, default value is used for result name.
10724 # @return New GEOM.GEOM_Object, containing the created face.
10726 # @ref tui_building_by_blocks_page "Example 1"
10727 # \n @ref swig_MakeQuad4Vertices "Example 2"
10728 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10730 Create a quadrangle face with specified corners.
10731 The missing edges will be built by creating the shortest ones.
10734 V1,V2,V3,V4 Corner vertices for the face.
10735 theName Object name; when specified, this parameter is used
10736 for result publication in the study. Otherwise, if automatic
10737 publication is switched on, default value is used for result name.
10740 New GEOM.GEOM_Object, containing the created face.
10744 p1 = geompy.MakeVertex( 0., 0., 0.)
10745 p2 = geompy.MakeVertex(150., 30., 0.)
10746 p3 = geompy.MakeVertex( 0., 120., 50.)
10747 p4 = geompy.MakeVertex( 0., 40., 70.)
10748 # create a quadrangle from four points in its corners
10749 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10751 # Example: see GEOM_Spanner.py
10752 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10753 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10754 self._autoPublish(anObj, theName, "quad")
10757 ## Create a hexahedral solid, bounded by the six given faces. Order of
10758 # faces is not important. It is not necessary that Faces share the same edge.
10759 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10760 # @param theName Object name; when specified, this parameter is used
10761 # for result publication in the study. Otherwise, if automatic
10762 # publication is switched on, default value is used for result name.
10764 # @return New GEOM.GEOM_Object, containing the created solid.
10766 # @ref tui_building_by_blocks_page "Example 1"
10767 # \n @ref swig_MakeHexa "Example 2"
10768 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10770 Create a hexahedral solid, bounded by the six given faces. Order of
10771 faces is not important. It is not necessary that Faces share the same edge.
10774 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10775 theName Object name; when specified, this parameter is used
10776 for result publication in the study. Otherwise, if automatic
10777 publication is switched on, default value is used for result name.
10780 New GEOM.GEOM_Object, containing the created solid.
10783 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10785 # Example: see GEOM_Spanner.py
10786 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10787 RaiseIfFailed("MakeHexa", self.BlocksOp)
10788 self._autoPublish(anObj, theName, "hexa")
10791 ## Create a hexahedral solid between two given faces.
10792 # The missing faces will be built by creating the smallest ones.
10793 # @param F1,F2 Two opposite faces for the hexahedral solid.
10794 # @param theName Object name; when specified, this parameter is used
10795 # for result publication in the study. Otherwise, if automatic
10796 # publication is switched on, default value is used for result name.
10798 # @return New GEOM.GEOM_Object, containing the created solid.
10800 # @ref tui_building_by_blocks_page "Example 1"
10801 # \n @ref swig_MakeHexa2Faces "Example 2"
10802 def MakeHexa2Faces(self, F1, F2, theName=None):
10804 Create a hexahedral solid between two given faces.
10805 The missing faces will be built by creating the smallest ones.
10808 F1,F2 Two opposite faces for the hexahedral solid.
10809 theName Object name; when specified, this parameter is used
10810 for result publication in the study. Otherwise, if automatic
10811 publication is switched on, default value is used for result name.
10814 New GEOM.GEOM_Object, containing the created solid.
10817 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10819 # Example: see GEOM_Spanner.py
10820 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10821 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10822 self._autoPublish(anObj, theName, "hexa")
10828 ## @addtogroup l3_blocks_op
10831 ## Get a vertex, found in the given shape by its coordinates.
10832 # @param theShape Block or a compound of blocks.
10833 # @param theX,theY,theZ Coordinates of the sought vertex.
10834 # @param theEpsilon Maximum allowed distance between the resulting
10835 # vertex and point with the given coordinates.
10836 # @param theName Object name; when specified, this parameter is used
10837 # for result publication in the study. Otherwise, if automatic
10838 # publication is switched on, default value is used for result name.
10840 # @return New GEOM.GEOM_Object, containing the found vertex.
10842 # @ref swig_GetPoint "Example"
10843 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10845 Get a vertex, found in the given shape by its coordinates.
10848 theShape Block or a compound of blocks.
10849 theX,theY,theZ Coordinates of the sought vertex.
10850 theEpsilon Maximum allowed distance between the resulting
10851 vertex and point with the given coordinates.
10852 theName Object name; when specified, this parameter is used
10853 for result publication in the study. Otherwise, if automatic
10854 publication is switched on, default value is used for result name.
10857 New GEOM.GEOM_Object, containing the found vertex.
10860 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10862 # Example: see GEOM_TestOthers.py
10863 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10864 RaiseIfFailed("GetPoint", self.BlocksOp)
10865 self._autoPublish(anObj, theName, "vertex")
10868 ## Find a vertex of the given shape, which has minimal distance to the given point.
10869 # @param theShape Any shape.
10870 # @param thePoint Point, close to the desired vertex.
10871 # @param theName Object name; when specified, this parameter is used
10872 # for result publication in the study. Otherwise, if automatic
10873 # publication is switched on, default value is used for result name.
10875 # @return New GEOM.GEOM_Object, containing the found vertex.
10877 # @ref swig_GetVertexNearPoint "Example"
10878 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10880 Find a vertex of the given shape, which has minimal distance to the given point.
10883 theShape Any shape.
10884 thePoint Point, close to the desired vertex.
10885 theName Object name; when specified, this parameter is used
10886 for result publication in the study. Otherwise, if automatic
10887 publication is switched on, default value is used for result name.
10890 New GEOM.GEOM_Object, containing the found vertex.
10893 pmidle = geompy.MakeVertex(50, 0, 50)
10894 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10896 # Example: see GEOM_TestOthers.py
10897 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10898 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10899 self._autoPublish(anObj, theName, "vertex")
10902 ## Get an edge, found in the given shape by two given vertices.
10903 # @param theShape Block or a compound of blocks.
10904 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10905 # @param theName Object name; when specified, this parameter is used
10906 # for result publication in the study. Otherwise, if automatic
10907 # publication is switched on, default value is used for result name.
10909 # @return New GEOM.GEOM_Object, containing the found edge.
10911 # @ref swig_GetEdge "Example"
10912 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10914 Get an edge, found in the given shape by two given vertices.
10917 theShape Block or a compound of blocks.
10918 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10919 theName Object name; when specified, this parameter is used
10920 for result publication in the study. Otherwise, if automatic
10921 publication is switched on, default value is used for result name.
10924 New GEOM.GEOM_Object, containing the found edge.
10926 # Example: see GEOM_Spanner.py
10927 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10928 RaiseIfFailed("GetEdge", self.BlocksOp)
10929 self._autoPublish(anObj, theName, "edge")
10932 ## Find an edge of the given shape, which has minimal distance to the given point.
10933 # @param theShape Block or a compound of blocks.
10934 # @param thePoint Point, close to the desired edge.
10935 # @param theName Object name; when specified, this parameter is used
10936 # for result publication in the study. Otherwise, if automatic
10937 # publication is switched on, default value is used for result name.
10939 # @return New GEOM.GEOM_Object, containing the found edge.
10941 # @ref swig_GetEdgeNearPoint "Example"
10942 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10944 Find an edge of the given shape, which has minimal distance to the given point.
10947 theShape Block or a compound of blocks.
10948 thePoint Point, close to the desired edge.
10949 theName Object name; when specified, this parameter is used
10950 for result publication in the study. Otherwise, if automatic
10951 publication is switched on, default value is used for result name.
10954 New GEOM.GEOM_Object, containing the found edge.
10956 # Example: see GEOM_TestOthers.py
10957 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10958 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10959 self._autoPublish(anObj, theName, "edge")
10962 ## Returns a face, found in the given shape by four given corner vertices.
10963 # @param theShape Block or a compound of blocks.
10964 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10965 # @param theName Object name; when specified, this parameter is used
10966 # for result publication in the study. Otherwise, if automatic
10967 # publication is switched on, default value is used for result name.
10969 # @return New GEOM.GEOM_Object, containing the found face.
10971 # @ref swig_todo "Example"
10972 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10974 Returns a face, found in the given shape by four given corner vertices.
10977 theShape Block or a compound of blocks.
10978 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10979 theName Object name; when specified, this parameter is used
10980 for result publication in the study. Otherwise, if automatic
10981 publication is switched on, default value is used for result name.
10984 New GEOM.GEOM_Object, containing the found face.
10986 # Example: see GEOM_Spanner.py
10987 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10988 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10989 self._autoPublish(anObj, theName, "face")
10992 ## Get a face of block, found in the given shape by two given edges.
10993 # @param theShape Block or a compound of blocks.
10994 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10995 # @param theName Object name; when specified, this parameter is used
10996 # for result publication in the study. Otherwise, if automatic
10997 # publication is switched on, default value is used for result name.
10999 # @return New GEOM.GEOM_Object, containing the found face.
11001 # @ref swig_todo "Example"
11002 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11004 Get a face of block, found in the given shape by two given edges.
11007 theShape Block or a compound of blocks.
11008 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11009 theName Object name; when specified, this parameter is used
11010 for result publication in the study. Otherwise, if automatic
11011 publication is switched on, default value is used for result name.
11014 New GEOM.GEOM_Object, containing the found face.
11016 # Example: see GEOM_Spanner.py
11017 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11018 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11019 self._autoPublish(anObj, theName, "face")
11022 ## Find a face, opposite to the given one in the given block.
11023 # @param theBlock Must be a hexahedral solid.
11024 # @param theFace Face of \a theBlock, opposite to the desired face.
11025 # @param theName Object name; when specified, this parameter is used
11026 # for result publication in the study. Otherwise, if automatic
11027 # publication is switched on, default value is used for result name.
11029 # @return New GEOM.GEOM_Object, containing the found face.
11031 # @ref swig_GetOppositeFace "Example"
11032 def GetOppositeFace(self, theBlock, theFace, theName=None):
11034 Find a face, opposite to the given one in the given block.
11037 theBlock Must be a hexahedral solid.
11038 theFace Face of theBlock, opposite to the desired face.
11039 theName Object name; when specified, this parameter is used
11040 for result publication in the study. Otherwise, if automatic
11041 publication is switched on, default value is used for result name.
11044 New GEOM.GEOM_Object, containing the found face.
11046 # Example: see GEOM_Spanner.py
11047 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11048 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11049 self._autoPublish(anObj, theName, "face")
11052 ## Find a face of the given shape, which has minimal distance to the given point.
11053 # @param theShape Block or a compound of blocks.
11054 # @param thePoint Point, close to the desired face.
11055 # @param theName Object name; when specified, this parameter is used
11056 # for result publication in the study. Otherwise, if automatic
11057 # publication is switched on, default value is used for result name.
11059 # @return New GEOM.GEOM_Object, containing the found face.
11061 # @ref swig_GetFaceNearPoint "Example"
11062 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11064 Find a face of the given shape, which has minimal distance to the given point.
11067 theShape Block or a compound of blocks.
11068 thePoint Point, close to the desired face.
11069 theName Object name; when specified, this parameter is used
11070 for result publication in the study. Otherwise, if automatic
11071 publication is switched on, default value is used for result name.
11074 New GEOM.GEOM_Object, containing the found face.
11076 # Example: see GEOM_Spanner.py
11077 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11078 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11079 self._autoPublish(anObj, theName, "face")
11082 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11083 # @param theBlock Block or a compound of blocks.
11084 # @param theVector Vector, close to the normale of the desired face.
11085 # @param theName Object name; when specified, this parameter is used
11086 # for result publication in the study. Otherwise, if automatic
11087 # publication is switched on, default value is used for result name.
11089 # @return New GEOM.GEOM_Object, containing the found face.
11091 # @ref swig_todo "Example"
11092 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11094 Find a face of block, whose outside normale has minimal angle with the given vector.
11097 theBlock Block or a compound of blocks.
11098 theVector Vector, close to the normale of the desired face.
11099 theName Object name; when specified, this parameter is used
11100 for result publication in the study. Otherwise, if automatic
11101 publication is switched on, default value is used for result name.
11104 New GEOM.GEOM_Object, containing the found face.
11106 # Example: see GEOM_Spanner.py
11107 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11108 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11109 self._autoPublish(anObj, theName, "face")
11112 ## Find all sub-shapes of type \a theShapeType of the given shape,
11113 # which have minimal distance to the given point.
11114 # @param theShape Any shape.
11115 # @param thePoint Point, close to the desired shape.
11116 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11117 # @param theTolerance The tolerance for distances comparison. All shapes
11118 # with distances to the given point in interval
11119 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11120 # @param theName Object name; when specified, this parameter is used
11121 # for result publication in the study. Otherwise, if automatic
11122 # publication is switched on, default value is used for result name.
11124 # @return New GEOM_Object, containing a group of all found shapes.
11126 # @ref swig_GetShapesNearPoint "Example"
11127 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11129 Find all sub-shapes of type theShapeType of the given shape,
11130 which have minimal distance to the given point.
11133 theShape Any shape.
11134 thePoint Point, close to the desired shape.
11135 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11136 theTolerance The tolerance for distances comparison. All shapes
11137 with distances to the given point in interval
11138 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11139 theName Object name; when specified, this parameter is used
11140 for result publication in the study. Otherwise, if automatic
11141 publication is switched on, default value is used for result name.
11144 New GEOM_Object, containing a group of all found shapes.
11146 # Example: see GEOM_TestOthers.py
11147 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11148 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11149 self._autoPublish(anObj, theName, "group")
11152 # end of l3_blocks_op
11155 ## @addtogroup l4_blocks_measure
11158 ## Check, if the compound of blocks is given.
11159 # To be considered as a compound of blocks, the
11160 # given shape must satisfy the following conditions:
11161 # - Each element of the compound should be a Block (6 faces and 12 edges).
11162 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11163 # - The compound should be connexe.
11164 # - The glue between two quadrangle faces should be applied.
11165 # @param theCompound The compound to check.
11166 # @return TRUE, if the given shape is a compound of blocks.
11167 # If theCompound is not valid, prints all discovered errors.
11169 # @ref tui_measurement_tools_page "Example 1"
11170 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11171 def CheckCompoundOfBlocks(self,theCompound):
11173 Check, if the compound of blocks is given.
11174 To be considered as a compound of blocks, the
11175 given shape must satisfy the following conditions:
11176 - Each element of the compound should be a Block (6 faces and 12 edges).
11177 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11178 - The compound should be connexe.
11179 - The glue between two quadrangle faces should be applied.
11182 theCompound The compound to check.
11185 TRUE, if the given shape is a compound of blocks.
11186 If theCompound is not valid, prints all discovered errors.
11188 # Example: see GEOM_Spanner.py
11189 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11190 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11192 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11196 ## Retrieve all non blocks solids and faces from \a theShape.
11197 # @param theShape The shape to explore.
11198 # @param theName Object name; when specified, this parameter is used
11199 # for result publication in the study. Otherwise, if automatic
11200 # publication is switched on, default value is used for result name.
11202 # @return A tuple of two GEOM_Objects. The first object is a group of all
11203 # non block solids (= not 6 faces, or with 6 faces, but with the
11204 # presence of non-quadrangular faces). The second object is a
11205 # group of all non quadrangular faces.
11207 # @ref tui_measurement_tools_page "Example 1"
11208 # \n @ref swig_GetNonBlocks "Example 2"
11209 def GetNonBlocks (self, theShape, theName=None):
11211 Retrieve all non blocks solids and faces from theShape.
11214 theShape The shape to explore.
11215 theName Object name; when specified, this parameter is used
11216 for result publication in the study. Otherwise, if automatic
11217 publication is switched on, default value is used for result name.
11220 A tuple of two GEOM_Objects. The first object is a group of all
11221 non block solids (= not 6 faces, or with 6 faces, but with the
11222 presence of non-quadrangular faces). The second object is a
11223 group of all non quadrangular faces.
11226 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11228 # Example: see GEOM_Spanner.py
11229 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11230 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11231 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11234 ## Remove all seam and degenerated edges from \a theShape.
11235 # Unite faces and edges, sharing one surface. It means that
11236 # this faces must have references to one C++ surface object (handle).
11237 # @param theShape The compound or single solid to remove irregular edges from.
11238 # @param doUnionFaces If True, then unite faces. If False (the default value),
11239 # do not unite faces.
11240 # @param theName Object name; when specified, this parameter is used
11241 # for result publication in the study. Otherwise, if automatic
11242 # publication is switched on, default value is used for result name.
11244 # @return Improved shape.
11246 # @ref swig_RemoveExtraEdges "Example"
11247 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11249 Remove all seam and degenerated edges from theShape.
11250 Unite faces and edges, sharing one surface. It means that
11251 this faces must have references to one C++ surface object (handle).
11254 theShape The compound or single solid to remove irregular edges from.
11255 doUnionFaces If True, then unite faces. If False (the default value),
11256 do not unite faces.
11257 theName Object name; when specified, this parameter is used
11258 for result publication in the study. Otherwise, if automatic
11259 publication is switched on, default value is used for result name.
11264 # Example: see GEOM_TestOthers.py
11265 nbFacesOptimum = -1 # -1 means do not unite faces
11266 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11267 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11268 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11269 self._autoPublish(anObj, theName, "removeExtraEdges")
11272 ## Performs union faces of \a theShape
11273 # Unite faces sharing one surface. It means that
11274 # these faces must have references to one C++ surface object (handle).
11275 # @param theShape The compound or single solid that contains faces
11276 # to perform union.
11277 # @param theName Object name; when specified, this parameter is used
11278 # for result publication in the study. Otherwise, if automatic
11279 # publication is switched on, default value is used for result name.
11281 # @return Improved shape.
11283 # @ref swig_UnionFaces "Example"
11284 def UnionFaces(self, theShape, theName=None):
11286 Performs union faces of theShape.
11287 Unite faces sharing one surface. It means that
11288 these faces must have references to one C++ surface object (handle).
11291 theShape The compound or single solid that contains faces
11293 theName Object name; when specified, this parameter is used
11294 for result publication in the study. Otherwise, if automatic
11295 publication is switched on, default value is used for result name.
11300 # Example: see GEOM_TestOthers.py
11301 anObj = self.BlocksOp.UnionFaces(theShape)
11302 RaiseIfFailed("UnionFaces", self.BlocksOp)
11303 self._autoPublish(anObj, theName, "unionFaces")
11306 ## Check, if the given shape is a blocks compound.
11307 # Fix all detected errors.
11308 # \note Single block can be also fixed by this method.
11309 # @param theShape The compound to check and improve.
11310 # @param theName Object name; when specified, this parameter is used
11311 # for result publication in the study. Otherwise, if automatic
11312 # publication is switched on, default value is used for result name.
11314 # @return Improved compound.
11316 # @ref swig_CheckAndImprove "Example"
11317 def CheckAndImprove(self, theShape, theName=None):
11319 Check, if the given shape is a blocks compound.
11320 Fix all detected errors.
11323 Single block can be also fixed by this method.
11326 theShape The compound to check and improve.
11327 theName Object name; when specified, this parameter is used
11328 for result publication in the study. Otherwise, if automatic
11329 publication is switched on, default value is used for result name.
11334 # Example: see GEOM_TestOthers.py
11335 anObj = self.BlocksOp.CheckAndImprove(theShape)
11336 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11337 self._autoPublish(anObj, theName, "improved")
11340 # end of l4_blocks_measure
11343 ## @addtogroup l3_blocks_op
11346 ## Get all the blocks, contained in the given compound.
11347 # @param theCompound The compound to explode.
11348 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11349 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11350 # @param theName Object name; when specified, this parameter is used
11351 # for result publication in the study. Otherwise, if automatic
11352 # publication is switched on, default value is used for result name.
11354 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11356 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11358 # @ref tui_explode_on_blocks "Example 1"
11359 # \n @ref swig_MakeBlockExplode "Example 2"
11360 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11362 Get all the blocks, contained in the given compound.
11365 theCompound The compound to explode.
11366 theMinNbFaces If solid has lower number of faces, it is not a block.
11367 theMaxNbFaces If solid has higher number of faces, it is not a block.
11368 theName Object name; when specified, this parameter is used
11369 for result publication in the study. Otherwise, if automatic
11370 publication is switched on, default value is used for result name.
11373 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11376 List of GEOM.GEOM_Object, containing the retrieved blocks.
11378 # Example: see GEOM_TestOthers.py
11379 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11380 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11381 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11382 for anObj in aList:
11383 anObj.SetParameters(Parameters)
11385 self._autoPublish(aList, theName, "block")
11388 ## Find block, containing the given point inside its volume or on boundary.
11389 # @param theCompound Compound, to find block in.
11390 # @param thePoint Point, close to the desired block. If the point lays on
11391 # boundary between some blocks, we return block with nearest center.
11392 # @param theName Object name; when specified, this parameter is used
11393 # for result publication in the study. Otherwise, if automatic
11394 # publication is switched on, default value is used for result name.
11396 # @return New GEOM.GEOM_Object, containing the found block.
11398 # @ref swig_todo "Example"
11399 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11401 Find block, containing the given point inside its volume or on boundary.
11404 theCompound Compound, to find block in.
11405 thePoint Point, close to the desired block. If the point lays on
11406 boundary between some blocks, we return block with nearest center.
11407 theName Object name; when specified, this parameter is used
11408 for result publication in the study. Otherwise, if automatic
11409 publication is switched on, default value is used for result name.
11412 New GEOM.GEOM_Object, containing the found block.
11414 # Example: see GEOM_Spanner.py
11415 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11416 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11417 self._autoPublish(anObj, theName, "block")
11420 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11421 # @param theCompound Compound, to find block in.
11422 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11423 # @param theName Object name; when specified, this parameter is used
11424 # for result publication in the study. Otherwise, if automatic
11425 # publication is switched on, default value is used for result name.
11427 # @return New GEOM.GEOM_Object, containing the found block.
11429 # @ref swig_GetBlockByParts "Example"
11430 def GetBlockByParts(self, theCompound, theParts, theName=None):
11432 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11435 theCompound Compound, to find block in.
11436 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11437 theName Object name; when specified, this parameter is used
11438 for result publication in the study. Otherwise, if automatic
11439 publication is switched on, default value is used for result name.
11442 New GEOM_Object, containing the found block.
11444 # Example: see GEOM_TestOthers.py
11445 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11446 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11447 self._autoPublish(anObj, theName, "block")
11450 ## Return all blocks, containing all the elements, passed as the parts.
11451 # @param theCompound Compound, to find blocks in.
11452 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11453 # @param theName Object name; when specified, this parameter is used
11454 # for result publication in the study. Otherwise, if automatic
11455 # publication is switched on, default value is used for result name.
11457 # @return List of GEOM.GEOM_Object, containing the found blocks.
11459 # @ref swig_todo "Example"
11460 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11462 Return all blocks, containing all the elements, passed as the parts.
11465 theCompound Compound, to find blocks in.
11466 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11467 theName Object name; when specified, this parameter is used
11468 for result publication in the study. Otherwise, if automatic
11469 publication is switched on, default value is used for result name.
11472 List of GEOM.GEOM_Object, containing the found blocks.
11474 # Example: see GEOM_Spanner.py
11475 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11476 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11477 self._autoPublish(aList, theName, "block")
11480 ## Multi-transformate block and glue the result.
11481 # Transformation is defined so, as to superpose direction faces.
11482 # @param Block Hexahedral solid to be multi-transformed.
11483 # @param DirFace1 ID of First direction face.
11484 # @param DirFace2 ID of Second direction face.
11485 # @param NbTimes Quantity of transformations to be done.
11486 # @param theName Object name; when specified, this parameter is used
11487 # for result publication in the study. Otherwise, if automatic
11488 # publication is switched on, default value is used for result name.
11490 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11492 # @return New GEOM.GEOM_Object, containing the result shape.
11494 # @ref tui_multi_transformation "Example"
11495 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11497 Multi-transformate block and glue the result.
11498 Transformation is defined so, as to superpose direction faces.
11501 Block Hexahedral solid to be multi-transformed.
11502 DirFace1 ID of First direction face.
11503 DirFace2 ID of Second direction face.
11504 NbTimes Quantity of transformations to be done.
11505 theName Object name; when specified, this parameter is used
11506 for result publication in the study. Otherwise, if automatic
11507 publication is switched on, default value is used for result name.
11510 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11513 New GEOM.GEOM_Object, containing the result shape.
11515 # Example: see GEOM_Spanner.py
11516 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11517 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11518 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11519 anObj.SetParameters(Parameters)
11520 self._autoPublish(anObj, theName, "transformed")
11523 ## Multi-transformate block and glue the result.
11524 # @param Block Hexahedral solid to be multi-transformed.
11525 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11526 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11527 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11528 # @param theName Object name; when specified, this parameter is used
11529 # for result publication in the study. Otherwise, if automatic
11530 # publication is switched on, default value is used for result name.
11532 # @return New GEOM.GEOM_Object, containing the result shape.
11534 # @ref tui_multi_transformation "Example"
11535 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11536 DirFace1V, DirFace2V, NbTimesV, theName=None):
11538 Multi-transformate block and glue the result.
11541 Block Hexahedral solid to be multi-transformed.
11542 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11543 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11544 NbTimesU,NbTimesV Quantity of transformations to be done.
11545 theName Object name; when specified, this parameter is used
11546 for result publication in the study. Otherwise, if automatic
11547 publication is switched on, default value is used for result name.
11550 New GEOM.GEOM_Object, containing the result shape.
11552 # Example: see GEOM_Spanner.py
11553 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11554 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11555 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11556 DirFace1V, DirFace2V, NbTimesV)
11557 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11558 anObj.SetParameters(Parameters)
11559 self._autoPublish(anObj, theName, "transformed")
11562 ## Build all possible propagation groups.
11563 # Propagation group is a set of all edges, opposite to one (main)
11564 # edge of this group directly or through other opposite edges.
11565 # Notion of Opposite Edge make sence only on quadrangle face.
11566 # @param theShape Shape to build propagation groups on.
11567 # @param theName Object name; when specified, this parameter is used
11568 # for result publication in the study. Otherwise, if automatic
11569 # publication is switched on, default value is used for result name.
11571 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11573 # @ref swig_Propagate "Example"
11574 def Propagate(self, theShape, theName=None):
11576 Build all possible propagation groups.
11577 Propagation group is a set of all edges, opposite to one (main)
11578 edge of this group directly or through other opposite edges.
11579 Notion of Opposite Edge make sence only on quadrangle face.
11582 theShape Shape to build propagation groups on.
11583 theName Object name; when specified, this parameter is used
11584 for result publication in the study. Otherwise, if automatic
11585 publication is switched on, default value is used for result name.
11588 List of GEOM.GEOM_Object, each of them is a propagation group.
11590 # Example: see GEOM_TestOthers.py
11591 listChains = self.BlocksOp.Propagate(theShape)
11592 RaiseIfFailed("Propagate", self.BlocksOp)
11593 self._autoPublish(listChains, theName, "propagate")
11596 # end of l3_blocks_op
11599 ## @addtogroup l3_groups
11602 ## Creates a new group which will store sub-shapes of theMainShape
11603 # @param theMainShape is a GEOM object on which the group is selected
11604 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11605 # @param theName Object name; when specified, this parameter is used
11606 # for result publication in the study. Otherwise, if automatic
11607 # publication is switched on, default value is used for result name.
11609 # @return a newly created GEOM group (GEOM.GEOM_Object)
11611 # @ref tui_working_with_groups_page "Example 1"
11612 # \n @ref swig_CreateGroup "Example 2"
11613 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11615 Creates a new group which will store sub-shapes of theMainShape
11618 theMainShape is a GEOM object on which the group is selected
11619 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11620 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11621 theName Object name; when specified, this parameter is used
11622 for result publication in the study. Otherwise, if automatic
11623 publication is switched on, default value is used for result name.
11626 a newly created GEOM group
11629 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11632 # Example: see GEOM_TestOthers.py
11633 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11634 RaiseIfFailed("CreateGroup", self.GroupOp)
11635 self._autoPublish(anObj, theName, "group")
11638 ## Adds a sub-object with ID theSubShapeId to the group
11639 # @param theGroup is a GEOM group to which the new sub-shape is added
11640 # @param theSubShapeID is a sub-shape ID in the main object.
11641 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11643 # @ref tui_working_with_groups_page "Example"
11644 def AddObject(self,theGroup, theSubShapeID):
11646 Adds a sub-object with ID theSubShapeId to the group
11649 theGroup is a GEOM group to which the new sub-shape is added
11650 theSubShapeID is a sub-shape ID in the main object.
11653 Use method GetSubShapeID() to get an unique ID of the sub-shape
11655 # Example: see GEOM_TestOthers.py
11656 self.GroupOp.AddObject(theGroup, theSubShapeID)
11657 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11658 RaiseIfFailed("AddObject", self.GroupOp)
11662 ## Removes a sub-object with ID \a theSubShapeId from the group
11663 # @param theGroup is a GEOM group from which the new sub-shape is removed
11664 # @param theSubShapeID is a sub-shape ID in the main object.
11665 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11667 # @ref tui_working_with_groups_page "Example"
11668 def RemoveObject(self,theGroup, theSubShapeID):
11670 Removes a sub-object with ID theSubShapeId from the group
11673 theGroup is a GEOM group from which the new sub-shape is removed
11674 theSubShapeID is a sub-shape ID in the main object.
11677 Use method GetSubShapeID() to get an unique ID of the sub-shape
11679 # Example: see GEOM_TestOthers.py
11680 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11681 RaiseIfFailed("RemoveObject", self.GroupOp)
11684 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11685 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11686 # @param theSubShapes is a list of sub-shapes to be added.
11688 # @ref tui_working_with_groups_page "Example"
11689 def UnionList (self,theGroup, theSubShapes):
11691 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11694 theGroup is a GEOM group to which the new sub-shapes are added.
11695 theSubShapes is a list of sub-shapes to be added.
11697 # Example: see GEOM_TestOthers.py
11698 self.GroupOp.UnionList(theGroup, theSubShapes)
11699 RaiseIfFailed("UnionList", self.GroupOp)
11702 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11703 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11704 # @param theSubShapes is a list of indices of sub-shapes to be added.
11706 # @ref swig_UnionIDs "Example"
11707 def UnionIDs(self,theGroup, theSubShapes):
11709 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11712 theGroup is a GEOM group to which the new sub-shapes are added.
11713 theSubShapes is a list of indices of sub-shapes to be added.
11715 # Example: see GEOM_TestOthers.py
11716 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11717 RaiseIfFailed("UnionIDs", self.GroupOp)
11720 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11721 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11722 # @param theSubShapes is a list of sub-shapes to be removed.
11724 # @ref tui_working_with_groups_page "Example"
11725 def DifferenceList (self,theGroup, theSubShapes):
11727 Removes from the group all the given shapes. No errors, if some shapes are not included.
11730 theGroup is a GEOM group from which the sub-shapes are removed.
11731 theSubShapes is a list of sub-shapes to be removed.
11733 # Example: see GEOM_TestOthers.py
11734 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11735 RaiseIfFailed("DifferenceList", self.GroupOp)
11738 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11739 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11740 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11742 # @ref swig_DifferenceIDs "Example"
11743 def DifferenceIDs(self,theGroup, theSubShapes):
11745 Removes from the group all the given shapes. No errors, if some shapes are not included.
11748 theGroup is a GEOM group from which the sub-shapes are removed.
11749 theSubShapes is a list of indices of sub-shapes to be removed.
11751 # Example: see GEOM_TestOthers.py
11752 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11753 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11756 ## Union of two groups.
11757 # New group is created. It will contain all entities
11758 # which are present in groups theGroup1 and theGroup2.
11759 # @param theGroup1, theGroup2 are the initial GEOM groups
11760 # to create the united group from.
11761 # @param theName Object name; when specified, this parameter is used
11762 # for result publication in the study. Otherwise, if automatic
11763 # publication is switched on, default value is used for result name.
11765 # @return a newly created GEOM group.
11767 # @ref tui_union_groups_anchor "Example"
11768 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11770 Union of two groups.
11771 New group is created. It will contain all entities
11772 which are present in groups theGroup1 and theGroup2.
11775 theGroup1, theGroup2 are the initial GEOM groups
11776 to create the united group from.
11777 theName Object name; when specified, this parameter is used
11778 for result publication in the study. Otherwise, if automatic
11779 publication is switched on, default value is used for result name.
11782 a newly created GEOM group.
11784 # Example: see GEOM_TestOthers.py
11785 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11786 RaiseIfFailed("UnionGroups", self.GroupOp)
11787 self._autoPublish(aGroup, theName, "group")
11790 ## Intersection of two groups.
11791 # New group is created. It will contain only those entities
11792 # which are present in both groups theGroup1 and theGroup2.
11793 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11794 # @param theName Object name; when specified, this parameter is used
11795 # for result publication in the study. Otherwise, if automatic
11796 # publication is switched on, default value is used for result name.
11798 # @return a newly created GEOM group.
11800 # @ref tui_intersect_groups_anchor "Example"
11801 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11803 Intersection of two groups.
11804 New group is created. It will contain only those entities
11805 which are present in both groups theGroup1 and theGroup2.
11808 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11809 theName Object name; when specified, this parameter is used
11810 for result publication in the study. Otherwise, if automatic
11811 publication is switched on, default value is used for result name.
11814 a newly created GEOM group.
11816 # Example: see GEOM_TestOthers.py
11817 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11818 RaiseIfFailed("IntersectGroups", self.GroupOp)
11819 self._autoPublish(aGroup, theName, "group")
11822 ## Cut of two groups.
11823 # New group is created. It will contain entities which are
11824 # present in group theGroup1 but are not present in group theGroup2.
11825 # @param theGroup1 is a GEOM group to include elements of.
11826 # @param theGroup2 is a GEOM group to exclude elements of.
11827 # @param theName Object name; when specified, this parameter is used
11828 # for result publication in the study. Otherwise, if automatic
11829 # publication is switched on, default value is used for result name.
11831 # @return a newly created GEOM group.
11833 # @ref tui_cut_groups_anchor "Example"
11834 def CutGroups (self, theGroup1, theGroup2, theName=None):
11837 New group is created. It will contain entities which are
11838 present in group theGroup1 but are not present in group theGroup2.
11841 theGroup1 is a GEOM group to include elements of.
11842 theGroup2 is a GEOM group to exclude elements of.
11843 theName Object name; when specified, this parameter is used
11844 for result publication in the study. Otherwise, if automatic
11845 publication is switched on, default value is used for result name.
11848 a newly created GEOM group.
11850 # Example: see GEOM_TestOthers.py
11851 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11852 RaiseIfFailed("CutGroups", self.GroupOp)
11853 self._autoPublish(aGroup, theName, "group")
11856 ## Union of list of groups.
11857 # New group is created. It will contain all entities that are
11858 # present in groups listed in theGList.
11859 # @param theGList is a list of GEOM groups to create the united group from.
11860 # @param theName Object name; when specified, this parameter is used
11861 # for result publication in the study. Otherwise, if automatic
11862 # publication is switched on, default value is used for result name.
11864 # @return a newly created GEOM group.
11866 # @ref tui_union_groups_anchor "Example"
11867 def UnionListOfGroups (self, theGList, theName=None):
11869 Union of list of groups.
11870 New group is created. It will contain all entities that are
11871 present in groups listed in theGList.
11874 theGList is a list of GEOM groups to create the united group from.
11875 theName Object name; when specified, this parameter is used
11876 for result publication in the study. Otherwise, if automatic
11877 publication is switched on, default value is used for result name.
11880 a newly created GEOM group.
11882 # Example: see GEOM_TestOthers.py
11883 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11884 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11885 self._autoPublish(aGroup, theName, "group")
11888 ## Cut of lists of groups.
11889 # New group is created. It will contain only entities
11890 # which are present in groups listed in theGList.
11891 # @param theGList is a list of GEOM groups to include elements of.
11892 # @param theName Object name; when specified, this parameter is used
11893 # for result publication in the study. Otherwise, if automatic
11894 # publication is switched on, default value is used for result name.
11896 # @return a newly created GEOM group.
11898 # @ref tui_intersect_groups_anchor "Example"
11899 def IntersectListOfGroups (self, theGList, theName=None):
11901 Cut of lists of groups.
11902 New group is created. It will contain only entities
11903 which are present in groups listed in theGList.
11906 theGList is a list of GEOM groups to include elements of.
11907 theName Object name; when specified, this parameter is used
11908 for result publication in the study. Otherwise, if automatic
11909 publication is switched on, default value is used for result name.
11912 a newly created GEOM group.
11914 # Example: see GEOM_TestOthers.py
11915 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11916 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11917 self._autoPublish(aGroup, theName, "group")
11920 ## Cut of lists of groups.
11921 # New group is created. It will contain only entities
11922 # which are present in groups listed in theGList1 but
11923 # are not present in groups from theGList2.
11924 # @param theGList1 is a list of GEOM groups to include elements of.
11925 # @param theGList2 is a list of GEOM groups to exclude elements of.
11926 # @param theName Object name; when specified, this parameter is used
11927 # for result publication in the study. Otherwise, if automatic
11928 # publication is switched on, default value is used for result name.
11930 # @return a newly created GEOM group.
11932 # @ref tui_cut_groups_anchor "Example"
11933 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11935 Cut of lists of groups.
11936 New group is created. It will contain only entities
11937 which are present in groups listed in theGList1 but
11938 are not present in groups from theGList2.
11941 theGList1 is a list of GEOM groups to include elements of.
11942 theGList2 is a list of GEOM groups to exclude elements of.
11943 theName Object name; when specified, this parameter is used
11944 for result publication in the study. Otherwise, if automatic
11945 publication is switched on, default value is used for result name.
11948 a newly created GEOM group.
11950 # Example: see GEOM_TestOthers.py
11951 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11952 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11953 self._autoPublish(aGroup, theName, "group")
11956 ## Returns a list of sub-objects ID stored in the group
11957 # @param theGroup is a GEOM group for which a list of IDs is requested
11959 # @ref swig_GetObjectIDs "Example"
11960 def GetObjectIDs(self,theGroup):
11962 Returns a list of sub-objects ID stored in the group
11965 theGroup is a GEOM group for which a list of IDs is requested
11967 # Example: see GEOM_TestOthers.py
11968 ListIDs = self.GroupOp.GetObjects(theGroup)
11969 RaiseIfFailed("GetObjects", self.GroupOp)
11972 ## Returns a type of sub-objects stored in the group
11973 # @param theGroup is a GEOM group which type is returned.
11975 # @ref swig_GetType "Example"
11976 def GetType(self,theGroup):
11978 Returns a type of sub-objects stored in the group
11981 theGroup is a GEOM group which type is returned.
11983 # Example: see GEOM_TestOthers.py
11984 aType = self.GroupOp.GetType(theGroup)
11985 RaiseIfFailed("GetType", self.GroupOp)
11988 ## Convert a type of geom object from id to string value
11989 # @param theId is a GEOM obect type id.
11990 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11991 # @ref swig_GetType "Example"
11992 def ShapeIdToType(self, theId):
11994 Convert a type of geom object from id to string value
11997 theId is a GEOM obect type id.
12000 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12027 return "REVOLUTION"
12075 return "FREE_BOUNDS"
12083 return "THRUSECTIONS"
12085 return "COMPOUNDFILTER"
12087 return "SHAPES_ON_SHAPE"
12089 return "ELLIPSE_ARC"
12091 return "3DSKETCHER"
12097 return "PIPETSHAPE"
12098 return "Shape Id not exist."
12100 ## Returns a main shape associated with the group
12101 # @param theGroup is a GEOM group for which a main shape object is requested
12102 # @return a GEOM object which is a main shape for theGroup
12104 # @ref swig_GetMainShape "Example"
12105 def GetMainShape(self,theGroup):
12107 Returns a main shape associated with the group
12110 theGroup is a GEOM group for which a main shape object is requested
12113 a GEOM object which is a main shape for theGroup
12115 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12117 # Example: see GEOM_TestOthers.py
12118 anObj = self.GroupOp.GetMainShape(theGroup)
12119 RaiseIfFailed("GetMainShape", self.GroupOp)
12122 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12123 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12124 # @param theShape given shape (see GEOM.GEOM_Object)
12125 # @param min_length minimum length of edges of theShape
12126 # @param max_length maximum length of edges of theShape
12127 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12128 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12129 # @param theName Object name; when specified, this parameter is used
12130 # for result publication in the study. Otherwise, if automatic
12131 # publication is switched on, default value is used for result name.
12133 # @return a newly created GEOM group of edges
12135 # @@ref swig_todo "Example"
12136 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12138 Create group of edges of theShape, whose length is in range [min_length, max_length].
12139 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12142 theShape given shape
12143 min_length minimum length of edges of theShape
12144 max_length maximum length of edges of theShape
12145 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12146 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12147 theName Object name; when specified, this parameter is used
12148 for result publication in the study. Otherwise, if automatic
12149 publication is switched on, default value is used for result name.
12152 a newly created GEOM group of edges.
12154 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12155 edges_in_range = []
12157 Props = self.BasicProperties(edge)
12158 if min_length <= Props[0] and Props[0] <= max_length:
12159 if (not include_min) and (min_length == Props[0]):
12162 if (not include_max) and (Props[0] == max_length):
12165 edges_in_range.append(edge)
12167 if len(edges_in_range) <= 0:
12168 print "No edges found by given criteria"
12171 # note: auto-publishing is done in self.CreateGroup()
12172 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12173 self.UnionList(group_edges, edges_in_range)
12177 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12178 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12179 # @param min_length minimum length of edges of selected shape
12180 # @param max_length maximum length of edges of selected shape
12181 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12182 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12183 # @return a newly created GEOM group of edges
12184 # @ref swig_todo "Example"
12185 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12187 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12188 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12191 min_length minimum length of edges of selected shape
12192 max_length maximum length of edges of selected shape
12193 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12194 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12197 a newly created GEOM group of edges.
12199 nb_selected = sg.SelectedCount()
12200 if nb_selected < 1:
12201 print "Select a shape before calling this function, please."
12203 if nb_selected > 1:
12204 print "Only one shape must be selected"
12207 id_shape = sg.getSelected(0)
12208 shape = IDToObject( id_shape )
12210 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12214 if include_min: left_str = " <= "
12215 if include_max: right_str = " <= "
12217 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12218 + left_str + "length" + right_str + `max_length`)
12220 sg.updateObjBrowser(1)
12227 ## @addtogroup l4_advanced
12230 ## Create a T-shape object with specified caracteristics for the main
12231 # and the incident pipes (radius, width, half-length).
12232 # The extremities of the main pipe are located on junctions points P1 and P2.
12233 # The extremity of the incident pipe is located on junction point P3.
12234 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12235 # the main plane of the T-shape is XOY.
12237 # @param theR1 Internal radius of main pipe
12238 # @param theW1 Width of main pipe
12239 # @param theL1 Half-length of main pipe
12240 # @param theR2 Internal radius of incident pipe (R2 < R1)
12241 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12242 # @param theL2 Half-length of incident pipe
12244 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12245 # @param theP1 1st junction point of main pipe
12246 # @param theP2 2nd junction point of main pipe
12247 # @param theP3 Junction point of incident pipe
12249 # @param theRL Internal radius of left thickness reduction
12250 # @param theWL Width of left thickness reduction
12251 # @param theLtransL Length of left transition part
12252 # @param theLthinL Length of left thin part
12254 # @param theRR Internal radius of right thickness reduction
12255 # @param theWR Width of right thickness reduction
12256 # @param theLtransR Length of right transition part
12257 # @param theLthinR Length of right thin part
12259 # @param theRI Internal radius of incident thickness reduction
12260 # @param theWI Width of incident thickness reduction
12261 # @param theLtransI Length of incident transition part
12262 # @param theLthinI Length of incident thin part
12264 # @param theName Object name; when specified, this parameter is used
12265 # for result publication in the study. Otherwise, if automatic
12266 # publication is switched on, default value is used for result name.
12268 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12270 # @ref tui_creation_pipetshape "Example"
12271 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12272 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12273 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12274 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12275 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12278 Create a T-shape object with specified caracteristics for the main
12279 and the incident pipes (radius, width, half-length).
12280 The extremities of the main pipe are located on junctions points P1 and P2.
12281 The extremity of the incident pipe is located on junction point P3.
12282 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12283 the main plane of the T-shape is XOY.
12286 theR1 Internal radius of main pipe
12287 theW1 Width of main pipe
12288 theL1 Half-length of main pipe
12289 theR2 Internal radius of incident pipe (R2 < R1)
12290 theW2 Width of incident pipe (R2+W2 < R1+W1)
12291 theL2 Half-length of incident pipe
12292 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12293 theP1 1st junction point of main pipe
12294 theP2 2nd junction point of main pipe
12295 theP3 Junction point of incident pipe
12297 theRL Internal radius of left thickness reduction
12298 theWL Width of left thickness reduction
12299 theLtransL Length of left transition part
12300 theLthinL Length of left thin part
12302 theRR Internal radius of right thickness reduction
12303 theWR Width of right thickness reduction
12304 theLtransR Length of right transition part
12305 theLthinR Length of right thin part
12307 theRI Internal radius of incident thickness reduction
12308 theWI Width of incident thickness reduction
12309 theLtransI Length of incident transition part
12310 theLthinI Length of incident thin part
12312 theName Object name; when specified, this parameter is used
12313 for result publication in the study. Otherwise, if automatic
12314 publication is switched on, default value is used for result name.
12317 List of GEOM_Object, containing the created shape and propagation groups.
12320 # create PipeTShape object
12321 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12322 # create PipeTShape object with position
12323 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12324 # create PipeTShape object with left thickness reduction
12325 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12327 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)
12328 if (theP1 and theP2 and theP3):
12329 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12330 theRL, theWL, theLtransL, theLthinL,
12331 theRR, theWR, theLtransR, theLthinR,
12332 theRI, theWI, theLtransI, theLthinI,
12333 theHexMesh, theP1, theP2, theP3)
12335 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12336 theRL, theWL, theLtransL, theLthinL,
12337 theRR, theWR, theLtransR, theLthinR,
12338 theRI, theWI, theLtransI, theLthinI,
12340 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12341 if Parameters: anObj[0].SetParameters(Parameters)
12342 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12343 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12346 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12347 # and the incident pipes (radius, width, half-length). The chamfer is
12348 # created on the junction of the pipes.
12349 # The extremities of the main pipe are located on junctions points P1 and P2.
12350 # The extremity of the incident pipe is located on junction point P3.
12351 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12352 # the main plane of the T-shape is XOY.
12353 # @param theR1 Internal radius of main pipe
12354 # @param theW1 Width of main pipe
12355 # @param theL1 Half-length of main pipe
12356 # @param theR2 Internal radius of incident pipe (R2 < R1)
12357 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12358 # @param theL2 Half-length of incident pipe
12359 # @param theH Height of the chamfer.
12360 # @param theW Width of the chamfer.
12361 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12362 # @param theP1 1st junction point of main pipe
12363 # @param theP2 2nd junction point of main pipe
12364 # @param theP3 Junction point of incident pipe
12366 # @param theRL Internal radius of left thickness reduction
12367 # @param theWL Width of left thickness reduction
12368 # @param theLtransL Length of left transition part
12369 # @param theLthinL Length of left thin part
12371 # @param theRR Internal radius of right thickness reduction
12372 # @param theWR Width of right thickness reduction
12373 # @param theLtransR Length of right transition part
12374 # @param theLthinR Length of right thin part
12376 # @param theRI Internal radius of incident thickness reduction
12377 # @param theWI Width of incident thickness reduction
12378 # @param theLtransI Length of incident transition part
12379 # @param theLthinI Length of incident thin part
12381 # @param theName Object name; when specified, this parameter is used
12382 # for result publication in the study. Otherwise, if automatic
12383 # publication is switched on, default value is used for result name.
12385 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12387 # @ref tui_creation_pipetshape "Example"
12388 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12389 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12390 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12391 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12392 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12395 Create a T-shape object with chamfer and with specified caracteristics for the main
12396 and the incident pipes (radius, width, half-length). The chamfer is
12397 created on the junction of the pipes.
12398 The extremities of the main pipe are located on junctions points P1 and P2.
12399 The extremity of the incident pipe is located on junction point P3.
12400 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12401 the main plane of the T-shape is XOY.
12404 theR1 Internal radius of main pipe
12405 theW1 Width of main pipe
12406 theL1 Half-length of main pipe
12407 theR2 Internal radius of incident pipe (R2 < R1)
12408 theW2 Width of incident pipe (R2+W2 < R1+W1)
12409 theL2 Half-length of incident pipe
12410 theH Height of the chamfer.
12411 theW Width of the chamfer.
12412 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12413 theP1 1st junction point of main pipe
12414 theP2 2nd junction point of main pipe
12415 theP3 Junction point of incident pipe
12417 theRL Internal radius of left thickness reduction
12418 theWL Width of left thickness reduction
12419 theLtransL Length of left transition part
12420 theLthinL Length of left thin part
12422 theRR Internal radius of right thickness reduction
12423 theWR Width of right thickness reduction
12424 theLtransR Length of right transition part
12425 theLthinR Length of right thin part
12427 theRI Internal radius of incident thickness reduction
12428 theWI Width of incident thickness reduction
12429 theLtransI Length of incident transition part
12430 theLthinI Length of incident thin part
12432 theName Object name; when specified, this parameter is used
12433 for result publication in the study. Otherwise, if automatic
12434 publication is switched on, default value is used for result name.
12437 List of GEOM_Object, containing the created shape and propagation groups.
12440 # create PipeTShape with chamfer object
12441 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12442 # create PipeTShape with chamfer object with position
12443 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12444 # create PipeTShape with chamfer object with left thickness reduction
12445 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)
12447 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)
12448 if (theP1 and theP2 and theP3):
12449 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12450 theRL, theWL, theLtransL, theLthinL,
12451 theRR, theWR, theLtransR, theLthinR,
12452 theRI, theWI, theLtransI, theLthinI,
12453 theH, theW, theHexMesh, theP1, theP2, theP3)
12455 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12456 theRL, theWL, theLtransL, theLthinL,
12457 theRR, theWR, theLtransR, theLthinR,
12458 theRI, theWI, theLtransI, theLthinI,
12459 theH, theW, theHexMesh)
12460 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12461 if Parameters: anObj[0].SetParameters(Parameters)
12462 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12463 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12466 ## Create a T-shape object with fillet and with specified caracteristics for the main
12467 # and the incident pipes (radius, width, half-length). The fillet is
12468 # created on the junction of the pipes.
12469 # The extremities of the main pipe are located on junctions points P1 and P2.
12470 # The extremity of the incident pipe is located on junction point P3.
12471 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12472 # the main plane of the T-shape is XOY.
12473 # @param theR1 Internal radius of main pipe
12474 # @param theW1 Width of main pipe
12475 # @param theL1 Half-length of main pipe
12476 # @param theR2 Internal radius of incident pipe (R2 < R1)
12477 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12478 # @param theL2 Half-length of incident pipe
12479 # @param theRF Radius of curvature of fillet.
12480 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12481 # @param theP1 1st junction point of main pipe
12482 # @param theP2 2nd junction point of main pipe
12483 # @param theP3 Junction point of incident pipe
12485 # @param theRL Internal radius of left thickness reduction
12486 # @param theWL Width of left thickness reduction
12487 # @param theLtransL Length of left transition part
12488 # @param theLthinL Length of left thin part
12490 # @param theRR Internal radius of right thickness reduction
12491 # @param theWR Width of right thickness reduction
12492 # @param theLtransR Length of right transition part
12493 # @param theLthinR Length of right thin part
12495 # @param theRI Internal radius of incident thickness reduction
12496 # @param theWI Width of incident thickness reduction
12497 # @param theLtransI Length of incident transition part
12498 # @param theLthinI Length of incident thin part
12500 # @param theName Object name; when specified, this parameter is used
12501 # for result publication in the study. Otherwise, if automatic
12502 # publication is switched on, default value is used for result name.
12504 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12506 # @ref tui_creation_pipetshape "Example"
12507 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12508 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12509 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12510 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12511 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12514 Create a T-shape object with fillet and with specified caracteristics for the main
12515 and the incident pipes (radius, width, half-length). The fillet is
12516 created on the junction of the pipes.
12517 The extremities of the main pipe are located on junctions points P1 and P2.
12518 The extremity of the incident pipe is located on junction point P3.
12521 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12522 the main plane of the T-shape is XOY.
12523 theR1 Internal radius of main pipe
12524 theW1 Width of main pipe
12525 heL1 Half-length of main pipe
12526 theR2 Internal radius of incident pipe (R2 < R1)
12527 theW2 Width of incident pipe (R2+W2 < R1+W1)
12528 theL2 Half-length of incident pipe
12529 theRF Radius of curvature of fillet.
12530 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12531 theP1 1st junction point of main pipe
12532 theP2 2nd junction point of main pipe
12533 theP3 Junction point of incident pipe
12535 theRL Internal radius of left thickness reduction
12536 theWL Width of left thickness reduction
12537 theLtransL Length of left transition part
12538 theLthinL Length of left thin part
12540 theRR Internal radius of right thickness reduction
12541 theWR Width of right thickness reduction
12542 theLtransR Length of right transition part
12543 theLthinR Length of right thin part
12545 theRI Internal radius of incident thickness reduction
12546 theWI Width of incident thickness reduction
12547 theLtransI Length of incident transition part
12548 theLthinI Length of incident thin part
12550 theName Object name; when specified, this parameter is used
12551 for result publication in the study. Otherwise, if automatic
12552 publication is switched on, default value is used for result name.
12555 List of GEOM_Object, containing the created shape and propagation groups.
12558 # create PipeTShape with fillet object
12559 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12560 # create PipeTShape with fillet object with position
12561 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12562 # create PipeTShape with fillet object with left thickness reduction
12563 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)
12565 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)
12566 if (theP1 and theP2 and theP3):
12567 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12568 theRL, theWL, theLtransL, theLthinL,
12569 theRR, theWR, theLtransR, theLthinR,
12570 theRI, theWI, theLtransI, theLthinI,
12571 theRF, theHexMesh, theP1, theP2, theP3)
12573 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12574 theRL, theWL, theLtransL, theLthinL,
12575 theRR, theWR, theLtransR, theLthinR,
12576 theRI, theWI, theLtransI, theLthinI,
12578 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12579 if Parameters: anObj[0].SetParameters(Parameters)
12580 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12581 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12584 ## This function allows creating a disk already divided into blocks. It
12585 # can be used to create divided pipes for later meshing in hexaedra.
12586 # @param theR Radius of the disk
12587 # @param theOrientation Orientation of the plane on which the disk will be built
12588 # 1 = XOY, 2 = OYZ, 3 = OZX
12589 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12590 # @param theName Object name; when specified, this parameter is used
12591 # for result publication in the study. Otherwise, if automatic
12592 # publication is switched on, default value is used for result name.
12594 # @return New GEOM_Object, containing the created shape.
12596 # @ref tui_creation_divideddisk "Example"
12597 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12599 Creates a disk, divided into blocks. It can be used to create divided pipes
12600 for later meshing in hexaedra.
12603 theR Radius of the disk
12604 theOrientation Orientation of the plane on which the disk will be built:
12605 1 = XOY, 2 = OYZ, 3 = OZX
12606 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12607 theName Object name; when specified, this parameter is used
12608 for result publication in the study. Otherwise, if automatic
12609 publication is switched on, default value is used for result name.
12612 New GEOM_Object, containing the created shape.
12614 theR, Parameters = ParseParameters(theR)
12615 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12616 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12617 if Parameters: anObj.SetParameters(Parameters)
12618 self._autoPublish(anObj, theName, "dividedDisk")
12621 ## This function allows creating a disk already divided into blocks. It
12622 # can be used to create divided pipes for later meshing in hexaedra.
12623 # @param theCenter Center of the disk
12624 # @param theVector Normal vector to the plane of the created disk
12625 # @param theRadius Radius of the disk
12626 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12627 # @param theName Object name; when specified, this parameter is used
12628 # for result publication in the study. Otherwise, if automatic
12629 # publication is switched on, default value is used for result name.
12631 # @return New GEOM_Object, containing the created shape.
12633 # @ref tui_creation_divideddisk "Example"
12634 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12636 Creates a disk already divided into blocks. It can be used to create divided pipes
12637 for later meshing in hexaedra.
12640 theCenter Center of the disk
12641 theVector Normal vector to the plane of the created disk
12642 theRadius Radius of the disk
12643 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12644 theName Object name; when specified, this parameter is used
12645 for result publication in the study. Otherwise, if automatic
12646 publication is switched on, default value is used for result name.
12649 New GEOM_Object, containing the created shape.
12651 theRadius, Parameters = ParseParameters(theRadius)
12652 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12653 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12654 if Parameters: anObj.SetParameters(Parameters)
12655 self._autoPublish(anObj, theName, "dividedDisk")
12658 ## Builds a cylinder prepared for hexa meshes
12659 # @param theR Radius of the cylinder
12660 # @param theH Height of the cylinder
12661 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12662 # @param theName Object name; when specified, this parameter is used
12663 # for result publication in the study. Otherwise, if automatic
12664 # publication is switched on, default value is used for result name.
12666 # @return New GEOM_Object, containing the created shape.
12668 # @ref tui_creation_dividedcylinder "Example"
12669 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12671 Builds a cylinder prepared for hexa meshes
12674 theR Radius of the cylinder
12675 theH Height of the cylinder
12676 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12677 theName Object name; when specified, this parameter is used
12678 for result publication in the study. Otherwise, if automatic
12679 publication is switched on, default value is used for result name.
12682 New GEOM_Object, containing the created shape.
12684 theR, theH, Parameters = ParseParameters(theR, theH)
12685 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12686 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12687 if Parameters: anObj.SetParameters(Parameters)
12688 self._autoPublish(anObj, theName, "dividedCylinder")
12691 ## Create a surface from a cloud of points
12692 # @param thelPoints list of points. Compounds of points are
12693 # accepted as well.
12694 # @param theNbMax maximum number of Bezier pieces in the resulting
12696 # @param theDegMax maximum degree of the resulting BSpline surface.
12697 # @param theDMax specifies maximum value of the
12698 # GeomPlate_PlateG0Criterion criterion.
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.
12704 # @ref tui_creation_smoothingsurface "Example"
12705 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
12706 theDMax=0.0, theName=None):
12708 Create a surface from a cloud of points
12711 thelPoints list of points. Compounds of points are
12713 theNbMax maximum number of Bezier pieces in the resulting
12715 theDegMax maximum degree of the resulting BSpline surface.
12716 theDMax specifies maximum value of the
12717 GeomPlate_PlateG0Criterion criterion.
12718 theName Object name; when specified, this parameter is used
12719 for result publication in the study. Otherwise, if automatic
12720 publication is switched on, default value is used for result name.
12723 New GEOM_Object, containing the created shape.
12725 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
12726 theDegMax, theDMax)
12727 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12728 self._autoPublish(anObj, theName, "smoothing")
12731 ## Export a shape to XAO format
12732 # @param shape The shape to export
12733 # @param groups The list of groups to export
12734 # @param fields The list of fields to export
12735 # @param author The author of the export
12736 # @param fileName The name of the file to export
12739 # @ref tui_exportxao "Example"
12740 def ExportXAO(self, shape, groups, fields, author, fileName):
12741 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12742 RaiseIfFailed("ExportXAO", self.InsertOp)
12745 ## Import a shape from XAO format
12746 # @param shape Shape to export
12747 # @param fileName The name of the file to import
12748 # @return tuple (res, shape, subShapes, groups, fields)
12749 # res Flag indicating if the import was successful
12750 # shape The imported shape
12751 # subShapes The list of imported subShapes
12752 # groups The list of imported groups
12753 # fields The list of imported fields
12755 # @ref tui_importxao "Example"
12756 def ImportXAO(self, fileName):
12757 res = self.InsertOp.ImportXAO(fileName)
12758 RaiseIfFailed("ImportXAO", self.InsertOp)
12761 #@@ insert new functions before this line @@ do not remove this line @@#
12763 # end of l4_advanced
12766 ## Create a copy of the given object
12768 # @param theOriginal geometry object for copy
12769 # @param theName Object name; when specified, this parameter is used
12770 # for result publication in the study. Otherwise, if automatic
12771 # publication is switched on, default value is used for result name.
12773 # @return New GEOM_Object, containing the copied shape.
12775 # @ingroup l1_geomBuilder_auxiliary
12776 # @ref swig_MakeCopy "Example"
12777 def MakeCopy(self, theOriginal, theName=None):
12779 Create a copy of the given object
12782 theOriginal geometry object for copy
12783 theName Object name; when specified, this parameter is used
12784 for result publication in the study. Otherwise, if automatic
12785 publication is switched on, default value is used for result name.
12788 New GEOM_Object, containing the copied shape.
12790 Example of usage: Copy = geompy.MakeCopy(Box)
12792 # Example: see GEOM_TestAll.py
12793 anObj = self.InsertOp.MakeCopy(theOriginal)
12794 RaiseIfFailed("MakeCopy", self.InsertOp)
12795 self._autoPublish(anObj, theName, "copy")
12798 ## Add Path to load python scripts from
12799 # @param Path a path to load python scripts from
12800 # @ingroup l1_geomBuilder_auxiliary
12801 def addPath(self,Path):
12803 Add Path to load python scripts from
12806 Path a path to load python scripts from
12808 if (sys.path.count(Path) < 1):
12809 sys.path.append(Path)
12813 ## Load marker texture from the file
12814 # @param Path a path to the texture file
12815 # @return unique texture identifier
12816 # @ingroup l1_geomBuilder_auxiliary
12817 def LoadTexture(self, Path):
12819 Load marker texture from the file
12822 Path a path to the texture file
12825 unique texture identifier
12827 # Example: see GEOM_TestAll.py
12828 ID = self.InsertOp.LoadTexture(Path)
12829 RaiseIfFailed("LoadTexture", self.InsertOp)
12832 ## Get internal name of the object based on its study entry
12833 # @note This method does not provide an unique identifier of the geometry object.
12834 # @note This is internal function of GEOM component, though it can be used outside it for
12835 # appropriate reason (e.g. for identification of geometry object).
12836 # @param obj geometry object
12837 # @return unique object identifier
12838 # @ingroup l1_geomBuilder_auxiliary
12839 def getObjectID(self, obj):
12841 Get internal name of the object based on its study entry.
12842 Note: this method does not provide an unique identifier of the geometry object.
12843 It is an internal function of GEOM component, though it can be used outside GEOM for
12844 appropriate reason (e.g. for identification of geometry object).
12847 obj geometry object
12850 unique object identifier
12853 entry = salome.ObjectToID(obj)
12854 if entry is not None:
12855 lst = entry.split(":")
12857 ID = lst[-1] # -1 means last item in the list
12858 return "GEOM_" + ID
12863 ## Add marker texture. @a Width and @a Height parameters
12864 # specify width and height of the texture in pixels.
12865 # If @a RowData is @c True, @a Texture parameter should represent texture data
12866 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12867 # parameter should be unpacked string, in which '1' symbols represent opaque
12868 # pixels and '0' represent transparent pixels of the texture bitmap.
12870 # @param Width texture width in pixels
12871 # @param Height texture height in pixels
12872 # @param Texture texture data
12873 # @param RowData if @c True, @a Texture data are packed in the byte stream
12874 # @return unique texture identifier
12875 # @ingroup l1_geomBuilder_auxiliary
12876 def AddTexture(self, Width, Height, Texture, RowData=False):
12878 Add marker texture. Width and Height parameters
12879 specify width and height of the texture in pixels.
12880 If RowData is True, Texture parameter should represent texture data
12881 packed into the byte array. If RowData is False (default), Texture
12882 parameter should be unpacked string, in which '1' symbols represent opaque
12883 pixels and '0' represent transparent pixels of the texture bitmap.
12886 Width texture width in pixels
12887 Height texture height in pixels
12888 Texture texture data
12889 RowData if True, Texture data are packed in the byte stream
12892 return unique texture identifier
12894 if not RowData: Texture = PackData(Texture)
12895 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12896 RaiseIfFailed("AddTexture", self.InsertOp)
12899 ## Creates a new folder object. It is a container for any GEOM objects.
12900 # @param Name name of the container
12901 # @param Father parent object. If None,
12902 # folder under 'Geometry' root object will be created.
12903 # @return a new created folder
12904 # @ingroup l1_publish_data
12905 def NewFolder(self, Name, Father=None):
12907 Create a new folder object. It is an auxiliary container for any GEOM objects.
12910 Name name of the container
12911 Father parent object. If None,
12912 folder under 'Geometry' root object will be created.
12915 a new created folder
12917 if not Father: Father = self.father
12918 return self.CreateFolder(Name, Father)
12920 ## Move object to the specified folder
12921 # @param Object object to move
12922 # @param Folder target folder
12923 # @ingroup l1_publish_data
12924 def PutToFolder(self, Object, Folder):
12926 Move object to the specified folder
12929 Object object to move
12930 Folder target folder
12932 self.MoveToFolder(Object, Folder)
12935 ## Move list of objects to the specified folder
12936 # @param ListOfSO list of objects to move
12937 # @param Folder target folder
12938 # @ingroup l1_publish_data
12939 def PutListToFolder(self, ListOfSO, Folder):
12941 Move list of objects to the specified folder
12944 ListOfSO list of objects to move
12945 Folder target folder
12947 self.MoveListToFolder(ListOfSO, Folder)
12950 ## @addtogroup l2_field
12954 # @param shape the shape the field lies on
12955 # @param name the field name
12956 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12957 # @param dimension dimension of the shape the field lies on
12958 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12959 # @param componentNames names of components
12960 # @return a created field
12961 def CreateField(self, shape, name, type, dimension, componentNames):
12966 shape the shape the field lies on
12967 name the field name
12968 type type of field data
12969 dimension dimension of the shape the field lies on
12970 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12971 componentNames names of components
12976 if isinstance( type, int ):
12977 if type < 0 or type > 3:
12978 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12979 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12981 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12982 RaiseIfFailed("CreateField", self.FieldOp)
12984 geom._autoPublish( f, "", name)
12987 ## Removes a field from the GEOM component
12988 # @param field the field to remove
12989 def RemoveField(self, field):
12990 "Removes a field from the GEOM component"
12992 if isinstance( field, GEOM._objref_GEOM_Field ):
12993 geom.RemoveObject( field )
12994 elif isinstance( field, geomField ):
12995 geom.RemoveObject( field.field )
12997 raise RuntimeError, "RemoveField() : the object is not a field"
13000 ## Returns number of fields on a shape
13001 def CountFields(self, shape):
13002 "Returns number of fields on a shape"
13003 nb = self.FieldOp.CountFields( shape )
13004 RaiseIfFailed("CountFields", self.FieldOp)
13007 ## Returns all fields on a shape
13008 def GetFields(self, shape):
13009 "Returns all fields on a shape"
13010 ff = self.FieldOp.GetFields( shape )
13011 RaiseIfFailed("GetFields", self.FieldOp)
13014 ## Returns a field on a shape by its name
13015 def GetField(self, shape, name):
13016 "Returns a field on a shape by its name"
13017 f = self.FieldOp.GetField( shape, name )
13018 RaiseIfFailed("GetField", self.FieldOp)
13026 # Register the new proxy for GEOM_Gen
13027 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13030 ## Field on Geometry
13031 # @ingroup l2_field
13032 class geomField( GEOM._objref_GEOM_Field ):
13034 def __init__(self):
13035 GEOM._objref_GEOM_Field.__init__(self)
13036 self.field = GEOM._objref_GEOM_Field
13039 ## Returns the shape the field lies on
13040 def getShape(self):
13041 "Returns the shape the field lies on"
13042 return self.field.GetShape(self)
13044 ## Returns the field name
13046 "Returns the field name"
13047 return self.field.GetName(self)
13049 ## Returns type of field data as integer [0-3]
13051 "Returns type of field data"
13052 return self.field.GetDataType(self)._v
13054 ## Returns type of field data:
13055 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13056 def getTypeEnum(self):
13057 "Returns type of field data"
13058 return self.field.GetDataType(self)
13060 ## Returns dimension of the shape the field lies on:
13061 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13062 def getDimension(self):
13063 """Returns dimension of the shape the field lies on:
13064 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13065 return self.field.GetDimension(self)
13067 ## Returns names of components
13068 def getComponents(self):
13069 "Returns names of components"
13070 return self.field.GetComponents(self)
13072 ## Adds a time step to the field
13073 # @param step the time step number futher used as the step identifier
13074 # @param stamp the time step time
13075 # @param values the values of the time step
13076 def addStep(self, step, stamp, values):
13077 "Adds a time step to the field"
13078 stp = self.field.AddStep( self, step, stamp )
13080 raise RuntimeError, \
13081 "Field.addStep() : Error: step %s already exists in this field"%step
13083 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13084 self.setValues( step, values )
13087 ## Remove a time step from the field
13088 def removeStep(self,step):
13089 "Remove a time step from the field"
13092 stepObj = self.field.GetStep( self, step )
13094 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13097 #traceback.print_exc()
13099 self.field.RemoveStep( self, step )
13101 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13104 ## Returns number of time steps in the field
13105 def countSteps(self):
13106 "Returns number of time steps in the field"
13107 return self.field.CountSteps(self)
13109 ## Returns a list of time step IDs in the field
13110 def getSteps(self):
13111 "Returns a list of time step IDs in the field"
13112 return self.field.GetSteps(self)
13114 ## Returns a time step by its ID
13115 def getStep(self,step):
13116 "Returns a time step by its ID"
13117 stp = self.field.GetStep(self, step)
13119 raise RuntimeError, "Step %s is missing from this field"%step
13122 ## Returns the time of the field step
13123 def getStamp(self,step):
13124 "Returns the time of the field step"
13125 return self.getStep(step).GetStamp()
13127 ## Changes the time of the field step
13128 def setStamp(self, step, stamp):
13129 "Changes the time of the field step"
13130 return self.getStep(step).SetStamp(stamp)
13132 ## Returns values of the field step
13133 def getValues(self, step):
13134 "Returns values of the field step"
13135 return self.getStep(step).GetValues()
13137 ## Changes values of the field step
13138 def setValues(self, step, values):
13139 "Changes values of the field step"
13140 stp = self.getStep(step)
13141 errBeg = "Field.setValues(values) : Error: "
13143 ok = stp.SetValues( values )
13144 except Exception, e:
13146 if excStr.find("WrongPythonType") > 0:
13147 raise RuntimeError, errBeg +\
13148 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13149 raise RuntimeError, errBeg + str(e)
13151 nbOK = self.field.GetArraySize(self)
13154 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13156 raise RuntimeError, errBeg + "failed"
13159 pass # end of class geomField
13161 # Register the new proxy for GEOM_Field
13162 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13165 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13166 # interface to GEOM operations.
13171 # salome.salome_init()
13172 # from salome.geom import geomBuilder
13173 # geompy = geomBuilder.New(salome.myStudy)
13175 # @param study SALOME study, generally obtained by salome.myStudy.
13176 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13177 # @return geomBuilder instance
13178 def New( study, instance=None):
13180 Create a new geomBuilder instance.The geomBuilder class provides the Python
13181 interface to GEOM operations.
13185 salome.salome_init()
13186 from salome.geom import geomBuilder
13187 geompy = geomBuilder.New(salome.myStudy)
13190 study SALOME study, generally obtained by salome.myStudy.
13191 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13193 geomBuilder instance
13195 #print "New geomBuilder ", study, instance
13202 geom = geomBuilder()
13203 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13204 geom.init_geom(study)