1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013 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.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup l1_publish_data Publishing results in SALOME study
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Not that 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.
150 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
152 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
154 ## @defgroup l2_import_export Importing/exporting geometrical objects
155 ## @defgroup l2_creating Creating geometrical objects
157 ## @defgroup l3_basic_go Creating Basic Geometric Objects
159 ## @defgroup l4_curves Creating Curves
162 ## @defgroup l3_3d_primitives Creating 3D Primitives
163 ## @defgroup l3_complex Creating Complex Objects
164 ## @defgroup l3_groups Working with groups
165 ## @defgroup l3_blocks Building by blocks
167 ## @defgroup l4_blocks_measure Check and Improve
170 ## @defgroup l3_sketcher Sketcher
171 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
173 ## @defgroup l4_decompose Decompose objects
174 ## @defgroup l4_decompose_d Decompose objects deprecated methods
175 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
176 ## @defgroup l4_obtain Access to sub-shapes by a criteria
177 ## @defgroup l4_advanced Advanced objects creation functions
182 ## @defgroup l2_transforming Transforming geometrical objects
184 ## @defgroup l3_basic_op Basic Operations
185 ## @defgroup l3_boolean Boolean Operations
186 ## @defgroup l3_transform Transformation Operations
187 ## @defgroup l3_transform_d Transformation Operations deprecated methods
188 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
189 ## @defgroup l3_blocks_op Blocks Operations
190 ## @defgroup l3_healing Repairing Operations
191 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
194 ## @defgroup l2_measure Using measurement tools
195 ## @defgroup l2_field Field on Geometry
199 # initialize SALOME session in try/except block
200 # to avoid problems in some cases, e.g. when generating documentation
208 from salome_notebook import *
214 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
217 def _toListOfNames(_names, _size=-1):
220 if type(_names) in [types.ListType, types.TupleType]:
221 for i in _names: l.append(i)
224 if l and len(l) < _size:
225 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
228 ## Raise an Error, containing the Method_name, if Operation is Failed
229 ## @ingroup l1_geomBuilder_auxiliary
230 def RaiseIfFailed (Method_name, Operation):
231 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
232 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
234 ## Return list of variables value from salome notebook
235 ## @ingroup l1_geomBuilder_auxiliary
236 def ParseParameters(*parameters):
239 for parameter in parameters:
240 if isinstance(parameter, list):
241 lResults = ParseParameters(*parameter)
242 if len(lResults) > 0:
243 Result.append(lResults[:-1])
244 StringResult += lResults[-1].split(":")
248 if isinstance(parameter,str):
249 if notebook.isVariable(parameter):
250 Result.append(notebook.get(parameter))
252 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
255 Result.append(parameter)
257 StringResult.append(str(parameter))
261 Result.append(":".join(StringResult))
263 Result = ":".join(StringResult)
266 ## Return list of variables value from salome notebook
267 ## @ingroup l1_geomBuilder_auxiliary
271 for parameter in list:
272 if isinstance(parameter,str) and notebook.isVariable(parameter):
273 Result.append(str(notebook.get(parameter)))
276 Result.append(str(parameter))
279 StringResult = StringResult + str(parameter)
280 StringResult = StringResult + ":"
282 StringResult = StringResult[:len(StringResult)-1]
283 return Result, StringResult
285 ## Return list of variables value from salome notebook
286 ## @ingroup l1_geomBuilder_auxiliary
287 def ParseSketcherCommand(command):
290 sections = command.split(":")
291 for section in sections:
292 parameters = section.split(" ")
294 for parameter in parameters:
295 if paramIndex > 1 and parameter.find("'") != -1:
296 parameter = parameter.replace("'","")
297 if notebook.isVariable(parameter):
298 Result = Result + str(notebook.get(parameter)) + " "
301 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
305 Result = Result + str(parameter) + " "
308 StringResult = StringResult + parameter
309 StringResult = StringResult + ":"
311 paramIndex = paramIndex + 1
313 Result = Result[:len(Result)-1] + ":"
315 Result = Result[:len(Result)-1]
316 return Result, StringResult
318 ## Helper function which can be used to pack the passed string to the byte data.
319 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
320 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
323 ## val = PackData("10001110") # val = 0xAE
324 ## val = PackData("1") # val = 0x80
326 ## @param data unpacked data - a string containing '1' and '0' symbols
327 ## @return data packed to the byte stream
328 ## @ingroup l1_geomBuilder_auxiliary
331 Helper function which can be used to pack the passed string to the byte data.
332 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
333 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
336 data unpacked data - a string containing '1' and '0' symbols
339 data packed to the byte stream
342 val = PackData("10001110") # val = 0xAE
343 val = PackData("1") # val = 0x80
346 if len(data)%8: bytes += 1
348 for b in range(bytes):
349 d = data[b*8:(b+1)*8]
354 if d[i] == "1": val += 1
356 raise "Invalid symbol %s" % d[i]
363 ## Read bitmap texture from the text file.
364 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
365 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
366 ## The function returns width and height of the pixmap in pixels and byte stream representing
367 ## texture bitmap itself.
369 ## This function can be used to read the texture to the byte stream in order to pass it to
370 ## the AddTexture() function of geomBuilder class.
373 ## from salome.geom import geomBuilder
374 ## geompy = geomBuilder.New(salome.myStudy)
375 ## texture = geompy.readtexture('mytexture.dat')
376 ## texture = geompy.AddTexture(*texture)
377 ## obj.SetMarkerTexture(texture)
379 ## @param fname texture file name
380 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
381 ## @ingroup l1_geomBuilder_auxiliary
382 def ReadTexture(fname):
384 Read bitmap texture from the text file.
385 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
386 A zero symbol ('0') represents transparent pixel of the texture bitmap.
387 The function returns width and height of the pixmap in pixels and byte stream representing
388 texture bitmap itself.
389 This function can be used to read the texture to the byte stream in order to pass it to
390 the AddTexture() function of geomBuilder class.
393 fname texture file name
396 sequence of tree values: texture's width, height in pixels and its byte stream
399 from salome.geom import geomBuilder
400 geompy = geomBuilder.New(salome.myStudy)
401 texture = geompy.readtexture('mytexture.dat')
402 texture = geompy.AddTexture(*texture)
403 obj.SetMarkerTexture(texture)
407 lines = [ l.strip() for l in f.readlines()]
410 if lines: maxlen = max([len(x) for x in lines])
412 if maxlen%8: lenbytes += 1
416 lenline = (len(line)/8+1)*8
419 lenline = (len(line)/8)*8
421 for i in range(lenline/8):
424 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
427 bytedata += PackData(byte)
429 for i in range(lenline/8, lenbytes):
430 bytedata += PackData("0")
432 return lenbytes*8, len(lines), bytedata
437 ## Returns a long value from enumeration type
438 # Can be used for CORBA enumerator types like GEOM.shape_type
439 # @param theItem enumeration type
440 # @ingroup l1_geomBuilder_auxiliary
441 def EnumToLong(theItem):
443 Returns a long value from enumeration type
444 Can be used for CORBA enumerator types like geomBuilder.ShapeType
447 theItem enumeration type
450 if hasattr(theItem, "_v"): ret = theItem._v
453 ## Information about closed/unclosed state of shell or wire
454 # @ingroup l1_geomBuilder_auxiliary
457 Information about closed/unclosed state of shell or wire
463 ##! Private class used to bind calls of plugin operations to geomBuilder
464 class PluginOperation:
465 def __init__(self, operation, function):
466 self.operation = operation
467 self.function = function
470 def __call__(self, *args):
471 res = self.function(self.operation, *args)
472 RaiseIfFailed(self.function.__name__, self.operation)
475 # Warning: geom is a singleton
481 class geomBuilder(object, GEOM._objref_GEOM_Gen):
483 ## Enumeration ShapeType as a dictionary. \n
484 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
485 # @ingroup l1_geomBuilder_auxiliary
486 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
488 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
489 # and a list of parameters, describing the shape.
490 # List of parameters, describing the shape:
491 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
492 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
494 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
496 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
498 # - SPHERE: [xc yc zc R]
499 # - CYLINDER: [xb yb zb dx dy dz R H]
500 # - BOX: [xc yc zc ax ay az]
501 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
502 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
503 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
504 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
505 # - SOLID: [nb_faces nb_edges nb_vertices]
507 # - SPHERE2D: [xc yc zc R]
508 # - CYLINDER2D: [xb yb zb dx dy dz R H]
509 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
510 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
511 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
512 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
513 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
514 # - PLANE: [xo yo zo dx dy dz]
515 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
516 # - FACE: [nb_edges nb_vertices]
518 # - CIRCLE: [xc yc zc dx dy dz R]
519 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
520 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
521 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
522 # - LINE: [xo yo zo dx dy dz]
523 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
524 # - EDGE: [nb_vertices]
527 # @ingroup l1_geomBuilder_auxiliary
528 kind = GEOM.GEOM_IKindOfShape
535 #print "==== __new__ ", engine, geom, doLcc, created
537 # geom engine is either retrieved from engine, or created
539 # Following test avoids a recursive loop
542 # geom engine not created: existing engine found
544 if doLcc and not created:
546 # FindOrLoadComponent called:
547 # 1. CORBA resolution of server
548 # 2. the __new__ method is called again
549 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
550 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
553 # FindOrLoadComponent not called
555 # geomBuilder instance is created from lcc.FindOrLoadComponent
556 #print "==== super ", engine, geom, doLcc, created
557 geom = super(geomBuilder,cls).__new__(cls)
560 # geom engine not created: existing engine found
561 #print "==== existing ", engine, geom, doLcc, created
563 #print "return geom 1 ", geom
566 #print "return geom 2 ", geom
571 #print "-------- geomBuilder __init__ --- ", created, self
574 GEOM._objref_GEOM_Gen.__init__(self)
575 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
576 self.myBuilder = None
596 ## Process object publication in the study, as follows:
597 # - if @a theName is specified (not None), the object is published in the study
598 # with this name, not taking into account "auto-publishing" option;
599 # - if @a theName is NOT specified, the object is published in the study
600 # (using default name, which can be customized using @a theDefaultName parameter)
601 # only if auto-publishing is switched on.
603 # @param theObj object, a subject for publishing
604 # @param theName object name for study
605 # @param theDefaultName default name for the auto-publishing
607 # @sa addToStudyAuto()
608 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
610 def _item_name(_names, _defname, _idx=-1):
611 if not _names: _names = _defname
612 if type(_names) in [types.ListType, types.TupleType]:
614 if _idx >= len(_names) or not _names[_idx]:
615 if type(_defname) not in [types.ListType, types.TupleType]:
616 _name = "%s_%d"%(_defname, _idx+1)
617 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
618 _name = _defname[_idx]
620 _name = "%noname_%d"%(dn, _idx+1)
626 # must be wrong usage
631 _name = "%s_%d"%(_names, _idx+1)
637 def _publish( _name, _obj ):
639 if isinstance( _obj, GEOM._objref_GEOM_Field ):
640 fatherObj = _obj.GetShape()
641 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
642 fatherObj = _obj.GetField()
643 elif not _obj.IsMainShape():
644 fatherObj = _obj.GetMainShape()
646 if fatherObj and fatherObj.GetStudyEntry():
647 self.addToStudyInFather(fatherObj, _obj, _name)
649 self.addToStudy(_obj, _name)
655 if not theName and not self.myMaxNbSubShapesAllowed:
656 return # nothing to do: auto-publishing is disabled
657 if not theName and not theDefaultName:
658 return # neither theName nor theDefaultName is given
660 if type(theObj) in [types.ListType, types.TupleType]:
661 # list of objects is being published
664 if not obj: continue # bad object
665 name = _item_name(theName, theDefaultName, idx)
666 _publish( name, obj )
668 if not theName and idx == self.myMaxNbSubShapesAllowed: break
672 # single object is published
673 name = _item_name(theName, theDefaultName)
674 _publish( name, theObj )
677 ## @addtogroup l1_geomBuilder_auxiliary
679 def init_geom(self,theStudy):
680 self.myStudy = theStudy
681 self.myStudyId = self.myStudy._get_StudyId()
682 self.myBuilder = self.myStudy.NewBuilder()
683 self.father = self.myStudy.FindComponent("GEOM")
684 if self.father is None:
685 self.father = self.myBuilder.NewComponent("GEOM")
686 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
687 FName = A1._narrow(SALOMEDS.AttributeName)
688 FName.SetValue("Geometry")
689 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
690 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
691 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
692 self.myBuilder.DefineComponentInstance(self.father,self)
694 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
695 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
696 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
697 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
698 self.HealOp = self.GetIHealingOperations (self.myStudyId)
699 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
700 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
701 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
702 self.LocalOp = self.GetILocalOperations (self.myStudyId)
703 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
704 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
705 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
706 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
708 # The below line is a right way to map all plugin functions to geomBuilder,
709 # but AdvancedOperations are already mapped, that is why this line is commented
710 # and presents here only as an axample
711 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
713 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
714 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
716 # set GEOM as root in the use case tree
717 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
718 self.myUseCaseBuilder.SetRootCurrent()
719 self.myUseCaseBuilder.Append(self.father)
722 def GetPluginOperations(self, studyID, libraryName):
723 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
725 # bind methods of operations to self
726 methods = op.__class__.__dict__['__methods__']
727 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
728 for meth_name in methods:
729 if not meth_name in avoid_methods: # avoid basic methods
730 function = getattr(op.__class__, meth_name)
731 if callable(function):
732 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
733 self.__dict__[meth_name] = PluginOperation(op, function)
736 ## Enable / disable results auto-publishing
738 # The automatic publishing is managed in the following way:
739 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
740 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
741 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
742 # value passed as parameter has the same effect.
743 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
744 # maximum number of sub-shapes allowed for publishing is set to specified value.
746 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
747 # @ingroup l1_publish_data
748 def addToStudyAuto(self, maxNbSubShapes=-1):
750 Enable / disable results auto-publishing
752 The automatic publishing is managed in the following way:
753 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
754 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
755 maximum number of sub-shapes allowed for publishing is unlimited; any negative
756 value passed as parameter has the same effect.
757 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
758 maximum number of sub-shapes allowed for publishing is set to this value.
761 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
764 geompy.addToStudyAuto() # enable auto-publishing
765 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
766 geompy.addToStudyAuto(0) # disable auto-publishing
768 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
771 ## Dump component to the Python script
772 # This method overrides IDL function to allow default values for the parameters.
773 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
775 Dump component to the Python script
776 This method overrides IDL function to allow default values for the parameters.
778 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
780 ## Get name for sub-shape aSubObj of shape aMainObj
782 # @ref swig_SubShapeName "Example"
783 def SubShapeName(self,aSubObj, aMainObj):
785 Get name for sub-shape aSubObj of shape aMainObj
787 # Example: see GEOM_TestAll.py
789 #aSubId = orb.object_to_string(aSubObj)
790 #aMainId = orb.object_to_string(aMainObj)
791 #index = gg.getIndexTopology(aSubId, aMainId)
792 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
793 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
794 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
797 ## Publish in study aShape with name aName
799 # \param aShape the shape to be published
800 # \param aName the name for the shape
801 # \param doRestoreSubShapes if True, finds and publishes also
802 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
803 # and published sub-shapes of arguments
804 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
805 # these arguments description
806 # \return study entry of the published shape in form of string
808 # @ingroup l1_publish_data
809 # @ref swig_all_addtostudy "Example"
810 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
811 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
813 Publish in study aShape with name aName
816 aShape the shape to be published
817 aName the name for the shape
818 doRestoreSubShapes if True, finds and publishes also
819 sub-shapes of aShape, corresponding to its arguments
820 and published sub-shapes of arguments
821 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
822 these arguments description
825 study entry of the published shape in form of string
828 id_block1 = geompy.addToStudy(Block1, "Block 1")
830 # Example: see GEOM_TestAll.py
832 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
833 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
834 if doRestoreSubShapes:
835 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
836 theFindMethod, theInheritFirstArg, True )
838 print "addToStudy() failed"
840 return aShape.GetStudyEntry()
842 ## Publish in study aShape with name aName as sub-object of previously published aFather
843 # \param aFather previously published object
844 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
845 # \param aName the name for the shape
847 # \return study entry of the published shape in form of string
849 # @ingroup l1_publish_data
850 # @ref swig_all_addtostudyInFather "Example"
851 def addToStudyInFather(self, aFather, aShape, aName):
853 Publish in study aShape with name aName as sub-object of previously published aFather
856 aFather previously published object
857 aShape the shape to be published as sub-object of aFather
858 aName the name for the shape
861 study entry of the published shape in form of string
863 # Example: see GEOM_TestAll.py
865 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
866 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
868 print "addToStudyInFather() failed"
870 return aShape.GetStudyEntry()
872 ## Unpublish object in study
874 # \param obj the object to be unpublished
875 def hideInStudy(self, obj):
877 Unpublish object in study
880 obj the object to be unpublished
882 ior = salome.orb.object_to_string(obj)
883 aSObject = self.myStudy.FindObjectIOR(ior)
884 if aSObject is not None:
885 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
886 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
887 drwAttribute.SetDrawable(False)
890 # end of l1_geomBuilder_auxiliary
893 ## @addtogroup l3_restore_ss
896 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
897 # To be used from python scripts out of addToStudy() (non-default usage)
898 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
899 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
900 # If this list is empty, all operation arguments will be published
901 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
902 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
903 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
904 # Do not publish sub-shapes in place of arguments, but only
905 # in place of sub-shapes of the first argument,
906 # because the whole shape corresponds to the first argument.
907 # Mainly to be used after transformations, but it also can be
908 # usefull after partition with one object shape, and some other
909 # operations, where only the first argument has to be considered.
910 # If theObject has only one argument shape, this flag is automatically
911 # considered as True, not regarding really passed value.
912 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
913 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
914 # \return list of published sub-shapes
916 # @ref tui_restore_prs_params "Example"
917 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
918 theInheritFirstArg=False, theAddPrefix=True):
920 Publish sub-shapes, standing for arguments and sub-shapes of arguments
921 To be used from python scripts out of geompy.addToStudy (non-default usage)
924 theObject published GEOM.GEOM_Object, arguments of which will be published
925 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
926 If this list is empty, all operation arguments will be published
927 theFindMethod method to search sub-shapes, corresponding to arguments and
928 their sub-shapes. Value from enumeration GEOM.find_shape_method.
929 theInheritFirstArg set properties of the first argument for theObject.
930 Do not publish sub-shapes in place of arguments, but only
931 in place of sub-shapes of the first argument,
932 because the whole shape corresponds to the first argument.
933 Mainly to be used after transformations, but it also can be
934 usefull after partition with one object shape, and some other
935 operations, where only the first argument has to be considered.
936 If theObject has only one argument shape, this flag is automatically
937 considered as True, not regarding really passed value.
938 theAddPrefix add prefix "from_" to names of restored sub-shapes,
939 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
941 list of published sub-shapes
943 # Example: see GEOM_TestAll.py
944 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
945 theFindMethod, theInheritFirstArg, theAddPrefix)
947 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
948 # To be used from python scripts out of addToStudy() (non-default usage)
949 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
950 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
951 # If this list is empty, all operation arguments will be published
952 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
953 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
954 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
955 # Do not publish sub-shapes in place of arguments, but only
956 # in place of sub-shapes of the first argument,
957 # because the whole shape corresponds to the first argument.
958 # Mainly to be used after transformations, but it also can be
959 # usefull after partition with one object shape, and some other
960 # operations, where only the first argument has to be considered.
961 # If theObject has only one argument shape, this flag is automatically
962 # considered as True, not regarding really passed value.
963 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
964 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
965 # \return list of published sub-shapes
967 # @ref tui_restore_prs_params "Example"
968 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
969 theInheritFirstArg=False, theAddPrefix=True):
971 Publish sub-shapes, standing for arguments and sub-shapes of arguments
972 To be used from python scripts out of geompy.addToStudy() (non-default usage)
975 theObject published GEOM.GEOM_Object, arguments of which will be published
976 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
977 If this list is empty, all operation arguments will be published
978 theFindMethod method to search sub-shapes, corresponding to arguments and
979 their sub-shapes. Value from enumeration GEOM::find_shape_method.
980 theInheritFirstArg set properties of the first argument for theObject.
981 Do not publish sub-shapes in place of arguments, but only
982 in place of sub-shapes of the first argument,
983 because the whole shape corresponds to the first argument.
984 Mainly to be used after transformations, but it also can be
985 usefull after partition with one object shape, and some other
986 operations, where only the first argument has to be considered.
987 If theObject has only one argument shape, this flag is automatically
988 considered as True, not regarding really passed value.
989 theAddPrefix add prefix "from_" to names of restored sub-shapes,
990 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
993 list of published sub-shapes
995 # Example: see GEOM_TestAll.py
996 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
997 theFindMethod, theInheritFirstArg, theAddPrefix)
999 # end of l3_restore_ss
1002 ## @addtogroup l3_basic_go
1005 ## Create point by three coordinates.
1006 # @param theX The X coordinate of the point.
1007 # @param theY The Y coordinate of the point.
1008 # @param theZ The Z coordinate of the point.
1009 # @param theName Object name; when specified, this parameter is used
1010 # for result publication in the study. Otherwise, if automatic
1011 # publication is switched on, default value is used for result name.
1013 # @return New GEOM.GEOM_Object, containing the created point.
1015 # @ref tui_creation_point "Example"
1016 def MakeVertex(self, theX, theY, theZ, theName=None):
1018 Create point by three coordinates.
1021 theX The X coordinate of the point.
1022 theY The Y coordinate of the point.
1023 theZ The Z coordinate of the point.
1024 theName Object name; when specified, this parameter is used
1025 for result publication in the study. Otherwise, if automatic
1026 publication is switched on, default value is used for result name.
1029 New GEOM.GEOM_Object, containing the created point.
1031 # Example: see GEOM_TestAll.py
1032 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1033 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1034 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1035 anObj.SetParameters(Parameters)
1036 self._autoPublish(anObj, theName, "vertex")
1039 ## Create a point, distant from the referenced point
1040 # on the given distances along the coordinate axes.
1041 # @param theReference The referenced point.
1042 # @param theX Displacement from the referenced point along OX axis.
1043 # @param theY Displacement from the referenced point along OY axis.
1044 # @param theZ Displacement from the referenced point along OZ axis.
1045 # @param theName Object name; when specified, this parameter is used
1046 # for result publication in the study. Otherwise, if automatic
1047 # publication is switched on, default value is used for result name.
1049 # @return New GEOM.GEOM_Object, containing the created point.
1051 # @ref tui_creation_point "Example"
1052 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1054 Create a point, distant from the referenced point
1055 on the given distances along the coordinate axes.
1058 theReference The referenced point.
1059 theX Displacement from the referenced point along OX axis.
1060 theY Displacement from the referenced point along OY axis.
1061 theZ Displacement from the referenced point along OZ axis.
1062 theName Object name; when specified, this parameter is used
1063 for result publication in the study. Otherwise, if automatic
1064 publication is switched on, default value is used for result name.
1067 New GEOM.GEOM_Object, containing the created point.
1069 # Example: see GEOM_TestAll.py
1070 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1071 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1072 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1073 anObj.SetParameters(Parameters)
1074 self._autoPublish(anObj, theName, "vertex")
1077 ## Create a point, corresponding to the given parameter on the given curve.
1078 # @param theRefCurve The referenced curve.
1079 # @param theParameter Value of parameter on the referenced curve.
1080 # @param theName Object name; when specified, this parameter is used
1081 # for result publication in the study. Otherwise, if automatic
1082 # publication is switched on, default value is used for result name.
1084 # @return New GEOM.GEOM_Object, containing the created point.
1086 # @ref tui_creation_point "Example"
1087 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1089 Create a point, corresponding to the given parameter on the given curve.
1092 theRefCurve The referenced curve.
1093 theParameter Value of parameter on the referenced curve.
1094 theName Object name; when specified, this parameter is used
1095 for result publication in the study. Otherwise, if automatic
1096 publication is switched on, default value is used for result name.
1099 New GEOM.GEOM_Object, containing the created point.
1102 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1104 # Example: see GEOM_TestAll.py
1105 theParameter, Parameters = ParseParameters(theParameter)
1106 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1107 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1108 anObj.SetParameters(Parameters)
1109 self._autoPublish(anObj, theName, "vertex")
1112 ## Create a point by projection give coordinates on the given curve
1113 # @param theRefCurve The referenced curve.
1114 # @param theX X-coordinate in 3D space
1115 # @param theY Y-coordinate in 3D space
1116 # @param theZ Z-coordinate in 3D space
1117 # @param theName Object name; when specified, this parameter is used
1118 # for result publication in the study. Otherwise, if automatic
1119 # publication is switched on, default value is used for result name.
1121 # @return New GEOM.GEOM_Object, containing the created point.
1123 # @ref tui_creation_point "Example"
1124 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1126 Create a point by projection give coordinates on the given curve
1129 theRefCurve The referenced curve.
1130 theX X-coordinate in 3D space
1131 theY Y-coordinate in 3D space
1132 theZ Z-coordinate in 3D space
1133 theName Object name; when specified, this parameter is used
1134 for result publication in the study. Otherwise, if automatic
1135 publication is switched on, default value is used for result name.
1138 New GEOM.GEOM_Object, containing the created point.
1141 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1143 # Example: see GEOM_TestAll.py
1144 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1145 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1146 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1147 anObj.SetParameters(Parameters)
1148 self._autoPublish(anObj, theName, "vertex")
1151 ## Create a point, corresponding to the given length on the given curve.
1152 # @param theRefCurve The referenced curve.
1153 # @param theLength Length on the referenced curve. It can be negative.
1154 # @param theStartPoint Point allowing to choose the direction for the calculation
1155 # of the length. If None, start from the first point of theRefCurve.
1156 # @param theName Object name; when specified, this parameter is used
1157 # for result publication in the study. Otherwise, if automatic
1158 # publication is switched on, default value is used for result name.
1160 # @return New GEOM.GEOM_Object, containing the created point.
1162 # @ref tui_creation_point "Example"
1163 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1165 Create a point, corresponding to the given length on the given curve.
1168 theRefCurve The referenced curve.
1169 theLength Length on the referenced curve. It can be negative.
1170 theStartPoint Point allowing to choose the direction for the calculation
1171 of the length. If None, start from the first point of theRefCurve.
1172 theName Object name; when specified, this parameter is used
1173 for result publication in the study. Otherwise, if automatic
1174 publication is switched on, default value is used for result name.
1177 New GEOM.GEOM_Object, containing the created point.
1179 # Example: see GEOM_TestAll.py
1180 theLength, Parameters = ParseParameters(theLength)
1181 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1182 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1183 anObj.SetParameters(Parameters)
1184 self._autoPublish(anObj, theName, "vertex")
1187 ## Create a point, corresponding to the given parameters on the
1189 # @param theRefSurf The referenced surface.
1190 # @param theUParameter Value of U-parameter on the referenced surface.
1191 # @param theVParameter Value of V-parameter on the referenced surface.
1192 # @param theName Object name; when specified, this parameter is used
1193 # for result publication in the study. Otherwise, if automatic
1194 # publication is switched on, default value is used for result name.
1196 # @return New GEOM.GEOM_Object, containing the created point.
1198 # @ref swig_MakeVertexOnSurface "Example"
1199 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1201 Create a point, corresponding to the given parameters on the
1205 theRefSurf The referenced surface.
1206 theUParameter Value of U-parameter on the referenced surface.
1207 theVParameter Value of V-parameter on the referenced surface.
1208 theName Object name; when specified, this parameter is used
1209 for result publication in the study. Otherwise, if automatic
1210 publication is switched on, default value is used for result name.
1213 New GEOM.GEOM_Object, containing the created point.
1216 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1218 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1219 # Example: see GEOM_TestAll.py
1220 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1221 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1222 anObj.SetParameters(Parameters);
1223 self._autoPublish(anObj, theName, "vertex")
1226 ## Create a point by projection give coordinates on the given surface
1227 # @param theRefSurf The referenced surface.
1228 # @param theX X-coordinate in 3D space
1229 # @param theY Y-coordinate in 3D space
1230 # @param theZ Z-coordinate in 3D space
1231 # @param theName Object name; when specified, this parameter is used
1232 # for result publication in the study. Otherwise, if automatic
1233 # publication is switched on, default value is used for result name.
1235 # @return New GEOM.GEOM_Object, containing the created point.
1237 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1238 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1240 Create a point by projection give coordinates on the given surface
1243 theRefSurf The referenced surface.
1244 theX X-coordinate in 3D space
1245 theY Y-coordinate in 3D space
1246 theZ Z-coordinate in 3D space
1247 theName Object name; when specified, this parameter is used
1248 for result publication in the study. Otherwise, if automatic
1249 publication is switched on, default value is used for result name.
1252 New GEOM.GEOM_Object, containing the created point.
1255 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1257 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1258 # Example: see GEOM_TestAll.py
1259 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1260 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1261 anObj.SetParameters(Parameters);
1262 self._autoPublish(anObj, theName, "vertex")
1265 ## Create a point, which lays on the given face.
1266 # The point will lay in arbitrary place of the face.
1267 # The only condition on it is a non-zero distance to the face boundary.
1268 # Such point can be used to uniquely identify the face inside any
1269 # shape in case, when the shape does not contain overlapped faces.
1270 # @param theFace The referenced face.
1271 # @param theName Object name; when specified, this parameter is used
1272 # for result publication in the study. Otherwise, if automatic
1273 # publication is switched on, default value is used for result name.
1275 # @return New GEOM.GEOM_Object, containing the created point.
1277 # @ref swig_MakeVertexInsideFace "Example"
1278 def MakeVertexInsideFace (self, theFace, theName=None):
1280 Create a point, which lays on the given face.
1281 The point will lay in arbitrary place of the face.
1282 The only condition on it is a non-zero distance to the face boundary.
1283 Such point can be used to uniquely identify the face inside any
1284 shape in case, when the shape does not contain overlapped faces.
1287 theFace The referenced face.
1288 theName Object name; when specified, this parameter is used
1289 for result publication in the study. Otherwise, if automatic
1290 publication is switched on, default value is used for result name.
1293 New GEOM.GEOM_Object, containing the created point.
1296 p_on_face = geompy.MakeVertexInsideFace(Face)
1298 # Example: see GEOM_TestAll.py
1299 anObj = self.BasicOp.MakePointOnFace(theFace)
1300 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1301 self._autoPublish(anObj, theName, "vertex")
1304 ## Create a point on intersection of two lines.
1305 # @param theRefLine1, theRefLine2 The referenced lines.
1306 # @param theName Object name; when specified, this parameter is used
1307 # for result publication in the study. Otherwise, if automatic
1308 # publication is switched on, default value is used for result name.
1310 # @return New GEOM.GEOM_Object, containing the created point.
1312 # @ref swig_MakeVertexOnLinesIntersection "Example"
1313 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1315 Create a point on intersection of two lines.
1318 theRefLine1, theRefLine2 The referenced lines.
1319 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.
1324 New GEOM.GEOM_Object, containing the created point.
1326 # Example: see GEOM_TestAll.py
1327 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1328 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1329 self._autoPublish(anObj, theName, "vertex")
1332 ## Create a tangent, corresponding to the given parameter on the given curve.
1333 # @param theRefCurve The referenced curve.
1334 # @param theParameter Value of parameter on the referenced curve.
1335 # @param theName Object name; when specified, this parameter is used
1336 # for result publication in the study. Otherwise, if automatic
1337 # publication is switched on, default value is used for result name.
1339 # @return New GEOM.GEOM_Object, containing the created tangent.
1341 # @ref swig_MakeTangentOnCurve "Example"
1342 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1344 Create a tangent, corresponding to the given parameter on the given curve.
1347 theRefCurve The referenced curve.
1348 theParameter Value of parameter on the referenced curve.
1349 theName Object name; when specified, this parameter is used
1350 for result publication in the study. Otherwise, if automatic
1351 publication is switched on, default value is used for result name.
1354 New GEOM.GEOM_Object, containing the created tangent.
1357 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1359 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1360 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1361 self._autoPublish(anObj, theName, "tangent")
1364 ## Create a tangent plane, corresponding to the given parameter on the given face.
1365 # @param theFace The face for which tangent plane should be built.
1366 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1367 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1368 # @param theTrimSize the size of plane.
1369 # @param theName Object name; when specified, this parameter is used
1370 # for result publication in the study. Otherwise, if automatic
1371 # publication is switched on, default value is used for result name.
1373 # @return New GEOM.GEOM_Object, containing the created tangent.
1375 # @ref swig_MakeTangentPlaneOnFace "Example"
1376 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1378 Create a tangent plane, corresponding to the given parameter on the given face.
1381 theFace The face for which tangent plane should be built.
1382 theParameterV vertical value of the center point (0.0 - 1.0).
1383 theParameterU horisontal value of the center point (0.0 - 1.0).
1384 theTrimSize the size of plane.
1385 theName Object name; when specified, this parameter is used
1386 for result publication in the study. Otherwise, if automatic
1387 publication is switched on, default value is used for result name.
1390 New GEOM.GEOM_Object, containing the created tangent.
1393 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1395 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1396 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1397 self._autoPublish(anObj, theName, "tangent")
1400 ## Create a vector with the given components.
1401 # @param theDX X component of the vector.
1402 # @param theDY Y component of the vector.
1403 # @param theDZ Z component of the vector.
1404 # @param theName Object name; when specified, this parameter is used
1405 # for result publication in the study. Otherwise, if automatic
1406 # publication is switched on, default value is used for result name.
1408 # @return New GEOM.GEOM_Object, containing the created vector.
1410 # @ref tui_creation_vector "Example"
1411 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1413 Create a vector with the given components.
1416 theDX X component of the vector.
1417 theDY Y component of the vector.
1418 theDZ Z component of the vector.
1419 theName Object name; when specified, this parameter is used
1420 for result publication in the study. Otherwise, if automatic
1421 publication is switched on, default value is used for result name.
1424 New GEOM.GEOM_Object, containing the created vector.
1426 # Example: see GEOM_TestAll.py
1427 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1428 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1429 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1430 anObj.SetParameters(Parameters)
1431 self._autoPublish(anObj, theName, "vector")
1434 ## Create a vector between two points.
1435 # @param thePnt1 Start point for the vector.
1436 # @param thePnt2 End point for the vector.
1437 # @param theName Object name; when specified, this parameter is used
1438 # for result publication in the study. Otherwise, if automatic
1439 # publication is switched on, default value is used for result name.
1441 # @return New GEOM.GEOM_Object, containing the created vector.
1443 # @ref tui_creation_vector "Example"
1444 def MakeVector(self, thePnt1, thePnt2, theName=None):
1446 Create a vector between two points.
1449 thePnt1 Start point for the vector.
1450 thePnt2 End point for the vector.
1451 theName Object name; when specified, this parameter is used
1452 for result publication in the study. Otherwise, if automatic
1453 publication is switched on, default value is used for result name.
1456 New GEOM.GEOM_Object, containing the created vector.
1458 # Example: see GEOM_TestAll.py
1459 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1460 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1461 self._autoPublish(anObj, theName, "vector")
1464 ## Create a line, passing through the given point
1465 # and parrallel to the given direction
1466 # @param thePnt Point. The resulting line will pass through it.
1467 # @param theDir Direction. The resulting line will be parallel to it.
1468 # @param theName Object name; when specified, this parameter is used
1469 # for result publication in the study. Otherwise, if automatic
1470 # publication is switched on, default value is used for result name.
1472 # @return New GEOM.GEOM_Object, containing the created line.
1474 # @ref tui_creation_line "Example"
1475 def MakeLine(self, thePnt, theDir, theName=None):
1477 Create a line, passing through the given point
1478 and parrallel to the given direction
1481 thePnt Point. The resulting line will pass through it.
1482 theDir Direction. The resulting line will be parallel to it.
1483 theName Object name; when specified, this parameter is used
1484 for result publication in the study. Otherwise, if automatic
1485 publication is switched on, default value is used for result name.
1488 New GEOM.GEOM_Object, containing the created line.
1490 # Example: see GEOM_TestAll.py
1491 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1492 RaiseIfFailed("MakeLine", self.BasicOp)
1493 self._autoPublish(anObj, theName, "line")
1496 ## Create a line, passing through the given points
1497 # @param thePnt1 First of two points, defining the line.
1498 # @param thePnt2 Second of two points, defining the line.
1499 # @param 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.
1503 # @return New GEOM.GEOM_Object, containing the created line.
1505 # @ref tui_creation_line "Example"
1506 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1508 Create a line, passing through the given points
1511 thePnt1 First of two points, defining the line.
1512 thePnt2 Second of two points, defining the line.
1513 theName Object name; when specified, this parameter is used
1514 for result publication in the study. Otherwise, if automatic
1515 publication is switched on, default value is used for result name.
1518 New GEOM.GEOM_Object, containing the created line.
1520 # Example: see GEOM_TestAll.py
1521 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1522 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1523 self._autoPublish(anObj, theName, "line")
1526 ## Create a line on two faces intersection.
1527 # @param theFace1 First of two faces, defining the line.
1528 # @param theFace2 Second of two faces, defining the line.
1529 # @param theName Object name; when specified, this parameter is used
1530 # for result publication in the study. Otherwise, if automatic
1531 # publication is switched on, default value is used for result name.
1533 # @return New GEOM.GEOM_Object, containing the created line.
1535 # @ref swig_MakeLineTwoFaces "Example"
1536 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1538 Create a line on two faces intersection.
1541 theFace1 First of two faces, defining the line.
1542 theFace2 Second of two faces, defining the line.
1543 theName Object name; when specified, this parameter is used
1544 for result publication in the study. Otherwise, if automatic
1545 publication is switched on, default value is used for result name.
1548 New GEOM.GEOM_Object, containing the created line.
1550 # Example: see GEOM_TestAll.py
1551 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1552 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1553 self._autoPublish(anObj, theName, "line")
1556 ## Create a plane, passing through the given point
1557 # and normal to the given vector.
1558 # @param thePnt Point, the plane has to pass through.
1559 # @param theVec Vector, defining the plane normal direction.
1560 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1561 # @param 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.
1565 # @return New GEOM.GEOM_Object, containing the created plane.
1567 # @ref tui_creation_plane "Example"
1568 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1570 Create a plane, passing through the given point
1571 and normal to the given vector.
1574 thePnt Point, the plane has to pass through.
1575 theVec Vector, defining the plane normal direction.
1576 theTrimSize Half size of a side of quadrangle face, representing the plane.
1577 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.
1582 New GEOM.GEOM_Object, containing the created plane.
1584 # Example: see GEOM_TestAll.py
1585 theTrimSize, Parameters = ParseParameters(theTrimSize);
1586 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1587 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1588 anObj.SetParameters(Parameters)
1589 self._autoPublish(anObj, theName, "plane")
1592 ## Create a plane, passing through the three given points
1593 # @param thePnt1 First of three points, defining the plane.
1594 # @param thePnt2 Second of three points, defining the plane.
1595 # @param thePnt3 Fird of three points, defining the plane.
1596 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1597 # @param theName Object name; when specified, this parameter is used
1598 # for result publication in the study. Otherwise, if automatic
1599 # publication is switched on, default value is used for result name.
1601 # @return New GEOM.GEOM_Object, containing the created plane.
1603 # @ref tui_creation_plane "Example"
1604 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1606 Create a plane, passing through the three given points
1609 thePnt1 First of three points, defining the plane.
1610 thePnt2 Second of three points, defining the plane.
1611 thePnt3 Fird of three points, defining the plane.
1612 theTrimSize Half size of a side of quadrangle face, representing the plane.
1613 theName Object name; when specified, this parameter is used
1614 for result publication in the study. Otherwise, if automatic
1615 publication is switched on, default value is used for result name.
1618 New GEOM.GEOM_Object, containing the created plane.
1620 # Example: see GEOM_TestAll.py
1621 theTrimSize, Parameters = ParseParameters(theTrimSize);
1622 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1623 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1624 anObj.SetParameters(Parameters)
1625 self._autoPublish(anObj, theName, "plane")
1628 ## Create a plane, similar to the existing one, but with another size of representing face.
1629 # @param theFace Referenced plane or LCS(Marker).
1630 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1631 # @param theName Object name; when specified, this parameter is used
1632 # for result publication in the study. Otherwise, if automatic
1633 # publication is switched on, default value is used for result name.
1635 # @return New GEOM.GEOM_Object, containing the created plane.
1637 # @ref tui_creation_plane "Example"
1638 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1640 Create a plane, similar to the existing one, but with another size of representing face.
1643 theFace Referenced plane or LCS(Marker).
1644 theTrimSize New half size of a side of quadrangle face, representing the plane.
1645 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.
1650 New GEOM.GEOM_Object, containing the created plane.
1652 # Example: see GEOM_TestAll.py
1653 theTrimSize, Parameters = ParseParameters(theTrimSize);
1654 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1655 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1656 anObj.SetParameters(Parameters)
1657 self._autoPublish(anObj, theName, "plane")
1660 ## Create a plane, passing through the 2 vectors
1661 # with center in a start point of the first vector.
1662 # @param theVec1 Vector, defining center point and plane direction.
1663 # @param theVec2 Vector, defining the plane normal direction.
1664 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1665 # @param theName Object name; when specified, this parameter is used
1666 # for result publication in the study. Otherwise, if automatic
1667 # publication is switched on, default value is used for result name.
1669 # @return New GEOM.GEOM_Object, containing the created plane.
1671 # @ref tui_creation_plane "Example"
1672 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1674 Create a plane, passing through the 2 vectors
1675 with center in a start point of the first vector.
1678 theVec1 Vector, defining center point and plane direction.
1679 theVec2 Vector, defining the plane normal direction.
1680 theTrimSize Half size of a side of quadrangle face, representing the plane.
1681 theName Object name; when specified, this parameter is used
1682 for result publication in the study. Otherwise, if automatic
1683 publication is switched on, default value is used for result name.
1686 New GEOM.GEOM_Object, containing the created plane.
1688 # Example: see GEOM_TestAll.py
1689 theTrimSize, Parameters = ParseParameters(theTrimSize);
1690 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1691 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1692 anObj.SetParameters(Parameters)
1693 self._autoPublish(anObj, theName, "plane")
1696 ## Create a plane, based on a Local coordinate system.
1697 # @param theLCS coordinate system, defining plane.
1698 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1699 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1700 # @param theName Object name; when specified, this parameter is used
1701 # for result publication in the study. Otherwise, if automatic
1702 # publication is switched on, default value is used for result name.
1704 # @return New GEOM.GEOM_Object, containing the created plane.
1706 # @ref tui_creation_plane "Example"
1707 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1709 Create a plane, based on a Local coordinate system.
1712 theLCS coordinate system, defining plane.
1713 theTrimSize Half size of a side of quadrangle face, representing the plane.
1714 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1715 theName Object name; when specified, this parameter is used
1716 for result publication in the study. Otherwise, if automatic
1717 publication is switched on, default value is used for result name.
1720 New GEOM.GEOM_Object, containing the created plane.
1722 # Example: see GEOM_TestAll.py
1723 theTrimSize, Parameters = ParseParameters(theTrimSize);
1724 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1725 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1726 anObj.SetParameters(Parameters)
1727 self._autoPublish(anObj, theName, "plane")
1730 ## Create a local coordinate system.
1731 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1732 # @param XDX,XDY,XDZ Three components of OX direction
1733 # @param YDX,YDY,YDZ Three components of OY direction
1734 # @param theName Object name; when specified, this parameter is used
1735 # for result publication in the study. Otherwise, if automatic
1736 # publication is switched on, default value is used for result name.
1738 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1740 # @ref swig_MakeMarker "Example"
1741 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1743 Create a local coordinate system.
1746 OX,OY,OZ Three coordinates of coordinate system origin.
1747 XDX,XDY,XDZ Three components of OX direction
1748 YDX,YDY,YDZ Three components of OY direction
1749 theName Object name; when specified, this parameter is used
1750 for result publication in the study. Otherwise, if automatic
1751 publication is switched on, default value is used for result name.
1754 New GEOM.GEOM_Object, containing the created coordinate system.
1756 # Example: see GEOM_TestAll.py
1757 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1758 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1759 RaiseIfFailed("MakeMarker", self.BasicOp)
1760 anObj.SetParameters(Parameters)
1761 self._autoPublish(anObj, theName, "lcs")
1764 ## Create a local coordinate system from shape.
1765 # @param theShape The initial shape to detect the coordinate system.
1766 # @param theName Object name; when specified, this parameter is used
1767 # for result publication in the study. Otherwise, if automatic
1768 # publication is switched on, default value is used for result name.
1770 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1772 # @ref tui_creation_lcs "Example"
1773 def MakeMarkerFromShape(self, theShape, theName=None):
1775 Create a local coordinate system from shape.
1778 theShape The initial shape to detect the coordinate system.
1779 theName Object name; when specified, this parameter is used
1780 for result publication in the study. Otherwise, if automatic
1781 publication is switched on, default value is used for result name.
1784 New GEOM.GEOM_Object, containing the created coordinate system.
1786 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1787 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1788 self._autoPublish(anObj, theName, "lcs")
1791 ## Create a local coordinate system from point and two vectors.
1792 # @param theOrigin Point of coordinate system origin.
1793 # @param theXVec Vector of X direction
1794 # @param theYVec Vector of Y direction
1795 # @param theName Object name; when specified, this parameter is used
1796 # for result publication in the study. Otherwise, if automatic
1797 # publication is switched on, default value is used for result name.
1799 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1801 # @ref tui_creation_lcs "Example"
1802 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1804 Create a local coordinate system from point and two vectors.
1807 theOrigin Point of coordinate system origin.
1808 theXVec Vector of X direction
1809 theYVec Vector of Y direction
1810 theName Object name; when specified, this parameter is used
1811 for result publication in the study. Otherwise, if automatic
1812 publication is switched on, default value is used for result name.
1815 New GEOM.GEOM_Object, containing the created coordinate system.
1818 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1819 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1820 self._autoPublish(anObj, theName, "lcs")
1823 # end of l3_basic_go
1826 ## @addtogroup l4_curves
1829 ## Create an arc of circle, passing through three given points.
1830 # @param thePnt1 Start point of the arc.
1831 # @param thePnt2 Middle point of the arc.
1832 # @param thePnt3 End point of the arc.
1833 # @param theName Object name; when specified, this parameter is used
1834 # for result publication in the study. Otherwise, if automatic
1835 # publication is switched on, default value is used for result name.
1837 # @return New GEOM.GEOM_Object, containing the created arc.
1839 # @ref swig_MakeArc "Example"
1840 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1842 Create an arc of circle, passing through three given points.
1845 thePnt1 Start point of the arc.
1846 thePnt2 Middle point of the arc.
1847 thePnt3 End point of the arc.
1848 theName Object name; when specified, this parameter is used
1849 for result publication in the study. Otherwise, if automatic
1850 publication is switched on, default value is used for result name.
1853 New GEOM.GEOM_Object, containing the created arc.
1855 # Example: see GEOM_TestAll.py
1856 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1857 RaiseIfFailed("MakeArc", self.CurvesOp)
1858 self._autoPublish(anObj, theName, "arc")
1861 ## Create an arc of circle from a center and 2 points.
1862 # @param thePnt1 Center of the arc
1863 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1864 # @param thePnt3 End point of the arc (Gives also a direction)
1865 # @param theSense Orientation of the arc
1866 # @param theName Object name; when specified, this parameter is used
1867 # for result publication in the study. Otherwise, if automatic
1868 # publication is switched on, default value is used for result name.
1870 # @return New GEOM.GEOM_Object, containing the created arc.
1872 # @ref swig_MakeArc "Example"
1873 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1875 Create an arc of circle from a center and 2 points.
1878 thePnt1 Center of the arc
1879 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1880 thePnt3 End point of the arc (Gives also a direction)
1881 theSense Orientation of the arc
1882 theName Object name; when specified, this parameter is used
1883 for result publication in the study. Otherwise, if automatic
1884 publication is switched on, default value is used for result name.
1887 New GEOM.GEOM_Object, containing the created arc.
1889 # Example: see GEOM_TestAll.py
1890 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1891 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1892 self._autoPublish(anObj, theName, "arc")
1895 ## Create an arc of ellipse, of center and two points.
1896 # @param theCenter Center of the arc.
1897 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1898 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1899 # @param theName Object name; when specified, this parameter is used
1900 # for result publication in the study. Otherwise, if automatic
1901 # publication is switched on, default value is used for result name.
1903 # @return New GEOM.GEOM_Object, containing the created arc.
1905 # @ref swig_MakeArc "Example"
1906 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1908 Create an arc of ellipse, of center and two points.
1911 theCenter Center of the arc.
1912 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1913 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1914 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.
1919 New GEOM.GEOM_Object, containing the created arc.
1921 # Example: see GEOM_TestAll.py
1922 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1923 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1924 self._autoPublish(anObj, theName, "arc")
1927 ## Create a circle with given center, normal vector and radius.
1928 # @param thePnt Circle center.
1929 # @param theVec Vector, normal to the plane of the circle.
1930 # @param theR Circle radius.
1931 # @param theName Object name; when specified, this parameter is used
1932 # for result publication in the study. Otherwise, if automatic
1933 # publication is switched on, default value is used for result name.
1935 # @return New GEOM.GEOM_Object, containing the created circle.
1937 # @ref tui_creation_circle "Example"
1938 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1940 Create a circle with given center, normal vector and radius.
1943 thePnt Circle center.
1944 theVec Vector, normal to the plane of the circle.
1946 theName Object name; when specified, this parameter is used
1947 for result publication in the study. Otherwise, if automatic
1948 publication is switched on, default value is used for result name.
1951 New GEOM.GEOM_Object, containing the created circle.
1953 # Example: see GEOM_TestAll.py
1954 theR, Parameters = ParseParameters(theR)
1955 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1956 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1957 anObj.SetParameters(Parameters)
1958 self._autoPublish(anObj, theName, "circle")
1961 ## Create a circle with given radius.
1962 # Center of the circle will be in the origin of global
1963 # coordinate system and normal vector will be codirected with Z axis
1964 # @param theR Circle radius.
1965 # @param theName Object name; when specified, this parameter is used
1966 # for result publication in the study. Otherwise, if automatic
1967 # publication is switched on, default value is used for result name.
1969 # @return New GEOM.GEOM_Object, containing the created circle.
1970 def MakeCircleR(self, theR, theName=None):
1972 Create a circle with given radius.
1973 Center of the circle will be in the origin of global
1974 coordinate system and normal vector will be codirected with Z axis
1978 theName Object name; when specified, this parameter is used
1979 for result publication in the study. Otherwise, if automatic
1980 publication is switched on, default value is used for result name.
1983 New GEOM.GEOM_Object, containing the created circle.
1985 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1986 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1987 self._autoPublish(anObj, theName, "circle")
1990 ## Create a circle, passing through three given points
1991 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1992 # @param theName Object name; when specified, this parameter is used
1993 # for result publication in the study. Otherwise, if automatic
1994 # publication is switched on, default value is used for result name.
1996 # @return New GEOM.GEOM_Object, containing the created circle.
1998 # @ref tui_creation_circle "Example"
1999 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2001 Create a circle, passing through three given points
2004 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2005 theName Object name; when specified, this parameter is used
2006 for result publication in the study. Otherwise, if automatic
2007 publication is switched on, default value is used for result name.
2010 New GEOM.GEOM_Object, containing the created circle.
2012 # Example: see GEOM_TestAll.py
2013 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2014 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2015 self._autoPublish(anObj, theName, "circle")
2018 ## Create a circle, with given point1 as center,
2019 # passing through the point2 as radius and laying in the plane,
2020 # defined by all three given points.
2021 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2022 # @param theName Object name; when specified, this parameter is used
2023 # for result publication in the study. Otherwise, if automatic
2024 # publication is switched on, default value is used for result name.
2026 # @return New GEOM.GEOM_Object, containing the created circle.
2028 # @ref swig_MakeCircle "Example"
2029 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2031 Create a circle, with given point1 as center,
2032 passing through the point2 as radius and laying in the plane,
2033 defined by all three given points.
2036 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2037 theName Object name; when specified, this parameter is used
2038 for result publication in the study. Otherwise, if automatic
2039 publication is switched on, default value is used for result name.
2042 New GEOM.GEOM_Object, containing the created circle.
2044 # Example: see GEOM_example6.py
2045 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2046 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2047 self._autoPublish(anObj, theName, "circle")
2050 ## Create an ellipse with given center, normal vector and radiuses.
2051 # @param thePnt Ellipse center.
2052 # @param theVec Vector, normal to the plane of the ellipse.
2053 # @param theRMajor Major ellipse radius.
2054 # @param theRMinor Minor ellipse radius.
2055 # @param theVecMaj Vector, direction of the ellipse's main axis.
2056 # @param theName Object name; when specified, this parameter is used
2057 # for result publication in the study. Otherwise, if automatic
2058 # publication is switched on, default value is used for result name.
2060 # @return New GEOM.GEOM_Object, containing the created ellipse.
2062 # @ref tui_creation_ellipse "Example"
2063 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2065 Create an ellipse with given center, normal vector and radiuses.
2068 thePnt Ellipse center.
2069 theVec Vector, normal to the plane of the ellipse.
2070 theRMajor Major ellipse radius.
2071 theRMinor Minor ellipse radius.
2072 theVecMaj Vector, direction of the ellipse's main axis.
2073 theName Object name; when specified, this parameter is used
2074 for result publication in the study. Otherwise, if automatic
2075 publication is switched on, default value is used for result name.
2078 New GEOM.GEOM_Object, containing the created ellipse.
2080 # Example: see GEOM_TestAll.py
2081 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2082 if theVecMaj is not None:
2083 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2085 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2087 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2088 anObj.SetParameters(Parameters)
2089 self._autoPublish(anObj, theName, "ellipse")
2092 ## Create an ellipse with given radiuses.
2093 # Center of the ellipse will be in the origin of global
2094 # coordinate system and normal vector will be codirected with Z axis
2095 # @param theRMajor Major ellipse radius.
2096 # @param theRMinor Minor ellipse radius.
2097 # @param theName Object name; when specified, this parameter is used
2098 # for result publication in the study. Otherwise, if automatic
2099 # publication is switched on, default value is used for result name.
2101 # @return New GEOM.GEOM_Object, containing the created ellipse.
2102 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2104 Create an ellipse with given radiuses.
2105 Center of the ellipse will be in the origin of global
2106 coordinate system and normal vector will be codirected with Z axis
2109 theRMajor Major ellipse radius.
2110 theRMinor Minor ellipse radius.
2111 theName Object name; when specified, this parameter is used
2112 for result publication in the study. Otherwise, if automatic
2113 publication is switched on, default value is used for result name.
2116 New GEOM.GEOM_Object, containing the created ellipse.
2118 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2119 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2120 self._autoPublish(anObj, theName, "ellipse")
2123 ## Create a polyline on the set of points.
2124 # @param thePoints Sequence of points for the polyline.
2125 # @param theIsClosed If True, build a closed wire.
2126 # @param theName Object name; when specified, this parameter is used
2127 # for result publication in the study. Otherwise, if automatic
2128 # publication is switched on, default value is used for result name.
2130 # @return New GEOM.GEOM_Object, containing the created polyline.
2132 # @ref tui_creation_curve "Example"
2133 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2135 Create a polyline on the set of points.
2138 thePoints Sequence of points for the polyline.
2139 theIsClosed If True, build a closed wire.
2140 theName Object name; when specified, this parameter is used
2141 for result publication in the study. Otherwise, if automatic
2142 publication is switched on, default value is used for result name.
2145 New GEOM.GEOM_Object, containing the created polyline.
2147 # Example: see GEOM_TestAll.py
2148 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2149 RaiseIfFailed("MakePolyline", self.CurvesOp)
2150 self._autoPublish(anObj, theName, "polyline")
2153 ## Create bezier curve on the set of points.
2154 # @param thePoints Sequence of points for the bezier curve.
2155 # @param theIsClosed If True, build a closed curve.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2162 # @ref tui_creation_curve "Example"
2163 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2165 Create bezier curve on the set of points.
2168 thePoints Sequence of points for the bezier curve.
2169 theIsClosed If True, build a closed curve.
2170 theName Object name; when specified, this parameter is used
2171 for result publication in the study. Otherwise, if automatic
2172 publication is switched on, default value is used for result name.
2175 New GEOM.GEOM_Object, containing the created bezier curve.
2177 # Example: see GEOM_TestAll.py
2178 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2179 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2180 self._autoPublish(anObj, theName, "bezier")
2183 ## Create B-Spline curve on the set of points.
2184 # @param thePoints Sequence of points for the B-Spline curve.
2185 # @param theIsClosed If True, build a closed curve.
2186 # @param theDoReordering If TRUE, the algo does not follow the order of
2187 # \a thePoints but searches for the closest vertex.
2188 # @param 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.
2192 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2194 # @ref tui_creation_curve "Example"
2195 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2197 Create B-Spline curve on the set of points.
2200 thePoints Sequence of points for the B-Spline curve.
2201 theIsClosed If True, build a closed curve.
2202 theDoReordering If True, the algo does not follow the order of
2203 thePoints but searches for the closest vertex.
2204 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.
2209 New GEOM.GEOM_Object, containing the created B-Spline curve.
2211 # Example: see GEOM_TestAll.py
2212 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2213 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2214 self._autoPublish(anObj, theName, "bspline")
2217 ## Create B-Spline curve on the set of points.
2218 # @param thePoints Sequence of points for the B-Spline curve.
2219 # @param theFirstVec Vector object, defining the curve direction at its first point.
2220 # @param theLastVec Vector object, defining the curve direction at its last point.
2221 # @param theName Object name; when specified, this parameter is used
2222 # for result publication in the study. Otherwise, if automatic
2223 # publication is switched on, default value is used for result name.
2225 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2227 # @ref tui_creation_curve "Example"
2228 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2230 Create B-Spline curve on the set of points.
2233 thePoints Sequence of points for the B-Spline curve.
2234 theFirstVec Vector object, defining the curve direction at its first point.
2235 theLastVec Vector object, defining the curve direction at its last point.
2236 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.
2241 New GEOM.GEOM_Object, containing the created B-Spline curve.
2243 # Example: see GEOM_TestAll.py
2244 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2245 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2246 self._autoPublish(anObj, theName, "bspline")
2249 ## Creates a curve using the parametric definition of the basic points.
2250 # @param thexExpr parametric equation of the coordinates X.
2251 # @param theyExpr parametric equation of the coordinates Y.
2252 # @param thezExpr parametric equation of the coordinates Z.
2253 # @param theParamMin the minimal value of the parameter.
2254 # @param theParamMax the maximum value of the parameter.
2255 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2256 # @param theCurveType the type of the curve,
2257 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2258 # @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.
2259 # @param theName Object name; when specified, this parameter is used
2260 # for result publication in the study. Otherwise, if automatic
2261 # publication is switched on, default value is used for result name.
2263 # @return New GEOM.GEOM_Object, containing the created curve.
2265 # @ref tui_creation_curve "Example"
2266 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2267 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2269 Creates a curve using the parametric definition of the basic points.
2272 thexExpr parametric equation of the coordinates X.
2273 theyExpr parametric equation of the coordinates Y.
2274 thezExpr parametric equation of the coordinates Z.
2275 theParamMin the minimal value of the parameter.
2276 theParamMax the maximum value of the parameter.
2277 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2278 theCurveType the type of the curve,
2279 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2280 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2281 method is used which can lead to a bug.
2282 theName Object name; when specified, this parameter is used
2283 for result publication in the study. Otherwise, if automatic
2284 publication is switched on, default value is used for result name.
2287 New GEOM.GEOM_Object, containing the created curve.
2289 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2291 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2293 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2294 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2295 anObj.SetParameters(Parameters)
2296 self._autoPublish(anObj, theName, "curve")
2302 ## @addtogroup l3_sketcher
2305 ## Create a sketcher (wire or face), following the textual description,
2306 # passed through <VAR>theCommand</VAR> argument. \n
2307 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2308 # Format of the description string have to be the following:
2310 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2313 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2315 # - "R angle" : Set the direction by angle
2316 # - "D dx dy" : Set the direction by DX & DY
2319 # - "TT x y" : Create segment by point at X & Y
2320 # - "T dx dy" : Create segment by point with DX & DY
2321 # - "L length" : Create segment by direction & Length
2322 # - "IX x" : Create segment by direction & Intersect. X
2323 # - "IY y" : Create segment by direction & Intersect. Y
2326 # - "C radius length" : Create arc by direction, radius and length(in degree)
2327 # - "AA x y": Create arc by point at X & Y
2328 # - "A dx dy" : Create arc by point with DX & DY
2329 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2330 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2331 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2332 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2335 # - "WW" : Close Wire (to finish)
2336 # - "WF" : Close Wire and build face (to finish)
2339 # - Flag1 (= reverse) is 0 or 2 ...
2340 # - if 0 the drawn arc is the one of lower angle (< Pi)
2341 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2344 # - Flag2 (= control tolerance) is 0 or 1 ...
2345 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2346 # - if 1 the wire is built only if the end point is on the arc
2347 # with a tolerance of 10^-7 on the distance else the creation fails
2349 # @param theCommand String, defining the sketcher in local
2350 # coordinates of the working plane.
2351 # @param theWorkingPlane Nine double values, defining origin,
2352 # OZ and OX directions of the working plane.
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 wire.
2359 # @ref tui_sketcher_page "Example"
2360 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2362 Create a sketcher (wire or face), following the textual description, passed
2363 through theCommand argument.
2364 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2365 Format of the description string have to be the following:
2366 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2368 - x1, y1 are coordinates of the first sketcher point (zero by default),
2370 - "R angle" : Set the direction by angle
2371 - "D dx dy" : Set the direction by DX & DY
2373 - "TT x y" : Create segment by point at X & Y
2374 - "T dx dy" : Create segment by point with DX & DY
2375 - "L length" : Create segment by direction & Length
2376 - "IX x" : Create segment by direction & Intersect. X
2377 - "IY y" : Create segment by direction & Intersect. Y
2379 - "C radius length" : Create arc by direction, radius and length(in degree)
2380 - "AA x y": Create arc by point at X & Y
2381 - "A dx dy" : Create arc by point with DX & DY
2382 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2383 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2384 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2385 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2387 - "WW" : Close Wire (to finish)
2388 - "WF" : Close Wire and build face (to finish)
2390 - Flag1 (= reverse) is 0 or 2 ...
2391 - if 0 the drawn arc is the one of lower angle (< Pi)
2392 - if 2 the drawn arc ius the one of greater angle (> Pi)
2394 - Flag2 (= control tolerance) is 0 or 1 ...
2395 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2396 - if 1 the wire is built only if the end point is on the arc
2397 with a tolerance of 10^-7 on the distance else the creation fails
2400 theCommand String, defining the sketcher in local
2401 coordinates of the working plane.
2402 theWorkingPlane Nine double values, defining origin,
2403 OZ and OX directions of the working plane.
2404 theName Object name; when specified, this parameter is used
2405 for result publication in the study. Otherwise, if automatic
2406 publication is switched on, default value is used for result name.
2409 New GEOM.GEOM_Object, containing the created wire.
2411 # Example: see GEOM_TestAll.py
2412 theCommand,Parameters = ParseSketcherCommand(theCommand)
2413 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2414 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2415 anObj.SetParameters(Parameters)
2416 self._autoPublish(anObj, theName, "wire")
2419 ## Create a sketcher (wire or face), following the textual description,
2420 # passed through <VAR>theCommand</VAR> argument. \n
2421 # For format of the description string see MakeSketcher() method.\n
2422 # @param theCommand String, defining the sketcher in local
2423 # coordinates of the working plane.
2424 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2425 # @param theName Object name; when specified, this parameter is used
2426 # for result publication in the study. Otherwise, if automatic
2427 # publication is switched on, default value is used for result name.
2429 # @return New GEOM.GEOM_Object, containing the created wire.
2431 # @ref tui_sketcher_page "Example"
2432 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2434 Create a sketcher (wire or face), following the textual description,
2435 passed through theCommand argument.
2436 For format of the description string see geompy.MakeSketcher() method.
2439 theCommand String, defining the sketcher in local
2440 coordinates of the working plane.
2441 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2442 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.
2447 New GEOM.GEOM_Object, containing the created wire.
2449 theCommand,Parameters = ParseSketcherCommand(theCommand)
2450 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2451 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2452 anObj.SetParameters(Parameters)
2453 self._autoPublish(anObj, theName, "wire")
2456 ## Obtain a 2D sketcher interface
2457 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2458 def Sketcher2D (self):
2460 Obtain a 2D sketcher interface.
2463 sk = geompy.Sketcher2D()
2465 sk.addSegmentRelative(15, 70)
2466 sk.addSegmentPerpY(50)
2467 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2468 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2469 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2471 Sketch_1 = sk.wire(geomObj_1)
2473 sk = Sketcher2D (self)
2476 ## Create a sketcher wire, following the numerical description,
2477 # passed through <VAR>theCoordinates</VAR> argument. \n
2478 # @param theCoordinates double values, defining points to create a wire,
2480 # @param theName Object name; when specified, this parameter is used
2481 # for result publication in the study. Otherwise, if automatic
2482 # publication is switched on, default value is used for result name.
2484 # @return New GEOM.GEOM_Object, containing the created wire.
2486 # @ref tui_3dsketcher_page "Example"
2487 def Make3DSketcher(self, theCoordinates, theName=None):
2489 Create a sketcher wire, following the numerical description,
2490 passed through theCoordinates argument.
2493 theCoordinates double values, defining points to create a wire,
2495 theName Object name; when specified, this parameter is used
2496 for result publication in the study. Otherwise, if automatic
2497 publication is switched on, default value is used for result name.
2500 New GEOM_Object, containing the created wire.
2502 theCoordinates,Parameters = ParseParameters(theCoordinates)
2503 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2504 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2505 anObj.SetParameters(Parameters)
2506 self._autoPublish(anObj, theName, "wire")
2509 ## Obtain a 3D sketcher interface
2510 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2512 # @ref tui_3dsketcher_page "Example"
2513 def Sketcher3D (self):
2515 Obtain a 3D sketcher interface.
2518 sk = geompy.Sketcher3D()
2519 sk.addPointsAbsolute(0,0,0, 70,0,0)
2520 sk.addPointsRelative(0, 0, 130)
2521 sk.addPointAnglesLength("OXY", 50, 0, 100)
2522 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2524 a3D_Sketcher_1 = sk.wire()
2526 sk = Sketcher3D (self)
2529 # end of l3_sketcher
2532 ## @addtogroup l3_3d_primitives
2535 ## Create a box by coordinates of two opposite vertices.
2537 # @param x1,y1,z1 double values, defining first point it.
2538 # @param x2,y2,z2 double values, defining first point it.
2539 # @param theName Object name; when specified, this parameter is used
2540 # for result publication in the study. Otherwise, if automatic
2541 # publication is switched on, default value is used for result name.
2543 # @return New GEOM.GEOM_Object, containing the created box.
2545 # @ref tui_creation_box "Example"
2546 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2548 Create a box by coordinates of two opposite vertices.
2551 x1,y1,z1 double values, defining first point.
2552 x2,y2,z2 double values, defining second point.
2553 theName Object name; when specified, this parameter is used
2554 for result publication in the study. Otherwise, if automatic
2555 publication is switched on, default value is used for result name.
2558 New GEOM.GEOM_Object, containing the created box.
2560 # Example: see GEOM_TestAll.py
2561 pnt1 = self.MakeVertex(x1,y1,z1)
2562 pnt2 = self.MakeVertex(x2,y2,z2)
2563 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2564 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2566 ## Create a box with specified dimensions along the coordinate axes
2567 # and with edges, parallel to the coordinate axes.
2568 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2569 # @param theDX Length of Box edges, parallel to OX axis.
2570 # @param theDY Length of Box edges, parallel to OY axis.
2571 # @param theDZ Length of Box edges, parallel to OZ axis.
2572 # @param theName Object name; when specified, this parameter is used
2573 # for result publication in the study. Otherwise, if automatic
2574 # publication is switched on, default value is used for result name.
2576 # @return New GEOM.GEOM_Object, containing the created box.
2578 # @ref tui_creation_box "Example"
2579 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2581 Create a box with specified dimensions along the coordinate axes
2582 and with edges, parallel to the coordinate axes.
2583 Center of the box will be at point (DX/2, DY/2, DZ/2).
2586 theDX Length of Box edges, parallel to OX axis.
2587 theDY Length of Box edges, parallel to OY axis.
2588 theDZ Length of Box edges, parallel to OZ axis.
2589 theName Object name; when specified, this parameter is used
2590 for result publication in the study. Otherwise, if automatic
2591 publication is switched on, default value is used for result name.
2594 New GEOM.GEOM_Object, containing the created box.
2596 # Example: see GEOM_TestAll.py
2597 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2598 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2599 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2600 anObj.SetParameters(Parameters)
2601 self._autoPublish(anObj, theName, "box")
2604 ## Create a box with two specified opposite vertices,
2605 # and with edges, parallel to the coordinate axes
2606 # @param thePnt1 First of two opposite vertices.
2607 # @param thePnt2 Second of two opposite vertices.
2608 # @param theName Object name; when specified, this parameter is used
2609 # for result publication in the study. Otherwise, if automatic
2610 # publication is switched on, default value is used for result name.
2612 # @return New GEOM.GEOM_Object, containing the created box.
2614 # @ref tui_creation_box "Example"
2615 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2617 Create a box with two specified opposite vertices,
2618 and with edges, parallel to the coordinate axes
2621 thePnt1 First of two opposite vertices.
2622 thePnt2 Second of two opposite vertices.
2623 theName Object name; when specified, this parameter is used
2624 for result publication in the study. Otherwise, if automatic
2625 publication is switched on, default value is used for result name.
2628 New GEOM.GEOM_Object, containing the created box.
2630 # Example: see GEOM_TestAll.py
2631 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2632 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2633 self._autoPublish(anObj, theName, "box")
2636 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2637 # @param theH height of Face.
2638 # @param theW width of Face.
2639 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2640 # @param theName Object name; when specified, this parameter is used
2641 # for result publication in the study. Otherwise, if automatic
2642 # publication is switched on, default value is used for result name.
2644 # @return New GEOM.GEOM_Object, containing the created face.
2646 # @ref tui_creation_face "Example"
2647 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2649 Create a face with specified dimensions with edges parallel to coordinate axes.
2652 theH height of Face.
2654 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2655 theName Object name; when specified, this parameter is used
2656 for result publication in the study. Otherwise, if automatic
2657 publication is switched on, default value is used for result name.
2660 New GEOM.GEOM_Object, containing the created face.
2662 # Example: see GEOM_TestAll.py
2663 theH,theW,Parameters = ParseParameters(theH, theW)
2664 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2665 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2666 anObj.SetParameters(Parameters)
2667 self._autoPublish(anObj, theName, "rectangle")
2670 ## Create a face from another plane and two sizes,
2671 # vertical size and horisontal size.
2672 # @param theObj Normale vector to the creating face or
2674 # @param theH Height (vertical size).
2675 # @param theW Width (horisontal size).
2676 # @param theName Object name; when specified, this parameter is used
2677 # for result publication in the study. Otherwise, if automatic
2678 # publication is switched on, default value is used for result name.
2680 # @return New GEOM.GEOM_Object, containing the created face.
2682 # @ref tui_creation_face "Example"
2683 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2685 Create a face from another plane and two sizes,
2686 vertical size and horisontal size.
2689 theObj Normale vector to the creating face or
2691 theH Height (vertical size).
2692 theW Width (horisontal size).
2693 theName Object name; when specified, this parameter is used
2694 for result publication in the study. Otherwise, if automatic
2695 publication is switched on, default value is used for result name.
2698 New GEOM_Object, containing the created face.
2700 # Example: see GEOM_TestAll.py
2701 theH,theW,Parameters = ParseParameters(theH, theW)
2702 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2703 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2704 anObj.SetParameters(Parameters)
2705 self._autoPublish(anObj, theName, "rectangle")
2708 ## Create a disk with given center, normal vector and radius.
2709 # @param thePnt Disk center.
2710 # @param theVec Vector, normal to the plane of the disk.
2711 # @param theR Disk radius.
2712 # @param 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.
2716 # @return New GEOM.GEOM_Object, containing the created disk.
2718 # @ref tui_creation_disk "Example"
2719 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2721 Create a disk with given center, normal vector and radius.
2725 theVec Vector, normal to the plane of the disk.
2727 theName Object name; when specified, this parameter is used
2728 for result publication in the study. Otherwise, if automatic
2729 publication is switched on, default value is used for result name.
2732 New GEOM.GEOM_Object, containing the created disk.
2734 # Example: see GEOM_TestAll.py
2735 theR,Parameters = ParseParameters(theR)
2736 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2737 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2738 anObj.SetParameters(Parameters)
2739 self._autoPublish(anObj, theName, "disk")
2742 ## Create a disk, passing through three given points
2743 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2744 # @param 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.
2748 # @return New GEOM.GEOM_Object, containing the created disk.
2750 # @ref tui_creation_disk "Example"
2751 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2753 Create a disk, passing through three given points
2756 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2757 theName Object name; when specified, this parameter is used
2758 for result publication in the study. Otherwise, if automatic
2759 publication is switched on, default value is used for result name.
2762 New GEOM.GEOM_Object, containing the created disk.
2764 # Example: see GEOM_TestAll.py
2765 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2766 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2767 self._autoPublish(anObj, theName, "disk")
2770 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2771 # @param theR Radius of Face.
2772 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2773 # @param theName Object name; when specified, this parameter is used
2774 # for result publication in the study. Otherwise, if automatic
2775 # publication is switched on, default value is used for result name.
2777 # @return New GEOM.GEOM_Object, containing the created disk.
2779 # @ref tui_creation_face "Example"
2780 def MakeDiskR(self, theR, theOrientation, theName=None):
2782 Create a disk with specified dimensions along OX-OY coordinate axes.
2785 theR Radius of Face.
2786 theOrientation set the orientation belong axis OXY or OYZ or OZX
2787 theName Object name; when specified, this parameter is used
2788 for result publication in the study. Otherwise, if automatic
2789 publication is switched on, default value is used for result name.
2792 New GEOM.GEOM_Object, containing the created disk.
2795 Disk3 = geompy.MakeDiskR(100., 1)
2797 # Example: see GEOM_TestAll.py
2798 theR,Parameters = ParseParameters(theR)
2799 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2800 RaiseIfFailed("MakeDiskR", self.PrimOp)
2801 anObj.SetParameters(Parameters)
2802 self._autoPublish(anObj, theName, "disk")
2805 ## Create a cylinder with given base point, axis, radius and height.
2806 # @param thePnt Central point of cylinder base.
2807 # @param theAxis Cylinder axis.
2808 # @param theR Cylinder radius.
2809 # @param theH Cylinder height.
2810 # @param theName Object name; when specified, this parameter is used
2811 # for result publication in the study. Otherwise, if automatic
2812 # publication is switched on, default value is used for result name.
2814 # @return New GEOM.GEOM_Object, containing the created cylinder.
2816 # @ref tui_creation_cylinder "Example"
2817 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2819 Create a cylinder with given base point, axis, radius and height.
2822 thePnt Central point of cylinder base.
2823 theAxis Cylinder axis.
2824 theR Cylinder radius.
2825 theH Cylinder height.
2826 theName Object name; when specified, this parameter is used
2827 for result publication in the study. Otherwise, if automatic
2828 publication is switched on, default value is used for result name.
2831 New GEOM.GEOM_Object, containing the created cylinder.
2833 # Example: see GEOM_TestAll.py
2834 theR,theH,Parameters = ParseParameters(theR, theH)
2835 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2836 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2837 anObj.SetParameters(Parameters)
2838 self._autoPublish(anObj, theName, "cylinder")
2841 ## Create a cylinder with given radius and height at
2842 # the origin of coordinate system. Axis of the cylinder
2843 # will be collinear to the OZ axis of the coordinate system.
2844 # @param theR Cylinder radius.
2845 # @param theH Cylinder height.
2846 # @param 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.
2850 # @return New GEOM.GEOM_Object, containing the created cylinder.
2852 # @ref tui_creation_cylinder "Example"
2853 def MakeCylinderRH(self, theR, theH, theName=None):
2855 Create a cylinder with given radius and height at
2856 the origin of coordinate system. Axis of the cylinder
2857 will be collinear to the OZ axis of the coordinate system.
2860 theR Cylinder radius.
2861 theH Cylinder height.
2862 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.
2867 New GEOM.GEOM_Object, containing the created cylinder.
2869 # Example: see GEOM_TestAll.py
2870 theR,theH,Parameters = ParseParameters(theR, theH)
2871 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2872 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2873 anObj.SetParameters(Parameters)
2874 self._autoPublish(anObj, theName, "cylinder")
2877 ## Create a sphere with given center and radius.
2878 # @param thePnt Sphere center.
2879 # @param theR Sphere radius.
2880 # @param theName Object name; when specified, this parameter is used
2881 # for result publication in the study. Otherwise, if automatic
2882 # publication is switched on, default value is used for result name.
2884 # @return New GEOM.GEOM_Object, containing the created sphere.
2886 # @ref tui_creation_sphere "Example"
2887 def MakeSpherePntR(self, thePnt, theR, theName=None):
2889 Create a sphere with given center and radius.
2892 thePnt Sphere center.
2894 theName Object name; when specified, this parameter is used
2895 for result publication in the study. Otherwise, if automatic
2896 publication is switched on, default value is used for result name.
2899 New GEOM.GEOM_Object, containing the created sphere.
2901 # Example: see GEOM_TestAll.py
2902 theR,Parameters = ParseParameters(theR)
2903 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2904 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2905 anObj.SetParameters(Parameters)
2906 self._autoPublish(anObj, theName, "sphere")
2909 ## Create a sphere with given center and radius.
2910 # @param x,y,z Coordinates of sphere center.
2911 # @param theR Sphere radius.
2912 # @param theName Object name; when specified, this parameter is used
2913 # for result publication in the study. Otherwise, if automatic
2914 # publication is switched on, default value is used for result name.
2916 # @return New GEOM.GEOM_Object, containing the created sphere.
2918 # @ref tui_creation_sphere "Example"
2919 def MakeSphere(self, x, y, z, theR, theName=None):
2921 Create a sphere with given center and radius.
2924 x,y,z Coordinates of sphere center.
2926 theName Object name; when specified, this parameter is used
2927 for result publication in the study. Otherwise, if automatic
2928 publication is switched on, default value is used for result name.
2931 New GEOM.GEOM_Object, containing the created sphere.
2933 # Example: see GEOM_TestAll.py
2934 point = self.MakeVertex(x, y, z)
2935 # note: auto-publishing is done in self.MakeSpherePntR()
2936 anObj = self.MakeSpherePntR(point, theR, theName)
2939 ## Create a sphere with given radius at the origin of coordinate system.
2940 # @param theR Sphere radius.
2941 # @param theName Object name; when specified, this parameter is used
2942 # for result publication in the study. Otherwise, if automatic
2943 # publication is switched on, default value is used for result name.
2945 # @return New GEOM.GEOM_Object, containing the created sphere.
2947 # @ref tui_creation_sphere "Example"
2948 def MakeSphereR(self, theR, theName=None):
2950 Create a sphere with given radius at the origin of coordinate system.
2954 theName Object name; when specified, this parameter is used
2955 for result publication in the study. Otherwise, if automatic
2956 publication is switched on, default value is used for result name.
2959 New GEOM.GEOM_Object, containing the created sphere.
2961 # Example: see GEOM_TestAll.py
2962 theR,Parameters = ParseParameters(theR)
2963 anObj = self.PrimOp.MakeSphereR(theR)
2964 RaiseIfFailed("MakeSphereR", self.PrimOp)
2965 anObj.SetParameters(Parameters)
2966 self._autoPublish(anObj, theName, "sphere")
2969 ## Create a cone with given base point, axis, height and radiuses.
2970 # @param thePnt Central point of the first cone base.
2971 # @param theAxis Cone axis.
2972 # @param theR1 Radius of the first cone base.
2973 # @param theR2 Radius of the second cone base.
2974 # \note If both radiuses are non-zero, the cone will be truncated.
2975 # \note If the radiuses are equal, a cylinder will be created instead.
2976 # @param theH Cone height.
2977 # @param theName Object name; when specified, this parameter is used
2978 # for result publication in the study. Otherwise, if automatic
2979 # publication is switched on, default value is used for result name.
2981 # @return New GEOM.GEOM_Object, containing the created cone.
2983 # @ref tui_creation_cone "Example"
2984 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2986 Create a cone with given base point, axis, height and radiuses.
2989 thePnt Central point of the first cone base.
2991 theR1 Radius of the first cone base.
2992 theR2 Radius of the second cone base.
2994 theName Object name; when specified, this parameter is used
2995 for result publication in the study. Otherwise, if automatic
2996 publication is switched on, default value is used for result name.
2999 If both radiuses are non-zero, the cone will be truncated.
3000 If the radiuses are equal, a cylinder will be created instead.
3003 New GEOM.GEOM_Object, containing the created cone.
3005 # Example: see GEOM_TestAll.py
3006 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3007 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3008 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3009 anObj.SetParameters(Parameters)
3010 self._autoPublish(anObj, theName, "cone")
3013 ## Create a cone with given height and radiuses at
3014 # the origin of coordinate system. Axis of the cone will
3015 # be collinear to the OZ axis of the coordinate system.
3016 # @param theR1 Radius of the first cone base.
3017 # @param theR2 Radius of the second cone base.
3018 # \note If both radiuses are non-zero, the cone will be truncated.
3019 # \note If the radiuses are equal, a cylinder will be created instead.
3020 # @param theH Cone height.
3021 # @param theName Object name; when specified, this parameter is used
3022 # for result publication in the study. Otherwise, if automatic
3023 # publication is switched on, default value is used for result name.
3025 # @return New GEOM.GEOM_Object, containing the created cone.
3027 # @ref tui_creation_cone "Example"
3028 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3030 Create a cone with given height and radiuses at
3031 the origin of coordinate system. Axis of the cone will
3032 be collinear to the OZ axis of the coordinate system.
3035 theR1 Radius of the first cone base.
3036 theR2 Radius of the second cone base.
3038 theName Object name; when specified, this parameter is used
3039 for result publication in the study. Otherwise, if automatic
3040 publication is switched on, default value is used for result name.
3043 If both radiuses are non-zero, the cone will be truncated.
3044 If the radiuses are equal, a cylinder will be created instead.
3047 New GEOM.GEOM_Object, containing the created cone.
3049 # Example: see GEOM_TestAll.py
3050 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3051 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3052 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3053 anObj.SetParameters(Parameters)
3054 self._autoPublish(anObj, theName, "cone")
3057 ## Create a torus with given center, normal vector and radiuses.
3058 # @param thePnt Torus central point.
3059 # @param theVec Torus axis of symmetry.
3060 # @param theRMajor Torus major radius.
3061 # @param theRMinor Torus minor radius.
3062 # @param theName Object name; when specified, this parameter is used
3063 # for result publication in the study. Otherwise, if automatic
3064 # publication is switched on, default value is used for result name.
3066 # @return New GEOM.GEOM_Object, containing the created torus.
3068 # @ref tui_creation_torus "Example"
3069 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3071 Create a torus with given center, normal vector and radiuses.
3074 thePnt Torus central point.
3075 theVec Torus axis of symmetry.
3076 theRMajor Torus major radius.
3077 theRMinor Torus minor radius.
3078 theName Object name; when specified, this parameter is used
3079 for result publication in the study. Otherwise, if automatic
3080 publication is switched on, default value is used for result name.
3083 New GEOM.GEOM_Object, containing the created torus.
3085 # Example: see GEOM_TestAll.py
3086 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3087 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3088 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3089 anObj.SetParameters(Parameters)
3090 self._autoPublish(anObj, theName, "torus")
3093 ## Create a torus with given radiuses at the origin of coordinate system.
3094 # @param theRMajor Torus major radius.
3095 # @param theRMinor Torus minor radius.
3096 # @param theName Object name; when specified, this parameter is used
3097 # for result publication in the study. Otherwise, if automatic
3098 # publication is switched on, default value is used for result name.
3100 # @return New GEOM.GEOM_Object, containing the created torus.
3102 # @ref tui_creation_torus "Example"
3103 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3105 Create a torus with given radiuses at the origin of coordinate system.
3108 theRMajor Torus major radius.
3109 theRMinor Torus minor radius.
3110 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.
3115 New GEOM.GEOM_Object, containing the created torus.
3117 # Example: see GEOM_TestAll.py
3118 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3119 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3120 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3121 anObj.SetParameters(Parameters)
3122 self._autoPublish(anObj, theName, "torus")
3125 # end of l3_3d_primitives
3128 ## @addtogroup l3_complex
3131 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3132 # @param theBase Base shape to be extruded.
3133 # @param thePoint1 First end of extrusion vector.
3134 # @param thePoint2 Second end of extrusion vector.
3135 # @param theScaleFactor Use it to make prism with scaled second base.
3136 # Nagative value means not scaled second base.
3137 # @param theName Object name; when specified, this parameter is used
3138 # for result publication in the study. Otherwise, if automatic
3139 # publication is switched on, default value is used for result name.
3141 # @return New GEOM.GEOM_Object, containing the created prism.
3143 # @ref tui_creation_prism "Example"
3144 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3146 Create a shape by extrusion of the base shape along a vector, defined by two points.
3149 theBase Base shape to be extruded.
3150 thePoint1 First end of extrusion vector.
3151 thePoint2 Second end of extrusion vector.
3152 theScaleFactor Use it to make prism with scaled second base.
3153 Nagative value means not scaled second base.
3154 theName Object name; when specified, this parameter is used
3155 for result publication in the study. Otherwise, if automatic
3156 publication is switched on, default value is used for result name.
3159 New GEOM.GEOM_Object, containing the created prism.
3161 # Example: see GEOM_TestAll.py
3164 if theScaleFactor > 0:
3165 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3166 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3168 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3169 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3170 anObj.SetParameters(Parameters)
3171 self._autoPublish(anObj, theName, "prism")
3174 ## Create a shape by extrusion of the base shape along a
3175 # vector, defined by two points, in 2 Ways (forward/backward).
3176 # @param theBase Base shape to be extruded.
3177 # @param thePoint1 First end of extrusion vector.
3178 # @param thePoint2 Second end of extrusion vector.
3179 # @param theName Object name; when specified, this parameter is used
3180 # for result publication in the study. Otherwise, if automatic
3181 # publication is switched on, default value is used for result name.
3183 # @return New GEOM.GEOM_Object, containing the created prism.
3185 # @ref tui_creation_prism "Example"
3186 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3188 Create a shape by extrusion of the base shape along a
3189 vector, defined by two points, in 2 Ways (forward/backward).
3192 theBase Base shape to be extruded.
3193 thePoint1 First end of extrusion vector.
3194 thePoint2 Second end of extrusion vector.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created prism.
3202 # Example: see GEOM_TestAll.py
3203 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3204 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3205 self._autoPublish(anObj, theName, "prism")
3208 ## Create a shape by extrusion of the base shape along the vector,
3209 # i.e. all the space, transfixed by the base shape during its translation
3210 # along the vector on the given distance.
3211 # @param theBase Base shape to be extruded.
3212 # @param theVec Direction of extrusion.
3213 # @param theH Prism dimension along theVec.
3214 # @param theScaleFactor Use it to make prism with scaled second base.
3215 # Negative value means not scaled second base.
3216 # @param theName Object name; when specified, this parameter is used
3217 # for result publication in the study. Otherwise, if automatic
3218 # publication is switched on, default value is used for result name.
3220 # @return New GEOM.GEOM_Object, containing the created prism.
3222 # @ref tui_creation_prism "Example"
3223 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3225 Create a shape by extrusion of the base shape along the vector,
3226 i.e. all the space, transfixed by the base shape during its translation
3227 along the vector on the given distance.
3230 theBase Base shape to be extruded.
3231 theVec Direction of extrusion.
3232 theH Prism dimension along theVec.
3233 theScaleFactor Use it to make prism with scaled second base.
3234 Negative value means not scaled second base.
3235 theName Object name; when specified, this parameter is used
3236 for result publication in the study. Otherwise, if automatic
3237 publication is switched on, default value is used for result name.
3240 New GEOM.GEOM_Object, containing the created prism.
3242 # Example: see GEOM_TestAll.py
3245 if theScaleFactor > 0:
3246 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3247 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3249 theH,Parameters = ParseParameters(theH)
3250 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3251 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3252 anObj.SetParameters(Parameters)
3253 self._autoPublish(anObj, theName, "prism")
3256 ## Create a shape by extrusion of the base shape along the vector,
3257 # i.e. all the space, transfixed by the base shape during its translation
3258 # along the vector on the given distance in 2 Ways (forward/backward).
3259 # @param theBase Base shape to be extruded.
3260 # @param theVec Direction of extrusion.
3261 # @param theH Prism dimension along theVec in forward direction.
3262 # @param theName Object name; when specified, this parameter is used
3263 # for result publication in the study. Otherwise, if automatic
3264 # publication is switched on, default value is used for result name.
3266 # @return New GEOM.GEOM_Object, containing the created prism.
3268 # @ref tui_creation_prism "Example"
3269 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3271 Create a shape by extrusion of the base shape along the vector,
3272 i.e. all the space, transfixed by the base shape during its translation
3273 along the vector on the given distance in 2 Ways (forward/backward).
3276 theBase Base shape to be extruded.
3277 theVec Direction of extrusion.
3278 theH Prism dimension along theVec in forward direction.
3279 theName Object name; when specified, this parameter is used
3280 for result publication in the study. Otherwise, if automatic
3281 publication is switched on, default value is used for result name.
3284 New GEOM.GEOM_Object, containing the created prism.
3286 # Example: see GEOM_TestAll.py
3287 theH,Parameters = ParseParameters(theH)
3288 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3289 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3290 anObj.SetParameters(Parameters)
3291 self._autoPublish(anObj, theName, "prism")
3294 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3295 # @param theBase Base shape to be extruded.
3296 # @param theDX, theDY, theDZ Directions of extrusion.
3297 # @param theScaleFactor Use it to make prism with scaled second base.
3298 # Nagative value means not scaled second base.
3299 # @param theName Object name; when specified, this parameter is used
3300 # for result publication in the study. Otherwise, if automatic
3301 # publication is switched on, default value is used for result name.
3303 # @return New GEOM.GEOM_Object, containing the created prism.
3305 # @ref tui_creation_prism "Example"
3306 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3308 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3311 theBase Base shape to be extruded.
3312 theDX, theDY, theDZ Directions of extrusion.
3313 theScaleFactor Use it to make prism with scaled second base.
3314 Nagative value means not scaled second base.
3315 theName Object name; when specified, this parameter is used
3316 for result publication in the study. Otherwise, if automatic
3317 publication is switched on, default value is used for result name.
3320 New GEOM.GEOM_Object, containing the created prism.
3322 # Example: see GEOM_TestAll.py
3325 if theScaleFactor > 0:
3326 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3327 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3329 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3330 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3331 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3332 anObj.SetParameters(Parameters)
3333 self._autoPublish(anObj, theName, "prism")
3336 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3337 # i.e. all the space, transfixed by the base shape during its translation
3338 # along the vector on the given distance in 2 Ways (forward/backward).
3339 # @param theBase Base shape to be extruded.
3340 # @param theDX, theDY, theDZ Directions of extrusion.
3341 # @param theName Object name; when specified, this parameter is used
3342 # for result publication in the study. Otherwise, if automatic
3343 # publication is switched on, default value is used for result name.
3345 # @return New GEOM.GEOM_Object, containing the created prism.
3347 # @ref tui_creation_prism "Example"
3348 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3350 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3351 i.e. all the space, transfixed by the base shape during its translation
3352 along the vector on the given distance in 2 Ways (forward/backward).
3355 theBase Base shape to be extruded.
3356 theDX, theDY, theDZ Directions of extrusion.
3357 theName Object name; when specified, this parameter is used
3358 for result publication in the study. Otherwise, if automatic
3359 publication is switched on, default value is used for result name.
3362 New GEOM.GEOM_Object, containing the created prism.
3364 # Example: see GEOM_TestAll.py
3365 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3366 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3367 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3368 anObj.SetParameters(Parameters)
3369 self._autoPublish(anObj, theName, "prism")
3372 ## Create a shape by revolution of the base shape around the axis
3373 # on the given angle, i.e. all the space, transfixed by the base
3374 # shape during its rotation around the axis on the given angle.
3375 # @param theBase Base shape to be rotated.
3376 # @param theAxis Rotation axis.
3377 # @param theAngle Rotation angle in radians.
3378 # @param theName Object name; when specified, this parameter is used
3379 # for result publication in the study. Otherwise, if automatic
3380 # publication is switched on, default value is used for result name.
3382 # @return New GEOM.GEOM_Object, containing the created revolution.
3384 # @ref tui_creation_revolution "Example"
3385 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3387 Create a shape by revolution of the base shape around the axis
3388 on the given angle, i.e. all the space, transfixed by the base
3389 shape during its rotation around the axis on the given angle.
3392 theBase Base shape to be rotated.
3393 theAxis Rotation axis.
3394 theAngle Rotation angle in radians.
3395 theName Object name; when specified, this parameter is used
3396 for result publication in the study. Otherwise, if automatic
3397 publication is switched on, default value is used for result name.
3400 New GEOM.GEOM_Object, containing the created revolution.
3402 # Example: see GEOM_TestAll.py
3403 theAngle,Parameters = ParseParameters(theAngle)
3404 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3405 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3406 anObj.SetParameters(Parameters)
3407 self._autoPublish(anObj, theName, "revolution")
3410 ## Create a shape by revolution of the base shape around the axis
3411 # on the given angle, i.e. all the space, transfixed by the base
3412 # shape during its rotation around the axis on the given angle in
3413 # both directions (forward/backward)
3414 # @param theBase Base shape to be rotated.
3415 # @param theAxis Rotation axis.
3416 # @param theAngle Rotation angle in radians.
3417 # @param theName Object name; when specified, this parameter is used
3418 # for result publication in the study. Otherwise, if automatic
3419 # publication is switched on, default value is used for result name.
3421 # @return New GEOM.GEOM_Object, containing the created revolution.
3423 # @ref tui_creation_revolution "Example"
3424 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3426 Create a shape by revolution of the base shape around the axis
3427 on the given angle, i.e. all the space, transfixed by the base
3428 shape during its rotation around the axis on the given angle in
3429 both directions (forward/backward).
3432 theBase Base shape to be rotated.
3433 theAxis Rotation axis.
3434 theAngle Rotation angle in radians.
3435 theName Object name; when specified, this parameter is used
3436 for result publication in the study. Otherwise, if automatic
3437 publication is switched on, default value is used for result name.
3440 New GEOM.GEOM_Object, containing the created revolution.
3442 theAngle,Parameters = ParseParameters(theAngle)
3443 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3444 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3445 anObj.SetParameters(Parameters)
3446 self._autoPublish(anObj, theName, "revolution")
3449 ## Create a filling from the given compound of contours.
3450 # @param theShape the compound of contours
3451 # @param theMinDeg a minimal degree of BSpline surface to create
3452 # @param theMaxDeg a maximal degree of BSpline surface to create
3453 # @param theTol2D a 2d tolerance to be reached
3454 # @param theTol3D a 3d tolerance to be reached
3455 # @param theNbIter a number of iteration of approximation algorithm
3456 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3457 # @param isApprox if True, BSpline curves are generated in the process
3458 # of surface construction. By default it is False, that means
3459 # the surface is created using given curves. The usage of
3460 # Approximation makes the algorithm work slower, but allows
3461 # building the surface for rather complex cases.
3462 # @param theName Object name; when specified, this parameter is used
3463 # for result publication in the study. Otherwise, if automatic
3464 # publication is switched on, default value is used for result name.
3466 # @return New GEOM.GEOM_Object, containing the created filling surface.
3468 # @ref tui_creation_filling "Example"
3469 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3470 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3472 Create a filling from the given compound of contours.
3475 theShape the compound of contours
3476 theMinDeg a minimal degree of BSpline surface to create
3477 theMaxDeg a maximal degree of BSpline surface to create
3478 theTol2D a 2d tolerance to be reached
3479 theTol3D a 3d tolerance to be reached
3480 theNbIter a number of iteration of approximation algorithm
3481 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3482 isApprox if True, BSpline curves are generated in the process
3483 of surface construction. By default it is False, that means
3484 the surface is created using given curves. The usage of
3485 Approximation makes the algorithm work slower, but allows
3486 building the surface for rather complex cases
3487 theName Object name; when specified, this parameter is used
3488 for result publication in the study. Otherwise, if automatic
3489 publication is switched on, default value is used for result name.
3492 New GEOM.GEOM_Object, containing the created filling surface.
3495 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3497 # Example: see GEOM_TestAll.py
3498 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3499 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3500 theTol2D, theTol3D, theNbIter,
3501 theMethod, isApprox)
3502 RaiseIfFailed("MakeFilling", self.PrimOp)
3503 anObj.SetParameters(Parameters)
3504 self._autoPublish(anObj, theName, "filling")
3508 ## Create a filling from the given compound of contours.
3509 # This method corresponds to MakeFilling with isApprox=True
3510 # @param theShape the compound of contours
3511 # @param theMinDeg a minimal degree of BSpline surface to create
3512 # @param theMaxDeg a maximal degree of BSpline surface to create
3513 # @param theTol3D a 3d tolerance to be reached
3514 # @param theName Object name; when specified, this parameter is used
3515 # for result publication in the study. Otherwise, if automatic
3516 # publication is switched on, default value is used for result name.
3518 # @return New GEOM.GEOM_Object, containing the created filling surface.
3520 # @ref tui_creation_filling "Example"
3521 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3523 Create a filling from the given compound of contours.
3524 This method corresponds to MakeFilling with isApprox=True
3527 theShape the compound of contours
3528 theMinDeg a minimal degree of BSpline surface to create
3529 theMaxDeg a maximal degree of BSpline surface to create
3530 theTol3D a 3d tolerance to be reached
3531 theName Object name; when specified, this parameter is used
3532 for result publication in the study. Otherwise, if automatic
3533 publication is switched on, default value is used for result name.
3536 New GEOM.GEOM_Object, containing the created filling surface.
3539 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3541 # Example: see GEOM_TestAll.py
3542 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3543 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3544 0, theTol3D, 0, GEOM.FOM_Default, True)
3545 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3546 anObj.SetParameters(Parameters)
3547 self._autoPublish(anObj, theName, "filling")
3550 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3551 # @param theSeqSections - set of specified sections.
3552 # @param theModeSolid - mode defining building solid or shell
3553 # @param thePreci - precision 3D used for smoothing
3554 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3555 # @param theName Object name; when specified, this parameter is used
3556 # for result publication in the study. Otherwise, if automatic
3557 # publication is switched on, default value is used for result name.
3559 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3561 # @ref swig_todo "Example"
3562 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3564 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3567 theSeqSections - set of specified sections.
3568 theModeSolid - mode defining building solid or shell
3569 thePreci - precision 3D used for smoothing
3570 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3571 theName Object name; when specified, this parameter is used
3572 for result publication in the study. Otherwise, if automatic
3573 publication is switched on, default value is used for result name.
3576 New GEOM.GEOM_Object, containing the created shell or solid.
3578 # Example: see GEOM_TestAll.py
3579 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3580 RaiseIfFailed("MakeThruSections", self.PrimOp)
3581 self._autoPublish(anObj, theName, "filling")
3584 ## Create a shape by extrusion of the base shape along
3585 # the path shape. The path shape can be a wire or an edge.
3586 # @param theBase Base shape to be extruded.
3587 # @param thePath Path shape to extrude the base shape along it.
3588 # @param theName Object name; when specified, this parameter is used
3589 # for result publication in the study. Otherwise, if automatic
3590 # publication is switched on, default value is used for result name.
3592 # @return New GEOM.GEOM_Object, containing the created pipe.
3594 # @ref tui_creation_pipe "Example"
3595 def MakePipe(self, theBase, thePath, theName=None):
3597 Create a shape by extrusion of the base shape along
3598 the path shape. The path shape can be a wire or an edge.
3601 theBase Base shape to be extruded.
3602 thePath Path shape to extrude the base shape along it.
3603 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.
3608 New GEOM.GEOM_Object, containing the created pipe.
3610 # Example: see GEOM_TestAll.py
3611 anObj = self.PrimOp.MakePipe(theBase, thePath)
3612 RaiseIfFailed("MakePipe", self.PrimOp)
3613 self._autoPublish(anObj, theName, "pipe")
3616 ## Create a shape by extrusion of the profile shape along
3617 # the path shape. The path shape can be a wire or an edge.
3618 # the several profiles can be specified in the several locations of path.
3619 # @param theSeqBases - list of Bases shape to be extruded.
3620 # @param theLocations - list of locations on the path corresponding
3621 # specified list of the Bases shapes. Number of locations
3622 # should be equal to number of bases or list of locations can be empty.
3623 # @param thePath - Path shape to extrude the base shape along it.
3624 # @param theWithContact - the mode defining that the section is translated to be in
3625 # contact with the spine.
3626 # @param theWithCorrection - defining that the section is rotated to be
3627 # orthogonal to the spine tangent in the correspondent point
3628 # @param theName Object name; when specified, this parameter is used
3629 # for result publication in the study. Otherwise, if automatic
3630 # publication is switched on, default value is used for result name.
3632 # @return New GEOM.GEOM_Object, containing the created pipe.
3634 # @ref tui_creation_pipe_with_diff_sec "Example"
3635 def MakePipeWithDifferentSections(self, theSeqBases,
3636 theLocations, thePath,
3637 theWithContact, theWithCorrection, theName=None):
3639 Create a shape by extrusion of the profile shape along
3640 the path shape. The path shape can be a wire or an edge.
3641 the several profiles can be specified in the several locations of path.
3644 theSeqBases - list of Bases shape to be extruded.
3645 theLocations - list of locations on the path corresponding
3646 specified list of the Bases shapes. Number of locations
3647 should be equal to number of bases or list of locations can be empty.
3648 thePath - Path shape to extrude the base shape along it.
3649 theWithContact - the mode defining that the section is translated to be in
3650 contact with the spine(0/1)
3651 theWithCorrection - defining that the section is rotated to be
3652 orthogonal to the spine tangent in the correspondent point (0/1)
3653 theName Object name; when specified, this parameter is used
3654 for result publication in the study. Otherwise, if automatic
3655 publication is switched on, default value is used for result name.
3658 New GEOM.GEOM_Object, containing the created pipe.
3660 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3661 theLocations, thePath,
3662 theWithContact, theWithCorrection)
3663 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3664 self._autoPublish(anObj, theName, "pipe")
3667 ## Create a shape by extrusion of the profile shape along
3668 # the path shape. The path shape can be a wire or a edge.
3669 # the several profiles can be specified in the several locations of path.
3670 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3671 # shell or face. If number of faces in neighbour sections
3672 # aren't coincided result solid between such sections will
3673 # be created using external boundaries of this shells.
3674 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3675 # This list is used for searching correspondences between
3676 # faces in the sections. Size of this list must be equal
3677 # to size of list of base shapes.
3678 # @param theLocations - list of locations on the path corresponding
3679 # specified list of the Bases shapes. Number of locations
3680 # should be equal to number of bases. First and last
3681 # locations must be coincided with first and last vertexes
3682 # of path correspondingly.
3683 # @param thePath - Path shape to extrude the base shape along it.
3684 # @param theWithContact - the mode defining that the section is translated to be in
3685 # contact with the spine.
3686 # @param theWithCorrection - defining that the section is rotated to be
3687 # orthogonal to the spine tangent in the correspondent point
3688 # @param theName Object name; when specified, this parameter is used
3689 # for result publication in the study. Otherwise, if automatic
3690 # publication is switched on, default value is used for result name.
3692 # @return New GEOM.GEOM_Object, containing the created solids.
3694 # @ref tui_creation_pipe_with_shell_sec "Example"
3695 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3696 theLocations, thePath,
3697 theWithContact, theWithCorrection, theName=None):
3699 Create a shape by extrusion of the profile shape along
3700 the path shape. The path shape can be a wire or a edge.
3701 the several profiles can be specified in the several locations of path.
3704 theSeqBases - list of Bases shape to be extruded. Base shape must be
3705 shell or face. If number of faces in neighbour sections
3706 aren't coincided result solid between such sections will
3707 be created using external boundaries of this shells.
3708 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3709 This list is used for searching correspondences between
3710 faces in the sections. Size of this list must be equal
3711 to size of list of base shapes.
3712 theLocations - list of locations on the path corresponding
3713 specified list of the Bases shapes. Number of locations
3714 should be equal to number of bases. First and last
3715 locations must be coincided with first and last vertexes
3716 of path correspondingly.
3717 thePath - Path shape to extrude the base shape along it.
3718 theWithContact - the mode defining that the section is translated to be in
3719 contact with the spine (0/1)
3720 theWithCorrection - defining that the section is rotated to be
3721 orthogonal to the spine tangent in the correspondent point (0/1)
3722 theName Object name; when specified, this parameter is used
3723 for result publication in the study. Otherwise, if automatic
3724 publication is switched on, default value is used for result name.
3727 New GEOM.GEOM_Object, containing the created solids.
3729 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3730 theLocations, thePath,
3731 theWithContact, theWithCorrection)
3732 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3733 self._autoPublish(anObj, theName, "pipe")
3736 ## Create a shape by extrusion of the profile shape along
3737 # the path shape. This function is used only for debug pipe
3738 # functionality - it is a version of function MakePipeWithShellSections()
3739 # which give a possibility to recieve information about
3740 # creating pipe between each pair of sections step by step.
3741 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3742 theLocations, thePath,
3743 theWithContact, theWithCorrection, theName=None):
3745 Create a shape by extrusion of the profile shape along
3746 the path shape. This function is used only for debug pipe
3747 functionality - it is a version of previous function
3748 geompy.MakePipeWithShellSections() which give a possibility to
3749 recieve information about creating pipe between each pair of
3750 sections step by step.
3753 nbsect = len(theSeqBases)
3754 nbsubsect = len(theSeqSubBases)
3755 #print "nbsect = ",nbsect
3756 for i in range(1,nbsect):
3758 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3759 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3761 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3762 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3763 tmpLocations, thePath,
3764 theWithContact, theWithCorrection)
3765 if self.PrimOp.IsDone() == 0:
3766 print "Problems with pipe creation between ",i," and ",i+1," sections"
3767 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3770 print "Pipe between ",i," and ",i+1," sections is OK"
3775 resc = self.MakeCompound(res)
3776 #resc = self.MakeSewing(res, 0.001)
3777 #print "resc: ",resc
3778 self._autoPublish(resc, theName, "pipe")
3781 ## Create solids between given sections
3782 # @param theSeqBases - list of sections (shell or face).
3783 # @param theLocations - list of corresponding vertexes
3784 # @param theName Object name; when specified, this parameter is used
3785 # for result publication in the study. Otherwise, if automatic
3786 # publication is switched on, default value is used for result name.
3788 # @return New GEOM.GEOM_Object, containing the created solids.
3790 # @ref tui_creation_pipe_without_path "Example"
3791 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3793 Create solids between given sections
3796 theSeqBases - list of sections (shell or face).
3797 theLocations - list of corresponding vertexes
3798 theName Object name; when specified, this parameter is used
3799 for result publication in the study. Otherwise, if automatic
3800 publication is switched on, default value is used for result name.
3803 New GEOM.GEOM_Object, containing the created solids.
3805 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3806 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3807 self._autoPublish(anObj, theName, "pipe")
3810 ## Create a shape by extrusion of the base shape along
3811 # the path shape with constant bi-normal direction along the given vector.
3812 # The path shape can be a wire or an edge.
3813 # @param theBase Base shape to be extruded.
3814 # @param thePath Path shape to extrude the base shape along it.
3815 # @param theVec Vector defines a constant binormal direction to keep the
3816 # same angle beetween the direction and the sections
3817 # along the sweep surface.
3818 # @param theName Object name; when specified, this parameter is used
3819 # for result publication in the study. Otherwise, if automatic
3820 # publication is switched on, default value is used for result name.
3822 # @return New GEOM.GEOM_Object, containing the created pipe.
3824 # @ref tui_creation_pipe "Example"
3825 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3827 Create a shape by extrusion of the base shape along
3828 the path shape with constant bi-normal direction along the given vector.
3829 The path shape can be a wire or an edge.
3832 theBase Base shape to be extruded.
3833 thePath Path shape to extrude the base shape along it.
3834 theVec Vector defines a constant binormal direction to keep the
3835 same angle beetween the direction and the sections
3836 along the sweep surface.
3837 theName Object name; when specified, this parameter is used
3838 for result publication in the study. Otherwise, if automatic
3839 publication is switched on, default value is used for result name.
3842 New GEOM.GEOM_Object, containing the created pipe.
3844 # Example: see GEOM_TestAll.py
3845 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3846 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3847 self._autoPublish(anObj, theName, "pipe")
3850 ## Makes a thick solid from a face or a shell
3851 # @param theShape Face or Shell to be thicken
3852 # @param theThickness Thickness of the resulting solid
3853 # @param theName Object name; when specified, this parameter is used
3854 # for result publication in the study. Otherwise, if automatic
3855 # publication is switched on, default value is used for result name.
3857 # @return New GEOM.GEOM_Object, containing the created solid
3859 def MakeThickSolid(self, theShape, theThickness, theName=None):
3861 Make a thick solid from a face or a shell
3864 theShape Face or Shell to be thicken
3865 theThickness Thickness of the resulting solid
3866 theName Object name; when specified, this parameter is used
3867 for result publication in the study. Otherwise, if automatic
3868 publication is switched on, default value is used for result name.
3871 New GEOM.GEOM_Object, containing the created solid
3873 # Example: see GEOM_TestAll.py
3874 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3875 RaiseIfFailed("MakeThickening", self.PrimOp)
3876 self._autoPublish(anObj, theName, "pipe")
3880 ## Modifies a face or a shell to make it a thick solid
3881 # @param theShape Face or Shell to be thicken
3882 # @param theThickness Thickness of the resulting solid
3884 # @return The modified shape
3886 def Thicken(self, theShape, theThickness):
3888 Modifies a face or a shell to make it a thick solid
3891 theBase Base shape to be extruded.
3892 thePath Path shape to extrude the base shape along it.
3893 theName Object name; when specified, this parameter is used
3894 for result publication in the study. Otherwise, if automatic
3895 publication is switched on, default value is used for result name.
3900 # Example: see GEOM_TestAll.py
3901 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3902 RaiseIfFailed("MakeThickening", self.PrimOp)
3905 ## Build a middle path of a pipe-like shape.
3906 # The path shape can be a wire or an edge.
3907 # @param theShape It can be closed or unclosed pipe-like shell
3908 # or a pipe-like solid.
3909 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3910 # should be wires or faces of theShape.
3911 # @param theName Object name; when specified, this parameter is used
3912 # for result publication in the study. Otherwise, if automatic
3913 # publication is switched on, default value is used for result name.
3915 # @note It is not assumed that exact or approximate copy of theShape
3916 # can be obtained by applying existing Pipe operation on the
3917 # resulting "Path" wire taking theBase1 as the base - it is not
3918 # always possible; though in some particular cases it might work
3919 # it is not guaranteed. Thus, RestorePath function should not be
3920 # considered as an exact reverse operation of the Pipe.
3922 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3923 # source pipe's "path".
3925 # @ref tui_creation_pipe_path "Example"
3926 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3928 Build a middle path of a pipe-like shape.
3929 The path shape can be a wire or an edge.
3932 theShape It can be closed or unclosed pipe-like shell
3933 or a pipe-like solid.
3934 theBase1, theBase2 Two bases of the supposed pipe. This
3935 should be wires or faces of theShape.
3936 theName Object name; when specified, this parameter is used
3937 for result publication in the study. Otherwise, if automatic
3938 publication is switched on, default value is used for result name.
3941 New GEOM_Object, containing an edge or wire that represent
3944 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3945 RaiseIfFailed("RestorePath", self.PrimOp)
3946 self._autoPublish(anObj, theName, "path")
3949 ## Build a middle path of a pipe-like shape.
3950 # The path shape can be a wire or an edge.
3951 # @param theShape It can be closed or unclosed pipe-like shell
3952 # or a pipe-like solid.
3953 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3954 # should be lists of edges of theShape.
3955 # @param 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.
3959 # @note It is not assumed that exact or approximate copy of theShape
3960 # can be obtained by applying existing Pipe operation on the
3961 # resulting "Path" wire taking theBase1 as the base - it is not
3962 # always possible; though in some particular cases it might work
3963 # it is not guaranteed. Thus, RestorePath function should not be
3964 # considered as an exact reverse operation of the Pipe.
3966 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3967 # source pipe's "path".
3969 # @ref tui_creation_pipe_path "Example"
3970 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3972 Build a middle path of a pipe-like shape.
3973 The path shape can be a wire or an edge.
3976 theShape It can be closed or unclosed pipe-like shell
3977 or a pipe-like solid.
3978 listEdges1, listEdges2 Two bases of the supposed pipe. This
3979 should be lists of edges of theShape.
3980 theName Object name; when specified, this parameter is used
3981 for result publication in the study. Otherwise, if automatic
3982 publication is switched on, default value is used for result name.
3985 New GEOM_Object, containing an edge or wire that represent
3988 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3989 RaiseIfFailed("RestorePath", self.PrimOp)
3990 self._autoPublish(anObj, theName, "path")
3996 ## @addtogroup l3_advanced
3999 ## Create a linear edge with specified ends.
4000 # @param thePnt1 Point for the first end of edge.
4001 # @param thePnt2 Point for the second end of edge.
4002 # @param theName Object name; when specified, this parameter is used
4003 # for result publication in the study. Otherwise, if automatic
4004 # publication is switched on, default value is used for result name.
4006 # @return New GEOM.GEOM_Object, containing the created edge.
4008 # @ref tui_creation_edge "Example"
4009 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4011 Create a linear edge with specified ends.
4014 thePnt1 Point for the first end of edge.
4015 thePnt2 Point for the second end of edge.
4016 theName Object name; when specified, this parameter is used
4017 for result publication in the study. Otherwise, if automatic
4018 publication is switched on, default value is used for result name.
4021 New GEOM.GEOM_Object, containing the created edge.
4023 # Example: see GEOM_TestAll.py
4024 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4025 RaiseIfFailed("MakeEdge", self.ShapesOp)
4026 self._autoPublish(anObj, theName, "edge")
4029 ## Create a new edge, corresponding to the given length on the given curve.
4030 # @param theRefCurve The referenced curve (edge).
4031 # @param theLength Length on the referenced curve. It can be negative.
4032 # @param theStartPoint Any point can be selected for it, the new edge will begin
4033 # at the end of \a theRefCurve, close to the selected point.
4034 # If None, start from the first point of \a theRefCurve.
4035 # @param theName Object name; when specified, this parameter is used
4036 # for result publication in the study. Otherwise, if automatic
4037 # publication is switched on, default value is used for result name.
4039 # @return New GEOM.GEOM_Object, containing the created edge.
4041 # @ref tui_creation_edge "Example"
4042 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4044 Create a new edge, corresponding to the given length on the given curve.
4047 theRefCurve The referenced curve (edge).
4048 theLength Length on the referenced curve. It can be negative.
4049 theStartPoint Any point can be selected for it, the new edge will begin
4050 at the end of theRefCurve, close to the selected point.
4051 If None, start from the first point of theRefCurve.
4052 theName Object name; when specified, this parameter is used
4053 for result publication in the study. Otherwise, if automatic
4054 publication is switched on, default value is used for result name.
4057 New GEOM.GEOM_Object, containing the created edge.
4059 # Example: see GEOM_TestAll.py
4060 theLength, Parameters = ParseParameters(theLength)
4061 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4062 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4063 anObj.SetParameters(Parameters)
4064 self._autoPublish(anObj, theName, "edge")
4067 ## Create an edge from specified wire.
4068 # @param theWire source Wire
4069 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4070 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4071 # @param theName Object name; when specified, this parameter is used
4072 # for result publication in the study. Otherwise, if automatic
4073 # publication is switched on, default value is used for result name.
4075 # @return New GEOM.GEOM_Object, containing the created edge.
4077 # @ref tui_creation_edge "Example"
4078 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4080 Create an edge from specified wire.
4084 theLinearTolerance linear tolerance value (default = 1e-07)
4085 theAngularTolerance angular tolerance value (default = 1e-12)
4086 theName Object name; when specified, this parameter is used
4087 for result publication in the study. Otherwise, if automatic
4088 publication is switched on, default value is used for result name.
4091 New GEOM.GEOM_Object, containing the created edge.
4093 # Example: see GEOM_TestAll.py
4094 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4095 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4096 self._autoPublish(anObj, theName, "edge")
4099 ## Create a wire from the set of edges and wires.
4100 # @param theEdgesAndWires List of edges and/or wires.
4101 # @param theTolerance Maximum distance between vertices, that will be merged.
4102 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4103 # @param theName Object name; when specified, this parameter is used
4104 # for result publication in the study. Otherwise, if automatic
4105 # publication is switched on, default value is used for result name.
4107 # @return New GEOM.GEOM_Object, containing the created wire.
4109 # @ref tui_creation_wire "Example"
4110 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4112 Create a wire from the set of edges and wires.
4115 theEdgesAndWires List of edges and/or wires.
4116 theTolerance Maximum distance between vertices, that will be merged.
4117 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4118 theName Object name; when specified, this parameter is used
4119 for result publication in the study. Otherwise, if automatic
4120 publication is switched on, default value is used for result name.
4123 New GEOM.GEOM_Object, containing the created wire.
4125 # Example: see GEOM_TestAll.py
4126 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4127 RaiseIfFailed("MakeWire", self.ShapesOp)
4128 self._autoPublish(anObj, theName, "wire")
4131 ## Create a face on the given wire.
4132 # @param theWire closed Wire or Edge to build the face on.
4133 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4134 # If the tolerance of the obtained planar face is less
4135 # than 1e-06, this face will be returned, otherwise the
4136 # algorithm tries to build any suitable face on the given
4137 # wire and prints a warning message.
4138 # @param theName Object name; when specified, this parameter is used
4139 # for result publication in the study. Otherwise, if automatic
4140 # publication is switched on, default value is used for result name.
4142 # @return New GEOM.GEOM_Object, containing the created face.
4144 # @ref tui_creation_face "Example"
4145 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4147 Create a face on the given wire.
4150 theWire closed Wire or Edge to build the face on.
4151 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4152 If the tolerance of the obtained planar face is less
4153 than 1e-06, this face will be returned, otherwise the
4154 algorithm tries to build any suitable face on the given
4155 wire and prints a warning message.
4156 theName Object name; when specified, this parameter is used
4157 for result publication in the study. Otherwise, if automatic
4158 publication is switched on, default value is used for result name.
4161 New GEOM.GEOM_Object, containing the created face.
4163 # Example: see GEOM_TestAll.py
4164 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4165 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4166 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4168 RaiseIfFailed("MakeFace", self.ShapesOp)
4169 self._autoPublish(anObj, theName, "face")
4172 ## Create a face on the given wires set.
4173 # @param theWires List of closed wires or edges to build the face on.
4174 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4175 # If the tolerance of the obtained planar face is less
4176 # than 1e-06, this face will be returned, otherwise the
4177 # algorithm tries to build any suitable face on the given
4178 # wire and prints a warning message.
4179 # @param theName Object name; when specified, this parameter is used
4180 # for result publication in the study. Otherwise, if automatic
4181 # publication is switched on, default value is used for result name.
4183 # @return New GEOM.GEOM_Object, containing the created face.
4185 # @ref tui_creation_face "Example"
4186 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4188 Create a face on the given wires set.
4191 theWires List of closed wires or edges to build the face on.
4192 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4193 If the tolerance of the obtained planar face is less
4194 than 1e-06, this face will be returned, otherwise the
4195 algorithm tries to build any suitable face on the given
4196 wire and prints a warning message.
4197 theName Object name; when specified, this parameter is used
4198 for result publication in the study. Otherwise, if automatic
4199 publication is switched on, default value is used for result name.
4202 New GEOM.GEOM_Object, containing the created face.
4204 # Example: see GEOM_TestAll.py
4205 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4206 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4207 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4209 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4210 self._autoPublish(anObj, theName, "face")
4213 ## See MakeFaceWires() method for details.
4215 # @ref tui_creation_face "Example 1"
4216 # \n @ref swig_MakeFaces "Example 2"
4217 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4219 See geompy.MakeFaceWires() method for details.
4221 # Example: see GEOM_TestOthers.py
4222 # note: auto-publishing is done in self.MakeFaceWires()
4223 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4226 ## Create a shell from the set of faces and shells.
4227 # @param theFacesAndShells List of faces and/or shells.
4228 # @param theName Object name; when specified, this parameter is used
4229 # for result publication in the study. Otherwise, if automatic
4230 # publication is switched on, default value is used for result name.
4232 # @return New GEOM.GEOM_Object, containing the created shell.
4234 # @ref tui_creation_shell "Example"
4235 def MakeShell(self, theFacesAndShells, theName=None):
4237 Create a shell from the set of faces and shells.
4240 theFacesAndShells List of faces and/or shells.
4241 theName Object name; when specified, this parameter is used
4242 for result publication in the study. Otherwise, if automatic
4243 publication is switched on, default value is used for result name.
4246 New GEOM.GEOM_Object, containing the created shell.
4248 # Example: see GEOM_TestAll.py
4249 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4250 RaiseIfFailed("MakeShell", self.ShapesOp)
4251 self._autoPublish(anObj, theName, "shell")
4254 ## Create a solid, bounded by the given shells.
4255 # @param theShells Sequence of bounding shells.
4256 # @param theName Object name; when specified, this parameter is used
4257 # for result publication in the study. Otherwise, if automatic
4258 # publication is switched on, default value is used for result name.
4260 # @return New GEOM.GEOM_Object, containing the created solid.
4262 # @ref tui_creation_solid "Example"
4263 def MakeSolid(self, theShells, theName=None):
4265 Create a solid, bounded by the given shells.
4268 theShells Sequence of bounding shells.
4269 theName Object name; when specified, this parameter is used
4270 for result publication in the study. Otherwise, if automatic
4271 publication is switched on, default value is used for result name.
4274 New GEOM.GEOM_Object, containing the created solid.
4276 # Example: see GEOM_TestAll.py
4277 if len(theShells) == 1:
4278 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4280 # raise RuntimeError, "MakeSolidShells : " + descr
4281 if descr == "WRN_SHAPE_UNCLOSED":
4282 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4283 anObj = self.ShapesOp.MakeSolidShells(theShells)
4284 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4285 self._autoPublish(anObj, theName, "solid")
4288 ## Create a compound of the given shapes.
4289 # @param theShapes List of shapes to put in compound.
4290 # @param theName Object name; when specified, this parameter is used
4291 # for result publication in the study. Otherwise, if automatic
4292 # publication is switched on, default value is used for result name.
4294 # @return New GEOM.GEOM_Object, containing the created compound.
4296 # @ref tui_creation_compound "Example"
4297 def MakeCompound(self, theShapes, theName=None):
4299 Create a compound of the given shapes.
4302 theShapes List of shapes to put in compound.
4303 theName Object name; when specified, this parameter is used
4304 for result publication in the study. Otherwise, if automatic
4305 publication is switched on, default value is used for result name.
4308 New GEOM.GEOM_Object, containing the created compound.
4310 # Example: see GEOM_TestAll.py
4311 anObj = self.ShapesOp.MakeCompound(theShapes)
4312 RaiseIfFailed("MakeCompound", self.ShapesOp)
4313 self._autoPublish(anObj, theName, "compound")
4316 # end of l3_advanced
4319 ## @addtogroup l2_measure
4322 ## Gives quantity of faces in the given shape.
4323 # @param theShape Shape to count faces of.
4324 # @return Quantity of faces.
4326 # @ref swig_NumberOf "Example"
4327 def NumberOfFaces(self, theShape):
4329 Gives quantity of faces in the given shape.
4332 theShape Shape to count faces of.
4337 # Example: see GEOM_TestOthers.py
4338 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4339 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4342 ## Gives quantity of edges in the given shape.
4343 # @param theShape Shape to count edges of.
4344 # @return Quantity of edges.
4346 # @ref swig_NumberOf "Example"
4347 def NumberOfEdges(self, theShape):
4349 Gives quantity of edges in the given shape.
4352 theShape Shape to count edges of.
4357 # Example: see GEOM_TestOthers.py
4358 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4359 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4362 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4363 # @param theShape Shape to count sub-shapes of.
4364 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4365 # @return Quantity of sub-shapes of given type.
4367 # @ref swig_NumberOf "Example"
4368 def NumberOfSubShapes(self, theShape, theShapeType):
4370 Gives quantity of sub-shapes of type theShapeType in the given shape.
4373 theShape Shape to count sub-shapes of.
4374 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4377 Quantity of sub-shapes of given type.
4379 # Example: see GEOM_TestOthers.py
4380 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4381 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4384 ## Gives quantity of solids in the given shape.
4385 # @param theShape Shape to count solids in.
4386 # @return Quantity of solids.
4388 # @ref swig_NumberOf "Example"
4389 def NumberOfSolids(self, theShape):
4391 Gives quantity of solids in the given shape.
4394 theShape Shape to count solids in.
4399 # Example: see GEOM_TestOthers.py
4400 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4401 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4407 ## @addtogroup l3_healing
4410 ## Reverses an orientation the given shape.
4411 # @param theShape Shape to be reversed.
4412 # @param theName Object name; when specified, this parameter is used
4413 # for result publication in the study. Otherwise, if automatic
4414 # publication is switched on, default value is used for result name.
4416 # @return The reversed copy of theShape.
4418 # @ref swig_ChangeOrientation "Example"
4419 def ChangeOrientation(self, theShape, theName=None):
4421 Reverses an orientation the given shape.
4424 theShape Shape to be reversed.
4425 theName Object name; when specified, this parameter is used
4426 for result publication in the study. Otherwise, if automatic
4427 publication is switched on, default value is used for result name.
4430 The reversed copy of theShape.
4432 # Example: see GEOM_TestAll.py
4433 anObj = self.ShapesOp.ChangeOrientation(theShape)
4434 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4435 self._autoPublish(anObj, theName, "reversed")
4438 ## See ChangeOrientation() method for details.
4440 # @ref swig_OrientationChange "Example"
4441 def OrientationChange(self, theShape, theName=None):
4443 See geompy.ChangeOrientation method for details.
4445 # Example: see GEOM_TestOthers.py
4446 # note: auto-publishing is done in self.ChangeOrientation()
4447 anObj = self.ChangeOrientation(theShape, theName)
4453 ## @addtogroup l4_obtain
4456 ## Retrieve all free faces from the given shape.
4457 # Free face is a face, which is not shared between two shells of the shape.
4458 # @param theShape Shape to find free faces in.
4459 # @return List of IDs of all free faces, contained in theShape.
4461 # @ref tui_measurement_tools_page "Example"
4462 def GetFreeFacesIDs(self,theShape):
4464 Retrieve all free faces from the given shape.
4465 Free face is a face, which is not shared between two shells of the shape.
4468 theShape Shape to find free faces in.
4471 List of IDs of all free faces, contained in theShape.
4473 # Example: see GEOM_TestOthers.py
4474 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4475 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4478 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4479 # @param theShape1 Shape to find sub-shapes in.
4480 # @param theShape2 Shape to find shared sub-shapes with.
4481 # @param theShapeType Type of sub-shapes to be retrieved.
4482 # @param theName Object name; when specified, this parameter is used
4483 # for result publication in the study. Otherwise, if automatic
4484 # publication is switched on, default value is used for result name.
4486 # @return List of sub-shapes of theShape1, shared with theShape2.
4488 # @ref swig_GetSharedShapes "Example"
4489 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4491 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4494 theShape1 Shape to find sub-shapes in.
4495 theShape2 Shape to find shared sub-shapes with.
4496 theShapeType Type of sub-shapes to be retrieved.
4497 theName Object name; when specified, this parameter is used
4498 for result publication in the study. Otherwise, if automatic
4499 publication is switched on, default value is used for result name.
4502 List of sub-shapes of theShape1, shared with theShape2.
4504 # Example: see GEOM_TestOthers.py
4505 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4506 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4507 self._autoPublish(aList, theName, "shared")
4510 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4511 # @param theShapes Shapes to find common sub-shapes of.
4512 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4513 # @param theName Object name; when specified, this parameter is used
4514 # for result publication in the study. Otherwise, if automatic
4515 # publication is switched on, default value is used for result name.
4517 # @return List of objects, that are sub-shapes of all given shapes.
4519 # @ref swig_GetSharedShapes "Example"
4520 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4522 Get all sub-shapes, shared by all shapes in the list theShapes.
4525 theShapes Shapes to find common sub-shapes of.
4526 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4527 theName Object name; when specified, this parameter is used
4528 for result publication in the study. Otherwise, if automatic
4529 publication is switched on, default value is used for result name.
4532 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4534 # Example: see GEOM_TestOthers.py
4535 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4536 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4537 self._autoPublish(aList, theName, "shared")
4540 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4541 # situated relatively the specified plane by the certain way,
4542 # defined through <VAR>theState</VAR> parameter.
4543 # @param theShape Shape to find sub-shapes of.
4544 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4545 # @param theAx1 Vector (or line, or linear edge), specifying normal
4546 # direction and location of the plane to find shapes on.
4547 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4548 # @param theName Object name; when specified, this parameter is used
4549 # for result publication in the study. Otherwise, if automatic
4550 # publication is switched on, default value is used for result name.
4552 # @return List of all found sub-shapes.
4554 # @ref swig_GetShapesOnPlane "Example"
4555 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4557 Find in theShape all sub-shapes of type theShapeType,
4558 situated relatively the specified plane by the certain way,
4559 defined through theState parameter.
4562 theShape Shape to find sub-shapes of.
4563 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4564 theAx1 Vector (or line, or linear edge), specifying normal
4565 direction and location of the plane to find shapes on.
4566 theState The state of the sub-shapes to find (see GEOM::shape_state)
4567 theName Object name; when specified, this parameter is used
4568 for result publication in the study. Otherwise, if automatic
4569 publication is switched on, default value is used for result name.
4572 List of all found sub-shapes.
4574 # Example: see GEOM_TestOthers.py
4575 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4576 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4577 self._autoPublish(aList, theName, "shapeOnPlane")
4580 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4581 # situated relatively the specified plane by the certain way,
4582 # defined through <VAR>theState</VAR> parameter.
4583 # @param theShape Shape to find sub-shapes of.
4584 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4585 # @param theAx1 Vector (or line, or linear edge), specifying normal
4586 # direction and location of the plane to find shapes on.
4587 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4589 # @return List of all found sub-shapes indices.
4591 # @ref swig_GetShapesOnPlaneIDs "Example"
4592 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4594 Find in theShape all sub-shapes of type theShapeType,
4595 situated relatively the specified plane by the certain way,
4596 defined through theState parameter.
4599 theShape Shape to find sub-shapes of.
4600 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4601 theAx1 Vector (or line, or linear edge), specifying normal
4602 direction and location of the plane to find shapes on.
4603 theState The state of the sub-shapes to find (see GEOM::shape_state)
4606 List of all found sub-shapes indices.
4608 # Example: see GEOM_TestOthers.py
4609 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4610 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4613 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4614 # situated relatively the specified plane by the certain way,
4615 # defined through <VAR>theState</VAR> parameter.
4616 # @param theShape Shape to find sub-shapes of.
4617 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4618 # @param theAx1 Vector (or line, or linear edge), specifying normal
4619 # direction of the plane to find shapes on.
4620 # @param thePnt Point specifying location of the plane to find shapes on.
4621 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4622 # @param theName Object name; when specified, this parameter is used
4623 # for result publication in the study. Otherwise, if automatic
4624 # publication is switched on, default value is used for result name.
4626 # @return List of all found sub-shapes.
4628 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4629 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4631 Find in theShape all sub-shapes of type theShapeType,
4632 situated relatively the specified plane by the certain way,
4633 defined through theState parameter.
4636 theShape Shape to find sub-shapes of.
4637 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4638 theAx1 Vector (or line, or linear edge), specifying normal
4639 direction and location of the plane to find shapes on.
4640 thePnt Point specifying location of the plane to find shapes on.
4641 theState The state of the sub-shapes to find (see GEOM::shape_state)
4642 theName Object name; when specified, this parameter is used
4643 for result publication in the study. Otherwise, if automatic
4644 publication is switched on, default value is used for result name.
4647 List of all found sub-shapes.
4649 # Example: see GEOM_TestOthers.py
4650 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4651 theAx1, thePnt, theState)
4652 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4653 self._autoPublish(aList, theName, "shapeOnPlane")
4656 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4657 # situated relatively the specified plane by the certain way,
4658 # defined through <VAR>theState</VAR> parameter.
4659 # @param theShape Shape to find sub-shapes of.
4660 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4661 # @param theAx1 Vector (or line, or linear edge), specifying normal
4662 # direction of the plane to find shapes on.
4663 # @param thePnt Point specifying location of the plane to find shapes on.
4664 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4666 # @return List of all found sub-shapes indices.
4668 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4669 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4671 Find in theShape all sub-shapes of type theShapeType,
4672 situated relatively the specified plane by the certain way,
4673 defined through theState parameter.
4676 theShape Shape to find sub-shapes of.
4677 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4678 theAx1 Vector (or line, or linear edge), specifying normal
4679 direction and location of the plane to find shapes on.
4680 thePnt Point specifying location of the plane to find shapes on.
4681 theState The state of the sub-shapes to find (see GEOM::shape_state)
4684 List of all found sub-shapes indices.
4686 # Example: see GEOM_TestOthers.py
4687 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4688 theAx1, thePnt, theState)
4689 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4692 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4693 # the specified cylinder by the certain way, defined through \a theState parameter.
4694 # @param theShape Shape to find sub-shapes of.
4695 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4696 # @param theAxis Vector (or line, or linear edge), specifying
4697 # axis of the cylinder to find shapes on.
4698 # @param theRadius Radius of the cylinder to find shapes on.
4699 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4700 # @param theName Object name; when specified, this parameter is used
4701 # for result publication in the study. Otherwise, if automatic
4702 # publication is switched on, default value is used for result name.
4704 # @return List of all found sub-shapes.
4706 # @ref swig_GetShapesOnCylinder "Example"
4707 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4709 Find in theShape all sub-shapes of type theShapeType, situated relatively
4710 the specified cylinder by the certain way, defined through theState parameter.
4713 theShape Shape to find sub-shapes of.
4714 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4715 theAxis Vector (or line, or linear edge), specifying
4716 axis of the cylinder to find shapes on.
4717 theRadius Radius of the cylinder to find shapes on.
4718 theState The state of the sub-shapes to find (see GEOM::shape_state)
4719 theName Object name; when specified, this parameter is used
4720 for result publication in the study. Otherwise, if automatic
4721 publication is switched on, default value is used for result name.
4724 List of all found sub-shapes.
4726 # Example: see GEOM_TestOthers.py
4727 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4728 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4729 self._autoPublish(aList, theName, "shapeOnCylinder")
4732 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4733 # the specified cylinder by the certain way, defined through \a theState parameter.
4734 # @param theShape Shape to find sub-shapes of.
4735 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4736 # @param theAxis Vector (or line, or linear edge), specifying
4737 # axis of the cylinder to find shapes on.
4738 # @param theRadius Radius of the cylinder to find shapes on.
4739 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4741 # @return List of all found sub-shapes indices.
4743 # @ref swig_GetShapesOnCylinderIDs "Example"
4744 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4746 Find in theShape all sub-shapes of type theShapeType, situated relatively
4747 the specified cylinder by the certain way, defined through theState parameter.
4750 theShape Shape to find sub-shapes of.
4751 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4752 theAxis Vector (or line, or linear edge), specifying
4753 axis of the cylinder to find shapes on.
4754 theRadius Radius of the cylinder to find shapes on.
4755 theState The state of the sub-shapes to find (see GEOM::shape_state)
4758 List of all found sub-shapes indices.
4760 # Example: see GEOM_TestOthers.py
4761 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4762 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4765 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4766 # the specified cylinder by the certain way, defined through \a theState parameter.
4767 # @param theShape Shape to find sub-shapes of.
4768 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4769 # @param theAxis Vector (or line, or linear edge), specifying
4770 # axis of the cylinder to find shapes on.
4771 # @param thePnt Point specifying location of the bottom of the cylinder.
4772 # @param theRadius Radius of the cylinder to find shapes on.
4773 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4774 # @param theName Object name; when specified, this parameter is used
4775 # for result publication in the study. Otherwise, if automatic
4776 # publication is switched on, default value is used for result name.
4778 # @return List of all found sub-shapes.
4780 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4781 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4783 Find in theShape all sub-shapes of type theShapeType, situated relatively
4784 the specified cylinder by the certain way, defined through theState parameter.
4787 theShape Shape to find sub-shapes of.
4788 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4789 theAxis Vector (or line, or linear edge), specifying
4790 axis of the cylinder to find shapes on.
4791 theRadius Radius of the cylinder to find shapes on.
4792 theState The state of the sub-shapes to find (see GEOM::shape_state)
4793 theName Object name; when specified, this parameter is used
4794 for result publication in the study. Otherwise, if automatic
4795 publication is switched on, default value is used for result name.
4798 List of all found sub-shapes.
4800 # Example: see GEOM_TestOthers.py
4801 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4802 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4803 self._autoPublish(aList, theName, "shapeOnCylinder")
4806 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4807 # the specified cylinder by the certain way, defined through \a theState parameter.
4808 # @param theShape Shape to find sub-shapes of.
4809 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4810 # @param theAxis Vector (or line, or linear edge), specifying
4811 # axis of the cylinder to find shapes on.
4812 # @param thePnt Point specifying location of the bottom of the cylinder.
4813 # @param theRadius Radius of the cylinder to find shapes on.
4814 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4816 # @return List of all found sub-shapes indices
4818 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4819 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4821 Find in theShape all sub-shapes of type theShapeType, situated relatively
4822 the specified cylinder by the certain way, defined through theState parameter.
4825 theShape Shape to find sub-shapes of.
4826 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4827 theAxis Vector (or line, or linear edge), specifying
4828 axis of the cylinder to find shapes on.
4829 theRadius Radius of the cylinder to find shapes on.
4830 theState The state of the sub-shapes to find (see GEOM::shape_state)
4833 List of all found sub-shapes indices.
4835 # Example: see GEOM_TestOthers.py
4836 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4837 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4840 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4841 # the specified sphere by the certain way, defined through \a theState parameter.
4842 # @param theShape Shape to find sub-shapes of.
4843 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4844 # @param theCenter Point, specifying center of the sphere to find shapes on.
4845 # @param theRadius Radius of the sphere to find shapes on.
4846 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4847 # @param theName Object name; when specified, this parameter is used
4848 # for result publication in the study. Otherwise, if automatic
4849 # publication is switched on, default value is used for result name.
4851 # @return List of all found sub-shapes.
4853 # @ref swig_GetShapesOnSphere "Example"
4854 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4856 Find in theShape all sub-shapes of type theShapeType, situated relatively
4857 the specified sphere by the certain way, defined through theState parameter.
4860 theShape Shape to find sub-shapes of.
4861 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4862 theCenter Point, specifying center of the sphere to find shapes on.
4863 theRadius Radius of the sphere to find shapes on.
4864 theState The state of the sub-shapes to find (see GEOM::shape_state)
4865 theName Object name; when specified, this parameter is used
4866 for result publication in the study. Otherwise, if automatic
4867 publication is switched on, default value is used for result name.
4870 List of all found sub-shapes.
4872 # Example: see GEOM_TestOthers.py
4873 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4874 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4875 self._autoPublish(aList, theName, "shapeOnSphere")
4878 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4879 # the specified sphere by the certain way, defined through \a theState parameter.
4880 # @param theShape Shape to find sub-shapes of.
4881 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4882 # @param theCenter Point, specifying center of the sphere to find shapes on.
4883 # @param theRadius Radius of the sphere to find shapes on.
4884 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4886 # @return List of all found sub-shapes indices.
4888 # @ref swig_GetShapesOnSphereIDs "Example"
4889 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4891 Find in theShape all sub-shapes of type theShapeType, situated relatively
4892 the specified sphere by the certain way, defined through theState parameter.
4895 theShape Shape to find sub-shapes of.
4896 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4897 theCenter Point, specifying center of the sphere to find shapes on.
4898 theRadius Radius of the sphere to find shapes on.
4899 theState The state of the sub-shapes to find (see GEOM::shape_state)
4902 List of all found sub-shapes indices.
4904 # Example: see GEOM_TestOthers.py
4905 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4906 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4909 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4910 # the specified quadrangle by the certain way, defined through \a theState parameter.
4911 # @param theShape Shape to find sub-shapes of.
4912 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4913 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4914 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4915 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4916 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4917 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4918 # @param theName Object name; when specified, this parameter is used
4919 # for result publication in the study. Otherwise, if automatic
4920 # publication is switched on, default value is used for result name.
4922 # @return List of all found sub-shapes.
4924 # @ref swig_GetShapesOnQuadrangle "Example"
4925 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4926 theTopLeftPoint, theTopRigthPoint,
4927 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4929 Find in theShape all sub-shapes of type theShapeType, situated relatively
4930 the specified quadrangle by the certain way, defined through theState parameter.
4933 theShape Shape to find sub-shapes of.
4934 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4935 theTopLeftPoint Point, specifying top left corner of a quadrangle
4936 theTopRigthPoint Point, specifying top right corner of a quadrangle
4937 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4938 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4939 theState The state of the sub-shapes to find (see GEOM::shape_state)
4940 theName Object name; when specified, this parameter is used
4941 for result publication in the study. Otherwise, if automatic
4942 publication is switched on, default value is used for result name.
4945 List of all found sub-shapes.
4947 # Example: see GEOM_TestOthers.py
4948 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4949 theTopLeftPoint, theTopRigthPoint,
4950 theBottomLeftPoint, theBottomRigthPoint, theState)
4951 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4952 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4955 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4956 # the specified quadrangle by the certain way, defined through \a theState parameter.
4957 # @param theShape Shape to find sub-shapes of.
4958 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4959 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4960 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4961 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4962 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4963 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4965 # @return List of all found sub-shapes indices.
4967 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4968 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4969 theTopLeftPoint, theTopRigthPoint,
4970 theBottomLeftPoint, theBottomRigthPoint, theState):
4972 Find in theShape all sub-shapes of type theShapeType, situated relatively
4973 the specified quadrangle by the certain way, defined through theState parameter.
4976 theShape Shape to find sub-shapes of.
4977 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4978 theTopLeftPoint Point, specifying top left corner of a quadrangle
4979 theTopRigthPoint Point, specifying top right corner of a quadrangle
4980 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4981 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4982 theState The state of the sub-shapes to find (see GEOM::shape_state)
4985 List of all found sub-shapes indices.
4988 # Example: see GEOM_TestOthers.py
4989 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4990 theTopLeftPoint, theTopRigthPoint,
4991 theBottomLeftPoint, theBottomRigthPoint, theState)
4992 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4995 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4996 # the specified \a theBox by the certain way, defined through \a theState parameter.
4997 # @param theBox Shape for relative comparing.
4998 # @param theShape Shape to find sub-shapes of.
4999 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5000 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5001 # @param theName Object name; when specified, this parameter is used
5002 # for result publication in the study. Otherwise, if automatic
5003 # publication is switched on, default value is used for result name.
5005 # @return List of all found sub-shapes.
5007 # @ref swig_GetShapesOnBox "Example"
5008 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5010 Find in theShape all sub-shapes of type theShapeType, situated relatively
5011 the specified theBox by the certain way, defined through theState parameter.
5014 theBox Shape for relative comparing.
5015 theShape Shape to find sub-shapes of.
5016 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5017 theState The state of the sub-shapes to find (see GEOM::shape_state)
5018 theName Object name; when specified, this parameter is used
5019 for result publication in the study. Otherwise, if automatic
5020 publication is switched on, default value is used for result name.
5023 List of all found sub-shapes.
5025 # Example: see GEOM_TestOthers.py
5026 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5027 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5028 self._autoPublish(aList, theName, "shapeOnBox")
5031 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5032 # the specified \a theBox by the certain way, defined through \a theState parameter.
5033 # @param theBox Shape for relative comparing.
5034 # @param theShape Shape to find sub-shapes of.
5035 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5036 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5038 # @return List of all found sub-shapes indices.
5040 # @ref swig_GetShapesOnBoxIDs "Example"
5041 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5043 Find in theShape all sub-shapes of type theShapeType, situated relatively
5044 the specified theBox by the certain way, defined through theState parameter.
5047 theBox Shape for relative comparing.
5048 theShape Shape to find sub-shapes of.
5049 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5050 theState The state of the sub-shapes to find (see GEOM::shape_state)
5053 List of all found sub-shapes indices.
5055 # Example: see GEOM_TestOthers.py
5056 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5057 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5060 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5061 # situated relatively the specified \a theCheckShape by the
5062 # certain way, defined through \a theState parameter.
5063 # @param theCheckShape Shape for relative comparing. It must be a solid.
5064 # @param theShape Shape to find sub-shapes of.
5065 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5066 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5067 # @param theName Object name; when specified, this parameter is used
5068 # for result publication in the study. Otherwise, if automatic
5069 # publication is switched on, default value is used for result name.
5071 # @return List of all found sub-shapes.
5073 # @ref swig_GetShapesOnShape "Example"
5074 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5076 Find in theShape all sub-shapes of type theShapeType,
5077 situated relatively the specified theCheckShape by the
5078 certain way, defined through theState parameter.
5081 theCheckShape Shape for relative comparing. It must be a solid.
5082 theShape Shape to find sub-shapes of.
5083 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5084 theState The state of the sub-shapes to find (see GEOM::shape_state)
5085 theName Object name; when specified, this parameter is used
5086 for result publication in the study. Otherwise, if automatic
5087 publication is switched on, default value is used for result name.
5090 List of all found sub-shapes.
5092 # Example: see GEOM_TestOthers.py
5093 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5094 theShapeType, theState)
5095 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5096 self._autoPublish(aList, theName, "shapeOnShape")
5099 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5100 # situated relatively the specified \a theCheckShape by the
5101 # certain way, defined through \a theState parameter.
5102 # @param theCheckShape Shape for relative comparing. It must be a solid.
5103 # @param theShape Shape to find sub-shapes of.
5104 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5105 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5106 # @param theName Object name; when specified, this parameter is used
5107 # for result publication in the study. Otherwise, if automatic
5108 # publication is switched on, default value is used for result name.
5110 # @return All found sub-shapes as compound.
5112 # @ref swig_GetShapesOnShapeAsCompound "Example"
5113 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5115 Find in theShape all sub-shapes of type theShapeType,
5116 situated relatively the specified theCheckShape by the
5117 certain way, defined through theState parameter.
5120 theCheckShape Shape for relative comparing. It must be a solid.
5121 theShape Shape to find sub-shapes of.
5122 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5123 theState The state of the sub-shapes to find (see GEOM::shape_state)
5124 theName Object name; when specified, this parameter is used
5125 for result publication in the study. Otherwise, if automatic
5126 publication is switched on, default value is used for result name.
5129 All found sub-shapes as compound.
5131 # Example: see GEOM_TestOthers.py
5132 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5133 theShapeType, theState)
5134 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5135 self._autoPublish(anObj, theName, "shapeOnShape")
5138 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5139 # situated relatively the specified \a theCheckShape by the
5140 # certain way, defined through \a theState parameter.
5141 # @param theCheckShape Shape for relative comparing. It must be a solid.
5142 # @param theShape Shape to find sub-shapes of.
5143 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5144 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5146 # @return List of all found sub-shapes indices.
5148 # @ref swig_GetShapesOnShapeIDs "Example"
5149 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5151 Find in theShape all sub-shapes of type theShapeType,
5152 situated relatively the specified theCheckShape by the
5153 certain way, defined through theState parameter.
5156 theCheckShape Shape for relative comparing. It must be a solid.
5157 theShape Shape to find sub-shapes of.
5158 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5159 theState The state of the sub-shapes to find (see GEOM::shape_state)
5162 List of all found sub-shapes indices.
5164 # Example: see GEOM_TestOthers.py
5165 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5166 theShapeType, theState)
5167 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5170 ## Get sub-shape(s) of theShapeWhere, which are
5171 # coincident with \a theShapeWhat or could be a part of it.
5172 # @param theShapeWhere Shape to find sub-shapes of.
5173 # @param theShapeWhat Shape, specifying what to find.
5174 # @param isNewImplementation implementation of GetInPlace functionality
5175 # (default = False, old alghorithm based on shape properties)
5176 # @param theName Object name; when specified, this parameter is used
5177 # for result publication in the study. Otherwise, if automatic
5178 # publication is switched on, default value is used for result name.
5180 # @return Group of all found sub-shapes or a single found sub-shape.
5182 # @note This function has a restriction on argument shapes.
5183 # If \a theShapeWhere has curved parts with significantly
5184 # outstanding centres (i.e. the mass centre of a part is closer to
5185 # \a theShapeWhat than to the part), such parts will not be found.
5186 # @image html get_in_place_lost_part.png
5188 # @ref swig_GetInPlace "Example"
5189 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5191 Get sub-shape(s) of theShapeWhere, which are
5192 coincident with theShapeWhat or could be a part of it.
5195 theShapeWhere Shape to find sub-shapes of.
5196 theShapeWhat Shape, specifying what to find.
5197 isNewImplementation Implementation of GetInPlace functionality
5198 (default = False, old alghorithm based on shape properties)
5199 theName Object name; when specified, this parameter is used
5200 for result publication in the study. Otherwise, if automatic
5201 publication is switched on, default value is used for result name.
5204 Group of all found sub-shapes or a single found sub-shape.
5208 This function has a restriction on argument shapes.
5209 If theShapeWhere has curved parts with significantly
5210 outstanding centres (i.e. the mass centre of a part is closer to
5211 theShapeWhat than to the part), such parts will not be found.
5213 # Example: see GEOM_TestOthers.py
5215 if isNewImplementation:
5216 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5218 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5220 RaiseIfFailed("GetInPlace", self.ShapesOp)
5221 self._autoPublish(anObj, theName, "inplace")
5224 ## Get sub-shape(s) of \a theShapeWhere, which are
5225 # coincident with \a theShapeWhat or could be a part of it.
5227 # Implementation of this method is based on a saved history of an operation,
5228 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5229 # arguments (an argument shape or a sub-shape of an argument shape).
5230 # The operation could be the Partition or one of boolean operations,
5231 # performed on simple shapes (not on compounds).
5233 # @param theShapeWhere Shape to find sub-shapes of.
5234 # @param theShapeWhat Shape, specifying what to find (must be in the
5235 # building history of the ShapeWhere).
5236 # @param theName Object name; when specified, this parameter is used
5237 # for result publication in the study. Otherwise, if automatic
5238 # publication is switched on, default value is used for result name.
5240 # @return Group of all found sub-shapes or a single found sub-shape.
5242 # @ref swig_GetInPlace "Example"
5243 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5245 Implementation of this method is based on a saved history of an operation,
5246 produced theShapeWhere. The theShapeWhat must be among this operation's
5247 arguments (an argument shape or a sub-shape of an argument shape).
5248 The operation could be the Partition or one of boolean operations,
5249 performed on simple shapes (not on compounds).
5252 theShapeWhere Shape to find sub-shapes of.
5253 theShapeWhat Shape, specifying what to find (must be in the
5254 building history of the ShapeWhere).
5255 theName Object name; when specified, this parameter is used
5256 for result publication in the study. Otherwise, if automatic
5257 publication is switched on, default value is used for result name.
5260 Group of all found sub-shapes or a single found sub-shape.
5262 # Example: see GEOM_TestOthers.py
5263 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5264 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5265 self._autoPublish(anObj, theName, "inplace")
5268 ## Get sub-shape of theShapeWhere, which is
5269 # equal to \a theShapeWhat.
5270 # @param theShapeWhere Shape to find sub-shape of.
5271 # @param theShapeWhat Shape, specifying what to find.
5272 # @param theName Object name; when specified, this parameter is used
5273 # for result publication in the study. Otherwise, if automatic
5274 # publication is switched on, default value is used for result name.
5276 # @return New GEOM.GEOM_Object for found sub-shape.
5278 # @ref swig_GetSame "Example"
5279 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5281 Get sub-shape of theShapeWhere, which is
5282 equal to theShapeWhat.
5285 theShapeWhere Shape to find sub-shape of.
5286 theShapeWhat Shape, specifying what to find.
5287 theName Object name; when specified, this parameter is used
5288 for result publication in the study. Otherwise, if automatic
5289 publication is switched on, default value is used for result name.
5292 New GEOM.GEOM_Object for found sub-shape.
5294 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5295 RaiseIfFailed("GetSame", self.ShapesOp)
5296 self._autoPublish(anObj, theName, "sameShape")
5300 ## Get sub-shape indices of theShapeWhere, which is
5301 # equal to \a theShapeWhat.
5302 # @param theShapeWhere Shape to find sub-shape of.
5303 # @param theShapeWhat Shape, specifying what to find.
5304 # @return List of all found sub-shapes indices.
5306 # @ref swig_GetSame "Example"
5307 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5309 Get sub-shape indices of theShapeWhere, which is
5310 equal to theShapeWhat.
5313 theShapeWhere Shape to find sub-shape of.
5314 theShapeWhat Shape, specifying what to find.
5317 List of all found sub-shapes indices.
5319 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5320 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5327 ## @addtogroup l4_access
5330 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5331 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5332 # @param aShape Shape to get sub-shape of.
5333 # @param ListOfID List of sub-shapes indices.
5334 # @param theName Object name; when specified, this parameter is used
5335 # for result publication in the study. Otherwise, if automatic
5336 # publication is switched on, default value is used for result name.
5338 # @return Found sub-shape.
5340 # @ref swig_all_decompose "Example"
5341 def GetSubShape(self, aShape, ListOfID, theName=None):
5343 Obtain a composite sub-shape of aShape, composed from sub-shapes
5344 of aShape, selected by their unique IDs inside aShape
5347 aShape Shape to get sub-shape of.
5348 ListOfID List of sub-shapes indices.
5349 theName Object name; when specified, this parameter is used
5350 for result publication in the study. Otherwise, if automatic
5351 publication is switched on, default value is used for result name.
5356 # Example: see GEOM_TestAll.py
5357 anObj = self.AddSubShape(aShape,ListOfID)
5358 self._autoPublish(anObj, theName, "subshape")
5361 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5362 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5363 # @param aShape Shape to get sub-shape of.
5364 # @param aSubShape Sub-shapes of aShape.
5365 # @return ID of found sub-shape.
5367 # @ref swig_all_decompose "Example"
5368 def GetSubShapeID(self, aShape, aSubShape):
5370 Obtain unique ID of sub-shape aSubShape inside aShape
5371 of aShape, selected by their unique IDs inside aShape
5374 aShape Shape to get sub-shape of.
5375 aSubShape Sub-shapes of aShape.
5378 ID of found sub-shape.
5380 # Example: see GEOM_TestAll.py
5381 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5382 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5385 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5386 # This function is provided for performance purpose. The complexity is O(n) with n
5387 # the number of subobjects of aShape
5388 # @param aShape Shape to get sub-shape of.
5389 # @param aSubShapes Sub-shapes of aShape.
5390 # @return list of IDs of found sub-shapes.
5392 # @ref swig_all_decompose "Example"
5393 def GetSubShapesIDs(self, aShape, aSubShapes):
5395 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5396 This function is provided for performance purpose. The complexity is O(n) with n
5397 the number of subobjects of aShape
5400 aShape Shape to get sub-shape of.
5401 aSubShapes Sub-shapes of aShape.
5404 List of IDs of found sub-shape.
5406 # Example: see GEOM_TestAll.py
5407 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5408 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5414 ## @addtogroup l4_decompose
5417 ## Get all sub-shapes and groups of \a theShape,
5418 # that were created already by any other methods.
5419 # @param theShape Any shape.
5420 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5421 # returned, else all found sub-shapes and groups.
5422 # @return List of existing sub-objects of \a theShape.
5424 # @ref swig_all_decompose "Example"
5425 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5427 Get all sub-shapes and groups of theShape,
5428 that were created already by any other methods.
5432 theGroupsOnly If this parameter is TRUE, only groups will be
5433 returned, else all found sub-shapes and groups.
5436 List of existing sub-objects of theShape.
5438 # Example: see GEOM_TestAll.py
5439 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5440 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5443 ## Get all groups of \a theShape,
5444 # that were created already by any other methods.
5445 # @param theShape Any shape.
5446 # @return List of existing groups of \a theShape.
5448 # @ref swig_all_decompose "Example"
5449 def GetGroups(self, theShape):
5451 Get all groups of theShape,
5452 that were created already by any other methods.
5458 List of existing groups of theShape.
5460 # Example: see GEOM_TestAll.py
5461 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5462 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5465 ## Explode a shape on sub-shapes of a given type.
5466 # If the shape itself matches the type, it is also returned.
5467 # @param aShape Shape to be exploded.
5468 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5469 # @param theName Object name; when specified, this parameter is used
5470 # for result publication in the study. Otherwise, if automatic
5471 # publication is switched on, default value is used for result name.
5473 # @return List of sub-shapes of type theShapeType, contained in theShape.
5475 # @ref swig_all_decompose "Example"
5476 def SubShapeAll(self, aShape, aType, theName=None):
5478 Explode a shape on sub-shapes of a given type.
5479 If the shape itself matches the type, it is also returned.
5482 aShape Shape to be exploded.
5483 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5484 theName Object name; when specified, this parameter is used
5485 for result publication in the study. Otherwise, if automatic
5486 publication is switched on, default value is used for result name.
5489 List of sub-shapes of type theShapeType, contained in theShape.
5491 # Example: see GEOM_TestAll.py
5492 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5493 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5494 self._autoPublish(ListObj, theName, "subshape")
5497 ## Explode a shape on sub-shapes of a given type.
5498 # @param aShape Shape to be exploded.
5499 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5500 # @return List of IDs of sub-shapes.
5502 # @ref swig_all_decompose "Example"
5503 def SubShapeAllIDs(self, aShape, aType):
5505 Explode a shape on sub-shapes of a given type.
5508 aShape Shape to be exploded (see geompy.ShapeType)
5509 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5512 List of IDs of sub-shapes.
5514 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5515 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5518 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5519 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5520 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5521 # @param aShape Shape to get sub-shape of.
5522 # @param ListOfInd List of sub-shapes indices.
5523 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5524 # @param theName Object name; when specified, this parameter is used
5525 # for result publication in the study. Otherwise, if automatic
5526 # publication is switched on, default value is used for result name.
5528 # @return A compound of sub-shapes of aShape.
5530 # @ref swig_all_decompose "Example"
5531 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5533 Obtain a compound of sub-shapes of aShape,
5534 selected by their indices in list of all sub-shapes of type aType.
5535 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5538 aShape Shape to get sub-shape of.
5539 ListOfID List of sub-shapes indices.
5540 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5541 theName Object name; when specified, this parameter is used
5542 for result publication in the study. Otherwise, if automatic
5543 publication is switched on, default value is used for result name.
5546 A compound of sub-shapes of aShape.
5548 # Example: see GEOM_TestAll.py
5550 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5551 for ind in ListOfInd:
5552 ListOfIDs.append(AllShapeIDsList[ind - 1])
5553 # note: auto-publishing is done in self.GetSubShape()
5554 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5557 ## Explode a shape on sub-shapes of a given type.
5558 # Sub-shapes will be sorted by coordinates of their gravity centers.
5559 # If the shape itself matches the type, it is also returned.
5560 # @param aShape Shape to be exploded.
5561 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5562 # @param theName Object name; when specified, this parameter is used
5563 # for result publication in the study. Otherwise, if automatic
5564 # publication is switched on, default value is used for result name.
5566 # @return List of sub-shapes of type theShapeType, contained in theShape.
5568 # @ref swig_SubShapeAllSorted "Example"
5569 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5571 Explode a shape on sub-shapes of a given type.
5572 Sub-shapes will be sorted by coordinates of their gravity centers.
5573 If the shape itself matches the type, it is also returned.
5576 aShape Shape to be exploded.
5577 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5578 theName Object name; when specified, this parameter is used
5579 for result publication in the study. Otherwise, if automatic
5580 publication is switched on, default value is used for result name.
5583 List of sub-shapes of type theShapeType, contained in theShape.
5585 # Example: see GEOM_TestAll.py
5586 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5587 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5588 self._autoPublish(ListObj, theName, "subshape")
5591 ## Explode a shape on sub-shapes of a given type.
5592 # Sub-shapes will be sorted by coordinates of their gravity centers.
5593 # @param aShape Shape to be exploded.
5594 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5595 # @return List of IDs of sub-shapes.
5597 # @ref swig_all_decompose "Example"
5598 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5600 Explode a shape on sub-shapes of a given type.
5601 Sub-shapes will be sorted by coordinates of their gravity centers.
5604 aShape Shape to be exploded.
5605 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5608 List of IDs of sub-shapes.
5610 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5611 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5614 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5615 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5616 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5617 # @param aShape Shape to get sub-shape of.
5618 # @param ListOfInd List of sub-shapes indices.
5619 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5620 # @param theName Object name; when specified, this parameter is used
5621 # for result publication in the study. Otherwise, if automatic
5622 # publication is switched on, default value is used for result name.
5624 # @return A compound of sub-shapes of aShape.
5626 # @ref swig_all_decompose "Example"
5627 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5629 Obtain a compound of sub-shapes of aShape,
5630 selected by they indices in sorted list of all sub-shapes of type aType.
5631 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5634 aShape Shape to get sub-shape of.
5635 ListOfID List of sub-shapes indices.
5636 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5637 theName Object name; when specified, this parameter is used
5638 for result publication in the study. Otherwise, if automatic
5639 publication is switched on, default value is used for result name.
5642 A compound of sub-shapes of aShape.
5644 # Example: see GEOM_TestAll.py
5646 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5647 for ind in ListOfInd:
5648 ListOfIDs.append(AllShapeIDsList[ind - 1])
5649 # note: auto-publishing is done in self.GetSubShape()
5650 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5653 ## Extract shapes (excluding the main shape) of given type.
5654 # @param aShape The shape.
5655 # @param aType The shape type (see ShapeType())
5656 # @param isSorted Boolean flag to switch sorting on/off.
5657 # @param theName Object name; when specified, this parameter is used
5658 # for result publication in the study. Otherwise, if automatic
5659 # publication is switched on, default value is used for result name.
5661 # @return List of sub-shapes of type aType, contained in aShape.
5663 # @ref swig_FilletChamfer "Example"
5664 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5666 Extract shapes (excluding the main shape) of given type.
5670 aType The shape type (see geompy.ShapeType)
5671 isSorted Boolean flag to switch sorting on/off.
5672 theName Object name; when specified, this parameter is used
5673 for result publication in the study. Otherwise, if automatic
5674 publication is switched on, default value is used for result name.
5677 List of sub-shapes of type aType, contained in aShape.
5679 # Example: see GEOM_TestAll.py
5680 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5681 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5682 self._autoPublish(ListObj, theName, "subshape")
5685 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5686 # @param aShape Main shape.
5687 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5688 # @param theName Object name; when specified, this parameter is used
5689 # for result publication in the study. Otherwise, if automatic
5690 # publication is switched on, default value is used for result name.
5691 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5693 # @ref swig_all_decompose "Example"
5694 def SubShapes(self, aShape, anIDs, theName=None):
5696 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5700 anIDs List of unique IDs of sub-shapes inside theMainShape.
5701 theName Object name; when specified, this parameter is used
5702 for result publication in the study. Otherwise, if automatic
5703 publication is switched on, default value is used for result name.
5706 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5708 # Example: see GEOM_TestAll.py
5709 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5710 RaiseIfFailed("SubShapes", self.ShapesOp)
5711 self._autoPublish(ListObj, theName, "subshape")
5714 # end of l4_decompose
5717 ## @addtogroup l4_decompose_d
5720 ## Deprecated method
5721 # It works like SubShapeAllSortedCentres(), but wrongly
5722 # defines centres of faces, shells and solids.
5723 def SubShapeAllSorted(self, aShape, aType, theName=None):
5726 It works like geompy.SubShapeAllSortedCentres, but wrongly
5727 defines centres of faces, shells and solids.
5729 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5730 RaiseIfFailed("MakeExplode", self.ShapesOp)
5731 self._autoPublish(ListObj, theName, "subshape")
5734 ## Deprecated method
5735 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5736 # defines centres of faces, shells and solids.
5737 def SubShapeAllSortedIDs(self, aShape, aType):
5740 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5741 defines centres of faces, shells and solids.
5743 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5744 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5747 ## Deprecated method
5748 # It works like SubShapeSortedCentres(), but has a bug
5749 # (wrongly defines centres of faces, shells and solids).
5750 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5753 It works like geompy.SubShapeSortedCentres, but has a bug
5754 (wrongly defines centres of faces, shells and solids).
5757 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5758 for ind in ListOfInd:
5759 ListOfIDs.append(AllShapeIDsList[ind - 1])
5760 # note: auto-publishing is done in self.GetSubShape()
5761 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5764 # end of l4_decompose_d
5767 ## @addtogroup l3_healing
5770 ## Apply a sequence of Shape Healing operators to the given object.
5771 # @param theShape Shape to be processed.
5772 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5773 # @param theParameters List of names of parameters
5774 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5775 # @param theValues List of values of parameters, in the same order
5776 # as parameters are listed in <VAR>theParameters</VAR> list.
5777 # @param theName Object name; when specified, this parameter is used
5778 # for result publication in the study. Otherwise, if automatic
5779 # publication is switched on, default value is used for result name.
5781 # <b> Operators and Parameters: </b> \n
5783 # * \b FixShape - corrects invalid shapes. \n
5784 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5785 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5787 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5788 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5789 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5790 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5792 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5793 # surfaces in segments using a certain angle. \n
5794 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5795 # if Angle=180, four if Angle=90, etc). \n
5796 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5798 # * \b SplitClosedFaces - splits closed faces in segments.
5799 # The number of segments depends on the number of splitting points.\n
5800 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5802 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5803 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5804 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5805 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5806 # This and the previous parameters can take the following values:\n
5807 # \b Parametric \b Continuity \n
5808 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5809 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5810 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5811 # ruling out sharp edges).\n
5812 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5813 # are of the same magnitude).\n
5814 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5815 # or surfaces (d/du C(u)) are the same at junction. \n
5816 # \b Geometric \b Continuity \n
5817 # \b G1: first derivatives are proportional at junction.\n
5818 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5819 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5820 # \b G2: first and second derivatives are proportional at junction.
5821 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5822 # continuity requires that the underlying parameterization was continuous as well.
5823 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5825 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5826 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5827 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5828 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5829 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5830 # with the specified parameters.\n
5831 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5832 # with the specified parameters.\n
5833 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5834 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5835 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5836 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5838 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5839 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5840 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5841 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5842 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5844 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5845 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5848 # @return New GEOM.GEOM_Object, containing processed shape.
5850 # \n @ref tui_shape_processing "Example"
5851 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5853 Apply a sequence of Shape Healing operators to the given object.
5856 theShape Shape to be processed.
5857 theValues List of values of parameters, in the same order
5858 as parameters are listed in theParameters list.
5859 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5860 theParameters List of names of parameters
5861 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5862 theName Object name; when specified, this parameter is used
5863 for result publication in the study. Otherwise, if automatic
5864 publication is switched on, default value is used for result name.
5866 Operators and Parameters:
5868 * FixShape - corrects invalid shapes.
5869 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5870 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5871 * FixFaceSize - removes small faces, such as spots and strips.
5872 * FixFaceSize.Tolerance - defines minimum possible face size.
5873 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5874 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5875 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5876 in segments using a certain angle.
5877 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5878 if Angle=180, four if Angle=90, etc).
5879 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5880 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5882 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5883 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5884 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5885 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5886 * SplitContinuity.CurveContinuity - required continuity for curves.
5887 This and the previous parameters can take the following values:
5889 Parametric Continuity:
5890 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5891 coincidental. The curves or surfaces may still meet at an angle,
5892 giving rise to a sharp corner or edge).
5893 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5894 are parallel, ruling out sharp edges).
5895 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5896 or surfaces are of the same magnitude).
5897 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5898 curves or surfaces (d/du C(u)) are the same at junction.
5900 Geometric Continuity:
5901 G1: first derivatives are proportional at junction.
5902 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5903 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5904 G2: first and second derivatives are proportional at junction. As the names imply,
5905 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5906 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5907 geometric continuity of order n, but not vice-versa.
5908 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5909 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5910 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5911 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5912 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5913 the specified parameters.
5914 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5915 the specified parameters.
5916 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5917 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5918 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5919 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5920 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5921 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5922 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5923 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5924 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5925 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5926 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5929 New GEOM.GEOM_Object, containing processed shape.
5931 Note: For more information look through SALOME Geometry User's Guide->
5932 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5934 # Example: see GEOM_TestHealing.py
5935 theValues,Parameters = ParseList(theValues)
5936 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5937 # To avoid script failure in case of good argument shape
5938 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5940 RaiseIfFailed("ProcessShape", self.HealOp)
5941 for string in (theOperators + theParameters):
5942 Parameters = ":" + Parameters
5944 anObj.SetParameters(Parameters)
5945 self._autoPublish(anObj, theName, "healed")
5948 ## Remove faces from the given object (shape).
5949 # @param theObject Shape to be processed.
5950 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5951 # removes ALL faces of the given object.
5952 # @param 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 # @return New GEOM.GEOM_Object, containing processed shape.
5958 # @ref tui_suppress_faces "Example"
5959 def SuppressFaces(self, theObject, theFaces, theName=None):
5961 Remove faces from the given object (shape).
5964 theObject Shape to be processed.
5965 theFaces Indices of faces to be removed, if EMPTY then the method
5966 removes ALL faces of the given object.
5967 theName Object name; when specified, this parameter is used
5968 for result publication in the study. Otherwise, if automatic
5969 publication is switched on, default value is used for result name.
5972 New GEOM.GEOM_Object, containing processed shape.
5974 # Example: see GEOM_TestHealing.py
5975 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5976 RaiseIfFailed("SuppressFaces", self.HealOp)
5977 self._autoPublish(anObj, theName, "suppressFaces")
5980 ## Sewing of some shapes into single shape.
5981 # @param ListShape Shapes to be processed.
5982 # @param theTolerance Required tolerance value.
5983 # @param AllowNonManifold Flag that allows non-manifold sewing.
5984 # @param theName Object name; when specified, this parameter is used
5985 # for result publication in the study. Otherwise, if automatic
5986 # publication is switched on, default value is used for result name.
5988 # @return New GEOM.GEOM_Object, containing processed shape.
5990 # @ref tui_sewing "Example"
5991 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5993 Sewing of some shapes into single shape.
5996 ListShape Shapes to be processed.
5997 theTolerance Required tolerance value.
5998 AllowNonManifold Flag that allows non-manifold sewing.
5999 theName Object name; when specified, this parameter is used
6000 for result publication in the study. Otherwise, if automatic
6001 publication is switched on, default value is used for result name.
6004 New GEOM.GEOM_Object, containing processed shape.
6006 # Example: see GEOM_TestHealing.py
6007 comp = self.MakeCompound(ListShape)
6008 # note: auto-publishing is done in self.Sew()
6009 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6012 ## Sewing of the given object.
6013 # @param theObject Shape to be processed.
6014 # @param theTolerance Required tolerance value.
6015 # @param AllowNonManifold Flag that allows non-manifold sewing.
6016 # @param theName Object name; when specified, this parameter is used
6017 # for result publication in the study. Otherwise, if automatic
6018 # publication is switched on, default value is used for result name.
6020 # @return New GEOM.GEOM_Object, containing processed shape.
6021 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6023 Sewing of the given object.
6026 theObject Shape to be processed.
6027 theTolerance Required tolerance value.
6028 AllowNonManifold Flag that allows non-manifold sewing.
6029 theName Object name; when specified, this parameter is used
6030 for result publication in the study. Otherwise, if automatic
6031 publication is switched on, default value is used for result name.
6034 New GEOM.GEOM_Object, containing processed shape.
6036 # Example: see MakeSewing() above
6037 theTolerance,Parameters = ParseParameters(theTolerance)
6038 if AllowNonManifold:
6039 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6041 anObj = self.HealOp.Sew(theObject, theTolerance)
6042 # To avoid script failure in case of good argument shape
6043 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6045 RaiseIfFailed("Sew", self.HealOp)
6046 anObj.SetParameters(Parameters)
6047 self._autoPublish(anObj, theName, "sewed")
6050 ## Rebuild the topology of theCompound of solids by removing
6051 # of the faces that are shared by several solids.
6052 # @param theCompound Shape to be processed.
6053 # @param theName Object name; when specified, this parameter is used
6054 # for result publication in the study. Otherwise, if automatic
6055 # publication is switched on, default value is used for result name.
6057 # @return New GEOM.GEOM_Object, containing processed shape.
6059 # @ref tui_remove_webs "Example"
6060 def RemoveInternalFaces (self, theCompound, theName=None):
6062 Rebuild the topology of theCompound of solids by removing
6063 of the faces that are shared by several solids.
6066 theCompound Shape to be processed.
6067 theName Object name; when specified, this parameter is used
6068 for result publication in the study. Otherwise, if automatic
6069 publication is switched on, default value is used for result name.
6072 New GEOM.GEOM_Object, containing processed shape.
6074 # Example: see GEOM_TestHealing.py
6075 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6076 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6077 self._autoPublish(anObj, theName, "removeWebs")
6080 ## Remove internal wires and edges from the given object (face).
6081 # @param theObject Shape to be processed.
6082 # @param theWires Indices of wires to be removed, if EMPTY then the method
6083 # removes ALL internal wires of the given object.
6084 # @param theName Object name; when specified, this parameter is used
6085 # for result publication in the study. Otherwise, if automatic
6086 # publication is switched on, default value is used for result name.
6088 # @return New GEOM.GEOM_Object, containing processed shape.
6090 # @ref tui_suppress_internal_wires "Example"
6091 def SuppressInternalWires(self, theObject, theWires, theName=None):
6093 Remove internal wires and edges from the given object (face).
6096 theObject Shape to be processed.
6097 theWires Indices of wires to be removed, if EMPTY then the method
6098 removes ALL internal wires of the given object.
6099 theName Object name; when specified, this parameter is used
6100 for result publication in the study. Otherwise, if automatic
6101 publication is switched on, default value is used for result name.
6104 New GEOM.GEOM_Object, containing processed shape.
6106 # Example: see GEOM_TestHealing.py
6107 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6108 RaiseIfFailed("RemoveIntWires", self.HealOp)
6109 self._autoPublish(anObj, theName, "suppressWires")
6112 ## Remove internal closed contours (holes) from the given object.
6113 # @param theObject Shape to be processed.
6114 # @param theWires Indices of wires to be removed, if EMPTY then the method
6115 # removes ALL internal holes of the given object
6116 # @param theName Object name; when specified, this parameter is used
6117 # for result publication in the study. Otherwise, if automatic
6118 # publication is switched on, default value is used for result name.
6120 # @return New GEOM.GEOM_Object, containing processed shape.
6122 # @ref tui_suppress_holes "Example"
6123 def SuppressHoles(self, theObject, theWires, theName=None):
6125 Remove internal closed contours (holes) from the given object.
6128 theObject Shape to be processed.
6129 theWires Indices of wires to be removed, if EMPTY then the method
6130 removes ALL internal holes of the given object
6131 theName Object name; when specified, this parameter is used
6132 for result publication in the study. Otherwise, if automatic
6133 publication is switched on, default value is used for result name.
6136 New GEOM.GEOM_Object, containing processed shape.
6138 # Example: see GEOM_TestHealing.py
6139 anObj = self.HealOp.FillHoles(theObject, theWires)
6140 RaiseIfFailed("FillHoles", self.HealOp)
6141 self._autoPublish(anObj, theName, "suppressHoles")
6144 ## Close an open wire.
6145 # @param theObject Shape to be processed.
6146 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6147 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6148 # @param isCommonVertex If True : closure by creation of a common vertex,
6149 # If False : closure by creation of an edge between ends.
6150 # @param theName Object name; when specified, this parameter is used
6151 # for result publication in the study. Otherwise, if automatic
6152 # publication is switched on, default value is used for result name.
6154 # @return New GEOM.GEOM_Object, containing processed shape.
6156 # @ref tui_close_contour "Example"
6157 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6162 theObject Shape to be processed.
6163 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6164 if [ ], then theObject itself is a wire.
6165 isCommonVertex If True : closure by creation of a common vertex,
6166 If False : closure by creation of an edge between ends.
6167 theName Object name; when specified, this parameter is used
6168 for result publication in the study. Otherwise, if automatic
6169 publication is switched on, default value is used for result name.
6172 New GEOM.GEOM_Object, containing processed shape.
6174 # Example: see GEOM_TestHealing.py
6175 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6176 RaiseIfFailed("CloseContour", self.HealOp)
6177 self._autoPublish(anObj, theName, "closeContour")
6180 ## Addition of a point to a given edge object.
6181 # @param theObject Shape to be processed.
6182 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6183 # if -1, then theObject itself is the edge.
6184 # @param theValue Value of parameter on edge or length parameter,
6185 # depending on \a isByParameter.
6186 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6187 # if FALSE : \a theValue is treated as a length parameter [0..1]
6188 # @param theName Object name; when specified, this parameter is used
6189 # for result publication in the study. Otherwise, if automatic
6190 # publication is switched on, default value is used for result name.
6192 # @return New GEOM.GEOM_Object, containing processed shape.
6194 # @ref tui_add_point_on_edge "Example"
6195 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6197 Addition of a point to a given edge object.
6200 theObject Shape to be processed.
6201 theEdgeIndex Index of edge to be divided within theObject's shape,
6202 if -1, then theObject itself is the edge.
6203 theValue Value of parameter on edge or length parameter,
6204 depending on isByParameter.
6205 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6206 if FALSE : theValue is treated as a length parameter [0..1]
6207 theName Object name; when specified, this parameter is used
6208 for result publication in the study. Otherwise, if automatic
6209 publication is switched on, default value is used for result name.
6212 New GEOM.GEOM_Object, containing processed shape.
6214 # Example: see GEOM_TestHealing.py
6215 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6216 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6217 RaiseIfFailed("DivideEdge", self.HealOp)
6218 anObj.SetParameters(Parameters)
6219 self._autoPublish(anObj, theName, "divideEdge")
6222 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6223 # @param theWire Wire to minimize the number of C1 continuous edges in.
6224 # @param theVertices A list of vertices to suppress. If the list
6225 # is empty, all vertices in a wire will be assumed.
6226 # @param theName Object name; when specified, this parameter is used
6227 # for result publication in the study. Otherwise, if automatic
6228 # publication is switched on, default value is used for result name.
6230 # @return New GEOM.GEOM_Object with modified wire.
6232 # @ref tui_fuse_collinear_edges "Example"
6233 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6235 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6238 theWire Wire to minimize the number of C1 continuous edges in.
6239 theVertices A list of vertices to suppress. If the list
6240 is empty, all vertices in a wire will be assumed.
6241 theName Object name; when specified, this parameter is used
6242 for result publication in the study. Otherwise, if automatic
6243 publication is switched on, default value is used for result name.
6246 New GEOM.GEOM_Object with modified wire.
6248 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6249 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6250 self._autoPublish(anObj, theName, "fuseEdges")
6253 ## Change orientation of the given object. Updates given shape.
6254 # @param theObject Shape to be processed.
6255 # @return Updated <var>theObject</var>
6257 # @ref swig_todo "Example"
6258 def ChangeOrientationShell(self,theObject):
6260 Change orientation of the given object. Updates given shape.
6263 theObject Shape to be processed.
6268 theObject = self.HealOp.ChangeOrientation(theObject)
6269 RaiseIfFailed("ChangeOrientation", self.HealOp)
6272 ## Change orientation of the given object.
6273 # @param theObject Shape to be processed.
6274 # @param theName Object name; when specified, this parameter is used
6275 # for result publication in the study. Otherwise, if automatic
6276 # publication is switched on, default value is used for result name.
6278 # @return New GEOM.GEOM_Object, containing processed shape.
6280 # @ref swig_todo "Example"
6281 def ChangeOrientationShellCopy(self, theObject, theName=None):
6283 Change orientation of the given object.
6286 theObject Shape to be processed.
6287 theName Object name; when specified, this parameter is used
6288 for result publication in the study. Otherwise, if automatic
6289 publication is switched on, default value is used for result name.
6292 New GEOM.GEOM_Object, containing processed shape.
6294 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6295 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6296 self._autoPublish(anObj, theName, "reversed")
6299 ## Try to limit tolerance of the given object by value \a theTolerance.
6300 # @param theObject Shape to be processed.
6301 # @param theTolerance Required tolerance value.
6302 # @param theName Object name; when specified, this parameter is used
6303 # for result publication in the study. Otherwise, if automatic
6304 # publication is switched on, default value is used for result name.
6306 # @return New GEOM.GEOM_Object, containing processed shape.
6308 # @ref tui_limit_tolerance "Example"
6309 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6311 Try to limit tolerance of the given object by value theTolerance.
6314 theObject Shape to be processed.
6315 theTolerance Required tolerance value.
6316 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.
6321 New GEOM.GEOM_Object, containing processed shape.
6323 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6324 RaiseIfFailed("LimitTolerance", self.HealOp)
6325 self._autoPublish(anObj, theName, "limitTolerance")
6328 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6329 # that constitute a free boundary of the given shape.
6330 # @param theObject Shape to get free boundary of.
6331 # @param 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.
6335 # @return [\a status, \a theClosedWires, \a theOpenWires]
6336 # \n \a status: FALSE, if an error(s) occured during the method execution.
6337 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6338 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6340 # @ref tui_measurement_tools_page "Example"
6341 def GetFreeBoundary(self, theObject, theName=None):
6343 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6344 that constitute a free boundary of the given shape.
6347 theObject Shape to get free boundary of.
6348 theName Object name; when specified, this parameter is used
6349 for result publication in the study. Otherwise, if automatic
6350 publication is switched on, default value is used for result name.
6353 [status, theClosedWires, theOpenWires]
6354 status: FALSE, if an error(s) occured during the method execution.
6355 theClosedWires: Closed wires on the free boundary of the given shape.
6356 theOpenWires: Open wires on the free boundary of the given shape.
6358 # Example: see GEOM_TestHealing.py
6359 anObj = self.HealOp.GetFreeBoundary(theObject)
6360 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6361 self._autoPublish(anObj[1], theName, "closedWire")
6362 self._autoPublish(anObj[2], theName, "openWire")
6365 ## Replace coincident faces in theShape by one face.
6366 # @param theShape Initial shape.
6367 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6368 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6369 # otherwise all initial shapes.
6370 # @param theName Object name; when specified, this parameter is used
6371 # for result publication in the study. Otherwise, if automatic
6372 # publication is switched on, default value is used for result name.
6374 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6376 # @ref tui_glue_faces "Example"
6377 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6379 Replace coincident faces in theShape by one face.
6382 theShape Initial shape.
6383 theTolerance Maximum distance between faces, which can be considered as coincident.
6384 doKeepNonSolids If FALSE, only solids will present in the result,
6385 otherwise all initial shapes.
6386 theName Object name; when specified, this parameter is used
6387 for result publication in the study. Otherwise, if automatic
6388 publication is switched on, default value is used for result name.
6391 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6393 # Example: see GEOM_Spanner.py
6394 theTolerance,Parameters = ParseParameters(theTolerance)
6395 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6397 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6398 anObj.SetParameters(Parameters)
6399 self._autoPublish(anObj, theName, "glueFaces")
6402 ## Find coincident faces in theShape for possible gluing.
6403 # @param theShape Initial shape.
6404 # @param theTolerance Maximum distance between faces,
6405 # which can be considered as coincident.
6406 # @param 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.
6410 # @return GEOM.ListOfGO
6412 # @ref tui_glue_faces "Example"
6413 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6415 Find coincident faces in theShape for possible gluing.
6418 theShape Initial shape.
6419 theTolerance Maximum distance between faces,
6420 which can be considered as coincident.
6421 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.
6428 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6429 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6430 self._autoPublish(anObj, theName, "facesToGlue")
6433 ## Replace coincident faces in theShape by one face
6434 # in compliance with given list of faces
6435 # @param theShape Initial shape.
6436 # @param theTolerance Maximum distance between faces,
6437 # which can be considered as coincident.
6438 # @param theFaces List of faces for gluing.
6439 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6440 # otherwise all initial shapes.
6441 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6442 # will be glued, otherwise only the edges,
6443 # belonging to <VAR>theFaces</VAR>.
6444 # @param theName Object name; when specified, this parameter is used
6445 # for result publication in the study. Otherwise, if automatic
6446 # publication is switched on, default value is used for result name.
6448 # @return New GEOM.GEOM_Object, containing a copy of theShape
6449 # without some faces.
6451 # @ref tui_glue_faces "Example"
6452 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6453 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6455 Replace coincident faces in theShape by one face
6456 in compliance with given list of faces
6459 theShape Initial shape.
6460 theTolerance Maximum distance between faces,
6461 which can be considered as coincident.
6462 theFaces List of faces for gluing.
6463 doKeepNonSolids If FALSE, only solids will present in the result,
6464 otherwise all initial shapes.
6465 doGlueAllEdges If TRUE, all coincident edges of theShape
6466 will be glued, otherwise only the edges,
6467 belonging to theFaces.
6468 theName Object name; when specified, this parameter is used
6469 for result publication in the study. Otherwise, if automatic
6470 publication is switched on, default value is used for result name.
6473 New GEOM.GEOM_Object, containing a copy of theShape
6476 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6477 doKeepNonSolids, doGlueAllEdges)
6479 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6480 self._autoPublish(anObj, theName, "glueFaces")
6483 ## Replace coincident edges in theShape by one edge.
6484 # @param theShape Initial shape.
6485 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6486 # @param theName Object name; when specified, this parameter is used
6487 # for result publication in the study. Otherwise, if automatic
6488 # publication is switched on, default value is used for result name.
6490 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6492 # @ref tui_glue_edges "Example"
6493 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6495 Replace coincident edges in theShape by one edge.
6498 theShape Initial shape.
6499 theTolerance Maximum distance between edges, which can be considered as coincident.
6500 theName Object name; when specified, this parameter is used
6501 for result publication in the study. Otherwise, if automatic
6502 publication is switched on, default value is used for result name.
6505 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6507 theTolerance,Parameters = ParseParameters(theTolerance)
6508 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6510 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6511 anObj.SetParameters(Parameters)
6512 self._autoPublish(anObj, theName, "glueEdges")
6515 ## Find coincident edges in theShape for possible gluing.
6516 # @param theShape Initial shape.
6517 # @param theTolerance Maximum distance between edges,
6518 # which can be considered as coincident.
6519 # @param theName Object name; when specified, this parameter is used
6520 # for result publication in the study. Otherwise, if automatic
6521 # publication is switched on, default value is used for result name.
6523 # @return GEOM.ListOfGO
6525 # @ref tui_glue_edges "Example"
6526 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6528 Find coincident edges in theShape for possible gluing.
6531 theShape Initial shape.
6532 theTolerance Maximum distance between edges,
6533 which can be considered as coincident.
6534 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.
6541 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6542 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6543 self._autoPublish(anObj, theName, "edgesToGlue")
6546 ## Replace coincident edges in theShape by one edge
6547 # in compliance with given list of edges.
6548 # @param theShape Initial shape.
6549 # @param theTolerance Maximum distance between edges,
6550 # which can be considered as coincident.
6551 # @param theEdges List of edges for gluing.
6552 # @param theName Object name; when specified, this parameter is used
6553 # for result publication in the study. Otherwise, if automatic
6554 # publication is switched on, default value is used for result name.
6556 # @return New GEOM.GEOM_Object, containing a copy of theShape
6557 # without some edges.
6559 # @ref tui_glue_edges "Example"
6560 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6562 Replace coincident edges in theShape by one edge
6563 in compliance with given list of edges.
6566 theShape Initial shape.
6567 theTolerance Maximum distance between edges,
6568 which can be considered as coincident.
6569 theEdges List of edges for gluing.
6570 theName Object name; when specified, this parameter is used
6571 for result publication in the study. Otherwise, if automatic
6572 publication is switched on, default value is used for result name.
6575 New GEOM.GEOM_Object, containing a copy of theShape
6578 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6580 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6581 self._autoPublish(anObj, theName, "glueEdges")
6587 ## @addtogroup l3_boolean Boolean Operations
6590 # -----------------------------------------------------------------------------
6591 # Boolean (Common, Cut, Fuse, Section)
6592 # -----------------------------------------------------------------------------
6594 ## Perform one of boolean operations on two given shapes.
6595 # @param theShape1 First argument for boolean operation.
6596 # @param theShape2 Second argument for boolean operation.
6597 # @param theOperation Indicates the operation to be done:\n
6598 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6599 # @param theName Object name; when specified, this parameter is used
6600 # for result publication in the study. Otherwise, if automatic
6601 # publication is switched on, default value is used for result name.
6603 # @return New GEOM.GEOM_Object, containing the result shape.
6605 # @ref tui_fuse "Example"
6606 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6608 Perform one of boolean operations on two given shapes.
6611 theShape1 First argument for boolean operation.
6612 theShape2 Second argument for boolean operation.
6613 theOperation Indicates the operation to be done:
6614 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6615 theName Object name; when specified, this parameter is used
6616 for result publication in the study. Otherwise, if automatic
6617 publication is switched on, default value is used for result name.
6620 New GEOM.GEOM_Object, containing the result shape.
6622 # Example: see GEOM_TestAll.py
6623 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6624 RaiseIfFailed("MakeBoolean", self.BoolOp)
6625 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6626 self._autoPublish(anObj, theName, def_names[theOperation])
6629 ## Perform Common boolean operation on two given shapes.
6630 # @param theShape1 First argument for boolean operation.
6631 # @param theShape2 Second argument for boolean operation.
6632 # @param theName Object name; when specified, this parameter is used
6633 # for result publication in the study. Otherwise, if automatic
6634 # publication is switched on, default value is used for result name.
6636 # @return New GEOM.GEOM_Object, containing the result shape.
6638 # @ref tui_common "Example 1"
6639 # \n @ref swig_MakeCommon "Example 2"
6640 def MakeCommon(self, theShape1, theShape2, theName=None):
6642 Perform Common boolean operation on two given shapes.
6645 theShape1 First argument for boolean operation.
6646 theShape2 Second argument for boolean operation.
6647 theName Object name; when specified, this parameter is used
6648 for result publication in the study. Otherwise, if automatic
6649 publication is switched on, default value is used for result name.
6652 New GEOM.GEOM_Object, containing the result shape.
6654 # Example: see GEOM_TestOthers.py
6655 # note: auto-publishing is done in self.MakeBoolean()
6656 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6658 ## Perform Cut boolean operation on two given shapes.
6659 # @param theShape1 First argument for boolean operation.
6660 # @param theShape2 Second argument for boolean operation.
6661 # @param theName Object name; when specified, this parameter is used
6662 # for result publication in the study. Otherwise, if automatic
6663 # publication is switched on, default value is used for result name.
6665 # @return New GEOM.GEOM_Object, containing the result shape.
6667 # @ref tui_cut "Example 1"
6668 # \n @ref swig_MakeCommon "Example 2"
6669 def MakeCut(self, theShape1, theShape2, theName=None):
6671 Perform Cut boolean operation on two given shapes.
6674 theShape1 First argument for boolean operation.
6675 theShape2 Second argument for boolean operation.
6676 theName Object name; when specified, this parameter is used
6677 for result publication in the study. Otherwise, if automatic
6678 publication is switched on, default value is used for result name.
6681 New GEOM.GEOM_Object, containing the result shape.
6684 # Example: see GEOM_TestOthers.py
6685 # note: auto-publishing is done in self.MakeBoolean()
6686 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6688 ## Perform Fuse boolean operation on two given shapes.
6689 # @param theShape1 First argument for boolean operation.
6690 # @param theShape2 Second argument for boolean 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 # @return New GEOM.GEOM_Object, containing the result shape.
6697 # @ref tui_fuse "Example 1"
6698 # \n @ref swig_MakeCommon "Example 2"
6699 def MakeFuse(self, theShape1, theShape2, theName=None):
6701 Perform Fuse boolean operation on two given shapes.
6704 theShape1 First argument for boolean operation.
6705 theShape2 Second argument for boolean operation.
6706 theName Object name; when specified, this parameter is used
6707 for result publication in the study. Otherwise, if automatic
6708 publication is switched on, default value is used for result name.
6711 New GEOM.GEOM_Object, containing the result shape.
6714 # Example: see GEOM_TestOthers.py
6715 # note: auto-publishing is done in self.MakeBoolean()
6716 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6718 ## Perform Section boolean operation on two given shapes.
6719 # @param theShape1 First argument for boolean operation.
6720 # @param theShape2 Second argument for boolean operation.
6721 # @param theName Object name; when specified, this parameter is used
6722 # for result publication in the study. Otherwise, if automatic
6723 # publication is switched on, default value is used for result name.
6725 # @return New GEOM.GEOM_Object, containing the result shape.
6727 # @ref tui_section "Example 1"
6728 # \n @ref swig_MakeCommon "Example 2"
6729 def MakeSection(self, theShape1, theShape2, theName=None):
6731 Perform Section boolean operation on two given shapes.
6734 theShape1 First argument for boolean operation.
6735 theShape2 Second argument for boolean operation.
6736 theName Object name; when specified, this parameter is used
6737 for result publication in the study. Otherwise, if automatic
6738 publication is switched on, default value is used for result name.
6741 New GEOM.GEOM_Object, containing the result shape.
6744 # Example: see GEOM_TestOthers.py
6745 # note: auto-publishing is done in self.MakeBoolean()
6746 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6748 ## Perform Fuse boolean operation on the list of shapes.
6749 # @param theShapesList Shapes to be fused.
6750 # @param theName Object name; when specified, this parameter is used
6751 # for result publication in the study. Otherwise, if automatic
6752 # publication is switched on, default value is used for result name.
6754 # @return New GEOM.GEOM_Object, containing the result shape.
6756 # @ref tui_fuse "Example 1"
6757 # \n @ref swig_MakeCommon "Example 2"
6758 def MakeFuseList(self, theShapesList, theName=None):
6760 Perform Fuse boolean operation on the list of shapes.
6763 theShapesList Shapes to be fused.
6764 theName Object name; when specified, this parameter is used
6765 for result publication in the study. Otherwise, if automatic
6766 publication is switched on, default value is used for result name.
6769 New GEOM.GEOM_Object, containing the result shape.
6772 # Example: see GEOM_TestOthers.py
6773 anObj = self.BoolOp.MakeFuseList(theShapesList)
6774 RaiseIfFailed("MakeFuseList", self.BoolOp)
6775 self._autoPublish(anObj, theName, "fuse")
6778 ## Perform Common boolean operation on the list of shapes.
6779 # @param theShapesList Shapes for Common operation.
6780 # @param theName Object name; when specified, this parameter is used
6781 # for result publication in the study. Otherwise, if automatic
6782 # publication is switched on, default value is used for result name.
6784 # @return New GEOM.GEOM_Object, containing the result shape.
6786 # @ref tui_common "Example 1"
6787 # \n @ref swig_MakeCommon "Example 2"
6788 def MakeCommonList(self, theShapesList, theName=None):
6790 Perform Common boolean operation on the list of shapes.
6793 theShapesList Shapes for Common operation.
6794 theName Object name; when specified, this parameter is used
6795 for result publication in the study. Otherwise, if automatic
6796 publication is switched on, default value is used for result name.
6799 New GEOM.GEOM_Object, containing the result shape.
6802 # Example: see GEOM_TestOthers.py
6803 anObj = self.BoolOp.MakeCommonList(theShapesList)
6804 RaiseIfFailed("MakeCommonList", self.BoolOp)
6805 self._autoPublish(anObj, theName, "common")
6808 ## Perform Cut boolean operation on one object and the list of tools.
6809 # @param theMainShape The object of the operation.
6810 # @param theShapesList The list of tools of the operation.
6811 # @param theName Object name; when specified, this parameter is used
6812 # for result publication in the study. Otherwise, if automatic
6813 # publication is switched on, default value is used for result name.
6815 # @return New GEOM.GEOM_Object, containing the result shape.
6817 # @ref tui_cut "Example 1"
6818 # \n @ref swig_MakeCommon "Example 2"
6819 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6821 Perform Cut boolean operation on one object and the list of tools.
6824 theMainShape The object of the operation.
6825 theShapesList The list of tools of the operation.
6826 theName Object name; when specified, this parameter is used
6827 for result publication in the study. Otherwise, if automatic
6828 publication is switched on, default value is used for result name.
6831 New GEOM.GEOM_Object, containing the result shape.
6834 # Example: see GEOM_TestOthers.py
6835 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6836 RaiseIfFailed("MakeCutList", self.BoolOp)
6837 self._autoPublish(anObj, theName, "cut")
6843 ## @addtogroup l3_basic_op
6846 ## Perform partition operation.
6847 # @param ListShapes Shapes to be intersected.
6848 # @param ListTools Shapes to intersect theShapes.
6849 # @param Limit Type of resulting shapes (see ShapeType()).\n
6850 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6851 # type will be detected automatically.
6852 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6853 # target type (equal to Limit) are kept in the result,
6854 # else standalone shapes of lower dimension
6855 # are kept also (if they exist).
6856 # @param theName Object name; when specified, this parameter is used
6857 # for result publication in the study. Otherwise, if automatic
6858 # publication is switched on, default value is used for result name.
6860 # @note Each compound from ListShapes and ListTools will be exploded
6861 # in order to avoid possible intersection between shapes from this compound.
6863 # After implementation new version of PartitionAlgo (October 2006)
6864 # other parameters are ignored by current functionality. They are kept
6865 # in this function only for support old versions.
6866 # @param ListKeepInside Shapes, outside which the results will be deleted.
6867 # Each shape from theKeepInside must belong to theShapes also.
6868 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6869 # Each shape from theRemoveInside must belong to theShapes also.
6870 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6871 # @param ListMaterials Material indices for each shape. Make sence,
6872 # only if theRemoveWebs is TRUE.
6874 # @return New GEOM.GEOM_Object, containing the result shapes.
6876 # @ref tui_partition "Example"
6877 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6878 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6879 KeepNonlimitShapes=0, theName=None):
6881 Perform partition operation.
6884 ListShapes Shapes to be intersected.
6885 ListTools Shapes to intersect theShapes.
6886 Limit Type of resulting shapes (see geompy.ShapeType)
6887 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6888 type will be detected automatically.
6889 KeepNonlimitShapes if this parameter == 0, then only shapes of
6890 target type (equal to Limit) are kept in the result,
6891 else standalone shapes of lower dimension
6892 are kept also (if they exist).
6893 theName Object name; when specified, this parameter is used
6894 for result publication in the study. Otherwise, if automatic
6895 publication is switched on, default value is used for result name.
6897 Each compound from ListShapes and ListTools will be exploded
6898 in order to avoid possible intersection between shapes from
6901 After implementation new version of PartitionAlgo (October 2006) other
6902 parameters are ignored by current functionality. They are kept in this
6903 function only for support old versions.
6906 ListKeepInside Shapes, outside which the results will be deleted.
6907 Each shape from theKeepInside must belong to theShapes also.
6908 ListRemoveInside Shapes, inside which the results will be deleted.
6909 Each shape from theRemoveInside must belong to theShapes also.
6910 RemoveWebs If TRUE, perform Glue 3D algorithm.
6911 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6914 New GEOM.GEOM_Object, containing the result shapes.
6916 # Example: see GEOM_TestAll.py
6917 if Limit == self.ShapeType["AUTO"]:
6918 # automatic detection of the most appropriate shape limit type
6920 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6921 Limit = EnumToLong(lim)
6923 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6924 ListKeepInside, ListRemoveInside,
6925 Limit, RemoveWebs, ListMaterials,
6926 KeepNonlimitShapes);
6927 RaiseIfFailed("MakePartition", self.BoolOp)
6928 self._autoPublish(anObj, theName, "partition")
6931 ## Perform partition operation.
6932 # This method may be useful if it is needed to make a partition for
6933 # compound contains nonintersected shapes. Performance will be better
6934 # since intersection between shapes from compound is not performed.
6936 # Description of all parameters as in previous method MakePartition()
6938 # @note Passed compounds (via ListShapes or via ListTools)
6939 # have to consist of nonintersecting shapes.
6941 # @return New GEOM.GEOM_Object, containing the result shapes.
6943 # @ref swig_todo "Example"
6944 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6945 ListKeepInside=[], ListRemoveInside=[],
6946 Limit=ShapeType["AUTO"], RemoveWebs=0,
6947 ListMaterials=[], KeepNonlimitShapes=0,
6950 Perform partition operation.
6951 This method may be useful if it is needed to make a partition for
6952 compound contains nonintersected shapes. Performance will be better
6953 since intersection between shapes from compound is not performed.
6956 Description of all parameters as in method geompy.MakePartition
6959 Passed compounds (via ListShapes or via ListTools)
6960 have to consist of nonintersecting shapes.
6963 New GEOM.GEOM_Object, containing the result shapes.
6965 if Limit == self.ShapeType["AUTO"]:
6966 # automatic detection of the most appropriate shape limit type
6968 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6969 Limit = EnumToLong(lim)
6971 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6972 ListKeepInside, ListRemoveInside,
6973 Limit, RemoveWebs, ListMaterials,
6974 KeepNonlimitShapes);
6975 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6976 self._autoPublish(anObj, theName, "partition")
6979 ## See method MakePartition() for more information.
6981 # @ref tui_partition "Example 1"
6982 # \n @ref swig_Partition "Example 2"
6983 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6984 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6985 KeepNonlimitShapes=0, theName=None):
6987 See method geompy.MakePartition for more information.
6989 # Example: see GEOM_TestOthers.py
6990 # note: auto-publishing is done in self.MakePartition()
6991 anObj = self.MakePartition(ListShapes, ListTools,
6992 ListKeepInside, ListRemoveInside,
6993 Limit, RemoveWebs, ListMaterials,
6994 KeepNonlimitShapes, theName);
6997 ## Perform partition of the Shape with the Plane
6998 # @param theShape Shape to be intersected.
6999 # @param thePlane Tool shape, to intersect theShape.
7000 # @param theName Object name; when specified, this parameter is used
7001 # for result publication in the study. Otherwise, if automatic
7002 # publication is switched on, default value is used for result name.
7004 # @return New GEOM.GEOM_Object, containing the result shape.
7006 # @ref tui_partition "Example"
7007 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7009 Perform partition of the Shape with the Plane
7012 theShape Shape to be intersected.
7013 thePlane Tool shape, to intersect theShape.
7014 theName Object name; when specified, this parameter is used
7015 for result publication in the study. Otherwise, if automatic
7016 publication is switched on, default value is used for result name.
7019 New GEOM.GEOM_Object, containing the result shape.
7021 # Example: see GEOM_TestAll.py
7022 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7023 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7024 self._autoPublish(anObj, theName, "partition")
7027 # end of l3_basic_op
7030 ## @addtogroup l3_transform
7033 ## Translate the given object along the vector, specified
7034 # by its end points.
7035 # @param theObject The object to be translated.
7036 # @param thePoint1 Start point of translation vector.
7037 # @param thePoint2 End point of translation vector.
7038 # @param theCopy Flag used to translate object itself or create a copy.
7039 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7040 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7041 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7043 Translate the given object along the vector, specified by its end points.
7046 theObject The object to be translated.
7047 thePoint1 Start point of translation vector.
7048 thePoint2 End point of translation vector.
7049 theCopy Flag used to translate object itself or create a copy.
7052 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7053 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7056 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7058 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7059 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7062 ## Translate the given object along the vector, specified
7063 # by its end points, creating its copy before the translation.
7064 # @param theObject The object to be translated.
7065 # @param thePoint1 Start point of translation vector.
7066 # @param thePoint2 End point of translation vector.
7067 # @param theName Object name; when specified, this parameter is used
7068 # for result publication in the study. Otherwise, if automatic
7069 # publication is switched on, default value is used for result name.
7071 # @return New GEOM.GEOM_Object, containing the translated object.
7073 # @ref tui_translation "Example 1"
7074 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7075 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7077 Translate the given object along the vector, specified
7078 by its end points, creating its copy before the translation.
7081 theObject The object to be translated.
7082 thePoint1 Start point of translation vector.
7083 thePoint2 End point of translation vector.
7084 theName Object name; when specified, this parameter is used
7085 for result publication in the study. Otherwise, if automatic
7086 publication is switched on, default value is used for result name.
7089 New GEOM.GEOM_Object, containing the translated object.
7091 # Example: see GEOM_TestAll.py
7092 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7093 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7094 self._autoPublish(anObj, theName, "translated")
7097 ## Translate the given object along the vector, specified by its components.
7098 # @param theObject The object to be translated.
7099 # @param theDX,theDY,theDZ Components of translation vector.
7100 # @param theCopy Flag used to translate object itself or create a copy.
7101 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7102 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7104 # @ref tui_translation "Example"
7105 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7107 Translate the given object along the vector, specified by its components.
7110 theObject The object to be translated.
7111 theDX,theDY,theDZ Components of translation vector.
7112 theCopy Flag used to translate object itself or create a copy.
7115 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7116 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7118 # Example: see GEOM_TestAll.py
7119 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7121 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7123 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7124 anObj.SetParameters(Parameters)
7125 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7128 ## Translate the given object along the vector, specified
7129 # by its components, creating its copy before the translation.
7130 # @param theObject The object to be translated.
7131 # @param theDX,theDY,theDZ Components of translation vector.
7132 # @param theName Object name; when specified, this parameter is used
7133 # for result publication in the study. Otherwise, if automatic
7134 # publication is switched on, default value is used for result name.
7136 # @return New GEOM.GEOM_Object, containing the translated object.
7138 # @ref tui_translation "Example"
7139 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7141 Translate the given object along the vector, specified
7142 by its components, creating its copy before the translation.
7145 theObject The object to be translated.
7146 theDX,theDY,theDZ Components of translation vector.
7147 theName Object name; when specified, this parameter is used
7148 for result publication in the study. Otherwise, if automatic
7149 publication is switched on, default value is used for result name.
7152 New GEOM.GEOM_Object, containing the translated object.
7154 # Example: see GEOM_TestAll.py
7155 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7156 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7157 anObj.SetParameters(Parameters)
7158 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7159 self._autoPublish(anObj, theName, "translated")
7162 ## Translate the given object along the given vector.
7163 # @param theObject The object to be translated.
7164 # @param theVector The translation vector.
7165 # @param theCopy Flag used to translate object itself or create a copy.
7166 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7167 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7168 def TranslateVector(self, theObject, theVector, theCopy=False):
7170 Translate the given object along the given vector.
7173 theObject The object to be translated.
7174 theVector The translation vector.
7175 theCopy Flag used to translate object itself or create a copy.
7178 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7179 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7182 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7184 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7185 RaiseIfFailed("TranslateVector", self.TrsfOp)
7188 ## Translate the given object along the given vector,
7189 # creating its copy before the translation.
7190 # @param theObject The object to be translated.
7191 # @param theVector The translation vector.
7192 # @param theName Object name; when specified, this parameter is used
7193 # for result publication in the study. Otherwise, if automatic
7194 # publication is switched on, default value is used for result name.
7196 # @return New GEOM.GEOM_Object, containing the translated object.
7198 # @ref tui_translation "Example"
7199 def MakeTranslationVector(self, theObject, theVector, theName=None):
7201 Translate the given object along the given vector,
7202 creating its copy before the translation.
7205 theObject The object to be translated.
7206 theVector The translation vector.
7207 theName Object name; when specified, this parameter is used
7208 for result publication in the study. Otherwise, if automatic
7209 publication is switched on, default value is used for result name.
7212 New GEOM.GEOM_Object, containing the translated object.
7214 # Example: see GEOM_TestAll.py
7215 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7216 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7217 self._autoPublish(anObj, theName, "translated")
7220 ## Translate the given object along the given vector on given distance.
7221 # @param theObject The object to be translated.
7222 # @param theVector The translation vector.
7223 # @param theDistance The translation distance.
7224 # @param theCopy Flag used to translate object itself or create a copy.
7225 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7226 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7228 # @ref tui_translation "Example"
7229 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7231 Translate the given object along the given vector on given distance.
7234 theObject The object to be translated.
7235 theVector The translation vector.
7236 theDistance The translation distance.
7237 theCopy Flag used to translate object itself or create a copy.
7240 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7241 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7243 # Example: see GEOM_TestAll.py
7244 theDistance,Parameters = ParseParameters(theDistance)
7245 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7246 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7247 anObj.SetParameters(Parameters)
7250 ## Translate the given object along the given vector on given distance,
7251 # creating its copy before the translation.
7252 # @param theObject The object to be translated.
7253 # @param theVector The translation vector.
7254 # @param theDistance The translation distance.
7255 # @param theName Object name; when specified, this parameter is used
7256 # for result publication in the study. Otherwise, if automatic
7257 # publication is switched on, default value is used for result name.
7259 # @return New GEOM.GEOM_Object, containing the translated object.
7261 # @ref tui_translation "Example"
7262 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7264 Translate the given object along the given vector on given distance,
7265 creating its copy before the translation.
7268 theObject The object to be translated.
7269 theVector The translation vector.
7270 theDistance The translation distance.
7271 theName Object name; when specified, this parameter is used
7272 for result publication in the study. Otherwise, if automatic
7273 publication is switched on, default value is used for result name.
7276 New GEOM.GEOM_Object, containing the translated object.
7278 # Example: see GEOM_TestAll.py
7279 theDistance,Parameters = ParseParameters(theDistance)
7280 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7281 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7282 anObj.SetParameters(Parameters)
7283 self._autoPublish(anObj, theName, "translated")
7286 ## Rotate the given object around the given axis on the given angle.
7287 # @param theObject The object to be rotated.
7288 # @param theAxis Rotation axis.
7289 # @param theAngle Rotation angle in radians.
7290 # @param theCopy Flag used to rotate object itself or create a copy.
7292 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7293 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7295 # @ref tui_rotation "Example"
7296 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7298 Rotate the given object around the given axis on the given angle.
7301 theObject The object to be rotated.
7302 theAxis Rotation axis.
7303 theAngle Rotation angle in radians.
7304 theCopy Flag used to rotate object itself or create a copy.
7307 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7308 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7310 # Example: see GEOM_TestAll.py
7312 if isinstance(theAngle,str):
7314 theAngle, Parameters = ParseParameters(theAngle)
7316 theAngle = theAngle*math.pi/180.0
7318 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7320 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7321 RaiseIfFailed("Rotate", self.TrsfOp)
7322 anObj.SetParameters(Parameters)
7325 ## Rotate the given object around the given axis
7326 # on the given angle, creating its copy before the rotatation.
7327 # @param theObject The object to be rotated.
7328 # @param theAxis Rotation axis.
7329 # @param theAngle Rotation angle in radians.
7330 # @param theName Object name; when specified, this parameter is used
7331 # for result publication in the study. Otherwise, if automatic
7332 # publication is switched on, default value is used for result name.
7334 # @return New GEOM.GEOM_Object, containing the rotated object.
7336 # @ref tui_rotation "Example"
7337 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7339 Rotate the given object around the given axis
7340 on the given angle, creating its copy before the rotatation.
7343 theObject The object to be rotated.
7344 theAxis Rotation axis.
7345 theAngle Rotation angle in radians.
7346 theName Object name; when specified, this parameter is used
7347 for result publication in the study. Otherwise, if automatic
7348 publication is switched on, default value is used for result name.
7351 New GEOM.GEOM_Object, containing the rotated object.
7353 # Example: see GEOM_TestAll.py
7355 if isinstance(theAngle,str):
7357 theAngle, Parameters = ParseParameters(theAngle)
7359 theAngle = theAngle*math.pi/180.0
7360 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7361 RaiseIfFailed("RotateCopy", self.TrsfOp)
7362 anObj.SetParameters(Parameters)
7363 self._autoPublish(anObj, theName, "rotated")
7366 ## Rotate given object around vector perpendicular to plane
7367 # containing three points.
7368 # @param theObject The object to be rotated.
7369 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7370 # containing the three points.
7371 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7372 # @param theCopy Flag used to rotate object itself or create a copy.
7373 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7374 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7375 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7377 Rotate given object around vector perpendicular to plane
7378 containing three points.
7381 theObject The object to be rotated.
7382 theCentPoint central point the axis is the vector perpendicular to the plane
7383 containing the three points.
7384 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7385 theCopy Flag used to rotate object itself or create a copy.
7388 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7389 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7392 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7394 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7395 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7398 ## Rotate given object around vector perpendicular to plane
7399 # containing three points, creating its copy before the rotatation.
7400 # @param theObject The object to be rotated.
7401 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7402 # containing the three points.
7403 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7404 # @param theName Object name; when specified, this parameter is used
7405 # for result publication in the study. Otherwise, if automatic
7406 # publication is switched on, default value is used for result name.
7408 # @return New GEOM.GEOM_Object, containing the rotated object.
7410 # @ref tui_rotation "Example"
7411 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7413 Rotate given object around vector perpendicular to plane
7414 containing three points, creating its copy before the rotatation.
7417 theObject The object to be rotated.
7418 theCentPoint central point the axis is the vector perpendicular to the plane
7419 containing the three points.
7420 thePoint1,thePoint2 in a perpendicular plane of the axis.
7421 theName Object name; when specified, this parameter is used
7422 for result publication in the study. Otherwise, if automatic
7423 publication is switched on, default value is used for result name.
7426 New GEOM.GEOM_Object, containing the rotated object.
7428 # Example: see GEOM_TestAll.py
7429 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7430 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7431 self._autoPublish(anObj, theName, "rotated")
7434 ## Scale the given object by the specified factor.
7435 # @param theObject The object to be scaled.
7436 # @param thePoint Center point for scaling.
7437 # Passing None for it means scaling relatively the origin of global CS.
7438 # @param theFactor Scaling factor value.
7439 # @param theCopy Flag used to scale object itself or create a copy.
7440 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7441 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7442 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7444 Scale the given object by the specified factor.
7447 theObject The object to be scaled.
7448 thePoint Center point for scaling.
7449 Passing None for it means scaling relatively the origin of global CS.
7450 theFactor Scaling factor value.
7451 theCopy Flag used to scale object itself or create a copy.
7454 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7455 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7457 # Example: see GEOM_TestAll.py
7458 theFactor, Parameters = ParseParameters(theFactor)
7460 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7462 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7463 RaiseIfFailed("Scale", self.TrsfOp)
7464 anObj.SetParameters(Parameters)
7467 ## Scale the given object by the factor, creating its copy before the scaling.
7468 # @param theObject The object to be scaled.
7469 # @param thePoint Center point for scaling.
7470 # Passing None for it means scaling relatively the origin of global CS.
7471 # @param theFactor Scaling factor value.
7472 # @param theName Object name; when specified, this parameter is used
7473 # for result publication in the study. Otherwise, if automatic
7474 # publication is switched on, default value is used for result name.
7476 # @return New GEOM.GEOM_Object, containing the scaled shape.
7478 # @ref tui_scale "Example"
7479 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7481 Scale the given object by the factor, creating its copy before the scaling.
7484 theObject The object to be scaled.
7485 thePoint Center point for scaling.
7486 Passing None for it means scaling relatively the origin of global CS.
7487 theFactor Scaling factor value.
7488 theName Object name; when specified, this parameter is used
7489 for result publication in the study. Otherwise, if automatic
7490 publication is switched on, default value is used for result name.
7493 New GEOM.GEOM_Object, containing the scaled shape.
7495 # Example: see GEOM_TestAll.py
7496 theFactor, Parameters = ParseParameters(theFactor)
7497 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7498 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7499 anObj.SetParameters(Parameters)
7500 self._autoPublish(anObj, theName, "scaled")
7503 ## Scale the given object by different factors along coordinate axes.
7504 # @param theObject The object to be scaled.
7505 # @param thePoint Center point for scaling.
7506 # Passing None for it means scaling relatively the origin of global CS.
7507 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7508 # @param theCopy Flag used to scale object itself or create a copy.
7509 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7510 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7511 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7513 Scale the given object by different factors along coordinate axes.
7516 theObject The object to be scaled.
7517 thePoint Center point for scaling.
7518 Passing None for it means scaling relatively the origin of global CS.
7519 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7520 theCopy Flag used to scale object itself or create a copy.
7523 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7524 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7526 # Example: see GEOM_TestAll.py
7527 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7529 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7530 theFactorX, theFactorY, theFactorZ)
7532 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7533 theFactorX, theFactorY, theFactorZ)
7534 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7535 anObj.SetParameters(Parameters)
7538 ## Scale the given object by different factors along coordinate axes,
7539 # creating its copy before the scaling.
7540 # @param theObject The object to be scaled.
7541 # @param thePoint Center point for scaling.
7542 # Passing None for it means scaling relatively the origin of global CS.
7543 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7544 # @param theName Object name; when specified, this parameter is used
7545 # for result publication in the study. Otherwise, if automatic
7546 # publication is switched on, default value is used for result name.
7548 # @return New GEOM.GEOM_Object, containing the scaled shape.
7550 # @ref swig_scale "Example"
7551 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7553 Scale the given object by different factors along coordinate axes,
7554 creating its copy before the scaling.
7557 theObject The object to be scaled.
7558 thePoint Center point for scaling.
7559 Passing None for it means scaling relatively the origin of global CS.
7560 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7561 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.
7566 New GEOM.GEOM_Object, containing the scaled shape.
7568 # Example: see GEOM_TestAll.py
7569 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7570 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7571 theFactorX, theFactorY, theFactorZ)
7572 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7573 anObj.SetParameters(Parameters)
7574 self._autoPublish(anObj, theName, "scaled")
7577 ## Mirror an object relatively the given plane.
7578 # @param theObject The object to be mirrored.
7579 # @param thePlane Plane of symmetry.
7580 # @param theCopy Flag used to mirror object itself or create a copy.
7581 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7582 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7583 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7585 Mirror an object relatively the given plane.
7588 theObject The object to be mirrored.
7589 thePlane Plane of symmetry.
7590 theCopy Flag used to mirror object itself or create a copy.
7593 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7594 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7597 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7599 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7600 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7603 ## Create an object, symmetrical
7604 # to the given one relatively the given plane.
7605 # @param theObject The object to be mirrored.
7606 # @param thePlane Plane of symmetry.
7607 # @param theName Object name; when specified, this parameter is used
7608 # for result publication in the study. Otherwise, if automatic
7609 # publication is switched on, default value is used for result name.
7611 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7613 # @ref tui_mirror "Example"
7614 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7616 Create an object, symmetrical to the given one relatively the given plane.
7619 theObject The object to be mirrored.
7620 thePlane Plane of symmetry.
7621 theName Object name; when specified, this parameter is used
7622 for result publication in the study. Otherwise, if automatic
7623 publication is switched on, default value is used for result name.
7626 New GEOM.GEOM_Object, containing the mirrored shape.
7628 # Example: see GEOM_TestAll.py
7629 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7630 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7631 self._autoPublish(anObj, theName, "mirrored")
7634 ## Mirror an object relatively the given axis.
7635 # @param theObject The object to be mirrored.
7636 # @param theAxis Axis of symmetry.
7637 # @param theCopy Flag used to mirror object itself or create a copy.
7638 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7639 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7640 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7642 Mirror an object relatively the given axis.
7645 theObject The object to be mirrored.
7646 theAxis Axis of symmetry.
7647 theCopy Flag used to mirror object itself or create a copy.
7650 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7651 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7654 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7656 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7657 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7660 ## Create an object, symmetrical
7661 # to the given one relatively the given axis.
7662 # @param theObject The object to be mirrored.
7663 # @param theAxis Axis of symmetry.
7664 # @param theName Object name; when specified, this parameter is used
7665 # for result publication in the study. Otherwise, if automatic
7666 # publication is switched on, default value is used for result name.
7668 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7670 # @ref tui_mirror "Example"
7671 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7673 Create an object, symmetrical to the given one relatively the given axis.
7676 theObject The object to be mirrored.
7677 theAxis Axis of symmetry.
7678 theName Object name; when specified, this parameter is used
7679 for result publication in the study. Otherwise, if automatic
7680 publication is switched on, default value is used for result name.
7683 New GEOM.GEOM_Object, containing the mirrored shape.
7685 # Example: see GEOM_TestAll.py
7686 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7687 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7688 self._autoPublish(anObj, theName, "mirrored")
7691 ## Mirror an object relatively the given point.
7692 # @param theObject The object to be mirrored.
7693 # @param thePoint Point of symmetry.
7694 # @param theCopy Flag used to mirror object itself or create a copy.
7695 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7696 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7697 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7699 Mirror an object relatively the given point.
7702 theObject The object to be mirrored.
7703 thePoint Point of symmetry.
7704 theCopy Flag used to mirror object itself or create a copy.
7707 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7708 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7710 # Example: see GEOM_TestAll.py
7712 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7714 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7715 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7718 ## Create an object, symmetrical
7719 # to the given one relatively the given point.
7720 # @param theObject The object to be mirrored.
7721 # @param thePoint Point of symmetry.
7722 # @param theName Object name; when specified, this parameter is used
7723 # for result publication in the study. Otherwise, if automatic
7724 # publication is switched on, default value is used for result name.
7726 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7728 # @ref tui_mirror "Example"
7729 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7731 Create an object, symmetrical
7732 to the given one relatively the given point.
7735 theObject The object to be mirrored.
7736 thePoint Point of symmetry.
7737 theName Object name; when specified, this parameter is used
7738 for result publication in the study. Otherwise, if automatic
7739 publication is switched on, default value is used for result name.
7742 New GEOM.GEOM_Object, containing the mirrored shape.
7744 # Example: see GEOM_TestAll.py
7745 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7746 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7747 self._autoPublish(anObj, theName, "mirrored")
7750 ## Modify the location of the given object.
7751 # @param theObject The object to be displaced.
7752 # @param theStartLCS Coordinate system to perform displacement from it.\n
7753 # If \a theStartLCS is NULL, displacement
7754 # will be performed from global CS.\n
7755 # If \a theObject itself is used as \a theStartLCS,
7756 # its location will be changed to \a theEndLCS.
7757 # @param theEndLCS Coordinate system to perform displacement to it.
7758 # @param theCopy Flag used to displace object itself or create a copy.
7759 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7760 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7761 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7763 Modify the Location of the given object by LCS, creating its copy before the setting.
7766 theObject The object to be displaced.
7767 theStartLCS Coordinate system to perform displacement from it.
7768 If theStartLCS is NULL, displacement
7769 will be performed from global CS.
7770 If theObject itself is used as theStartLCS,
7771 its location will be changed to theEndLCS.
7772 theEndLCS Coordinate system to perform displacement to it.
7773 theCopy Flag used to displace object itself or create a copy.
7776 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7777 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7779 # Example: see GEOM_TestAll.py
7781 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7783 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7784 RaiseIfFailed("Displace", self.TrsfOp)
7787 ## Modify the Location of the given object by LCS,
7788 # creating its copy before the setting.
7789 # @param theObject The object to be displaced.
7790 # @param theStartLCS Coordinate system to perform displacement from it.\n
7791 # If \a theStartLCS is NULL, displacement
7792 # will be performed from global CS.\n
7793 # If \a theObject itself is used as \a theStartLCS,
7794 # its location will be changed to \a theEndLCS.
7795 # @param theEndLCS Coordinate system to perform displacement to it.
7796 # @param theName Object name; when specified, this parameter is used
7797 # for result publication in the study. Otherwise, if automatic
7798 # publication is switched on, default value is used for result name.
7800 # @return New GEOM.GEOM_Object, containing the displaced shape.
7802 # @ref tui_modify_location "Example"
7803 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7805 Modify the Location of the given object by LCS, creating its copy before the setting.
7808 theObject The object to be displaced.
7809 theStartLCS Coordinate system to perform displacement from it.
7810 If theStartLCS is NULL, displacement
7811 will be performed from global CS.
7812 If theObject itself is used as theStartLCS,
7813 its location will be changed to theEndLCS.
7814 theEndLCS Coordinate system to perform displacement to it.
7815 theName Object name; when specified, this parameter is used
7816 for result publication in the study. Otherwise, if automatic
7817 publication is switched on, default value is used for result name.
7820 New GEOM.GEOM_Object, containing the displaced shape.
7823 # create local coordinate systems
7824 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7825 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7826 # modify the location of the given object
7827 position = geompy.MakePosition(cylinder, cs1, cs2)
7829 # Example: see GEOM_TestAll.py
7830 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7831 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7832 self._autoPublish(anObj, theName, "displaced")
7835 ## Modify the Location of the given object by Path.
7836 # @param theObject The object to be displaced.
7837 # @param thePath Wire or Edge along that the object will be translated.
7838 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7839 # @param theCopy is to create a copy objects if true.
7840 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7841 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7842 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7844 # @ref tui_modify_location "Example"
7845 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7847 Modify the Location of the given object by Path.
7850 theObject The object to be displaced.
7851 thePath Wire or Edge along that the object will be translated.
7852 theDistance progress of Path (0 = start location, 1 = end of path location).
7853 theCopy is to create a copy objects if true.
7854 theReverse 0 - for usual direction, 1 - to reverse path direction.
7857 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7858 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7861 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7863 # Example: see GEOM_TestAll.py
7864 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7865 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7868 ## Modify the Location of the given object by Path, creating its copy before the operation.
7869 # @param theObject The object to be displaced.
7870 # @param thePath Wire or Edge along that the object will be translated.
7871 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7872 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7873 # @param theName Object name; when specified, this parameter is used
7874 # for result publication in the study. Otherwise, if automatic
7875 # publication is switched on, default value is used for result name.
7877 # @return New GEOM.GEOM_Object, containing the displaced shape.
7878 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7880 Modify the Location of the given object by Path, creating its copy before the operation.
7883 theObject The object to be displaced.
7884 thePath Wire or Edge along that the object will be translated.
7885 theDistance progress of Path (0 = start location, 1 = end of path location).
7886 theReverse 0 - for usual direction, 1 - to reverse path direction.
7887 theName Object name; when specified, this parameter is used
7888 for result publication in the study. Otherwise, if automatic
7889 publication is switched on, default value is used for result name.
7892 New GEOM.GEOM_Object, containing the displaced shape.
7894 # Example: see GEOM_TestAll.py
7895 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7896 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7897 self._autoPublish(anObj, theName, "displaced")
7900 ## Offset given shape.
7901 # @param theObject The base object for the offset.
7902 # @param theOffset Offset value.
7903 # @param theCopy Flag used to offset object itself or create a copy.
7904 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7905 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7906 def Offset(self, theObject, theOffset, theCopy=False):
7911 theObject The base object for the offset.
7912 theOffset Offset value.
7913 theCopy Flag used to offset object itself or create a copy.
7916 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7917 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7919 theOffset, Parameters = ParseParameters(theOffset)
7921 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7923 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7924 RaiseIfFailed("Offset", self.TrsfOp)
7925 anObj.SetParameters(Parameters)
7928 ## Create new object as offset of the given one.
7929 # @param theObject The base object for the offset.
7930 # @param theOffset Offset value.
7931 # @param theName Object name; when specified, this parameter is used
7932 # for result publication in the study. Otherwise, if automatic
7933 # publication is switched on, default value is used for result name.
7935 # @return New GEOM.GEOM_Object, containing the offset object.
7937 # @ref tui_offset "Example"
7938 def MakeOffset(self, theObject, theOffset, theName=None):
7940 Create new object as offset of the given one.
7943 theObject The base object for the offset.
7944 theOffset Offset value.
7945 theName Object name; when specified, this parameter is used
7946 for result publication in the study. Otherwise, if automatic
7947 publication is switched on, default value is used for result name.
7950 New GEOM.GEOM_Object, containing the offset object.
7953 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7954 # create a new object as offset of the given object
7955 offset = geompy.MakeOffset(box, 70.)
7957 # Example: see GEOM_TestAll.py
7958 theOffset, Parameters = ParseParameters(theOffset)
7959 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7960 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7961 anObj.SetParameters(Parameters)
7962 self._autoPublish(anObj, theName, "offset")
7965 ## Create new object as projection of the given one on a 2D surface.
7966 # @param theSource The source object for the projection. It can be a point, edge or wire.
7967 # @param theTarget The target object. It can be planar or cylindrical face.
7968 # @param theName Object name; when specified, this parameter is used
7969 # for result publication in the study. Otherwise, if automatic
7970 # publication is switched on, default value is used for result name.
7972 # @return New GEOM.GEOM_Object, containing the projection.
7974 # @ref tui_projection "Example"
7975 def MakeProjection(self, theSource, theTarget, theName=None):
7977 Create new object as projection of the given one on a 2D surface.
7980 theSource The source object for the projection. It can be a point, edge or wire.
7981 theTarget The target object. It can be planar or cylindrical face.
7982 theName Object name; when specified, this parameter is used
7983 for result publication in the study. Otherwise, if automatic
7984 publication is switched on, default value is used for result name.
7987 New GEOM.GEOM_Object, containing the projection.
7989 # Example: see GEOM_TestAll.py
7990 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7991 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7992 self._autoPublish(anObj, theName, "projection")
7995 # -----------------------------------------------------------------------------
7997 # -----------------------------------------------------------------------------
7999 ## Translate the given object along the given vector a given number times
8000 # @param theObject The object to be translated.
8001 # @param theVector Direction of the translation. DX if None.
8002 # @param theStep Distance to translate on.
8003 # @param theNbTimes Quantity of translations to be done.
8004 # @param theName Object name; when specified, this parameter is used
8005 # for result publication in the study. Otherwise, if automatic
8006 # publication is switched on, default value is used for result name.
8008 # @return New GEOM.GEOM_Object, containing compound of all
8009 # the shapes, obtained after each translation.
8011 # @ref tui_multi_translation "Example"
8012 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8014 Translate the given object along the given vector a given number times
8017 theObject The object to be translated.
8018 theVector Direction of the translation. DX if None.
8019 theStep Distance to translate on.
8020 theNbTimes Quantity of translations to be done.
8021 theName Object name; when specified, this parameter is used
8022 for result publication in the study. Otherwise, if automatic
8023 publication is switched on, default value is used for result name.
8026 New GEOM.GEOM_Object, containing compound of all
8027 the shapes, obtained after each translation.
8030 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8032 # Example: see GEOM_TestAll.py
8033 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8034 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8035 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8036 anObj.SetParameters(Parameters)
8037 self._autoPublish(anObj, theName, "multitranslation")
8040 ## Conseqently apply two specified translations to theObject specified number of times.
8041 # @param theObject The object to be translated.
8042 # @param theVector1 Direction of the first translation. DX if None.
8043 # @param theStep1 Step of the first translation.
8044 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8045 # @param theVector2 Direction of the second translation. DY if None.
8046 # @param theStep2 Step of the second translation.
8047 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8048 # @param theName Object name; when specified, this parameter is used
8049 # for result publication in the study. Otherwise, if automatic
8050 # publication is switched on, default value is used for result name.
8052 # @return New GEOM.GEOM_Object, containing compound of all
8053 # the shapes, obtained after each translation.
8055 # @ref tui_multi_translation "Example"
8056 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8057 theVector2, theStep2, theNbTimes2, theName=None):
8059 Conseqently apply two specified translations to theObject specified number of times.
8062 theObject The object to be translated.
8063 theVector1 Direction of the first translation. DX if None.
8064 theStep1 Step of the first translation.
8065 theNbTimes1 Quantity of translations to be done along theVector1.
8066 theVector2 Direction of the second translation. DY if None.
8067 theStep2 Step of the second translation.
8068 theNbTimes2 Quantity of translations to be done along theVector2.
8069 theName Object name; when specified, this parameter is used
8070 for result publication in the study. Otherwise, if automatic
8071 publication is switched on, default value is used for result name.
8074 New GEOM.GEOM_Object, containing compound of all
8075 the shapes, obtained after each translation.
8078 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8080 # Example: see GEOM_TestAll.py
8081 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8082 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8083 theVector2, theStep2, theNbTimes2)
8084 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8085 anObj.SetParameters(Parameters)
8086 self._autoPublish(anObj, theName, "multitranslation")
8089 ## Rotate the given object around the given axis a given number times.
8090 # Rotation angle will be 2*PI/theNbTimes.
8091 # @param theObject The object to be rotated.
8092 # @param theAxis The rotation axis. DZ if None.
8093 # @param theNbTimes Quantity of rotations to be done.
8094 # @param theName Object name; when specified, this parameter is used
8095 # for result publication in the study. Otherwise, if automatic
8096 # publication is switched on, default value is used for result name.
8098 # @return New GEOM.GEOM_Object, containing compound of all the
8099 # shapes, obtained after each rotation.
8101 # @ref tui_multi_rotation "Example"
8102 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8104 Rotate the given object around the given axis a given number times.
8105 Rotation angle will be 2*PI/theNbTimes.
8108 theObject The object to be rotated.
8109 theAxis The rotation axis. DZ if None.
8110 theNbTimes Quantity of rotations to be done.
8111 theName Object name; when specified, this parameter is used
8112 for result publication in the study. Otherwise, if automatic
8113 publication is switched on, default value is used for result name.
8116 New GEOM.GEOM_Object, containing compound of all the
8117 shapes, obtained after each rotation.
8120 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8122 # Example: see GEOM_TestAll.py
8123 theNbTimes, Parameters = ParseParameters(theNbTimes)
8124 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8125 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8126 anObj.SetParameters(Parameters)
8127 self._autoPublish(anObj, theName, "multirotation")
8130 ## Rotate the given object around the given axis
8131 # a given number times on the given angle.
8132 # @param theObject The object to be rotated.
8133 # @param theAxis The rotation axis. DZ if None.
8134 # @param theAngleStep Rotation angle in radians.
8135 # @param theNbTimes Quantity of rotations to be done.
8136 # @param theName Object name; when specified, this parameter is used
8137 # for result publication in the study. Otherwise, if automatic
8138 # publication is switched on, default value is used for result name.
8140 # @return New GEOM.GEOM_Object, containing compound of all the
8141 # shapes, obtained after each rotation.
8143 # @ref tui_multi_rotation "Example"
8144 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8146 Rotate the given object around the given axis
8147 a given number times on the given angle.
8150 theObject The object to be rotated.
8151 theAxis The rotation axis. DZ if None.
8152 theAngleStep Rotation angle in radians.
8153 theNbTimes Quantity of rotations to be done.
8154 theName Object name; when specified, this parameter is used
8155 for result publication in the study. Otherwise, if automatic
8156 publication is switched on, default value is used for result name.
8159 New GEOM.GEOM_Object, containing compound of all the
8160 shapes, obtained after each rotation.
8163 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8165 # Example: see GEOM_TestAll.py
8166 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8167 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8168 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8169 anObj.SetParameters(Parameters)
8170 self._autoPublish(anObj, theName, "multirotation")
8173 ## Rotate the given object around the given axis a given
8174 # number times and multi-translate each rotation result.
8175 # Rotation angle will be 2*PI/theNbTimes1.
8176 # Translation direction passes through center of gravity
8177 # of rotated shape and its projection on the rotation axis.
8178 # @param theObject The object to be rotated.
8179 # @param theAxis Rotation axis. DZ if None.
8180 # @param theNbTimes1 Quantity of rotations to be done.
8181 # @param theRadialStep Translation distance.
8182 # @param theNbTimes2 Quantity of translations to be done.
8183 # @param theName Object name; when specified, this parameter is used
8184 # for result publication in the study. Otherwise, if automatic
8185 # publication is switched on, default value is used for result name.
8187 # @return New GEOM.GEOM_Object, containing compound of all the
8188 # shapes, obtained after each transformation.
8190 # @ref tui_multi_rotation "Example"
8191 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8193 Rotate the given object around the
8194 given axis on the given angle a given number
8195 times and multi-translate each rotation result.
8196 Translation direction passes through center of gravity
8197 of rotated shape and its projection on the rotation axis.
8200 theObject The object to be rotated.
8201 theAxis Rotation axis. DZ if None.
8202 theNbTimes1 Quantity of rotations to be done.
8203 theRadialStep Translation distance.
8204 theNbTimes2 Quantity of translations to be done.
8205 theName Object name; when specified, this parameter is used
8206 for result publication in the study. Otherwise, if automatic
8207 publication is switched on, default value is used for result name.
8210 New GEOM.GEOM_Object, containing compound of all the
8211 shapes, obtained after each transformation.
8214 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8216 # Example: see GEOM_TestAll.py
8217 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8218 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8219 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8220 anObj.SetParameters(Parameters)
8221 self._autoPublish(anObj, theName, "multirotation")
8224 ## Rotate the given object around the
8225 # given axis on the given angle a given number
8226 # times and multi-translate each rotation result.
8227 # Translation direction passes through center of gravity
8228 # of rotated shape and its projection on the rotation axis.
8229 # @param theObject The object to be rotated.
8230 # @param theAxis Rotation axis. DZ if None.
8231 # @param theAngleStep Rotation angle in radians.
8232 # @param theNbTimes1 Quantity of rotations to be done.
8233 # @param theRadialStep Translation distance.
8234 # @param theNbTimes2 Quantity of translations to be done.
8235 # @param theName Object name; when specified, this parameter is used
8236 # for result publication in the study. Otherwise, if automatic
8237 # publication is switched on, default value is used for result name.
8239 # @return New GEOM.GEOM_Object, containing compound of all the
8240 # shapes, obtained after each transformation.
8242 # @ref tui_multi_rotation "Example"
8243 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8245 Rotate the given object around the
8246 given axis on the given angle a given number
8247 times and multi-translate each rotation result.
8248 Translation direction passes through center of gravity
8249 of rotated shape and its projection on the rotation axis.
8252 theObject The object to be rotated.
8253 theAxis Rotation axis. DZ if None.
8254 theAngleStep Rotation angle in radians.
8255 theNbTimes1 Quantity of rotations to be done.
8256 theRadialStep Translation distance.
8257 theNbTimes2 Quantity of translations to be done.
8258 theName Object name; when specified, this parameter is used
8259 for result publication in the study. Otherwise, if automatic
8260 publication is switched on, default value is used for result name.
8263 New GEOM.GEOM_Object, containing compound of all the
8264 shapes, obtained after each transformation.
8267 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8269 # Example: see GEOM_TestAll.py
8270 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8271 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8272 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8273 anObj.SetParameters(Parameters)
8274 self._autoPublish(anObj, theName, "multirotation")
8277 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8279 # @ref swig_MakeMultiRotation "Example"
8280 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8282 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8285 pz = geompy.MakeVertex(0, 0, 100)
8286 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8287 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8289 # Example: see GEOM_TestOthers.py
8290 aVec = self.MakeLine(aPoint,aDir)
8291 # note: auto-publishing is done in self.MultiRotate1D()
8292 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8295 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8297 # @ref swig_MakeMultiRotation "Example"
8298 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8300 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8303 pz = geompy.MakeVertex(0, 0, 100)
8304 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8305 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8307 # Example: see GEOM_TestOthers.py
8308 aVec = self.MakeLine(aPoint,aDir)
8309 # note: auto-publishing is done in self.MultiRotate1D()
8310 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8313 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8315 # @ref swig_MakeMultiRotation "Example"
8316 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8318 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8321 pz = geompy.MakeVertex(0, 0, 100)
8322 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8323 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8325 # Example: see GEOM_TestOthers.py
8326 aVec = self.MakeLine(aPoint,aDir)
8327 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8328 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8331 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8333 # @ref swig_MakeMultiRotation "Example"
8334 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8336 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8339 pz = geompy.MakeVertex(0, 0, 100)
8340 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8341 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8343 # Example: see GEOM_TestOthers.py
8344 aVec = self.MakeLine(aPoint,aDir)
8345 # note: auto-publishing is done in self.MultiRotate2D()
8346 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8349 # end of l3_transform
8352 ## @addtogroup l3_transform_d
8355 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8356 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8358 Deprecated method. Use MultiRotate1DNbTimes instead.
8360 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8361 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8363 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8364 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8365 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8367 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8368 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8371 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8373 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8374 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8375 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8376 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8377 anObj.SetParameters(Parameters)
8378 self._autoPublish(anObj, theName, "multirotation")
8381 ## The same, as MultiRotate1D(), but axis is given by direction and point
8382 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8383 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8385 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8386 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8389 pz = geompy.MakeVertex(0, 0, 100)
8390 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8391 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8393 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8394 aVec = self.MakeLine(aPoint,aDir)
8395 # note: auto-publishing is done in self.MultiRotate1D()
8396 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8399 ## The same, as MultiRotate2D(), but axis is given by direction and point
8400 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8401 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8403 The same, as MultiRotate2D(), but axis is given by direction and point
8404 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8407 pz = geompy.MakeVertex(0, 0, 100)
8408 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8409 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8411 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8412 aVec = self.MakeLine(aPoint,aDir)
8413 # note: auto-publishing is done in self.MultiRotate2D()
8414 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8417 # end of l3_transform_d
8420 ## @addtogroup l3_local
8423 ## Perform a fillet on all edges of the given shape.
8424 # @param theShape Shape, to perform fillet on.
8425 # @param theR Fillet radius.
8426 # @param theName Object name; when specified, this parameter is used
8427 # for result publication in the study. Otherwise, if automatic
8428 # publication is switched on, default value is used for result name.
8430 # @return New GEOM.GEOM_Object, containing the result shape.
8432 # @ref tui_fillet "Example 1"
8433 # \n @ref swig_MakeFilletAll "Example 2"
8434 def MakeFilletAll(self, theShape, theR, theName=None):
8436 Perform a fillet on all edges of the given shape.
8439 theShape Shape, to perform fillet on.
8441 theName Object name; when specified, this parameter is used
8442 for result publication in the study. Otherwise, if automatic
8443 publication is switched on, default value is used for result name.
8446 New GEOM.GEOM_Object, containing the result shape.
8449 filletall = geompy.MakeFilletAll(prism, 10.)
8451 # Example: see GEOM_TestOthers.py
8452 theR,Parameters = ParseParameters(theR)
8453 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8454 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8455 anObj.SetParameters(Parameters)
8456 self._autoPublish(anObj, theName, "fillet")
8459 ## Perform a fillet on the specified edges/faces of the given shape
8460 # @param theShape Shape, to perform fillet on.
8461 # @param theR Fillet radius.
8462 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8463 # @param theListShapes Global indices of edges/faces to perform fillet on.
8464 # @param theName Object name; when specified, this parameter is used
8465 # for result publication in the study. Otherwise, if automatic
8466 # publication is switched on, default value is used for result name.
8468 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8470 # @return New GEOM.GEOM_Object, containing the result shape.
8472 # @ref tui_fillet "Example"
8473 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8475 Perform a fillet on the specified edges/faces of the given shape
8478 theShape Shape, to perform fillet on.
8480 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8481 theListShapes Global indices of edges/faces to perform fillet on.
8482 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.
8487 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8490 New GEOM.GEOM_Object, containing the result shape.
8493 # get the list of IDs (IDList) for the fillet
8494 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8496 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8497 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8498 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8499 # make a fillet on the specified edges of the given shape
8500 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8502 # Example: see GEOM_TestAll.py
8503 theR,Parameters = ParseParameters(theR)
8505 if theShapeType == self.ShapeType["EDGE"]:
8506 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8507 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8509 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8510 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8511 anObj.SetParameters(Parameters)
8512 self._autoPublish(anObj, theName, "fillet")
8515 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8516 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8518 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8521 # get the list of IDs (IDList) for the fillet
8522 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8524 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8525 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8526 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8527 # make a fillet on the specified edges of the given shape
8528 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8530 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8532 if theShapeType == self.ShapeType["EDGE"]:
8533 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8534 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8536 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8537 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8538 anObj.SetParameters(Parameters)
8539 self._autoPublish(anObj, theName, "fillet")
8542 ## Perform a fillet on the specified edges of the given shape
8543 # @param theShape Wire Shape to perform fillet on.
8544 # @param theR Fillet radius.
8545 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8546 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8547 # \note The list of vertices could be empty,
8548 # in this case fillet will done done at all vertices in wire
8549 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8550 # by the length of the edges, nearest to the fillet vertex.
8551 # But sometimes the next edge is C1 continuous with the one, nearest to
8552 # the fillet point, and such two (or more) edges can be united to allow
8553 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8554 # thus ignoring the secant vertex (vertices).
8555 # @param theName Object name; when specified, this parameter is used
8556 # for result publication in the study. Otherwise, if automatic
8557 # publication is switched on, default value is used for result name.
8559 # @return New GEOM.GEOM_Object, containing the result shape.
8561 # @ref tui_fillet2d "Example"
8562 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8564 Perform a fillet on the specified edges of the given shape
8567 theShape Wire Shape to perform fillet on.
8569 theListOfVertexes Global indices of vertexes to perform fillet on.
8570 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8571 by the length of the edges, nearest to the fillet vertex.
8572 But sometimes the next edge is C1 continuous with the one, nearest to
8573 the fillet point, and such two (or more) edges can be united to allow
8574 bigger radius. Set this flag to TRUE to allow collinear edges union,
8575 thus ignoring the secant vertex (vertices).
8576 theName Object name; when specified, this parameter is used
8577 for result publication in the study. Otherwise, if automatic
8578 publication is switched on, default value is used for result name.
8580 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8582 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8585 New GEOM.GEOM_Object, containing the result shape.
8589 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8590 # make fillet at given wire vertices with giver radius
8591 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8593 # Example: see GEOM_TestAll.py
8594 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8595 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8596 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8597 anObj.SetParameters(Parameters)
8598 self._autoPublish(anObj, theName, "fillet")
8601 ## Perform a fillet at the specified vertices of the given face/shell.
8602 # @param theShape Face or Shell shape to perform fillet on.
8603 # @param theR Fillet radius.
8604 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8605 # @param theName Object name; when specified, this parameter is used
8606 # for result publication in the study. Otherwise, if automatic
8607 # publication is switched on, default value is used for result name.
8609 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8611 # @return New GEOM.GEOM_Object, containing the result shape.
8613 # @ref tui_fillet2d "Example"
8614 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8616 Perform a fillet at the specified vertices of the given face/shell.
8619 theShape Face or Shell shape to perform fillet on.
8621 theListOfVertexes Global indices of vertexes to perform fillet on.
8622 theName Object name; when specified, this parameter is used
8623 for result publication in the study. Otherwise, if automatic
8624 publication is switched on, default value is used for result name.
8626 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8629 New GEOM.GEOM_Object, containing the result shape.
8632 face = geompy.MakeFaceHW(100, 100, 1)
8633 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8635 # Example: see GEOM_TestAll.py
8636 theR,Parameters = ParseParameters(theR)
8637 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8638 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8639 anObj.SetParameters(Parameters)
8640 self._autoPublish(anObj, theName, "fillet")
8643 ## Perform a symmetric chamfer on all edges of the given shape.
8644 # @param theShape Shape, to perform chamfer on.
8645 # @param theD Chamfer size along each face.
8646 # @param theName Object name; when specified, this parameter is used
8647 # for result publication in the study. Otherwise, if automatic
8648 # publication is switched on, default value is used for result name.
8650 # @return New GEOM.GEOM_Object, containing the result shape.
8652 # @ref tui_chamfer "Example 1"
8653 # \n @ref swig_MakeChamferAll "Example 2"
8654 def MakeChamferAll(self, theShape, theD, theName=None):
8656 Perform a symmetric chamfer on all edges of the given shape.
8659 theShape Shape, to perform chamfer on.
8660 theD Chamfer size along each face.
8661 theName Object name; when specified, this parameter is used
8662 for result publication in the study. Otherwise, if automatic
8663 publication is switched on, default value is used for result name.
8666 New GEOM.GEOM_Object, containing the result shape.
8669 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8671 # Example: see GEOM_TestOthers.py
8672 theD,Parameters = ParseParameters(theD)
8673 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8674 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8675 anObj.SetParameters(Parameters)
8676 self._autoPublish(anObj, theName, "chamfer")
8679 ## Perform a chamfer on edges, common to the specified faces,
8680 # with distance D1 on the Face1
8681 # @param theShape Shape, to perform chamfer on.
8682 # @param theD1 Chamfer size along \a theFace1.
8683 # @param theD2 Chamfer size along \a theFace2.
8684 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8685 # @param theName Object name; when specified, this parameter is used
8686 # for result publication in the study. Otherwise, if automatic
8687 # publication is switched on, default value is used for result name.
8689 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8691 # @return New GEOM.GEOM_Object, containing the result shape.
8693 # @ref tui_chamfer "Example"
8694 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8696 Perform a chamfer on edges, common to the specified faces,
8697 with distance D1 on the Face1
8700 theShape Shape, to perform chamfer on.
8701 theD1 Chamfer size along theFace1.
8702 theD2 Chamfer size along theFace2.
8703 theFace1,theFace2 Global indices of two faces of theShape.
8704 theName Object name; when specified, this parameter is used
8705 for result publication in the study. Otherwise, if automatic
8706 publication is switched on, default value is used for result name.
8709 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8712 New GEOM.GEOM_Object, containing the result shape.
8715 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8716 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8717 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8718 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8720 # Example: see GEOM_TestAll.py
8721 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8722 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8723 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8724 anObj.SetParameters(Parameters)
8725 self._autoPublish(anObj, theName, "chamfer")
8728 ## Perform a chamfer on edges
8729 # @param theShape Shape, to perform chamfer on.
8730 # @param theD Chamfer length
8731 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8732 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8733 # @param theName Object name; when specified, this parameter is used
8734 # for result publication in the study. Otherwise, if automatic
8735 # publication is switched on, default value is used for result name.
8737 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8739 # @return New GEOM.GEOM_Object, containing the result shape.
8740 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8742 Perform a chamfer on edges
8745 theShape Shape, to perform chamfer on.
8746 theD1 Chamfer size along theFace1.
8747 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8748 theFace1,theFace2 Global indices of two faces of theShape.
8749 theName Object name; when specified, this parameter is used
8750 for result publication in the study. Otherwise, if automatic
8751 publication is switched on, default value is used for result name.
8754 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8757 New GEOM.GEOM_Object, containing the result shape.
8760 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8761 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8762 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8764 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8767 if isinstance(theAngle,str):
8769 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8771 theAngle = theAngle*math.pi/180.0
8772 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8773 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8774 anObj.SetParameters(Parameters)
8775 self._autoPublish(anObj, theName, "chamfer")
8778 ## Perform a chamfer on all edges of the specified faces,
8779 # with distance D1 on the first specified face (if several for one edge)
8780 # @param theShape Shape, to perform chamfer on.
8781 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8782 # connected to the edge, are in \a theFaces, \a theD1
8783 # will be get along face, which is nearer to \a theFaces beginning.
8784 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8785 # @param theFaces Sequence of global indices of faces of \a theShape.
8786 # @param theName Object name; when specified, this parameter is used
8787 # for result publication in the study. Otherwise, if automatic
8788 # publication is switched on, default value is used for result name.
8790 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8792 # @return New GEOM.GEOM_Object, containing the result shape.
8794 # @ref tui_chamfer "Example"
8795 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8797 Perform a chamfer on all edges of the specified faces,
8798 with distance D1 on the first specified face (if several for one edge)
8801 theShape Shape, to perform chamfer on.
8802 theD1 Chamfer size along face from theFaces. If both faces,
8803 connected to the edge, are in theFaces, theD1
8804 will be get along face, which is nearer to theFaces beginning.
8805 theD2 Chamfer size along another of two faces, connected to the edge.
8806 theFaces Sequence of global indices of faces of theShape.
8807 theName Object name; when specified, this parameter is used
8808 for result publication in the study. Otherwise, if automatic
8809 publication is switched on, default value is used for result name.
8811 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8814 New GEOM.GEOM_Object, containing the result shape.
8816 # Example: see GEOM_TestAll.py
8817 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8818 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8819 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8820 anObj.SetParameters(Parameters)
8821 self._autoPublish(anObj, theName, "chamfer")
8824 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8825 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8827 # @ref swig_FilletChamfer "Example"
8828 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8830 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8831 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8834 if isinstance(theAngle,str):
8836 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8838 theAngle = theAngle*math.pi/180.0
8839 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8840 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8841 anObj.SetParameters(Parameters)
8842 self._autoPublish(anObj, theName, "chamfer")
8845 ## Perform a chamfer on edges,
8846 # with distance D1 on the first specified face (if several for one edge)
8847 # @param theShape Shape, to perform chamfer on.
8848 # @param theD1,theD2 Chamfer size
8849 # @param theEdges Sequence of edges of \a theShape.
8850 # @param theName Object name; when specified, this parameter is used
8851 # for result publication in the study. Otherwise, if automatic
8852 # publication is switched on, default value is used for result name.
8854 # @return New GEOM.GEOM_Object, containing the result shape.
8856 # @ref swig_FilletChamfer "Example"
8857 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8859 Perform a chamfer on edges,
8860 with distance D1 on the first specified face (if several for one edge)
8863 theShape Shape, to perform chamfer on.
8864 theD1,theD2 Chamfer size
8865 theEdges Sequence of edges of theShape.
8866 theName Object name; when specified, this parameter is used
8867 for result publication in the study. Otherwise, if automatic
8868 publication is switched on, default value is used for result name.
8871 New GEOM.GEOM_Object, containing the result shape.
8873 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8874 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8875 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8876 anObj.SetParameters(Parameters)
8877 self._autoPublish(anObj, theName, "chamfer")
8880 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8881 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8882 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8884 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8885 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8888 if isinstance(theAngle,str):
8890 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8892 theAngle = theAngle*math.pi/180.0
8893 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8894 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8895 anObj.SetParameters(Parameters)
8896 self._autoPublish(anObj, theName, "chamfer")
8899 ## @sa MakeChamferEdge(), MakeChamferFaces()
8901 # @ref swig_MakeChamfer "Example"
8902 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8904 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8906 # Example: see GEOM_TestOthers.py
8908 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8909 if aShapeType == self.ShapeType["EDGE"]:
8910 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8912 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8915 ## Remove material from a solid by extrusion of the base shape on the given distance.
8916 # @param theInit Shape to remove material from. It must be a solid or
8917 # a compound made of a single solid.
8918 # @param theBase Closed edge or wire defining the base shape to be extruded.
8919 # @param theH Prism dimension along the normal to theBase
8920 # @param theAngle Draft angle in degrees.
8921 # @param theName Object name; when specified, this parameter is used
8922 # for result publication in the study. Otherwise, if automatic
8923 # publication is switched on, default value is used for result name.
8925 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8927 # @ref tui_creation_prism "Example"
8928 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8930 Add material to a solid by extrusion of the base shape on the given distance.
8933 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8934 theBase Closed edge or wire defining the base shape to be extruded.
8935 theH Prism dimension along the normal to theBase
8936 theAngle Draft angle in degrees.
8937 theName Object name; when specified, this parameter is used
8938 for result publication in the study. Otherwise, if automatic
8939 publication is switched on, default value is used for result name.
8942 New GEOM.GEOM_Object, containing the initial shape with removed material.
8944 # Example: see GEOM_TestAll.py
8945 #theH,Parameters = ParseParameters(theH)
8946 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8947 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8948 #anObj.SetParameters(Parameters)
8949 self._autoPublish(anObj, theName, "extrudedCut")
8952 ## Add material to a solid by extrusion of the base shape on the given distance.
8953 # @param theInit Shape to add material to. It must be a solid or
8954 # a compound made of a single solid.
8955 # @param theBase Closed edge or wire defining the base shape to be extruded.
8956 # @param theH Prism dimension along the normal to theBase
8957 # @param theAngle Draft angle in degrees.
8958 # @param theName Object name; when specified, this parameter is used
8959 # for result publication in the study. Otherwise, if automatic
8960 # publication is switched on, default value is used for result name.
8962 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8964 # @ref tui_creation_prism "Example"
8965 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8967 Add material to a solid by extrusion of the base shape on the given distance.
8970 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8971 theBase Closed edge or wire defining the base shape to be extruded.
8972 theH Prism dimension along the normal to theBase
8973 theAngle Draft angle in degrees.
8974 theName Object name; when specified, this parameter is used
8975 for result publication in the study. Otherwise, if automatic
8976 publication is switched on, default value is used for result name.
8979 New GEOM.GEOM_Object, containing the initial shape with added material.
8981 # Example: see GEOM_TestAll.py
8982 #theH,Parameters = ParseParameters(theH)
8983 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8984 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8985 #anObj.SetParameters(Parameters)
8986 self._autoPublish(anObj, theName, "extrudedBoss")
8992 ## @addtogroup l3_basic_op
8995 ## Perform an Archimde operation on the given shape with given parameters.
8996 # The object presenting the resulting face is returned.
8997 # @param theShape Shape to be put in water.
8998 # @param theWeight Weight og the shape.
8999 # @param theWaterDensity Density of the water.
9000 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9001 # @param theName Object name; when specified, this parameter is used
9002 # for result publication in the study. Otherwise, if automatic
9003 # publication is switched on, default value is used for result name.
9005 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9006 # by a plane, corresponding to water level.
9008 # @ref tui_archimede "Example"
9009 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9011 Perform an Archimde operation on the given shape with given parameters.
9012 The object presenting the resulting face is returned.
9015 theShape Shape to be put in water.
9016 theWeight Weight og the shape.
9017 theWaterDensity Density of the water.
9018 theMeshDeflection Deflection of the mesh, using to compute the section.
9019 theName Object name; when specified, this parameter is used
9020 for result publication in the study. Otherwise, if automatic
9021 publication is switched on, default value is used for result name.
9024 New GEOM.GEOM_Object, containing a section of theShape
9025 by a plane, corresponding to water level.
9027 # Example: see GEOM_TestAll.py
9028 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9029 theWeight,theWaterDensity,theMeshDeflection)
9030 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9031 RaiseIfFailed("MakeArchimede", self.LocalOp)
9032 anObj.SetParameters(Parameters)
9033 self._autoPublish(anObj, theName, "archimede")
9036 # end of l3_basic_op
9039 ## @addtogroup l2_measure
9042 ## Get point coordinates
9045 # @ref tui_measurement_tools_page "Example"
9046 def PointCoordinates(self,Point):
9048 Get point coordinates
9053 # Example: see GEOM_TestMeasures.py
9054 aTuple = self.MeasuOp.PointCoordinates(Point)
9055 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9058 ## Get vector coordinates
9061 # @ref tui_measurement_tools_page "Example"
9062 def VectorCoordinates(self,Vector):
9064 Get vector coordinates
9070 p1=self.GetFirstVertex(Vector)
9071 p2=self.GetLastVertex(Vector)
9073 X1=self.PointCoordinates(p1)
9074 X2=self.PointCoordinates(p2)
9076 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9079 ## Compute cross product
9080 # @return vector w=u^v
9082 # @ref tui_measurement_tools_page "Example"
9083 def CrossProduct(self, Vector1, Vector2):
9085 Compute cross product
9087 Returns: vector w=u^v
9089 u=self.VectorCoordinates(Vector1)
9090 v=self.VectorCoordinates(Vector2)
9091 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])
9095 ## Compute cross product
9096 # @return dot product p=u.v
9098 # @ref tui_measurement_tools_page "Example"
9099 def DotProduct(self, Vector1, Vector2):
9101 Compute cross product
9103 Returns: dot product p=u.v
9105 u=self.VectorCoordinates(Vector1)
9106 v=self.VectorCoordinates(Vector2)
9107 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9112 ## Get summarized length of all wires,
9113 # area of surface and volume of the given shape.
9114 # @param theShape Shape to define properties of.
9115 # @return [theLength, theSurfArea, theVolume]\n
9116 # theLength: Summarized length of all wires of the given shape.\n
9117 # theSurfArea: Area of surface of the given shape.\n
9118 # theVolume: Volume of the given shape.
9120 # @ref tui_measurement_tools_page "Example"
9121 def BasicProperties(self,theShape):
9123 Get summarized length of all wires,
9124 area of surface and volume of the given shape.
9127 theShape Shape to define properties of.
9130 [theLength, theSurfArea, theVolume]
9131 theLength: Summarized length of all wires of the given shape.
9132 theSurfArea: Area of surface of the given shape.
9133 theVolume: Volume of the given shape.
9135 # Example: see GEOM_TestMeasures.py
9136 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9137 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9140 ## Get parameters of bounding box of the given shape
9141 # @param theShape Shape to obtain bounding box of.
9142 # @param precise TRUE for precise computation; FALSE for fast one.
9143 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9144 # Xmin,Xmax: Limits of shape along OX axis.
9145 # Ymin,Ymax: Limits of shape along OY axis.
9146 # Zmin,Zmax: Limits of shape along OZ axis.
9148 # @ref tui_measurement_tools_page "Example"
9149 def BoundingBox (self, theShape, precise=False):
9151 Get parameters of bounding box of the given shape
9154 theShape Shape to obtain bounding box of.
9155 precise TRUE for precise computation; FALSE for fast one.
9158 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9159 Xmin,Xmax: Limits of shape along OX axis.
9160 Ymin,Ymax: Limits of shape along OY axis.
9161 Zmin,Zmax: Limits of shape along OZ axis.
9163 # Example: see GEOM_TestMeasures.py
9164 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9165 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9168 ## Get bounding box of the given shape
9169 # @param theShape Shape to obtain bounding box of.
9170 # @param precise TRUE for precise computation; FALSE for fast one.
9171 # @param theName Object name; when specified, this parameter is used
9172 # for result publication in the study. Otherwise, if automatic
9173 # publication is switched on, default value is used for result name.
9175 # @return New GEOM.GEOM_Object, containing the created box.
9177 # @ref tui_measurement_tools_page "Example"
9178 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9180 Get bounding box of the given shape
9183 theShape Shape to obtain bounding box of.
9184 precise TRUE for precise computation; FALSE for fast one.
9185 theName Object name; when specified, this parameter is used
9186 for result publication in the study. Otherwise, if automatic
9187 publication is switched on, default value is used for result name.
9190 New GEOM.GEOM_Object, containing the created box.
9192 # Example: see GEOM_TestMeasures.py
9193 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9194 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9195 self._autoPublish(anObj, theName, "bndbox")
9198 ## Get inertia matrix and moments of inertia of theShape.
9199 # @param theShape Shape to calculate inertia of.
9200 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9201 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9202 # Ix,Iy,Iz: Moments of inertia of the given shape.
9204 # @ref tui_measurement_tools_page "Example"
9205 def Inertia(self,theShape):
9207 Get inertia matrix and moments of inertia of theShape.
9210 theShape Shape to calculate inertia of.
9213 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9214 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9215 Ix,Iy,Iz: Moments of inertia of the given shape.
9217 # Example: see GEOM_TestMeasures.py
9218 aTuple = self.MeasuOp.GetInertia(theShape)
9219 RaiseIfFailed("GetInertia", self.MeasuOp)
9222 ## Get if coords are included in the shape (ST_IN or ST_ON)
9223 # @param theShape Shape
9224 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9225 # @param tolerance to be used (default is 1.0e-7)
9226 # @return list_of_boolean = [res1, res2, ...]
9227 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9229 Get if coords are included in the shape (ST_IN or ST_ON)
9233 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9234 tolerance to be used (default is 1.0e-7)
9237 list_of_boolean = [res1, res2, ...]
9239 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9241 ## Get minimal distance between the given shapes.
9242 # @param theShape1,theShape2 Shapes to find minimal distance between.
9243 # @return Value of the minimal distance between the given shapes.
9245 # @ref tui_measurement_tools_page "Example"
9246 def MinDistance(self, theShape1, theShape2):
9248 Get minimal distance between the given shapes.
9251 theShape1,theShape2 Shapes to find minimal distance between.
9254 Value of the minimal distance between the given shapes.
9256 # Example: see GEOM_TestMeasures.py
9257 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9258 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9261 ## Get minimal distance between the given shapes.
9262 # @param theShape1,theShape2 Shapes to find minimal distance between.
9263 # @return Value of the minimal distance between the given shapes, in form of list
9264 # [Distance, DX, DY, DZ].
9266 # @ref swig_all_measure "Example"
9267 def MinDistanceComponents(self, theShape1, theShape2):
9269 Get minimal distance between the given shapes.
9272 theShape1,theShape2 Shapes to find minimal distance between.
9275 Value of the minimal distance between the given shapes, in form of list
9276 [Distance, DX, DY, DZ]
9278 # Example: see GEOM_TestMeasures.py
9279 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9280 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9281 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9284 ## Get closest points of the given shapes.
9285 # @param theShape1,theShape2 Shapes to find closest points of.
9286 # @return The number of found solutions (-1 in case of infinite number of
9287 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9289 # @ref tui_measurement_tools_page "Example"
9290 def ClosestPoints (self, theShape1, theShape2):
9292 Get closest points of the given shapes.
9295 theShape1,theShape2 Shapes to find closest points of.
9298 The number of found solutions (-1 in case of infinite number of
9299 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9301 # Example: see GEOM_TestMeasures.py
9302 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9303 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9306 ## Get angle between the given shapes in degrees.
9307 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9308 # @note If both arguments are vectors, the angle is computed in accordance
9309 # with their orientations, otherwise the minimum angle is computed.
9310 # @return Value of the angle between the given shapes in degrees.
9312 # @ref tui_measurement_tools_page "Example"
9313 def GetAngle(self, theShape1, theShape2):
9315 Get angle between the given shapes in degrees.
9318 theShape1,theShape2 Lines or linear edges to find angle between.
9321 If both arguments are vectors, the angle is computed in accordance
9322 with their orientations, otherwise the minimum angle is computed.
9325 Value of the angle between the given shapes in degrees.
9327 # Example: see GEOM_TestMeasures.py
9328 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9329 RaiseIfFailed("GetAngle", self.MeasuOp)
9332 ## Get angle between the given shapes in radians.
9333 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9334 # @note If both arguments are vectors, the angle is computed in accordance
9335 # with their orientations, otherwise the minimum angle is computed.
9336 # @return Value of the angle between the given shapes in radians.
9338 # @ref tui_measurement_tools_page "Example"
9339 def GetAngleRadians(self, theShape1, theShape2):
9341 Get angle between the given shapes in radians.
9344 theShape1,theShape2 Lines or linear edges to find angle between.
9348 If both arguments are vectors, the angle is computed in accordance
9349 with their orientations, otherwise the minimum angle is computed.
9352 Value of the angle between the given shapes in radians.
9354 # Example: see GEOM_TestMeasures.py
9355 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9356 RaiseIfFailed("GetAngle", self.MeasuOp)
9359 ## Get angle between the given vectors in degrees.
9360 # @param theShape1,theShape2 Vectors to find angle between.
9361 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9362 # if False, the opposite vector to the normal vector is used.
9363 # @return Value of the angle between the given vectors in degrees.
9365 # @ref tui_measurement_tools_page "Example"
9366 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9368 Get angle between the given vectors in degrees.
9371 theShape1,theShape2 Vectors to find angle between.
9372 theFlag If True, the normal vector is defined by the two vectors cross,
9373 if False, the opposite vector to the normal vector is used.
9376 Value of the angle between the given vectors in degrees.
9378 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9380 anAngle = 360. - anAngle
9381 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9384 ## The same as GetAngleVectors, but the result is in radians.
9385 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9387 Get angle between the given vectors in radians.
9390 theShape1,theShape2 Vectors to find angle between.
9391 theFlag If True, the normal vector is defined by the two vectors cross,
9392 if False, the opposite vector to the normal vector is used.
9395 Value of the angle between the given vectors in radians.
9397 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9400 ## @name Curve Curvature Measurement
9401 # Methods for receiving radius of curvature of curves
9402 # in the given point
9405 ## Measure curvature of a curve at a point, set by parameter.
9406 # @param theCurve a curve.
9407 # @param theParam parameter.
9408 # @return radius of curvature of \a theCurve.
9410 # @ref swig_todo "Example"
9411 def CurveCurvatureByParam(self, theCurve, theParam):
9413 Measure curvature of a curve at a point, set by parameter.
9420 radius of curvature of theCurve.
9422 # Example: see GEOM_TestMeasures.py
9423 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9424 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9427 ## Measure curvature of a curve at a point.
9428 # @param theCurve a curve.
9429 # @param thePoint given point.
9430 # @return radius of curvature of \a theCurve.
9432 # @ref swig_todo "Example"
9433 def CurveCurvatureByPoint(self, theCurve, thePoint):
9435 Measure curvature of a curve at a point.
9439 thePoint given point.
9442 radius of curvature of theCurve.
9444 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9445 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9449 ## @name Surface Curvature Measurement
9450 # Methods for receiving max and min radius of curvature of surfaces
9451 # in the given point
9454 ## Measure max radius of curvature of surface.
9455 # @param theSurf the given surface.
9456 # @param theUParam Value of U-parameter on the referenced surface.
9457 # @param theVParam Value of V-parameter on the referenced surface.
9458 # @return max radius of curvature of theSurf.
9460 ## @ref swig_todo "Example"
9461 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9463 Measure max radius of curvature of surface.
9466 theSurf the given surface.
9467 theUParam Value of U-parameter on the referenced surface.
9468 theVParam Value of V-parameter on the referenced surface.
9471 max radius of curvature of theSurf.
9473 # Example: see GEOM_TestMeasures.py
9474 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9475 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9478 ## Measure max radius of curvature of surface in the given point
9479 # @param theSurf the given surface.
9480 # @param thePoint given point.
9481 # @return max radius of curvature of theSurf.
9483 ## @ref swig_todo "Example"
9484 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9486 Measure max radius of curvature of surface in the given point.
9489 theSurf the given surface.
9490 thePoint given point.
9493 max radius of curvature of theSurf.
9495 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9496 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9499 ## Measure min radius of curvature of surface.
9500 # @param theSurf the given surface.
9501 # @param theUParam Value of U-parameter on the referenced surface.
9502 # @param theVParam Value of V-parameter on the referenced surface.
9503 # @return min radius of curvature of theSurf.
9505 ## @ref swig_todo "Example"
9506 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9508 Measure min radius of curvature of surface.
9511 theSurf the given surface.
9512 theUParam Value of U-parameter on the referenced surface.
9513 theVParam Value of V-parameter on the referenced surface.
9516 Min radius of curvature of theSurf.
9518 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9519 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9522 ## Measure min radius of curvature of surface in the given point
9523 # @param theSurf the given surface.
9524 # @param thePoint given point.
9525 # @return min radius of curvature of theSurf.
9527 ## @ref swig_todo "Example"
9528 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9530 Measure min radius of curvature of surface in the given point.
9533 theSurf the given surface.
9534 thePoint given point.
9537 Min radius of curvature of theSurf.
9539 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9540 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9544 ## Get min and max tolerances of sub-shapes of theShape
9545 # @param theShape Shape, to get tolerances of.
9546 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9547 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9548 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9549 # VertMin,VertMax: Min and max tolerances of the vertices.
9551 # @ref tui_measurement_tools_page "Example"
9552 def Tolerance(self,theShape):
9554 Get min and max tolerances of sub-shapes of theShape
9557 theShape Shape, to get tolerances of.
9560 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9561 FaceMin,FaceMax: Min and max tolerances of the faces.
9562 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9563 VertMin,VertMax: Min and max tolerances of the vertices.
9565 # Example: see GEOM_TestMeasures.py
9566 aTuple = self.MeasuOp.GetTolerance(theShape)
9567 RaiseIfFailed("GetTolerance", self.MeasuOp)
9570 ## Obtain description of the given shape (number of sub-shapes of each type)
9571 # @param theShape Shape to be described.
9572 # @return Description of the given shape.
9574 # @ref tui_measurement_tools_page "Example"
9575 def WhatIs(self,theShape):
9577 Obtain description of the given shape (number of sub-shapes of each type)
9580 theShape Shape to be described.
9583 Description of the given shape.
9585 # Example: see GEOM_TestMeasures.py
9586 aDescr = self.MeasuOp.WhatIs(theShape)
9587 RaiseIfFailed("WhatIs", self.MeasuOp)
9590 ## Obtain quantity of shapes of the given type in \a theShape.
9591 # If \a theShape is of type \a theType, it is also counted.
9592 # @param theShape Shape to be described.
9593 # @param theType the given ShapeType().
9594 # @return Quantity of shapes of type \a theType in \a theShape.
9596 # @ref tui_measurement_tools_page "Example"
9597 def NbShapes (self, theShape, theType):
9599 Obtain quantity of shapes of the given type in theShape.
9600 If theShape is of type theType, it is also counted.
9603 theShape Shape to be described.
9604 theType the given geompy.ShapeType
9607 Quantity of shapes of type theType in theShape.
9609 # Example: see GEOM_TestMeasures.py
9610 listSh = self.SubShapeAllIDs(theShape, theType)
9614 ## Obtain quantity of shapes of each type in \a theShape.
9615 # The \a theShape is also counted.
9616 # @param theShape Shape to be described.
9617 # @return Dictionary of ShapeType() with bound quantities of shapes.
9619 # @ref tui_measurement_tools_page "Example"
9620 def ShapeInfo (self, theShape):
9622 Obtain quantity of shapes of each type in theShape.
9623 The theShape is also counted.
9626 theShape Shape to be described.
9629 Dictionary of geompy.ShapeType with bound quantities of shapes.
9631 # Example: see GEOM_TestMeasures.py
9633 for typeSh in self.ShapeType:
9634 if typeSh in ( "AUTO", "SHAPE" ): continue
9635 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9641 def GetCreationInformation(self, theShape):
9642 info = theShape.GetCreationInformation()
9644 opName = info.operationName
9645 if not opName: opName = "no info available"
9646 res = "Operation: " + opName
9648 for parVal in info.params:
9649 res += " \n %s = %s" % ( parVal.name, parVal.value )
9652 ## Get a point, situated at the centre of mass of theShape.
9653 # @param theShape Shape to define centre of mass of.
9654 # @param theName Object name; when specified, this parameter is used
9655 # for result publication in the study. Otherwise, if automatic
9656 # publication is switched on, default value is used for result name.
9658 # @return New GEOM.GEOM_Object, containing the created point.
9660 # @ref tui_measurement_tools_page "Example"
9661 def MakeCDG(self, theShape, theName=None):
9663 Get a point, situated at the centre of mass of theShape.
9666 theShape Shape to define centre of mass of.
9667 theName Object name; when specified, this parameter is used
9668 for result publication in the study. Otherwise, if automatic
9669 publication is switched on, default value is used for result name.
9672 New GEOM.GEOM_Object, containing the created point.
9674 # Example: see GEOM_TestMeasures.py
9675 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9676 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9677 self._autoPublish(anObj, theName, "centerOfMass")
9680 ## Get a vertex sub-shape by index depended with orientation.
9681 # @param theShape Shape to find sub-shape.
9682 # @param theIndex Index to find vertex by this index (starting from zero)
9683 # @param theName Object name; when specified, this parameter is used
9684 # for result publication in the study. Otherwise, if automatic
9685 # publication is switched on, default value is used for result name.
9687 # @return New GEOM.GEOM_Object, containing the created vertex.
9689 # @ref tui_measurement_tools_page "Example"
9690 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9692 Get a vertex sub-shape by index depended with orientation.
9695 theShape Shape to find sub-shape.
9696 theIndex Index to find vertex by this index (starting from zero)
9697 theName Object name; when specified, this parameter is used
9698 for result publication in the study. Otherwise, if automatic
9699 publication is switched on, default value is used for result name.
9702 New GEOM.GEOM_Object, containing the created vertex.
9704 # Example: see GEOM_TestMeasures.py
9705 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9706 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9707 self._autoPublish(anObj, theName, "vertex")
9710 ## Get the first vertex of wire/edge depended orientation.
9711 # @param theShape Shape to find first vertex.
9712 # @param theName Object name; when specified, this parameter is used
9713 # for result publication in the study. Otherwise, if automatic
9714 # publication is switched on, default value is used for result name.
9716 # @return New GEOM.GEOM_Object, containing the created vertex.
9718 # @ref tui_measurement_tools_page "Example"
9719 def GetFirstVertex(self, theShape, theName=None):
9721 Get the first vertex of wire/edge depended orientation.
9724 theShape Shape to find first vertex.
9725 theName Object name; when specified, this parameter is used
9726 for result publication in the study. Otherwise, if automatic
9727 publication is switched on, default value is used for result name.
9730 New GEOM.GEOM_Object, containing the created vertex.
9732 # Example: see GEOM_TestMeasures.py
9733 # note: auto-publishing is done in self.GetVertexByIndex()
9734 anObj = self.GetVertexByIndex(theShape, 0, theName)
9735 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9738 ## Get the last vertex of wire/edge depended orientation.
9739 # @param theShape Shape to find last vertex.
9740 # @param theName Object name; when specified, this parameter is used
9741 # for result publication in the study. Otherwise, if automatic
9742 # publication is switched on, default value is used for result name.
9744 # @return New GEOM.GEOM_Object, containing the created vertex.
9746 # @ref tui_measurement_tools_page "Example"
9747 def GetLastVertex(self, theShape, theName=None):
9749 Get the last vertex of wire/edge depended orientation.
9752 theShape Shape to find last vertex.
9753 theName Object name; when specified, this parameter is used
9754 for result publication in the study. Otherwise, if automatic
9755 publication is switched on, default value is used for result name.
9758 New GEOM.GEOM_Object, containing the created vertex.
9760 # Example: see GEOM_TestMeasures.py
9761 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9762 # note: auto-publishing is done in self.GetVertexByIndex()
9763 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9764 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9767 ## Get a normale to the given face. If the point is not given,
9768 # the normale is calculated at the center of mass.
9769 # @param theFace Face to define normale of.
9770 # @param theOptionalPoint Point to compute the normale at.
9771 # @param theName Object name; when specified, this parameter is used
9772 # for result publication in the study. Otherwise, if automatic
9773 # publication is switched on, default value is used for result name.
9775 # @return New GEOM.GEOM_Object, containing the created vector.
9777 # @ref swig_todo "Example"
9778 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9780 Get a normale to the given face. If the point is not given,
9781 the normale is calculated at the center of mass.
9784 theFace Face to define normale of.
9785 theOptionalPoint Point to compute the normale at.
9786 theName Object name; when specified, this parameter is used
9787 for result publication in the study. Otherwise, if automatic
9788 publication is switched on, default value is used for result name.
9791 New GEOM.GEOM_Object, containing the created vector.
9793 # Example: see GEOM_TestMeasures.py
9794 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9795 RaiseIfFailed("GetNormal", self.MeasuOp)
9796 self._autoPublish(anObj, theName, "normal")
9799 ## Check a topology of the given shape.
9800 # @param theShape Shape to check validity of.
9801 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9802 # if TRUE, the shape's geometry will be checked also.
9803 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9804 # of problem is printed.
9805 # if TRUE and if theShape is invalid, the description
9806 # of problem is also returned.
9807 # @return TRUE, if the shape "seems to be valid".
9809 # @ref tui_measurement_tools_page "Example"
9810 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9812 Check a topology of the given shape.
9815 theShape Shape to check validity of.
9816 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9817 if TRUE, the shape's geometry will be checked also.
9818 theReturnStatus If FALSE and if theShape is invalid, a description
9819 of problem is printed.
9820 if TRUE and if theShape is invalid, the description
9821 of problem is returned.
9824 TRUE, if the shape "seems to be valid".
9825 If theShape is invalid, prints a description of problem.
9826 This description can also be returned.
9828 # Example: see GEOM_TestMeasures.py
9830 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9831 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9833 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9834 RaiseIfFailed("CheckShape", self.MeasuOp)
9836 if theReturnStatus == 0:
9838 if theReturnStatus == 1:
9839 return (IsValid, Status)
9842 ## Detect self-intersections in the given shape.
9843 # @param theShape Shape to check.
9844 # @return TRUE, if the shape contains no self-intersections.
9846 # @ref tui_measurement_tools_page "Example"
9847 def CheckSelfIntersections(self, theShape):
9849 Detect self-intersections in the given shape.
9852 theShape Shape to check.
9855 TRUE, if the shape contains no self-intersections.
9857 # Example: see GEOM_TestMeasures.py
9858 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9859 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9862 ## Get position (LCS) of theShape.
9864 # Origin of the LCS is situated at the shape's center of mass.
9865 # Axes of the LCS are obtained from shape's location or,
9866 # if the shape is a planar face, from position of its plane.
9868 # @param theShape Shape to calculate position of.
9869 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9870 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9871 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9872 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9874 # @ref swig_todo "Example"
9875 def GetPosition(self,theShape):
9877 Get position (LCS) of theShape.
9878 Origin of the LCS is situated at the shape's center of mass.
9879 Axes of the LCS are obtained from shape's location or,
9880 if the shape is a planar face, from position of its plane.
9883 theShape Shape to calculate position of.
9886 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9887 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9888 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9889 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9891 # Example: see GEOM_TestMeasures.py
9892 aTuple = self.MeasuOp.GetPosition(theShape)
9893 RaiseIfFailed("GetPosition", self.MeasuOp)
9896 ## Get kind of theShape.
9898 # @param theShape Shape to get a kind of.
9899 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9900 # and a list of parameters, describing the shape.
9901 # @note Concrete meaning of each value, returned via \a theIntegers
9902 # or \a theDoubles list depends on the kind() of the shape.
9904 # @ref swig_todo "Example"
9905 def KindOfShape(self,theShape):
9907 Get kind of theShape.
9910 theShape Shape to get a kind of.
9913 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9914 and a list of parameters, describing the shape.
9916 Concrete meaning of each value, returned via theIntegers
9917 or theDoubles list depends on the geompy.kind of the shape
9919 # Example: see GEOM_TestMeasures.py
9920 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9921 RaiseIfFailed("KindOfShape", self.MeasuOp)
9923 aKind = aRoughTuple[0]
9924 anInts = aRoughTuple[1]
9925 aDbls = aRoughTuple[2]
9927 # Now there is no exception from this rule:
9928 aKindTuple = [aKind] + aDbls + anInts
9930 # If they are we will regroup parameters for such kind of shape.
9932 #if aKind == kind.SOME_KIND:
9933 # # SOME_KIND int int double int double double
9934 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9941 ## @addtogroup l2_import_export
9944 ## Import a shape from the BREP or IGES or STEP file
9945 # (depends on given format) with given name.
9946 # @param theFileName The file, containing the shape.
9947 # @param theFormatName Specify format for the file reading.
9948 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9949 # If format 'IGES_SCALE' is used instead of 'IGES' or
9950 # format 'STEP_SCALE' is used instead of 'STEP',
9951 # length unit will be set to 'meter' and result model will be scaled.
9952 # @param theName Object name; when specified, this parameter is used
9953 # for result publication in the study. Otherwise, if automatic
9954 # publication is switched on, default value is used for result name.
9956 # @return New GEOM.GEOM_Object, containing the imported shape.
9958 # @ref swig_Import_Export "Example"
9959 def ImportFile(self, theFileName, theFormatName, theName=None):
9961 Import a shape from the BREP or IGES or STEP file
9962 (depends on given format) with given name.
9965 theFileName The file, containing the shape.
9966 theFormatName Specify format for the file reading.
9967 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9968 If format 'IGES_SCALE' is used instead of 'IGES' or
9969 format 'STEP_SCALE' is used instead of 'STEP',
9970 length unit will be set to 'meter' and result model will be scaled.
9971 theName Object name; when specified, this parameter is used
9972 for result publication in the study. Otherwise, if automatic
9973 publication is switched on, default value is used for result name.
9976 New GEOM.GEOM_Object, containing the imported shape.
9978 # Example: see GEOM_TestOthers.py
9979 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9980 RaiseIfFailed("ImportFile", self.InsertOp)
9981 self._autoPublish(anObj, theName, "imported")
9984 ## Deprecated analog of ImportFile()
9985 def Import(self, theFileName, theFormatName, theName=None):
9987 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9989 print "WARNING: Function Import is deprecated, use ImportFile instead"
9990 # note: auto-publishing is done in self.ImportFile()
9991 return self.ImportFile(theFileName, theFormatName, theName)
9993 ## Shortcut to ImportFile() for BREP format.
9994 # Import a shape from the BREP file with given name.
9995 # @param theFileName The file, containing the shape.
9996 # @param theName Object name; when specified, this parameter is used
9997 # for result publication in the study. Otherwise, if automatic
9998 # publication is switched on, default value is used for result name.
10000 # @return New GEOM.GEOM_Object, containing the imported shape.
10002 # @ref swig_Import_Export "Example"
10003 def ImportBREP(self, theFileName, theName=None):
10005 geompy.ImportFile(...) function for BREP format
10006 Import a shape from the BREP file with given name.
10009 theFileName The file, containing the shape.
10010 theName Object name; when specified, this parameter is used
10011 for result publication in the study. Otherwise, if automatic
10012 publication is switched on, default value is used for result name.
10015 New GEOM.GEOM_Object, containing the imported shape.
10017 # Example: see GEOM_TestOthers.py
10018 # note: auto-publishing is done in self.ImportFile()
10019 return self.ImportFile(theFileName, "BREP", theName)
10021 ## Shortcut to ImportFile() for IGES format
10022 # Import a shape from the IGES file with given name.
10023 # @param theFileName The file, containing the shape.
10024 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10025 # and result model will be scaled, if its units are not meters.
10026 # If False (default), file length units will be taken into account.
10027 # @param theName Object name; when specified, this parameter is used
10028 # for result publication in the study. Otherwise, if automatic
10029 # publication is switched on, default value is used for result name.
10031 # @return New GEOM.GEOM_Object, containing the imported shape.
10033 # @ref swig_Import_Export "Example"
10034 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10036 geompy.ImportFile(...) function for IGES format
10039 theFileName The file, containing the shape.
10040 ignoreUnits If True, file length units will be ignored (set to 'meter')
10041 and result model will be scaled, if its units are not meters.
10042 If False (default), file length units will be taken into account.
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 imported shape.
10050 # Example: see GEOM_TestOthers.py
10051 # note: auto-publishing is done in self.ImportFile()
10053 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10054 return self.ImportFile(theFileName, "IGES", theName)
10056 ## Return length unit from given IGES file
10057 # @param theFileName The file, containing the shape.
10058 # @return String, containing the units name.
10060 # @ref swig_Import_Export "Example"
10061 def GetIGESUnit(self, theFileName):
10063 Return length units from given IGES file
10066 theFileName The file, containing the shape.
10069 String, containing the units name.
10071 # Example: see GEOM_TestOthers.py
10072 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10075 ## Shortcut to ImportFile() for STEP format
10076 # Import a shape from the STEP file with given name.
10077 # @param theFileName The file, containing the shape.
10078 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10079 # and result model will be scaled, if its units are not meters.
10080 # If False (default), file length units will be taken into account.
10081 # @param theName Object name; when specified, this parameter is used
10082 # for result publication in the study. Otherwise, if automatic
10083 # publication is switched on, default value is used for result name.
10085 # @return New GEOM.GEOM_Object, containing the imported shape.
10087 # @ref swig_Import_Export "Example"
10088 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10090 geompy.ImportFile(...) function for STEP format
10093 theFileName The file, containing the shape.
10094 ignoreUnits If True, file length units will be ignored (set to 'meter')
10095 and result model will be scaled, if its units are not meters.
10096 If False (default), file length units will be taken into account.
10097 theName Object name; when specified, this parameter is used
10098 for result publication in the study. Otherwise, if automatic
10099 publication is switched on, default value is used for result name.
10102 New GEOM.GEOM_Object, containing the imported shape.
10104 # Example: see GEOM_TestOthers.py
10105 # note: auto-publishing is done in self.ImportFile()
10107 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10108 return self.ImportFile(theFileName, "STEP", theName)
10110 ## Return length unit from given IGES or STEP file
10111 # @param theFileName The file, containing the shape.
10112 # @return String, containing the units name.
10114 # @ref swig_Import_Export "Example"
10115 def GetSTEPUnit(self, theFileName):
10117 Return length units from given STEP file
10120 theFileName The file, containing the shape.
10123 String, containing the units name.
10125 # Example: see GEOM_TestOthers.py
10126 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10129 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10130 # @note This method will not be dumped to the python script by DumpStudy functionality.
10131 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10132 # @param theStream The BRep binary stream.
10133 # @param theName Object name; when specified, this parameter is used
10134 # for result publication in the study. Otherwise, if automatic
10135 # publication is switched on, default value is used for result name.
10137 # @return New GEOM_Object, containing the shape, read from theStream.
10139 # @ref swig_Import_Export "Example"
10140 def RestoreShape (self, theStream, theName=None):
10142 Read a shape from the binary stream, containing its bounding representation (BRep).
10145 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10148 theStream The BRep binary stream.
10149 theName Object name; when specified, this parameter is used
10150 for result publication in the study. Otherwise, if automatic
10151 publication is switched on, default value is used for result name.
10154 New GEOM_Object, containing the shape, read from theStream.
10156 # Example: see GEOM_TestOthers.py
10157 anObj = self.InsertOp.RestoreShape(theStream)
10158 RaiseIfFailed("RestoreShape", self.InsertOp)
10159 self._autoPublish(anObj, theName, "restored")
10162 ## Export the given shape into a file with given name.
10163 # @param theObject Shape to be stored in the file.
10164 # @param theFileName Name of the file to store the given shape in.
10165 # @param theFormatName Specify format for the shape storage.
10166 # Available formats can be obtained with
10167 # geompy.InsertOp.ExportTranslators()[0] method.
10169 # @ref swig_Import_Export "Example"
10170 def Export(self, theObject, theFileName, theFormatName):
10172 Export the given shape into a file with given name.
10175 theObject Shape to be stored in the file.
10176 theFileName Name of the file to store the given shape in.
10177 theFormatName Specify format for the shape storage.
10178 Available formats can be obtained with
10179 geompy.InsertOp.ExportTranslators()[0] method.
10181 # Example: see GEOM_TestOthers.py
10182 self.InsertOp.Export(theObject, theFileName, theFormatName)
10183 if self.InsertOp.IsDone() == 0:
10184 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10188 ## Shortcut to Export() for BREP format
10190 # @ref swig_Import_Export "Example"
10191 def ExportBREP(self,theObject, theFileName):
10193 geompy.Export(...) function for BREP format
10195 # Example: see GEOM_TestOthers.py
10196 return self.Export(theObject, theFileName, "BREP")
10198 ## Shortcut to Export() for IGES format
10200 # @ref swig_Import_Export "Example"
10201 def ExportIGES(self,theObject, theFileName):
10203 geompy.Export(...) function for IGES format
10205 # Example: see GEOM_TestOthers.py
10206 return self.Export(theObject, theFileName, "IGES")
10208 ## Shortcut to Export() for STEP format
10210 # @ref swig_Import_Export "Example"
10211 def ExportSTEP(self,theObject, theFileName):
10213 geompy.Export(...) function for STEP format
10215 # Example: see GEOM_TestOthers.py
10216 return self.Export(theObject, theFileName, "STEP")
10218 # end of l2_import_export
10221 ## @addtogroup l3_blocks
10224 ## Create a quadrangle face from four edges. Order of Edges is not
10225 # important. It is not necessary that edges share the same vertex.
10226 # @param E1,E2,E3,E4 Edges for the face bound.
10227 # @param theName Object name; when specified, this parameter is used
10228 # for result publication in the study. Otherwise, if automatic
10229 # publication is switched on, default value is used for result name.
10231 # @return New GEOM.GEOM_Object, containing the created face.
10233 # @ref tui_building_by_blocks_page "Example"
10234 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10236 Create a quadrangle face from four edges. Order of Edges is not
10237 important. It is not necessary that edges share the same vertex.
10240 E1,E2,E3,E4 Edges for the face bound.
10241 theName Object name; when specified, this parameter is used
10242 for result publication in the study. Otherwise, if automatic
10243 publication is switched on, default value is used for result name.
10246 New GEOM.GEOM_Object, containing the created face.
10249 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10251 # Example: see GEOM_Spanner.py
10252 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10253 RaiseIfFailed("MakeQuad", self.BlocksOp)
10254 self._autoPublish(anObj, theName, "quad")
10257 ## Create a quadrangle face on two edges.
10258 # The missing edges will be built by creating the shortest ones.
10259 # @param E1,E2 Two opposite edges for the face.
10260 # @param theName Object name; when specified, this parameter is used
10261 # for result publication in the study. Otherwise, if automatic
10262 # publication is switched on, default value is used for result name.
10264 # @return New GEOM.GEOM_Object, containing the created face.
10266 # @ref tui_building_by_blocks_page "Example"
10267 def MakeQuad2Edges(self, E1, E2, theName=None):
10269 Create a quadrangle face on two edges.
10270 The missing edges will be built by creating the shortest ones.
10273 E1,E2 Two opposite edges for the face.
10274 theName Object name; when specified, this parameter is used
10275 for result publication in the study. Otherwise, if automatic
10276 publication is switched on, default value is used for result name.
10279 New GEOM.GEOM_Object, containing the created face.
10283 p1 = geompy.MakeVertex( 0., 0., 0.)
10284 p2 = geompy.MakeVertex(150., 30., 0.)
10285 p3 = geompy.MakeVertex( 0., 120., 50.)
10286 p4 = geompy.MakeVertex( 0., 40., 70.)
10288 edge1 = geompy.MakeEdge(p1, p2)
10289 edge2 = geompy.MakeEdge(p3, p4)
10290 # create a quadrangle face from two edges
10291 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10293 # Example: see GEOM_Spanner.py
10294 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10295 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10296 self._autoPublish(anObj, theName, "quad")
10299 ## Create a quadrangle face with specified corners.
10300 # The missing edges will be built by creating the shortest ones.
10301 # @param V1,V2,V3,V4 Corner vertices for the face.
10302 # @param theName Object name; when specified, this parameter is used
10303 # for result publication in the study. Otherwise, if automatic
10304 # publication is switched on, default value is used for result name.
10306 # @return New GEOM.GEOM_Object, containing the created face.
10308 # @ref tui_building_by_blocks_page "Example 1"
10309 # \n @ref swig_MakeQuad4Vertices "Example 2"
10310 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10312 Create a quadrangle face with specified corners.
10313 The missing edges will be built by creating the shortest ones.
10316 V1,V2,V3,V4 Corner vertices for the face.
10317 theName Object name; when specified, this parameter is used
10318 for result publication in the study. Otherwise, if automatic
10319 publication is switched on, default value is used for result name.
10322 New GEOM.GEOM_Object, containing the created face.
10326 p1 = geompy.MakeVertex( 0., 0., 0.)
10327 p2 = geompy.MakeVertex(150., 30., 0.)
10328 p3 = geompy.MakeVertex( 0., 120., 50.)
10329 p4 = geompy.MakeVertex( 0., 40., 70.)
10330 # create a quadrangle from four points in its corners
10331 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10333 # Example: see GEOM_Spanner.py
10334 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10335 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10336 self._autoPublish(anObj, theName, "quad")
10339 ## Create a hexahedral solid, bounded by the six given faces. Order of
10340 # faces is not important. It is not necessary that Faces share the same edge.
10341 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10342 # @param theName Object name; when specified, this parameter is used
10343 # for result publication in the study. Otherwise, if automatic
10344 # publication is switched on, default value is used for result name.
10346 # @return New GEOM.GEOM_Object, containing the created solid.
10348 # @ref tui_building_by_blocks_page "Example 1"
10349 # \n @ref swig_MakeHexa "Example 2"
10350 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10352 Create a hexahedral solid, bounded by the six given faces. Order of
10353 faces is not important. It is not necessary that Faces share the same edge.
10356 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10357 theName Object name; when specified, this parameter is used
10358 for result publication in the study. Otherwise, if automatic
10359 publication is switched on, default value is used for result name.
10362 New GEOM.GEOM_Object, containing the created solid.
10365 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10367 # Example: see GEOM_Spanner.py
10368 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10369 RaiseIfFailed("MakeHexa", self.BlocksOp)
10370 self._autoPublish(anObj, theName, "hexa")
10373 ## Create a hexahedral solid between two given faces.
10374 # The missing faces will be built by creating the smallest ones.
10375 # @param F1,F2 Two opposite faces for the hexahedral solid.
10376 # @param theName Object name; when specified, this parameter is used
10377 # for result publication in the study. Otherwise, if automatic
10378 # publication is switched on, default value is used for result name.
10380 # @return New GEOM.GEOM_Object, containing the created solid.
10382 # @ref tui_building_by_blocks_page "Example 1"
10383 # \n @ref swig_MakeHexa2Faces "Example 2"
10384 def MakeHexa2Faces(self, F1, F2, theName=None):
10386 Create a hexahedral solid between two given faces.
10387 The missing faces will be built by creating the smallest ones.
10390 F1,F2 Two opposite faces for the hexahedral solid.
10391 theName Object name; when specified, this parameter is used
10392 for result publication in the study. Otherwise, if automatic
10393 publication is switched on, default value is used for result name.
10396 New GEOM.GEOM_Object, containing the created solid.
10399 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10401 # Example: see GEOM_Spanner.py
10402 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10403 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10404 self._autoPublish(anObj, theName, "hexa")
10410 ## @addtogroup l3_blocks_op
10413 ## Get a vertex, found in the given shape by its coordinates.
10414 # @param theShape Block or a compound of blocks.
10415 # @param theX,theY,theZ Coordinates of the sought vertex.
10416 # @param theEpsilon Maximum allowed distance between the resulting
10417 # vertex and point with the given coordinates.
10418 # @param theName Object name; when specified, this parameter is used
10419 # for result publication in the study. Otherwise, if automatic
10420 # publication is switched on, default value is used for result name.
10422 # @return New GEOM.GEOM_Object, containing the found vertex.
10424 # @ref swig_GetPoint "Example"
10425 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10427 Get a vertex, found in the given shape by its coordinates.
10430 theShape Block or a compound of blocks.
10431 theX,theY,theZ Coordinates of the sought vertex.
10432 theEpsilon Maximum allowed distance between the resulting
10433 vertex and point with the given coordinates.
10434 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.
10439 New GEOM.GEOM_Object, containing the found vertex.
10442 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10444 # Example: see GEOM_TestOthers.py
10445 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10446 RaiseIfFailed("GetPoint", self.BlocksOp)
10447 self._autoPublish(anObj, theName, "vertex")
10450 ## Find a vertex of the given shape, which has minimal distance to the given point.
10451 # @param theShape Any shape.
10452 # @param thePoint Point, close to the desired vertex.
10453 # @param theName Object name; when specified, this parameter is used
10454 # for result publication in the study. Otherwise, if automatic
10455 # publication is switched on, default value is used for result name.
10457 # @return New GEOM.GEOM_Object, containing the found vertex.
10459 # @ref swig_GetVertexNearPoint "Example"
10460 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10462 Find a vertex of the given shape, which has minimal distance to the given point.
10465 theShape Any shape.
10466 thePoint Point, close to the desired vertex.
10467 theName Object name; when specified, this parameter is used
10468 for result publication in the study. Otherwise, if automatic
10469 publication is switched on, default value is used for result name.
10472 New GEOM.GEOM_Object, containing the found vertex.
10475 pmidle = geompy.MakeVertex(50, 0, 50)
10476 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10478 # Example: see GEOM_TestOthers.py
10479 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10480 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10481 self._autoPublish(anObj, theName, "vertex")
10484 ## Get an edge, found in the given shape by two given vertices.
10485 # @param theShape Block or a compound of blocks.
10486 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10487 # @param theName Object name; when specified, this parameter is used
10488 # for result publication in the study. Otherwise, if automatic
10489 # publication is switched on, default value is used for result name.
10491 # @return New GEOM.GEOM_Object, containing the found edge.
10493 # @ref swig_GetEdge "Example"
10494 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10496 Get an edge, found in the given shape by two given vertices.
10499 theShape Block or a compound of blocks.
10500 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10501 theName Object name; when specified, this parameter is used
10502 for result publication in the study. Otherwise, if automatic
10503 publication is switched on, default value is used for result name.
10506 New GEOM.GEOM_Object, containing the found edge.
10508 # Example: see GEOM_Spanner.py
10509 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10510 RaiseIfFailed("GetEdge", self.BlocksOp)
10511 self._autoPublish(anObj, theName, "edge")
10514 ## Find an edge of the given shape, which has minimal distance to the given point.
10515 # @param theShape Block or a compound of blocks.
10516 # @param thePoint Point, close to the desired edge.
10517 # @param theName Object name; when specified, this parameter is used
10518 # for result publication in the study. Otherwise, if automatic
10519 # publication is switched on, default value is used for result name.
10521 # @return New GEOM.GEOM_Object, containing the found edge.
10523 # @ref swig_GetEdgeNearPoint "Example"
10524 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10526 Find an edge of the given shape, which has minimal distance to the given point.
10529 theShape Block or a compound of blocks.
10530 thePoint Point, close to the desired edge.
10531 theName Object name; when specified, this parameter is used
10532 for result publication in the study. Otherwise, if automatic
10533 publication is switched on, default value is used for result name.
10536 New GEOM.GEOM_Object, containing the found edge.
10538 # Example: see GEOM_TestOthers.py
10539 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10540 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10541 self._autoPublish(anObj, theName, "edge")
10544 ## Returns a face, found in the given shape by four given corner vertices.
10545 # @param theShape Block or a compound of blocks.
10546 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10547 # @param theName Object name; when specified, this parameter is used
10548 # for result publication in the study. Otherwise, if automatic
10549 # publication is switched on, default value is used for result name.
10551 # @return New GEOM.GEOM_Object, containing the found face.
10553 # @ref swig_todo "Example"
10554 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10556 Returns a face, found in the given shape by four given corner vertices.
10559 theShape Block or a compound of blocks.
10560 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10561 theName Object name; when specified, this parameter is used
10562 for result publication in the study. Otherwise, if automatic
10563 publication is switched on, default value is used for result name.
10566 New GEOM.GEOM_Object, containing the found face.
10568 # Example: see GEOM_Spanner.py
10569 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10570 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10571 self._autoPublish(anObj, theName, "face")
10574 ## Get a face of block, found in the given shape by two given edges.
10575 # @param theShape Block or a compound of blocks.
10576 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10577 # @param theName Object name; when specified, this parameter is used
10578 # for result publication in the study. Otherwise, if automatic
10579 # publication is switched on, default value is used for result name.
10581 # @return New GEOM.GEOM_Object, containing the found face.
10583 # @ref swig_todo "Example"
10584 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10586 Get a face of block, found in the given shape by two given edges.
10589 theShape Block or a compound of blocks.
10590 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10591 theName Object name; when specified, this parameter is used
10592 for result publication in the study. Otherwise, if automatic
10593 publication is switched on, default value is used for result name.
10596 New GEOM.GEOM_Object, containing the found face.
10598 # Example: see GEOM_Spanner.py
10599 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10600 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10601 self._autoPublish(anObj, theName, "face")
10604 ## Find a face, opposite to the given one in the given block.
10605 # @param theBlock Must be a hexahedral solid.
10606 # @param theFace Face of \a theBlock, opposite to the desired face.
10607 # @param theName Object name; when specified, this parameter is used
10608 # for result publication in the study. Otherwise, if automatic
10609 # publication is switched on, default value is used for result name.
10611 # @return New GEOM.GEOM_Object, containing the found face.
10613 # @ref swig_GetOppositeFace "Example"
10614 def GetOppositeFace(self, theBlock, theFace, theName=None):
10616 Find a face, opposite to the given one in the given block.
10619 theBlock Must be a hexahedral solid.
10620 theFace Face of theBlock, opposite to the desired face.
10621 theName Object name; when specified, this parameter is used
10622 for result publication in the study. Otherwise, if automatic
10623 publication is switched on, default value is used for result name.
10626 New GEOM.GEOM_Object, containing the found face.
10628 # Example: see GEOM_Spanner.py
10629 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10630 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10631 self._autoPublish(anObj, theName, "face")
10634 ## Find a face of the given shape, which has minimal distance to the given point.
10635 # @param theShape Block or a compound of blocks.
10636 # @param thePoint Point, close to the desired face.
10637 # @param theName Object name; when specified, this parameter is used
10638 # for result publication in the study. Otherwise, if automatic
10639 # publication is switched on, default value is used for result name.
10641 # @return New GEOM.GEOM_Object, containing the found face.
10643 # @ref swig_GetFaceNearPoint "Example"
10644 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10646 Find a face of the given shape, which has minimal distance to the given point.
10649 theShape Block or a compound of blocks.
10650 thePoint Point, close to the desired face.
10651 theName Object name; when specified, this parameter is used
10652 for result publication in the study. Otherwise, if automatic
10653 publication is switched on, default value is used for result name.
10656 New GEOM.GEOM_Object, containing the found face.
10658 # Example: see GEOM_Spanner.py
10659 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10660 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10661 self._autoPublish(anObj, theName, "face")
10664 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10665 # @param theBlock Block or a compound of blocks.
10666 # @param theVector Vector, close to the normale of the desired face.
10667 # @param theName Object name; when specified, this parameter is used
10668 # for result publication in the study. Otherwise, if automatic
10669 # publication is switched on, default value is used for result name.
10671 # @return New GEOM.GEOM_Object, containing the found face.
10673 # @ref swig_todo "Example"
10674 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10676 Find a face of block, whose outside normale has minimal angle with the given vector.
10679 theBlock Block or a compound of blocks.
10680 theVector Vector, close to the normale of the desired face.
10681 theName Object name; when specified, this parameter is used
10682 for result publication in the study. Otherwise, if automatic
10683 publication is switched on, default value is used for result name.
10686 New GEOM.GEOM_Object, containing the found face.
10688 # Example: see GEOM_Spanner.py
10689 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10690 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10691 self._autoPublish(anObj, theName, "face")
10694 ## Find all sub-shapes of type \a theShapeType of the given shape,
10695 # which have minimal distance to the given point.
10696 # @param theShape Any shape.
10697 # @param thePoint Point, close to the desired shape.
10698 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10699 # @param theTolerance The tolerance for distances comparison. All shapes
10700 # with distances to the given point in interval
10701 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10702 # @param theName Object name; when specified, this parameter is used
10703 # for result publication in the study. Otherwise, if automatic
10704 # publication is switched on, default value is used for result name.
10706 # @return New GEOM_Object, containing a group of all found shapes.
10708 # @ref swig_GetShapesNearPoint "Example"
10709 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10711 Find all sub-shapes of type theShapeType of the given shape,
10712 which have minimal distance to the given point.
10715 theShape Any shape.
10716 thePoint Point, close to the desired shape.
10717 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10718 theTolerance The tolerance for distances comparison. All shapes
10719 with distances to the given point in interval
10720 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10721 theName Object name; when specified, this parameter is used
10722 for result publication in the study. Otherwise, if automatic
10723 publication is switched on, default value is used for result name.
10726 New GEOM_Object, containing a group of all found shapes.
10728 # Example: see GEOM_TestOthers.py
10729 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10730 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10731 self._autoPublish(anObj, theName, "group")
10734 # end of l3_blocks_op
10737 ## @addtogroup l4_blocks_measure
10740 ## Check, if the compound of blocks is given.
10741 # To be considered as a compound of blocks, the
10742 # given shape must satisfy the following conditions:
10743 # - Each element of the compound should be a Block (6 faces and 12 edges).
10744 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10745 # - The compound should be connexe.
10746 # - The glue between two quadrangle faces should be applied.
10747 # @param theCompound The compound to check.
10748 # @return TRUE, if the given shape is a compound of blocks.
10749 # If theCompound is not valid, prints all discovered errors.
10751 # @ref tui_measurement_tools_page "Example 1"
10752 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10753 def CheckCompoundOfBlocks(self,theCompound):
10755 Check, if the compound of blocks is given.
10756 To be considered as a compound of blocks, the
10757 given shape must satisfy the following conditions:
10758 - Each element of the compound should be a Block (6 faces and 12 edges).
10759 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10760 - The compound should be connexe.
10761 - The glue between two quadrangle faces should be applied.
10764 theCompound The compound to check.
10767 TRUE, if the given shape is a compound of blocks.
10768 If theCompound is not valid, prints all discovered errors.
10770 # Example: see GEOM_Spanner.py
10771 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10772 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10774 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10778 ## Retrieve all non blocks solids and faces from \a theShape.
10779 # @param theShape The shape to explore.
10780 # @param theName Object name; when specified, this parameter is used
10781 # for result publication in the study. Otherwise, if automatic
10782 # publication is switched on, default value is used for result name.
10784 # @return A tuple of two GEOM_Objects. The first object is a group of all
10785 # non block solids (= not 6 faces, or with 6 faces, but with the
10786 # presence of non-quadrangular faces). The second object is a
10787 # group of all non quadrangular faces.
10789 # @ref tui_measurement_tools_page "Example 1"
10790 # \n @ref swig_GetNonBlocks "Example 2"
10791 def GetNonBlocks (self, theShape, theName=None):
10793 Retrieve all non blocks solids and faces from theShape.
10796 theShape The shape to explore.
10797 theName Object name; when specified, this parameter is used
10798 for result publication in the study. Otherwise, if automatic
10799 publication is switched on, default value is used for result name.
10802 A tuple of two GEOM_Objects. The first object is a group of all
10803 non block solids (= not 6 faces, or with 6 faces, but with the
10804 presence of non-quadrangular faces). The second object is a
10805 group of all non quadrangular faces.
10808 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10810 # Example: see GEOM_Spanner.py
10811 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10812 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10813 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10816 ## Remove all seam and degenerated edges from \a theShape.
10817 # Unite faces and edges, sharing one surface. It means that
10818 # this faces must have references to one C++ surface object (handle).
10819 # @param theShape The compound or single solid to remove irregular edges from.
10820 # @param doUnionFaces If True, then unite faces. If False (the default value),
10821 # do not unite faces.
10822 # @param theName Object name; when specified, this parameter is used
10823 # for result publication in the study. Otherwise, if automatic
10824 # publication is switched on, default value is used for result name.
10826 # @return Improved shape.
10828 # @ref swig_RemoveExtraEdges "Example"
10829 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10831 Remove all seam and degenerated edges from theShape.
10832 Unite faces and edges, sharing one surface. It means that
10833 this faces must have references to one C++ surface object (handle).
10836 theShape The compound or single solid to remove irregular edges from.
10837 doUnionFaces If True, then unite faces. If False (the default value),
10838 do not unite faces.
10839 theName Object name; when specified, this parameter is used
10840 for result publication in the study. Otherwise, if automatic
10841 publication is switched on, default value is used for result name.
10846 # Example: see GEOM_TestOthers.py
10847 nbFacesOptimum = -1 # -1 means do not unite faces
10848 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10849 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10850 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10851 self._autoPublish(anObj, theName, "removeExtraEdges")
10854 ## Performs union faces of \a theShape
10855 # Unite faces sharing one surface. It means that
10856 # these faces must have references to one C++ surface object (handle).
10857 # @param theShape The compound or single solid that contains faces
10858 # to perform union.
10859 # @param theName Object name; when specified, this parameter is used
10860 # for result publication in the study. Otherwise, if automatic
10861 # publication is switched on, default value is used for result name.
10863 # @return Improved shape.
10865 # @ref swig_UnionFaces "Example"
10866 def UnionFaces(self, theShape, theName=None):
10868 Performs union faces of theShape.
10869 Unite faces sharing one surface. It means that
10870 these faces must have references to one C++ surface object (handle).
10873 theShape The compound or single solid that contains faces
10875 theName Object name; when specified, this parameter is used
10876 for result publication in the study. Otherwise, if automatic
10877 publication is switched on, default value is used for result name.
10882 # Example: see GEOM_TestOthers.py
10883 anObj = self.BlocksOp.UnionFaces(theShape)
10884 RaiseIfFailed("UnionFaces", self.BlocksOp)
10885 self._autoPublish(anObj, theName, "unionFaces")
10888 ## Check, if the given shape is a blocks compound.
10889 # Fix all detected errors.
10890 # \note Single block can be also fixed by this method.
10891 # @param theShape The compound to check and improve.
10892 # @param theName Object name; when specified, this parameter is used
10893 # for result publication in the study. Otherwise, if automatic
10894 # publication is switched on, default value is used for result name.
10896 # @return Improved compound.
10898 # @ref swig_CheckAndImprove "Example"
10899 def CheckAndImprove(self, theShape, theName=None):
10901 Check, if the given shape is a blocks compound.
10902 Fix all detected errors.
10905 Single block can be also fixed by this method.
10908 theShape The compound to check and improve.
10909 theName Object name; when specified, this parameter is used
10910 for result publication in the study. Otherwise, if automatic
10911 publication is switched on, default value is used for result name.
10916 # Example: see GEOM_TestOthers.py
10917 anObj = self.BlocksOp.CheckAndImprove(theShape)
10918 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10919 self._autoPublish(anObj, theName, "improved")
10922 # end of l4_blocks_measure
10925 ## @addtogroup l3_blocks_op
10928 ## Get all the blocks, contained in the given compound.
10929 # @param theCompound The compound to explode.
10930 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10931 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10932 # @param theName Object name; when specified, this parameter is used
10933 # for result publication in the study. Otherwise, if automatic
10934 # publication is switched on, default value is used for result name.
10936 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10938 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10940 # @ref tui_explode_on_blocks "Example 1"
10941 # \n @ref swig_MakeBlockExplode "Example 2"
10942 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10944 Get all the blocks, contained in the given compound.
10947 theCompound The compound to explode.
10948 theMinNbFaces If solid has lower number of faces, it is not a block.
10949 theMaxNbFaces If solid has higher number of faces, it is not a block.
10950 theName Object name; when specified, this parameter is used
10951 for result publication in the study. Otherwise, if automatic
10952 publication is switched on, default value is used for result name.
10955 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10958 List of GEOM.GEOM_Object, containing the retrieved blocks.
10960 # Example: see GEOM_TestOthers.py
10961 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10962 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10963 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10964 for anObj in aList:
10965 anObj.SetParameters(Parameters)
10967 self._autoPublish(aList, theName, "block")
10970 ## Find block, containing the given point inside its volume or on boundary.
10971 # @param theCompound Compound, to find block in.
10972 # @param thePoint Point, close to the desired block. If the point lays on
10973 # boundary between some blocks, we return block with nearest center.
10974 # @param theName Object name; when specified, this parameter is used
10975 # for result publication in the study. Otherwise, if automatic
10976 # publication is switched on, default value is used for result name.
10978 # @return New GEOM.GEOM_Object, containing the found block.
10980 # @ref swig_todo "Example"
10981 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10983 Find block, containing the given point inside its volume or on boundary.
10986 theCompound Compound, to find block in.
10987 thePoint Point, close to the desired block. If the point lays on
10988 boundary between some blocks, we return block with nearest center.
10989 theName Object name; when specified, this parameter is used
10990 for result publication in the study. Otherwise, if automatic
10991 publication is switched on, default value is used for result name.
10994 New GEOM.GEOM_Object, containing the found block.
10996 # Example: see GEOM_Spanner.py
10997 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10998 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10999 self._autoPublish(anObj, theName, "block")
11002 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11003 # @param theCompound Compound, to find block in.
11004 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11005 # @param theName Object name; when specified, this parameter is used
11006 # for result publication in the study. Otherwise, if automatic
11007 # publication is switched on, default value is used for result name.
11009 # @return New GEOM.GEOM_Object, containing the found block.
11011 # @ref swig_GetBlockByParts "Example"
11012 def GetBlockByParts(self, theCompound, theParts, theName=None):
11014 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11017 theCompound Compound, to find block in.
11018 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11019 theName Object name; when specified, this parameter is used
11020 for result publication in the study. Otherwise, if automatic
11021 publication is switched on, default value is used for result name.
11024 New GEOM_Object, containing the found block.
11026 # Example: see GEOM_TestOthers.py
11027 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11028 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11029 self._autoPublish(anObj, theName, "block")
11032 ## Return all blocks, containing all the elements, passed as the parts.
11033 # @param theCompound Compound, to find blocks in.
11034 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11035 # @param theName Object name; when specified, this parameter is used
11036 # for result publication in the study. Otherwise, if automatic
11037 # publication is switched on, default value is used for result name.
11039 # @return List of GEOM.GEOM_Object, containing the found blocks.
11041 # @ref swig_todo "Example"
11042 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11044 Return all blocks, containing all the elements, passed as the parts.
11047 theCompound Compound, to find blocks in.
11048 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11049 theName Object name; when specified, this parameter is used
11050 for result publication in the study. Otherwise, if automatic
11051 publication is switched on, default value is used for result name.
11054 List of GEOM.GEOM_Object, containing the found blocks.
11056 # Example: see GEOM_Spanner.py
11057 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11058 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11059 self._autoPublish(aList, theName, "block")
11062 ## Multi-transformate block and glue the result.
11063 # Transformation is defined so, as to superpose direction faces.
11064 # @param Block Hexahedral solid to be multi-transformed.
11065 # @param DirFace1 ID of First direction face.
11066 # @param DirFace2 ID of Second direction face.
11067 # @param NbTimes Quantity of transformations to be done.
11068 # @param theName Object name; when specified, this parameter is used
11069 # for result publication in the study. Otherwise, if automatic
11070 # publication is switched on, default value is used for result name.
11072 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11074 # @return New GEOM.GEOM_Object, containing the result shape.
11076 # @ref tui_multi_transformation "Example"
11077 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11079 Multi-transformate block and glue the result.
11080 Transformation is defined so, as to superpose direction faces.
11083 Block Hexahedral solid to be multi-transformed.
11084 DirFace1 ID of First direction face.
11085 DirFace2 ID of Second direction face.
11086 NbTimes Quantity of transformations to be done.
11087 theName Object name; when specified, this parameter is used
11088 for result publication in the study. Otherwise, if automatic
11089 publication is switched on, default value is used for result name.
11092 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11095 New GEOM.GEOM_Object, containing the result shape.
11097 # Example: see GEOM_Spanner.py
11098 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11099 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11100 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11101 anObj.SetParameters(Parameters)
11102 self._autoPublish(anObj, theName, "transformed")
11105 ## Multi-transformate block and glue the result.
11106 # @param Block Hexahedral solid to be multi-transformed.
11107 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11108 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11109 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11110 # @param theName Object name; when specified, this parameter is used
11111 # for result publication in the study. Otherwise, if automatic
11112 # publication is switched on, default value is used for result name.
11114 # @return New GEOM.GEOM_Object, containing the result shape.
11116 # @ref tui_multi_transformation "Example"
11117 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11118 DirFace1V, DirFace2V, NbTimesV, theName=None):
11120 Multi-transformate block and glue the result.
11123 Block Hexahedral solid to be multi-transformed.
11124 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11125 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11126 NbTimesU,NbTimesV Quantity of transformations to be done.
11127 theName Object name; when specified, this parameter is used
11128 for result publication in the study. Otherwise, if automatic
11129 publication is switched on, default value is used for result name.
11132 New GEOM.GEOM_Object, containing the result shape.
11134 # Example: see GEOM_Spanner.py
11135 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11136 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11137 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11138 DirFace1V, DirFace2V, NbTimesV)
11139 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11140 anObj.SetParameters(Parameters)
11141 self._autoPublish(anObj, theName, "transformed")
11144 ## Build all possible propagation groups.
11145 # Propagation group is a set of all edges, opposite to one (main)
11146 # edge of this group directly or through other opposite edges.
11147 # Notion of Opposite Edge make sence only on quadrangle face.
11148 # @param theShape Shape to build propagation groups on.
11149 # @param theName Object name; when specified, this parameter is used
11150 # for result publication in the study. Otherwise, if automatic
11151 # publication is switched on, default value is used for result name.
11153 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11155 # @ref swig_Propagate "Example"
11156 def Propagate(self, theShape, theName=None):
11158 Build all possible propagation groups.
11159 Propagation group is a set of all edges, opposite to one (main)
11160 edge of this group directly or through other opposite edges.
11161 Notion of Opposite Edge make sence only on quadrangle face.
11164 theShape Shape to build propagation groups on.
11165 theName Object name; when specified, this parameter is used
11166 for result publication in the study. Otherwise, if automatic
11167 publication is switched on, default value is used for result name.
11170 List of GEOM.GEOM_Object, each of them is a propagation group.
11172 # Example: see GEOM_TestOthers.py
11173 listChains = self.BlocksOp.Propagate(theShape)
11174 RaiseIfFailed("Propagate", self.BlocksOp)
11175 self._autoPublish(listChains, theName, "propagate")
11178 # end of l3_blocks_op
11181 ## @addtogroup l3_groups
11184 ## Creates a new group which will store sub-shapes of theMainShape
11185 # @param theMainShape is a GEOM object on which the group is selected
11186 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11187 # @param theName Object name; when specified, this parameter is used
11188 # for result publication in the study. Otherwise, if automatic
11189 # publication is switched on, default value is used for result name.
11191 # @return a newly created GEOM group (GEOM.GEOM_Object)
11193 # @ref tui_working_with_groups_page "Example 1"
11194 # \n @ref swig_CreateGroup "Example 2"
11195 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11197 Creates a new group which will store sub-shapes of theMainShape
11200 theMainShape is a GEOM object on which the group is selected
11201 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11202 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11203 theName Object name; when specified, this parameter is used
11204 for result publication in the study. Otherwise, if automatic
11205 publication is switched on, default value is used for result name.
11208 a newly created GEOM group
11211 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11214 # Example: see GEOM_TestOthers.py
11215 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11216 RaiseIfFailed("CreateGroup", self.GroupOp)
11217 self._autoPublish(anObj, theName, "group")
11220 ## Adds a sub-object with ID theSubShapeId to the group
11221 # @param theGroup is a GEOM group to which the new sub-shape is added
11222 # @param theSubShapeID is a sub-shape ID in the main object.
11223 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11225 # @ref tui_working_with_groups_page "Example"
11226 def AddObject(self,theGroup, theSubShapeID):
11228 Adds a sub-object with ID theSubShapeId to the group
11231 theGroup is a GEOM group to which the new sub-shape is added
11232 theSubShapeID is a sub-shape ID in the main object.
11235 Use method GetSubShapeID() to get an unique ID of the sub-shape
11237 # Example: see GEOM_TestOthers.py
11238 self.GroupOp.AddObject(theGroup, theSubShapeID)
11239 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11240 RaiseIfFailed("AddObject", self.GroupOp)
11244 ## Removes a sub-object with ID \a theSubShapeId from the group
11245 # @param theGroup is a GEOM group from which the new sub-shape is removed
11246 # @param theSubShapeID is a sub-shape ID in the main object.
11247 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11249 # @ref tui_working_with_groups_page "Example"
11250 def RemoveObject(self,theGroup, theSubShapeID):
11252 Removes a sub-object with ID theSubShapeId from the group
11255 theGroup is a GEOM group from which the new sub-shape is removed
11256 theSubShapeID is a sub-shape ID in the main object.
11259 Use method GetSubShapeID() to get an unique ID of the sub-shape
11261 # Example: see GEOM_TestOthers.py
11262 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11263 RaiseIfFailed("RemoveObject", self.GroupOp)
11266 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11267 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11268 # @param theSubShapes is a list of sub-shapes to be added.
11270 # @ref tui_working_with_groups_page "Example"
11271 def UnionList (self,theGroup, theSubShapes):
11273 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11276 theGroup is a GEOM group to which the new sub-shapes are added.
11277 theSubShapes is a list of sub-shapes to be added.
11279 # Example: see GEOM_TestOthers.py
11280 self.GroupOp.UnionList(theGroup, theSubShapes)
11281 RaiseIfFailed("UnionList", self.GroupOp)
11284 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11285 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11286 # @param theSubShapes is a list of indices of sub-shapes to be added.
11288 # @ref swig_UnionIDs "Example"
11289 def UnionIDs(self,theGroup, theSubShapes):
11291 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11294 theGroup is a GEOM group to which the new sub-shapes are added.
11295 theSubShapes is a list of indices of sub-shapes to be added.
11297 # Example: see GEOM_TestOthers.py
11298 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11299 RaiseIfFailed("UnionIDs", self.GroupOp)
11302 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11303 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11304 # @param theSubShapes is a list of sub-shapes to be removed.
11306 # @ref tui_working_with_groups_page "Example"
11307 def DifferenceList (self,theGroup, theSubShapes):
11309 Removes from the group all the given shapes. No errors, if some shapes are not included.
11312 theGroup is a GEOM group from which the sub-shapes are removed.
11313 theSubShapes is a list of sub-shapes to be removed.
11315 # Example: see GEOM_TestOthers.py
11316 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11317 RaiseIfFailed("DifferenceList", self.GroupOp)
11320 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11321 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11322 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11324 # @ref swig_DifferenceIDs "Example"
11325 def DifferenceIDs(self,theGroup, theSubShapes):
11327 Removes from the group all the given shapes. No errors, if some shapes are not included.
11330 theGroup is a GEOM group from which the sub-shapes are removed.
11331 theSubShapes is a list of indices of sub-shapes to be removed.
11333 # Example: see GEOM_TestOthers.py
11334 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11335 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11338 ## Union of two groups.
11339 # New group is created. It will contain all entities
11340 # which are present in groups theGroup1 and theGroup2.
11341 # @param theGroup1, theGroup2 are the initial GEOM groups
11342 # to create the united group from.
11343 # @param theName Object name; when specified, this parameter is used
11344 # for result publication in the study. Otherwise, if automatic
11345 # publication is switched on, default value is used for result name.
11347 # @return a newly created GEOM group.
11349 # @ref tui_union_groups_anchor "Example"
11350 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11352 Union of two groups.
11353 New group is created. It will contain all entities
11354 which are present in groups theGroup1 and theGroup2.
11357 theGroup1, theGroup2 are the initial GEOM groups
11358 to create the united group from.
11359 theName Object name; when specified, this parameter is used
11360 for result publication in the study. Otherwise, if automatic
11361 publication is switched on, default value is used for result name.
11364 a newly created GEOM group.
11366 # Example: see GEOM_TestOthers.py
11367 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11368 RaiseIfFailed("UnionGroups", self.GroupOp)
11369 self._autoPublish(aGroup, theName, "group")
11372 ## Intersection of two groups.
11373 # New group is created. It will contain only those entities
11374 # which are present in both groups theGroup1 and theGroup2.
11375 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11376 # @param theName Object name; when specified, this parameter is used
11377 # for result publication in the study. Otherwise, if automatic
11378 # publication is switched on, default value is used for result name.
11380 # @return a newly created GEOM group.
11382 # @ref tui_intersect_groups_anchor "Example"
11383 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11385 Intersection of two groups.
11386 New group is created. It will contain only those entities
11387 which are present in both groups theGroup1 and theGroup2.
11390 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11391 theName Object name; when specified, this parameter is used
11392 for result publication in the study. Otherwise, if automatic
11393 publication is switched on, default value is used for result name.
11396 a newly created GEOM group.
11398 # Example: see GEOM_TestOthers.py
11399 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11400 RaiseIfFailed("IntersectGroups", self.GroupOp)
11401 self._autoPublish(aGroup, theName, "group")
11404 ## Cut of two groups.
11405 # New group is created. It will contain entities which are
11406 # present in group theGroup1 but are not present in group theGroup2.
11407 # @param theGroup1 is a GEOM group to include elements of.
11408 # @param theGroup2 is a GEOM group to exclude elements of.
11409 # @param theName Object name; when specified, this parameter is used
11410 # for result publication in the study. Otherwise, if automatic
11411 # publication is switched on, default value is used for result name.
11413 # @return a newly created GEOM group.
11415 # @ref tui_cut_groups_anchor "Example"
11416 def CutGroups (self, theGroup1, theGroup2, theName=None):
11419 New group is created. It will contain entities which are
11420 present in group theGroup1 but are not present in group theGroup2.
11423 theGroup1 is a GEOM group to include elements of.
11424 theGroup2 is a GEOM group to exclude elements of.
11425 theName Object name; when specified, this parameter is used
11426 for result publication in the study. Otherwise, if automatic
11427 publication is switched on, default value is used for result name.
11430 a newly created GEOM group.
11432 # Example: see GEOM_TestOthers.py
11433 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11434 RaiseIfFailed("CutGroups", self.GroupOp)
11435 self._autoPublish(aGroup, theName, "group")
11438 ## Union of list of groups.
11439 # New group is created. It will contain all entities that are
11440 # present in groups listed in theGList.
11441 # @param theGList is a list of GEOM groups to create the united group from.
11442 # @param theName Object name; when specified, this parameter is used
11443 # for result publication in the study. Otherwise, if automatic
11444 # publication is switched on, default value is used for result name.
11446 # @return a newly created GEOM group.
11448 # @ref tui_union_groups_anchor "Example"
11449 def UnionListOfGroups (self, theGList, theName=None):
11451 Union of list of groups.
11452 New group is created. It will contain all entities that are
11453 present in groups listed in theGList.
11456 theGList is a list of GEOM groups to create the united group from.
11457 theName Object name; when specified, this parameter is used
11458 for result publication in the study. Otherwise, if automatic
11459 publication is switched on, default value is used for result name.
11462 a newly created GEOM group.
11464 # Example: see GEOM_TestOthers.py
11465 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11466 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11467 self._autoPublish(aGroup, theName, "group")
11470 ## Cut of lists of groups.
11471 # New group is created. It will contain only entities
11472 # which are present in groups listed in theGList.
11473 # @param theGList is a list of GEOM groups to include elements of.
11474 # @param theName Object name; when specified, this parameter is used
11475 # for result publication in the study. Otherwise, if automatic
11476 # publication is switched on, default value is used for result name.
11478 # @return a newly created GEOM group.
11480 # @ref tui_intersect_groups_anchor "Example"
11481 def IntersectListOfGroups (self, theGList, theName=None):
11483 Cut of lists of groups.
11484 New group is created. It will contain only entities
11485 which are present in groups listed in theGList.
11488 theGList is a list of GEOM groups to include elements of.
11489 theName Object name; when specified, this parameter is used
11490 for result publication in the study. Otherwise, if automatic
11491 publication is switched on, default value is used for result name.
11494 a newly created GEOM group.
11496 # Example: see GEOM_TestOthers.py
11497 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11498 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11499 self._autoPublish(aGroup, theName, "group")
11502 ## Cut of lists of groups.
11503 # New group is created. It will contain only entities
11504 # which are present in groups listed in theGList1 but
11505 # are not present in groups from theGList2.
11506 # @param theGList1 is a list of GEOM groups to include elements of.
11507 # @param theGList2 is a list of GEOM groups to exclude elements of.
11508 # @param theName Object name; when specified, this parameter is used
11509 # for result publication in the study. Otherwise, if automatic
11510 # publication is switched on, default value is used for result name.
11512 # @return a newly created GEOM group.
11514 # @ref tui_cut_groups_anchor "Example"
11515 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11517 Cut of lists of groups.
11518 New group is created. It will contain only entities
11519 which are present in groups listed in theGList1 but
11520 are not present in groups from theGList2.
11523 theGList1 is a list of GEOM groups to include elements of.
11524 theGList2 is a list of GEOM groups to exclude elements of.
11525 theName Object name; when specified, this parameter is used
11526 for result publication in the study. Otherwise, if automatic
11527 publication is switched on, default value is used for result name.
11530 a newly created GEOM group.
11532 # Example: see GEOM_TestOthers.py
11533 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11534 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11535 self._autoPublish(aGroup, theName, "group")
11538 ## Returns a list of sub-objects ID stored in the group
11539 # @param theGroup is a GEOM group for which a list of IDs is requested
11541 # @ref swig_GetObjectIDs "Example"
11542 def GetObjectIDs(self,theGroup):
11544 Returns a list of sub-objects ID stored in the group
11547 theGroup is a GEOM group for which a list of IDs is requested
11549 # Example: see GEOM_TestOthers.py
11550 ListIDs = self.GroupOp.GetObjects(theGroup)
11551 RaiseIfFailed("GetObjects", self.GroupOp)
11554 ## Returns a type of sub-objects stored in the group
11555 # @param theGroup is a GEOM group which type is returned.
11557 # @ref swig_GetType "Example"
11558 def GetType(self,theGroup):
11560 Returns a type of sub-objects stored in the group
11563 theGroup is a GEOM group which type is returned.
11565 # Example: see GEOM_TestOthers.py
11566 aType = self.GroupOp.GetType(theGroup)
11567 RaiseIfFailed("GetType", self.GroupOp)
11570 ## Convert a type of geom object from id to string value
11571 # @param theId is a GEOM obect type id.
11572 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11573 # @ref swig_GetType "Example"
11574 def ShapeIdToType(self, theId):
11576 Convert a type of geom object from id to string value
11579 theId is a GEOM obect type id.
11582 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11609 return "REVOLUTION"
11657 return "FREE_BOUNDS"
11665 return "THRUSECTIONS"
11667 return "COMPOUNDFILTER"
11669 return "SHAPES_ON_SHAPE"
11671 return "ELLIPSE_ARC"
11673 return "3DSKETCHER"
11679 return "PIPETSHAPE"
11680 return "Shape Id not exist."
11682 ## Returns a main shape associated with the group
11683 # @param theGroup is a GEOM group for which a main shape object is requested
11684 # @return a GEOM object which is a main shape for theGroup
11686 # @ref swig_GetMainShape "Example"
11687 def GetMainShape(self,theGroup):
11689 Returns a main shape associated with the group
11692 theGroup is a GEOM group for which a main shape object is requested
11695 a GEOM object which is a main shape for theGroup
11697 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11699 # Example: see GEOM_TestOthers.py
11700 anObj = self.GroupOp.GetMainShape(theGroup)
11701 RaiseIfFailed("GetMainShape", self.GroupOp)
11704 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11705 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11706 # @param theShape given shape (see GEOM.GEOM_Object)
11707 # @param min_length minimum length of edges of theShape
11708 # @param max_length maximum length of edges of theShape
11709 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11710 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11711 # @param theName Object name; when specified, this parameter is used
11712 # for result publication in the study. Otherwise, if automatic
11713 # publication is switched on, default value is used for result name.
11715 # @return a newly created GEOM group of edges
11717 # @@ref swig_todo "Example"
11718 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11720 Create group of edges of theShape, whose length is in range [min_length, max_length].
11721 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11724 theShape given shape
11725 min_length minimum length of edges of theShape
11726 max_length maximum length of edges of theShape
11727 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11728 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11729 theName Object name; when specified, this parameter is used
11730 for result publication in the study. Otherwise, if automatic
11731 publication is switched on, default value is used for result name.
11734 a newly created GEOM group of edges.
11736 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11737 edges_in_range = []
11739 Props = self.BasicProperties(edge)
11740 if min_length <= Props[0] and Props[0] <= max_length:
11741 if (not include_min) and (min_length == Props[0]):
11744 if (not include_max) and (Props[0] == max_length):
11747 edges_in_range.append(edge)
11749 if len(edges_in_range) <= 0:
11750 print "No edges found by given criteria"
11753 # note: auto-publishing is done in self.CreateGroup()
11754 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11755 self.UnionList(group_edges, edges_in_range)
11759 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11760 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11761 # @param min_length minimum length of edges of selected shape
11762 # @param max_length maximum length of edges of selected shape
11763 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11764 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11765 # @return a newly created GEOM group of edges
11766 # @ref swig_todo "Example"
11767 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11769 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11770 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11773 min_length minimum length of edges of selected shape
11774 max_length maximum length of edges of selected shape
11775 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11776 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11779 a newly created GEOM group of edges.
11781 nb_selected = sg.SelectedCount()
11782 if nb_selected < 1:
11783 print "Select a shape before calling this function, please."
11785 if nb_selected > 1:
11786 print "Only one shape must be selected"
11789 id_shape = sg.getSelected(0)
11790 shape = IDToObject( id_shape )
11792 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11796 if include_min: left_str = " <= "
11797 if include_max: right_str = " <= "
11799 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11800 + left_str + "length" + right_str + `max_length`)
11802 sg.updateObjBrowser(1)
11809 ## @addtogroup l4_advanced
11812 ## Create a T-shape object with specified caracteristics for the main
11813 # and the incident pipes (radius, width, half-length).
11814 # The extremities of the main pipe are located on junctions points P1 and P2.
11815 # The extremity of the incident pipe is located on junction point P3.
11816 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11817 # the main plane of the T-shape is XOY.
11819 # @param theR1 Internal radius of main pipe
11820 # @param theW1 Width of main pipe
11821 # @param theL1 Half-length of main pipe
11822 # @param theR2 Internal radius of incident pipe (R2 < R1)
11823 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11824 # @param theL2 Half-length of incident pipe
11826 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11827 # @param theP1 1st junction point of main pipe
11828 # @param theP2 2nd junction point of main pipe
11829 # @param theP3 Junction point of incident pipe
11831 # @param theRL Internal radius of left thickness reduction
11832 # @param theWL Width of left thickness reduction
11833 # @param theLtransL Length of left transition part
11834 # @param theLthinL Length of left thin part
11836 # @param theRR Internal radius of right thickness reduction
11837 # @param theWR Width of right thickness reduction
11838 # @param theLtransR Length of right transition part
11839 # @param theLthinR Length of right thin part
11841 # @param theRI Internal radius of incident thickness reduction
11842 # @param theWI Width of incident thickness reduction
11843 # @param theLtransI Length of incident transition part
11844 # @param theLthinI Length of incident thin part
11846 # @param theName Object name; when specified, this parameter is used
11847 # for result publication in the study. Otherwise, if automatic
11848 # publication is switched on, default value is used for result name.
11850 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11852 # @ref tui_creation_pipetshape "Example"
11853 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11854 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11855 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11856 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11857 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11860 Create a T-shape object with specified caracteristics for the main
11861 and the incident pipes (radius, width, half-length).
11862 The extremities of the main pipe are located on junctions points P1 and P2.
11863 The extremity of the incident pipe is located on junction point P3.
11864 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11865 the main plane of the T-shape is XOY.
11868 theR1 Internal radius of main pipe
11869 theW1 Width of main pipe
11870 theL1 Half-length of main pipe
11871 theR2 Internal radius of incident pipe (R2 < R1)
11872 theW2 Width of incident pipe (R2+W2 < R1+W1)
11873 theL2 Half-length of incident pipe
11874 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11875 theP1 1st junction point of main pipe
11876 theP2 2nd junction point of main pipe
11877 theP3 Junction point of incident pipe
11879 theRL Internal radius of left thickness reduction
11880 theWL Width of left thickness reduction
11881 theLtransL Length of left transition part
11882 theLthinL Length of left thin part
11884 theRR Internal radius of right thickness reduction
11885 theWR Width of right thickness reduction
11886 theLtransR Length of right transition part
11887 theLthinR Length of right thin part
11889 theRI Internal radius of incident thickness reduction
11890 theWI Width of incident thickness reduction
11891 theLtransI Length of incident transition part
11892 theLthinI Length of incident thin part
11894 theName Object name; when specified, this parameter is used
11895 for result publication in the study. Otherwise, if automatic
11896 publication is switched on, default value is used for result name.
11899 List of GEOM_Object, containing the created shape and propagation groups.
11902 # create PipeTShape object
11903 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11904 # create PipeTShape object with position
11905 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11906 # create PipeTShape object with left thickness reduction
11907 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11909 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)
11910 if (theP1 and theP2 and theP3):
11911 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11912 theRL, theWL, theLtransL, theLthinL,
11913 theRR, theWR, theLtransR, theLthinR,
11914 theRI, theWI, theLtransI, theLthinI,
11915 theHexMesh, theP1, theP2, theP3)
11917 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11918 theRL, theWL, theLtransL, theLthinL,
11919 theRR, theWR, theLtransR, theLthinR,
11920 theRI, theWI, theLtransI, theLthinI,
11922 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11923 if Parameters: anObj[0].SetParameters(Parameters)
11924 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11925 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11928 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11929 # and the incident pipes (radius, width, half-length). The chamfer is
11930 # created on the junction of the pipes.
11931 # The extremities of the main pipe are located on junctions points P1 and P2.
11932 # The extremity of the incident pipe is located on junction point P3.
11933 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11934 # the main plane of the T-shape is XOY.
11935 # @param theR1 Internal radius of main pipe
11936 # @param theW1 Width of main pipe
11937 # @param theL1 Half-length of main pipe
11938 # @param theR2 Internal radius of incident pipe (R2 < R1)
11939 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11940 # @param theL2 Half-length of incident pipe
11941 # @param theH Height of the chamfer.
11942 # @param theW Width of the chamfer.
11943 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11944 # @param theP1 1st junction point of main pipe
11945 # @param theP2 2nd junction point of main pipe
11946 # @param theP3 Junction point of incident pipe
11948 # @param theRL Internal radius of left thickness reduction
11949 # @param theWL Width of left thickness reduction
11950 # @param theLtransL Length of left transition part
11951 # @param theLthinL Length of left thin part
11953 # @param theRR Internal radius of right thickness reduction
11954 # @param theWR Width of right thickness reduction
11955 # @param theLtransR Length of right transition part
11956 # @param theLthinR Length of right thin part
11958 # @param theRI Internal radius of incident thickness reduction
11959 # @param theWI Width of incident thickness reduction
11960 # @param theLtransI Length of incident transition part
11961 # @param theLthinI Length of incident thin part
11963 # @param theName Object name; when specified, this parameter is used
11964 # for result publication in the study. Otherwise, if automatic
11965 # publication is switched on, default value is used for result name.
11967 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11969 # @ref tui_creation_pipetshape "Example"
11970 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11971 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11972 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11973 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11974 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11977 Create a T-shape object with chamfer and with specified caracteristics for the main
11978 and the incident pipes (radius, width, half-length). The chamfer is
11979 created on the junction of the pipes.
11980 The extremities of the main pipe are located on junctions points P1 and P2.
11981 The extremity of the incident pipe is located on junction point P3.
11982 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11983 the main plane of the T-shape is XOY.
11986 theR1 Internal radius of main pipe
11987 theW1 Width of main pipe
11988 theL1 Half-length of main pipe
11989 theR2 Internal radius of incident pipe (R2 < R1)
11990 theW2 Width of incident pipe (R2+W2 < R1+W1)
11991 theL2 Half-length of incident pipe
11992 theH Height of the chamfer.
11993 theW Width of the chamfer.
11994 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11995 theP1 1st junction point of main pipe
11996 theP2 2nd junction point of main pipe
11997 theP3 Junction point of incident pipe
11999 theRL Internal radius of left thickness reduction
12000 theWL Width of left thickness reduction
12001 theLtransL Length of left transition part
12002 theLthinL Length of left thin part
12004 theRR Internal radius of right thickness reduction
12005 theWR Width of right thickness reduction
12006 theLtransR Length of right transition part
12007 theLthinR Length of right thin part
12009 theRI Internal radius of incident thickness reduction
12010 theWI Width of incident thickness reduction
12011 theLtransI Length of incident transition part
12012 theLthinI Length of incident thin part
12014 theName Object name; when specified, this parameter is used
12015 for result publication in the study. Otherwise, if automatic
12016 publication is switched on, default value is used for result name.
12019 List of GEOM_Object, containing the created shape and propagation groups.
12022 # create PipeTShape with chamfer object
12023 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12024 # create PipeTShape with chamfer object with position
12025 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12026 # create PipeTShape with chamfer object with left thickness reduction
12027 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)
12029 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)
12030 if (theP1 and theP2 and theP3):
12031 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12032 theRL, theWL, theLtransL, theLthinL,
12033 theRR, theWR, theLtransR, theLthinR,
12034 theRI, theWI, theLtransI, theLthinI,
12035 theH, theW, theHexMesh, theP1, theP2, theP3)
12037 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12038 theRL, theWL, theLtransL, theLthinL,
12039 theRR, theWR, theLtransR, theLthinR,
12040 theRI, theWI, theLtransI, theLthinI,
12041 theH, theW, theHexMesh)
12042 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12043 if Parameters: anObj[0].SetParameters(Parameters)
12044 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12045 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12048 ## Create a T-shape object with fillet and with specified caracteristics for the main
12049 # and the incident pipes (radius, width, half-length). The fillet is
12050 # created on the junction of the pipes.
12051 # The extremities of the main pipe are located on junctions points P1 and P2.
12052 # The extremity of the incident pipe is located on junction point P3.
12053 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12054 # the main plane of the T-shape is XOY.
12055 # @param theR1 Internal radius of main pipe
12056 # @param theW1 Width of main pipe
12057 # @param theL1 Half-length of main pipe
12058 # @param theR2 Internal radius of incident pipe (R2 < R1)
12059 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12060 # @param theL2 Half-length of incident pipe
12061 # @param theRF Radius of curvature of fillet.
12062 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12063 # @param theP1 1st junction point of main pipe
12064 # @param theP2 2nd junction point of main pipe
12065 # @param theP3 Junction point of incident pipe
12067 # @param theRL Internal radius of left thickness reduction
12068 # @param theWL Width of left thickness reduction
12069 # @param theLtransL Length of left transition part
12070 # @param theLthinL Length of left thin part
12072 # @param theRR Internal radius of right thickness reduction
12073 # @param theWR Width of right thickness reduction
12074 # @param theLtransR Length of right transition part
12075 # @param theLthinR Length of right thin part
12077 # @param theRI Internal radius of incident thickness reduction
12078 # @param theWI Width of incident thickness reduction
12079 # @param theLtransI Length of incident transition part
12080 # @param theLthinI Length of incident thin part
12082 # @param theName Object name; when specified, this parameter is used
12083 # for result publication in the study. Otherwise, if automatic
12084 # publication is switched on, default value is used for result name.
12086 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12088 # @ref tui_creation_pipetshape "Example"
12089 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12090 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12091 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12092 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12093 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12096 Create a T-shape object with fillet and with specified caracteristics for the main
12097 and the incident pipes (radius, width, half-length). The fillet is
12098 created on the junction of the pipes.
12099 The extremities of the main pipe are located on junctions points P1 and P2.
12100 The extremity of the incident pipe is located on junction point P3.
12103 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12104 the main plane of the T-shape is XOY.
12105 theR1 Internal radius of main pipe
12106 theW1 Width of main pipe
12107 heL1 Half-length of main pipe
12108 theR2 Internal radius of incident pipe (R2 < R1)
12109 theW2 Width of incident pipe (R2+W2 < R1+W1)
12110 theL2 Half-length of incident pipe
12111 theRF Radius of curvature of fillet.
12112 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12113 theP1 1st junction point of main pipe
12114 theP2 2nd junction point of main pipe
12115 theP3 Junction point of incident pipe
12117 theRL Internal radius of left thickness reduction
12118 theWL Width of left thickness reduction
12119 theLtransL Length of left transition part
12120 theLthinL Length of left thin part
12122 theRR Internal radius of right thickness reduction
12123 theWR Width of right thickness reduction
12124 theLtransR Length of right transition part
12125 theLthinR Length of right thin part
12127 theRI Internal radius of incident thickness reduction
12128 theWI Width of incident thickness reduction
12129 theLtransI Length of incident transition part
12130 theLthinI Length of incident thin part
12132 theName Object name; when specified, this parameter is used
12133 for result publication in the study. Otherwise, if automatic
12134 publication is switched on, default value is used for result name.
12137 List of GEOM_Object, containing the created shape and propagation groups.
12140 # create PipeTShape with fillet object
12141 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12142 # create PipeTShape with fillet object with position
12143 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12144 # create PipeTShape with fillet object with left thickness reduction
12145 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)
12147 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)
12148 if (theP1 and theP2 and theP3):
12149 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12150 theRL, theWL, theLtransL, theLthinL,
12151 theRR, theWR, theLtransR, theLthinR,
12152 theRI, theWI, theLtransI, theLthinI,
12153 theRF, theHexMesh, theP1, theP2, theP3)
12155 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12156 theRL, theWL, theLtransL, theLthinL,
12157 theRR, theWR, theLtransR, theLthinR,
12158 theRI, theWI, theLtransI, theLthinI,
12160 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12161 if Parameters: anObj[0].SetParameters(Parameters)
12162 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12163 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12166 ## This function allows creating a disk already divided into blocks. It
12167 # can be used to create divided pipes for later meshing in hexaedra.
12168 # @param theR Radius of the disk
12169 # @param theOrientation Orientation of the plane on which the disk will be built
12170 # 1 = XOY, 2 = OYZ, 3 = OZX
12171 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12172 # @param theName Object name; when specified, this parameter is used
12173 # for result publication in the study. Otherwise, if automatic
12174 # publication is switched on, default value is used for result name.
12176 # @return New GEOM_Object, containing the created shape.
12178 # @ref tui_creation_divideddisk "Example"
12179 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12181 Creates a disk, divided into blocks. It can be used to create divided pipes
12182 for later meshing in hexaedra.
12185 theR Radius of the disk
12186 theOrientation Orientation of the plane on which the disk will be built:
12187 1 = XOY, 2 = OYZ, 3 = OZX
12188 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12189 theName Object name; when specified, this parameter is used
12190 for result publication in the study. Otherwise, if automatic
12191 publication is switched on, default value is used for result name.
12194 New GEOM_Object, containing the created shape.
12196 theR, Parameters = ParseParameters(theR)
12197 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12198 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12199 if Parameters: anObj.SetParameters(Parameters)
12200 self._autoPublish(anObj, theName, "dividedDisk")
12203 ## This function allows creating a disk already divided into blocks. It
12204 # can be used to create divided pipes for later meshing in hexaedra.
12205 # @param theCenter Center of the disk
12206 # @param theVector Normal vector to the plane of the created disk
12207 # @param theRadius Radius of the disk
12208 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12209 # @param theName Object name; when specified, this parameter is used
12210 # for result publication in the study. Otherwise, if automatic
12211 # publication is switched on, default value is used for result name.
12213 # @return New GEOM_Object, containing the created shape.
12215 # @ref tui_creation_divideddisk "Example"
12216 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12218 Creates a disk already divided into blocks. It can be used to create divided pipes
12219 for later meshing in hexaedra.
12222 theCenter Center of the disk
12223 theVector Normal vector to the plane of the created disk
12224 theRadius Radius of the disk
12225 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12226 theName Object name; when specified, this parameter is used
12227 for result publication in the study. Otherwise, if automatic
12228 publication is switched on, default value is used for result name.
12231 New GEOM_Object, containing the created shape.
12233 theRadius, Parameters = ParseParameters(theRadius)
12234 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12235 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12236 if Parameters: anObj.SetParameters(Parameters)
12237 self._autoPublish(anObj, theName, "dividedDisk")
12240 ## Builds a cylinder prepared for hexa meshes
12241 # @param theR Radius of the cylinder
12242 # @param theH Height of the cylinder
12243 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12244 # @param theName Object name; when specified, this parameter is used
12245 # for result publication in the study. Otherwise, if automatic
12246 # publication is switched on, default value is used for result name.
12248 # @return New GEOM_Object, containing the created shape.
12250 # @ref tui_creation_dividedcylinder "Example"
12251 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12253 Builds a cylinder prepared for hexa meshes
12256 theR Radius of the cylinder
12257 theH Height of the cylinder
12258 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12259 theName Object name; when specified, this parameter is used
12260 for result publication in the study. Otherwise, if automatic
12261 publication is switched on, default value is used for result name.
12264 New GEOM_Object, containing the created shape.
12266 theR, theH, Parameters = ParseParameters(theR, theH)
12267 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12268 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12269 if Parameters: anObj.SetParameters(Parameters)
12270 self._autoPublish(anObj, theName, "dividedCylinder")
12273 ## Create a surface from a cloud of points
12274 # @param thelPoints list of points
12275 # @return New GEOM_Object, containing the created shape.
12277 # @ref tui_creation_smoothingsurface "Example"
12278 def MakeSmoothingSurface(self, thelPoints):
12279 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12280 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12283 ## Export a shape to XAO format
12284 # @param shape The shape to export
12285 # @param groups The list of groups to export
12286 # @param fields The list of fields to export
12287 # @param author The author of the export
12288 # @param fileName The name of the file to export
12291 # @ref tui_exportxao "Example"
12292 def ExportXAO(self, shape, groups, fields, author, fileName):
12293 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12294 RaiseIfFailed("ExportXAO", self.InsertOp)
12297 ## Import a shape from XAO format
12298 # @param shape Shape to export
12299 # @param fileName The name of the file to import
12300 # @return tuple (res, shape, subShapes, groups, fields)
12301 # res Flag indicating if the import was successful
12302 # shape The imported shape
12303 # subShapes The list of imported subShapes
12304 # groups The list of imported groups
12305 # fields The list of imported fields
12307 # @ref tui_importxao "Example"
12308 def ImportXAO(self, fileName):
12309 res = self.InsertOp.ImportXAO(fileName)
12310 RaiseIfFailed("ImportXAO", self.InsertOp)
12313 #@@ insert new functions before this line @@ do not remove this line @@#
12315 # end of l4_advanced
12318 ## Create a copy of the given object
12320 # @param theOriginal geometry object for copy
12321 # @param theName Object name; when specified, this parameter is used
12322 # for result publication in the study. Otherwise, if automatic
12323 # publication is switched on, default value is used for result name.
12325 # @return New GEOM_Object, containing the copied shape.
12327 # @ingroup l1_geomBuilder_auxiliary
12328 # @ref swig_MakeCopy "Example"
12329 def MakeCopy(self, theOriginal, theName=None):
12331 Create a copy of the given object
12334 theOriginal geometry object for copy
12335 theName Object name; when specified, this parameter is used
12336 for result publication in the study. Otherwise, if automatic
12337 publication is switched on, default value is used for result name.
12340 New GEOM_Object, containing the copied shape.
12342 Example of usage: Copy = geompy.MakeCopy(Box)
12344 # Example: see GEOM_TestAll.py
12345 anObj = self.InsertOp.MakeCopy(theOriginal)
12346 RaiseIfFailed("MakeCopy", self.InsertOp)
12347 self._autoPublish(anObj, theName, "copy")
12350 ## Add Path to load python scripts from
12351 # @param Path a path to load python scripts from
12352 # @ingroup l1_geomBuilder_auxiliary
12353 def addPath(self,Path):
12355 Add Path to load python scripts from
12358 Path a path to load python scripts from
12360 if (sys.path.count(Path) < 1):
12361 sys.path.append(Path)
12365 ## Load marker texture from the file
12366 # @param Path a path to the texture file
12367 # @return unique texture identifier
12368 # @ingroup l1_geomBuilder_auxiliary
12369 def LoadTexture(self, Path):
12371 Load marker texture from the file
12374 Path a path to the texture file
12377 unique texture identifier
12379 # Example: see GEOM_TestAll.py
12380 ID = self.InsertOp.LoadTexture(Path)
12381 RaiseIfFailed("LoadTexture", self.InsertOp)
12384 ## Get internal name of the object based on its study entry
12385 # @note This method does not provide an unique identifier of the geometry object.
12386 # @note This is internal function of GEOM component, though it can be used outside it for
12387 # appropriate reason (e.g. for identification of geometry object).
12388 # @param obj geometry object
12389 # @return unique object identifier
12390 # @ingroup l1_geomBuilder_auxiliary
12391 def getObjectID(self, obj):
12393 Get internal name of the object based on its study entry.
12394 Note: this method does not provide an unique identifier of the geometry object.
12395 It is an internal function of GEOM component, though it can be used outside GEOM for
12396 appropriate reason (e.g. for identification of geometry object).
12399 obj geometry object
12402 unique object identifier
12405 entry = salome.ObjectToID(obj)
12406 if entry is not None:
12407 lst = entry.split(":")
12409 ID = lst[-1] # -1 means last item in the list
12410 return "GEOM_" + ID
12415 ## Add marker texture. @a Width and @a Height parameters
12416 # specify width and height of the texture in pixels.
12417 # If @a RowData is @c True, @a Texture parameter should represent texture data
12418 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12419 # parameter should be unpacked string, in which '1' symbols represent opaque
12420 # pixels and '0' represent transparent pixels of the texture bitmap.
12422 # @param Width texture width in pixels
12423 # @param Height texture height in pixels
12424 # @param Texture texture data
12425 # @param RowData if @c True, @a Texture data are packed in the byte stream
12426 # @return unique texture identifier
12427 # @ingroup l1_geomBuilder_auxiliary
12428 def AddTexture(self, Width, Height, Texture, RowData=False):
12430 Add marker texture. Width and Height parameters
12431 specify width and height of the texture in pixels.
12432 If RowData is True, Texture parameter should represent texture data
12433 packed into the byte array. If RowData is False (default), Texture
12434 parameter should be unpacked string, in which '1' symbols represent opaque
12435 pixels and '0' represent transparent pixels of the texture bitmap.
12438 Width texture width in pixels
12439 Height texture height in pixels
12440 Texture texture data
12441 RowData if True, Texture data are packed in the byte stream
12444 return unique texture identifier
12446 if not RowData: Texture = PackData(Texture)
12447 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12448 RaiseIfFailed("AddTexture", self.InsertOp)
12451 ## Creates a new folder object. It is a container for any GEOM objects.
12452 # @param Name name of the container
12453 # @param Father parent object. If None,
12454 # folder under 'Geometry' root object will be created.
12455 # @return a new created folder
12456 def NewFolder(self, Name, Father=None):
12458 Create a new folder object. It is an auxiliary container for any GEOM objects.
12461 Name name of the container
12462 Father parent object. If None,
12463 folder under 'Geometry' root object will be created.
12466 a new created folder
12468 if not Father: Father = self.father
12469 return self.CreateFolder(Name, Father)
12471 ## Move object to the specified folder
12472 # @param Object object to move
12473 # @param Folder target folder
12474 def PutToFolder(self, Object, Folder):
12476 Move object to the specified folder
12479 Object object to move
12480 Folder target folder
12482 self.MoveToFolder(Object, Folder)
12485 ## Move list of objects to the specified folder
12486 # @param ListOfSO list of objects to move
12487 # @param Folder target folder
12488 def PutListToFolder(self, ListOfSO, Folder):
12490 Move list of objects to the specified folder
12493 ListOfSO list of objects to move
12494 Folder target folder
12496 self.MoveListToFolder(ListOfSO, Folder)
12499 ## @addtogroup l2_field
12503 # @param shape the shape the field lies on
12504 # @param name the field name
12505 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12506 # @param dimension dimension of the shape the field lies on
12507 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12508 # @param componentNames names of components
12509 # @return a created field
12510 def CreateField(self, shape, name, type, dimension, componentNames):
12515 shape the shape the field lies on
12516 name the field name
12517 type type of field data
12518 dimension dimension of the shape the field lies on
12519 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12520 componentNames names of components
12525 if isinstance( type, int ):
12526 if type < 0 or type > 3:
12527 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12528 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12530 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12531 RaiseIfFailed("CreateField", self.FieldOp)
12533 geom._autoPublish( f, "", name)
12536 ## Removes a field from the GEOM component
12537 # @param field the field to remove
12538 def RemoveField(self, field):
12539 "Removes a field from the GEOM component"
12541 if isinstance( field, GEOM._objref_GEOM_Field ):
12542 geom.RemoveObject( field )
12543 elif isinstance( field, geomField ):
12544 geom.RemoveObject( field.field )
12546 raise RuntimeError, "RemoveField() : the object is not a field"
12549 ## Returns number of fields on a shape
12550 def CountFields(self, shape):
12551 "Returns number of fields on a shape"
12552 nb = self.FieldOp.CountFields( shape )
12553 RaiseIfFailed("CountFields", self.FieldOp)
12556 ## Returns all fields on a shape
12557 def GetFields(self, shape):
12558 "Returns all fields on a shape"
12559 ff = self.FieldOp.GetFields( shape )
12560 RaiseIfFailed("GetFields", self.FieldOp)
12563 ## Returns a field on a shape by its name
12564 def GetField(self, shape, name):
12565 "Returns a field on a shape by its name"
12566 f = self.FieldOp.GetField( shape, name )
12567 RaiseIfFailed("GetField", self.FieldOp)
12575 # Register the new proxy for GEOM_Gen
12576 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12579 ## Field on Geometry
12580 # @ingroup l2_field
12581 class geomField( GEOM._objref_GEOM_Field ):
12583 def __init__(self):
12584 GEOM._objref_GEOM_Field.__init__(self)
12585 self.field = GEOM._objref_GEOM_Field
12588 ## Returns the shape the field lies on
12589 def getShape(self):
12590 "Returns the shape the field lies on"
12591 return self.field.GetShape(self)
12593 ## Returns the field name
12595 "Returns the field name"
12596 return self.field.GetName(self)
12598 ## Returns type of field data as integer [0-3]
12600 "Returns type of field data"
12601 return self.field.GetDataType(self)._v
12603 ## Returns type of field data:
12604 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12605 def getTypeEnum(self):
12606 "Returns type of field data"
12607 return self.field.GetDataType(self)
12609 ## Returns dimension of the shape the field lies on:
12610 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12611 def getDimension(self):
12612 """Returns dimension of the shape the field lies on:
12613 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12614 return self.field.GetDimension(self)
12616 ## Returns names of components
12617 def getComponents(self):
12618 "Returns names of components"
12619 return self.field.GetComponents(self)
12621 ## Adds a time step to the field
12622 # @param step the time step number futher used as the step identifier
12623 # @param stamp the time step time
12624 # @param values the values of the time step
12625 def addStep(self, step, stamp, values):
12626 "Adds a time step to the field"
12627 stp = self.field.AddStep( self, step, stamp )
12629 raise RuntimeError, \
12630 "Field.addStep() : Error: step %s already exists in this field"%step
12632 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12633 self.setValues( step, values )
12636 ## Remove a time step from the field
12637 def removeStep(self,step):
12638 "Remove a time step from the field"
12639 self.field.RemoveStep( self, step )
12642 ## Returns number of time steps in the field
12643 def countSteps(self):
12644 "Returns number of time steps in the field"
12645 return self.field.CountSteps(self)
12647 ## Returns a list of time step IDs in the field
12648 def getSteps(self):
12649 "Returns a list of time step IDs in the field"
12650 return self.field.GetSteps(self)
12652 ## Returns a time step by its ID
12653 def getStep(self,step):
12654 "Returns a time step by its ID"
12655 stp = self.field.GetStep(self, step)
12657 raise RuntimeError, "Step %s is missing from this field"%step
12660 ## Returns the time of the field step
12661 def getStamp(self,step):
12662 "Returns the time of the field step"
12663 return self.getStep(step).GetStamp()
12665 ## Changes the time of the field step
12666 def setStamp(self, step, stamp):
12667 "Changes the time of the field step"
12668 return self.getStep(step).SetStamp(stamp)
12670 ## Returns values of the field step
12671 def getValues(self, step):
12672 "Returns values of the field step"
12673 return self.getStep(step).GetValues()
12675 ## Changes values of the field step
12676 def setValues(self, step, values):
12677 "Changes values of the field step"
12678 stp = self.getStep(step)
12679 errBeg = "Field.setValues(values) : Error: "
12681 ok = stp.SetValues( values )
12682 except Exception, e:
12684 if excStr.find("WrongPythonType") > 0:
12685 raise RuntimeError, errBeg +\
12686 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12687 raise RuntimeError, errBeg + str(e)
12689 nbOK = self.field.GetArraySize(self)
12692 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12694 raise RuntimeError, errBeg + "failed"
12697 pass # end of class geomField
12699 # Register the new proxy for GEOM_Field
12700 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12703 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12704 # interface to GEOM operations.
12709 # salome.salome_init()
12710 # from salome.geom import geomBuilder
12711 # geompy = geomBuilder.New(salome.myStudy)
12713 # @param study SALOME study, generally obtained by salome.myStudy.
12714 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12715 # @return geomBuilder instance
12716 def New( study, instance=None):
12718 Create a new geomBuilder instance.The geomBuilder class provides the Python
12719 interface to GEOM operations.
12723 salome.salome_init()
12724 from salome.geom import geomBuilder
12725 geompy = geomBuilder.New(salome.myStudy)
12728 study SALOME study, generally obtained by salome.myStudy.
12729 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12731 geomBuilder instance
12733 #print "New geomBuilder ", study, instance
12740 geom = geomBuilder()
12741 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12742 geom.init_geom(study)