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
198 # initialize SALOME session in try/except block
199 # to avoid problems in some cases, e.g. when generating documentation
207 from salome_notebook import *
213 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
216 def _toListOfNames(_names, _size=-1):
219 if type(_names) in [types.ListType, types.TupleType]:
220 for i in _names: l.append(i)
223 if l and len(l) < _size:
224 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
227 ## Raise an Error, containing the Method_name, if Operation is Failed
228 ## @ingroup l1_geomBuilder_auxiliary
229 def RaiseIfFailed (Method_name, Operation):
230 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
231 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
233 ## Return list of variables value from salome notebook
234 ## @ingroup l1_geomBuilder_auxiliary
235 def ParseParameters(*parameters):
238 for parameter in parameters:
239 if isinstance(parameter, list):
240 lResults = ParseParameters(*parameter)
241 if len(lResults) > 0:
242 Result.append(lResults[:-1])
243 StringResult += lResults[-1].split(":")
247 if isinstance(parameter,str):
248 if notebook.isVariable(parameter):
249 Result.append(notebook.get(parameter))
251 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
254 Result.append(parameter)
256 StringResult.append(str(parameter))
260 Result.append(":".join(StringResult))
262 Result = ":".join(StringResult)
265 ## Return list of variables value from salome notebook
266 ## @ingroup l1_geomBuilder_auxiliary
270 for parameter in list:
271 if isinstance(parameter,str) and notebook.isVariable(parameter):
272 Result.append(str(notebook.get(parameter)))
275 Result.append(str(parameter))
278 StringResult = StringResult + str(parameter)
279 StringResult = StringResult + ":"
281 StringResult = StringResult[:len(StringResult)-1]
282 return Result, StringResult
284 ## Return list of variables value from salome notebook
285 ## @ingroup l1_geomBuilder_auxiliary
286 def ParseSketcherCommand(command):
289 sections = command.split(":")
290 for section in sections:
291 parameters = section.split(" ")
293 for parameter in parameters:
294 if paramIndex > 1 and parameter.find("'") != -1:
295 parameter = parameter.replace("'","")
296 if notebook.isVariable(parameter):
297 Result = Result + str(notebook.get(parameter)) + " "
300 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
304 Result = Result + str(parameter) + " "
307 StringResult = StringResult + parameter
308 StringResult = StringResult + ":"
310 paramIndex = paramIndex + 1
312 Result = Result[:len(Result)-1] + ":"
314 Result = Result[:len(Result)-1]
315 return Result, StringResult
317 ## Helper function which can be used to pack the passed string to the byte data.
318 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
319 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
322 ## val = PackData("10001110") # val = 0xAE
323 ## val = PackData("1") # val = 0x80
325 ## @param data unpacked data - a string containing '1' and '0' symbols
326 ## @return data packed to the byte stream
327 ## @ingroup l1_geomBuilder_auxiliary
330 Helper function which can be used to pack the passed string to the byte data.
331 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
332 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
335 data unpacked data - a string containing '1' and '0' symbols
338 data packed to the byte stream
341 val = PackData("10001110") # val = 0xAE
342 val = PackData("1") # val = 0x80
345 if len(data)%8: bytes += 1
347 for b in range(bytes):
348 d = data[b*8:(b+1)*8]
353 if d[i] == "1": val += 1
355 raise "Invalid symbol %s" % d[i]
362 ## Read bitmap texture from the text file.
363 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
364 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
365 ## The function returns width and height of the pixmap in pixels and byte stream representing
366 ## texture bitmap itself.
368 ## This function can be used to read the texture to the byte stream in order to pass it to
369 ## the AddTexture() function of geomBuilder class.
372 ## from salome.geom import geomBuilder
373 ## geompy = geomBuilder.New(salome.myStudy)
374 ## texture = geompy.readtexture('mytexture.dat')
375 ## texture = geompy.AddTexture(*texture)
376 ## obj.SetMarkerTexture(texture)
378 ## @param fname texture file name
379 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
380 ## @ingroup l1_geomBuilder_auxiliary
381 def ReadTexture(fname):
383 Read bitmap texture from the text file.
384 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
385 A zero symbol ('0') represents transparent pixel of the texture bitmap.
386 The function returns width and height of the pixmap in pixels and byte stream representing
387 texture bitmap itself.
388 This function can be used to read the texture to the byte stream in order to pass it to
389 the AddTexture() function of geomBuilder class.
392 fname texture file name
395 sequence of tree values: texture's width, height in pixels and its byte stream
398 from salome.geom import geomBuilder
399 geompy = geomBuilder.New(salome.myStudy)
400 texture = geompy.readtexture('mytexture.dat')
401 texture = geompy.AddTexture(*texture)
402 obj.SetMarkerTexture(texture)
406 lines = [ l.strip() for l in f.readlines()]
409 if lines: maxlen = max([len(x) for x in lines])
411 if maxlen%8: lenbytes += 1
415 lenline = (len(line)/8+1)*8
418 lenline = (len(line)/8)*8
420 for i in range(lenline/8):
423 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
426 bytedata += PackData(byte)
428 for i in range(lenline/8, lenbytes):
429 bytedata += PackData("0")
431 return lenbytes*8, len(lines), bytedata
436 ## Returns a long value from enumeration type
437 # Can be used for CORBA enumerator types like GEOM.shape_type
438 # @param theItem enumeration type
439 # @ingroup l1_geomBuilder_auxiliary
440 def EnumToLong(theItem):
442 Returns a long value from enumeration type
443 Can be used for CORBA enumerator types like geomBuilder.ShapeType
446 theItem enumeration type
449 if hasattr(theItem, "_v"): ret = theItem._v
452 ## Information about closed/unclosed state of shell or wire
453 # @ingroup l1_geomBuilder_auxiliary
456 Information about closed/unclosed state of shell or wire
462 ##! Private class used to bind calls of plugin operations to geomBuilder
463 class PluginOperation:
464 def __init__(self, operation, function):
465 self.operation = operation
466 self.function = function
469 def __call__(self, *args):
470 res = self.function(self.operation, *args)
471 RaiseIfFailed(self.function.__name__, self.operation)
474 # Warning: geom is a singleton
480 class geomBuilder(object, GEOM._objref_GEOM_Gen):
482 ## Enumeration ShapeType as a dictionary. \n
483 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
484 # @ingroup l1_geomBuilder_auxiliary
485 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
487 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
488 # and a list of parameters, describing the shape.
489 # List of parameters, describing the shape:
490 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
491 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
493 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
495 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
497 # - SPHERE: [xc yc zc R]
498 # - CYLINDER: [xb yb zb dx dy dz R H]
499 # - BOX: [xc yc zc ax ay az]
500 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
501 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
502 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
503 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
504 # - SOLID: [nb_faces nb_edges nb_vertices]
506 # - SPHERE2D: [xc yc zc R]
507 # - CYLINDER2D: [xb yb zb dx dy dz R H]
508 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
509 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
510 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
511 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
512 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
513 # - PLANE: [xo yo zo dx dy dz]
514 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
515 # - FACE: [nb_edges nb_vertices]
517 # - CIRCLE: [xc yc zc dx dy dz R]
518 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
519 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
520 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
521 # - LINE: [xo yo zo dx dy dz]
522 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
523 # - EDGE: [nb_vertices]
526 # @ingroup l1_geomBuilder_auxiliary
527 kind = GEOM.GEOM_IKindOfShape
534 #print "==== __new__ ", engine, geom, doLcc, created
536 # geom engine is either retrieved from engine, or created
538 # Following test avoids a recursive loop
541 # geom engine not created: existing engine found
543 if doLcc and not created:
545 # FindOrLoadComponent called:
546 # 1. CORBA resolution of server
547 # 2. the __new__ method is called again
548 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
549 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
552 # FindOrLoadComponent not called
554 # geomBuilder instance is created from lcc.FindOrLoadComponent
555 #print "==== super ", engine, geom, doLcc, created
556 geom = super(geomBuilder,cls).__new__(cls)
559 # geom engine not created: existing engine found
560 #print "==== existing ", engine, geom, doLcc, created
562 #print "return geom 1 ", geom
565 #print "return geom 2 ", geom
570 #print "-------- geomBuilder __init__ --- ", created, self
573 GEOM._objref_GEOM_Gen.__init__(self)
574 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
575 self.myBuilder = None
594 ## Process object publication in the study, as follows:
595 # - if @a theName is specified (not None), the object is published in the study
596 # with this name, not taking into account "auto-publishing" option;
597 # - if @a theName is NOT specified, the object is published in the study
598 # (using default name, which can be customized using @a theDefaultName parameter)
599 # only if auto-publishing is switched on.
601 # @param theObj object, a subject for publishing
602 # @param theName object name for study
603 # @param theDefaultName default name for the auto-publishing
605 # @sa addToStudyAuto()
606 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
608 def _item_name(_names, _defname, _idx=-1):
609 if not _names: _names = _defname
610 if type(_names) in [types.ListType, types.TupleType]:
612 if _idx >= len(_names) or not _names[_idx]:
613 if type(_defname) not in [types.ListType, types.TupleType]:
614 _name = "%s_%d"%(_defname, _idx+1)
615 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
616 _name = _defname[_idx]
618 _name = "%noname_%d"%(dn, _idx+1)
624 # must be wrong usage
629 _name = "%s_%d"%(_names, _idx+1)
637 if not theName and not self.myMaxNbSubShapesAllowed:
638 return # nothing to do: auto-publishing is disabled
639 if not theName and not theDefaultName:
640 return # neither theName nor theDefaultName is given
642 if type(theObj) in [types.ListType, types.TupleType]:
643 # list of objects is being published
646 if not obj: continue # bad object
647 ###if obj.GetStudyEntry(): continue # already published
648 name = _item_name(theName, theDefaultName, idx)
649 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
650 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
652 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
655 if not theName and idx == self.myMaxNbSubShapesAllowed: break
659 # single object is published
660 ###if theObj.GetStudyEntry(): return # already published
661 name = _item_name(theName, theDefaultName)
662 if theObj.IsMainShape():
663 self.addToStudy(theObj, name)
665 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
670 ## @addtogroup l1_geomBuilder_auxiliary
672 def init_geom(self,theStudy):
673 self.myStudy = theStudy
674 self.myStudyId = self.myStudy._get_StudyId()
675 self.myBuilder = self.myStudy.NewBuilder()
676 self.father = self.myStudy.FindComponent("GEOM")
677 if self.father is None:
678 self.father = self.myBuilder.NewComponent("GEOM")
679 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
680 FName = A1._narrow(SALOMEDS.AttributeName)
681 FName.SetValue("Geometry")
682 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
683 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
684 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
685 self.myBuilder.DefineComponentInstance(self.father,self)
687 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
688 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
689 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
690 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
691 self.HealOp = self.GetIHealingOperations (self.myStudyId)
692 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
693 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
694 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
695 self.LocalOp = self.GetILocalOperations (self.myStudyId)
696 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
697 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
698 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
699 #self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
700 self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
701 # set GEOM as root in the use case tree
702 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
703 self.myUseCaseBuilder.SetRootCurrent()
704 self.myUseCaseBuilder.Append(self.father)
707 def GetPluginOperations(self, studyID, libraryName):
708 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
710 # bind methods of operations to self
711 methods = op.__class__.__dict__['__methods__']
712 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
713 for meth_name in methods:
714 if not meth_name in avoid_methods: # avoid basic methods
715 function = getattr(op.__class__, meth_name)
716 if callable(function):
717 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
718 self.__dict__[meth_name] = PluginOperation(op, function)
721 ## Enable / disable results auto-publishing
723 # The automatic publishing is managed in the following way:
724 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
725 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
726 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
727 # value passed as parameter has the same effect.
728 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
729 # maximum number of sub-shapes allowed for publishing is set to specified value.
731 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
732 # @ingroup l1_publish_data
733 def addToStudyAuto(self, maxNbSubShapes=-1):
735 Enable / disable results auto-publishing
737 The automatic publishing is managed in the following way:
738 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
739 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
740 maximum number of sub-shapes allowed for publishing is unlimited; any negative
741 value passed as parameter has the same effect.
742 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
743 maximum number of sub-shapes allowed for publishing is set to this value.
746 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
749 geompy.addToStudyAuto() # enable auto-publishing
750 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
751 geompy.addToStudyAuto(0) # disable auto-publishing
753 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
756 ## Dump component to the Python script
757 # This method overrides IDL function to allow default values for the parameters.
758 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
760 Dump component to the Python script
761 This method overrides IDL function to allow default values for the parameters.
763 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
765 ## Get name for sub-shape aSubObj of shape aMainObj
767 # @ref swig_SubShapeName "Example"
768 def SubShapeName(self,aSubObj, aMainObj):
770 Get name for sub-shape aSubObj of shape aMainObj
772 # Example: see GEOM_TestAll.py
774 #aSubId = orb.object_to_string(aSubObj)
775 #aMainId = orb.object_to_string(aMainObj)
776 #index = gg.getIndexTopology(aSubId, aMainId)
777 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
778 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
779 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
782 ## Publish in study aShape with name aName
784 # \param aShape the shape to be published
785 # \param aName the name for the shape
786 # \param doRestoreSubShapes if True, finds and publishes also
787 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
788 # and published sub-shapes of arguments
789 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
790 # these arguments description
791 # \return study entry of the published shape in form of string
793 # @ingroup l1_publish_data
794 # @ref swig_all_addtostudy "Example"
795 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
796 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
798 Publish in study aShape with name aName
801 aShape the shape to be published
802 aName the name for the shape
803 doRestoreSubShapes if True, finds and publishes also
804 sub-shapes of aShape, corresponding to its arguments
805 and published sub-shapes of arguments
806 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
807 these arguments description
810 study entry of the published shape in form of string
813 id_block1 = geompy.addToStudy(Block1, "Block 1")
815 # Example: see GEOM_TestAll.py
817 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
818 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
819 if doRestoreSubShapes:
820 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
821 theFindMethod, theInheritFirstArg, True )
823 print "addToStudy() failed"
825 return aShape.GetStudyEntry()
827 ## Publish in study aShape with name aName as sub-object of previously published aFather
828 # \param aFather previously published object
829 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
830 # \param aName the name for the shape
832 # \return study entry of the published shape in form of string
834 # @ingroup l1_publish_data
835 # @ref swig_all_addtostudyInFather "Example"
836 def addToStudyInFather(self, aFather, aShape, aName):
838 Publish in study aShape with name aName as sub-object of previously published aFather
841 aFather previously published object
842 aShape the shape to be published as sub-object of aFather
843 aName the name for the shape
846 study entry of the published shape in form of string
848 # Example: see GEOM_TestAll.py
850 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
851 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
853 print "addToStudyInFather() failed"
855 return aShape.GetStudyEntry()
857 ## Unpublish object in study
859 # \param obj the object to be unpublished
860 def hideInStudy(self, obj):
862 Unpublish object in study
865 obj the object to be unpublished
867 ior = salome.orb.object_to_string(obj)
868 aSObject = self.myStudy.FindObjectIOR(ior)
869 if aSObject is not None:
870 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
871 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
872 drwAttribute.SetDrawable(False)
875 # end of l1_geomBuilder_auxiliary
878 ## @addtogroup l3_restore_ss
881 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
882 # To be used from python scripts out of addToStudy() (non-default usage)
883 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
884 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
885 # If this list is empty, all operation arguments will be published
886 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
887 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
888 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
889 # Do not publish sub-shapes in place of arguments, but only
890 # in place of sub-shapes of the first argument,
891 # because the whole shape corresponds to the first argument.
892 # Mainly to be used after transformations, but it also can be
893 # usefull after partition with one object shape, and some other
894 # operations, where only the first argument has to be considered.
895 # If theObject has only one argument shape, this flag is automatically
896 # considered as True, not regarding really passed value.
897 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
898 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
899 # \return list of published sub-shapes
901 # @ref tui_restore_prs_params "Example"
902 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
903 theInheritFirstArg=False, theAddPrefix=True):
905 Publish sub-shapes, standing for arguments and sub-shapes of arguments
906 To be used from python scripts out of geompy.addToStudy (non-default usage)
909 theObject published GEOM.GEOM_Object, arguments of which will be published
910 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
911 If this list is empty, all operation arguments will be published
912 theFindMethod method to search sub-shapes, corresponding to arguments and
913 their sub-shapes. Value from enumeration GEOM.find_shape_method.
914 theInheritFirstArg set properties of the first argument for theObject.
915 Do not publish sub-shapes in place of arguments, but only
916 in place of sub-shapes of the first argument,
917 because the whole shape corresponds to the first argument.
918 Mainly to be used after transformations, but it also can be
919 usefull after partition with one object shape, and some other
920 operations, where only the first argument has to be considered.
921 If theObject has only one argument shape, this flag is automatically
922 considered as True, not regarding really passed value.
923 theAddPrefix add prefix "from_" to names of restored sub-shapes,
924 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
926 list of published sub-shapes
928 # Example: see GEOM_TestAll.py
929 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
930 theFindMethod, theInheritFirstArg, theAddPrefix)
932 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
933 # To be used from python scripts out of addToStudy() (non-default usage)
934 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
935 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
936 # If this list is empty, all operation arguments will be published
937 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
938 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
939 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
940 # Do not publish sub-shapes in place of arguments, but only
941 # in place of sub-shapes of the first argument,
942 # because the whole shape corresponds to the first argument.
943 # Mainly to be used after transformations, but it also can be
944 # usefull after partition with one object shape, and some other
945 # operations, where only the first argument has to be considered.
946 # If theObject has only one argument shape, this flag is automatically
947 # considered as True, not regarding really passed value.
948 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
949 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
950 # \return list of published sub-shapes
952 # @ref tui_restore_prs_params "Example"
953 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
954 theInheritFirstArg=False, theAddPrefix=True):
956 Publish sub-shapes, standing for arguments and sub-shapes of arguments
957 To be used from python scripts out of geompy.addToStudy() (non-default usage)
960 theObject published GEOM.GEOM_Object, arguments of which will be published
961 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
962 If this list is empty, all operation arguments will be published
963 theFindMethod method to search sub-shapes, corresponding to arguments and
964 their sub-shapes. Value from enumeration GEOM::find_shape_method.
965 theInheritFirstArg set properties of the first argument for theObject.
966 Do not publish sub-shapes in place of arguments, but only
967 in place of sub-shapes of the first argument,
968 because the whole shape corresponds to the first argument.
969 Mainly to be used after transformations, but it also can be
970 usefull after partition with one object shape, and some other
971 operations, where only the first argument has to be considered.
972 If theObject has only one argument shape, this flag is automatically
973 considered as True, not regarding really passed value.
974 theAddPrefix add prefix "from_" to names of restored sub-shapes,
975 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
978 list of published sub-shapes
980 # Example: see GEOM_TestAll.py
981 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
982 theFindMethod, theInheritFirstArg, theAddPrefix)
984 # end of l3_restore_ss
987 ## @addtogroup l3_basic_go
990 ## Create point by three coordinates.
991 # @param theX The X coordinate of the point.
992 # @param theY The Y coordinate of the point.
993 # @param theZ The Z coordinate of the point.
994 # @param theName Object name; when specified, this parameter is used
995 # for result publication in the study. Otherwise, if automatic
996 # publication is switched on, default value is used for result name.
998 # @return New GEOM.GEOM_Object, containing the created point.
1000 # @ref tui_creation_point "Example"
1001 def MakeVertex(self, theX, theY, theZ, theName=None):
1003 Create point by three coordinates.
1006 theX The X coordinate of the point.
1007 theY The Y coordinate of the point.
1008 theZ The Z coordinate of the point.
1009 theName Object name; when specified, this parameter is used
1010 for result publication in the study. Otherwise, if automatic
1011 publication is switched on, default value is used for result name.
1014 New GEOM.GEOM_Object, containing the created point.
1016 # Example: see GEOM_TestAll.py
1017 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1018 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1019 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1020 anObj.SetParameters(Parameters)
1021 self._autoPublish(anObj, theName, "vertex")
1024 ## Create a point, distant from the referenced point
1025 # on the given distances along the coordinate axes.
1026 # @param theReference The referenced point.
1027 # @param theX Displacement from the referenced point along OX axis.
1028 # @param theY Displacement from the referenced point along OY axis.
1029 # @param theZ Displacement from the referenced point along OZ axis.
1030 # @param theName Object name; when specified, this parameter is used
1031 # for result publication in the study. Otherwise, if automatic
1032 # publication is switched on, default value is used for result name.
1034 # @return New GEOM.GEOM_Object, containing the created point.
1036 # @ref tui_creation_point "Example"
1037 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1039 Create a point, distant from the referenced point
1040 on the given distances along the coordinate axes.
1043 theReference The referenced point.
1044 theX Displacement from the referenced point along OX axis.
1045 theY Displacement from the referenced point along OY axis.
1046 theZ Displacement from the referenced point along OZ axis.
1047 theName Object name; when specified, this parameter is used
1048 for result publication in the study. Otherwise, if automatic
1049 publication is switched on, default value is used for result name.
1052 New GEOM.GEOM_Object, containing the created point.
1054 # Example: see GEOM_TestAll.py
1055 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1056 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1057 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1058 anObj.SetParameters(Parameters)
1059 self._autoPublish(anObj, theName, "vertex")
1062 ## Create a point, corresponding to the given parameter on the given curve.
1063 # @param theRefCurve The referenced curve.
1064 # @param theParameter Value of parameter on the referenced curve.
1065 # @param theName Object name; when specified, this parameter is used
1066 # for result publication in the study. Otherwise, if automatic
1067 # publication is switched on, default value is used for result name.
1069 # @return New GEOM.GEOM_Object, containing the created point.
1071 # @ref tui_creation_point "Example"
1072 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1074 Create a point, corresponding to the given parameter on the given curve.
1077 theRefCurve The referenced curve.
1078 theParameter Value of parameter on the referenced curve.
1079 theName Object name; when specified, this parameter is used
1080 for result publication in the study. Otherwise, if automatic
1081 publication is switched on, default value is used for result name.
1084 New GEOM.GEOM_Object, containing the created point.
1087 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1089 # Example: see GEOM_TestAll.py
1090 theParameter, Parameters = ParseParameters(theParameter)
1091 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1092 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1093 anObj.SetParameters(Parameters)
1094 self._autoPublish(anObj, theName, "vertex")
1097 ## Create a point by projection give coordinates on the given curve
1098 # @param theRefCurve The referenced curve.
1099 # @param theX X-coordinate in 3D space
1100 # @param theY Y-coordinate in 3D space
1101 # @param theZ Z-coordinate in 3D space
1102 # @param theName Object name; when specified, this parameter is used
1103 # for result publication in the study. Otherwise, if automatic
1104 # publication is switched on, default value is used for result name.
1106 # @return New GEOM.GEOM_Object, containing the created point.
1108 # @ref tui_creation_point "Example"
1109 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1111 Create a point by projection give coordinates on the given curve
1114 theRefCurve The referenced curve.
1115 theX X-coordinate in 3D space
1116 theY Y-coordinate in 3D space
1117 theZ Z-coordinate in 3D space
1118 theName Object name; when specified, this parameter is used
1119 for result publication in the study. Otherwise, if automatic
1120 publication is switched on, default value is used for result name.
1123 New GEOM.GEOM_Object, containing the created point.
1126 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1128 # Example: see GEOM_TestAll.py
1129 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1130 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1131 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1132 anObj.SetParameters(Parameters)
1133 self._autoPublish(anObj, theName, "vertex")
1136 ## Create a point, corresponding to the given length on the given curve.
1137 # @param theRefCurve The referenced curve.
1138 # @param theLength Length on the referenced curve. It can be negative.
1139 # @param theStartPoint Point allowing to choose the direction for the calculation
1140 # of the length. If None, start from the first point of theRefCurve.
1141 # @param theName Object name; when specified, this parameter is used
1142 # for result publication in the study. Otherwise, if automatic
1143 # publication is switched on, default value is used for result name.
1145 # @return New GEOM.GEOM_Object, containing the created point.
1147 # @ref tui_creation_point "Example"
1148 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1150 Create a point, corresponding to the given length on the given curve.
1153 theRefCurve The referenced curve.
1154 theLength Length on the referenced curve. It can be negative.
1155 theStartPoint Point allowing to choose the direction for the calculation
1156 of the length. If None, start from the first point of theRefCurve.
1157 theName Object name; when specified, this parameter is used
1158 for result publication in the study. Otherwise, if automatic
1159 publication is switched on, default value is used for result name.
1162 New GEOM.GEOM_Object, containing the created point.
1164 # Example: see GEOM_TestAll.py
1165 theLength, Parameters = ParseParameters(theLength)
1166 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1167 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1168 anObj.SetParameters(Parameters)
1169 self._autoPublish(anObj, theName, "vertex")
1172 ## Create a point, corresponding to the given parameters on the
1174 # @param theRefSurf The referenced surface.
1175 # @param theUParameter Value of U-parameter on the referenced surface.
1176 # @param theVParameter Value of V-parameter on the referenced surface.
1177 # @param theName Object name; when specified, this parameter is used
1178 # for result publication in the study. Otherwise, if automatic
1179 # publication is switched on, default value is used for result name.
1181 # @return New GEOM.GEOM_Object, containing the created point.
1183 # @ref swig_MakeVertexOnSurface "Example"
1184 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1186 Create a point, corresponding to the given parameters on the
1190 theRefSurf The referenced surface.
1191 theUParameter Value of U-parameter on the referenced surface.
1192 theVParameter Value of V-parameter on the referenced surface.
1193 theName Object name; when specified, this parameter is used
1194 for result publication in the study. Otherwise, if automatic
1195 publication is switched on, default value is used for result name.
1198 New GEOM.GEOM_Object, containing the created point.
1201 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1203 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1204 # Example: see GEOM_TestAll.py
1205 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1206 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1207 anObj.SetParameters(Parameters);
1208 self._autoPublish(anObj, theName, "vertex")
1211 ## Create a point by projection give coordinates on the given surface
1212 # @param theRefSurf The referenced surface.
1213 # @param theX X-coordinate in 3D space
1214 # @param theY Y-coordinate in 3D space
1215 # @param theZ Z-coordinate in 3D space
1216 # @param theName Object name; when specified, this parameter is used
1217 # for result publication in the study. Otherwise, if automatic
1218 # publication is switched on, default value is used for result name.
1220 # @return New GEOM.GEOM_Object, containing the created point.
1222 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1223 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1225 Create a point by projection give coordinates on the given surface
1228 theRefSurf The referenced surface.
1229 theX X-coordinate in 3D space
1230 theY Y-coordinate in 3D space
1231 theZ Z-coordinate in 3D space
1232 theName Object name; when specified, this parameter is used
1233 for result publication in the study. Otherwise, if automatic
1234 publication is switched on, default value is used for result name.
1237 New GEOM.GEOM_Object, containing the created point.
1240 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1242 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1243 # Example: see GEOM_TestAll.py
1244 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1245 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1246 anObj.SetParameters(Parameters);
1247 self._autoPublish(anObj, theName, "vertex")
1250 ## Create a point, which lays on the given face.
1251 # The point will lay in arbitrary place of the face.
1252 # The only condition on it is a non-zero distance to the face boundary.
1253 # Such point can be used to uniquely identify the face inside any
1254 # shape in case, when the shape does not contain overlapped faces.
1255 # @param theFace The referenced face.
1256 # @param theName Object name; when specified, this parameter is used
1257 # for result publication in the study. Otherwise, if automatic
1258 # publication is switched on, default value is used for result name.
1260 # @return New GEOM.GEOM_Object, containing the created point.
1262 # @ref swig_MakeVertexInsideFace "Example"
1263 def MakeVertexInsideFace (self, theFace, theName=None):
1265 Create a point, which lays on the given face.
1266 The point will lay in arbitrary place of the face.
1267 The only condition on it is a non-zero distance to the face boundary.
1268 Such point can be used to uniquely identify the face inside any
1269 shape in case, when the shape does not contain overlapped faces.
1272 theFace The referenced face.
1273 theName Object name; when specified, this parameter is used
1274 for result publication in the study. Otherwise, if automatic
1275 publication is switched on, default value is used for result name.
1278 New GEOM.GEOM_Object, containing the created point.
1281 p_on_face = geompy.MakeVertexInsideFace(Face)
1283 # Example: see GEOM_TestAll.py
1284 anObj = self.BasicOp.MakePointOnFace(theFace)
1285 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1286 self._autoPublish(anObj, theName, "vertex")
1289 ## Create a point on intersection of two lines.
1290 # @param theRefLine1, theRefLine2 The referenced lines.
1291 # @param theName Object name; when specified, this parameter is used
1292 # for result publication in the study. Otherwise, if automatic
1293 # publication is switched on, default value is used for result name.
1295 # @return New GEOM.GEOM_Object, containing the created point.
1297 # @ref swig_MakeVertexOnLinesIntersection "Example"
1298 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1300 Create a point on intersection of two lines.
1303 theRefLine1, theRefLine2 The referenced lines.
1304 theName Object name; when specified, this parameter is used
1305 for result publication in the study. Otherwise, if automatic
1306 publication is switched on, default value is used for result name.
1309 New GEOM.GEOM_Object, containing the created point.
1311 # Example: see GEOM_TestAll.py
1312 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1313 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1314 self._autoPublish(anObj, theName, "vertex")
1317 ## Create a tangent, corresponding to the given parameter on the given curve.
1318 # @param theRefCurve The referenced curve.
1319 # @param theParameter Value of parameter on the referenced curve.
1320 # @param theName Object name; when specified, this parameter is used
1321 # for result publication in the study. Otherwise, if automatic
1322 # publication is switched on, default value is used for result name.
1324 # @return New GEOM.GEOM_Object, containing the created tangent.
1326 # @ref swig_MakeTangentOnCurve "Example"
1327 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1329 Create a tangent, corresponding to the given parameter on the given curve.
1332 theRefCurve The referenced curve.
1333 theParameter Value of parameter on the referenced curve.
1334 theName Object name; when specified, this parameter is used
1335 for result publication in the study. Otherwise, if automatic
1336 publication is switched on, default value is used for result name.
1339 New GEOM.GEOM_Object, containing the created tangent.
1342 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1344 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1345 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1346 self._autoPublish(anObj, theName, "tangent")
1349 ## Create a tangent plane, corresponding to the given parameter on the given face.
1350 # @param theFace The face for which tangent plane should be built.
1351 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1352 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1353 # @param theTrimSize the size of plane.
1354 # @param theName Object name; when specified, this parameter is used
1355 # for result publication in the study. Otherwise, if automatic
1356 # publication is switched on, default value is used for result name.
1358 # @return New GEOM.GEOM_Object, containing the created tangent.
1360 # @ref swig_MakeTangentPlaneOnFace "Example"
1361 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1363 Create a tangent plane, corresponding to the given parameter on the given face.
1366 theFace The face for which tangent plane should be built.
1367 theParameterV vertical value of the center point (0.0 - 1.0).
1368 theParameterU horisontal value of the center point (0.0 - 1.0).
1369 theTrimSize the size of plane.
1370 theName Object name; when specified, this parameter is used
1371 for result publication in the study. Otherwise, if automatic
1372 publication is switched on, default value is used for result name.
1375 New GEOM.GEOM_Object, containing the created tangent.
1378 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1380 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1381 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1382 self._autoPublish(anObj, theName, "tangent")
1385 ## Create a vector with the given components.
1386 # @param theDX X component of the vector.
1387 # @param theDY Y component of the vector.
1388 # @param theDZ Z component of the vector.
1389 # @param 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.
1393 # @return New GEOM.GEOM_Object, containing the created vector.
1395 # @ref tui_creation_vector "Example"
1396 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1398 Create a vector with the given components.
1401 theDX X component of the vector.
1402 theDY Y component of the vector.
1403 theDZ Z component of the vector.
1404 theName Object name; when specified, this parameter is used
1405 for result publication in the study. Otherwise, if automatic
1406 publication is switched on, default value is used for result name.
1409 New GEOM.GEOM_Object, containing the created vector.
1411 # Example: see GEOM_TestAll.py
1412 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1413 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1414 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1415 anObj.SetParameters(Parameters)
1416 self._autoPublish(anObj, theName, "vector")
1419 ## Create a vector between two points.
1420 # @param thePnt1 Start point for the vector.
1421 # @param thePnt2 End point for the vector.
1422 # @param theName Object name; when specified, this parameter is used
1423 # for result publication in the study. Otherwise, if automatic
1424 # publication is switched on, default value is used for result name.
1426 # @return New GEOM.GEOM_Object, containing the created vector.
1428 # @ref tui_creation_vector "Example"
1429 def MakeVector(self, thePnt1, thePnt2, theName=None):
1431 Create a vector between two points.
1434 thePnt1 Start point for the vector.
1435 thePnt2 End point for the vector.
1436 theName Object name; when specified, this parameter is used
1437 for result publication in the study. Otherwise, if automatic
1438 publication is switched on, default value is used for result name.
1441 New GEOM.GEOM_Object, containing the created vector.
1443 # Example: see GEOM_TestAll.py
1444 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1445 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1446 self._autoPublish(anObj, theName, "vector")
1449 ## Create a line, passing through the given point
1450 # and parrallel to the given direction
1451 # @param thePnt Point. The resulting line will pass through it.
1452 # @param theDir Direction. The resulting line will be parallel to it.
1453 # @param theName Object name; when specified, this parameter is used
1454 # for result publication in the study. Otherwise, if automatic
1455 # publication is switched on, default value is used for result name.
1457 # @return New GEOM.GEOM_Object, containing the created line.
1459 # @ref tui_creation_line "Example"
1460 def MakeLine(self, thePnt, theDir, theName=None):
1462 Create a line, passing through the given point
1463 and parrallel to the given direction
1466 thePnt Point. The resulting line will pass through it.
1467 theDir Direction. The resulting line will be parallel to it.
1468 theName Object name; when specified, this parameter is used
1469 for result publication in the study. Otherwise, if automatic
1470 publication is switched on, default value is used for result name.
1473 New GEOM.GEOM_Object, containing the created line.
1475 # Example: see GEOM_TestAll.py
1476 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1477 RaiseIfFailed("MakeLine", self.BasicOp)
1478 self._autoPublish(anObj, theName, "line")
1481 ## Create a line, passing through the given points
1482 # @param thePnt1 First of two points, defining the line.
1483 # @param thePnt2 Second of two points, defining the line.
1484 # @param theName Object name; when specified, this parameter is used
1485 # for result publication in the study. Otherwise, if automatic
1486 # publication is switched on, default value is used for result name.
1488 # @return New GEOM.GEOM_Object, containing the created line.
1490 # @ref tui_creation_line "Example"
1491 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1493 Create a line, passing through the given points
1496 thePnt1 First of two points, defining the line.
1497 thePnt2 Second of two points, defining the line.
1498 theName Object name; when specified, this parameter is used
1499 for result publication in the study. Otherwise, if automatic
1500 publication is switched on, default value is used for result name.
1503 New GEOM.GEOM_Object, containing the created line.
1505 # Example: see GEOM_TestAll.py
1506 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1507 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1508 self._autoPublish(anObj, theName, "line")
1511 ## Create a line on two faces intersection.
1512 # @param theFace1 First of two faces, defining the line.
1513 # @param theFace2 Second of two faces, defining the line.
1514 # @param theName Object name; when specified, this parameter is used
1515 # for result publication in the study. Otherwise, if automatic
1516 # publication is switched on, default value is used for result name.
1518 # @return New GEOM.GEOM_Object, containing the created line.
1520 # @ref swig_MakeLineTwoFaces "Example"
1521 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1523 Create a line on two faces intersection.
1526 theFace1 First of two faces, defining the line.
1527 theFace2 Second of two faces, defining the line.
1528 theName Object name; when specified, this parameter is used
1529 for result publication in the study. Otherwise, if automatic
1530 publication is switched on, default value is used for result name.
1533 New GEOM.GEOM_Object, containing the created line.
1535 # Example: see GEOM_TestAll.py
1536 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1537 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1538 self._autoPublish(anObj, theName, "line")
1541 ## Create a plane, passing through the given point
1542 # and normal to the given vector.
1543 # @param thePnt Point, the plane has to pass through.
1544 # @param theVec Vector, defining the plane normal direction.
1545 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1546 # @param theName Object name; when specified, this parameter is used
1547 # for result publication in the study. Otherwise, if automatic
1548 # publication is switched on, default value is used for result name.
1550 # @return New GEOM.GEOM_Object, containing the created plane.
1552 # @ref tui_creation_plane "Example"
1553 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1555 Create a plane, passing through the given point
1556 and normal to the given vector.
1559 thePnt Point, the plane has to pass through.
1560 theVec Vector, defining the plane normal direction.
1561 theTrimSize Half size of a side of quadrangle face, representing the plane.
1562 theName Object name; when specified, this parameter is used
1563 for result publication in the study. Otherwise, if automatic
1564 publication is switched on, default value is used for result name.
1567 New GEOM.GEOM_Object, containing the created plane.
1569 # Example: see GEOM_TestAll.py
1570 theTrimSize, Parameters = ParseParameters(theTrimSize);
1571 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1572 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1573 anObj.SetParameters(Parameters)
1574 self._autoPublish(anObj, theName, "plane")
1577 ## Create a plane, passing through the three given points
1578 # @param thePnt1 First of three points, defining the plane.
1579 # @param thePnt2 Second of three points, defining the plane.
1580 # @param thePnt3 Fird of three points, defining the plane.
1581 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1582 # @param theName Object name; when specified, this parameter is used
1583 # for result publication in the study. Otherwise, if automatic
1584 # publication is switched on, default value is used for result name.
1586 # @return New GEOM.GEOM_Object, containing the created plane.
1588 # @ref tui_creation_plane "Example"
1589 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1591 Create a plane, passing through the three given points
1594 thePnt1 First of three points, defining the plane.
1595 thePnt2 Second of three points, defining the plane.
1596 thePnt3 Fird of three points, defining the plane.
1597 theTrimSize Half size of a side of quadrangle face, representing the plane.
1598 theName Object name; when specified, this parameter is used
1599 for result publication in the study. Otherwise, if automatic
1600 publication is switched on, default value is used for result name.
1603 New GEOM.GEOM_Object, containing the created plane.
1605 # Example: see GEOM_TestAll.py
1606 theTrimSize, Parameters = ParseParameters(theTrimSize);
1607 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1608 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1609 anObj.SetParameters(Parameters)
1610 self._autoPublish(anObj, theName, "plane")
1613 ## Create a plane, similar to the existing one, but with another size of representing face.
1614 # @param theFace Referenced plane or LCS(Marker).
1615 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1616 # @param theName Object name; when specified, this parameter is used
1617 # for result publication in the study. Otherwise, if automatic
1618 # publication is switched on, default value is used for result name.
1620 # @return New GEOM.GEOM_Object, containing the created plane.
1622 # @ref tui_creation_plane "Example"
1623 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1625 Create a plane, similar to the existing one, but with another size of representing face.
1628 theFace Referenced plane or LCS(Marker).
1629 theTrimSize New half size of a side of quadrangle face, representing the plane.
1630 theName Object name; when specified, this parameter is used
1631 for result publication in the study. Otherwise, if automatic
1632 publication is switched on, default value is used for result name.
1635 New GEOM.GEOM_Object, containing the created plane.
1637 # Example: see GEOM_TestAll.py
1638 theTrimSize, Parameters = ParseParameters(theTrimSize);
1639 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1640 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1641 anObj.SetParameters(Parameters)
1642 self._autoPublish(anObj, theName, "plane")
1645 ## Create a plane, passing through the 2 vectors
1646 # with center in a start point of the first vector.
1647 # @param theVec1 Vector, defining center point and plane direction.
1648 # @param theVec2 Vector, defining the plane normal direction.
1649 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1650 # @param theName Object name; when specified, this parameter is used
1651 # for result publication in the study. Otherwise, if automatic
1652 # publication is switched on, default value is used for result name.
1654 # @return New GEOM.GEOM_Object, containing the created plane.
1656 # @ref tui_creation_plane "Example"
1657 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1659 Create a plane, passing through the 2 vectors
1660 with center in a start point of the first vector.
1663 theVec1 Vector, defining center point and plane direction.
1664 theVec2 Vector, defining the plane normal direction.
1665 theTrimSize Half size of a side of quadrangle face, representing the plane.
1666 theName Object name; when specified, this parameter is used
1667 for result publication in the study. Otherwise, if automatic
1668 publication is switched on, default value is used for result name.
1671 New GEOM.GEOM_Object, containing the created plane.
1673 # Example: see GEOM_TestAll.py
1674 theTrimSize, Parameters = ParseParameters(theTrimSize);
1675 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1676 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1677 anObj.SetParameters(Parameters)
1678 self._autoPublish(anObj, theName, "plane")
1681 ## Create a plane, based on a Local coordinate system.
1682 # @param theLCS coordinate system, defining plane.
1683 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1684 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1685 # @param 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.
1689 # @return New GEOM.GEOM_Object, containing the created plane.
1691 # @ref tui_creation_plane "Example"
1692 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1694 Create a plane, based on a Local coordinate system.
1697 theLCS coordinate system, defining plane.
1698 theTrimSize Half size of a side of quadrangle face, representing the plane.
1699 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created plane.
1707 # Example: see GEOM_TestAll.py
1708 theTrimSize, Parameters = ParseParameters(theTrimSize);
1709 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1710 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1711 anObj.SetParameters(Parameters)
1712 self._autoPublish(anObj, theName, "plane")
1715 ## Create a local coordinate system.
1716 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1717 # @param XDX,XDY,XDZ Three components of OX direction
1718 # @param YDX,YDY,YDZ Three components of OY direction
1719 # @param 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.
1723 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1725 # @ref swig_MakeMarker "Example"
1726 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1728 Create a local coordinate system.
1731 OX,OY,OZ Three coordinates of coordinate system origin.
1732 XDX,XDY,XDZ Three components of OX direction
1733 YDX,YDY,YDZ Three components of OY direction
1734 theName Object name; when specified, this parameter is used
1735 for result publication in the study. Otherwise, if automatic
1736 publication is switched on, default value is used for result name.
1739 New GEOM.GEOM_Object, containing the created coordinate system.
1741 # Example: see GEOM_TestAll.py
1742 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1743 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1744 RaiseIfFailed("MakeMarker", self.BasicOp)
1745 anObj.SetParameters(Parameters)
1746 self._autoPublish(anObj, theName, "lcs")
1749 ## Create a local coordinate system from shape.
1750 # @param theShape The initial shape to detect the coordinate system.
1751 # @param theName Object name; when specified, this parameter is used
1752 # for result publication in the study. Otherwise, if automatic
1753 # publication is switched on, default value is used for result name.
1755 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1757 # @ref tui_creation_lcs "Example"
1758 def MakeMarkerFromShape(self, theShape, theName=None):
1760 Create a local coordinate system from shape.
1763 theShape The initial shape to detect the coordinate system.
1764 theName Object name; when specified, this parameter is used
1765 for result publication in the study. Otherwise, if automatic
1766 publication is switched on, default value is used for result name.
1769 New GEOM.GEOM_Object, containing the created coordinate system.
1771 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1772 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1773 self._autoPublish(anObj, theName, "lcs")
1776 ## Create a local coordinate system from point and two vectors.
1777 # @param theOrigin Point of coordinate system origin.
1778 # @param theXVec Vector of X direction
1779 # @param theYVec Vector of Y direction
1780 # @param theName Object name; when specified, this parameter is used
1781 # for result publication in the study. Otherwise, if automatic
1782 # publication is switched on, default value is used for result name.
1784 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1786 # @ref tui_creation_lcs "Example"
1787 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1789 Create a local coordinate system from point and two vectors.
1792 theOrigin Point of coordinate system origin.
1793 theXVec Vector of X direction
1794 theYVec Vector of Y direction
1795 theName Object name; when specified, this parameter is used
1796 for result publication in the study. Otherwise, if automatic
1797 publication is switched on, default value is used for result name.
1800 New GEOM.GEOM_Object, containing the created coordinate system.
1803 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1804 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1805 self._autoPublish(anObj, theName, "lcs")
1808 # end of l3_basic_go
1811 ## @addtogroup l4_curves
1814 ## Create an arc of circle, passing through three given points.
1815 # @param thePnt1 Start point of the arc.
1816 # @param thePnt2 Middle point of the arc.
1817 # @param thePnt3 End point of the arc.
1818 # @param theName Object name; when specified, this parameter is used
1819 # for result publication in the study. Otherwise, if automatic
1820 # publication is switched on, default value is used for result name.
1822 # @return New GEOM.GEOM_Object, containing the created arc.
1824 # @ref swig_MakeArc "Example"
1825 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1827 Create an arc of circle, passing through three given points.
1830 thePnt1 Start point of the arc.
1831 thePnt2 Middle point of the arc.
1832 thePnt3 End point of the arc.
1833 theName Object name; when specified, this parameter is used
1834 for result publication in the study. Otherwise, if automatic
1835 publication is switched on, default value is used for result name.
1838 New GEOM.GEOM_Object, containing the created arc.
1840 # Example: see GEOM_TestAll.py
1841 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1842 RaiseIfFailed("MakeArc", self.CurvesOp)
1843 self._autoPublish(anObj, theName, "arc")
1846 ## Create an arc of circle from a center and 2 points.
1847 # @param thePnt1 Center of the arc
1848 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1849 # @param thePnt3 End point of the arc (Gives also a direction)
1850 # @param theSense Orientation of the arc
1851 # @param theName Object name; when specified, this parameter is used
1852 # for result publication in the study. Otherwise, if automatic
1853 # publication is switched on, default value is used for result name.
1855 # @return New GEOM.GEOM_Object, containing the created arc.
1857 # @ref swig_MakeArc "Example"
1858 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1860 Create an arc of circle from a center and 2 points.
1863 thePnt1 Center of the arc
1864 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1865 thePnt3 End point of the arc (Gives also a direction)
1866 theSense Orientation of the arc
1867 theName Object name; when specified, this parameter is used
1868 for result publication in the study. Otherwise, if automatic
1869 publication is switched on, default value is used for result name.
1872 New GEOM.GEOM_Object, containing the created arc.
1874 # Example: see GEOM_TestAll.py
1875 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1876 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1877 self._autoPublish(anObj, theName, "arc")
1880 ## Create an arc of ellipse, of center and two points.
1881 # @param theCenter Center of the arc.
1882 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1883 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1884 # @param theName Object name; when specified, this parameter is used
1885 # for result publication in the study. Otherwise, if automatic
1886 # publication is switched on, default value is used for result name.
1888 # @return New GEOM.GEOM_Object, containing the created arc.
1890 # @ref swig_MakeArc "Example"
1891 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1893 Create an arc of ellipse, of center and two points.
1896 theCenter Center of the arc.
1897 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1898 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1899 theName Object name; when specified, this parameter is used
1900 for result publication in the study. Otherwise, if automatic
1901 publication is switched on, default value is used for result name.
1904 New GEOM.GEOM_Object, containing the created arc.
1906 # Example: see GEOM_TestAll.py
1907 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1908 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1909 self._autoPublish(anObj, theName, "arc")
1912 ## Create a circle with given center, normal vector and radius.
1913 # @param thePnt Circle center.
1914 # @param theVec Vector, normal to the plane of the circle.
1915 # @param theR Circle radius.
1916 # @param theName Object name; when specified, this parameter is used
1917 # for result publication in the study. Otherwise, if automatic
1918 # publication is switched on, default value is used for result name.
1920 # @return New GEOM.GEOM_Object, containing the created circle.
1922 # @ref tui_creation_circle "Example"
1923 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1925 Create a circle with given center, normal vector and radius.
1928 thePnt Circle center.
1929 theVec Vector, normal to the plane of the circle.
1931 theName Object name; when specified, this parameter is used
1932 for result publication in the study. Otherwise, if automatic
1933 publication is switched on, default value is used for result name.
1936 New GEOM.GEOM_Object, containing the created circle.
1938 # Example: see GEOM_TestAll.py
1939 theR, Parameters = ParseParameters(theR)
1940 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1941 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1942 anObj.SetParameters(Parameters)
1943 self._autoPublish(anObj, theName, "circle")
1946 ## Create a circle with given radius.
1947 # Center of the circle will be in the origin of global
1948 # coordinate system and normal vector will be codirected with Z axis
1949 # @param theR Circle radius.
1950 # @param 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.
1954 # @return New GEOM.GEOM_Object, containing the created circle.
1955 def MakeCircleR(self, theR, theName=None):
1957 Create a circle with given radius.
1958 Center of the circle will be in the origin of global
1959 coordinate system and normal vector will be codirected with Z axis
1963 theName Object name; when specified, this parameter is used
1964 for result publication in the study. Otherwise, if automatic
1965 publication is switched on, default value is used for result name.
1968 New GEOM.GEOM_Object, containing the created circle.
1970 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1971 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1972 self._autoPublish(anObj, theName, "circle")
1975 ## Create a circle, passing through three given points
1976 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1977 # @param theName Object name; when specified, this parameter is used
1978 # for result publication in the study. Otherwise, if automatic
1979 # publication is switched on, default value is used for result name.
1981 # @return New GEOM.GEOM_Object, containing the created circle.
1983 # @ref tui_creation_circle "Example"
1984 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1986 Create a circle, passing through three given points
1989 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1990 theName Object name; when specified, this parameter is used
1991 for result publication in the study. Otherwise, if automatic
1992 publication is switched on, default value is used for result name.
1995 New GEOM.GEOM_Object, containing the created circle.
1997 # Example: see GEOM_TestAll.py
1998 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1999 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2000 self._autoPublish(anObj, theName, "circle")
2003 ## Create a circle, with given point1 as center,
2004 # passing through the point2 as radius and laying in the plane,
2005 # defined by all three given points.
2006 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2007 # @param theName Object name; when specified, this parameter is used
2008 # for result publication in the study. Otherwise, if automatic
2009 # publication is switched on, default value is used for result name.
2011 # @return New GEOM.GEOM_Object, containing the created circle.
2013 # @ref swig_MakeCircle "Example"
2014 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2016 Create a circle, with given point1 as center,
2017 passing through the point2 as radius and laying in the plane,
2018 defined by all three given points.
2021 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2022 theName Object name; when specified, this parameter is used
2023 for result publication in the study. Otherwise, if automatic
2024 publication is switched on, default value is used for result name.
2027 New GEOM.GEOM_Object, containing the created circle.
2029 # Example: see GEOM_example6.py
2030 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2031 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2032 self._autoPublish(anObj, theName, "circle")
2035 ## Create an ellipse with given center, normal vector and radiuses.
2036 # @param thePnt Ellipse center.
2037 # @param theVec Vector, normal to the plane of the ellipse.
2038 # @param theRMajor Major ellipse radius.
2039 # @param theRMinor Minor ellipse radius.
2040 # @param theVecMaj Vector, direction of the ellipse's main axis.
2041 # @param theName Object name; when specified, this parameter is used
2042 # for result publication in the study. Otherwise, if automatic
2043 # publication is switched on, default value is used for result name.
2045 # @return New GEOM.GEOM_Object, containing the created ellipse.
2047 # @ref tui_creation_ellipse "Example"
2048 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2050 Create an ellipse with given center, normal vector and radiuses.
2053 thePnt Ellipse center.
2054 theVec Vector, normal to the plane of the ellipse.
2055 theRMajor Major ellipse radius.
2056 theRMinor Minor ellipse radius.
2057 theVecMaj Vector, direction of the ellipse's main axis.
2058 theName Object name; when specified, this parameter is used
2059 for result publication in the study. Otherwise, if automatic
2060 publication is switched on, default value is used for result name.
2063 New GEOM.GEOM_Object, containing the created ellipse.
2065 # Example: see GEOM_TestAll.py
2066 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2067 if theVecMaj is not None:
2068 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2070 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2072 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2073 anObj.SetParameters(Parameters)
2074 self._autoPublish(anObj, theName, "ellipse")
2077 ## Create an ellipse with given radiuses.
2078 # Center of the ellipse will be in the origin of global
2079 # coordinate system and normal vector will be codirected with Z axis
2080 # @param theRMajor Major ellipse radius.
2081 # @param theRMinor Minor ellipse radius.
2082 # @param theName Object name; when specified, this parameter is used
2083 # for result publication in the study. Otherwise, if automatic
2084 # publication is switched on, default value is used for result name.
2086 # @return New GEOM.GEOM_Object, containing the created ellipse.
2087 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2089 Create an ellipse with given radiuses.
2090 Center of the ellipse will be in the origin of global
2091 coordinate system and normal vector will be codirected with Z axis
2094 theRMajor Major ellipse radius.
2095 theRMinor Minor ellipse radius.
2096 theName Object name; when specified, this parameter is used
2097 for result publication in the study. Otherwise, if automatic
2098 publication is switched on, default value is used for result name.
2101 New GEOM.GEOM_Object, containing the created ellipse.
2103 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2104 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2105 self._autoPublish(anObj, theName, "ellipse")
2108 ## Create a polyline on the set of points.
2109 # @param thePoints Sequence of points for the polyline.
2110 # @param theIsClosed If True, build a closed wire.
2111 # @param theName Object name; when specified, this parameter is used
2112 # for result publication in the study. Otherwise, if automatic
2113 # publication is switched on, default value is used for result name.
2115 # @return New GEOM.GEOM_Object, containing the created polyline.
2117 # @ref tui_creation_curve "Example"
2118 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2120 Create a polyline on the set of points.
2123 thePoints Sequence of points for the polyline.
2124 theIsClosed If True, build a closed wire.
2125 theName Object name; when specified, this parameter is used
2126 for result publication in the study. Otherwise, if automatic
2127 publication is switched on, default value is used for result name.
2130 New GEOM.GEOM_Object, containing the created polyline.
2132 # Example: see GEOM_TestAll.py
2133 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2134 RaiseIfFailed("MakePolyline", self.CurvesOp)
2135 self._autoPublish(anObj, theName, "polyline")
2138 ## Create bezier curve on the set of points.
2139 # @param thePoints Sequence of points for the bezier curve.
2140 # @param theIsClosed If True, build a closed curve.
2141 # @param theName Object name; when specified, this parameter is used
2142 # for result publication in the study. Otherwise, if automatic
2143 # publication is switched on, default value is used for result name.
2145 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2147 # @ref tui_creation_curve "Example"
2148 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2150 Create bezier curve on the set of points.
2153 thePoints Sequence of points for the bezier curve.
2154 theIsClosed If True, build a closed curve.
2155 theName Object name; when specified, this parameter is used
2156 for result publication in the study. Otherwise, if automatic
2157 publication is switched on, default value is used for result name.
2160 New GEOM.GEOM_Object, containing the created bezier curve.
2162 # Example: see GEOM_TestAll.py
2163 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2164 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2165 self._autoPublish(anObj, theName, "bezier")
2168 ## Create B-Spline curve on the set of points.
2169 # @param thePoints Sequence of points for the B-Spline curve.
2170 # @param theIsClosed If True, build a closed curve.
2171 # @param theDoReordering If TRUE, the algo does not follow the order of
2172 # \a thePoints but searches for the closest vertex.
2173 # @param theName Object name; when specified, this parameter is used
2174 # for result publication in the study. Otherwise, if automatic
2175 # publication is switched on, default value is used for result name.
2177 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2179 # @ref tui_creation_curve "Example"
2180 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2182 Create B-Spline curve on the set of points.
2185 thePoints Sequence of points for the B-Spline curve.
2186 theIsClosed If True, build a closed curve.
2187 theDoReordering If True, the algo does not follow the order of
2188 thePoints but searches for the closest vertex.
2189 theName Object name; when specified, this parameter is used
2190 for result publication in the study. Otherwise, if automatic
2191 publication is switched on, default value is used for result name.
2194 New GEOM.GEOM_Object, containing the created B-Spline curve.
2196 # Example: see GEOM_TestAll.py
2197 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2198 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2199 self._autoPublish(anObj, theName, "bspline")
2202 ## Create B-Spline curve on the set of points.
2203 # @param thePoints Sequence of points for the B-Spline curve.
2204 # @param theFirstVec Vector object, defining the curve direction at its first point.
2205 # @param theLastVec Vector object, defining the curve direction at its last point.
2206 # @param theName Object name; when specified, this parameter is used
2207 # for result publication in the study. Otherwise, if automatic
2208 # publication is switched on, default value is used for result name.
2210 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2212 # @ref tui_creation_curve "Example"
2213 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2215 Create B-Spline curve on the set of points.
2218 thePoints Sequence of points for the B-Spline curve.
2219 theFirstVec Vector object, defining the curve direction at its first point.
2220 theLastVec Vector object, defining the curve direction at its last point.
2221 theName Object name; when specified, this parameter is used
2222 for result publication in the study. Otherwise, if automatic
2223 publication is switched on, default value is used for result name.
2226 New GEOM.GEOM_Object, containing the created B-Spline curve.
2228 # Example: see GEOM_TestAll.py
2229 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2230 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2231 self._autoPublish(anObj, theName, "bspline")
2234 ## Creates a curve using the parametric definition of the basic points.
2235 # @param thexExpr parametric equation of the coordinates X.
2236 # @param theyExpr parametric equation of the coordinates Y.
2237 # @param thezExpr parametric equation of the coordinates Z.
2238 # @param theParamMin the minimal value of the parameter.
2239 # @param theParamMax the maximum value of the parameter.
2240 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2241 # @param theCurveType the type of the curve.
2242 # @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.
2243 # @param theName Object name; when specified, this parameter is used
2244 # for result publication in the study. Otherwise, if automatic
2245 # publication is switched on, default value is used for result name.
2247 # @return New GEOM.GEOM_Object, containing the created curve.
2249 # @ref tui_creation_curve "Example"
2250 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2251 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2253 Creates a curve using the parametric definition of the basic points.
2256 thexExpr parametric equation of the coordinates X.
2257 theyExpr parametric equation of the coordinates Y.
2258 thezExpr parametric equation of the coordinates Z.
2259 theParamMin the minimal value of the parameter.
2260 theParamMax the maximum value of the parameter.
2261 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2262 theCurveType the type of the curve.
2263 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2264 method is used which can lead to a bug.
2265 theName Object name; when specified, this parameter is used
2266 for result publication in the study. Otherwise, if automatic
2267 publication is switched on, default value is used for result name.
2270 New GEOM.GEOM_Object, containing the created curve.
2272 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2274 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2276 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2277 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2278 anObj.SetParameters(Parameters)
2279 self._autoPublish(anObj, theName, "curve")
2285 ## @addtogroup l3_sketcher
2288 ## Create a sketcher (wire or face), following the textual description,
2289 # passed through <VAR>theCommand</VAR> argument. \n
2290 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2291 # Format of the description string have to be the following:
2293 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2296 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2298 # - "R angle" : Set the direction by angle
2299 # - "D dx dy" : Set the direction by DX & DY
2302 # - "TT x y" : Create segment by point at X & Y
2303 # - "T dx dy" : Create segment by point with DX & DY
2304 # - "L length" : Create segment by direction & Length
2305 # - "IX x" : Create segment by direction & Intersect. X
2306 # - "IY y" : Create segment by direction & Intersect. Y
2309 # - "C radius length" : Create arc by direction, radius and length(in degree)
2310 # - "AA x y": Create arc by point at X & Y
2311 # - "A dx dy" : Create arc by point with DX & DY
2312 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2313 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2314 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2315 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2318 # - "WW" : Close Wire (to finish)
2319 # - "WF" : Close Wire and build face (to finish)
2322 # - Flag1 (= reverse) is 0 or 2 ...
2323 # - if 0 the drawn arc is the one of lower angle (< Pi)
2324 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2327 # - Flag2 (= control tolerance) is 0 or 1 ...
2328 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2329 # - if 1 the wire is built only if the end point is on the arc
2330 # with a tolerance of 10^-7 on the distance else the creation fails
2332 # @param theCommand String, defining the sketcher in local
2333 # coordinates of the working plane.
2334 # @param theWorkingPlane Nine double values, defining origin,
2335 # OZ and OX directions of the working plane.
2336 # @param theName Object name; when specified, this parameter is used
2337 # for result publication in the study. Otherwise, if automatic
2338 # publication is switched on, default value is used for result name.
2340 # @return New GEOM.GEOM_Object, containing the created wire.
2342 # @ref tui_sketcher_page "Example"
2343 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2345 Create a sketcher (wire or face), following the textual description, passed
2346 through theCommand argument.
2347 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2348 Format of the description string have to be the following:
2349 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2351 - x1, y1 are coordinates of the first sketcher point (zero by default),
2353 - "R angle" : Set the direction by angle
2354 - "D dx dy" : Set the direction by DX & DY
2356 - "TT x y" : Create segment by point at X & Y
2357 - "T dx dy" : Create segment by point with DX & DY
2358 - "L length" : Create segment by direction & Length
2359 - "IX x" : Create segment by direction & Intersect. X
2360 - "IY y" : Create segment by direction & Intersect. Y
2362 - "C radius length" : Create arc by direction, radius and length(in degree)
2363 - "AA x y": Create arc by point at X & Y
2364 - "A dx dy" : Create arc by point with DX & DY
2365 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2366 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2367 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2368 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2370 - "WW" : Close Wire (to finish)
2371 - "WF" : Close Wire and build face (to finish)
2373 - Flag1 (= reverse) is 0 or 2 ...
2374 - if 0 the drawn arc is the one of lower angle (< Pi)
2375 - if 2 the drawn arc ius the one of greater angle (> Pi)
2377 - Flag2 (= control tolerance) is 0 or 1 ...
2378 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2379 - if 1 the wire is built only if the end point is on the arc
2380 with a tolerance of 10^-7 on the distance else the creation fails
2383 theCommand String, defining the sketcher in local
2384 coordinates of the working plane.
2385 theWorkingPlane Nine double values, defining origin,
2386 OZ and OX directions of the working plane.
2387 theName Object name; when specified, this parameter is used
2388 for result publication in the study. Otherwise, if automatic
2389 publication is switched on, default value is used for result name.
2392 New GEOM.GEOM_Object, containing the created wire.
2394 # Example: see GEOM_TestAll.py
2395 theCommand,Parameters = ParseSketcherCommand(theCommand)
2396 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2397 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2398 anObj.SetParameters(Parameters)
2399 self._autoPublish(anObj, theName, "wire")
2402 ## Create a sketcher (wire or face), following the textual description,
2403 # passed through <VAR>theCommand</VAR> argument. \n
2404 # For format of the description string see MakeSketcher() method.\n
2405 # @param theCommand String, defining the sketcher in local
2406 # coordinates of the working plane.
2407 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2408 # @param theName Object name; when specified, this parameter is used
2409 # for result publication in the study. Otherwise, if automatic
2410 # publication is switched on, default value is used for result name.
2412 # @return New GEOM.GEOM_Object, containing the created wire.
2414 # @ref tui_sketcher_page "Example"
2415 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2417 Create a sketcher (wire or face), following the textual description,
2418 passed through theCommand argument.
2419 For format of the description string see geompy.MakeSketcher() method.
2422 theCommand String, defining the sketcher in local
2423 coordinates of the working plane.
2424 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2425 theName Object name; when specified, this parameter is used
2426 for result publication in the study. Otherwise, if automatic
2427 publication is switched on, default value is used for result name.
2430 New GEOM.GEOM_Object, containing the created wire.
2432 theCommand,Parameters = ParseSketcherCommand(theCommand)
2433 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2434 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2435 anObj.SetParameters(Parameters)
2436 self._autoPublish(anObj, theName, "wire")
2439 ## Obtain a 2D sketcher interface
2440 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2441 def Sketcher2D (self):
2443 Obtain a 2D sketcher interface.
2446 sk = geompy.Sketcher2D()
2448 sk.addSegmentRelative(15, 70)
2449 sk.addSegmentPerpY(50)
2450 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2451 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2452 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2454 Sketch_1 = sk.wire(geomObj_1)
2456 sk = Sketcher2D (self)
2459 ## Create a sketcher wire, following the numerical description,
2460 # passed through <VAR>theCoordinates</VAR> argument. \n
2461 # @param theCoordinates double values, defining points to create a wire,
2463 # @param theName Object name; when specified, this parameter is used
2464 # for result publication in the study. Otherwise, if automatic
2465 # publication is switched on, default value is used for result name.
2467 # @return New GEOM.GEOM_Object, containing the created wire.
2469 # @ref tui_3dsketcher_page "Example"
2470 def Make3DSketcher(self, theCoordinates, theName=None):
2472 Create a sketcher wire, following the numerical description,
2473 passed through theCoordinates argument.
2476 theCoordinates double values, defining points to create a wire,
2478 theName Object name; when specified, this parameter is used
2479 for result publication in the study. Otherwise, if automatic
2480 publication is switched on, default value is used for result name.
2483 New GEOM_Object, containing the created wire.
2485 theCoordinates,Parameters = ParseParameters(theCoordinates)
2486 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2487 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2488 anObj.SetParameters(Parameters)
2489 self._autoPublish(anObj, theName, "wire")
2492 ## Obtain a 3D sketcher interface
2493 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2495 # @ref tui_3dsketcher_page "Example"
2496 def Sketcher3D (self):
2498 Obtain a 3D sketcher interface.
2501 sk = geompy.Sketcher3D()
2502 sk.addPointsAbsolute(0,0,0, 70,0,0)
2503 sk.addPointsRelative(0, 0, 130)
2504 sk.addPointAnglesLength("OXY", 50, 0, 100)
2505 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2507 a3D_Sketcher_1 = sk.wire()
2509 sk = Sketcher3D (self)
2512 # end of l3_sketcher
2515 ## @addtogroup l3_3d_primitives
2518 ## Create a box by coordinates of two opposite vertices.
2520 # @param x1,y1,z1 double values, defining first point it.
2521 # @param x2,y2,z2 double values, defining first point it.
2522 # @param theName Object name; when specified, this parameter is used
2523 # for result publication in the study. Otherwise, if automatic
2524 # publication is switched on, default value is used for result name.
2526 # @return New GEOM.GEOM_Object, containing the created box.
2528 # @ref tui_creation_box "Example"
2529 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2531 Create a box by coordinates of two opposite vertices.
2534 x1,y1,z1 double values, defining first point.
2535 x2,y2,z2 double values, defining second point.
2536 theName Object name; when specified, this parameter is used
2537 for result publication in the study. Otherwise, if automatic
2538 publication is switched on, default value is used for result name.
2541 New GEOM.GEOM_Object, containing the created box.
2543 # Example: see GEOM_TestAll.py
2544 pnt1 = self.MakeVertex(x1,y1,z1)
2545 pnt2 = self.MakeVertex(x2,y2,z2)
2546 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2547 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2549 ## Create a box with specified dimensions along the coordinate axes
2550 # and with edges, parallel to the coordinate axes.
2551 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2552 # @param theDX Length of Box edges, parallel to OX axis.
2553 # @param theDY Length of Box edges, parallel to OY axis.
2554 # @param theDZ Length of Box edges, parallel to OZ axis.
2555 # @param theName Object name; when specified, this parameter is used
2556 # for result publication in the study. Otherwise, if automatic
2557 # publication is switched on, default value is used for result name.
2559 # @return New GEOM.GEOM_Object, containing the created box.
2561 # @ref tui_creation_box "Example"
2562 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2564 Create a box with specified dimensions along the coordinate axes
2565 and with edges, parallel to the coordinate axes.
2566 Center of the box will be at point (DX/2, DY/2, DZ/2).
2569 theDX Length of Box edges, parallel to OX axis.
2570 theDY Length of Box edges, parallel to OY axis.
2571 theDZ Length of Box edges, parallel to OZ axis.
2572 theName Object name; when specified, this parameter is used
2573 for result publication in the study. Otherwise, if automatic
2574 publication is switched on, default value is used for result name.
2577 New GEOM.GEOM_Object, containing the created box.
2579 # Example: see GEOM_TestAll.py
2580 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2581 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2582 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2583 anObj.SetParameters(Parameters)
2584 self._autoPublish(anObj, theName, "box")
2587 ## Create a box with two specified opposite vertices,
2588 # and with edges, parallel to the coordinate axes
2589 # @param thePnt1 First of two opposite vertices.
2590 # @param thePnt2 Second of two opposite vertices.
2591 # @param theName Object name; when specified, this parameter is used
2592 # for result publication in the study. Otherwise, if automatic
2593 # publication is switched on, default value is used for result name.
2595 # @return New GEOM.GEOM_Object, containing the created box.
2597 # @ref tui_creation_box "Example"
2598 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2600 Create a box with two specified opposite vertices,
2601 and with edges, parallel to the coordinate axes
2604 thePnt1 First of two opposite vertices.
2605 thePnt2 Second of two opposite vertices.
2606 theName Object name; when specified, this parameter is used
2607 for result publication in the study. Otherwise, if automatic
2608 publication is switched on, default value is used for result name.
2611 New GEOM.GEOM_Object, containing the created box.
2613 # Example: see GEOM_TestAll.py
2614 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2615 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2616 self._autoPublish(anObj, theName, "box")
2619 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2620 # @param theH height of Face.
2621 # @param theW width of Face.
2622 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2623 # @param theName Object name; when specified, this parameter is used
2624 # for result publication in the study. Otherwise, if automatic
2625 # publication is switched on, default value is used for result name.
2627 # @return New GEOM.GEOM_Object, containing the created face.
2629 # @ref tui_creation_face "Example"
2630 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2632 Create a face with specified dimensions with edges parallel to coordinate axes.
2635 theH height of Face.
2637 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2638 theName Object name; when specified, this parameter is used
2639 for result publication in the study. Otherwise, if automatic
2640 publication is switched on, default value is used for result name.
2643 New GEOM.GEOM_Object, containing the created face.
2645 # Example: see GEOM_TestAll.py
2646 theH,theW,Parameters = ParseParameters(theH, theW)
2647 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2648 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2649 anObj.SetParameters(Parameters)
2650 self._autoPublish(anObj, theName, "rectangle")
2653 ## Create a face from another plane and two sizes,
2654 # vertical size and horisontal size.
2655 # @param theObj Normale vector to the creating face or
2657 # @param theH Height (vertical size).
2658 # @param theW Width (horisontal size).
2659 # @param theName Object name; when specified, this parameter is used
2660 # for result publication in the study. Otherwise, if automatic
2661 # publication is switched on, default value is used for result name.
2663 # @return New GEOM.GEOM_Object, containing the created face.
2665 # @ref tui_creation_face "Example"
2666 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2668 Create a face from another plane and two sizes,
2669 vertical size and horisontal size.
2672 theObj Normale vector to the creating face or
2674 theH Height (vertical size).
2675 theW Width (horisontal size).
2676 theName Object name; when specified, this parameter is used
2677 for result publication in the study. Otherwise, if automatic
2678 publication is switched on, default value is used for result name.
2681 New GEOM_Object, containing the created face.
2683 # Example: see GEOM_TestAll.py
2684 theH,theW,Parameters = ParseParameters(theH, theW)
2685 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2686 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2687 anObj.SetParameters(Parameters)
2688 self._autoPublish(anObj, theName, "rectangle")
2691 ## Create a disk with given center, normal vector and radius.
2692 # @param thePnt Disk center.
2693 # @param theVec Vector, normal to the plane of the disk.
2694 # @param theR Disk radius.
2695 # @param theName Object name; when specified, this parameter is used
2696 # for result publication in the study. Otherwise, if automatic
2697 # publication is switched on, default value is used for result name.
2699 # @return New GEOM.GEOM_Object, containing the created disk.
2701 # @ref tui_creation_disk "Example"
2702 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2704 Create a disk with given center, normal vector and radius.
2708 theVec Vector, normal to the plane of the disk.
2710 theName Object name; when specified, this parameter is used
2711 for result publication in the study. Otherwise, if automatic
2712 publication is switched on, default value is used for result name.
2715 New GEOM.GEOM_Object, containing the created disk.
2717 # Example: see GEOM_TestAll.py
2718 theR,Parameters = ParseParameters(theR)
2719 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2720 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2721 anObj.SetParameters(Parameters)
2722 self._autoPublish(anObj, theName, "disk")
2725 ## Create a disk, passing through three given points
2726 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2727 # @param theName Object name; when specified, this parameter is used
2728 # for result publication in the study. Otherwise, if automatic
2729 # publication is switched on, default value is used for result name.
2731 # @return New GEOM.GEOM_Object, containing the created disk.
2733 # @ref tui_creation_disk "Example"
2734 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2736 Create a disk, passing through three given points
2739 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2740 theName Object name; when specified, this parameter is used
2741 for result publication in the study. Otherwise, if automatic
2742 publication is switched on, default value is used for result name.
2745 New GEOM.GEOM_Object, containing the created disk.
2747 # Example: see GEOM_TestAll.py
2748 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2749 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2750 self._autoPublish(anObj, theName, "disk")
2753 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2754 # @param theR Radius of Face.
2755 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2756 # @param theName Object name; when specified, this parameter is used
2757 # for result publication in the study. Otherwise, if automatic
2758 # publication is switched on, default value is used for result name.
2760 # @return New GEOM.GEOM_Object, containing the created disk.
2762 # @ref tui_creation_face "Example"
2763 def MakeDiskR(self, theR, theOrientation, theName=None):
2765 Create a disk with specified dimensions along OX-OY coordinate axes.
2768 theR Radius of Face.
2769 theOrientation set the orientation belong axis OXY or OYZ or OZX
2770 theName Object name; when specified, this parameter is used
2771 for result publication in the study. Otherwise, if automatic
2772 publication is switched on, default value is used for result name.
2775 New GEOM.GEOM_Object, containing the created disk.
2778 Disk3 = geompy.MakeDiskR(100., 1)
2780 # Example: see GEOM_TestAll.py
2781 theR,Parameters = ParseParameters(theR)
2782 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2783 RaiseIfFailed("MakeDiskR", self.PrimOp)
2784 anObj.SetParameters(Parameters)
2785 self._autoPublish(anObj, theName, "disk")
2788 ## Create a cylinder with given base point, axis, radius and height.
2789 # @param thePnt Central point of cylinder base.
2790 # @param theAxis Cylinder axis.
2791 # @param theR Cylinder radius.
2792 # @param theH Cylinder height.
2793 # @param theName Object name; when specified, this parameter is used
2794 # for result publication in the study. Otherwise, if automatic
2795 # publication is switched on, default value is used for result name.
2797 # @return New GEOM.GEOM_Object, containing the created cylinder.
2799 # @ref tui_creation_cylinder "Example"
2800 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2802 Create a cylinder with given base point, axis, radius and height.
2805 thePnt Central point of cylinder base.
2806 theAxis Cylinder axis.
2807 theR Cylinder radius.
2808 theH Cylinder height.
2809 theName Object name; when specified, this parameter is used
2810 for result publication in the study. Otherwise, if automatic
2811 publication is switched on, default value is used for result name.
2814 New GEOM.GEOM_Object, containing the created cylinder.
2816 # Example: see GEOM_TestAll.py
2817 theR,theH,Parameters = ParseParameters(theR, theH)
2818 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2819 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2820 anObj.SetParameters(Parameters)
2821 self._autoPublish(anObj, theName, "cylinder")
2824 ## Create a cylinder with given radius and height at
2825 # the origin of coordinate system. Axis of the cylinder
2826 # will be collinear to the OZ axis of the coordinate system.
2827 # @param theR Cylinder radius.
2828 # @param theH Cylinder height.
2829 # @param theName Object name; when specified, this parameter is used
2830 # for result publication in the study. Otherwise, if automatic
2831 # publication is switched on, default value is used for result name.
2833 # @return New GEOM.GEOM_Object, containing the created cylinder.
2835 # @ref tui_creation_cylinder "Example"
2836 def MakeCylinderRH(self, theR, theH, theName=None):
2838 Create a cylinder with given radius and height at
2839 the origin of coordinate system. Axis of the cylinder
2840 will be collinear to the OZ axis of the coordinate system.
2843 theR Cylinder radius.
2844 theH Cylinder height.
2845 theName Object name; when specified, this parameter is used
2846 for result publication in the study. Otherwise, if automatic
2847 publication is switched on, default value is used for result name.
2850 New GEOM.GEOM_Object, containing the created cylinder.
2852 # Example: see GEOM_TestAll.py
2853 theR,theH,Parameters = ParseParameters(theR, theH)
2854 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2855 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2856 anObj.SetParameters(Parameters)
2857 self._autoPublish(anObj, theName, "cylinder")
2860 ## Create a sphere with given center and radius.
2861 # @param thePnt Sphere center.
2862 # @param theR Sphere radius.
2863 # @param theName Object name; when specified, this parameter is used
2864 # for result publication in the study. Otherwise, if automatic
2865 # publication is switched on, default value is used for result name.
2867 # @return New GEOM.GEOM_Object, containing the created sphere.
2869 # @ref tui_creation_sphere "Example"
2870 def MakeSpherePntR(self, thePnt, theR, theName=None):
2872 Create a sphere with given center and radius.
2875 thePnt Sphere center.
2877 theName Object name; when specified, this parameter is used
2878 for result publication in the study. Otherwise, if automatic
2879 publication is switched on, default value is used for result name.
2882 New GEOM.GEOM_Object, containing the created sphere.
2884 # Example: see GEOM_TestAll.py
2885 theR,Parameters = ParseParameters(theR)
2886 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2887 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2888 anObj.SetParameters(Parameters)
2889 self._autoPublish(anObj, theName, "sphere")
2892 ## Create a sphere with given center and radius.
2893 # @param x,y,z Coordinates of sphere center.
2894 # @param theR Sphere radius.
2895 # @param theName Object name; when specified, this parameter is used
2896 # for result publication in the study. Otherwise, if automatic
2897 # publication is switched on, default value is used for result name.
2899 # @return New GEOM.GEOM_Object, containing the created sphere.
2901 # @ref tui_creation_sphere "Example"
2902 def MakeSphere(self, x, y, z, theR, theName=None):
2904 Create a sphere with given center and radius.
2907 x,y,z Coordinates of sphere center.
2909 theName Object name; when specified, this parameter is used
2910 for result publication in the study. Otherwise, if automatic
2911 publication is switched on, default value is used for result name.
2914 New GEOM.GEOM_Object, containing the created sphere.
2916 # Example: see GEOM_TestAll.py
2917 point = self.MakeVertex(x, y, z)
2918 # note: auto-publishing is done in self.MakeSpherePntR()
2919 anObj = self.MakeSpherePntR(point, theR, theName)
2922 ## Create a sphere with given radius at the origin of coordinate system.
2923 # @param theR Sphere radius.
2924 # @param theName Object name; when specified, this parameter is used
2925 # for result publication in the study. Otherwise, if automatic
2926 # publication is switched on, default value is used for result name.
2928 # @return New GEOM.GEOM_Object, containing the created sphere.
2930 # @ref tui_creation_sphere "Example"
2931 def MakeSphereR(self, theR, theName=None):
2933 Create a sphere with given radius at the origin of coordinate system.
2937 theName Object name; when specified, this parameter is used
2938 for result publication in the study. Otherwise, if automatic
2939 publication is switched on, default value is used for result name.
2942 New GEOM.GEOM_Object, containing the created sphere.
2944 # Example: see GEOM_TestAll.py
2945 theR,Parameters = ParseParameters(theR)
2946 anObj = self.PrimOp.MakeSphereR(theR)
2947 RaiseIfFailed("MakeSphereR", self.PrimOp)
2948 anObj.SetParameters(Parameters)
2949 self._autoPublish(anObj, theName, "sphere")
2952 ## Create a cone with given base point, axis, height and radiuses.
2953 # @param thePnt Central point of the first cone base.
2954 # @param theAxis Cone axis.
2955 # @param theR1 Radius of the first cone base.
2956 # @param theR2 Radius of the second cone base.
2957 # \note If both radiuses are non-zero, the cone will be truncated.
2958 # \note If the radiuses are equal, a cylinder will be created instead.
2959 # @param theH Cone height.
2960 # @param theName Object name; when specified, this parameter is used
2961 # for result publication in the study. Otherwise, if automatic
2962 # publication is switched on, default value is used for result name.
2964 # @return New GEOM.GEOM_Object, containing the created cone.
2966 # @ref tui_creation_cone "Example"
2967 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2969 Create a cone with given base point, axis, height and radiuses.
2972 thePnt Central point of the first cone base.
2974 theR1 Radius of the first cone base.
2975 theR2 Radius of the second cone base.
2977 theName Object name; when specified, this parameter is used
2978 for result publication in the study. Otherwise, if automatic
2979 publication is switched on, default value is used for result name.
2982 If both radiuses are non-zero, the cone will be truncated.
2983 If the radiuses are equal, a cylinder will be created instead.
2986 New GEOM.GEOM_Object, containing the created cone.
2988 # Example: see GEOM_TestAll.py
2989 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2990 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2991 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2992 anObj.SetParameters(Parameters)
2993 self._autoPublish(anObj, theName, "cone")
2996 ## Create a cone with given height and radiuses at
2997 # the origin of coordinate system. Axis of the cone will
2998 # be collinear to the OZ axis of the coordinate system.
2999 # @param theR1 Radius of the first cone base.
3000 # @param theR2 Radius of the second cone base.
3001 # \note If both radiuses are non-zero, the cone will be truncated.
3002 # \note If the radiuses are equal, a cylinder will be created instead.
3003 # @param theH Cone height.
3004 # @param theName Object name; when specified, this parameter is used
3005 # for result publication in the study. Otherwise, if automatic
3006 # publication is switched on, default value is used for result name.
3008 # @return New GEOM.GEOM_Object, containing the created cone.
3010 # @ref tui_creation_cone "Example"
3011 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3013 Create a cone with given height and radiuses at
3014 the origin of coordinate system. Axis of the cone will
3015 be collinear to the OZ axis of the coordinate system.
3018 theR1 Radius of the first cone base.
3019 theR2 Radius of the second cone base.
3021 theName Object name; when specified, this parameter is used
3022 for result publication in the study. Otherwise, if automatic
3023 publication is switched on, default value is used for result name.
3026 If both radiuses are non-zero, the cone will be truncated.
3027 If the radiuses are equal, a cylinder will be created instead.
3030 New GEOM.GEOM_Object, containing the created cone.
3032 # Example: see GEOM_TestAll.py
3033 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3034 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3035 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3036 anObj.SetParameters(Parameters)
3037 self._autoPublish(anObj, theName, "cone")
3040 ## Create a torus with given center, normal vector and radiuses.
3041 # @param thePnt Torus central point.
3042 # @param theVec Torus axis of symmetry.
3043 # @param theRMajor Torus major radius.
3044 # @param theRMinor Torus minor radius.
3045 # @param theName Object name; when specified, this parameter is used
3046 # for result publication in the study. Otherwise, if automatic
3047 # publication is switched on, default value is used for result name.
3049 # @return New GEOM.GEOM_Object, containing the created torus.
3051 # @ref tui_creation_torus "Example"
3052 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3054 Create a torus with given center, normal vector and radiuses.
3057 thePnt Torus central point.
3058 theVec Torus axis of symmetry.
3059 theRMajor Torus major radius.
3060 theRMinor Torus minor radius.
3061 theName Object name; when specified, this parameter is used
3062 for result publication in the study. Otherwise, if automatic
3063 publication is switched on, default value is used for result name.
3066 New GEOM.GEOM_Object, containing the created torus.
3068 # Example: see GEOM_TestAll.py
3069 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3070 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3071 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3072 anObj.SetParameters(Parameters)
3073 self._autoPublish(anObj, theName, "torus")
3076 ## Create a torus with given radiuses at the origin of coordinate system.
3077 # @param theRMajor Torus major radius.
3078 # @param theRMinor Torus minor radius.
3079 # @param theName Object name; when specified, this parameter is used
3080 # for result publication in the study. Otherwise, if automatic
3081 # publication is switched on, default value is used for result name.
3083 # @return New GEOM.GEOM_Object, containing the created torus.
3085 # @ref tui_creation_torus "Example"
3086 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3088 Create a torus with given radiuses at the origin of coordinate system.
3091 theRMajor Torus major radius.
3092 theRMinor Torus minor radius.
3093 theName Object name; when specified, this parameter is used
3094 for result publication in the study. Otherwise, if automatic
3095 publication is switched on, default value is used for result name.
3098 New GEOM.GEOM_Object, containing the created torus.
3100 # Example: see GEOM_TestAll.py
3101 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3102 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3103 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3104 anObj.SetParameters(Parameters)
3105 self._autoPublish(anObj, theName, "torus")
3108 # end of l3_3d_primitives
3111 ## @addtogroup l3_complex
3114 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3115 # @param theBase Base shape to be extruded.
3116 # @param thePoint1 First end of extrusion vector.
3117 # @param thePoint2 Second end of extrusion vector.
3118 # @param theScaleFactor Use it to make prism with scaled second base.
3119 # Nagative value means not scaled second base.
3120 # @param theName Object name; when specified, this parameter is used
3121 # for result publication in the study. Otherwise, if automatic
3122 # publication is switched on, default value is used for result name.
3124 # @return New GEOM.GEOM_Object, containing the created prism.
3126 # @ref tui_creation_prism "Example"
3127 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3129 Create a shape by extrusion of the base shape along a vector, defined by two points.
3132 theBase Base shape to be extruded.
3133 thePoint1 First end of extrusion vector.
3134 thePoint2 Second end of extrusion vector.
3135 theScaleFactor Use it to make prism with scaled second base.
3136 Nagative value means not scaled second base.
3137 theName Object name; when specified, this parameter is used
3138 for result publication in the study. Otherwise, if automatic
3139 publication is switched on, default value is used for result name.
3142 New GEOM.GEOM_Object, containing the created prism.
3144 # Example: see GEOM_TestAll.py
3147 if theScaleFactor > 0:
3148 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3149 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3151 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3152 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3153 anObj.SetParameters(Parameters)
3154 self._autoPublish(anObj, theName, "prism")
3157 ## Create a shape by extrusion of the base shape along a
3158 # vector, defined by two points, in 2 Ways (forward/backward).
3159 # @param theBase Base shape to be extruded.
3160 # @param thePoint1 First end of extrusion vector.
3161 # @param thePoint2 Second end of extrusion vector.
3162 # @param theName Object name; when specified, this parameter is used
3163 # for result publication in the study. Otherwise, if automatic
3164 # publication is switched on, default value is used for result name.
3166 # @return New GEOM.GEOM_Object, containing the created prism.
3168 # @ref tui_creation_prism "Example"
3169 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3171 Create a shape by extrusion of the base shape along a
3172 vector, defined by two points, in 2 Ways (forward/backward).
3175 theBase Base shape to be extruded.
3176 thePoint1 First end of extrusion vector.
3177 thePoint2 Second end of extrusion vector.
3178 theName Object name; when specified, this parameter is used
3179 for result publication in the study. Otherwise, if automatic
3180 publication is switched on, default value is used for result name.
3183 New GEOM.GEOM_Object, containing the created prism.
3185 # Example: see GEOM_TestAll.py
3186 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3187 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3188 self._autoPublish(anObj, theName, "prism")
3191 ## Create a shape by extrusion of the base shape along the vector,
3192 # i.e. all the space, transfixed by the base shape during its translation
3193 # along the vector on the given distance.
3194 # @param theBase Base shape to be extruded.
3195 # @param theVec Direction of extrusion.
3196 # @param theH Prism dimension along theVec.
3197 # @param theScaleFactor Use it to make prism with scaled second base.
3198 # Negative value means not scaled second base.
3199 # @param 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.
3203 # @return New GEOM.GEOM_Object, containing the created prism.
3205 # @ref tui_creation_prism "Example"
3206 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3208 Create a shape by extrusion of the base shape along the vector,
3209 i.e. all the space, transfixed by the base shape during its translation
3210 along the vector on the given distance.
3213 theBase Base shape to be extruded.
3214 theVec Direction of extrusion.
3215 theH Prism dimension along theVec.
3216 theScaleFactor Use it to make prism with scaled second base.
3217 Negative value means not scaled second base.
3218 theName Object name; when specified, this parameter is used
3219 for result publication in the study. Otherwise, if automatic
3220 publication is switched on, default value is used for result name.
3223 New GEOM.GEOM_Object, containing the created prism.
3225 # Example: see GEOM_TestAll.py
3228 if theScaleFactor > 0:
3229 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3230 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3232 theH,Parameters = ParseParameters(theH)
3233 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3234 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "prism")
3239 ## Create a shape by extrusion of the base shape along the vector,
3240 # i.e. all the space, transfixed by the base shape during its translation
3241 # along the vector on the given distance in 2 Ways (forward/backward).
3242 # @param theBase Base shape to be extruded.
3243 # @param theVec Direction of extrusion.
3244 # @param theH Prism dimension along theVec in forward direction.
3245 # @param theName Object name; when specified, this parameter is used
3246 # for result publication in the study. Otherwise, if automatic
3247 # publication is switched on, default value is used for result name.
3249 # @return New GEOM.GEOM_Object, containing the created prism.
3251 # @ref tui_creation_prism "Example"
3252 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3254 Create a shape by extrusion of the base shape along the vector,
3255 i.e. all the space, transfixed by the base shape during its translation
3256 along the vector on the given distance in 2 Ways (forward/backward).
3259 theBase Base shape to be extruded.
3260 theVec Direction of extrusion.
3261 theH Prism dimension along theVec in forward direction.
3262 theName Object name; when specified, this parameter is used
3263 for result publication in the study. Otherwise, if automatic
3264 publication is switched on, default value is used for result name.
3267 New GEOM.GEOM_Object, containing the created prism.
3269 # Example: see GEOM_TestAll.py
3270 theH,Parameters = ParseParameters(theH)
3271 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3272 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3273 anObj.SetParameters(Parameters)
3274 self._autoPublish(anObj, theName, "prism")
3277 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3278 # @param theBase Base shape to be extruded.
3279 # @param theDX, theDY, theDZ Directions of extrusion.
3280 # @param theScaleFactor Use it to make prism with scaled second base.
3281 # Nagative value means not scaled second base.
3282 # @param theName Object name; when specified, this parameter is used
3283 # for result publication in the study. Otherwise, if automatic
3284 # publication is switched on, default value is used for result name.
3286 # @return New GEOM.GEOM_Object, containing the created prism.
3288 # @ref tui_creation_prism "Example"
3289 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3291 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3294 theBase Base shape to be extruded.
3295 theDX, theDY, theDZ Directions of extrusion.
3296 theScaleFactor Use it to make prism with scaled second base.
3297 Nagative value means not scaled second base.
3298 theName Object name; when specified, this parameter is used
3299 for result publication in the study. Otherwise, if automatic
3300 publication is switched on, default value is used for result name.
3303 New GEOM.GEOM_Object, containing the created prism.
3305 # Example: see GEOM_TestAll.py
3308 if theScaleFactor > 0:
3309 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3310 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3312 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3313 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3314 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3315 anObj.SetParameters(Parameters)
3316 self._autoPublish(anObj, theName, "prism")
3319 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3320 # i.e. all the space, transfixed by the base shape during its translation
3321 # along the vector on the given distance in 2 Ways (forward/backward).
3322 # @param theBase Base shape to be extruded.
3323 # @param theDX, theDY, theDZ Directions of extrusion.
3324 # @param 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.
3328 # @return New GEOM.GEOM_Object, containing the created prism.
3330 # @ref tui_creation_prism "Example"
3331 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3333 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3334 i.e. all the space, transfixed by the base shape during its translation
3335 along the vector on the given distance in 2 Ways (forward/backward).
3338 theBase Base shape to be extruded.
3339 theDX, theDY, theDZ Directions of extrusion.
3340 theName Object name; when specified, this parameter is used
3341 for result publication in the study. Otherwise, if automatic
3342 publication is switched on, default value is used for result name.
3345 New GEOM.GEOM_Object, containing the created prism.
3347 # Example: see GEOM_TestAll.py
3348 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3349 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3350 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3351 anObj.SetParameters(Parameters)
3352 self._autoPublish(anObj, theName, "prism")
3355 ## Create a shape by revolution of the base shape around the axis
3356 # on the given angle, i.e. all the space, transfixed by the base
3357 # shape during its rotation around the axis on the given angle.
3358 # @param theBase Base shape to be rotated.
3359 # @param theAxis Rotation axis.
3360 # @param theAngle Rotation angle in radians.
3361 # @param theName Object name; when specified, this parameter is used
3362 # for result publication in the study. Otherwise, if automatic
3363 # publication is switched on, default value is used for result name.
3365 # @return New GEOM.GEOM_Object, containing the created revolution.
3367 # @ref tui_creation_revolution "Example"
3368 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3370 Create a shape by revolution of the base shape around the axis
3371 on the given angle, i.e. all the space, transfixed by the base
3372 shape during its rotation around the axis on the given angle.
3375 theBase Base shape to be rotated.
3376 theAxis Rotation axis.
3377 theAngle Rotation angle in radians.
3378 theName Object name; when specified, this parameter is used
3379 for result publication in the study. Otherwise, if automatic
3380 publication is switched on, default value is used for result name.
3383 New GEOM.GEOM_Object, containing the created revolution.
3385 # Example: see GEOM_TestAll.py
3386 theAngle,Parameters = ParseParameters(theAngle)
3387 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3388 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3389 anObj.SetParameters(Parameters)
3390 self._autoPublish(anObj, theName, "revolution")
3393 ## Create a shape by revolution of the base shape around the axis
3394 # on the given angle, i.e. all the space, transfixed by the base
3395 # shape during its rotation around the axis on the given angle in
3396 # both directions (forward/backward)
3397 # @param theBase Base shape to be rotated.
3398 # @param theAxis Rotation axis.
3399 # @param theAngle Rotation angle in radians.
3400 # @param theName Object name; when specified, this parameter is used
3401 # for result publication in the study. Otherwise, if automatic
3402 # publication is switched on, default value is used for result name.
3404 # @return New GEOM.GEOM_Object, containing the created revolution.
3406 # @ref tui_creation_revolution "Example"
3407 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3409 Create a shape by revolution of the base shape around the axis
3410 on the given angle, i.e. all the space, transfixed by the base
3411 shape during its rotation around the axis on the given angle in
3412 both directions (forward/backward).
3415 theBase Base shape to be rotated.
3416 theAxis Rotation axis.
3417 theAngle Rotation angle in radians.
3418 theName Object name; when specified, this parameter is used
3419 for result publication in the study. Otherwise, if automatic
3420 publication is switched on, default value is used for result name.
3423 New GEOM.GEOM_Object, containing the created revolution.
3425 theAngle,Parameters = ParseParameters(theAngle)
3426 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3427 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3428 anObj.SetParameters(Parameters)
3429 self._autoPublish(anObj, theName, "revolution")
3432 ## Create a filling from the given compound of contours.
3433 # @param theShape the compound of contours
3434 # @param theMinDeg a minimal degree of BSpline surface to create
3435 # @param theMaxDeg a maximal degree of BSpline surface to create
3436 # @param theTol2D a 2d tolerance to be reached
3437 # @param theTol3D a 3d tolerance to be reached
3438 # @param theNbIter a number of iteration of approximation algorithm
3439 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3440 # @param isApprox if True, BSpline curves are generated in the process
3441 # of surface construction. By default it is False, that means
3442 # the surface is created using given curves. The usage of
3443 # Approximation makes the algorithm work slower, but allows
3444 # building the surface for rather complex cases.
3445 # @param theName Object name; when specified, this parameter is used
3446 # for result publication in the study. Otherwise, if automatic
3447 # publication is switched on, default value is used for result name.
3449 # @return New GEOM.GEOM_Object, containing the created filling surface.
3451 # @ref tui_creation_filling "Example"
3452 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3453 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3455 Create a filling from the given compound of contours.
3458 theShape the compound of contours
3459 theMinDeg a minimal degree of BSpline surface to create
3460 theMaxDeg a maximal degree of BSpline surface to create
3461 theTol2D a 2d tolerance to be reached
3462 theTol3D a 3d tolerance to be reached
3463 theNbIter a number of iteration of approximation algorithm
3464 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3465 isApprox if True, BSpline curves are generated in the process
3466 of surface construction. By default it is False, that means
3467 the surface is created using given curves. The usage of
3468 Approximation makes the algorithm work slower, but allows
3469 building the surface for rather complex cases
3470 theName Object name; when specified, this parameter is used
3471 for result publication in the study. Otherwise, if automatic
3472 publication is switched on, default value is used for result name.
3475 New GEOM.GEOM_Object, containing the created filling surface.
3478 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3480 # Example: see GEOM_TestAll.py
3481 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3482 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3483 theTol2D, theTol3D, theNbIter,
3484 theMethod, isApprox)
3485 RaiseIfFailed("MakeFilling", self.PrimOp)
3486 anObj.SetParameters(Parameters)
3487 self._autoPublish(anObj, theName, "filling")
3491 ## Create a filling from the given compound of contours.
3492 # This method corresponds to MakeFilling with isApprox=True
3493 # @param theShape the compound of contours
3494 # @param theMinDeg a minimal degree of BSpline surface to create
3495 # @param theMaxDeg a maximal degree of BSpline surface to create
3496 # @param theTol3D a 3d tolerance to be reached
3497 # @param theName Object name; when specified, this parameter is used
3498 # for result publication in the study. Otherwise, if automatic
3499 # publication is switched on, default value is used for result name.
3501 # @return New GEOM.GEOM_Object, containing the created filling surface.
3503 # @ref tui_creation_filling "Example"
3504 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3506 Create a filling from the given compound of contours.
3507 This method corresponds to MakeFilling with isApprox=True
3510 theShape the compound of contours
3511 theMinDeg a minimal degree of BSpline surface to create
3512 theMaxDeg a maximal degree of BSpline surface to create
3513 theTol3D a 3d tolerance to be reached
3514 theName Object name; when specified, this parameter is used
3515 for result publication in the study. Otherwise, if automatic
3516 publication is switched on, default value is used for result name.
3519 New GEOM.GEOM_Object, containing the created filling surface.
3522 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3524 # Example: see GEOM_TestAll.py
3525 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3526 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3527 0, theTol3D, 0, GEOM.FOM_Default, True)
3528 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "filling")
3533 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3534 # @param theSeqSections - set of specified sections.
3535 # @param theModeSolid - mode defining building solid or shell
3536 # @param thePreci - precision 3D used for smoothing
3537 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3538 # @param theName Object name; when specified, this parameter is used
3539 # for result publication in the study. Otherwise, if automatic
3540 # publication is switched on, default value is used for result name.
3542 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3544 # @ref swig_todo "Example"
3545 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3547 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3550 theSeqSections - set of specified sections.
3551 theModeSolid - mode defining building solid or shell
3552 thePreci - precision 3D used for smoothing
3553 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3554 theName Object name; when specified, this parameter is used
3555 for result publication in the study. Otherwise, if automatic
3556 publication is switched on, default value is used for result name.
3559 New GEOM.GEOM_Object, containing the created shell or solid.
3561 # Example: see GEOM_TestAll.py
3562 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3563 RaiseIfFailed("MakeThruSections", self.PrimOp)
3564 self._autoPublish(anObj, theName, "filling")
3567 ## Create a shape by extrusion of the base shape along
3568 # the path shape. The path shape can be a wire or an edge.
3569 # @param theBase Base shape to be extruded.
3570 # @param thePath Path shape to extrude the base shape along it.
3571 # @param theName Object name; when specified, this parameter is used
3572 # for result publication in the study. Otherwise, if automatic
3573 # publication is switched on, default value is used for result name.
3575 # @return New GEOM.GEOM_Object, containing the created pipe.
3577 # @ref tui_creation_pipe "Example"
3578 def MakePipe(self, theBase, thePath, theName=None):
3580 Create a shape by extrusion of the base shape along
3581 the path shape. The path shape can be a wire or an edge.
3584 theBase Base shape to be extruded.
3585 thePath Path shape to extrude the base shape along it.
3586 theName Object name; when specified, this parameter is used
3587 for result publication in the study. Otherwise, if automatic
3588 publication is switched on, default value is used for result name.
3591 New GEOM.GEOM_Object, containing the created pipe.
3593 # Example: see GEOM_TestAll.py
3594 anObj = self.PrimOp.MakePipe(theBase, thePath)
3595 RaiseIfFailed("MakePipe", self.PrimOp)
3596 self._autoPublish(anObj, theName, "pipe")
3599 ## Create a shape by extrusion of the profile shape along
3600 # the path shape. The path shape can be a wire or an edge.
3601 # the several profiles can be specified in the several locations of path.
3602 # @param theSeqBases - list of Bases shape to be extruded.
3603 # @param theLocations - list of locations on the path corresponding
3604 # specified list of the Bases shapes. Number of locations
3605 # should be equal to number of bases or list of locations can be empty.
3606 # @param thePath - Path shape to extrude the base shape along it.
3607 # @param theWithContact - the mode defining that the section is translated to be in
3608 # contact with the spine.
3609 # @param theWithCorrection - defining that the section is rotated to be
3610 # orthogonal to the spine tangent in the correspondent point
3611 # @param theName Object name; when specified, this parameter is used
3612 # for result publication in the study. Otherwise, if automatic
3613 # publication is switched on, default value is used for result name.
3615 # @return New GEOM.GEOM_Object, containing the created pipe.
3617 # @ref tui_creation_pipe_with_diff_sec "Example"
3618 def MakePipeWithDifferentSections(self, theSeqBases,
3619 theLocations, thePath,
3620 theWithContact, theWithCorrection, theName=None):
3622 Create a shape by extrusion of the profile shape along
3623 the path shape. The path shape can be a wire or an edge.
3624 the several profiles can be specified in the several locations of path.
3627 theSeqBases - list of Bases shape to be extruded.
3628 theLocations - list of locations on the path corresponding
3629 specified list of the Bases shapes. Number of locations
3630 should be equal to number of bases or list of locations can be empty.
3631 thePath - Path shape to extrude the base shape along it.
3632 theWithContact - the mode defining that the section is translated to be in
3633 contact with the spine(0/1)
3634 theWithCorrection - defining that the section is rotated to be
3635 orthogonal to the spine tangent in the correspondent point (0/1)
3636 theName Object name; when specified, this parameter is used
3637 for result publication in the study. Otherwise, if automatic
3638 publication is switched on, default value is used for result name.
3641 New GEOM.GEOM_Object, containing the created pipe.
3643 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3644 theLocations, thePath,
3645 theWithContact, theWithCorrection)
3646 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3647 self._autoPublish(anObj, theName, "pipe")
3650 ## Create a shape by extrusion of the profile shape along
3651 # the path shape. The path shape can be a wire or a edge.
3652 # the several profiles can be specified in the several locations of path.
3653 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3654 # shell or face. If number of faces in neighbour sections
3655 # aren't coincided result solid between such sections will
3656 # be created using external boundaries of this shells.
3657 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3658 # This list is used for searching correspondences between
3659 # faces in the sections. Size of this list must be equal
3660 # to size of list of base shapes.
3661 # @param theLocations - list of locations on the path corresponding
3662 # specified list of the Bases shapes. Number of locations
3663 # should be equal to number of bases. First and last
3664 # locations must be coincided with first and last vertexes
3665 # of path correspondingly.
3666 # @param thePath - Path shape to extrude the base shape along it.
3667 # @param theWithContact - the mode defining that the section is translated to be in
3668 # contact with the spine.
3669 # @param theWithCorrection - defining that the section is rotated to be
3670 # orthogonal to the spine tangent in the correspondent point
3671 # @param theName Object name; when specified, this parameter is used
3672 # for result publication in the study. Otherwise, if automatic
3673 # publication is switched on, default value is used for result name.
3675 # @return New GEOM.GEOM_Object, containing the created solids.
3677 # @ref tui_creation_pipe_with_shell_sec "Example"
3678 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3679 theLocations, thePath,
3680 theWithContact, theWithCorrection, theName=None):
3682 Create a shape by extrusion of the profile shape along
3683 the path shape. The path shape can be a wire or a edge.
3684 the several profiles can be specified in the several locations of path.
3687 theSeqBases - list of Bases shape to be extruded. Base shape must be
3688 shell or face. If number of faces in neighbour sections
3689 aren't coincided result solid between such sections will
3690 be created using external boundaries of this shells.
3691 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3692 This list is used for searching correspondences between
3693 faces in the sections. Size of this list must be equal
3694 to size of list of base shapes.
3695 theLocations - list of locations on the path corresponding
3696 specified list of the Bases shapes. Number of locations
3697 should be equal to number of bases. First and last
3698 locations must be coincided with first and last vertexes
3699 of path correspondingly.
3700 thePath - Path shape to extrude the base shape along it.
3701 theWithContact - the mode defining that the section is translated to be in
3702 contact with the spine (0/1)
3703 theWithCorrection - defining that the section is rotated to be
3704 orthogonal to the spine tangent in the correspondent point (0/1)
3705 theName Object name; when specified, this parameter is used
3706 for result publication in the study. Otherwise, if automatic
3707 publication is switched on, default value is used for result name.
3710 New GEOM.GEOM_Object, containing the created solids.
3712 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3713 theLocations, thePath,
3714 theWithContact, theWithCorrection)
3715 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3716 self._autoPublish(anObj, theName, "pipe")
3719 ## Create a shape by extrusion of the profile shape along
3720 # the path shape. This function is used only for debug pipe
3721 # functionality - it is a version of function MakePipeWithShellSections()
3722 # which give a possibility to recieve information about
3723 # creating pipe between each pair of sections step by step.
3724 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3725 theLocations, thePath,
3726 theWithContact, theWithCorrection, theName=None):
3728 Create a shape by extrusion of the profile shape along
3729 the path shape. This function is used only for debug pipe
3730 functionality - it is a version of previous function
3731 geompy.MakePipeWithShellSections() which give a possibility to
3732 recieve information about creating pipe between each pair of
3733 sections step by step.
3736 nbsect = len(theSeqBases)
3737 nbsubsect = len(theSeqSubBases)
3738 #print "nbsect = ",nbsect
3739 for i in range(1,nbsect):
3741 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3742 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3744 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3745 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3746 tmpLocations, thePath,
3747 theWithContact, theWithCorrection)
3748 if self.PrimOp.IsDone() == 0:
3749 print "Problems with pipe creation between ",i," and ",i+1," sections"
3750 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3753 print "Pipe between ",i," and ",i+1," sections is OK"
3758 resc = self.MakeCompound(res)
3759 #resc = self.MakeSewing(res, 0.001)
3760 #print "resc: ",resc
3761 self._autoPublish(resc, theName, "pipe")
3764 ## Create solids between given sections
3765 # @param theSeqBases - list of sections (shell or face).
3766 # @param theLocations - list of corresponding vertexes
3767 # @param 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.
3771 # @return New GEOM.GEOM_Object, containing the created solids.
3773 # @ref tui_creation_pipe_without_path "Example"
3774 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3776 Create solids between given sections
3779 theSeqBases - list of sections (shell or face).
3780 theLocations - list of corresponding vertexes
3781 theName Object name; when specified, this parameter is used
3782 for result publication in the study. Otherwise, if automatic
3783 publication is switched on, default value is used for result name.
3786 New GEOM.GEOM_Object, containing the created solids.
3788 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3789 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3790 self._autoPublish(anObj, theName, "pipe")
3793 ## Create a shape by extrusion of the base shape along
3794 # the path shape with constant bi-normal direction along the given vector.
3795 # The path shape can be a wire or an edge.
3796 # @param theBase Base shape to be extruded.
3797 # @param thePath Path shape to extrude the base shape along it.
3798 # @param theVec Vector defines a constant binormal direction to keep the
3799 # same angle beetween the direction and the sections
3800 # along the sweep surface.
3801 # @param theName Object name; when specified, this parameter is used
3802 # for result publication in the study. Otherwise, if automatic
3803 # publication is switched on, default value is used for result name.
3805 # @return New GEOM.GEOM_Object, containing the created pipe.
3807 # @ref tui_creation_pipe "Example"
3808 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3810 Create a shape by extrusion of the base shape along
3811 the path shape with constant bi-normal direction along the given vector.
3812 The path shape can be a wire or an edge.
3815 theBase Base shape to be extruded.
3816 thePath Path shape to extrude the base shape along it.
3817 theVec Vector defines a constant binormal direction to keep the
3818 same angle beetween the direction and the sections
3819 along the sweep surface.
3820 theName Object name; when specified, this parameter is used
3821 for result publication in the study. Otherwise, if automatic
3822 publication is switched on, default value is used for result name.
3825 New GEOM.GEOM_Object, containing the created pipe.
3827 # Example: see GEOM_TestAll.py
3828 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3829 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3830 self._autoPublish(anObj, theName, "pipe")
3833 ## Makes a thick solid from a face or a shell
3834 # @param theShape Face or Shell to be thicken
3835 # @param theThickness Thickness of the resulting solid
3836 # @param theName Object name; when specified, this parameter is used
3837 # for result publication in the study. Otherwise, if automatic
3838 # publication is switched on, default value is used for result name.
3840 # @return New GEOM.GEOM_Object, containing the created solid
3842 def MakeThickSolid(self, theShape, theThickness, theName=None):
3844 Make a thick solid from a face or a shell
3847 theShape Face or Shell to be thicken
3848 theThickness Thickness of the resulting solid
3849 theName Object name; when specified, this parameter is used
3850 for result publication in the study. Otherwise, if automatic
3851 publication is switched on, default value is used for result name.
3854 New GEOM.GEOM_Object, containing the created solid
3856 # Example: see GEOM_TestAll.py
3857 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3858 RaiseIfFailed("MakeThickening", self.PrimOp)
3859 self._autoPublish(anObj, theName, "pipe")
3863 ## Modifies a face or a shell to make it a thick solid
3864 # @param theShape Face or Shell to be thicken
3865 # @param theThickness Thickness of the resulting solid
3867 # @return The modified shape
3869 def Thicken(self, theShape, theThickness):
3871 Modifies a face or a shell to make it a thick solid
3874 theBase Base shape to be extruded.
3875 thePath Path shape to extrude the base shape along it.
3876 theName Object name; when specified, this parameter is used
3877 for result publication in the study. Otherwise, if automatic
3878 publication is switched on, default value is used for result name.
3883 # Example: see GEOM_TestAll.py
3884 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3885 RaiseIfFailed("MakeThickening", self.PrimOp)
3888 ## Build a middle path of a pipe-like shape.
3889 # The path shape can be a wire or an edge.
3890 # @param theShape It can be closed or unclosed pipe-like shell
3891 # or a pipe-like solid.
3892 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3893 # should be wires or faces of theShape.
3894 # @param theName Object name; when specified, this parameter is used
3895 # for result publication in the study. Otherwise, if automatic
3896 # publication is switched on, default value is used for result name.
3898 # @note It is not assumed that exact or approximate copy of theShape
3899 # can be obtained by applying existing Pipe operation on the
3900 # resulting "Path" wire taking theBase1 as the base - it is not
3901 # always possible; though in some particular cases it might work
3902 # it is not guaranteed. Thus, RestorePath function should not be
3903 # considered as an exact reverse operation of the Pipe.
3905 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3906 # source pipe's "path".
3908 # @ref tui_creation_pipe_path "Example"
3909 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3911 Build a middle path of a pipe-like shape.
3912 The path shape can be a wire or an edge.
3915 theShape It can be closed or unclosed pipe-like shell
3916 or a pipe-like solid.
3917 theBase1, theBase2 Two bases of the supposed pipe. This
3918 should be wires or faces of theShape.
3919 theName Object name; when specified, this parameter is used
3920 for result publication in the study. Otherwise, if automatic
3921 publication is switched on, default value is used for result name.
3924 New GEOM_Object, containing an edge or wire that represent
3927 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3928 RaiseIfFailed("RestorePath", self.PrimOp)
3929 self._autoPublish(anObj, theName, "path")
3932 ## Build a middle path of a pipe-like shape.
3933 # The path shape can be a wire or an edge.
3934 # @param theShape It can be closed or unclosed pipe-like shell
3935 # or a pipe-like solid.
3936 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3937 # should be lists of edges of theShape.
3938 # @param 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.
3942 # @note It is not assumed that exact or approximate copy of theShape
3943 # can be obtained by applying existing Pipe operation on the
3944 # resulting "Path" wire taking theBase1 as the base - it is not
3945 # always possible; though in some particular cases it might work
3946 # it is not guaranteed. Thus, RestorePath function should not be
3947 # considered as an exact reverse operation of the Pipe.
3949 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3950 # source pipe's "path".
3952 # @ref tui_creation_pipe_path "Example"
3953 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3955 Build a middle path of a pipe-like shape.
3956 The path shape can be a wire or an edge.
3959 theShape It can be closed or unclosed pipe-like shell
3960 or a pipe-like solid.
3961 listEdges1, listEdges2 Two bases of the supposed pipe. This
3962 should be lists of edges of theShape.
3963 theName Object name; when specified, this parameter is used
3964 for result publication in the study. Otherwise, if automatic
3965 publication is switched on, default value is used for result name.
3968 New GEOM_Object, containing an edge or wire that represent
3971 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3972 RaiseIfFailed("RestorePath", self.PrimOp)
3973 self._autoPublish(anObj, theName, "path")
3979 ## @addtogroup l3_advanced
3982 ## Create a linear edge with specified ends.
3983 # @param thePnt1 Point for the first end of edge.
3984 # @param thePnt2 Point for the second end of edge.
3985 # @param theName Object name; when specified, this parameter is used
3986 # for result publication in the study. Otherwise, if automatic
3987 # publication is switched on, default value is used for result name.
3989 # @return New GEOM.GEOM_Object, containing the created edge.
3991 # @ref tui_creation_edge "Example"
3992 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3994 Create a linear edge with specified ends.
3997 thePnt1 Point for the first end of edge.
3998 thePnt2 Point for the second end of edge.
3999 theName Object name; when specified, this parameter is used
4000 for result publication in the study. Otherwise, if automatic
4001 publication is switched on, default value is used for result name.
4004 New GEOM.GEOM_Object, containing the created edge.
4006 # Example: see GEOM_TestAll.py
4007 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4008 RaiseIfFailed("MakeEdge", self.ShapesOp)
4009 self._autoPublish(anObj, theName, "edge")
4012 ## Create a new edge, corresponding to the given length on the given curve.
4013 # @param theRefCurve The referenced curve (edge).
4014 # @param theLength Length on the referenced curve. It can be negative.
4015 # @param theStartPoint Any point can be selected for it, the new edge will begin
4016 # at the end of \a theRefCurve, close to the selected point.
4017 # If None, start from the first point of \a theRefCurve.
4018 # @param theName Object name; when specified, this parameter is used
4019 # for result publication in the study. Otherwise, if automatic
4020 # publication is switched on, default value is used for result name.
4022 # @return New GEOM.GEOM_Object, containing the created edge.
4024 # @ref tui_creation_edge "Example"
4025 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4027 Create a new edge, corresponding to the given length on the given curve.
4030 theRefCurve The referenced curve (edge).
4031 theLength Length on the referenced curve. It can be negative.
4032 theStartPoint Any point can be selected for it, the new edge will begin
4033 at the end of theRefCurve, close to the selected point.
4034 If None, start from the first point of theRefCurve.
4035 theName Object name; when specified, this parameter is used
4036 for result publication in the study. Otherwise, if automatic
4037 publication is switched on, default value is used for result name.
4040 New GEOM.GEOM_Object, containing the created edge.
4042 # Example: see GEOM_TestAll.py
4043 theLength, Parameters = ParseParameters(theLength)
4044 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4045 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4046 anObj.SetParameters(Parameters)
4047 self._autoPublish(anObj, theName, "edge")
4050 ## Create an edge from specified wire.
4051 # @param theWire source Wire
4052 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4053 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4054 # @param theName Object name; when specified, this parameter is used
4055 # for result publication in the study. Otherwise, if automatic
4056 # publication is switched on, default value is used for result name.
4058 # @return New GEOM.GEOM_Object, containing the created edge.
4060 # @ref tui_creation_edge "Example"
4061 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4063 Create an edge from specified wire.
4067 theLinearTolerance linear tolerance value (default = 1e-07)
4068 theAngularTolerance angular tolerance value (default = 1e-12)
4069 theName Object name; when specified, this parameter is used
4070 for result publication in the study. Otherwise, if automatic
4071 publication is switched on, default value is used for result name.
4074 New GEOM.GEOM_Object, containing the created edge.
4076 # Example: see GEOM_TestAll.py
4077 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4078 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4079 self._autoPublish(anObj, theName, "edge")
4082 ## Create a wire from the set of edges and wires.
4083 # @param theEdgesAndWires List of edges and/or wires.
4084 # @param theTolerance Maximum distance between vertices, that will be merged.
4085 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4086 # @param theName Object name; when specified, this parameter is used
4087 # for result publication in the study. Otherwise, if automatic
4088 # publication is switched on, default value is used for result name.
4090 # @return New GEOM.GEOM_Object, containing the created wire.
4092 # @ref tui_creation_wire "Example"
4093 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4095 Create a wire from the set of edges and wires.
4098 theEdgesAndWires List of edges and/or wires.
4099 theTolerance Maximum distance between vertices, that will be merged.
4100 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4101 theName Object name; when specified, this parameter is used
4102 for result publication in the study. Otherwise, if automatic
4103 publication is switched on, default value is used for result name.
4106 New GEOM.GEOM_Object, containing the created wire.
4108 # Example: see GEOM_TestAll.py
4109 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4110 RaiseIfFailed("MakeWire", self.ShapesOp)
4111 self._autoPublish(anObj, theName, "wire")
4114 ## Create a face on the given wire.
4115 # @param theWire closed Wire or Edge to build the face on.
4116 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4117 # If the tolerance of the obtained planar face is less
4118 # than 1e-06, this face will be returned, otherwise the
4119 # algorithm tries to build any suitable face on the given
4120 # wire and prints a warning message.
4121 # @param theName Object name; when specified, this parameter is used
4122 # for result publication in the study. Otherwise, if automatic
4123 # publication is switched on, default value is used for result name.
4125 # @return New GEOM.GEOM_Object, containing the created face.
4127 # @ref tui_creation_face "Example"
4128 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4130 Create a face on the given wire.
4133 theWire closed Wire or Edge to build the face on.
4134 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4135 If the tolerance of the obtained planar face is less
4136 than 1e-06, this face will be returned, otherwise the
4137 algorithm tries to build any suitable face on the given
4138 wire and prints a warning message.
4139 theName Object name; when specified, this parameter is used
4140 for result publication in the study. Otherwise, if automatic
4141 publication is switched on, default value is used for result name.
4144 New GEOM.GEOM_Object, containing the created face.
4146 # Example: see GEOM_TestAll.py
4147 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4148 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4149 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4151 RaiseIfFailed("MakeFace", self.ShapesOp)
4152 self._autoPublish(anObj, theName, "face")
4155 ## Create a face on the given wires set.
4156 # @param theWires List of closed wires or edges to build the face on.
4157 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4158 # If the tolerance of the obtained planar face is less
4159 # than 1e-06, this face will be returned, otherwise the
4160 # algorithm tries to build any suitable face on the given
4161 # wire and prints a warning message.
4162 # @param theName Object name; when specified, this parameter is used
4163 # for result publication in the study. Otherwise, if automatic
4164 # publication is switched on, default value is used for result name.
4166 # @return New GEOM.GEOM_Object, containing the created face.
4168 # @ref tui_creation_face "Example"
4169 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4171 Create a face on the given wires set.
4174 theWires List of closed wires or edges to build the face on.
4175 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4176 If the tolerance of the obtained planar face is less
4177 than 1e-06, this face will be returned, otherwise the
4178 algorithm tries to build any suitable face on the given
4179 wire and prints a warning message.
4180 theName Object name; when specified, this parameter is used
4181 for result publication in the study. Otherwise, if automatic
4182 publication is switched on, default value is used for result name.
4185 New GEOM.GEOM_Object, containing the created face.
4187 # Example: see GEOM_TestAll.py
4188 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4189 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4190 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4192 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4193 self._autoPublish(anObj, theName, "face")
4196 ## See MakeFaceWires() method for details.
4198 # @ref tui_creation_face "Example 1"
4199 # \n @ref swig_MakeFaces "Example 2"
4200 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4202 See geompy.MakeFaceWires() method for details.
4204 # Example: see GEOM_TestOthers.py
4205 # note: auto-publishing is done in self.MakeFaceWires()
4206 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4209 ## Create a shell from the set of faces and shells.
4210 # @param theFacesAndShells List of faces and/or shells.
4211 # @param theName Object name; when specified, this parameter is used
4212 # for result publication in the study. Otherwise, if automatic
4213 # publication is switched on, default value is used for result name.
4215 # @return New GEOM.GEOM_Object, containing the created shell.
4217 # @ref tui_creation_shell "Example"
4218 def MakeShell(self, theFacesAndShells, theName=None):
4220 Create a shell from the set of faces and shells.
4223 theFacesAndShells List of faces and/or shells.
4224 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.
4229 New GEOM.GEOM_Object, containing the created shell.
4231 # Example: see GEOM_TestAll.py
4232 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4233 RaiseIfFailed("MakeShell", self.ShapesOp)
4234 self._autoPublish(anObj, theName, "shell")
4237 ## Create a solid, bounded by the given shells.
4238 # @param theShells Sequence of bounding shells.
4239 # @param theName Object name; when specified, this parameter is used
4240 # for result publication in the study. Otherwise, if automatic
4241 # publication is switched on, default value is used for result name.
4243 # @return New GEOM.GEOM_Object, containing the created solid.
4245 # @ref tui_creation_solid "Example"
4246 def MakeSolid(self, theShells, theName=None):
4248 Create a solid, bounded by the given shells.
4251 theShells Sequence of bounding shells.
4252 theName Object name; when specified, this parameter is used
4253 for result publication in the study. Otherwise, if automatic
4254 publication is switched on, default value is used for result name.
4257 New GEOM.GEOM_Object, containing the created solid.
4259 # Example: see GEOM_TestAll.py
4260 if len(theShells) == 1:
4261 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4263 # raise RuntimeError, "MakeSolidShells : " + descr
4264 if descr == "WRN_SHAPE_UNCLOSED":
4265 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4266 anObj = self.ShapesOp.MakeSolidShells(theShells)
4267 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4268 self._autoPublish(anObj, theName, "solid")
4271 ## Create a compound of the given shapes.
4272 # @param theShapes List of shapes to put in compound.
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 compound.
4279 # @ref tui_creation_compound "Example"
4280 def MakeCompound(self, theShapes, theName=None):
4282 Create a compound of the given shapes.
4285 theShapes List of shapes to put in compound.
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 compound.
4293 # Example: see GEOM_TestAll.py
4294 anObj = self.ShapesOp.MakeCompound(theShapes)
4295 RaiseIfFailed("MakeCompound", self.ShapesOp)
4296 self._autoPublish(anObj, theName, "compound")
4299 # end of l3_advanced
4302 ## @addtogroup l2_measure
4305 ## Gives quantity of faces in the given shape.
4306 # @param theShape Shape to count faces of.
4307 # @return Quantity of faces.
4309 # @ref swig_NumberOf "Example"
4310 def NumberOfFaces(self, theShape):
4312 Gives quantity of faces in the given shape.
4315 theShape Shape to count faces of.
4320 # Example: see GEOM_TestOthers.py
4321 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4322 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4325 ## Gives quantity of edges in the given shape.
4326 # @param theShape Shape to count edges of.
4327 # @return Quantity of edges.
4329 # @ref swig_NumberOf "Example"
4330 def NumberOfEdges(self, theShape):
4332 Gives quantity of edges in the given shape.
4335 theShape Shape to count edges of.
4340 # Example: see GEOM_TestOthers.py
4341 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4342 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4345 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4346 # @param theShape Shape to count sub-shapes of.
4347 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4348 # @return Quantity of sub-shapes of given type.
4350 # @ref swig_NumberOf "Example"
4351 def NumberOfSubShapes(self, theShape, theShapeType):
4353 Gives quantity of sub-shapes of type theShapeType in the given shape.
4356 theShape Shape to count sub-shapes of.
4357 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4360 Quantity of sub-shapes of given type.
4362 # Example: see GEOM_TestOthers.py
4363 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4364 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4367 ## Gives quantity of solids in the given shape.
4368 # @param theShape Shape to count solids in.
4369 # @return Quantity of solids.
4371 # @ref swig_NumberOf "Example"
4372 def NumberOfSolids(self, theShape):
4374 Gives quantity of solids in the given shape.
4377 theShape Shape to count solids in.
4382 # Example: see GEOM_TestOthers.py
4383 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4384 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4390 ## @addtogroup l3_healing
4393 ## Reverses an orientation the given shape.
4394 # @param theShape Shape to be reversed.
4395 # @param theName Object name; when specified, this parameter is used
4396 # for result publication in the study. Otherwise, if automatic
4397 # publication is switched on, default value is used for result name.
4399 # @return The reversed copy of theShape.
4401 # @ref swig_ChangeOrientation "Example"
4402 def ChangeOrientation(self, theShape, theName=None):
4404 Reverses an orientation the given shape.
4407 theShape Shape to be reversed.
4408 theName Object name; when specified, this parameter is used
4409 for result publication in the study. Otherwise, if automatic
4410 publication is switched on, default value is used for result name.
4413 The reversed copy of theShape.
4415 # Example: see GEOM_TestAll.py
4416 anObj = self.ShapesOp.ChangeOrientation(theShape)
4417 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4418 self._autoPublish(anObj, theName, "reversed")
4421 ## See ChangeOrientation() method for details.
4423 # @ref swig_OrientationChange "Example"
4424 def OrientationChange(self, theShape, theName=None):
4426 See geompy.ChangeOrientation method for details.
4428 # Example: see GEOM_TestOthers.py
4429 # note: auto-publishing is done in self.ChangeOrientation()
4430 anObj = self.ChangeOrientation(theShape, theName)
4436 ## @addtogroup l4_obtain
4439 ## Retrieve all free faces from the given shape.
4440 # Free face is a face, which is not shared between two shells of the shape.
4441 # @param theShape Shape to find free faces in.
4442 # @return List of IDs of all free faces, contained in theShape.
4444 # @ref tui_measurement_tools_page "Example"
4445 def GetFreeFacesIDs(self,theShape):
4447 Retrieve all free faces from the given shape.
4448 Free face is a face, which is not shared between two shells of the shape.
4451 theShape Shape to find free faces in.
4454 List of IDs of all free faces, contained in theShape.
4456 # Example: see GEOM_TestOthers.py
4457 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4458 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4461 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4462 # @param theShape1 Shape to find sub-shapes in.
4463 # @param theShape2 Shape to find shared sub-shapes with.
4464 # @param theShapeType Type of sub-shapes to be retrieved.
4465 # @param theName Object name; when specified, this parameter is used
4466 # for result publication in the study. Otherwise, if automatic
4467 # publication is switched on, default value is used for result name.
4469 # @return List of sub-shapes of theShape1, shared with theShape2.
4471 # @ref swig_GetSharedShapes "Example"
4472 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4474 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4477 theShape1 Shape to find sub-shapes in.
4478 theShape2 Shape to find shared sub-shapes with.
4479 theShapeType Type of sub-shapes to be retrieved.
4480 theName Object name; when specified, this parameter is used
4481 for result publication in the study. Otherwise, if automatic
4482 publication is switched on, default value is used for result name.
4485 List of sub-shapes of theShape1, shared with theShape2.
4487 # Example: see GEOM_TestOthers.py
4488 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4489 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4490 self._autoPublish(aList, theName, "shared")
4493 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4494 # @param theShapes Shapes to find common sub-shapes of.
4495 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4496 # @param theName Object name; when specified, this parameter is used
4497 # for result publication in the study. Otherwise, if automatic
4498 # publication is switched on, default value is used for result name.
4500 # @return List of objects, that are sub-shapes of all given shapes.
4502 # @ref swig_GetSharedShapes "Example"
4503 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4505 Get all sub-shapes, shared by all shapes in the list theShapes.
4508 theShapes Shapes to find common sub-shapes of.
4509 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4510 theName Object name; when specified, this parameter is used
4511 for result publication in the study. Otherwise, if automatic
4512 publication is switched on, default value is used for result name.
4515 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4517 # Example: see GEOM_TestOthers.py
4518 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4519 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4520 self._autoPublish(aList, theName, "shared")
4523 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4524 # situated relatively the specified plane by the certain way,
4525 # defined through <VAR>theState</VAR> parameter.
4526 # @param theShape Shape to find sub-shapes of.
4527 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4528 # @param theAx1 Vector (or line, or linear edge), specifying normal
4529 # direction and location of the plane to find shapes on.
4530 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4531 # @param theName Object name; when specified, this parameter is used
4532 # for result publication in the study. Otherwise, if automatic
4533 # publication is switched on, default value is used for result name.
4535 # @return List of all found sub-shapes.
4537 # @ref swig_GetShapesOnPlane "Example"
4538 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4540 Find in theShape all sub-shapes of type theShapeType,
4541 situated relatively the specified plane by the certain way,
4542 defined through theState parameter.
4545 theShape Shape to find sub-shapes of.
4546 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4547 theAx1 Vector (or line, or linear edge), specifying normal
4548 direction and location of the plane to find shapes on.
4549 theState The state of the sub-shapes to find (see GEOM::shape_state)
4550 theName Object name; when specified, this parameter is used
4551 for result publication in the study. Otherwise, if automatic
4552 publication is switched on, default value is used for result name.
4555 List of all found sub-shapes.
4557 # Example: see GEOM_TestOthers.py
4558 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4559 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4560 self._autoPublish(aList, theName, "shapeOnPlane")
4563 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4564 # situated relatively the specified plane by the certain way,
4565 # defined through <VAR>theState</VAR> parameter.
4566 # @param theShape Shape to find sub-shapes of.
4567 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4568 # @param theAx1 Vector (or line, or linear edge), specifying normal
4569 # direction and location of the plane to find shapes on.
4570 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4572 # @return List of all found sub-shapes indices.
4574 # @ref swig_GetShapesOnPlaneIDs "Example"
4575 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4577 Find in theShape all sub-shapes of type theShapeType,
4578 situated relatively the specified plane by the certain way,
4579 defined through theState parameter.
4582 theShape Shape to find sub-shapes of.
4583 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4584 theAx1 Vector (or line, or linear edge), specifying normal
4585 direction and location of the plane to find shapes on.
4586 theState The state of the sub-shapes to find (see GEOM::shape_state)
4589 List of all found sub-shapes indices.
4591 # Example: see GEOM_TestOthers.py
4592 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4593 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4596 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4597 # situated relatively the specified plane by the certain way,
4598 # defined through <VAR>theState</VAR> parameter.
4599 # @param theShape Shape to find sub-shapes of.
4600 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4601 # @param theAx1 Vector (or line, or linear edge), specifying normal
4602 # direction of the plane to find shapes on.
4603 # @param thePnt Point specifying location of the plane to find shapes on.
4604 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4605 # @param theName Object name; when specified, this parameter is used
4606 # for result publication in the study. Otherwise, if automatic
4607 # publication is switched on, default value is used for result name.
4609 # @return List of all found sub-shapes.
4611 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4612 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4614 Find in theShape all sub-shapes of type theShapeType,
4615 situated relatively the specified plane by the certain way,
4616 defined through theState parameter.
4619 theShape Shape to find sub-shapes of.
4620 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4621 theAx1 Vector (or line, or linear edge), specifying normal
4622 direction and location of the plane to find shapes on.
4623 thePnt Point specifying location of the plane to find shapes on.
4624 theState The state of the sub-shapes to find (see GEOM::shape_state)
4625 theName Object name; when specified, this parameter is used
4626 for result publication in the study. Otherwise, if automatic
4627 publication is switched on, default value is used for result name.
4630 List of all found sub-shapes.
4632 # Example: see GEOM_TestOthers.py
4633 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4634 theAx1, thePnt, theState)
4635 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4636 self._autoPublish(aList, theName, "shapeOnPlane")
4639 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4640 # situated relatively the specified plane by the certain way,
4641 # defined through <VAR>theState</VAR> parameter.
4642 # @param theShape Shape to find sub-shapes of.
4643 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4644 # @param theAx1 Vector (or line, or linear edge), specifying normal
4645 # direction of the plane to find shapes on.
4646 # @param thePnt Point specifying location of the plane to find shapes on.
4647 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4649 # @return List of all found sub-shapes indices.
4651 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4652 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4654 Find in theShape all sub-shapes of type theShapeType,
4655 situated relatively the specified plane by the certain way,
4656 defined through theState parameter.
4659 theShape Shape to find sub-shapes of.
4660 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4661 theAx1 Vector (or line, or linear edge), specifying normal
4662 direction and location of the plane to find shapes on.
4663 thePnt Point specifying location of the plane to find shapes on.
4664 theState The state of the sub-shapes to find (see GEOM::shape_state)
4667 List of all found sub-shapes indices.
4669 # Example: see GEOM_TestOthers.py
4670 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4671 theAx1, thePnt, theState)
4672 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4675 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4676 # the specified cylinder by the certain way, defined through \a theState parameter.
4677 # @param theShape Shape to find sub-shapes of.
4678 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4679 # @param theAxis Vector (or line, or linear edge), specifying
4680 # axis of the cylinder to find shapes on.
4681 # @param theRadius Radius of the cylinder to find shapes on.
4682 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4683 # @param theName Object name; when specified, this parameter is used
4684 # for result publication in the study. Otherwise, if automatic
4685 # publication is switched on, default value is used for result name.
4687 # @return List of all found sub-shapes.
4689 # @ref swig_GetShapesOnCylinder "Example"
4690 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4692 Find in theShape all sub-shapes of type theShapeType, situated relatively
4693 the specified cylinder by the certain way, defined through theState parameter.
4696 theShape Shape to find sub-shapes of.
4697 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4698 theAxis Vector (or line, or linear edge), specifying
4699 axis of the cylinder to find shapes on.
4700 theRadius Radius of the cylinder to find shapes on.
4701 theState The state of the sub-shapes to find (see GEOM::shape_state)
4702 theName Object name; when specified, this parameter is used
4703 for result publication in the study. Otherwise, if automatic
4704 publication is switched on, default value is used for result name.
4707 List of all found sub-shapes.
4709 # Example: see GEOM_TestOthers.py
4710 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4711 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4712 self._autoPublish(aList, theName, "shapeOnCylinder")
4715 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4716 # the specified cylinder by the certain way, defined through \a theState parameter.
4717 # @param theShape Shape to find sub-shapes of.
4718 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4719 # @param theAxis Vector (or line, or linear edge), specifying
4720 # axis of the cylinder to find shapes on.
4721 # @param theRadius Radius of the cylinder to find shapes on.
4722 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4724 # @return List of all found sub-shapes indices.
4726 # @ref swig_GetShapesOnCylinderIDs "Example"
4727 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4729 Find in theShape all sub-shapes of type theShapeType, situated relatively
4730 the specified cylinder by the certain way, defined through theState parameter.
4733 theShape Shape to find sub-shapes of.
4734 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4735 theAxis Vector (or line, or linear edge), specifying
4736 axis of the cylinder to find shapes on.
4737 theRadius Radius of the cylinder to find shapes on.
4738 theState The state of the sub-shapes to find (see GEOM::shape_state)
4741 List of all found sub-shapes indices.
4743 # Example: see GEOM_TestOthers.py
4744 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4745 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4748 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4749 # the specified cylinder by the certain way, defined through \a theState parameter.
4750 # @param theShape Shape to find sub-shapes of.
4751 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4752 # @param theAxis Vector (or line, or linear edge), specifying
4753 # axis of the cylinder to find shapes on.
4754 # @param thePnt Point specifying location of the bottom of the cylinder.
4755 # @param theRadius Radius of the cylinder to find shapes on.
4756 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4757 # @param theName Object name; when specified, this parameter is used
4758 # for result publication in the study. Otherwise, if automatic
4759 # publication is switched on, default value is used for result name.
4761 # @return List of all found sub-shapes.
4763 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4764 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4766 Find in theShape all sub-shapes of type theShapeType, situated relatively
4767 the specified cylinder by the certain way, defined through theState parameter.
4770 theShape Shape to find sub-shapes of.
4771 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4772 theAxis Vector (or line, or linear edge), specifying
4773 axis of the cylinder to find shapes on.
4774 theRadius Radius of the cylinder to find shapes on.
4775 theState The state of the sub-shapes to find (see GEOM::shape_state)
4776 theName Object name; when specified, this parameter is used
4777 for result publication in the study. Otherwise, if automatic
4778 publication is switched on, default value is used for result name.
4781 List of all found sub-shapes.
4783 # Example: see GEOM_TestOthers.py
4784 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4785 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4786 self._autoPublish(aList, theName, "shapeOnCylinder")
4789 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4790 # the specified cylinder by the certain way, defined through \a theState parameter.
4791 # @param theShape Shape to find sub-shapes of.
4792 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4793 # @param theAxis Vector (or line, or linear edge), specifying
4794 # axis of the cylinder to find shapes on.
4795 # @param thePnt Point specifying location of the bottom of the cylinder.
4796 # @param theRadius Radius of the cylinder to find shapes on.
4797 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4799 # @return List of all found sub-shapes indices
4801 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4802 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4804 Find in theShape all sub-shapes of type theShapeType, situated relatively
4805 the specified cylinder by the certain way, defined through theState parameter.
4808 theShape Shape to find sub-shapes of.
4809 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4810 theAxis Vector (or line, or linear edge), specifying
4811 axis of the cylinder to find shapes on.
4812 theRadius Radius of the cylinder to find shapes on.
4813 theState The state of the sub-shapes to find (see GEOM::shape_state)
4816 List of all found sub-shapes indices.
4818 # Example: see GEOM_TestOthers.py
4819 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4820 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4823 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4824 # the specified sphere by the certain way, defined through \a theState parameter.
4825 # @param theShape Shape to find sub-shapes of.
4826 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4827 # @param theCenter Point, specifying center of the sphere to find shapes on.
4828 # @param theRadius Radius of the sphere to find shapes on.
4829 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4830 # @param theName Object name; when specified, this parameter is used
4831 # for result publication in the study. Otherwise, if automatic
4832 # publication is switched on, default value is used for result name.
4834 # @return List of all found sub-shapes.
4836 # @ref swig_GetShapesOnSphere "Example"
4837 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4839 Find in theShape all sub-shapes of type theShapeType, situated relatively
4840 the specified sphere by the certain way, defined through theState parameter.
4843 theShape Shape to find sub-shapes of.
4844 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4845 theCenter Point, specifying center of the sphere to find shapes on.
4846 theRadius Radius of the sphere to find shapes on.
4847 theState The state of the sub-shapes to find (see GEOM::shape_state)
4848 theName Object name; when specified, this parameter is used
4849 for result publication in the study. Otherwise, if automatic
4850 publication is switched on, default value is used for result name.
4853 List of all found sub-shapes.
4855 # Example: see GEOM_TestOthers.py
4856 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4857 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4858 self._autoPublish(aList, theName, "shapeOnSphere")
4861 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4862 # the specified sphere by the certain way, defined through \a theState parameter.
4863 # @param theShape Shape to find sub-shapes of.
4864 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4865 # @param theCenter Point, specifying center of the sphere to find shapes on.
4866 # @param theRadius Radius of the sphere to find shapes on.
4867 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4869 # @return List of all found sub-shapes indices.
4871 # @ref swig_GetShapesOnSphereIDs "Example"
4872 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4874 Find in theShape all sub-shapes of type theShapeType, situated relatively
4875 the specified sphere by the certain way, defined through theState parameter.
4878 theShape Shape to find sub-shapes of.
4879 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4880 theCenter Point, specifying center of the sphere to find shapes on.
4881 theRadius Radius of the sphere to find shapes on.
4882 theState The state of the sub-shapes to find (see GEOM::shape_state)
4885 List of all found sub-shapes indices.
4887 # Example: see GEOM_TestOthers.py
4888 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4889 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4892 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4893 # the specified quadrangle by the certain way, defined through \a theState parameter.
4894 # @param theShape Shape to find sub-shapes of.
4895 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4896 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4897 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4898 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4899 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4900 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4901 # @param theName Object name; when specified, this parameter is used
4902 # for result publication in the study. Otherwise, if automatic
4903 # publication is switched on, default value is used for result name.
4905 # @return List of all found sub-shapes.
4907 # @ref swig_GetShapesOnQuadrangle "Example"
4908 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4909 theTopLeftPoint, theTopRigthPoint,
4910 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4912 Find in theShape all sub-shapes of type theShapeType, situated relatively
4913 the specified quadrangle by the certain way, defined through theState parameter.
4916 theShape Shape to find sub-shapes of.
4917 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4918 theTopLeftPoint Point, specifying top left corner of a quadrangle
4919 theTopRigthPoint Point, specifying top right corner of a quadrangle
4920 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4921 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4922 theState The state of the sub-shapes to find (see GEOM::shape_state)
4923 theName Object name; when specified, this parameter is used
4924 for result publication in the study. Otherwise, if automatic
4925 publication is switched on, default value is used for result name.
4928 List of all found sub-shapes.
4930 # Example: see GEOM_TestOthers.py
4931 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4932 theTopLeftPoint, theTopRigthPoint,
4933 theBottomLeftPoint, theBottomRigthPoint, theState)
4934 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4935 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4938 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4939 # the specified quadrangle by the certain way, defined through \a theState parameter.
4940 # @param theShape Shape to find sub-shapes of.
4941 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4942 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4943 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4944 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4945 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4946 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4948 # @return List of all found sub-shapes indices.
4950 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4951 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4952 theTopLeftPoint, theTopRigthPoint,
4953 theBottomLeftPoint, theBottomRigthPoint, theState):
4955 Find in theShape all sub-shapes of type theShapeType, situated relatively
4956 the specified quadrangle by the certain way, defined through theState parameter.
4959 theShape Shape to find sub-shapes of.
4960 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4961 theTopLeftPoint Point, specifying top left corner of a quadrangle
4962 theTopRigthPoint Point, specifying top right corner of a quadrangle
4963 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4964 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4965 theState The state of the sub-shapes to find (see GEOM::shape_state)
4968 List of all found sub-shapes indices.
4971 # Example: see GEOM_TestOthers.py
4972 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4973 theTopLeftPoint, theTopRigthPoint,
4974 theBottomLeftPoint, theBottomRigthPoint, theState)
4975 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4978 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4979 # the specified \a theBox by the certain way, defined through \a theState parameter.
4980 # @param theBox Shape for relative comparing.
4981 # @param theShape Shape to find sub-shapes of.
4982 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4983 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4984 # @param theName Object name; when specified, this parameter is used
4985 # for result publication in the study. Otherwise, if automatic
4986 # publication is switched on, default value is used for result name.
4988 # @return List of all found sub-shapes.
4990 # @ref swig_GetShapesOnBox "Example"
4991 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4993 Find in theShape all sub-shapes of type theShapeType, situated relatively
4994 the specified theBox by the certain way, defined through theState parameter.
4997 theBox Shape for relative comparing.
4998 theShape Shape to find sub-shapes of.
4999 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5000 theState The state of the sub-shapes to find (see GEOM::shape_state)
5001 theName Object name; when specified, this parameter is used
5002 for result publication in the study. Otherwise, if automatic
5003 publication is switched on, default value is used for result name.
5006 List of all found sub-shapes.
5008 # Example: see GEOM_TestOthers.py
5009 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5010 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5011 self._autoPublish(aList, theName, "shapeOnBox")
5014 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5015 # the specified \a theBox by the certain way, defined through \a theState parameter.
5016 # @param theBox Shape for relative comparing.
5017 # @param theShape Shape to find sub-shapes of.
5018 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5019 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5021 # @return List of all found sub-shapes indices.
5023 # @ref swig_GetShapesOnBoxIDs "Example"
5024 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5026 Find in theShape all sub-shapes of type theShapeType, situated relatively
5027 the specified theBox by the certain way, defined through theState parameter.
5030 theBox Shape for relative comparing.
5031 theShape Shape to find sub-shapes of.
5032 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5033 theState The state of the sub-shapes to find (see GEOM::shape_state)
5036 List of all found sub-shapes indices.
5038 # Example: see GEOM_TestOthers.py
5039 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5040 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5043 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5044 # situated relatively the specified \a theCheckShape by the
5045 # certain way, defined through \a theState parameter.
5046 # @param theCheckShape Shape for relative comparing. It must be a solid.
5047 # @param theShape Shape to find sub-shapes of.
5048 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5049 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5050 # @param theName Object name; when specified, this parameter is used
5051 # for result publication in the study. Otherwise, if automatic
5052 # publication is switched on, default value is used for result name.
5054 # @return List of all found sub-shapes.
5056 # @ref swig_GetShapesOnShape "Example"
5057 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5059 Find in theShape all sub-shapes of type theShapeType,
5060 situated relatively the specified theCheckShape by the
5061 certain way, defined through theState parameter.
5064 theCheckShape Shape for relative comparing. It must be a solid.
5065 theShape Shape to find sub-shapes of.
5066 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5067 theState The state of the sub-shapes to find (see GEOM::shape_state)
5068 theName Object name; when specified, this parameter is used
5069 for result publication in the study. Otherwise, if automatic
5070 publication is switched on, default value is used for result name.
5073 List of all found sub-shapes.
5075 # Example: see GEOM_TestOthers.py
5076 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5077 theShapeType, theState)
5078 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5079 self._autoPublish(aList, theName, "shapeOnShape")
5082 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5083 # situated relatively the specified \a theCheckShape by the
5084 # certain way, defined through \a theState parameter.
5085 # @param theCheckShape Shape for relative comparing. It must be a solid.
5086 # @param theShape Shape to find sub-shapes of.
5087 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5088 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5089 # @param theName Object name; when specified, this parameter is used
5090 # for result publication in the study. Otherwise, if automatic
5091 # publication is switched on, default value is used for result name.
5093 # @return All found sub-shapes as compound.
5095 # @ref swig_GetShapesOnShapeAsCompound "Example"
5096 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5098 Find in theShape all sub-shapes of type theShapeType,
5099 situated relatively the specified theCheckShape by the
5100 certain way, defined through theState parameter.
5103 theCheckShape Shape for relative comparing. It must be a solid.
5104 theShape Shape to find sub-shapes of.
5105 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5106 theState The state of the sub-shapes to find (see GEOM::shape_state)
5107 theName Object name; when specified, this parameter is used
5108 for result publication in the study. Otherwise, if automatic
5109 publication is switched on, default value is used for result name.
5112 All found sub-shapes as compound.
5114 # Example: see GEOM_TestOthers.py
5115 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5116 theShapeType, theState)
5117 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5118 self._autoPublish(anObj, theName, "shapeOnShape")
5121 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5122 # situated relatively the specified \a theCheckShape by the
5123 # certain way, defined through \a theState parameter.
5124 # @param theCheckShape Shape for relative comparing. It must be a solid.
5125 # @param theShape Shape to find sub-shapes of.
5126 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5127 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5129 # @return List of all found sub-shapes indices.
5131 # @ref swig_GetShapesOnShapeIDs "Example"
5132 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5134 Find in theShape all sub-shapes of type theShapeType,
5135 situated relatively the specified theCheckShape by the
5136 certain way, defined through theState parameter.
5139 theCheckShape Shape for relative comparing. It must be a solid.
5140 theShape Shape to find sub-shapes of.
5141 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5142 theState The state of the sub-shapes to find (see GEOM::shape_state)
5145 List of all found sub-shapes indices.
5147 # Example: see GEOM_TestOthers.py
5148 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5149 theShapeType, theState)
5150 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5153 ## Get sub-shape(s) of theShapeWhere, which are
5154 # coincident with \a theShapeWhat or could be a part of it.
5155 # @param theShapeWhere Shape to find sub-shapes of.
5156 # @param theShapeWhat Shape, specifying what to find.
5157 # @param isNewImplementation implementation of GetInPlace functionality
5158 # (default = False, old alghorithm based on shape properties)
5159 # @param theName Object name; when specified, this parameter is used
5160 # for result publication in the study. Otherwise, if automatic
5161 # publication is switched on, default value is used for result name.
5163 # @return Group of all found sub-shapes or a single found sub-shape.
5165 # @note This function has a restriction on argument shapes.
5166 # If \a theShapeWhere has curved parts with significantly
5167 # outstanding centres (i.e. the mass centre of a part is closer to
5168 # \a theShapeWhat than to the part), such parts will not be found.
5169 # @image html get_in_place_lost_part.png
5171 # @ref swig_GetInPlace "Example"
5172 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5174 Get sub-shape(s) of theShapeWhere, which are
5175 coincident with theShapeWhat or could be a part of it.
5178 theShapeWhere Shape to find sub-shapes of.
5179 theShapeWhat Shape, specifying what to find.
5180 isNewImplementation Implementation of GetInPlace functionality
5181 (default = False, old alghorithm based on shape properties)
5182 theName Object name; when specified, this parameter is used
5183 for result publication in the study. Otherwise, if automatic
5184 publication is switched on, default value is used for result name.
5187 Group of all found sub-shapes or a single found sub-shape.
5191 This function has a restriction on argument shapes.
5192 If theShapeWhere has curved parts with significantly
5193 outstanding centres (i.e. the mass centre of a part is closer to
5194 theShapeWhat than to the part), such parts will not be found.
5196 # Example: see GEOM_TestOthers.py
5198 if isNewImplementation:
5199 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5201 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5203 RaiseIfFailed("GetInPlace", self.ShapesOp)
5204 self._autoPublish(anObj, theName, "inplace")
5207 ## Get sub-shape(s) of \a theShapeWhere, which are
5208 # coincident with \a theShapeWhat or could be a part of it.
5210 # Implementation of this method is based on a saved history of an operation,
5211 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5212 # arguments (an argument shape or a sub-shape of an argument shape).
5213 # The operation could be the Partition or one of boolean operations,
5214 # performed on simple shapes (not on compounds).
5216 # @param theShapeWhere Shape to find sub-shapes of.
5217 # @param theShapeWhat Shape, specifying what to find (must be in the
5218 # building history of the ShapeWhere).
5219 # @param theName Object name; when specified, this parameter is used
5220 # for result publication in the study. Otherwise, if automatic
5221 # publication is switched on, default value is used for result name.
5223 # @return Group of all found sub-shapes or a single found sub-shape.
5225 # @ref swig_GetInPlace "Example"
5226 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5228 Implementation of this method is based on a saved history of an operation,
5229 produced theShapeWhere. The theShapeWhat must be among this operation's
5230 arguments (an argument shape or a sub-shape of an argument shape).
5231 The operation could be the Partition or one of boolean operations,
5232 performed on simple shapes (not on compounds).
5235 theShapeWhere Shape to find sub-shapes of.
5236 theShapeWhat Shape, specifying what to find (must be in the
5237 building history of the ShapeWhere).
5238 theName Object name; when specified, this parameter is used
5239 for result publication in the study. Otherwise, if automatic
5240 publication is switched on, default value is used for result name.
5243 Group of all found sub-shapes or a single found sub-shape.
5245 # Example: see GEOM_TestOthers.py
5246 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5247 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5248 self._autoPublish(anObj, theName, "inplace")
5251 ## Get sub-shape of theShapeWhere, which is
5252 # equal to \a theShapeWhat.
5253 # @param theShapeWhere Shape to find sub-shape of.
5254 # @param theShapeWhat Shape, specifying what to find.
5255 # @param theName Object name; when specified, this parameter is used
5256 # for result publication in the study. Otherwise, if automatic
5257 # publication is switched on, default value is used for result name.
5259 # @return New GEOM.GEOM_Object for found sub-shape.
5261 # @ref swig_GetSame "Example"
5262 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5264 Get sub-shape of theShapeWhere, which is
5265 equal to theShapeWhat.
5268 theShapeWhere Shape to find sub-shape of.
5269 theShapeWhat Shape, specifying what to find.
5270 theName Object name; when specified, this parameter is used
5271 for result publication in the study. Otherwise, if automatic
5272 publication is switched on, default value is used for result name.
5275 New GEOM.GEOM_Object for found sub-shape.
5277 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5278 RaiseIfFailed("GetSame", self.ShapesOp)
5279 self._autoPublish(anObj, theName, "sameShape")
5283 ## Get sub-shape indices of theShapeWhere, which is
5284 # equal to \a theShapeWhat.
5285 # @param theShapeWhere Shape to find sub-shape of.
5286 # @param theShapeWhat Shape, specifying what to find.
5287 # @return List of all found sub-shapes indices.
5289 # @ref swig_GetSame "Example"
5290 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5292 Get sub-shape indices of theShapeWhere, which is
5293 equal to theShapeWhat.
5296 theShapeWhere Shape to find sub-shape of.
5297 theShapeWhat Shape, specifying what to find.
5300 List of all found sub-shapes indices.
5302 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5303 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5310 ## @addtogroup l4_access
5313 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5314 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5315 # @param aShape Shape to get sub-shape of.
5316 # @param ListOfID List of sub-shapes indices.
5317 # @param theName Object name; when specified, this parameter is used
5318 # for result publication in the study. Otherwise, if automatic
5319 # publication is switched on, default value is used for result name.
5321 # @return Found sub-shape.
5323 # @ref swig_all_decompose "Example"
5324 def GetSubShape(self, aShape, ListOfID, theName=None):
5326 Obtain a composite sub-shape of aShape, composed from sub-shapes
5327 of aShape, selected by their unique IDs inside aShape
5330 aShape Shape to get sub-shape of.
5331 ListOfID List of sub-shapes indices.
5332 theName Object name; when specified, this parameter is used
5333 for result publication in the study. Otherwise, if automatic
5334 publication is switched on, default value is used for result name.
5339 # Example: see GEOM_TestAll.py
5340 anObj = self.AddSubShape(aShape,ListOfID)
5341 self._autoPublish(anObj, theName, "subshape")
5344 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5345 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5346 # @param aShape Shape to get sub-shape of.
5347 # @param aSubShape Sub-shapes of aShape.
5348 # @return ID of found sub-shape.
5350 # @ref swig_all_decompose "Example"
5351 def GetSubShapeID(self, aShape, aSubShape):
5353 Obtain unique ID of sub-shape aSubShape inside aShape
5354 of aShape, selected by their unique IDs inside aShape
5357 aShape Shape to get sub-shape of.
5358 aSubShape Sub-shapes of aShape.
5361 ID of found sub-shape.
5363 # Example: see GEOM_TestAll.py
5364 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5365 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5368 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5369 # This function is provided for performance purpose. The complexity is O(n) with n
5370 # the number of subobjects of aShape
5371 # @param aShape Shape to get sub-shape of.
5372 # @param aSubShapes Sub-shapes of aShape.
5373 # @return list of IDs of found sub-shapes.
5375 # @ref swig_all_decompose "Example"
5376 def GetSubShapesIDs(self, aShape, aSubShapes):
5378 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5379 This function is provided for performance purpose. The complexity is O(n) with n
5380 the number of subobjects of aShape
5383 aShape Shape to get sub-shape of.
5384 aSubShapes Sub-shapes of aShape.
5387 List of IDs of found sub-shape.
5389 # Example: see GEOM_TestAll.py
5390 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5391 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5397 ## @addtogroup l4_decompose
5400 ## Get all sub-shapes and groups of \a theShape,
5401 # that were created already by any other methods.
5402 # @param theShape Any shape.
5403 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5404 # returned, else all found sub-shapes and groups.
5405 # @return List of existing sub-objects of \a theShape.
5407 # @ref swig_all_decompose "Example"
5408 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5410 Get all sub-shapes and groups of theShape,
5411 that were created already by any other methods.
5415 theGroupsOnly If this parameter is TRUE, only groups will be
5416 returned, else all found sub-shapes and groups.
5419 List of existing sub-objects of theShape.
5421 # Example: see GEOM_TestAll.py
5422 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5423 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5426 ## Get all groups of \a theShape,
5427 # that were created already by any other methods.
5428 # @param theShape Any shape.
5429 # @return List of existing groups of \a theShape.
5431 # @ref swig_all_decompose "Example"
5432 def GetGroups(self, theShape):
5434 Get all groups of theShape,
5435 that were created already by any other methods.
5441 List of existing groups of theShape.
5443 # Example: see GEOM_TestAll.py
5444 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5445 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5448 ## Explode a shape on sub-shapes of a given type.
5449 # If the shape itself matches the type, it is also returned.
5450 # @param aShape Shape to be exploded.
5451 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5452 # @param theName Object name; when specified, this parameter is used
5453 # for result publication in the study. Otherwise, if automatic
5454 # publication is switched on, default value is used for result name.
5456 # @return List of sub-shapes of type theShapeType, contained in theShape.
5458 # @ref swig_all_decompose "Example"
5459 def SubShapeAll(self, aShape, aType, theName=None):
5461 Explode a shape on sub-shapes of a given type.
5462 If the shape itself matches the type, it is also returned.
5465 aShape Shape to be exploded.
5466 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5467 theName Object name; when specified, this parameter is used
5468 for result publication in the study. Otherwise, if automatic
5469 publication is switched on, default value is used for result name.
5472 List of sub-shapes of type theShapeType, contained in theShape.
5474 # Example: see GEOM_TestAll.py
5475 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5476 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5477 self._autoPublish(ListObj, theName, "subshape")
5480 ## Explode a shape on sub-shapes of a given type.
5481 # @param aShape Shape to be exploded.
5482 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5483 # @return List of IDs of sub-shapes.
5485 # @ref swig_all_decompose "Example"
5486 def SubShapeAllIDs(self, aShape, aType):
5488 Explode a shape on sub-shapes of a given type.
5491 aShape Shape to be exploded (see geompy.ShapeType)
5492 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5495 List of IDs of sub-shapes.
5497 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5498 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5501 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5502 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5503 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5504 # @param aShape Shape to get sub-shape of.
5505 # @param ListOfInd List of sub-shapes indices.
5506 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5507 # @param theName Object name; when specified, this parameter is used
5508 # for result publication in the study. Otherwise, if automatic
5509 # publication is switched on, default value is used for result name.
5511 # @return A compound of sub-shapes of aShape.
5513 # @ref swig_all_decompose "Example"
5514 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5516 Obtain a compound of sub-shapes of aShape,
5517 selected by their indices in list of all sub-shapes of type aType.
5518 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5521 aShape Shape to get sub-shape of.
5522 ListOfID List of sub-shapes indices.
5523 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5524 theName Object name; when specified, this parameter is used
5525 for result publication in the study. Otherwise, if automatic
5526 publication is switched on, default value is used for result name.
5529 A compound of sub-shapes of aShape.
5531 # Example: see GEOM_TestAll.py
5533 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5534 for ind in ListOfInd:
5535 ListOfIDs.append(AllShapeIDsList[ind - 1])
5536 # note: auto-publishing is done in self.GetSubShape()
5537 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5540 ## Explode a shape on sub-shapes of a given type.
5541 # Sub-shapes will be sorted by coordinates of their gravity centers.
5542 # If the shape itself matches the type, it is also returned.
5543 # @param aShape Shape to be exploded.
5544 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5545 # @param theName Object name; when specified, this parameter is used
5546 # for result publication in the study. Otherwise, if automatic
5547 # publication is switched on, default value is used for result name.
5549 # @return List of sub-shapes of type theShapeType, contained in theShape.
5551 # @ref swig_SubShapeAllSorted "Example"
5552 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5554 Explode a shape on sub-shapes of a given type.
5555 Sub-shapes will be sorted by coordinates of their gravity centers.
5556 If the shape itself matches the type, it is also returned.
5559 aShape Shape to be exploded.
5560 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5561 theName Object name; when specified, this parameter is used
5562 for result publication in the study. Otherwise, if automatic
5563 publication is switched on, default value is used for result name.
5566 List of sub-shapes of type theShapeType, contained in theShape.
5568 # Example: see GEOM_TestAll.py
5569 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5570 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5571 self._autoPublish(ListObj, theName, "subshape")
5574 ## Explode a shape on sub-shapes of a given type.
5575 # Sub-shapes will be sorted by coordinates of their gravity centers.
5576 # @param aShape Shape to be exploded.
5577 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5578 # @return List of IDs of sub-shapes.
5580 # @ref swig_all_decompose "Example"
5581 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5583 Explode a shape on sub-shapes of a given type.
5584 Sub-shapes will be sorted by coordinates of their gravity centers.
5587 aShape Shape to be exploded.
5588 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5591 List of IDs of sub-shapes.
5593 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5594 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5597 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5598 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5599 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5600 # @param aShape Shape to get sub-shape of.
5601 # @param ListOfInd List of sub-shapes indices.
5602 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5603 # @param theName Object name; when specified, this parameter is used
5604 # for result publication in the study. Otherwise, if automatic
5605 # publication is switched on, default value is used for result name.
5607 # @return A compound of sub-shapes of aShape.
5609 # @ref swig_all_decompose "Example"
5610 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5612 Obtain a compound of sub-shapes of aShape,
5613 selected by they indices in sorted list of all sub-shapes of type aType.
5614 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5617 aShape Shape to get sub-shape of.
5618 ListOfID List of sub-shapes indices.
5619 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5620 theName Object name; when specified, this parameter is used
5621 for result publication in the study. Otherwise, if automatic
5622 publication is switched on, default value is used for result name.
5625 A compound of sub-shapes of aShape.
5627 # Example: see GEOM_TestAll.py
5629 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5630 for ind in ListOfInd:
5631 ListOfIDs.append(AllShapeIDsList[ind - 1])
5632 # note: auto-publishing is done in self.GetSubShape()
5633 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5636 ## Extract shapes (excluding the main shape) of given type.
5637 # @param aShape The shape.
5638 # @param aType The shape type (see ShapeType())
5639 # @param isSorted Boolean flag to switch sorting on/off.
5640 # @param theName Object name; when specified, this parameter is used
5641 # for result publication in the study. Otherwise, if automatic
5642 # publication is switched on, default value is used for result name.
5644 # @return List of sub-shapes of type aType, contained in aShape.
5646 # @ref swig_FilletChamfer "Example"
5647 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5649 Extract shapes (excluding the main shape) of given type.
5653 aType The shape type (see geompy.ShapeType)
5654 isSorted Boolean flag to switch sorting on/off.
5655 theName Object name; when specified, this parameter is used
5656 for result publication in the study. Otherwise, if automatic
5657 publication is switched on, default value is used for result name.
5660 List of sub-shapes of type aType, contained in aShape.
5662 # Example: see GEOM_TestAll.py
5663 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5664 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5665 self._autoPublish(ListObj, theName, "subshape")
5668 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5669 # @param aShape Main shape.
5670 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5671 # @param theName Object name; when specified, this parameter is used
5672 # for result publication in the study. Otherwise, if automatic
5673 # publication is switched on, default value is used for result name.
5674 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5676 # @ref swig_all_decompose "Example"
5677 def SubShapes(self, aShape, anIDs, theName=None):
5679 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5683 anIDs List of unique IDs of sub-shapes inside theMainShape.
5684 theName Object name; when specified, this parameter is used
5685 for result publication in the study. Otherwise, if automatic
5686 publication is switched on, default value is used for result name.
5689 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5691 # Example: see GEOM_TestAll.py
5692 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5693 RaiseIfFailed("SubShapes", self.ShapesOp)
5694 self._autoPublish(ListObj, theName, "subshape")
5697 # end of l4_decompose
5700 ## @addtogroup l4_decompose_d
5703 ## Deprecated method
5704 # It works like SubShapeAllSortedCentres(), but wrongly
5705 # defines centres of faces, shells and solids.
5706 def SubShapeAllSorted(self, aShape, aType, theName=None):
5709 It works like geompy.SubShapeAllSortedCentres, but wrongly
5710 defines centres of faces, shells and solids.
5712 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5713 RaiseIfFailed("MakeExplode", self.ShapesOp)
5714 self._autoPublish(ListObj, theName, "subshape")
5717 ## Deprecated method
5718 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5719 # defines centres of faces, shells and solids.
5720 def SubShapeAllSortedIDs(self, aShape, aType):
5723 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5724 defines centres of faces, shells and solids.
5726 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5727 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5730 ## Deprecated method
5731 # It works like SubShapeSortedCentres(), but has a bug
5732 # (wrongly defines centres of faces, shells and solids).
5733 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5736 It works like geompy.SubShapeSortedCentres, but has a bug
5737 (wrongly defines centres of faces, shells and solids).
5740 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5741 for ind in ListOfInd:
5742 ListOfIDs.append(AllShapeIDsList[ind - 1])
5743 # note: auto-publishing is done in self.GetSubShape()
5744 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5747 # end of l4_decompose_d
5750 ## @addtogroup l3_healing
5753 ## Apply a sequence of Shape Healing operators to the given object.
5754 # @param theShape Shape to be processed.
5755 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5756 # @param theParameters List of names of parameters
5757 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5758 # @param theValues List of values of parameters, in the same order
5759 # as parameters are listed in <VAR>theParameters</VAR> list.
5760 # @param theName Object name; when specified, this parameter is used
5761 # for result publication in the study. Otherwise, if automatic
5762 # publication is switched on, default value is used for result name.
5764 # <b> Operators and Parameters: </b> \n
5766 # * \b FixShape - corrects invalid shapes. \n
5767 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5768 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5770 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5771 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5772 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5773 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5775 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5776 # surfaces in segments using a certain angle. \n
5777 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5778 # if Angle=180, four if Angle=90, etc). \n
5779 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5781 # * \b SplitClosedFaces - splits closed faces in segments.
5782 # The number of segments depends on the number of splitting points.\n
5783 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5785 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5786 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5787 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5788 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5789 # This and the previous parameters can take the following values:\n
5790 # \b Parametric \b Continuity \n
5791 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5792 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5793 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5794 # ruling out sharp edges).\n
5795 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5796 # are of the same magnitude).\n
5797 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5798 # or surfaces (d/du C(u)) are the same at junction. \n
5799 # \b Geometric \b Continuity \n
5800 # \b G1: first derivatives are proportional at junction.\n
5801 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5802 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5803 # \b G2: first and second derivatives are proportional at junction.
5804 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5805 # continuity requires that the underlying parameterization was continuous as well.
5806 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5808 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5809 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5810 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5811 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5812 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5813 # with the specified parameters.\n
5814 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5815 # with the specified parameters.\n
5816 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5817 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5818 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5819 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5821 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5822 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5823 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5824 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5825 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5827 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5828 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5831 # @return New GEOM.GEOM_Object, containing processed shape.
5833 # \n @ref tui_shape_processing "Example"
5834 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5836 Apply a sequence of Shape Healing operators to the given object.
5839 theShape Shape to be processed.
5840 theValues List of values of parameters, in the same order
5841 as parameters are listed in theParameters list.
5842 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5843 theParameters List of names of parameters
5844 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5845 theName Object name; when specified, this parameter is used
5846 for result publication in the study. Otherwise, if automatic
5847 publication is switched on, default value is used for result name.
5849 Operators and Parameters:
5851 * FixShape - corrects invalid shapes.
5852 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5853 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5854 * FixFaceSize - removes small faces, such as spots and strips.
5855 * FixFaceSize.Tolerance - defines minimum possible face size.
5856 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5857 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5858 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5859 in segments using a certain angle.
5860 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5861 if Angle=180, four if Angle=90, etc).
5862 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5863 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5865 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5866 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5867 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5868 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5869 * SplitContinuity.CurveContinuity - required continuity for curves.
5870 This and the previous parameters can take the following values:
5872 Parametric Continuity:
5873 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5874 coincidental. The curves or surfaces may still meet at an angle,
5875 giving rise to a sharp corner or edge).
5876 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5877 are parallel, ruling out sharp edges).
5878 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5879 or surfaces are of the same magnitude).
5880 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5881 curves or surfaces (d/du C(u)) are the same at junction.
5883 Geometric Continuity:
5884 G1: first derivatives are proportional at junction.
5885 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5886 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5887 G2: first and second derivatives are proportional at junction. As the names imply,
5888 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5889 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5890 geometric continuity of order n, but not vice-versa.
5891 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5892 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5893 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5894 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5895 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5896 the specified parameters.
5897 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5898 the specified parameters.
5899 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5900 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5901 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5902 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5903 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5904 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5905 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5906 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5907 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5908 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5909 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5912 New GEOM.GEOM_Object, containing processed shape.
5914 Note: For more information look through SALOME Geometry User's Guide->
5915 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5917 # Example: see GEOM_TestHealing.py
5918 theValues,Parameters = ParseList(theValues)
5919 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5920 # To avoid script failure in case of good argument shape
5921 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5923 RaiseIfFailed("ProcessShape", self.HealOp)
5924 for string in (theOperators + theParameters):
5925 Parameters = ":" + Parameters
5927 anObj.SetParameters(Parameters)
5928 self._autoPublish(anObj, theName, "healed")
5931 ## Remove faces from the given object (shape).
5932 # @param theObject Shape to be processed.
5933 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5934 # removes ALL faces of the given object.
5935 # @param theName Object name; when specified, this parameter is used
5936 # for result publication in the study. Otherwise, if automatic
5937 # publication is switched on, default value is used for result name.
5939 # @return New GEOM.GEOM_Object, containing processed shape.
5941 # @ref tui_suppress_faces "Example"
5942 def SuppressFaces(self, theObject, theFaces, theName=None):
5944 Remove faces from the given object (shape).
5947 theObject Shape to be processed.
5948 theFaces Indices of faces to be removed, if EMPTY then the method
5949 removes ALL faces of the given object.
5950 theName Object name; when specified, this parameter is used
5951 for result publication in the study. Otherwise, if automatic
5952 publication is switched on, default value is used for result name.
5955 New GEOM.GEOM_Object, containing processed shape.
5957 # Example: see GEOM_TestHealing.py
5958 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5959 RaiseIfFailed("SuppressFaces", self.HealOp)
5960 self._autoPublish(anObj, theName, "suppressFaces")
5963 ## Sewing of some shapes into single shape.
5964 # @param ListShape Shapes to be processed.
5965 # @param theTolerance Required tolerance value.
5966 # @param AllowNonManifold Flag that allows non-manifold sewing.
5967 # @param theName Object name; when specified, this parameter is used
5968 # for result publication in the study. Otherwise, if automatic
5969 # publication is switched on, default value is used for result name.
5971 # @return New GEOM.GEOM_Object, containing processed shape.
5973 # @ref tui_sewing "Example"
5974 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
5976 Sewing of some shapes into single shape.
5979 ListShape Shapes to be processed.
5980 theTolerance Required tolerance value.
5981 AllowNonManifold Flag that allows non-manifold sewing.
5982 theName Object name; when specified, this parameter is used
5983 for result publication in the study. Otherwise, if automatic
5984 publication is switched on, default value is used for result name.
5987 New GEOM.GEOM_Object, containing processed shape.
5989 # Example: see GEOM_TestHealing.py
5990 comp = self.MakeCompound(ListShape)
5991 # note: auto-publishing is done in self.Sew()
5992 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
5995 ## Sewing of the given object.
5996 # @param theObject Shape to be processed.
5997 # @param theTolerance Required tolerance value.
5998 # @param AllowNonManifold Flag that allows non-manifold sewing.
5999 # @param theName Object name; when specified, this parameter is used
6000 # for result publication in the study. Otherwise, if automatic
6001 # publication is switched on, default value is used for result name.
6003 # @return New GEOM.GEOM_Object, containing processed shape.
6004 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6006 Sewing of the given object.
6009 theObject Shape to be processed.
6010 theTolerance Required tolerance value.
6011 AllowNonManifold Flag that allows non-manifold sewing.
6012 theName Object name; when specified, this parameter is used
6013 for result publication in the study. Otherwise, if automatic
6014 publication is switched on, default value is used for result name.
6017 New GEOM.GEOM_Object, containing processed shape.
6019 # Example: see MakeSewing() above
6020 theTolerance,Parameters = ParseParameters(theTolerance)
6021 if AllowNonManifold:
6022 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6024 anObj = self.HealOp.Sew(theObject, theTolerance)
6025 RaiseIfFailed("Sew", self.HealOp)
6026 anObj.SetParameters(Parameters)
6027 self._autoPublish(anObj, theName, "sewed")
6030 ## Rebuild the topology of theCompound of solids by removing
6031 # of the faces that are shared by several solids.
6032 # @param theCompound Shape to be processed.
6033 # @param theName Object name; when specified, this parameter is used
6034 # for result publication in the study. Otherwise, if automatic
6035 # publication is switched on, default value is used for result name.
6037 # @return New GEOM.GEOM_Object, containing processed shape.
6039 # @ref tui_remove_webs "Example"
6040 def RemoveInternalFaces (self, theCompound, theName=None):
6042 Rebuild the topology of theCompound of solids by removing
6043 of the faces that are shared by several solids.
6046 theCompound Shape to be processed.
6047 theName Object name; when specified, this parameter is used
6048 for result publication in the study. Otherwise, if automatic
6049 publication is switched on, default value is used for result name.
6052 New GEOM.GEOM_Object, containing processed shape.
6054 # Example: see GEOM_TestHealing.py
6055 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6056 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6057 self._autoPublish(anObj, theName, "removeWebs")
6060 ## Remove internal wires and edges from the given object (face).
6061 # @param theObject Shape to be processed.
6062 # @param theWires Indices of wires to be removed, if EMPTY then the method
6063 # removes ALL internal wires of the given object.
6064 # @param theName Object name; when specified, this parameter is used
6065 # for result publication in the study. Otherwise, if automatic
6066 # publication is switched on, default value is used for result name.
6068 # @return New GEOM.GEOM_Object, containing processed shape.
6070 # @ref tui_suppress_internal_wires "Example"
6071 def SuppressInternalWires(self, theObject, theWires, theName=None):
6073 Remove internal wires and edges from the given object (face).
6076 theObject Shape to be processed.
6077 theWires Indices of wires to be removed, if EMPTY then the method
6078 removes ALL internal wires of the given object.
6079 theName Object name; when specified, this parameter is used
6080 for result publication in the study. Otherwise, if automatic
6081 publication is switched on, default value is used for result name.
6084 New GEOM.GEOM_Object, containing processed shape.
6086 # Example: see GEOM_TestHealing.py
6087 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6088 RaiseIfFailed("RemoveIntWires", self.HealOp)
6089 self._autoPublish(anObj, theName, "suppressWires")
6092 ## Remove internal closed contours (holes) from the given object.
6093 # @param theObject Shape to be processed.
6094 # @param theWires Indices of wires to be removed, if EMPTY then the method
6095 # removes ALL internal holes of the given object
6096 # @param theName Object name; when specified, this parameter is used
6097 # for result publication in the study. Otherwise, if automatic
6098 # publication is switched on, default value is used for result name.
6100 # @return New GEOM.GEOM_Object, containing processed shape.
6102 # @ref tui_suppress_holes "Example"
6103 def SuppressHoles(self, theObject, theWires, theName=None):
6105 Remove internal closed contours (holes) from the given object.
6108 theObject Shape to be processed.
6109 theWires Indices of wires to be removed, if EMPTY then the method
6110 removes ALL internal holes of the given object
6111 theName Object name; when specified, this parameter is used
6112 for result publication in the study. Otherwise, if automatic
6113 publication is switched on, default value is used for result name.
6116 New GEOM.GEOM_Object, containing processed shape.
6118 # Example: see GEOM_TestHealing.py
6119 anObj = self.HealOp.FillHoles(theObject, theWires)
6120 RaiseIfFailed("FillHoles", self.HealOp)
6121 self._autoPublish(anObj, theName, "suppressHoles")
6124 ## Close an open wire.
6125 # @param theObject Shape to be processed.
6126 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6127 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6128 # @param isCommonVertex If True : closure by creation of a common vertex,
6129 # If False : closure by creation of an edge between ends.
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_close_contour "Example"
6137 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6142 theObject Shape to be processed.
6143 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6144 if [ ], then theObject itself is a wire.
6145 isCommonVertex If True : closure by creation of a common vertex,
6146 If False : closure by creation of an edge between ends.
6147 theName Object name; when specified, this parameter is used
6148 for result publication in the study. Otherwise, if automatic
6149 publication is switched on, default value is used for result name.
6152 New GEOM.GEOM_Object, containing processed shape.
6154 # Example: see GEOM_TestHealing.py
6155 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6156 RaiseIfFailed("CloseContour", self.HealOp)
6157 self._autoPublish(anObj, theName, "closeContour")
6160 ## Addition of a point to a given edge object.
6161 # @param theObject Shape to be processed.
6162 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6163 # if -1, then theObject itself is the edge.
6164 # @param theValue Value of parameter on edge or length parameter,
6165 # depending on \a isByParameter.
6166 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6167 # if FALSE : \a theValue is treated as a length parameter [0..1]
6168 # @param theName Object name; when specified, this parameter is used
6169 # for result publication in the study. Otherwise, if automatic
6170 # publication is switched on, default value is used for result name.
6172 # @return New GEOM.GEOM_Object, containing processed shape.
6174 # @ref tui_add_point_on_edge "Example"
6175 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6177 Addition of a point to a given edge object.
6180 theObject Shape to be processed.
6181 theEdgeIndex Index of edge to be divided within theObject's shape,
6182 if -1, then theObject itself is the edge.
6183 theValue Value of parameter on edge or length parameter,
6184 depending on isByParameter.
6185 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6186 if FALSE : theValue is treated as a length parameter [0..1]
6187 theName Object name; when specified, this parameter is used
6188 for result publication in the study. Otherwise, if automatic
6189 publication is switched on, default value is used for result name.
6192 New GEOM.GEOM_Object, containing processed shape.
6194 # Example: see GEOM_TestHealing.py
6195 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6196 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6197 RaiseIfFailed("DivideEdge", self.HealOp)
6198 anObj.SetParameters(Parameters)
6199 self._autoPublish(anObj, theName, "divideEdge")
6202 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6203 # @param theWire Wire to minimize the number of C1 continuous edges in.
6204 # @param theVertices A list of vertices to suppress. If the list
6205 # is empty, all vertices in a wire will be assumed.
6206 # @param theName Object name; when specified, this parameter is used
6207 # for result publication in the study. Otherwise, if automatic
6208 # publication is switched on, default value is used for result name.
6210 # @return New GEOM.GEOM_Object with modified wire.
6212 # @ref tui_fuse_collinear_edges "Example"
6213 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6215 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6218 theWire Wire to minimize the number of C1 continuous edges in.
6219 theVertices A list of vertices to suppress. If the list
6220 is empty, all vertices in a wire will be assumed.
6221 theName Object name; when specified, this parameter is used
6222 for result publication in the study. Otherwise, if automatic
6223 publication is switched on, default value is used for result name.
6226 New GEOM.GEOM_Object with modified wire.
6228 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6229 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6230 self._autoPublish(anObj, theName, "fuseEdges")
6233 ## Change orientation of the given object. Updates given shape.
6234 # @param theObject Shape to be processed.
6235 # @return Updated <var>theObject</var>
6237 # @ref swig_todo "Example"
6238 def ChangeOrientationShell(self,theObject):
6240 Change orientation of the given object. Updates given shape.
6243 theObject Shape to be processed.
6248 theObject = self.HealOp.ChangeOrientation(theObject)
6249 RaiseIfFailed("ChangeOrientation", self.HealOp)
6252 ## Change orientation of the given object.
6253 # @param theObject Shape to be processed.
6254 # @param theName Object name; when specified, this parameter is used
6255 # for result publication in the study. Otherwise, if automatic
6256 # publication is switched on, default value is used for result name.
6258 # @return New GEOM.GEOM_Object, containing processed shape.
6260 # @ref swig_todo "Example"
6261 def ChangeOrientationShellCopy(self, theObject, theName=None):
6263 Change orientation of the given object.
6266 theObject Shape to be processed.
6267 theName Object name; when specified, this parameter is used
6268 for result publication in the study. Otherwise, if automatic
6269 publication is switched on, default value is used for result name.
6272 New GEOM.GEOM_Object, containing processed shape.
6274 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6275 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6276 self._autoPublish(anObj, theName, "reversed")
6279 ## Try to limit tolerance of the given object by value \a theTolerance.
6280 # @param theObject Shape to be processed.
6281 # @param theTolerance Required tolerance value.
6282 # @param theName Object name; when specified, this parameter is used
6283 # for result publication in the study. Otherwise, if automatic
6284 # publication is switched on, default value is used for result name.
6286 # @return New GEOM.GEOM_Object, containing processed shape.
6288 # @ref tui_limit_tolerance "Example"
6289 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6291 Try to limit tolerance of the given object by value theTolerance.
6294 theObject Shape to be processed.
6295 theTolerance Required tolerance value.
6296 theName Object name; when specified, this parameter is used
6297 for result publication in the study. Otherwise, if automatic
6298 publication is switched on, default value is used for result name.
6301 New GEOM.GEOM_Object, containing processed shape.
6303 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6304 RaiseIfFailed("LimitTolerance", self.HealOp)
6305 self._autoPublish(anObj, theName, "limitTolerance")
6308 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6309 # that constitute a free boundary of the given shape.
6310 # @param theObject Shape to get free boundary of.
6311 # @param theName Object name; when specified, this parameter is used
6312 # for result publication in the study. Otherwise, if automatic
6313 # publication is switched on, default value is used for result name.
6315 # @return [\a status, \a theClosedWires, \a theOpenWires]
6316 # \n \a status: FALSE, if an error(s) occured during the method execution.
6317 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6318 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6320 # @ref tui_measurement_tools_page "Example"
6321 def GetFreeBoundary(self, theObject, theName=None):
6323 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6324 that constitute a free boundary of the given shape.
6327 theObject Shape to get free boundary of.
6328 theName Object name; when specified, this parameter is used
6329 for result publication in the study. Otherwise, if automatic
6330 publication is switched on, default value is used for result name.
6333 [status, theClosedWires, theOpenWires]
6334 status: FALSE, if an error(s) occured during the method execution.
6335 theClosedWires: Closed wires on the free boundary of the given shape.
6336 theOpenWires: Open wires on the free boundary of the given shape.
6338 # Example: see GEOM_TestHealing.py
6339 anObj = self.HealOp.GetFreeBoundary(theObject)
6340 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6341 self._autoPublish(anObj[1], theName, "closedWire")
6342 self._autoPublish(anObj[2], theName, "openWire")
6345 ## Replace coincident faces in theShape by one face.
6346 # @param theShape Initial shape.
6347 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6348 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6349 # otherwise all initial shapes.
6350 # @param theName Object name; when specified, this parameter is used
6351 # for result publication in the study. Otherwise, if automatic
6352 # publication is switched on, default value is used for result name.
6354 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6356 # @ref tui_glue_faces "Example"
6357 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6359 Replace coincident faces in theShape by one face.
6362 theShape Initial shape.
6363 theTolerance Maximum distance between faces, which can be considered as coincident.
6364 doKeepNonSolids If FALSE, only solids will present in the result,
6365 otherwise all initial shapes.
6366 theName Object name; when specified, this parameter is used
6367 for result publication in the study. Otherwise, if automatic
6368 publication is switched on, default value is used for result name.
6371 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6373 # Example: see GEOM_Spanner.py
6374 theTolerance,Parameters = ParseParameters(theTolerance)
6375 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6377 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6378 anObj.SetParameters(Parameters)
6379 self._autoPublish(anObj, theName, "glueFaces")
6382 ## Find coincident faces in theShape for possible gluing.
6383 # @param theShape Initial shape.
6384 # @param theTolerance Maximum distance between faces,
6385 # which can be considered as coincident.
6386 # @param theName Object name; when specified, this parameter is used
6387 # for result publication in the study. Otherwise, if automatic
6388 # publication is switched on, default value is used for result name.
6390 # @return GEOM.ListOfGO
6392 # @ref tui_glue_faces "Example"
6393 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6395 Find coincident faces in theShape for possible gluing.
6398 theShape Initial shape.
6399 theTolerance Maximum distance between faces,
6400 which can be considered as coincident.
6401 theName Object name; when specified, this parameter is used
6402 for result publication in the study. Otherwise, if automatic
6403 publication is switched on, default value is used for result name.
6408 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6409 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6410 self._autoPublish(anObj, theName, "facesToGlue")
6413 ## Replace coincident faces in theShape by one face
6414 # in compliance with given list of faces
6415 # @param theShape Initial shape.
6416 # @param theTolerance Maximum distance between faces,
6417 # which can be considered as coincident.
6418 # @param theFaces List of faces for gluing.
6419 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6420 # otherwise all initial shapes.
6421 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6422 # will be glued, otherwise only the edges,
6423 # belonging to <VAR>theFaces</VAR>.
6424 # @param theName Object name; when specified, this parameter is used
6425 # for result publication in the study. Otherwise, if automatic
6426 # publication is switched on, default value is used for result name.
6428 # @return New GEOM.GEOM_Object, containing a copy of theShape
6429 # without some faces.
6431 # @ref tui_glue_faces "Example"
6432 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6433 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6435 Replace coincident faces in theShape by one face
6436 in compliance with given list of faces
6439 theShape Initial shape.
6440 theTolerance Maximum distance between faces,
6441 which can be considered as coincident.
6442 theFaces List of faces for gluing.
6443 doKeepNonSolids If FALSE, only solids will present in the result,
6444 otherwise all initial shapes.
6445 doGlueAllEdges If TRUE, all coincident edges of theShape
6446 will be glued, otherwise only the edges,
6447 belonging to theFaces.
6448 theName Object name; when specified, this parameter is used
6449 for result publication in the study. Otherwise, if automatic
6450 publication is switched on, default value is used for result name.
6453 New GEOM.GEOM_Object, containing a copy of theShape
6456 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6457 doKeepNonSolids, doGlueAllEdges)
6459 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6460 self._autoPublish(anObj, theName, "glueFaces")
6463 ## Replace coincident edges in theShape by one edge.
6464 # @param theShape Initial shape.
6465 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6466 # @param theName Object name; when specified, this parameter is used
6467 # for result publication in the study. Otherwise, if automatic
6468 # publication is switched on, default value is used for result name.
6470 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6472 # @ref tui_glue_edges "Example"
6473 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6475 Replace coincident edges in theShape by one edge.
6478 theShape Initial shape.
6479 theTolerance Maximum distance between edges, which can be considered as coincident.
6480 theName Object name; when specified, this parameter is used
6481 for result publication in the study. Otherwise, if automatic
6482 publication is switched on, default value is used for result name.
6485 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6487 theTolerance,Parameters = ParseParameters(theTolerance)
6488 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6490 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6491 anObj.SetParameters(Parameters)
6492 self._autoPublish(anObj, theName, "glueEdges")
6495 ## Find coincident edges in theShape for possible gluing.
6496 # @param theShape Initial shape.
6497 # @param theTolerance Maximum distance between edges,
6498 # which can be considered as coincident.
6499 # @param theName Object name; when specified, this parameter is used
6500 # for result publication in the study. Otherwise, if automatic
6501 # publication is switched on, default value is used for result name.
6503 # @return GEOM.ListOfGO
6505 # @ref tui_glue_edges "Example"
6506 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6508 Find coincident edges in theShape for possible gluing.
6511 theShape Initial shape.
6512 theTolerance Maximum distance between edges,
6513 which can be considered as coincident.
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.
6521 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6522 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6523 self._autoPublish(anObj, theName, "edgesToGlue")
6526 ## Replace coincident edges in theShape by one edge
6527 # in compliance with given list of edges.
6528 # @param theShape Initial shape.
6529 # @param theTolerance Maximum distance between edges,
6530 # which can be considered as coincident.
6531 # @param theEdges List of edges for gluing.
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
6537 # without some edges.
6539 # @ref tui_glue_edges "Example"
6540 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6542 Replace coincident edges in theShape by one edge
6543 in compliance with given list of edges.
6546 theShape Initial shape.
6547 theTolerance Maximum distance between edges,
6548 which can be considered as coincident.
6549 theEdges List of edges for gluing.
6550 theName Object name; when specified, this parameter is used
6551 for result publication in the study. Otherwise, if automatic
6552 publication is switched on, default value is used for result name.
6555 New GEOM.GEOM_Object, containing a copy of theShape
6558 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6560 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6561 self._autoPublish(anObj, theName, "glueEdges")
6567 ## @addtogroup l3_boolean Boolean Operations
6570 # -----------------------------------------------------------------------------
6571 # Boolean (Common, Cut, Fuse, Section)
6572 # -----------------------------------------------------------------------------
6574 ## Perform one of boolean operations on two given shapes.
6575 # @param theShape1 First argument for boolean operation.
6576 # @param theShape2 Second argument for boolean operation.
6577 # @param theOperation Indicates the operation to be done:\n
6578 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6579 # @param theName Object name; when specified, this parameter is used
6580 # for result publication in the study. Otherwise, if automatic
6581 # publication is switched on, default value is used for result name.
6583 # @return New GEOM.GEOM_Object, containing the result shape.
6585 # @ref tui_fuse "Example"
6586 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6588 Perform one of boolean operations on two given shapes.
6591 theShape1 First argument for boolean operation.
6592 theShape2 Second argument for boolean operation.
6593 theOperation Indicates the operation to be done:
6594 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6595 theName Object name; when specified, this parameter is used
6596 for result publication in the study. Otherwise, if automatic
6597 publication is switched on, default value is used for result name.
6600 New GEOM.GEOM_Object, containing the result shape.
6602 # Example: see GEOM_TestAll.py
6603 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6604 RaiseIfFailed("MakeBoolean", self.BoolOp)
6605 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6606 self._autoPublish(anObj, theName, def_names[theOperation])
6609 ## Perform Common boolean operation on two given shapes.
6610 # @param theShape1 First argument for boolean operation.
6611 # @param theShape2 Second argument for boolean operation.
6612 # @param theName Object name; when specified, this parameter is used
6613 # for result publication in the study. Otherwise, if automatic
6614 # publication is switched on, default value is used for result name.
6616 # @return New GEOM.GEOM_Object, containing the result shape.
6618 # @ref tui_common "Example 1"
6619 # \n @ref swig_MakeCommon "Example 2"
6620 def MakeCommon(self, theShape1, theShape2, theName=None):
6622 Perform Common boolean operation on two given shapes.
6625 theShape1 First argument for boolean operation.
6626 theShape2 Second argument for boolean operation.
6627 theName Object name; when specified, this parameter is used
6628 for result publication in the study. Otherwise, if automatic
6629 publication is switched on, default value is used for result name.
6632 New GEOM.GEOM_Object, containing the result shape.
6634 # Example: see GEOM_TestOthers.py
6635 # note: auto-publishing is done in self.MakeBoolean()
6636 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6638 ## Perform Cut boolean operation on two given shapes.
6639 # @param theShape1 First argument for boolean operation.
6640 # @param theShape2 Second argument for boolean operation.
6641 # @param theName Object name; when specified, this parameter is used
6642 # for result publication in the study. Otherwise, if automatic
6643 # publication is switched on, default value is used for result name.
6645 # @return New GEOM.GEOM_Object, containing the result shape.
6647 # @ref tui_cut "Example 1"
6648 # \n @ref swig_MakeCommon "Example 2"
6649 def MakeCut(self, theShape1, theShape2, theName=None):
6651 Perform Cut boolean operation on two given shapes.
6654 theShape1 First argument for boolean operation.
6655 theShape2 Second argument for boolean operation.
6656 theName Object name; when specified, this parameter is used
6657 for result publication in the study. Otherwise, if automatic
6658 publication is switched on, default value is used for result name.
6661 New GEOM.GEOM_Object, containing the result shape.
6664 # Example: see GEOM_TestOthers.py
6665 # note: auto-publishing is done in self.MakeBoolean()
6666 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6668 ## Perform Fuse boolean operation on two given shapes.
6669 # @param theShape1 First argument for boolean operation.
6670 # @param theShape2 Second argument for boolean operation.
6671 # @param theName Object name; when specified, this parameter is used
6672 # for result publication in the study. Otherwise, if automatic
6673 # publication is switched on, default value is used for result name.
6675 # @return New GEOM.GEOM_Object, containing the result shape.
6677 # @ref tui_fuse "Example 1"
6678 # \n @ref swig_MakeCommon "Example 2"
6679 def MakeFuse(self, theShape1, theShape2, theName=None):
6681 Perform Fuse boolean operation on two given shapes.
6684 theShape1 First argument for boolean operation.
6685 theShape2 Second argument for boolean operation.
6686 theName Object name; when specified, this parameter is used
6687 for result publication in the study. Otherwise, if automatic
6688 publication is switched on, default value is used for result name.
6691 New GEOM.GEOM_Object, containing the result shape.
6694 # Example: see GEOM_TestOthers.py
6695 # note: auto-publishing is done in self.MakeBoolean()
6696 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6698 ## Perform Section boolean operation on two given shapes.
6699 # @param theShape1 First argument for boolean operation.
6700 # @param theShape2 Second argument for boolean operation.
6701 # @param theName Object name; when specified, this parameter is used
6702 # for result publication in the study. Otherwise, if automatic
6703 # publication is switched on, default value is used for result name.
6705 # @return New GEOM.GEOM_Object, containing the result shape.
6707 # @ref tui_section "Example 1"
6708 # \n @ref swig_MakeCommon "Example 2"
6709 def MakeSection(self, theShape1, theShape2, theName=None):
6711 Perform Section boolean operation on two given shapes.
6714 theShape1 First argument for boolean operation.
6715 theShape2 Second argument for boolean operation.
6716 theName Object name; when specified, this parameter is used
6717 for result publication in the study. Otherwise, if automatic
6718 publication is switched on, default value is used for result name.
6721 New GEOM.GEOM_Object, containing the result shape.
6724 # Example: see GEOM_TestOthers.py
6725 # note: auto-publishing is done in self.MakeBoolean()
6726 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6728 ## Perform Fuse boolean operation on the list of shapes.
6729 # @param theShapesList Shapes to be fused.
6730 # @param theName Object name; when specified, this parameter is used
6731 # for result publication in the study. Otherwise, if automatic
6732 # publication is switched on, default value is used for result name.
6734 # @return New GEOM.GEOM_Object, containing the result shape.
6736 # @ref tui_fuse "Example 1"
6737 # \n @ref swig_MakeCommon "Example 2"
6738 def MakeFuseList(self, theShapesList, theName=None):
6740 Perform Fuse boolean operation on the list of shapes.
6743 theShapesList Shapes to be fused.
6744 theName Object name; when specified, this parameter is used
6745 for result publication in the study. Otherwise, if automatic
6746 publication is switched on, default value is used for result name.
6749 New GEOM.GEOM_Object, containing the result shape.
6752 # Example: see GEOM_TestOthers.py
6753 anObj = self.BoolOp.MakeFuseList(theShapesList)
6754 RaiseIfFailed("MakeFuseList", self.BoolOp)
6755 self._autoPublish(anObj, theName, "fuse")
6758 ## Perform Common boolean operation on the list of shapes.
6759 # @param theShapesList Shapes for Common operation.
6760 # @param theName Object name; when specified, this parameter is used
6761 # for result publication in the study. Otherwise, if automatic
6762 # publication is switched on, default value is used for result name.
6764 # @return New GEOM.GEOM_Object, containing the result shape.
6766 # @ref tui_common "Example 1"
6767 # \n @ref swig_MakeCommon "Example 2"
6768 def MakeCommonList(self, theShapesList, theName=None):
6770 Perform Common boolean operation on the list of shapes.
6773 theShapesList Shapes for Common operation.
6774 theName Object name; when specified, this parameter is used
6775 for result publication in the study. Otherwise, if automatic
6776 publication is switched on, default value is used for result name.
6779 New GEOM.GEOM_Object, containing the result shape.
6782 # Example: see GEOM_TestOthers.py
6783 anObj = self.BoolOp.MakeCommonList(theShapesList)
6784 RaiseIfFailed("MakeCommonList", self.BoolOp)
6785 self._autoPublish(anObj, theName, "common")
6788 ## Perform Cut boolean operation on one object and the list of tools.
6789 # @param theMainShape The object of the operation.
6790 # @param theShapesList The list of tools of the operation.
6791 # @param theName Object name; when specified, this parameter is used
6792 # for result publication in the study. Otherwise, if automatic
6793 # publication is switched on, default value is used for result name.
6795 # @return New GEOM.GEOM_Object, containing the result shape.
6797 # @ref tui_cut "Example 1"
6798 # \n @ref swig_MakeCommon "Example 2"
6799 def MakeCutList(self, theMainShape, theShapesList, theName=None):
6801 Perform Cut boolean operation on one object and the list of tools.
6804 theMainShape The object of the operation.
6805 theShapesList The list of tools of the operation.
6806 theName Object name; when specified, this parameter is used
6807 for result publication in the study. Otherwise, if automatic
6808 publication is switched on, default value is used for result name.
6811 New GEOM.GEOM_Object, containing the result shape.
6814 # Example: see GEOM_TestOthers.py
6815 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
6816 RaiseIfFailed("MakeCutList", self.BoolOp)
6817 self._autoPublish(anObj, theName, "cut")
6823 ## @addtogroup l3_basic_op
6826 ## Perform partition operation.
6827 # @param ListShapes Shapes to be intersected.
6828 # @param ListTools Shapes to intersect theShapes.
6829 # @param Limit Type of resulting shapes (see ShapeType()).\n
6830 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6831 # type will be detected automatically.
6832 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6833 # target type (equal to Limit) are kept in the result,
6834 # else standalone shapes of lower dimension
6835 # are kept also (if they exist).
6836 # @param theName Object name; when specified, this parameter is used
6837 # for result publication in the study. Otherwise, if automatic
6838 # publication is switched on, default value is used for result name.
6840 # @note Each compound from ListShapes and ListTools will be exploded
6841 # in order to avoid possible intersection between shapes from this compound.
6843 # After implementation new version of PartitionAlgo (October 2006)
6844 # other parameters are ignored by current functionality. They are kept
6845 # in this function only for support old versions.
6846 # @param ListKeepInside Shapes, outside which the results will be deleted.
6847 # Each shape from theKeepInside must belong to theShapes also.
6848 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6849 # Each shape from theRemoveInside must belong to theShapes also.
6850 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6851 # @param ListMaterials Material indices for each shape. Make sence,
6852 # only if theRemoveWebs is TRUE.
6854 # @return New GEOM.GEOM_Object, containing the result shapes.
6856 # @ref tui_partition "Example"
6857 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6858 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6859 KeepNonlimitShapes=0, theName=None):
6861 Perform partition operation.
6864 ListShapes Shapes to be intersected.
6865 ListTools Shapes to intersect theShapes.
6866 Limit Type of resulting shapes (see geompy.ShapeType)
6867 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6868 type will be detected automatically.
6869 KeepNonlimitShapes if this parameter == 0, then only shapes of
6870 target type (equal to Limit) are kept in the result,
6871 else standalone shapes of lower dimension
6872 are kept also (if they exist).
6873 theName Object name; when specified, this parameter is used
6874 for result publication in the study. Otherwise, if automatic
6875 publication is switched on, default value is used for result name.
6877 Each compound from ListShapes and ListTools will be exploded
6878 in order to avoid possible intersection between shapes from
6881 After implementation new version of PartitionAlgo (October 2006) other
6882 parameters are ignored by current functionality. They are kept in this
6883 function only for support old versions.
6886 ListKeepInside Shapes, outside which the results will be deleted.
6887 Each shape from theKeepInside must belong to theShapes also.
6888 ListRemoveInside Shapes, inside which the results will be deleted.
6889 Each shape from theRemoveInside must belong to theShapes also.
6890 RemoveWebs If TRUE, perform Glue 3D algorithm.
6891 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6894 New GEOM.GEOM_Object, containing the result shapes.
6896 # Example: see GEOM_TestAll.py
6897 if Limit == self.ShapeType["AUTO"]:
6898 # automatic detection of the most appropriate shape limit type
6900 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6901 Limit = EnumToLong(lim)
6903 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6904 ListKeepInside, ListRemoveInside,
6905 Limit, RemoveWebs, ListMaterials,
6906 KeepNonlimitShapes);
6907 RaiseIfFailed("MakePartition", self.BoolOp)
6908 self._autoPublish(anObj, theName, "partition")
6911 ## Perform partition operation.
6912 # This method may be useful if it is needed to make a partition for
6913 # compound contains nonintersected shapes. Performance will be better
6914 # since intersection between shapes from compound is not performed.
6916 # Description of all parameters as in previous method MakePartition()
6918 # @note Passed compounds (via ListShapes or via ListTools)
6919 # have to consist of nonintersecting shapes.
6921 # @return New GEOM.GEOM_Object, containing the result shapes.
6923 # @ref swig_todo "Example"
6924 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6925 ListKeepInside=[], ListRemoveInside=[],
6926 Limit=ShapeType["AUTO"], RemoveWebs=0,
6927 ListMaterials=[], KeepNonlimitShapes=0,
6930 Perform partition operation.
6931 This method may be useful if it is needed to make a partition for
6932 compound contains nonintersected shapes. Performance will be better
6933 since intersection between shapes from compound is not performed.
6936 Description of all parameters as in method geompy.MakePartition
6939 Passed compounds (via ListShapes or via ListTools)
6940 have to consist of nonintersecting shapes.
6943 New GEOM.GEOM_Object, containing the result shapes.
6945 if Limit == self.ShapeType["AUTO"]:
6946 # automatic detection of the most appropriate shape limit type
6948 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6949 Limit = EnumToLong(lim)
6951 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6952 ListKeepInside, ListRemoveInside,
6953 Limit, RemoveWebs, ListMaterials,
6954 KeepNonlimitShapes);
6955 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6956 self._autoPublish(anObj, theName, "partition")
6959 ## See method MakePartition() for more information.
6961 # @ref tui_partition "Example 1"
6962 # \n @ref swig_Partition "Example 2"
6963 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6964 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6965 KeepNonlimitShapes=0, theName=None):
6967 See method geompy.MakePartition for more information.
6969 # Example: see GEOM_TestOthers.py
6970 # note: auto-publishing is done in self.MakePartition()
6971 anObj = self.MakePartition(ListShapes, ListTools,
6972 ListKeepInside, ListRemoveInside,
6973 Limit, RemoveWebs, ListMaterials,
6974 KeepNonlimitShapes, theName);
6977 ## Perform partition of the Shape with the Plane
6978 # @param theShape Shape to be intersected.
6979 # @param thePlane Tool shape, to intersect theShape.
6980 # @param theName Object name; when specified, this parameter is used
6981 # for result publication in the study. Otherwise, if automatic
6982 # publication is switched on, default value is used for result name.
6984 # @return New GEOM.GEOM_Object, containing the result shape.
6986 # @ref tui_partition "Example"
6987 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6989 Perform partition of the Shape with the Plane
6992 theShape Shape to be intersected.
6993 thePlane Tool shape, to intersect theShape.
6994 theName Object name; when specified, this parameter is used
6995 for result publication in the study. Otherwise, if automatic
6996 publication is switched on, default value is used for result name.
6999 New GEOM.GEOM_Object, containing the result shape.
7001 # Example: see GEOM_TestAll.py
7002 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7003 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7004 self._autoPublish(anObj, theName, "partition")
7007 # end of l3_basic_op
7010 ## @addtogroup l3_transform
7013 ## Translate the given object along the vector, specified
7014 # by its end points.
7015 # @param theObject The object to be translated.
7016 # @param thePoint1 Start point of translation vector.
7017 # @param thePoint2 End point of translation vector.
7018 # @param theCopy Flag used to translate object itself or create a copy.
7019 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7020 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7021 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7023 Translate the given object along the vector, specified by its end points.
7026 theObject The object to be translated.
7027 thePoint1 Start point of translation vector.
7028 thePoint2 End point of translation vector.
7029 theCopy Flag used to translate object itself or create a copy.
7032 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7033 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7036 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7038 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7039 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7042 ## Translate the given object along the vector, specified
7043 # by its end points, creating its copy before the translation.
7044 # @param theObject The object to be translated.
7045 # @param thePoint1 Start point of translation vector.
7046 # @param thePoint2 End point of translation vector.
7047 # @param theName Object name; when specified, this parameter is used
7048 # for result publication in the study. Otherwise, if automatic
7049 # publication is switched on, default value is used for result name.
7051 # @return New GEOM.GEOM_Object, containing the translated object.
7053 # @ref tui_translation "Example 1"
7054 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7055 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7057 Translate the given object along the vector, specified
7058 by its end points, creating its copy before the translation.
7061 theObject The object to be translated.
7062 thePoint1 Start point of translation vector.
7063 thePoint2 End point of translation vector.
7064 theName Object name; when specified, this parameter is used
7065 for result publication in the study. Otherwise, if automatic
7066 publication is switched on, default value is used for result name.
7069 New GEOM.GEOM_Object, containing the translated object.
7071 # Example: see GEOM_TestAll.py
7072 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7073 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7074 self._autoPublish(anObj, theName, "translated")
7077 ## Translate the given object along the vector, specified by its components.
7078 # @param theObject The object to be translated.
7079 # @param theDX,theDY,theDZ Components of translation vector.
7080 # @param theCopy Flag used to translate object itself or create a copy.
7081 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7082 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7084 # @ref tui_translation "Example"
7085 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7087 Translate the given object along the vector, specified by its components.
7090 theObject The object to be translated.
7091 theDX,theDY,theDZ Components of translation vector.
7092 theCopy Flag used to translate object itself or create a copy.
7095 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7096 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7098 # Example: see GEOM_TestAll.py
7099 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7101 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7103 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7104 anObj.SetParameters(Parameters)
7105 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7108 ## Translate the given object along the vector, specified
7109 # by its components, creating its copy before the translation.
7110 # @param theObject The object to be translated.
7111 # @param theDX,theDY,theDZ Components of translation vector.
7112 # @param theName Object name; when specified, this parameter is used
7113 # for result publication in the study. Otherwise, if automatic
7114 # publication is switched on, default value is used for result name.
7116 # @return New GEOM.GEOM_Object, containing the translated object.
7118 # @ref tui_translation "Example"
7119 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7121 Translate the given object along the vector, specified
7122 by its components, creating its copy before the translation.
7125 theObject The object to be translated.
7126 theDX,theDY,theDZ Components of translation vector.
7127 theName Object name; when specified, this parameter is used
7128 for result publication in the study. Otherwise, if automatic
7129 publication is switched on, default value is used for result name.
7132 New GEOM.GEOM_Object, containing the translated object.
7134 # Example: see GEOM_TestAll.py
7135 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7136 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7137 anObj.SetParameters(Parameters)
7138 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7139 self._autoPublish(anObj, theName, "translated")
7142 ## Translate the given object along the given vector.
7143 # @param theObject The object to be translated.
7144 # @param theVector The translation vector.
7145 # @param theCopy Flag used to translate object itself or create a copy.
7146 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7147 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7148 def TranslateVector(self, theObject, theVector, theCopy=False):
7150 Translate the given object along the given vector.
7153 theObject The object to be translated.
7154 theVector The translation vector.
7155 theCopy Flag used to translate object itself or create a copy.
7158 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7159 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7162 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7164 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7165 RaiseIfFailed("TranslateVector", self.TrsfOp)
7168 ## Translate the given object along the given vector,
7169 # creating its copy before the translation.
7170 # @param theObject The object to be translated.
7171 # @param theVector The translation vector.
7172 # @param theName Object name; when specified, this parameter is used
7173 # for result publication in the study. Otherwise, if automatic
7174 # publication is switched on, default value is used for result name.
7176 # @return New GEOM.GEOM_Object, containing the translated object.
7178 # @ref tui_translation "Example"
7179 def MakeTranslationVector(self, theObject, theVector, theName=None):
7181 Translate the given object along the given vector,
7182 creating its copy before the translation.
7185 theObject The object to be translated.
7186 theVector The translation vector.
7187 theName Object name; when specified, this parameter is used
7188 for result publication in the study. Otherwise, if automatic
7189 publication is switched on, default value is used for result name.
7192 New GEOM.GEOM_Object, containing the translated object.
7194 # Example: see GEOM_TestAll.py
7195 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7196 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7197 self._autoPublish(anObj, theName, "translated")
7200 ## Translate the given object along the given vector on given distance.
7201 # @param theObject The object to be translated.
7202 # @param theVector The translation vector.
7203 # @param theDistance The translation distance.
7204 # @param theCopy Flag used to translate object itself or create a copy.
7205 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7206 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7208 # @ref tui_translation "Example"
7209 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7211 Translate the given object along the given vector on given distance.
7214 theObject The object to be translated.
7215 theVector The translation vector.
7216 theDistance The translation distance.
7217 theCopy Flag used to translate object itself or create a copy.
7220 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7221 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7223 # Example: see GEOM_TestAll.py
7224 theDistance,Parameters = ParseParameters(theDistance)
7225 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7226 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7227 anObj.SetParameters(Parameters)
7230 ## Translate the given object along the given vector on given distance,
7231 # creating its copy before the translation.
7232 # @param theObject The object to be translated.
7233 # @param theVector The translation vector.
7234 # @param theDistance The translation distance.
7235 # @param theName Object name; when specified, this parameter is used
7236 # for result publication in the study. Otherwise, if automatic
7237 # publication is switched on, default value is used for result name.
7239 # @return New GEOM.GEOM_Object, containing the translated object.
7241 # @ref tui_translation "Example"
7242 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7244 Translate the given object along the given vector on given distance,
7245 creating its copy before the translation.
7248 theObject The object to be translated.
7249 theVector The translation vector.
7250 theDistance The translation distance.
7251 theName Object name; when specified, this parameter is used
7252 for result publication in the study. Otherwise, if automatic
7253 publication is switched on, default value is used for result name.
7256 New GEOM.GEOM_Object, containing the translated object.
7258 # Example: see GEOM_TestAll.py
7259 theDistance,Parameters = ParseParameters(theDistance)
7260 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7261 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7262 anObj.SetParameters(Parameters)
7263 self._autoPublish(anObj, theName, "translated")
7266 ## Rotate the given object around the given axis on the given angle.
7267 # @param theObject The object to be rotated.
7268 # @param theAxis Rotation axis.
7269 # @param theAngle Rotation angle in radians.
7270 # @param theCopy Flag used to rotate object itself or create a copy.
7272 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7273 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7275 # @ref tui_rotation "Example"
7276 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7278 Rotate the given object around the given axis on the given angle.
7281 theObject The object to be rotated.
7282 theAxis Rotation axis.
7283 theAngle Rotation angle in radians.
7284 theCopy Flag used to rotate object itself or create a copy.
7287 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7288 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7290 # Example: see GEOM_TestAll.py
7292 if isinstance(theAngle,str):
7294 theAngle, Parameters = ParseParameters(theAngle)
7296 theAngle = theAngle*math.pi/180.0
7298 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7300 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7301 RaiseIfFailed("Rotate", self.TrsfOp)
7302 anObj.SetParameters(Parameters)
7305 ## Rotate the given object around the given axis
7306 # on the given angle, creating its copy before the rotatation.
7307 # @param theObject The object to be rotated.
7308 # @param theAxis Rotation axis.
7309 # @param theAngle Rotation angle in radians.
7310 # @param theName Object name; when specified, this parameter is used
7311 # for result publication in the study. Otherwise, if automatic
7312 # publication is switched on, default value is used for result name.
7314 # @return New GEOM.GEOM_Object, containing the rotated object.
7316 # @ref tui_rotation "Example"
7317 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7319 Rotate the given object around the given axis
7320 on the given angle, creating its copy before the rotatation.
7323 theObject The object to be rotated.
7324 theAxis Rotation axis.
7325 theAngle Rotation angle in radians.
7326 theName Object name; when specified, this parameter is used
7327 for result publication in the study. Otherwise, if automatic
7328 publication is switched on, default value is used for result name.
7331 New GEOM.GEOM_Object, containing the rotated object.
7333 # Example: see GEOM_TestAll.py
7335 if isinstance(theAngle,str):
7337 theAngle, Parameters = ParseParameters(theAngle)
7339 theAngle = theAngle*math.pi/180.0
7340 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7341 RaiseIfFailed("RotateCopy", self.TrsfOp)
7342 anObj.SetParameters(Parameters)
7343 self._autoPublish(anObj, theName, "rotated")
7346 ## Rotate given object around vector perpendicular to plane
7347 # containing three points.
7348 # @param theObject The object to be rotated.
7349 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7350 # containing the three points.
7351 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7352 # @param theCopy Flag used to rotate object itself or create a copy.
7353 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7354 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7355 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7357 Rotate given object around vector perpendicular to plane
7358 containing three points.
7361 theObject The object to be rotated.
7362 theCentPoint central point the axis is the vector perpendicular to the plane
7363 containing the three points.
7364 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7365 theCopy Flag used to rotate object itself or create a copy.
7368 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7369 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7372 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7374 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7375 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7378 ## Rotate given object around vector perpendicular to plane
7379 # containing three points, creating its copy before the rotatation.
7380 # @param theObject The object to be rotated.
7381 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7382 # containing the three points.
7383 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7384 # @param theName Object name; when specified, this parameter is used
7385 # for result publication in the study. Otherwise, if automatic
7386 # publication is switched on, default value is used for result name.
7388 # @return New GEOM.GEOM_Object, containing the rotated object.
7390 # @ref tui_rotation "Example"
7391 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7393 Rotate given object around vector perpendicular to plane
7394 containing three points, creating its copy before the rotatation.
7397 theObject The object to be rotated.
7398 theCentPoint central point the axis is the vector perpendicular to the plane
7399 containing the three points.
7400 thePoint1,thePoint2 in a perpendicular plane of the axis.
7401 theName Object name; when specified, this parameter is used
7402 for result publication in the study. Otherwise, if automatic
7403 publication is switched on, default value is used for result name.
7406 New GEOM.GEOM_Object, containing the rotated object.
7408 # Example: see GEOM_TestAll.py
7409 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7410 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7411 self._autoPublish(anObj, theName, "rotated")
7414 ## Scale the given object by the specified factor.
7415 # @param theObject The object to be scaled.
7416 # @param thePoint Center point for scaling.
7417 # Passing None for it means scaling relatively the origin of global CS.
7418 # @param theFactor Scaling factor value.
7419 # @param theCopy Flag used to scale object itself or create a copy.
7420 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7421 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7422 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7424 Scale the given object by the specified factor.
7427 theObject The object to be scaled.
7428 thePoint Center point for scaling.
7429 Passing None for it means scaling relatively the origin of global CS.
7430 theFactor Scaling factor value.
7431 theCopy Flag used to scale object itself or create a copy.
7434 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7435 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7437 # Example: see GEOM_TestAll.py
7438 theFactor, Parameters = ParseParameters(theFactor)
7440 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7442 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7443 RaiseIfFailed("Scale", self.TrsfOp)
7444 anObj.SetParameters(Parameters)
7447 ## Scale the given object by the factor, creating its copy before the scaling.
7448 # @param theObject The object to be scaled.
7449 # @param thePoint Center point for scaling.
7450 # Passing None for it means scaling relatively the origin of global CS.
7451 # @param theFactor Scaling factor value.
7452 # @param theName Object name; when specified, this parameter is used
7453 # for result publication in the study. Otherwise, if automatic
7454 # publication is switched on, default value is used for result name.
7456 # @return New GEOM.GEOM_Object, containing the scaled shape.
7458 # @ref tui_scale "Example"
7459 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7461 Scale the given object by the factor, creating its copy before the scaling.
7464 theObject The object to be scaled.
7465 thePoint Center point for scaling.
7466 Passing None for it means scaling relatively the origin of global CS.
7467 theFactor Scaling factor value.
7468 theName Object name; when specified, this parameter is used
7469 for result publication in the study. Otherwise, if automatic
7470 publication is switched on, default value is used for result name.
7473 New GEOM.GEOM_Object, containing the scaled shape.
7475 # Example: see GEOM_TestAll.py
7476 theFactor, Parameters = ParseParameters(theFactor)
7477 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7478 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7479 anObj.SetParameters(Parameters)
7480 self._autoPublish(anObj, theName, "scaled")
7483 ## Scale the given object by different factors along coordinate axes.
7484 # @param theObject The object to be scaled.
7485 # @param thePoint Center point for scaling.
7486 # Passing None for it means scaling relatively the origin of global CS.
7487 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7488 # @param theCopy Flag used to scale object itself or create a copy.
7489 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7490 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7491 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7493 Scale the given object by different factors along coordinate axes.
7496 theObject The object to be scaled.
7497 thePoint Center point for scaling.
7498 Passing None for it means scaling relatively the origin of global CS.
7499 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7500 theCopy Flag used to scale object itself or create a copy.
7503 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7504 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7506 # Example: see GEOM_TestAll.py
7507 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7509 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7510 theFactorX, theFactorY, theFactorZ)
7512 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7513 theFactorX, theFactorY, theFactorZ)
7514 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7515 anObj.SetParameters(Parameters)
7518 ## Scale the given object by different factors along coordinate axes,
7519 # creating its copy before the scaling.
7520 # @param theObject The object to be scaled.
7521 # @param thePoint Center point for scaling.
7522 # Passing None for it means scaling relatively the origin of global CS.
7523 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7524 # @param theName Object name; when specified, this parameter is used
7525 # for result publication in the study. Otherwise, if automatic
7526 # publication is switched on, default value is used for result name.
7528 # @return New GEOM.GEOM_Object, containing the scaled shape.
7530 # @ref swig_scale "Example"
7531 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7533 Scale the given object by different factors along coordinate axes,
7534 creating its copy before the scaling.
7537 theObject The object to be scaled.
7538 thePoint Center point for scaling.
7539 Passing None for it means scaling relatively the origin of global CS.
7540 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7541 theName Object name; when specified, this parameter is used
7542 for result publication in the study. Otherwise, if automatic
7543 publication is switched on, default value is used for result name.
7546 New GEOM.GEOM_Object, containing the scaled shape.
7548 # Example: see GEOM_TestAll.py
7549 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7550 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7551 theFactorX, theFactorY, theFactorZ)
7552 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7553 anObj.SetParameters(Parameters)
7554 self._autoPublish(anObj, theName, "scaled")
7557 ## Mirror an object relatively the given plane.
7558 # @param theObject The object to be mirrored.
7559 # @param thePlane Plane of symmetry.
7560 # @param theCopy Flag used to mirror object itself or create a copy.
7561 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7562 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7563 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7565 Mirror an object relatively the given plane.
7568 theObject The object to be mirrored.
7569 thePlane Plane of symmetry.
7570 theCopy Flag used to mirror object itself or create a copy.
7573 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7574 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7577 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7579 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7580 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7583 ## Create an object, symmetrical
7584 # to the given one relatively the given plane.
7585 # @param theObject The object to be mirrored.
7586 # @param thePlane Plane of symmetry.
7587 # @param theName Object name; when specified, this parameter is used
7588 # for result publication in the study. Otherwise, if automatic
7589 # publication is switched on, default value is used for result name.
7591 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7593 # @ref tui_mirror "Example"
7594 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7596 Create an object, symmetrical to the given one relatively the given plane.
7599 theObject The object to be mirrored.
7600 thePlane Plane of symmetry.
7601 theName Object name; when specified, this parameter is used
7602 for result publication in the study. Otherwise, if automatic
7603 publication is switched on, default value is used for result name.
7606 New GEOM.GEOM_Object, containing the mirrored shape.
7608 # Example: see GEOM_TestAll.py
7609 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7610 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7611 self._autoPublish(anObj, theName, "mirrored")
7614 ## Mirror an object relatively the given axis.
7615 # @param theObject The object to be mirrored.
7616 # @param theAxis Axis of symmetry.
7617 # @param theCopy Flag used to mirror object itself or create a copy.
7618 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7619 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7620 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7622 Mirror an object relatively the given axis.
7625 theObject The object to be mirrored.
7626 theAxis Axis of symmetry.
7627 theCopy Flag used to mirror object itself or create a copy.
7630 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7631 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7634 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7636 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7637 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7640 ## Create an object, symmetrical
7641 # to the given one relatively the given axis.
7642 # @param theObject The object to be mirrored.
7643 # @param theAxis Axis of symmetry.
7644 # @param theName Object name; when specified, this parameter is used
7645 # for result publication in the study. Otherwise, if automatic
7646 # publication is switched on, default value is used for result name.
7648 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7650 # @ref tui_mirror "Example"
7651 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7653 Create an object, symmetrical to the given one relatively the given axis.
7656 theObject The object to be mirrored.
7657 theAxis Axis of symmetry.
7658 theName Object name; when specified, this parameter is used
7659 for result publication in the study. Otherwise, if automatic
7660 publication is switched on, default value is used for result name.
7663 New GEOM.GEOM_Object, containing the mirrored shape.
7665 # Example: see GEOM_TestAll.py
7666 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7667 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7668 self._autoPublish(anObj, theName, "mirrored")
7671 ## Mirror an object relatively the given point.
7672 # @param theObject The object to be mirrored.
7673 # @param thePoint Point of symmetry.
7674 # @param theCopy Flag used to mirror object itself or create a copy.
7675 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7676 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7677 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7679 Mirror an object relatively the given point.
7682 theObject The object to be mirrored.
7683 thePoint Point of symmetry.
7684 theCopy Flag used to mirror object itself or create a copy.
7687 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7688 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7690 # Example: see GEOM_TestAll.py
7692 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7694 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7695 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7698 ## Create an object, symmetrical
7699 # to the given one relatively the given point.
7700 # @param theObject The object to be mirrored.
7701 # @param thePoint Point of symmetry.
7702 # @param theName Object name; when specified, this parameter is used
7703 # for result publication in the study. Otherwise, if automatic
7704 # publication is switched on, default value is used for result name.
7706 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7708 # @ref tui_mirror "Example"
7709 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7711 Create an object, symmetrical
7712 to the given one relatively the given point.
7715 theObject The object to be mirrored.
7716 thePoint Point of symmetry.
7717 theName Object name; when specified, this parameter is used
7718 for result publication in the study. Otherwise, if automatic
7719 publication is switched on, default value is used for result name.
7722 New GEOM.GEOM_Object, containing the mirrored shape.
7724 # Example: see GEOM_TestAll.py
7725 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7726 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7727 self._autoPublish(anObj, theName, "mirrored")
7730 ## Modify the location of the given object.
7731 # @param theObject The object to be displaced.
7732 # @param theStartLCS Coordinate system to perform displacement from it.\n
7733 # If \a theStartLCS is NULL, displacement
7734 # will be performed from global CS.\n
7735 # If \a theObject itself is used as \a theStartLCS,
7736 # its location will be changed to \a theEndLCS.
7737 # @param theEndLCS Coordinate system to perform displacement to it.
7738 # @param theCopy Flag used to displace object itself or create a copy.
7739 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7740 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7741 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7743 Modify the Location of the given object by LCS, creating its copy before the setting.
7746 theObject The object to be displaced.
7747 theStartLCS Coordinate system to perform displacement from it.
7748 If theStartLCS is NULL, displacement
7749 will be performed from global CS.
7750 If theObject itself is used as theStartLCS,
7751 its location will be changed to theEndLCS.
7752 theEndLCS Coordinate system to perform displacement to it.
7753 theCopy Flag used to displace object itself or create a copy.
7756 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7757 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7759 # Example: see GEOM_TestAll.py
7761 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7763 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7764 RaiseIfFailed("Displace", self.TrsfOp)
7767 ## Modify the Location of the given object by LCS,
7768 # creating its copy before the setting.
7769 # @param theObject The object to be displaced.
7770 # @param theStartLCS Coordinate system to perform displacement from it.\n
7771 # If \a theStartLCS is NULL, displacement
7772 # will be performed from global CS.\n
7773 # If \a theObject itself is used as \a theStartLCS,
7774 # its location will be changed to \a theEndLCS.
7775 # @param theEndLCS Coordinate system to perform displacement to it.
7776 # @param theName Object name; when specified, this parameter is used
7777 # for result publication in the study. Otherwise, if automatic
7778 # publication is switched on, default value is used for result name.
7780 # @return New GEOM.GEOM_Object, containing the displaced shape.
7782 # @ref tui_modify_location "Example"
7783 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7785 Modify the Location of the given object by LCS, creating its copy before the setting.
7788 theObject The object to be displaced.
7789 theStartLCS Coordinate system to perform displacement from it.
7790 If theStartLCS is NULL, displacement
7791 will be performed from global CS.
7792 If theObject itself is used as theStartLCS,
7793 its location will be changed to theEndLCS.
7794 theEndLCS Coordinate system to perform displacement to it.
7795 theName Object name; when specified, this parameter is used
7796 for result publication in the study. Otherwise, if automatic
7797 publication is switched on, default value is used for result name.
7800 New GEOM.GEOM_Object, containing the displaced shape.
7803 # create local coordinate systems
7804 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7805 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7806 # modify the location of the given object
7807 position = geompy.MakePosition(cylinder, cs1, cs2)
7809 # Example: see GEOM_TestAll.py
7810 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7811 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7812 self._autoPublish(anObj, theName, "displaced")
7815 ## Modify the Location of the given object by Path.
7816 # @param theObject The object to be displaced.
7817 # @param thePath Wire or Edge along that the object will be translated.
7818 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7819 # @param theCopy is to create a copy objects if true.
7820 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7821 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7822 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7824 # @ref tui_modify_location "Example"
7825 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7827 Modify the Location of the given object by Path.
7830 theObject The object to be displaced.
7831 thePath Wire or Edge along that the object will be translated.
7832 theDistance progress of Path (0 = start location, 1 = end of path location).
7833 theCopy is to create a copy objects if true.
7834 theReverse 0 - for usual direction, 1 - to reverse path direction.
7837 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7838 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7841 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7843 # Example: see GEOM_TestAll.py
7844 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7845 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7848 ## Modify the Location of the given object by Path, creating its copy before the operation.
7849 # @param theObject The object to be displaced.
7850 # @param thePath Wire or Edge along that the object will be translated.
7851 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7852 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7853 # @param theName Object name; when specified, this parameter is used
7854 # for result publication in the study. Otherwise, if automatic
7855 # publication is switched on, default value is used for result name.
7857 # @return New GEOM.GEOM_Object, containing the displaced shape.
7858 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7860 Modify the Location of the given object by Path, creating its copy before the operation.
7863 theObject The object to be displaced.
7864 thePath Wire or Edge along that the object will be translated.
7865 theDistance progress of Path (0 = start location, 1 = end of path location).
7866 theReverse 0 - for usual direction, 1 - to reverse path direction.
7867 theName Object name; when specified, this parameter is used
7868 for result publication in the study. Otherwise, if automatic
7869 publication is switched on, default value is used for result name.
7872 New GEOM.GEOM_Object, containing the displaced shape.
7874 # Example: see GEOM_TestAll.py
7875 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7876 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7877 self._autoPublish(anObj, theName, "displaced")
7880 ## Offset given shape.
7881 # @param theObject The base object for the offset.
7882 # @param theOffset Offset value.
7883 # @param theCopy Flag used to offset object itself or create a copy.
7884 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7885 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7886 def Offset(self, theObject, theOffset, theCopy=False):
7891 theObject The base object for the offset.
7892 theOffset Offset value.
7893 theCopy Flag used to offset object itself or create a copy.
7896 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7897 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7899 theOffset, Parameters = ParseParameters(theOffset)
7901 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7903 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7904 RaiseIfFailed("Offset", self.TrsfOp)
7905 anObj.SetParameters(Parameters)
7908 ## Create new object as offset of the given one.
7909 # @param theObject The base object for the offset.
7910 # @param theOffset Offset value.
7911 # @param theName Object name; when specified, this parameter is used
7912 # for result publication in the study. Otherwise, if automatic
7913 # publication is switched on, default value is used for result name.
7915 # @return New GEOM.GEOM_Object, containing the offset object.
7917 # @ref tui_offset "Example"
7918 def MakeOffset(self, theObject, theOffset, theName=None):
7920 Create new object as offset of the given one.
7923 theObject The base object for the offset.
7924 theOffset Offset value.
7925 theName Object name; when specified, this parameter is used
7926 for result publication in the study. Otherwise, if automatic
7927 publication is switched on, default value is used for result name.
7930 New GEOM.GEOM_Object, containing the offset object.
7933 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7934 # create a new object as offset of the given object
7935 offset = geompy.MakeOffset(box, 70.)
7937 # Example: see GEOM_TestAll.py
7938 theOffset, Parameters = ParseParameters(theOffset)
7939 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7940 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7941 anObj.SetParameters(Parameters)
7942 self._autoPublish(anObj, theName, "offset")
7945 ## Create new object as projection of the given one on a 2D surface.
7946 # @param theSource The source object for the projection. It can be a point, edge or wire.
7947 # @param theTarget The target object. It can be planar or cylindrical face.
7948 # @param theName Object name; when specified, this parameter is used
7949 # for result publication in the study. Otherwise, if automatic
7950 # publication is switched on, default value is used for result name.
7952 # @return New GEOM.GEOM_Object, containing the projection.
7954 # @ref tui_projection "Example"
7955 def MakeProjection(self, theSource, theTarget, theName=None):
7957 Create new object as projection of the given one on a 2D surface.
7960 theSource The source object for the projection. It can be a point, edge or wire.
7961 theTarget The target object. It can be planar or cylindrical face.
7962 theName Object name; when specified, this parameter is used
7963 for result publication in the study. Otherwise, if automatic
7964 publication is switched on, default value is used for result name.
7967 New GEOM.GEOM_Object, containing the projection.
7969 # Example: see GEOM_TestAll.py
7970 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7971 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7972 self._autoPublish(anObj, theName, "projection")
7975 # -----------------------------------------------------------------------------
7977 # -----------------------------------------------------------------------------
7979 ## Translate the given object along the given vector a given number times
7980 # @param theObject The object to be translated.
7981 # @param theVector Direction of the translation. DX if None.
7982 # @param theStep Distance to translate on.
7983 # @param theNbTimes Quantity of translations to be done.
7984 # @param theName Object name; when specified, this parameter is used
7985 # for result publication in the study. Otherwise, if automatic
7986 # publication is switched on, default value is used for result name.
7988 # @return New GEOM.GEOM_Object, containing compound of all
7989 # the shapes, obtained after each translation.
7991 # @ref tui_multi_translation "Example"
7992 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7994 Translate the given object along the given vector a given number times
7997 theObject The object to be translated.
7998 theVector Direction of the translation. DX if None.
7999 theStep Distance to translate on.
8000 theNbTimes Quantity of translations to be done.
8001 theName Object name; when specified, this parameter is used
8002 for result publication in the study. Otherwise, if automatic
8003 publication is switched on, default value is used for result name.
8006 New GEOM.GEOM_Object, containing compound of all
8007 the shapes, obtained after each translation.
8010 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8012 # Example: see GEOM_TestAll.py
8013 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8014 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8015 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8016 anObj.SetParameters(Parameters)
8017 self._autoPublish(anObj, theName, "multitranslation")
8020 ## Conseqently apply two specified translations to theObject specified number of times.
8021 # @param theObject The object to be translated.
8022 # @param theVector1 Direction of the first translation. DX if None.
8023 # @param theStep1 Step of the first translation.
8024 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8025 # @param theVector2 Direction of the second translation. DY if None.
8026 # @param theStep2 Step of the second translation.
8027 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8028 # @param theName Object name; when specified, this parameter is used
8029 # for result publication in the study. Otherwise, if automatic
8030 # publication is switched on, default value is used for result name.
8032 # @return New GEOM.GEOM_Object, containing compound of all
8033 # the shapes, obtained after each translation.
8035 # @ref tui_multi_translation "Example"
8036 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8037 theVector2, theStep2, theNbTimes2, theName=None):
8039 Conseqently apply two specified translations to theObject specified number of times.
8042 theObject The object to be translated.
8043 theVector1 Direction of the first translation. DX if None.
8044 theStep1 Step of the first translation.
8045 theNbTimes1 Quantity of translations to be done along theVector1.
8046 theVector2 Direction of the second translation. DY if None.
8047 theStep2 Step of the second translation.
8048 theNbTimes2 Quantity of translations to be done along theVector2.
8049 theName Object name; when specified, this parameter is used
8050 for result publication in the study. Otherwise, if automatic
8051 publication is switched on, default value is used for result name.
8054 New GEOM.GEOM_Object, containing compound of all
8055 the shapes, obtained after each translation.
8058 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8060 # Example: see GEOM_TestAll.py
8061 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8062 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8063 theVector2, theStep2, theNbTimes2)
8064 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8065 anObj.SetParameters(Parameters)
8066 self._autoPublish(anObj, theName, "multitranslation")
8069 ## Rotate the given object around the given axis a given number times.
8070 # Rotation angle will be 2*PI/theNbTimes.
8071 # @param theObject The object to be rotated.
8072 # @param theAxis The rotation axis. DZ if None.
8073 # @param theNbTimes Quantity of rotations to be done.
8074 # @param theName Object name; when specified, this parameter is used
8075 # for result publication in the study. Otherwise, if automatic
8076 # publication is switched on, default value is used for result name.
8078 # @return New GEOM.GEOM_Object, containing compound of all the
8079 # shapes, obtained after each rotation.
8081 # @ref tui_multi_rotation "Example"
8082 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8084 Rotate the given object around the given axis a given number times.
8085 Rotation angle will be 2*PI/theNbTimes.
8088 theObject The object to be rotated.
8089 theAxis The rotation axis. DZ if None.
8090 theNbTimes Quantity of rotations to be done.
8091 theName Object name; when specified, this parameter is used
8092 for result publication in the study. Otherwise, if automatic
8093 publication is switched on, default value is used for result name.
8096 New GEOM.GEOM_Object, containing compound of all the
8097 shapes, obtained after each rotation.
8100 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8102 # Example: see GEOM_TestAll.py
8103 theNbTimes, Parameters = ParseParameters(theNbTimes)
8104 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8105 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8106 anObj.SetParameters(Parameters)
8107 self._autoPublish(anObj, theName, "multirotation")
8110 ## Rotate the given object around the given axis
8111 # a given number times on the given angle.
8112 # @param theObject The object to be rotated.
8113 # @param theAxis The rotation axis. DZ if None.
8114 # @param theAngleStep Rotation angle in radians.
8115 # @param theNbTimes Quantity of rotations to be done.
8116 # @param theName Object name; when specified, this parameter is used
8117 # for result publication in the study. Otherwise, if automatic
8118 # publication is switched on, default value is used for result name.
8120 # @return New GEOM.GEOM_Object, containing compound of all the
8121 # shapes, obtained after each rotation.
8123 # @ref tui_multi_rotation "Example"
8124 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8126 Rotate the given object around the given axis
8127 a given number times on the given angle.
8130 theObject The object to be rotated.
8131 theAxis The rotation axis. DZ if None.
8132 theAngleStep Rotation angle in radians.
8133 theNbTimes Quantity of rotations to be done.
8134 theName Object name; when specified, this parameter is used
8135 for result publication in the study. Otherwise, if automatic
8136 publication is switched on, default value is used for result name.
8139 New GEOM.GEOM_Object, containing compound of all the
8140 shapes, obtained after each rotation.
8143 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8145 # Example: see GEOM_TestAll.py
8146 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8147 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8148 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8149 anObj.SetParameters(Parameters)
8150 self._autoPublish(anObj, theName, "multirotation")
8153 ## Rotate the given object around the given axis a given
8154 # number times and multi-translate each rotation result.
8155 # Rotation angle will be 2*PI/theNbTimes1.
8156 # Translation direction passes through center of gravity
8157 # of rotated shape and its projection on the rotation axis.
8158 # @param theObject The object to be rotated.
8159 # @param theAxis Rotation axis. DZ if None.
8160 # @param theNbTimes1 Quantity of rotations to be done.
8161 # @param theRadialStep Translation distance.
8162 # @param theNbTimes2 Quantity of translations to be done.
8163 # @param theName Object name; when specified, this parameter is used
8164 # for result publication in the study. Otherwise, if automatic
8165 # publication is switched on, default value is used for result name.
8167 # @return New GEOM.GEOM_Object, containing compound of all the
8168 # shapes, obtained after each transformation.
8170 # @ref tui_multi_rotation "Example"
8171 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8173 Rotate the given object around the
8174 given axis on the given angle a given number
8175 times and multi-translate each rotation result.
8176 Translation direction passes through center of gravity
8177 of rotated shape and its projection on the rotation axis.
8180 theObject The object to be rotated.
8181 theAxis Rotation axis. DZ if None.
8182 theNbTimes1 Quantity of rotations to be done.
8183 theRadialStep Translation distance.
8184 theNbTimes2 Quantity of translations to be done.
8185 theName Object name; when specified, this parameter is used
8186 for result publication in the study. Otherwise, if automatic
8187 publication is switched on, default value is used for result name.
8190 New GEOM.GEOM_Object, containing compound of all the
8191 shapes, obtained after each transformation.
8194 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8196 # Example: see GEOM_TestAll.py
8197 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8198 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8199 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8200 anObj.SetParameters(Parameters)
8201 self._autoPublish(anObj, theName, "multirotation")
8204 ## Rotate the given object around the
8205 # given axis on the given angle a given number
8206 # times and multi-translate each rotation result.
8207 # Translation direction passes through center of gravity
8208 # of rotated shape and its projection on the rotation axis.
8209 # @param theObject The object to be rotated.
8210 # @param theAxis Rotation axis. DZ if None.
8211 # @param theAngleStep Rotation angle in radians.
8212 # @param theNbTimes1 Quantity of rotations to be done.
8213 # @param theRadialStep Translation distance.
8214 # @param theNbTimes2 Quantity of translations to be done.
8215 # @param theName Object name; when specified, this parameter is used
8216 # for result publication in the study. Otherwise, if automatic
8217 # publication is switched on, default value is used for result name.
8219 # @return New GEOM.GEOM_Object, containing compound of all the
8220 # shapes, obtained after each transformation.
8222 # @ref tui_multi_rotation "Example"
8223 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8225 Rotate the given object around the
8226 given axis on the given angle a given number
8227 times and multi-translate each rotation result.
8228 Translation direction passes through center of gravity
8229 of rotated shape and its projection on the rotation axis.
8232 theObject The object to be rotated.
8233 theAxis Rotation axis. DZ if None.
8234 theAngleStep Rotation angle in radians.
8235 theNbTimes1 Quantity of rotations to be done.
8236 theRadialStep Translation distance.
8237 theNbTimes2 Quantity of translations to be done.
8238 theName Object name; when specified, this parameter is used
8239 for result publication in the study. Otherwise, if automatic
8240 publication is switched on, default value is used for result name.
8243 New GEOM.GEOM_Object, containing compound of all the
8244 shapes, obtained after each transformation.
8247 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8249 # Example: see GEOM_TestAll.py
8250 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8251 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8252 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8253 anObj.SetParameters(Parameters)
8254 self._autoPublish(anObj, theName, "multirotation")
8257 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8259 # @ref swig_MakeMultiRotation "Example"
8260 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8262 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8265 pz = geompy.MakeVertex(0, 0, 100)
8266 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8267 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8269 # Example: see GEOM_TestOthers.py
8270 aVec = self.MakeLine(aPoint,aDir)
8271 # note: auto-publishing is done in self.MultiRotate1D()
8272 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8275 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8277 # @ref swig_MakeMultiRotation "Example"
8278 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8280 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8283 pz = geompy.MakeVertex(0, 0, 100)
8284 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8285 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8287 # Example: see GEOM_TestOthers.py
8288 aVec = self.MakeLine(aPoint,aDir)
8289 # note: auto-publishing is done in self.MultiRotate1D()
8290 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8293 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8295 # @ref swig_MakeMultiRotation "Example"
8296 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8298 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8301 pz = geompy.MakeVertex(0, 0, 100)
8302 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8303 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8305 # Example: see GEOM_TestOthers.py
8306 aVec = self.MakeLine(aPoint,aDir)
8307 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8308 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8311 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8313 # @ref swig_MakeMultiRotation "Example"
8314 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8316 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8319 pz = geompy.MakeVertex(0, 0, 100)
8320 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8321 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8323 # Example: see GEOM_TestOthers.py
8324 aVec = self.MakeLine(aPoint,aDir)
8325 # note: auto-publishing is done in self.MultiRotate2D()
8326 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8329 # end of l3_transform
8332 ## @addtogroup l3_transform_d
8335 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8336 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8338 Deprecated method. Use MultiRotate1DNbTimes instead.
8340 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8341 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8343 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8344 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8345 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8347 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8348 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8351 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8353 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8354 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8355 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8356 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8357 anObj.SetParameters(Parameters)
8358 self._autoPublish(anObj, theName, "multirotation")
8361 ## The same, as MultiRotate1D(), but axis is given by direction and point
8362 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8363 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8365 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8366 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8369 pz = geompy.MakeVertex(0, 0, 100)
8370 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8371 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8373 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8374 aVec = self.MakeLine(aPoint,aDir)
8375 # note: auto-publishing is done in self.MultiRotate1D()
8376 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8379 ## The same, as MultiRotate2D(), but axis is given by direction and point
8380 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8381 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8383 The same, as MultiRotate2D(), but axis is given by direction and point
8384 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8387 pz = geompy.MakeVertex(0, 0, 100)
8388 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8389 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8391 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8392 aVec = self.MakeLine(aPoint,aDir)
8393 # note: auto-publishing is done in self.MultiRotate2D()
8394 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8397 # end of l3_transform_d
8400 ## @addtogroup l3_local
8403 ## Perform a fillet on all edges of the given shape.
8404 # @param theShape Shape, to perform fillet on.
8405 # @param theR Fillet radius.
8406 # @param theName Object name; when specified, this parameter is used
8407 # for result publication in the study. Otherwise, if automatic
8408 # publication is switched on, default value is used for result name.
8410 # @return New GEOM.GEOM_Object, containing the result shape.
8412 # @ref tui_fillet "Example 1"
8413 # \n @ref swig_MakeFilletAll "Example 2"
8414 def MakeFilletAll(self, theShape, theR, theName=None):
8416 Perform a fillet on all edges of the given shape.
8419 theShape Shape, to perform fillet on.
8421 theName Object name; when specified, this parameter is used
8422 for result publication in the study. Otherwise, if automatic
8423 publication is switched on, default value is used for result name.
8426 New GEOM.GEOM_Object, containing the result shape.
8429 filletall = geompy.MakeFilletAll(prism, 10.)
8431 # Example: see GEOM_TestOthers.py
8432 theR,Parameters = ParseParameters(theR)
8433 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8434 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8435 anObj.SetParameters(Parameters)
8436 self._autoPublish(anObj, theName, "fillet")
8439 ## Perform a fillet on the specified edges/faces of the given shape
8440 # @param theShape Shape, to perform fillet on.
8441 # @param theR Fillet radius.
8442 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8443 # @param theListShapes Global indices of edges/faces to perform fillet on.
8444 # @param theName Object name; when specified, this parameter is used
8445 # for result publication in the study. Otherwise, if automatic
8446 # publication is switched on, default value is used for result name.
8448 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8450 # @return New GEOM.GEOM_Object, containing the result shape.
8452 # @ref tui_fillet "Example"
8453 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8455 Perform a fillet on the specified edges/faces of the given shape
8458 theShape Shape, to perform fillet on.
8460 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8461 theListShapes Global indices of edges/faces to perform fillet on.
8462 theName Object name; when specified, this parameter is used
8463 for result publication in the study. Otherwise, if automatic
8464 publication is switched on, default value is used for result name.
8467 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8470 New GEOM.GEOM_Object, containing the result shape.
8473 # get the list of IDs (IDList) for the fillet
8474 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8476 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8477 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8478 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8479 # make a fillet on the specified edges of the given shape
8480 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8482 # Example: see GEOM_TestAll.py
8483 theR,Parameters = ParseParameters(theR)
8485 if theShapeType == self.ShapeType["EDGE"]:
8486 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8487 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8489 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8490 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8491 anObj.SetParameters(Parameters)
8492 self._autoPublish(anObj, theName, "fillet")
8495 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8496 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8498 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8501 # get the list of IDs (IDList) for the fillet
8502 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8504 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8505 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8506 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8507 # make a fillet on the specified edges of the given shape
8508 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8510 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8512 if theShapeType == self.ShapeType["EDGE"]:
8513 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8514 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8516 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8517 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8518 anObj.SetParameters(Parameters)
8519 self._autoPublish(anObj, theName, "fillet")
8522 ## Perform a fillet on the specified edges of the given shape
8523 # @param theShape Wire Shape to perform fillet on.
8524 # @param theR Fillet radius.
8525 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8526 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8527 # \note The list of vertices could be empty,
8528 # in this case fillet will done done at all vertices in wire
8529 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8530 # by the length of the edges, nearest to the fillet vertex.
8531 # But sometimes the next edge is C1 continuous with the one, nearest to
8532 # the fillet point, and such two (or more) edges can be united to allow
8533 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8534 # thus ignoring the secant vertex (vertices).
8535 # @param theName Object name; when specified, this parameter is used
8536 # for result publication in the study. Otherwise, if automatic
8537 # publication is switched on, default value is used for result name.
8539 # @return New GEOM.GEOM_Object, containing the result shape.
8541 # @ref tui_fillet2d "Example"
8542 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8544 Perform a fillet on the specified edges of the given shape
8547 theShape Wire Shape to perform fillet on.
8549 theListOfVertexes Global indices of vertexes to perform fillet on.
8550 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8551 by the length of the edges, nearest to the fillet vertex.
8552 But sometimes the next edge is C1 continuous with the one, nearest to
8553 the fillet point, and such two (or more) edges can be united to allow
8554 bigger radius. Set this flag to TRUE to allow collinear edges union,
8555 thus ignoring the secant vertex (vertices).
8556 theName Object name; when specified, this parameter is used
8557 for result publication in the study. Otherwise, if automatic
8558 publication is switched on, default value is used for result name.
8560 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8562 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8565 New GEOM.GEOM_Object, containing the result shape.
8569 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8570 # make fillet at given wire vertices with giver radius
8571 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8573 # Example: see GEOM_TestAll.py
8574 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8575 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8576 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8577 anObj.SetParameters(Parameters)
8578 self._autoPublish(anObj, theName, "fillet")
8581 ## Perform a fillet at the specified vertices of the given face/shell.
8582 # @param theShape Face or Shell shape to perform fillet on.
8583 # @param theR Fillet radius.
8584 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8585 # @param theName Object name; when specified, this parameter is used
8586 # for result publication in the study. Otherwise, if automatic
8587 # publication is switched on, default value is used for result name.
8589 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8591 # @return New GEOM.GEOM_Object, containing the result shape.
8593 # @ref tui_fillet2d "Example"
8594 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8596 Perform a fillet at the specified vertices of the given face/shell.
8599 theShape Face or Shell shape to perform fillet on.
8601 theListOfVertexes Global indices of vertexes to perform fillet on.
8602 theName Object name; when specified, this parameter is used
8603 for result publication in the study. Otherwise, if automatic
8604 publication is switched on, default value is used for result name.
8606 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8609 New GEOM.GEOM_Object, containing the result shape.
8612 face = geompy.MakeFaceHW(100, 100, 1)
8613 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8615 # Example: see GEOM_TestAll.py
8616 theR,Parameters = ParseParameters(theR)
8617 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8618 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8619 anObj.SetParameters(Parameters)
8620 self._autoPublish(anObj, theName, "fillet")
8623 ## Perform a symmetric chamfer on all edges of the given shape.
8624 # @param theShape Shape, to perform chamfer on.
8625 # @param theD Chamfer size along each face.
8626 # @param theName Object name; when specified, this parameter is used
8627 # for result publication in the study. Otherwise, if automatic
8628 # publication is switched on, default value is used for result name.
8630 # @return New GEOM.GEOM_Object, containing the result shape.
8632 # @ref tui_chamfer "Example 1"
8633 # \n @ref swig_MakeChamferAll "Example 2"
8634 def MakeChamferAll(self, theShape, theD, theName=None):
8636 Perform a symmetric chamfer on all edges of the given shape.
8639 theShape Shape, to perform chamfer on.
8640 theD Chamfer size along each face.
8641 theName Object name; when specified, this parameter is used
8642 for result publication in the study. Otherwise, if automatic
8643 publication is switched on, default value is used for result name.
8646 New GEOM.GEOM_Object, containing the result shape.
8649 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8651 # Example: see GEOM_TestOthers.py
8652 theD,Parameters = ParseParameters(theD)
8653 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8654 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8655 anObj.SetParameters(Parameters)
8656 self._autoPublish(anObj, theName, "chamfer")
8659 ## Perform a chamfer on edges, common to the specified faces,
8660 # with distance D1 on the Face1
8661 # @param theShape Shape, to perform chamfer on.
8662 # @param theD1 Chamfer size along \a theFace1.
8663 # @param theD2 Chamfer size along \a theFace2.
8664 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8665 # @param theName Object name; when specified, this parameter is used
8666 # for result publication in the study. Otherwise, if automatic
8667 # publication is switched on, default value is used for result name.
8669 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8671 # @return New GEOM.GEOM_Object, containing the result shape.
8673 # @ref tui_chamfer "Example"
8674 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8676 Perform a chamfer on edges, common to the specified faces,
8677 with distance D1 on the Face1
8680 theShape Shape, to perform chamfer on.
8681 theD1 Chamfer size along theFace1.
8682 theD2 Chamfer size along theFace2.
8683 theFace1,theFace2 Global indices of two faces of theShape.
8684 theName Object name; when specified, this parameter is used
8685 for result publication in the study. Otherwise, if automatic
8686 publication is switched on, default value is used for result name.
8689 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8692 New GEOM.GEOM_Object, containing the result shape.
8695 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8696 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8697 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8698 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8700 # Example: see GEOM_TestAll.py
8701 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8702 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8703 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8704 anObj.SetParameters(Parameters)
8705 self._autoPublish(anObj, theName, "chamfer")
8708 ## Perform a chamfer on edges
8709 # @param theShape Shape, to perform chamfer on.
8710 # @param theD Chamfer length
8711 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8712 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8713 # @param theName Object name; when specified, this parameter is used
8714 # for result publication in the study. Otherwise, if automatic
8715 # publication is switched on, default value is used for result name.
8717 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8719 # @return New GEOM.GEOM_Object, containing the result shape.
8720 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8722 Perform a chamfer on edges
8725 theShape Shape, to perform chamfer on.
8726 theD1 Chamfer size along theFace1.
8727 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8728 theFace1,theFace2 Global indices of two faces of theShape.
8729 theName Object name; when specified, this parameter is used
8730 for result publication in the study. Otherwise, if automatic
8731 publication is switched on, default value is used for result name.
8734 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8737 New GEOM.GEOM_Object, containing the result shape.
8740 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8741 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8742 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8744 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8747 if isinstance(theAngle,str):
8749 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8751 theAngle = theAngle*math.pi/180.0
8752 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8753 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8754 anObj.SetParameters(Parameters)
8755 self._autoPublish(anObj, theName, "chamfer")
8758 ## Perform a chamfer on all edges of the specified faces,
8759 # with distance D1 on the first specified face (if several for one edge)
8760 # @param theShape Shape, to perform chamfer on.
8761 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8762 # connected to the edge, are in \a theFaces, \a theD1
8763 # will be get along face, which is nearer to \a theFaces beginning.
8764 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8765 # @param theFaces Sequence of global indices of faces of \a theShape.
8766 # @param theName Object name; when specified, this parameter is used
8767 # for result publication in the study. Otherwise, if automatic
8768 # publication is switched on, default value is used for result name.
8770 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8772 # @return New GEOM.GEOM_Object, containing the result shape.
8774 # @ref tui_chamfer "Example"
8775 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8777 Perform a chamfer on all edges of the specified faces,
8778 with distance D1 on the first specified face (if several for one edge)
8781 theShape Shape, to perform chamfer on.
8782 theD1 Chamfer size along face from theFaces. If both faces,
8783 connected to the edge, are in theFaces, theD1
8784 will be get along face, which is nearer to theFaces beginning.
8785 theD2 Chamfer size along another of two faces, connected to the edge.
8786 theFaces Sequence of global indices of faces of theShape.
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.
8791 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8794 New GEOM.GEOM_Object, containing the result shape.
8796 # Example: see GEOM_TestAll.py
8797 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8798 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8799 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8800 anObj.SetParameters(Parameters)
8801 self._autoPublish(anObj, theName, "chamfer")
8804 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8805 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8807 # @ref swig_FilletChamfer "Example"
8808 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8810 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8811 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8814 if isinstance(theAngle,str):
8816 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8818 theAngle = theAngle*math.pi/180.0
8819 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8820 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8821 anObj.SetParameters(Parameters)
8822 self._autoPublish(anObj, theName, "chamfer")
8825 ## Perform a chamfer on edges,
8826 # with distance D1 on the first specified face (if several for one edge)
8827 # @param theShape Shape, to perform chamfer on.
8828 # @param theD1,theD2 Chamfer size
8829 # @param theEdges Sequence of edges of \a theShape.
8830 # @param 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.
8834 # @return New GEOM.GEOM_Object, containing the result shape.
8836 # @ref swig_FilletChamfer "Example"
8837 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8839 Perform a chamfer on edges,
8840 with distance D1 on the first specified face (if several for one edge)
8843 theShape Shape, to perform chamfer on.
8844 theD1,theD2 Chamfer size
8845 theEdges Sequence of edges of theShape.
8846 theName Object name; when specified, this parameter is used
8847 for result publication in the study. Otherwise, if automatic
8848 publication is switched on, default value is used for result name.
8851 New GEOM.GEOM_Object, containing the result shape.
8853 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8854 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8855 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8856 anObj.SetParameters(Parameters)
8857 self._autoPublish(anObj, theName, "chamfer")
8860 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8861 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8862 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8864 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8865 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8868 if isinstance(theAngle,str):
8870 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8872 theAngle = theAngle*math.pi/180.0
8873 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8874 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8875 anObj.SetParameters(Parameters)
8876 self._autoPublish(anObj, theName, "chamfer")
8879 ## @sa MakeChamferEdge(), MakeChamferFaces()
8881 # @ref swig_MakeChamfer "Example"
8882 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8884 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8886 # Example: see GEOM_TestOthers.py
8888 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8889 if aShapeType == self.ShapeType["EDGE"]:
8890 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8892 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8895 ## Remove material from a solid by extrusion of the base shape on the given distance.
8896 # @param theInit Shape to remove material from. It must be a solid or
8897 # a compound made of a single solid.
8898 # @param theBase Closed edge or wire defining the base shape to be extruded.
8899 # @param theH Prism dimension along the normal to theBase
8900 # @param theAngle Draft angle in degrees.
8901 # @param theName Object name; when specified, this parameter is used
8902 # for result publication in the study. Otherwise, if automatic
8903 # publication is switched on, default value is used for result name.
8905 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8907 # @ref tui_creation_prism "Example"
8908 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8910 Add material to a solid by extrusion of the base shape on the given distance.
8913 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8914 theBase Closed edge or wire defining the base shape to be extruded.
8915 theH Prism dimension along the normal to theBase
8916 theAngle Draft angle in degrees.
8917 theName Object name; when specified, this parameter is used
8918 for result publication in the study. Otherwise, if automatic
8919 publication is switched on, default value is used for result name.
8922 New GEOM.GEOM_Object, containing the initial shape with removed material.
8924 # Example: see GEOM_TestAll.py
8925 #theH,Parameters = ParseParameters(theH)
8926 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8927 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8928 #anObj.SetParameters(Parameters)
8929 self._autoPublish(anObj, theName, "extrudedCut")
8932 ## Add material to a solid by extrusion of the base shape on the given distance.
8933 # @param theInit Shape to add material to. It must be a solid or
8934 # a compound made of a single solid.
8935 # @param theBase Closed edge or wire defining the base shape to be extruded.
8936 # @param theH Prism dimension along the normal to theBase
8937 # @param theAngle Draft angle in degrees.
8938 # @param theName Object name; when specified, this parameter is used
8939 # for result publication in the study. Otherwise, if automatic
8940 # publication is switched on, default value is used for result name.
8942 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8944 # @ref tui_creation_prism "Example"
8945 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8947 Add material to a solid by extrusion of the base shape on the given distance.
8950 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8951 theBase Closed edge or wire defining the base shape to be extruded.
8952 theH Prism dimension along the normal to theBase
8953 theAngle Draft angle in degrees.
8954 theName Object name; when specified, this parameter is used
8955 for result publication in the study. Otherwise, if automatic
8956 publication is switched on, default value is used for result name.
8959 New GEOM.GEOM_Object, containing the initial shape with added material.
8961 # Example: see GEOM_TestAll.py
8962 #theH,Parameters = ParseParameters(theH)
8963 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8964 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8965 #anObj.SetParameters(Parameters)
8966 self._autoPublish(anObj, theName, "extrudedBoss")
8972 ## @addtogroup l3_basic_op
8975 ## Perform an Archimde operation on the given shape with given parameters.
8976 # The object presenting the resulting face is returned.
8977 # @param theShape Shape to be put in water.
8978 # @param theWeight Weight og the shape.
8979 # @param theWaterDensity Density of the water.
8980 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8981 # @param theName Object name; when specified, this parameter is used
8982 # for result publication in the study. Otherwise, if automatic
8983 # publication is switched on, default value is used for result name.
8985 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8986 # by a plane, corresponding to water level.
8988 # @ref tui_archimede "Example"
8989 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8991 Perform an Archimde operation on the given shape with given parameters.
8992 The object presenting the resulting face is returned.
8995 theShape Shape to be put in water.
8996 theWeight Weight og the shape.
8997 theWaterDensity Density of the water.
8998 theMeshDeflection Deflection of the mesh, using to compute the section.
8999 theName Object name; when specified, this parameter is used
9000 for result publication in the study. Otherwise, if automatic
9001 publication is switched on, default value is used for result name.
9004 New GEOM.GEOM_Object, containing a section of theShape
9005 by a plane, corresponding to water level.
9007 # Example: see GEOM_TestAll.py
9008 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9009 theWeight,theWaterDensity,theMeshDeflection)
9010 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9011 RaiseIfFailed("MakeArchimede", self.LocalOp)
9012 anObj.SetParameters(Parameters)
9013 self._autoPublish(anObj, theName, "archimede")
9016 # end of l3_basic_op
9019 ## @addtogroup l2_measure
9022 ## Get point coordinates
9025 # @ref tui_measurement_tools_page "Example"
9026 def PointCoordinates(self,Point):
9028 Get point coordinates
9033 # Example: see GEOM_TestMeasures.py
9034 aTuple = self.MeasuOp.PointCoordinates(Point)
9035 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9038 ## Get vector coordinates
9041 # @ref tui_measurement_tools_page "Example"
9042 def VectorCoordinates(self,Vector):
9044 Get vector coordinates
9050 p1=self.GetFirstVertex(Vector)
9051 p2=self.GetLastVertex(Vector)
9053 X1=self.PointCoordinates(p1)
9054 X2=self.PointCoordinates(p2)
9056 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9059 ## Compute cross product
9060 # @return vector w=u^v
9062 # @ref tui_measurement_tools_page "Example"
9063 def CrossProduct(self, Vector1, Vector2):
9065 Compute cross product
9067 Returns: vector w=u^v
9069 u=self.VectorCoordinates(Vector1)
9070 v=self.VectorCoordinates(Vector2)
9071 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])
9075 ## Compute cross product
9076 # @return dot product p=u.v
9078 # @ref tui_measurement_tools_page "Example"
9079 def DotProduct(self, Vector1, Vector2):
9081 Compute cross product
9083 Returns: dot product p=u.v
9085 u=self.VectorCoordinates(Vector1)
9086 v=self.VectorCoordinates(Vector2)
9087 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9092 ## Get summarized length of all wires,
9093 # area of surface and volume of the given shape.
9094 # @param theShape Shape to define properties of.
9095 # @return [theLength, theSurfArea, theVolume]\n
9096 # theLength: Summarized length of all wires of the given shape.\n
9097 # theSurfArea: Area of surface of the given shape.\n
9098 # theVolume: Volume of the given shape.
9100 # @ref tui_measurement_tools_page "Example"
9101 def BasicProperties(self,theShape):
9103 Get summarized length of all wires,
9104 area of surface and volume of the given shape.
9107 theShape Shape to define properties of.
9110 [theLength, theSurfArea, theVolume]
9111 theLength: Summarized length of all wires of the given shape.
9112 theSurfArea: Area of surface of the given shape.
9113 theVolume: Volume of the given shape.
9115 # Example: see GEOM_TestMeasures.py
9116 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9117 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9120 ## Get parameters of bounding box of the given shape
9121 # @param theShape Shape to obtain bounding box of.
9122 # @param precise TRUE for precise computation; FALSE for fast one.
9123 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9124 # Xmin,Xmax: Limits of shape along OX axis.
9125 # Ymin,Ymax: Limits of shape along OY axis.
9126 # Zmin,Zmax: Limits of shape along OZ axis.
9128 # @ref tui_measurement_tools_page "Example"
9129 def BoundingBox (self, theShape, precise=False):
9131 Get parameters of bounding box of the given shape
9134 theShape Shape to obtain bounding box of.
9135 precise TRUE for precise computation; FALSE for fast one.
9138 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9139 Xmin,Xmax: Limits of shape along OX axis.
9140 Ymin,Ymax: Limits of shape along OY axis.
9141 Zmin,Zmax: Limits of shape along OZ axis.
9143 # Example: see GEOM_TestMeasures.py
9144 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9145 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9148 ## Get bounding box of the given shape
9149 # @param theShape Shape to obtain bounding box of.
9150 # @param precise TRUE for precise computation; FALSE for fast one.
9151 # @param theName Object name; when specified, this parameter is used
9152 # for result publication in the study. Otherwise, if automatic
9153 # publication is switched on, default value is used for result name.
9155 # @return New GEOM.GEOM_Object, containing the created box.
9157 # @ref tui_measurement_tools_page "Example"
9158 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9160 Get bounding box of the given shape
9163 theShape Shape to obtain bounding box of.
9164 precise TRUE for precise computation; FALSE for fast one.
9165 theName Object name; when specified, this parameter is used
9166 for result publication in the study. Otherwise, if automatic
9167 publication is switched on, default value is used for result name.
9170 New GEOM.GEOM_Object, containing the created box.
9172 # Example: see GEOM_TestMeasures.py
9173 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9174 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9175 self._autoPublish(anObj, theName, "bndbox")
9178 ## Get inertia matrix and moments of inertia of theShape.
9179 # @param theShape Shape to calculate inertia of.
9180 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9181 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9182 # Ix,Iy,Iz: Moments of inertia of the given shape.
9184 # @ref tui_measurement_tools_page "Example"
9185 def Inertia(self,theShape):
9187 Get inertia matrix and moments of inertia of theShape.
9190 theShape Shape to calculate inertia of.
9193 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9194 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9195 Ix,Iy,Iz: Moments of inertia of the given shape.
9197 # Example: see GEOM_TestMeasures.py
9198 aTuple = self.MeasuOp.GetInertia(theShape)
9199 RaiseIfFailed("GetInertia", self.MeasuOp)
9202 ## Get if coords are included in the shape (ST_IN or ST_ON)
9203 # @param theShape Shape
9204 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9205 # @param tolerance to be used (default is 1.0e-7)
9206 # @return list_of_boolean = [res1, res2, ...]
9207 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9209 Get if coords are included in the shape (ST_IN or ST_ON)
9213 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9214 tolerance to be used (default is 1.0e-7)
9217 list_of_boolean = [res1, res2, ...]
9219 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9221 ## Get minimal distance between the given shapes.
9222 # @param theShape1,theShape2 Shapes to find minimal distance between.
9223 # @return Value of the minimal distance between the given shapes.
9225 # @ref tui_measurement_tools_page "Example"
9226 def MinDistance(self, theShape1, theShape2):
9228 Get minimal distance between the given shapes.
9231 theShape1,theShape2 Shapes to find minimal distance between.
9234 Value of the minimal distance between the given shapes.
9236 # Example: see GEOM_TestMeasures.py
9237 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9238 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9241 ## Get minimal distance between the given shapes.
9242 # @param theShape1,theShape2 Shapes to find minimal distance between.
9243 # @return Value of the minimal distance between the given shapes, in form of list
9244 # [Distance, DX, DY, DZ].
9246 # @ref swig_all_measure "Example"
9247 def MinDistanceComponents(self, theShape1, theShape2):
9249 Get minimal distance between the given shapes.
9252 theShape1,theShape2 Shapes to find minimal distance between.
9255 Value of the minimal distance between the given shapes, in form of list
9256 [Distance, DX, DY, DZ]
9258 # Example: see GEOM_TestMeasures.py
9259 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9260 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9261 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9264 ## Get closest points of the given shapes.
9265 # @param theShape1,theShape2 Shapes to find closest points of.
9266 # @return The number of found solutions (-1 in case of infinite number of
9267 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9269 # @ref tui_measurement_tools_page "Example"
9270 def ClosestPoints (self, theShape1, theShape2):
9272 Get closest points of the given shapes.
9275 theShape1,theShape2 Shapes to find closest points of.
9278 The number of found solutions (-1 in case of infinite number of
9279 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9281 # Example: see GEOM_TestMeasures.py
9282 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9283 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9286 ## Get angle between the given shapes in degrees.
9287 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9288 # @note If both arguments are vectors, the angle is computed in accordance
9289 # with their orientations, otherwise the minimum angle is computed.
9290 # @return Value of the angle between the given shapes in degrees.
9292 # @ref tui_measurement_tools_page "Example"
9293 def GetAngle(self, theShape1, theShape2):
9295 Get angle between the given shapes in degrees.
9298 theShape1,theShape2 Lines or linear edges to find angle between.
9301 If both arguments are vectors, the angle is computed in accordance
9302 with their orientations, otherwise the minimum angle is computed.
9305 Value of the angle between the given shapes in degrees.
9307 # Example: see GEOM_TestMeasures.py
9308 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9309 RaiseIfFailed("GetAngle", self.MeasuOp)
9312 ## Get angle between the given shapes in radians.
9313 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9314 # @note If both arguments are vectors, the angle is computed in accordance
9315 # with their orientations, otherwise the minimum angle is computed.
9316 # @return Value of the angle between the given shapes in radians.
9318 # @ref tui_measurement_tools_page "Example"
9319 def GetAngleRadians(self, theShape1, theShape2):
9321 Get angle between the given shapes in radians.
9324 theShape1,theShape2 Lines or linear edges to find angle between.
9328 If both arguments are vectors, the angle is computed in accordance
9329 with their orientations, otherwise the minimum angle is computed.
9332 Value of the angle between the given shapes in radians.
9334 # Example: see GEOM_TestMeasures.py
9335 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9336 RaiseIfFailed("GetAngle", self.MeasuOp)
9339 ## Get angle between the given vectors in degrees.
9340 # @param theShape1,theShape2 Vectors to find angle between.
9341 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9342 # if False, the opposite vector to the normal vector is used.
9343 # @return Value of the angle between the given vectors in degrees.
9345 # @ref tui_measurement_tools_page "Example"
9346 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9348 Get angle between the given vectors in degrees.
9351 theShape1,theShape2 Vectors to find angle between.
9352 theFlag If True, the normal vector is defined by the two vectors cross,
9353 if False, the opposite vector to the normal vector is used.
9356 Value of the angle between the given vectors in degrees.
9358 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9360 anAngle = 360. - anAngle
9361 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9364 ## The same as GetAngleVectors, but the result is in radians.
9365 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9367 Get angle between the given vectors in radians.
9370 theShape1,theShape2 Vectors to find angle between.
9371 theFlag If True, the normal vector is defined by the two vectors cross,
9372 if False, the opposite vector to the normal vector is used.
9375 Value of the angle between the given vectors in radians.
9377 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9380 ## @name Curve Curvature Measurement
9381 # Methods for receiving radius of curvature of curves
9382 # in the given point
9385 ## Measure curvature of a curve at a point, set by parameter.
9386 # @param theCurve a curve.
9387 # @param theParam parameter.
9388 # @return radius of curvature of \a theCurve.
9390 # @ref swig_todo "Example"
9391 def CurveCurvatureByParam(self, theCurve, theParam):
9393 Measure curvature of a curve at a point, set by parameter.
9400 radius of curvature of theCurve.
9402 # Example: see GEOM_TestMeasures.py
9403 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9404 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9407 ## Measure curvature of a curve at a point.
9408 # @param theCurve a curve.
9409 # @param thePoint given point.
9410 # @return radius of curvature of \a theCurve.
9412 # @ref swig_todo "Example"
9413 def CurveCurvatureByPoint(self, theCurve, thePoint):
9415 Measure curvature of a curve at a point.
9419 thePoint given point.
9422 radius of curvature of theCurve.
9424 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9425 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9429 ## @name Surface Curvature Measurement
9430 # Methods for receiving max and min radius of curvature of surfaces
9431 # in the given point
9434 ## Measure max radius of curvature of surface.
9435 # @param theSurf the given surface.
9436 # @param theUParam Value of U-parameter on the referenced surface.
9437 # @param theVParam Value of V-parameter on the referenced surface.
9438 # @return max radius of curvature of theSurf.
9440 ## @ref swig_todo "Example"
9441 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9443 Measure max radius of curvature of surface.
9446 theSurf the given surface.
9447 theUParam Value of U-parameter on the referenced surface.
9448 theVParam Value of V-parameter on the referenced surface.
9451 max radius of curvature of theSurf.
9453 # Example: see GEOM_TestMeasures.py
9454 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9455 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9458 ## Measure max radius of curvature of surface in the given point
9459 # @param theSurf the given surface.
9460 # @param thePoint given point.
9461 # @return max radius of curvature of theSurf.
9463 ## @ref swig_todo "Example"
9464 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9466 Measure max radius of curvature of surface in the given point.
9469 theSurf the given surface.
9470 thePoint given point.
9473 max radius of curvature of theSurf.
9475 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9476 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9479 ## Measure min radius of curvature of surface.
9480 # @param theSurf the given surface.
9481 # @param theUParam Value of U-parameter on the referenced surface.
9482 # @param theVParam Value of V-parameter on the referenced surface.
9483 # @return min radius of curvature of theSurf.
9485 ## @ref swig_todo "Example"
9486 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9488 Measure min radius of curvature of surface.
9491 theSurf the given surface.
9492 theUParam Value of U-parameter on the referenced surface.
9493 theVParam Value of V-parameter on the referenced surface.
9496 Min radius of curvature of theSurf.
9498 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9499 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9502 ## Measure min radius of curvature of surface in the given point
9503 # @param theSurf the given surface.
9504 # @param thePoint given point.
9505 # @return min radius of curvature of theSurf.
9507 ## @ref swig_todo "Example"
9508 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9510 Measure min radius of curvature of surface in the given point.
9513 theSurf the given surface.
9514 thePoint given point.
9517 Min radius of curvature of theSurf.
9519 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9520 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9524 ## Get min and max tolerances of sub-shapes of theShape
9525 # @param theShape Shape, to get tolerances of.
9526 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9527 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9528 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9529 # VertMin,VertMax: Min and max tolerances of the vertices.
9531 # @ref tui_measurement_tools_page "Example"
9532 def Tolerance(self,theShape):
9534 Get min and max tolerances of sub-shapes of theShape
9537 theShape Shape, to get tolerances of.
9540 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9541 FaceMin,FaceMax: Min and max tolerances of the faces.
9542 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9543 VertMin,VertMax: Min and max tolerances of the vertices.
9545 # Example: see GEOM_TestMeasures.py
9546 aTuple = self.MeasuOp.GetTolerance(theShape)
9547 RaiseIfFailed("GetTolerance", self.MeasuOp)
9550 ## Obtain description of the given shape (number of sub-shapes of each type)
9551 # @param theShape Shape to be described.
9552 # @return Description of the given shape.
9554 # @ref tui_measurement_tools_page "Example"
9555 def WhatIs(self,theShape):
9557 Obtain description of the given shape (number of sub-shapes of each type)
9560 theShape Shape to be described.
9563 Description of the given shape.
9565 # Example: see GEOM_TestMeasures.py
9566 aDescr = self.MeasuOp.WhatIs(theShape)
9567 RaiseIfFailed("WhatIs", self.MeasuOp)
9570 ## Obtain quantity of shapes of the given type in \a theShape.
9571 # If \a theShape is of type \a theType, it is also counted.
9572 # @param theShape Shape to be described.
9573 # @param theType the given ShapeType().
9574 # @return Quantity of shapes of type \a theType in \a theShape.
9576 # @ref tui_measurement_tools_page "Example"
9577 def NbShapes (self, theShape, theType):
9579 Obtain quantity of shapes of the given type in theShape.
9580 If theShape is of type theType, it is also counted.
9583 theShape Shape to be described.
9584 theType the given geompy.ShapeType
9587 Quantity of shapes of type theType in theShape.
9589 # Example: see GEOM_TestMeasures.py
9590 listSh = self.SubShapeAllIDs(theShape, theType)
9592 t = EnumToLong(theShape.GetShapeType())
9593 theType = EnumToLong(theType)
9599 ## Obtain quantity of shapes of each type in \a theShape.
9600 # The \a theShape is also counted.
9601 # @param theShape Shape to be described.
9602 # @return Dictionary of ShapeType() with bound quantities of shapes.
9604 # @ref tui_measurement_tools_page "Example"
9605 def ShapeInfo (self, theShape):
9607 Obtain quantity of shapes of each type in theShape.
9608 The theShape is also counted.
9611 theShape Shape to be described.
9614 Dictionary of geompy.ShapeType with bound quantities of shapes.
9616 # Example: see GEOM_TestMeasures.py
9618 for typeSh in self.ShapeType:
9619 if typeSh in ( "AUTO", "SHAPE" ): continue
9620 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
9622 if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
9629 def GetCreationInformation(self, theShape):
9630 info = theShape.GetCreationInformation()
9632 opName = info.operationName
9633 if not opName: opName = "no info available"
9634 res = "Operation: " + opName
9636 for parVal in info.params:
9637 res += " \n %s = %s" % ( parVal.name, parVal.value )
9640 ## Get a point, situated at the centre of mass of theShape.
9641 # @param theShape Shape to define centre of mass of.
9642 # @param theName Object name; when specified, this parameter is used
9643 # for result publication in the study. Otherwise, if automatic
9644 # publication is switched on, default value is used for result name.
9646 # @return New GEOM.GEOM_Object, containing the created point.
9648 # @ref tui_measurement_tools_page "Example"
9649 def MakeCDG(self, theShape, theName=None):
9651 Get a point, situated at the centre of mass of theShape.
9654 theShape Shape to define centre of mass of.
9655 theName Object name; when specified, this parameter is used
9656 for result publication in the study. Otherwise, if automatic
9657 publication is switched on, default value is used for result name.
9660 New GEOM.GEOM_Object, containing the created point.
9662 # Example: see GEOM_TestMeasures.py
9663 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9664 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9665 self._autoPublish(anObj, theName, "centerOfMass")
9668 ## Get a vertex sub-shape by index depended with orientation.
9669 # @param theShape Shape to find sub-shape.
9670 # @param theIndex Index to find vertex by this index (starting from zero)
9671 # @param theName Object name; when specified, this parameter is used
9672 # for result publication in the study. Otherwise, if automatic
9673 # publication is switched on, default value is used for result name.
9675 # @return New GEOM.GEOM_Object, containing the created vertex.
9677 # @ref tui_measurement_tools_page "Example"
9678 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9680 Get a vertex sub-shape by index depended with orientation.
9683 theShape Shape to find sub-shape.
9684 theIndex Index to find vertex by this index (starting from zero)
9685 theName Object name; when specified, this parameter is used
9686 for result publication in the study. Otherwise, if automatic
9687 publication is switched on, default value is used for result name.
9690 New GEOM.GEOM_Object, containing the created vertex.
9692 # Example: see GEOM_TestMeasures.py
9693 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9694 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9695 self._autoPublish(anObj, theName, "vertex")
9698 ## Get the first vertex of wire/edge depended orientation.
9699 # @param theShape Shape to find first vertex.
9700 # @param theName Object name; when specified, this parameter is used
9701 # for result publication in the study. Otherwise, if automatic
9702 # publication is switched on, default value is used for result name.
9704 # @return New GEOM.GEOM_Object, containing the created vertex.
9706 # @ref tui_measurement_tools_page "Example"
9707 def GetFirstVertex(self, theShape, theName=None):
9709 Get the first vertex of wire/edge depended orientation.
9712 theShape Shape to find first vertex.
9713 theName Object name; when specified, this parameter is used
9714 for result publication in the study. Otherwise, if automatic
9715 publication is switched on, default value is used for result name.
9718 New GEOM.GEOM_Object, containing the created vertex.
9720 # Example: see GEOM_TestMeasures.py
9721 # note: auto-publishing is done in self.GetVertexByIndex()
9722 anObj = self.GetVertexByIndex(theShape, 0, theName)
9723 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9726 ## Get the last vertex of wire/edge depended orientation.
9727 # @param theShape Shape to find last vertex.
9728 # @param theName Object name; when specified, this parameter is used
9729 # for result publication in the study. Otherwise, if automatic
9730 # publication is switched on, default value is used for result name.
9732 # @return New GEOM.GEOM_Object, containing the created vertex.
9734 # @ref tui_measurement_tools_page "Example"
9735 def GetLastVertex(self, theShape, theName=None):
9737 Get the last vertex of wire/edge depended orientation.
9740 theShape Shape to find last vertex.
9741 theName Object name; when specified, this parameter is used
9742 for result publication in the study. Otherwise, if automatic
9743 publication is switched on, default value is used for result name.
9746 New GEOM.GEOM_Object, containing the created vertex.
9748 # Example: see GEOM_TestMeasures.py
9749 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
9750 # note: auto-publishing is done in self.GetVertexByIndex()
9751 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9752 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9755 ## Get a normale to the given face. If the point is not given,
9756 # the normale is calculated at the center of mass.
9757 # @param theFace Face to define normale of.
9758 # @param theOptionalPoint Point to compute the normale at.
9759 # @param theName Object name; when specified, this parameter is used
9760 # for result publication in the study. Otherwise, if automatic
9761 # publication is switched on, default value is used for result name.
9763 # @return New GEOM.GEOM_Object, containing the created vector.
9765 # @ref swig_todo "Example"
9766 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9768 Get a normale to the given face. If the point is not given,
9769 the normale is calculated at the center of mass.
9772 theFace Face to define normale of.
9773 theOptionalPoint Point to compute the normale at.
9774 theName Object name; when specified, this parameter is used
9775 for result publication in the study. Otherwise, if automatic
9776 publication is switched on, default value is used for result name.
9779 New GEOM.GEOM_Object, containing the created vector.
9781 # Example: see GEOM_TestMeasures.py
9782 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9783 RaiseIfFailed("GetNormal", self.MeasuOp)
9784 self._autoPublish(anObj, theName, "normal")
9787 ## Check a topology of the given shape.
9788 # @param theShape Shape to check validity of.
9789 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9790 # if TRUE, the shape's geometry will be checked also.
9791 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9792 # of problem is printed.
9793 # if TRUE and if theShape is invalid, the description
9794 # of problem is also returned.
9795 # @return TRUE, if the shape "seems to be valid".
9797 # @ref tui_measurement_tools_page "Example"
9798 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9800 Check a topology of the given shape.
9803 theShape Shape to check validity of.
9804 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9805 if TRUE, the shape's geometry will be checked also.
9806 theReturnStatus If FALSE and if theShape is invalid, a description
9807 of problem is printed.
9808 if TRUE and if theShape is invalid, the description
9809 of problem is returned.
9812 TRUE, if the shape "seems to be valid".
9813 If theShape is invalid, prints a description of problem.
9814 This description can also be returned.
9816 # Example: see GEOM_TestMeasures.py
9818 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9819 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9821 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9822 RaiseIfFailed("CheckShape", self.MeasuOp)
9824 if theReturnStatus == 0:
9826 if theReturnStatus == 1:
9827 return (IsValid, Status)
9830 ## Detect self-intersections in the given shape.
9831 # @param theShape Shape to check.
9832 # @return TRUE, if the shape contains no self-intersections.
9834 # @ref tui_measurement_tools_page "Example"
9835 def CheckSelfIntersections(self, theShape):
9837 Detect self-intersections in the given shape.
9840 theShape Shape to check.
9843 TRUE, if the shape contains no self-intersections.
9845 # Example: see GEOM_TestMeasures.py
9846 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9847 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9850 ## Get position (LCS) of theShape.
9852 # Origin of the LCS is situated at the shape's center of mass.
9853 # Axes of the LCS are obtained from shape's location or,
9854 # if the shape is a planar face, from position of its plane.
9856 # @param theShape Shape to calculate position of.
9857 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9858 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9859 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9860 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9862 # @ref swig_todo "Example"
9863 def GetPosition(self,theShape):
9865 Get position (LCS) of theShape.
9866 Origin of the LCS is situated at the shape's center of mass.
9867 Axes of the LCS are obtained from shape's location or,
9868 if the shape is a planar face, from position of its plane.
9871 theShape Shape to calculate position of.
9874 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9875 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9876 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9877 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9879 # Example: see GEOM_TestMeasures.py
9880 aTuple = self.MeasuOp.GetPosition(theShape)
9881 RaiseIfFailed("GetPosition", self.MeasuOp)
9884 ## Get kind of theShape.
9886 # @param theShape Shape to get a kind of.
9887 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9888 # and a list of parameters, describing the shape.
9889 # @note Concrete meaning of each value, returned via \a theIntegers
9890 # or \a theDoubles list depends on the kind() of the shape.
9892 # @ref swig_todo "Example"
9893 def KindOfShape(self,theShape):
9895 Get kind of theShape.
9898 theShape Shape to get a kind of.
9901 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9902 and a list of parameters, describing the shape.
9904 Concrete meaning of each value, returned via theIntegers
9905 or theDoubles list depends on the geompy.kind of the shape
9907 # Example: see GEOM_TestMeasures.py
9908 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9909 RaiseIfFailed("KindOfShape", self.MeasuOp)
9911 aKind = aRoughTuple[0]
9912 anInts = aRoughTuple[1]
9913 aDbls = aRoughTuple[2]
9915 # Now there is no exception from this rule:
9916 aKindTuple = [aKind] + aDbls + anInts
9918 # If they are we will regroup parameters for such kind of shape.
9920 #if aKind == kind.SOME_KIND:
9921 # # SOME_KIND int int double int double double
9922 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9929 ## @addtogroup l2_import_export
9932 ## Import a shape from the BREP or IGES or STEP file
9933 # (depends on given format) with given name.
9934 # @param theFileName The file, containing the shape.
9935 # @param theFormatName Specify format for the file reading.
9936 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9937 # If format 'IGES_SCALE' is used instead of 'IGES' or
9938 # format 'STEP_SCALE' is used instead of 'STEP',
9939 # length unit will be set to 'meter' and result model will be scaled.
9940 # @param theName Object name; when specified, this parameter is used
9941 # for result publication in the study. Otherwise, if automatic
9942 # publication is switched on, default value is used for result name.
9944 # @return New GEOM.GEOM_Object, containing the imported shape.
9946 # @ref swig_Import_Export "Example"
9947 def ImportFile(self, theFileName, theFormatName, theName=None):
9949 Import a shape from the BREP or IGES or STEP file
9950 (depends on given format) with given name.
9953 theFileName The file, containing the shape.
9954 theFormatName Specify format for the file reading.
9955 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9956 If format 'IGES_SCALE' is used instead of 'IGES' or
9957 format 'STEP_SCALE' is used instead of 'STEP',
9958 length unit will be set to 'meter' and result model will be scaled.
9959 theName Object name; when specified, this parameter is used
9960 for result publication in the study. Otherwise, if automatic
9961 publication is switched on, default value is used for result name.
9964 New GEOM.GEOM_Object, containing the imported shape.
9966 # Example: see GEOM_TestOthers.py
9967 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9968 RaiseIfFailed("ImportFile", self.InsertOp)
9969 self._autoPublish(anObj, theName, "imported")
9972 ## Deprecated analog of ImportFile()
9973 def Import(self, theFileName, theFormatName, theName=None):
9975 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9977 print "WARNING: Function Import is deprecated, use ImportFile instead"
9978 # note: auto-publishing is done in self.ImportFile()
9979 return self.ImportFile(theFileName, theFormatName, theName)
9981 ## Shortcut to ImportFile() for BREP format.
9982 # Import a shape from the BREP file with given name.
9983 # @param theFileName The file, containing the shape.
9984 # @param theName Object name; when specified, this parameter is used
9985 # for result publication in the study. Otherwise, if automatic
9986 # publication is switched on, default value is used for result name.
9988 # @return New GEOM.GEOM_Object, containing the imported shape.
9990 # @ref swig_Import_Export "Example"
9991 def ImportBREP(self, theFileName, theName=None):
9993 geompy.ImportFile(...) function for BREP format
9994 Import a shape from the BREP file with given name.
9997 theFileName The file, containing the shape.
9998 theName Object name; when specified, this parameter is used
9999 for result publication in the study. Otherwise, if automatic
10000 publication is switched on, default value is used for result name.
10003 New GEOM.GEOM_Object, containing the imported shape.
10005 # Example: see GEOM_TestOthers.py
10006 # note: auto-publishing is done in self.ImportFile()
10007 return self.ImportFile(theFileName, "BREP", theName)
10009 ## Shortcut to ImportFile() for IGES format
10010 # Import a shape from the IGES file with given name.
10011 # @param theFileName The file, containing the shape.
10012 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10013 # and result model will be scaled, if its units are not meters.
10014 # If False (default), file length units will be taken into account.
10015 # @param theName Object name; when specified, this parameter is used
10016 # for result publication in the study. Otherwise, if automatic
10017 # publication is switched on, default value is used for result name.
10019 # @return New GEOM.GEOM_Object, containing the imported shape.
10021 # @ref swig_Import_Export "Example"
10022 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10024 geompy.ImportFile(...) function for IGES format
10027 theFileName The file, containing the shape.
10028 ignoreUnits If True, file length units will be ignored (set to 'meter')
10029 and result model will be scaled, if its units are not meters.
10030 If False (default), file length units will be taken into account.
10031 theName Object name; when specified, this parameter is used
10032 for result publication in the study. Otherwise, if automatic
10033 publication is switched on, default value is used for result name.
10036 New GEOM.GEOM_Object, containing the imported shape.
10038 # Example: see GEOM_TestOthers.py
10039 # note: auto-publishing is done in self.ImportFile()
10041 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10042 return self.ImportFile(theFileName, "IGES", theName)
10044 ## Return length unit from given IGES file
10045 # @param theFileName The file, containing the shape.
10046 # @return String, containing the units name.
10048 # @ref swig_Import_Export "Example"
10049 def GetIGESUnit(self, theFileName):
10051 Return length units from given IGES file
10054 theFileName The file, containing the shape.
10057 String, containing the units name.
10059 # Example: see GEOM_TestOthers.py
10060 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10063 ## Shortcut to ImportFile() for STEP format
10064 # Import a shape from the STEP file with given name.
10065 # @param theFileName The file, containing the shape.
10066 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10067 # and result model will be scaled, if its units are not meters.
10068 # If False (default), file length units will be taken into account.
10069 # @param theName Object name; when specified, this parameter is used
10070 # for result publication in the study. Otherwise, if automatic
10071 # publication is switched on, default value is used for result name.
10073 # @return New GEOM.GEOM_Object, containing the imported shape.
10075 # @ref swig_Import_Export "Example"
10076 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10078 geompy.ImportFile(...) function for STEP format
10081 theFileName The file, containing the shape.
10082 ignoreUnits If True, file length units will be ignored (set to 'meter')
10083 and result model will be scaled, if its units are not meters.
10084 If False (default), file length units will be taken into account.
10085 theName Object name; when specified, this parameter is used
10086 for result publication in the study. Otherwise, if automatic
10087 publication is switched on, default value is used for result name.
10090 New GEOM.GEOM_Object, containing the imported shape.
10092 # Example: see GEOM_TestOthers.py
10093 # note: auto-publishing is done in self.ImportFile()
10095 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10096 return self.ImportFile(theFileName, "STEP", theName)
10098 ## Return length unit from given IGES or STEP file
10099 # @param theFileName The file, containing the shape.
10100 # @return String, containing the units name.
10102 # @ref swig_Import_Export "Example"
10103 def GetSTEPUnit(self, theFileName):
10105 Return length units from given STEP file
10108 theFileName The file, containing the shape.
10111 String, containing the units name.
10113 # Example: see GEOM_TestOthers.py
10114 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10117 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10118 # @note This method will not be dumped to the python script by DumpStudy functionality.
10119 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10120 # @param theStream The BRep binary stream.
10121 # @param theName Object name; when specified, this parameter is used
10122 # for result publication in the study. Otherwise, if automatic
10123 # publication is switched on, default value is used for result name.
10125 # @return New GEOM_Object, containing the shape, read from theStream.
10127 # @ref swig_Import_Export "Example"
10128 def RestoreShape (self, theStream, theName=None):
10130 Read a shape from the binary stream, containing its bounding representation (BRep).
10133 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10136 theStream The BRep binary stream.
10137 theName Object name; when specified, this parameter is used
10138 for result publication in the study. Otherwise, if automatic
10139 publication is switched on, default value is used for result name.
10142 New GEOM_Object, containing the shape, read from theStream.
10144 # Example: see GEOM_TestOthers.py
10145 anObj = self.InsertOp.RestoreShape(theStream)
10146 RaiseIfFailed("RestoreShape", self.InsertOp)
10147 self._autoPublish(anObj, theName, "restored")
10150 ## Export the given shape into a file with given name.
10151 # @param theObject Shape to be stored in the file.
10152 # @param theFileName Name of the file to store the given shape in.
10153 # @param theFormatName Specify format for the shape storage.
10154 # Available formats can be obtained with
10155 # geompy.InsertOp.ExportTranslators()[0] method.
10157 # @ref swig_Import_Export "Example"
10158 def Export(self, theObject, theFileName, theFormatName):
10160 Export the given shape into a file with given name.
10163 theObject Shape to be stored in the file.
10164 theFileName Name of the file to store the given shape in.
10165 theFormatName Specify format for the shape storage.
10166 Available formats can be obtained with
10167 geompy.InsertOp.ExportTranslators()[0] method.
10169 # Example: see GEOM_TestOthers.py
10170 self.InsertOp.Export(theObject, theFileName, theFormatName)
10171 if self.InsertOp.IsDone() == 0:
10172 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10176 ## Shortcut to Export() for BREP format
10178 # @ref swig_Import_Export "Example"
10179 def ExportBREP(self,theObject, theFileName):
10181 geompy.Export(...) function for BREP format
10183 # Example: see GEOM_TestOthers.py
10184 return self.Export(theObject, theFileName, "BREP")
10186 ## Shortcut to Export() for IGES format
10188 # @ref swig_Import_Export "Example"
10189 def ExportIGES(self,theObject, theFileName):
10191 geompy.Export(...) function for IGES format
10193 # Example: see GEOM_TestOthers.py
10194 return self.Export(theObject, theFileName, "IGES")
10196 ## Shortcut to Export() for STEP format
10198 # @ref swig_Import_Export "Example"
10199 def ExportSTEP(self,theObject, theFileName):
10201 geompy.Export(...) function for STEP format
10203 # Example: see GEOM_TestOthers.py
10204 return self.Export(theObject, theFileName, "STEP")
10206 # end of l2_import_export
10209 ## @addtogroup l3_blocks
10212 ## Create a quadrangle face from four edges. Order of Edges is not
10213 # important. It is not necessary that edges share the same vertex.
10214 # @param E1,E2,E3,E4 Edges for the face bound.
10215 # @param theName Object name; when specified, this parameter is used
10216 # for result publication in the study. Otherwise, if automatic
10217 # publication is switched on, default value is used for result name.
10219 # @return New GEOM.GEOM_Object, containing the created face.
10221 # @ref tui_building_by_blocks_page "Example"
10222 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10224 Create a quadrangle face from four edges. Order of Edges is not
10225 important. It is not necessary that edges share the same vertex.
10228 E1,E2,E3,E4 Edges for the face bound.
10229 theName Object name; when specified, this parameter is used
10230 for result publication in the study. Otherwise, if automatic
10231 publication is switched on, default value is used for result name.
10234 New GEOM.GEOM_Object, containing the created face.
10237 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10239 # Example: see GEOM_Spanner.py
10240 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10241 RaiseIfFailed("MakeQuad", self.BlocksOp)
10242 self._autoPublish(anObj, theName, "quad")
10245 ## Create a quadrangle face on two edges.
10246 # The missing edges will be built by creating the shortest ones.
10247 # @param E1,E2 Two opposite edges for the face.
10248 # @param theName Object name; when specified, this parameter is used
10249 # for result publication in the study. Otherwise, if automatic
10250 # publication is switched on, default value is used for result name.
10252 # @return New GEOM.GEOM_Object, containing the created face.
10254 # @ref tui_building_by_blocks_page "Example"
10255 def MakeQuad2Edges(self, E1, E2, theName=None):
10257 Create a quadrangle face on two edges.
10258 The missing edges will be built by creating the shortest ones.
10261 E1,E2 Two opposite edges for the face.
10262 theName Object name; when specified, this parameter is used
10263 for result publication in the study. Otherwise, if automatic
10264 publication is switched on, default value is used for result name.
10267 New GEOM.GEOM_Object, containing the created face.
10271 p1 = geompy.MakeVertex( 0., 0., 0.)
10272 p2 = geompy.MakeVertex(150., 30., 0.)
10273 p3 = geompy.MakeVertex( 0., 120., 50.)
10274 p4 = geompy.MakeVertex( 0., 40., 70.)
10276 edge1 = geompy.MakeEdge(p1, p2)
10277 edge2 = geompy.MakeEdge(p3, p4)
10278 # create a quadrangle face from two edges
10279 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10281 # Example: see GEOM_Spanner.py
10282 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10283 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10284 self._autoPublish(anObj, theName, "quad")
10287 ## Create a quadrangle face with specified corners.
10288 # The missing edges will be built by creating the shortest ones.
10289 # @param V1,V2,V3,V4 Corner vertices for the face.
10290 # @param theName Object name; when specified, this parameter is used
10291 # for result publication in the study. Otherwise, if automatic
10292 # publication is switched on, default value is used for result name.
10294 # @return New GEOM.GEOM_Object, containing the created face.
10296 # @ref tui_building_by_blocks_page "Example 1"
10297 # \n @ref swig_MakeQuad4Vertices "Example 2"
10298 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10300 Create a quadrangle face with specified corners.
10301 The missing edges will be built by creating the shortest ones.
10304 V1,V2,V3,V4 Corner vertices for the face.
10305 theName Object name; when specified, this parameter is used
10306 for result publication in the study. Otherwise, if automatic
10307 publication is switched on, default value is used for result name.
10310 New GEOM.GEOM_Object, containing the created face.
10314 p1 = geompy.MakeVertex( 0., 0., 0.)
10315 p2 = geompy.MakeVertex(150., 30., 0.)
10316 p3 = geompy.MakeVertex( 0., 120., 50.)
10317 p4 = geompy.MakeVertex( 0., 40., 70.)
10318 # create a quadrangle from four points in its corners
10319 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10321 # Example: see GEOM_Spanner.py
10322 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10323 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10324 self._autoPublish(anObj, theName, "quad")
10327 ## Create a hexahedral solid, bounded by the six given faces. Order of
10328 # faces is not important. It is not necessary that Faces share the same edge.
10329 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10330 # @param theName Object name; when specified, this parameter is used
10331 # for result publication in the study. Otherwise, if automatic
10332 # publication is switched on, default value is used for result name.
10334 # @return New GEOM.GEOM_Object, containing the created solid.
10336 # @ref tui_building_by_blocks_page "Example 1"
10337 # \n @ref swig_MakeHexa "Example 2"
10338 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10340 Create a hexahedral solid, bounded by the six given faces. Order of
10341 faces is not important. It is not necessary that Faces share the same edge.
10344 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10345 theName Object name; when specified, this parameter is used
10346 for result publication in the study. Otherwise, if automatic
10347 publication is switched on, default value is used for result name.
10350 New GEOM.GEOM_Object, containing the created solid.
10353 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10355 # Example: see GEOM_Spanner.py
10356 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10357 RaiseIfFailed("MakeHexa", self.BlocksOp)
10358 self._autoPublish(anObj, theName, "hexa")
10361 ## Create a hexahedral solid between two given faces.
10362 # The missing faces will be built by creating the smallest ones.
10363 # @param F1,F2 Two opposite faces for the hexahedral solid.
10364 # @param theName Object name; when specified, this parameter is used
10365 # for result publication in the study. Otherwise, if automatic
10366 # publication is switched on, default value is used for result name.
10368 # @return New GEOM.GEOM_Object, containing the created solid.
10370 # @ref tui_building_by_blocks_page "Example 1"
10371 # \n @ref swig_MakeHexa2Faces "Example 2"
10372 def MakeHexa2Faces(self, F1, F2, theName=None):
10374 Create a hexahedral solid between two given faces.
10375 The missing faces will be built by creating the smallest ones.
10378 F1,F2 Two opposite faces for the hexahedral solid.
10379 theName Object name; when specified, this parameter is used
10380 for result publication in the study. Otherwise, if automatic
10381 publication is switched on, default value is used for result name.
10384 New GEOM.GEOM_Object, containing the created solid.
10387 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10389 # Example: see GEOM_Spanner.py
10390 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10391 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10392 self._autoPublish(anObj, theName, "hexa")
10398 ## @addtogroup l3_blocks_op
10401 ## Get a vertex, found in the given shape by its coordinates.
10402 # @param theShape Block or a compound of blocks.
10403 # @param theX,theY,theZ Coordinates of the sought vertex.
10404 # @param theEpsilon Maximum allowed distance between the resulting
10405 # vertex and point with the given coordinates.
10406 # @param theName Object name; when specified, this parameter is used
10407 # for result publication in the study. Otherwise, if automatic
10408 # publication is switched on, default value is used for result name.
10410 # @return New GEOM.GEOM_Object, containing the found vertex.
10412 # @ref swig_GetPoint "Example"
10413 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10415 Get a vertex, found in the given shape by its coordinates.
10418 theShape Block or a compound of blocks.
10419 theX,theY,theZ Coordinates of the sought vertex.
10420 theEpsilon Maximum allowed distance between the resulting
10421 vertex and point with the given coordinates.
10422 theName Object name; when specified, this parameter is used
10423 for result publication in the study. Otherwise, if automatic
10424 publication is switched on, default value is used for result name.
10427 New GEOM.GEOM_Object, containing the found vertex.
10430 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10432 # Example: see GEOM_TestOthers.py
10433 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10434 RaiseIfFailed("GetPoint", self.BlocksOp)
10435 self._autoPublish(anObj, theName, "vertex")
10438 ## Find a vertex of the given shape, which has minimal distance to the given point.
10439 # @param theShape Any shape.
10440 # @param thePoint Point, close to the desired vertex.
10441 # @param theName Object name; when specified, this parameter is used
10442 # for result publication in the study. Otherwise, if automatic
10443 # publication is switched on, default value is used for result name.
10445 # @return New GEOM.GEOM_Object, containing the found vertex.
10447 # @ref swig_GetVertexNearPoint "Example"
10448 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10450 Find a vertex of the given shape, which has minimal distance to the given point.
10453 theShape Any shape.
10454 thePoint Point, close to the desired vertex.
10455 theName Object name; when specified, this parameter is used
10456 for result publication in the study. Otherwise, if automatic
10457 publication is switched on, default value is used for result name.
10460 New GEOM.GEOM_Object, containing the found vertex.
10463 pmidle = geompy.MakeVertex(50, 0, 50)
10464 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10466 # Example: see GEOM_TestOthers.py
10467 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10468 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10469 self._autoPublish(anObj, theName, "vertex")
10472 ## Get an edge, found in the given shape by two given vertices.
10473 # @param theShape Block or a compound of blocks.
10474 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10475 # @param theName Object name; when specified, this parameter is used
10476 # for result publication in the study. Otherwise, if automatic
10477 # publication is switched on, default value is used for result name.
10479 # @return New GEOM.GEOM_Object, containing the found edge.
10481 # @ref swig_GetEdge "Example"
10482 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10484 Get an edge, found in the given shape by two given vertices.
10487 theShape Block or a compound of blocks.
10488 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10489 theName Object name; when specified, this parameter is used
10490 for result publication in the study. Otherwise, if automatic
10491 publication is switched on, default value is used for result name.
10494 New GEOM.GEOM_Object, containing the found edge.
10496 # Example: see GEOM_Spanner.py
10497 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10498 RaiseIfFailed("GetEdge", self.BlocksOp)
10499 self._autoPublish(anObj, theName, "edge")
10502 ## Find an edge of the given shape, which has minimal distance to the given point.
10503 # @param theShape Block or a compound of blocks.
10504 # @param thePoint Point, close to the desired edge.
10505 # @param theName Object name; when specified, this parameter is used
10506 # for result publication in the study. Otherwise, if automatic
10507 # publication is switched on, default value is used for result name.
10509 # @return New GEOM.GEOM_Object, containing the found edge.
10511 # @ref swig_GetEdgeNearPoint "Example"
10512 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10514 Find an edge of the given shape, which has minimal distance to the given point.
10517 theShape Block or a compound of blocks.
10518 thePoint Point, close to the desired edge.
10519 theName Object name; when specified, this parameter is used
10520 for result publication in the study. Otherwise, if automatic
10521 publication is switched on, default value is used for result name.
10524 New GEOM.GEOM_Object, containing the found edge.
10526 # Example: see GEOM_TestOthers.py
10527 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10528 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10529 self._autoPublish(anObj, theName, "edge")
10532 ## Returns a face, found in the given shape by four given corner vertices.
10533 # @param theShape Block or a compound of blocks.
10534 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10535 # @param theName Object name; when specified, this parameter is used
10536 # for result publication in the study. Otherwise, if automatic
10537 # publication is switched on, default value is used for result name.
10539 # @return New GEOM.GEOM_Object, containing the found face.
10541 # @ref swig_todo "Example"
10542 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10544 Returns a face, found in the given shape by four given corner vertices.
10547 theShape Block or a compound of blocks.
10548 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10549 theName Object name; when specified, this parameter is used
10550 for result publication in the study. Otherwise, if automatic
10551 publication is switched on, default value is used for result name.
10554 New GEOM.GEOM_Object, containing the found face.
10556 # Example: see GEOM_Spanner.py
10557 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10558 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10559 self._autoPublish(anObj, theName, "face")
10562 ## Get a face of block, found in the given shape by two given edges.
10563 # @param theShape Block or a compound of blocks.
10564 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10565 # @param theName Object name; when specified, this parameter is used
10566 # for result publication in the study. Otherwise, if automatic
10567 # publication is switched on, default value is used for result name.
10569 # @return New GEOM.GEOM_Object, containing the found face.
10571 # @ref swig_todo "Example"
10572 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10574 Get a face of block, found in the given shape by two given edges.
10577 theShape Block or a compound of blocks.
10578 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10579 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.
10584 New GEOM.GEOM_Object, containing the found face.
10586 # Example: see GEOM_Spanner.py
10587 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10588 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10589 self._autoPublish(anObj, theName, "face")
10592 ## Find a face, opposite to the given one in the given block.
10593 # @param theBlock Must be a hexahedral solid.
10594 # @param theFace Face of \a theBlock, opposite to the desired face.
10595 # @param theName Object name; when specified, this parameter is used
10596 # for result publication in the study. Otherwise, if automatic
10597 # publication is switched on, default value is used for result name.
10599 # @return New GEOM.GEOM_Object, containing the found face.
10601 # @ref swig_GetOppositeFace "Example"
10602 def GetOppositeFace(self, theBlock, theFace, theName=None):
10604 Find a face, opposite to the given one in the given block.
10607 theBlock Must be a hexahedral solid.
10608 theFace Face of theBlock, opposite to the desired face.
10609 theName Object name; when specified, this parameter is used
10610 for result publication in the study. Otherwise, if automatic
10611 publication is switched on, default value is used for result name.
10614 New GEOM.GEOM_Object, containing the found face.
10616 # Example: see GEOM_Spanner.py
10617 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10618 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10619 self._autoPublish(anObj, theName, "face")
10622 ## Find a face of the given shape, which has minimal distance to the given point.
10623 # @param theShape Block or a compound of blocks.
10624 # @param thePoint Point, close to the desired face.
10625 # @param theName Object name; when specified, this parameter is used
10626 # for result publication in the study. Otherwise, if automatic
10627 # publication is switched on, default value is used for result name.
10629 # @return New GEOM.GEOM_Object, containing the found face.
10631 # @ref swig_GetFaceNearPoint "Example"
10632 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10634 Find a face of the given shape, which has minimal distance to the given point.
10637 theShape Block or a compound of blocks.
10638 thePoint Point, close to the desired face.
10639 theName Object name; when specified, this parameter is used
10640 for result publication in the study. Otherwise, if automatic
10641 publication is switched on, default value is used for result name.
10644 New GEOM.GEOM_Object, containing the found face.
10646 # Example: see GEOM_Spanner.py
10647 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10648 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10649 self._autoPublish(anObj, theName, "face")
10652 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10653 # @param theBlock Block or a compound of blocks.
10654 # @param theVector Vector, close to the normale of the desired face.
10655 # @param theName Object name; when specified, this parameter is used
10656 # for result publication in the study. Otherwise, if automatic
10657 # publication is switched on, default value is used for result name.
10659 # @return New GEOM.GEOM_Object, containing the found face.
10661 # @ref swig_todo "Example"
10662 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10664 Find a face of block, whose outside normale has minimal angle with the given vector.
10667 theBlock Block or a compound of blocks.
10668 theVector Vector, close to the normale of the desired face.
10669 theName Object name; when specified, this parameter is used
10670 for result publication in the study. Otherwise, if automatic
10671 publication is switched on, default value is used for result name.
10674 New GEOM.GEOM_Object, containing the found face.
10676 # Example: see GEOM_Spanner.py
10677 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10678 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10679 self._autoPublish(anObj, theName, "face")
10682 ## Find all sub-shapes of type \a theShapeType of the given shape,
10683 # which have minimal distance to the given point.
10684 # @param theShape Any shape.
10685 # @param thePoint Point, close to the desired shape.
10686 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10687 # @param theTolerance The tolerance for distances comparison. All shapes
10688 # with distances to the given point in interval
10689 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10690 # @param theName Object name; when specified, this parameter is used
10691 # for result publication in the study. Otherwise, if automatic
10692 # publication is switched on, default value is used for result name.
10694 # @return New GEOM_Object, containing a group of all found shapes.
10696 # @ref swig_GetShapesNearPoint "Example"
10697 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10699 Find all sub-shapes of type theShapeType of the given shape,
10700 which have minimal distance to the given point.
10703 theShape Any shape.
10704 thePoint Point, close to the desired shape.
10705 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10706 theTolerance The tolerance for distances comparison. All shapes
10707 with distances to the given point in interval
10708 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10709 theName Object name; when specified, this parameter is used
10710 for result publication in the study. Otherwise, if automatic
10711 publication is switched on, default value is used for result name.
10714 New GEOM_Object, containing a group of all found shapes.
10716 # Example: see GEOM_TestOthers.py
10717 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10718 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10719 self._autoPublish(anObj, theName, "group")
10722 # end of l3_blocks_op
10725 ## @addtogroup l4_blocks_measure
10728 ## Check, if the compound of blocks is given.
10729 # To be considered as a compound of blocks, the
10730 # given shape must satisfy the following conditions:
10731 # - Each element of the compound should be a Block (6 faces and 12 edges).
10732 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10733 # - The compound should be connexe.
10734 # - The glue between two quadrangle faces should be applied.
10735 # @param theCompound The compound to check.
10736 # @return TRUE, if the given shape is a compound of blocks.
10737 # If theCompound is not valid, prints all discovered errors.
10739 # @ref tui_measurement_tools_page "Example 1"
10740 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10741 def CheckCompoundOfBlocks(self,theCompound):
10743 Check, if the compound of blocks is given.
10744 To be considered as a compound of blocks, the
10745 given shape must satisfy the following conditions:
10746 - Each element of the compound should be a Block (6 faces and 12 edges).
10747 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10748 - The compound should be connexe.
10749 - The glue between two quadrangle faces should be applied.
10752 theCompound The compound to check.
10755 TRUE, if the given shape is a compound of blocks.
10756 If theCompound is not valid, prints all discovered errors.
10758 # Example: see GEOM_Spanner.py
10759 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10760 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10762 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10766 ## Retrieve all non blocks solids and faces from \a theShape.
10767 # @param theShape The shape to explore.
10768 # @param theName Object name; when specified, this parameter is used
10769 # for result publication in the study. Otherwise, if automatic
10770 # publication is switched on, default value is used for result name.
10772 # @return A tuple of two GEOM_Objects. The first object is a group of all
10773 # non block solids (= not 6 faces, or with 6 faces, but with the
10774 # presence of non-quadrangular faces). The second object is a
10775 # group of all non quadrangular faces.
10777 # @ref tui_measurement_tools_page "Example 1"
10778 # \n @ref swig_GetNonBlocks "Example 2"
10779 def GetNonBlocks (self, theShape, theName=None):
10781 Retrieve all non blocks solids and faces from theShape.
10784 theShape The shape to explore.
10785 theName Object name; when specified, this parameter is used
10786 for result publication in the study. Otherwise, if automatic
10787 publication is switched on, default value is used for result name.
10790 A tuple of two GEOM_Objects. The first object is a group of all
10791 non block solids (= not 6 faces, or with 6 faces, but with the
10792 presence of non-quadrangular faces). The second object is a
10793 group of all non quadrangular faces.
10796 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10798 # Example: see GEOM_Spanner.py
10799 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10800 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10801 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10804 ## Remove all seam and degenerated edges from \a theShape.
10805 # Unite faces and edges, sharing one surface. It means that
10806 # this faces must have references to one C++ surface object (handle).
10807 # @param theShape The compound or single solid to remove irregular edges from.
10808 # @param doUnionFaces If True, then unite faces. If False (the default value),
10809 # do not unite faces.
10810 # @param theName Object name; when specified, this parameter is used
10811 # for result publication in the study. Otherwise, if automatic
10812 # publication is switched on, default value is used for result name.
10814 # @return Improved shape.
10816 # @ref swig_RemoveExtraEdges "Example"
10817 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10819 Remove all seam and degenerated edges from theShape.
10820 Unite faces and edges, sharing one surface. It means that
10821 this faces must have references to one C++ surface object (handle).
10824 theShape The compound or single solid to remove irregular edges from.
10825 doUnionFaces If True, then unite faces. If False (the default value),
10826 do not unite faces.
10827 theName Object name; when specified, this parameter is used
10828 for result publication in the study. Otherwise, if automatic
10829 publication is switched on, default value is used for result name.
10834 # Example: see GEOM_TestOthers.py
10835 nbFacesOptimum = -1 # -1 means do not unite faces
10836 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10837 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10838 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10839 self._autoPublish(anObj, theName, "removeExtraEdges")
10842 ## Performs union faces of \a theShape
10843 # Unite faces sharing one surface. It means that
10844 # these faces must have references to one C++ surface object (handle).
10845 # @param theShape The compound or single solid that contains faces
10846 # to perform union.
10847 # @param 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.
10851 # @return Improved shape.
10853 # @ref swig_UnionFaces "Example"
10854 def UnionFaces(self, theShape, theName=None):
10856 Performs union faces of theShape.
10857 Unite faces sharing one surface. It means that
10858 these faces must have references to one C++ surface object (handle).
10861 theShape The compound or single solid that contains faces
10863 theName Object name; when specified, this parameter is used
10864 for result publication in the study. Otherwise, if automatic
10865 publication is switched on, default value is used for result name.
10870 # Example: see GEOM_TestOthers.py
10871 anObj = self.BlocksOp.UnionFaces(theShape)
10872 RaiseIfFailed("UnionFaces", self.BlocksOp)
10873 self._autoPublish(anObj, theName, "unionFaces")
10876 ## Check, if the given shape is a blocks compound.
10877 # Fix all detected errors.
10878 # \note Single block can be also fixed by this method.
10879 # @param theShape The compound to check and improve.
10880 # @param theName Object name; when specified, this parameter is used
10881 # for result publication in the study. Otherwise, if automatic
10882 # publication is switched on, default value is used for result name.
10884 # @return Improved compound.
10886 # @ref swig_CheckAndImprove "Example"
10887 def CheckAndImprove(self, theShape, theName=None):
10889 Check, if the given shape is a blocks compound.
10890 Fix all detected errors.
10893 Single block can be also fixed by this method.
10896 theShape The compound to check and improve.
10897 theName Object name; when specified, this parameter is used
10898 for result publication in the study. Otherwise, if automatic
10899 publication is switched on, default value is used for result name.
10904 # Example: see GEOM_TestOthers.py
10905 anObj = self.BlocksOp.CheckAndImprove(theShape)
10906 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10907 self._autoPublish(anObj, theName, "improved")
10910 # end of l4_blocks_measure
10913 ## @addtogroup l3_blocks_op
10916 ## Get all the blocks, contained in the given compound.
10917 # @param theCompound The compound to explode.
10918 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10919 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10920 # @param theName Object name; when specified, this parameter is used
10921 # for result publication in the study. Otherwise, if automatic
10922 # publication is switched on, default value is used for result name.
10924 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10926 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10928 # @ref tui_explode_on_blocks "Example 1"
10929 # \n @ref swig_MakeBlockExplode "Example 2"
10930 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10932 Get all the blocks, contained in the given compound.
10935 theCompound The compound to explode.
10936 theMinNbFaces If solid has lower number of faces, it is not a block.
10937 theMaxNbFaces If solid has higher number of faces, it is not a block.
10938 theName Object name; when specified, this parameter is used
10939 for result publication in the study. Otherwise, if automatic
10940 publication is switched on, default value is used for result name.
10943 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10946 List of GEOM.GEOM_Object, containing the retrieved blocks.
10948 # Example: see GEOM_TestOthers.py
10949 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10950 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10951 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10952 for anObj in aList:
10953 anObj.SetParameters(Parameters)
10955 self._autoPublish(aList, theName, "block")
10958 ## Find block, containing the given point inside its volume or on boundary.
10959 # @param theCompound Compound, to find block in.
10960 # @param thePoint Point, close to the desired block. If the point lays on
10961 # boundary between some blocks, we return block with nearest center.
10962 # @param theName Object name; when specified, this parameter is used
10963 # for result publication in the study. Otherwise, if automatic
10964 # publication is switched on, default value is used for result name.
10966 # @return New GEOM.GEOM_Object, containing the found block.
10968 # @ref swig_todo "Example"
10969 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10971 Find block, containing the given point inside its volume or on boundary.
10974 theCompound Compound, to find block in.
10975 thePoint Point, close to the desired block. If the point lays on
10976 boundary between some blocks, we return block with nearest center.
10977 theName Object name; when specified, this parameter is used
10978 for result publication in the study. Otherwise, if automatic
10979 publication is switched on, default value is used for result name.
10982 New GEOM.GEOM_Object, containing the found block.
10984 # Example: see GEOM_Spanner.py
10985 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10986 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10987 self._autoPublish(anObj, theName, "block")
10990 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10991 # @param theCompound Compound, to find block in.
10992 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10993 # @param theName Object name; when specified, this parameter is used
10994 # for result publication in the study. Otherwise, if automatic
10995 # publication is switched on, default value is used for result name.
10997 # @return New GEOM.GEOM_Object, containing the found block.
10999 # @ref swig_GetBlockByParts "Example"
11000 def GetBlockByParts(self, theCompound, theParts, theName=None):
11002 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11005 theCompound Compound, to find block in.
11006 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11007 theName Object name; when specified, this parameter is used
11008 for result publication in the study. Otherwise, if automatic
11009 publication is switched on, default value is used for result name.
11012 New GEOM_Object, containing the found block.
11014 # Example: see GEOM_TestOthers.py
11015 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11016 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11017 self._autoPublish(anObj, theName, "block")
11020 ## Return all blocks, containing all the elements, passed as the parts.
11021 # @param theCompound Compound, to find blocks in.
11022 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11023 # @param theName Object name; when specified, this parameter is used
11024 # for result publication in the study. Otherwise, if automatic
11025 # publication is switched on, default value is used for result name.
11027 # @return List of GEOM.GEOM_Object, containing the found blocks.
11029 # @ref swig_todo "Example"
11030 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11032 Return all blocks, containing all the elements, passed as the parts.
11035 theCompound Compound, to find blocks in.
11036 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11037 theName Object name; when specified, this parameter is used
11038 for result publication in the study. Otherwise, if automatic
11039 publication is switched on, default value is used for result name.
11042 List of GEOM.GEOM_Object, containing the found blocks.
11044 # Example: see GEOM_Spanner.py
11045 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11046 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11047 self._autoPublish(aList, theName, "block")
11050 ## Multi-transformate block and glue the result.
11051 # Transformation is defined so, as to superpose direction faces.
11052 # @param Block Hexahedral solid to be multi-transformed.
11053 # @param DirFace1 ID of First direction face.
11054 # @param DirFace2 ID of Second direction face.
11055 # @param NbTimes Quantity of transformations to be done.
11056 # @param theName Object name; when specified, this parameter is used
11057 # for result publication in the study. Otherwise, if automatic
11058 # publication is switched on, default value is used for result name.
11060 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11062 # @return New GEOM.GEOM_Object, containing the result shape.
11064 # @ref tui_multi_transformation "Example"
11065 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11067 Multi-transformate block and glue the result.
11068 Transformation is defined so, as to superpose direction faces.
11071 Block Hexahedral solid to be multi-transformed.
11072 DirFace1 ID of First direction face.
11073 DirFace2 ID of Second direction face.
11074 NbTimes Quantity of transformations to be done.
11075 theName Object name; when specified, this parameter is used
11076 for result publication in the study. Otherwise, if automatic
11077 publication is switched on, default value is used for result name.
11080 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11083 New GEOM.GEOM_Object, containing the result shape.
11085 # Example: see GEOM_Spanner.py
11086 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11087 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11088 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11089 anObj.SetParameters(Parameters)
11090 self._autoPublish(anObj, theName, "transformed")
11093 ## Multi-transformate block and glue the result.
11094 # @param Block Hexahedral solid to be multi-transformed.
11095 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11096 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11097 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11098 # @param theName Object name; when specified, this parameter is used
11099 # for result publication in the study. Otherwise, if automatic
11100 # publication is switched on, default value is used for result name.
11102 # @return New GEOM.GEOM_Object, containing the result shape.
11104 # @ref tui_multi_transformation "Example"
11105 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11106 DirFace1V, DirFace2V, NbTimesV, theName=None):
11108 Multi-transformate block and glue the result.
11111 Block Hexahedral solid to be multi-transformed.
11112 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11113 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11114 NbTimesU,NbTimesV Quantity of transformations to be done.
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 result shape.
11122 # Example: see GEOM_Spanner.py
11123 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11124 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11125 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11126 DirFace1V, DirFace2V, NbTimesV)
11127 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11128 anObj.SetParameters(Parameters)
11129 self._autoPublish(anObj, theName, "transformed")
11132 ## Build all possible propagation groups.
11133 # Propagation group is a set of all edges, opposite to one (main)
11134 # edge of this group directly or through other opposite edges.
11135 # Notion of Opposite Edge make sence only on quadrangle face.
11136 # @param theShape Shape to build propagation groups on.
11137 # @param theName Object name; when specified, this parameter is used
11138 # for result publication in the study. Otherwise, if automatic
11139 # publication is switched on, default value is used for result name.
11141 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11143 # @ref swig_Propagate "Example"
11144 def Propagate(self, theShape, theName=None):
11146 Build all possible propagation groups.
11147 Propagation group is a set of all edges, opposite to one (main)
11148 edge of this group directly or through other opposite edges.
11149 Notion of Opposite Edge make sence only on quadrangle face.
11152 theShape Shape to build propagation groups on.
11153 theName Object name; when specified, this parameter is used
11154 for result publication in the study. Otherwise, if automatic
11155 publication is switched on, default value is used for result name.
11158 List of GEOM.GEOM_Object, each of them is a propagation group.
11160 # Example: see GEOM_TestOthers.py
11161 listChains = self.BlocksOp.Propagate(theShape)
11162 RaiseIfFailed("Propagate", self.BlocksOp)
11163 self._autoPublish(listChains, theName, "propagate")
11166 # end of l3_blocks_op
11169 ## @addtogroup l3_groups
11172 ## Creates a new group which will store sub-shapes of theMainShape
11173 # @param theMainShape is a GEOM object on which the group is selected
11174 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11175 # @param 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.
11179 # @return a newly created GEOM group (GEOM.GEOM_Object)
11181 # @ref tui_working_with_groups_page "Example 1"
11182 # \n @ref swig_CreateGroup "Example 2"
11183 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11185 Creates a new group which will store sub-shapes of theMainShape
11188 theMainShape is a GEOM object on which the group is selected
11189 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11190 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11191 theName Object name; when specified, this parameter is used
11192 for result publication in the study. Otherwise, if automatic
11193 publication is switched on, default value is used for result name.
11196 a newly created GEOM group
11199 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11202 # Example: see GEOM_TestOthers.py
11203 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11204 RaiseIfFailed("CreateGroup", self.GroupOp)
11205 self._autoPublish(anObj, theName, "group")
11208 ## Adds a sub-object with ID theSubShapeId to the group
11209 # @param theGroup is a GEOM group to which the new sub-shape is added
11210 # @param theSubShapeID is a sub-shape ID in the main object.
11211 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11213 # @ref tui_working_with_groups_page "Example"
11214 def AddObject(self,theGroup, theSubShapeID):
11216 Adds a sub-object with ID theSubShapeId to the group
11219 theGroup is a GEOM group to which the new sub-shape is added
11220 theSubShapeID is a sub-shape ID in the main object.
11223 Use method GetSubShapeID() to get an unique ID of the sub-shape
11225 # Example: see GEOM_TestOthers.py
11226 self.GroupOp.AddObject(theGroup, theSubShapeID)
11227 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11228 RaiseIfFailed("AddObject", self.GroupOp)
11232 ## Removes a sub-object with ID \a theSubShapeId from the group
11233 # @param theGroup is a GEOM group from which the new sub-shape is removed
11234 # @param theSubShapeID is a sub-shape ID in the main object.
11235 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11237 # @ref tui_working_with_groups_page "Example"
11238 def RemoveObject(self,theGroup, theSubShapeID):
11240 Removes a sub-object with ID theSubShapeId from the group
11243 theGroup is a GEOM group from which the new sub-shape is removed
11244 theSubShapeID is a sub-shape ID in the main object.
11247 Use method GetSubShapeID() to get an unique ID of the sub-shape
11249 # Example: see GEOM_TestOthers.py
11250 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11251 RaiseIfFailed("RemoveObject", self.GroupOp)
11254 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11255 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11256 # @param theSubShapes is a list of sub-shapes to be added.
11258 # @ref tui_working_with_groups_page "Example"
11259 def UnionList (self,theGroup, theSubShapes):
11261 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11264 theGroup is a GEOM group to which the new sub-shapes are added.
11265 theSubShapes is a list of sub-shapes to be added.
11267 # Example: see GEOM_TestOthers.py
11268 self.GroupOp.UnionList(theGroup, theSubShapes)
11269 RaiseIfFailed("UnionList", self.GroupOp)
11272 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11273 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11274 # @param theSubShapes is a list of indices of sub-shapes to be added.
11276 # @ref swig_UnionIDs "Example"
11277 def UnionIDs(self,theGroup, theSubShapes):
11279 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11282 theGroup is a GEOM group to which the new sub-shapes are added.
11283 theSubShapes is a list of indices of sub-shapes to be added.
11285 # Example: see GEOM_TestOthers.py
11286 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11287 RaiseIfFailed("UnionIDs", self.GroupOp)
11290 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11291 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11292 # @param theSubShapes is a list of sub-shapes to be removed.
11294 # @ref tui_working_with_groups_page "Example"
11295 def DifferenceList (self,theGroup, theSubShapes):
11297 Removes from the group all the given shapes. No errors, if some shapes are not included.
11300 theGroup is a GEOM group from which the sub-shapes are removed.
11301 theSubShapes is a list of sub-shapes to be removed.
11303 # Example: see GEOM_TestOthers.py
11304 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11305 RaiseIfFailed("DifferenceList", self.GroupOp)
11308 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11309 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11310 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11312 # @ref swig_DifferenceIDs "Example"
11313 def DifferenceIDs(self,theGroup, theSubShapes):
11315 Removes from the group all the given shapes. No errors, if some shapes are not included.
11318 theGroup is a GEOM group from which the sub-shapes are removed.
11319 theSubShapes is a list of indices of sub-shapes to be removed.
11321 # Example: see GEOM_TestOthers.py
11322 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11323 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11326 ## Union of two groups.
11327 # New group is created. It will contain all entities
11328 # which are present in groups theGroup1 and theGroup2.
11329 # @param theGroup1, theGroup2 are the initial GEOM groups
11330 # to create the united group from.
11331 # @param theName Object name; when specified, this parameter is used
11332 # for result publication in the study. Otherwise, if automatic
11333 # publication is switched on, default value is used for result name.
11335 # @return a newly created GEOM group.
11337 # @ref tui_union_groups_anchor "Example"
11338 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11340 Union of two groups.
11341 New group is created. It will contain all entities
11342 which are present in groups theGroup1 and theGroup2.
11345 theGroup1, theGroup2 are the initial GEOM groups
11346 to create the united group from.
11347 theName Object name; when specified, this parameter is used
11348 for result publication in the study. Otherwise, if automatic
11349 publication is switched on, default value is used for result name.
11352 a newly created GEOM group.
11354 # Example: see GEOM_TestOthers.py
11355 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11356 RaiseIfFailed("UnionGroups", self.GroupOp)
11357 self._autoPublish(aGroup, theName, "group")
11360 ## Intersection of two groups.
11361 # New group is created. It will contain only those entities
11362 # which are present in both groups theGroup1 and theGroup2.
11363 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11364 # @param theName Object name; when specified, this parameter is used
11365 # for result publication in the study. Otherwise, if automatic
11366 # publication is switched on, default value is used for result name.
11368 # @return a newly created GEOM group.
11370 # @ref tui_intersect_groups_anchor "Example"
11371 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11373 Intersection of two groups.
11374 New group is created. It will contain only those entities
11375 which are present in both groups theGroup1 and theGroup2.
11378 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11379 theName Object name; when specified, this parameter is used
11380 for result publication in the study. Otherwise, if automatic
11381 publication is switched on, default value is used for result name.
11384 a newly created GEOM group.
11386 # Example: see GEOM_TestOthers.py
11387 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11388 RaiseIfFailed("IntersectGroups", self.GroupOp)
11389 self._autoPublish(aGroup, theName, "group")
11392 ## Cut of two groups.
11393 # New group is created. It will contain entities which are
11394 # present in group theGroup1 but are not present in group theGroup2.
11395 # @param theGroup1 is a GEOM group to include elements of.
11396 # @param theGroup2 is a GEOM group to exclude elements of.
11397 # @param theName Object name; when specified, this parameter is used
11398 # for result publication in the study. Otherwise, if automatic
11399 # publication is switched on, default value is used for result name.
11401 # @return a newly created GEOM group.
11403 # @ref tui_cut_groups_anchor "Example"
11404 def CutGroups (self, theGroup1, theGroup2, theName=None):
11407 New group is created. It will contain entities which are
11408 present in group theGroup1 but are not present in group theGroup2.
11411 theGroup1 is a GEOM group to include elements of.
11412 theGroup2 is a GEOM group to exclude elements of.
11413 theName Object name; when specified, this parameter is used
11414 for result publication in the study. Otherwise, if automatic
11415 publication is switched on, default value is used for result name.
11418 a newly created GEOM group.
11420 # Example: see GEOM_TestOthers.py
11421 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11422 RaiseIfFailed("CutGroups", self.GroupOp)
11423 self._autoPublish(aGroup, theName, "group")
11426 ## Union of list of groups.
11427 # New group is created. It will contain all entities that are
11428 # present in groups listed in theGList.
11429 # @param theGList is a list of GEOM groups to create the united group from.
11430 # @param theName Object name; when specified, this parameter is used
11431 # for result publication in the study. Otherwise, if automatic
11432 # publication is switched on, default value is used for result name.
11434 # @return a newly created GEOM group.
11436 # @ref tui_union_groups_anchor "Example"
11437 def UnionListOfGroups (self, theGList, theName=None):
11439 Union of list of groups.
11440 New group is created. It will contain all entities that are
11441 present in groups listed in theGList.
11444 theGList is a list of GEOM groups to create the united group from.
11445 theName Object name; when specified, this parameter is used
11446 for result publication in the study. Otherwise, if automatic
11447 publication is switched on, default value is used for result name.
11450 a newly created GEOM group.
11452 # Example: see GEOM_TestOthers.py
11453 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11454 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11455 self._autoPublish(aGroup, theName, "group")
11458 ## Cut of lists of groups.
11459 # New group is created. It will contain only entities
11460 # which are present in groups listed in theGList.
11461 # @param theGList is a list of GEOM groups to include elements of.
11462 # @param theName Object name; when specified, this parameter is used
11463 # for result publication in the study. Otherwise, if automatic
11464 # publication is switched on, default value is used for result name.
11466 # @return a newly created GEOM group.
11468 # @ref tui_intersect_groups_anchor "Example"
11469 def IntersectListOfGroups (self, theGList, theName=None):
11471 Cut of lists of groups.
11472 New group is created. It will contain only entities
11473 which are present in groups listed in theGList.
11476 theGList is a list of GEOM groups to include elements of.
11477 theName Object name; when specified, this parameter is used
11478 for result publication in the study. Otherwise, if automatic
11479 publication is switched on, default value is used for result name.
11482 a newly created GEOM group.
11484 # Example: see GEOM_TestOthers.py
11485 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11486 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11487 self._autoPublish(aGroup, theName, "group")
11490 ## Cut of lists of groups.
11491 # New group is created. It will contain only entities
11492 # which are present in groups listed in theGList1 but
11493 # are not present in groups from theGList2.
11494 # @param theGList1 is a list of GEOM groups to include elements of.
11495 # @param theGList2 is a list of GEOM groups to exclude elements of.
11496 # @param theName Object name; when specified, this parameter is used
11497 # for result publication in the study. Otherwise, if automatic
11498 # publication is switched on, default value is used for result name.
11500 # @return a newly created GEOM group.
11502 # @ref tui_cut_groups_anchor "Example"
11503 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11505 Cut of lists of groups.
11506 New group is created. It will contain only entities
11507 which are present in groups listed in theGList1 but
11508 are not present in groups from theGList2.
11511 theGList1 is a list of GEOM groups to include elements of.
11512 theGList2 is a list of GEOM groups to exclude elements of.
11513 theName Object name; when specified, this parameter is used
11514 for result publication in the study. Otherwise, if automatic
11515 publication is switched on, default value is used for result name.
11518 a newly created GEOM group.
11520 # Example: see GEOM_TestOthers.py
11521 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11522 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11523 self._autoPublish(aGroup, theName, "group")
11526 ## Returns a list of sub-objects ID stored in the group
11527 # @param theGroup is a GEOM group for which a list of IDs is requested
11529 # @ref swig_GetObjectIDs "Example"
11530 def GetObjectIDs(self,theGroup):
11532 Returns a list of sub-objects ID stored in the group
11535 theGroup is a GEOM group for which a list of IDs is requested
11537 # Example: see GEOM_TestOthers.py
11538 ListIDs = self.GroupOp.GetObjects(theGroup)
11539 RaiseIfFailed("GetObjects", self.GroupOp)
11542 ## Returns a type of sub-objects stored in the group
11543 # @param theGroup is a GEOM group which type is returned.
11545 # @ref swig_GetType "Example"
11546 def GetType(self,theGroup):
11548 Returns a type of sub-objects stored in the group
11551 theGroup is a GEOM group which type is returned.
11553 # Example: see GEOM_TestOthers.py
11554 aType = self.GroupOp.GetType(theGroup)
11555 RaiseIfFailed("GetType", self.GroupOp)
11558 ## Convert a type of geom object from id to string value
11559 # @param theId is a GEOM obect type id.
11560 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11561 # @ref swig_GetType "Example"
11562 def ShapeIdToType(self, theId):
11564 Convert a type of geom object from id to string value
11567 theId is a GEOM obect type id.
11570 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11597 return "REVOLUTION"
11645 return "FREE_BOUNDS"
11653 return "THRUSECTIONS"
11655 return "COMPOUNDFILTER"
11657 return "SHAPES_ON_SHAPE"
11659 return "ELLIPSE_ARC"
11661 return "3DSKETCHER"
11667 return "PIPETSHAPE"
11668 return "Shape Id not exist."
11670 ## Returns a main shape associated with the group
11671 # @param theGroup is a GEOM group for which a main shape object is requested
11672 # @return a GEOM object which is a main shape for theGroup
11674 # @ref swig_GetMainShape "Example"
11675 def GetMainShape(self,theGroup):
11677 Returns a main shape associated with the group
11680 theGroup is a GEOM group for which a main shape object is requested
11683 a GEOM object which is a main shape for theGroup
11685 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11687 # Example: see GEOM_TestOthers.py
11688 anObj = self.GroupOp.GetMainShape(theGroup)
11689 RaiseIfFailed("GetMainShape", self.GroupOp)
11692 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11693 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11694 # @param theShape given shape (see GEOM.GEOM_Object)
11695 # @param min_length minimum length of edges of theShape
11696 # @param max_length maximum length of edges of theShape
11697 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11698 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11699 # @param theName Object name; when specified, this parameter is used
11700 # for result publication in the study. Otherwise, if automatic
11701 # publication is switched on, default value is used for result name.
11703 # @return a newly created GEOM group of edges
11705 # @@ref swig_todo "Example"
11706 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11708 Create group of edges of theShape, whose length is in range [min_length, max_length].
11709 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11712 theShape given shape
11713 min_length minimum length of edges of theShape
11714 max_length maximum length of edges of theShape
11715 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11716 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11717 theName Object name; when specified, this parameter is used
11718 for result publication in the study. Otherwise, if automatic
11719 publication is switched on, default value is used for result name.
11722 a newly created GEOM group of edges.
11724 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
11725 edges_in_range = []
11727 Props = self.BasicProperties(edge)
11728 if min_length <= Props[0] and Props[0] <= max_length:
11729 if (not include_min) and (min_length == Props[0]):
11732 if (not include_max) and (Props[0] == max_length):
11735 edges_in_range.append(edge)
11737 if len(edges_in_range) <= 0:
11738 print "No edges found by given criteria"
11741 # note: auto-publishing is done in self.CreateGroup()
11742 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
11743 self.UnionList(group_edges, edges_in_range)
11747 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11748 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11749 # @param min_length minimum length of edges of selected shape
11750 # @param max_length maximum length of edges of selected shape
11751 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11752 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11753 # @return a newly created GEOM group of edges
11754 # @ref swig_todo "Example"
11755 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11757 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11758 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11761 min_length minimum length of edges of selected shape
11762 max_length maximum length of edges of selected shape
11763 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11764 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11767 a newly created GEOM group of edges.
11769 nb_selected = sg.SelectedCount()
11770 if nb_selected < 1:
11771 print "Select a shape before calling this function, please."
11773 if nb_selected > 1:
11774 print "Only one shape must be selected"
11777 id_shape = sg.getSelected(0)
11778 shape = IDToObject( id_shape )
11780 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11784 if include_min: left_str = " <= "
11785 if include_max: right_str = " <= "
11787 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11788 + left_str + "length" + right_str + `max_length`)
11790 sg.updateObjBrowser(1)
11797 ## @addtogroup l4_advanced
11800 ## Create a T-shape object with specified caracteristics for the main
11801 # and the incident pipes (radius, width, half-length).
11802 # The extremities of the main pipe are located on junctions points P1 and P2.
11803 # The extremity of the incident pipe is located on junction point P3.
11804 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11805 # the main plane of the T-shape is XOY.
11807 # @param theR1 Internal radius of main pipe
11808 # @param theW1 Width of main pipe
11809 # @param theL1 Half-length of main pipe
11810 # @param theR2 Internal radius of incident pipe (R2 < R1)
11811 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11812 # @param theL2 Half-length of incident pipe
11814 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11815 # @param theP1 1st junction point of main pipe
11816 # @param theP2 2nd junction point of main pipe
11817 # @param theP3 Junction point of incident pipe
11819 # @param theRL Internal radius of left thickness reduction
11820 # @param theWL Width of left thickness reduction
11821 # @param theLtransL Length of left transition part
11822 # @param theLthinL Length of left thin part
11824 # @param theRR Internal radius of right thickness reduction
11825 # @param theWR Width of right thickness reduction
11826 # @param theLtransR Length of right transition part
11827 # @param theLthinR Length of right thin part
11829 # @param theRI Internal radius of incident thickness reduction
11830 # @param theWI Width of incident thickness reduction
11831 # @param theLtransI Length of incident transition part
11832 # @param theLthinI Length of incident thin part
11834 # @param theName Object name; when specified, this parameter is used
11835 # for result publication in the study. Otherwise, if automatic
11836 # publication is switched on, default value is used for result name.
11838 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11840 # @ref tui_creation_pipetshape "Example"
11841 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
11842 theHexMesh=True, theP1=None, theP2=None, theP3=None,
11843 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11844 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11845 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11848 Create a T-shape object with specified caracteristics for the main
11849 and the incident pipes (radius, width, half-length).
11850 The extremities of the main pipe are located on junctions points P1 and P2.
11851 The extremity of the incident pipe is located on junction point P3.
11852 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11853 the main plane of the T-shape is XOY.
11856 theR1 Internal radius of main pipe
11857 theW1 Width of main pipe
11858 theL1 Half-length of main pipe
11859 theR2 Internal radius of incident pipe (R2 < R1)
11860 theW2 Width of incident pipe (R2+W2 < R1+W1)
11861 theL2 Half-length of incident pipe
11862 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11863 theP1 1st junction point of main pipe
11864 theP2 2nd junction point of main pipe
11865 theP3 Junction point of incident pipe
11867 theRL Internal radius of left thickness reduction
11868 theWL Width of left thickness reduction
11869 theLtransL Length of left transition part
11870 theLthinL Length of left thin part
11872 theRR Internal radius of right thickness reduction
11873 theWR Width of right thickness reduction
11874 theLtransR Length of right transition part
11875 theLthinR Length of right thin part
11877 theRI Internal radius of incident thickness reduction
11878 theWI Width of incident thickness reduction
11879 theLtransI Length of incident transition part
11880 theLthinI Length of incident thin part
11882 theName Object name; when specified, this parameter is used
11883 for result publication in the study. Otherwise, if automatic
11884 publication is switched on, default value is used for result name.
11887 List of GEOM_Object, containing the created shape and propagation groups.
11890 # create PipeTShape object
11891 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11892 # create PipeTShape object with position
11893 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11894 # create PipeTShape object with left thickness reduction
11895 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
11897 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)
11898 if (theP1 and theP2 and theP3):
11899 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
11900 theRL, theWL, theLtransL, theLthinL,
11901 theRR, theWR, theLtransR, theLthinR,
11902 theRI, theWI, theLtransI, theLthinI,
11903 theHexMesh, theP1, theP2, theP3)
11905 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
11906 theRL, theWL, theLtransL, theLthinL,
11907 theRR, theWR, theLtransR, theLthinR,
11908 theRI, theWI, theLtransI, theLthinI,
11910 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11911 if Parameters: anObj[0].SetParameters(Parameters)
11912 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11913 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11916 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11917 # and the incident pipes (radius, width, half-length). The chamfer is
11918 # created on the junction of the pipes.
11919 # The extremities of the main pipe are located on junctions points P1 and P2.
11920 # The extremity of the incident pipe is located on junction point P3.
11921 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11922 # the main plane of the T-shape is XOY.
11923 # @param theR1 Internal radius of main pipe
11924 # @param theW1 Width of main pipe
11925 # @param theL1 Half-length of main pipe
11926 # @param theR2 Internal radius of incident pipe (R2 < R1)
11927 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11928 # @param theL2 Half-length of incident pipe
11929 # @param theH Height of the chamfer.
11930 # @param theW Width of the chamfer.
11931 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11932 # @param theP1 1st junction point of main pipe
11933 # @param theP2 2nd junction point of main pipe
11934 # @param theP3 Junction point of incident pipe
11936 # @param theRL Internal radius of left thickness reduction
11937 # @param theWL Width of left thickness reduction
11938 # @param theLtransL Length of left transition part
11939 # @param theLthinL Length of left thin part
11941 # @param theRR Internal radius of right thickness reduction
11942 # @param theWR Width of right thickness reduction
11943 # @param theLtransR Length of right transition part
11944 # @param theLthinR Length of right thin part
11946 # @param theRI Internal radius of incident thickness reduction
11947 # @param theWI Width of incident thickness reduction
11948 # @param theLtransI Length of incident transition part
11949 # @param theLthinI Length of incident thin part
11951 # @param theName Object name; when specified, this parameter is used
11952 # for result publication in the study. Otherwise, if automatic
11953 # publication is switched on, default value is used for result name.
11955 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11957 # @ref tui_creation_pipetshape "Example"
11958 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
11959 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
11960 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
11961 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
11962 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
11965 Create a T-shape object with chamfer and with specified caracteristics for the main
11966 and the incident pipes (radius, width, half-length). The chamfer is
11967 created on the junction of the pipes.
11968 The extremities of the main pipe are located on junctions points P1 and P2.
11969 The extremity of the incident pipe is located on junction point P3.
11970 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11971 the main plane of the T-shape is XOY.
11974 theR1 Internal radius of main pipe
11975 theW1 Width of main pipe
11976 theL1 Half-length of main pipe
11977 theR2 Internal radius of incident pipe (R2 < R1)
11978 theW2 Width of incident pipe (R2+W2 < R1+W1)
11979 theL2 Half-length of incident pipe
11980 theH Height of the chamfer.
11981 theW Width of the chamfer.
11982 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11983 theP1 1st junction point of main pipe
11984 theP2 2nd junction point of main pipe
11985 theP3 Junction point of incident pipe
11987 theRL Internal radius of left thickness reduction
11988 theWL Width of left thickness reduction
11989 theLtransL Length of left transition part
11990 theLthinL Length of left thin part
11992 theRR Internal radius of right thickness reduction
11993 theWR Width of right thickness reduction
11994 theLtransR Length of right transition part
11995 theLthinR Length of right thin part
11997 theRI Internal radius of incident thickness reduction
11998 theWI Width of incident thickness reduction
11999 theLtransI Length of incident transition part
12000 theLthinI Length of incident thin part
12002 theName Object name; when specified, this parameter is used
12003 for result publication in the study. Otherwise, if automatic
12004 publication is switched on, default value is used for result name.
12007 List of GEOM_Object, containing the created shape and propagation groups.
12010 # create PipeTShape with chamfer object
12011 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12012 # create PipeTShape with chamfer object with position
12013 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12014 # create PipeTShape with chamfer object with left thickness reduction
12015 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)
12017 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)
12018 if (theP1 and theP2 and theP3):
12019 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12020 theRL, theWL, theLtransL, theLthinL,
12021 theRR, theWR, theLtransR, theLthinR,
12022 theRI, theWI, theLtransI, theLthinI,
12023 theH, theW, theHexMesh, theP1, theP2, theP3)
12025 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12026 theRL, theWL, theLtransL, theLthinL,
12027 theRR, theWR, theLtransR, theLthinR,
12028 theRI, theWI, theLtransI, theLthinI,
12029 theH, theW, theHexMesh)
12030 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12031 if Parameters: anObj[0].SetParameters(Parameters)
12032 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12033 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12036 ## Create a T-shape object with fillet and with specified caracteristics for the main
12037 # and the incident pipes (radius, width, half-length). The fillet is
12038 # created on the junction of the pipes.
12039 # The extremities of the main pipe are located on junctions points P1 and P2.
12040 # The extremity of the incident pipe is located on junction point P3.
12041 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12042 # the main plane of the T-shape is XOY.
12043 # @param theR1 Internal radius of main pipe
12044 # @param theW1 Width of main pipe
12045 # @param theL1 Half-length of main pipe
12046 # @param theR2 Internal radius of incident pipe (R2 < R1)
12047 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12048 # @param theL2 Half-length of incident pipe
12049 # @param theRF Radius of curvature of fillet.
12050 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12051 # @param theP1 1st junction point of main pipe
12052 # @param theP2 2nd junction point of main pipe
12053 # @param theP3 Junction point of incident pipe
12055 # @param theRL Internal radius of left thickness reduction
12056 # @param theWL Width of left thickness reduction
12057 # @param theLtransL Length of left transition part
12058 # @param theLthinL Length of left thin part
12060 # @param theRR Internal radius of right thickness reduction
12061 # @param theWR Width of right thickness reduction
12062 # @param theLtransR Length of right transition part
12063 # @param theLthinR Length of right thin part
12065 # @param theRI Internal radius of incident thickness reduction
12066 # @param theWI Width of incident thickness reduction
12067 # @param theLtransI Length of incident transition part
12068 # @param theLthinI Length of incident thin part
12070 # @param theName Object name; when specified, this parameter is used
12071 # for result publication in the study. Otherwise, if automatic
12072 # publication is switched on, default value is used for result name.
12074 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12076 # @ref tui_creation_pipetshape "Example"
12077 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12078 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12079 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12080 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12081 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12084 Create a T-shape object with fillet and with specified caracteristics for the main
12085 and the incident pipes (radius, width, half-length). The fillet is
12086 created on the junction of the pipes.
12087 The extremities of the main pipe are located on junctions points P1 and P2.
12088 The extremity of the incident pipe is located on junction point P3.
12091 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12092 the main plane of the T-shape is XOY.
12093 theR1 Internal radius of main pipe
12094 theW1 Width of main pipe
12095 heL1 Half-length of main pipe
12096 theR2 Internal radius of incident pipe (R2 < R1)
12097 theW2 Width of incident pipe (R2+W2 < R1+W1)
12098 theL2 Half-length of incident pipe
12099 theRF Radius of curvature of fillet.
12100 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12101 theP1 1st junction point of main pipe
12102 theP2 2nd junction point of main pipe
12103 theP3 Junction point of incident pipe
12105 theRL Internal radius of left thickness reduction
12106 theWL Width of left thickness reduction
12107 theLtransL Length of left transition part
12108 theLthinL Length of left thin part
12110 theRR Internal radius of right thickness reduction
12111 theWR Width of right thickness reduction
12112 theLtransR Length of right transition part
12113 theLthinR Length of right thin part
12115 theRI Internal radius of incident thickness reduction
12116 theWI Width of incident thickness reduction
12117 theLtransI Length of incident transition part
12118 theLthinI Length of incident thin part
12120 theName Object name; when specified, this parameter is used
12121 for result publication in the study. Otherwise, if automatic
12122 publication is switched on, default value is used for result name.
12125 List of GEOM_Object, containing the created shape and propagation groups.
12128 # create PipeTShape with fillet object
12129 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12130 # create PipeTShape with fillet object with position
12131 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12132 # create PipeTShape with fillet object with left thickness reduction
12133 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)
12135 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)
12136 if (theP1 and theP2 and theP3):
12137 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12138 theRL, theWL, theLtransL, theLthinL,
12139 theRR, theWR, theLtransR, theLthinR,
12140 theRI, theWI, theLtransI, theLthinI,
12141 theRF, theHexMesh, theP1, theP2, theP3)
12143 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12144 theRL, theWL, theLtransL, theLthinL,
12145 theRR, theWR, theLtransR, theLthinR,
12146 theRI, theWI, theLtransI, theLthinI,
12148 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12149 if Parameters: anObj[0].SetParameters(Parameters)
12150 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12151 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12154 ## This function allows creating a disk already divided into blocks. It
12155 # can be used to create divided pipes for later meshing in hexaedra.
12156 # @param theR Radius of the disk
12157 # @param theOrientation Orientation of the plane on which the disk will be built
12158 # 1 = XOY, 2 = OYZ, 3 = OZX
12159 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12160 # @param theName Object name; when specified, this parameter is used
12161 # for result publication in the study. Otherwise, if automatic
12162 # publication is switched on, default value is used for result name.
12164 # @return New GEOM_Object, containing the created shape.
12166 # @ref tui_creation_divideddisk "Example"
12167 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12169 Creates a disk, divided into blocks. It can be used to create divided pipes
12170 for later meshing in hexaedra.
12173 theR Radius of the disk
12174 theOrientation Orientation of the plane on which the disk will be built:
12175 1 = XOY, 2 = OYZ, 3 = OZX
12176 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12177 theName Object name; when specified, this parameter is used
12178 for result publication in the study. Otherwise, if automatic
12179 publication is switched on, default value is used for result name.
12182 New GEOM_Object, containing the created shape.
12184 theR, Parameters = ParseParameters(theR)
12185 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12186 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12187 if Parameters: anObj.SetParameters(Parameters)
12188 self._autoPublish(anObj, theName, "dividedDisk")
12191 ## This function allows creating a disk already divided into blocks. It
12192 # can be used to create divided pipes for later meshing in hexaedra.
12193 # @param theCenter Center of the disk
12194 # @param theVector Normal vector to the plane of the created disk
12195 # @param theRadius Radius of the disk
12196 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12197 # @param theName Object name; when specified, this parameter is used
12198 # for result publication in the study. Otherwise, if automatic
12199 # publication is switched on, default value is used for result name.
12201 # @return New GEOM_Object, containing the created shape.
12203 # @ref tui_creation_divideddisk "Example"
12204 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12206 Creates a disk already divided into blocks. It can be used to create divided pipes
12207 for later meshing in hexaedra.
12210 theCenter Center of the disk
12211 theVector Normal vector to the plane of the created disk
12212 theRadius Radius of the disk
12213 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12214 theName Object name; when specified, this parameter is used
12215 for result publication in the study. Otherwise, if automatic
12216 publication is switched on, default value is used for result name.
12219 New GEOM_Object, containing the created shape.
12221 theRadius, Parameters = ParseParameters(theRadius)
12222 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12223 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12224 if Parameters: anObj.SetParameters(Parameters)
12225 self._autoPublish(anObj, theName, "dividedDisk")
12228 ## Builds a cylinder prepared for hexa meshes
12229 # @param theR Radius of the cylinder
12230 # @param theH Height of the cylinder
12231 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12232 # @param theName Object name; when specified, this parameter is used
12233 # for result publication in the study. Otherwise, if automatic
12234 # publication is switched on, default value is used for result name.
12236 # @return New GEOM_Object, containing the created shape.
12238 # @ref tui_creation_dividedcylinder "Example"
12239 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12241 Builds a cylinder prepared for hexa meshes
12244 theR Radius of the cylinder
12245 theH Height of the cylinder
12246 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12247 theName Object name; when specified, this parameter is used
12248 for result publication in the study. Otherwise, if automatic
12249 publication is switched on, default value is used for result name.
12252 New GEOM_Object, containing the created shape.
12254 theR, theH, Parameters = ParseParameters(theR, theH)
12255 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
12256 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
12257 if Parameters: anObj.SetParameters(Parameters)
12258 self._autoPublish(anObj, theName, "dividedCylinder")
12261 ## Create a surface from a cloud of points
12262 # @param thelPoints list of points
12263 # @return New GEOM_Object, containing the created shape.
12265 # @ref tui_creation_smoothingsurface "Example"
12266 def MakeSmoothingSurface(self, thelPoints):
12267 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints)
12268 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
12271 #@@ insert new functions before this line @@ do not remove this line @@#
12273 # end of l4_advanced
12276 ## Create a copy of the given object
12278 # @param theOriginal geometry object for copy
12279 # @param theName Object name; when specified, this parameter is used
12280 # for result publication in the study. Otherwise, if automatic
12281 # publication is switched on, default value is used for result name.
12283 # @return New GEOM_Object, containing the copied shape.
12285 # @ingroup l1_geomBuilder_auxiliary
12286 # @ref swig_MakeCopy "Example"
12287 def MakeCopy(self, theOriginal, theName=None):
12289 Create a copy of the given object
12292 theOriginal geometry object for copy
12293 theName Object name; when specified, this parameter is used
12294 for result publication in the study. Otherwise, if automatic
12295 publication is switched on, default value is used for result name.
12298 New GEOM_Object, containing the copied shape.
12300 Example of usage: Copy = geompy.MakeCopy(Box)
12302 # Example: see GEOM_TestAll.py
12303 anObj = self.InsertOp.MakeCopy(theOriginal)
12304 RaiseIfFailed("MakeCopy", self.InsertOp)
12305 self._autoPublish(anObj, theName, "copy")
12308 ## Add Path to load python scripts from
12309 # @param Path a path to load python scripts from
12310 # @ingroup l1_geomBuilder_auxiliary
12311 def addPath(self,Path):
12313 Add Path to load python scripts from
12316 Path a path to load python scripts from
12318 if (sys.path.count(Path) < 1):
12319 sys.path.append(Path)
12323 ## Load marker texture from the file
12324 # @param Path a path to the texture file
12325 # @return unique texture identifier
12326 # @ingroup l1_geomBuilder_auxiliary
12327 def LoadTexture(self, Path):
12329 Load marker texture from the file
12332 Path a path to the texture file
12335 unique texture identifier
12337 # Example: see GEOM_TestAll.py
12338 ID = self.InsertOp.LoadTexture(Path)
12339 RaiseIfFailed("LoadTexture", self.InsertOp)
12342 ## Get internal name of the object based on its study entry
12343 # @note This method does not provide an unique identifier of the geometry object.
12344 # @note This is internal function of GEOM component, though it can be used outside it for
12345 # appropriate reason (e.g. for identification of geometry object).
12346 # @param obj geometry object
12347 # @return unique object identifier
12348 # @ingroup l1_geomBuilder_auxiliary
12349 def getObjectID(self, obj):
12351 Get internal name of the object based on its study entry.
12352 Note: this method does not provide an unique identifier of the geometry object.
12353 It is an internal function of GEOM component, though it can be used outside GEOM for
12354 appropriate reason (e.g. for identification of geometry object).
12357 obj geometry object
12360 unique object identifier
12363 entry = salome.ObjectToID(obj)
12364 if entry is not None:
12365 lst = entry.split(":")
12367 ID = lst[-1] # -1 means last item in the list
12368 return "GEOM_" + ID
12373 ## Add marker texture. @a Width and @a Height parameters
12374 # specify width and height of the texture in pixels.
12375 # If @a RowData is @c True, @a Texture parameter should represent texture data
12376 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12377 # parameter should be unpacked string, in which '1' symbols represent opaque
12378 # pixels and '0' represent transparent pixels of the texture bitmap.
12380 # @param Width texture width in pixels
12381 # @param Height texture height in pixels
12382 # @param Texture texture data
12383 # @param RowData if @c True, @a Texture data are packed in the byte stream
12384 # @return unique texture identifier
12385 # @ingroup l1_geomBuilder_auxiliary
12386 def AddTexture(self, Width, Height, Texture, RowData=False):
12388 Add marker texture. Width and Height parameters
12389 specify width and height of the texture in pixels.
12390 If RowData is True, Texture parameter should represent texture data
12391 packed into the byte array. If RowData is False (default), Texture
12392 parameter should be unpacked string, in which '1' symbols represent opaque
12393 pixels and '0' represent transparent pixels of the texture bitmap.
12396 Width texture width in pixels
12397 Height texture height in pixels
12398 Texture texture data
12399 RowData if True, Texture data are packed in the byte stream
12402 return unique texture identifier
12404 if not RowData: Texture = PackData(Texture)
12405 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12406 RaiseIfFailed("AddTexture", self.InsertOp)
12409 ## Creates a new folder object. It is a container for any GEOM objects.
12410 # @param Name name of the container
12411 # @param Father parent object. If None,
12412 # folder under 'Geometry' root object will be created.
12413 # @return a new created folder
12414 def NewFolder(self, Name, Father=None):
12416 Create a new folder object. It is an auxiliary container for any GEOM objects.
12419 Name name of the container
12420 Father parent object. If None,
12421 folder under 'Geometry' root object will be created.
12424 a new created folder
12426 if not Father: Father = self.father
12427 return self.CreateFolder(Name, Father)
12429 ## Move object to the specified folder
12430 # @param Object object to move
12431 # @param Folder target folder
12432 def PutToFolder(self, Object, Folder):
12434 Move object to the specified folder
12437 Object object to move
12438 Folder target folder
12440 self.MoveToFolder(Object, Folder)
12443 ## Move list of objects to the specified folder
12444 # @param ListOfSO list of objects to move
12445 # @param Folder target folder
12446 def PutListToFolder(self, ListOfSO, Folder):
12448 Move list of objects to the specified folder
12451 ListOfSO list of objects to move
12452 Folder target folder
12454 self.MoveListToFolder(ListOfSO, Folder)
12458 # Register the new proxy for GEOM_Gen
12459 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12461 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12462 # interface to GEOM operations.
12467 # salome.salome_init()
12468 # from salome.geom import geomBuilder
12469 # geompy = geomBuilder.New(salome.myStudy)
12471 # @param study SALOME study, generally obtained by salome.myStudy.
12472 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12473 # @return geomBuilder instance
12474 def New( study, instance=None):
12476 Create a new geomBuilder instance.The geomBuilder class provides the Python
12477 interface to GEOM operations.
12481 salome.salome_init()
12482 from salome.geom import geomBuilder
12483 geompy = geomBuilder.New(salome.myStudy)
12486 study SALOME study, generally obtained by salome.myStudy.
12487 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12489 geomBuilder instance
12491 #print "New geomBuilder ", study, instance
12498 geom = geomBuilder()
12499 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12500 geom.init_geom(study)