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 Operation.AbortOperation()
233 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
235 Operation.FinishOperation()
238 ## Return list of variables value from salome notebook
239 ## @ingroup l1_geomBuilder_auxiliary
240 def ParseParameters(*parameters):
243 for parameter in parameters:
244 if isinstance(parameter, list):
245 lResults = ParseParameters(*parameter)
246 if len(lResults) > 0:
247 Result.append(lResults[:-1])
248 StringResult += lResults[-1].split(":")
252 if isinstance(parameter,str):
253 if notebook.isVariable(parameter):
254 Result.append(notebook.get(parameter))
256 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
259 Result.append(parameter)
261 StringResult.append(str(parameter))
265 Result.append(":".join(StringResult))
267 Result = ":".join(StringResult)
270 ## Return list of variables value from salome notebook
271 ## @ingroup l1_geomBuilder_auxiliary
275 for parameter in list:
276 if isinstance(parameter,str) and notebook.isVariable(parameter):
277 Result.append(str(notebook.get(parameter)))
280 Result.append(str(parameter))
283 StringResult = StringResult + str(parameter)
284 StringResult = StringResult + ":"
286 StringResult = StringResult[:len(StringResult)-1]
287 return Result, StringResult
289 ## Return list of variables value from salome notebook
290 ## @ingroup l1_geomBuilder_auxiliary
291 def ParseSketcherCommand(command):
294 sections = command.split(":")
295 for section in sections:
296 parameters = section.split(" ")
298 for parameter in parameters:
299 if paramIndex > 1 and parameter.find("'") != -1:
300 parameter = parameter.replace("'","")
301 if notebook.isVariable(parameter):
302 Result = Result + str(notebook.get(parameter)) + " "
305 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
309 Result = Result + str(parameter) + " "
312 StringResult = StringResult + parameter
313 StringResult = StringResult + ":"
315 paramIndex = paramIndex + 1
317 Result = Result[:len(Result)-1] + ":"
319 Result = Result[:len(Result)-1]
320 return Result, StringResult
322 ## Helper function which can be used to pack the passed string to the byte data.
323 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
324 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
327 ## val = PackData("10001110") # val = 0xAE
328 ## val = PackData("1") # val = 0x80
330 ## @param data unpacked data - a string containing '1' and '0' symbols
331 ## @return data packed to the byte stream
332 ## @ingroup l1_geomBuilder_auxiliary
335 Helper function which can be used to pack the passed string to the byte data.
336 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
337 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
340 data unpacked data - a string containing '1' and '0' symbols
343 data packed to the byte stream
346 val = PackData("10001110") # val = 0xAE
347 val = PackData("1") # val = 0x80
350 if len(data)%8: bytes += 1
352 for b in range(bytes):
353 d = data[b*8:(b+1)*8]
358 if d[i] == "1": val += 1
360 raise "Invalid symbol %s" % d[i]
367 ## Read bitmap texture from the text file.
368 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
369 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
370 ## The function returns width and height of the pixmap in pixels and byte stream representing
371 ## texture bitmap itself.
373 ## This function can be used to read the texture to the byte stream in order to pass it to
374 ## the AddTexture() function of geomBuilder class.
377 ## from salome.geom import geomBuilder
378 ## geompy = geomBuilder.New(salome.myStudy)
379 ## texture = geompy.readtexture('mytexture.dat')
380 ## texture = geompy.AddTexture(*texture)
381 ## obj.SetMarkerTexture(texture)
383 ## @param fname texture file name
384 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
385 ## @ingroup l1_geomBuilder_auxiliary
386 def ReadTexture(fname):
388 Read bitmap texture from the text file.
389 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
390 A zero symbol ('0') represents transparent pixel of the texture bitmap.
391 The function returns width and height of the pixmap in pixels and byte stream representing
392 texture bitmap itself.
393 This function can be used to read the texture to the byte stream in order to pass it to
394 the AddTexture() function of geomBuilder class.
397 fname texture file name
400 sequence of tree values: texture's width, height in pixels and its byte stream
403 from salome.geom import geomBuilder
404 geompy = geomBuilder.New(salome.myStudy)
405 texture = geompy.readtexture('mytexture.dat')
406 texture = geompy.AddTexture(*texture)
407 obj.SetMarkerTexture(texture)
411 lines = [ l.strip() for l in f.readlines()]
414 if lines: maxlen = max([len(x) for x in lines])
416 if maxlen%8: lenbytes += 1
420 lenline = (len(line)/8+1)*8
423 lenline = (len(line)/8)*8
425 for i in range(lenline/8):
428 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
431 bytedata += PackData(byte)
433 for i in range(lenline/8, lenbytes):
434 bytedata += PackData("0")
436 return lenbytes*8, len(lines), bytedata
441 ## Returns a long value from enumeration type
442 # Can be used for CORBA enumerator types like GEOM.shape_type
443 # @param theItem enumeration type
444 # @ingroup l1_geomBuilder_auxiliary
445 def EnumToLong(theItem):
447 Returns a long value from enumeration type
448 Can be used for CORBA enumerator types like geomBuilder.ShapeType
451 theItem enumeration type
454 if hasattr(theItem, "_v"): ret = theItem._v
457 ## Information about closed/unclosed state of shell or wire
458 # @ingroup l1_geomBuilder_auxiliary
461 Information about closed/unclosed state of shell or wire
467 ##! Private class used to bind calls of plugin operations to geomBuilder
468 class PluginOperation:
469 def __init__(self, operation, function):
470 self.operation = operation
471 self.function = function
474 def __call__(self, *args):
475 res = self.function(self.operation, *args)
476 RaiseIfFailed(self.function.__name__, self.operation)
479 # Warning: geom is a singleton
485 class geomBuilder(object, GEOM._objref_GEOM_Gen):
487 ## Enumeration ShapeType as a dictionary. \n
488 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
489 # @ingroup l1_geomBuilder_auxiliary
490 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
492 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
493 # and a list of parameters, describing the shape.
494 # List of parameters, describing the shape:
495 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
496 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
498 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
500 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
502 # - SPHERE: [xc yc zc R]
503 # - CYLINDER: [xb yb zb dx dy dz R H]
504 # - BOX: [xc yc zc ax ay az]
505 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
506 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
507 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
508 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
509 # - SOLID: [nb_faces nb_edges nb_vertices]
511 # - SPHERE2D: [xc yc zc R]
512 # - CYLINDER2D: [xb yb zb dx dy dz R H]
513 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
514 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
515 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
516 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
517 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
518 # - PLANE: [xo yo zo dx dy dz]
519 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
520 # - FACE: [nb_edges nb_vertices]
522 # - CIRCLE: [xc yc zc dx dy dz R]
523 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
524 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
525 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
526 # - LINE: [xo yo zo dx dy dz]
527 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
528 # - EDGE: [nb_vertices]
531 # @ingroup l1_geomBuilder_auxiliary
532 kind = GEOM.GEOM_IKindOfShape
539 #print "==== __new__ ", engine, geom, doLcc, created
541 # geom engine is either retrieved from engine, or created
543 # Following test avoids a recursive loop
546 # geom engine not created: existing engine found
548 if doLcc and not created:
550 # FindOrLoadComponent called:
551 # 1. CORBA resolution of server
552 # 2. the __new__ method is called again
553 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
554 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
557 # FindOrLoadComponent not called
559 # geomBuilder instance is created from lcc.FindOrLoadComponent
560 #print "==== super ", engine, geom, doLcc, created
561 geom = super(geomBuilder,cls).__new__(cls)
564 # geom engine not created: existing engine found
565 #print "==== existing ", engine, geom, doLcc, created
567 #print "return geom 1 ", geom
570 #print "return geom 2 ", geom
575 #print "-------- geomBuilder __init__ --- ", created, self
578 GEOM._objref_GEOM_Gen.__init__(self)
579 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
580 self.myBuilder = None
600 ## Process object publication in the study, as follows:
601 # - if @a theName is specified (not None), the object is published in the study
602 # with this name, not taking into account "auto-publishing" option;
603 # - if @a theName is NOT specified, the object is published in the study
604 # (using default name, which can be customized using @a theDefaultName parameter)
605 # only if auto-publishing is switched on.
607 # @param theObj object, a subject for publishing
608 # @param theName object name for study
609 # @param theDefaultName default name for the auto-publishing
611 # @sa addToStudyAuto()
612 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
614 def _item_name(_names, _defname, _idx=-1):
615 if not _names: _names = _defname
616 if type(_names) in [types.ListType, types.TupleType]:
618 if _idx >= len(_names) or not _names[_idx]:
619 if type(_defname) not in [types.ListType, types.TupleType]:
620 _name = "%s_%d"%(_defname, _idx+1)
621 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
622 _name = _defname[_idx]
624 _name = "%noname_%d"%(dn, _idx+1)
630 # must be wrong usage
635 _name = "%s_%d"%(_names, _idx+1)
641 def _publish( _name, _obj ):
643 if isinstance( _obj, GEOM._objref_GEOM_Field ):
644 fatherObj = _obj.GetShape()
645 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
646 fatherObj = _obj.GetField()
647 elif not _obj.IsMainShape():
648 fatherObj = _obj.GetMainShape()
650 if fatherObj and fatherObj.GetStudyEntry():
651 self.addToStudyInFather(fatherObj, _obj, _name)
653 self.addToStudy(_obj, _name)
659 if not theName and not self.myMaxNbSubShapesAllowed:
660 return # nothing to do: auto-publishing is disabled
661 if not theName and not theDefaultName:
662 return # neither theName nor theDefaultName is given
664 if type(theObj) in [types.ListType, types.TupleType]:
665 # list of objects is being published
668 if not obj: continue # bad object
669 name = _item_name(theName, theDefaultName, idx)
670 _publish( name, obj )
672 if not theName and idx == self.myMaxNbSubShapesAllowed: break
676 # single object is published
677 name = _item_name(theName, theDefaultName)
678 _publish( name, theObj )
681 ## @addtogroup l1_geomBuilder_auxiliary
683 def init_geom(self,theStudy):
684 self.myStudy = theStudy
685 self.myStudyId = self.myStudy._get_StudyId()
686 self.myBuilder = self.myStudy.NewBuilder()
687 self.father = self.myStudy.FindComponent("GEOM")
688 if self.father is None:
689 self.father = self.myBuilder.NewComponent("GEOM")
690 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
691 FName = A1._narrow(SALOMEDS.AttributeName)
692 FName.SetValue("Geometry")
693 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
694 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
695 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
696 self.myBuilder.DefineComponentInstance(self.father,self)
698 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
699 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
700 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
701 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
702 self.HealOp = self.GetIHealingOperations (self.myStudyId)
703 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
704 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
705 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
706 self.LocalOp = self.GetILocalOperations (self.myStudyId)
707 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
708 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
709 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
710 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
712 # The below line is a right way to map all plugin functions to geomBuilder,
713 # but AdvancedOperations are already mapped, that is why this line is commented
714 # and presents here only as an axample
715 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
717 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
718 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
720 # set GEOM as root in the use case tree
721 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
722 self.myUseCaseBuilder.SetRootCurrent()
723 self.myUseCaseBuilder.Append(self.father)
726 def GetPluginOperations(self, studyID, libraryName):
727 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
729 # bind methods of operations to self
730 methods = op.__class__.__dict__['__methods__']
731 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
732 for meth_name in methods:
733 if not meth_name in avoid_methods: # avoid basic methods
734 function = getattr(op.__class__, meth_name)
735 if callable(function):
736 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
737 self.__dict__[meth_name] = PluginOperation(op, function)
740 ## Enable / disable results auto-publishing
742 # The automatic publishing is managed in the following way:
743 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
744 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
745 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
746 # value passed as parameter has the same effect.
747 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
748 # maximum number of sub-shapes allowed for publishing is set to specified value.
750 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
751 # @ingroup l1_publish_data
752 def addToStudyAuto(self, maxNbSubShapes=-1):
754 Enable / disable results auto-publishing
756 The automatic publishing is managed in the following way:
757 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
758 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
759 maximum number of sub-shapes allowed for publishing is unlimited; any negative
760 value passed as parameter has the same effect.
761 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
762 maximum number of sub-shapes allowed for publishing is set to this value.
765 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
768 geompy.addToStudyAuto() # enable auto-publishing
769 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
770 geompy.addToStudyAuto(0) # disable auto-publishing
772 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
775 ## Dump component to the Python script
776 # This method overrides IDL function to allow default values for the parameters.
777 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
779 Dump component to the Python script
780 This method overrides IDL function to allow default values for the parameters.
782 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
784 ## Get name for sub-shape aSubObj of shape aMainObj
786 # @ref swig_SubShapeName "Example"
787 def SubShapeName(self,aSubObj, aMainObj):
789 Get name for sub-shape aSubObj of shape aMainObj
791 # Example: see GEOM_TestAll.py
793 #aSubId = orb.object_to_string(aSubObj)
794 #aMainId = orb.object_to_string(aMainObj)
795 #index = gg.getIndexTopology(aSubId, aMainId)
796 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
797 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
798 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
801 ## Publish in study aShape with name aName
803 # \param aShape the shape to be published
804 # \param aName the name for the shape
805 # \param doRestoreSubShapes if True, finds and publishes also
806 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
807 # and published sub-shapes of arguments
808 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
809 # these arguments description
810 # \return study entry of the published shape in form of string
812 # @ingroup l1_publish_data
813 # @ref swig_all_addtostudy "Example"
814 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
815 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
817 Publish in study aShape with name aName
820 aShape the shape to be published
821 aName the name for the shape
822 doRestoreSubShapes if True, finds and publishes also
823 sub-shapes of aShape, corresponding to its arguments
824 and published sub-shapes of arguments
825 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
826 these arguments description
829 study entry of the published shape in form of string
832 id_block1 = geompy.addToStudy(Block1, "Block 1")
834 # Example: see GEOM_TestAll.py
836 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
837 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
838 if doRestoreSubShapes:
839 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
840 theFindMethod, theInheritFirstArg, True )
842 print "addToStudy() failed"
844 return aShape.GetStudyEntry()
846 ## Publish in study aShape with name aName as sub-object of previously published aFather
847 # \param aFather previously published object
848 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
849 # \param aName the name for the shape
851 # \return study entry of the published shape in form of string
853 # @ingroup l1_publish_data
854 # @ref swig_all_addtostudyInFather "Example"
855 def addToStudyInFather(self, aFather, aShape, aName):
857 Publish in study aShape with name aName as sub-object of previously published aFather
860 aFather previously published object
861 aShape the shape to be published as sub-object of aFather
862 aName the name for the shape
865 study entry of the published shape in form of string
867 # Example: see GEOM_TestAll.py
869 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
870 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
872 print "addToStudyInFather() failed"
874 return aShape.GetStudyEntry()
876 ## Unpublish object in study
878 # \param obj the object to be unpublished
879 def hideInStudy(self, obj):
881 Unpublish object in study
884 obj the object to be unpublished
886 ior = salome.orb.object_to_string(obj)
887 aSObject = self.myStudy.FindObjectIOR(ior)
888 if aSObject is not None:
889 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
890 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
891 drwAttribute.SetDrawable(False)
894 # end of l1_geomBuilder_auxiliary
897 ## @addtogroup l3_restore_ss
900 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
901 # To be used from python scripts out of addToStudy() (non-default usage)
902 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
903 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
904 # If this list is empty, all operation arguments will be published
905 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
906 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
907 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
908 # Do not publish sub-shapes in place of arguments, but only
909 # in place of sub-shapes of the first argument,
910 # because the whole shape corresponds to the first argument.
911 # Mainly to be used after transformations, but it also can be
912 # usefull after partition with one object shape, and some other
913 # operations, where only the first argument has to be considered.
914 # If theObject has only one argument shape, this flag is automatically
915 # considered as True, not regarding really passed value.
916 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
917 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
918 # \return list of published sub-shapes
920 # @ref tui_restore_prs_params "Example"
921 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
922 theInheritFirstArg=False, theAddPrefix=True):
924 Publish sub-shapes, standing for arguments and sub-shapes of arguments
925 To be used from python scripts out of geompy.addToStudy (non-default usage)
928 theObject published GEOM.GEOM_Object, arguments of which will be published
929 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
930 If this list is empty, all operation arguments will be published
931 theFindMethod method to search sub-shapes, corresponding to arguments and
932 their sub-shapes. Value from enumeration GEOM.find_shape_method.
933 theInheritFirstArg set properties of the first argument for theObject.
934 Do not publish sub-shapes in place of arguments, but only
935 in place of sub-shapes of the first argument,
936 because the whole shape corresponds to the first argument.
937 Mainly to be used after transformations, but it also can be
938 usefull after partition with one object shape, and some other
939 operations, where only the first argument has to be considered.
940 If theObject has only one argument shape, this flag is automatically
941 considered as True, not regarding really passed value.
942 theAddPrefix add prefix "from_" to names of restored sub-shapes,
943 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
945 list of published sub-shapes
947 # Example: see GEOM_TestAll.py
948 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
949 theFindMethod, theInheritFirstArg, theAddPrefix)
951 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
952 # To be used from python scripts out of addToStudy() (non-default usage)
953 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
954 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
955 # If this list is empty, all operation arguments will be published
956 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
957 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
958 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
959 # Do not publish sub-shapes in place of arguments, but only
960 # in place of sub-shapes of the first argument,
961 # because the whole shape corresponds to the first argument.
962 # Mainly to be used after transformations, but it also can be
963 # usefull after partition with one object shape, and some other
964 # operations, where only the first argument has to be considered.
965 # If theObject has only one argument shape, this flag is automatically
966 # considered as True, not regarding really passed value.
967 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
968 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
969 # \return list of published sub-shapes
971 # @ref tui_restore_prs_params "Example"
972 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
973 theInheritFirstArg=False, theAddPrefix=True):
975 Publish sub-shapes, standing for arguments and sub-shapes of arguments
976 To be used from python scripts out of geompy.addToStudy() (non-default usage)
979 theObject published GEOM.GEOM_Object, arguments of which will be published
980 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
981 If this list is empty, all operation arguments will be published
982 theFindMethod method to search sub-shapes, corresponding to arguments and
983 their sub-shapes. Value from enumeration GEOM::find_shape_method.
984 theInheritFirstArg set properties of the first argument for theObject.
985 Do not publish sub-shapes in place of arguments, but only
986 in place of sub-shapes of the first argument,
987 because the whole shape corresponds to the first argument.
988 Mainly to be used after transformations, but it also can be
989 usefull after partition with one object shape, and some other
990 operations, where only the first argument has to be considered.
991 If theObject has only one argument shape, this flag is automatically
992 considered as True, not regarding really passed value.
993 theAddPrefix add prefix "from_" to names of restored sub-shapes,
994 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
997 list of published sub-shapes
999 # Example: see GEOM_TestAll.py
1000 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1001 theFindMethod, theInheritFirstArg, theAddPrefix)
1003 # end of l3_restore_ss
1006 ## @addtogroup l3_basic_go
1009 ## Create point by three coordinates.
1010 # @param theX The X coordinate of the point.
1011 # @param theY The Y coordinate of the point.
1012 # @param theZ The Z coordinate of the point.
1013 # @param theName Object name; when specified, this parameter is used
1014 # for result publication in the study. Otherwise, if automatic
1015 # publication is switched on, default value is used for result name.
1017 # @return New GEOM.GEOM_Object, containing the created point.
1019 # @ref tui_creation_point "Example"
1020 def MakeVertex(self, theX, theY, theZ, theName=None):
1022 Create point by three coordinates.
1025 theX The X coordinate of the point.
1026 theY The Y coordinate of the point.
1027 theZ The Z coordinate of the point.
1028 theName Object name; when specified, this parameter is used
1029 for result publication in the study. Otherwise, if automatic
1030 publication is switched on, default value is used for result name.
1033 New GEOM.GEOM_Object, containing the created point.
1035 # Example: see GEOM_TestAll.py
1036 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1037 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1038 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1039 anObj.SetParameters(Parameters)
1040 self._autoPublish(anObj, theName, "vertex")
1043 ## Create a point, distant from the referenced point
1044 # on the given distances along the coordinate axes.
1045 # @param theReference The referenced point.
1046 # @param theX Displacement from the referenced point along OX axis.
1047 # @param theY Displacement from the referenced point along OY axis.
1048 # @param theZ Displacement from the referenced point along OZ axis.
1049 # @param theName Object name; when specified, this parameter is used
1050 # for result publication in the study. Otherwise, if automatic
1051 # publication is switched on, default value is used for result name.
1053 # @return New GEOM.GEOM_Object, containing the created point.
1055 # @ref tui_creation_point "Example"
1056 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1058 Create a point, distant from the referenced point
1059 on the given distances along the coordinate axes.
1062 theReference The referenced point.
1063 theX Displacement from the referenced point along OX axis.
1064 theY Displacement from the referenced point along OY axis.
1065 theZ Displacement from the referenced point along OZ axis.
1066 theName Object name; when specified, this parameter is used
1067 for result publication in the study. Otherwise, if automatic
1068 publication is switched on, default value is used for result name.
1071 New GEOM.GEOM_Object, containing the created point.
1073 # Example: see GEOM_TestAll.py
1074 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1075 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1076 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1077 anObj.SetParameters(Parameters)
1078 self._autoPublish(anObj, theName, "vertex")
1081 ## Create a point, corresponding to the given parameter on the given curve.
1082 # @param theRefCurve The referenced curve.
1083 # @param theParameter Value of parameter on the referenced curve.
1084 # @param theName Object name; when specified, this parameter is used
1085 # for result publication in the study. Otherwise, if automatic
1086 # publication is switched on, default value is used for result name.
1088 # @return New GEOM.GEOM_Object, containing the created point.
1090 # @ref tui_creation_point "Example"
1091 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1093 Create a point, corresponding to the given parameter on the given curve.
1096 theRefCurve The referenced curve.
1097 theParameter Value of parameter on the referenced curve.
1098 theName Object name; when specified, this parameter is used
1099 for result publication in the study. Otherwise, if automatic
1100 publication is switched on, default value is used for result name.
1103 New GEOM.GEOM_Object, containing the created point.
1106 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1108 # Example: see GEOM_TestAll.py
1109 theParameter, Parameters = ParseParameters(theParameter)
1110 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1111 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1112 anObj.SetParameters(Parameters)
1113 self._autoPublish(anObj, theName, "vertex")
1116 ## Create a point by projection give coordinates on the given curve
1117 # @param theRefCurve The referenced curve.
1118 # @param theX X-coordinate in 3D space
1119 # @param theY Y-coordinate in 3D space
1120 # @param theZ Z-coordinate in 3D space
1121 # @param theName Object name; when specified, this parameter is used
1122 # for result publication in the study. Otherwise, if automatic
1123 # publication is switched on, default value is used for result name.
1125 # @return New GEOM.GEOM_Object, containing the created point.
1127 # @ref tui_creation_point "Example"
1128 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1130 Create a point by projection give coordinates on the given curve
1133 theRefCurve The referenced curve.
1134 theX X-coordinate in 3D space
1135 theY Y-coordinate in 3D space
1136 theZ Z-coordinate in 3D space
1137 theName Object name; when specified, this parameter is used
1138 for result publication in the study. Otherwise, if automatic
1139 publication is switched on, default value is used for result name.
1142 New GEOM.GEOM_Object, containing the created point.
1145 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1147 # Example: see GEOM_TestAll.py
1148 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1149 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1150 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1151 anObj.SetParameters(Parameters)
1152 self._autoPublish(anObj, theName, "vertex")
1155 ## Create a point, corresponding to the given length on the given curve.
1156 # @param theRefCurve The referenced curve.
1157 # @param theLength Length on the referenced curve. It can be negative.
1158 # @param theStartPoint Point allowing to choose the direction for the calculation
1159 # of the length. If None, start from the first point of theRefCurve.
1160 # @param theName Object name; when specified, this parameter is used
1161 # for result publication in the study. Otherwise, if automatic
1162 # publication is switched on, default value is used for result name.
1164 # @return New GEOM.GEOM_Object, containing the created point.
1166 # @ref tui_creation_point "Example"
1167 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1169 Create a point, corresponding to the given length on the given curve.
1172 theRefCurve The referenced curve.
1173 theLength Length on the referenced curve. It can be negative.
1174 theStartPoint Point allowing to choose the direction for the calculation
1175 of the length. If None, start from the first point of theRefCurve.
1176 theName Object name; when specified, this parameter is used
1177 for result publication in the study. Otherwise, if automatic
1178 publication is switched on, default value is used for result name.
1181 New GEOM.GEOM_Object, containing the created point.
1183 # Example: see GEOM_TestAll.py
1184 theLength, Parameters = ParseParameters(theLength)
1185 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1186 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1187 anObj.SetParameters(Parameters)
1188 self._autoPublish(anObj, theName, "vertex")
1191 ## Create a point, corresponding to the given parameters on the
1193 # @param theRefSurf The referenced surface.
1194 # @param theUParameter Value of U-parameter on the referenced surface.
1195 # @param theVParameter Value of V-parameter on the referenced surface.
1196 # @param theName Object name; when specified, this parameter is used
1197 # for result publication in the study. Otherwise, if automatic
1198 # publication is switched on, default value is used for result name.
1200 # @return New GEOM.GEOM_Object, containing the created point.
1202 # @ref swig_MakeVertexOnSurface "Example"
1203 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1205 Create a point, corresponding to the given parameters on the
1209 theRefSurf The referenced surface.
1210 theUParameter Value of U-parameter on the referenced surface.
1211 theVParameter Value of V-parameter on the referenced surface.
1212 theName Object name; when specified, this parameter is used
1213 for result publication in the study. Otherwise, if automatic
1214 publication is switched on, default value is used for result name.
1217 New GEOM.GEOM_Object, containing the created point.
1220 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1222 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1223 # Example: see GEOM_TestAll.py
1224 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1225 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1226 anObj.SetParameters(Parameters);
1227 self._autoPublish(anObj, theName, "vertex")
1230 ## Create a point by projection give coordinates on the given surface
1231 # @param theRefSurf The referenced surface.
1232 # @param theX X-coordinate in 3D space
1233 # @param theY Y-coordinate in 3D space
1234 # @param theZ Z-coordinate in 3D space
1235 # @param theName Object name; when specified, this parameter is used
1236 # for result publication in the study. Otherwise, if automatic
1237 # publication is switched on, default value is used for result name.
1239 # @return New GEOM.GEOM_Object, containing the created point.
1241 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1242 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1244 Create a point by projection give coordinates on the given surface
1247 theRefSurf The referenced surface.
1248 theX X-coordinate in 3D space
1249 theY Y-coordinate in 3D space
1250 theZ Z-coordinate in 3D space
1251 theName Object name; when specified, this parameter is used
1252 for result publication in the study. Otherwise, if automatic
1253 publication is switched on, default value is used for result name.
1256 New GEOM.GEOM_Object, containing the created point.
1259 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1261 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1262 # Example: see GEOM_TestAll.py
1263 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1264 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1265 anObj.SetParameters(Parameters);
1266 self._autoPublish(anObj, theName, "vertex")
1269 ## Create a point, which lays on the given face.
1270 # The point will lay in arbitrary place of the face.
1271 # The only condition on it is a non-zero distance to the face boundary.
1272 # Such point can be used to uniquely identify the face inside any
1273 # shape in case, when the shape does not contain overlapped faces.
1274 # @param theFace The referenced face.
1275 # @param theName Object name; when specified, this parameter is used
1276 # for result publication in the study. Otherwise, if automatic
1277 # publication is switched on, default value is used for result name.
1279 # @return New GEOM.GEOM_Object, containing the created point.
1281 # @ref swig_MakeVertexInsideFace "Example"
1282 def MakeVertexInsideFace (self, theFace, theName=None):
1284 Create a point, which lays on the given face.
1285 The point will lay in arbitrary place of the face.
1286 The only condition on it is a non-zero distance to the face boundary.
1287 Such point can be used to uniquely identify the face inside any
1288 shape in case, when the shape does not contain overlapped faces.
1291 theFace The referenced face.
1292 theName Object name; when specified, this parameter is used
1293 for result publication in the study. Otherwise, if automatic
1294 publication is switched on, default value is used for result name.
1297 New GEOM.GEOM_Object, containing the created point.
1300 p_on_face = geompy.MakeVertexInsideFace(Face)
1302 # Example: see GEOM_TestAll.py
1303 anObj = self.BasicOp.MakePointOnFace(theFace)
1304 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1305 self._autoPublish(anObj, theName, "vertex")
1308 ## Create a point on intersection of two lines.
1309 # @param theRefLine1, theRefLine2 The referenced lines.
1310 # @param theName Object name; when specified, this parameter is used
1311 # for result publication in the study. Otherwise, if automatic
1312 # publication is switched on, default value is used for result name.
1314 # @return New GEOM.GEOM_Object, containing the created point.
1316 # @ref swig_MakeVertexOnLinesIntersection "Example"
1317 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1319 Create a point on intersection of two lines.
1322 theRefLine1, theRefLine2 The referenced lines.
1323 theName Object name; when specified, this parameter is used
1324 for result publication in the study. Otherwise, if automatic
1325 publication is switched on, default value is used for result name.
1328 New GEOM.GEOM_Object, containing the created point.
1330 # Example: see GEOM_TestAll.py
1331 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1332 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1333 self._autoPublish(anObj, theName, "vertex")
1336 ## Create a tangent, corresponding to the given parameter on the given curve.
1337 # @param theRefCurve The referenced curve.
1338 # @param theParameter Value of parameter on the referenced curve.
1339 # @param theName Object name; when specified, this parameter is used
1340 # for result publication in the study. Otherwise, if automatic
1341 # publication is switched on, default value is used for result name.
1343 # @return New GEOM.GEOM_Object, containing the created tangent.
1345 # @ref swig_MakeTangentOnCurve "Example"
1346 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1348 Create a tangent, corresponding to the given parameter on the given curve.
1351 theRefCurve The referenced curve.
1352 theParameter Value of parameter on the referenced curve.
1353 theName Object name; when specified, this parameter is used
1354 for result publication in the study. Otherwise, if automatic
1355 publication is switched on, default value is used for result name.
1358 New GEOM.GEOM_Object, containing the created tangent.
1361 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1363 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1364 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1365 self._autoPublish(anObj, theName, "tangent")
1368 ## Create a tangent plane, corresponding to the given parameter on the given face.
1369 # @param theFace The face for which tangent plane should be built.
1370 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1371 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1372 # @param theTrimSize the size of plane.
1373 # @param theName Object name; when specified, this parameter is used
1374 # for result publication in the study. Otherwise, if automatic
1375 # publication is switched on, default value is used for result name.
1377 # @return New GEOM.GEOM_Object, containing the created tangent.
1379 # @ref swig_MakeTangentPlaneOnFace "Example"
1380 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1382 Create a tangent plane, corresponding to the given parameter on the given face.
1385 theFace The face for which tangent plane should be built.
1386 theParameterV vertical value of the center point (0.0 - 1.0).
1387 theParameterU horisontal value of the center point (0.0 - 1.0).
1388 theTrimSize the size of plane.
1389 theName Object name; when specified, this parameter is used
1390 for result publication in the study. Otherwise, if automatic
1391 publication is switched on, default value is used for result name.
1394 New GEOM.GEOM_Object, containing the created tangent.
1397 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1399 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1400 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1401 self._autoPublish(anObj, theName, "tangent")
1404 ## Create a vector with the given components.
1405 # @param theDX X component of the vector.
1406 # @param theDY Y component of the vector.
1407 # @param theDZ Z component of the vector.
1408 # @param theName Object name; when specified, this parameter is used
1409 # for result publication in the study. Otherwise, if automatic
1410 # publication is switched on, default value is used for result name.
1412 # @return New GEOM.GEOM_Object, containing the created vector.
1414 # @ref tui_creation_vector "Example"
1415 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1417 Create a vector with the given components.
1420 theDX X component of the vector.
1421 theDY Y component of the vector.
1422 theDZ Z component of the vector.
1423 theName Object name; when specified, this parameter is used
1424 for result publication in the study. Otherwise, if automatic
1425 publication is switched on, default value is used for result name.
1428 New GEOM.GEOM_Object, containing the created vector.
1430 # Example: see GEOM_TestAll.py
1431 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1432 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1433 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1434 anObj.SetParameters(Parameters)
1435 self._autoPublish(anObj, theName, "vector")
1438 ## Create a vector between two points.
1439 # @param thePnt1 Start point for the vector.
1440 # @param thePnt2 End point for the vector.
1441 # @param theName Object name; when specified, this parameter is used
1442 # for result publication in the study. Otherwise, if automatic
1443 # publication is switched on, default value is used for result name.
1445 # @return New GEOM.GEOM_Object, containing the created vector.
1447 # @ref tui_creation_vector "Example"
1448 def MakeVector(self, thePnt1, thePnt2, theName=None):
1450 Create a vector between two points.
1453 thePnt1 Start point for the vector.
1454 thePnt2 End point for the vector.
1455 theName Object name; when specified, this parameter is used
1456 for result publication in the study. Otherwise, if automatic
1457 publication is switched on, default value is used for result name.
1460 New GEOM.GEOM_Object, containing the created vector.
1462 # Example: see GEOM_TestAll.py
1463 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1464 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1465 self._autoPublish(anObj, theName, "vector")
1468 ## Create a line, passing through the given point
1469 # and parrallel to the given direction
1470 # @param thePnt Point. The resulting line will pass through it.
1471 # @param theDir Direction. The resulting line will be parallel to it.
1472 # @param theName Object name; when specified, this parameter is used
1473 # for result publication in the study. Otherwise, if automatic
1474 # publication is switched on, default value is used for result name.
1476 # @return New GEOM.GEOM_Object, containing the created line.
1478 # @ref tui_creation_line "Example"
1479 def MakeLine(self, thePnt, theDir, theName=None):
1481 Create a line, passing through the given point
1482 and parrallel to the given direction
1485 thePnt Point. The resulting line will pass through it.
1486 theDir Direction. The resulting line will be parallel to it.
1487 theName Object name; when specified, this parameter is used
1488 for result publication in the study. Otherwise, if automatic
1489 publication is switched on, default value is used for result name.
1492 New GEOM.GEOM_Object, containing the created line.
1494 # Example: see GEOM_TestAll.py
1495 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1496 RaiseIfFailed("MakeLine", self.BasicOp)
1497 self._autoPublish(anObj, theName, "line")
1500 ## Create a line, passing through the given points
1501 # @param thePnt1 First of two points, defining the line.
1502 # @param thePnt2 Second of two points, defining the line.
1503 # @param theName Object name; when specified, this parameter is used
1504 # for result publication in the study. Otherwise, if automatic
1505 # publication is switched on, default value is used for result name.
1507 # @return New GEOM.GEOM_Object, containing the created line.
1509 # @ref tui_creation_line "Example"
1510 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1512 Create a line, passing through the given points
1515 thePnt1 First of two points, defining the line.
1516 thePnt2 Second of two points, defining the line.
1517 theName Object name; when specified, this parameter is used
1518 for result publication in the study. Otherwise, if automatic
1519 publication is switched on, default value is used for result name.
1522 New GEOM.GEOM_Object, containing the created line.
1524 # Example: see GEOM_TestAll.py
1525 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1526 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1527 self._autoPublish(anObj, theName, "line")
1530 ## Create a line on two faces intersection.
1531 # @param theFace1 First of two faces, defining the line.
1532 # @param theFace2 Second of two faces, defining the line.
1533 # @param theName Object name; when specified, this parameter is used
1534 # for result publication in the study. Otherwise, if automatic
1535 # publication is switched on, default value is used for result name.
1537 # @return New GEOM.GEOM_Object, containing the created line.
1539 # @ref swig_MakeLineTwoFaces "Example"
1540 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1542 Create a line on two faces intersection.
1545 theFace1 First of two faces, defining the line.
1546 theFace2 Second of two faces, defining the line.
1547 theName Object name; when specified, this parameter is used
1548 for result publication in the study. Otherwise, if automatic
1549 publication is switched on, default value is used for result name.
1552 New GEOM.GEOM_Object, containing the created line.
1554 # Example: see GEOM_TestAll.py
1555 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1556 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1557 self._autoPublish(anObj, theName, "line")
1560 ## Create a plane, passing through the given point
1561 # and normal to the given vector.
1562 # @param thePnt Point, the plane has to pass through.
1563 # @param theVec Vector, defining the plane normal direction.
1564 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1565 # @param theName Object name; when specified, this parameter is used
1566 # for result publication in the study. Otherwise, if automatic
1567 # publication is switched on, default value is used for result name.
1569 # @return New GEOM.GEOM_Object, containing the created plane.
1571 # @ref tui_creation_plane "Example"
1572 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1574 Create a plane, passing through the given point
1575 and normal to the given vector.
1578 thePnt Point, the plane has to pass through.
1579 theVec Vector, defining the plane normal direction.
1580 theTrimSize Half size of a side of quadrangle face, representing the plane.
1581 theName Object name; when specified, this parameter is used
1582 for result publication in the study. Otherwise, if automatic
1583 publication is switched on, default value is used for result name.
1586 New GEOM.GEOM_Object, containing the created plane.
1588 # Example: see GEOM_TestAll.py
1589 theTrimSize, Parameters = ParseParameters(theTrimSize);
1590 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1591 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1592 anObj.SetParameters(Parameters)
1593 self._autoPublish(anObj, theName, "plane")
1596 ## Create a plane, passing through the three given points
1597 # @param thePnt1 First of three points, defining the plane.
1598 # @param thePnt2 Second of three points, defining the plane.
1599 # @param thePnt3 Fird of three points, defining the plane.
1600 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1601 # @param theName Object name; when specified, this parameter is used
1602 # for result publication in the study. Otherwise, if automatic
1603 # publication is switched on, default value is used for result name.
1605 # @return New GEOM.GEOM_Object, containing the created plane.
1607 # @ref tui_creation_plane "Example"
1608 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1610 Create a plane, passing through the three given points
1613 thePnt1 First of three points, defining the plane.
1614 thePnt2 Second of three points, defining the plane.
1615 thePnt3 Fird of three points, defining the plane.
1616 theTrimSize Half size of a side of quadrangle face, representing the plane.
1617 theName Object name; when specified, this parameter is used
1618 for result publication in the study. Otherwise, if automatic
1619 publication is switched on, default value is used for result name.
1622 New GEOM.GEOM_Object, containing the created plane.
1624 # Example: see GEOM_TestAll.py
1625 theTrimSize, Parameters = ParseParameters(theTrimSize);
1626 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1627 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1628 anObj.SetParameters(Parameters)
1629 self._autoPublish(anObj, theName, "plane")
1632 ## Create a plane, similar to the existing one, but with another size of representing face.
1633 # @param theFace Referenced plane or LCS(Marker).
1634 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1635 # @param theName Object name; when specified, this parameter is used
1636 # for result publication in the study. Otherwise, if automatic
1637 # publication is switched on, default value is used for result name.
1639 # @return New GEOM.GEOM_Object, containing the created plane.
1641 # @ref tui_creation_plane "Example"
1642 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1644 Create a plane, similar to the existing one, but with another size of representing face.
1647 theFace Referenced plane or LCS(Marker).
1648 theTrimSize New half size of a side of quadrangle face, representing the plane.
1649 theName Object name; when specified, this parameter is used
1650 for result publication in the study. Otherwise, if automatic
1651 publication is switched on, default value is used for result name.
1654 New GEOM.GEOM_Object, containing the created plane.
1656 # Example: see GEOM_TestAll.py
1657 theTrimSize, Parameters = ParseParameters(theTrimSize);
1658 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1659 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1660 anObj.SetParameters(Parameters)
1661 self._autoPublish(anObj, theName, "plane")
1664 ## Create a plane, passing through the 2 vectors
1665 # with center in a start point of the first vector.
1666 # @param theVec1 Vector, defining center point and plane direction.
1667 # @param theVec2 Vector, defining the plane normal direction.
1668 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1669 # @param theName Object name; when specified, this parameter is used
1670 # for result publication in the study. Otherwise, if automatic
1671 # publication is switched on, default value is used for result name.
1673 # @return New GEOM.GEOM_Object, containing the created plane.
1675 # @ref tui_creation_plane "Example"
1676 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1678 Create a plane, passing through the 2 vectors
1679 with center in a start point of the first vector.
1682 theVec1 Vector, defining center point and plane direction.
1683 theVec2 Vector, defining the plane normal direction.
1684 theTrimSize Half size of a side of quadrangle face, representing the plane.
1685 theName Object name; when specified, this parameter is used
1686 for result publication in the study. Otherwise, if automatic
1687 publication is switched on, default value is used for result name.
1690 New GEOM.GEOM_Object, containing the created plane.
1692 # Example: see GEOM_TestAll.py
1693 theTrimSize, Parameters = ParseParameters(theTrimSize);
1694 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1695 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1696 anObj.SetParameters(Parameters)
1697 self._autoPublish(anObj, theName, "plane")
1700 ## Create a plane, based on a Local coordinate system.
1701 # @param theLCS coordinate system, defining plane.
1702 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1703 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1704 # @param theName Object name; when specified, this parameter is used
1705 # for result publication in the study. Otherwise, if automatic
1706 # publication is switched on, default value is used for result name.
1708 # @return New GEOM.GEOM_Object, containing the created plane.
1710 # @ref tui_creation_plane "Example"
1711 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1713 Create a plane, based on a Local coordinate system.
1716 theLCS coordinate system, defining plane.
1717 theTrimSize Half size of a side of quadrangle face, representing the plane.
1718 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1719 theName Object name; when specified, this parameter is used
1720 for result publication in the study. Otherwise, if automatic
1721 publication is switched on, default value is used for result name.
1724 New GEOM.GEOM_Object, containing the created plane.
1726 # Example: see GEOM_TestAll.py
1727 theTrimSize, Parameters = ParseParameters(theTrimSize);
1728 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1729 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1730 anObj.SetParameters(Parameters)
1731 self._autoPublish(anObj, theName, "plane")
1734 ## Create a local coordinate system.
1735 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1736 # @param XDX,XDY,XDZ Three components of OX direction
1737 # @param YDX,YDY,YDZ Three components of OY direction
1738 # @param theName Object name; when specified, this parameter is used
1739 # for result publication in the study. Otherwise, if automatic
1740 # publication is switched on, default value is used for result name.
1742 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1744 # @ref swig_MakeMarker "Example"
1745 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1747 Create a local coordinate system.
1750 OX,OY,OZ Three coordinates of coordinate system origin.
1751 XDX,XDY,XDZ Three components of OX direction
1752 YDX,YDY,YDZ Three components of OY direction
1753 theName Object name; when specified, this parameter is used
1754 for result publication in the study. Otherwise, if automatic
1755 publication is switched on, default value is used for result name.
1758 New GEOM.GEOM_Object, containing the created coordinate system.
1760 # Example: see GEOM_TestAll.py
1761 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1762 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1763 RaiseIfFailed("MakeMarker", self.BasicOp)
1764 anObj.SetParameters(Parameters)
1765 self._autoPublish(anObj, theName, "lcs")
1768 ## Create a local coordinate system from shape.
1769 # @param theShape The initial shape to detect the coordinate system.
1770 # @param theName Object name; when specified, this parameter is used
1771 # for result publication in the study. Otherwise, if automatic
1772 # publication is switched on, default value is used for result name.
1774 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1776 # @ref tui_creation_lcs "Example"
1777 def MakeMarkerFromShape(self, theShape, theName=None):
1779 Create a local coordinate system from shape.
1782 theShape The initial shape to detect the coordinate system.
1783 theName Object name; when specified, this parameter is used
1784 for result publication in the study. Otherwise, if automatic
1785 publication is switched on, default value is used for result name.
1788 New GEOM.GEOM_Object, containing the created coordinate system.
1790 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1791 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1792 self._autoPublish(anObj, theName, "lcs")
1795 ## Create a local coordinate system from point and two vectors.
1796 # @param theOrigin Point of coordinate system origin.
1797 # @param theXVec Vector of X direction
1798 # @param theYVec Vector of Y direction
1799 # @param theName Object name; when specified, this parameter is used
1800 # for result publication in the study. Otherwise, if automatic
1801 # publication is switched on, default value is used for result name.
1803 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1805 # @ref tui_creation_lcs "Example"
1806 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1808 Create a local coordinate system from point and two vectors.
1811 theOrigin Point of coordinate system origin.
1812 theXVec Vector of X direction
1813 theYVec Vector of Y direction
1814 theName Object name; when specified, this parameter is used
1815 for result publication in the study. Otherwise, if automatic
1816 publication is switched on, default value is used for result name.
1819 New GEOM.GEOM_Object, containing the created coordinate system.
1822 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1823 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1824 self._autoPublish(anObj, theName, "lcs")
1827 # end of l3_basic_go
1830 ## @addtogroup l4_curves
1833 ## Create an arc of circle, passing through three given points.
1834 # @param thePnt1 Start point of the arc.
1835 # @param thePnt2 Middle point of the arc.
1836 # @param thePnt3 End point of the arc.
1837 # @param theName Object name; when specified, this parameter is used
1838 # for result publication in the study. Otherwise, if automatic
1839 # publication is switched on, default value is used for result name.
1841 # @return New GEOM.GEOM_Object, containing the created arc.
1843 # @ref swig_MakeArc "Example"
1844 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1846 Create an arc of circle, passing through three given points.
1849 thePnt1 Start point of the arc.
1850 thePnt2 Middle point of the arc.
1851 thePnt3 End point of the arc.
1852 theName Object name; when specified, this parameter is used
1853 for result publication in the study. Otherwise, if automatic
1854 publication is switched on, default value is used for result name.
1857 New GEOM.GEOM_Object, containing the created arc.
1859 # Example: see GEOM_TestAll.py
1860 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1861 RaiseIfFailed("MakeArc", self.CurvesOp)
1862 self._autoPublish(anObj, theName, "arc")
1865 ## Create an arc of circle from a center and 2 points.
1866 # @param thePnt1 Center of the arc
1867 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1868 # @param thePnt3 End point of the arc (Gives also a direction)
1869 # @param theSense Orientation of the arc
1870 # @param theName Object name; when specified, this parameter is used
1871 # for result publication in the study. Otherwise, if automatic
1872 # publication is switched on, default value is used for result name.
1874 # @return New GEOM.GEOM_Object, containing the created arc.
1876 # @ref swig_MakeArc "Example"
1877 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1879 Create an arc of circle from a center and 2 points.
1882 thePnt1 Center of the arc
1883 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1884 thePnt3 End point of the arc (Gives also a direction)
1885 theSense Orientation of the arc
1886 theName Object name; when specified, this parameter is used
1887 for result publication in the study. Otherwise, if automatic
1888 publication is switched on, default value is used for result name.
1891 New GEOM.GEOM_Object, containing the created arc.
1893 # Example: see GEOM_TestAll.py
1894 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1895 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1896 self._autoPublish(anObj, theName, "arc")
1899 ## Create an arc of ellipse, of center and two points.
1900 # @param theCenter Center of the arc.
1901 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1902 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1903 # @param theName Object name; when specified, this parameter is used
1904 # for result publication in the study. Otherwise, if automatic
1905 # publication is switched on, default value is used for result name.
1907 # @return New GEOM.GEOM_Object, containing the created arc.
1909 # @ref swig_MakeArc "Example"
1910 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1912 Create an arc of ellipse, of center and two points.
1915 theCenter Center of the arc.
1916 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1917 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1918 theName Object name; when specified, this parameter is used
1919 for result publication in the study. Otherwise, if automatic
1920 publication is switched on, default value is used for result name.
1923 New GEOM.GEOM_Object, containing the created arc.
1925 # Example: see GEOM_TestAll.py
1926 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1927 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1928 self._autoPublish(anObj, theName, "arc")
1931 ## Create a circle with given center, normal vector and radius.
1932 # @param thePnt Circle center.
1933 # @param theVec Vector, normal to the plane of the circle.
1934 # @param theR Circle radius.
1935 # @param theName Object name; when specified, this parameter is used
1936 # for result publication in the study. Otherwise, if automatic
1937 # publication is switched on, default value is used for result name.
1939 # @return New GEOM.GEOM_Object, containing the created circle.
1941 # @ref tui_creation_circle "Example"
1942 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1944 Create a circle with given center, normal vector and radius.
1947 thePnt Circle center.
1948 theVec Vector, normal to the plane of the circle.
1950 theName Object name; when specified, this parameter is used
1951 for result publication in the study. Otherwise, if automatic
1952 publication is switched on, default value is used for result name.
1955 New GEOM.GEOM_Object, containing the created circle.
1957 # Example: see GEOM_TestAll.py
1958 theR, Parameters = ParseParameters(theR)
1959 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1960 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1961 anObj.SetParameters(Parameters)
1962 self._autoPublish(anObj, theName, "circle")
1965 ## Create a circle with given radius.
1966 # Center of the circle will be in the origin of global
1967 # coordinate system and normal vector will be codirected with Z axis
1968 # @param theR Circle radius.
1969 # @param theName Object name; when specified, this parameter is used
1970 # for result publication in the study. Otherwise, if automatic
1971 # publication is switched on, default value is used for result name.
1973 # @return New GEOM.GEOM_Object, containing the created circle.
1974 def MakeCircleR(self, theR, theName=None):
1976 Create a circle with given radius.
1977 Center of the circle will be in the origin of global
1978 coordinate system and normal vector will be codirected with Z axis
1982 theName Object name; when specified, this parameter is used
1983 for result publication in the study. Otherwise, if automatic
1984 publication is switched on, default value is used for result name.
1987 New GEOM.GEOM_Object, containing the created circle.
1989 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1990 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1991 self._autoPublish(anObj, theName, "circle")
1994 ## Create a circle, passing through three given points
1995 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1996 # @param theName Object name; when specified, this parameter is used
1997 # for result publication in the study. Otherwise, if automatic
1998 # publication is switched on, default value is used for result name.
2000 # @return New GEOM.GEOM_Object, containing the created circle.
2002 # @ref tui_creation_circle "Example"
2003 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2005 Create a circle, passing through three given points
2008 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2009 theName Object name; when specified, this parameter is used
2010 for result publication in the study. Otherwise, if automatic
2011 publication is switched on, default value is used for result name.
2014 New GEOM.GEOM_Object, containing the created circle.
2016 # Example: see GEOM_TestAll.py
2017 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2018 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2019 self._autoPublish(anObj, theName, "circle")
2022 ## Create a circle, with given point1 as center,
2023 # passing through the point2 as radius and laying in the plane,
2024 # defined by all three given points.
2025 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2026 # @param theName Object name; when specified, this parameter is used
2027 # for result publication in the study. Otherwise, if automatic
2028 # publication is switched on, default value is used for result name.
2030 # @return New GEOM.GEOM_Object, containing the created circle.
2032 # @ref swig_MakeCircle "Example"
2033 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2035 Create a circle, with given point1 as center,
2036 passing through the point2 as radius and laying in the plane,
2037 defined by all three given points.
2040 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2041 theName Object name; when specified, this parameter is used
2042 for result publication in the study. Otherwise, if automatic
2043 publication is switched on, default value is used for result name.
2046 New GEOM.GEOM_Object, containing the created circle.
2048 # Example: see GEOM_example6.py
2049 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2050 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2051 self._autoPublish(anObj, theName, "circle")
2054 ## Create an ellipse with given center, normal vector and radiuses.
2055 # @param thePnt Ellipse center.
2056 # @param theVec Vector, normal to the plane of the ellipse.
2057 # @param theRMajor Major ellipse radius.
2058 # @param theRMinor Minor ellipse radius.
2059 # @param theVecMaj Vector, direction of the ellipse's main axis.
2060 # @param theName Object name; when specified, this parameter is used
2061 # for result publication in the study. Otherwise, if automatic
2062 # publication is switched on, default value is used for result name.
2064 # @return New GEOM.GEOM_Object, containing the created ellipse.
2066 # @ref tui_creation_ellipse "Example"
2067 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2069 Create an ellipse with given center, normal vector and radiuses.
2072 thePnt Ellipse center.
2073 theVec Vector, normal to the plane of the ellipse.
2074 theRMajor Major ellipse radius.
2075 theRMinor Minor ellipse radius.
2076 theVecMaj Vector, direction of the ellipse's main axis.
2077 theName Object name; when specified, this parameter is used
2078 for result publication in the study. Otherwise, if automatic
2079 publication is switched on, default value is used for result name.
2082 New GEOM.GEOM_Object, containing the created ellipse.
2084 # Example: see GEOM_TestAll.py
2085 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2086 if theVecMaj is not None:
2087 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2089 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2091 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2092 anObj.SetParameters(Parameters)
2093 self._autoPublish(anObj, theName, "ellipse")
2096 ## Create an ellipse with given radiuses.
2097 # Center of the ellipse will be in the origin of global
2098 # coordinate system and normal vector will be codirected with Z axis
2099 # @param theRMajor Major ellipse radius.
2100 # @param theRMinor Minor ellipse radius.
2101 # @param theName Object name; when specified, this parameter is used
2102 # for result publication in the study. Otherwise, if automatic
2103 # publication is switched on, default value is used for result name.
2105 # @return New GEOM.GEOM_Object, containing the created ellipse.
2106 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2108 Create an ellipse with given radiuses.
2109 Center of the ellipse will be in the origin of global
2110 coordinate system and normal vector will be codirected with Z axis
2113 theRMajor Major ellipse radius.
2114 theRMinor Minor ellipse radius.
2115 theName Object name; when specified, this parameter is used
2116 for result publication in the study. Otherwise, if automatic
2117 publication is switched on, default value is used for result name.
2120 New GEOM.GEOM_Object, containing the created ellipse.
2122 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2123 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2124 self._autoPublish(anObj, theName, "ellipse")
2127 ## Create a polyline on the set of points.
2128 # @param thePoints Sequence of points for the polyline.
2129 # @param theIsClosed If True, build a closed wire.
2130 # @param theName Object name; when specified, this parameter is used
2131 # for result publication in the study. Otherwise, if automatic
2132 # publication is switched on, default value is used for result name.
2134 # @return New GEOM.GEOM_Object, containing the created polyline.
2136 # @ref tui_creation_curve "Example"
2137 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2139 Create a polyline on the set of points.
2142 thePoints Sequence of points for the polyline.
2143 theIsClosed If True, build a closed wire.
2144 theName Object name; when specified, this parameter is used
2145 for result publication in the study. Otherwise, if automatic
2146 publication is switched on, default value is used for result name.
2149 New GEOM.GEOM_Object, containing the created polyline.
2151 # Example: see GEOM_TestAll.py
2152 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2153 RaiseIfFailed("MakePolyline", self.CurvesOp)
2154 self._autoPublish(anObj, theName, "polyline")
2157 ## Create bezier curve on the set of points.
2158 # @param thePoints Sequence of points for the bezier curve.
2159 # @param theIsClosed If True, build a closed curve.
2160 # @param theName Object name; when specified, this parameter is used
2161 # for result publication in the study. Otherwise, if automatic
2162 # publication is switched on, default value is used for result name.
2164 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2166 # @ref tui_creation_curve "Example"
2167 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2169 Create bezier curve on the set of points.
2172 thePoints Sequence of points for the bezier curve.
2173 theIsClosed If True, build a closed curve.
2174 theName Object name; when specified, this parameter is used
2175 for result publication in the study. Otherwise, if automatic
2176 publication is switched on, default value is used for result name.
2179 New GEOM.GEOM_Object, containing the created bezier curve.
2181 # Example: see GEOM_TestAll.py
2182 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2183 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2184 self._autoPublish(anObj, theName, "bezier")
2187 ## Create B-Spline curve on the set of points.
2188 # @param thePoints Sequence of points for the B-Spline curve.
2189 # @param theIsClosed If True, build a closed curve.
2190 # @param theDoReordering If TRUE, the algo does not follow the order of
2191 # \a thePoints but searches for the closest vertex.
2192 # @param theName Object name; when specified, this parameter is used
2193 # for result publication in the study. Otherwise, if automatic
2194 # publication is switched on, default value is used for result name.
2196 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2198 # @ref tui_creation_curve "Example"
2199 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2201 Create B-Spline curve on the set of points.
2204 thePoints Sequence of points for the B-Spline curve.
2205 theIsClosed If True, build a closed curve.
2206 theDoReordering If True, the algo does not follow the order of
2207 thePoints but searches for the closest vertex.
2208 theName Object name; when specified, this parameter is used
2209 for result publication in the study. Otherwise, if automatic
2210 publication is switched on, default value is used for result name.
2213 New GEOM.GEOM_Object, containing the created B-Spline curve.
2215 # Example: see GEOM_TestAll.py
2216 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2217 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2218 self._autoPublish(anObj, theName, "bspline")
2221 ## Create B-Spline curve on the set of points.
2222 # @param thePoints Sequence of points for the B-Spline curve.
2223 # @param theFirstVec Vector object, defining the curve direction at its first point.
2224 # @param theLastVec Vector object, defining the curve direction at its last point.
2225 # @param theName Object name; when specified, this parameter is used
2226 # for result publication in the study. Otherwise, if automatic
2227 # publication is switched on, default value is used for result name.
2229 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2231 # @ref tui_creation_curve "Example"
2232 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2234 Create B-Spline curve on the set of points.
2237 thePoints Sequence of points for the B-Spline curve.
2238 theFirstVec Vector object, defining the curve direction at its first point.
2239 theLastVec Vector object, defining the curve direction at its last point.
2240 theName Object name; when specified, this parameter is used
2241 for result publication in the study. Otherwise, if automatic
2242 publication is switched on, default value is used for result name.
2245 New GEOM.GEOM_Object, containing the created B-Spline curve.
2247 # Example: see GEOM_TestAll.py
2248 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2249 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2250 self._autoPublish(anObj, theName, "bspline")
2253 ## Creates a curve using the parametric definition of the basic points.
2254 # @param thexExpr parametric equation of the coordinates X.
2255 # @param theyExpr parametric equation of the coordinates Y.
2256 # @param thezExpr parametric equation of the coordinates Z.
2257 # @param theParamMin the minimal value of the parameter.
2258 # @param theParamMax the maximum value of the parameter.
2259 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2260 # @param theCurveType the type of the curve,
2261 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2262 # @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.
2263 # @param theName Object name; when specified, this parameter is used
2264 # for result publication in the study. Otherwise, if automatic
2265 # publication is switched on, default value is used for result name.
2267 # @return New GEOM.GEOM_Object, containing the created curve.
2269 # @ref tui_creation_curve "Example"
2270 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2271 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2273 Creates a curve using the parametric definition of the basic points.
2276 thexExpr parametric equation of the coordinates X.
2277 theyExpr parametric equation of the coordinates Y.
2278 thezExpr parametric equation of the coordinates Z.
2279 theParamMin the minimal value of the parameter.
2280 theParamMax the maximum value of the parameter.
2281 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2282 theCurveType the type of the curve,
2283 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2284 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2285 method is used which can lead to a bug.
2286 theName Object name; when specified, this parameter is used
2287 for result publication in the study. Otherwise, if automatic
2288 publication is switched on, default value is used for result name.
2291 New GEOM.GEOM_Object, containing the created curve.
2293 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2295 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2297 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2298 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2299 anObj.SetParameters(Parameters)
2300 self._autoPublish(anObj, theName, "curve")
2303 ## Create an isoline curve on a face.
2304 # @param theFace the face for which an isoline is created.
2305 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2307 # @param theParameter the U parameter for U-isoline or V parameter
2309 # @param theName Object name; when specified, this parameter is used
2310 # for result publication in the study. Otherwise, if automatic
2311 # publication is switched on, default value is used for result name.
2313 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2314 # a compound of edges.
2316 # @ref tui_creation_curve "Example"
2317 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2319 Create an isoline curve on a face.
2322 theFace the face for which an isoline is created.
2323 IsUIsoline True for U-isoline creation; False for V-isoline
2325 theParameter the U parameter for U-isoline or V parameter
2327 theName Object name; when specified, this parameter is used
2328 for result publication in the study. Otherwise, if automatic
2329 publication is switched on, default value is used for result name.
2332 New GEOM.GEOM_Object, containing the created isoline edge or a
2335 # Example: see GEOM_TestAll.py
2336 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2337 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2339 self._autoPublish(anObj, theName, "U-Isoline")
2341 self._autoPublish(anObj, theName, "V-Isoline")
2347 ## @addtogroup l3_sketcher
2350 ## Create a sketcher (wire or face), following the textual description,
2351 # passed through <VAR>theCommand</VAR> argument. \n
2352 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2353 # Format of the description string have to be the following:
2355 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2358 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2360 # - "R angle" : Set the direction by angle
2361 # - "D dx dy" : Set the direction by DX & DY
2364 # - "TT x y" : Create segment by point at X & Y
2365 # - "T dx dy" : Create segment by point with DX & DY
2366 # - "L length" : Create segment by direction & Length
2367 # - "IX x" : Create segment by direction & Intersect. X
2368 # - "IY y" : Create segment by direction & Intersect. Y
2371 # - "C radius length" : Create arc by direction, radius and length(in degree)
2372 # - "AA x y": Create arc by point at X & Y
2373 # - "A dx dy" : Create arc by point with DX & DY
2374 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2375 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2376 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2377 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2380 # - "WW" : Close Wire (to finish)
2381 # - "WF" : Close Wire and build face (to finish)
2384 # - Flag1 (= reverse) is 0 or 2 ...
2385 # - if 0 the drawn arc is the one of lower angle (< Pi)
2386 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2389 # - Flag2 (= control tolerance) is 0 or 1 ...
2390 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2391 # - if 1 the wire is built only if the end point is on the arc
2392 # with a tolerance of 10^-7 on the distance else the creation fails
2394 # @param theCommand String, defining the sketcher in local
2395 # coordinates of the working plane.
2396 # @param theWorkingPlane Nine double values, defining origin,
2397 # OZ and OX directions of the working plane.
2398 # @param theName Object name; when specified, this parameter is used
2399 # for result publication in the study. Otherwise, if automatic
2400 # publication is switched on, default value is used for result name.
2402 # @return New GEOM.GEOM_Object, containing the created wire.
2404 # @ref tui_sketcher_page "Example"
2405 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2407 Create a sketcher (wire or face), following the textual description, passed
2408 through theCommand argument.
2409 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2410 Format of the description string have to be the following:
2411 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2413 - x1, y1 are coordinates of the first sketcher point (zero by default),
2415 - "R angle" : Set the direction by angle
2416 - "D dx dy" : Set the direction by DX & DY
2418 - "TT x y" : Create segment by point at X & Y
2419 - "T dx dy" : Create segment by point with DX & DY
2420 - "L length" : Create segment by direction & Length
2421 - "IX x" : Create segment by direction & Intersect. X
2422 - "IY y" : Create segment by direction & Intersect. Y
2424 - "C radius length" : Create arc by direction, radius and length(in degree)
2425 - "AA x y": Create arc by point at X & Y
2426 - "A dx dy" : Create arc by point with DX & DY
2427 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2428 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2429 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2430 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2432 - "WW" : Close Wire (to finish)
2433 - "WF" : Close Wire and build face (to finish)
2435 - Flag1 (= reverse) is 0 or 2 ...
2436 - if 0 the drawn arc is the one of lower angle (< Pi)
2437 - if 2 the drawn arc ius the one of greater angle (> Pi)
2439 - Flag2 (= control tolerance) is 0 or 1 ...
2440 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2441 - if 1 the wire is built only if the end point is on the arc
2442 with a tolerance of 10^-7 on the distance else the creation fails
2445 theCommand String, defining the sketcher in local
2446 coordinates of the working plane.
2447 theWorkingPlane Nine double values, defining origin,
2448 OZ and OX directions of the working plane.
2449 theName Object name; when specified, this parameter is used
2450 for result publication in the study. Otherwise, if automatic
2451 publication is switched on, default value is used for result name.
2454 New GEOM.GEOM_Object, containing the created wire.
2456 # Example: see GEOM_TestAll.py
2457 theCommand,Parameters = ParseSketcherCommand(theCommand)
2458 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2459 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2460 anObj.SetParameters(Parameters)
2461 self._autoPublish(anObj, theName, "wire")
2464 ## Create a sketcher (wire or face), following the textual description,
2465 # passed through <VAR>theCommand</VAR> argument. \n
2466 # For format of the description string see MakeSketcher() method.\n
2467 # @param theCommand String, defining the sketcher in local
2468 # coordinates of the working plane.
2469 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2470 # @param theName Object name; when specified, this parameter is used
2471 # for result publication in the study. Otherwise, if automatic
2472 # publication is switched on, default value is used for result name.
2474 # @return New GEOM.GEOM_Object, containing the created wire.
2476 # @ref tui_sketcher_page "Example"
2477 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2479 Create a sketcher (wire or face), following the textual description,
2480 passed through theCommand argument.
2481 For format of the description string see geompy.MakeSketcher() method.
2484 theCommand String, defining the sketcher in local
2485 coordinates of the working plane.
2486 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2487 theName Object name; when specified, this parameter is used
2488 for result publication in the study. Otherwise, if automatic
2489 publication is switched on, default value is used for result name.
2492 New GEOM.GEOM_Object, containing the created wire.
2494 theCommand,Parameters = ParseSketcherCommand(theCommand)
2495 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2496 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2497 anObj.SetParameters(Parameters)
2498 self._autoPublish(anObj, theName, "wire")
2501 ## Obtain a 2D sketcher interface
2502 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2503 def Sketcher2D (self):
2505 Obtain a 2D sketcher interface.
2508 sk = geompy.Sketcher2D()
2510 sk.addSegmentRelative(15, 70)
2511 sk.addSegmentPerpY(50)
2512 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2513 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2514 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2516 Sketch_1 = sk.wire(geomObj_1)
2518 sk = Sketcher2D (self)
2521 ## Create a sketcher wire, following the numerical description,
2522 # passed through <VAR>theCoordinates</VAR> argument. \n
2523 # @param theCoordinates double values, defining points to create a wire,
2525 # @param theName Object name; when specified, this parameter is used
2526 # for result publication in the study. Otherwise, if automatic
2527 # publication is switched on, default value is used for result name.
2529 # @return New GEOM.GEOM_Object, containing the created wire.
2531 # @ref tui_3dsketcher_page "Example"
2532 def Make3DSketcher(self, theCoordinates, theName=None):
2534 Create a sketcher wire, following the numerical description,
2535 passed through theCoordinates argument.
2538 theCoordinates double values, defining points to create a wire,
2540 theName Object name; when specified, this parameter is used
2541 for result publication in the study. Otherwise, if automatic
2542 publication is switched on, default value is used for result name.
2545 New GEOM_Object, containing the created wire.
2547 theCoordinates,Parameters = ParseParameters(theCoordinates)
2548 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2549 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2550 anObj.SetParameters(Parameters)
2551 self._autoPublish(anObj, theName, "wire")
2554 ## Obtain a 3D sketcher interface
2555 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2557 # @ref tui_3dsketcher_page "Example"
2558 def Sketcher3D (self):
2560 Obtain a 3D sketcher interface.
2563 sk = geompy.Sketcher3D()
2564 sk.addPointsAbsolute(0,0,0, 70,0,0)
2565 sk.addPointsRelative(0, 0, 130)
2566 sk.addPointAnglesLength("OXY", 50, 0, 100)
2567 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2569 a3D_Sketcher_1 = sk.wire()
2571 sk = Sketcher3D (self)
2574 # end of l3_sketcher
2577 ## @addtogroup l3_3d_primitives
2580 ## Create a box by coordinates of two opposite vertices.
2582 # @param x1,y1,z1 double values, defining first point it.
2583 # @param x2,y2,z2 double values, defining first point it.
2584 # @param theName Object name; when specified, this parameter is used
2585 # for result publication in the study. Otherwise, if automatic
2586 # publication is switched on, default value is used for result name.
2588 # @return New GEOM.GEOM_Object, containing the created box.
2590 # @ref tui_creation_box "Example"
2591 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2593 Create a box by coordinates of two opposite vertices.
2596 x1,y1,z1 double values, defining first point.
2597 x2,y2,z2 double values, defining second point.
2598 theName Object name; when specified, this parameter is used
2599 for result publication in the study. Otherwise, if automatic
2600 publication is switched on, default value is used for result name.
2603 New GEOM.GEOM_Object, containing the created box.
2605 # Example: see GEOM_TestAll.py
2606 pnt1 = self.MakeVertex(x1,y1,z1)
2607 pnt2 = self.MakeVertex(x2,y2,z2)
2608 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2609 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2611 ## Create a box with specified dimensions along the coordinate axes
2612 # and with edges, parallel to the coordinate axes.
2613 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2614 # @param theDX Length of Box edges, parallel to OX axis.
2615 # @param theDY Length of Box edges, parallel to OY axis.
2616 # @param theDZ Length of Box edges, parallel to OZ axis.
2617 # @param theName Object name; when specified, this parameter is used
2618 # for result publication in the study. Otherwise, if automatic
2619 # publication is switched on, default value is used for result name.
2621 # @return New GEOM.GEOM_Object, containing the created box.
2623 # @ref tui_creation_box "Example"
2624 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2626 Create a box with specified dimensions along the coordinate axes
2627 and with edges, parallel to the coordinate axes.
2628 Center of the box will be at point (DX/2, DY/2, DZ/2).
2631 theDX Length of Box edges, parallel to OX axis.
2632 theDY Length of Box edges, parallel to OY axis.
2633 theDZ Length of Box edges, parallel to OZ axis.
2634 theName Object name; when specified, this parameter is used
2635 for result publication in the study. Otherwise, if automatic
2636 publication is switched on, default value is used for result name.
2639 New GEOM.GEOM_Object, containing the created box.
2641 # Example: see GEOM_TestAll.py
2642 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2643 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2644 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2645 anObj.SetParameters(Parameters)
2646 self._autoPublish(anObj, theName, "box")
2649 ## Create a box with two specified opposite vertices,
2650 # and with edges, parallel to the coordinate axes
2651 # @param thePnt1 First of two opposite vertices.
2652 # @param thePnt2 Second of two opposite vertices.
2653 # @param theName Object name; when specified, this parameter is used
2654 # for result publication in the study. Otherwise, if automatic
2655 # publication is switched on, default value is used for result name.
2657 # @return New GEOM.GEOM_Object, containing the created box.
2659 # @ref tui_creation_box "Example"
2660 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2662 Create a box with two specified opposite vertices,
2663 and with edges, parallel to the coordinate axes
2666 thePnt1 First of two opposite vertices.
2667 thePnt2 Second of two opposite vertices.
2668 theName Object name; when specified, this parameter is used
2669 for result publication in the study. Otherwise, if automatic
2670 publication is switched on, default value is used for result name.
2673 New GEOM.GEOM_Object, containing the created box.
2675 # Example: see GEOM_TestAll.py
2676 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2677 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2678 self._autoPublish(anObj, theName, "box")
2681 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2682 # @param theH height of Face.
2683 # @param theW width of Face.
2684 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2685 # @param theName Object name; when specified, this parameter is used
2686 # for result publication in the study. Otherwise, if automatic
2687 # publication is switched on, default value is used for result name.
2689 # @return New GEOM.GEOM_Object, containing the created face.
2691 # @ref tui_creation_face "Example"
2692 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2694 Create a face with specified dimensions with edges parallel to coordinate axes.
2697 theH height of Face.
2699 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2700 theName Object name; when specified, this parameter is used
2701 for result publication in the study. Otherwise, if automatic
2702 publication is switched on, default value is used for result name.
2705 New GEOM.GEOM_Object, containing the created face.
2707 # Example: see GEOM_TestAll.py
2708 theH,theW,Parameters = ParseParameters(theH, theW)
2709 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2710 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2711 anObj.SetParameters(Parameters)
2712 self._autoPublish(anObj, theName, "rectangle")
2715 ## Create a face from another plane and two sizes,
2716 # vertical size and horisontal size.
2717 # @param theObj Normale vector to the creating face or
2719 # @param theH Height (vertical size).
2720 # @param theW Width (horisontal size).
2721 # @param theName Object name; when specified, this parameter is used
2722 # for result publication in the study. Otherwise, if automatic
2723 # publication is switched on, default value is used for result name.
2725 # @return New GEOM.GEOM_Object, containing the created face.
2727 # @ref tui_creation_face "Example"
2728 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2730 Create a face from another plane and two sizes,
2731 vertical size and horisontal size.
2734 theObj Normale vector to the creating face or
2736 theH Height (vertical size).
2737 theW Width (horisontal size).
2738 theName Object name; when specified, this parameter is used
2739 for result publication in the study. Otherwise, if automatic
2740 publication is switched on, default value is used for result name.
2743 New GEOM_Object, containing the created face.
2745 # Example: see GEOM_TestAll.py
2746 theH,theW,Parameters = ParseParameters(theH, theW)
2747 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2748 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2749 anObj.SetParameters(Parameters)
2750 self._autoPublish(anObj, theName, "rectangle")
2753 ## Create a disk with given center, normal vector and radius.
2754 # @param thePnt Disk center.
2755 # @param theVec Vector, normal to the plane of the disk.
2756 # @param theR Disk radius.
2757 # @param 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.
2761 # @return New GEOM.GEOM_Object, containing the created disk.
2763 # @ref tui_creation_disk "Example"
2764 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2766 Create a disk with given center, normal vector and radius.
2770 theVec Vector, normal to the plane of the disk.
2772 theName Object name; when specified, this parameter is used
2773 for result publication in the study. Otherwise, if automatic
2774 publication is switched on, default value is used for result name.
2777 New GEOM.GEOM_Object, containing the created disk.
2779 # Example: see GEOM_TestAll.py
2780 theR,Parameters = ParseParameters(theR)
2781 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2782 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2783 anObj.SetParameters(Parameters)
2784 self._autoPublish(anObj, theName, "disk")
2787 ## Create a disk, passing through three given points
2788 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2789 # @param theName Object name; when specified, this parameter is used
2790 # for result publication in the study. Otherwise, if automatic
2791 # publication is switched on, default value is used for result name.
2793 # @return New GEOM.GEOM_Object, containing the created disk.
2795 # @ref tui_creation_disk "Example"
2796 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2798 Create a disk, passing through three given points
2801 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2802 theName Object name; when specified, this parameter is used
2803 for result publication in the study. Otherwise, if automatic
2804 publication is switched on, default value is used for result name.
2807 New GEOM.GEOM_Object, containing the created disk.
2809 # Example: see GEOM_TestAll.py
2810 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2811 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2812 self._autoPublish(anObj, theName, "disk")
2815 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2816 # @param theR Radius of Face.
2817 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2818 # @param theName Object name; when specified, this parameter is used
2819 # for result publication in the study. Otherwise, if automatic
2820 # publication is switched on, default value is used for result name.
2822 # @return New GEOM.GEOM_Object, containing the created disk.
2824 # @ref tui_creation_face "Example"
2825 def MakeDiskR(self, theR, theOrientation, theName=None):
2827 Create a disk with specified dimensions along OX-OY coordinate axes.
2830 theR Radius of Face.
2831 theOrientation set the orientation belong axis OXY or OYZ or OZX
2832 theName Object name; when specified, this parameter is used
2833 for result publication in the study. Otherwise, if automatic
2834 publication is switched on, default value is used for result name.
2837 New GEOM.GEOM_Object, containing the created disk.
2840 Disk3 = geompy.MakeDiskR(100., 1)
2842 # Example: see GEOM_TestAll.py
2843 theR,Parameters = ParseParameters(theR)
2844 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2845 RaiseIfFailed("MakeDiskR", self.PrimOp)
2846 anObj.SetParameters(Parameters)
2847 self._autoPublish(anObj, theName, "disk")
2850 ## Create a cylinder with given base point, axis, radius and height.
2851 # @param thePnt Central point of cylinder base.
2852 # @param theAxis Cylinder axis.
2853 # @param theR Cylinder radius.
2854 # @param theH Cylinder height.
2855 # @param theName Object name; when specified, this parameter is used
2856 # for result publication in the study. Otherwise, if automatic
2857 # publication is switched on, default value is used for result name.
2859 # @return New GEOM.GEOM_Object, containing the created cylinder.
2861 # @ref tui_creation_cylinder "Example"
2862 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2864 Create a cylinder with given base point, axis, radius and height.
2867 thePnt Central point of cylinder base.
2868 theAxis Cylinder axis.
2869 theR Cylinder radius.
2870 theH Cylinder height.
2871 theName Object name; when specified, this parameter is used
2872 for result publication in the study. Otherwise, if automatic
2873 publication is switched on, default value is used for result name.
2876 New GEOM.GEOM_Object, containing the created cylinder.
2878 # Example: see GEOM_TestAll.py
2879 theR,theH,Parameters = ParseParameters(theR, theH)
2880 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2881 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2882 anObj.SetParameters(Parameters)
2883 self._autoPublish(anObj, theName, "cylinder")
2886 ## Create a cylinder with given radius and height at
2887 # the origin of coordinate system. Axis of the cylinder
2888 # will be collinear to the OZ axis of the coordinate system.
2889 # @param theR Cylinder radius.
2890 # @param theH Cylinder height.
2891 # @param theName Object name; when specified, this parameter is used
2892 # for result publication in the study. Otherwise, if automatic
2893 # publication is switched on, default value is used for result name.
2895 # @return New GEOM.GEOM_Object, containing the created cylinder.
2897 # @ref tui_creation_cylinder "Example"
2898 def MakeCylinderRH(self, theR, theH, theName=None):
2900 Create a cylinder with given radius and height at
2901 the origin of coordinate system. Axis of the cylinder
2902 will be collinear to the OZ axis of the coordinate system.
2905 theR Cylinder radius.
2906 theH Cylinder height.
2907 theName Object name; when specified, this parameter is used
2908 for result publication in the study. Otherwise, if automatic
2909 publication is switched on, default value is used for result name.
2912 New GEOM.GEOM_Object, containing the created cylinder.
2914 # Example: see GEOM_TestAll.py
2915 theR,theH,Parameters = ParseParameters(theR, theH)
2916 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2917 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2918 anObj.SetParameters(Parameters)
2919 self._autoPublish(anObj, theName, "cylinder")
2922 ## Create a sphere with given center and radius.
2923 # @param thePnt Sphere center.
2924 # @param theR Sphere radius.
2925 # @param theName Object name; when specified, this parameter is used
2926 # for result publication in the study. Otherwise, if automatic
2927 # publication is switched on, default value is used for result name.
2929 # @return New GEOM.GEOM_Object, containing the created sphere.
2931 # @ref tui_creation_sphere "Example"
2932 def MakeSpherePntR(self, thePnt, theR, theName=None):
2934 Create a sphere with given center and radius.
2937 thePnt Sphere center.
2939 theName Object name; when specified, this parameter is used
2940 for result publication in the study. Otherwise, if automatic
2941 publication is switched on, default value is used for result name.
2944 New GEOM.GEOM_Object, containing the created sphere.
2946 # Example: see GEOM_TestAll.py
2947 theR,Parameters = ParseParameters(theR)
2948 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2949 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2950 anObj.SetParameters(Parameters)
2951 self._autoPublish(anObj, theName, "sphere")
2954 ## Create a sphere with given center and radius.
2955 # @param x,y,z Coordinates of sphere center.
2956 # @param theR Sphere radius.
2957 # @param theName Object name; when specified, this parameter is used
2958 # for result publication in the study. Otherwise, if automatic
2959 # publication is switched on, default value is used for result name.
2961 # @return New GEOM.GEOM_Object, containing the created sphere.
2963 # @ref tui_creation_sphere "Example"
2964 def MakeSphere(self, x, y, z, theR, theName=None):
2966 Create a sphere with given center and radius.
2969 x,y,z Coordinates of sphere center.
2971 theName Object name; when specified, this parameter is used
2972 for result publication in the study. Otherwise, if automatic
2973 publication is switched on, default value is used for result name.
2976 New GEOM.GEOM_Object, containing the created sphere.
2978 # Example: see GEOM_TestAll.py
2979 point = self.MakeVertex(x, y, z)
2980 # note: auto-publishing is done in self.MakeSpherePntR()
2981 anObj = self.MakeSpherePntR(point, theR, theName)
2984 ## Create a sphere with given radius at the origin of coordinate system.
2985 # @param theR Sphere radius.
2986 # @param theName Object name; when specified, this parameter is used
2987 # for result publication in the study. Otherwise, if automatic
2988 # publication is switched on, default value is used for result name.
2990 # @return New GEOM.GEOM_Object, containing the created sphere.
2992 # @ref tui_creation_sphere "Example"
2993 def MakeSphereR(self, theR, theName=None):
2995 Create a sphere with given radius at the origin of coordinate system.
2999 theName Object name; when specified, this parameter is used
3000 for result publication in the study. Otherwise, if automatic
3001 publication is switched on, default value is used for result name.
3004 New GEOM.GEOM_Object, containing the created sphere.
3006 # Example: see GEOM_TestAll.py
3007 theR,Parameters = ParseParameters(theR)
3008 anObj = self.PrimOp.MakeSphereR(theR)
3009 RaiseIfFailed("MakeSphereR", self.PrimOp)
3010 anObj.SetParameters(Parameters)
3011 self._autoPublish(anObj, theName, "sphere")
3014 ## Create a cone with given base point, axis, height and radiuses.
3015 # @param thePnt Central point of the first cone base.
3016 # @param theAxis Cone axis.
3017 # @param theR1 Radius of the first cone base.
3018 # @param theR2 Radius of the second cone base.
3019 # \note If both radiuses are non-zero, the cone will be truncated.
3020 # \note If the radiuses are equal, a cylinder will be created instead.
3021 # @param theH Cone height.
3022 # @param theName Object name; when specified, this parameter is used
3023 # for result publication in the study. Otherwise, if automatic
3024 # publication is switched on, default value is used for result name.
3026 # @return New GEOM.GEOM_Object, containing the created cone.
3028 # @ref tui_creation_cone "Example"
3029 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3031 Create a cone with given base point, axis, height and radiuses.
3034 thePnt Central point of the first cone base.
3036 theR1 Radius of the first cone base.
3037 theR2 Radius of the second cone base.
3039 theName Object name; when specified, this parameter is used
3040 for result publication in the study. Otherwise, if automatic
3041 publication is switched on, default value is used for result name.
3044 If both radiuses are non-zero, the cone will be truncated.
3045 If the radiuses are equal, a cylinder will be created instead.
3048 New GEOM.GEOM_Object, containing the created cone.
3050 # Example: see GEOM_TestAll.py
3051 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3052 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3053 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3054 anObj.SetParameters(Parameters)
3055 self._autoPublish(anObj, theName, "cone")
3058 ## Create a cone with given height and radiuses at
3059 # the origin of coordinate system. Axis of the cone will
3060 # be collinear to the OZ axis of the coordinate system.
3061 # @param theR1 Radius of the first cone base.
3062 # @param theR2 Radius of the second cone base.
3063 # \note If both radiuses are non-zero, the cone will be truncated.
3064 # \note If the radiuses are equal, a cylinder will be created instead.
3065 # @param theH Cone height.
3066 # @param theName Object name; when specified, this parameter is used
3067 # for result publication in the study. Otherwise, if automatic
3068 # publication is switched on, default value is used for result name.
3070 # @return New GEOM.GEOM_Object, containing the created cone.
3072 # @ref tui_creation_cone "Example"
3073 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3075 Create a cone with given height and radiuses at
3076 the origin of coordinate system. Axis of the cone will
3077 be collinear to the OZ axis of the coordinate system.
3080 theR1 Radius of the first cone base.
3081 theR2 Radius of the second cone base.
3083 theName Object name; when specified, this parameter is used
3084 for result publication in the study. Otherwise, if automatic
3085 publication is switched on, default value is used for result name.
3088 If both radiuses are non-zero, the cone will be truncated.
3089 If the radiuses are equal, a cylinder will be created instead.
3092 New GEOM.GEOM_Object, containing the created cone.
3094 # Example: see GEOM_TestAll.py
3095 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3096 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3097 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3098 anObj.SetParameters(Parameters)
3099 self._autoPublish(anObj, theName, "cone")
3102 ## Create a torus with given center, normal vector and radiuses.
3103 # @param thePnt Torus central point.
3104 # @param theVec Torus axis of symmetry.
3105 # @param theRMajor Torus major radius.
3106 # @param theRMinor Torus minor radius.
3107 # @param theName Object name; when specified, this parameter is used
3108 # for result publication in the study. Otherwise, if automatic
3109 # publication is switched on, default value is used for result name.
3111 # @return New GEOM.GEOM_Object, containing the created torus.
3113 # @ref tui_creation_torus "Example"
3114 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3116 Create a torus with given center, normal vector and radiuses.
3119 thePnt Torus central point.
3120 theVec Torus axis of symmetry.
3121 theRMajor Torus major radius.
3122 theRMinor Torus minor radius.
3123 theName Object name; when specified, this parameter is used
3124 for result publication in the study. Otherwise, if automatic
3125 publication is switched on, default value is used for result name.
3128 New GEOM.GEOM_Object, containing the created torus.
3130 # Example: see GEOM_TestAll.py
3131 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3132 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3133 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3134 anObj.SetParameters(Parameters)
3135 self._autoPublish(anObj, theName, "torus")
3138 ## Create a torus with given radiuses at the origin of coordinate system.
3139 # @param theRMajor Torus major radius.
3140 # @param theRMinor Torus minor radius.
3141 # @param theName Object name; when specified, this parameter is used
3142 # for result publication in the study. Otherwise, if automatic
3143 # publication is switched on, default value is used for result name.
3145 # @return New GEOM.GEOM_Object, containing the created torus.
3147 # @ref tui_creation_torus "Example"
3148 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3150 Create a torus with given radiuses at the origin of coordinate system.
3153 theRMajor Torus major radius.
3154 theRMinor Torus minor radius.
3155 theName Object name; when specified, this parameter is used
3156 for result publication in the study. Otherwise, if automatic
3157 publication is switched on, default value is used for result name.
3160 New GEOM.GEOM_Object, containing the created torus.
3162 # Example: see GEOM_TestAll.py
3163 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3164 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3165 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3166 anObj.SetParameters(Parameters)
3167 self._autoPublish(anObj, theName, "torus")
3170 # end of l3_3d_primitives
3173 ## @addtogroup l3_complex
3176 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3177 # @param theBase Base shape to be extruded.
3178 # @param thePoint1 First end of extrusion vector.
3179 # @param thePoint2 Second end of extrusion vector.
3180 # @param theScaleFactor Use it to make prism with scaled second base.
3181 # Nagative value means not scaled second base.
3182 # @param theName Object name; when specified, this parameter is used
3183 # for result publication in the study. Otherwise, if automatic
3184 # publication is switched on, default value is used for result name.
3186 # @return New GEOM.GEOM_Object, containing the created prism.
3188 # @ref tui_creation_prism "Example"
3189 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3191 Create a shape by extrusion of the base shape along a vector, defined by two points.
3194 theBase Base shape to be extruded.
3195 thePoint1 First end of extrusion vector.
3196 thePoint2 Second end of extrusion vector.
3197 theScaleFactor Use it to make prism with scaled second base.
3198 Nagative value means not scaled second base.
3199 theName Object name; when specified, this parameter is used
3200 for result publication in the study. Otherwise, if automatic
3201 publication is switched on, default value is used for result name.
3204 New GEOM.GEOM_Object, containing the created prism.
3206 # Example: see GEOM_TestAll.py
3209 if theScaleFactor > 0:
3210 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3211 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3213 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3214 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3215 anObj.SetParameters(Parameters)
3216 self._autoPublish(anObj, theName, "prism")
3219 ## Create a shape by extrusion of the base shape along a
3220 # vector, defined by two points, in 2 Ways (forward/backward).
3221 # @param theBase Base shape to be extruded.
3222 # @param thePoint1 First end of extrusion vector.
3223 # @param thePoint2 Second end of extrusion vector.
3224 # @param theName Object name; when specified, this parameter is used
3225 # for result publication in the study. Otherwise, if automatic
3226 # publication is switched on, default value is used for result name.
3228 # @return New GEOM.GEOM_Object, containing the created prism.
3230 # @ref tui_creation_prism "Example"
3231 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3233 Create a shape by extrusion of the base shape along a
3234 vector, defined by two points, in 2 Ways (forward/backward).
3237 theBase Base shape to be extruded.
3238 thePoint1 First end of extrusion vector.
3239 thePoint2 Second end of extrusion vector.
3240 theName Object name; when specified, this parameter is used
3241 for result publication in the study. Otherwise, if automatic
3242 publication is switched on, default value is used for result name.
3245 New GEOM.GEOM_Object, containing the created prism.
3247 # Example: see GEOM_TestAll.py
3248 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3249 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3250 self._autoPublish(anObj, theName, "prism")
3253 ## Create a shape by extrusion of the base shape along the vector,
3254 # i.e. all the space, transfixed by the base shape during its translation
3255 # along the vector on the given distance.
3256 # @param theBase Base shape to be extruded.
3257 # @param theVec Direction of extrusion.
3258 # @param theH Prism dimension along theVec.
3259 # @param theScaleFactor Use it to make prism with scaled second base.
3260 # Negative value means not scaled second base.
3261 # @param theName Object name; when specified, this parameter is used
3262 # for result publication in the study. Otherwise, if automatic
3263 # publication is switched on, default value is used for result name.
3265 # @return New GEOM.GEOM_Object, containing the created prism.
3267 # @ref tui_creation_prism "Example"
3268 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3270 Create a shape by extrusion of the base shape along the vector,
3271 i.e. all the space, transfixed by the base shape during its translation
3272 along the vector on the given distance.
3275 theBase Base shape to be extruded.
3276 theVec Direction of extrusion.
3277 theH Prism dimension along theVec.
3278 theScaleFactor Use it to make prism with scaled second base.
3279 Negative value means not scaled second base.
3280 theName Object name; when specified, this parameter is used
3281 for result publication in the study. Otherwise, if automatic
3282 publication is switched on, default value is used for result name.
3285 New GEOM.GEOM_Object, containing the created prism.
3287 # Example: see GEOM_TestAll.py
3290 if theScaleFactor > 0:
3291 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3292 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3294 theH,Parameters = ParseParameters(theH)
3295 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3296 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3297 anObj.SetParameters(Parameters)
3298 self._autoPublish(anObj, theName, "prism")
3301 ## Create a shape by extrusion of the base shape along the vector,
3302 # i.e. all the space, transfixed by the base shape during its translation
3303 # along the vector on the given distance in 2 Ways (forward/backward).
3304 # @param theBase Base shape to be extruded.
3305 # @param theVec Direction of extrusion.
3306 # @param theH Prism dimension along theVec in forward direction.
3307 # @param theName Object name; when specified, this parameter is used
3308 # for result publication in the study. Otherwise, if automatic
3309 # publication is switched on, default value is used for result name.
3311 # @return New GEOM.GEOM_Object, containing the created prism.
3313 # @ref tui_creation_prism "Example"
3314 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3316 Create a shape by extrusion of the base shape along the vector,
3317 i.e. all the space, transfixed by the base shape during its translation
3318 along the vector on the given distance in 2 Ways (forward/backward).
3321 theBase Base shape to be extruded.
3322 theVec Direction of extrusion.
3323 theH Prism dimension along theVec in forward direction.
3324 theName Object name; when specified, this parameter is used
3325 for result publication in the study. Otherwise, if automatic
3326 publication is switched on, default value is used for result name.
3329 New GEOM.GEOM_Object, containing the created prism.
3331 # Example: see GEOM_TestAll.py
3332 theH,Parameters = ParseParameters(theH)
3333 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3334 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3335 anObj.SetParameters(Parameters)
3336 self._autoPublish(anObj, theName, "prism")
3339 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3340 # @param theBase Base shape to be extruded.
3341 # @param theDX, theDY, theDZ Directions of extrusion.
3342 # @param theScaleFactor Use it to make prism with scaled second base.
3343 # Nagative value means not scaled second base.
3344 # @param theName Object name; when specified, this parameter is used
3345 # for result publication in the study. Otherwise, if automatic
3346 # publication is switched on, default value is used for result name.
3348 # @return New GEOM.GEOM_Object, containing the created prism.
3350 # @ref tui_creation_prism "Example"
3351 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3353 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3356 theBase Base shape to be extruded.
3357 theDX, theDY, theDZ Directions of extrusion.
3358 theScaleFactor Use it to make prism with scaled second base.
3359 Nagative value means not scaled second base.
3360 theName Object name; when specified, this parameter is used
3361 for result publication in the study. Otherwise, if automatic
3362 publication is switched on, default value is used for result name.
3365 New GEOM.GEOM_Object, containing the created prism.
3367 # Example: see GEOM_TestAll.py
3370 if theScaleFactor > 0:
3371 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3372 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3374 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3375 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3376 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3377 anObj.SetParameters(Parameters)
3378 self._autoPublish(anObj, theName, "prism")
3381 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3382 # i.e. all the space, transfixed by the base shape during its translation
3383 # along the vector on the given distance in 2 Ways (forward/backward).
3384 # @param theBase Base shape to be extruded.
3385 # @param theDX, theDY, theDZ Directions of extrusion.
3386 # @param theName Object name; when specified, this parameter is used
3387 # for result publication in the study. Otherwise, if automatic
3388 # publication is switched on, default value is used for result name.
3390 # @return New GEOM.GEOM_Object, containing the created prism.
3392 # @ref tui_creation_prism "Example"
3393 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3395 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3396 i.e. all the space, transfixed by the base shape during its translation
3397 along the vector on the given distance in 2 Ways (forward/backward).
3400 theBase Base shape to be extruded.
3401 theDX, theDY, theDZ Directions of extrusion.
3402 theName Object name; when specified, this parameter is used
3403 for result publication in the study. Otherwise, if automatic
3404 publication is switched on, default value is used for result name.
3407 New GEOM.GEOM_Object, containing the created prism.
3409 # Example: see GEOM_TestAll.py
3410 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3411 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3412 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3413 anObj.SetParameters(Parameters)
3414 self._autoPublish(anObj, theName, "prism")
3417 ## Create a shape by revolution of the base shape around the axis
3418 # on the given angle, i.e. all the space, transfixed by the base
3419 # shape during its rotation around the axis on the given angle.
3420 # @param theBase Base shape to be rotated.
3421 # @param theAxis Rotation axis.
3422 # @param theAngle Rotation angle in radians.
3423 # @param theName Object name; when specified, this parameter is used
3424 # for result publication in the study. Otherwise, if automatic
3425 # publication is switched on, default value is used for result name.
3427 # @return New GEOM.GEOM_Object, containing the created revolution.
3429 # @ref tui_creation_revolution "Example"
3430 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3432 Create a shape by revolution of the base shape around the axis
3433 on the given angle, i.e. all the space, transfixed by the base
3434 shape during its rotation around the axis on the given angle.
3437 theBase Base shape to be rotated.
3438 theAxis Rotation axis.
3439 theAngle Rotation angle in radians.
3440 theName Object name; when specified, this parameter is used
3441 for result publication in the study. Otherwise, if automatic
3442 publication is switched on, default value is used for result name.
3445 New GEOM.GEOM_Object, containing the created revolution.
3447 # Example: see GEOM_TestAll.py
3448 theAngle,Parameters = ParseParameters(theAngle)
3449 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3450 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3451 anObj.SetParameters(Parameters)
3452 self._autoPublish(anObj, theName, "revolution")
3455 ## Create a shape by revolution of the base shape around the axis
3456 # on the given angle, i.e. all the space, transfixed by the base
3457 # shape during its rotation around the axis on the given angle in
3458 # both directions (forward/backward)
3459 # @param theBase Base shape to be rotated.
3460 # @param theAxis Rotation axis.
3461 # @param theAngle Rotation angle in radians.
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 revolution.
3468 # @ref tui_creation_revolution "Example"
3469 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3471 Create a shape by revolution of the base shape around the axis
3472 on the given angle, i.e. all the space, transfixed by the base
3473 shape during its rotation around the axis on the given angle in
3474 both directions (forward/backward).
3477 theBase Base shape to be rotated.
3478 theAxis Rotation axis.
3479 theAngle Rotation angle in radians.
3480 theName Object name; when specified, this parameter is used
3481 for result publication in the study. Otherwise, if automatic
3482 publication is switched on, default value is used for result name.
3485 New GEOM.GEOM_Object, containing the created revolution.
3487 theAngle,Parameters = ParseParameters(theAngle)
3488 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3489 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3490 anObj.SetParameters(Parameters)
3491 self._autoPublish(anObj, theName, "revolution")
3494 ## Create a filling from the given compound of contours.
3495 # @param theShape the compound of contours
3496 # @param theMinDeg a minimal degree of BSpline surface to create
3497 # @param theMaxDeg a maximal degree of BSpline surface to create
3498 # @param theTol2D a 2d tolerance to be reached
3499 # @param theTol3D a 3d tolerance to be reached
3500 # @param theNbIter a number of iteration of approximation algorithm
3501 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3502 # @param isApprox if True, BSpline curves are generated in the process
3503 # of surface construction. By default it is False, that means
3504 # the surface is created using given curves. The usage of
3505 # Approximation makes the algorithm work slower, but allows
3506 # building the surface for rather complex cases.
3507 # @param theName Object name; when specified, this parameter is used
3508 # for result publication in the study. Otherwise, if automatic
3509 # publication is switched on, default value is used for result name.
3511 # @return New GEOM.GEOM_Object, containing the created filling surface.
3513 # @ref tui_creation_filling "Example"
3514 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3515 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3517 Create a filling from the given compound of contours.
3520 theShape the compound of contours
3521 theMinDeg a minimal degree of BSpline surface to create
3522 theMaxDeg a maximal degree of BSpline surface to create
3523 theTol2D a 2d tolerance to be reached
3524 theTol3D a 3d tolerance to be reached
3525 theNbIter a number of iteration of approximation algorithm
3526 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3527 isApprox if True, BSpline curves are generated in the process
3528 of surface construction. By default it is False, that means
3529 the surface is created using given curves. The usage of
3530 Approximation makes the algorithm work slower, but allows
3531 building the surface for rather complex cases
3532 theName Object name; when specified, this parameter is used
3533 for result publication in the study. Otherwise, if automatic
3534 publication is switched on, default value is used for result name.
3537 New GEOM.GEOM_Object, containing the created filling surface.
3540 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3542 # Example: see GEOM_TestAll.py
3543 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3544 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3545 theTol2D, theTol3D, theNbIter,
3546 theMethod, isApprox)
3547 RaiseIfFailed("MakeFilling", self.PrimOp)
3548 anObj.SetParameters(Parameters)
3549 self._autoPublish(anObj, theName, "filling")
3553 ## Create a filling from the given compound of contours.
3554 # This method corresponds to MakeFilling with isApprox=True
3555 # @param theShape the compound of contours
3556 # @param theMinDeg a minimal degree of BSpline surface to create
3557 # @param theMaxDeg a maximal degree of BSpline surface to create
3558 # @param theTol3D a 3d tolerance to be reached
3559 # @param theName Object name; when specified, this parameter is used
3560 # for result publication in the study. Otherwise, if automatic
3561 # publication is switched on, default value is used for result name.
3563 # @return New GEOM.GEOM_Object, containing the created filling surface.
3565 # @ref tui_creation_filling "Example"
3566 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3568 Create a filling from the given compound of contours.
3569 This method corresponds to MakeFilling with isApprox=True
3572 theShape the compound of contours
3573 theMinDeg a minimal degree of BSpline surface to create
3574 theMaxDeg a maximal degree of BSpline surface to create
3575 theTol3D a 3d tolerance to be reached
3576 theName Object name; when specified, this parameter is used
3577 for result publication in the study. Otherwise, if automatic
3578 publication is switched on, default value is used for result name.
3581 New GEOM.GEOM_Object, containing the created filling surface.
3584 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3586 # Example: see GEOM_TestAll.py
3587 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3588 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3589 0, theTol3D, 0, GEOM.FOM_Default, True)
3590 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3591 anObj.SetParameters(Parameters)
3592 self._autoPublish(anObj, theName, "filling")
3595 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3596 # @param theSeqSections - set of specified sections.
3597 # @param theModeSolid - mode defining building solid or shell
3598 # @param thePreci - precision 3D used for smoothing
3599 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3600 # @param theName Object name; when specified, this parameter is used
3601 # for result publication in the study. Otherwise, if automatic
3602 # publication is switched on, default value is used for result name.
3604 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3606 # @ref swig_todo "Example"
3607 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3609 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3612 theSeqSections - set of specified sections.
3613 theModeSolid - mode defining building solid or shell
3614 thePreci - precision 3D used for smoothing
3615 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3616 theName Object name; when specified, this parameter is used
3617 for result publication in the study. Otherwise, if automatic
3618 publication is switched on, default value is used for result name.
3621 New GEOM.GEOM_Object, containing the created shell or solid.
3623 # Example: see GEOM_TestAll.py
3624 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3625 RaiseIfFailed("MakeThruSections", self.PrimOp)
3626 self._autoPublish(anObj, theName, "filling")
3629 ## Create a shape by extrusion of the base shape along
3630 # the path shape. The path shape can be a wire or an edge.
3631 # @param theBase Base shape to be extruded.
3632 # @param thePath Path shape to extrude the base shape along it.
3633 # @param theName Object name; when specified, this parameter is used
3634 # for result publication in the study. Otherwise, if automatic
3635 # publication is switched on, default value is used for result name.
3637 # @return New GEOM.GEOM_Object, containing the created pipe.
3639 # @ref tui_creation_pipe "Example"
3640 def MakePipe(self, theBase, thePath, theName=None):
3642 Create a shape by extrusion of the base shape along
3643 the path shape. The path shape can be a wire or an edge.
3646 theBase Base shape to be extruded.
3647 thePath Path shape to extrude the base shape along it.
3648 theName Object name; when specified, this parameter is used
3649 for result publication in the study. Otherwise, if automatic
3650 publication is switched on, default value is used for result name.
3653 New GEOM.GEOM_Object, containing the created pipe.
3655 # Example: see GEOM_TestAll.py
3656 anObj = self.PrimOp.MakePipe(theBase, thePath)
3657 RaiseIfFailed("MakePipe", self.PrimOp)
3658 self._autoPublish(anObj, theName, "pipe")
3661 ## Create a shape by extrusion of the profile shape along
3662 # the path shape. The path shape can be a wire or an edge.
3663 # the several profiles can be specified in the several locations of path.
3664 # @param theSeqBases - list of Bases shape to be extruded.
3665 # @param theLocations - list of locations on the path corresponding
3666 # specified list of the Bases shapes. Number of locations
3667 # should be equal to number of bases or list of locations can be empty.
3668 # @param thePath - Path shape to extrude the base shape along it.
3669 # @param theWithContact - the mode defining that the section is translated to be in
3670 # contact with the spine.
3671 # @param theWithCorrection - defining that the section is rotated to be
3672 # orthogonal to the spine tangent in the correspondent point
3673 # @param theName Object name; when specified, this parameter is used
3674 # for result publication in the study. Otherwise, if automatic
3675 # publication is switched on, default value is used for result name.
3677 # @return New GEOM.GEOM_Object, containing the created pipe.
3679 # @ref tui_creation_pipe_with_diff_sec "Example"
3680 def MakePipeWithDifferentSections(self, theSeqBases,
3681 theLocations, thePath,
3682 theWithContact, theWithCorrection, theName=None):
3684 Create a shape by extrusion of the profile shape along
3685 the path shape. The path shape can be a wire or an edge.
3686 the several profiles can be specified in the several locations of path.
3689 theSeqBases - list of Bases shape to be extruded.
3690 theLocations - list of locations on the path corresponding
3691 specified list of the Bases shapes. Number of locations
3692 should be equal to number of bases or list of locations can be empty.
3693 thePath - Path shape to extrude the base shape along it.
3694 theWithContact - the mode defining that the section is translated to be in
3695 contact with the spine(0/1)
3696 theWithCorrection - defining that the section is rotated to be
3697 orthogonal to the spine tangent in the correspondent point (0/1)
3698 theName Object name; when specified, this parameter is used
3699 for result publication in the study. Otherwise, if automatic
3700 publication is switched on, default value is used for result name.
3703 New GEOM.GEOM_Object, containing the created pipe.
3705 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3706 theLocations, thePath,
3707 theWithContact, theWithCorrection)
3708 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3709 self._autoPublish(anObj, theName, "pipe")
3712 ## Create a shape by extrusion of the profile shape along
3713 # the path shape. The path shape can be a wire or a edge.
3714 # the several profiles can be specified in the several locations of path.
3715 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3716 # shell or face. If number of faces in neighbour sections
3717 # aren't coincided result solid between such sections will
3718 # be created using external boundaries of this shells.
3719 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3720 # This list is used for searching correspondences between
3721 # faces in the sections. Size of this list must be equal
3722 # to size of list of base shapes.
3723 # @param theLocations - list of locations on the path corresponding
3724 # specified list of the Bases shapes. Number of locations
3725 # should be equal to number of bases. First and last
3726 # locations must be coincided with first and last vertexes
3727 # of path correspondingly.
3728 # @param thePath - Path shape to extrude the base shape along it.
3729 # @param theWithContact - the mode defining that the section is translated to be in
3730 # contact with the spine.
3731 # @param theWithCorrection - defining that the section is rotated to be
3732 # orthogonal to the spine tangent in the correspondent point
3733 # @param theName Object name; when specified, this parameter is used
3734 # for result publication in the study. Otherwise, if automatic
3735 # publication is switched on, default value is used for result name.
3737 # @return New GEOM.GEOM_Object, containing the created solids.
3739 # @ref tui_creation_pipe_with_shell_sec "Example"
3740 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3741 theLocations, thePath,
3742 theWithContact, theWithCorrection, theName=None):
3744 Create a shape by extrusion of the profile shape along
3745 the path shape. The path shape can be a wire or a edge.
3746 the several profiles can be specified in the several locations of path.
3749 theSeqBases - list of Bases shape to be extruded. Base shape must be
3750 shell or face. If number of faces in neighbour sections
3751 aren't coincided result solid between such sections will
3752 be created using external boundaries of this shells.
3753 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3754 This list is used for searching correspondences between
3755 faces in the sections. Size of this list must be equal
3756 to size of list of base shapes.
3757 theLocations - list of locations on the path corresponding
3758 specified list of the Bases shapes. Number of locations
3759 should be equal to number of bases. First and last
3760 locations must be coincided with first and last vertexes
3761 of path correspondingly.
3762 thePath - Path shape to extrude the base shape along it.
3763 theWithContact - the mode defining that the section is translated to be in
3764 contact with the spine (0/1)
3765 theWithCorrection - defining that the section is rotated to be
3766 orthogonal to the spine tangent in the correspondent point (0/1)
3767 theName Object name; when specified, this parameter is used
3768 for result publication in the study. Otherwise, if automatic
3769 publication is switched on, default value is used for result name.
3772 New GEOM.GEOM_Object, containing the created solids.
3774 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3775 theLocations, thePath,
3776 theWithContact, theWithCorrection)
3777 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3778 self._autoPublish(anObj, theName, "pipe")
3781 ## Create a shape by extrusion of the profile shape along
3782 # the path shape. This function is used only for debug pipe
3783 # functionality - it is a version of function MakePipeWithShellSections()
3784 # which give a possibility to recieve information about
3785 # creating pipe between each pair of sections step by step.
3786 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3787 theLocations, thePath,
3788 theWithContact, theWithCorrection, theName=None):
3790 Create a shape by extrusion of the profile shape along
3791 the path shape. This function is used only for debug pipe
3792 functionality - it is a version of previous function
3793 geompy.MakePipeWithShellSections() which give a possibility to
3794 recieve information about creating pipe between each pair of
3795 sections step by step.
3798 nbsect = len(theSeqBases)
3799 nbsubsect = len(theSeqSubBases)
3800 #print "nbsect = ",nbsect
3801 for i in range(1,nbsect):
3803 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3804 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3806 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3807 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3808 tmpLocations, thePath,
3809 theWithContact, theWithCorrection)
3810 if self.PrimOp.IsDone() == 0:
3811 print "Problems with pipe creation between ",i," and ",i+1," sections"
3812 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3815 print "Pipe between ",i," and ",i+1," sections is OK"
3820 resc = self.MakeCompound(res)
3821 #resc = self.MakeSewing(res, 0.001)
3822 #print "resc: ",resc
3823 self._autoPublish(resc, theName, "pipe")
3826 ## Create solids between given sections
3827 # @param theSeqBases - list of sections (shell or face).
3828 # @param theLocations - list of corresponding vertexes
3829 # @param theName Object name; when specified, this parameter is used
3830 # for result publication in the study. Otherwise, if automatic
3831 # publication is switched on, default value is used for result name.
3833 # @return New GEOM.GEOM_Object, containing the created solids.
3835 # @ref tui_creation_pipe_without_path "Example"
3836 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3838 Create solids between given sections
3841 theSeqBases - list of sections (shell or face).
3842 theLocations - list of corresponding vertexes
3843 theName Object name; when specified, this parameter is used
3844 for result publication in the study. Otherwise, if automatic
3845 publication is switched on, default value is used for result name.
3848 New GEOM.GEOM_Object, containing the created solids.
3850 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3851 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3852 self._autoPublish(anObj, theName, "pipe")
3855 ## Create a shape by extrusion of the base shape along
3856 # the path shape with constant bi-normal direction along the given vector.
3857 # The path shape can be a wire or an edge.
3858 # @param theBase Base shape to be extruded.
3859 # @param thePath Path shape to extrude the base shape along it.
3860 # @param theVec Vector defines a constant binormal direction to keep the
3861 # same angle beetween the direction and the sections
3862 # along the sweep surface.
3863 # @param theName Object name; when specified, this parameter is used
3864 # for result publication in the study. Otherwise, if automatic
3865 # publication is switched on, default value is used for result name.
3867 # @return New GEOM.GEOM_Object, containing the created pipe.
3869 # @ref tui_creation_pipe "Example"
3870 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3872 Create a shape by extrusion of the base shape along
3873 the path shape with constant bi-normal direction along the given vector.
3874 The path shape can be a wire or an edge.
3877 theBase Base shape to be extruded.
3878 thePath Path shape to extrude the base shape along it.
3879 theVec Vector defines a constant binormal direction to keep the
3880 same angle beetween the direction and the sections
3881 along the sweep surface.
3882 theName Object name; when specified, this parameter is used
3883 for result publication in the study. Otherwise, if automatic
3884 publication is switched on, default value is used for result name.
3887 New GEOM.GEOM_Object, containing the created pipe.
3889 # Example: see GEOM_TestAll.py
3890 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3891 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3892 self._autoPublish(anObj, theName, "pipe")
3895 ## Makes a thick solid from a face or a shell
3896 # @param theShape Face or Shell to be thicken
3897 # @param theThickness Thickness of the resulting solid
3898 # @param theName Object name; when specified, this parameter is used
3899 # for result publication in the study. Otherwise, if automatic
3900 # publication is switched on, default value is used for result name.
3902 # @return New GEOM.GEOM_Object, containing the created solid
3904 def MakeThickSolid(self, theShape, theThickness, theName=None):
3906 Make a thick solid from a face or a shell
3909 theShape Face or Shell to be thicken
3910 theThickness Thickness of the resulting solid
3911 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.
3916 New GEOM.GEOM_Object, containing the created solid
3918 # Example: see GEOM_TestAll.py
3919 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3920 RaiseIfFailed("MakeThickening", self.PrimOp)
3921 self._autoPublish(anObj, theName, "pipe")
3925 ## Modifies a face or a shell to make it a thick solid
3926 # @param theShape Face or Shell to be thicken
3927 # @param theThickness Thickness of the resulting solid
3929 # @return The modified shape
3931 def Thicken(self, theShape, theThickness):
3933 Modifies a face or a shell to make it a thick solid
3936 theBase Base shape to be extruded.
3937 thePath Path shape to extrude the base shape along it.
3938 theName Object name; when specified, this parameter is used
3939 for result publication in the study. Otherwise, if automatic
3940 publication is switched on, default value is used for result name.
3945 # Example: see GEOM_TestAll.py
3946 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3947 RaiseIfFailed("MakeThickening", self.PrimOp)
3950 ## Build a middle path of a pipe-like shape.
3951 # The path shape can be a wire or an edge.
3952 # @param theShape It can be closed or unclosed pipe-like shell
3953 # or a pipe-like solid.
3954 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3955 # should be wires or faces of theShape.
3956 # @param theName Object name; when specified, this parameter is used
3957 # for result publication in the study. Otherwise, if automatic
3958 # publication is switched on, default value is used for result name.
3960 # @note It is not assumed that exact or approximate copy of theShape
3961 # can be obtained by applying existing Pipe operation on the
3962 # resulting "Path" wire taking theBase1 as the base - it is not
3963 # always possible; though in some particular cases it might work
3964 # it is not guaranteed. Thus, RestorePath function should not be
3965 # considered as an exact reverse operation of the Pipe.
3967 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3968 # source pipe's "path".
3970 # @ref tui_creation_pipe_path "Example"
3971 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3973 Build a middle path of a pipe-like shape.
3974 The path shape can be a wire or an edge.
3977 theShape It can be closed or unclosed pipe-like shell
3978 or a pipe-like solid.
3979 theBase1, theBase2 Two bases of the supposed pipe. This
3980 should be wires or faces of theShape.
3981 theName Object name; when specified, this parameter is used
3982 for result publication in the study. Otherwise, if automatic
3983 publication is switched on, default value is used for result name.
3986 New GEOM_Object, containing an edge or wire that represent
3989 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3990 RaiseIfFailed("RestorePath", self.PrimOp)
3991 self._autoPublish(anObj, theName, "path")
3994 ## Build a middle path of a pipe-like shape.
3995 # The path shape can be a wire or an edge.
3996 # @param theShape It can be closed or unclosed pipe-like shell
3997 # or a pipe-like solid.
3998 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3999 # should be lists of edges of theShape.
4000 # @param theName Object name; when specified, this parameter is used
4001 # for result publication in the study. Otherwise, if automatic
4002 # publication is switched on, default value is used for result name.
4004 # @note It is not assumed that exact or approximate copy of theShape
4005 # can be obtained by applying existing Pipe operation on the
4006 # resulting "Path" wire taking theBase1 as the base - it is not
4007 # always possible; though in some particular cases it might work
4008 # it is not guaranteed. Thus, RestorePath function should not be
4009 # considered as an exact reverse operation of the Pipe.
4011 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4012 # source pipe's "path".
4014 # @ref tui_creation_pipe_path "Example"
4015 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4017 Build a middle path of a pipe-like shape.
4018 The path shape can be a wire or an edge.
4021 theShape It can be closed or unclosed pipe-like shell
4022 or a pipe-like solid.
4023 listEdges1, listEdges2 Two bases of the supposed pipe. This
4024 should be lists of edges of theShape.
4025 theName Object name; when specified, this parameter is used
4026 for result publication in the study. Otherwise, if automatic
4027 publication is switched on, default value is used for result name.
4030 New GEOM_Object, containing an edge or wire that represent
4033 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4034 RaiseIfFailed("RestorePath", self.PrimOp)
4035 self._autoPublish(anObj, theName, "path")
4041 ## @addtogroup l3_advanced
4044 ## Create a linear edge with specified ends.
4045 # @param thePnt1 Point for the first end of edge.
4046 # @param thePnt2 Point for the second end of edge.
4047 # @param theName Object name; when specified, this parameter is used
4048 # for result publication in the study. Otherwise, if automatic
4049 # publication is switched on, default value is used for result name.
4051 # @return New GEOM.GEOM_Object, containing the created edge.
4053 # @ref tui_creation_edge "Example"
4054 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4056 Create a linear edge with specified ends.
4059 thePnt1 Point for the first end of edge.
4060 thePnt2 Point for the second end of edge.
4061 theName Object name; when specified, this parameter is used
4062 for result publication in the study. Otherwise, if automatic
4063 publication is switched on, default value is used for result name.
4066 New GEOM.GEOM_Object, containing the created edge.
4068 # Example: see GEOM_TestAll.py
4069 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4070 RaiseIfFailed("MakeEdge", self.ShapesOp)
4071 self._autoPublish(anObj, theName, "edge")
4074 ## Create a new edge, corresponding to the given length on the given curve.
4075 # @param theRefCurve The referenced curve (edge).
4076 # @param theLength Length on the referenced curve. It can be negative.
4077 # @param theStartPoint Any point can be selected for it, the new edge will begin
4078 # at the end of \a theRefCurve, close to the selected point.
4079 # If None, start from the first point of \a theRefCurve.
4080 # @param theName Object name; when specified, this parameter is used
4081 # for result publication in the study. Otherwise, if automatic
4082 # publication is switched on, default value is used for result name.
4084 # @return New GEOM.GEOM_Object, containing the created edge.
4086 # @ref tui_creation_edge "Example"
4087 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4089 Create a new edge, corresponding to the given length on the given curve.
4092 theRefCurve The referenced curve (edge).
4093 theLength Length on the referenced curve. It can be negative.
4094 theStartPoint Any point can be selected for it, the new edge will begin
4095 at the end of theRefCurve, close to the selected point.
4096 If None, start from the first point of theRefCurve.
4097 theName Object name; when specified, this parameter is used
4098 for result publication in the study. Otherwise, if automatic
4099 publication is switched on, default value is used for result name.
4102 New GEOM.GEOM_Object, containing the created edge.
4104 # Example: see GEOM_TestAll.py
4105 theLength, Parameters = ParseParameters(theLength)
4106 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4107 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4108 anObj.SetParameters(Parameters)
4109 self._autoPublish(anObj, theName, "edge")
4112 ## Create an edge from specified wire.
4113 # @param theWire source Wire
4114 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4115 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4116 # @param theName Object name; when specified, this parameter is used
4117 # for result publication in the study. Otherwise, if automatic
4118 # publication is switched on, default value is used for result name.
4120 # @return New GEOM.GEOM_Object, containing the created edge.
4122 # @ref tui_creation_edge "Example"
4123 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4125 Create an edge from specified wire.
4129 theLinearTolerance linear tolerance value (default = 1e-07)
4130 theAngularTolerance angular tolerance value (default = 1e-12)
4131 theName Object name; when specified, this parameter is used
4132 for result publication in the study. Otherwise, if automatic
4133 publication is switched on, default value is used for result name.
4136 New GEOM.GEOM_Object, containing the created edge.
4138 # Example: see GEOM_TestAll.py
4139 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4140 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4141 self._autoPublish(anObj, theName, "edge")
4144 ## Create a wire from the set of edges and wires.
4145 # @param theEdgesAndWires List of edges and/or wires.
4146 # @param theTolerance Maximum distance between vertices, that will be merged.
4147 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4148 # @param theName Object name; when specified, this parameter is used
4149 # for result publication in the study. Otherwise, if automatic
4150 # publication is switched on, default value is used for result name.
4152 # @return New GEOM.GEOM_Object, containing the created wire.
4154 # @ref tui_creation_wire "Example"
4155 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4157 Create a wire from the set of edges and wires.
4160 theEdgesAndWires List of edges and/or wires.
4161 theTolerance Maximum distance between vertices, that will be merged.
4162 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4163 theName Object name; when specified, this parameter is used
4164 for result publication in the study. Otherwise, if automatic
4165 publication is switched on, default value is used for result name.
4168 New GEOM.GEOM_Object, containing the created wire.
4170 # Example: see GEOM_TestAll.py
4171 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4172 RaiseIfFailed("MakeWire", self.ShapesOp)
4173 self._autoPublish(anObj, theName, "wire")
4176 ## Create a face on the given wire.
4177 # @param theWire closed Wire or Edge to build the face on.
4178 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4179 # If the tolerance of the obtained planar face is less
4180 # than 1e-06, this face will be returned, otherwise the
4181 # algorithm tries to build any suitable face on the given
4182 # wire and prints a warning message.
4183 # @param theName Object name; when specified, this parameter is used
4184 # for result publication in the study. Otherwise, if automatic
4185 # publication is switched on, default value is used for result name.
4187 # @return New GEOM.GEOM_Object, containing the created face.
4189 # @ref tui_creation_face "Example"
4190 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4192 Create a face on the given wire.
4195 theWire closed Wire or Edge to build the face on.
4196 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4197 If the tolerance of the obtained planar face is less
4198 than 1e-06, this face will be returned, otherwise the
4199 algorithm tries to build any suitable face on the given
4200 wire and prints a warning message.
4201 theName Object name; when specified, this parameter is used
4202 for result publication in the study. Otherwise, if automatic
4203 publication is switched on, default value is used for result name.
4206 New GEOM.GEOM_Object, containing the created face.
4208 # Example: see GEOM_TestAll.py
4209 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4210 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4211 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4213 RaiseIfFailed("MakeFace", self.ShapesOp)
4214 self._autoPublish(anObj, theName, "face")
4217 ## Create a face on the given wires set.
4218 # @param theWires List of closed wires or edges to build the face on.
4219 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4220 # If the tolerance of the obtained planar face is less
4221 # than 1e-06, this face will be returned, otherwise the
4222 # algorithm tries to build any suitable face on the given
4223 # wire and prints a warning message.
4224 # @param theName Object name; when specified, this parameter is used
4225 # for result publication in the study. Otherwise, if automatic
4226 # publication is switched on, default value is used for result name.
4228 # @return New GEOM.GEOM_Object, containing the created face.
4230 # @ref tui_creation_face "Example"
4231 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4233 Create a face on the given wires set.
4236 theWires List of closed wires or edges to build the face on.
4237 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4238 If the tolerance of the obtained planar face is less
4239 than 1e-06, this face will be returned, otherwise the
4240 algorithm tries to build any suitable face on the given
4241 wire and prints a warning message.
4242 theName Object name; when specified, this parameter is used
4243 for result publication in the study. Otherwise, if automatic
4244 publication is switched on, default value is used for result name.
4247 New GEOM.GEOM_Object, containing the created face.
4249 # Example: see GEOM_TestAll.py
4250 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4251 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4252 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4254 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4255 self._autoPublish(anObj, theName, "face")
4258 ## See MakeFaceWires() method for details.
4260 # @ref tui_creation_face "Example 1"
4261 # \n @ref swig_MakeFaces "Example 2"
4262 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4264 See geompy.MakeFaceWires() method for details.
4266 # Example: see GEOM_TestOthers.py
4267 # note: auto-publishing is done in self.MakeFaceWires()
4268 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4271 ## Create a shell from the set of faces and shells.
4272 # @param theFacesAndShells List of faces and/or shells.
4273 # @param theName Object name; when specified, this parameter is used
4274 # for result publication in the study. Otherwise, if automatic
4275 # publication is switched on, default value is used for result name.
4277 # @return New GEOM.GEOM_Object, containing the created shell.
4279 # @ref tui_creation_shell "Example"
4280 def MakeShell(self, theFacesAndShells, theName=None):
4282 Create a shell from the set of faces and shells.
4285 theFacesAndShells List of faces and/or shells.
4286 theName Object name; when specified, this parameter is used
4287 for result publication in the study. Otherwise, if automatic
4288 publication is switched on, default value is used for result name.
4291 New GEOM.GEOM_Object, containing the created shell.
4293 # Example: see GEOM_TestAll.py
4294 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4295 RaiseIfFailed("MakeShell", self.ShapesOp)
4296 self._autoPublish(anObj, theName, "shell")
4299 ## Create a solid, bounded by the given shells.
4300 # @param theShells Sequence of bounding shells.
4301 # @param theName Object name; when specified, this parameter is used
4302 # for result publication in the study. Otherwise, if automatic
4303 # publication is switched on, default value is used for result name.
4305 # @return New GEOM.GEOM_Object, containing the created solid.
4307 # @ref tui_creation_solid "Example"
4308 def MakeSolid(self, theShells, theName=None):
4310 Create a solid, bounded by the given shells.
4313 theShells Sequence of bounding shells.
4314 theName Object name; when specified, this parameter is used
4315 for result publication in the study. Otherwise, if automatic
4316 publication is switched on, default value is used for result name.
4319 New GEOM.GEOM_Object, containing the created solid.
4321 # Example: see GEOM_TestAll.py
4322 if len(theShells) == 1:
4323 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4325 # raise RuntimeError, "MakeSolidShells : " + descr
4326 if descr == "WRN_SHAPE_UNCLOSED":
4327 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4328 anObj = self.ShapesOp.MakeSolidShells(theShells)
4329 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4330 self._autoPublish(anObj, theName, "solid")
4333 ## Create a compound of the given shapes.
4334 # @param theShapes List of shapes to put in compound.
4335 # @param theName Object name; when specified, this parameter is used
4336 # for result publication in the study. Otherwise, if automatic
4337 # publication is switched on, default value is used for result name.
4339 # @return New GEOM.GEOM_Object, containing the created compound.
4341 # @ref tui_creation_compound "Example"
4342 def MakeCompound(self, theShapes, theName=None):
4344 Create a compound of the given shapes.
4347 theShapes List of shapes to put in compound.
4348 theName Object name; when specified, this parameter is used
4349 for result publication in the study. Otherwise, if automatic
4350 publication is switched on, default value is used for result name.
4353 New GEOM.GEOM_Object, containing the created compound.
4355 # Example: see GEOM_TestAll.py
4356 self.ShapesOp.StartOperation()
4357 anObj = self.ShapesOp.MakeCompound(theShapes)
4358 RaiseIfFailed("MakeCompound", self.ShapesOp)
4359 self._autoPublish(anObj, theName, "compound")
4362 # end of l3_advanced
4365 ## @addtogroup l2_measure
4368 ## Gives quantity of faces in the given shape.
4369 # @param theShape Shape to count faces of.
4370 # @return Quantity of faces.
4372 # @ref swig_NumberOf "Example"
4373 def NumberOfFaces(self, theShape):
4375 Gives quantity of faces in the given shape.
4378 theShape Shape to count faces of.
4383 # Example: see GEOM_TestOthers.py
4384 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4385 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4388 ## Gives quantity of edges in the given shape.
4389 # @param theShape Shape to count edges of.
4390 # @return Quantity of edges.
4392 # @ref swig_NumberOf "Example"
4393 def NumberOfEdges(self, theShape):
4395 Gives quantity of edges in the given shape.
4398 theShape Shape to count edges of.
4403 # Example: see GEOM_TestOthers.py
4404 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4405 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4408 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4409 # @param theShape Shape to count sub-shapes of.
4410 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4411 # @return Quantity of sub-shapes of given type.
4413 # @ref swig_NumberOf "Example"
4414 def NumberOfSubShapes(self, theShape, theShapeType):
4416 Gives quantity of sub-shapes of type theShapeType in the given shape.
4419 theShape Shape to count sub-shapes of.
4420 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4423 Quantity of sub-shapes of given type.
4425 # Example: see GEOM_TestOthers.py
4426 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4427 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4430 ## Gives quantity of solids in the given shape.
4431 # @param theShape Shape to count solids in.
4432 # @return Quantity of solids.
4434 # @ref swig_NumberOf "Example"
4435 def NumberOfSolids(self, theShape):
4437 Gives quantity of solids in the given shape.
4440 theShape Shape to count solids in.
4445 # Example: see GEOM_TestOthers.py
4446 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4447 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4453 ## @addtogroup l3_healing
4456 ## Reverses an orientation the given shape.
4457 # @param theShape Shape to be reversed.
4458 # @param theName Object name; when specified, this parameter is used
4459 # for result publication in the study. Otherwise, if automatic
4460 # publication is switched on, default value is used for result name.
4462 # @return The reversed copy of theShape.
4464 # @ref swig_ChangeOrientation "Example"
4465 def ChangeOrientation(self, theShape, theName=None):
4467 Reverses an orientation the given shape.
4470 theShape Shape to be reversed.
4471 theName Object name; when specified, this parameter is used
4472 for result publication in the study. Otherwise, if automatic
4473 publication is switched on, default value is used for result name.
4476 The reversed copy of theShape.
4478 # Example: see GEOM_TestAll.py
4479 anObj = self.ShapesOp.ChangeOrientation(theShape)
4480 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4481 self._autoPublish(anObj, theName, "reversed")
4484 ## See ChangeOrientation() method for details.
4486 # @ref swig_OrientationChange "Example"
4487 def OrientationChange(self, theShape, theName=None):
4489 See geompy.ChangeOrientation method for details.
4491 # Example: see GEOM_TestOthers.py
4492 # note: auto-publishing is done in self.ChangeOrientation()
4493 anObj = self.ChangeOrientation(theShape, theName)
4499 ## @addtogroup l4_obtain
4502 ## Retrieve all free faces from the given shape.
4503 # Free face is a face, which is not shared between two shells of the shape.
4504 # @param theShape Shape to find free faces in.
4505 # @return List of IDs of all free faces, contained in theShape.
4507 # @ref tui_measurement_tools_page "Example"
4508 def GetFreeFacesIDs(self,theShape):
4510 Retrieve all free faces from the given shape.
4511 Free face is a face, which is not shared between two shells of the shape.
4514 theShape Shape to find free faces in.
4517 List of IDs of all free faces, contained in theShape.
4519 # Example: see GEOM_TestOthers.py
4520 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4521 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4524 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4525 # @param theShape1 Shape to find sub-shapes in.
4526 # @param theShape2 Shape to find shared sub-shapes with.
4527 # @param theShapeType Type of sub-shapes to be retrieved.
4528 # @param theName Object name; when specified, this parameter is used
4529 # for result publication in the study. Otherwise, if automatic
4530 # publication is switched on, default value is used for result name.
4532 # @return List of sub-shapes of theShape1, shared with theShape2.
4534 # @ref swig_GetSharedShapes "Example"
4535 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4537 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4540 theShape1 Shape to find sub-shapes in.
4541 theShape2 Shape to find shared sub-shapes with.
4542 theShapeType Type of sub-shapes to be retrieved.
4543 theName Object name; when specified, this parameter is used
4544 for result publication in the study. Otherwise, if automatic
4545 publication is switched on, default value is used for result name.
4548 List of sub-shapes of theShape1, shared with theShape2.
4550 # Example: see GEOM_TestOthers.py
4551 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4552 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4553 self._autoPublish(aList, theName, "shared")
4556 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4557 # @param theShapes Shapes to find common sub-shapes of.
4558 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4559 # @param theName Object name; when specified, this parameter is used
4560 # for result publication in the study. Otherwise, if automatic
4561 # publication is switched on, default value is used for result name.
4563 # @return List of objects, that are sub-shapes of all given shapes.
4565 # @ref swig_GetSharedShapes "Example"
4566 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4568 Get all sub-shapes, shared by all shapes in the list theShapes.
4571 theShapes Shapes to find common sub-shapes of.
4572 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4573 theName Object name; when specified, this parameter is used
4574 for result publication in the study. Otherwise, if automatic
4575 publication is switched on, default value is used for result name.
4578 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4580 # Example: see GEOM_TestOthers.py
4581 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4582 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4583 self._autoPublish(aList, theName, "shared")
4586 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4587 # situated relatively the specified plane by the certain way,
4588 # defined through <VAR>theState</VAR> parameter.
4589 # @param theShape Shape to find sub-shapes of.
4590 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4591 # @param theAx1 Vector (or line, or linear edge), specifying normal
4592 # direction and location of the plane to find shapes on.
4593 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4594 # @param theName Object name; when specified, this parameter is used
4595 # for result publication in the study. Otherwise, if automatic
4596 # publication is switched on, default value is used for result name.
4598 # @return List of all found sub-shapes.
4600 # @ref swig_GetShapesOnPlane "Example"
4601 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4603 Find in theShape all sub-shapes of type theShapeType,
4604 situated relatively the specified plane by the certain way,
4605 defined through theState parameter.
4608 theShape Shape to find sub-shapes of.
4609 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4610 theAx1 Vector (or line, or linear edge), specifying normal
4611 direction and location of the plane to find shapes on.
4612 theState The state of the sub-shapes to find (see GEOM::shape_state)
4613 theName Object name; when specified, this parameter is used
4614 for result publication in the study. Otherwise, if automatic
4615 publication is switched on, default value is used for result name.
4618 List of all found sub-shapes.
4620 # Example: see GEOM_TestOthers.py
4621 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4622 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4623 self._autoPublish(aList, theName, "shapeOnPlane")
4626 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4627 # situated relatively the specified plane by the certain way,
4628 # defined through <VAR>theState</VAR> parameter.
4629 # @param theShape Shape to find sub-shapes of.
4630 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4631 # @param theAx1 Vector (or line, or linear edge), specifying normal
4632 # direction and location of the plane to find shapes on.
4633 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4635 # @return List of all found sub-shapes indices.
4637 # @ref swig_GetShapesOnPlaneIDs "Example"
4638 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4640 Find in theShape all sub-shapes of type theShapeType,
4641 situated relatively the specified plane by the certain way,
4642 defined through theState parameter.
4645 theShape Shape to find sub-shapes of.
4646 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4647 theAx1 Vector (or line, or linear edge), specifying normal
4648 direction and location of the plane to find shapes on.
4649 theState The state of the sub-shapes to find (see GEOM::shape_state)
4652 List of all found sub-shapes indices.
4654 # Example: see GEOM_TestOthers.py
4655 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4656 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4659 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4660 # situated relatively the specified plane by the certain way,
4661 # defined through <VAR>theState</VAR> parameter.
4662 # @param theShape Shape to find sub-shapes of.
4663 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4664 # @param theAx1 Vector (or line, or linear edge), specifying normal
4665 # direction of the plane to find shapes on.
4666 # @param thePnt Point specifying location of the plane to find shapes on.
4667 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4668 # @param theName Object name; when specified, this parameter is used
4669 # for result publication in the study. Otherwise, if automatic
4670 # publication is switched on, default value is used for result name.
4672 # @return List of all found sub-shapes.
4674 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4675 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4677 Find in theShape all sub-shapes of type theShapeType,
4678 situated relatively the specified plane by the certain way,
4679 defined through theState parameter.
4682 theShape Shape to find sub-shapes of.
4683 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4684 theAx1 Vector (or line, or linear edge), specifying normal
4685 direction and location of the plane to find shapes on.
4686 thePnt Point specifying location of the plane to find shapes on.
4687 theState The state of the sub-shapes to find (see GEOM::shape_state)
4688 theName Object name; when specified, this parameter is used
4689 for result publication in the study. Otherwise, if automatic
4690 publication is switched on, default value is used for result name.
4693 List of all found sub-shapes.
4695 # Example: see GEOM_TestOthers.py
4696 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4697 theAx1, thePnt, theState)
4698 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4699 self._autoPublish(aList, theName, "shapeOnPlane")
4702 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4703 # situated relatively the specified plane by the certain way,
4704 # defined through <VAR>theState</VAR> parameter.
4705 # @param theShape Shape to find sub-shapes of.
4706 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4707 # @param theAx1 Vector (or line, or linear edge), specifying normal
4708 # direction of the plane to find shapes on.
4709 # @param thePnt Point specifying location of the plane to find shapes on.
4710 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4712 # @return List of all found sub-shapes indices.
4714 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4715 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4717 Find in theShape all sub-shapes of type theShapeType,
4718 situated relatively the specified plane by the certain way,
4719 defined through theState parameter.
4722 theShape Shape to find sub-shapes of.
4723 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4724 theAx1 Vector (or line, or linear edge), specifying normal
4725 direction and location of the plane to find shapes on.
4726 thePnt Point specifying location of the plane to find shapes on.
4727 theState The state of the sub-shapes to find (see GEOM::shape_state)
4730 List of all found sub-shapes indices.
4732 # Example: see GEOM_TestOthers.py
4733 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4734 theAx1, thePnt, theState)
4735 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4738 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4739 # the specified cylinder by the certain way, defined through \a theState parameter.
4740 # @param theShape Shape to find sub-shapes of.
4741 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4742 # @param theAxis Vector (or line, or linear edge), specifying
4743 # axis of the cylinder to find shapes on.
4744 # @param theRadius Radius of the cylinder to find shapes on.
4745 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4746 # @param theName Object name; when specified, this parameter is used
4747 # for result publication in the study. Otherwise, if automatic
4748 # publication is switched on, default value is used for result name.
4750 # @return List of all found sub-shapes.
4752 # @ref swig_GetShapesOnCylinder "Example"
4753 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4755 Find in theShape all sub-shapes of type theShapeType, situated relatively
4756 the specified cylinder by the certain way, defined through theState parameter.
4759 theShape Shape to find sub-shapes of.
4760 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4761 theAxis Vector (or line, or linear edge), specifying
4762 axis of the cylinder to find shapes on.
4763 theRadius Radius of the cylinder to find shapes on.
4764 theState The state of the sub-shapes to find (see GEOM::shape_state)
4765 theName Object name; when specified, this parameter is used
4766 for result publication in the study. Otherwise, if automatic
4767 publication is switched on, default value is used for result name.
4770 List of all found sub-shapes.
4772 # Example: see GEOM_TestOthers.py
4773 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4774 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4775 self._autoPublish(aList, theName, "shapeOnCylinder")
4778 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4779 # the specified cylinder by the certain way, defined through \a theState parameter.
4780 # @param theShape Shape to find sub-shapes of.
4781 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4782 # @param theAxis Vector (or line, or linear edge), specifying
4783 # axis of the cylinder to find shapes on.
4784 # @param theRadius Radius of the cylinder to find shapes on.
4785 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4787 # @return List of all found sub-shapes indices.
4789 # @ref swig_GetShapesOnCylinderIDs "Example"
4790 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4792 Find in theShape all sub-shapes of type theShapeType, situated relatively
4793 the specified cylinder by the certain way, defined through theState parameter.
4796 theShape Shape to find sub-shapes of.
4797 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4798 theAxis Vector (or line, or linear edge), specifying
4799 axis of the cylinder to find shapes on.
4800 theRadius Radius of the cylinder to find shapes on.
4801 theState The state of the sub-shapes to find (see GEOM::shape_state)
4804 List of all found sub-shapes indices.
4806 # Example: see GEOM_TestOthers.py
4807 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4808 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4811 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4812 # the specified cylinder by the certain way, defined through \a theState parameter.
4813 # @param theShape Shape to find sub-shapes of.
4814 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4815 # @param theAxis Vector (or line, or linear edge), specifying
4816 # axis of the cylinder to find shapes on.
4817 # @param thePnt Point specifying location of the bottom of the cylinder.
4818 # @param theRadius Radius of the cylinder to find shapes on.
4819 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4820 # @param theName Object name; when specified, this parameter is used
4821 # for result publication in the study. Otherwise, if automatic
4822 # publication is switched on, default value is used for result name.
4824 # @return List of all found sub-shapes.
4826 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4827 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4829 Find in theShape all sub-shapes of type theShapeType, situated relatively
4830 the specified cylinder by the certain way, defined through theState parameter.
4833 theShape Shape to find sub-shapes of.
4834 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4835 theAxis Vector (or line, or linear edge), specifying
4836 axis of the cylinder to find shapes on.
4837 theRadius Radius of the cylinder to find shapes on.
4838 theState The state of the sub-shapes to find (see GEOM::shape_state)
4839 theName Object name; when specified, this parameter is used
4840 for result publication in the study. Otherwise, if automatic
4841 publication is switched on, default value is used for result name.
4844 List of all found sub-shapes.
4846 # Example: see GEOM_TestOthers.py
4847 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4848 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4849 self._autoPublish(aList, theName, "shapeOnCylinder")
4852 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4853 # the specified cylinder by the certain way, defined through \a theState parameter.
4854 # @param theShape Shape to find sub-shapes of.
4855 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4856 # @param theAxis Vector (or line, or linear edge), specifying
4857 # axis of the cylinder to find shapes on.
4858 # @param thePnt Point specifying location of the bottom of the cylinder.
4859 # @param theRadius Radius of the cylinder to find shapes on.
4860 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4862 # @return List of all found sub-shapes indices
4864 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4865 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4867 Find in theShape all sub-shapes of type theShapeType, situated relatively
4868 the specified cylinder by the certain way, defined through theState parameter.
4871 theShape Shape to find sub-shapes of.
4872 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4873 theAxis Vector (or line, or linear edge), specifying
4874 axis of the cylinder to find shapes on.
4875 theRadius Radius of the cylinder to find shapes on.
4876 theState The state of the sub-shapes to find (see GEOM::shape_state)
4879 List of all found sub-shapes indices.
4881 # Example: see GEOM_TestOthers.py
4882 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4883 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4886 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4887 # the specified sphere by the certain way, defined through \a theState parameter.
4888 # @param theShape Shape to find sub-shapes of.
4889 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4890 # @param theCenter Point, specifying center of the sphere to find shapes on.
4891 # @param theRadius Radius of the sphere to find shapes on.
4892 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4893 # @param theName Object name; when specified, this parameter is used
4894 # for result publication in the study. Otherwise, if automatic
4895 # publication is switched on, default value is used for result name.
4897 # @return List of all found sub-shapes.
4899 # @ref swig_GetShapesOnSphere "Example"
4900 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4902 Find in theShape all sub-shapes of type theShapeType, situated relatively
4903 the specified sphere by the certain way, defined through theState parameter.
4906 theShape Shape to find sub-shapes of.
4907 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4908 theCenter Point, specifying center of the sphere to find shapes on.
4909 theRadius Radius of the sphere to find shapes on.
4910 theState The state of the sub-shapes to find (see GEOM::shape_state)
4911 theName Object name; when specified, this parameter is used
4912 for result publication in the study. Otherwise, if automatic
4913 publication is switched on, default value is used for result name.
4916 List of all found sub-shapes.
4918 # Example: see GEOM_TestOthers.py
4919 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4920 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4921 self._autoPublish(aList, theName, "shapeOnSphere")
4924 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4925 # the specified sphere by the certain way, defined through \a theState parameter.
4926 # @param theShape Shape to find sub-shapes of.
4927 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4928 # @param theCenter Point, specifying center of the sphere to find shapes on.
4929 # @param theRadius Radius of the sphere to find shapes on.
4930 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4932 # @return List of all found sub-shapes indices.
4934 # @ref swig_GetShapesOnSphereIDs "Example"
4935 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4937 Find in theShape all sub-shapes of type theShapeType, situated relatively
4938 the specified sphere by the certain way, defined through theState parameter.
4941 theShape Shape to find sub-shapes of.
4942 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4943 theCenter Point, specifying center of the sphere to find shapes on.
4944 theRadius Radius of the sphere to find shapes on.
4945 theState The state of the sub-shapes to find (see GEOM::shape_state)
4948 List of all found sub-shapes indices.
4950 # Example: see GEOM_TestOthers.py
4951 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4952 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
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)
4964 # @param theName Object name; when specified, this parameter is used
4965 # for result publication in the study. Otherwise, if automatic
4966 # publication is switched on, default value is used for result name.
4968 # @return List of all found sub-shapes.
4970 # @ref swig_GetShapesOnQuadrangle "Example"
4971 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4972 theTopLeftPoint, theTopRigthPoint,
4973 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4975 Find in theShape all sub-shapes of type theShapeType, situated relatively
4976 the specified quadrangle by the certain way, defined through theState parameter.
4979 theShape Shape to find sub-shapes of.
4980 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4981 theTopLeftPoint Point, specifying top left corner of a quadrangle
4982 theTopRigthPoint Point, specifying top right corner of a quadrangle
4983 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4984 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4985 theState The state of the sub-shapes to find (see GEOM::shape_state)
4986 theName Object name; when specified, this parameter is used
4987 for result publication in the study. Otherwise, if automatic
4988 publication is switched on, default value is used for result name.
4991 List of all found sub-shapes.
4993 # Example: see GEOM_TestOthers.py
4994 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4995 theTopLeftPoint, theTopRigthPoint,
4996 theBottomLeftPoint, theBottomRigthPoint, theState)
4997 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4998 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5001 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5002 # the specified quadrangle by the certain way, defined through \a theState parameter.
5003 # @param theShape Shape to find sub-shapes of.
5004 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5005 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5006 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5007 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5008 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5009 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5011 # @return List of all found sub-shapes indices.
5013 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5014 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5015 theTopLeftPoint, theTopRigthPoint,
5016 theBottomLeftPoint, theBottomRigthPoint, theState):
5018 Find in theShape all sub-shapes of type theShapeType, situated relatively
5019 the specified quadrangle by the certain way, defined through theState parameter.
5022 theShape Shape to find sub-shapes of.
5023 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5024 theTopLeftPoint Point, specifying top left corner of a quadrangle
5025 theTopRigthPoint Point, specifying top right corner of a quadrangle
5026 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5027 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5028 theState The state of the sub-shapes to find (see GEOM::shape_state)
5031 List of all found sub-shapes indices.
5034 # Example: see GEOM_TestOthers.py
5035 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5036 theTopLeftPoint, theTopRigthPoint,
5037 theBottomLeftPoint, theBottomRigthPoint, theState)
5038 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5041 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5042 # the specified \a theBox by the certain way, defined through \a theState parameter.
5043 # @param theBox Shape for relative comparing.
5044 # @param theShape Shape to find sub-shapes of.
5045 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5046 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5047 # @param theName Object name; when specified, this parameter is used
5048 # for result publication in the study. Otherwise, if automatic
5049 # publication is switched on, default value is used for result name.
5051 # @return List of all found sub-shapes.
5053 # @ref swig_GetShapesOnBox "Example"
5054 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5056 Find in theShape all sub-shapes of type theShapeType, situated relatively
5057 the specified theBox by the certain way, defined through theState parameter.
5060 theBox Shape for relative comparing.
5061 theShape Shape to find sub-shapes of.
5062 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5063 theState The state of the sub-shapes to find (see GEOM::shape_state)
5064 theName Object name; when specified, this parameter is used
5065 for result publication in the study. Otherwise, if automatic
5066 publication is switched on, default value is used for result name.
5069 List of all found sub-shapes.
5071 # Example: see GEOM_TestOthers.py
5072 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5073 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5074 self._autoPublish(aList, theName, "shapeOnBox")
5077 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5078 # the specified \a theBox by the certain way, defined through \a theState parameter.
5079 # @param theBox Shape for relative comparing.
5080 # @param theShape Shape to find sub-shapes of.
5081 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5082 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5084 # @return List of all found sub-shapes indices.
5086 # @ref swig_GetShapesOnBoxIDs "Example"
5087 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5089 Find in theShape all sub-shapes of type theShapeType, situated relatively
5090 the specified theBox by the certain way, defined through theState parameter.
5093 theBox Shape for relative comparing.
5094 theShape Shape to find sub-shapes of.
5095 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5096 theState The state of the sub-shapes to find (see GEOM::shape_state)
5099 List of all found sub-shapes indices.
5101 # Example: see GEOM_TestOthers.py
5102 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5103 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5106 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5107 # situated relatively the specified \a theCheckShape by the
5108 # certain way, defined through \a theState parameter.
5109 # @param theCheckShape Shape for relative comparing. It must be a solid.
5110 # @param theShape Shape to find sub-shapes of.
5111 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5112 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5113 # @param theName Object name; when specified, this parameter is used
5114 # for result publication in the study. Otherwise, if automatic
5115 # publication is switched on, default value is used for result name.
5117 # @return List of all found sub-shapes.
5119 # @ref swig_GetShapesOnShape "Example"
5120 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5122 Find in theShape all sub-shapes of type theShapeType,
5123 situated relatively the specified theCheckShape by the
5124 certain way, defined through theState parameter.
5127 theCheckShape Shape for relative comparing. It must be a solid.
5128 theShape Shape to find sub-shapes of.
5129 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5130 theState The state of the sub-shapes to find (see GEOM::shape_state)
5131 theName Object name; when specified, this parameter is used
5132 for result publication in the study. Otherwise, if automatic
5133 publication is switched on, default value is used for result name.
5136 List of all found sub-shapes.
5138 # Example: see GEOM_TestOthers.py
5139 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5140 theShapeType, theState)
5141 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5142 self._autoPublish(aList, theName, "shapeOnShape")
5145 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5146 # situated relatively the specified \a theCheckShape by the
5147 # certain way, defined through \a theState parameter.
5148 # @param theCheckShape Shape for relative comparing. It must be a solid.
5149 # @param theShape Shape to find sub-shapes of.
5150 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5151 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5152 # @param theName Object name; when specified, this parameter is used
5153 # for result publication in the study. Otherwise, if automatic
5154 # publication is switched on, default value is used for result name.
5156 # @return All found sub-shapes as compound.
5158 # @ref swig_GetShapesOnShapeAsCompound "Example"
5159 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5161 Find in theShape all sub-shapes of type theShapeType,
5162 situated relatively the specified theCheckShape by the
5163 certain way, defined through theState parameter.
5166 theCheckShape Shape for relative comparing. It must be a solid.
5167 theShape Shape to find sub-shapes of.
5168 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5169 theState The state of the sub-shapes to find (see GEOM::shape_state)
5170 theName Object name; when specified, this parameter is used
5171 for result publication in the study. Otherwise, if automatic
5172 publication is switched on, default value is used for result name.
5175 All found sub-shapes as compound.
5177 # Example: see GEOM_TestOthers.py
5178 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5179 theShapeType, theState)
5180 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5181 self._autoPublish(anObj, theName, "shapeOnShape")
5184 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5185 # situated relatively the specified \a theCheckShape by the
5186 # certain way, defined through \a theState parameter.
5187 # @param theCheckShape Shape for relative comparing. It must be a solid.
5188 # @param theShape Shape to find sub-shapes of.
5189 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5190 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5192 # @return List of all found sub-shapes indices.
5194 # @ref swig_GetShapesOnShapeIDs "Example"
5195 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5197 Find in theShape all sub-shapes of type theShapeType,
5198 situated relatively the specified theCheckShape by the
5199 certain way, defined through theState parameter.
5202 theCheckShape Shape for relative comparing. It must be a solid.
5203 theShape Shape to find sub-shapes of.
5204 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5205 theState The state of the sub-shapes to find (see GEOM::shape_state)
5208 List of all found sub-shapes indices.
5210 # Example: see GEOM_TestOthers.py
5211 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5212 theShapeType, theState)
5213 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5216 ## Get sub-shape(s) of theShapeWhere, which are
5217 # coincident with \a theShapeWhat or could be a part of it.
5218 # @param theShapeWhere Shape to find sub-shapes of.
5219 # @param theShapeWhat Shape, specifying what to find.
5220 # @param isNewImplementation implementation of GetInPlace functionality
5221 # (default = False, old alghorithm based on shape properties)
5222 # @param theName Object name; when specified, this parameter is used
5223 # for result publication in the study. Otherwise, if automatic
5224 # publication is switched on, default value is used for result name.
5226 # @return Group of all found sub-shapes or a single found sub-shape.
5228 # @note This function has a restriction on argument shapes.
5229 # If \a theShapeWhere has curved parts with significantly
5230 # outstanding centres (i.e. the mass centre of a part is closer to
5231 # \a theShapeWhat than to the part), such parts will not be found.
5232 # @image html get_in_place_lost_part.png
5234 # @ref swig_GetInPlace "Example"
5235 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5237 Get sub-shape(s) of theShapeWhere, which are
5238 coincident with theShapeWhat or could be a part of it.
5241 theShapeWhere Shape to find sub-shapes of.
5242 theShapeWhat Shape, specifying what to find.
5243 isNewImplementation Implementation of GetInPlace functionality
5244 (default = False, old alghorithm based on shape properties)
5245 theName Object name; when specified, this parameter is used
5246 for result publication in the study. Otherwise, if automatic
5247 publication is switched on, default value is used for result name.
5250 Group of all found sub-shapes or a single found sub-shape.
5254 This function has a restriction on argument shapes.
5255 If theShapeWhere has curved parts with significantly
5256 outstanding centres (i.e. the mass centre of a part is closer to
5257 theShapeWhat than to the part), such parts will not be found.
5259 # Example: see GEOM_TestOthers.py
5261 if isNewImplementation:
5262 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5264 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5266 RaiseIfFailed("GetInPlace", self.ShapesOp)
5267 self._autoPublish(anObj, theName, "inplace")
5270 ## Get sub-shape(s) of \a theShapeWhere, which are
5271 # coincident with \a theShapeWhat or could be a part of it.
5273 # Implementation of this method is based on a saved history of an operation,
5274 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5275 # arguments (an argument shape or a sub-shape of an argument shape).
5276 # The operation could be the Partition or one of boolean operations,
5277 # performed on simple shapes (not on compounds).
5279 # @param theShapeWhere Shape to find sub-shapes of.
5280 # @param theShapeWhat Shape, specifying what to find (must be in the
5281 # building history of the ShapeWhere).
5282 # @param theName Object name; when specified, this parameter is used
5283 # for result publication in the study. Otherwise, if automatic
5284 # publication is switched on, default value is used for result name.
5286 # @return Group of all found sub-shapes or a single found sub-shape.
5288 # @ref swig_GetInPlace "Example"
5289 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5291 Implementation of this method is based on a saved history of an operation,
5292 produced theShapeWhere. The theShapeWhat must be among this operation's
5293 arguments (an argument shape or a sub-shape of an argument shape).
5294 The operation could be the Partition or one of boolean operations,
5295 performed on simple shapes (not on compounds).
5298 theShapeWhere Shape to find sub-shapes of.
5299 theShapeWhat Shape, specifying what to find (must be in the
5300 building history of the ShapeWhere).
5301 theName Object name; when specified, this parameter is used
5302 for result publication in the study. Otherwise, if automatic
5303 publication is switched on, default value is used for result name.
5306 Group of all found sub-shapes or a single found sub-shape.
5308 # Example: see GEOM_TestOthers.py
5309 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5310 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5311 self._autoPublish(anObj, theName, "inplace")
5314 ## Get sub-shape of theShapeWhere, which is
5315 # equal to \a theShapeWhat.
5316 # @param theShapeWhere Shape to find sub-shape of.
5317 # @param theShapeWhat Shape, specifying what to find.
5318 # @param theName Object name; when specified, this parameter is used
5319 # for result publication in the study. Otherwise, if automatic
5320 # publication is switched on, default value is used for result name.
5322 # @return New GEOM.GEOM_Object for found sub-shape.
5324 # @ref swig_GetSame "Example"
5325 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5327 Get sub-shape of theShapeWhere, which is
5328 equal to theShapeWhat.
5331 theShapeWhere Shape to find sub-shape of.
5332 theShapeWhat Shape, specifying what to find.
5333 theName Object name; when specified, this parameter is used
5334 for result publication in the study. Otherwise, if automatic
5335 publication is switched on, default value is used for result name.
5338 New GEOM.GEOM_Object for found sub-shape.
5340 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5341 RaiseIfFailed("GetSame", self.ShapesOp)
5342 self._autoPublish(anObj, theName, "sameShape")
5346 ## Get sub-shape indices of theShapeWhere, which is
5347 # equal to \a theShapeWhat.
5348 # @param theShapeWhere Shape to find sub-shape of.
5349 # @param theShapeWhat Shape, specifying what to find.
5350 # @return List of all found sub-shapes indices.
5352 # @ref swig_GetSame "Example"
5353 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5355 Get sub-shape indices of theShapeWhere, which is
5356 equal to theShapeWhat.
5359 theShapeWhere Shape to find sub-shape of.
5360 theShapeWhat Shape, specifying what to find.
5363 List of all found sub-shapes indices.
5365 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5366 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5373 ## @addtogroup l4_access
5376 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5377 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5378 # @param aShape Shape to get sub-shape of.
5379 # @param ListOfID List of sub-shapes indices.
5380 # @param theName Object name; when specified, this parameter is used
5381 # for result publication in the study. Otherwise, if automatic
5382 # publication is switched on, default value is used for result name.
5384 # @return Found sub-shape.
5386 # @ref swig_all_decompose "Example"
5387 def GetSubShape(self, aShape, ListOfID, theName=None):
5389 Obtain a composite sub-shape of aShape, composed from sub-shapes
5390 of aShape, selected by their unique IDs inside aShape
5393 aShape Shape to get sub-shape of.
5394 ListOfID List of sub-shapes indices.
5395 theName Object name; when specified, this parameter is used
5396 for result publication in the study. Otherwise, if automatic
5397 publication is switched on, default value is used for result name.
5402 # Example: see GEOM_TestAll.py
5403 anObj = self.AddSubShape(aShape,ListOfID)
5404 self._autoPublish(anObj, theName, "subshape")
5407 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5408 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5409 # @param aShape Shape to get sub-shape of.
5410 # @param aSubShape Sub-shapes of aShape.
5411 # @return ID of found sub-shape.
5413 # @ref swig_all_decompose "Example"
5414 def GetSubShapeID(self, aShape, aSubShape):
5416 Obtain unique ID of sub-shape aSubShape inside aShape
5417 of aShape, selected by their unique IDs inside aShape
5420 aShape Shape to get sub-shape of.
5421 aSubShape Sub-shapes of aShape.
5424 ID of found sub-shape.
5426 # Example: see GEOM_TestAll.py
5427 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5428 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5431 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5432 # This function is provided for performance purpose. The complexity is O(n) with n
5433 # the number of subobjects of aShape
5434 # @param aShape Shape to get sub-shape of.
5435 # @param aSubShapes Sub-shapes of aShape.
5436 # @return list of IDs of found sub-shapes.
5438 # @ref swig_all_decompose "Example"
5439 def GetSubShapesIDs(self, aShape, aSubShapes):
5441 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5442 This function is provided for performance purpose. The complexity is O(n) with n
5443 the number of subobjects of aShape
5446 aShape Shape to get sub-shape of.
5447 aSubShapes Sub-shapes of aShape.
5450 List of IDs of found sub-shape.
5452 # Example: see GEOM_TestAll.py
5453 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5454 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5460 ## @addtogroup l4_decompose
5463 ## Get all sub-shapes and groups of \a theShape,
5464 # that were created already by any other methods.
5465 # @param theShape Any shape.
5466 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5467 # returned, else all found sub-shapes and groups.
5468 # @return List of existing sub-objects of \a theShape.
5470 # @ref swig_all_decompose "Example"
5471 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5473 Get all sub-shapes and groups of theShape,
5474 that were created already by any other methods.
5478 theGroupsOnly If this parameter is TRUE, only groups will be
5479 returned, else all found sub-shapes and groups.
5482 List of existing sub-objects of theShape.
5484 # Example: see GEOM_TestAll.py
5485 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5486 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5489 ## Get all groups of \a theShape,
5490 # that were created already by any other methods.
5491 # @param theShape Any shape.
5492 # @return List of existing groups of \a theShape.
5494 # @ref swig_all_decompose "Example"
5495 def GetGroups(self, theShape):
5497 Get all groups of theShape,
5498 that were created already by any other methods.
5504 List of existing groups of theShape.
5506 # Example: see GEOM_TestAll.py
5507 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5508 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5511 ## Explode a shape on sub-shapes of a given type.
5512 # If the shape itself matches the type, it is also returned.
5513 # @param aShape Shape to be exploded.
5514 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5515 # @param theName Object name; when specified, this parameter is used
5516 # for result publication in the study. Otherwise, if automatic
5517 # publication is switched on, default value is used for result name.
5519 # @return List of sub-shapes of type theShapeType, contained in theShape.
5521 # @ref swig_all_decompose "Example"
5522 def SubShapeAll(self, aShape, aType, theName=None):
5524 Explode a shape on sub-shapes of a given type.
5525 If the shape itself matches the type, it is also returned.
5528 aShape Shape to be exploded.
5529 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5530 theName Object name; when specified, this parameter is used
5531 for result publication in the study. Otherwise, if automatic
5532 publication is switched on, default value is used for result name.
5535 List of sub-shapes of type theShapeType, contained in theShape.
5537 # Example: see GEOM_TestAll.py
5538 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5539 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5540 self._autoPublish(ListObj, theName, "subshape")
5543 ## Explode a shape on sub-shapes of a given type.
5544 # @param aShape Shape to be exploded.
5545 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5546 # @return List of IDs of sub-shapes.
5548 # @ref swig_all_decompose "Example"
5549 def SubShapeAllIDs(self, aShape, aType):
5551 Explode a shape on sub-shapes of a given type.
5554 aShape Shape to be exploded (see geompy.ShapeType)
5555 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5558 List of IDs of sub-shapes.
5560 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5561 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5564 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5565 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5566 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5567 # @param aShape Shape to get sub-shape of.
5568 # @param ListOfInd List of sub-shapes indices.
5569 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5570 # @param theName Object name; when specified, this parameter is used
5571 # for result publication in the study. Otherwise, if automatic
5572 # publication is switched on, default value is used for result name.
5574 # @return A compound of sub-shapes of aShape.
5576 # @ref swig_all_decompose "Example"
5577 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5579 Obtain a compound of sub-shapes of aShape,
5580 selected by their indices in list of all sub-shapes of type aType.
5581 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5584 aShape Shape to get sub-shape of.
5585 ListOfID List of sub-shapes indices.
5586 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5587 theName Object name; when specified, this parameter is used
5588 for result publication in the study. Otherwise, if automatic
5589 publication is switched on, default value is used for result name.
5592 A compound of sub-shapes of aShape.
5594 # Example: see GEOM_TestAll.py
5596 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5597 for ind in ListOfInd:
5598 ListOfIDs.append(AllShapeIDsList[ind - 1])
5599 # note: auto-publishing is done in self.GetSubShape()
5600 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5603 ## Explode a shape on sub-shapes of a given type.
5604 # Sub-shapes will be sorted by coordinates of their gravity centers.
5605 # If the shape itself matches the type, it is also returned.
5606 # @param aShape Shape to be exploded.
5607 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5608 # @param theName Object name; when specified, this parameter is used
5609 # for result publication in the study. Otherwise, if automatic
5610 # publication is switched on, default value is used for result name.
5612 # @return List of sub-shapes of type theShapeType, contained in theShape.
5614 # @ref swig_SubShapeAllSorted "Example"
5615 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5617 Explode a shape on sub-shapes of a given type.
5618 Sub-shapes will be sorted by coordinates of their gravity centers.
5619 If the shape itself matches the type, it is also returned.
5622 aShape Shape to be exploded.
5623 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5624 theName Object name; when specified, this parameter is used
5625 for result publication in the study. Otherwise, if automatic
5626 publication is switched on, default value is used for result name.
5629 List of sub-shapes of type theShapeType, contained in theShape.
5631 # Example: see GEOM_TestAll.py
5632 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5633 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5634 self._autoPublish(ListObj, theName, "subshape")
5637 ## Explode a shape on sub-shapes of a given type.
5638 # Sub-shapes will be sorted by coordinates of their gravity centers.
5639 # @param aShape Shape to be exploded.
5640 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5641 # @return List of IDs of sub-shapes.
5643 # @ref swig_all_decompose "Example"
5644 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5646 Explode a shape on sub-shapes of a given type.
5647 Sub-shapes will be sorted by coordinates of their gravity centers.
5650 aShape Shape to be exploded.
5651 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5654 List of IDs of sub-shapes.
5656 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5657 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5660 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5661 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5662 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5663 # @param aShape Shape to get sub-shape of.
5664 # @param ListOfInd List of sub-shapes indices.
5665 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5666 # @param theName Object name; when specified, this parameter is used
5667 # for result publication in the study. Otherwise, if automatic
5668 # publication is switched on, default value is used for result name.
5670 # @return A compound of sub-shapes of aShape.
5672 # @ref swig_all_decompose "Example"
5673 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5675 Obtain a compound of sub-shapes of aShape,
5676 selected by they indices in sorted list of all sub-shapes of type aType.
5677 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5680 aShape Shape to get sub-shape of.
5681 ListOfID List of sub-shapes indices.
5682 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5683 theName Object name; when specified, this parameter is used
5684 for result publication in the study. Otherwise, if automatic
5685 publication is switched on, default value is used for result name.
5688 A compound of sub-shapes of aShape.
5690 # Example: see GEOM_TestAll.py
5692 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5693 for ind in ListOfInd:
5694 ListOfIDs.append(AllShapeIDsList[ind - 1])
5695 # note: auto-publishing is done in self.GetSubShape()
5696 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5699 ## Extract shapes (excluding the main shape) of given type.
5700 # @param aShape The shape.
5701 # @param aType The shape type (see ShapeType())
5702 # @param isSorted Boolean flag to switch sorting on/off.
5703 # @param theName Object name; when specified, this parameter is used
5704 # for result publication in the study. Otherwise, if automatic
5705 # publication is switched on, default value is used for result name.
5707 # @return List of sub-shapes of type aType, contained in aShape.
5709 # @ref swig_FilletChamfer "Example"
5710 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5712 Extract shapes (excluding the main shape) of given type.
5716 aType The shape type (see geompy.ShapeType)
5717 isSorted Boolean flag to switch sorting on/off.
5718 theName Object name; when specified, this parameter is used
5719 for result publication in the study. Otherwise, if automatic
5720 publication is switched on, default value is used for result name.
5723 List of sub-shapes of type aType, contained in aShape.
5725 # Example: see GEOM_TestAll.py
5726 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5727 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5728 self._autoPublish(ListObj, theName, "subshape")
5731 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5732 # @param aShape Main shape.
5733 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5734 # @param theName Object name; when specified, this parameter is used
5735 # for result publication in the study. Otherwise, if automatic
5736 # publication is switched on, default value is used for result name.
5737 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5739 # @ref swig_all_decompose "Example"
5740 def SubShapes(self, aShape, anIDs, theName=None):
5742 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5746 anIDs List of unique IDs of sub-shapes inside theMainShape.
5747 theName Object name; when specified, this parameter is used
5748 for result publication in the study. Otherwise, if automatic
5749 publication is switched on, default value is used for result name.
5752 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5754 # Example: see GEOM_TestAll.py
5755 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5756 RaiseIfFailed("SubShapes", self.ShapesOp)
5757 self._autoPublish(ListObj, theName, "subshape")
5760 # end of l4_decompose
5763 ## @addtogroup l4_decompose_d
5766 ## Deprecated method
5767 # It works like SubShapeAllSortedCentres(), but wrongly
5768 # defines centres of faces, shells and solids.
5769 def SubShapeAllSorted(self, aShape, aType, theName=None):
5772 It works like geompy.SubShapeAllSortedCentres, but wrongly
5773 defines centres of faces, shells and solids.
5775 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5776 RaiseIfFailed("MakeExplode", self.ShapesOp)
5777 self._autoPublish(ListObj, theName, "subshape")
5780 ## Deprecated method
5781 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5782 # defines centres of faces, shells and solids.
5783 def SubShapeAllSortedIDs(self, aShape, aType):
5786 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5787 defines centres of faces, shells and solids.
5789 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5790 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5793 ## Deprecated method
5794 # It works like SubShapeSortedCentres(), but has a bug
5795 # (wrongly defines centres of faces, shells and solids).
5796 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5799 It works like geompy.SubShapeSortedCentres, but has a bug
5800 (wrongly defines centres of faces, shells and solids).
5803 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5804 for ind in ListOfInd:
5805 ListOfIDs.append(AllShapeIDsList[ind - 1])
5806 # note: auto-publishing is done in self.GetSubShape()
5807 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5810 # end of l4_decompose_d
5813 ## @addtogroup l3_healing
5816 ## Apply a sequence of Shape Healing operators to the given object.
5817 # @param theShape Shape to be processed.
5818 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5819 # @param theParameters List of names of parameters
5820 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5821 # @param theValues List of values of parameters, in the same order
5822 # as parameters are listed in <VAR>theParameters</VAR> list.
5823 # @param theName Object name; when specified, this parameter is used
5824 # for result publication in the study. Otherwise, if automatic
5825 # publication is switched on, default value is used for result name.
5827 # <b> Operators and Parameters: </b> \n
5829 # * \b FixShape - corrects invalid shapes. \n
5830 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5831 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5833 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5834 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5835 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5836 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5838 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5839 # surfaces in segments using a certain angle. \n
5840 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5841 # if Angle=180, four if Angle=90, etc). \n
5842 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5844 # * \b SplitClosedFaces - splits closed faces in segments.
5845 # The number of segments depends on the number of splitting points.\n
5846 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5848 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5849 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5850 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5851 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5852 # This and the previous parameters can take the following values:\n
5853 # \b Parametric \b Continuity \n
5854 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5855 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5856 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5857 # ruling out sharp edges).\n
5858 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5859 # are of the same magnitude).\n
5860 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5861 # or surfaces (d/du C(u)) are the same at junction. \n
5862 # \b Geometric \b Continuity \n
5863 # \b G1: first derivatives are proportional at junction.\n
5864 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5865 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5866 # \b G2: first and second derivatives are proportional at junction.
5867 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5868 # continuity requires that the underlying parameterization was continuous as well.
5869 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5871 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5872 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5873 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5874 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5875 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5876 # with the specified parameters.\n
5877 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5878 # with the specified parameters.\n
5879 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5880 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5881 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5882 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5884 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5885 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5886 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5887 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5888 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5890 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5891 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5894 # @return New GEOM.GEOM_Object, containing processed shape.
5896 # \n @ref tui_shape_processing "Example"
5897 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5899 Apply a sequence of Shape Healing operators to the given object.
5902 theShape Shape to be processed.
5903 theValues List of values of parameters, in the same order
5904 as parameters are listed in theParameters list.
5905 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5906 theParameters List of names of parameters
5907 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5908 theName Object name; when specified, this parameter is used
5909 for result publication in the study. Otherwise, if automatic
5910 publication is switched on, default value is used for result name.
5912 Operators and Parameters:
5914 * FixShape - corrects invalid shapes.
5915 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5916 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5917 * FixFaceSize - removes small faces, such as spots and strips.
5918 * FixFaceSize.Tolerance - defines minimum possible face size.
5919 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5920 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5921 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5922 in segments using a certain angle.
5923 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5924 if Angle=180, four if Angle=90, etc).
5925 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5926 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5928 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5929 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5930 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5931 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5932 * SplitContinuity.CurveContinuity - required continuity for curves.
5933 This and the previous parameters can take the following values:
5935 Parametric Continuity:
5936 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5937 coincidental. The curves or surfaces may still meet at an angle,
5938 giving rise to a sharp corner or edge).
5939 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5940 are parallel, ruling out sharp edges).
5941 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5942 or surfaces are of the same magnitude).
5943 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5944 curves or surfaces (d/du C(u)) are the same at junction.
5946 Geometric Continuity:
5947 G1: first derivatives are proportional at junction.
5948 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5949 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5950 G2: first and second derivatives are proportional at junction. As the names imply,
5951 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5952 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5953 geometric continuity of order n, but not vice-versa.
5954 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5955 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5956 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5957 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5958 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5959 the specified parameters.
5960 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5961 the specified parameters.
5962 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5963 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5964 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5965 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5966 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5967 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5968 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5969 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5970 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5971 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5972 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5975 New GEOM.GEOM_Object, containing processed shape.
5977 Note: For more information look through SALOME Geometry User's Guide->
5978 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5980 # Example: see GEOM_TestHealing.py
5981 theValues,Parameters = ParseList(theValues)
5982 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5983 # To avoid script failure in case of good argument shape
5984 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5986 RaiseIfFailed("ProcessShape", self.HealOp)
5987 for string in (theOperators + theParameters):
5988 Parameters = ":" + Parameters
5990 anObj.SetParameters(Parameters)
5991 self._autoPublish(anObj, theName, "healed")
5994 ## Remove faces from the given object (shape).
5995 # @param theObject Shape to be processed.
5996 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5997 # removes ALL faces of the given object.
5998 # @param theName Object name; when specified, this parameter is used
5999 # for result publication in the study. Otherwise, if automatic
6000 # publication is switched on, default value is used for result name.
6002 # @return New GEOM.GEOM_Object, containing processed shape.
6004 # @ref tui_suppress_faces "Example"
6005 def SuppressFaces(self, theObject, theFaces, theName=None):
6007 Remove faces from the given object (shape).
6010 theObject Shape to be processed.
6011 theFaces Indices of faces to be removed, if EMPTY then the method
6012 removes ALL faces of the given object.
6013 theName Object name; when specified, this parameter is used
6014 for result publication in the study. Otherwise, if automatic
6015 publication is switched on, default value is used for result name.
6018 New GEOM.GEOM_Object, containing processed shape.
6020 # Example: see GEOM_TestHealing.py
6021 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6022 RaiseIfFailed("SuppressFaces", self.HealOp)
6023 self._autoPublish(anObj, theName, "suppressFaces")
6026 ## Sewing of some shapes into single shape.
6027 # @param ListShape Shapes to be processed.
6028 # @param theTolerance Required tolerance value.
6029 # @param AllowNonManifold Flag that allows non-manifold sewing.
6030 # @param theName Object name; when specified, this parameter is used
6031 # for result publication in the study. Otherwise, if automatic
6032 # publication is switched on, default value is used for result name.
6034 # @return New GEOM.GEOM_Object, containing processed shape.
6036 # @ref tui_sewing "Example"
6037 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6039 Sewing of some shapes into single shape.
6042 ListShape Shapes to be processed.
6043 theTolerance Required tolerance value.
6044 AllowNonManifold Flag that allows non-manifold sewing.
6045 theName Object name; when specified, this parameter is used
6046 for result publication in the study. Otherwise, if automatic
6047 publication is switched on, default value is used for result name.
6050 New GEOM.GEOM_Object, containing processed shape.
6052 # Example: see GEOM_TestHealing.py
6053 comp = self.MakeCompound(ListShape)
6054 # note: auto-publishing is done in self.Sew()
6055 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6058 ## Sewing of the given object.
6059 # @param theObject Shape to be processed.
6060 # @param theTolerance Required tolerance value.
6061 # @param AllowNonManifold Flag that allows non-manifold sewing.
6062 # @param theName Object name; when specified, this parameter is used
6063 # for result publication in the study. Otherwise, if automatic
6064 # publication is switched on, default value is used for result name.
6066 # @return New GEOM.GEOM_Object, containing processed shape.
6067 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6069 Sewing of the given object.
6072 theObject Shape to be processed.
6073 theTolerance Required tolerance value.
6074 AllowNonManifold Flag that allows non-manifold sewing.
6075 theName Object name; when specified, this parameter is used
6076 for result publication in the study. Otherwise, if automatic
6077 publication is switched on, default value is used for result name.
6080 New GEOM.GEOM_Object, containing processed shape.
6082 # Example: see MakeSewing() above
6083 theTolerance,Parameters = ParseParameters(theTolerance)
6084 if AllowNonManifold:
6085 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6087 anObj = self.HealOp.Sew(theObject, theTolerance)
6088 # To avoid script failure in case of good argument shape
6089 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6091 RaiseIfFailed("Sew", self.HealOp)
6092 anObj.SetParameters(Parameters)
6093 self._autoPublish(anObj, theName, "sewed")
6096 ## Rebuild the topology of theCompound of solids by removing
6097 # of the faces that are shared by several solids.
6098 # @param theCompound Shape to be processed.
6099 # @param 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.
6103 # @return New GEOM.GEOM_Object, containing processed shape.
6105 # @ref tui_remove_webs "Example"
6106 def RemoveInternalFaces (self, theCompound, theName=None):
6108 Rebuild the topology of theCompound of solids by removing
6109 of the faces that are shared by several solids.
6112 theCompound Shape to be processed.
6113 theName Object name; when specified, this parameter is used
6114 for result publication in the study. Otherwise, if automatic
6115 publication is switched on, default value is used for result name.
6118 New GEOM.GEOM_Object, containing processed shape.
6120 # Example: see GEOM_TestHealing.py
6121 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6122 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6123 self._autoPublish(anObj, theName, "removeWebs")
6126 ## Remove internal wires and edges from the given object (face).
6127 # @param theObject Shape to be processed.
6128 # @param theWires Indices of wires to be removed, if EMPTY then the method
6129 # removes ALL internal wires of the given object.
6130 # @param theName Object name; when specified, this parameter is used
6131 # for result publication in the study. Otherwise, if automatic
6132 # publication is switched on, default value is used for result name.
6134 # @return New GEOM.GEOM_Object, containing processed shape.
6136 # @ref tui_suppress_internal_wires "Example"
6137 def SuppressInternalWires(self, theObject, theWires, theName=None):
6139 Remove internal wires and edges from the given object (face).
6142 theObject Shape to be processed.
6143 theWires Indices of wires to be removed, if EMPTY then the method
6144 removes ALL internal wires of the given object.
6145 theName Object name; when specified, this parameter is used
6146 for result publication in the study. Otherwise, if automatic
6147 publication is switched on, default value is used for result name.
6150 New GEOM.GEOM_Object, containing processed shape.
6152 # Example: see GEOM_TestHealing.py
6153 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6154 RaiseIfFailed("RemoveIntWires", self.HealOp)
6155 self._autoPublish(anObj, theName, "suppressWires")
6158 ## Remove internal closed contours (holes) from the given object.
6159 # @param theObject Shape to be processed.
6160 # @param theWires Indices of wires to be removed, if EMPTY then the method
6161 # removes ALL internal holes of the given object
6162 # @param theName Object name; when specified, this parameter is used
6163 # for result publication in the study. Otherwise, if automatic
6164 # publication is switched on, default value is used for result name.
6166 # @return New GEOM.GEOM_Object, containing processed shape.
6168 # @ref tui_suppress_holes "Example"
6169 def SuppressHoles(self, theObject, theWires, theName=None):
6171 Remove internal closed contours (holes) from the given object.
6174 theObject Shape to be processed.
6175 theWires Indices of wires to be removed, if EMPTY then the method
6176 removes ALL internal holes of the given object
6177 theName Object name; when specified, this parameter is used
6178 for result publication in the study. Otherwise, if automatic
6179 publication is switched on, default value is used for result name.
6182 New GEOM.GEOM_Object, containing processed shape.
6184 # Example: see GEOM_TestHealing.py
6185 anObj = self.HealOp.FillHoles(theObject, theWires)
6186 RaiseIfFailed("FillHoles", self.HealOp)
6187 self._autoPublish(anObj, theName, "suppressHoles")
6190 ## Close an open wire.
6191 # @param theObject Shape to be processed.
6192 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6193 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6194 # @param isCommonVertex If True : closure by creation of a common vertex,
6195 # If False : closure by creation of an edge between ends.
6196 # @param theName Object name; when specified, this parameter is used
6197 # for result publication in the study. Otherwise, if automatic
6198 # publication is switched on, default value is used for result name.
6200 # @return New GEOM.GEOM_Object, containing processed shape.
6202 # @ref tui_close_contour "Example"
6203 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6208 theObject Shape to be processed.
6209 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6210 if [ ], then theObject itself is a wire.
6211 isCommonVertex If True : closure by creation of a common vertex,
6212 If False : closure by creation of an edge between ends.
6213 theName Object name; when specified, this parameter is used
6214 for result publication in the study. Otherwise, if automatic
6215 publication is switched on, default value is used for result name.
6218 New GEOM.GEOM_Object, containing processed shape.
6220 # Example: see GEOM_TestHealing.py
6221 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6222 RaiseIfFailed("CloseContour", self.HealOp)
6223 self._autoPublish(anObj, theName, "closeContour")
6226 ## Addition of a point to a given edge object.
6227 # @param theObject Shape to be processed.
6228 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6229 # if -1, then theObject itself is the edge.
6230 # @param theValue Value of parameter on edge or length parameter,
6231 # depending on \a isByParameter.
6232 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6233 # if FALSE : \a theValue is treated as a length parameter [0..1]
6234 # @param theName Object name; when specified, this parameter is used
6235 # for result publication in the study. Otherwise, if automatic
6236 # publication is switched on, default value is used for result name.
6238 # @return New GEOM.GEOM_Object, containing processed shape.
6240 # @ref tui_add_point_on_edge "Example"
6241 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6243 Addition of a point to a given edge object.
6246 theObject Shape to be processed.
6247 theEdgeIndex Index of edge to be divided within theObject's shape,
6248 if -1, then theObject itself is the edge.
6249 theValue Value of parameter on edge or length parameter,
6250 depending on isByParameter.
6251 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6252 if FALSE : theValue is treated as a length parameter [0..1]
6253 theName Object name; when specified, this parameter is used
6254 for result publication in the study. Otherwise, if automatic
6255 publication is switched on, default value is used for result name.
6258 New GEOM.GEOM_Object, containing processed shape.
6260 # Example: see GEOM_TestHealing.py
6261 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6262 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6263 RaiseIfFailed("DivideEdge", self.HealOp)
6264 anObj.SetParameters(Parameters)
6265 self._autoPublish(anObj, theName, "divideEdge")
6268 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6269 # @param theWire Wire to minimize the number of C1 continuous edges in.
6270 # @param theVertices A list of vertices to suppress. If the list
6271 # is empty, all vertices in a wire will be assumed.
6272 # @param theName Object name; when specified, this parameter is used
6273 # for result publication in the study. Otherwise, if automatic
6274 # publication is switched on, default value is used for result name.
6276 # @return New GEOM.GEOM_Object with modified wire.
6278 # @ref tui_fuse_collinear_edges "Example"
6279 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6281 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6284 theWire Wire to minimize the number of C1 continuous edges in.
6285 theVertices A list of vertices to suppress. If the list
6286 is empty, all vertices in a wire will be assumed.
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 with modified wire.
6294 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6295 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6296 self._autoPublish(anObj, theName, "fuseEdges")
6299 ## Change orientation of the given object. Updates given shape.
6300 # @param theObject Shape to be processed.
6301 # @return Updated <var>theObject</var>
6303 # @ref swig_todo "Example"
6304 def ChangeOrientationShell(self,theObject):
6306 Change orientation of the given object. Updates given shape.
6309 theObject Shape to be processed.
6314 theObject = self.HealOp.ChangeOrientation(theObject)
6315 RaiseIfFailed("ChangeOrientation", self.HealOp)
6318 ## Change orientation of the given object.
6319 # @param theObject Shape to be processed.
6320 # @param theName Object name; when specified, this parameter is used
6321 # for result publication in the study. Otherwise, if automatic
6322 # publication is switched on, default value is used for result name.
6324 # @return New GEOM.GEOM_Object, containing processed shape.
6326 # @ref swig_todo "Example"
6327 def ChangeOrientationShellCopy(self, theObject, theName=None):
6329 Change orientation of the given object.
6332 theObject Shape to be processed.
6333 theName Object name; when specified, this parameter is used
6334 for result publication in the study. Otherwise, if automatic
6335 publication is switched on, default value is used for result name.
6338 New GEOM.GEOM_Object, containing processed shape.
6340 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6341 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6342 self._autoPublish(anObj, theName, "reversed")
6345 ## Try to limit tolerance of the given object by value \a theTolerance.
6346 # @param theObject Shape to be processed.
6347 # @param theTolerance Required tolerance value.
6348 # @param 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.
6352 # @return New GEOM.GEOM_Object, containing processed shape.
6354 # @ref tui_limit_tolerance "Example"
6355 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6357 Try to limit tolerance of the given object by value theTolerance.
6360 theObject Shape to be processed.
6361 theTolerance Required tolerance value.
6362 theName Object name; when specified, this parameter is used
6363 for result publication in the study. Otherwise, if automatic
6364 publication is switched on, default value is used for result name.
6367 New GEOM.GEOM_Object, containing processed shape.
6369 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6370 RaiseIfFailed("LimitTolerance", self.HealOp)
6371 self._autoPublish(anObj, theName, "limitTolerance")
6374 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6375 # that constitute a free boundary of the given shape.
6376 # @param theObject Shape to get free boundary of.
6377 # @param theName Object name; when specified, this parameter is used
6378 # for result publication in the study. Otherwise, if automatic
6379 # publication is switched on, default value is used for result name.
6381 # @return [\a status, \a theClosedWires, \a theOpenWires]
6382 # \n \a status: FALSE, if an error(s) occured during the method execution.
6383 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6384 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6386 # @ref tui_measurement_tools_page "Example"
6387 def GetFreeBoundary(self, theObject, theName=None):
6389 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6390 that constitute a free boundary of the given shape.
6393 theObject Shape to get free boundary of.
6394 theName Object name; when specified, this parameter is used
6395 for result publication in the study. Otherwise, if automatic
6396 publication is switched on, default value is used for result name.
6399 [status, theClosedWires, theOpenWires]
6400 status: FALSE, if an error(s) occured during the method execution.
6401 theClosedWires: Closed wires on the free boundary of the given shape.
6402 theOpenWires: Open wires on the free boundary of the given shape.
6404 # Example: see GEOM_TestHealing.py
6405 anObj = self.HealOp.GetFreeBoundary(theObject)
6406 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6407 self._autoPublish(anObj[1], theName, "closedWire")
6408 self._autoPublish(anObj[2], theName, "openWire")
6411 ## Replace coincident faces in theShape by one face.
6412 # @param theShape Initial shape.
6413 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6414 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6415 # otherwise all initial shapes.
6416 # @param theName Object name; when specified, this parameter is used
6417 # for result publication in the study. Otherwise, if automatic
6418 # publication is switched on, default value is used for result name.
6420 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6422 # @ref tui_glue_faces "Example"
6423 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6425 Replace coincident faces in theShape by one face.
6428 theShape Initial shape.
6429 theTolerance Maximum distance between faces, which can be considered as coincident.
6430 doKeepNonSolids If FALSE, only solids will present in the result,
6431 otherwise all initial shapes.
6432 theName Object name; when specified, this parameter is used
6433 for result publication in the study. Otherwise, if automatic
6434 publication is switched on, default value is used for result name.
6437 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6439 # Example: see GEOM_Spanner.py
6440 theTolerance,Parameters = ParseParameters(theTolerance)
6441 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6443 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6444 anObj.SetParameters(Parameters)
6445 self._autoPublish(anObj, theName, "glueFaces")
6448 ## Find coincident faces in theShape for possible gluing.
6449 # @param theShape Initial shape.
6450 # @param theTolerance Maximum distance between faces,
6451 # which can be considered as coincident.
6452 # @param theName Object name; when specified, this parameter is used
6453 # for result publication in the study. Otherwise, if automatic
6454 # publication is switched on, default value is used for result name.
6456 # @return GEOM.ListOfGO
6458 # @ref tui_glue_faces "Example"
6459 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6461 Find coincident faces in theShape for possible gluing.
6464 theShape Initial shape.
6465 theTolerance Maximum distance between faces,
6466 which can be considered as coincident.
6467 theName Object name; when specified, this parameter is used
6468 for result publication in the study. Otherwise, if automatic
6469 publication is switched on, default value is used for result name.
6474 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6475 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6476 self._autoPublish(anObj, theName, "facesToGlue")
6479 ## Replace coincident faces in theShape by one face
6480 # in compliance with given list of faces
6481 # @param theShape Initial shape.
6482 # @param theTolerance Maximum distance between faces,
6483 # which can be considered as coincident.
6484 # @param theFaces List of faces for gluing.
6485 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6486 # otherwise all initial shapes.
6487 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6488 # will be glued, otherwise only the edges,
6489 # belonging to <VAR>theFaces</VAR>.
6490 # @param theName Object name; when specified, this parameter is used
6491 # for result publication in the study. Otherwise, if automatic
6492 # publication is switched on, default value is used for result name.
6494 # @return New GEOM.GEOM_Object, containing a copy of theShape
6495 # without some faces.
6497 # @ref tui_glue_faces "Example"
6498 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6499 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6501 Replace coincident faces in theShape by one face
6502 in compliance with given list of faces
6505 theShape Initial shape.
6506 theTolerance Maximum distance between faces,
6507 which can be considered as coincident.
6508 theFaces List of faces for gluing.
6509 doKeepNonSolids If FALSE, only solids will present in the result,
6510 otherwise all initial shapes.
6511 doGlueAllEdges If TRUE, all coincident edges of theShape
6512 will be glued, otherwise only the edges,
6513 belonging to theFaces.
6514 theName Object name; when specified, this parameter is used
6515 for result publication in the study. Otherwise, if automatic
6516 publication is switched on, default value is used for result name.
6519 New GEOM.GEOM_Object, containing a copy of theShape
6522 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6523 doKeepNonSolids, doGlueAllEdges)
6525 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6526 self._autoPublish(anObj, theName, "glueFaces")
6529 ## Replace coincident edges in theShape by one edge.
6530 # @param theShape Initial shape.
6531 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6532 # @param theName Object name; when specified, this parameter is used
6533 # for result publication in the study. Otherwise, if automatic
6534 # publication is switched on, default value is used for result name.
6536 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6538 # @ref tui_glue_edges "Example"
6539 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6541 Replace coincident edges in theShape by one edge.
6544 theShape Initial shape.
6545 theTolerance Maximum distance between edges, which can be considered as coincident.
6546 theName Object name; when specified, this parameter is used
6547 for result publication in the study. Otherwise, if automatic
6548 publication is switched on, default value is used for result name.
6551 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6553 theTolerance,Parameters = ParseParameters(theTolerance)
6554 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6556 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6557 anObj.SetParameters(Parameters)
6558 self._autoPublish(anObj, theName, "glueEdges")
6561 ## Find coincident edges in theShape for possible gluing.
6562 # @param theShape Initial shape.
6563 # @param theTolerance Maximum distance between edges,
6564 # which can be considered as coincident.
6565 # @param theName Object name; when specified, this parameter is used
6566 # for result publication in the study. Otherwise, if automatic
6567 # publication is switched on, default value is used for result name.
6569 # @return GEOM.ListOfGO
6571 # @ref tui_glue_edges "Example"
6572 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6574 Find coincident edges in theShape for possible gluing.
6577 theShape Initial shape.
6578 theTolerance Maximum distance between edges,
6579 which can be considered as coincident.
6580 theName Object name; when specified, this parameter is used
6581 for result publication in the study. Otherwise, if automatic
6582 publication is switched on, default value is used for result name.
6587 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6588 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6589 self._autoPublish(anObj, theName, "edgesToGlue")
6592 ## Replace coincident edges in theShape by one edge
6593 # in compliance with given list of edges.
6594 # @param theShape Initial shape.
6595 # @param theTolerance Maximum distance between edges,
6596 # which can be considered as coincident.
6597 # @param theEdges List of edges for gluing.
6598 # @param theName Object name; when specified, this parameter is used
6599 # for result publication in the study. Otherwise, if automatic
6600 # publication is switched on, default value is used for result name.
6602 # @return New GEOM.GEOM_Object, containing a copy of theShape
6603 # without some edges.
6605 # @ref tui_glue_edges "Example"
6606 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6608 Replace coincident edges in theShape by one edge
6609 in compliance with given list of edges.
6612 theShape Initial shape.
6613 theTolerance Maximum distance between edges,
6614 which can be considered as coincident.
6615 theEdges List of edges for gluing.
6616 theName Object name; when specified, this parameter is used
6617 for result publication in the study. Otherwise, if automatic
6618 publication is switched on, default value is used for result name.
6621 New GEOM.GEOM_Object, containing a copy of theShape
6624 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6626 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6627 self._autoPublish(anObj, theName, "glueEdges")
6633 ## @addtogroup l3_boolean Boolean Operations
6636 # -----------------------------------------------------------------------------
6637 # Boolean (Common, Cut, Fuse, Section)
6638 # -----------------------------------------------------------------------------
6640 ## Perform one of boolean operations on two given shapes.
6641 # @param theShape1 First argument for boolean operation.
6642 # @param theShape2 Second argument for boolean operation.
6643 # @param theOperation Indicates the operation to be done:\n
6644 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6645 # @param checkSelfInte The flag that tells if the arguments should
6646 # be checked for self-intersection prior to the operation.
6647 # @param 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.
6651 # @return New GEOM.GEOM_Object, containing the result shape.
6653 # @ref tui_fuse "Example"
6654 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6656 Perform one of boolean operations on two given shapes.
6659 theShape1 First argument for boolean operation.
6660 theShape2 Second argument for boolean operation.
6661 theOperation Indicates the operation to be done:
6662 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6663 checkSelfInte The flag that tells if the arguments should
6664 be checked for self-intersection prior to
6666 theName Object name; when specified, this parameter is used
6667 for result publication in the study. Otherwise, if automatic
6668 publication is switched on, default value is used for result name.
6671 New GEOM.GEOM_Object, containing the result shape.
6673 # Example: see GEOM_TestAll.py
6674 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6675 RaiseIfFailed("MakeBoolean", self.BoolOp)
6676 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6677 self._autoPublish(anObj, theName, def_names[theOperation])
6680 ## Perform Common boolean operation on two given shapes.
6681 # @param theShape1 First argument for boolean operation.
6682 # @param theShape2 Second argument for boolean operation.
6683 # @param checkSelfInte The flag that tells if the arguments should
6684 # be checked for self-intersection prior to the operation.
6685 # @param theName Object name; when specified, this parameter is used
6686 # for result publication in the study. Otherwise, if automatic
6687 # publication is switched on, default value is used for result name.
6689 # @return New GEOM.GEOM_Object, containing the result shape.
6691 # @ref tui_common "Example 1"
6692 # \n @ref swig_MakeCommon "Example 2"
6693 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6695 Perform Common boolean operation on two given shapes.
6698 theShape1 First argument for boolean operation.
6699 theShape2 Second argument for boolean operation.
6700 checkSelfInte The flag that tells if the arguments should
6701 be checked for self-intersection prior to
6703 theName Object name; when specified, this parameter is used
6704 for result publication in the study. Otherwise, if automatic
6705 publication is switched on, default value is used for result name.
6708 New GEOM.GEOM_Object, containing the result shape.
6710 # Example: see GEOM_TestOthers.py
6711 # note: auto-publishing is done in self.MakeBoolean()
6712 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6714 ## Perform Cut boolean operation on two given shapes.
6715 # @param theShape1 First argument for boolean operation.
6716 # @param theShape2 Second argument for boolean operation.
6717 # @param checkSelfInte The flag that tells if the arguments should
6718 # be checked for self-intersection prior to the operation.
6719 # @param theName Object name; when specified, this parameter is used
6720 # for result publication in the study. Otherwise, if automatic
6721 # publication is switched on, default value is used for result name.
6723 # @return New GEOM.GEOM_Object, containing the result shape.
6725 # @ref tui_cut "Example 1"
6726 # \n @ref swig_MakeCommon "Example 2"
6727 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6729 Perform Cut boolean operation on two given shapes.
6732 theShape1 First argument for boolean operation.
6733 theShape2 Second argument for boolean operation.
6734 checkSelfInte The flag that tells if the arguments should
6735 be checked for self-intersection prior to
6737 theName Object name; when specified, this parameter is used
6738 for result publication in the study. Otherwise, if automatic
6739 publication is switched on, default value is used for result name.
6742 New GEOM.GEOM_Object, containing the result shape.
6745 # Example: see GEOM_TestOthers.py
6746 # note: auto-publishing is done in self.MakeBoolean()
6747 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
6749 ## Perform Fuse boolean operation on two given shapes.
6750 # @param theShape1 First argument for boolean operation.
6751 # @param theShape2 Second argument for boolean operation.
6752 # @param checkSelfInte The flag that tells if the arguments should
6753 # be checked for self-intersection prior to the operation.
6754 # @param theName Object name; when specified, this parameter is used
6755 # for result publication in the study. Otherwise, if automatic
6756 # publication is switched on, default value is used for result name.
6758 # @return New GEOM.GEOM_Object, containing the result shape.
6760 # @ref tui_fuse "Example 1"
6761 # \n @ref swig_MakeCommon "Example 2"
6762 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6764 Perform Fuse boolean operation on two given shapes.
6767 theShape1 First argument for boolean operation.
6768 theShape2 Second argument for boolean operation.
6769 checkSelfInte The flag that tells if the arguments should
6770 be checked for self-intersection prior to
6772 theName Object name; when specified, this parameter is used
6773 for result publication in the study. Otherwise, if automatic
6774 publication is switched on, default value is used for result name.
6777 New GEOM.GEOM_Object, containing the result shape.
6780 # Example: see GEOM_TestOthers.py
6781 # note: auto-publishing is done in self.MakeBoolean()
6782 return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
6784 ## Perform Section boolean operation on two given shapes.
6785 # @param theShape1 First argument for boolean operation.
6786 # @param theShape2 Second argument for boolean operation.
6787 # @param checkSelfInte The flag that tells if the arguments should
6788 # be checked for self-intersection prior to the operation.
6789 # @param theName Object name; when specified, this parameter is used
6790 # for result publication in the study. Otherwise, if automatic
6791 # publication is switched on, default value is used for result name.
6793 # @return New GEOM.GEOM_Object, containing the result shape.
6795 # @ref tui_section "Example 1"
6796 # \n @ref swig_MakeCommon "Example 2"
6797 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6799 Perform Section boolean operation on two given shapes.
6802 theShape1 First argument for boolean operation.
6803 theShape2 Second argument for boolean operation.
6804 checkSelfInte The flag that tells if the arguments should
6805 be checked for self-intersection prior to
6807 theName Object name; when specified, this parameter is used
6808 for result publication in the study. Otherwise, if automatic
6809 publication is switched on, default value is used for result name.
6812 New GEOM.GEOM_Object, containing the result shape.
6815 # Example: see GEOM_TestOthers.py
6816 # note: auto-publishing is done in self.MakeBoolean()
6817 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
6819 ## Perform Fuse boolean operation on the list of shapes.
6820 # @param theShapesList Shapes to be fused.
6821 # @param checkSelfInte The flag that tells if the arguments should
6822 # be checked for self-intersection prior to the operation.
6823 # @param theName Object name; when specified, this parameter is used
6824 # for result publication in the study. Otherwise, if automatic
6825 # publication is switched on, default value is used for result name.
6827 # @return New GEOM.GEOM_Object, containing the result shape.
6829 # @ref tui_fuse "Example 1"
6830 # \n @ref swig_MakeCommon "Example 2"
6831 def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
6833 Perform Fuse boolean operation on the list of shapes.
6836 theShapesList Shapes to be fused.
6837 checkSelfInte The flag that tells if the arguments should
6838 be checked for self-intersection prior to
6840 theName Object name; when specified, this parameter is used
6841 for result publication in the study. Otherwise, if automatic
6842 publication is switched on, default value is used for result name.
6845 New GEOM.GEOM_Object, containing the result shape.
6848 # Example: see GEOM_TestOthers.py
6849 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
6850 RaiseIfFailed("MakeFuseList", self.BoolOp)
6851 self._autoPublish(anObj, theName, "fuse")
6854 ## Perform Common boolean operation on the list of shapes.
6855 # @param theShapesList Shapes for Common operation.
6856 # @param checkSelfInte The flag that tells if the arguments should
6857 # be checked for self-intersection prior to the operation.
6858 # @param theName Object name; when specified, this parameter is used
6859 # for result publication in the study. Otherwise, if automatic
6860 # publication is switched on, default value is used for result name.
6862 # @return New GEOM.GEOM_Object, containing the result shape.
6864 # @ref tui_common "Example 1"
6865 # \n @ref swig_MakeCommon "Example 2"
6866 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
6868 Perform Common boolean operation on the list of shapes.
6871 theShapesList Shapes for Common operation.
6872 checkSelfInte The flag that tells if the arguments should
6873 be checked for self-intersection prior to
6875 theName Object name; when specified, this parameter is used
6876 for result publication in the study. Otherwise, if automatic
6877 publication is switched on, default value is used for result name.
6880 New GEOM.GEOM_Object, containing the result shape.
6883 # Example: see GEOM_TestOthers.py
6884 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
6885 RaiseIfFailed("MakeCommonList", self.BoolOp)
6886 self._autoPublish(anObj, theName, "common")
6889 ## Perform Cut boolean operation on one object and the list of tools.
6890 # @param theMainShape The object of the operation.
6891 # @param theShapesList The list of tools of the operation.
6892 # @param checkSelfInte The flag that tells if the arguments should
6893 # be checked for self-intersection prior to the operation.
6894 # @param theName Object name; when specified, this parameter is used
6895 # for result publication in the study. Otherwise, if automatic
6896 # publication is switched on, default value is used for result name.
6898 # @return New GEOM.GEOM_Object, containing the result shape.
6900 # @ref tui_cut "Example 1"
6901 # \n @ref swig_MakeCommon "Example 2"
6902 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
6904 Perform Cut boolean operation on one object and the list of tools.
6907 theMainShape The object of the operation.
6908 theShapesList The list of tools of the operation.
6909 checkSelfInte The flag that tells if the arguments should
6910 be checked for self-intersection prior to
6912 theName Object name; when specified, this parameter is used
6913 for result publication in the study. Otherwise, if automatic
6914 publication is switched on, default value is used for result name.
6917 New GEOM.GEOM_Object, containing the result shape.
6920 # Example: see GEOM_TestOthers.py
6921 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
6922 RaiseIfFailed("MakeCutList", self.BoolOp)
6923 self._autoPublish(anObj, theName, "cut")
6929 ## @addtogroup l3_basic_op
6932 ## Perform partition operation.
6933 # @param ListShapes Shapes to be intersected.
6934 # @param ListTools Shapes to intersect theShapes.
6935 # @param Limit Type of resulting shapes (see ShapeType()).\n
6936 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6937 # type will be detected automatically.
6938 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6939 # target type (equal to Limit) are kept in the result,
6940 # else standalone shapes of lower dimension
6941 # are kept also (if they exist).
6942 # @param theName Object name; when specified, this parameter is used
6943 # for result publication in the study. Otherwise, if automatic
6944 # publication is switched on, default value is used for result name.
6946 # @note Each compound from ListShapes and ListTools will be exploded
6947 # in order to avoid possible intersection between shapes from this compound.
6949 # After implementation new version of PartitionAlgo (October 2006)
6950 # other parameters are ignored by current functionality. They are kept
6951 # in this function only for support old versions.
6952 # @param ListKeepInside Shapes, outside which the results will be deleted.
6953 # Each shape from theKeepInside must belong to theShapes also.
6954 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6955 # Each shape from theRemoveInside must belong to theShapes also.
6956 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6957 # @param ListMaterials Material indices for each shape. Make sence,
6958 # only if theRemoveWebs is TRUE.
6960 # @return New GEOM.GEOM_Object, containing the result shapes.
6962 # @ref tui_partition "Example"
6963 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6964 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6965 KeepNonlimitShapes=0, theName=None):
6967 Perform partition operation.
6970 ListShapes Shapes to be intersected.
6971 ListTools Shapes to intersect theShapes.
6972 Limit Type of resulting shapes (see geompy.ShapeType)
6973 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6974 type will be detected automatically.
6975 KeepNonlimitShapes if this parameter == 0, then only shapes of
6976 target type (equal to Limit) are kept in the result,
6977 else standalone shapes of lower dimension
6978 are kept also (if they exist).
6979 theName Object name; when specified, this parameter is used
6980 for result publication in the study. Otherwise, if automatic
6981 publication is switched on, default value is used for result name.
6983 Each compound from ListShapes and ListTools will be exploded
6984 in order to avoid possible intersection between shapes from
6987 After implementation new version of PartitionAlgo (October 2006) other
6988 parameters are ignored by current functionality. They are kept in this
6989 function only for support old versions.
6992 ListKeepInside Shapes, outside which the results will be deleted.
6993 Each shape from theKeepInside must belong to theShapes also.
6994 ListRemoveInside Shapes, inside which the results will be deleted.
6995 Each shape from theRemoveInside must belong to theShapes also.
6996 RemoveWebs If TRUE, perform Glue 3D algorithm.
6997 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7000 New GEOM.GEOM_Object, containing the result shapes.
7002 # Example: see GEOM_TestAll.py
7003 if Limit == self.ShapeType["AUTO"]:
7004 # automatic detection of the most appropriate shape limit type
7006 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7007 Limit = EnumToLong(lim)
7009 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7010 ListKeepInside, ListRemoveInside,
7011 Limit, RemoveWebs, ListMaterials,
7012 KeepNonlimitShapes);
7013 RaiseIfFailed("MakePartition", self.BoolOp)
7014 self._autoPublish(anObj, theName, "partition")
7017 ## Perform partition operation.
7018 # This method may be useful if it is needed to make a partition for
7019 # compound contains nonintersected shapes. Performance will be better
7020 # since intersection between shapes from compound is not performed.
7022 # Description of all parameters as in previous method MakePartition()
7024 # @note Passed compounds (via ListShapes or via ListTools)
7025 # have to consist of nonintersecting shapes.
7027 # @return New GEOM.GEOM_Object, containing the result shapes.
7029 # @ref swig_todo "Example"
7030 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7031 ListKeepInside=[], ListRemoveInside=[],
7032 Limit=ShapeType["AUTO"], RemoveWebs=0,
7033 ListMaterials=[], KeepNonlimitShapes=0,
7036 Perform partition operation.
7037 This method may be useful if it is needed to make a partition for
7038 compound contains nonintersected shapes. Performance will be better
7039 since intersection between shapes from compound is not performed.
7042 Description of all parameters as in method geompy.MakePartition
7045 Passed compounds (via ListShapes or via ListTools)
7046 have to consist of nonintersecting shapes.
7049 New GEOM.GEOM_Object, containing the result shapes.
7051 if Limit == self.ShapeType["AUTO"]:
7052 # automatic detection of the most appropriate shape limit type
7054 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7055 Limit = EnumToLong(lim)
7057 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7058 ListKeepInside, ListRemoveInside,
7059 Limit, RemoveWebs, ListMaterials,
7060 KeepNonlimitShapes);
7061 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7062 self._autoPublish(anObj, theName, "partition")
7065 ## See method MakePartition() for more information.
7067 # @ref tui_partition "Example 1"
7068 # \n @ref swig_Partition "Example 2"
7069 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7070 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7071 KeepNonlimitShapes=0, theName=None):
7073 See method geompy.MakePartition for more information.
7075 # Example: see GEOM_TestOthers.py
7076 # note: auto-publishing is done in self.MakePartition()
7077 anObj = self.MakePartition(ListShapes, ListTools,
7078 ListKeepInside, ListRemoveInside,
7079 Limit, RemoveWebs, ListMaterials,
7080 KeepNonlimitShapes, theName);
7083 ## Perform partition of the Shape with the Plane
7084 # @param theShape Shape to be intersected.
7085 # @param thePlane Tool shape, to intersect theShape.
7086 # @param theName Object name; when specified, this parameter is used
7087 # for result publication in the study. Otherwise, if automatic
7088 # publication is switched on, default value is used for result name.
7090 # @return New GEOM.GEOM_Object, containing the result shape.
7092 # @ref tui_partition "Example"
7093 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7095 Perform partition of the Shape with the Plane
7098 theShape Shape to be intersected.
7099 thePlane Tool shape, to intersect theShape.
7100 theName Object name; when specified, this parameter is used
7101 for result publication in the study. Otherwise, if automatic
7102 publication is switched on, default value is used for result name.
7105 New GEOM.GEOM_Object, containing the result shape.
7107 # Example: see GEOM_TestAll.py
7108 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7109 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7110 self._autoPublish(anObj, theName, "partition")
7113 # end of l3_basic_op
7116 ## @addtogroup l3_transform
7119 ## Translate the given object along the vector, specified
7120 # by its end points.
7121 # @param theObject The object to be translated.
7122 # @param thePoint1 Start point of translation vector.
7123 # @param thePoint2 End point of translation vector.
7124 # @param theCopy Flag used to translate object itself or create a copy.
7125 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7126 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7127 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7129 Translate the given object along the vector, specified by its end points.
7132 theObject The object to be translated.
7133 thePoint1 Start point of translation vector.
7134 thePoint2 End point of translation vector.
7135 theCopy Flag used to translate object itself or create a copy.
7138 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7139 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7142 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7144 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7145 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7148 ## Translate the given object along the vector, specified
7149 # by its end points, creating its copy before the translation.
7150 # @param theObject The object to be translated.
7151 # @param thePoint1 Start point of translation vector.
7152 # @param thePoint2 End point of translation vector.
7153 # @param theName Object name; when specified, this parameter is used
7154 # for result publication in the study. Otherwise, if automatic
7155 # publication is switched on, default value is used for result name.
7157 # @return New GEOM.GEOM_Object, containing the translated object.
7159 # @ref tui_translation "Example 1"
7160 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7161 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7163 Translate the given object along the vector, specified
7164 by its end points, creating its copy before the translation.
7167 theObject The object to be translated.
7168 thePoint1 Start point of translation vector.
7169 thePoint2 End point of translation vector.
7170 theName Object name; when specified, this parameter is used
7171 for result publication in the study. Otherwise, if automatic
7172 publication is switched on, default value is used for result name.
7175 New GEOM.GEOM_Object, containing the translated object.
7177 # Example: see GEOM_TestAll.py
7178 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7179 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7180 self._autoPublish(anObj, theName, "translated")
7183 ## Translate the given object along the vector, specified by its components.
7184 # @param theObject The object to be translated.
7185 # @param theDX,theDY,theDZ Components of translation vector.
7186 # @param theCopy Flag used to translate object itself or create a copy.
7187 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7188 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7190 # @ref tui_translation "Example"
7191 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7193 Translate the given object along the vector, specified by its components.
7196 theObject The object to be translated.
7197 theDX,theDY,theDZ Components of translation vector.
7198 theCopy Flag used to translate object itself or create a copy.
7201 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7202 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7204 # Example: see GEOM_TestAll.py
7205 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7207 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7209 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7210 anObj.SetParameters(Parameters)
7211 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7214 ## Translate the given object along the vector, specified
7215 # by its components, creating its copy before the translation.
7216 # @param theObject The object to be translated.
7217 # @param theDX,theDY,theDZ Components of translation vector.
7218 # @param theName Object name; when specified, this parameter is used
7219 # for result publication in the study. Otherwise, if automatic
7220 # publication is switched on, default value is used for result name.
7222 # @return New GEOM.GEOM_Object, containing the translated object.
7224 # @ref tui_translation "Example"
7225 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7227 Translate the given object along the vector, specified
7228 by its components, creating its copy before the translation.
7231 theObject The object to be translated.
7232 theDX,theDY,theDZ Components of translation vector.
7233 theName Object name; when specified, this parameter is used
7234 for result publication in the study. Otherwise, if automatic
7235 publication is switched on, default value is used for result name.
7238 New GEOM.GEOM_Object, containing the translated object.
7240 # Example: see GEOM_TestAll.py
7241 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7242 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7243 anObj.SetParameters(Parameters)
7244 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7245 self._autoPublish(anObj, theName, "translated")
7248 ## Translate the given object along the given vector.
7249 # @param theObject The object to be translated.
7250 # @param theVector The translation vector.
7251 # @param theCopy Flag used to translate object itself or create a copy.
7252 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7253 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7254 def TranslateVector(self, theObject, theVector, theCopy=False):
7256 Translate the given object along the given vector.
7259 theObject The object to be translated.
7260 theVector The translation vector.
7261 theCopy Flag used to translate object itself or create a copy.
7264 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7265 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7268 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7270 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7271 RaiseIfFailed("TranslateVector", self.TrsfOp)
7274 ## Translate the given object along the given vector,
7275 # creating its copy before the translation.
7276 # @param theObject The object to be translated.
7277 # @param theVector The translation vector.
7278 # @param theName Object name; when specified, this parameter is used
7279 # for result publication in the study. Otherwise, if automatic
7280 # publication is switched on, default value is used for result name.
7282 # @return New GEOM.GEOM_Object, containing the translated object.
7284 # @ref tui_translation "Example"
7285 def MakeTranslationVector(self, theObject, theVector, theName=None):
7287 Translate the given object along the given vector,
7288 creating its copy before the translation.
7291 theObject The object to be translated.
7292 theVector The translation vector.
7293 theName Object name; when specified, this parameter is used
7294 for result publication in the study. Otherwise, if automatic
7295 publication is switched on, default value is used for result name.
7298 New GEOM.GEOM_Object, containing the translated object.
7300 # Example: see GEOM_TestAll.py
7301 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7302 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7303 self._autoPublish(anObj, theName, "translated")
7306 ## Translate the given object along the given vector on given distance.
7307 # @param theObject The object to be translated.
7308 # @param theVector The translation vector.
7309 # @param theDistance The translation distance.
7310 # @param theCopy Flag used to translate object itself or create a copy.
7311 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7312 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7314 # @ref tui_translation "Example"
7315 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7317 Translate the given object along the given vector on given distance.
7320 theObject The object to be translated.
7321 theVector The translation vector.
7322 theDistance The translation distance.
7323 theCopy Flag used to translate object itself or create a copy.
7326 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7327 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7329 # Example: see GEOM_TestAll.py
7330 theDistance,Parameters = ParseParameters(theDistance)
7331 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7332 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7333 anObj.SetParameters(Parameters)
7336 ## Translate the given object along the given vector on given distance,
7337 # creating its copy before the translation.
7338 # @param theObject The object to be translated.
7339 # @param theVector The translation vector.
7340 # @param theDistance The translation distance.
7341 # @param theName Object name; when specified, this parameter is used
7342 # for result publication in the study. Otherwise, if automatic
7343 # publication is switched on, default value is used for result name.
7345 # @return New GEOM.GEOM_Object, containing the translated object.
7347 # @ref tui_translation "Example"
7348 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7350 Translate the given object along the given vector on given distance,
7351 creating its copy before the translation.
7354 theObject The object to be translated.
7355 theVector The translation vector.
7356 theDistance The translation distance.
7357 theName Object name; when specified, this parameter is used
7358 for result publication in the study. Otherwise, if automatic
7359 publication is switched on, default value is used for result name.
7362 New GEOM.GEOM_Object, containing the translated object.
7364 # Example: see GEOM_TestAll.py
7365 theDistance,Parameters = ParseParameters(theDistance)
7366 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7367 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7368 anObj.SetParameters(Parameters)
7369 self._autoPublish(anObj, theName, "translated")
7372 ## Rotate the given object around the given axis on the given angle.
7373 # @param theObject The object to be rotated.
7374 # @param theAxis Rotation axis.
7375 # @param theAngle Rotation angle in radians.
7376 # @param theCopy Flag used to rotate object itself or create a copy.
7378 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7379 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7381 # @ref tui_rotation "Example"
7382 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7384 Rotate the given object around the given axis on the given angle.
7387 theObject The object to be rotated.
7388 theAxis Rotation axis.
7389 theAngle Rotation angle in radians.
7390 theCopy Flag used to rotate object itself or create a copy.
7393 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7394 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7396 # Example: see GEOM_TestAll.py
7398 if isinstance(theAngle,str):
7400 theAngle, Parameters = ParseParameters(theAngle)
7402 theAngle = theAngle*math.pi/180.0
7404 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7406 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7407 RaiseIfFailed("Rotate", self.TrsfOp)
7408 anObj.SetParameters(Parameters)
7411 ## Rotate the given object around the given axis
7412 # on the given angle, creating its copy before the rotatation.
7413 # @param theObject The object to be rotated.
7414 # @param theAxis Rotation axis.
7415 # @param theAngle Rotation angle in radians.
7416 # @param theName Object name; when specified, this parameter is used
7417 # for result publication in the study. Otherwise, if automatic
7418 # publication is switched on, default value is used for result name.
7420 # @return New GEOM.GEOM_Object, containing the rotated object.
7422 # @ref tui_rotation "Example"
7423 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7425 Rotate the given object around the given axis
7426 on the given angle, creating its copy before the rotatation.
7429 theObject The object to be rotated.
7430 theAxis Rotation axis.
7431 theAngle Rotation angle in radians.
7432 theName Object name; when specified, this parameter is used
7433 for result publication in the study. Otherwise, if automatic
7434 publication is switched on, default value is used for result name.
7437 New GEOM.GEOM_Object, containing the rotated object.
7439 # Example: see GEOM_TestAll.py
7441 if isinstance(theAngle,str):
7443 theAngle, Parameters = ParseParameters(theAngle)
7445 theAngle = theAngle*math.pi/180.0
7446 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7447 RaiseIfFailed("RotateCopy", self.TrsfOp)
7448 anObj.SetParameters(Parameters)
7449 self._autoPublish(anObj, theName, "rotated")
7452 ## Rotate given object around vector perpendicular to plane
7453 # containing three points.
7454 # @param theObject The object to be rotated.
7455 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7456 # containing the three points.
7457 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7458 # @param theCopy Flag used to rotate object itself or create a copy.
7459 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7460 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7461 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7463 Rotate given object around vector perpendicular to plane
7464 containing three points.
7467 theObject The object to be rotated.
7468 theCentPoint central point the axis is the vector perpendicular to the plane
7469 containing the three points.
7470 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7471 theCopy Flag used to rotate object itself or create a copy.
7474 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7475 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7478 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7480 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7481 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7484 ## Rotate given object around vector perpendicular to plane
7485 # containing three points, creating its copy before the rotatation.
7486 # @param theObject The object to be rotated.
7487 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7488 # containing the three points.
7489 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7490 # @param theName Object name; when specified, this parameter is used
7491 # for result publication in the study. Otherwise, if automatic
7492 # publication is switched on, default value is used for result name.
7494 # @return New GEOM.GEOM_Object, containing the rotated object.
7496 # @ref tui_rotation "Example"
7497 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7499 Rotate given object around vector perpendicular to plane
7500 containing three points, creating its copy before the rotatation.
7503 theObject The object to be rotated.
7504 theCentPoint central point the axis is the vector perpendicular to the plane
7505 containing the three points.
7506 thePoint1,thePoint2 in a perpendicular plane of the axis.
7507 theName Object name; when specified, this parameter is used
7508 for result publication in the study. Otherwise, if automatic
7509 publication is switched on, default value is used for result name.
7512 New GEOM.GEOM_Object, containing the rotated object.
7514 # Example: see GEOM_TestAll.py
7515 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7516 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7517 self._autoPublish(anObj, theName, "rotated")
7520 ## Scale the given object by the specified factor.
7521 # @param theObject The object to be scaled.
7522 # @param thePoint Center point for scaling.
7523 # Passing None for it means scaling relatively the origin of global CS.
7524 # @param theFactor Scaling factor value.
7525 # @param theCopy Flag used to scale object itself or create a copy.
7526 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7527 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7528 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7530 Scale the given object by the specified factor.
7533 theObject The object to be scaled.
7534 thePoint Center point for scaling.
7535 Passing None for it means scaling relatively the origin of global CS.
7536 theFactor Scaling factor value.
7537 theCopy Flag used to scale object itself or create a copy.
7540 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7541 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7543 # Example: see GEOM_TestAll.py
7544 theFactor, Parameters = ParseParameters(theFactor)
7546 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7548 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7549 RaiseIfFailed("Scale", self.TrsfOp)
7550 anObj.SetParameters(Parameters)
7553 ## Scale the given object by the factor, creating its copy before the scaling.
7554 # @param theObject The object to be scaled.
7555 # @param thePoint Center point for scaling.
7556 # Passing None for it means scaling relatively the origin of global CS.
7557 # @param theFactor Scaling factor value.
7558 # @param theName Object name; when specified, this parameter is used
7559 # for result publication in the study. Otherwise, if automatic
7560 # publication is switched on, default value is used for result name.
7562 # @return New GEOM.GEOM_Object, containing the scaled shape.
7564 # @ref tui_scale "Example"
7565 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7567 Scale the given object by the factor, creating its copy before the scaling.
7570 theObject The object to be scaled.
7571 thePoint Center point for scaling.
7572 Passing None for it means scaling relatively the origin of global CS.
7573 theFactor Scaling factor value.
7574 theName Object name; when specified, this parameter is used
7575 for result publication in the study. Otherwise, if automatic
7576 publication is switched on, default value is used for result name.
7579 New GEOM.GEOM_Object, containing the scaled shape.
7581 # Example: see GEOM_TestAll.py
7582 theFactor, Parameters = ParseParameters(theFactor)
7583 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7584 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7585 anObj.SetParameters(Parameters)
7586 self._autoPublish(anObj, theName, "scaled")
7589 ## Scale the given object by different factors along coordinate axes.
7590 # @param theObject The object to be scaled.
7591 # @param thePoint Center point for scaling.
7592 # Passing None for it means scaling relatively the origin of global CS.
7593 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7594 # @param theCopy Flag used to scale object itself or create a copy.
7595 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7596 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7597 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7599 Scale the given object by different factors along coordinate axes.
7602 theObject The object to be scaled.
7603 thePoint Center point for scaling.
7604 Passing None for it means scaling relatively the origin of global CS.
7605 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7606 theCopy Flag used to scale object itself or create a copy.
7609 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7610 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7612 # Example: see GEOM_TestAll.py
7613 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7615 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7616 theFactorX, theFactorY, theFactorZ)
7618 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7619 theFactorX, theFactorY, theFactorZ)
7620 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7621 anObj.SetParameters(Parameters)
7624 ## Scale the given object by different factors along coordinate axes,
7625 # creating its copy before the scaling.
7626 # @param theObject The object to be scaled.
7627 # @param thePoint Center point for scaling.
7628 # Passing None for it means scaling relatively the origin of global CS.
7629 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7630 # @param theName Object name; when specified, this parameter is used
7631 # for result publication in the study. Otherwise, if automatic
7632 # publication is switched on, default value is used for result name.
7634 # @return New GEOM.GEOM_Object, containing the scaled shape.
7636 # @ref swig_scale "Example"
7637 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7639 Scale the given object by different factors along coordinate axes,
7640 creating its copy before the scaling.
7643 theObject The object to be scaled.
7644 thePoint Center point for scaling.
7645 Passing None for it means scaling relatively the origin of global CS.
7646 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7647 theName Object name; when specified, this parameter is used
7648 for result publication in the study. Otherwise, if automatic
7649 publication is switched on, default value is used for result name.
7652 New GEOM.GEOM_Object, containing the scaled shape.
7654 # Example: see GEOM_TestAll.py
7655 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7656 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7657 theFactorX, theFactorY, theFactorZ)
7658 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7659 anObj.SetParameters(Parameters)
7660 self._autoPublish(anObj, theName, "scaled")
7663 ## Mirror an object relatively the given plane.
7664 # @param theObject The object to be mirrored.
7665 # @param thePlane Plane of symmetry.
7666 # @param theCopy Flag used to mirror object itself or create a copy.
7667 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7668 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7669 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7671 Mirror an object relatively the given plane.
7674 theObject The object to be mirrored.
7675 thePlane Plane of symmetry.
7676 theCopy Flag used to mirror object itself or create a copy.
7679 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7680 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7683 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7685 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7686 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7689 ## Create an object, symmetrical
7690 # to the given one relatively the given plane.
7691 # @param theObject The object to be mirrored.
7692 # @param thePlane Plane of symmetry.
7693 # @param theName Object name; when specified, this parameter is used
7694 # for result publication in the study. Otherwise, if automatic
7695 # publication is switched on, default value is used for result name.
7697 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7699 # @ref tui_mirror "Example"
7700 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7702 Create an object, symmetrical to the given one relatively the given plane.
7705 theObject The object to be mirrored.
7706 thePlane Plane of symmetry.
7707 theName Object name; when specified, this parameter is used
7708 for result publication in the study. Otherwise, if automatic
7709 publication is switched on, default value is used for result name.
7712 New GEOM.GEOM_Object, containing the mirrored shape.
7714 # Example: see GEOM_TestAll.py
7715 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7716 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7717 self._autoPublish(anObj, theName, "mirrored")
7720 ## Mirror an object relatively the given axis.
7721 # @param theObject The object to be mirrored.
7722 # @param theAxis Axis of symmetry.
7723 # @param theCopy Flag used to mirror object itself or create a copy.
7724 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7725 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7726 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7728 Mirror an object relatively the given axis.
7731 theObject The object to be mirrored.
7732 theAxis Axis of symmetry.
7733 theCopy Flag used to mirror object itself or create a copy.
7736 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7737 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7740 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7742 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7743 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7746 ## Create an object, symmetrical
7747 # to the given one relatively the given axis.
7748 # @param theObject The object to be mirrored.
7749 # @param theAxis Axis of symmetry.
7750 # @param theName Object name; when specified, this parameter is used
7751 # for result publication in the study. Otherwise, if automatic
7752 # publication is switched on, default value is used for result name.
7754 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7756 # @ref tui_mirror "Example"
7757 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7759 Create an object, symmetrical to the given one relatively the given axis.
7762 theObject The object to be mirrored.
7763 theAxis Axis of symmetry.
7764 theName Object name; when specified, this parameter is used
7765 for result publication in the study. Otherwise, if automatic
7766 publication is switched on, default value is used for result name.
7769 New GEOM.GEOM_Object, containing the mirrored shape.
7771 # Example: see GEOM_TestAll.py
7772 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7773 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7774 self._autoPublish(anObj, theName, "mirrored")
7777 ## Mirror an object relatively the given point.
7778 # @param theObject The object to be mirrored.
7779 # @param thePoint Point of symmetry.
7780 # @param theCopy Flag used to mirror object itself or create a copy.
7781 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7782 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7783 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7785 Mirror an object relatively the given point.
7788 theObject The object to be mirrored.
7789 thePoint Point of symmetry.
7790 theCopy Flag used to mirror object itself or create a copy.
7793 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7794 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7796 # Example: see GEOM_TestAll.py
7798 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7800 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7801 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7804 ## Create an object, symmetrical
7805 # to the given one relatively the given point.
7806 # @param theObject The object to be mirrored.
7807 # @param thePoint Point of symmetry.
7808 # @param theName Object name; when specified, this parameter is used
7809 # for result publication in the study. Otherwise, if automatic
7810 # publication is switched on, default value is used for result name.
7812 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7814 # @ref tui_mirror "Example"
7815 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7817 Create an object, symmetrical
7818 to the given one relatively the given point.
7821 theObject The object to be mirrored.
7822 thePoint Point of symmetry.
7823 theName Object name; when specified, this parameter is used
7824 for result publication in the study. Otherwise, if automatic
7825 publication is switched on, default value is used for result name.
7828 New GEOM.GEOM_Object, containing the mirrored shape.
7830 # Example: see GEOM_TestAll.py
7831 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7832 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7833 self._autoPublish(anObj, theName, "mirrored")
7836 ## Modify the location of the given object.
7837 # @param theObject The object to be displaced.
7838 # @param theStartLCS Coordinate system to perform displacement from it.\n
7839 # If \a theStartLCS is NULL, displacement
7840 # will be performed from global CS.\n
7841 # If \a theObject itself is used as \a theStartLCS,
7842 # its location will be changed to \a theEndLCS.
7843 # @param theEndLCS Coordinate system to perform displacement to it.
7844 # @param theCopy Flag used to displace object itself or create a copy.
7845 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7846 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7847 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7849 Modify the Location of the given object by LCS, creating its copy before the setting.
7852 theObject The object to be displaced.
7853 theStartLCS Coordinate system to perform displacement from it.
7854 If theStartLCS is NULL, displacement
7855 will be performed from global CS.
7856 If theObject itself is used as theStartLCS,
7857 its location will be changed to theEndLCS.
7858 theEndLCS Coordinate system to perform displacement to it.
7859 theCopy Flag used to displace object itself or create a copy.
7862 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7863 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7865 # Example: see GEOM_TestAll.py
7867 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7869 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7870 RaiseIfFailed("Displace", self.TrsfOp)
7873 ## Modify the Location of the given object by LCS,
7874 # creating its copy before the setting.
7875 # @param theObject The object to be displaced.
7876 # @param theStartLCS Coordinate system to perform displacement from it.\n
7877 # If \a theStartLCS is NULL, displacement
7878 # will be performed from global CS.\n
7879 # If \a theObject itself is used as \a theStartLCS,
7880 # its location will be changed to \a theEndLCS.
7881 # @param theEndLCS Coordinate system to perform displacement to it.
7882 # @param theName Object name; when specified, this parameter is used
7883 # for result publication in the study. Otherwise, if automatic
7884 # publication is switched on, default value is used for result name.
7886 # @return New GEOM.GEOM_Object, containing the displaced shape.
7888 # @ref tui_modify_location "Example"
7889 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7891 Modify the Location of the given object by LCS, creating its copy before the setting.
7894 theObject The object to be displaced.
7895 theStartLCS Coordinate system to perform displacement from it.
7896 If theStartLCS is NULL, displacement
7897 will be performed from global CS.
7898 If theObject itself is used as theStartLCS,
7899 its location will be changed to theEndLCS.
7900 theEndLCS Coordinate system to perform displacement to it.
7901 theName Object name; when specified, this parameter is used
7902 for result publication in the study. Otherwise, if automatic
7903 publication is switched on, default value is used for result name.
7906 New GEOM.GEOM_Object, containing the displaced shape.
7909 # create local coordinate systems
7910 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7911 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7912 # modify the location of the given object
7913 position = geompy.MakePosition(cylinder, cs1, cs2)
7915 # Example: see GEOM_TestAll.py
7916 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7917 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7918 self._autoPublish(anObj, theName, "displaced")
7921 ## Modify the Location of the given object by Path.
7922 # @param theObject The object to be displaced.
7923 # @param thePath Wire or Edge along that the object will be translated.
7924 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7925 # @param theCopy is to create a copy objects if true.
7926 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7927 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7928 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7930 # @ref tui_modify_location "Example"
7931 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7933 Modify the Location of the given object by Path.
7936 theObject The object to be displaced.
7937 thePath Wire or Edge along that the object will be translated.
7938 theDistance progress of Path (0 = start location, 1 = end of path location).
7939 theCopy is to create a copy objects if true.
7940 theReverse 0 - for usual direction, 1 - to reverse path direction.
7943 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7944 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7947 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7949 # Example: see GEOM_TestAll.py
7950 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7951 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7954 ## Modify the Location of the given object by Path, creating its copy before the operation.
7955 # @param theObject The object to be displaced.
7956 # @param thePath Wire or Edge along that the object will be translated.
7957 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7958 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7959 # @param theName Object name; when specified, this parameter is used
7960 # for result publication in the study. Otherwise, if automatic
7961 # publication is switched on, default value is used for result name.
7963 # @return New GEOM.GEOM_Object, containing the displaced shape.
7964 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7966 Modify the Location of the given object by Path, creating its copy before the operation.
7969 theObject The object to be displaced.
7970 thePath Wire or Edge along that the object will be translated.
7971 theDistance progress of Path (0 = start location, 1 = end of path location).
7972 theReverse 0 - for usual direction, 1 - to reverse path direction.
7973 theName Object name; when specified, this parameter is used
7974 for result publication in the study. Otherwise, if automatic
7975 publication is switched on, default value is used for result name.
7978 New GEOM.GEOM_Object, containing the displaced shape.
7980 # Example: see GEOM_TestAll.py
7981 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7982 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7983 self._autoPublish(anObj, theName, "displaced")
7986 ## Offset given shape.
7987 # @param theObject The base object for the offset.
7988 # @param theOffset Offset value.
7989 # @param theCopy Flag used to offset object itself or create a copy.
7990 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7991 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7992 def Offset(self, theObject, theOffset, theCopy=False):
7997 theObject The base object for the offset.
7998 theOffset Offset value.
7999 theCopy Flag used to offset object itself or create a copy.
8002 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8003 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8005 theOffset, Parameters = ParseParameters(theOffset)
8007 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8009 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8010 RaiseIfFailed("Offset", self.TrsfOp)
8011 anObj.SetParameters(Parameters)
8014 ## Create new object as offset of the given one.
8015 # @param theObject The base object for the offset.
8016 # @param theOffset Offset value.
8017 # @param theName Object name; when specified, this parameter is used
8018 # for result publication in the study. Otherwise, if automatic
8019 # publication is switched on, default value is used for result name.
8021 # @return New GEOM.GEOM_Object, containing the offset object.
8023 # @ref tui_offset "Example"
8024 def MakeOffset(self, theObject, theOffset, theName=None):
8026 Create new object as offset of the given one.
8029 theObject The base object for the offset.
8030 theOffset Offset value.
8031 theName Object name; when specified, this parameter is used
8032 for result publication in the study. Otherwise, if automatic
8033 publication is switched on, default value is used for result name.
8036 New GEOM.GEOM_Object, containing the offset object.
8039 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8040 # create a new object as offset of the given object
8041 offset = geompy.MakeOffset(box, 70.)
8043 # Example: see GEOM_TestAll.py
8044 theOffset, Parameters = ParseParameters(theOffset)
8045 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8046 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8047 anObj.SetParameters(Parameters)
8048 self._autoPublish(anObj, theName, "offset")
8051 ## Create new object as projection of the given one on a 2D surface.
8052 # @param theSource The source object for the projection. It can be a point, edge or wire.
8053 # @param theTarget The target object. It can be planar or cylindrical face.
8054 # @param theName Object name; when specified, this parameter is used
8055 # for result publication in the study. Otherwise, if automatic
8056 # publication is switched on, default value is used for result name.
8058 # @return New GEOM.GEOM_Object, containing the projection.
8060 # @ref tui_projection "Example"
8061 def MakeProjection(self, theSource, theTarget, theName=None):
8063 Create new object as projection of the given one on a 2D surface.
8066 theSource The source object for the projection. It can be a point, edge or wire.
8067 theTarget The target object. It can be planar or cylindrical face.
8068 theName Object name; when specified, this parameter is used
8069 for result publication in the study. Otherwise, if automatic
8070 publication is switched on, default value is used for result name.
8073 New GEOM.GEOM_Object, containing the projection.
8075 # Example: see GEOM_TestAll.py
8076 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8077 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8078 self._autoPublish(anObj, theName, "projection")
8081 ## Create a projection projection of the given point on a wire or an edge.
8082 # If there are no solutions or there are 2 or more solutions It throws an
8084 # @param thePoint the point to be projected.
8085 # @param theWire the wire. The edge is accepted as well.
8086 # @param theName Object name; when specified, this parameter is used
8087 # for result publication in the study. Otherwise, if automatic
8088 # publication is switched on, default value is used for result name.
8090 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8091 # \n \a u: The parameter of projection point on edge.
8092 # \n \a PointOnEdge: The projection point.
8093 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8095 # @ref tui_projection "Example"
8096 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8098 Create a projection projection of the given point on a wire or an edge.
8099 If there are no solutions or there are 2 or more solutions It throws an
8103 thePoint the point to be projected.
8104 theWire the wire. The edge is accepted as well.
8105 theName Object name; when specified, this parameter is used
8106 for result publication in the study. Otherwise, if automatic
8107 publication is switched on, default value is used for result name.
8110 [u, PointOnEdge, EdgeInWireIndex]
8111 u: The parameter of projection point on edge.
8112 PointOnEdge: The projection point.
8113 EdgeInWireIndex: The index of an edge in a wire.
8115 # Example: see GEOM_TestAll.py
8116 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8117 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8118 self._autoPublish(anObj[1], theName, "projection")
8121 # -----------------------------------------------------------------------------
8123 # -----------------------------------------------------------------------------
8125 ## Translate the given object along the given vector a given number times
8126 # @param theObject The object to be translated.
8127 # @param theVector Direction of the translation. DX if None.
8128 # @param theStep Distance to translate on.
8129 # @param theNbTimes Quantity of translations to be done.
8130 # @param theName Object name; when specified, this parameter is used
8131 # for result publication in the study. Otherwise, if automatic
8132 # publication is switched on, default value is used for result name.
8134 # @return New GEOM.GEOM_Object, containing compound of all
8135 # the shapes, obtained after each translation.
8137 # @ref tui_multi_translation "Example"
8138 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8140 Translate the given object along the given vector a given number times
8143 theObject The object to be translated.
8144 theVector Direction of the translation. DX if None.
8145 theStep Distance to translate on.
8146 theNbTimes Quantity of translations to be done.
8147 theName Object name; when specified, this parameter is used
8148 for result publication in the study. Otherwise, if automatic
8149 publication is switched on, default value is used for result name.
8152 New GEOM.GEOM_Object, containing compound of all
8153 the shapes, obtained after each translation.
8156 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8158 # Example: see GEOM_TestAll.py
8159 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8160 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8161 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8162 anObj.SetParameters(Parameters)
8163 self._autoPublish(anObj, theName, "multitranslation")
8166 ## Conseqently apply two specified translations to theObject specified number of times.
8167 # @param theObject The object to be translated.
8168 # @param theVector1 Direction of the first translation. DX if None.
8169 # @param theStep1 Step of the first translation.
8170 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8171 # @param theVector2 Direction of the second translation. DY if None.
8172 # @param theStep2 Step of the second translation.
8173 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8174 # @param theName Object name; when specified, this parameter is used
8175 # for result publication in the study. Otherwise, if automatic
8176 # publication is switched on, default value is used for result name.
8178 # @return New GEOM.GEOM_Object, containing compound of all
8179 # the shapes, obtained after each translation.
8181 # @ref tui_multi_translation "Example"
8182 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8183 theVector2, theStep2, theNbTimes2, theName=None):
8185 Conseqently apply two specified translations to theObject specified number of times.
8188 theObject The object to be translated.
8189 theVector1 Direction of the first translation. DX if None.
8190 theStep1 Step of the first translation.
8191 theNbTimes1 Quantity of translations to be done along theVector1.
8192 theVector2 Direction of the second translation. DY if None.
8193 theStep2 Step of the second translation.
8194 theNbTimes2 Quantity of translations to be done along theVector2.
8195 theName Object name; when specified, this parameter is used
8196 for result publication in the study. Otherwise, if automatic
8197 publication is switched on, default value is used for result name.
8200 New GEOM.GEOM_Object, containing compound of all
8201 the shapes, obtained after each translation.
8204 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8206 # Example: see GEOM_TestAll.py
8207 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8208 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8209 theVector2, theStep2, theNbTimes2)
8210 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8211 anObj.SetParameters(Parameters)
8212 self._autoPublish(anObj, theName, "multitranslation")
8215 ## Rotate the given object around the given axis a given number times.
8216 # Rotation angle will be 2*PI/theNbTimes.
8217 # @param theObject The object to be rotated.
8218 # @param theAxis The rotation axis. DZ if None.
8219 # @param theNbTimes Quantity of rotations to be done.
8220 # @param theName Object name; when specified, this parameter is used
8221 # for result publication in the study. Otherwise, if automatic
8222 # publication is switched on, default value is used for result name.
8224 # @return New GEOM.GEOM_Object, containing compound of all the
8225 # shapes, obtained after each rotation.
8227 # @ref tui_multi_rotation "Example"
8228 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8230 Rotate the given object around the given axis a given number times.
8231 Rotation angle will be 2*PI/theNbTimes.
8234 theObject The object to be rotated.
8235 theAxis The rotation axis. DZ if None.
8236 theNbTimes Quantity of rotations to be done.
8237 theName Object name; when specified, this parameter is used
8238 for result publication in the study. Otherwise, if automatic
8239 publication is switched on, default value is used for result name.
8242 New GEOM.GEOM_Object, containing compound of all the
8243 shapes, obtained after each rotation.
8246 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8248 # Example: see GEOM_TestAll.py
8249 theNbTimes, Parameters = ParseParameters(theNbTimes)
8250 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8251 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8252 anObj.SetParameters(Parameters)
8253 self._autoPublish(anObj, theName, "multirotation")
8256 ## Rotate the given object around the given axis
8257 # a given number times on the given angle.
8258 # @param theObject The object to be rotated.
8259 # @param theAxis The rotation axis. DZ if None.
8260 # @param theAngleStep Rotation angle in radians.
8261 # @param theNbTimes Quantity of rotations to be done.
8262 # @param theName Object name; when specified, this parameter is used
8263 # for result publication in the study. Otherwise, if automatic
8264 # publication is switched on, default value is used for result name.
8266 # @return New GEOM.GEOM_Object, containing compound of all the
8267 # shapes, obtained after each rotation.
8269 # @ref tui_multi_rotation "Example"
8270 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8272 Rotate the given object around the given axis
8273 a given number times on the given angle.
8276 theObject The object to be rotated.
8277 theAxis The rotation axis. DZ if None.
8278 theAngleStep Rotation angle in radians.
8279 theNbTimes Quantity of rotations to be done.
8280 theName Object name; when specified, this parameter is used
8281 for result publication in the study. Otherwise, if automatic
8282 publication is switched on, default value is used for result name.
8285 New GEOM.GEOM_Object, containing compound of all the
8286 shapes, obtained after each rotation.
8289 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8291 # Example: see GEOM_TestAll.py
8292 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8293 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8294 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8295 anObj.SetParameters(Parameters)
8296 self._autoPublish(anObj, theName, "multirotation")
8299 ## Rotate the given object around the given axis a given
8300 # number times and multi-translate each rotation result.
8301 # Rotation angle will be 2*PI/theNbTimes1.
8302 # Translation direction passes through center of gravity
8303 # of rotated shape and its projection on the rotation axis.
8304 # @param theObject The object to be rotated.
8305 # @param theAxis Rotation axis. DZ if None.
8306 # @param theNbTimes1 Quantity of rotations to be done.
8307 # @param theRadialStep Translation distance.
8308 # @param theNbTimes2 Quantity of translations to be done.
8309 # @param theName Object name; when specified, this parameter is used
8310 # for result publication in the study. Otherwise, if automatic
8311 # publication is switched on, default value is used for result name.
8313 # @return New GEOM.GEOM_Object, containing compound of all the
8314 # shapes, obtained after each transformation.
8316 # @ref tui_multi_rotation "Example"
8317 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8319 Rotate the given object around the
8320 given axis on the given angle a given number
8321 times and multi-translate each rotation result.
8322 Translation direction passes through center of gravity
8323 of rotated shape and its projection on the rotation axis.
8326 theObject The object to be rotated.
8327 theAxis Rotation axis. DZ if None.
8328 theNbTimes1 Quantity of rotations to be done.
8329 theRadialStep Translation distance.
8330 theNbTimes2 Quantity of translations to be done.
8331 theName Object name; when specified, this parameter is used
8332 for result publication in the study. Otherwise, if automatic
8333 publication is switched on, default value is used for result name.
8336 New GEOM.GEOM_Object, containing compound of all the
8337 shapes, obtained after each transformation.
8340 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8342 # Example: see GEOM_TestAll.py
8343 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8344 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8345 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8346 anObj.SetParameters(Parameters)
8347 self._autoPublish(anObj, theName, "multirotation")
8350 ## Rotate the given object around the
8351 # given axis on the given angle a given number
8352 # times and multi-translate each rotation result.
8353 # Translation direction passes through center of gravity
8354 # of rotated shape and its projection on the rotation axis.
8355 # @param theObject The object to be rotated.
8356 # @param theAxis Rotation axis. DZ if None.
8357 # @param theAngleStep Rotation angle in radians.
8358 # @param theNbTimes1 Quantity of rotations to be done.
8359 # @param theRadialStep Translation distance.
8360 # @param theNbTimes2 Quantity of translations to be done.
8361 # @param theName Object name; when specified, this parameter is used
8362 # for result publication in the study. Otherwise, if automatic
8363 # publication is switched on, default value is used for result name.
8365 # @return New GEOM.GEOM_Object, containing compound of all the
8366 # shapes, obtained after each transformation.
8368 # @ref tui_multi_rotation "Example"
8369 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8371 Rotate the given object around the
8372 given axis on the given angle a given number
8373 times and multi-translate each rotation result.
8374 Translation direction passes through center of gravity
8375 of rotated shape and its projection on the rotation axis.
8378 theObject The object to be rotated.
8379 theAxis Rotation axis. DZ if None.
8380 theAngleStep Rotation angle in radians.
8381 theNbTimes1 Quantity of rotations to be done.
8382 theRadialStep Translation distance.
8383 theNbTimes2 Quantity of translations to be done.
8384 theName Object name; when specified, this parameter is used
8385 for result publication in the study. Otherwise, if automatic
8386 publication is switched on, default value is used for result name.
8389 New GEOM.GEOM_Object, containing compound of all the
8390 shapes, obtained after each transformation.
8393 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8395 # Example: see GEOM_TestAll.py
8396 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8397 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8398 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8399 anObj.SetParameters(Parameters)
8400 self._autoPublish(anObj, theName, "multirotation")
8403 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8405 # @ref swig_MakeMultiRotation "Example"
8406 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8408 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8411 pz = geompy.MakeVertex(0, 0, 100)
8412 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8413 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8415 # Example: see GEOM_TestOthers.py
8416 aVec = self.MakeLine(aPoint,aDir)
8417 # note: auto-publishing is done in self.MultiRotate1D()
8418 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8421 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8423 # @ref swig_MakeMultiRotation "Example"
8424 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8426 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8429 pz = geompy.MakeVertex(0, 0, 100)
8430 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8431 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8433 # Example: see GEOM_TestOthers.py
8434 aVec = self.MakeLine(aPoint,aDir)
8435 # note: auto-publishing is done in self.MultiRotate1D()
8436 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8439 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8441 # @ref swig_MakeMultiRotation "Example"
8442 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8444 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8447 pz = geompy.MakeVertex(0, 0, 100)
8448 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8449 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8451 # Example: see GEOM_TestOthers.py
8452 aVec = self.MakeLine(aPoint,aDir)
8453 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8454 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8457 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8459 # @ref swig_MakeMultiRotation "Example"
8460 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8462 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8465 pz = geompy.MakeVertex(0, 0, 100)
8466 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8467 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8469 # Example: see GEOM_TestOthers.py
8470 aVec = self.MakeLine(aPoint,aDir)
8471 # note: auto-publishing is done in self.MultiRotate2D()
8472 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8475 # end of l3_transform
8478 ## @addtogroup l3_transform_d
8481 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8482 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8484 Deprecated method. Use MultiRotate1DNbTimes instead.
8486 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8487 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8489 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8490 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8491 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8493 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8494 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8497 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8499 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8500 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8501 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8502 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8503 anObj.SetParameters(Parameters)
8504 self._autoPublish(anObj, theName, "multirotation")
8507 ## The same, as MultiRotate1D(), but axis is given by direction and point
8508 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8509 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8511 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8512 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8515 pz = geompy.MakeVertex(0, 0, 100)
8516 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8517 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8519 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8520 aVec = self.MakeLine(aPoint,aDir)
8521 # note: auto-publishing is done in self.MultiRotate1D()
8522 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8525 ## The same, as MultiRotate2D(), but axis is given by direction and point
8526 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8527 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8529 The same, as MultiRotate2D(), but axis is given by direction and point
8530 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8533 pz = geompy.MakeVertex(0, 0, 100)
8534 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8535 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8537 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8538 aVec = self.MakeLine(aPoint,aDir)
8539 # note: auto-publishing is done in self.MultiRotate2D()
8540 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8543 # end of l3_transform_d
8546 ## @addtogroup l3_local
8549 ## Perform a fillet on all edges of the given shape.
8550 # @param theShape Shape, to perform fillet on.
8551 # @param theR Fillet radius.
8552 # @param theName Object name; when specified, this parameter is used
8553 # for result publication in the study. Otherwise, if automatic
8554 # publication is switched on, default value is used for result name.
8556 # @return New GEOM.GEOM_Object, containing the result shape.
8558 # @ref tui_fillet "Example 1"
8559 # \n @ref swig_MakeFilletAll "Example 2"
8560 def MakeFilletAll(self, theShape, theR, theName=None):
8562 Perform a fillet on all edges of the given shape.
8565 theShape Shape, to perform fillet on.
8567 theName Object name; when specified, this parameter is used
8568 for result publication in the study. Otherwise, if automatic
8569 publication is switched on, default value is used for result name.
8572 New GEOM.GEOM_Object, containing the result shape.
8575 filletall = geompy.MakeFilletAll(prism, 10.)
8577 # Example: see GEOM_TestOthers.py
8578 theR,Parameters = ParseParameters(theR)
8579 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8580 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8581 anObj.SetParameters(Parameters)
8582 self._autoPublish(anObj, theName, "fillet")
8585 ## Perform a fillet on the specified edges/faces of the given shape
8586 # @param theShape Shape, to perform fillet on.
8587 # @param theR Fillet radius.
8588 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8589 # @param theListShapes Global indices of edges/faces to perform fillet on.
8590 # @param theName Object name; when specified, this parameter is used
8591 # for result publication in the study. Otherwise, if automatic
8592 # publication is switched on, default value is used for result name.
8594 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8596 # @return New GEOM.GEOM_Object, containing the result shape.
8598 # @ref tui_fillet "Example"
8599 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8601 Perform a fillet on the specified edges/faces of the given shape
8604 theShape Shape, to perform fillet on.
8606 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8607 theListShapes Global indices of edges/faces to perform fillet on.
8608 theName Object name; when specified, this parameter is used
8609 for result publication in the study. Otherwise, if automatic
8610 publication is switched on, default value is used for result name.
8613 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8616 New GEOM.GEOM_Object, containing the result shape.
8619 # get the list of IDs (IDList) for the fillet
8620 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8622 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8623 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8624 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8625 # make a fillet on the specified edges of the given shape
8626 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8628 # Example: see GEOM_TestAll.py
8629 theR,Parameters = ParseParameters(theR)
8631 if theShapeType == self.ShapeType["EDGE"]:
8632 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8633 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8635 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8636 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8637 anObj.SetParameters(Parameters)
8638 self._autoPublish(anObj, theName, "fillet")
8641 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8642 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8644 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8647 # get the list of IDs (IDList) for the fillet
8648 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8650 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8651 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8652 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8653 # make a fillet on the specified edges of the given shape
8654 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8656 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8658 if theShapeType == self.ShapeType["EDGE"]:
8659 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8660 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8662 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8663 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8664 anObj.SetParameters(Parameters)
8665 self._autoPublish(anObj, theName, "fillet")
8668 ## Perform a fillet on the specified edges of the given shape
8669 # @param theShape Wire Shape to perform fillet on.
8670 # @param theR Fillet radius.
8671 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8672 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8673 # \note The list of vertices could be empty,
8674 # in this case fillet will done done at all vertices in wire
8675 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8676 # by the length of the edges, nearest to the fillet vertex.
8677 # But sometimes the next edge is C1 continuous with the one, nearest to
8678 # the fillet point, and such two (or more) edges can be united to allow
8679 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8680 # thus ignoring the secant vertex (vertices).
8681 # @param theName Object name; when specified, this parameter is used
8682 # for result publication in the study. Otherwise, if automatic
8683 # publication is switched on, default value is used for result name.
8685 # @return New GEOM.GEOM_Object, containing the result shape.
8687 # @ref tui_fillet2d "Example"
8688 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8690 Perform a fillet on the specified edges of the given shape
8693 theShape Wire Shape to perform fillet on.
8695 theListOfVertexes Global indices of vertexes to perform fillet on.
8696 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8697 by the length of the edges, nearest to the fillet vertex.
8698 But sometimes the next edge is C1 continuous with the one, nearest to
8699 the fillet point, and such two (or more) edges can be united to allow
8700 bigger radius. Set this flag to TRUE to allow collinear edges union,
8701 thus ignoring the secant vertex (vertices).
8702 theName Object name; when specified, this parameter is used
8703 for result publication in the study. Otherwise, if automatic
8704 publication is switched on, default value is used for result name.
8706 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8708 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8711 New GEOM.GEOM_Object, containing the result shape.
8715 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8716 # make fillet at given wire vertices with giver radius
8717 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8719 # Example: see GEOM_TestAll.py
8720 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8721 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8722 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8723 anObj.SetParameters(Parameters)
8724 self._autoPublish(anObj, theName, "fillet")
8727 ## Perform a fillet at the specified vertices of the given face/shell.
8728 # @param theShape Face or Shell shape to perform fillet on.
8729 # @param theR Fillet radius.
8730 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8731 # @param theName Object name; when specified, this parameter is used
8732 # for result publication in the study. Otherwise, if automatic
8733 # publication is switched on, default value is used for result name.
8735 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8737 # @return New GEOM.GEOM_Object, containing the result shape.
8739 # @ref tui_fillet2d "Example"
8740 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8742 Perform a fillet at the specified vertices of the given face/shell.
8745 theShape Face or Shell shape to perform fillet on.
8747 theListOfVertexes Global indices of vertexes to perform fillet on.
8748 theName Object name; when specified, this parameter is used
8749 for result publication in the study. Otherwise, if automatic
8750 publication is switched on, default value is used for result name.
8752 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8755 New GEOM.GEOM_Object, containing the result shape.
8758 face = geompy.MakeFaceHW(100, 100, 1)
8759 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8761 # Example: see GEOM_TestAll.py
8762 theR,Parameters = ParseParameters(theR)
8763 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8764 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8765 anObj.SetParameters(Parameters)
8766 self._autoPublish(anObj, theName, "fillet")
8769 ## Perform a symmetric chamfer on all edges of the given shape.
8770 # @param theShape Shape, to perform chamfer on.
8771 # @param theD Chamfer size along each face.
8772 # @param theName Object name; when specified, this parameter is used
8773 # for result publication in the study. Otherwise, if automatic
8774 # publication is switched on, default value is used for result name.
8776 # @return New GEOM.GEOM_Object, containing the result shape.
8778 # @ref tui_chamfer "Example 1"
8779 # \n @ref swig_MakeChamferAll "Example 2"
8780 def MakeChamferAll(self, theShape, theD, theName=None):
8782 Perform a symmetric chamfer on all edges of the given shape.
8785 theShape Shape, to perform chamfer on.
8786 theD Chamfer size along each face.
8787 theName Object name; when specified, this parameter is used
8788 for result publication in the study. Otherwise, if automatic
8789 publication is switched on, default value is used for result name.
8792 New GEOM.GEOM_Object, containing the result shape.
8795 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8797 # Example: see GEOM_TestOthers.py
8798 theD,Parameters = ParseParameters(theD)
8799 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8800 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8801 anObj.SetParameters(Parameters)
8802 self._autoPublish(anObj, theName, "chamfer")
8805 ## Perform a chamfer on edges, common to the specified faces,
8806 # with distance D1 on the Face1
8807 # @param theShape Shape, to perform chamfer on.
8808 # @param theD1 Chamfer size along \a theFace1.
8809 # @param theD2 Chamfer size along \a theFace2.
8810 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8811 # @param theName Object name; when specified, this parameter is used
8812 # for result publication in the study. Otherwise, if automatic
8813 # publication is switched on, default value is used for result name.
8815 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8817 # @return New GEOM.GEOM_Object, containing the result shape.
8819 # @ref tui_chamfer "Example"
8820 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8822 Perform a chamfer on edges, common to the specified faces,
8823 with distance D1 on the Face1
8826 theShape Shape, to perform chamfer on.
8827 theD1 Chamfer size along theFace1.
8828 theD2 Chamfer size along theFace2.
8829 theFace1,theFace2 Global indices of two faces of theShape.
8830 theName Object name; when specified, this parameter is used
8831 for result publication in the study. Otherwise, if automatic
8832 publication is switched on, default value is used for result name.
8835 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8838 New GEOM.GEOM_Object, containing the result shape.
8841 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8842 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8843 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8844 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8846 # Example: see GEOM_TestAll.py
8847 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8848 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8849 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8850 anObj.SetParameters(Parameters)
8851 self._autoPublish(anObj, theName, "chamfer")
8854 ## Perform a chamfer on edges
8855 # @param theShape Shape, to perform chamfer on.
8856 # @param theD Chamfer length
8857 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8858 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8859 # @param theName Object name; when specified, this parameter is used
8860 # for result publication in the study. Otherwise, if automatic
8861 # publication is switched on, default value is used for result name.
8863 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8865 # @return New GEOM.GEOM_Object, containing the result shape.
8866 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8868 Perform a chamfer on edges
8871 theShape Shape, to perform chamfer on.
8872 theD1 Chamfer size along theFace1.
8873 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8874 theFace1,theFace2 Global indices of two faces of theShape.
8875 theName Object name; when specified, this parameter is used
8876 for result publication in the study. Otherwise, if automatic
8877 publication is switched on, default value is used for result name.
8880 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8883 New GEOM.GEOM_Object, containing the result shape.
8886 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8887 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8888 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8890 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8893 if isinstance(theAngle,str):
8895 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8897 theAngle = theAngle*math.pi/180.0
8898 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8899 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8900 anObj.SetParameters(Parameters)
8901 self._autoPublish(anObj, theName, "chamfer")
8904 ## Perform a chamfer on all edges of the specified faces,
8905 # with distance D1 on the first specified face (if several for one edge)
8906 # @param theShape Shape, to perform chamfer on.
8907 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8908 # connected to the edge, are in \a theFaces, \a theD1
8909 # will be get along face, which is nearer to \a theFaces beginning.
8910 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8911 # @param theFaces Sequence of global indices of faces of \a theShape.
8912 # @param theName Object name; when specified, this parameter is used
8913 # for result publication in the study. Otherwise, if automatic
8914 # publication is switched on, default value is used for result name.
8916 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8918 # @return New GEOM.GEOM_Object, containing the result shape.
8920 # @ref tui_chamfer "Example"
8921 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8923 Perform a chamfer on all edges of the specified faces,
8924 with distance D1 on the first specified face (if several for one edge)
8927 theShape Shape, to perform chamfer on.
8928 theD1 Chamfer size along face from theFaces. If both faces,
8929 connected to the edge, are in theFaces, theD1
8930 will be get along face, which is nearer to theFaces beginning.
8931 theD2 Chamfer size along another of two faces, connected to the edge.
8932 theFaces Sequence of global indices of faces of theShape.
8933 theName Object name; when specified, this parameter is used
8934 for result publication in the study. Otherwise, if automatic
8935 publication is switched on, default value is used for result name.
8937 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8940 New GEOM.GEOM_Object, containing the result shape.
8942 # Example: see GEOM_TestAll.py
8943 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8944 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8945 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8946 anObj.SetParameters(Parameters)
8947 self._autoPublish(anObj, theName, "chamfer")
8950 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8951 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8953 # @ref swig_FilletChamfer "Example"
8954 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8956 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8957 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8960 if isinstance(theAngle,str):
8962 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8964 theAngle = theAngle*math.pi/180.0
8965 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8966 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8967 anObj.SetParameters(Parameters)
8968 self._autoPublish(anObj, theName, "chamfer")
8971 ## Perform a chamfer on edges,
8972 # with distance D1 on the first specified face (if several for one edge)
8973 # @param theShape Shape, to perform chamfer on.
8974 # @param theD1,theD2 Chamfer size
8975 # @param theEdges Sequence of edges of \a theShape.
8976 # @param theName Object name; when specified, this parameter is used
8977 # for result publication in the study. Otherwise, if automatic
8978 # publication is switched on, default value is used for result name.
8980 # @return New GEOM.GEOM_Object, containing the result shape.
8982 # @ref swig_FilletChamfer "Example"
8983 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8985 Perform a chamfer on edges,
8986 with distance D1 on the first specified face (if several for one edge)
8989 theShape Shape, to perform chamfer on.
8990 theD1,theD2 Chamfer size
8991 theEdges Sequence of edges of theShape.
8992 theName Object name; when specified, this parameter is used
8993 for result publication in the study. Otherwise, if automatic
8994 publication is switched on, default value is used for result name.
8997 New GEOM.GEOM_Object, containing the result shape.
8999 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9000 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9001 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9002 anObj.SetParameters(Parameters)
9003 self._autoPublish(anObj, theName, "chamfer")
9006 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9007 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9008 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9010 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9011 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9014 if isinstance(theAngle,str):
9016 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9018 theAngle = theAngle*math.pi/180.0
9019 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9020 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9021 anObj.SetParameters(Parameters)
9022 self._autoPublish(anObj, theName, "chamfer")
9025 ## @sa MakeChamferEdge(), MakeChamferFaces()
9027 # @ref swig_MakeChamfer "Example"
9028 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9030 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9032 # Example: see GEOM_TestOthers.py
9034 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9035 if aShapeType == self.ShapeType["EDGE"]:
9036 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9038 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9041 ## Remove material from a solid by extrusion of the base shape on the given distance.
9042 # @param theInit Shape to remove material from. It must be a solid or
9043 # a compound made of a single solid.
9044 # @param theBase Closed edge or wire defining the base shape to be extruded.
9045 # @param theH Prism dimension along the normal to theBase
9046 # @param theAngle Draft angle in degrees.
9047 # @param theName Object name; when specified, this parameter is used
9048 # for result publication in the study. Otherwise, if automatic
9049 # publication is switched on, default value is used for result name.
9051 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9053 # @ref tui_creation_prism "Example"
9054 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9056 Add material to a solid by extrusion of the base shape on the given distance.
9059 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9060 theBase Closed edge or wire defining the base shape to be extruded.
9061 theH Prism dimension along the normal to theBase
9062 theAngle Draft angle in degrees.
9063 theName Object name; when specified, this parameter is used
9064 for result publication in the study. Otherwise, if automatic
9065 publication is switched on, default value is used for result name.
9068 New GEOM.GEOM_Object, containing the initial shape with removed material.
9070 # Example: see GEOM_TestAll.py
9071 #theH,Parameters = ParseParameters(theH)
9072 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9073 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9074 #anObj.SetParameters(Parameters)
9075 self._autoPublish(anObj, theName, "extrudedCut")
9078 ## Add material to a solid by extrusion of the base shape on the given distance.
9079 # @param theInit Shape to add material to. It must be a solid or
9080 # a compound made of a single solid.
9081 # @param theBase Closed edge or wire defining the base shape to be extruded.
9082 # @param theH Prism dimension along the normal to theBase
9083 # @param theAngle Draft angle in degrees.
9084 # @param theName Object name; when specified, this parameter is used
9085 # for result publication in the study. Otherwise, if automatic
9086 # publication is switched on, default value is used for result name.
9088 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9090 # @ref tui_creation_prism "Example"
9091 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9093 Add material to a solid by extrusion of the base shape on the given distance.
9096 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9097 theBase Closed edge or wire defining the base shape to be extruded.
9098 theH Prism dimension along the normal to theBase
9099 theAngle Draft angle in degrees.
9100 theName Object name; when specified, this parameter is used
9101 for result publication in the study. Otherwise, if automatic
9102 publication is switched on, default value is used for result name.
9105 New GEOM.GEOM_Object, containing the initial shape with added material.
9107 # Example: see GEOM_TestAll.py
9108 #theH,Parameters = ParseParameters(theH)
9109 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9110 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9111 #anObj.SetParameters(Parameters)
9112 self._autoPublish(anObj, theName, "extrudedBoss")
9118 ## @addtogroup l3_basic_op
9121 ## Perform an Archimde operation on the given shape with given parameters.
9122 # The object presenting the resulting face is returned.
9123 # @param theShape Shape to be put in water.
9124 # @param theWeight Weight og the shape.
9125 # @param theWaterDensity Density of the water.
9126 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9127 # @param theName Object name; when specified, this parameter is used
9128 # for result publication in the study. Otherwise, if automatic
9129 # publication is switched on, default value is used for result name.
9131 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9132 # by a plane, corresponding to water level.
9134 # @ref tui_archimede "Example"
9135 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9137 Perform an Archimde operation on the given shape with given parameters.
9138 The object presenting the resulting face is returned.
9141 theShape Shape to be put in water.
9142 theWeight Weight og the shape.
9143 theWaterDensity Density of the water.
9144 theMeshDeflection Deflection of the mesh, using to compute the section.
9145 theName Object name; when specified, this parameter is used
9146 for result publication in the study. Otherwise, if automatic
9147 publication is switched on, default value is used for result name.
9150 New GEOM.GEOM_Object, containing a section of theShape
9151 by a plane, corresponding to water level.
9153 # Example: see GEOM_TestAll.py
9154 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9155 theWeight,theWaterDensity,theMeshDeflection)
9156 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9157 RaiseIfFailed("MakeArchimede", self.LocalOp)
9158 anObj.SetParameters(Parameters)
9159 self._autoPublish(anObj, theName, "archimede")
9162 # end of l3_basic_op
9165 ## @addtogroup l2_measure
9168 ## Get point coordinates
9171 # @ref tui_measurement_tools_page "Example"
9172 def PointCoordinates(self,Point):
9174 Get point coordinates
9179 # Example: see GEOM_TestMeasures.py
9180 aTuple = self.MeasuOp.PointCoordinates(Point)
9181 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9184 ## Get vector coordinates
9187 # @ref tui_measurement_tools_page "Example"
9188 def VectorCoordinates(self,Vector):
9190 Get vector coordinates
9196 p1=self.GetFirstVertex(Vector)
9197 p2=self.GetLastVertex(Vector)
9199 X1=self.PointCoordinates(p1)
9200 X2=self.PointCoordinates(p2)
9202 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9205 ## Compute cross product
9206 # @return vector w=u^v
9208 # @ref tui_measurement_tools_page "Example"
9209 def CrossProduct(self, Vector1, Vector2):
9211 Compute cross product
9213 Returns: vector w=u^v
9215 u=self.VectorCoordinates(Vector1)
9216 v=self.VectorCoordinates(Vector2)
9217 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])
9221 ## Compute cross product
9222 # @return dot product p=u.v
9224 # @ref tui_measurement_tools_page "Example"
9225 def DotProduct(self, Vector1, Vector2):
9227 Compute cross product
9229 Returns: dot product p=u.v
9231 u=self.VectorCoordinates(Vector1)
9232 v=self.VectorCoordinates(Vector2)
9233 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9238 ## Get summarized length of all wires,
9239 # area of surface and volume of the given shape.
9240 # @param theShape Shape to define properties of.
9241 # @return [theLength, theSurfArea, theVolume]\n
9242 # theLength: Summarized length of all wires of the given shape.\n
9243 # theSurfArea: Area of surface of the given shape.\n
9244 # theVolume: Volume of the given shape.
9246 # @ref tui_measurement_tools_page "Example"
9247 def BasicProperties(self,theShape):
9249 Get summarized length of all wires,
9250 area of surface and volume of the given shape.
9253 theShape Shape to define properties of.
9256 [theLength, theSurfArea, theVolume]
9257 theLength: Summarized length of all wires of the given shape.
9258 theSurfArea: Area of surface of the given shape.
9259 theVolume: Volume of the given shape.
9261 # Example: see GEOM_TestMeasures.py
9262 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9263 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9266 ## Get parameters of bounding box of the given shape
9267 # @param theShape Shape to obtain bounding box of.
9268 # @param precise TRUE for precise computation; FALSE for fast one.
9269 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9270 # Xmin,Xmax: Limits of shape along OX axis.
9271 # Ymin,Ymax: Limits of shape along OY axis.
9272 # Zmin,Zmax: Limits of shape along OZ axis.
9274 # @ref tui_measurement_tools_page "Example"
9275 def BoundingBox (self, theShape, precise=False):
9277 Get parameters of bounding box of the given shape
9280 theShape Shape to obtain bounding box of.
9281 precise TRUE for precise computation; FALSE for fast one.
9284 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9285 Xmin,Xmax: Limits of shape along OX axis.
9286 Ymin,Ymax: Limits of shape along OY axis.
9287 Zmin,Zmax: Limits of shape along OZ axis.
9289 # Example: see GEOM_TestMeasures.py
9290 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9291 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9294 ## Get bounding box of the given shape
9295 # @param theShape Shape to obtain bounding box of.
9296 # @param precise TRUE for precise computation; FALSE for fast one.
9297 # @param theName Object name; when specified, this parameter is used
9298 # for result publication in the study. Otherwise, if automatic
9299 # publication is switched on, default value is used for result name.
9301 # @return New GEOM.GEOM_Object, containing the created box.
9303 # @ref tui_measurement_tools_page "Example"
9304 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9306 Get bounding box of the given shape
9309 theShape Shape to obtain bounding box of.
9310 precise TRUE for precise computation; FALSE for fast one.
9311 theName Object name; when specified, this parameter is used
9312 for result publication in the study. Otherwise, if automatic
9313 publication is switched on, default value is used for result name.
9316 New GEOM.GEOM_Object, containing the created box.
9318 # Example: see GEOM_TestMeasures.py
9319 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9320 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9321 self._autoPublish(anObj, theName, "bndbox")
9324 ## Get inertia matrix and moments of inertia of theShape.
9325 # @param theShape Shape to calculate inertia of.
9326 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9327 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9328 # Ix,Iy,Iz: Moments of inertia of the given shape.
9330 # @ref tui_measurement_tools_page "Example"
9331 def Inertia(self,theShape):
9333 Get inertia matrix and moments of inertia of theShape.
9336 theShape Shape to calculate inertia of.
9339 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9340 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9341 Ix,Iy,Iz: Moments of inertia of the given shape.
9343 # Example: see GEOM_TestMeasures.py
9344 aTuple = self.MeasuOp.GetInertia(theShape)
9345 RaiseIfFailed("GetInertia", self.MeasuOp)
9348 ## Get if coords are included in the shape (ST_IN or ST_ON)
9349 # @param theShape Shape
9350 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9351 # @param tolerance to be used (default is 1.0e-7)
9352 # @return list_of_boolean = [res1, res2, ...]
9353 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9355 Get if coords are included in the shape (ST_IN or ST_ON)
9359 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9360 tolerance to be used (default is 1.0e-7)
9363 list_of_boolean = [res1, res2, ...]
9365 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9367 ## Get minimal distance between the given shapes.
9368 # @param theShape1,theShape2 Shapes to find minimal distance between.
9369 # @return Value of the minimal distance between the given shapes.
9371 # @ref tui_measurement_tools_page "Example"
9372 def MinDistance(self, theShape1, theShape2):
9374 Get minimal distance between the given shapes.
9377 theShape1,theShape2 Shapes to find minimal distance between.
9380 Value of the minimal distance between the given shapes.
9382 # Example: see GEOM_TestMeasures.py
9383 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9384 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9387 ## Get minimal distance between the given shapes.
9388 # @param theShape1,theShape2 Shapes to find minimal distance between.
9389 # @return Value of the minimal distance between the given shapes, in form of list
9390 # [Distance, DX, DY, DZ].
9392 # @ref swig_all_measure "Example"
9393 def MinDistanceComponents(self, theShape1, theShape2):
9395 Get minimal distance between the given shapes.
9398 theShape1,theShape2 Shapes to find minimal distance between.
9401 Value of the minimal distance between the given shapes, in form of list
9402 [Distance, DX, DY, DZ]
9404 # Example: see GEOM_TestMeasures.py
9405 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9406 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9407 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9410 ## Get closest points of the given shapes.
9411 # @param theShape1,theShape2 Shapes to find closest points of.
9412 # @return The number of found solutions (-1 in case of infinite number of
9413 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9415 # @ref tui_measurement_tools_page "Example"
9416 def ClosestPoints (self, theShape1, theShape2):
9418 Get closest points of the given shapes.
9421 theShape1,theShape2 Shapes to find closest points of.
9424 The number of found solutions (-1 in case of infinite number of
9425 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9427 # Example: see GEOM_TestMeasures.py
9428 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9429 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9432 ## Get angle between the given shapes in degrees.
9433 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9434 # @note If both arguments are vectors, the angle is computed in accordance
9435 # with their orientations, otherwise the minimum angle is computed.
9436 # @return Value of the angle between the given shapes in degrees.
9438 # @ref tui_measurement_tools_page "Example"
9439 def GetAngle(self, theShape1, theShape2):
9441 Get angle between the given shapes in degrees.
9444 theShape1,theShape2 Lines or linear edges to find angle between.
9447 If both arguments are vectors, the angle is computed in accordance
9448 with their orientations, otherwise the minimum angle is computed.
9451 Value of the angle between the given shapes in degrees.
9453 # Example: see GEOM_TestMeasures.py
9454 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9455 RaiseIfFailed("GetAngle", self.MeasuOp)
9458 ## Get angle between the given shapes in radians.
9459 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9460 # @note If both arguments are vectors, the angle is computed in accordance
9461 # with their orientations, otherwise the minimum angle is computed.
9462 # @return Value of the angle between the given shapes in radians.
9464 # @ref tui_measurement_tools_page "Example"
9465 def GetAngleRadians(self, theShape1, theShape2):
9467 Get angle between the given shapes in radians.
9470 theShape1,theShape2 Lines or linear edges to find angle between.
9474 If both arguments are vectors, the angle is computed in accordance
9475 with their orientations, otherwise the minimum angle is computed.
9478 Value of the angle between the given shapes in radians.
9480 # Example: see GEOM_TestMeasures.py
9481 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9482 RaiseIfFailed("GetAngle", self.MeasuOp)
9485 ## Get angle between the given vectors in degrees.
9486 # @param theShape1,theShape2 Vectors to find angle between.
9487 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9488 # if False, the opposite vector to the normal vector is used.
9489 # @return Value of the angle between the given vectors in degrees.
9491 # @ref tui_measurement_tools_page "Example"
9492 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9494 Get angle between the given vectors in degrees.
9497 theShape1,theShape2 Vectors to find angle between.
9498 theFlag If True, the normal vector is defined by the two vectors cross,
9499 if False, the opposite vector to the normal vector is used.
9502 Value of the angle between the given vectors in degrees.
9504 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9506 anAngle = 360. - anAngle
9507 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9510 ## The same as GetAngleVectors, but the result is in radians.
9511 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9513 Get angle between the given vectors in radians.
9516 theShape1,theShape2 Vectors to find angle between.
9517 theFlag If True, the normal vector is defined by the two vectors cross,
9518 if False, the opposite vector to the normal vector is used.
9521 Value of the angle between the given vectors in radians.
9523 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9526 ## @name Curve Curvature Measurement
9527 # Methods for receiving radius of curvature of curves
9528 # in the given point
9531 ## Measure curvature of a curve at a point, set by parameter.
9532 # @param theCurve a curve.
9533 # @param theParam parameter.
9534 # @return radius of curvature of \a theCurve.
9536 # @ref swig_todo "Example"
9537 def CurveCurvatureByParam(self, theCurve, theParam):
9539 Measure curvature of a curve at a point, set by parameter.
9546 radius of curvature of theCurve.
9548 # Example: see GEOM_TestMeasures.py
9549 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9550 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9553 ## Measure curvature of a curve at a point.
9554 # @param theCurve a curve.
9555 # @param thePoint given point.
9556 # @return radius of curvature of \a theCurve.
9558 # @ref swig_todo "Example"
9559 def CurveCurvatureByPoint(self, theCurve, thePoint):
9561 Measure curvature of a curve at a point.
9565 thePoint given point.
9568 radius of curvature of theCurve.
9570 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9571 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9575 ## @name Surface Curvature Measurement
9576 # Methods for receiving max and min radius of curvature of surfaces
9577 # in the given point
9580 ## Measure max radius of curvature of surface.
9581 # @param theSurf the given surface.
9582 # @param theUParam Value of U-parameter on the referenced surface.
9583 # @param theVParam Value of V-parameter on the referenced surface.
9584 # @return max radius of curvature of theSurf.
9586 ## @ref swig_todo "Example"
9587 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9589 Measure max radius of curvature of surface.
9592 theSurf the given surface.
9593 theUParam Value of U-parameter on the referenced surface.
9594 theVParam Value of V-parameter on the referenced surface.
9597 max radius of curvature of theSurf.
9599 # Example: see GEOM_TestMeasures.py
9600 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9601 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9604 ## Measure max radius of curvature of surface in the given point
9605 # @param theSurf the given surface.
9606 # @param thePoint given point.
9607 # @return max radius of curvature of theSurf.
9609 ## @ref swig_todo "Example"
9610 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9612 Measure max radius of curvature of surface in the given point.
9615 theSurf the given surface.
9616 thePoint given point.
9619 max radius of curvature of theSurf.
9621 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9622 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9625 ## Measure min radius of curvature of surface.
9626 # @param theSurf the given surface.
9627 # @param theUParam Value of U-parameter on the referenced surface.
9628 # @param theVParam Value of V-parameter on the referenced surface.
9629 # @return min radius of curvature of theSurf.
9631 ## @ref swig_todo "Example"
9632 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9634 Measure min radius of curvature of surface.
9637 theSurf the given surface.
9638 theUParam Value of U-parameter on the referenced surface.
9639 theVParam Value of V-parameter on the referenced surface.
9642 Min radius of curvature of theSurf.
9644 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9645 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9648 ## Measure min radius of curvature of surface in the given point
9649 # @param theSurf the given surface.
9650 # @param thePoint given point.
9651 # @return min radius of curvature of theSurf.
9653 ## @ref swig_todo "Example"
9654 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9656 Measure min radius of curvature of surface in the given point.
9659 theSurf the given surface.
9660 thePoint given point.
9663 Min radius of curvature of theSurf.
9665 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9666 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9670 ## Get min and max tolerances of sub-shapes of theShape
9671 # @param theShape Shape, to get tolerances of.
9672 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9673 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9674 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9675 # VertMin,VertMax: Min and max tolerances of the vertices.
9677 # @ref tui_measurement_tools_page "Example"
9678 def Tolerance(self,theShape):
9680 Get min and max tolerances of sub-shapes of theShape
9683 theShape Shape, to get tolerances of.
9686 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9687 FaceMin,FaceMax: Min and max tolerances of the faces.
9688 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9689 VertMin,VertMax: Min and max tolerances of the vertices.
9691 # Example: see GEOM_TestMeasures.py
9692 aTuple = self.MeasuOp.GetTolerance(theShape)
9693 RaiseIfFailed("GetTolerance", self.MeasuOp)
9696 ## Obtain description of the given shape (number of sub-shapes of each type)
9697 # @param theShape Shape to be described.
9698 # @return Description of the given shape.
9700 # @ref tui_measurement_tools_page "Example"
9701 def WhatIs(self,theShape):
9703 Obtain description of the given shape (number of sub-shapes of each type)
9706 theShape Shape to be described.
9709 Description of the given shape.
9711 # Example: see GEOM_TestMeasures.py
9712 aDescr = self.MeasuOp.WhatIs(theShape)
9713 RaiseIfFailed("WhatIs", self.MeasuOp)
9716 ## Obtain quantity of shapes of the given type in \a theShape.
9717 # If \a theShape is of type \a theType, it is also counted.
9718 # @param theShape Shape to be described.
9719 # @param theType the given ShapeType().
9720 # @return Quantity of shapes of type \a theType in \a theShape.
9722 # @ref tui_measurement_tools_page "Example"
9723 def NbShapes (self, theShape, theType):
9725 Obtain quantity of shapes of the given type in theShape.
9726 If theShape is of type theType, it is also counted.
9729 theShape Shape to be described.
9730 theType the given geompy.ShapeType
9733 Quantity of shapes of type theType in theShape.
9735 # Example: see GEOM_TestMeasures.py
9736 listSh = self.SubShapeAllIDs(theShape, theType)
9740 ## Obtain quantity of shapes of each type in \a theShape.
9741 # The \a theShape is also counted.
9742 # @param theShape Shape to be described.
9743 # @return Dictionary of ShapeType() with bound quantities of shapes.
9745 # @ref tui_measurement_tools_page "Example"
9746 def ShapeInfo (self, theShape):
9748 Obtain quantity of shapes of each type in theShape.
9749 The theShape is also counted.
9752 theShape Shape to be described.
9755 Dictionary of geompy.ShapeType with bound quantities of shapes.
9757 # Example: see GEOM_TestMeasures.py
9759 for typeSh in self.ShapeType:
9760 if typeSh in ( "AUTO", "SHAPE" ): continue
9761 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9767 def GetCreationInformation(self, theShape):
9768 info = theShape.GetCreationInformation()
9770 opName = info.operationName
9771 if not opName: opName = "no info available"
9772 res = "Operation: " + opName
9774 for parVal in info.params:
9775 res += " \n %s = %s" % ( parVal.name, parVal.value )
9778 ## Get a point, situated at the centre of mass of theShape.
9779 # @param theShape Shape to define centre of mass of.
9780 # @param theName Object name; when specified, this parameter is used
9781 # for result publication in the study. Otherwise, if automatic
9782 # publication is switched on, default value is used for result name.
9784 # @return New GEOM.GEOM_Object, containing the created point.
9786 # @ref tui_measurement_tools_page "Example"
9787 def MakeCDG(self, theShape, theName=None):
9789 Get a point, situated at the centre of mass of theShape.
9792 theShape Shape to define centre of mass of.
9793 theName Object name; when specified, this parameter is used
9794 for result publication in the study. Otherwise, if automatic
9795 publication is switched on, default value is used for result name.
9798 New GEOM.GEOM_Object, containing the created point.
9800 # Example: see GEOM_TestMeasures.py
9801 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9802 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9803 self._autoPublish(anObj, theName, "centerOfMass")
9806 ## Get a vertex sub-shape by index depended with orientation.
9807 # @param theShape Shape to find sub-shape.
9808 # @param theIndex Index to find vertex by this index (starting from zero)
9809 # @param theName Object name; when specified, this parameter is used
9810 # for result publication in the study. Otherwise, if automatic
9811 # publication is switched on, default value is used for result name.
9813 # @return New GEOM.GEOM_Object, containing the created vertex.
9815 # @ref tui_measurement_tools_page "Example"
9816 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9818 Get a vertex sub-shape by index depended with orientation.
9821 theShape Shape to find sub-shape.
9822 theIndex Index to find vertex by this index (starting from zero)
9823 theName Object name; when specified, this parameter is used
9824 for result publication in the study. Otherwise, if automatic
9825 publication is switched on, default value is used for result name.
9828 New GEOM.GEOM_Object, containing the created vertex.
9830 # Example: see GEOM_TestMeasures.py
9831 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9832 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9833 self._autoPublish(anObj, theName, "vertex")
9836 ## Get the first vertex of wire/edge depended orientation.
9837 # @param theShape Shape to find first vertex.
9838 # @param theName Object name; when specified, this parameter is used
9839 # for result publication in the study. Otherwise, if automatic
9840 # publication is switched on, default value is used for result name.
9842 # @return New GEOM.GEOM_Object, containing the created vertex.
9844 # @ref tui_measurement_tools_page "Example"
9845 def GetFirstVertex(self, theShape, theName=None):
9847 Get the first vertex of wire/edge depended orientation.
9850 theShape Shape to find first vertex.
9851 theName Object name; when specified, this parameter is used
9852 for result publication in the study. Otherwise, if automatic
9853 publication is switched on, default value is used for result name.
9856 New GEOM.GEOM_Object, containing the created vertex.
9858 # Example: see GEOM_TestMeasures.py
9859 # note: auto-publishing is done in self.GetVertexByIndex()
9860 anObj = self.GetVertexByIndex(theShape, 0, theName)
9861 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9864 ## Get the last vertex of wire/edge depended orientation.
9865 # @param theShape Shape to find last vertex.
9866 # @param theName Object name; when specified, this parameter is used
9867 # for result publication in the study. Otherwise, if automatic
9868 # publication is switched on, default value is used for result name.
9870 # @return New GEOM.GEOM_Object, containing the created vertex.
9872 # @ref tui_measurement_tools_page "Example"
9873 def GetLastVertex(self, theShape, theName=None):
9875 Get the last vertex of wire/edge depended orientation.
9878 theShape Shape to find last vertex.
9879 theName Object name; when specified, this parameter is used
9880 for result publication in the study. Otherwise, if automatic
9881 publication is switched on, default value is used for result name.
9884 New GEOM.GEOM_Object, containing the created vertex.
9886 # Example: see GEOM_TestMeasures.py
9887 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9888 # note: auto-publishing is done in self.GetVertexByIndex()
9889 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9890 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9893 ## Get a normale to the given face. If the point is not given,
9894 # the normale is calculated at the center of mass.
9895 # @param theFace Face to define normale of.
9896 # @param theOptionalPoint Point to compute the normale at.
9897 # @param theName Object name; when specified, this parameter is used
9898 # for result publication in the study. Otherwise, if automatic
9899 # publication is switched on, default value is used for result name.
9901 # @return New GEOM.GEOM_Object, containing the created vector.
9903 # @ref swig_todo "Example"
9904 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9906 Get a normale to the given face. If the point is not given,
9907 the normale is calculated at the center of mass.
9910 theFace Face to define normale of.
9911 theOptionalPoint Point to compute the normale at.
9912 theName Object name; when specified, this parameter is used
9913 for result publication in the study. Otherwise, if automatic
9914 publication is switched on, default value is used for result name.
9917 New GEOM.GEOM_Object, containing the created vector.
9919 # Example: see GEOM_TestMeasures.py
9920 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9921 RaiseIfFailed("GetNormal", self.MeasuOp)
9922 self._autoPublish(anObj, theName, "normal")
9925 ## Check a topology of the given shape.
9926 # @param theShape Shape to check validity of.
9927 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9928 # if TRUE, the shape's geometry will be checked also.
9929 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9930 # of problem is printed.
9931 # if TRUE and if theShape is invalid, the description
9932 # of problem is also returned.
9933 # @return TRUE, if the shape "seems to be valid".
9935 # @ref tui_measurement_tools_page "Example"
9936 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9938 Check a topology of the given shape.
9941 theShape Shape to check validity of.
9942 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9943 if TRUE, the shape's geometry will be checked also.
9944 theReturnStatus If FALSE and if theShape is invalid, a description
9945 of problem is printed.
9946 if TRUE and if theShape is invalid, the description
9947 of problem is returned.
9950 TRUE, if the shape "seems to be valid".
9951 If theShape is invalid, prints a description of problem.
9952 This description can also be returned.
9954 # Example: see GEOM_TestMeasures.py
9956 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9957 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9959 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9960 RaiseIfFailed("CheckShape", self.MeasuOp)
9962 if theReturnStatus == 0:
9964 if theReturnStatus == 1:
9965 return (IsValid, Status)
9968 ## Detect self-intersections in the given shape.
9969 # @param theShape Shape to check.
9970 # @return TRUE, if the shape contains no self-intersections.
9972 # @ref tui_measurement_tools_page "Example"
9973 def CheckSelfIntersections(self, theShape):
9975 Detect self-intersections in the given shape.
9978 theShape Shape to check.
9981 TRUE, if the shape contains no self-intersections.
9983 # Example: see GEOM_TestMeasures.py
9984 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9985 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9988 ## Get position (LCS) of theShape.
9990 # Origin of the LCS is situated at the shape's center of mass.
9991 # Axes of the LCS are obtained from shape's location or,
9992 # if the shape is a planar face, from position of its plane.
9994 # @param theShape Shape to calculate position of.
9995 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9996 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9997 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9998 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10000 # @ref swig_todo "Example"
10001 def GetPosition(self,theShape):
10003 Get position (LCS) of theShape.
10004 Origin of the LCS is situated at the shape's center of mass.
10005 Axes of the LCS are obtained from shape's location or,
10006 if the shape is a planar face, from position of its plane.
10009 theShape Shape to calculate position of.
10012 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10013 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10014 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10015 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10017 # Example: see GEOM_TestMeasures.py
10018 aTuple = self.MeasuOp.GetPosition(theShape)
10019 RaiseIfFailed("GetPosition", self.MeasuOp)
10022 ## Get kind of theShape.
10024 # @param theShape Shape to get a kind of.
10025 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10026 # and a list of parameters, describing the shape.
10027 # @note Concrete meaning of each value, returned via \a theIntegers
10028 # or \a theDoubles list depends on the kind() of the shape.
10030 # @ref swig_todo "Example"
10031 def KindOfShape(self,theShape):
10033 Get kind of theShape.
10036 theShape Shape to get a kind of.
10039 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10040 and a list of parameters, describing the shape.
10042 Concrete meaning of each value, returned via theIntegers
10043 or theDoubles list depends on the geompy.kind of the shape
10045 # Example: see GEOM_TestMeasures.py
10046 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10047 RaiseIfFailed("KindOfShape", self.MeasuOp)
10049 aKind = aRoughTuple[0]
10050 anInts = aRoughTuple[1]
10051 aDbls = aRoughTuple[2]
10053 # Now there is no exception from this rule:
10054 aKindTuple = [aKind] + aDbls + anInts
10056 # If they are we will regroup parameters for such kind of shape.
10058 #if aKind == kind.SOME_KIND:
10059 # # SOME_KIND int int double int double double
10060 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10064 # end of l2_measure
10067 ## @addtogroup l2_import_export
10070 ## Import a shape from the BREP or IGES or STEP file
10071 # (depends on given format) with given name.
10072 # @param theFileName The file, containing the shape.
10073 # @param theFormatName Specify format for the file reading.
10074 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10075 # If format 'IGES_SCALE' is used instead of 'IGES' or
10076 # format 'STEP_SCALE' is used instead of 'STEP',
10077 # length unit will be set to 'meter' and result model will be scaled.
10078 # @param theName Object name; when specified, this parameter is used
10079 # for result publication in the study. Otherwise, if automatic
10080 # publication is switched on, default value is used for result name.
10082 # @return New GEOM.GEOM_Object, containing the imported shape.
10084 # @ref swig_Import_Export "Example"
10085 def ImportFile(self, theFileName, theFormatName, theName=None):
10087 Import a shape from the BREP or IGES or STEP file
10088 (depends on given format) with given name.
10091 theFileName The file, containing the shape.
10092 theFormatName Specify format for the file reading.
10093 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10094 If format 'IGES_SCALE' is used instead of 'IGES' or
10095 format 'STEP_SCALE' is used instead of 'STEP',
10096 length unit will be set to 'meter' and result model will be scaled.
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 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10106 RaiseIfFailed("ImportFile", self.InsertOp)
10107 self._autoPublish(anObj, theName, "imported")
10110 ## Deprecated analog of ImportFile()
10111 def Import(self, theFileName, theFormatName, theName=None):
10113 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10115 print "WARNING: Function Import is deprecated, use ImportFile instead"
10116 # note: auto-publishing is done in self.ImportFile()
10117 return self.ImportFile(theFileName, theFormatName, theName)
10119 ## Shortcut to ImportFile() for BREP format.
10120 # Import a shape from the BREP file with given name.
10121 # @param theFileName The file, containing the shape.
10122 # @param theName Object name; when specified, this parameter is used
10123 # for result publication in the study. Otherwise, if automatic
10124 # publication is switched on, default value is used for result name.
10126 # @return New GEOM.GEOM_Object, containing the imported shape.
10128 # @ref swig_Import_Export "Example"
10129 def ImportBREP(self, theFileName, theName=None):
10131 geompy.ImportFile(...) function for BREP format
10132 Import a shape from the BREP file with given name.
10135 theFileName The file, containing the shape.
10136 theName Object name; when specified, this parameter is used
10137 for result publication in the study. Otherwise, if automatic
10138 publication is switched on, default value is used for result name.
10141 New GEOM.GEOM_Object, containing the imported shape.
10143 # Example: see GEOM_TestOthers.py
10144 # note: auto-publishing is done in self.ImportFile()
10145 return self.ImportFile(theFileName, "BREP", theName)
10147 ## Shortcut to ImportFile() for IGES format
10148 # Import a shape from the IGES file with given name.
10149 # @param theFileName The file, containing the shape.
10150 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10151 # and result model will be scaled, if its units are not meters.
10152 # If False (default), file length units will be taken into account.
10153 # @param theName Object name; when specified, this parameter is used
10154 # for result publication in the study. Otherwise, if automatic
10155 # publication is switched on, default value is used for result name.
10157 # @return New GEOM.GEOM_Object, containing the imported shape.
10159 # @ref swig_Import_Export "Example"
10160 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10162 geompy.ImportFile(...) function for IGES format
10165 theFileName The file, containing the shape.
10166 ignoreUnits If True, file length units will be ignored (set to 'meter')
10167 and result model will be scaled, if its units are not meters.
10168 If False (default), file length units will be taken into account.
10169 theName Object name; when specified, this parameter is used
10170 for result publication in the study. Otherwise, if automatic
10171 publication is switched on, default value is used for result name.
10174 New GEOM.GEOM_Object, containing the imported shape.
10176 # Example: see GEOM_TestOthers.py
10177 # note: auto-publishing is done in self.ImportFile()
10179 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10180 return self.ImportFile(theFileName, "IGES", theName)
10182 ## Return length unit from given IGES file
10183 # @param theFileName The file, containing the shape.
10184 # @return String, containing the units name.
10186 # @ref swig_Import_Export "Example"
10187 def GetIGESUnit(self, theFileName):
10189 Return length units from given IGES file
10192 theFileName The file, containing the shape.
10195 String, containing the units name.
10197 # Example: see GEOM_TestOthers.py
10198 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10201 ## Shortcut to ImportFile() for STEP format
10202 # Import a shape from the STEP file with given name.
10203 # @param theFileName The file, containing the shape.
10204 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10205 # and result model will be scaled, if its units are not meters.
10206 # If False (default), file length units will be taken into account.
10207 # @param theName Object name; when specified, this parameter is used
10208 # for result publication in the study. Otherwise, if automatic
10209 # publication is switched on, default value is used for result name.
10211 # @return New GEOM.GEOM_Object, containing the imported shape.
10213 # @ref swig_Import_Export "Example"
10214 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10216 geompy.ImportFile(...) function for STEP format
10219 theFileName The file, containing the shape.
10220 ignoreUnits If True, file length units will be ignored (set to 'meter')
10221 and result model will be scaled, if its units are not meters.
10222 If False (default), file length units will be taken into account.
10223 theName Object name; when specified, this parameter is used
10224 for result publication in the study. Otherwise, if automatic
10225 publication is switched on, default value is used for result name.
10228 New GEOM.GEOM_Object, containing the imported shape.
10230 # Example: see GEOM_TestOthers.py
10231 # note: auto-publishing is done in self.ImportFile()
10233 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10234 return self.ImportFile(theFileName, "STEP", theName)
10236 ## Return length unit from given IGES or STEP file
10237 # @param theFileName The file, containing the shape.
10238 # @return String, containing the units name.
10240 # @ref swig_Import_Export "Example"
10241 def GetSTEPUnit(self, theFileName):
10243 Return length units from given STEP file
10246 theFileName The file, containing the shape.
10249 String, containing the units name.
10251 # Example: see GEOM_TestOthers.py
10252 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10255 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10256 # @note This method will not be dumped to the python script by DumpStudy functionality.
10257 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10258 # @param theStream The BRep binary stream.
10259 # @param theName Object name; when specified, this parameter is used
10260 # for result publication in the study. Otherwise, if automatic
10261 # publication is switched on, default value is used for result name.
10263 # @return New GEOM_Object, containing the shape, read from theStream.
10265 # @ref swig_Import_Export "Example"
10266 def RestoreShape (self, theStream, theName=None):
10268 Read a shape from the binary stream, containing its bounding representation (BRep).
10271 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10274 theStream The BRep binary stream.
10275 theName Object name; when specified, this parameter is used
10276 for result publication in the study. Otherwise, if automatic
10277 publication is switched on, default value is used for result name.
10280 New GEOM_Object, containing the shape, read from theStream.
10282 # Example: see GEOM_TestOthers.py
10283 anObj = self.InsertOp.RestoreShape(theStream)
10284 RaiseIfFailed("RestoreShape", self.InsertOp)
10285 self._autoPublish(anObj, theName, "restored")
10288 ## Export the given shape into a file with given name.
10289 # @param theObject Shape to be stored in the file.
10290 # @param theFileName Name of the file to store the given shape in.
10291 # @param theFormatName Specify format for the shape storage.
10292 # Available formats can be obtained with
10293 # geompy.InsertOp.ExportTranslators()[0] method.
10295 # @ref swig_Import_Export "Example"
10296 def Export(self, theObject, theFileName, theFormatName):
10298 Export the given shape into a file with given name.
10301 theObject Shape to be stored in the file.
10302 theFileName Name of the file to store the given shape in.
10303 theFormatName Specify format for the shape storage.
10304 Available formats can be obtained with
10305 geompy.InsertOp.ExportTranslators()[0] method.
10307 # Example: see GEOM_TestOthers.py
10308 self.InsertOp.Export(theObject, theFileName, theFormatName)
10309 if self.InsertOp.IsDone() == 0:
10310 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10314 ## Shortcut to Export() for BREP format
10316 # @ref swig_Import_Export "Example"
10317 def ExportBREP(self,theObject, theFileName):
10319 geompy.Export(...) function for BREP format
10321 # Example: see GEOM_TestOthers.py
10322 return self.Export(theObject, theFileName, "BREP")
10324 ## Shortcut to Export() for IGES format
10326 # @ref swig_Import_Export "Example"
10327 def ExportIGES(self,theObject, theFileName):
10329 geompy.Export(...) function for IGES format
10331 # Example: see GEOM_TestOthers.py
10332 return self.Export(theObject, theFileName, "IGES")
10334 ## Shortcut to Export() for STEP format
10336 # @ref swig_Import_Export "Example"
10337 def ExportSTEP(self,theObject, theFileName):
10339 geompy.Export(...) function for STEP format
10341 # Example: see GEOM_TestOthers.py
10342 return self.Export(theObject, theFileName, "STEP")
10344 # end of l2_import_export
10347 ## @addtogroup l3_blocks
10350 ## Create a quadrangle face from four edges. Order of Edges is not
10351 # important. It is not necessary that edges share the same vertex.
10352 # @param E1,E2,E3,E4 Edges for the face bound.
10353 # @param theName Object name; when specified, this parameter is used
10354 # for result publication in the study. Otherwise, if automatic
10355 # publication is switched on, default value is used for result name.
10357 # @return New GEOM.GEOM_Object, containing the created face.
10359 # @ref tui_building_by_blocks_page "Example"
10360 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10362 Create a quadrangle face from four edges. Order of Edges is not
10363 important. It is not necessary that edges share the same vertex.
10366 E1,E2,E3,E4 Edges for the face bound.
10367 theName Object name; when specified, this parameter is used
10368 for result publication in the study. Otherwise, if automatic
10369 publication is switched on, default value is used for result name.
10372 New GEOM.GEOM_Object, containing the created face.
10375 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10377 # Example: see GEOM_Spanner.py
10378 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10379 RaiseIfFailed("MakeQuad", self.BlocksOp)
10380 self._autoPublish(anObj, theName, "quad")
10383 ## Create a quadrangle face on two edges.
10384 # The missing edges will be built by creating the shortest ones.
10385 # @param E1,E2 Two opposite edges for the face.
10386 # @param theName Object name; when specified, this parameter is used
10387 # for result publication in the study. Otherwise, if automatic
10388 # publication is switched on, default value is used for result name.
10390 # @return New GEOM.GEOM_Object, containing the created face.
10392 # @ref tui_building_by_blocks_page "Example"
10393 def MakeQuad2Edges(self, E1, E2, theName=None):
10395 Create a quadrangle face on two edges.
10396 The missing edges will be built by creating the shortest ones.
10399 E1,E2 Two opposite edges for the face.
10400 theName Object name; when specified, this parameter is used
10401 for result publication in the study. Otherwise, if automatic
10402 publication is switched on, default value is used for result name.
10405 New GEOM.GEOM_Object, containing the created face.
10409 p1 = geompy.MakeVertex( 0., 0., 0.)
10410 p2 = geompy.MakeVertex(150., 30., 0.)
10411 p3 = geompy.MakeVertex( 0., 120., 50.)
10412 p4 = geompy.MakeVertex( 0., 40., 70.)
10414 edge1 = geompy.MakeEdge(p1, p2)
10415 edge2 = geompy.MakeEdge(p3, p4)
10416 # create a quadrangle face from two edges
10417 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10419 # Example: see GEOM_Spanner.py
10420 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10421 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10422 self._autoPublish(anObj, theName, "quad")
10425 ## Create a quadrangle face with specified corners.
10426 # The missing edges will be built by creating the shortest ones.
10427 # @param V1,V2,V3,V4 Corner vertices for the face.
10428 # @param theName Object name; when specified, this parameter is used
10429 # for result publication in the study. Otherwise, if automatic
10430 # publication is switched on, default value is used for result name.
10432 # @return New GEOM.GEOM_Object, containing the created face.
10434 # @ref tui_building_by_blocks_page "Example 1"
10435 # \n @ref swig_MakeQuad4Vertices "Example 2"
10436 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10438 Create a quadrangle face with specified corners.
10439 The missing edges will be built by creating the shortest ones.
10442 V1,V2,V3,V4 Corner vertices for the face.
10443 theName Object name; when specified, this parameter is used
10444 for result publication in the study. Otherwise, if automatic
10445 publication is switched on, default value is used for result name.
10448 New GEOM.GEOM_Object, containing the created face.
10452 p1 = geompy.MakeVertex( 0., 0., 0.)
10453 p2 = geompy.MakeVertex(150., 30., 0.)
10454 p3 = geompy.MakeVertex( 0., 120., 50.)
10455 p4 = geompy.MakeVertex( 0., 40., 70.)
10456 # create a quadrangle from four points in its corners
10457 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10459 # Example: see GEOM_Spanner.py
10460 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10461 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10462 self._autoPublish(anObj, theName, "quad")
10465 ## Create a hexahedral solid, bounded by the six given faces. Order of
10466 # faces is not important. It is not necessary that Faces share the same edge.
10467 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10468 # @param theName Object name; when specified, this parameter is used
10469 # for result publication in the study. Otherwise, if automatic
10470 # publication is switched on, default value is used for result name.
10472 # @return New GEOM.GEOM_Object, containing the created solid.
10474 # @ref tui_building_by_blocks_page "Example 1"
10475 # \n @ref swig_MakeHexa "Example 2"
10476 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10478 Create a hexahedral solid, bounded by the six given faces. Order of
10479 faces is not important. It is not necessary that Faces share the same edge.
10482 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10483 theName Object name; when specified, this parameter is used
10484 for result publication in the study. Otherwise, if automatic
10485 publication is switched on, default value is used for result name.
10488 New GEOM.GEOM_Object, containing the created solid.
10491 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10493 # Example: see GEOM_Spanner.py
10494 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10495 RaiseIfFailed("MakeHexa", self.BlocksOp)
10496 self._autoPublish(anObj, theName, "hexa")
10499 ## Create a hexahedral solid between two given faces.
10500 # The missing faces will be built by creating the smallest ones.
10501 # @param F1,F2 Two opposite faces for the hexahedral solid.
10502 # @param theName Object name; when specified, this parameter is used
10503 # for result publication in the study. Otherwise, if automatic
10504 # publication is switched on, default value is used for result name.
10506 # @return New GEOM.GEOM_Object, containing the created solid.
10508 # @ref tui_building_by_blocks_page "Example 1"
10509 # \n @ref swig_MakeHexa2Faces "Example 2"
10510 def MakeHexa2Faces(self, F1, F2, theName=None):
10512 Create a hexahedral solid between two given faces.
10513 The missing faces will be built by creating the smallest ones.
10516 F1,F2 Two opposite faces for the hexahedral solid.
10517 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.
10522 New GEOM.GEOM_Object, containing the created solid.
10525 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10527 # Example: see GEOM_Spanner.py
10528 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10529 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10530 self._autoPublish(anObj, theName, "hexa")
10536 ## @addtogroup l3_blocks_op
10539 ## Get a vertex, found in the given shape by its coordinates.
10540 # @param theShape Block or a compound of blocks.
10541 # @param theX,theY,theZ Coordinates of the sought vertex.
10542 # @param theEpsilon Maximum allowed distance between the resulting
10543 # vertex and point with the given coordinates.
10544 # @param theName Object name; when specified, this parameter is used
10545 # for result publication in the study. Otherwise, if automatic
10546 # publication is switched on, default value is used for result name.
10548 # @return New GEOM.GEOM_Object, containing the found vertex.
10550 # @ref swig_GetPoint "Example"
10551 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10553 Get a vertex, found in the given shape by its coordinates.
10556 theShape Block or a compound of blocks.
10557 theX,theY,theZ Coordinates of the sought vertex.
10558 theEpsilon Maximum allowed distance between the resulting
10559 vertex and point with the given coordinates.
10560 theName Object name; when specified, this parameter is used
10561 for result publication in the study. Otherwise, if automatic
10562 publication is switched on, default value is used for result name.
10565 New GEOM.GEOM_Object, containing the found vertex.
10568 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10570 # Example: see GEOM_TestOthers.py
10571 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10572 RaiseIfFailed("GetPoint", self.BlocksOp)
10573 self._autoPublish(anObj, theName, "vertex")
10576 ## Find a vertex of the given shape, which has minimal distance to the given point.
10577 # @param theShape Any shape.
10578 # @param thePoint Point, close to the desired vertex.
10579 # @param theName Object name; when specified, this parameter is used
10580 # for result publication in the study. Otherwise, if automatic
10581 # publication is switched on, default value is used for result name.
10583 # @return New GEOM.GEOM_Object, containing the found vertex.
10585 # @ref swig_GetVertexNearPoint "Example"
10586 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10588 Find a vertex of the given shape, which has minimal distance to the given point.
10591 theShape Any shape.
10592 thePoint Point, close to the desired vertex.
10593 theName Object name; when specified, this parameter is used
10594 for result publication in the study. Otherwise, if automatic
10595 publication is switched on, default value is used for result name.
10598 New GEOM.GEOM_Object, containing the found vertex.
10601 pmidle = geompy.MakeVertex(50, 0, 50)
10602 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10604 # Example: see GEOM_TestOthers.py
10605 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10606 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10607 self._autoPublish(anObj, theName, "vertex")
10610 ## Get an edge, found in the given shape by two given vertices.
10611 # @param theShape Block or a compound of blocks.
10612 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10613 # @param theName Object name; when specified, this parameter is used
10614 # for result publication in the study. Otherwise, if automatic
10615 # publication is switched on, default value is used for result name.
10617 # @return New GEOM.GEOM_Object, containing the found edge.
10619 # @ref swig_GetEdge "Example"
10620 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10622 Get an edge, found in the given shape by two given vertices.
10625 theShape Block or a compound of blocks.
10626 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10627 theName Object name; when specified, this parameter is used
10628 for result publication in the study. Otherwise, if automatic
10629 publication is switched on, default value is used for result name.
10632 New GEOM.GEOM_Object, containing the found edge.
10634 # Example: see GEOM_Spanner.py
10635 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10636 RaiseIfFailed("GetEdge", self.BlocksOp)
10637 self._autoPublish(anObj, theName, "edge")
10640 ## Find an edge of the given shape, which has minimal distance to the given point.
10641 # @param theShape Block or a compound of blocks.
10642 # @param thePoint Point, close to the desired edge.
10643 # @param theName Object name; when specified, this parameter is used
10644 # for result publication in the study. Otherwise, if automatic
10645 # publication is switched on, default value is used for result name.
10647 # @return New GEOM.GEOM_Object, containing the found edge.
10649 # @ref swig_GetEdgeNearPoint "Example"
10650 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10652 Find an edge of the given shape, which has minimal distance to the given point.
10655 theShape Block or a compound of blocks.
10656 thePoint Point, close to the desired edge.
10657 theName Object name; when specified, this parameter is used
10658 for result publication in the study. Otherwise, if automatic
10659 publication is switched on, default value is used for result name.
10662 New GEOM.GEOM_Object, containing the found edge.
10664 # Example: see GEOM_TestOthers.py
10665 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10666 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10667 self._autoPublish(anObj, theName, "edge")
10670 ## Returns a face, found in the given shape by four given corner vertices.
10671 # @param theShape Block or a compound of blocks.
10672 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10673 # @param theName Object name; when specified, this parameter is used
10674 # for result publication in the study. Otherwise, if automatic
10675 # publication is switched on, default value is used for result name.
10677 # @return New GEOM.GEOM_Object, containing the found face.
10679 # @ref swig_todo "Example"
10680 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10682 Returns a face, found in the given shape by four given corner vertices.
10685 theShape Block or a compound of blocks.
10686 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10687 theName Object name; when specified, this parameter is used
10688 for result publication in the study. Otherwise, if automatic
10689 publication is switched on, default value is used for result name.
10692 New GEOM.GEOM_Object, containing the found face.
10694 # Example: see GEOM_Spanner.py
10695 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10696 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10697 self._autoPublish(anObj, theName, "face")
10700 ## Get a face of block, found in the given shape by two given edges.
10701 # @param theShape Block or a compound of blocks.
10702 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10703 # @param theName Object name; when specified, this parameter is used
10704 # for result publication in the study. Otherwise, if automatic
10705 # publication is switched on, default value is used for result name.
10707 # @return New GEOM.GEOM_Object, containing the found face.
10709 # @ref swig_todo "Example"
10710 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10712 Get a face of block, found in the given shape by two given edges.
10715 theShape Block or a compound of blocks.
10716 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10717 theName Object name; when specified, this parameter is used
10718 for result publication in the study. Otherwise, if automatic
10719 publication is switched on, default value is used for result name.
10722 New GEOM.GEOM_Object, containing the found face.
10724 # Example: see GEOM_Spanner.py
10725 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10726 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10727 self._autoPublish(anObj, theName, "face")
10730 ## Find a face, opposite to the given one in the given block.
10731 # @param theBlock Must be a hexahedral solid.
10732 # @param theFace Face of \a theBlock, opposite to the desired face.
10733 # @param theName Object name; when specified, this parameter is used
10734 # for result publication in the study. Otherwise, if automatic
10735 # publication is switched on, default value is used for result name.
10737 # @return New GEOM.GEOM_Object, containing the found face.
10739 # @ref swig_GetOppositeFace "Example"
10740 def GetOppositeFace(self, theBlock, theFace, theName=None):
10742 Find a face, opposite to the given one in the given block.
10745 theBlock Must be a hexahedral solid.
10746 theFace Face of theBlock, opposite to the desired face.
10747 theName Object name; when specified, this parameter is used
10748 for result publication in the study. Otherwise, if automatic
10749 publication is switched on, default value is used for result name.
10752 New GEOM.GEOM_Object, containing the found face.
10754 # Example: see GEOM_Spanner.py
10755 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10756 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10757 self._autoPublish(anObj, theName, "face")
10760 ## Find a face of the given shape, which has minimal distance to the given point.
10761 # @param theShape Block or a compound of blocks.
10762 # @param thePoint Point, close to the desired face.
10763 # @param theName Object name; when specified, this parameter is used
10764 # for result publication in the study. Otherwise, if automatic
10765 # publication is switched on, default value is used for result name.
10767 # @return New GEOM.GEOM_Object, containing the found face.
10769 # @ref swig_GetFaceNearPoint "Example"
10770 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10772 Find a face of the given shape, which has minimal distance to the given point.
10775 theShape Block or a compound of blocks.
10776 thePoint Point, close to the desired face.
10777 theName Object name; when specified, this parameter is used
10778 for result publication in the study. Otherwise, if automatic
10779 publication is switched on, default value is used for result name.
10782 New GEOM.GEOM_Object, containing the found face.
10784 # Example: see GEOM_Spanner.py
10785 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10786 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10787 self._autoPublish(anObj, theName, "face")
10790 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10791 # @param theBlock Block or a compound of blocks.
10792 # @param theVector Vector, close to the normale of the desired face.
10793 # @param theName Object name; when specified, this parameter is used
10794 # for result publication in the study. Otherwise, if automatic
10795 # publication is switched on, default value is used for result name.
10797 # @return New GEOM.GEOM_Object, containing the found face.
10799 # @ref swig_todo "Example"
10800 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10802 Find a face of block, whose outside normale has minimal angle with the given vector.
10805 theBlock Block or a compound of blocks.
10806 theVector Vector, close to the normale of the desired face.
10807 theName Object name; when specified, this parameter is used
10808 for result publication in the study. Otherwise, if automatic
10809 publication is switched on, default value is used for result name.
10812 New GEOM.GEOM_Object, containing the found face.
10814 # Example: see GEOM_Spanner.py
10815 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10816 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10817 self._autoPublish(anObj, theName, "face")
10820 ## Find all sub-shapes of type \a theShapeType of the given shape,
10821 # which have minimal distance to the given point.
10822 # @param theShape Any shape.
10823 # @param thePoint Point, close to the desired shape.
10824 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10825 # @param theTolerance The tolerance for distances comparison. All shapes
10826 # with distances to the given point in interval
10827 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10828 # @param theName Object name; when specified, this parameter is used
10829 # for result publication in the study. Otherwise, if automatic
10830 # publication is switched on, default value is used for result name.
10832 # @return New GEOM_Object, containing a group of all found shapes.
10834 # @ref swig_GetShapesNearPoint "Example"
10835 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10837 Find all sub-shapes of type theShapeType of the given shape,
10838 which have minimal distance to the given point.
10841 theShape Any shape.
10842 thePoint Point, close to the desired shape.
10843 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10844 theTolerance The tolerance for distances comparison. All shapes
10845 with distances to the given point in interval
10846 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10847 theName Object name; when specified, this parameter is used
10848 for result publication in the study. Otherwise, if automatic
10849 publication is switched on, default value is used for result name.
10852 New GEOM_Object, containing a group of all found shapes.
10854 # Example: see GEOM_TestOthers.py
10855 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10856 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10857 self._autoPublish(anObj, theName, "group")
10860 # end of l3_blocks_op
10863 ## @addtogroup l4_blocks_measure
10866 ## Check, if the compound of blocks is given.
10867 # To be considered as a compound of blocks, the
10868 # given shape must satisfy the following conditions:
10869 # - Each element of the compound should be a Block (6 faces and 12 edges).
10870 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10871 # - The compound should be connexe.
10872 # - The glue between two quadrangle faces should be applied.
10873 # @param theCompound The compound to check.
10874 # @return TRUE, if the given shape is a compound of blocks.
10875 # If theCompound is not valid, prints all discovered errors.
10877 # @ref tui_measurement_tools_page "Example 1"
10878 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10879 def CheckCompoundOfBlocks(self,theCompound):
10881 Check, if the compound of blocks is given.
10882 To be considered as a compound of blocks, the
10883 given shape must satisfy the following conditions:
10884 - Each element of the compound should be a Block (6 faces and 12 edges).
10885 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10886 - The compound should be connexe.
10887 - The glue between two quadrangle faces should be applied.
10890 theCompound The compound to check.
10893 TRUE, if the given shape is a compound of blocks.
10894 If theCompound is not valid, prints all discovered errors.
10896 # Example: see GEOM_Spanner.py
10897 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10898 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10900 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10904 ## Retrieve all non blocks solids and faces from \a theShape.
10905 # @param theShape The shape to explore.
10906 # @param theName Object name; when specified, this parameter is used
10907 # for result publication in the study. Otherwise, if automatic
10908 # publication is switched on, default value is used for result name.
10910 # @return A tuple of two GEOM_Objects. The first object is a group of all
10911 # non block solids (= not 6 faces, or with 6 faces, but with the
10912 # presence of non-quadrangular faces). The second object is a
10913 # group of all non quadrangular faces.
10915 # @ref tui_measurement_tools_page "Example 1"
10916 # \n @ref swig_GetNonBlocks "Example 2"
10917 def GetNonBlocks (self, theShape, theName=None):
10919 Retrieve all non blocks solids and faces from theShape.
10922 theShape The shape to explore.
10923 theName Object name; when specified, this parameter is used
10924 for result publication in the study. Otherwise, if automatic
10925 publication is switched on, default value is used for result name.
10928 A tuple of two GEOM_Objects. The first object is a group of all
10929 non block solids (= not 6 faces, or with 6 faces, but with the
10930 presence of non-quadrangular faces). The second object is a
10931 group of all non quadrangular faces.
10934 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10936 # Example: see GEOM_Spanner.py
10937 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10938 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10939 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10942 ## Remove all seam and degenerated edges from \a theShape.
10943 # Unite faces and edges, sharing one surface. It means that
10944 # this faces must have references to one C++ surface object (handle).
10945 # @param theShape The compound or single solid to remove irregular edges from.
10946 # @param doUnionFaces If True, then unite faces. If False (the default value),
10947 # do not unite faces.
10948 # @param theName Object name; when specified, this parameter is used
10949 # for result publication in the study. Otherwise, if automatic
10950 # publication is switched on, default value is used for result name.
10952 # @return Improved shape.
10954 # @ref swig_RemoveExtraEdges "Example"
10955 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10957 Remove all seam and degenerated edges from theShape.
10958 Unite faces and edges, sharing one surface. It means that
10959 this faces must have references to one C++ surface object (handle).
10962 theShape The compound or single solid to remove irregular edges from.
10963 doUnionFaces If True, then unite faces. If False (the default value),
10964 do not unite faces.
10965 theName Object name; when specified, this parameter is used
10966 for result publication in the study. Otherwise, if automatic
10967 publication is switched on, default value is used for result name.
10972 # Example: see GEOM_TestOthers.py
10973 nbFacesOptimum = -1 # -1 means do not unite faces
10974 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10975 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10976 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10977 self._autoPublish(anObj, theName, "removeExtraEdges")
10980 ## Performs union faces of \a theShape
10981 # Unite faces sharing one surface. It means that
10982 # these faces must have references to one C++ surface object (handle).
10983 # @param theShape The compound or single solid that contains faces
10984 # to perform union.
10985 # @param theName Object name; when specified, this parameter is used
10986 # for result publication in the study. Otherwise, if automatic
10987 # publication is switched on, default value is used for result name.
10989 # @return Improved shape.
10991 # @ref swig_UnionFaces "Example"
10992 def UnionFaces(self, theShape, theName=None):
10994 Performs union faces of theShape.
10995 Unite faces sharing one surface. It means that
10996 these faces must have references to one C++ surface object (handle).
10999 theShape The compound or single solid that contains faces
11001 theName Object name; when specified, this parameter is used
11002 for result publication in the study. Otherwise, if automatic
11003 publication is switched on, default value is used for result name.
11008 # Example: see GEOM_TestOthers.py
11009 anObj = self.BlocksOp.UnionFaces(theShape)
11010 RaiseIfFailed("UnionFaces", self.BlocksOp)
11011 self._autoPublish(anObj, theName, "unionFaces")
11014 ## Check, if the given shape is a blocks compound.
11015 # Fix all detected errors.
11016 # \note Single block can be also fixed by this method.
11017 # @param theShape The compound to check and improve.
11018 # @param theName Object name; when specified, this parameter is used
11019 # for result publication in the study. Otherwise, if automatic
11020 # publication is switched on, default value is used for result name.
11022 # @return Improved compound.
11024 # @ref swig_CheckAndImprove "Example"
11025 def CheckAndImprove(self, theShape, theName=None):
11027 Check, if the given shape is a blocks compound.
11028 Fix all detected errors.
11031 Single block can be also fixed by this method.
11034 theShape The compound to check and improve.
11035 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.
11042 # Example: see GEOM_TestOthers.py
11043 anObj = self.BlocksOp.CheckAndImprove(theShape)
11044 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11045 self._autoPublish(anObj, theName, "improved")
11048 # end of l4_blocks_measure
11051 ## @addtogroup l3_blocks_op
11054 ## Get all the blocks, contained in the given compound.
11055 # @param theCompound The compound to explode.
11056 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11057 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11058 # @param theName Object name; when specified, this parameter is used
11059 # for result publication in the study. Otherwise, if automatic
11060 # publication is switched on, default value is used for result name.
11062 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11064 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11066 # @ref tui_explode_on_blocks "Example 1"
11067 # \n @ref swig_MakeBlockExplode "Example 2"
11068 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11070 Get all the blocks, contained in the given compound.
11073 theCompound The compound to explode.
11074 theMinNbFaces If solid has lower number of faces, it is not a block.
11075 theMaxNbFaces If solid has higher number of faces, it is not a block.
11076 theName Object name; when specified, this parameter is used
11077 for result publication in the study. Otherwise, if automatic
11078 publication is switched on, default value is used for result name.
11081 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11084 List of GEOM.GEOM_Object, containing the retrieved blocks.
11086 # Example: see GEOM_TestOthers.py
11087 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11088 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11089 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11090 for anObj in aList:
11091 anObj.SetParameters(Parameters)
11093 self._autoPublish(aList, theName, "block")
11096 ## Find block, containing the given point inside its volume or on boundary.
11097 # @param theCompound Compound, to find block in.
11098 # @param thePoint Point, close to the desired block. If the point lays on
11099 # boundary between some blocks, we return block with nearest center.
11100 # @param theName Object name; when specified, this parameter is used
11101 # for result publication in the study. Otherwise, if automatic
11102 # publication is switched on, default value is used for result name.
11104 # @return New GEOM.GEOM_Object, containing the found block.
11106 # @ref swig_todo "Example"
11107 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11109 Find block, containing the given point inside its volume or on boundary.
11112 theCompound Compound, to find block in.
11113 thePoint Point, close to the desired block. If the point lays on
11114 boundary between some blocks, we return block with nearest center.
11115 theName Object name; when specified, this parameter is used
11116 for result publication in the study. Otherwise, if automatic
11117 publication is switched on, default value is used for result name.
11120 New GEOM.GEOM_Object, containing the found block.
11122 # Example: see GEOM_Spanner.py
11123 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11124 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11125 self._autoPublish(anObj, theName, "block")
11128 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11129 # @param theCompound Compound, to find block in.
11130 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11131 # @param theName Object name; when specified, this parameter is used
11132 # for result publication in the study. Otherwise, if automatic
11133 # publication is switched on, default value is used for result name.
11135 # @return New GEOM.GEOM_Object, containing the found block.
11137 # @ref swig_GetBlockByParts "Example"
11138 def GetBlockByParts(self, theCompound, theParts, theName=None):
11140 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11143 theCompound Compound, to find block in.
11144 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11145 theName Object name; when specified, this parameter is used
11146 for result publication in the study. Otherwise, if automatic
11147 publication is switched on, default value is used for result name.
11150 New GEOM_Object, containing the found block.
11152 # Example: see GEOM_TestOthers.py
11153 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11154 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11155 self._autoPublish(anObj, theName, "block")
11158 ## Return all blocks, containing all the elements, passed as the parts.
11159 # @param theCompound Compound, to find blocks in.
11160 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11161 # @param theName Object name; when specified, this parameter is used
11162 # for result publication in the study. Otherwise, if automatic
11163 # publication is switched on, default value is used for result name.
11165 # @return List of GEOM.GEOM_Object, containing the found blocks.
11167 # @ref swig_todo "Example"
11168 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11170 Return all blocks, containing all the elements, passed as the parts.
11173 theCompound Compound, to find blocks in.
11174 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11175 theName Object name; when specified, this parameter is used
11176 for result publication in the study. Otherwise, if automatic
11177 publication is switched on, default value is used for result name.
11180 List of GEOM.GEOM_Object, containing the found blocks.
11182 # Example: see GEOM_Spanner.py
11183 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11184 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11185 self._autoPublish(aList, theName, "block")
11188 ## Multi-transformate block and glue the result.
11189 # Transformation is defined so, as to superpose direction faces.
11190 # @param Block Hexahedral solid to be multi-transformed.
11191 # @param DirFace1 ID of First direction face.
11192 # @param DirFace2 ID of Second direction face.
11193 # @param NbTimes Quantity of transformations to be done.
11194 # @param theName Object name; when specified, this parameter is used
11195 # for result publication in the study. Otherwise, if automatic
11196 # publication is switched on, default value is used for result name.
11198 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11200 # @return New GEOM.GEOM_Object, containing the result shape.
11202 # @ref tui_multi_transformation "Example"
11203 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11205 Multi-transformate block and glue the result.
11206 Transformation is defined so, as to superpose direction faces.
11209 Block Hexahedral solid to be multi-transformed.
11210 DirFace1 ID of First direction face.
11211 DirFace2 ID of Second direction face.
11212 NbTimes Quantity of transformations to be done.
11213 theName Object name; when specified, this parameter is used
11214 for result publication in the study. Otherwise, if automatic
11215 publication is switched on, default value is used for result name.
11218 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11221 New GEOM.GEOM_Object, containing the result shape.
11223 # Example: see GEOM_Spanner.py
11224 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11225 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11226 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11227 anObj.SetParameters(Parameters)
11228 self._autoPublish(anObj, theName, "transformed")
11231 ## Multi-transformate block and glue the result.
11232 # @param Block Hexahedral solid to be multi-transformed.
11233 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11234 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11235 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11236 # @param theName Object name; when specified, this parameter is used
11237 # for result publication in the study. Otherwise, if automatic
11238 # publication is switched on, default value is used for result name.
11240 # @return New GEOM.GEOM_Object, containing the result shape.
11242 # @ref tui_multi_transformation "Example"
11243 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11244 DirFace1V, DirFace2V, NbTimesV, theName=None):
11246 Multi-transformate block and glue the result.
11249 Block Hexahedral solid to be multi-transformed.
11250 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11251 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11252 NbTimesU,NbTimesV Quantity of transformations to be done.
11253 theName Object name; when specified, this parameter is used
11254 for result publication in the study. Otherwise, if automatic
11255 publication is switched on, default value is used for result name.
11258 New GEOM.GEOM_Object, containing the result shape.
11260 # Example: see GEOM_Spanner.py
11261 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11262 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11263 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11264 DirFace1V, DirFace2V, NbTimesV)
11265 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11266 anObj.SetParameters(Parameters)
11267 self._autoPublish(anObj, theName, "transformed")
11270 ## Build all possible propagation groups.
11271 # Propagation group is a set of all edges, opposite to one (main)
11272 # edge of this group directly or through other opposite edges.
11273 # Notion of Opposite Edge make sence only on quadrangle face.
11274 # @param theShape Shape to build propagation groups on.
11275 # @param theName Object name; when specified, this parameter is used
11276 # for result publication in the study. Otherwise, if automatic
11277 # publication is switched on, default value is used for result name.
11279 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11281 # @ref swig_Propagate "Example"
11282 def Propagate(self, theShape, theName=None):
11284 Build all possible propagation groups.
11285 Propagation group is a set of all edges, opposite to one (main)
11286 edge of this group directly or through other opposite edges.
11287 Notion of Opposite Edge make sence only on quadrangle face.
11290 theShape Shape to build propagation groups on.
11291 theName Object name; when specified, this parameter is used
11292 for result publication in the study. Otherwise, if automatic
11293 publication is switched on, default value is used for result name.
11296 List of GEOM.GEOM_Object, each of them is a propagation group.
11298 # Example: see GEOM_TestOthers.py
11299 listChains = self.BlocksOp.Propagate(theShape)
11300 RaiseIfFailed("Propagate", self.BlocksOp)
11301 self._autoPublish(listChains, theName, "propagate")
11304 # end of l3_blocks_op
11307 ## @addtogroup l3_groups
11310 ## Creates a new group which will store sub-shapes of theMainShape
11311 # @param theMainShape is a GEOM object on which the group is selected
11312 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11313 # @param theName Object name; when specified, this parameter is used
11314 # for result publication in the study. Otherwise, if automatic
11315 # publication is switched on, default value is used for result name.
11317 # @return a newly created GEOM group (GEOM.GEOM_Object)
11319 # @ref tui_working_with_groups_page "Example 1"
11320 # \n @ref swig_CreateGroup "Example 2"
11321 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11323 Creates a new group which will store sub-shapes of theMainShape
11326 theMainShape is a GEOM object on which the group is selected
11327 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11328 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11329 theName Object name; when specified, this parameter is used
11330 for result publication in the study. Otherwise, if automatic
11331 publication is switched on, default value is used for result name.
11334 a newly created GEOM group
11337 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11340 # Example: see GEOM_TestOthers.py
11341 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11342 RaiseIfFailed("CreateGroup", self.GroupOp)
11343 self._autoPublish(anObj, theName, "group")
11346 ## Adds a sub-object with ID theSubShapeId to the group
11347 # @param theGroup is a GEOM group to which the new sub-shape is added
11348 # @param theSubShapeID is a sub-shape ID in the main object.
11349 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11351 # @ref tui_working_with_groups_page "Example"
11352 def AddObject(self,theGroup, theSubShapeID):
11354 Adds a sub-object with ID theSubShapeId to the group
11357 theGroup is a GEOM group to which the new sub-shape is added
11358 theSubShapeID is a sub-shape ID in the main object.
11361 Use method GetSubShapeID() to get an unique ID of the sub-shape
11363 # Example: see GEOM_TestOthers.py
11364 self.GroupOp.AddObject(theGroup, theSubShapeID)
11365 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11366 RaiseIfFailed("AddObject", self.GroupOp)
11370 ## Removes a sub-object with ID \a theSubShapeId from the group
11371 # @param theGroup is a GEOM group from which the new sub-shape is removed
11372 # @param theSubShapeID is a sub-shape ID in the main object.
11373 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11375 # @ref tui_working_with_groups_page "Example"
11376 def RemoveObject(self,theGroup, theSubShapeID):
11378 Removes a sub-object with ID theSubShapeId from the group
11381 theGroup is a GEOM group from which the new sub-shape is removed
11382 theSubShapeID is a sub-shape ID in the main object.
11385 Use method GetSubShapeID() to get an unique ID of the sub-shape
11387 # Example: see GEOM_TestOthers.py
11388 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11389 RaiseIfFailed("RemoveObject", self.GroupOp)
11392 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11393 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11394 # @param theSubShapes is a list of sub-shapes to be added.
11396 # @ref tui_working_with_groups_page "Example"
11397 def UnionList (self,theGroup, theSubShapes):
11399 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11402 theGroup is a GEOM group to which the new sub-shapes are added.
11403 theSubShapes is a list of sub-shapes to be added.
11405 # Example: see GEOM_TestOthers.py
11406 self.GroupOp.UnionList(theGroup, theSubShapes)
11407 RaiseIfFailed("UnionList", self.GroupOp)
11410 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11411 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11412 # @param theSubShapes is a list of indices of sub-shapes to be added.
11414 # @ref swig_UnionIDs "Example"
11415 def UnionIDs(self,theGroup, theSubShapes):
11417 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11420 theGroup is a GEOM group to which the new sub-shapes are added.
11421 theSubShapes is a list of indices of sub-shapes to be added.
11423 # Example: see GEOM_TestOthers.py
11424 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11425 RaiseIfFailed("UnionIDs", self.GroupOp)
11428 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11429 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11430 # @param theSubShapes is a list of sub-shapes to be removed.
11432 # @ref tui_working_with_groups_page "Example"
11433 def DifferenceList (self,theGroup, theSubShapes):
11435 Removes from the group all the given shapes. No errors, if some shapes are not included.
11438 theGroup is a GEOM group from which the sub-shapes are removed.
11439 theSubShapes is a list of sub-shapes to be removed.
11441 # Example: see GEOM_TestOthers.py
11442 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11443 RaiseIfFailed("DifferenceList", self.GroupOp)
11446 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11447 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11448 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11450 # @ref swig_DifferenceIDs "Example"
11451 def DifferenceIDs(self,theGroup, theSubShapes):
11453 Removes from the group all the given shapes. No errors, if some shapes are not included.
11456 theGroup is a GEOM group from which the sub-shapes are removed.
11457 theSubShapes is a list of indices of sub-shapes to be removed.
11459 # Example: see GEOM_TestOthers.py
11460 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11461 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11464 ## Union of two groups.
11465 # New group is created. It will contain all entities
11466 # which are present in groups theGroup1 and theGroup2.
11467 # @param theGroup1, theGroup2 are the initial GEOM groups
11468 # to create the united group from.
11469 # @param theName Object name; when specified, this parameter is used
11470 # for result publication in the study. Otherwise, if automatic
11471 # publication is switched on, default value is used for result name.
11473 # @return a newly created GEOM group.
11475 # @ref tui_union_groups_anchor "Example"
11476 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11478 Union of two groups.
11479 New group is created. It will contain all entities
11480 which are present in groups theGroup1 and theGroup2.
11483 theGroup1, theGroup2 are the initial GEOM groups
11484 to create the united group from.
11485 theName Object name; when specified, this parameter is used
11486 for result publication in the study. Otherwise, if automatic
11487 publication is switched on, default value is used for result name.
11490 a newly created GEOM group.
11492 # Example: see GEOM_TestOthers.py
11493 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11494 RaiseIfFailed("UnionGroups", self.GroupOp)
11495 self._autoPublish(aGroup, theName, "group")
11498 ## Intersection of two groups.
11499 # New group is created. It will contain only those entities
11500 # which are present in both groups theGroup1 and theGroup2.
11501 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11502 # @param theName Object name; when specified, this parameter is used
11503 # for result publication in the study. Otherwise, if automatic
11504 # publication is switched on, default value is used for result name.
11506 # @return a newly created GEOM group.
11508 # @ref tui_intersect_groups_anchor "Example"
11509 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11511 Intersection of two groups.
11512 New group is created. It will contain only those entities
11513 which are present in both groups theGroup1 and theGroup2.
11516 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11517 theName Object name; when specified, this parameter is used
11518 for result publication in the study. Otherwise, if automatic
11519 publication is switched on, default value is used for result name.
11522 a newly created GEOM group.
11524 # Example: see GEOM_TestOthers.py
11525 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11526 RaiseIfFailed("IntersectGroups", self.GroupOp)
11527 self._autoPublish(aGroup, theName, "group")
11530 ## Cut of two groups.
11531 # New group is created. It will contain entities which are
11532 # present in group theGroup1 but are not present in group theGroup2.
11533 # @param theGroup1 is a GEOM group to include elements of.
11534 # @param theGroup2 is a GEOM group to exclude elements of.
11535 # @param theName Object name; when specified, this parameter is used
11536 # for result publication in the study. Otherwise, if automatic
11537 # publication is switched on, default value is used for result name.
11539 # @return a newly created GEOM group.
11541 # @ref tui_cut_groups_anchor "Example"
11542 def CutGroups (self, theGroup1, theGroup2, theName=None):
11545 New group is created. It will contain entities which are
11546 present in group theGroup1 but are not present in group theGroup2.
11549 theGroup1 is a GEOM group to include elements of.
11550 theGroup2 is a GEOM group to exclude elements of.
11551 theName Object name; when specified, this parameter is used
11552 for result publication in the study. Otherwise, if automatic
11553 publication is switched on, default value is used for result name.
11556 a newly created GEOM group.
11558 # Example: see GEOM_TestOthers.py
11559 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11560 RaiseIfFailed("CutGroups", self.GroupOp)
11561 self._autoPublish(aGroup, theName, "group")
11564 ## Union of list of groups.
11565 # New group is created. It will contain all entities that are
11566 # present in groups listed in theGList.
11567 # @param theGList is a list of GEOM groups to create the united group from.
11568 # @param theName Object name; when specified, this parameter is used
11569 # for result publication in the study. Otherwise, if automatic
11570 # publication is switched on, default value is used for result name.
11572 # @return a newly created GEOM group.
11574 # @ref tui_union_groups_anchor "Example"
11575 def UnionListOfGroups (self, theGList, theName=None):
11577 Union of list of groups.
11578 New group is created. It will contain all entities that are
11579 present in groups listed in theGList.
11582 theGList is a list of GEOM groups to create the united group from.
11583 theName Object name; when specified, this parameter is used
11584 for result publication in the study. Otherwise, if automatic
11585 publication is switched on, default value is used for result name.
11588 a newly created GEOM group.
11590 # Example: see GEOM_TestOthers.py
11591 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11592 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11593 self._autoPublish(aGroup, theName, "group")
11596 ## Cut of lists of groups.
11597 # New group is created. It will contain only entities
11598 # which are present in groups listed in theGList.
11599 # @param theGList is a list of GEOM groups to include elements of.
11600 # @param theName Object name; when specified, this parameter is used
11601 # for result publication in the study. Otherwise, if automatic
11602 # publication is switched on, default value is used for result name.
11604 # @return a newly created GEOM group.
11606 # @ref tui_intersect_groups_anchor "Example"
11607 def IntersectListOfGroups (self, theGList, theName=None):
11609 Cut of lists of groups.
11610 New group is created. It will contain only entities
11611 which are present in groups listed in theGList.
11614 theGList is a list of GEOM groups to include elements of.
11615 theName Object name; when specified, this parameter is used
11616 for result publication in the study. Otherwise, if automatic
11617 publication is switched on, default value is used for result name.
11620 a newly created GEOM group.
11622 # Example: see GEOM_TestOthers.py
11623 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11624 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11625 self._autoPublish(aGroup, theName, "group")
11628 ## Cut of lists of groups.
11629 # New group is created. It will contain only entities
11630 # which are present in groups listed in theGList1 but
11631 # are not present in groups from theGList2.
11632 # @param theGList1 is a list of GEOM groups to include elements of.
11633 # @param theGList2 is a list of GEOM groups to exclude elements of.
11634 # @param theName Object name; when specified, this parameter is used
11635 # for result publication in the study. Otherwise, if automatic
11636 # publication is switched on, default value is used for result name.
11638 # @return a newly created GEOM group.
11640 # @ref tui_cut_groups_anchor "Example"
11641 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11643 Cut of lists of groups.
11644 New group is created. It will contain only entities
11645 which are present in groups listed in theGList1 but
11646 are not present in groups from theGList2.
11649 theGList1 is a list of GEOM groups to include elements of.
11650 theGList2 is a list of GEOM groups to exclude elements of.
11651 theName Object name; when specified, this parameter is used
11652 for result publication in the study. Otherwise, if automatic
11653 publication is switched on, default value is used for result name.
11656 a newly created GEOM group.
11658 # Example: see GEOM_TestOthers.py
11659 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11660 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11661 self._autoPublish(aGroup, theName, "group")
11664 ## Returns a list of sub-objects ID stored in the group
11665 # @param theGroup is a GEOM group for which a list of IDs is requested
11667 # @ref swig_GetObjectIDs "Example"
11668 def GetObjectIDs(self,theGroup):
11670 Returns a list of sub-objects ID stored in the group
11673 theGroup is a GEOM group for which a list of IDs is requested
11675 # Example: see GEOM_TestOthers.py
11676 ListIDs = self.GroupOp.GetObjects(theGroup)
11677 RaiseIfFailed("GetObjects", self.GroupOp)
11680 ## Returns a type of sub-objects stored in the group
11681 # @param theGroup is a GEOM group which type is returned.
11683 # @ref swig_GetType "Example"
11684 def GetType(self,theGroup):
11686 Returns a type of sub-objects stored in the group
11689 theGroup is a GEOM group which type is returned.
11691 # Example: see GEOM_TestOthers.py
11692 aType = self.GroupOp.GetType(theGroup)
11693 RaiseIfFailed("GetType", self.GroupOp)
11696 ## Convert a type of geom object from id to string value
11697 # @param theId is a GEOM obect type id.
11698 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11699 # @ref swig_GetType "Example"
11700 def ShapeIdToType(self, theId):
11702 Convert a type of geom object from id to string value
11705 theId is a GEOM obect type id.
11708 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11735 return "REVOLUTION"
11783 return "FREE_BOUNDS"
11791 return "THRUSECTIONS"
11793 return "COMPOUNDFILTER"
11795 return "SHAPES_ON_SHAPE"
11797 return "ELLIPSE_ARC"
11799 return "3DSKETCHER"
11805 return "PIPETSHAPE"
11806 return "Shape Id not exist."
11808 ## Returns a main shape associated with the group
11809 # @param theGroup is a GEOM group for which a main shape object is requested
11810 # @return a GEOM object which is a main shape for theGroup
11812 # @ref swig_GetMainShape "Example"
11813 def GetMainShape(self,theGroup):
11815 Returns a main shape associated with the group
11818 theGroup is a GEOM group for which a main shape object is requested
11821 a GEOM object which is a main shape for theGroup
11823 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11825 # Example: see GEOM_TestOthers.py
11826 anObj = self.GroupOp.GetMainShape(theGroup)
11827 RaiseIfFailed("GetMainShape", self.GroupOp)
11830 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11831 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11832 # @param theShape given shape (see GEOM.GEOM_Object)
11833 # @param min_length minimum length of edges of theShape
11834 # @param max_length maximum length of edges of theShape
11835 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11836 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11837 # @param theName Object name; when specified, this parameter is used
11838 # for result publication in the study. Otherwise, if automatic
11839 # publication is switched on, default value is used for result name.
11841 # @return a newly created GEOM group of edges
11843 # @@ref swig_todo "Example"
11844 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11846 Create group of edges of theShape, whose length is in range [min_length, max_length].
11847 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11850 theShape given shape
11851 min_length minimum length of edges of theShape
11852 max_length maximum length of edges of theShape
11853 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11854 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11855 theName Object name; when specified, this parameter is used
11856 for result publication in the study. Otherwise, if automatic
11857 publication is switched on, default value is used for result name.
11860 a newly created GEOM group of edges.
11862 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11863 edges_in_range = []
11865 Props = self.BasicProperties(edge)
11866 if min_length <= Props[0] and Props[0] <= max_length:
11867 if (not include_min) and (min_length == Props[0]):
11870 if (not include_max) and (Props[0] == max_length):
11873 edges_in_range.append(edge)
11875 if len(edges_in_range) <= 0:
11876 print "No edges found by given criteria"
11879 # note: auto-publishing is done in self.CreateGroup()
11880 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11881 self.UnionList(group_edges, edges_in_range)
11885 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11886 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11887 # @param min_length minimum length of edges of selected shape
11888 # @param max_length maximum length of edges of selected shape
11889 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11890 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11891 # @return a newly created GEOM group of edges
11892 # @ref swig_todo "Example"
11893 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11895 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11896 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11899 min_length minimum length of edges of selected shape
11900 max_length maximum length of edges of selected shape
11901 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11902 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11905 a newly created GEOM group of edges.
11907 nb_selected = sg.SelectedCount()
11908 if nb_selected < 1:
11909 print "Select a shape before calling this function, please."
11911 if nb_selected > 1:
11912 print "Only one shape must be selected"
11915 id_shape = sg.getSelected(0)
11916 shape = IDToObject( id_shape )
11918 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11922 if include_min: left_str = " <= "
11923 if include_max: right_str = " <= "
11925 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11926 + left_str + "length" + right_str + `max_length`)
11928 sg.updateObjBrowser(1)
11935 ## @addtogroup l4_advanced
11938 ## Create a T-shape object with specified caracteristics for the main
11939 # and the incident pipes (radius, width, half-length).
11940 # The extremities of the main pipe are located on junctions points P1 and P2.
11941 # The extremity of the incident pipe is located on junction point P3.
11942 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11943 # the main plane of the T-shape is XOY.
11945 # @param theR1 Internal radius of main pipe
11946 # @param theW1 Width of main pipe
11947 # @param theL1 Half-length of main pipe
11948 # @param theR2 Internal radius of incident pipe (R2 < R1)
11949 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11950 # @param theL2 Half-length of incident pipe
11952 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11953 # @param theP1 1st junction point of main pipe
11954 # @param theP2 2nd junction point of main pipe
11955 # @param theP3 Junction point of incident pipe
11957 # @param theRL Internal radius of left thickness reduction
11958 # @param theWL Width of left thickness reduction
11959 # @param theLtransL Length of left transition part
11960 # @param theLthinL Length of left thin part
11962 # @param theRR Internal radius of right thickness reduction
11963 # @param theWR Width of right thickness reduction
11964 # @param theLtransR Length of right transition part
11965 # @param theLthinR Length of right thin part
11967 # @param theRI Internal radius of incident thickness reduction
11968 # @param theWI Width of incident thickness reduction
11969 # @param theLtransI Length of incident transition part
11970 # @param theLthinI Length of incident thin part
11972 # @param theName Object name; when specified, this parameter is used
11973 # for result publication in the study. Otherwise, if automatic
11974 # publication is switched on, default value is used for result name.
11976 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11978 # @ref tui_creation_pipetshape "Example"
11979 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11980 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11981 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11982 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11983 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11986 Create a T-shape object with specified caracteristics for the main
11987 and the incident pipes (radius, width, half-length).
11988 The extremities of the main pipe are located on junctions points P1 and P2.
11989 The extremity of the incident pipe is located on junction point P3.
11990 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11991 the main plane of the T-shape is XOY.
11994 theR1 Internal radius of main pipe
11995 theW1 Width of main pipe
11996 theL1 Half-length of main pipe
11997 theR2 Internal radius of incident pipe (R2 < R1)
11998 theW2 Width of incident pipe (R2+W2 < R1+W1)
11999 theL2 Half-length of incident pipe
12000 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12001 theP1 1st junction point of main pipe
12002 theP2 2nd junction point of main pipe
12003 theP3 Junction point of incident pipe
12005 theRL Internal radius of left thickness reduction
12006 theWL Width of left thickness reduction
12007 theLtransL Length of left transition part
12008 theLthinL Length of left thin part
12010 theRR Internal radius of right thickness reduction
12011 theWR Width of right thickness reduction
12012 theLtransR Length of right transition part
12013 theLthinR Length of right thin part
12015 theRI Internal radius of incident thickness reduction
12016 theWI Width of incident thickness reduction
12017 theLtransI Length of incident transition part
12018 theLthinI Length of incident thin part
12020 theName Object name; when specified, this parameter is used
12021 for result publication in the study. Otherwise, if automatic
12022 publication is switched on, default value is used for result name.
12025 List of GEOM_Object, containing the created shape and propagation groups.
12028 # create PipeTShape object
12029 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12030 # create PipeTShape object with position
12031 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12032 # create PipeTShape object with left thickness reduction
12033 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12035 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)
12036 if (theP1 and theP2 and theP3):
12037 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12038 theRL, theWL, theLtransL, theLthinL,
12039 theRR, theWR, theLtransR, theLthinR,
12040 theRI, theWI, theLtransI, theLthinI,
12041 theHexMesh, theP1, theP2, theP3)
12043 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12044 theRL, theWL, theLtransL, theLthinL,
12045 theRR, theWR, theLtransR, theLthinR,
12046 theRI, theWI, theLtransI, theLthinI,
12048 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12049 if Parameters: anObj[0].SetParameters(Parameters)
12050 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12051 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12054 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12055 # and the incident pipes (radius, width, half-length). The chamfer is
12056 # created on the junction of the pipes.
12057 # The extremities of the main pipe are located on junctions points P1 and P2.
12058 # The extremity of the incident pipe is located on junction point P3.
12059 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12060 # the main plane of the T-shape is XOY.
12061 # @param theR1 Internal radius of main pipe
12062 # @param theW1 Width of main pipe
12063 # @param theL1 Half-length of main pipe
12064 # @param theR2 Internal radius of incident pipe (R2 < R1)
12065 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12066 # @param theL2 Half-length of incident pipe
12067 # @param theH Height of the chamfer.
12068 # @param theW Width of the chamfer.
12069 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12070 # @param theP1 1st junction point of main pipe
12071 # @param theP2 2nd junction point of main pipe
12072 # @param theP3 Junction point of incident pipe
12074 # @param theRL Internal radius of left thickness reduction
12075 # @param theWL Width of left thickness reduction
12076 # @param theLtransL Length of left transition part
12077 # @param theLthinL Length of left thin part
12079 # @param theRR Internal radius of right thickness reduction
12080 # @param theWR Width of right thickness reduction
12081 # @param theLtransR Length of right transition part
12082 # @param theLthinR Length of right thin part
12084 # @param theRI Internal radius of incident thickness reduction
12085 # @param theWI Width of incident thickness reduction
12086 # @param theLtransI Length of incident transition part
12087 # @param theLthinI Length of incident thin part
12089 # @param theName Object name; when specified, this parameter is used
12090 # for result publication in the study. Otherwise, if automatic
12091 # publication is switched on, default value is used for result name.
12093 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12095 # @ref tui_creation_pipetshape "Example"
12096 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12097 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12098 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12099 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12100 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12103 Create a T-shape object with chamfer and with specified caracteristics for the main
12104 and the incident pipes (radius, width, half-length). The chamfer is
12105 created on the junction of the pipes.
12106 The extremities of the main pipe are located on junctions points P1 and P2.
12107 The extremity of the incident pipe is located on junction point P3.
12108 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12109 the main plane of the T-shape is XOY.
12112 theR1 Internal radius of main pipe
12113 theW1 Width of main pipe
12114 theL1 Half-length of main pipe
12115 theR2 Internal radius of incident pipe (R2 < R1)
12116 theW2 Width of incident pipe (R2+W2 < R1+W1)
12117 theL2 Half-length of incident pipe
12118 theH Height of the chamfer.
12119 theW Width of the chamfer.
12120 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12121 theP1 1st junction point of main pipe
12122 theP2 2nd junction point of main pipe
12123 theP3 Junction point of incident pipe
12125 theRL Internal radius of left thickness reduction
12126 theWL Width of left thickness reduction
12127 theLtransL Length of left transition part
12128 theLthinL Length of left thin part
12130 theRR Internal radius of right thickness reduction
12131 theWR Width of right thickness reduction
12132 theLtransR Length of right transition part
12133 theLthinR Length of right thin part
12135 theRI Internal radius of incident thickness reduction
12136 theWI Width of incident thickness reduction
12137 theLtransI Length of incident transition part
12138 theLthinI Length of incident thin part
12140 theName Object name; when specified, this parameter is used
12141 for result publication in the study. Otherwise, if automatic
12142 publication is switched on, default value is used for result name.
12145 List of GEOM_Object, containing the created shape and propagation groups.
12148 # create PipeTShape with chamfer object
12149 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12150 # create PipeTShape with chamfer object with position
12151 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12152 # create PipeTShape with chamfer object with left thickness reduction
12153 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)
12155 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)
12156 if (theP1 and theP2 and theP3):
12157 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12158 theRL, theWL, theLtransL, theLthinL,
12159 theRR, theWR, theLtransR, theLthinR,
12160 theRI, theWI, theLtransI, theLthinI,
12161 theH, theW, theHexMesh, theP1, theP2, theP3)
12163 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12164 theRL, theWL, theLtransL, theLthinL,
12165 theRR, theWR, theLtransR, theLthinR,
12166 theRI, theWI, theLtransI, theLthinI,
12167 theH, theW, theHexMesh)
12168 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12169 if Parameters: anObj[0].SetParameters(Parameters)
12170 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12171 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12174 ## Create a T-shape object with fillet and with specified caracteristics for the main
12175 # and the incident pipes (radius, width, half-length). The fillet is
12176 # created on the junction of the pipes.
12177 # The extremities of the main pipe are located on junctions points P1 and P2.
12178 # The extremity of the incident pipe is located on junction point P3.
12179 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12180 # the main plane of the T-shape is XOY.
12181 # @param theR1 Internal radius of main pipe
12182 # @param theW1 Width of main pipe
12183 # @param theL1 Half-length of main pipe
12184 # @param theR2 Internal radius of incident pipe (R2 < R1)
12185 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12186 # @param theL2 Half-length of incident pipe
12187 # @param theRF Radius of curvature of fillet.
12188 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12189 # @param theP1 1st junction point of main pipe
12190 # @param theP2 2nd junction point of main pipe
12191 # @param theP3 Junction point of incident pipe
12193 # @param theRL Internal radius of left thickness reduction
12194 # @param theWL Width of left thickness reduction
12195 # @param theLtransL Length of left transition part
12196 # @param theLthinL Length of left thin part
12198 # @param theRR Internal radius of right thickness reduction
12199 # @param theWR Width of right thickness reduction
12200 # @param theLtransR Length of right transition part
12201 # @param theLthinR Length of right thin part
12203 # @param theRI Internal radius of incident thickness reduction
12204 # @param theWI Width of incident thickness reduction
12205 # @param theLtransI Length of incident transition part
12206 # @param theLthinI Length of incident thin part
12208 # @param theName Object name; when specified, this parameter is used
12209 # for result publication in the study. Otherwise, if automatic
12210 # publication is switched on, default value is used for result name.
12212 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12214 # @ref tui_creation_pipetshape "Example"
12215 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12216 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12217 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12218 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12219 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12222 Create a T-shape object with fillet and with specified caracteristics for the main
12223 and the incident pipes (radius, width, half-length). The fillet is
12224 created on the junction of the pipes.
12225 The extremities of the main pipe are located on junctions points P1 and P2.
12226 The extremity of the incident pipe is located on junction point P3.
12229 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12230 the main plane of the T-shape is XOY.
12231 theR1 Internal radius of main pipe
12232 theW1 Width of main pipe
12233 heL1 Half-length of main pipe
12234 theR2 Internal radius of incident pipe (R2 < R1)
12235 theW2 Width of incident pipe (R2+W2 < R1+W1)
12236 theL2 Half-length of incident pipe
12237 theRF Radius of curvature of fillet.
12238 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12239 theP1 1st junction point of main pipe
12240 theP2 2nd junction point of main pipe
12241 theP3 Junction point of incident pipe
12243 theRL Internal radius of left thickness reduction
12244 theWL Width of left thickness reduction
12245 theLtransL Length of left transition part
12246 theLthinL Length of left thin part
12248 theRR Internal radius of right thickness reduction
12249 theWR Width of right thickness reduction
12250 theLtransR Length of right transition part
12251 theLthinR Length of right thin part
12253 theRI Internal radius of incident thickness reduction
12254 theWI Width of incident thickness reduction
12255 theLtransI Length of incident transition part
12256 theLthinI Length of incident thin part
12258 theName Object name; when specified, this parameter is used
12259 for result publication in the study. Otherwise, if automatic
12260 publication is switched on, default value is used for result name.
12263 List of GEOM_Object, containing the created shape and propagation groups.
12266 # create PipeTShape with fillet object
12267 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12268 # create PipeTShape with fillet object with position
12269 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12270 # create PipeTShape with fillet object with left thickness reduction
12271 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)
12273 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)
12274 if (theP1 and theP2 and theP3):
12275 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12276 theRL, theWL, theLtransL, theLthinL,
12277 theRR, theWR, theLtransR, theLthinR,
12278 theRI, theWI, theLtransI, theLthinI,
12279 theRF, theHexMesh, theP1, theP2, theP3)
12281 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12282 theRL, theWL, theLtransL, theLthinL,
12283 theRR, theWR, theLtransR, theLthinR,
12284 theRI, theWI, theLtransI, theLthinI,
12286 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12287 if Parameters: anObj[0].SetParameters(Parameters)
12288 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12289 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12292 ## This function allows creating a disk already divided into blocks. It
12293 # can be used to create divided pipes for later meshing in hexaedra.
12294 # @param theR Radius of the disk
12295 # @param theOrientation Orientation of the plane on which the disk will be built
12296 # 1 = XOY, 2 = OYZ, 3 = OZX
12297 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12298 # @param theName Object name; when specified, this parameter is used
12299 # for result publication in the study. Otherwise, if automatic
12300 # publication is switched on, default value is used for result name.
12302 # @return New GEOM_Object, containing the created shape.
12304 # @ref tui_creation_divideddisk "Example"
12305 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12307 Creates a disk, divided into blocks. It can be used to create divided pipes
12308 for later meshing in hexaedra.
12311 theR Radius of the disk
12312 theOrientation Orientation of the plane on which the disk will be built:
12313 1 = XOY, 2 = OYZ, 3 = OZX
12314 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12315 theName Object name; when specified, this parameter is used
12316 for result publication in the study. Otherwise, if automatic
12317 publication is switched on, default value is used for result name.
12320 New GEOM_Object, containing the created shape.
12322 theR, Parameters = ParseParameters(theR)
12323 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12324 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12325 if Parameters: anObj.SetParameters(Parameters)
12326 self._autoPublish(anObj, theName, "dividedDisk")
12329 ## This function allows creating a disk already divided into blocks. It
12330 # can be used to create divided pipes for later meshing in hexaedra.
12331 # @param theCenter Center of the disk
12332 # @param theVector Normal vector to the plane of the created disk
12333 # @param theRadius Radius of the disk
12334 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12335 # @param 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.
12339 # @return New GEOM_Object, containing the created shape.
12341 # @ref tui_creation_divideddisk "Example"
12342 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12344 Creates a disk already divided into blocks. It can be used to create divided pipes
12345 for later meshing in hexaedra.
12348 theCenter Center of the disk
12349 theVector Normal vector to the plane of the created disk
12350 theRadius Radius of the disk
12351 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12352 theName Object name; when specified, this parameter is used
12353 for result publication in the study. Otherwise, if automatic
12354 publication is switched on, default value is used for result name.
12357 New GEOM_Object, containing the created shape.
12359 theRadius, Parameters = ParseParameters(theRadius)
12360 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12361 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12362 if Parameters: anObj.SetParameters(Parameters)
12363 self._autoPublish(anObj, theName, "dividedDisk")
12366 ## Builds a cylinder prepared for hexa meshes
12367 # @param theR Radius of the cylinder
12368 # @param theH Height of the cylinder
12369 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12370 # @param theName Object name; when specified, this parameter is used
12371 # for result publication in the study. Otherwise, if automatic
12372 # publication is switched on, default value is used for result name.
12374 # @return New GEOM_Object, containing the created shape.
12376 # @ref tui_creation_dividedcylinder "Example"
12377 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12379 Builds a cylinder prepared for hexa meshes
12382 theR Radius of the cylinder
12383 theH Height of the cylinder
12384 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12385 theName Object name; when specified, this parameter is used
12386 for result publication in the study. Otherwise, if automatic
12387 publication is switched on, default value is used for result name.
12390 New GEOM_Object, containing the created shape.
12392 theR, theH, Parameters = ParseParameters(theR, theH)
12393 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12394 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12395 if Parameters: anObj.SetParameters(Parameters)
12396 self._autoPublish(anObj, theName, "dividedCylinder")
12399 ## Create a surface from a cloud of points
12400 # @param thelPoints list of points
12401 # @return New GEOM_Object, containing the created shape.
12403 # @ref tui_creation_smoothingsurface "Example"
12404 def MakeSmoothingSurface(self, thelPoints):
12405 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12406 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12409 ## Export a shape to XAO format
12410 # @param shape The shape to export
12411 # @param groups The list of groups to export
12412 # @param fields The list of fields to export
12413 # @param author The author of the export
12414 # @param fileName The name of the file to export
12417 # @ref tui_exportxao "Example"
12418 def ExportXAO(self, shape, groups, fields, author, fileName):
12419 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
12420 RaiseIfFailed("ExportXAO", self.InsertOp)
12423 ## Import a shape from XAO format
12424 # @param shape Shape to export
12425 # @param fileName The name of the file to import
12426 # @return tuple (res, shape, subShapes, groups, fields)
12427 # res Flag indicating if the import was successful
12428 # shape The imported shape
12429 # subShapes The list of imported subShapes
12430 # groups The list of imported groups
12431 # fields The list of imported fields
12433 # @ref tui_importxao "Example"
12434 def ImportXAO(self, fileName):
12435 res = self.InsertOp.ImportXAO(fileName)
12436 RaiseIfFailed("ImportXAO", self.InsertOp)
12439 #@@ insert new functions before this line @@ do not remove this line @@#
12441 # end of l4_advanced
12444 ## Create a copy of the given object
12446 # @param theOriginal geometry object for copy
12447 # @param theName Object name; when specified, this parameter is used
12448 # for result publication in the study. Otherwise, if automatic
12449 # publication is switched on, default value is used for result name.
12451 # @return New GEOM_Object, containing the copied shape.
12453 # @ingroup l1_geomBuilder_auxiliary
12454 # @ref swig_MakeCopy "Example"
12455 def MakeCopy(self, theOriginal, theName=None):
12457 Create a copy of the given object
12460 theOriginal geometry object for copy
12461 theName Object name; when specified, this parameter is used
12462 for result publication in the study. Otherwise, if automatic
12463 publication is switched on, default value is used for result name.
12466 New GEOM_Object, containing the copied shape.
12468 Example of usage: Copy = geompy.MakeCopy(Box)
12470 # Example: see GEOM_TestAll.py
12471 anObj = self.InsertOp.MakeCopy(theOriginal)
12472 RaiseIfFailed("MakeCopy", self.InsertOp)
12473 self._autoPublish(anObj, theName, "copy")
12476 ## Add Path to load python scripts from
12477 # @param Path a path to load python scripts from
12478 # @ingroup l1_geomBuilder_auxiliary
12479 def addPath(self,Path):
12481 Add Path to load python scripts from
12484 Path a path to load python scripts from
12486 if (sys.path.count(Path) < 1):
12487 sys.path.append(Path)
12491 ## Load marker texture from the file
12492 # @param Path a path to the texture file
12493 # @return unique texture identifier
12494 # @ingroup l1_geomBuilder_auxiliary
12495 def LoadTexture(self, Path):
12497 Load marker texture from the file
12500 Path a path to the texture file
12503 unique texture identifier
12505 # Example: see GEOM_TestAll.py
12506 ID = self.InsertOp.LoadTexture(Path)
12507 RaiseIfFailed("LoadTexture", self.InsertOp)
12510 ## Get internal name of the object based on its study entry
12511 # @note This method does not provide an unique identifier of the geometry object.
12512 # @note This is internal function of GEOM component, though it can be used outside it for
12513 # appropriate reason (e.g. for identification of geometry object).
12514 # @param obj geometry object
12515 # @return unique object identifier
12516 # @ingroup l1_geomBuilder_auxiliary
12517 def getObjectID(self, obj):
12519 Get internal name of the object based on its study entry.
12520 Note: this method does not provide an unique identifier of the geometry object.
12521 It is an internal function of GEOM component, though it can be used outside GEOM for
12522 appropriate reason (e.g. for identification of geometry object).
12525 obj geometry object
12528 unique object identifier
12531 entry = salome.ObjectToID(obj)
12532 if entry is not None:
12533 lst = entry.split(":")
12535 ID = lst[-1] # -1 means last item in the list
12536 return "GEOM_" + ID
12541 ## Add marker texture. @a Width and @a Height parameters
12542 # specify width and height of the texture in pixels.
12543 # If @a RowData is @c True, @a Texture parameter should represent texture data
12544 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12545 # parameter should be unpacked string, in which '1' symbols represent opaque
12546 # pixels and '0' represent transparent pixels of the texture bitmap.
12548 # @param Width texture width in pixels
12549 # @param Height texture height in pixels
12550 # @param Texture texture data
12551 # @param RowData if @c True, @a Texture data are packed in the byte stream
12552 # @return unique texture identifier
12553 # @ingroup l1_geomBuilder_auxiliary
12554 def AddTexture(self, Width, Height, Texture, RowData=False):
12556 Add marker texture. Width and Height parameters
12557 specify width and height of the texture in pixels.
12558 If RowData is True, Texture parameter should represent texture data
12559 packed into the byte array. If RowData is False (default), Texture
12560 parameter should be unpacked string, in which '1' symbols represent opaque
12561 pixels and '0' represent transparent pixels of the texture bitmap.
12564 Width texture width in pixels
12565 Height texture height in pixels
12566 Texture texture data
12567 RowData if True, Texture data are packed in the byte stream
12570 return unique texture identifier
12572 if not RowData: Texture = PackData(Texture)
12573 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12574 RaiseIfFailed("AddTexture", self.InsertOp)
12577 ## Creates a new folder object. It is a container for any GEOM objects.
12578 # @param Name name of the container
12579 # @param Father parent object. If None,
12580 # folder under 'Geometry' root object will be created.
12581 # @return a new created folder
12582 def NewFolder(self, Name, Father=None):
12584 Create a new folder object. It is an auxiliary container for any GEOM objects.
12587 Name name of the container
12588 Father parent object. If None,
12589 folder under 'Geometry' root object will be created.
12592 a new created folder
12594 if not Father: Father = self.father
12595 return self.CreateFolder(Name, Father)
12597 ## Move object to the specified folder
12598 # @param Object object to move
12599 # @param Folder target folder
12600 def PutToFolder(self, Object, Folder):
12602 Move object to the specified folder
12605 Object object to move
12606 Folder target folder
12608 self.MoveToFolder(Object, Folder)
12611 ## Move list of objects to the specified folder
12612 # @param ListOfSO list of objects to move
12613 # @param Folder target folder
12614 def PutListToFolder(self, ListOfSO, Folder):
12616 Move list of objects to the specified folder
12619 ListOfSO list of objects to move
12620 Folder target folder
12622 self.MoveListToFolder(ListOfSO, Folder)
12625 ## @addtogroup l2_field
12629 # @param shape the shape the field lies on
12630 # @param name the field name
12631 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12632 # @param dimension dimension of the shape the field lies on
12633 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12634 # @param componentNames names of components
12635 # @return a created field
12636 def CreateField(self, shape, name, type, dimension, componentNames):
12641 shape the shape the field lies on
12642 name the field name
12643 type type of field data
12644 dimension dimension of the shape the field lies on
12645 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12646 componentNames names of components
12651 if isinstance( type, int ):
12652 if type < 0 or type > 3:
12653 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12654 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12656 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12657 RaiseIfFailed("CreateField", self.FieldOp)
12659 geom._autoPublish( f, "", name)
12662 ## Removes a field from the GEOM component
12663 # @param field the field to remove
12664 def RemoveField(self, field):
12665 "Removes a field from the GEOM component"
12667 if isinstance( field, GEOM._objref_GEOM_Field ):
12668 geom.RemoveObject( field )
12669 elif isinstance( field, geomField ):
12670 geom.RemoveObject( field.field )
12672 raise RuntimeError, "RemoveField() : the object is not a field"
12675 ## Returns number of fields on a shape
12676 def CountFields(self, shape):
12677 "Returns number of fields on a shape"
12678 nb = self.FieldOp.CountFields( shape )
12679 RaiseIfFailed("CountFields", self.FieldOp)
12682 ## Returns all fields on a shape
12683 def GetFields(self, shape):
12684 "Returns all fields on a shape"
12685 ff = self.FieldOp.GetFields( shape )
12686 RaiseIfFailed("GetFields", self.FieldOp)
12689 ## Returns a field on a shape by its name
12690 def GetField(self, shape, name):
12691 "Returns a field on a shape by its name"
12692 f = self.FieldOp.GetField( shape, name )
12693 RaiseIfFailed("GetField", self.FieldOp)
12701 # Register the new proxy for GEOM_Gen
12702 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12705 ## Field on Geometry
12706 # @ingroup l2_field
12707 class geomField( GEOM._objref_GEOM_Field ):
12709 def __init__(self):
12710 GEOM._objref_GEOM_Field.__init__(self)
12711 self.field = GEOM._objref_GEOM_Field
12714 ## Returns the shape the field lies on
12715 def getShape(self):
12716 "Returns the shape the field lies on"
12717 return self.field.GetShape(self)
12719 ## Returns the field name
12721 "Returns the field name"
12722 return self.field.GetName(self)
12724 ## Returns type of field data as integer [0-3]
12726 "Returns type of field data"
12727 return self.field.GetDataType(self)._v
12729 ## Returns type of field data:
12730 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12731 def getTypeEnum(self):
12732 "Returns type of field data"
12733 return self.field.GetDataType(self)
12735 ## Returns dimension of the shape the field lies on:
12736 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12737 def getDimension(self):
12738 """Returns dimension of the shape the field lies on:
12739 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12740 return self.field.GetDimension(self)
12742 ## Returns names of components
12743 def getComponents(self):
12744 "Returns names of components"
12745 return self.field.GetComponents(self)
12747 ## Adds a time step to the field
12748 # @param step the time step number futher used as the step identifier
12749 # @param stamp the time step time
12750 # @param values the values of the time step
12751 def addStep(self, step, stamp, values):
12752 "Adds a time step to the field"
12753 stp = self.field.AddStep( self, step, stamp )
12755 raise RuntimeError, \
12756 "Field.addStep() : Error: step %s already exists in this field"%step
12758 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12759 self.setValues( step, values )
12762 ## Remove a time step from the field
12763 def removeStep(self,step):
12764 "Remove a time step from the field"
12767 stepObj = self.field.GetStep( self, step )
12769 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12772 #traceback.print_exc()
12774 self.field.RemoveStep( self, step )
12776 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12779 ## Returns number of time steps in the field
12780 def countSteps(self):
12781 "Returns number of time steps in the field"
12782 return self.field.CountSteps(self)
12784 ## Returns a list of time step IDs in the field
12785 def getSteps(self):
12786 "Returns a list of time step IDs in the field"
12787 return self.field.GetSteps(self)
12789 ## Returns a time step by its ID
12790 def getStep(self,step):
12791 "Returns a time step by its ID"
12792 stp = self.field.GetStep(self, step)
12794 raise RuntimeError, "Step %s is missing from this field"%step
12797 ## Returns the time of the field step
12798 def getStamp(self,step):
12799 "Returns the time of the field step"
12800 return self.getStep(step).GetStamp()
12802 ## Changes the time of the field step
12803 def setStamp(self, step, stamp):
12804 "Changes the time of the field step"
12805 return self.getStep(step).SetStamp(stamp)
12807 ## Returns values of the field step
12808 def getValues(self, step):
12809 "Returns values of the field step"
12810 return self.getStep(step).GetValues()
12812 ## Changes values of the field step
12813 def setValues(self, step, values):
12814 "Changes values of the field step"
12815 stp = self.getStep(step)
12816 errBeg = "Field.setValues(values) : Error: "
12818 ok = stp.SetValues( values )
12819 except Exception, e:
12821 if excStr.find("WrongPythonType") > 0:
12822 raise RuntimeError, errBeg +\
12823 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12824 raise RuntimeError, errBeg + str(e)
12826 nbOK = self.field.GetArraySize(self)
12829 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12831 raise RuntimeError, errBeg + "failed"
12834 pass # end of class geomField
12836 # Register the new proxy for GEOM_Field
12837 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12840 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12841 # interface to GEOM operations.
12846 # salome.salome_init()
12847 # from salome.geom import geomBuilder
12848 # geompy = geomBuilder.New(salome.myStudy)
12850 # @param study SALOME study, generally obtained by salome.myStudy.
12851 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12852 # @return geomBuilder instance
12853 def New( study, instance=None):
12855 Create a new geomBuilder instance.The geomBuilder class provides the Python
12856 interface to GEOM operations.
12860 salome.salome_init()
12861 from salome.geom import geomBuilder
12862 geompy = geomBuilder.New(salome.myStudy)
12865 study SALOME study, generally obtained by salome.myStudy.
12866 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12868 geomBuilder instance
12870 #print "New geomBuilder ", study, instance
12877 geom = geomBuilder()
12878 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12879 geom.init_geom(study)