1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012 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 # Author : Paul RASCLE, EDF
29 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
31 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
33 ## @defgroup l2_import_export Importing/exporting geometrical objects
34 ## @defgroup l2_creating Creating geometrical objects
36 ## @defgroup l3_basic_go Creating Basic Geometric Objects
38 ## @defgroup l4_curves Creating Curves
41 ## @defgroup l3_3d_primitives Creating 3D Primitives
42 ## @defgroup l3_complex Creating Complex Objects
43 ## @defgroup l3_groups Working with groups
44 ## @defgroup l3_blocks Building by blocks
46 ## @defgroup l4_blocks_measure Check and Improve
49 ## @defgroup l3_sketcher Sketcher
50 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
52 ## @defgroup l4_decompose Decompose objects
53 ## @defgroup l4_decompose_d Decompose objects deprecated methods
54 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
55 ## @defgroup l4_obtain Access to sub-shapes by a criteria
56 ## @defgroup l4_advanced Advanced objects creation functions
61 ## @defgroup l2_transforming Transforming geometrical objects
63 ## @defgroup l3_basic_op Basic Operations
64 ## @defgroup l3_boolean Boolean Operations
65 ## @defgroup l3_transform Transformation Operations
66 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
67 ## @defgroup l3_blocks_op Blocks Operations
68 ## @defgroup l3_healing Repairing Operations
69 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
72 ## @defgroup l2_measure Using measurement tools
76 # initialize SALOME session in try/except block
77 # to avoid problems in some cases, e.g. when generating documentation
85 from salome_notebook import *
91 from gsketcher import Sketcher3D
93 ## Enumeration ShapeType as a dictionary. \n
94 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
95 # @ingroup l1_geompy_auxiliary
96 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
98 ## Raise an Error, containing the Method_name, if Operation is Failed
99 ## @ingroup l1_geompy_auxiliary
100 def RaiseIfFailed (Method_name, Operation):
101 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
102 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
104 ## Return list of variables value from salome notebook
105 ## @ingroup l1_geompy_auxiliary
106 def ParseParameters(*parameters):
109 for parameter in parameters:
110 if isinstance(parameter, list):
111 lResults = ParseParameters(*parameter)
112 if len(lResults) > 0:
113 Result.append(lResults[:-1])
114 StringResult += lResults[-1].split(":")
118 if isinstance(parameter,str):
119 if notebook.isVariable(parameter):
120 Result.append(notebook.get(parameter))
122 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
125 Result.append(parameter)
127 StringResult.append(str(parameter))
131 Result.append(":".join(StringResult))
133 Result = ":".join(StringResult)
136 ## Return list of variables value from salome notebook
137 ## @ingroup l1_geompy_auxiliary
141 for parameter in list:
142 if isinstance(parameter,str) and notebook.isVariable(parameter):
143 Result.append(str(notebook.get(parameter)))
146 Result.append(str(parameter))
149 StringResult = StringResult + str(parameter)
150 StringResult = StringResult + ":"
152 StringResult = StringResult[:len(StringResult)-1]
153 return Result, StringResult
155 ## Return list of variables value from salome notebook
156 ## @ingroup l1_geompy_auxiliary
157 def ParseSketcherCommand(command):
160 sections = command.split(":")
161 for section in sections:
162 parameters = section.split(" ")
164 for parameter in parameters:
165 if paramIndex > 1 and parameter.find("'") != -1:
166 parameter = parameter.replace("'","")
167 if notebook.isVariable(parameter):
168 Result = Result + str(notebook.get(parameter)) + " "
171 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
175 Result = Result + str(parameter) + " "
178 StringResult = StringResult + parameter
179 StringResult = StringResult + ":"
181 paramIndex = paramIndex + 1
183 Result = Result[:len(Result)-1] + ":"
185 Result = Result[:len(Result)-1]
186 return Result, StringResult
188 ## Helper function which can be used to pack the passed string to the byte data.
189 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
190 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
193 ## val = PackData("10001110") # val = 0xAE
194 ## val = PackData("1") # val = 0x80
196 ## @param data unpacked data - a string containing '1' and '0' symbols
197 ## @return data packed to the byte stream
198 ## @ingroup l1_geompy_auxiliary
201 Helper function which can be used to pack the passed string to the byte data.
202 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
203 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
206 data unpacked data - a string containing '1' and '0' symbols
209 data packed to the byte stream
212 val = PackData("10001110") # val = 0xAE
213 val = PackData("1") # val = 0x80
216 if len(data)%8: bytes += 1
218 for b in range(bytes):
219 d = data[b*8:(b+1)*8]
224 if d[i] == "1": val += 1
226 raise "Invalid symbol %s" % d[i]
233 ## Read bitmap texture from the text file.
234 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
235 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
236 ## The function returns width and height of the pixmap in pixels and byte stream representing
237 ## texture bitmap itself.
239 ## This function can be used to read the texture to the byte stream in order to pass it to
240 ## the AddTexture() function of geompy class.
244 ## geompy.init_geom(salome.myStudy)
245 ## texture = geompy.readtexture('mytexture.dat')
246 ## texture = geompy.AddTexture(*texture)
247 ## obj.SetMarkerTexture(texture)
249 ## @param fname texture file name
250 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
251 ## @ingroup l1_geompy_auxiliary
252 def ReadTexture(fname):
254 Read bitmap texture from the text file.
255 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
256 A zero symbol ('0') represents transparent pixel of the texture bitmap.
257 The function returns width and height of the pixmap in pixels and byte stream representing
258 texture bitmap itself.
259 This function can be used to read the texture to the byte stream in order to pass it to
260 the AddTexture() function of geompy class.
263 fname texture file name
266 sequence of tree values: texture's width, height in pixels and its byte stream
270 geompy.init_geom(salome.myStudy)
271 texture = geompy.readtexture('mytexture.dat')
272 texture = geompy.AddTexture(*texture)
273 obj.SetMarkerTexture(texture)
277 lines = [ l.strip() for l in f.readlines()]
280 if lines: maxlen = max([len(x) for x in lines])
282 if maxlen%8: lenbytes += 1
286 lenline = (len(line)/8+1)*8
289 lenline = (len(line)/8)*8
291 for i in range(lenline/8):
294 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
297 bytedata += PackData(byte)
299 for i in range(lenline/8, lenbytes):
300 bytedata += PackData("0")
302 return lenbytes*8, len(lines), bytedata
307 ## Returns a long value from enumeration type
308 # Can be used for CORBA enumerator types like GEOM.shape_type
309 # @param theItem enumeration type
310 # @ingroup l1_geompy_auxiliary
311 def EnumToLong(theItem):
313 Returns a long value from enumeration type
314 Can be used for CORBA enumerator types like geompy.ShapeType
317 theItem enumeration type
320 if hasattr(theItem, "_v"): ret = theItem._v
323 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
324 # and a list of parameters, describing the shape.
325 # List of parameters, describing the shape:
326 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
327 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
329 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
331 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
333 # - SPHERE: [xc yc zc R]
334 # - CYLINDER: [xb yb zb dx dy dz R H]
335 # - BOX: [xc yc zc ax ay az]
336 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
337 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
338 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
339 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
340 # - SOLID: [nb_faces nb_edges nb_vertices]
342 # - SPHERE2D: [xc yc zc R]
343 # - CYLINDER2D: [xb yb zb dx dy dz R H]
344 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
345 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
346 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
347 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
348 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
349 # - PLANE: [xo yo zo dx dy dz]
350 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
351 # - FACE: [nb_edges nb_vertices]
353 # - CIRCLE: [xc yc zc dx dy dz R]
354 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
355 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
356 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
357 # - LINE: [xo yo zo dx dy dz]
358 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
359 # - EDGE: [nb_vertices]
362 # @ingroup l1_geompy_auxiliary
363 kind = GEOM.GEOM_IKindOfShape
365 ## Information about closed/unclosed state of shell or wire
366 # @ingroup l1_geompy_auxiliary
369 Information about closed/unclosed state of shell or wire
375 class geompyDC(GEOM._objref_GEOM_Gen):
378 GEOM._objref_GEOM_Gen.__init__(self)
379 self.myBuilder = None
398 ## @addtogroup l1_geompy_auxiliary
400 def init_geom(self,theStudy):
401 self.myStudy = theStudy
402 self.myStudyId = self.myStudy._get_StudyId()
403 self.myBuilder = self.myStudy.NewBuilder()
404 self.father = self.myStudy.FindComponent("GEOM")
405 if self.father is None:
406 self.father = self.myBuilder.NewComponent("GEOM")
407 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
408 FName = A1._narrow(SALOMEDS.AttributeName)
409 FName.SetValue("Geometry")
410 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
411 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
412 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
413 self.myBuilder.DefineComponentInstance(self.father,self)
415 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
416 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
417 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
418 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
419 self.HealOp = self.GetIHealingOperations (self.myStudyId)
420 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
421 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
422 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
423 self.LocalOp = self.GetILocalOperations (self.myStudyId)
424 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
425 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
426 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
427 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
430 ## Dump component to the Python script
431 # This method overrides IDL function to allow default values for the parameters.
432 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
434 Dump component to the Python script
435 This method overrides IDL function to allow default values for the parameters.
437 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
439 ## Get name for sub-shape aSubObj of shape aMainObj
441 # @ref swig_SubShapeName "Example"
442 def SubShapeName(self,aSubObj, aMainObj):
444 Get name for sub-shape aSubObj of shape aMainObj
446 # Example: see GEOM_TestAll.py
448 #aSubId = orb.object_to_string(aSubObj)
449 #aMainId = orb.object_to_string(aMainObj)
450 #index = gg.getIndexTopology(aSubId, aMainId)
451 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
452 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
453 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
456 ## Publish in study aShape with name aName
458 # \param aShape the shape to be published
459 # \param aName the name for the shape
460 # \param doRestoreSubShapes if True, finds and publishes also
461 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
462 # and published sub-shapes of arguments
463 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
464 # these arguments description
465 # \return study entry of the published shape in form of string
467 # @ref swig_all_addtostudy "Example"
468 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
469 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
471 Publish in study aShape with name aName
474 aShape the shape to be published
475 aName the name for the shape
476 doRestoreSubShapes if True, finds and publishes also
477 sub-shapes of aShape, corresponding to its arguments
478 and published sub-shapes of arguments
479 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
480 these arguments description
483 study entry of the published shape in form of string
486 id_block1 = geompy.addToStudy(Block1, "Block 1")
488 # Example: see GEOM_TestAll.py
490 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
491 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
492 if doRestoreSubShapes:
493 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
494 theFindMethod, theInheritFirstArg, True )
496 print "addToStudy() failed"
498 return aShape.GetStudyEntry()
500 ## Publish in study aShape with name aName as sub-object of previously published aFather
501 # \param aFather previously published object
502 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
503 # \param aName the name for the shape
505 # \return study entry of the published shape in form of string
506 # @ref swig_all_addtostudyInFather "Example"
507 def addToStudyInFather(self, aFather, aShape, aName):
509 Publish in study aShape with name aName as sub-object of previously published aFather
512 aFather previously published object
513 aShape the shape to be published as sub-object of aFather
514 aName the name for the shape
517 study entry of the published shape in form of string
519 # Example: see GEOM_TestAll.py
521 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
522 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
524 print "addToStudyInFather() failed"
526 return aShape.GetStudyEntry()
528 ## Unpublish object in study
530 # \param obj the object to be unpublished
531 def hideInStudy(self, obj):
533 Unpublish object in study
536 obj the object to be unpublished
538 ior = salome.orb.object_to_string(obj)
539 aSObject = self.myStudy.FindObjectIOR(ior)
540 if aSObject is not None:
541 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
542 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
543 drwAttribute.SetDrawable(False)
546 # end of l1_geompy_auxiliary
549 ## @addtogroup l3_restore_ss
552 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
553 # To be used from python scripts out of addToStudy() (non-default usage)
554 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
555 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
556 # If this list is empty, all operation arguments will be published
557 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
558 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
559 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
560 # Do not publish sub-shapes in place of arguments, but only
561 # in place of sub-shapes of the first argument,
562 # because the whole shape corresponds to the first argument.
563 # Mainly to be used after transformations, but it also can be
564 # usefull after partition with one object shape, and some other
565 # operations, where only the first argument has to be considered.
566 # If theObject has only one argument shape, this flag is automatically
567 # considered as True, not regarding really passed value.
568 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
569 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
570 # \return list of published sub-shapes
572 # @ref tui_restore_prs_params "Example"
573 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
574 theInheritFirstArg=False, theAddPrefix=True):
576 Publish sub-shapes, standing for arguments and sub-shapes of arguments
577 To be used from python scripts out of geompy.addToStudy (non-default usage)
580 theObject published GEOM.GEOM_Object, arguments of which will be published
581 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
582 If this list is empty, all operation arguments will be published
583 theFindMethod method to search sub-shapes, corresponding to arguments and
584 their sub-shapes. Value from enumeration GEOM.find_shape_method.
585 theInheritFirstArg set properties of the first argument for theObject.
586 Do not publish sub-shapes in place of arguments, but only
587 in place of sub-shapes of the first argument,
588 because the whole shape corresponds to the first argument.
589 Mainly to be used after transformations, but it also can be
590 usefull after partition with one object shape, and some other
591 operations, where only the first argument has to be considered.
592 If theObject has only one argument shape, this flag is automatically
593 considered as True, not regarding really passed value.
594 theAddPrefix add prefix "from_" to names of restored sub-shapes,
595 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
597 list of published sub-shapes
599 # Example: see GEOM_TestAll.py
600 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
601 theFindMethod, theInheritFirstArg, theAddPrefix)
603 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
604 # To be used from python scripts out of addToStudy() (non-default usage)
605 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
606 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
607 # If this list is empty, all operation arguments will be published
608 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
609 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
610 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
611 # Do not publish sub-shapes in place of arguments, but only
612 # in place of sub-shapes of the first argument,
613 # because the whole shape corresponds to the first argument.
614 # Mainly to be used after transformations, but it also can be
615 # usefull after partition with one object shape, and some other
616 # operations, where only the first argument has to be considered.
617 # If theObject has only one argument shape, this flag is automatically
618 # considered as True, not regarding really passed value.
619 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
620 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
621 # \return list of published sub-shapes
623 # @ref tui_restore_prs_params "Example"
624 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
625 theInheritFirstArg=False, theAddPrefix=True):
627 Publish sub-shapes, standing for arguments and sub-shapes of arguments
628 To be used from python scripts out of geompy.addToStudy() (non-default usage)
631 theObject published GEOM.GEOM_Object, arguments of which will be published
632 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
633 If this list is empty, all operation arguments will be published
634 theFindMethod method to search sub-shapes, corresponding to arguments and
635 their sub-shapes. Value from enumeration GEOM::find_shape_method.
636 theInheritFirstArg set properties of the first argument for theObject.
637 Do not publish sub-shapes in place of arguments, but only
638 in place of sub-shapes of the first argument,
639 because the whole shape corresponds to the first argument.
640 Mainly to be used after transformations, but it also can be
641 usefull after partition with one object shape, and some other
642 operations, where only the first argument has to be considered.
643 If theObject has only one argument shape, this flag is automatically
644 considered as True, not regarding really passed value.
645 theAddPrefix add prefix "from_" to names of restored sub-shapes,
646 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
649 list of published sub-shapes
651 # Example: see GEOM_TestAll.py
652 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
653 theFindMethod, theInheritFirstArg, theAddPrefix)
655 # end of l3_restore_ss
658 ## @addtogroup l3_basic_go
661 ## Create point by three coordinates.
662 # @param theX The X coordinate of the point.
663 # @param theY The Y coordinate of the point.
664 # @param theZ The Z coordinate of the point.
665 # @return New GEOM.GEOM_Object, containing the created point.
667 # @ref tui_creation_point "Example"
668 def MakeVertex(self, theX, theY, theZ):
670 Create point by three coordinates.
673 theX The X coordinate of the point.
674 theY The Y coordinate of the point.
675 theZ The Z coordinate of the point.
678 New GEOM.GEOM_Object, containing the created point.
680 # Example: see GEOM_TestAll.py
681 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
682 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
683 RaiseIfFailed("MakePointXYZ", self.BasicOp)
684 anObj.SetParameters(Parameters)
687 ## Create a point, distant from the referenced point
688 # on the given distances along the coordinate axes.
689 # @param theReference The referenced point.
690 # @param theX Displacement from the referenced point along OX axis.
691 # @param theY Displacement from the referenced point along OY axis.
692 # @param theZ Displacement from the referenced point along OZ axis.
693 # @return New GEOM.GEOM_Object, containing the created point.
695 # @ref tui_creation_point "Example"
696 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
698 Create a point, distant from the referenced point
699 on the given distances along the coordinate axes.
702 theReference The referenced point.
703 theX Displacement from the referenced point along OX axis.
704 theY Displacement from the referenced point along OY axis.
705 theZ Displacement from the referenced point along OZ axis.
708 New GEOM.GEOM_Object, containing the created point.
710 # Example: see GEOM_TestAll.py
711 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
712 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
713 RaiseIfFailed("MakePointWithReference", self.BasicOp)
714 anObj.SetParameters(Parameters)
717 ## Create a point, corresponding to the given parameter on the given curve.
718 # @param theRefCurve The referenced curve.
719 # @param theParameter Value of parameter on the referenced curve.
720 # @return New GEOM.GEOM_Object, containing the created point.
722 # @ref tui_creation_point "Example"
723 def MakeVertexOnCurve(self,theRefCurve, theParameter):
725 Create a point, corresponding to the given parameter on the given curve.
728 theRefCurve The referenced curve.
729 theParameter Value of parameter on the referenced curve.
732 New GEOM.GEOM_Object, containing the created point.
735 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
737 # Example: see GEOM_TestAll.py
738 theParameter, Parameters = ParseParameters(theParameter)
739 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
740 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
741 anObj.SetParameters(Parameters)
744 ## Create a point by projection give coordinates on the given curve
745 # @param theRefCurve The referenced curve.
746 # @param theX X-coordinate in 3D space
747 # @param theY Y-coordinate in 3D space
748 # @param theZ Z-coordinate in 3D space
749 # @return New GEOM.GEOM_Object, containing the created point.
751 # @ref tui_creation_point "Example"
752 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
754 Create a point by projection give coordinates on the given curve
757 theRefCurve The referenced curve.
758 theX X-coordinate in 3D space
759 theY Y-coordinate in 3D space
760 theZ Z-coordinate in 3D space
763 New GEOM.GEOM_Object, containing the created point.
766 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
768 # Example: see GEOM_TestAll.py
769 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
770 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
771 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
772 anObj.SetParameters(Parameters)
775 ## Create a point, corresponding to the given length on the given curve.
776 # @param theRefCurve The referenced curve.
777 # @param theLength Length on the referenced curve. It can be negative.
778 # @param theStartPoint Point allowing to choose the direction for the calculation
779 # of the length. If None, start from the first point of theRefCurve.
780 # @return New GEOM.GEOM_Object, containing the created point.
782 # @ref tui_creation_point "Example"
783 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
785 Create a point, corresponding to the given length on the given curve.
788 theRefCurve The referenced curve.
789 theLength Length on the referenced curve. It can be negative.
790 theStartPoint Point allowing to choose the direction for the calculation
791 of the length. If None, start from the first point of theRefCurve.
794 New GEOM.GEOM_Object, containing the created point.
796 # Example: see GEOM_TestAll.py
797 theLength, Parameters = ParseParameters(theLength)
798 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
799 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
800 anObj.SetParameters(Parameters)
803 ## Create a point, corresponding to the given parameters on the
805 # @param theRefSurf The referenced surface.
806 # @param theUParameter Value of U-parameter on the referenced surface.
807 # @param theVParameter Value of V-parameter on the referenced surface.
808 # @return New GEOM.GEOM_Object, containing the created point.
810 # @ref swig_MakeVertexOnSurface "Example"
811 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
813 Create a point, corresponding to the given parameters on the
817 theRefSurf The referenced surface.
818 theUParameter Value of U-parameter on the referenced surface.
819 theVParameter Value of V-parameter on the referenced surface.
822 New GEOM.GEOM_Object, containing the created point.
825 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
827 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
828 # Example: see GEOM_TestAll.py
829 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
830 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
831 anObj.SetParameters(Parameters);
834 ## Create a point by projection give coordinates on the given surface
835 # @param theRefSurf The referenced surface.
836 # @param theX X-coordinate in 3D space
837 # @param theY Y-coordinate in 3D space
838 # @param theZ Z-coordinate in 3D space
839 # @return New GEOM.GEOM_Object, containing the created point.
841 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
842 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
844 Create a point by projection give coordinates on the given surface
847 theRefSurf The referenced surface.
848 theX X-coordinate in 3D space
849 theY Y-coordinate in 3D space
850 theZ Z-coordinate in 3D space
853 New GEOM.GEOM_Object, containing the created point.
856 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
858 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
859 # Example: see GEOM_TestAll.py
860 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
861 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
862 anObj.SetParameters(Parameters);
865 ## Create a point, which lays on the given face.
866 # The point will lay in arbitrary place of the face.
867 # The only condition on it is a non-zero distance to the face boundary.
868 # Such point can be used to uniquely identify the face inside any
869 # shape in case, when the shape does not contain overlapped faces.
870 # @param theFace The referenced face.
871 # @return New GEOM.GEOM_Object, containing the created point.
873 # @ref swig_MakeVertexInsideFace "Example"
874 def MakeVertexInsideFace (self, theFace):
876 Create a point, which lays on the given face.
877 The point will lay in arbitrary place of the face.
878 The only condition on it is a non-zero distance to the face boundary.
879 Such point can be used to uniquely identify the face inside any
880 shape in case, when the shape does not contain overlapped faces.
883 theFace The referenced face.
886 New GEOM.GEOM_Object, containing the created point.
889 p_on_face = geompy.MakeVertexInsideFace(Face)
891 # Example: see GEOM_TestAll.py
892 anObj = self.BasicOp.MakePointOnFace(theFace)
893 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
896 ## Create a point on intersection of two lines.
897 # @param theRefLine1, theRefLine2 The referenced lines.
898 # @return New GEOM.GEOM_Object, containing the created point.
900 # @ref swig_MakeVertexOnLinesIntersection "Example"
901 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
903 Create a point on intersection of two lines.
906 theRefLine1, theRefLine2 The referenced lines.
909 New GEOM.GEOM_Object, containing the created point.
911 # Example: see GEOM_TestAll.py
912 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
913 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
916 ## Create a tangent, corresponding to the given parameter on the given curve.
917 # @param theRefCurve The referenced curve.
918 # @param theParameter Value of parameter on the referenced curve.
919 # @return New GEOM.GEOM_Object, containing the created tangent.
921 # @ref swig_MakeTangentOnCurve "Example"
922 def MakeTangentOnCurve(self, theRefCurve, theParameter):
924 Create a tangent, corresponding to the given parameter on the given curve.
927 theRefCurve The referenced curve.
928 theParameter Value of parameter on the referenced curve.
931 New GEOM.GEOM_Object, containing the created tangent.
934 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
936 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
937 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
940 ## Create a tangent plane, corresponding to the given parameter on the given face.
941 # @param theFace The face for which tangent plane should be built.
942 # @param theParameterV vertical value of the center point (0.0 - 1.0).
943 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
944 # @param theTrimSize the size of plane.
945 # @return New GEOM.GEOM_Object, containing the created tangent.
947 # @ref swig_MakeTangentPlaneOnFace "Example"
948 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
950 Create a tangent plane, corresponding to the given parameter on the given face.
953 theFace The face for which tangent plane should be built.
954 theParameterV vertical value of the center point (0.0 - 1.0).
955 theParameterU horisontal value of the center point (0.0 - 1.0).
956 theTrimSize the size of plane.
959 New GEOM.GEOM_Object, containing the created tangent.
962 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
964 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
965 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
968 ## Create a vector with the given components.
969 # @param theDX X component of the vector.
970 # @param theDY Y component of the vector.
971 # @param theDZ Z component of the vector.
972 # @return New GEOM.GEOM_Object, containing the created vector.
974 # @ref tui_creation_vector "Example"
975 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
977 Create a vector with the given components.
980 theDX X component of the vector.
981 theDY Y component of the vector.
982 theDZ Z component of the vector.
985 New GEOM.GEOM_Object, containing the created vector.
987 # Example: see GEOM_TestAll.py
988 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
989 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
990 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
991 anObj.SetParameters(Parameters)
994 ## Create a vector between two points.
995 # @param thePnt1 Start point for the vector.
996 # @param thePnt2 End point for the vector.
997 # @return New GEOM.GEOM_Object, containing the created vector.
999 # @ref tui_creation_vector "Example"
1000 def MakeVector(self,thePnt1, thePnt2):
1002 Create a vector between two points.
1005 thePnt1 Start point for the vector.
1006 thePnt2 End point for the vector.
1009 New GEOM.GEOM_Object, containing the created vector.
1011 # Example: see GEOM_TestAll.py
1012 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1013 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1016 ## Create a line, passing through the given point
1017 # and parrallel to the given direction
1018 # @param thePnt Point. The resulting line will pass through it.
1019 # @param theDir Direction. The resulting line will be parallel to it.
1020 # @return New GEOM.GEOM_Object, containing the created line.
1022 # @ref tui_creation_line "Example"
1023 def MakeLine(self,thePnt, theDir):
1025 Create a line, passing through the given point
1026 and parrallel to the given direction
1029 thePnt Point. The resulting line will pass through it.
1030 theDir Direction. The resulting line will be parallel to it.
1033 New GEOM.GEOM_Object, containing the created line.
1035 # Example: see GEOM_TestAll.py
1036 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1037 RaiseIfFailed("MakeLine", self.BasicOp)
1040 ## Create a line, passing through the given points
1041 # @param thePnt1 First of two points, defining the line.
1042 # @param thePnt2 Second of two points, defining the line.
1043 # @return New GEOM.GEOM_Object, containing the created line.
1045 # @ref tui_creation_line "Example"
1046 def MakeLineTwoPnt(self,thePnt1, thePnt2):
1048 Create a line, passing through the given points
1051 thePnt1 First of two points, defining the line.
1052 thePnt2 Second of two points, defining the line.
1055 New GEOM.GEOM_Object, containing the created line.
1057 # Example: see GEOM_TestAll.py
1058 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1059 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1062 ## Create a line on two faces intersection.
1063 # @param theFace1 First of two faces, defining the line.
1064 # @param theFace2 Second of two faces, defining the line.
1065 # @return New GEOM.GEOM_Object, containing the created line.
1067 # @ref swig_MakeLineTwoFaces "Example"
1068 def MakeLineTwoFaces(self, theFace1, theFace2):
1070 Create a line on two faces intersection.
1073 theFace1 First of two faces, defining the line.
1074 theFace2 Second of two faces, defining the line.
1077 New GEOM.GEOM_Object, containing the created line.
1079 # Example: see GEOM_TestAll.py
1080 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1081 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1084 ## Create a plane, passing through the given point
1085 # and normal to the given vector.
1086 # @param thePnt Point, the plane has to pass through.
1087 # @param theVec Vector, defining the plane normal direction.
1088 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1089 # @return New GEOM.GEOM_Object, containing the created plane.
1091 # @ref tui_creation_plane "Example"
1092 def MakePlane(self,thePnt, theVec, theTrimSize):
1094 Create a plane, passing through the given point
1095 and normal to the given vector.
1098 thePnt Point, the plane has to pass through.
1099 theVec Vector, defining the plane normal direction.
1100 theTrimSize Half size of a side of quadrangle face, representing the plane.
1103 New GEOM.GEOM_Object, containing the created plane.
1105 # Example: see GEOM_TestAll.py
1106 theTrimSize, Parameters = ParseParameters(theTrimSize);
1107 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1108 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1109 anObj.SetParameters(Parameters)
1112 ## Create a plane, passing through the three given points
1113 # @param thePnt1 First of three points, defining the plane.
1114 # @param thePnt2 Second of three points, defining the plane.
1115 # @param thePnt3 Fird of three points, defining the plane.
1116 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1117 # @return New GEOM.GEOM_Object, containing the created plane.
1119 # @ref tui_creation_plane "Example"
1120 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1122 Create a plane, passing through the three given points
1125 thePnt1 First of three points, defining the plane.
1126 thePnt2 Second of three points, defining the plane.
1127 thePnt3 Fird of three points, defining the plane.
1128 theTrimSize Half size of a side of quadrangle face, representing the plane.
1131 New GEOM.GEOM_Object, containing the created plane.
1133 # Example: see GEOM_TestAll.py
1134 theTrimSize, Parameters = ParseParameters(theTrimSize);
1135 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1136 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1137 anObj.SetParameters(Parameters)
1140 ## Create a plane, similar to the existing one, but with another size of representing face.
1141 # @param theFace Referenced plane or LCS(Marker).
1142 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1143 # @return New GEOM.GEOM_Object, containing the created plane.
1145 # @ref tui_creation_plane "Example"
1146 def MakePlaneFace(self,theFace, theTrimSize):
1148 Create a plane, similar to the existing one, but with another size of representing face.
1151 theFace Referenced plane or LCS(Marker).
1152 theTrimSize New half size of a side of quadrangle face, representing the plane.
1155 New GEOM.GEOM_Object, containing the created plane.
1157 # Example: see GEOM_TestAll.py
1158 theTrimSize, Parameters = ParseParameters(theTrimSize);
1159 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1160 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1161 anObj.SetParameters(Parameters)
1164 ## Create a plane, passing through the 2 vectors
1165 # with center in a start point of the first vector.
1166 # @param theVec1 Vector, defining center point and plane direction.
1167 # @param theVec2 Vector, defining the plane normal direction.
1168 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1169 # @return New GEOM.GEOM_Object, containing the created plane.
1171 # @ref tui_creation_plane "Example"
1172 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1174 Create a plane, passing through the 2 vectors
1175 with center in a start point of the first vector.
1178 theVec1 Vector, defining center point and plane direction.
1179 theVec2 Vector, defining the plane normal direction.
1180 theTrimSize Half size of a side of quadrangle face, representing the plane.
1183 New GEOM.GEOM_Object, containing the created plane.
1185 # Example: see GEOM_TestAll.py
1186 theTrimSize, Parameters = ParseParameters(theTrimSize);
1187 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1188 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1189 anObj.SetParameters(Parameters)
1192 ## Create a plane, based on a Local coordinate system.
1193 # @param theLCS coordinate system, defining plane.
1194 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1195 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1196 # @return New GEOM.GEOM_Object, containing the created plane.
1198 # @ref tui_creation_plane "Example"
1199 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1201 Create a plane, based on a Local coordinate system.
1204 theLCS coordinate system, defining plane.
1205 theTrimSize Half size of a side of quadrangle face, representing the plane.
1206 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1209 New GEOM.GEOM_Object, containing the created plane.
1211 # Example: see GEOM_TestAll.py
1212 theTrimSize, Parameters = ParseParameters(theTrimSize);
1213 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1214 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1215 anObj.SetParameters(Parameters)
1218 ## Create a local coordinate system.
1219 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1220 # @param XDX,XDY,XDZ Three components of OX direction
1221 # @param YDX,YDY,YDZ Three components of OY direction
1222 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1224 # @ref swig_MakeMarker "Example"
1225 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1227 Create a local coordinate system.
1230 OX,OY,OZ Three coordinates of coordinate system origin.
1231 XDX,XDY,XDZ Three components of OX direction
1232 YDX,YDY,YDZ Three components of OY direction
1235 New GEOM.GEOM_Object, containing the created coordinate system.
1237 # Example: see GEOM_TestAll.py
1238 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1239 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1240 RaiseIfFailed("MakeMarker", self.BasicOp)
1241 anObj.SetParameters(Parameters)
1244 ## Create a local coordinate system from shape.
1245 # @param theShape The initial shape to detect the coordinate system.
1246 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1248 # @ref tui_creation_lcs "Example"
1249 def MakeMarkerFromShape(self, theShape):
1251 Create a local coordinate system from shape.
1254 theShape The initial shape to detect the coordinate system.
1257 New GEOM.GEOM_Object, containing the created coordinate system.
1259 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1260 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1263 ## Create a local coordinate system from point and two vectors.
1264 # @param theOrigin Point of coordinate system origin.
1265 # @param theXVec Vector of X direction
1266 # @param theYVec Vector of Y direction
1267 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1269 # @ref tui_creation_lcs "Example"
1270 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1272 Create a local coordinate system from point and two vectors.
1275 theOrigin Point of coordinate system origin.
1276 theXVec Vector of X direction
1277 theYVec Vector of Y direction
1280 New GEOM.GEOM_Object, containing the created coordinate system.
1283 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1284 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1287 # end of l3_basic_go
1290 ## @addtogroup l4_curves
1293 ## Create an arc of circle, passing through three given points.
1294 # @param thePnt1 Start point of the arc.
1295 # @param thePnt2 Middle point of the arc.
1296 # @param thePnt3 End point of the arc.
1297 # @return New GEOM.GEOM_Object, containing the created arc.
1299 # @ref swig_MakeArc "Example"
1300 def MakeArc(self,thePnt1, thePnt2, thePnt3):
1302 Create an arc of circle, passing through three given points.
1305 thePnt1 Start point of the arc.
1306 thePnt2 Middle point of the arc.
1307 thePnt3 End point of the arc.
1310 New GEOM.GEOM_Object, containing the created arc.
1312 # Example: see GEOM_TestAll.py
1313 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1314 RaiseIfFailed("MakeArc", self.CurvesOp)
1317 ## Create an arc of circle from a center and 2 points.
1318 # @param thePnt1 Center of the arc
1319 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1320 # @param thePnt3 End point of the arc (Gives also a direction)
1321 # @param theSense Orientation of the arc
1322 # @return New GEOM.GEOM_Object, containing the created arc.
1324 # @ref swig_MakeArc "Example"
1325 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1327 Create an arc of circle from a center and 2 points.
1330 thePnt1 Center of the arc
1331 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1332 thePnt3 End point of the arc (Gives also a direction)
1333 theSense Orientation of the arc
1336 New GEOM.GEOM_Object, containing the created arc.
1338 # Example: see GEOM_TestAll.py
1339 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1340 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1343 ## Create an arc of ellipse, of center and two points.
1344 # @param theCenter Center of the arc.
1345 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1346 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1347 # @return New GEOM.GEOM_Object, containing the created arc.
1349 # @ref swig_MakeArc "Example"
1350 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1352 Create an arc of ellipse, of center and two points.
1355 theCenter Center of the arc.
1356 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1357 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1360 New GEOM.GEOM_Object, containing the created arc.
1362 # Example: see GEOM_TestAll.py
1363 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1364 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1367 ## Create a circle with given center, normal vector and radius.
1368 # @param thePnt Circle center.
1369 # @param theVec Vector, normal to the plane of the circle.
1370 # @param theR Circle radius.
1371 # @return New GEOM.GEOM_Object, containing the created circle.
1373 # @ref tui_creation_circle "Example"
1374 def MakeCircle(self, thePnt, theVec, theR):
1376 Create a circle with given center, normal vector and radius.
1379 thePnt Circle center.
1380 theVec Vector, normal to the plane of the circle.
1384 New GEOM.GEOM_Object, containing the created circle.
1386 # Example: see GEOM_TestAll.py
1387 theR, Parameters = ParseParameters(theR)
1388 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1389 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1390 anObj.SetParameters(Parameters)
1393 ## Create a circle with given radius.
1394 # Center of the circle will be in the origin of global
1395 # coordinate system and normal vector will be codirected with Z axis
1396 # @param theR Circle radius.
1397 # @return New GEOM.GEOM_Object, containing the created circle.
1398 def MakeCircleR(self, theR):
1400 Create a circle with given radius.
1401 Center of the circle will be in the origin of global
1402 coordinate system and normal vector will be codirected with Z axis
1408 New GEOM.GEOM_Object, containing the created circle.
1410 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1411 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1414 ## Create a circle, passing through three given points
1415 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1416 # @return New GEOM.GEOM_Object, containing the created circle.
1418 # @ref tui_creation_circle "Example"
1419 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1421 Create a circle, passing through three given points
1424 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1427 New GEOM.GEOM_Object, containing the created circle.
1429 # Example: see GEOM_TestAll.py
1430 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1431 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1434 ## Create a circle, with given point1 as center,
1435 # passing through the point2 as radius and laying in the plane,
1436 # defined by all three given points.
1437 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1438 # @return New GEOM.GEOM_Object, containing the created circle.
1440 # @ref swig_MakeCircle "Example"
1441 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1443 Create a circle, with given point1 as center,
1444 passing through the point2 as radius and laying in the plane,
1445 defined by all three given points.
1448 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1451 New GEOM.GEOM_Object, containing the created circle.
1453 # Example: see GEOM_example6.py
1454 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1455 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1458 ## Create an ellipse with given center, normal vector and radiuses.
1459 # @param thePnt Ellipse center.
1460 # @param theVec Vector, normal to the plane of the ellipse.
1461 # @param theRMajor Major ellipse radius.
1462 # @param theRMinor Minor ellipse radius.
1463 # @param theVecMaj Vector, direction of the ellipse's main axis.
1464 # @return New GEOM.GEOM_Object, containing the created ellipse.
1466 # @ref tui_creation_ellipse "Example"
1467 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1469 Create an ellipse with given center, normal vector and radiuses.
1472 thePnt Ellipse center.
1473 theVec Vector, normal to the plane of the ellipse.
1474 theRMajor Major ellipse radius.
1475 theRMinor Minor ellipse radius.
1476 theVecMaj Vector, direction of the ellipse's main axis.
1479 New GEOM.GEOM_Object, containing the created ellipse.
1481 # Example: see GEOM_TestAll.py
1482 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1483 if theVecMaj is not None:
1484 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1486 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1488 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1489 anObj.SetParameters(Parameters)
1492 ## Create an ellipse with given radiuses.
1493 # Center of the ellipse will be in the origin of global
1494 # coordinate system and normal vector will be codirected with Z axis
1495 # @param theRMajor Major ellipse radius.
1496 # @param theRMinor Minor ellipse radius.
1497 # @return New GEOM.GEOM_Object, containing the created ellipse.
1498 def MakeEllipseRR(self, theRMajor, theRMinor):
1500 Create an ellipse with given radiuses.
1501 Center of the ellipse will be in the origin of global
1502 coordinate system and normal vector will be codirected with Z axis
1505 theRMajor Major ellipse radius.
1506 theRMinor Minor ellipse radius.
1509 New GEOM.GEOM_Object, containing the created ellipse.
1511 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1512 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1515 ## Create a polyline on the set of points.
1516 # @param thePoints Sequence of points for the polyline.
1517 # @param theIsClosed If True, build a closed wire.
1518 # @return New GEOM.GEOM_Object, containing the created polyline.
1520 # @ref tui_creation_curve "Example"
1521 def MakePolyline(self, thePoints, theIsClosed=False):
1523 Create a polyline on the set of points.
1526 thePoints Sequence of points for the polyline.
1527 theIsClosed If True, build a closed wire.
1530 New GEOM.GEOM_Object, containing the created polyline.
1532 # Example: see GEOM_TestAll.py
1533 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1534 RaiseIfFailed("MakePolyline", self.CurvesOp)
1537 ## Create bezier curve on the set of points.
1538 # @param thePoints Sequence of points for the bezier curve.
1539 # @param theIsClosed If True, build a closed curve.
1540 # @return New GEOM.GEOM_Object, containing the created bezier curve.
1542 # @ref tui_creation_curve "Example"
1543 def MakeBezier(self, thePoints, theIsClosed=False):
1545 Create bezier curve on the set of points.
1548 thePoints Sequence of points for the bezier curve.
1549 theIsClosed If True, build a closed curve.
1552 New GEOM.GEOM_Object, containing the created bezier curve.
1554 # Example: see GEOM_TestAll.py
1555 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1556 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1559 ## Create B-Spline curve on the set of points.
1560 # @param thePoints Sequence of points for the B-Spline curve.
1561 # @param theIsClosed If True, build a closed curve.
1562 # @param theDoReordering If TRUE, the algo does not follow the order of
1563 # \a thePoints but searches for the closest vertex.
1564 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1566 # @ref tui_creation_curve "Example"
1567 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1569 Create B-Spline curve on the set of points.
1572 thePoints Sequence of points for the B-Spline curve.
1573 theIsClosed If True, build a closed curve.
1574 theDoReordering If True, the algo does not follow the order of
1575 thePoints but searches for the closest vertex.
1578 New GEOM.GEOM_Object, containing the created B-Spline curve.
1580 # Example: see GEOM_TestAll.py
1581 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1582 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1586 ## Creates a curve using the parametric definition of the basic points.
1587 # @param thexExpr parametric equation of the coordinates X.
1588 # @param theyExpr parametric equation of the coordinates Y.
1589 # @param thezExpr parametric equation of the coordinates Z.
1590 # @param theParamMin the minimal value of the parameter.
1591 # @param theParamMax the maximum value of the parameter.
1592 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1593 # @param theCurveType the type of the curve.
1594 # @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.
1595 # @return New GEOM.GEOM_Object, containing the created curve.
1597 # @ref tui_creation_curve "Example"
1598 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1599 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1601 Creates a curve using the parametric definition of the basic points.
1604 thexExpr parametric equation of the coordinates X.
1605 theyExpr parametric equation of the coordinates Y.
1606 thezExpr parametric equation of the coordinates Z.
1607 theParamMin the minimal value of the parameter.
1608 theParamMax the maximum value of the parameter.
1609 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1610 theCurveType the type of the curve.
1611 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1612 method is used which can lead to a bug.
1615 New GEOM.GEOM_Object, containing the created curve.
1617 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1619 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1621 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1622 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1623 anObj.SetParameters(Parameters)
1631 ## @addtogroup l3_sketcher
1634 ## Create a sketcher (wire or face), following the textual description,
1635 # passed through <VAR>theCommand</VAR> argument. \n
1636 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1637 # Format of the description string have to be the following:
1639 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1642 # - x1, y1 are coordinates of the first sketcher point (zero by default),
1644 # - "R angle" : Set the direction by angle
1645 # - "D dx dy" : Set the direction by DX & DY
1648 # - "TT x y" : Create segment by point at X & Y
1649 # - "T dx dy" : Create segment by point with DX & DY
1650 # - "L length" : Create segment by direction & Length
1651 # - "IX x" : Create segment by direction & Intersect. X
1652 # - "IY y" : Create segment by direction & Intersect. Y
1655 # - "C radius length" : Create arc by direction, radius and length(in degree)
1656 # - "AA x y": Create arc by point at X & Y
1657 # - "A dx dy" : Create arc by point with DX & DY
1658 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1659 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1660 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1661 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1664 # - "WW" : Close Wire (to finish)
1665 # - "WF" : Close Wire and build face (to finish)
1668 # - Flag1 (= reverse) is 0 or 2 ...
1669 # - if 0 the drawn arc is the one of lower angle (< Pi)
1670 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1673 # - Flag2 (= control tolerance) is 0 or 1 ...
1674 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1675 # - if 1 the wire is built only if the end point is on the arc
1676 # with a tolerance of 10^-7 on the distance else the creation fails
1678 # @param theCommand String, defining the sketcher in local
1679 # coordinates of the working plane.
1680 # @param theWorkingPlane Nine double values, defining origin,
1681 # OZ and OX directions of the working plane.
1682 # @return New GEOM.GEOM_Object, containing the created wire.
1684 # @ref tui_sketcher_page "Example"
1685 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1687 Create a sketcher (wire or face), following the textual description, passed
1688 through theCommand argument.
1689 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1690 Format of the description string have to be the following:
1691 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1693 - x1, y1 are coordinates of the first sketcher point (zero by default),
1695 - "R angle" : Set the direction by angle
1696 - "D dx dy" : Set the direction by DX & DY
1698 - "TT x y" : Create segment by point at X & Y
1699 - "T dx dy" : Create segment by point with DX & DY
1700 - "L length" : Create segment by direction & Length
1701 - "IX x" : Create segment by direction & Intersect. X
1702 - "IY y" : Create segment by direction & Intersect. Y
1704 - "C radius length" : Create arc by direction, radius and length(in degree)
1705 - "AA x y": Create arc by point at X & Y
1706 - "A dx dy" : Create arc by point with DX & DY
1707 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1708 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1709 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1710 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1712 - "WW" : Close Wire (to finish)
1713 - "WF" : Close Wire and build face (to finish)
1715 - Flag1 (= reverse) is 0 or 2 ...
1716 - if 0 the drawn arc is the one of lower angle (< Pi)
1717 - if 2 the drawn arc ius the one of greater angle (> Pi)
1719 - Flag2 (= control tolerance) is 0 or 1 ...
1720 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1721 - if 1 the wire is built only if the end point is on the arc
1722 with a tolerance of 10^-7 on the distance else the creation fails
1725 theCommand String, defining the sketcher in local
1726 coordinates of the working plane.
1727 theWorkingPlane Nine double values, defining origin,
1728 OZ and OX directions of the working plane.
1731 New GEOM.GEOM_Object, containing the created wire.
1733 # Example: see GEOM_TestAll.py
1734 theCommand,Parameters = ParseSketcherCommand(theCommand)
1735 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1736 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1737 anObj.SetParameters(Parameters)
1740 ## Create a sketcher (wire or face), following the textual description,
1741 # passed through <VAR>theCommand</VAR> argument. \n
1742 # For format of the description string see MakeSketcher() method.\n
1743 # @param theCommand String, defining the sketcher in local
1744 # coordinates of the working plane.
1745 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1746 # @return New GEOM.GEOM_Object, containing the created wire.
1748 # @ref tui_sketcher_page "Example"
1749 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1751 Create a sketcher (wire or face), following the textual description,
1752 passed through theCommand argument.
1753 For format of the description string see geompy.MakeSketcher() method.
1756 theCommand String, defining the sketcher in local
1757 coordinates of the working plane.
1758 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1761 New GEOM.GEOM_Object, containing the created wire.
1763 theCommand,Parameters = ParseSketcherCommand(theCommand)
1764 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1765 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1766 anObj.SetParameters(Parameters)
1769 ## Create a sketcher wire, following the numerical description,
1770 # passed through <VAR>theCoordinates</VAR> argument. \n
1771 # @param theCoordinates double values, defining points to create a wire,
1773 # @return New GEOM.GEOM_Object, containing the created wire.
1775 # @ref tui_3dsketcher_page "Example"
1776 def Make3DSketcher(self, theCoordinates):
1778 Create a sketcher wire, following the numerical description,
1779 passed through theCoordinates argument.
1782 theCoordinates double values, defining points to create a wire,
1786 New GEOM_Object, containing the created wire.
1788 theCoordinates,Parameters = ParseParameters(theCoordinates)
1789 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1790 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1791 anObj.SetParameters(Parameters)
1794 ## Obtain a 3D sketcher interface
1795 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
1797 # @ref tui_3dsketcher_page "Example"
1798 def Sketcher3D (self):
1800 Obtain a 3D sketcher interface.
1803 sk = geompy.Sketcher3D()
1804 sk.addPointsAbsolute(0,0,0, 70,0,0)
1805 sk.addPointsRelative(0, 0, 130)
1806 sk.addPointAnglesLength("OXY", 50, 0, 100)
1807 sk.addPointAnglesLength("OXZ", 30, 80, 130)
1809 a3D_Sketcher_1 = sk.wire()
1811 sk = Sketcher3D (self)
1814 # end of l3_sketcher
1817 ## @addtogroup l3_3d_primitives
1820 ## Create a box by coordinates of two opposite vertices.
1822 # @param x1,y1,z1 double values, defining first point it.
1823 # @param x2,y2,z2 double values, defining first point it.
1825 # @return New GEOM.GEOM_Object, containing the created box.
1826 # @ref tui_creation_box "Example"
1827 def MakeBox (self, x1,y1,z1, x2,y2,z2):
1829 Create a box by coordinates of two opposite vertices.
1832 x1,y1,z1 double values, defining first point.
1833 x2,y2,z2 double values, defining second point.
1836 New GEOM.GEOM_Object, containing the created box.
1838 # Example: see GEOM_TestAll.py
1839 pnt1 = self.MakeVertex(x1,y1,z1)
1840 pnt2 = self.MakeVertex(x2,y2,z2)
1841 return self.MakeBoxTwoPnt(pnt1,pnt2)
1843 ## Create a box with specified dimensions along the coordinate axes
1844 # and with edges, parallel to the coordinate axes.
1845 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1846 # @param theDX Length of Box edges, parallel to OX axis.
1847 # @param theDY Length of Box edges, parallel to OY axis.
1848 # @param theDZ Length of Box edges, parallel to OZ axis.
1849 # @return New GEOM.GEOM_Object, containing the created box.
1851 # @ref tui_creation_box "Example"
1852 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1854 Create a box with specified dimensions along the coordinate axes
1855 and with edges, parallel to the coordinate axes.
1856 Center of the box will be at point (DX/2, DY/2, DZ/2).
1859 theDX Length of Box edges, parallel to OX axis.
1860 theDY Length of Box edges, parallel to OY axis.
1861 theDZ Length of Box edges, parallel to OZ axis.
1864 New GEOM.GEOM_Object, containing the created box.
1866 # Example: see GEOM_TestAll.py
1867 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1868 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1869 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1870 anObj.SetParameters(Parameters)
1873 ## Create a box with two specified opposite vertices,
1874 # and with edges, parallel to the coordinate axes
1875 # @param thePnt1 First of two opposite vertices.
1876 # @param thePnt2 Second of two opposite vertices.
1877 # @return New GEOM.GEOM_Object, containing the created box.
1879 # @ref tui_creation_box "Example"
1880 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1882 Create a box with two specified opposite vertices,
1883 and with edges, parallel to the coordinate axes
1886 thePnt1 First of two opposite vertices.
1887 thePnt2 Second of two opposite vertices.
1890 New GEOM.GEOM_Object, containing the created box.
1892 # Example: see GEOM_TestAll.py
1893 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1894 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1897 ## Create a face with specified dimensions with edges parallel to coordinate axes.
1898 # @param theH height of Face.
1899 # @param theW width of Face.
1900 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1901 # @return New GEOM.GEOM_Object, containing the created face.
1903 # @ref tui_creation_face "Example"
1904 def MakeFaceHW(self,theH, theW, theOrientation):
1906 Create a face with specified dimensions with edges parallel to coordinate axes.
1909 theH height of Face.
1911 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1914 New GEOM.GEOM_Object, containing the created face.
1916 # Example: see GEOM_TestAll.py
1917 theH,theW,Parameters = ParseParameters(theH, theW)
1918 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1919 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1920 anObj.SetParameters(Parameters)
1923 ## Create a face from another plane and two sizes,
1924 # vertical size and horisontal size.
1925 # @param theObj Normale vector to the creating face or
1927 # @param theH Height (vertical size).
1928 # @param theW Width (horisontal size).
1929 # @return New GEOM.GEOM_Object, containing the created face.
1931 # @ref tui_creation_face "Example"
1932 def MakeFaceObjHW(self, theObj, theH, theW):
1934 Create a face from another plane and two sizes,
1935 vertical size and horisontal size.
1938 theObj Normale vector to the creating face or
1940 theH Height (vertical size).
1941 theW Width (horisontal size).
1944 New GEOM_Object, containing the created face.
1946 # Example: see GEOM_TestAll.py
1947 theH,theW,Parameters = ParseParameters(theH, theW)
1948 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1949 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1950 anObj.SetParameters(Parameters)
1953 ## Create a disk with given center, normal vector and radius.
1954 # @param thePnt Disk center.
1955 # @param theVec Vector, normal to the plane of the disk.
1956 # @param theR Disk radius.
1957 # @return New GEOM.GEOM_Object, containing the created disk.
1959 # @ref tui_creation_disk "Example"
1960 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1962 Create a disk with given center, normal vector and radius.
1966 theVec Vector, normal to the plane of the disk.
1970 New GEOM.GEOM_Object, containing the created disk.
1972 # Example: see GEOM_TestAll.py
1973 theR,Parameters = ParseParameters(theR)
1974 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1975 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1976 anObj.SetParameters(Parameters)
1979 ## Create a disk, passing through three given points
1980 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1981 # @return New GEOM.GEOM_Object, containing the created disk.
1983 # @ref tui_creation_disk "Example"
1984 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1986 Create a disk, passing through three given points
1989 thePnt1,thePnt2,thePnt3 Points, defining the disk.
1992 New GEOM.GEOM_Object, containing the created disk.
1994 # Example: see GEOM_TestAll.py
1995 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1996 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1999 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2000 # @param theR Radius of Face.
2001 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2002 # @return New GEOM.GEOM_Object, containing the created disk.
2004 # @ref tui_creation_face "Example"
2005 def MakeDiskR(self,theR, theOrientation):
2007 Create a disk with specified dimensions along OX-OY coordinate axes.
2010 theR Radius of Face.
2011 theOrientation set the orientation belong axis OXY or OYZ or OZX
2014 New GEOM.GEOM_Object, containing the created disk.
2017 Disk3 = geompy.MakeDiskR(100., 1)
2019 # Example: see GEOM_TestAll.py
2020 theR,Parameters = ParseParameters(theR)
2021 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2022 RaiseIfFailed("MakeDiskR", self.PrimOp)
2023 anObj.SetParameters(Parameters)
2026 ## Create a cylinder with given base point, axis, radius and height.
2027 # @param thePnt Central point of cylinder base.
2028 # @param theAxis Cylinder axis.
2029 # @param theR Cylinder radius.
2030 # @param theH Cylinder height.
2031 # @return New GEOM.GEOM_Object, containing the created cylinder.
2033 # @ref tui_creation_cylinder "Example"
2034 def MakeCylinder(self,thePnt, theAxis, theR, theH):
2036 Create a cylinder with given base point, axis, radius and height.
2039 thePnt Central point of cylinder base.
2040 theAxis Cylinder axis.
2041 theR Cylinder radius.
2042 theH Cylinder height.
2045 New GEOM.GEOM_Object, containing the created cylinder.
2047 # Example: see GEOM_TestAll.py
2048 theR,theH,Parameters = ParseParameters(theR, theH)
2049 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2050 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2051 anObj.SetParameters(Parameters)
2054 ## Create a cylinder with given radius and height at
2055 # the origin of coordinate system. Axis of the cylinder
2056 # will be collinear to the OZ axis of the coordinate system.
2057 # @param theR Cylinder radius.
2058 # @param theH Cylinder height.
2059 # @return New GEOM.GEOM_Object, containing the created cylinder.
2061 # @ref tui_creation_cylinder "Example"
2062 def MakeCylinderRH(self,theR, theH):
2064 Create a cylinder with given radius and height at
2065 the origin of coordinate system. Axis of the cylinder
2066 will be collinear to the OZ axis of the coordinate system.
2069 theR Cylinder radius.
2070 theH Cylinder height.
2073 New GEOM.GEOM_Object, containing the created cylinder.
2075 # Example: see GEOM_TestAll.py
2076 theR,theH,Parameters = ParseParameters(theR, theH)
2077 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2078 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2079 anObj.SetParameters(Parameters)
2082 ## Create a sphere with given center and radius.
2083 # @param thePnt Sphere center.
2084 # @param theR Sphere radius.
2085 # @return New GEOM.GEOM_Object, containing the created sphere.
2087 # @ref tui_creation_sphere "Example"
2088 def MakeSpherePntR(self, thePnt, theR):
2090 Create a sphere with given center and radius.
2093 thePnt Sphere center.
2097 New GEOM.GEOM_Object, containing the created sphere.
2099 # Example: see GEOM_TestAll.py
2100 theR,Parameters = ParseParameters(theR)
2101 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2102 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2103 anObj.SetParameters(Parameters)
2106 ## Create a sphere with given center and radius.
2107 # @param x,y,z Coordinates of sphere center.
2108 # @param theR Sphere radius.
2109 # @return New GEOM.GEOM_Object, containing the created sphere.
2111 # @ref tui_creation_sphere "Example"
2112 def MakeSphere(self, x, y, z, theR):
2114 Create a sphere with given center and radius.
2117 x,y,z Coordinates of sphere center.
2121 New GEOM.GEOM_Object, containing the created sphere.
2123 # Example: see GEOM_TestAll.py
2124 point = self.MakeVertex(x, y, z)
2125 anObj = self.MakeSpherePntR(point, theR)
2128 ## Create a sphere with given radius at the origin of coordinate system.
2129 # @param theR Sphere radius.
2130 # @return New GEOM.GEOM_Object, containing the created sphere.
2132 # @ref tui_creation_sphere "Example"
2133 def MakeSphereR(self, theR):
2135 Create a sphere with given radius at the origin of coordinate system.
2141 New GEOM.GEOM_Object, containing the created sphere.
2143 # Example: see GEOM_TestAll.py
2144 theR,Parameters = ParseParameters(theR)
2145 anObj = self.PrimOp.MakeSphereR(theR)
2146 RaiseIfFailed("MakeSphereR", self.PrimOp)
2147 anObj.SetParameters(Parameters)
2150 ## Create a cone with given base point, axis, height and radiuses.
2151 # @param thePnt Central point of the first cone base.
2152 # @param theAxis Cone axis.
2153 # @param theR1 Radius of the first cone base.
2154 # @param theR2 Radius of the second cone base.
2155 # \note If both radiuses are non-zero, the cone will be truncated.
2156 # \note If the radiuses are equal, a cylinder will be created instead.
2157 # @param theH Cone height.
2158 # @return New GEOM.GEOM_Object, containing the created cone.
2160 # @ref tui_creation_cone "Example"
2161 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2163 Create a cone with given base point, axis, height and radiuses.
2166 thePnt Central point of the first cone base.
2168 theR1 Radius of the first cone base.
2169 theR2 Radius of the second cone base.
2173 If both radiuses are non-zero, the cone will be truncated.
2174 If the radiuses are equal, a cylinder will be created instead.
2177 New GEOM.GEOM_Object, containing the created cone.
2179 # Example: see GEOM_TestAll.py
2180 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2181 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2182 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2183 anObj.SetParameters(Parameters)
2186 ## Create a cone with given height and radiuses at
2187 # the origin of coordinate system. Axis of the cone will
2188 # be collinear to the OZ axis of the coordinate system.
2189 # @param theR1 Radius of the first cone base.
2190 # @param theR2 Radius of the second cone base.
2191 # \note If both radiuses are non-zero, the cone will be truncated.
2192 # \note If the radiuses are equal, a cylinder will be created instead.
2193 # @param theH Cone height.
2194 # @return New GEOM.GEOM_Object, containing the created cone.
2196 # @ref tui_creation_cone "Example"
2197 def MakeConeR1R2H(self,theR1, theR2, theH):
2199 Create a cone with given height and radiuses at
2200 the origin of coordinate system. Axis of the cone will
2201 be collinear to the OZ axis of the coordinate system.
2204 theR1 Radius of the first cone base.
2205 theR2 Radius of the second cone base.
2209 If both radiuses are non-zero, the cone will be truncated.
2210 If the radiuses are equal, a cylinder will be created instead.
2213 New GEOM.GEOM_Object, containing the created cone.
2215 # Example: see GEOM_TestAll.py
2216 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2217 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2218 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2219 anObj.SetParameters(Parameters)
2222 ## Create a torus with given center, normal vector and radiuses.
2223 # @param thePnt Torus central point.
2224 # @param theVec Torus axis of symmetry.
2225 # @param theRMajor Torus major radius.
2226 # @param theRMinor Torus minor radius.
2227 # @return New GEOM.GEOM_Object, containing the created torus.
2229 # @ref tui_creation_torus "Example"
2230 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2232 Create a torus with given center, normal vector and radiuses.
2235 thePnt Torus central point.
2236 theVec Torus axis of symmetry.
2237 theRMajor Torus major radius.
2238 theRMinor Torus minor radius.
2241 New GEOM.GEOM_Object, containing the created torus.
2243 # Example: see GEOM_TestAll.py
2244 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2245 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2246 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2247 anObj.SetParameters(Parameters)
2250 ## Create a torus with given radiuses at the origin of coordinate system.
2251 # @param theRMajor Torus major radius.
2252 # @param theRMinor Torus minor radius.
2253 # @return New GEOM.GEOM_Object, containing the created torus.
2255 # @ref tui_creation_torus "Example"
2256 def MakeTorusRR(self, theRMajor, theRMinor):
2258 Create a torus with given radiuses at the origin of coordinate system.
2261 theRMajor Torus major radius.
2262 theRMinor Torus minor radius.
2265 New GEOM.GEOM_Object, containing the created torus.
2267 # Example: see GEOM_TestAll.py
2268 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2269 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2270 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2271 anObj.SetParameters(Parameters)
2274 # end of l3_3d_primitives
2277 ## @addtogroup l3_complex
2280 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2281 # @param theBase Base shape to be extruded.
2282 # @param thePoint1 First end of extrusion vector.
2283 # @param thePoint2 Second end of extrusion vector.
2284 # @param theScaleFactor Use it to make prism with scaled second base.
2285 # Nagative value means not scaled second base.
2286 # @return New GEOM.GEOM_Object, containing the created prism.
2288 # @ref tui_creation_prism "Example"
2289 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2291 Create a shape by extrusion of the base shape along a vector, defined by two points.
2294 theBase Base shape to be extruded.
2295 thePoint1 First end of extrusion vector.
2296 thePoint2 Second end of extrusion vector.
2297 theScaleFactor Use it to make prism with scaled second base.
2298 Nagative value means not scaled second base.
2301 New GEOM.GEOM_Object, containing the created prism.
2303 # Example: see GEOM_TestAll.py
2306 if theScaleFactor > 0:
2307 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2308 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2310 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2311 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2312 anObj.SetParameters(Parameters)
2315 ## Create a shape by extrusion of the base shape along a
2316 # vector, defined by two points, in 2 Ways (forward/backward).
2317 # @param theBase Base shape to be extruded.
2318 # @param thePoint1 First end of extrusion vector.
2319 # @param thePoint2 Second end of extrusion vector.
2320 # @return New GEOM.GEOM_Object, containing the created prism.
2322 # @ref tui_creation_prism "Example"
2323 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2325 Create a shape by extrusion of the base shape along a
2326 vector, defined by two points, in 2 Ways (forward/backward).
2329 theBase Base shape to be extruded.
2330 thePoint1 First end of extrusion vector.
2331 thePoint2 Second end of extrusion vector.
2334 New GEOM.GEOM_Object, containing the created prism.
2336 # Example: see GEOM_TestAll.py
2337 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2338 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2341 ## Create a shape by extrusion of the base shape along the vector,
2342 # i.e. all the space, transfixed by the base shape during its translation
2343 # along the vector on the given distance.
2344 # @param theBase Base shape to be extruded.
2345 # @param theVec Direction of extrusion.
2346 # @param theH Prism dimension along theVec.
2347 # @param theScaleFactor Use it to make prism with scaled second base.
2348 # Negative value means not scaled second base.
2349 # @return New GEOM.GEOM_Object, containing the created prism.
2351 # @ref tui_creation_prism "Example"
2352 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2354 Create a shape by extrusion of the base shape along the vector,
2355 i.e. all the space, transfixed by the base shape during its translation
2356 along the vector on the given distance.
2359 theBase Base shape to be extruded.
2360 theVec Direction of extrusion.
2361 theH Prism dimension along theVec.
2362 theScaleFactor Use it to make prism with scaled second base.
2363 Negative value means not scaled second base.
2366 New GEOM.GEOM_Object, containing the created prism.
2368 # Example: see GEOM_TestAll.py
2371 if theScaleFactor > 0:
2372 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2373 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2375 theH,Parameters = ParseParameters(theH)
2376 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2377 RaiseIfFailed("MakePrismVecH", self.PrimOp)
2378 anObj.SetParameters(Parameters)
2381 ## Create a shape by extrusion of the base shape along the vector,
2382 # i.e. all the space, transfixed by the base shape during its translation
2383 # along the vector on the given distance in 2 Ways (forward/backward).
2384 # @param theBase Base shape to be extruded.
2385 # @param theVec Direction of extrusion.
2386 # @param theH Prism dimension along theVec in forward direction.
2387 # @return New GEOM.GEOM_Object, containing the created prism.
2389 # @ref tui_creation_prism "Example"
2390 def MakePrismVecH2Ways(self, theBase, theVec, theH):
2392 Create a shape by extrusion of the base shape along the vector,
2393 i.e. all the space, transfixed by the base shape during its translation
2394 along the vector on the given distance in 2 Ways (forward/backward).
2397 theBase Base shape to be extruded.
2398 theVec Direction of extrusion.
2399 theH Prism dimension along theVec in forward direction.
2402 New GEOM.GEOM_Object, containing the created prism.
2404 # Example: see GEOM_TestAll.py
2405 theH,Parameters = ParseParameters(theH)
2406 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2407 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2408 anObj.SetParameters(Parameters)
2411 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2412 # @param theBase Base shape to be extruded.
2413 # @param theDX, theDY, theDZ Directions of extrusion.
2414 # @param theScaleFactor Use it to make prism with scaled second base.
2415 # Nagative value means not scaled second base.
2416 # @return New GEOM.GEOM_Object, containing the created prism.
2418 # @ref tui_creation_prism "Example"
2419 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2421 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2424 theBase Base shape to be extruded.
2425 theDX, theDY, theDZ Directions of extrusion.
2426 theScaleFactor Use it to make prism with scaled second base.
2427 Nagative value means not scaled second base.
2430 New GEOM.GEOM_Object, containing the created prism.
2432 # Example: see GEOM_TestAll.py
2435 if theScaleFactor > 0:
2436 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2437 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2439 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2440 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2441 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2442 anObj.SetParameters(Parameters)
2445 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2446 # i.e. all the space, transfixed by the base shape during its translation
2447 # along the vector on the given distance in 2 Ways (forward/backward).
2448 # @param theBase Base shape to be extruded.
2449 # @param theDX, theDY, theDZ Directions of extrusion.
2450 # @return New GEOM.GEOM_Object, containing the created prism.
2452 # @ref tui_creation_prism "Example"
2453 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2455 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2456 i.e. all the space, transfixed by the base shape during its translation
2457 along the vector on the given distance in 2 Ways (forward/backward).
2460 theBase Base shape to be extruded.
2461 theDX, theDY, theDZ Directions of extrusion.
2464 New GEOM.GEOM_Object, containing the created prism.
2466 # Example: see GEOM_TestAll.py
2467 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2468 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2469 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2470 anObj.SetParameters(Parameters)
2473 ## Create a shape by revolution of the base shape around the axis
2474 # on the given angle, i.e. all the space, transfixed by the base
2475 # shape during its rotation around the axis on the given angle.
2476 # @param theBase Base shape to be rotated.
2477 # @param theAxis Rotation axis.
2478 # @param theAngle Rotation angle in radians.
2479 # @return New GEOM.GEOM_Object, containing the created revolution.
2481 # @ref tui_creation_revolution "Example"
2482 def MakeRevolution(self, theBase, theAxis, theAngle):
2484 Create a shape by revolution of the base shape around the axis
2485 on the given angle, i.e. all the space, transfixed by the base
2486 shape during its rotation around the axis on the given angle.
2489 theBase Base shape to be rotated.
2490 theAxis Rotation axis.
2491 theAngle Rotation angle in radians.
2494 New GEOM.GEOM_Object, containing the created revolution.
2496 # Example: see GEOM_TestAll.py
2497 theAngle,Parameters = ParseParameters(theAngle)
2498 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2499 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2500 anObj.SetParameters(Parameters)
2503 ## Create a shape by revolution of the base shape around the axis
2504 # on the given angle, i.e. all the space, transfixed by the base
2505 # shape during its rotation around the axis on the given angle in
2506 # both directions (forward/backward)
2507 # @param theBase Base shape to be rotated.
2508 # @param theAxis Rotation axis.
2509 # @param theAngle Rotation angle in radians.
2510 # @return New GEOM.GEOM_Object, containing the created revolution.
2512 # @ref tui_creation_revolution "Example"
2513 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2515 Create a shape by revolution of the base shape around the axis
2516 on the given angle, i.e. all the space, transfixed by the base
2517 shape during its rotation around the axis on the given angle in
2518 both directions (forward/backward).
2521 theBase Base shape to be rotated.
2522 theAxis Rotation axis.
2523 theAngle Rotation angle in radians.
2526 New GEOM.GEOM_Object, containing the created revolution.
2528 theAngle,Parameters = ParseParameters(theAngle)
2529 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2530 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2531 anObj.SetParameters(Parameters)
2534 ## Create a filling from the given compound of contours.
2535 # @param theShape the compound of contours
2536 # @param theMinDeg a minimal degree of BSpline surface to create
2537 # @param theMaxDeg a maximal degree of BSpline surface to create
2538 # @param theTol2D a 2d tolerance to be reached
2539 # @param theTol3D a 3d tolerance to be reached
2540 # @param theNbIter a number of iteration of approximation algorithm
2541 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2542 # @param isApprox if True, BSpline curves are generated in the process
2543 # of surface construction. By default it is False, that means
2544 # the surface is created using given curves. The usage of
2545 # Approximation makes the algorithm work slower, but allows
2546 # building the surface for rather complex cases.
2547 # @return New GEOM.GEOM_Object, containing the created filling surface.
2549 # @ref tui_creation_filling "Example"
2550 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2551 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2553 Create a filling from the given compound of contours.
2556 theShape the compound of contours
2557 theMinDeg a minimal degree of BSpline surface to create
2558 theMaxDeg a maximal degree of BSpline surface to create
2559 theTol2D a 2d tolerance to be reached
2560 theTol3D a 3d tolerance to be reached
2561 theNbIter a number of iteration of approximation algorithm
2562 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2563 isApprox if True, BSpline curves are generated in the process
2564 of surface construction. By default it is False, that means
2565 the surface is created using given curves. The usage of
2566 Approximation makes the algorithm work slower, but allows
2567 building the surface for rather complex cases
2570 New GEOM.GEOM_Object, containing the created filling surface.
2573 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2575 # Example: see GEOM_TestAll.py
2576 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2577 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2578 theTol2D, theTol3D, theNbIter,
2579 theMethod, isApprox)
2580 RaiseIfFailed("MakeFilling", self.PrimOp)
2581 anObj.SetParameters(Parameters)
2585 ## Create a filling from the given compound of contours.
2586 # This method corresponds to MakeFilling with isApprox=True
2587 # @param theShape the compound of contours
2588 # @param theMinDeg a minimal degree of BSpline surface to create
2589 # @param theMaxDeg a maximal degree of BSpline surface to create
2590 # @param theTol3D a 3d tolerance to be reached
2591 # @return New GEOM.GEOM_Object, containing the created filling surface.
2593 # @ref tui_creation_filling "Example"
2594 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2596 Create a filling from the given compound of contours.
2597 This method corresponds to MakeFilling with isApprox=True
2600 theShape the compound of contours
2601 theMinDeg a minimal degree of BSpline surface to create
2602 theMaxDeg a maximal degree of BSpline surface to create
2603 theTol3D a 3d tolerance to be reached
2606 New GEOM.GEOM_Object, containing the created filling surface.
2609 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2611 # Example: see GEOM_TestAll.py
2612 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2613 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2614 0, theTol3D, 0, GEOM.FOM_Default, True)
2615 RaiseIfFailed("MakeFillingNew", self.PrimOp)
2616 anObj.SetParameters(Parameters)
2619 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2620 # @param theSeqSections - set of specified sections.
2621 # @param theModeSolid - mode defining building solid or shell
2622 # @param thePreci - precision 3D used for smoothing
2623 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2624 # @return New GEOM.GEOM_Object, containing the created shell or solid.
2626 # @ref swig_todo "Example"
2627 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2629 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2632 theSeqSections - set of specified sections.
2633 theModeSolid - mode defining building solid or shell
2634 thePreci - precision 3D used for smoothing
2635 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2638 New GEOM.GEOM_Object, containing the created shell or solid.
2640 # Example: see GEOM_TestAll.py
2641 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2642 RaiseIfFailed("MakeThruSections", self.PrimOp)
2645 ## Create a shape by extrusion of the base shape along
2646 # the path shape. The path shape can be a wire or an edge.
2647 # @param theBase Base shape to be extruded.
2648 # @param thePath Path shape to extrude the base shape along it.
2649 # @return New GEOM.GEOM_Object, containing the created pipe.
2651 # @ref tui_creation_pipe "Example"
2652 def MakePipe(self,theBase, thePath):
2654 Create a shape by extrusion of the base shape along
2655 the path shape. The path shape can be a wire or an edge.
2658 theBase Base shape to be extruded.
2659 thePath Path shape to extrude the base shape along it.
2662 New GEOM.GEOM_Object, containing the created pipe.
2664 # Example: see GEOM_TestAll.py
2665 anObj = self.PrimOp.MakePipe(theBase, thePath)
2666 RaiseIfFailed("MakePipe", self.PrimOp)
2669 ## Create a shape by extrusion of the profile shape along
2670 # the path shape. The path shape can be a wire or an edge.
2671 # the several profiles can be specified in the several locations of path.
2672 # @param theSeqBases - list of Bases shape to be extruded.
2673 # @param theLocations - list of locations on the path corresponding
2674 # specified list of the Bases shapes. Number of locations
2675 # should be equal to number of bases or list of locations can be empty.
2676 # @param thePath - Path shape to extrude the base shape along it.
2677 # @param theWithContact - the mode defining that the section is translated to be in
2678 # contact with the spine.
2679 # @param theWithCorrection - defining that the section is rotated to be
2680 # orthogonal to the spine tangent in the correspondent point
2681 # @return New GEOM.GEOM_Object, containing the created pipe.
2683 # @ref tui_creation_pipe_with_diff_sec "Example"
2684 def MakePipeWithDifferentSections(self, theSeqBases,
2685 theLocations, thePath,
2686 theWithContact, theWithCorrection):
2688 Create a shape by extrusion of the profile shape along
2689 the path shape. The path shape can be a wire or an edge.
2690 the several profiles can be specified in the several locations of path.
2693 theSeqBases - list of Bases shape to be extruded.
2694 theLocations - list of locations on the path corresponding
2695 specified list of the Bases shapes. Number of locations
2696 should be equal to number of bases or list of locations can be empty.
2697 thePath - Path shape to extrude the base shape along it.
2698 theWithContact - the mode defining that the section is translated to be in
2699 contact with the spine(0/1)
2700 theWithCorrection - defining that the section is rotated to be
2701 orthogonal to the spine tangent in the correspondent point (0/1)
2704 New GEOM.GEOM_Object, containing the created pipe.
2706 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2707 theLocations, thePath,
2708 theWithContact, theWithCorrection)
2709 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2712 ## Create a shape by extrusion of the profile shape along
2713 # the path shape. The path shape can be a wire or a edge.
2714 # the several profiles can be specified in the several locations of path.
2715 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
2716 # shell or face. If number of faces in neighbour sections
2717 # aren't coincided result solid between such sections will
2718 # be created using external boundaries of this shells.
2719 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2720 # This list is used for searching correspondences between
2721 # faces in the sections. Size of this list must be equal
2722 # to size of list of base shapes.
2723 # @param theLocations - list of locations on the path corresponding
2724 # specified list of the Bases shapes. Number of locations
2725 # should be equal to number of bases. First and last
2726 # locations must be coincided with first and last vertexes
2727 # of path correspondingly.
2728 # @param thePath - Path shape to extrude the base shape along it.
2729 # @param theWithContact - the mode defining that the section is translated to be in
2730 # contact with the spine.
2731 # @param theWithCorrection - defining that the section is rotated to be
2732 # orthogonal to the spine tangent in the correspondent point
2733 # @return New GEOM.GEOM_Object, containing the created solids.
2735 # @ref tui_creation_pipe_with_shell_sec "Example"
2736 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2737 theLocations, thePath,
2738 theWithContact, theWithCorrection):
2740 Create a shape by extrusion of the profile shape along
2741 the path shape. The path shape can be a wire or a edge.
2742 the several profiles can be specified in the several locations of path.
2745 theSeqBases - list of Bases shape to be extruded. Base shape must be
2746 shell or face. If number of faces in neighbour sections
2747 aren't coincided result solid between such sections will
2748 be created using external boundaries of this shells.
2749 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2750 This list is used for searching correspondences between
2751 faces in the sections. Size of this list must be equal
2752 to size of list of base shapes.
2753 theLocations - list of locations on the path corresponding
2754 specified list of the Bases shapes. Number of locations
2755 should be equal to number of bases. First and last
2756 locations must be coincided with first and last vertexes
2757 of path correspondingly.
2758 thePath - Path shape to extrude the base shape along it.
2759 theWithContact - the mode defining that the section is translated to be in
2760 contact with the spine (0/1)
2761 theWithCorrection - defining that the section is rotated to be
2762 orthogonal to the spine tangent in the correspondent point (0/1)
2765 New GEOM.GEOM_Object, containing the created solids.
2767 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2768 theLocations, thePath,
2769 theWithContact, theWithCorrection)
2770 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2773 ## Create a shape by extrusion of the profile shape along
2774 # the path shape. This function is used only for debug pipe
2775 # functionality - it is a version of function MakePipeWithShellSections()
2776 # which give a possibility to recieve information about
2777 # creating pipe between each pair of sections step by step.
2778 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2779 theLocations, thePath,
2780 theWithContact, theWithCorrection):
2782 Create a shape by extrusion of the profile shape along
2783 the path shape. This function is used only for debug pipe
2784 functionality - it is a version of previous function
2785 geompy.MakePipeWithShellSections() which give a possibility to
2786 recieve information about creating pipe between each pair of
2787 sections step by step.
2790 nbsect = len(theSeqBases)
2791 nbsubsect = len(theSeqSubBases)
2792 #print "nbsect = ",nbsect
2793 for i in range(1,nbsect):
2795 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2796 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2798 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2799 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2800 tmpLocations, thePath,
2801 theWithContact, theWithCorrection)
2802 if self.PrimOp.IsDone() == 0:
2803 print "Problems with pipe creation between ",i," and ",i+1," sections"
2804 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2807 print "Pipe between ",i," and ",i+1," sections is OK"
2812 resc = self.MakeCompound(res)
2813 #resc = self.MakeSewing(res, 0.001)
2814 #print "resc: ",resc
2817 ## Create solids between given sections
2818 # @param theSeqBases - list of sections (shell or face).
2819 # @param theLocations - list of corresponding vertexes
2820 # @return New GEOM.GEOM_Object, containing the created solids.
2822 # @ref tui_creation_pipe_without_path "Example"
2823 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2825 Create solids between given sections
2828 theSeqBases - list of sections (shell or face).
2829 theLocations - list of corresponding vertexes
2832 New GEOM.GEOM_Object, containing the created solids.
2834 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2835 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2838 ## Create a shape by extrusion of the base shape along
2839 # the path shape with constant bi-normal direction along the given vector.
2840 # The path shape can be a wire or an edge.
2841 # @param theBase Base shape to be extruded.
2842 # @param thePath Path shape to extrude the base shape along it.
2843 # @param theVec Vector defines a constant binormal direction to keep the
2844 # same angle beetween the direction and the sections
2845 # along the sweep surface.
2846 # @return New GEOM.GEOM_Object, containing the created pipe.
2848 # @ref tui_creation_pipe "Example"
2849 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2851 Create a shape by extrusion of the base shape along
2852 the path shape with constant bi-normal direction along the given vector.
2853 The path shape can be a wire or an edge.
2856 theBase Base shape to be extruded.
2857 thePath Path shape to extrude the base shape along it.
2858 theVec Vector defines a constant binormal direction to keep the
2859 same angle beetween the direction and the sections
2860 along the sweep surface.
2863 New GEOM.GEOM_Object, containing the created pipe.
2865 # Example: see GEOM_TestAll.py
2866 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2867 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2873 ## @addtogroup l3_advanced
2876 ## Create a linear edge with specified ends.
2877 # @param thePnt1 Point for the first end of edge.
2878 # @param thePnt2 Point for the second end of edge.
2879 # @return New GEOM.GEOM_Object, containing the created edge.
2881 # @ref tui_creation_edge "Example"
2882 def MakeEdge(self,thePnt1, thePnt2):
2884 Create a linear edge with specified ends.
2887 thePnt1 Point for the first end of edge.
2888 thePnt2 Point for the second end of edge.
2891 New GEOM.GEOM_Object, containing the created edge.
2893 # Example: see GEOM_TestAll.py
2894 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2895 RaiseIfFailed("MakeEdge", self.ShapesOp)
2898 ## Create a new edge, corresponding to the given length on the given curve.
2899 # @param theRefCurve The referenced curve (edge).
2900 # @param theLength Length on the referenced curve. It can be negative.
2901 # @param theStartPoint Any point can be selected for it, the new edge will begin
2902 # at the end of \a theRefCurve, close to the selected point.
2903 # If None, start from the first point of \a theRefCurve.
2904 # @return New GEOM.GEOM_Object, containing the created edge.
2906 # @ref tui_creation_edge "Example"
2907 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2909 Create a new edge, corresponding to the given length on the given curve.
2912 theRefCurve The referenced curve (edge).
2913 theLength Length on the referenced curve. It can be negative.
2914 theStartPoint Any point can be selected for it, the new edge will begin
2915 at the end of theRefCurve, close to the selected point.
2916 If None, start from the first point of theRefCurve.
2919 New GEOM.GEOM_Object, containing the created edge.
2921 # Example: see GEOM_TestAll.py
2922 theLength, Parameters = ParseParameters(theLength)
2923 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2924 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2925 anObj.SetParameters(Parameters)
2928 ## Create an edge from specified wire.
2929 # @param theWire source Wire
2930 # @param theLinearTolerance linear tolerance value (default = 1e-07)
2931 # @param theAngularTolerance angular tolerance value (default = 1e-12)
2932 # @return New GEOM.GEOM_Object, containing the created edge.
2934 # @ref tui_creation_edge "Example"
2935 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
2937 Create an edge from specified wire.
2941 theLinearTolerance linear tolerance value (default = 1e-07)
2942 theAngularTolerance angular tolerance value (default = 1e-12)
2945 New GEOM.GEOM_Object, containing the created edge.
2947 # Example: see GEOM_TestAll.py
2948 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
2949 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
2952 ## Create a wire from the set of edges and wires.
2953 # @param theEdgesAndWires List of edges and/or wires.
2954 # @param theTolerance Maximum distance between vertices, that will be merged.
2955 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
2956 # @return New GEOM.GEOM_Object, containing the created wire.
2958 # @ref tui_creation_wire "Example"
2959 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
2961 Create a wire from the set of edges and wires.
2964 theEdgesAndWires List of edges and/or wires.
2965 theTolerance Maximum distance between vertices, that will be merged.
2966 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
2969 New GEOM.GEOM_Object, containing the created wire.
2971 # Example: see GEOM_TestAll.py
2972 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
2973 RaiseIfFailed("MakeWire", self.ShapesOp)
2976 ## Create a face on the given wire.
2977 # @param theWire closed Wire or Edge to build the face on.
2978 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2979 # If the tolerance of the obtained planar face is less
2980 # than 1e-06, this face will be returned, otherwise the
2981 # algorithm tries to build any suitable face on the given
2982 # wire and prints a warning message.
2983 # @return New GEOM.GEOM_Object, containing the created face.
2985 # @ref tui_creation_face "Example"
2986 def MakeFace(self, theWire, isPlanarWanted):
2988 Create a face on the given wire.
2991 theWire closed Wire or Edge to build the face on.
2992 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2993 If the tolerance of the obtained planar face is less
2994 than 1e-06, this face will be returned, otherwise the
2995 algorithm tries to build any suitable face on the given
2996 wire and prints a warning message.
2999 New GEOM.GEOM_Object, containing the created face.
3001 # Example: see GEOM_TestAll.py
3002 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
3003 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3004 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3006 RaiseIfFailed("MakeFace", self.ShapesOp)
3009 ## Create a face on the given wires set.
3010 # @param theWires List of closed wires or edges to build the face on.
3011 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3012 # If the tolerance of the obtained planar face is less
3013 # than 1e-06, this face will be returned, otherwise the
3014 # algorithm tries to build any suitable face on the given
3015 # wire and prints a warning message.
3016 # @return New GEOM.GEOM_Object, containing the created face.
3018 # @ref tui_creation_face "Example"
3019 def MakeFaceWires(self, theWires, isPlanarWanted):
3021 Create a face on the given wires set.
3024 theWires List of closed wires or edges to build the face on.
3025 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3026 If the tolerance of the obtained planar face is less
3027 than 1e-06, this face will be returned, otherwise the
3028 algorithm tries to build any suitable face on the given
3029 wire and prints a warning message.
3032 New GEOM.GEOM_Object, containing the created face.
3034 # Example: see GEOM_TestAll.py
3035 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
3036 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3037 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3039 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
3042 ## See MakeFaceWires() method for details.
3044 # @ref tui_creation_face "Example 1"
3045 # \n @ref swig_MakeFaces "Example 2"
3046 def MakeFaces(self, theWires, isPlanarWanted):
3048 See geompy.MakeFaceWires() method for details.
3050 # Example: see GEOM_TestOthers.py
3051 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3054 ## Create a shell from the set of faces and shells.
3055 # @param theFacesAndShells List of faces and/or shells.
3056 # @return New GEOM.GEOM_Object, containing the created shell.
3058 # @ref tui_creation_shell "Example"
3059 def MakeShell(self,theFacesAndShells):
3061 Create a shell from the set of faces and shells.
3064 theFacesAndShells List of faces and/or shells.
3067 New GEOM.GEOM_Object, containing the created shell.
3069 # Example: see GEOM_TestAll.py
3070 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3071 RaiseIfFailed("MakeShell", self.ShapesOp)
3074 ## Create a solid, bounded by the given shells.
3075 # @param theShells Sequence of bounding shells.
3076 # @return New GEOM.GEOM_Object, containing the created solid.
3078 # @ref tui_creation_solid "Example"
3079 def MakeSolid(self, theShells):
3081 Create a solid, bounded by the given shells.
3084 theShells Sequence of bounding shells.
3087 New GEOM.GEOM_Object, containing the created solid.
3089 # Example: see GEOM_TestAll.py
3090 if len(theShells) == 1:
3091 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3093 # raise RuntimeError, "MakeSolidShells : " + descr
3094 if descr == "WRN_SHAPE_UNCLOSED":
3095 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3096 anObj = self.ShapesOp.MakeSolidShells(theShells)
3097 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3100 ## Create a compound of the given shapes.
3101 # @param theShapes List of shapes to put in compound.
3102 # @return New GEOM.GEOM_Object, containing the created compound.
3104 # @ref tui_creation_compound "Example"
3105 def MakeCompound(self,theShapes):
3107 Create a compound of the given shapes.
3110 theShapes List of shapes to put in compound.
3113 New GEOM.GEOM_Object, containing the created compound.
3115 # Example: see GEOM_TestAll.py
3116 anObj = self.ShapesOp.MakeCompound(theShapes)
3117 RaiseIfFailed("MakeCompound", self.ShapesOp)
3120 # end of l3_advanced
3123 ## @addtogroup l2_measure
3126 ## Gives quantity of faces in the given shape.
3127 # @param theShape Shape to count faces of.
3128 # @return Quantity of faces.
3130 # @ref swig_NumberOf "Example"
3131 def NumberOfFaces(self, theShape):
3133 Gives quantity of faces in the given shape.
3136 theShape Shape to count faces of.
3141 # Example: see GEOM_TestOthers.py
3142 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3143 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3146 ## Gives quantity of edges in the given shape.
3147 # @param theShape Shape to count edges of.
3148 # @return Quantity of edges.
3150 # @ref swig_NumberOf "Example"
3151 def NumberOfEdges(self, theShape):
3153 Gives quantity of edges in the given shape.
3156 theShape Shape to count edges of.
3161 # Example: see GEOM_TestOthers.py
3162 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3163 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3166 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3167 # @param theShape Shape to count sub-shapes of.
3168 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3169 # @return Quantity of sub-shapes of given type.
3171 # @ref swig_NumberOf "Example"
3172 def NumberOfSubShapes(self, theShape, theShapeType):
3174 Gives quantity of sub-shapes of type theShapeType in the given shape.
3177 theShape Shape to count sub-shapes of.
3178 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3181 Quantity of sub-shapes of given type.
3183 # Example: see GEOM_TestOthers.py
3184 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3185 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3188 ## Gives quantity of solids in the given shape.
3189 # @param theShape Shape to count solids in.
3190 # @return Quantity of solids.
3192 # @ref swig_NumberOf "Example"
3193 def NumberOfSolids(self, theShape):
3195 Gives quantity of solids in the given shape.
3198 theShape Shape to count solids in.
3203 # Example: see GEOM_TestOthers.py
3204 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3205 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3211 ## @addtogroup l3_healing
3214 ## Reverses an orientation the given shape.
3215 # @param theShape Shape to be reversed.
3216 # @return The reversed copy of theShape.
3218 # @ref swig_ChangeOrientation "Example"
3219 def ChangeOrientation(self,theShape):
3221 Reverses an orientation the given shape.
3224 theShape Shape to be reversed.
3227 The reversed copy of theShape.
3229 # Example: see GEOM_TestAll.py
3230 anObj = self.ShapesOp.ChangeOrientation(theShape)
3231 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3234 ## See ChangeOrientation() method for details.
3236 # @ref swig_OrientationChange "Example"
3237 def OrientationChange(self,theShape):
3239 See geompy.ChangeOrientation method for details.
3241 # Example: see GEOM_TestOthers.py
3242 anObj = self.ChangeOrientation(theShape)
3248 ## @addtogroup l4_obtain
3251 ## Retrieve all free faces from the given shape.
3252 # Free face is a face, which is not shared between two shells of the shape.
3253 # @param theShape Shape to find free faces in.
3254 # @return List of IDs of all free faces, contained in theShape.
3256 # @ref tui_measurement_tools_page "Example"
3257 def GetFreeFacesIDs(self,theShape):
3259 Retrieve all free faces from the given shape.
3260 Free face is a face, which is not shared between two shells of the shape.
3263 theShape Shape to find free faces in.
3266 List of IDs of all free faces, contained in theShape.
3268 # Example: see GEOM_TestOthers.py
3269 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3270 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3273 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3274 # @param theShape1 Shape to find sub-shapes in.
3275 # @param theShape2 Shape to find shared sub-shapes with.
3276 # @param theShapeType Type of sub-shapes to be retrieved.
3277 # @return List of sub-shapes of theShape1, shared with theShape2.
3279 # @ref swig_GetSharedShapes "Example"
3280 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3282 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3285 theShape1 Shape to find sub-shapes in.
3286 theShape2 Shape to find shared sub-shapes with.
3287 theShapeType Type of sub-shapes to be retrieved.
3290 List of sub-shapes of theShape1, shared with theShape2.
3292 # Example: see GEOM_TestOthers.py
3293 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3294 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3297 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3298 # @param theShapes Shapes to find common sub-shapes of.
3299 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3300 # @return List of objects, that are sub-shapes of all given shapes.
3302 # @ref swig_GetSharedShapes "Example"
3303 def GetSharedShapesMulti(self, theShapes, theShapeType):
3305 Get all sub-shapes, shared by all shapes in the list theShapes.
3308 theShapes Shapes to find common sub-shapes of.
3309 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3312 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3314 # Example: see GEOM_TestOthers.py
3315 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3316 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3319 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3320 # situated relatively the specified plane by the certain way,
3321 # defined through <VAR>theState</VAR> parameter.
3322 # @param theShape Shape to find sub-shapes of.
3323 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3324 # @param theAx1 Vector (or line, or linear edge), specifying normal
3325 # direction and location of the plane to find shapes on.
3326 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3327 # @return List of all found sub-shapes.
3329 # @ref swig_GetShapesOnPlane "Example"
3330 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3332 Find in theShape all sub-shapes of type theShapeType,
3333 situated relatively the specified plane by the certain way,
3334 defined through theState parameter.
3337 theShape Shape to find sub-shapes of.
3338 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3339 theAx1 Vector (or line, or linear edge), specifying normal
3340 direction and location of the plane to find shapes on.
3341 theState The state of the sub-shapes to find (see GEOM::shape_state)
3344 List of all found sub-shapes.
3346 # Example: see GEOM_TestOthers.py
3347 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3348 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3351 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3352 # situated relatively the specified plane by the certain way,
3353 # defined through <VAR>theState</VAR> parameter.
3354 # @param theShape Shape to find sub-shapes of.
3355 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3356 # @param theAx1 Vector (or line, or linear edge), specifying normal
3357 # direction and location of the plane to find shapes on.
3358 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3359 # @return List of all found sub-shapes indices.
3361 # @ref swig_GetShapesOnPlaneIDs "Example"
3362 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3364 Find in theShape all sub-shapes of type theShapeType,
3365 situated relatively the specified plane by the certain way,
3366 defined through theState parameter.
3369 theShape Shape to find sub-shapes of.
3370 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3371 theAx1 Vector (or line, or linear edge), specifying normal
3372 direction and location of the plane to find shapes on.
3373 theState The state of the sub-shapes to find (see GEOM::shape_state)
3376 List of all found sub-shapes indices.
3378 # Example: see GEOM_TestOthers.py
3379 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3380 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3383 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3384 # situated relatively the specified plane by the certain way,
3385 # defined through <VAR>theState</VAR> parameter.
3386 # @param theShape Shape to find sub-shapes of.
3387 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3388 # @param theAx1 Vector (or line, or linear edge), specifying normal
3389 # direction of the plane to find shapes on.
3390 # @param thePnt Point specifying location of the plane to find shapes on.
3391 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3392 # @return List of all found sub-shapes.
3394 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3395 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3397 Find in theShape all sub-shapes of type theShapeType,
3398 situated relatively the specified plane by the certain way,
3399 defined through theState parameter.
3402 theShape Shape to find sub-shapes of.
3403 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3404 theAx1 Vector (or line, or linear edge), specifying normal
3405 direction and location of the plane to find shapes on.
3406 thePnt Point specifying location of the plane to find shapes on.
3407 theState The state of the sub-shapes to find (see GEOM::shape_state)
3410 List of all found sub-shapes.
3412 # Example: see GEOM_TestOthers.py
3413 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3414 theAx1, thePnt, theState)
3415 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3418 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3419 # situated relatively the specified plane by the certain way,
3420 # defined through <VAR>theState</VAR> parameter.
3421 # @param theShape Shape to find sub-shapes of.
3422 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3423 # @param theAx1 Vector (or line, or linear edge), specifying normal
3424 # direction of the plane to find shapes on.
3425 # @param thePnt Point specifying location of the plane to find shapes on.
3426 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3427 # @return List of all found sub-shapes indices.
3429 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3430 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3432 Find in theShape all sub-shapes of type theShapeType,
3433 situated relatively the specified plane by the certain way,
3434 defined through theState parameter.
3437 theShape Shape to find sub-shapes of.
3438 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3439 theAx1 Vector (or line, or linear edge), specifying normal
3440 direction and location of the plane to find shapes on.
3441 thePnt Point specifying location of the plane to find shapes on.
3442 theState The state of the sub-shapes to find (see GEOM::shape_state)
3445 List of all found sub-shapes indices.
3447 # Example: see GEOM_TestOthers.py
3448 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3449 theAx1, thePnt, theState)
3450 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3453 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3454 # the specified cylinder by the certain way, defined through \a theState parameter.
3455 # @param theShape Shape to find sub-shapes of.
3456 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3457 # @param theAxis Vector (or line, or linear edge), specifying
3458 # axis of the cylinder to find shapes on.
3459 # @param theRadius Radius of the cylinder to find shapes on.
3460 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3461 # @return List of all found sub-shapes.
3463 # @ref swig_GetShapesOnCylinder "Example"
3464 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3466 Find in theShape all sub-shapes of type theShapeType, situated relatively
3467 the specified cylinder by the certain way, defined through theState parameter.
3470 theShape Shape to find sub-shapes of.
3471 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3472 theAxis Vector (or line, or linear edge), specifying
3473 axis of the cylinder to find shapes on.
3474 theRadius Radius of the cylinder to find shapes on.
3475 theState The state of the sub-shapes to find (see GEOM::shape_state)
3478 List of all found sub-shapes.
3480 # Example: see GEOM_TestOthers.py
3481 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3482 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3485 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3486 # the specified cylinder by the certain way, defined through \a theState parameter.
3487 # @param theShape Shape to find sub-shapes of.
3488 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3489 # @param theAxis Vector (or line, or linear edge), specifying
3490 # axis of the cylinder to find shapes on.
3491 # @param theRadius Radius of the cylinder to find shapes on.
3492 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3493 # @return List of all found sub-shapes indices.
3495 # @ref swig_GetShapesOnCylinderIDs "Example"
3496 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3498 Find in theShape all sub-shapes of type theShapeType, situated relatively
3499 the specified cylinder by the certain way, defined through theState parameter.
3502 theShape Shape to find sub-shapes of.
3503 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3504 theAxis Vector (or line, or linear edge), specifying
3505 axis of the cylinder to find shapes on.
3506 theRadius Radius of the cylinder to find shapes on.
3507 theState The state of the sub-shapes to find (see GEOM::shape_state)
3510 List of all found sub-shapes indices.
3512 # Example: see GEOM_TestOthers.py
3513 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3514 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3517 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3518 # the specified cylinder by the certain way, defined through \a theState parameter.
3519 # @param theShape Shape to find sub-shapes of.
3520 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3521 # @param theAxis Vector (or line, or linear edge), specifying
3522 # axis of the cylinder to find shapes on.
3523 # @param thePnt Point specifying location of the bottom of the cylinder.
3524 # @param theRadius Radius of the cylinder to find shapes on.
3525 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3526 # @return List of all found sub-shapes.
3528 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3529 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3531 Find in theShape all sub-shapes of type theShapeType, situated relatively
3532 the specified cylinder by the certain way, defined through theState parameter.
3535 theShape Shape to find sub-shapes of.
3536 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3537 theAxis Vector (or line, or linear edge), specifying
3538 axis of the cylinder to find shapes on.
3539 theRadius Radius of the cylinder to find shapes on.
3540 theState The state of the sub-shapes to find (see GEOM::shape_state)
3543 List of all found sub-shapes.
3545 # Example: see GEOM_TestOthers.py
3546 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3547 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3550 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3551 # the specified cylinder by the certain way, defined through \a theState parameter.
3552 # @param theShape Shape to find sub-shapes of.
3553 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3554 # @param theAxis Vector (or line, or linear edge), specifying
3555 # axis of the cylinder to find shapes on.
3556 # @param thePnt Point specifying location of the bottom of the cylinder.
3557 # @param theRadius Radius of the cylinder to find shapes on.
3558 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3559 # @return List of all found sub-shapes indices
3561 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3562 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3564 Find in theShape all sub-shapes of type theShapeType, situated relatively
3565 the specified cylinder by the certain way, defined through theState parameter.
3568 theShape Shape to find sub-shapes of.
3569 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3570 theAxis Vector (or line, or linear edge), specifying
3571 axis of the cylinder to find shapes on.
3572 theRadius Radius of the cylinder to find shapes on.
3573 theState The state of the sub-shapes to find (see GEOM::shape_state)
3576 List of all found sub-shapes indices.
3578 # Example: see GEOM_TestOthers.py
3579 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3580 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3583 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3584 # the specified sphere by the certain way, defined through \a theState parameter.
3585 # @param theShape Shape to find sub-shapes of.
3586 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3587 # @param theCenter Point, specifying center of the sphere to find shapes on.
3588 # @param theRadius Radius of the sphere to find shapes on.
3589 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3590 # @return List of all found sub-shapes.
3592 # @ref swig_GetShapesOnSphere "Example"
3593 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3595 Find in theShape all sub-shapes of type theShapeType, situated relatively
3596 the specified sphere by the certain way, defined through theState parameter.
3599 theShape Shape to find sub-shapes of.
3600 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3601 theCenter Point, specifying center of the sphere to find shapes on.
3602 theRadius Radius of the sphere to find shapes on.
3603 theState The state of the sub-shapes to find (see GEOM::shape_state)
3606 List of all found sub-shapes.
3608 # Example: see GEOM_TestOthers.py
3609 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3610 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3613 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3614 # the specified sphere by the certain way, defined through \a theState parameter.
3615 # @param theShape Shape to find sub-shapes of.
3616 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3617 # @param theCenter Point, specifying center of the sphere to find shapes on.
3618 # @param theRadius Radius of the sphere to find shapes on.
3619 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3620 # @return List of all found sub-shapes indices.
3622 # @ref swig_GetShapesOnSphereIDs "Example"
3623 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3625 Find in theShape all sub-shapes of type theShapeType, situated relatively
3626 the specified sphere by the certain way, defined through theState parameter.
3629 theShape Shape to find sub-shapes of.
3630 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3631 theCenter Point, specifying center of the sphere to find shapes on.
3632 theRadius Radius of the sphere to find shapes on.
3633 theState The state of the sub-shapes to find (see GEOM::shape_state)
3636 List of all found sub-shapes indices.
3638 # Example: see GEOM_TestOthers.py
3639 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3640 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3643 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3644 # the specified quadrangle by the certain way, defined through \a theState parameter.
3645 # @param theShape Shape to find sub-shapes of.
3646 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3647 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3648 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3649 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3650 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3651 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3652 # @return List of all found sub-shapes.
3654 # @ref swig_GetShapesOnQuadrangle "Example"
3655 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3656 theTopLeftPoint, theTopRigthPoint,
3657 theBottomLeftPoint, theBottomRigthPoint, theState):
3659 Find in theShape all sub-shapes of type theShapeType, situated relatively
3660 the specified quadrangle by the certain way, defined through theState parameter.
3663 theShape Shape to find sub-shapes of.
3664 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3665 theTopLeftPoint Point, specifying top left corner of a quadrangle
3666 theTopRigthPoint Point, specifying top right corner of a quadrangle
3667 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3668 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3669 theState The state of the sub-shapes to find (see GEOM::shape_state)
3672 List of all found sub-shapes.
3674 # Example: see GEOM_TestOthers.py
3675 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3676 theTopLeftPoint, theTopRigthPoint,
3677 theBottomLeftPoint, theBottomRigthPoint, theState)
3678 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3681 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3682 # the specified quadrangle by the certain way, defined through \a theState parameter.
3683 # @param theShape Shape to find sub-shapes of.
3684 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3685 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3686 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3687 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3688 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3689 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3690 # @return List of all found sub-shapes indices.
3692 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3693 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3694 theTopLeftPoint, theTopRigthPoint,
3695 theBottomLeftPoint, theBottomRigthPoint, theState):
3697 Find in theShape all sub-shapes of type theShapeType, situated relatively
3698 the specified quadrangle by the certain way, defined through theState parameter.
3701 theShape Shape to find sub-shapes of.
3702 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3703 theTopLeftPoint Point, specifying top left corner of a quadrangle
3704 theTopRigthPoint Point, specifying top right corner of a quadrangle
3705 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3706 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3707 theState The state of the sub-shapes to find (see GEOM::shape_state)
3710 List of all found sub-shapes indices.
3713 # Example: see GEOM_TestOthers.py
3714 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3715 theTopLeftPoint, theTopRigthPoint,
3716 theBottomLeftPoint, theBottomRigthPoint, theState)
3717 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3720 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3721 # the specified \a theBox by the certain way, defined through \a theState parameter.
3722 # @param theBox Shape for relative comparing.
3723 # @param theShape Shape to find sub-shapes of.
3724 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3725 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3726 # @return List of all found sub-shapes.
3728 # @ref swig_GetShapesOnBox "Example"
3729 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3731 Find in theShape all sub-shapes of type theShapeType, situated relatively
3732 the specified theBox by the certain way, defined through theState parameter.
3735 theBox Shape for relative comparing.
3736 theShape Shape to find sub-shapes of.
3737 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3738 theState The state of the sub-shapes to find (see GEOM::shape_state)
3741 List of all found sub-shapes.
3743 # Example: see GEOM_TestOthers.py
3744 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3745 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3748 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3749 # the specified \a theBox by the certain way, defined through \a theState parameter.
3750 # @param theBox Shape for relative comparing.
3751 # @param theShape Shape to find sub-shapes of.
3752 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3753 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3754 # @return List of all found sub-shapes indices.
3756 # @ref swig_GetShapesOnBoxIDs "Example"
3757 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3759 Find in theShape all sub-shapes of type theShapeType, situated relatively
3760 the specified theBox by the certain way, defined through theState parameter.
3763 theBox Shape for relative comparing.
3764 theShape Shape to find sub-shapes of.
3765 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3766 theState The state of the sub-shapes to find (see GEOM::shape_state)
3769 List of all found sub-shapes indices.
3771 # Example: see GEOM_TestOthers.py
3772 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3773 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3776 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3777 # situated relatively the specified \a theCheckShape by the
3778 # certain way, defined through \a theState parameter.
3779 # @param theCheckShape Shape for relative comparing. It must be a solid.
3780 # @param theShape Shape to find sub-shapes of.
3781 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3782 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3783 # @return List of all found sub-shapes.
3785 # @ref swig_GetShapesOnShape "Example"
3786 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3788 Find in theShape all sub-shapes of type theShapeType,
3789 situated relatively the specified theCheckShape by the
3790 certain way, defined through theState parameter.
3793 theCheckShape Shape for relative comparing. It must be a solid.
3794 theShape Shape to find sub-shapes of.
3795 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3796 theState The state of the sub-shapes to find (see GEOM::shape_state)
3799 List of all found sub-shapes.
3801 # Example: see GEOM_TestOthers.py
3802 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3803 theShapeType, theState)
3804 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3807 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3808 # situated relatively the specified \a theCheckShape by the
3809 # certain way, defined through \a theState parameter.
3810 # @param theCheckShape Shape for relative comparing. It must be a solid.
3811 # @param theShape Shape to find sub-shapes of.
3812 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3813 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3814 # @return All found sub-shapes as compound.
3816 # @ref swig_GetShapesOnShapeAsCompound "Example"
3817 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3819 Find in theShape all sub-shapes of type theShapeType,
3820 situated relatively the specified theCheckShape by the
3821 certain way, defined through theState parameter.
3824 theCheckShape Shape for relative comparing. It must be a solid.
3825 theShape Shape to find sub-shapes of.
3826 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3827 theState The state of the sub-shapes to find (see GEOM::shape_state)
3830 All found sub-shapes as compound.
3832 # Example: see GEOM_TestOthers.py
3833 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3834 theShapeType, theState)
3835 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3838 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3839 # situated relatively the specified \a theCheckShape by the
3840 # certain way, defined through \a theState parameter.
3841 # @param theCheckShape Shape for relative comparing. It must be a solid.
3842 # @param theShape Shape to find sub-shapes of.
3843 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3844 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3845 # @return List of all found sub-shapes indices.
3847 # @ref swig_GetShapesOnShapeIDs "Example"
3848 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3850 Find in theShape all sub-shapes of type theShapeType,
3851 situated relatively the specified theCheckShape by the
3852 certain way, defined through theState parameter.
3855 theCheckShape Shape for relative comparing. It must be a solid.
3856 theShape Shape to find sub-shapes of.
3857 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3858 theState The state of the sub-shapes to find (see GEOM::shape_state)
3861 List of all found sub-shapes indices.
3863 # Example: see GEOM_TestOthers.py
3864 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3865 theShapeType, theState)
3866 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3869 ## Get sub-shape(s) of theShapeWhere, which are
3870 # coincident with \a theShapeWhat or could be a part of it.
3871 # @param theShapeWhere Shape to find sub-shapes of.
3872 # @param theShapeWhat Shape, specifying what to find.
3873 # @param isNewImplementation implementation of GetInPlace functionality
3874 # (default = False, old alghorithm based on shape properties)
3875 # @return Group of all found sub-shapes or a single found sub-shape.
3877 # @note This function has a restriction on argument shapes.
3878 # If \a theShapeWhere has curved parts with significantly
3879 # outstanding centres (i.e. the mass centre of a part is closer to
3880 # \a theShapeWhat than to the part), such parts will not be found.
3881 # @image html get_in_place_lost_part.png
3883 # @ref swig_GetInPlace "Example"
3884 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3886 Get sub-shape(s) of theShapeWhere, which are
3887 coincident with theShapeWhat or could be a part of it.
3890 theShapeWhere Shape to find sub-shapes of.
3891 theShapeWhat Shape, specifying what to find.
3892 isNewImplementation Implementation of GetInPlace functionality
3893 (default = False, old alghorithm based on shape properties)
3896 Group of all found sub-shapes or a single found sub-shape.
3900 This function has a restriction on argument shapes.
3901 If theShapeWhere has curved parts with significantly
3902 outstanding centres (i.e. the mass centre of a part is closer to
3903 theShapeWhat than to the part), such parts will not be found.
3905 # Example: see GEOM_TestOthers.py
3907 if isNewImplementation:
3908 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3910 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3912 RaiseIfFailed("GetInPlace", self.ShapesOp)
3915 ## Get sub-shape(s) of \a theShapeWhere, which are
3916 # coincident with \a theShapeWhat or could be a part of it.
3918 # Implementation of this method is based on a saved history of an operation,
3919 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3920 # arguments (an argument shape or a sub-shape of an argument shape).
3921 # The operation could be the Partition or one of boolean operations,
3922 # performed on simple shapes (not on compounds).
3924 # @param theShapeWhere Shape to find sub-shapes of.
3925 # @param theShapeWhat Shape, specifying what to find (must be in the
3926 # building history of the ShapeWhere).
3927 # @return Group of all found sub-shapes or a single found sub-shape.
3929 # @ref swig_GetInPlace "Example"
3930 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
3932 Implementation of this method is based on a saved history of an operation,
3933 produced theShapeWhere. The theShapeWhat must be among this operation's
3934 arguments (an argument shape or a sub-shape of an argument shape).
3935 The operation could be the Partition or one of boolean operations,
3936 performed on simple shapes (not on compounds).
3939 theShapeWhere Shape to find sub-shapes of.
3940 theShapeWhat Shape, specifying what to find (must be in the
3941 building history of the ShapeWhere).
3944 Group of all found sub-shapes or a single found sub-shape.
3946 # Example: see GEOM_TestOthers.py
3947 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
3948 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
3951 ## Get sub-shape of theShapeWhere, which is
3952 # equal to \a theShapeWhat.
3953 # @param theShapeWhere Shape to find sub-shape of.
3954 # @param theShapeWhat Shape, specifying what to find.
3955 # @return New GEOM.GEOM_Object for found sub-shape.
3957 # @ref swig_GetSame "Example"
3958 def GetSame(self,theShapeWhere, theShapeWhat):
3960 Get sub-shape of theShapeWhere, which is
3961 equal to theShapeWhat.
3964 theShapeWhere Shape to find sub-shape of.
3965 theShapeWhat Shape, specifying what to find.
3968 New GEOM.GEOM_Object for found sub-shape.
3970 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
3971 RaiseIfFailed("GetSame", self.ShapesOp)
3975 ## Get sub-shape indices of theShapeWhere, which is
3976 # equal to \a theShapeWhat.
3977 # @param theShapeWhere Shape to find sub-shape of.
3978 # @param theShapeWhat Shape, specifying what to find.
3979 # @return List of all found sub-shapes indices.
3981 # @ref swig_GetSame "Example"
3982 def GetSameIDs(self,theShapeWhere, theShapeWhat):
3984 Get sub-shape indices of theShapeWhere, which is
3985 equal to theShapeWhat.
3988 theShapeWhere Shape to find sub-shape of.
3989 theShapeWhat Shape, specifying what to find.
3992 List of all found sub-shapes indices.
3994 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
3995 RaiseIfFailed("GetSameIDs", self.ShapesOp)
4002 ## @addtogroup l4_access
4005 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
4006 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4007 # @param aShape Shape to get sub-shape of.
4008 # @param ListOfID List of sub-shapes indices.
4009 # @return Found sub-shape.
4011 # @ref swig_all_decompose "Example"
4012 def GetSubShape(self, aShape, ListOfID):
4014 Obtain a composite sub-shape of aShape, composed from sub-shapes
4015 of aShape, selected by their unique IDs inside aShape
4018 aShape Shape to get sub-shape of.
4019 ListOfID List of sub-shapes indices.
4024 # Example: see GEOM_TestAll.py
4025 anObj = self.AddSubShape(aShape,ListOfID)
4028 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
4029 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4030 # @param aShape Shape to get sub-shape of.
4031 # @param aSubShape Sub-shapes of aShape.
4032 # @return ID of found sub-shape.
4034 # @ref swig_all_decompose "Example"
4035 def GetSubShapeID(self, aShape, aSubShape):
4037 Obtain unique ID of sub-shape aSubShape inside aShape
4038 of aShape, selected by their unique IDs inside aShape
4041 aShape Shape to get sub-shape of.
4042 aSubShape Sub-shapes of aShape.
4045 ID of found sub-shape.
4047 # Example: see GEOM_TestAll.py
4048 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
4049 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4055 ## @addtogroup l4_decompose
4058 ## Get all sub-shapes and groups of \a theShape,
4059 # that were created already by any other methods.
4060 # @param theShape Any shape.
4061 # @param theGroupsOnly If this parameter is TRUE, only groups will be
4062 # returned, else all found sub-shapes and groups.
4063 # @return List of existing sub-objects of \a theShape.
4065 # @ref swig_all_decompose "Example"
4066 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4068 Get all sub-shapes and groups of theShape,
4069 that were created already by any other methods.
4073 theGroupsOnly If this parameter is TRUE, only groups will be
4074 returned, else all found sub-shapes and groups.
4077 List of existing sub-objects of theShape.
4079 # Example: see GEOM_TestAll.py
4080 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4081 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4084 ## Get all groups of \a theShape,
4085 # that were created already by any other methods.
4086 # @param theShape Any shape.
4087 # @return List of existing groups of \a theShape.
4089 # @ref swig_all_decompose "Example"
4090 def GetGroups(self, theShape):
4092 Get all groups of theShape,
4093 that were created already by any other methods.
4099 List of existing groups of theShape.
4101 # Example: see GEOM_TestAll.py
4102 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4103 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4106 ## Explode a shape on sub-shapes of a given type.
4107 # If the shape itself matches the type, it is also returned.
4108 # @param aShape Shape to be exploded.
4109 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4110 # @return List of sub-shapes of type theShapeType, contained in theShape.
4112 # @ref swig_all_decompose "Example"
4113 def SubShapeAll(self, aShape, aType):
4115 Explode a shape on sub-shapes of a given type.
4116 If the shape itself matches the type, it is also returned.
4119 aShape Shape to be exploded.
4120 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4123 List of sub-shapes of type theShapeType, contained in theShape.
4125 # Example: see GEOM_TestAll.py
4126 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
4127 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4130 ## Explode a shape on sub-shapes of a given type.
4131 # @param aShape Shape to be exploded.
4132 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4133 # @return List of IDs of sub-shapes.
4135 # @ref swig_all_decompose "Example"
4136 def SubShapeAllIDs(self, aShape, aType):
4138 Explode a shape on sub-shapes of a given type.
4141 aShape Shape to be exploded (see geompy.ShapeType)
4142 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4145 List of IDs of sub-shapes.
4147 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
4148 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4151 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4152 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4153 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4154 # @param aShape Shape to get sub-shape of.
4155 # @param ListOfInd List of sub-shapes indices.
4156 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4157 # @return A compound of sub-shapes of aShape.
4159 # @ref swig_all_decompose "Example"
4160 def SubShape(self, aShape, aType, ListOfInd):
4162 Obtain a compound of sub-shapes of aShape,
4163 selected by they indices in list of all sub-shapes of type aType.
4164 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4167 aShape Shape to get sub-shape of.
4168 ListOfID List of sub-shapes indices.
4169 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4172 A compound of sub-shapes of aShape.
4174 # Example: see GEOM_TestAll.py
4176 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
4177 for ind in ListOfInd:
4178 ListOfIDs.append(AllShapeIDsList[ind - 1])
4179 anObj = self.GetSubShape(aShape, ListOfIDs)
4182 ## Explode a shape on sub-shapes of a given type.
4183 # Sub-shapes will be sorted by coordinates of their gravity centers.
4184 # If the shape itself matches the type, it is also returned.
4185 # @param aShape Shape to be exploded.
4186 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4187 # @return List of sub-shapes of type theShapeType, contained in theShape.
4189 # @ref swig_SubShapeAllSorted "Example"
4190 def SubShapeAllSortedCentres(self, aShape, aType):
4192 Explode a shape on sub-shapes of a given type.
4193 Sub-shapes will be sorted by coordinates of their gravity centers.
4194 If the shape itself matches the type, it is also returned.
4197 aShape Shape to be exploded.
4198 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4201 List of sub-shapes of type theShapeType, contained in theShape.
4203 # Example: see GEOM_TestAll.py
4204 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
4205 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4208 ## Explode a shape on sub-shapes of a given type.
4209 # Sub-shapes will be sorted by coordinates of their gravity centers.
4210 # @param aShape Shape to be exploded.
4211 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4212 # @return List of IDs of sub-shapes.
4214 # @ref swig_all_decompose "Example"
4215 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4217 Explode a shape on sub-shapes of a given type.
4218 Sub-shapes will be sorted by coordinates of their gravity centers.
4221 aShape Shape to be exploded.
4222 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4225 List of IDs of sub-shapes.
4227 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
4228 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4231 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4232 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4233 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4234 # @param aShape Shape to get sub-shape of.
4235 # @param ListOfInd List of sub-shapes indices.
4236 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4237 # @return A compound of sub-shapes of aShape.
4239 # @ref swig_all_decompose "Example"
4240 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4242 Obtain a compound of sub-shapes of aShape,
4243 selected by they indices in sorted list of all sub-shapes of type aType.
4244 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4247 aShape Shape to get sub-shape of.
4248 ListOfID List of sub-shapes indices.
4249 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4252 A compound of sub-shapes of aShape.
4254 # Example: see GEOM_TestAll.py
4256 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
4257 for ind in ListOfInd:
4258 ListOfIDs.append(AllShapeIDsList[ind - 1])
4259 anObj = self.GetSubShape(aShape, ListOfIDs)
4262 ## Extract shapes (excluding the main shape) of given type.
4263 # @param aShape The shape.
4264 # @param aType The shape type (see ShapeType())
4265 # @param isSorted Boolean flag to switch sorting on/off.
4266 # @return List of sub-shapes of type aType, contained in aShape.
4268 # @ref swig_FilletChamfer "Example"
4269 def ExtractShapes(self, aShape, aType, isSorted = False):
4271 Extract shapes (excluding the main shape) of given type.
4275 aType The shape type (see geompy.ShapeType)
4276 isSorted Boolean flag to switch sorting on/off.
4279 List of sub-shapes of type aType, contained in aShape.
4281 # Example: see GEOM_TestAll.py
4282 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
4283 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4286 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4287 # @param aShape Main shape.
4288 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4289 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4291 # @ref swig_all_decompose "Example"
4292 def SubShapes(self, aShape, anIDs):
4294 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4298 anIDs List of unique IDs of sub-shapes inside theMainShape.
4301 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4303 # Example: see GEOM_TestAll.py
4304 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4305 RaiseIfFailed("SubShapes", self.ShapesOp)
4308 # end of l4_decompose
4311 ## @addtogroup l4_decompose_d
4314 ## Deprecated method
4315 # It works like SubShapeAllSortedCentres(), but wrongly
4316 # defines centres of faces, shells and solids.
4317 def SubShapeAllSorted(self, aShape, aType):
4320 It works like geompy.SubShapeAllSortedCentres, but wrongly
4321 defines centres of faces, shells and solids.
4323 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
4324 RaiseIfFailed("MakeExplode", self.ShapesOp)
4327 ## Deprecated method
4328 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4329 # defines centres of faces, shells and solids.
4330 def SubShapeAllSortedIDs(self, aShape, aType):
4333 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4334 defines centres of faces, shells and solids.
4336 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
4337 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4340 ## Deprecated method
4341 # It works like SubShapeSortedCentres(), but has a bug
4342 # (wrongly defines centres of faces, shells and solids).
4343 def SubShapeSorted(self, aShape, aType, ListOfInd):
4346 It works like geompy.SubShapeSortedCentres, but has a bug
4347 (wrongly defines centres of faces, shells and solids).
4350 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
4351 for ind in ListOfInd:
4352 ListOfIDs.append(AllShapeIDsList[ind - 1])
4353 anObj = self.GetSubShape(aShape, ListOfIDs)
4356 # end of l4_decompose_d
4359 ## @addtogroup l3_healing
4362 ## Apply a sequence of Shape Healing operators to the given object.
4363 # @param theShape Shape to be processed.
4364 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4365 # @param theParameters List of names of parameters
4366 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4367 # @param theValues List of values of parameters, in the same order
4368 # as parameters are listed in <VAR>theParameters</VAR> list.
4371 # <b> Operators and Parameters: </b> \n
4373 # * \b FixShape - corrects invalid shapes. \n
4374 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4375 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4377 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4378 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4379 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4380 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4382 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4383 # surfaces in segments using a certain angle. \n
4384 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4385 # if Angle=180, four if Angle=90, etc). \n
4386 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4388 # * \b SplitClosedFaces - splits closed faces in segments.
4389 # The number of segments depends on the number of splitting points.\n
4390 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4392 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4393 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4394 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4395 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4396 # This and the previous parameters can take the following values:\n
4397 # \b Parametric \b Continuity \n
4398 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4399 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4400 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4401 # ruling out sharp edges).\n
4402 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4403 # are of the same magnitude).\n
4404 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4405 # or surfaces (d/du C(u)) are the same at junction. \n
4406 # \b Geometric \b Continuity \n
4407 # \b G1: first derivatives are proportional at junction.\n
4408 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4409 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4410 # \b G2: first and second derivatives are proportional at junction.
4411 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4412 # continuity requires that the underlying parameterization was continuous as well.
4413 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4415 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4416 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4417 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4418 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4419 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4420 # with the specified parameters.\n
4421 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4422 # with the specified parameters.\n
4423 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4424 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4425 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4426 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4428 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4429 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4430 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4431 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4432 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4434 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4435 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4438 # @return New GEOM.GEOM_Object, containing processed shape.
4440 # \n @ref tui_shape_processing "Example"
4441 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4443 Apply a sequence of Shape Healing operators to the given object.
4446 theShape Shape to be processed.
4447 theValues List of values of parameters, in the same order
4448 as parameters are listed in theParameters list.
4449 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4450 theParameters List of names of parameters
4451 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4452 Operators and Parameters:
4454 * FixShape - corrects invalid shapes.
4455 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4456 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4457 * FixFaceSize - removes small faces, such as spots and strips.
4458 * FixFaceSize.Tolerance - defines minimum possible face size.
4459 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4460 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4461 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4462 in segments using a certain angle.
4463 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4464 if Angle=180, four if Angle=90, etc).
4465 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4466 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4468 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4469 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4470 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4471 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4472 * SplitContinuity.CurveContinuity - required continuity for curves.
4473 This and the previous parameters can take the following values:
4475 Parametric Continuity:
4476 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4477 coincidental. The curves or surfaces may still meet at an angle,
4478 giving rise to a sharp corner or edge).
4479 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4480 are parallel, ruling out sharp edges).
4481 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4482 or surfaces are of the same magnitude).
4483 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4484 curves or surfaces (d/du C(u)) are the same at junction.
4486 Geometric Continuity:
4487 G1: first derivatives are proportional at junction.
4488 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4489 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4490 G2: first and second derivatives are proportional at junction. As the names imply,
4491 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4492 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4493 geometric continuity of order n, but not vice-versa.
4494 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4495 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4496 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4497 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4498 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4499 the specified parameters.
4500 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4501 the specified parameters.
4502 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4503 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4504 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4505 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4506 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4507 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4508 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4509 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4510 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4511 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4512 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4515 New GEOM.GEOM_Object, containing processed shape.
4517 Note: For more information look through SALOME Geometry User's Guide->
4518 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4520 # Example: see GEOM_TestHealing.py
4521 theValues,Parameters = ParseList(theValues)
4522 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4523 # To avoid script failure in case of good argument shape
4524 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4526 RaiseIfFailed("ProcessShape", self.HealOp)
4527 for string in (theOperators + theParameters):
4528 Parameters = ":" + Parameters
4530 anObj.SetParameters(Parameters)
4533 ## Remove faces from the given object (shape).
4534 # @param theObject Shape to be processed.
4535 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4536 # removes ALL faces of the given object.
4537 # @return New GEOM.GEOM_Object, containing processed shape.
4539 # @ref tui_suppress_faces "Example"
4540 def SuppressFaces(self,theObject, theFaces):
4542 Remove faces from the given object (shape).
4545 theObject Shape to be processed.
4546 theFaces Indices of faces to be removed, if EMPTY then the method
4547 removes ALL faces of the given object.
4550 New GEOM.GEOM_Object, containing processed shape.
4552 # Example: see GEOM_TestHealing.py
4553 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4554 RaiseIfFailed("SuppressFaces", self.HealOp)
4557 ## Sewing of some shapes into single shape.
4558 # @param ListShape Shapes to be processed.
4559 # @param theTolerance Required tolerance value.
4560 # @return New GEOM.GEOM_Object, containing processed shape.
4562 # @ref tui_sewing "Example"
4563 def MakeSewing(self, ListShape, theTolerance):
4565 Sewing of some shapes into single shape.
4568 ListShape Shapes to be processed.
4569 theTolerance Required tolerance value.
4572 New GEOM.GEOM_Object, containing processed shape.
4574 # Example: see GEOM_TestHealing.py
4575 comp = self.MakeCompound(ListShape)
4576 anObj = self.Sew(comp, theTolerance)
4579 ## Sewing of the given object.
4580 # @param theObject Shape to be processed.
4581 # @param theTolerance Required tolerance value.
4582 # @return New GEOM.GEOM_Object, containing processed shape.
4583 def Sew(self, theObject, theTolerance):
4585 Sewing of the given object.
4588 theObject Shape to be processed.
4589 theTolerance Required tolerance value.
4592 New GEOM.GEOM_Object, containing processed shape.
4594 # Example: see MakeSewing() above
4595 theTolerance,Parameters = ParseParameters(theTolerance)
4596 anObj = self.HealOp.Sew(theObject, theTolerance)
4597 RaiseIfFailed("Sew", self.HealOp)
4598 anObj.SetParameters(Parameters)
4601 ## Remove internal wires and edges from the given object (face).
4602 # @param theObject Shape to be processed.
4603 # @param theWires Indices of wires to be removed, if EMPTY then the method
4604 # removes ALL internal wires of the given object.
4605 # @return New GEOM.GEOM_Object, containing processed shape.
4607 # @ref tui_suppress_internal_wires "Example"
4608 def SuppressInternalWires(self,theObject, theWires):
4610 Remove internal wires and edges from the given object (face).
4613 theObject Shape to be processed.
4614 theWires Indices of wires to be removed, if EMPTY then the method
4615 removes ALL internal wires of the given object.
4618 New GEOM.GEOM_Object, containing processed shape.
4620 # Example: see GEOM_TestHealing.py
4621 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4622 RaiseIfFailed("RemoveIntWires", self.HealOp)
4625 ## Remove internal closed contours (holes) from the given object.
4626 # @param theObject Shape to be processed.
4627 # @param theWires Indices of wires to be removed, if EMPTY then the method
4628 # removes ALL internal holes of the given object
4629 # @return New GEOM.GEOM_Object, containing processed shape.
4631 # @ref tui_suppress_holes "Example"
4632 def SuppressHoles(self,theObject, theWires):
4634 Remove internal closed contours (holes) from the given object.
4637 theObject Shape to be processed.
4638 theWires Indices of wires to be removed, if EMPTY then the method
4639 removes ALL internal holes of the given object
4642 New GEOM.GEOM_Object, containing processed shape.
4644 # Example: see GEOM_TestHealing.py
4645 anObj = self.HealOp.FillHoles(theObject, theWires)
4646 RaiseIfFailed("FillHoles", self.HealOp)
4649 ## Close an open wire.
4650 # @param theObject Shape to be processed.
4651 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4652 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4653 # @param isCommonVertex If True : closure by creation of a common vertex,
4654 # If False : closure by creation of an edge between ends.
4655 # @return New GEOM.GEOM_Object, containing processed shape.
4657 # @ref tui_close_contour "Example"
4658 def CloseContour(self,theObject, theWires, isCommonVertex):
4663 theObject Shape to be processed.
4664 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4665 if [ ], then theObject itself is a wire.
4666 isCommonVertex If True : closure by creation of a common vertex,
4667 If False : closure by creation of an edge between ends.
4670 New GEOM.GEOM_Object, containing processed shape.
4672 # Example: see GEOM_TestHealing.py
4673 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4674 RaiseIfFailed("CloseContour", self.HealOp)
4677 ## Addition of a point to a given edge object.
4678 # @param theObject Shape to be processed.
4679 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4680 # if -1, then theObject itself is the edge.
4681 # @param theValue Value of parameter on edge or length parameter,
4682 # depending on \a isByParameter.
4683 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4684 # if FALSE : \a theValue is treated as a length parameter [0..1]
4685 # @return New GEOM.GEOM_Object, containing processed shape.
4687 # @ref tui_add_point_on_edge "Example"
4688 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4690 Addition of a point to a given edge object.
4693 theObject Shape to be processed.
4694 theEdgeIndex Index of edge to be divided within theObject's shape,
4695 if -1, then theObject itself is the edge.
4696 theValue Value of parameter on edge or length parameter,
4697 depending on isByParameter.
4698 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4699 if FALSE : theValue is treated as a length parameter [0..1]
4702 New GEOM.GEOM_Object, containing processed shape.
4704 # Example: see GEOM_TestHealing.py
4705 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4706 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4707 RaiseIfFailed("DivideEdge", self.HealOp)
4708 anObj.SetParameters(Parameters)
4711 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4712 # @param theWire Wire to minimize the number of C1 continuous edges in.
4713 # @param theVertices A list of vertices to suppress. If the list
4714 # is empty, all vertices in a wire will be assumed.
4715 # @return New GEOM.GEOM_Object with modified wire.
4717 # @ref tui_fuse_collinear_edges "Example"
4718 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4720 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4723 theWire Wire to minimize the number of C1 continuous edges in.
4724 theVertices A list of vertices to suppress. If the list
4725 is empty, all vertices in a wire will be assumed.
4728 New GEOM.GEOM_Object with modified wire.
4730 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4731 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4734 ## Change orientation of the given object. Updates given shape.
4735 # @param theObject Shape to be processed.
4736 # @return Updated <var>theObject</var>
4738 # @ref swig_todo "Example"
4739 def ChangeOrientationShell(self,theObject):
4741 Change orientation of the given object. Updates given shape.
4744 theObject Shape to be processed.
4749 theObject = self.HealOp.ChangeOrientation(theObject)
4750 RaiseIfFailed("ChangeOrientation", self.HealOp)
4753 ## Change orientation of the given object.
4754 # @param theObject Shape to be processed.
4755 # @return New GEOM.GEOM_Object, containing processed shape.
4757 # @ref swig_todo "Example"
4758 def ChangeOrientationShellCopy(self, theObject):
4760 Change orientation of the given object.
4763 theObject Shape to be processed.
4766 New GEOM.GEOM_Object, containing processed shape.
4768 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4769 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4772 ## Try to limit tolerance of the given object by value \a theTolerance.
4773 # @param theObject Shape to be processed.
4774 # @param theTolerance Required tolerance value.
4775 # @return New GEOM.GEOM_Object, containing processed shape.
4777 # @ref tui_limit_tolerance "Example"
4778 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4780 Try to limit tolerance of the given object by value theTolerance.
4783 theObject Shape to be processed.
4784 theTolerance Required tolerance value.
4787 New GEOM.GEOM_Object, containing processed shape.
4789 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4790 RaiseIfFailed("LimitTolerance", self.HealOp)
4793 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4794 # that constitute a free boundary of the given shape.
4795 # @param theObject Shape to get free boundary of.
4796 # @return [\a status, \a theClosedWires, \a theOpenWires]
4797 # \n \a status: FALSE, if an error(s) occured during the method execution.
4798 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4799 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4801 # @ref tui_measurement_tools_page "Example"
4802 def GetFreeBoundary(self, theObject):
4804 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4805 that constitute a free boundary of the given shape.
4808 theObject Shape to get free boundary of.
4811 [status, theClosedWires, theOpenWires]
4812 status: FALSE, if an error(s) occured during the method execution.
4813 theClosedWires: Closed wires on the free boundary of the given shape.
4814 theOpenWires: Open wires on the free boundary of the given shape.
4816 # Example: see GEOM_TestHealing.py
4817 anObj = self.HealOp.GetFreeBoundary(theObject)
4818 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4821 ## Replace coincident faces in theShape by one face.
4822 # @param theShape Initial shape.
4823 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4824 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4825 # otherwise all initial shapes.
4826 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4828 # @ref tui_glue_faces "Example"
4829 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4831 Replace coincident faces in theShape by one face.
4834 theShape Initial shape.
4835 theTolerance Maximum distance between faces, which can be considered as coincident.
4836 doKeepNonSolids If FALSE, only solids will present in the result,
4837 otherwise all initial shapes.
4840 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4842 # Example: see GEOM_Spanner.py
4843 theTolerance,Parameters = ParseParameters(theTolerance)
4844 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4846 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4847 anObj.SetParameters(Parameters)
4850 ## Find coincident faces in theShape for possible gluing.
4851 # @param theShape Initial shape.
4852 # @param theTolerance Maximum distance between faces,
4853 # which can be considered as coincident.
4854 # @return GEOM.ListOfGO
4856 # @ref tui_glue_faces "Example"
4857 def GetGlueFaces(self, theShape, theTolerance):
4859 Find coincident faces in theShape for possible gluing.
4862 theShape Initial shape.
4863 theTolerance Maximum distance between faces,
4864 which can be considered as coincident.
4869 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4870 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4873 ## Replace coincident faces in theShape by one face
4874 # in compliance with given list of faces
4875 # @param theShape Initial shape.
4876 # @param theTolerance Maximum distance between faces,
4877 # which can be considered as coincident.
4878 # @param theFaces List of faces for gluing.
4879 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4880 # otherwise all initial shapes.
4881 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4882 # will be glued, otherwise only the edges,
4883 # belonging to <VAR>theFaces</VAR>.
4884 # @return New GEOM.GEOM_Object, containing a copy of theShape
4885 # without some faces.
4887 # @ref tui_glue_faces "Example"
4888 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4889 doKeepNonSolids=True, doGlueAllEdges=True):
4891 Replace coincident faces in theShape by one face
4892 in compliance with given list of faces
4895 theShape Initial shape.
4896 theTolerance Maximum distance between faces,
4897 which can be considered as coincident.
4898 theFaces List of faces for gluing.
4899 doKeepNonSolids If FALSE, only solids will present in the result,
4900 otherwise all initial shapes.
4901 doGlueAllEdges If TRUE, all coincident edges of theShape
4902 will be glued, otherwise only the edges,
4903 belonging to theFaces.
4906 New GEOM.GEOM_Object, containing a copy of theShape
4909 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4910 doKeepNonSolids, doGlueAllEdges)
4912 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4915 ## Replace coincident edges in theShape by one edge.
4916 # @param theShape Initial shape.
4917 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
4918 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4920 # @ref tui_glue_edges "Example"
4921 def MakeGlueEdges(self, theShape, theTolerance):
4923 Replace coincident edges in theShape by one edge.
4926 theShape Initial shape.
4927 theTolerance Maximum distance between edges, which can be considered as coincident.
4930 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4932 theTolerance,Parameters = ParseParameters(theTolerance)
4933 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
4935 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
4936 anObj.SetParameters(Parameters)
4939 ## Find coincident edges in theShape for possible gluing.
4940 # @param theShape Initial shape.
4941 # @param theTolerance Maximum distance between edges,
4942 # which can be considered as coincident.
4943 # @return GEOM.ListOfGO
4945 # @ref tui_glue_edges "Example"
4946 def GetGlueEdges(self, theShape, theTolerance):
4948 Find coincident edges in theShape for possible gluing.
4951 theShape Initial shape.
4952 theTolerance Maximum distance between edges,
4953 which can be considered as coincident.
4958 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
4959 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
4962 ## Replace coincident edges in theShape by one edge
4963 # in compliance with given list of edges.
4964 # @param theShape Initial shape.
4965 # @param theTolerance Maximum distance between edges,
4966 # which can be considered as coincident.
4967 # @param theEdges List of edges for gluing.
4968 # @return New GEOM.GEOM_Object, containing a copy of theShape
4969 # without some edges.
4971 # @ref tui_glue_edges "Example"
4972 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
4974 Replace coincident edges in theShape by one edge
4975 in compliance with given list of edges.
4978 theShape Initial shape.
4979 theTolerance Maximum distance between edges,
4980 which can be considered as coincident.
4981 theEdges List of edges for gluing.
4984 New GEOM.GEOM_Object, containing a copy of theShape
4987 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
4989 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
4995 ## @addtogroup l3_boolean Boolean Operations
4998 # -----------------------------------------------------------------------------
4999 # Boolean (Common, Cut, Fuse, Section)
5000 # -----------------------------------------------------------------------------
5002 ## Perform one of boolean operations on two given shapes.
5003 # @param theShape1 First argument for boolean operation.
5004 # @param theShape2 Second argument for boolean operation.
5005 # @param theOperation Indicates the operation to be done:\n
5006 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5007 # @return New GEOM.GEOM_Object, containing the result shape.
5009 # @ref tui_fuse "Example"
5010 def MakeBoolean(self,theShape1, theShape2, theOperation):
5012 Perform one of boolean operations on two given shapes.
5015 theShape1 First argument for boolean operation.
5016 theShape2 Second argument for boolean operation.
5017 theOperation Indicates the operation to be done:
5018 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5021 New GEOM.GEOM_Object, containing the result shape.
5023 # Example: see GEOM_TestAll.py
5024 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
5025 RaiseIfFailed("MakeBoolean", self.BoolOp)
5028 ## Perform Common boolean operation on two given shapes.
5029 # @param theShape1 First argument for boolean operation.
5030 # @param theShape2 Second argument for boolean operation.
5031 # @return New GEOM.GEOM_Object, containing the result shape.
5033 # @ref tui_common "Example 1"
5034 # \n @ref swig_MakeCommon "Example 2"
5035 def MakeCommon(self, theShape1, theShape2):
5037 Perform Common boolean operation on two given shapes.
5040 theShape1 First argument for boolean operation.
5041 theShape2 Second argument for boolean operation.
5044 New GEOM.GEOM_Object, containing the result shape.
5046 # Example: see GEOM_TestOthers.py
5047 return self.MakeBoolean(theShape1, theShape2, 1)
5049 ## Perform Cut boolean operation on two given shapes.
5050 # @param theShape1 First argument for boolean operation.
5051 # @param theShape2 Second argument for boolean operation.
5052 # @return New GEOM.GEOM_Object, containing the result shape.
5054 # @ref tui_cut "Example 1"
5055 # \n @ref swig_MakeCommon "Example 2"
5056 def MakeCut(self, theShape1, theShape2):
5058 Perform Cut boolean operation on two given shapes.
5061 theShape1 First argument for boolean operation.
5062 theShape2 Second argument for boolean operation.
5065 New GEOM.GEOM_Object, containing the result shape.
5068 # Example: see GEOM_TestOthers.py
5069 return self.MakeBoolean(theShape1, theShape2, 2)
5071 ## Perform Fuse boolean operation on two given shapes.
5072 # @param theShape1 First argument for boolean operation.
5073 # @param theShape2 Second argument for boolean operation.
5074 # @return New GEOM.GEOM_Object, containing the result shape.
5076 # @ref tui_fuse "Example 1"
5077 # \n @ref swig_MakeCommon "Example 2"
5078 def MakeFuse(self, theShape1, theShape2):
5080 Perform Fuse boolean operation on two given shapes.
5083 theShape1 First argument for boolean operation.
5084 theShape2 Second argument for boolean operation.
5087 New GEOM.GEOM_Object, containing the result shape.
5090 # Example: see GEOM_TestOthers.py
5091 return self.MakeBoolean(theShape1, theShape2, 3)
5093 ## Perform Section boolean operation on two given shapes.
5094 # @param theShape1 First argument for boolean operation.
5095 # @param theShape2 Second argument for boolean operation.
5096 # @return New GEOM.GEOM_Object, containing the result shape.
5098 # @ref tui_section "Example 1"
5099 # \n @ref swig_MakeCommon "Example 2"
5100 def MakeSection(self, theShape1, theShape2):
5102 Perform Section boolean operation on two given shapes.
5105 theShape1 First argument for boolean operation.
5106 theShape2 Second argument for boolean operation.
5109 New GEOM.GEOM_Object, containing the result shape.
5112 # Example: see GEOM_TestOthers.py
5113 return self.MakeBoolean(theShape1, theShape2, 4)
5118 ## @addtogroup l3_basic_op
5121 ## Perform partition operation.
5122 # @param ListShapes Shapes to be intersected.
5123 # @param ListTools Shapes to intersect theShapes.
5124 # @param Limit Type of resulting shapes (see ShapeType()).\n
5125 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
5126 # type will be detected automatically.
5127 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5128 # target type (equal to Limit) are kept in the result,
5129 # else standalone shapes of lower dimension
5130 # are kept also (if they exist).
5131 # @note Each compound from ListShapes and ListTools will be exploded
5132 # in order to avoid possible intersection between shapes from this compound.
5134 # After implementation new version of PartitionAlgo (October 2006)
5135 # other parameters are ignored by current functionality. They are kept
5136 # in this function only for support old versions.
5137 # @param ListKeepInside Shapes, outside which the results will be deleted.
5138 # Each shape from theKeepInside must belong to theShapes also.
5139 # @param ListRemoveInside Shapes, inside which the results will be deleted.
5140 # Each shape from theRemoveInside must belong to theShapes also.
5141 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5142 # @param ListMaterials Material indices for each shape. Make sence,
5143 # only if theRemoveWebs is TRUE.
5145 # @return New GEOM.GEOM_Object, containing the result shapes.
5147 # @ref tui_partition "Example"
5148 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5149 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5150 KeepNonlimitShapes=0):
5152 Perform partition operation.
5155 ListShapes Shapes to be intersected.
5156 ListTools Shapes to intersect theShapes.
5157 Limit Type of resulting shapes (see geompy.ShapeType)
5158 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5159 type will be detected automatically.
5160 KeepNonlimitShapes if this parameter == 0, then only shapes of
5161 target type (equal to Limit) are kept in the result,
5162 else standalone shapes of lower dimension
5163 are kept also (if they exist).
5165 Each compound from ListShapes and ListTools will be exploded
5166 in order to avoid possible intersection between shapes from
5169 After implementation new version of PartitionAlgo (October 2006) other
5170 parameters are ignored by current functionality. They are kept in this
5171 function only for support old versions.
5174 ListKeepInside Shapes, outside which the results will be deleted.
5175 Each shape from theKeepInside must belong to theShapes also.
5176 ListRemoveInside Shapes, inside which the results will be deleted.
5177 Each shape from theRemoveInside must belong to theShapes also.
5178 RemoveWebs If TRUE, perform Glue 3D algorithm.
5179 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5182 New GEOM.GEOM_Object, containing the result shapes.
5184 # Example: see GEOM_TestAll.py
5185 if Limit == ShapeType["AUTO"]:
5186 # automatic detection of the most appropriate shape limit type
5188 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5189 Limit = EnumToLong(lim)
5191 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5192 ListKeepInside, ListRemoveInside,
5193 Limit, RemoveWebs, ListMaterials,
5194 KeepNonlimitShapes);
5195 RaiseIfFailed("MakePartition", self.BoolOp)
5198 ## Perform partition operation.
5199 # This method may be useful if it is needed to make a partition for
5200 # compound contains nonintersected shapes. Performance will be better
5201 # since intersection between shapes from compound is not performed.
5203 # Description of all parameters as in previous method MakePartition()
5205 # @note Passed compounds (via ListShapes or via ListTools)
5206 # have to consist of nonintersecting shapes.
5208 # @return New GEOM.GEOM_Object, containing the result shapes.
5210 # @ref swig_todo "Example"
5211 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5212 ListKeepInside=[], ListRemoveInside=[],
5213 Limit=ShapeType["AUTO"], RemoveWebs=0,
5214 ListMaterials=[], KeepNonlimitShapes=0):
5216 Perform partition operation.
5217 This method may be useful if it is needed to make a partition for
5218 compound contains nonintersected shapes. Performance will be better
5219 since intersection between shapes from compound is not performed.
5222 Description of all parameters as in method geompy.MakePartition
5225 Passed compounds (via ListShapes or via ListTools)
5226 have to consist of nonintersecting shapes.
5229 New GEOM.GEOM_Object, containing the result shapes.
5231 if Limit == ShapeType["AUTO"]:
5232 # automatic detection of the most appropriate shape limit type
5234 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5235 Limit = EnumToLong(lim)
5237 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5238 ListKeepInside, ListRemoveInside,
5239 Limit, RemoveWebs, ListMaterials,
5240 KeepNonlimitShapes);
5241 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5244 ## See method MakePartition() for more information.
5246 # @ref tui_partition "Example 1"
5247 # \n @ref swig_Partition "Example 2"
5248 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5249 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5250 KeepNonlimitShapes=0):
5252 See method geompy.MakePartition for more information.
5254 # Example: see GEOM_TestOthers.py
5255 anObj = self.MakePartition(ListShapes, ListTools,
5256 ListKeepInside, ListRemoveInside,
5257 Limit, RemoveWebs, ListMaterials,
5258 KeepNonlimitShapes);
5261 ## Perform partition of the Shape with the Plane
5262 # @param theShape Shape to be intersected.
5263 # @param thePlane Tool shape, to intersect theShape.
5264 # @return New GEOM.GEOM_Object, containing the result shape.
5266 # @ref tui_partition "Example"
5267 def MakeHalfPartition(self,theShape, thePlane):
5269 Perform partition of the Shape with the Plane
5272 theShape Shape to be intersected.
5273 thePlane Tool shape, to intersect theShape.
5276 New GEOM.GEOM_Object, containing the result shape.
5278 # Example: see GEOM_TestAll.py
5279 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5280 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5283 # end of l3_basic_op
5286 ## @addtogroup l3_transform
5289 ## Translate the given object along the vector, specified
5290 # by its end points, creating its copy before the translation.
5291 # @param theObject The object to be translated.
5292 # @param thePoint1 Start point of translation vector.
5293 # @param thePoint2 End point of translation vector.
5294 # @return New GEOM.GEOM_Object, containing the translated object.
5296 # @ref tui_translation "Example 1"
5297 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5298 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5300 Translate the given object along the vector, specified
5301 by its end points, creating its copy before the translation.
5304 theObject The object to be translated.
5305 thePoint1 Start point of translation vector.
5306 thePoint2 End point of translation vector.
5309 New GEOM.GEOM_Object, containing the translated object.
5311 # Example: see GEOM_TestAll.py
5312 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5313 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5316 ## Translate the given object along the vector, specified by its components.
5317 # @param theObject The object to be translated.
5318 # @param theDX,theDY,theDZ Components of translation vector.
5319 # @return Translated GEOM.GEOM_Object.
5321 # @ref tui_translation "Example"
5322 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5324 Translate the given object along the vector, specified by its components.
5327 theObject The object to be translated.
5328 theDX,theDY,theDZ Components of translation vector.
5331 Translated GEOM.GEOM_Object.
5333 # Example: see GEOM_TestAll.py
5334 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5335 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5336 anObj.SetParameters(Parameters)
5337 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5340 ## Translate the given object along the vector, specified
5341 # by its components, creating its copy before the translation.
5342 # @param theObject The object to be translated.
5343 # @param theDX,theDY,theDZ Components of translation vector.
5344 # @return New GEOM.GEOM_Object, containing the translated object.
5346 # @ref tui_translation "Example"
5347 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5349 Translate the given object along the vector, specified
5350 by its components, creating its copy before the translation.
5353 theObject The object to be translated.
5354 theDX,theDY,theDZ Components of translation vector.
5357 New GEOM.GEOM_Object, containing the translated object.
5359 # Example: see GEOM_TestAll.py
5360 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5361 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5362 anObj.SetParameters(Parameters)
5363 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5366 ## Translate the given object along the given vector,
5367 # creating its copy before the translation.
5368 # @param theObject The object to be translated.
5369 # @param theVector The translation vector.
5370 # @return New GEOM.GEOM_Object, containing the translated object.
5372 # @ref tui_translation "Example"
5373 def MakeTranslationVector(self,theObject, theVector):
5375 Translate the given object along the given vector,
5376 creating its copy before the translation.
5379 theObject The object to be translated.
5380 theVector The translation vector.
5383 New GEOM.GEOM_Object, containing the translated object.
5385 # Example: see GEOM_TestAll.py
5386 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5387 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5390 ## Translate the given object along the given vector on given distance.
5391 # @param theObject The object to be translated.
5392 # @param theVector The translation vector.
5393 # @param theDistance The translation distance.
5394 # @param theCopy Flag used to translate object itself or create a copy.
5395 # @return New GEOM.GEOM_Object, containing the translated object.
5397 # @ref tui_translation "Example"
5398 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5400 Translate the given object along the given vector on given distance.
5403 theObject The object to be translated.
5404 theVector The translation vector.
5405 theDistance The translation distance.
5406 theCopy Flag used to translate object itself or create a copy.
5409 New GEOM.GEOM_Object, containing the translated object.
5411 # Example: see GEOM_TestAll.py
5412 theDistance,Parameters = ParseParameters(theDistance)
5413 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5414 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5415 anObj.SetParameters(Parameters)
5418 ## Translate the given object along the given vector on given distance,
5419 # creating its copy before the translation.
5420 # @param theObject The object to be translated.
5421 # @param theVector The translation vector.
5422 # @param theDistance The translation distance.
5423 # @return New GEOM.GEOM_Object, containing the translated object.
5425 # @ref tui_translation "Example"
5426 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5428 Translate the given object along the given vector on given distance,
5429 creating its copy before the translation.
5432 theObject The object to be translated.
5433 theVector The translation vector.
5434 theDistance The translation distance.
5437 New GEOM.GEOM_Object, containing the translated object.
5439 # Example: see GEOM_TestAll.py
5440 theDistance,Parameters = ParseParameters(theDistance)
5441 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5442 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5443 anObj.SetParameters(Parameters)
5446 ## Rotate the given object around the given axis on the given angle.
5447 # @param theObject The object to be rotated.
5448 # @param theAxis Rotation axis.
5449 # @param theAngle Rotation angle in radians.
5450 # @return New GEOM.GEOM_Object, containing the rotated object.
5452 # @ref tui_rotation "Example"
5453 def Rotate(self,theObject, theAxis, theAngle):
5455 Rotate the given object around the given axis on the given angle.
5458 theObject The object to be rotated.
5459 theAxis Rotation axis.
5460 theAngle Rotation angle in radians.
5463 New GEOM.GEOM_Object, containing the rotated object.
5465 # Example: see GEOM_TestAll.py
5467 if isinstance(theAngle,str):
5469 theAngle, Parameters = ParseParameters(theAngle)
5471 theAngle = theAngle*math.pi/180.0
5472 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5473 RaiseIfFailed("RotateCopy", self.TrsfOp)
5474 anObj.SetParameters(Parameters)
5477 ## Rotate the given object around the given axis
5478 # on the given angle, creating its copy before the rotatation.
5479 # @param theObject The object to be rotated.
5480 # @param theAxis Rotation axis.
5481 # @param theAngle Rotation angle in radians.
5482 # @return New GEOM.GEOM_Object, containing the rotated object.
5484 # @ref tui_rotation "Example"
5485 def MakeRotation(self,theObject, theAxis, theAngle):
5487 Rotate the given object around the given axis
5488 on the given angle, creating its copy before the rotatation.
5491 theObject The object to be rotated.
5492 theAxis Rotation axis.
5493 theAngle Rotation angle in radians.
5496 New GEOM.GEOM_Object, containing the rotated object.
5498 # Example: see GEOM_TestAll.py
5500 if isinstance(theAngle,str):
5502 theAngle, Parameters = ParseParameters(theAngle)
5504 theAngle = theAngle*math.pi/180.0
5505 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5506 RaiseIfFailed("RotateCopy", self.TrsfOp)
5507 anObj.SetParameters(Parameters)
5510 ## Rotate given object around vector perpendicular to plane
5511 # containing three points, creating its copy before the rotatation.
5512 # @param theObject The object to be rotated.
5513 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5514 # containing the three points.
5515 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5516 # @return New GEOM.GEOM_Object, containing the rotated object.
5518 # @ref tui_rotation "Example"
5519 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5521 Rotate given object around vector perpendicular to plane
5522 containing three points, creating its copy before the rotatation.
5525 theObject The object to be rotated.
5526 theCentPoint central point the axis is the vector perpendicular to the plane
5527 containing the three points.
5528 thePoint1,thePoint2 in a perpendicular plane of the axis.
5531 New GEOM.GEOM_Object, containing the rotated object.
5533 # Example: see GEOM_TestAll.py
5534 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5535 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5538 ## Scale the given object by the factor, creating its copy before the scaling.
5539 # @param theObject The object to be scaled.
5540 # @param thePoint Center point for scaling.
5541 # Passing None for it means scaling relatively the origin of global CS.
5542 # @param theFactor Scaling factor value.
5543 # @return New GEOM.GEOM_Object, containing the scaled shape.
5545 # @ref tui_scale "Example"
5546 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5548 Scale the given object by the factor, creating its copy before the scaling.
5551 theObject The object to be scaled.
5552 thePoint Center point for scaling.
5553 Passing None for it means scaling relatively the origin of global CS.
5554 theFactor Scaling factor value.
5557 New GEOM.GEOM_Object, containing the scaled shape.
5559 # Example: see GEOM_TestAll.py
5560 theFactor, Parameters = ParseParameters(theFactor)
5561 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5562 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5563 anObj.SetParameters(Parameters)
5566 ## Scale the given object by different factors along coordinate axes,
5567 # creating its copy before the scaling.
5568 # @param theObject The object to be scaled.
5569 # @param thePoint Center point for scaling.
5570 # Passing None for it means scaling relatively the origin of global CS.
5571 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5572 # @return New GEOM.GEOM_Object, containing the scaled shape.
5574 # @ref swig_scale "Example"
5575 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5577 Scale the given object by different factors along coordinate axes,
5578 creating its copy before the scaling.
5581 theObject The object to be scaled.
5582 thePoint Center point for scaling.
5583 Passing None for it means scaling relatively the origin of global CS.
5584 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5587 New GEOM.GEOM_Object, containing the scaled shape.
5589 # Example: see GEOM_TestAll.py
5590 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5591 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5592 theFactorX, theFactorY, theFactorZ)
5593 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5594 anObj.SetParameters(Parameters)
5597 ## Create an object, symmetrical
5598 # to the given one relatively the given plane.
5599 # @param theObject The object to be mirrored.
5600 # @param thePlane Plane of symmetry.
5601 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5603 # @ref tui_mirror "Example"
5604 def MakeMirrorByPlane(self,theObject, thePlane):
5606 Create an object, symmetrical to the given one relatively the given plane.
5609 theObject The object to be mirrored.
5610 thePlane Plane of symmetry.
5613 New GEOM.GEOM_Object, containing the mirrored shape.
5615 # Example: see GEOM_TestAll.py
5616 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5617 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5620 ## Create an object, symmetrical
5621 # to the given one relatively the given axis.
5622 # @param theObject The object to be mirrored.
5623 # @param theAxis Axis of symmetry.
5624 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5626 # @ref tui_mirror "Example"
5627 def MakeMirrorByAxis(self,theObject, theAxis):
5629 Create an object, symmetrical to the given one relatively the given axis.
5632 theObject The object to be mirrored.
5633 theAxis Axis of symmetry.
5636 New GEOM.GEOM_Object, containing the mirrored shape.
5638 # Example: see GEOM_TestAll.py
5639 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5640 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5643 ## Create an object, symmetrical
5644 # to the given one relatively the given point.
5645 # @param theObject The object to be mirrored.
5646 # @param thePoint Point of symmetry.
5647 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5649 # @ref tui_mirror "Example"
5650 def MakeMirrorByPoint(self,theObject, thePoint):
5652 Create an object, symmetrical
5653 to the given one relatively the given point.
5656 theObject The object to be mirrored.
5657 thePoint Point of symmetry.
5660 New GEOM.GEOM_Object, containing the mirrored shape.
5662 # Example: see GEOM_TestAll.py
5663 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5664 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5667 ## Modify the Location of the given object by LCS,
5668 # creating its copy before the setting.
5669 # @param theObject The object to be displaced.
5670 # @param theStartLCS Coordinate system to perform displacement from it.\n
5671 # If \a theStartLCS is NULL, displacement
5672 # will be performed from global CS.\n
5673 # If \a theObject itself is used as \a theStartLCS,
5674 # its location will be changed to \a theEndLCS.
5675 # @param theEndLCS Coordinate system to perform displacement to it.
5676 # @return New GEOM.GEOM_Object, containing the displaced shape.
5678 # @ref tui_modify_location "Example"
5679 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5681 Modify the Location of the given object by LCS, creating its copy before the setting.
5684 theObject The object to be displaced.
5685 theStartLCS Coordinate system to perform displacement from it.
5686 If theStartLCS is NULL, displacement
5687 will be performed from global CS.
5688 If theObject itself is used as theStartLCS,
5689 its location will be changed to theEndLCS.
5690 theEndLCS Coordinate system to perform displacement to it.
5693 New GEOM.GEOM_Object, containing the displaced shape.
5696 # create local coordinate systems
5697 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5698 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5699 # modify the location of the given object
5700 position = geompy.MakePosition(cylinder, cs1, cs2)
5702 # Example: see GEOM_TestAll.py
5703 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5704 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5707 ## Modify the Location of the given object by Path,
5708 # @param theObject The object to be displaced.
5709 # @param thePath Wire or Edge along that the object will be translated.
5710 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5711 # @param theCopy is to create a copy objects if true.
5712 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5713 # @return New GEOM.GEOM_Object, containing the displaced shape.
5715 # @ref tui_modify_location "Example"
5716 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5718 Modify the Location of the given object by Path
5721 theObject The object to be displaced.
5722 thePath Wire or Edge along that the object will be translated.
5723 theDistance progress of Path (0 = start location, 1 = end of path location).
5724 theCopy is to create a copy objects if true.
5725 theReverse 0 - for usual direction, 1 - to reverse path direction.
5728 New GEOM.GEOM_Object, containing the displaced shape.
5731 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5733 # Example: see GEOM_TestAll.py
5734 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5735 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5738 ## Create new object as offset of the given one.
5739 # @param theObject The base object for the offset.
5740 # @param theOffset Offset value.
5741 # @return New GEOM.GEOM_Object, containing the offset object.
5743 # @ref tui_offset "Example"
5744 def MakeOffset(self,theObject, theOffset):
5746 Create new object as offset of the given one.
5749 theObject The base object for the offset.
5750 theOffset Offset value.
5753 New GEOM.GEOM_Object, containing the offset object.
5756 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5757 # create a new object as offset of the given object
5758 offset = geompy.MakeOffset(box, 70.)
5760 # Example: see GEOM_TestAll.py
5761 theOffset, Parameters = ParseParameters(theOffset)
5762 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5763 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5764 anObj.SetParameters(Parameters)
5767 ## Create new object as projection of the given one on a 2D surface.
5768 # @param theSource The source object for the projection. It can be a point, edge or wire.
5769 # @param theTarget The target object. It can be planar or cylindrical face.
5770 # @return New GEOM.GEOM_Object, containing the projection.
5772 # @ref tui_projection "Example"
5773 def MakeProjection(self, theSource, theTarget):
5775 Create new object as projection of the given one on a 2D surface.
5778 theSource The source object for the projection. It can be a point, edge or wire.
5779 theTarget The target object. It can be planar or cylindrical face.
5782 New GEOM.GEOM_Object, containing the projection.
5784 # Example: see GEOM_TestAll.py
5785 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5786 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5789 # -----------------------------------------------------------------------------
5791 # -----------------------------------------------------------------------------
5793 ## Translate the given object along the given vector a given number times
5794 # @param theObject The object to be translated.
5795 # @param theVector Direction of the translation.
5796 # @param theStep Distance to translate on.
5797 # @param theNbTimes Quantity of translations to be done.
5798 # @return New GEOM.GEOM_Object, containing compound of all
5799 # the shapes, obtained after each translation.
5801 # @ref tui_multi_translation "Example"
5802 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5804 Translate the given object along the given vector a given number times
5807 theObject The object to be translated.
5808 theVector Direction of the translation.
5809 theStep Distance to translate on.
5810 theNbTimes Quantity of translations to be done.
5813 New GEOM.GEOM_Object, containing compound of all
5814 the shapes, obtained after each translation.
5817 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5819 # Example: see GEOM_TestAll.py
5820 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5821 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5822 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5823 anObj.SetParameters(Parameters)
5826 ## Conseqently apply two specified translations to theObject specified number of times.
5827 # @param theObject The object to be translated.
5828 # @param theVector1 Direction of the first translation.
5829 # @param theStep1 Step of the first translation.
5830 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5831 # @param theVector2 Direction of the second translation.
5832 # @param theStep2 Step of the second translation.
5833 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5834 # @return New GEOM.GEOM_Object, containing compound of all
5835 # the shapes, obtained after each translation.
5837 # @ref tui_multi_translation "Example"
5838 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5839 theVector2, theStep2, theNbTimes2):
5841 Conseqently apply two specified translations to theObject specified number of times.
5844 theObject The object to be translated.
5845 theVector1 Direction of the first translation.
5846 theStep1 Step of the first translation.
5847 theNbTimes1 Quantity of translations to be done along theVector1.
5848 theVector2 Direction of the second translation.
5849 theStep2 Step of the second translation.
5850 theNbTimes2 Quantity of translations to be done along theVector2.
5853 New GEOM.GEOM_Object, containing compound of all
5854 the shapes, obtained after each translation.
5857 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5859 # Example: see GEOM_TestAll.py
5860 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5861 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5862 theVector2, theStep2, theNbTimes2)
5863 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5864 anObj.SetParameters(Parameters)
5867 ## Rotate the given object around the given axis a given number times.
5868 # Rotation angle will be 2*PI/theNbTimes.
5869 # @param theObject The object to be rotated.
5870 # @param theAxis The rotation axis.
5871 # @param theNbTimes Quantity of rotations to be done.
5872 # @return New GEOM.GEOM_Object, containing compound of all the
5873 # shapes, obtained after each rotation.
5875 # @ref tui_multi_rotation "Example"
5876 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5878 Rotate the given object around the given axis a given number times.
5879 Rotation angle will be 2*PI/theNbTimes.
5882 theObject The object to be rotated.
5883 theAxis The rotation axis.
5884 theNbTimes Quantity of rotations to be done.
5887 New GEOM.GEOM_Object, containing compound of all the
5888 shapes, obtained after each rotation.
5891 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5893 # Example: see GEOM_TestAll.py
5894 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5895 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5896 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5897 anObj.SetParameters(Parameters)
5900 ## Rotate the given object around the
5901 # given axis on the given angle a given number
5902 # times and multi-translate each rotation result.
5903 # Translation direction passes through center of gravity
5904 # of rotated shape and its projection on the rotation axis.
5905 # @param theObject The object to be rotated.
5906 # @param theAxis Rotation axis.
5907 # @param theAngle Rotation angle in graduces.
5908 # @param theNbTimes1 Quantity of rotations to be done.
5909 # @param theStep Translation distance.
5910 # @param theNbTimes2 Quantity of translations to be done.
5911 # @return New GEOM.GEOM_Object, containing compound of all the
5912 # shapes, obtained after each transformation.
5914 # @ref tui_multi_rotation "Example"
5915 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5917 Rotate the given object around the
5918 given axis on the given angle a given number
5919 times and multi-translate each rotation result.
5920 Translation direction passes through center of gravity
5921 of rotated shape and its projection on the rotation axis.
5924 theObject The object to be rotated.
5925 theAxis Rotation axis.
5926 theAngle Rotation angle in graduces.
5927 theNbTimes1 Quantity of rotations to be done.
5928 theStep Translation distance.
5929 theNbTimes2 Quantity of translations to be done.
5932 New GEOM.GEOM_Object, containing compound of all the
5933 shapes, obtained after each transformation.
5936 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
5938 # Example: see GEOM_TestAll.py
5939 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
5940 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
5941 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
5942 anObj.SetParameters(Parameters)
5945 ## The same, as MultiRotate1D(), but axis is given by direction and point
5947 # @ref swig_MakeMultiRotation "Example"
5948 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
5950 The same, as geompy.MultiRotate1D, but axis is given by direction and point
5953 pz = geompy.MakeVertex(0, 0, 100)
5954 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5955 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
5957 # Example: see GEOM_TestOthers.py
5958 aVec = self.MakeLine(aPoint,aDir)
5959 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
5962 ## The same, as MultiRotate2D(), but axis is given by direction and point
5964 # @ref swig_MakeMultiRotation "Example"
5965 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
5967 The same, as MultiRotate2D(), but axis is given by direction and point
5970 pz = geompy.MakeVertex(0, 0, 100)
5971 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5972 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
5974 # Example: see GEOM_TestOthers.py
5975 aVec = self.MakeLine(aPoint,aDir)
5976 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
5979 # end of l3_transform
5982 ## @addtogroup l3_local
5985 ## Perform a fillet on all edges of the given shape.
5986 # @param theShape Shape, to perform fillet on.
5987 # @param theR Fillet radius.
5988 # @return New GEOM.GEOM_Object, containing the result shape.
5990 # @ref tui_fillet "Example 1"
5991 # \n @ref swig_MakeFilletAll "Example 2"
5992 def MakeFilletAll(self,theShape, theR):
5994 Perform a fillet on all edges of the given shape.
5997 theShape Shape, to perform fillet on.
6001 New GEOM.GEOM_Object, containing the result shape.
6004 filletall = geompy.MakeFilletAll(prism, 10.)
6006 # Example: see GEOM_TestOthers.py
6007 theR,Parameters = ParseParameters(theR)
6008 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
6009 RaiseIfFailed("MakeFilletAll", self.LocalOp)
6010 anObj.SetParameters(Parameters)
6013 ## Perform a fillet on the specified edges/faces of the given shape
6014 # @param theShape Shape, to perform fillet on.
6015 # @param theR Fillet radius.
6016 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
6017 # @param theListShapes Global indices of edges/faces to perform fillet on.
6018 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6019 # @return New GEOM.GEOM_Object, containing the result shape.
6021 # @ref tui_fillet "Example"
6022 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
6024 Perform a fillet on the specified edges/faces of the given shape
6027 theShape Shape, to perform fillet on.
6029 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
6030 theListShapes Global indices of edges/faces to perform fillet on.
6033 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6036 New GEOM.GEOM_Object, containing the result shape.
6039 # get the list of IDs (IDList) for the fillet
6040 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6042 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6043 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6044 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6045 # make a fillet on the specified edges of the given shape
6046 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
6048 # Example: see GEOM_TestAll.py
6049 theR,Parameters = ParseParameters(theR)
6051 if theShapeType == ShapeType["EDGE"]:
6052 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6053 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6055 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6056 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6057 anObj.SetParameters(Parameters)
6060 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6061 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6063 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6066 # get the list of IDs (IDList) for the fillet
6067 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6069 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6070 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6071 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6072 # make a fillet on the specified edges of the given shape
6073 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6075 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6077 if theShapeType == ShapeType["EDGE"]:
6078 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6079 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6081 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6082 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6083 anObj.SetParameters(Parameters)
6086 ## Perform a fillet on the specified edges of the given shape
6087 # @param theShape Wire Shape to perform fillet on.
6088 # @param theR Fillet radius.
6089 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6090 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6091 # \note The list of vertices could be empty,
6092 # in this case fillet will done done at all vertices in wire
6093 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6094 # by the length of the edges, nearest to the fillet vertex.
6095 # But sometimes the next edge is C1 continuous with the one, nearest to
6096 # the fillet point, and such two (or more) edges can be united to allow
6097 # bigger radius. Set this flag to TRUE to allow collinear edges union,
6098 # thus ignoring the secant vertex (vertices).
6099 # @return New GEOM.GEOM_Object, containing the result shape.
6101 # @ref tui_fillet2d "Example"
6102 def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6104 Perform a fillet on the specified edges of the given shape
6107 theShape Wire Shape to perform fillet on.
6109 theListOfVertexes Global indices of vertexes to perform fillet on.
6110 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6111 by the length of the edges, nearest to the fillet vertex.
6112 But sometimes the next edge is C1 continuous with the one, nearest to
6113 the fillet point, and such two (or more) edges can be united to allow
6114 bigger radius. Set this flag to TRUE to allow collinear edges union,
6115 thus ignoring the secant vertex (vertices).
6117 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6119 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6122 New GEOM.GEOM_Object, containing the result shape.
6126 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6127 # make fillet at given wire vertices with giver radius
6128 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6130 # Example: see GEOM_TestAll.py
6131 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6132 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6133 RaiseIfFailed("MakeFillet1D", self.LocalOp)
6134 anObj.SetParameters(Parameters)
6137 ## Perform a fillet at the specified vertices of the given face/shell.
6138 # @param theShape Face or Shell shape to perform fillet on.
6139 # @param theR Fillet radius.
6140 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6141 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6142 # @return New GEOM.GEOM_Object, containing the result shape.
6144 # @ref tui_fillet2d "Example"
6145 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6147 Perform a fillet at the specified vertices of the given face/shell.
6150 theShape Face or Shell shape to perform fillet on.
6152 theListOfVertexes Global indices of vertexes to perform fillet on.
6154 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6157 New GEOM.GEOM_Object, containing the result shape.
6160 face = geompy.MakeFaceHW(100, 100, 1)
6161 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6163 # Example: see GEOM_TestAll.py
6164 theR,Parameters = ParseParameters(theR)
6165 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6166 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6167 anObj.SetParameters(Parameters)
6170 ## Perform a symmetric chamfer on all edges of the given shape.
6171 # @param theShape Shape, to perform chamfer on.
6172 # @param theD Chamfer size along each face.
6173 # @return New GEOM.GEOM_Object, containing the result shape.
6175 # @ref tui_chamfer "Example 1"
6176 # \n @ref swig_MakeChamferAll "Example 2"
6177 def MakeChamferAll(self,theShape, theD):
6179 Perform a symmetric chamfer on all edges of the given shape.
6182 theShape Shape, to perform chamfer on.
6183 theD Chamfer size along each face.
6186 New GEOM.GEOM_Object, containing the result shape.
6189 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6191 # Example: see GEOM_TestOthers.py
6192 theD,Parameters = ParseParameters(theD)
6193 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6194 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6195 anObj.SetParameters(Parameters)
6198 ## Perform a chamfer on edges, common to the specified faces,
6199 # with distance D1 on the Face1
6200 # @param theShape Shape, to perform chamfer on.
6201 # @param theD1 Chamfer size along \a theFace1.
6202 # @param theD2 Chamfer size along \a theFace2.
6203 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6204 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6205 # @return New GEOM.GEOM_Object, containing the result shape.
6207 # @ref tui_chamfer "Example"
6208 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6210 Perform a chamfer on edges, common to the specified faces,
6211 with distance D1 on the Face1
6214 theShape Shape, to perform chamfer on.
6215 theD1 Chamfer size along theFace1.
6216 theD2 Chamfer size along theFace2.
6217 theFace1,theFace2 Global indices of two faces of theShape.
6220 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6223 New GEOM.GEOM_Object, containing the result shape.
6226 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6227 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6228 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6229 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6231 # Example: see GEOM_TestAll.py
6232 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6233 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6234 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6235 anObj.SetParameters(Parameters)
6238 ## Perform a chamfer on edges
6239 # @param theShape Shape, to perform chamfer on.
6240 # @param theD Chamfer length
6241 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6242 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6243 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6244 # @return New GEOM.GEOM_Object, containing the result shape.
6245 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6247 Perform a chamfer on edges
6250 theShape Shape, to perform chamfer on.
6251 theD1 Chamfer size along theFace1.
6252 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6253 theFace1,theFace2 Global indices of two faces of theShape.
6256 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6259 New GEOM.GEOM_Object, containing the result shape.
6262 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6263 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6264 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6266 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6269 if isinstance(theAngle,str):
6271 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6273 theAngle = theAngle*math.pi/180.0
6274 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6275 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6276 anObj.SetParameters(Parameters)
6279 ## Perform a chamfer on all edges of the specified faces,
6280 # with distance D1 on the first specified face (if several for one edge)
6281 # @param theShape Shape, to perform chamfer on.
6282 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6283 # connected to the edge, are in \a theFaces, \a theD1
6284 # will be get along face, which is nearer to \a theFaces beginning.
6285 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6286 # @param theFaces Sequence of global indices of faces of \a theShape.
6287 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6288 # @return New GEOM.GEOM_Object, containing the result shape.
6290 # @ref tui_chamfer "Example"
6291 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6293 Perform a chamfer on all edges of the specified faces,
6294 with distance D1 on the first specified face (if several for one edge)
6297 theShape Shape, to perform chamfer on.
6298 theD1 Chamfer size along face from theFaces. If both faces,
6299 connected to the edge, are in theFaces, theD1
6300 will be get along face, which is nearer to theFaces beginning.
6301 theD2 Chamfer size along another of two faces, connected to the edge.
6302 theFaces Sequence of global indices of faces of theShape.
6305 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6308 New GEOM.GEOM_Object, containing the result shape.
6310 # Example: see GEOM_TestAll.py
6311 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6312 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6313 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6314 anObj.SetParameters(Parameters)
6317 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6318 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6320 # @ref swig_FilletChamfer "Example"
6321 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6323 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6324 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6327 if isinstance(theAngle,str):
6329 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6331 theAngle = theAngle*math.pi/180.0
6332 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6333 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6334 anObj.SetParameters(Parameters)
6337 ## Perform a chamfer on edges,
6338 # with distance D1 on the first specified face (if several for one edge)
6339 # @param theShape Shape, to perform chamfer on.
6340 # @param theD1,theD2 Chamfer size
6341 # @param theEdges Sequence of edges of \a theShape.
6342 # @return New GEOM.GEOM_Object, containing the result shape.
6344 # @ref swig_FilletChamfer "Example"
6345 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6347 Perform a chamfer on edges,
6348 with distance D1 on the first specified face (if several for one edge)
6351 theShape Shape, to perform chamfer on.
6352 theD1,theD2 Chamfer size
6353 theEdges Sequence of edges of theShape.
6356 New GEOM.GEOM_Object, containing the result shape.
6358 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6359 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6360 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6361 anObj.SetParameters(Parameters)
6364 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6365 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6366 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6368 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6369 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6372 if isinstance(theAngle,str):
6374 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6376 theAngle = theAngle*math.pi/180.0
6377 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6378 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6379 anObj.SetParameters(Parameters)
6382 ## /sa MakeChamferEdge() and MakeChamferFaces()
6384 # @ref swig_MakeChamfer "Example"
6385 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6387 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6389 # Example: see GEOM_TestOthers.py
6391 if aShapeType == ShapeType["EDGE"]:
6392 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6394 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6397 ## Remove material from a solid by extrusion of the base shape on the given distance.
6398 # @param theInit Shape to remove material from. It must be a solid or
6399 # a compound made of a single solid.
6400 # @param theBase Closed edge or wire defining the base shape to be extruded.
6401 # @param theH Prism dimension along the normal to theBase
6402 # @param theAngle Draft angle in degrees.
6403 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6405 # @ref tui_creation_prism "Example"
6406 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6408 Add material to a solid by extrusion of the base shape on the given distance.
6411 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6412 theBase Closed edge or wire defining the base shape to be extruded.
6413 theH Prism dimension along the normal to theBase
6414 theAngle Draft angle in degrees.
6417 New GEOM.GEOM_Object, containing the initial shape with removed material.
6419 # Example: see GEOM_TestAll.py
6420 #theH,Parameters = ParseParameters(theH)
6421 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6422 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6423 #anObj.SetParameters(Parameters)
6426 ## Add material to a solid by extrusion of the base shape on the given distance.
6427 # @param theInit Shape to add material to. It must be a solid or
6428 # a compound made of a single solid.
6429 # @param theBase Closed edge or wire defining the base shape to be extruded.
6430 # @param theH Prism dimension along the normal to theBase
6431 # @param theAngle Draft angle in degrees.
6432 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6434 # @ref tui_creation_prism "Example"
6435 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6437 Add material to a solid by extrusion of the base shape on the given distance.
6440 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6441 theBase Closed edge or wire defining the base shape to be extruded.
6442 theH Prism dimension along the normal to theBase
6443 theAngle Draft angle in degrees.
6446 New GEOM.GEOM_Object, containing the initial shape with added material.
6448 # Example: see GEOM_TestAll.py
6449 #theH,Parameters = ParseParameters(theH)
6450 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6451 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6452 #anObj.SetParameters(Parameters)
6458 ## @addtogroup l3_basic_op
6461 ## Perform an Archimde operation on the given shape with given parameters.
6462 # The object presenting the resulting face is returned.
6463 # @param theShape Shape to be put in water.
6464 # @param theWeight Weight og the shape.
6465 # @param theWaterDensity Density of the water.
6466 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6467 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6468 # by a plane, corresponding to water level.
6470 # @ref tui_archimede "Example"
6471 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6473 Perform an Archimde operation on the given shape with given parameters.
6474 The object presenting the resulting face is returned.
6477 theShape Shape to be put in water.
6478 theWeight Weight og the shape.
6479 theWaterDensity Density of the water.
6480 theMeshDeflection Deflection of the mesh, using to compute the section.
6483 New GEOM.GEOM_Object, containing a section of theShape
6484 by a plane, corresponding to water level.
6486 # Example: see GEOM_TestAll.py
6487 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6488 theWeight,theWaterDensity,theMeshDeflection)
6489 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6490 RaiseIfFailed("MakeArchimede", self.LocalOp)
6491 anObj.SetParameters(Parameters)
6494 # end of l3_basic_op
6497 ## @addtogroup l2_measure
6500 ## Get point coordinates
6503 # @ref tui_measurement_tools_page "Example"
6504 def PointCoordinates(self,Point):
6506 Get point coordinates
6511 # Example: see GEOM_TestMeasures.py
6512 aTuple = self.MeasuOp.PointCoordinates(Point)
6513 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6516 ## Get summarized length of all wires,
6517 # area of surface and volume of the given shape.
6518 # @param theShape Shape to define properties of.
6519 # @return [theLength, theSurfArea, theVolume]\n
6520 # theLength: Summarized length of all wires of the given shape.\n
6521 # theSurfArea: Area of surface of the given shape.\n
6522 # theVolume: Volume of the given shape.
6524 # @ref tui_measurement_tools_page "Example"
6525 def BasicProperties(self,theShape):
6527 Get summarized length of all wires,
6528 area of surface and volume of the given shape.
6531 theShape Shape to define properties of.
6534 [theLength, theSurfArea, theVolume]
6535 theLength: Summarized length of all wires of the given shape.
6536 theSurfArea: Area of surface of the given shape.
6537 theVolume: Volume of the given shape.
6539 # Example: see GEOM_TestMeasures.py
6540 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6541 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6544 ## Get parameters of bounding box of the given shape
6545 # @param theShape Shape to obtain bounding box of.
6546 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6547 # Xmin,Xmax: Limits of shape along OX axis.
6548 # Ymin,Ymax: Limits of shape along OY axis.
6549 # Zmin,Zmax: Limits of shape along OZ axis.
6551 # @ref tui_measurement_tools_page "Example"
6552 def BoundingBox(self,theShape):
6554 Get parameters of bounding box of the given shape
6557 theShape Shape to obtain bounding box of.
6560 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6561 Xmin,Xmax: Limits of shape along OX axis.
6562 Ymin,Ymax: Limits of shape along OY axis.
6563 Zmin,Zmax: Limits of shape along OZ axis.
6565 # Example: see GEOM_TestMeasures.py
6566 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6567 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6570 ## Get inertia matrix and moments of inertia of theShape.
6571 # @param theShape Shape to calculate inertia of.
6572 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6573 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6574 # Ix,Iy,Iz: Moments of inertia of the given shape.
6576 # @ref tui_measurement_tools_page "Example"
6577 def Inertia(self,theShape):
6579 Get inertia matrix and moments of inertia of theShape.
6582 theShape Shape to calculate inertia of.
6585 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6586 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6587 Ix,Iy,Iz: Moments of inertia of the given shape.
6589 # Example: see GEOM_TestMeasures.py
6590 aTuple = self.MeasuOp.GetInertia(theShape)
6591 RaiseIfFailed("GetInertia", self.MeasuOp)
6594 ## Get if coords are included in the shape (ST_IN or ST_ON)
6595 # @param theShape Shape
6596 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6597 # @param tolerance to be used (default is 1.0e-7)
6598 # @return list_of_boolean = [res1, res2, ...]
6599 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6601 Get if coords are included in the shape (ST_IN or ST_ON)
6605 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6606 tolerance to be used (default is 1.0e-7)
6609 list_of_boolean = [res1, res2, ...]
6611 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6613 ## Get minimal distance between the given shapes.
6614 # @param theShape1,theShape2 Shapes to find minimal distance between.
6615 # @return Value of the minimal distance between the given shapes.
6617 # @ref tui_measurement_tools_page "Example"
6618 def MinDistance(self, theShape1, theShape2):
6620 Get minimal distance between the given shapes.
6623 theShape1,theShape2 Shapes to find minimal distance between.
6626 Value of the minimal distance between the given shapes.
6628 # Example: see GEOM_TestMeasures.py
6629 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6630 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6633 ## Get minimal distance between the given shapes.
6634 # @param theShape1,theShape2 Shapes to find minimal distance between.
6635 # @return Value of the minimal distance between the given shapes.
6637 # @ref swig_all_measure "Example"
6638 def MinDistanceComponents(self, theShape1, theShape2):
6640 Get minimal distance between the given shapes.
6643 theShape1,theShape2 Shapes to find minimal distance between.
6646 Value of the minimal distance between the given shapes.
6648 # Example: see GEOM_TestMeasures.py
6649 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6650 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6651 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6654 ## Get angle between the given shapes in degrees.
6655 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6656 # @note If both arguments are vectors, the angle is computed in accordance
6657 # with their orientations, otherwise the minimum angle is computed.
6658 # @return Value of the angle between the given shapes in degrees.
6660 # @ref tui_measurement_tools_page "Example"
6661 def GetAngle(self, theShape1, theShape2):
6663 Get angle between the given shapes in degrees.
6666 theShape1,theShape2 Lines or linear edges to find angle between.
6669 If both arguments are vectors, the angle is computed in accordance
6670 with their orientations, otherwise the minimum angle is computed.
6673 Value of the angle between the given shapes in degrees.
6675 # Example: see GEOM_TestMeasures.py
6676 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6677 RaiseIfFailed("GetAngle", self.MeasuOp)
6680 ## Get angle between the given shapes in radians.
6681 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6682 # @note If both arguments are vectors, the angle is computed in accordance
6683 # with their orientations, otherwise the minimum angle is computed.
6684 # @return Value of the angle between the given shapes in radians.
6686 # @ref tui_measurement_tools_page "Example"
6687 def GetAngleRadians(self, theShape1, theShape2):
6689 Get angle between the given shapes in radians.
6692 theShape1,theShape2 Lines or linear edges to find angle between.
6696 If both arguments are vectors, the angle is computed in accordance
6697 with their orientations, otherwise the minimum angle is computed.
6700 Value of the angle between the given shapes in radians.
6702 # Example: see GEOM_TestMeasures.py
6703 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6704 RaiseIfFailed("GetAngle", self.MeasuOp)
6707 ## Get angle between the given vectors in degrees.
6708 # @param theShape1,theShape2 Vectors to find angle between.
6709 # @param theFlag If True, the normal vector is defined by the two vectors cross,
6710 # if False, the opposite vector to the normal vector is used.
6711 # @return Value of the angle between the given vectors in degrees.
6713 # @ref tui_measurement_tools_page "Example"
6714 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6716 Get angle between the given vectors in degrees.
6719 theShape1,theShape2 Vectors to find angle between.
6720 theFlag If True, the normal vector is defined by the two vectors cross,
6721 if False, the opposite vector to the normal vector is used.
6724 Value of the angle between the given vectors in degrees.
6726 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6728 anAngle = 360. - anAngle
6729 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6732 ## The same as GetAngleVectors, but the result is in radians.
6733 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6735 Get angle between the given vectors in radians.
6738 theShape1,theShape2 Vectors to find angle between.
6739 theFlag If True, the normal vector is defined by the two vectors cross,
6740 if False, the opposite vector to the normal vector is used.
6743 Value of the angle between the given vectors in radians.
6745 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6748 ## @name Curve Curvature Measurement
6749 # Methods for receiving radius of curvature of curves
6750 # in the given point
6753 ## Measure curvature of a curve at a point, set by parameter.
6754 # @param theCurve a curve.
6755 # @param theParam parameter.
6756 # @return radius of curvature of \a theCurve.
6758 # @ref swig_todo "Example"
6759 def CurveCurvatureByParam(self, theCurve, theParam):
6761 Measure curvature of a curve at a point, set by parameter.
6768 radius of curvature of theCurve.
6770 # Example: see GEOM_TestMeasures.py
6771 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6772 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6775 ## Measure curvature of a curve at a point.
6776 # @param theCurve a curve.
6777 # @param thePoint given point.
6778 # @return radius of curvature of \a theCurve.
6780 # @ref swig_todo "Example"
6781 def CurveCurvatureByPoint(self, theCurve, thePoint):
6783 Measure curvature of a curve at a point.
6787 thePoint given point.
6790 radius of curvature of theCurve.
6792 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6793 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6797 ## @name Surface Curvature Measurement
6798 # Methods for receiving max and min radius of curvature of surfaces
6799 # in the given point
6802 ## Measure max radius of curvature of surface.
6803 # @param theSurf the given surface.
6804 # @param theUParam Value of U-parameter on the referenced surface.
6805 # @param theVParam Value of V-parameter on the referenced surface.
6806 # @return max radius of curvature of theSurf.
6808 ## @ref swig_todo "Example"
6809 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6811 Measure max radius of curvature of surface.
6814 theSurf the given surface.
6815 theUParam Value of U-parameter on the referenced surface.
6816 theVParam Value of V-parameter on the referenced surface.
6819 max radius of curvature of theSurf.
6821 # Example: see GEOM_TestMeasures.py
6822 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6823 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6826 ## Measure max radius of curvature of surface in the given point
6827 # @param theSurf the given surface.
6828 # @param thePoint given point.
6829 # @return max radius of curvature of theSurf.
6831 ## @ref swig_todo "Example"
6832 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6834 Measure max radius of curvature of surface in the given point.
6837 theSurf the given surface.
6838 thePoint given point.
6841 max radius of curvature of theSurf.
6843 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6844 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6847 ## Measure min radius of curvature of surface.
6848 # @param theSurf the given surface.
6849 # @param theUParam Value of U-parameter on the referenced surface.
6850 # @param theVParam Value of V-parameter on the referenced surface.
6851 # @return min radius of curvature of theSurf.
6853 ## @ref swig_todo "Example"
6854 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6856 Measure min radius of curvature of surface.
6859 theSurf the given surface.
6860 theUParam Value of U-parameter on the referenced surface.
6861 theVParam Value of V-parameter on the referenced surface.
6864 Min radius of curvature of theSurf.
6866 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6867 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6870 ## Measure min radius of curvature of surface in the given point
6871 # @param theSurf the given surface.
6872 # @param thePoint given point.
6873 # @return min radius of curvature of theSurf.
6875 ## @ref swig_todo "Example"
6876 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6878 Measure min radius of curvature of surface in the given point.
6881 theSurf the given surface.
6882 thePoint given point.
6885 Min radius of curvature of theSurf.
6887 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6888 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6892 ## Get min and max tolerances of sub-shapes of theShape
6893 # @param theShape Shape, to get tolerances of.
6894 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6895 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
6896 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6897 # VertMin,VertMax: Min and max tolerances of the vertices.
6899 # @ref tui_measurement_tools_page "Example"
6900 def Tolerance(self,theShape):
6902 Get min and max tolerances of sub-shapes of theShape
6905 theShape Shape, to get tolerances of.
6908 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6909 FaceMin,FaceMax: Min and max tolerances of the faces.
6910 EdgeMin,EdgeMax: Min and max tolerances of the edges.
6911 VertMin,VertMax: Min and max tolerances of the vertices.
6913 # Example: see GEOM_TestMeasures.py
6914 aTuple = self.MeasuOp.GetTolerance(theShape)
6915 RaiseIfFailed("GetTolerance", self.MeasuOp)
6918 ## Obtain description of the given shape (number of sub-shapes of each type)
6919 # @param theShape Shape to be described.
6920 # @return Description of the given shape.
6922 # @ref tui_measurement_tools_page "Example"
6923 def WhatIs(self,theShape):
6925 Obtain description of the given shape (number of sub-shapes of each type)
6928 theShape Shape to be described.
6931 Description of the given shape.
6933 # Example: see GEOM_TestMeasures.py
6934 aDescr = self.MeasuOp.WhatIs(theShape)
6935 RaiseIfFailed("WhatIs", self.MeasuOp)
6938 ## Obtain quantity of shapes of the given type in \a theShape.
6939 # If \a theShape is of type \a theType, it is also counted.
6940 # @param theShape Shape to be described.
6941 # @param theType the given ShapeType().
6942 # @return Quantity of shapes of type \a theType in \a theShape.
6944 # @ref tui_measurement_tools_page "Example"
6945 def NbShapes (self, theShape, theType):
6947 Obtain quantity of shapes of the given type in theShape.
6948 If theShape is of type theType, it is also counted.
6951 theShape Shape to be described.
6952 theType the given geompy.ShapeType
6955 Quantity of shapes of type theType in theShape.
6957 # Example: see GEOM_TestMeasures.py
6958 listSh = self.SubShapeAllIDs(theShape, theType)
6960 t = EnumToLong(theShape.GetShapeType())
6961 theType = EnumToLong(theType)
6967 ## Obtain quantity of shapes of each type in \a theShape.
6968 # The \a theShape is also counted.
6969 # @param theShape Shape to be described.
6970 # @return Dictionary of ShapeType() with bound quantities of shapes.
6972 # @ref tui_measurement_tools_page "Example"
6973 def ShapeInfo (self, theShape):
6975 Obtain quantity of shapes of each type in theShape.
6976 The theShape is also counted.
6979 theShape Shape to be described.
6982 Dictionary of geompy.ShapeType with bound quantities of shapes.
6984 # Example: see GEOM_TestMeasures.py
6986 for typeSh in ShapeType:
6987 if typeSh in ( "AUTO", "SHAPE" ): continue
6988 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
6990 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
6997 ## Get a point, situated at the centre of mass of theShape.
6998 # @param theShape Shape to define centre of mass of.
6999 # @return New GEOM.GEOM_Object, containing the created point.
7001 # @ref tui_measurement_tools_page "Example"
7002 def MakeCDG(self,theShape):
7004 Get a point, situated at the centre of mass of theShape.
7007 theShape Shape to define centre of mass of.
7010 New GEOM.GEOM_Object, containing the created point.
7012 # Example: see GEOM_TestMeasures.py
7013 anObj = self.MeasuOp.GetCentreOfMass(theShape)
7014 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
7017 ## Get a vertex sub-shape by index depended with orientation.
7018 # @param theShape Shape to find sub-shape.
7019 # @param theIndex Index to find vertex by this index (starting from zero)
7020 # @return New GEOM.GEOM_Object, containing the created vertex.
7022 # @ref tui_measurement_tools_page "Example"
7023 def GetVertexByIndex(self,theShape, theIndex):
7025 Get a vertex sub-shape by index depended with orientation.
7028 theShape Shape to find sub-shape.
7029 theIndex Index to find vertex by this index (starting from zero)
7032 New GEOM.GEOM_Object, containing the created vertex.
7034 # Example: see GEOM_TestMeasures.py
7035 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
7036 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
7039 ## Get the first vertex of wire/edge depended orientation.
7040 # @param theShape Shape to find first vertex.
7041 # @return New GEOM.GEOM_Object, containing the created vertex.
7043 # @ref tui_measurement_tools_page "Example"
7044 def GetFirstVertex(self,theShape):
7046 Get the first vertex of wire/edge depended orientation.
7049 theShape Shape to find first vertex.
7052 New GEOM.GEOM_Object, containing the created vertex.
7054 # Example: see GEOM_TestMeasures.py
7055 anObj = self.GetVertexByIndex(theShape, 0)
7056 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7059 ## Get the last vertex of wire/edge depended orientation.
7060 # @param theShape Shape to find last vertex.
7061 # @return New GEOM.GEOM_Object, containing the created vertex.
7063 # @ref tui_measurement_tools_page "Example"
7064 def GetLastVertex(self,theShape):
7066 Get the last vertex of wire/edge depended orientation.
7069 theShape Shape to find last vertex.
7072 New GEOM.GEOM_Object, containing the created vertex.
7074 # Example: see GEOM_TestMeasures.py
7075 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7076 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7077 RaiseIfFailed("GetLastVertex", self.MeasuOp)
7080 ## Get a normale to the given face. If the point is not given,
7081 # the normale is calculated at the center of mass.
7082 # @param theFace Face to define normale of.
7083 # @param theOptionalPoint Point to compute the normale at.
7084 # @return New GEOM.GEOM_Object, containing the created vector.
7086 # @ref swig_todo "Example"
7087 def GetNormal(self, theFace, theOptionalPoint = None):
7089 Get a normale to the given face. If the point is not given,
7090 the normale is calculated at the center of mass.
7093 theFace Face to define normale of.
7094 theOptionalPoint Point to compute the normale at.
7097 New GEOM.GEOM_Object, containing the created vector.
7099 # Example: see GEOM_TestMeasures.py
7100 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7101 RaiseIfFailed("GetNormal", self.MeasuOp)
7104 ## Check a topology of the given shape.
7105 # @param theShape Shape to check validity of.
7106 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7107 # if TRUE, the shape's geometry will be checked also.
7108 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7109 # of problem is printed.
7110 # if TRUE and if theShape is invalid, the description
7111 # of problem is also returned.
7112 # @return TRUE, if the shape "seems to be valid".
7114 # @ref tui_measurement_tools_page "Example"
7115 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7117 Check a topology of the given shape.
7120 theShape Shape to check validity of.
7121 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7122 if TRUE, the shape's geometry will be checked also.
7123 theReturnStatus If FALSE and if theShape is invalid, a description
7124 of problem is printed.
7125 if TRUE and if theShape is invalid, the description
7126 of problem is returned.
7129 TRUE, if the shape "seems to be valid".
7130 If theShape is invalid, prints a description of problem.
7131 This description can also be returned.
7133 # Example: see GEOM_TestMeasures.py
7135 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7136 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7138 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7139 RaiseIfFailed("CheckShape", self.MeasuOp)
7141 if theReturnStatus == 0:
7143 if theReturnStatus == 1:
7144 return (IsValid, Status)
7147 ## Detect self-intersections in the given shape.
7148 # @param theShape Shape to check.
7149 # @return TRUE, if the shape contains no self-intersections.
7151 # @ref tui_measurement_tools_page "Example"
7152 def CheckSelfIntersections(self, theShape):
7154 Detect self-intersections in the given shape.
7157 theShape Shape to check.
7160 TRUE, if the shape contains no self-intersections.
7162 # Example: see GEOM_TestMeasures.py
7163 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7164 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7167 ## Get position (LCS) of theShape.
7169 # Origin of the LCS is situated at the shape's center of mass.
7170 # Axes of the LCS are obtained from shape's location or,
7171 # if the shape is a planar face, from position of its plane.
7173 # @param theShape Shape to calculate position of.
7174 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7175 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
7176 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7177 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7179 # @ref swig_todo "Example"
7180 def GetPosition(self,theShape):
7182 Get position (LCS) of theShape.
7183 Origin of the LCS is situated at the shape's center of mass.
7184 Axes of the LCS are obtained from shape's location or,
7185 if the shape is a planar face, from position of its plane.
7188 theShape Shape to calculate position of.
7191 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7192 Ox,Oy,Oz: Coordinates of shape's LCS origin.
7193 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7194 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7196 # Example: see GEOM_TestMeasures.py
7197 aTuple = self.MeasuOp.GetPosition(theShape)
7198 RaiseIfFailed("GetPosition", self.MeasuOp)
7201 ## Get kind of theShape.
7203 # @param theShape Shape to get a kind of.
7204 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7205 # and a list of parameters, describing the shape.
7206 # @note Concrete meaning of each value, returned via \a theIntegers
7207 # or \a theDoubles list depends on the kind() of the shape.
7209 # @ref swig_todo "Example"
7210 def KindOfShape(self,theShape):
7212 Get kind of theShape.
7215 theShape Shape to get a kind of.
7218 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7219 and a list of parameters, describing the shape.
7221 Concrete meaning of each value, returned via theIntegers
7222 or theDoubles list depends on the geompy.kind of the shape
7224 # Example: see GEOM_TestMeasures.py
7225 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7226 RaiseIfFailed("KindOfShape", self.MeasuOp)
7228 aKind = aRoughTuple[0]
7229 anInts = aRoughTuple[1]
7230 aDbls = aRoughTuple[2]
7232 # Now there is no exception from this rule:
7233 aKindTuple = [aKind] + aDbls + anInts
7235 # If they are we will regroup parameters for such kind of shape.
7237 #if aKind == kind.SOME_KIND:
7238 # # SOME_KIND int int double int double double
7239 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7246 ## @addtogroup l2_import_export
7249 ## Import a shape from the BREP or IGES or STEP file
7250 # (depends on given format) with given name.
7251 # @param theFileName The file, containing the shape.
7252 # @param theFormatName Specify format for the file reading.
7253 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7254 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7255 # set to 'meter' and result model will be scaled.
7256 # @return New GEOM.GEOM_Object, containing the imported shape.
7258 # @ref swig_Import_Export "Example"
7259 def ImportFile(self,theFileName, theFormatName):
7261 Import a shape from the BREP or IGES or STEP file
7262 (depends on given format) with given name.
7265 theFileName The file, containing the shape.
7266 theFormatName Specify format for the file reading.
7267 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7268 If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7269 set to 'meter' and result model will be scaled.
7272 New GEOM.GEOM_Object, containing the imported shape.
7274 # Example: see GEOM_TestOthers.py
7275 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7276 RaiseIfFailed("Import", self.InsertOp)
7279 ## Deprecated analog of ImportFile()
7280 def Import(self,theFileName, theFormatName):
7282 Deprecated analog of geompy.ImportFile
7284 print "WARNING: Function Import is deprecated, use ImportFile instead"
7285 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7286 RaiseIfFailed("Import", self.InsertOp)
7289 ## Shortcut to ImportFile() for BREP format
7291 # @ref swig_Import_Export "Example"
7292 def ImportBREP(self,theFileName):
7294 geompy.ImportFile(...) function for BREP format
7296 # Example: see GEOM_TestOthers.py
7297 return self.ImportFile(theFileName, "BREP")
7299 ## Shortcut to ImportFile() for IGES format
7301 # @ref swig_Import_Export "Example"
7302 def ImportIGES(self,theFileName):
7304 geompy.ImportFile(...) function for IGES format
7306 # Example: see GEOM_TestOthers.py
7307 return self.ImportFile(theFileName, "IGES")
7309 ## Return length unit from given IGES file
7311 # @ref swig_Import_Export "Example"
7312 def GetIGESUnit(self,theFileName):
7314 Return length unit from given IGES file
7316 # Example: see GEOM_TestOthers.py
7317 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
7318 #RaiseIfFailed("Import", self.InsertOp)
7319 # recieve name using returned vertex
7321 if anObj.GetShapeType() == GEOM.VERTEX:
7324 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
7326 p = self.PointCoordinates(vertices[0])
7327 if abs(p[0]-0.01) < 1.e-6:
7329 elif abs(p[0]-0.001) < 1.e-6:
7333 ## Shortcut to ImportFile() for STEP format
7335 # @ref swig_Import_Export "Example"
7336 def ImportSTEP(self,theFileName):
7338 geompy.ImportFile(...) function for STEP format
7340 # Example: see GEOM_TestOthers.py
7341 return self.ImportFile(theFileName, "STEP")
7343 ## Read a shape from the binary stream, containing its bounding representation (BRep).
7344 # @note This method will not be dumped to the python script by DumpStudy functionality.
7345 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
7346 # @param theStream The BRep binary stream.
7347 # @return New GEOM_Object, containing the shape, read from theStream.
7349 # @ref swig_Import_Export "Example"
7350 def RestoreShape (self, theStream):
7352 Read a shape from the binary stream, containing its bounding representation (BRep).
7355 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
7358 theStream The BRep binary stream.
7361 New GEOM_Object, containing the shape, read from theStream.
7363 # Example: see GEOM_TestOthers.py
7364 anObj = self.InsertOp.RestoreShape(theStream)
7365 RaiseIfFailed("RestoreShape", self.InsertOp)
7368 ## Export the given shape into a file with given name.
7369 # @param theObject Shape to be stored in the file.
7370 # @param theFileName Name of the file to store the given shape in.
7371 # @param theFormatName Specify format for the shape storage.
7372 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7374 # @ref swig_Import_Export "Example"
7375 def Export(self,theObject, theFileName, theFormatName):
7377 Export the given shape into a file with given name.
7380 theObject Shape to be stored in the file.
7381 theFileName Name of the file to store the given shape in.
7382 theFormatName Specify format for the shape storage.
7383 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7385 # Example: see GEOM_TestOthers.py
7386 self.InsertOp.Export(theObject, theFileName, theFormatName)
7387 if self.InsertOp.IsDone() == 0:
7388 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7392 ## Shortcut to Export() for BREP format
7394 # @ref swig_Import_Export "Example"
7395 def ExportBREP(self,theObject, theFileName):
7397 geompy.Export(...) function for BREP format
7399 # Example: see GEOM_TestOthers.py
7400 return self.Export(theObject, theFileName, "BREP")
7402 ## Shortcut to Export() for IGES format
7404 # @ref swig_Import_Export "Example"
7405 def ExportIGES(self,theObject, theFileName):
7407 geompy.Export(...) function for IGES format
7409 # Example: see GEOM_TestOthers.py
7410 return self.Export(theObject, theFileName, "IGES")
7412 ## Shortcut to Export() for STEP format
7414 # @ref swig_Import_Export "Example"
7415 def ExportSTEP(self,theObject, theFileName):
7417 geompy.Export(...) function for STEP format
7419 # Example: see GEOM_TestOthers.py
7420 return self.Export(theObject, theFileName, "STEP")
7422 # end of l2_import_export
7425 ## @addtogroup l3_blocks
7428 ## Create a quadrangle face from four edges. Order of Edges is not
7429 # important. It is not necessary that edges share the same vertex.
7430 # @param E1,E2,E3,E4 Edges for the face bound.
7431 # @return New GEOM.GEOM_Object, containing the created face.
7433 # @ref tui_building_by_blocks_page "Example"
7434 def MakeQuad(self,E1, E2, E3, E4):
7436 Create a quadrangle face from four edges. Order of Edges is not
7437 important. It is not necessary that edges share the same vertex.
7440 E1,E2,E3,E4 Edges for the face bound.
7443 New GEOM.GEOM_Object, containing the created face.
7446 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7448 # Example: see GEOM_Spanner.py
7449 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7450 RaiseIfFailed("MakeQuad", self.BlocksOp)
7453 ## Create a quadrangle face on two edges.
7454 # The missing edges will be built by creating the shortest ones.
7455 # @param E1,E2 Two opposite edges for the face.
7456 # @return New GEOM.GEOM_Object, containing the created face.
7458 # @ref tui_building_by_blocks_page "Example"
7459 def MakeQuad2Edges(self,E1, E2):
7461 Create a quadrangle face on two edges.
7462 The missing edges will be built by creating the shortest ones.
7465 E1,E2 Two opposite edges for the face.
7468 New GEOM.GEOM_Object, containing the created face.
7472 p1 = geompy.MakeVertex( 0., 0., 0.)
7473 p2 = geompy.MakeVertex(150., 30., 0.)
7474 p3 = geompy.MakeVertex( 0., 120., 50.)
7475 p4 = geompy.MakeVertex( 0., 40., 70.)
7477 edge1 = geompy.MakeEdge(p1, p2)
7478 edge2 = geompy.MakeEdge(p3, p4)
7479 # create a quadrangle face from two edges
7480 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7482 # Example: see GEOM_Spanner.py
7483 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7484 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7487 ## Create a quadrangle face with specified corners.
7488 # The missing edges will be built by creating the shortest ones.
7489 # @param V1,V2,V3,V4 Corner vertices for the face.
7490 # @return New GEOM.GEOM_Object, containing the created face.
7492 # @ref tui_building_by_blocks_page "Example 1"
7493 # \n @ref swig_MakeQuad4Vertices "Example 2"
7494 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7496 Create a quadrangle face with specified corners.
7497 The missing edges will be built by creating the shortest ones.
7500 V1,V2,V3,V4 Corner vertices for the face.
7503 New GEOM.GEOM_Object, containing the created face.
7507 p1 = geompy.MakeVertex( 0., 0., 0.)
7508 p2 = geompy.MakeVertex(150., 30., 0.)
7509 p3 = geompy.MakeVertex( 0., 120., 50.)
7510 p4 = geompy.MakeVertex( 0., 40., 70.)
7511 # create a quadrangle from four points in its corners
7512 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7514 # Example: see GEOM_Spanner.py
7515 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7516 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7519 ## Create a hexahedral solid, bounded by the six given faces. Order of
7520 # faces is not important. It is not necessary that Faces share the same edge.
7521 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7522 # @return New GEOM.GEOM_Object, containing the created solid.
7524 # @ref tui_building_by_blocks_page "Example 1"
7525 # \n @ref swig_MakeHexa "Example 2"
7526 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7528 Create a hexahedral solid, bounded by the six given faces. Order of
7529 faces is not important. It is not necessary that Faces share the same edge.
7532 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7535 New GEOM.GEOM_Object, containing the created solid.
7538 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7540 # Example: see GEOM_Spanner.py
7541 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7542 RaiseIfFailed("MakeHexa", self.BlocksOp)
7545 ## Create a hexahedral solid between two given faces.
7546 # The missing faces will be built by creating the smallest ones.
7547 # @param F1,F2 Two opposite faces for the hexahedral solid.
7548 # @return New GEOM.GEOM_Object, containing the created solid.
7550 # @ref tui_building_by_blocks_page "Example 1"
7551 # \n @ref swig_MakeHexa2Faces "Example 2"
7552 def MakeHexa2Faces(self,F1, F2):
7554 Create a hexahedral solid between two given faces.
7555 The missing faces will be built by creating the smallest ones.
7558 F1,F2 Two opposite faces for the hexahedral solid.
7561 New GEOM.GEOM_Object, containing the created solid.
7564 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7566 # Example: see GEOM_Spanner.py
7567 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7568 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7574 ## @addtogroup l3_blocks_op
7577 ## Get a vertex, found in the given shape by its coordinates.
7578 # @param theShape Block or a compound of blocks.
7579 # @param theX,theY,theZ Coordinates of the sought vertex.
7580 # @param theEpsilon Maximum allowed distance between the resulting
7581 # vertex and point with the given coordinates.
7582 # @return New GEOM.GEOM_Object, containing the found vertex.
7584 # @ref swig_GetPoint "Example"
7585 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7587 Get a vertex, found in the given shape by its coordinates.
7590 theShape Block or a compound of blocks.
7591 theX,theY,theZ Coordinates of the sought vertex.
7592 theEpsilon Maximum allowed distance between the resulting
7593 vertex and point with the given coordinates.
7596 New GEOM.GEOM_Object, containing the found vertex.
7599 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7601 # Example: see GEOM_TestOthers.py
7602 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7603 RaiseIfFailed("GetPoint", self.BlocksOp)
7606 ## Find a vertex of the given shape, which has minimal distance to the given point.
7607 # @param theShape Any shape.
7608 # @param thePoint Point, close to the desired vertex.
7609 # @return New GEOM.GEOM_Object, containing the found vertex.
7611 # @ref swig_GetVertexNearPoint "Example"
7612 def GetVertexNearPoint(self, theShape, thePoint):
7614 Find a vertex of the given shape, which has minimal distance to the given point.
7618 thePoint Point, close to the desired vertex.
7621 New GEOM.GEOM_Object, containing the found vertex.
7624 pmidle = geompy.MakeVertex(50, 0, 50)
7625 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7627 # Example: see GEOM_TestOthers.py
7628 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7629 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7632 ## Get an edge, found in the given shape by two given vertices.
7633 # @param theShape Block or a compound of blocks.
7634 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7635 # @return New GEOM.GEOM_Object, containing the found edge.
7637 # @ref swig_GetEdge "Example"
7638 def GetEdge(self, theShape, thePoint1, thePoint2):
7640 Get an edge, found in the given shape by two given vertices.
7643 theShape Block or a compound of blocks.
7644 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7647 New GEOM.GEOM_Object, containing the found edge.
7649 # Example: see GEOM_Spanner.py
7650 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7651 RaiseIfFailed("GetEdge", self.BlocksOp)
7654 ## Find an edge of the given shape, which has minimal distance to the given point.
7655 # @param theShape Block or a compound of blocks.
7656 # @param thePoint Point, close to the desired edge.
7657 # @return New GEOM.GEOM_Object, containing the found edge.
7659 # @ref swig_GetEdgeNearPoint "Example"
7660 def GetEdgeNearPoint(self, theShape, thePoint):
7662 Find an edge of the given shape, which has minimal distance to the given point.
7665 theShape Block or a compound of blocks.
7666 thePoint Point, close to the desired edge.
7669 New GEOM.GEOM_Object, containing the found edge.
7671 # Example: see GEOM_TestOthers.py
7672 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7673 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7676 ## Returns a face, found in the given shape by four given corner vertices.
7677 # @param theShape Block or a compound of blocks.
7678 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7679 # @return New GEOM.GEOM_Object, containing the found face.
7681 # @ref swig_todo "Example"
7682 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7684 Returns a face, found in the given shape by four given corner vertices.
7687 theShape Block or a compound of blocks.
7688 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7691 New GEOM.GEOM_Object, containing the found face.
7693 # Example: see GEOM_Spanner.py
7694 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7695 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7698 ## Get a face of block, found in the given shape by two given edges.
7699 # @param theShape Block or a compound of blocks.
7700 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7701 # @return New GEOM.GEOM_Object, containing the found face.
7703 # @ref swig_todo "Example"
7704 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7706 Get a face of block, found in the given shape by two given edges.
7709 theShape Block or a compound of blocks.
7710 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7713 New GEOM.GEOM_Object, containing the found face.
7715 # Example: see GEOM_Spanner.py
7716 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7717 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7720 ## Find a face, opposite to the given one in the given block.
7721 # @param theBlock Must be a hexahedral solid.
7722 # @param theFace Face of \a theBlock, opposite to the desired face.
7723 # @return New GEOM.GEOM_Object, containing the found face.
7725 # @ref swig_GetOppositeFace "Example"
7726 def GetOppositeFace(self,theBlock, theFace):
7728 Find a face, opposite to the given one in the given block.
7731 theBlock Must be a hexahedral solid.
7732 theFace Face of theBlock, opposite to the desired face.
7735 New GEOM.GEOM_Object, containing the found face.
7737 # Example: see GEOM_Spanner.py
7738 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7739 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7742 ## Find a face of the given shape, which has minimal distance to the given point.
7743 # @param theShape Block or a compound of blocks.
7744 # @param thePoint Point, close to the desired face.
7745 # @return New GEOM.GEOM_Object, containing the found face.
7747 # @ref swig_GetFaceNearPoint "Example"
7748 def GetFaceNearPoint(self, theShape, thePoint):
7750 Find a face of the given shape, which has minimal distance to the given point.
7753 theShape Block or a compound of blocks.
7754 thePoint Point, close to the desired face.
7757 New GEOM.GEOM_Object, containing the found face.
7759 # Example: see GEOM_Spanner.py
7760 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7761 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7764 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7765 # @param theBlock Block or a compound of blocks.
7766 # @param theVector Vector, close to the normale of the desired face.
7767 # @return New GEOM.GEOM_Object, containing the found face.
7769 # @ref swig_todo "Example"
7770 def GetFaceByNormale(self, theBlock, theVector):
7772 Find a face of block, whose outside normale has minimal angle with the given vector.
7775 theBlock Block or a compound of blocks.
7776 theVector Vector, close to the normale of the desired face.
7779 New GEOM.GEOM_Object, containing the found face.
7781 # Example: see GEOM_Spanner.py
7782 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7783 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7786 ## Find all sub-shapes of type \a theShapeType of the given shape,
7787 # which have minimal distance to the given point.
7788 # @param theShape Any shape.
7789 # @param thePoint Point, close to the desired shape.
7790 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7791 # @param theTolerance The tolerance for distances comparison. All shapes
7792 # with distances to the given point in interval
7793 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7794 # @return New GEOM_Object, containing a group of all found shapes.
7796 # @ref swig_GetShapesNearPoint "Example"
7797 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7799 Find all sub-shapes of type theShapeType of the given shape,
7800 which have minimal distance to the given point.
7804 thePoint Point, close to the desired shape.
7805 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7806 theTolerance The tolerance for distances comparison. All shapes
7807 with distances to the given point in interval
7808 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7811 New GEOM_Object, containing a group of all found shapes.
7813 # Example: see GEOM_TestOthers.py
7814 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7815 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7818 # end of l3_blocks_op
7821 ## @addtogroup l4_blocks_measure
7824 ## Check, if the compound of blocks is given.
7825 # To be considered as a compound of blocks, the
7826 # given shape must satisfy the following conditions:
7827 # - Each element of the compound should be a Block (6 faces and 12 edges).
7828 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7829 # - The compound should be connexe.
7830 # - The glue between two quadrangle faces should be applied.
7831 # @param theCompound The compound to check.
7832 # @return TRUE, if the given shape is a compound of blocks.
7833 # If theCompound is not valid, prints all discovered errors.
7835 # @ref tui_measurement_tools_page "Example 1"
7836 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
7837 def CheckCompoundOfBlocks(self,theCompound):
7839 Check, if the compound of blocks is given.
7840 To be considered as a compound of blocks, the
7841 given shape must satisfy the following conditions:
7842 - Each element of the compound should be a Block (6 faces and 12 edges).
7843 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7844 - The compound should be connexe.
7845 - The glue between two quadrangle faces should be applied.
7848 theCompound The compound to check.
7851 TRUE, if the given shape is a compound of blocks.
7852 If theCompound is not valid, prints all discovered errors.
7854 # Example: see GEOM_Spanner.py
7855 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7856 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7858 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7862 ## Retrieve all non blocks solids and faces from \a theShape.
7863 # @param theShape The shape to explore.
7864 # @return A tuple of two GEOM_Objects. The first object is a group of all
7865 # non block solids (= not 6 faces, or with 6 faces, but with the
7866 # presence of non-quadrangular faces). The second object is a
7867 # group of all non quadrangular faces.
7869 # @ref tui_measurement_tools_page "Example 1"
7870 # \n @ref swig_GetNonBlocks "Example 2"
7871 def GetNonBlocks (self, theShape):
7873 Retrieve all non blocks solids and faces from theShape.
7876 theShape The shape to explore.
7879 A tuple of two GEOM_Objects. The first object is a group of all
7880 non block solids (= not 6 faces, or with 6 faces, but with the
7881 presence of non-quadrangular faces). The second object is a
7882 group of all non quadrangular faces.
7885 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
7887 # Example: see GEOM_Spanner.py
7888 aTuple = self.BlocksOp.GetNonBlocks(theShape)
7889 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
7892 ## Remove all seam and degenerated edges from \a theShape.
7893 # Unite faces and edges, sharing one surface. It means that
7894 # this faces must have references to one C++ surface object (handle).
7895 # @param theShape The compound or single solid to remove irregular edges from.
7896 # @param doUnionFaces If True, then unite faces. If False (the default value),
7897 # do not unite faces.
7898 # @return Improved shape.
7900 # @ref swig_RemoveExtraEdges "Example"
7901 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
7903 Remove all seam and degenerated edges from theShape.
7904 Unite faces and edges, sharing one surface. It means that
7905 this faces must have references to one C++ surface object (handle).
7908 theShape The compound or single solid to remove irregular edges from.
7909 doUnionFaces If True, then unite faces. If False (the default value),
7915 # Example: see GEOM_TestOthers.py
7916 nbFacesOptimum = -1 # -1 means do not unite faces
7917 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
7918 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
7919 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
7922 ## Check, if the given shape is a blocks compound.
7923 # Fix all detected errors.
7924 # \note Single block can be also fixed by this method.
7925 # @param theShape The compound to check and improve.
7926 # @return Improved compound.
7928 # @ref swig_CheckAndImprove "Example"
7929 def CheckAndImprove(self,theShape):
7931 Check, if the given shape is a blocks compound.
7932 Fix all detected errors.
7935 Single block can be also fixed by this method.
7938 theShape The compound to check and improve.
7943 # Example: see GEOM_TestOthers.py
7944 anObj = self.BlocksOp.CheckAndImprove(theShape)
7945 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
7948 # end of l4_blocks_measure
7951 ## @addtogroup l3_blocks_op
7954 ## Get all the blocks, contained in the given compound.
7955 # @param theCompound The compound to explode.
7956 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
7957 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
7958 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7959 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
7961 # @ref tui_explode_on_blocks "Example 1"
7962 # \n @ref swig_MakeBlockExplode "Example 2"
7963 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
7965 Get all the blocks, contained in the given compound.
7968 theCompound The compound to explode.
7969 theMinNbFaces If solid has lower number of faces, it is not a block.
7970 theMaxNbFaces If solid has higher number of faces, it is not a block.
7973 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7976 List of GEOM.GEOM_Object, containing the retrieved blocks.
7978 # Example: see GEOM_TestOthers.py
7979 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
7980 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
7981 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
7983 anObj.SetParameters(Parameters)
7987 ## Find block, containing the given point inside its volume or on boundary.
7988 # @param theCompound Compound, to find block in.
7989 # @param thePoint Point, close to the desired block. If the point lays on
7990 # boundary between some blocks, we return block with nearest center.
7991 # @return New GEOM.GEOM_Object, containing the found block.
7993 # @ref swig_todo "Example"
7994 def GetBlockNearPoint(self,theCompound, thePoint):
7996 Find block, containing the given point inside its volume or on boundary.
7999 theCompound Compound, to find block in.
8000 thePoint Point, close to the desired block. If the point lays on
8001 boundary between some blocks, we return block with nearest center.
8004 New GEOM.GEOM_Object, containing the found block.
8006 # Example: see GEOM_Spanner.py
8007 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
8008 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
8011 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8012 # @param theCompound Compound, to find block in.
8013 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
8014 # @return New GEOM.GEOM_Object, containing the found block.
8016 # @ref swig_GetBlockByParts "Example"
8017 def GetBlockByParts(self,theCompound, theParts):
8019 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8022 theCompound Compound, to find block in.
8023 theParts List of faces and/or edges and/or vertices to be parts of the found block.
8026 New GEOM_Object, containing the found block.
8028 # Example: see GEOM_TestOthers.py
8029 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
8030 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
8033 ## Return all blocks, containing all the elements, passed as the parts.
8034 # @param theCompound Compound, to find blocks in.
8035 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8036 # @return List of GEOM.GEOM_Object, containing the found blocks.
8038 # @ref swig_todo "Example"
8039 def GetBlocksByParts(self,theCompound, theParts):
8041 Return all blocks, containing all the elements, passed as the parts.
8044 theCompound Compound, to find blocks in.
8045 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8048 List of GEOM.GEOM_Object, containing the found blocks.
8050 # Example: see GEOM_Spanner.py
8051 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
8052 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
8055 ## Multi-transformate block and glue the result.
8056 # Transformation is defined so, as to superpose direction faces.
8057 # @param Block Hexahedral solid to be multi-transformed.
8058 # @param DirFace1 ID of First direction face.
8059 # @param DirFace2 ID of Second direction face.
8060 # @param NbTimes Quantity of transformations to be done.
8061 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8062 # @return New GEOM.GEOM_Object, containing the result shape.
8064 # @ref tui_multi_transformation "Example"
8065 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
8067 Multi-transformate block and glue the result.
8068 Transformation is defined so, as to superpose direction faces.
8071 Block Hexahedral solid to be multi-transformed.
8072 DirFace1 ID of First direction face.
8073 DirFace2 ID of Second direction face.
8074 NbTimes Quantity of transformations to be done.
8077 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8080 New GEOM.GEOM_Object, containing the result shape.
8082 # Example: see GEOM_Spanner.py
8083 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8084 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8085 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8086 anObj.SetParameters(Parameters)
8089 ## Multi-transformate block and glue the result.
8090 # @param Block Hexahedral solid to be multi-transformed.
8091 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8092 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8093 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
8094 # @return New GEOM.GEOM_Object, containing the result shape.
8096 # @ref tui_multi_transformation "Example"
8097 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8098 DirFace1V, DirFace2V, NbTimesV):
8100 Multi-transformate block and glue the result.
8103 Block Hexahedral solid to be multi-transformed.
8104 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8105 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8106 NbTimesU,NbTimesV Quantity of transformations to be done.
8109 New GEOM.GEOM_Object, containing the result shape.
8111 # Example: see GEOM_Spanner.py
8112 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8113 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8114 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8115 DirFace1V, DirFace2V, NbTimesV)
8116 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8117 anObj.SetParameters(Parameters)
8120 ## Build all possible propagation groups.
8121 # Propagation group is a set of all edges, opposite to one (main)
8122 # edge of this group directly or through other opposite edges.
8123 # Notion of Opposite Edge make sence only on quadrangle face.
8124 # @param theShape Shape to build propagation groups on.
8125 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
8127 # @ref swig_Propagate "Example"
8128 def Propagate(self,theShape):
8130 Build all possible propagation groups.
8131 Propagation group is a set of all edges, opposite to one (main)
8132 edge of this group directly or through other opposite edges.
8133 Notion of Opposite Edge make sence only on quadrangle face.
8136 theShape Shape to build propagation groups on.
8139 List of GEOM.GEOM_Object, each of them is a propagation group.
8141 # Example: see GEOM_TestOthers.py
8142 listChains = self.BlocksOp.Propagate(theShape)
8143 RaiseIfFailed("Propagate", self.BlocksOp)
8146 # end of l3_blocks_op
8149 ## @addtogroup l3_groups
8152 ## Creates a new group which will store sub-shapes of theMainShape
8153 # @param theMainShape is a GEOM object on which the group is selected
8154 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8155 # @return a newly created GEOM group
8157 # @ref tui_working_with_groups_page "Example 1"
8158 # \n @ref swig_CreateGroup "Example 2"
8159 def CreateGroup(self,theMainShape, theShapeType):
8161 Creates a new group which will store sub-shapes of theMainShape
8164 theMainShape is a GEOM object on which the group is selected
8165 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8166 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8169 a newly created GEOM group
8172 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8175 # Example: see GEOM_TestOthers.py
8176 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8177 RaiseIfFailed("CreateGroup", self.GroupOp)
8180 ## Adds a sub-object with ID theSubShapeId to the group
8181 # @param theGroup is a GEOM group to which the new sub-shape is added
8182 # @param theSubShapeID is a sub-shape ID in the main object.
8183 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8185 # @ref tui_working_with_groups_page "Example"
8186 def AddObject(self,theGroup, theSubShapeID):
8188 Adds a sub-object with ID theSubShapeId to the group
8191 theGroup is a GEOM group to which the new sub-shape is added
8192 theSubShapeID is a sub-shape ID in the main object.
8195 Use method GetSubShapeID() to get an unique ID of the sub-shape
8197 # Example: see GEOM_TestOthers.py
8198 self.GroupOp.AddObject(theGroup, theSubShapeID)
8199 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8200 RaiseIfFailed("AddObject", self.GroupOp)
8204 ## Removes a sub-object with ID \a theSubShapeId from the group
8205 # @param theGroup is a GEOM group from which the new sub-shape is removed
8206 # @param theSubShapeID is a sub-shape ID in the main object.
8207 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8209 # @ref tui_working_with_groups_page "Example"
8210 def RemoveObject(self,theGroup, theSubShapeID):
8212 Removes a sub-object with ID theSubShapeId from the group
8215 theGroup is a GEOM group from which the new sub-shape is removed
8216 theSubShapeID is a sub-shape ID in the main object.
8219 Use method GetSubShapeID() to get an unique ID of the sub-shape
8221 # Example: see GEOM_TestOthers.py
8222 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8223 RaiseIfFailed("RemoveObject", self.GroupOp)
8226 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8227 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8228 # @param theSubShapes is a list of sub-shapes to be added.
8230 # @ref tui_working_with_groups_page "Example"
8231 def UnionList (self,theGroup, theSubShapes):
8233 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8236 theGroup is a GEOM group to which the new sub-shapes are added.
8237 theSubShapes is a list of sub-shapes to be added.
8239 # Example: see GEOM_TestOthers.py
8240 self.GroupOp.UnionList(theGroup, theSubShapes)
8241 RaiseIfFailed("UnionList", self.GroupOp)
8244 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8245 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8246 # @param theSubShapes is a list of indices of sub-shapes to be added.
8248 # @ref swig_UnionIDs "Example"
8249 def UnionIDs(self,theGroup, theSubShapes):
8251 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8254 theGroup is a GEOM group to which the new sub-shapes are added.
8255 theSubShapes is a list of indices of sub-shapes to be added.
8257 # Example: see GEOM_TestOthers.py
8258 self.GroupOp.UnionIDs(theGroup, theSubShapes)
8259 RaiseIfFailed("UnionIDs", self.GroupOp)
8262 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8263 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8264 # @param theSubShapes is a list of sub-shapes to be removed.
8266 # @ref tui_working_with_groups_page "Example"
8267 def DifferenceList (self,theGroup, theSubShapes):
8269 Removes from the group all the given shapes. No errors, if some shapes are not included.
8272 theGroup is a GEOM group from which the sub-shapes are removed.
8273 theSubShapes is a list of sub-shapes to be removed.
8275 # Example: see GEOM_TestOthers.py
8276 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8277 RaiseIfFailed("DifferenceList", self.GroupOp)
8280 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8281 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8282 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8284 # @ref swig_DifferenceIDs "Example"
8285 def DifferenceIDs(self,theGroup, theSubShapes):
8287 Removes from the group all the given shapes. No errors, if some shapes are not included.
8290 theGroup is a GEOM group from which the sub-shapes are removed.
8291 theSubShapes is a list of indices of sub-shapes to be removed.
8293 # Example: see GEOM_TestOthers.py
8294 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8295 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8298 ## Union of two groups.
8299 # New group is created. It will contain all entities
8300 # which are present in groups theGroup1 and theGroup2.
8301 # @param theGroup1, theGroup2 are the initial GEOM groups
8302 # to create the united group from.
8303 # @return a newly created GEOM group.
8304 # @ref tui_union_groups_anchor "Example"
8305 def UnionGroups (self, theGroup1, theGroup2):
8307 Union of two groups.
8308 New group is created. It will contain all entities
8309 which are present in groups theGroup1 and theGroup2.
8312 theGroup1, theGroup2 are the initial GEOM groups
8313 to create the united group from.
8316 a newly created GEOM group.
8318 # Example: see GEOM_TestOthers.py
8319 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
8320 RaiseIfFailed("UnionGroups", self.GroupOp)
8323 ## Intersection of two groups.
8324 # New group is created. It will contain only those entities
8325 # which are present in both groups theGroup1 and theGroup2.
8326 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8327 # @return a newly created GEOM group.
8328 # @ref tui_intersect_groups_anchor "Example"
8329 def IntersectGroups (self, theGroup1, theGroup2):
8331 Intersection of two groups.
8332 New group is created. It will contain only those entities
8333 which are present in both groups theGroup1 and theGroup2.
8336 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8339 a newly created GEOM group.
8341 # Example: see GEOM_TestOthers.py
8342 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
8343 RaiseIfFailed("IntersectGroups", self.GroupOp)
8346 ## Cut of two groups.
8347 # New group is created. It will contain entities which are
8348 # present in group theGroup1 but are not present in group theGroup2.
8349 # @param theGroup1 is a GEOM group to include elements of.
8350 # @param theGroup2 is a GEOM group to exclude elements of.
8351 # @return a newly created GEOM group.
8352 # @ref tui_cut_groups_anchor "Example"
8353 def CutGroups (self, theGroup1, theGroup2):
8356 New group is created. It will contain entities which are
8357 present in group theGroup1 but are not present in group theGroup2.
8360 theGroup1 is a GEOM group to include elements of.
8361 theGroup2 is a GEOM group to exclude elements of.
8364 a newly created GEOM group.
8366 # Example: see GEOM_TestOthers.py
8367 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
8368 RaiseIfFailed("CutGroups", self.GroupOp)
8371 ## Union of list of groups.
8372 # New group is created. It will contain all entities that are
8373 # present in groups listed in theGList.
8374 # @param theGList is a list of GEOM groups to create the united group from.
8375 # @return a newly created GEOM group.
8376 # @ref tui_union_groups_anchor "Example"
8377 def UnionListOfGroups (self, theGList):
8379 Union of list of groups.
8380 New group is created. It will contain all entities that are
8381 present in groups listed in theGList.
8384 theGList is a list of GEOM groups to create the united group from.
8387 a newly created GEOM group.
8389 # Example: see GEOM_TestOthers.py
8390 aGroup = self.GroupOp.UnionListOfGroups(theGList)
8391 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
8394 ## Cut of lists of groups.
8395 # New group is created. It will contain only entities
8396 # which are present in groups listed in theGList1 but
8397 # are not present in groups from theGList2.
8398 # @param theGList1 is a list of GEOM groups to include elements of.
8399 # @param theGList2 is a list of GEOM groups to exclude elements of.
8400 # @return a newly created GEOM group.
8401 # @ref tui_intersect_groups_anchor "Example"
8402 def IntersectListOfGroups (self, theGList):
8404 Cut of lists of groups.
8405 New group is created. It will contain only entities
8406 which are present in groups listed in theGList1 but
8407 are not present in groups from theGList2.
8410 theGList1 is a list of GEOM groups to include elements of.
8411 theGList2 is a list of GEOM groups to exclude elements of.
8414 a newly created GEOM group.
8416 # Example: see GEOM_TestOthers.py
8417 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
8418 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
8421 ## Cut of lists of groups.
8422 # New group is created. It will contain only entities
8423 # which are present in groups listed in theGList1 but
8424 # are not present in groups from theGList2.
8425 # @param theGList1 is a list of GEOM groups to include elements of.
8426 # @param theGList2 is a list of GEOM groups to exclude elements of.
8427 # @return a newly created GEOM group.
8428 # @ref tui_cut_groups_anchor "Example"
8429 def CutListOfGroups (self, theGList1, theGList2):
8431 Cut of lists of groups.
8432 New group is created. It will contain only entities
8433 which are present in groups listed in theGList1 but
8434 are not present in groups from theGList2.
8437 theGList1 is a list of GEOM groups to include elements of.
8438 theGList2 is a list of GEOM groups to exclude elements of.
8441 a newly created GEOM group.
8443 # Example: see GEOM_TestOthers.py
8444 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
8445 RaiseIfFailed("CutListOfGroups", self.GroupOp)
8448 ## Returns a list of sub-objects ID stored in the group
8449 # @param theGroup is a GEOM group for which a list of IDs is requested
8451 # @ref swig_GetObjectIDs "Example"
8452 def GetObjectIDs(self,theGroup):
8454 Returns a list of sub-objects ID stored in the group
8457 theGroup is a GEOM group for which a list of IDs is requested
8459 # Example: see GEOM_TestOthers.py
8460 ListIDs = self.GroupOp.GetObjects(theGroup)
8461 RaiseIfFailed("GetObjects", self.GroupOp)
8464 ## Returns a type of sub-objects stored in the group
8465 # @param theGroup is a GEOM group which type is returned.
8467 # @ref swig_GetType "Example"
8468 def GetType(self,theGroup):
8470 Returns a type of sub-objects stored in the group
8473 theGroup is a GEOM group which type is returned.
8475 # Example: see GEOM_TestOthers.py
8476 aType = self.GroupOp.GetType(theGroup)
8477 RaiseIfFailed("GetType", self.GroupOp)
8480 ## Convert a type of geom object from id to string value
8481 # @param theId is a GEOM obect type id.
8482 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8483 # @ref swig_GetType "Example"
8484 def ShapeIdToType(self, theId):
8486 Convert a type of geom object from id to string value
8489 theId is a GEOM obect type id.
8492 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8567 return "FREE_BOUNDS"
8575 return "THRUSECTIONS"
8577 return "COMPOUNDFILTER"
8579 return "SHAPES_ON_SHAPE"
8581 return "ELLIPSE_ARC"
8590 return "Shape Id not exist."
8592 ## Returns a main shape associated with the group
8593 # @param theGroup is a GEOM group for which a main shape object is requested
8594 # @return a GEOM object which is a main shape for theGroup
8596 # @ref swig_GetMainShape "Example"
8597 def GetMainShape(self,theGroup):
8599 Returns a main shape associated with the group
8602 theGroup is a GEOM group for which a main shape object is requested
8605 a GEOM object which is a main shape for theGroup
8607 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8609 # Example: see GEOM_TestOthers.py
8610 anObj = self.GroupOp.GetMainShape(theGroup)
8611 RaiseIfFailed("GetMainShape", self.GroupOp)
8614 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8615 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8616 # @param theShape given shape (see GEOM.GEOM_Object)
8617 # @param min_length minimum length of edges of theShape
8618 # @param max_length maximum length of edges of theShape
8619 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8620 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8621 # @return a newly created GEOM group of edges
8622 # @@ref swig_todo "Example"
8623 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8625 Create group of edges of theShape, whose length is in range [min_length, max_length].
8626 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8629 theShape given shape
8630 min_length minimum length of edges of theShape
8631 max_length maximum length of edges of theShape
8632 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8633 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8636 a newly created GEOM group of edges.
8638 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8641 Props = self.BasicProperties(edge)
8642 if min_length <= Props[0] and Props[0] <= max_length:
8643 if (not include_min) and (min_length == Props[0]):
8646 if (not include_max) and (Props[0] == max_length):
8649 edges_in_range.append(edge)
8651 if len(edges_in_range) <= 0:
8652 print "No edges found by given criteria"
8655 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8656 self.UnionList(group_edges, edges_in_range)
8660 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8661 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8662 # @param min_length minimum length of edges of selected shape
8663 # @param max_length maximum length of edges of selected shape
8664 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8665 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8666 # @return a newly created GEOM group of edges
8667 # @ref swig_todo "Example"
8668 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8670 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8671 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8674 min_length minimum length of edges of selected shape
8675 max_length maximum length of edges of selected shape
8676 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8677 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8680 a newly created GEOM group of edges.
8682 nb_selected = sg.SelectedCount()
8684 print "Select a shape before calling this function, please."
8687 print "Only one shape must be selected"
8690 id_shape = sg.getSelected(0)
8691 shape = IDToObject( id_shape )
8693 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8697 if include_min: left_str = " <= "
8698 if include_max: right_str = " <= "
8700 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8701 + left_str + "length" + right_str + `max_length`)
8703 sg.updateObjBrowser(1)
8710 ## @addtogroup l4_advanced
8713 ## Create a T-shape object with specified caracteristics for the main
8714 # and the incident pipes (radius, width, half-length).
8715 # The extremities of the main pipe are located on junctions points P1 and P2.
8716 # The extremity of the incident pipe is located on junction point P3.
8717 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8718 # the main plane of the T-shape is XOY.
8719 # @param theR1 Internal radius of main pipe
8720 # @param theW1 Width of main pipe
8721 # @param theL1 Half-length of main pipe
8722 # @param theR2 Internal radius of incident pipe (R2 < R1)
8723 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8724 # @param theL2 Half-length of incident pipe
8725 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8726 # @param theP1 1st junction point of main pipe
8727 # @param theP2 2nd junction point of main pipe
8728 # @param theP3 Junction point of incident pipe
8729 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8731 # @ref tui_creation_pipetshape "Example"
8732 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8734 Create a T-shape object with specified caracteristics for the main
8735 and the incident pipes (radius, width, half-length).
8736 The extremities of the main pipe are located on junctions points P1 and P2.
8737 The extremity of the incident pipe is located on junction point P3.
8738 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8739 the main plane of the T-shape is XOY.
8742 theR1 Internal radius of main pipe
8743 theW1 Width of main pipe
8744 theL1 Half-length of main pipe
8745 theR2 Internal radius of incident pipe (R2 < R1)
8746 theW2 Width of incident pipe (R2+W2 < R1+W1)
8747 theL2 Half-length of incident pipe
8748 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8749 theP1 1st junction point of main pipe
8750 theP2 2nd junction point of main pipe
8751 theP3 Junction point of incident pipe
8754 List of GEOM_Object, containing the created shape and propagation groups.
8757 # create PipeTShape object
8758 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8759 # create PipeTShape object with position
8760 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8762 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8763 if (theP1 and theP2 and theP3):
8764 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8766 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8767 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8768 if Parameters: anObj[0].SetParameters(Parameters)
8771 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8772 # and the incident pipes (radius, width, half-length). The chamfer is
8773 # created on the junction of the pipes.
8774 # The extremities of the main pipe are located on junctions points P1 and P2.
8775 # The extremity of the incident pipe is located on junction point P3.
8776 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8777 # the main plane of the T-shape is XOY.
8778 # @param theR1 Internal radius of main pipe
8779 # @param theW1 Width of main pipe
8780 # @param theL1 Half-length of main pipe
8781 # @param theR2 Internal radius of incident pipe (R2 < R1)
8782 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8783 # @param theL2 Half-length of incident pipe
8784 # @param theH Height of the chamfer.
8785 # @param theW Width of the chamfer.
8786 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8787 # @param theP1 1st junction point of main pipe
8788 # @param theP2 2nd junction point of main pipe
8789 # @param theP3 Junction point of incident pipe
8790 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8792 # @ref tui_creation_pipetshape "Example"
8793 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8795 Create a T-shape object with chamfer and with specified caracteristics for the main
8796 and the incident pipes (radius, width, half-length). The chamfer is
8797 created on the junction of the pipes.
8798 The extremities of the main pipe are located on junctions points P1 and P2.
8799 The extremity of the incident pipe is located on junction point P3.
8800 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8801 the main plane of the T-shape is XOY.
8804 theR1 Internal radius of main pipe
8805 theW1 Width of main pipe
8806 theL1 Half-length of main pipe
8807 theR2 Internal radius of incident pipe (R2 < R1)
8808 theW2 Width of incident pipe (R2+W2 < R1+W1)
8809 theL2 Half-length of incident pipe
8810 theH Height of the chamfer.
8811 theW Width of the chamfer.
8812 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8813 theP1 1st junction point of main pipe
8814 theP2 2nd junction point of main pipe
8815 theP3 Junction point of incident pipe
8818 List of GEOM_Object, containing the created shape and propagation groups.
8821 # create PipeTShape with chamfer object
8822 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8823 # create PipeTShape with chamfer object with position
8824 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8826 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8827 if (theP1 and theP2 and theP3):
8828 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8830 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8831 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8832 if Parameters: anObj[0].SetParameters(Parameters)
8835 ## Create a T-shape object with fillet and with specified caracteristics for the main
8836 # and the incident pipes (radius, width, half-length). The fillet is
8837 # created on the junction of the pipes.
8838 # The extremities of the main pipe are located on junctions points P1 and P2.
8839 # The extremity of the incident pipe is located on junction point P3.
8840 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8841 # the main plane of the T-shape is XOY.
8842 # @param theR1 Internal radius of main pipe
8843 # @param theW1 Width of main pipe
8844 # @param theL1 Half-length of main pipe
8845 # @param theR2 Internal radius of incident pipe (R2 < R1)
8846 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8847 # @param theL2 Half-length of incident pipe
8848 # @param theRF Radius of curvature of fillet.
8849 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8850 # @param theP1 1st junction point of main pipe
8851 # @param theP2 2nd junction point of main pipe
8852 # @param theP3 Junction point of incident pipe
8853 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8855 # @ref tui_creation_pipetshape "Example"
8856 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8858 Create a T-shape object with fillet and with specified caracteristics for the main
8859 and the incident pipes (radius, width, half-length). The fillet is
8860 created on the junction of the pipes.
8861 The extremities of the main pipe are located on junctions points P1 and P2.
8862 The extremity of the incident pipe is located on junction point P3.
8865 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8866 the main plane of the T-shape is XOY.
8867 theR1 Internal radius of main pipe
8868 theW1 Width of main pipe
8869 heL1 Half-length of main pipe
8870 theR2 Internal radius of incident pipe (R2 < R1)
8871 theW2 Width of incident pipe (R2+W2 < R1+W1)
8872 theL2 Half-length of incident pipe
8873 theRF Radius of curvature of fillet.
8874 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8875 theP1 1st junction point of main pipe
8876 theP2 2nd junction point of main pipe
8877 theP3 Junction point of incident pipe
8880 List of GEOM_Object, containing the created shape and propagation groups.
8883 # create PipeTShape with fillet object
8884 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
8885 # create PipeTShape with fillet object with position
8886 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
8889 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
8890 if (theP1 and theP2 and theP3):
8891 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
8893 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
8894 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
8895 if Parameters: anObj[0].SetParameters(Parameters)
8898 ## This function allows creating a disk already divided into blocks. It
8899 # can be used to create divided pipes for later meshing in hexaedra.
8900 # @param theR Radius of the disk
8901 # @param theOrientation Orientation of the plane on which the disk will be built
8902 # 1 = XOY, 2 = OYZ, 3 = OZX
8903 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8904 # @return New GEOM_Object, containing the created shape.
8906 # @ref tui_creation_divideddisk "Example"
8907 def MakeDividedDisk(self, theR, theOrientation, thePattern ):
8908 theR, Parameters = ParseParameters(theR)
8909 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
8910 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
8911 if Parameters: anObj.SetParameters(Parameters)
8914 ## This function allows creating a disk already divided into blocks. It
8915 # can be used to create divided pipes for later meshing in hexaedra.
8916 # @param theCenter Center of the disk
8917 # @param theVector Normal vector to the plane of the created disk
8918 # @param theRadius Radius of the disk
8919 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8920 # @return New GEOM_Object, containing the created shape.
8922 # @ref tui_creation_divideddisk "Example"
8923 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
8924 theRadius, Parameters = ParseParameters(theRadius)
8925 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
8926 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
8927 if Parameters: anObj.SetParameters(Parameters)
8930 ## Builds a cylinder prepared for hexa meshes
8931 # @param theR Radius of the cylinder
8932 # @param theH Height of the cylinder
8933 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8934 # @return New GEOM_Object, containing the created shape.
8936 # @ref tui_creation_dividedcylinder "Example"
8937 def MakeDividedCylinder(self, theR, theH, thePattern):
8938 theR, theH, Parameters = ParseParameters(theR, theH)
8939 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
8940 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
8941 if Parameters: anObj.SetParameters(Parameters)
8944 #@@ insert new functions before this line @@ do not remove this line @@#
8946 # end of l4_advanced
8949 ## Create a copy of the given object
8951 # @param theOriginal geometry object for copy
8952 # @return unique object identifier
8953 # @ingroup l1_geompy_auxiliary
8954 # @ref swig_MakeCopy "Example"
8955 def MakeCopy(self,theOriginal):
8957 Create a copy of the given object
8960 theOriginal geometry object for copy
8963 unique object identifier
8965 Example of usage: Copy = geompy.MakeCopy(Box)
8967 # Example: see GEOM_TestAll.py
8968 anObj = self.InsertOp.MakeCopy(theOriginal)
8969 RaiseIfFailed("MakeCopy", self.InsertOp)
8972 ## Add Path to load python scripts from
8973 # @param Path a path to load python scripts from
8974 # @ingroup l1_geompy_auxiliary
8975 def addPath(self,Path):
8977 Add Path to load python scripts from
8980 Path a path to load python scripts from
8982 if (sys.path.count(Path) < 1):
8983 sys.path.append(Path)
8987 ## Load marker texture from the file
8988 # @param Path a path to the texture file
8989 # @return unique texture identifier
8990 # @ingroup l1_geompy_auxiliary
8991 def LoadTexture(self, Path):
8993 Load marker texture from the file
8996 Path a path to the texture file
8999 unique texture identifier
9001 # Example: see GEOM_TestAll.py
9002 ID = self.InsertOp.LoadTexture(Path)
9003 RaiseIfFailed("LoadTexture", self.InsertOp)
9006 ## Get entry of the object
9007 # @param obj geometry object
9008 # @return unique object identifier
9009 # @ingroup l1_geompy_auxiliary
9010 def getObjectID(self, obj):
9012 Get entry of the object
9018 unique object identifier
9021 entry = salome.ObjectToID(obj)
9022 if entry is not None:
9023 lst = entry.split(":")
9025 ID = lst[-1] # -1 means last item in the list
9031 ## Add marker texture. @a Width and @a Height parameters
9032 # specify width and height of the texture in pixels.
9033 # If @a RowData is @c True, @a Texture parameter should represent texture data
9034 # packed into the byte array. If @a RowData is @c False (default), @a Texture
9035 # parameter should be unpacked string, in which '1' symbols represent opaque
9036 # pixels and '0' represent transparent pixels of the texture bitmap.
9038 # @param Width texture width in pixels
9039 # @param Height texture height in pixels
9040 # @param Texture texture data
9041 # @param RowData if @c True, @a Texture data are packed in the byte stream
9042 # @return unique texture identifier
9043 # @ingroup l1_geompy_auxiliary
9044 def AddTexture(self, Width, Height, Texture, RowData=False):
9046 Add marker texture. Width and Height parameters
9047 specify width and height of the texture in pixels.
9048 If RowData is True, Texture parameter should represent texture data
9049 packed into the byte array. If RowData is False (default), Texture
9050 parameter should be unpacked string, in which '1' symbols represent opaque
9051 pixels and '0' represent transparent pixels of the texture bitmap.
9054 Width texture width in pixels
9055 Height texture height in pixels
9056 Texture texture data
9057 RowData if True, Texture data are packed in the byte stream
9060 return unique texture identifier
9062 if not RowData: Texture = PackData(Texture)
9063 ID = self.InsertOp.AddTexture(Width, Height, Texture)
9064 RaiseIfFailed("AddTexture", self.InsertOp)
9068 #Register the new proxy for GEOM_Gen
9069 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)