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)
2870 ## Build a middle path of a pipe-like shape.
2871 # The path shape can be a wire or an edge.
2872 # @param theShape It can be closed or unclosed pipe-like shell
2873 # or a pipe-like solid.
2874 # @param theBase1, theBase2 Two bases of the supposed pipe. This
2875 # should be wires or faces of theShape.
2876 # @note It is not assumed that exact or approximate copy of theShape
2877 # can be obtained by applying existing Pipe operation on the
2878 # resulting "Path" wire taking theBase1 as the base - it is not
2879 # always possible; though in some particular cases it might work
2880 # it is not guaranteed. Thus, RestorePath function should not be
2881 # considered as an exact reverse operation of the Pipe.
2882 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
2883 # source pipe's "path".
2885 # @ref tui_creation_pipe_path "Example"
2886 def RestorePath (self, theShape, theBase1, theBase2):
2888 Build a middle path of a pipe-like shape.
2889 The path shape can be a wire or an edge.
2892 theShape It can be closed or unclosed pipe-like shell
2893 or a pipe-like solid.
2894 theBase1, theBase2 Two bases of the supposed pipe. This
2895 should be wires or faces of theShape.
2898 New GEOM_Object, containing an edge or wire that represent
2901 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
2902 RaiseIfFailed("RestorePath", self.PrimOp)
2905 ## Build a middle path of a pipe-like shape.
2906 # The path shape can be a wire or an edge.
2907 # @param theShape It can be closed or unclosed pipe-like shell
2908 # or a pipe-like solid.
2909 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
2910 # should be lists of edges of theShape.
2911 # @note It is not assumed that exact or approximate copy of theShape
2912 # can be obtained by applying existing Pipe operation on the
2913 # resulting "Path" wire taking theBase1 as the base - it is not
2914 # always possible; though in some particular cases it might work
2915 # it is not guaranteed. Thus, RestorePath function should not be
2916 # considered as an exact reverse operation of the Pipe.
2917 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
2918 # source pipe's "path".
2920 # @ref tui_creation_pipe_path "Example"
2921 def RestorePathEdges (self, theShape, listEdges1, listEdges2):
2923 Build a middle path of a pipe-like shape.
2924 The path shape can be a wire or an edge.
2927 theShape It can be closed or unclosed pipe-like shell
2928 or a pipe-like solid.
2929 listEdges1, listEdges2 Two bases of the supposed pipe. This
2930 should be lists of edges of theShape.
2933 New GEOM_Object, containing an edge or wire that represent
2936 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
2937 RaiseIfFailed("RestorePath", self.PrimOp)
2943 ## @addtogroup l3_advanced
2946 ## Create a linear edge with specified ends.
2947 # @param thePnt1 Point for the first end of edge.
2948 # @param thePnt2 Point for the second end of edge.
2949 # @return New GEOM.GEOM_Object, containing the created edge.
2951 # @ref tui_creation_edge "Example"
2952 def MakeEdge(self,thePnt1, thePnt2):
2954 Create a linear edge with specified ends.
2957 thePnt1 Point for the first end of edge.
2958 thePnt2 Point for the second end of edge.
2961 New GEOM.GEOM_Object, containing the created edge.
2963 # Example: see GEOM_TestAll.py
2964 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2965 RaiseIfFailed("MakeEdge", self.ShapesOp)
2968 ## Create a new edge, corresponding to the given length on the given curve.
2969 # @param theRefCurve The referenced curve (edge).
2970 # @param theLength Length on the referenced curve. It can be negative.
2971 # @param theStartPoint Any point can be selected for it, the new edge will begin
2972 # at the end of \a theRefCurve, close to the selected point.
2973 # If None, start from the first point of \a theRefCurve.
2974 # @return New GEOM.GEOM_Object, containing the created edge.
2976 # @ref tui_creation_edge "Example"
2977 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2979 Create a new edge, corresponding to the given length on the given curve.
2982 theRefCurve The referenced curve (edge).
2983 theLength Length on the referenced curve. It can be negative.
2984 theStartPoint Any point can be selected for it, the new edge will begin
2985 at the end of theRefCurve, close to the selected point.
2986 If None, start from the first point of theRefCurve.
2989 New GEOM.GEOM_Object, containing the created edge.
2991 # Example: see GEOM_TestAll.py
2992 theLength, Parameters = ParseParameters(theLength)
2993 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2994 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2995 anObj.SetParameters(Parameters)
2998 ## Create an edge from specified wire.
2999 # @param theWire source Wire
3000 # @param theLinearTolerance linear tolerance value (default = 1e-07)
3001 # @param theAngularTolerance angular tolerance value (default = 1e-12)
3002 # @return New GEOM.GEOM_Object, containing the created edge.
3004 # @ref tui_creation_edge "Example"
3005 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
3007 Create an edge from specified wire.
3011 theLinearTolerance linear tolerance value (default = 1e-07)
3012 theAngularTolerance angular tolerance value (default = 1e-12)
3015 New GEOM.GEOM_Object, containing the created edge.
3017 # Example: see GEOM_TestAll.py
3018 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3019 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3022 ## Create a wire from the set of edges and wires.
3023 # @param theEdgesAndWires List of edges and/or wires.
3024 # @param theTolerance Maximum distance between vertices, that will be merged.
3025 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3026 # @return New GEOM.GEOM_Object, containing the created wire.
3028 # @ref tui_creation_wire "Example"
3029 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
3031 Create a wire from the set of edges and wires.
3034 theEdgesAndWires List of edges and/or wires.
3035 theTolerance Maximum distance between vertices, that will be merged.
3036 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3039 New GEOM.GEOM_Object, containing the created wire.
3041 # Example: see GEOM_TestAll.py
3042 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3043 RaiseIfFailed("MakeWire", self.ShapesOp)
3046 ## Create a face on the given wire.
3047 # @param theWire closed Wire or Edge to build the face on.
3048 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3049 # If the tolerance of the obtained planar face is less
3050 # than 1e-06, this face will be returned, otherwise the
3051 # algorithm tries to build any suitable face on the given
3052 # wire and prints a warning message.
3053 # @return New GEOM.GEOM_Object, containing the created face.
3055 # @ref tui_creation_face "Example"
3056 def MakeFace(self, theWire, isPlanarWanted):
3058 Create a face on the given wire.
3061 theWire closed Wire or Edge to build the face on.
3062 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3063 If the tolerance of the obtained planar face is less
3064 than 1e-06, this face will be returned, otherwise the
3065 algorithm tries to build any suitable face on the given
3066 wire and prints a warning message.
3069 New GEOM.GEOM_Object, containing the created face.
3071 # Example: see GEOM_TestAll.py
3072 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
3073 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3074 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3076 RaiseIfFailed("MakeFace", self.ShapesOp)
3079 ## Create a face on the given wires set.
3080 # @param theWires List of closed wires or edges to build the face on.
3081 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3082 # If the tolerance of the obtained planar face is less
3083 # than 1e-06, this face will be returned, otherwise the
3084 # algorithm tries to build any suitable face on the given
3085 # wire and prints a warning message.
3086 # @return New GEOM.GEOM_Object, containing the created face.
3088 # @ref tui_creation_face "Example"
3089 def MakeFaceWires(self, theWires, isPlanarWanted):
3091 Create a face on the given wires set.
3094 theWires List of closed wires or edges to build the face on.
3095 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3096 If the tolerance of the obtained planar face is less
3097 than 1e-06, this face will be returned, otherwise the
3098 algorithm tries to build any suitable face on the given
3099 wire and prints a warning message.
3102 New GEOM.GEOM_Object, containing the created face.
3104 # Example: see GEOM_TestAll.py
3105 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
3106 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3107 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3109 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
3112 ## See MakeFaceWires() method for details.
3114 # @ref tui_creation_face "Example 1"
3115 # \n @ref swig_MakeFaces "Example 2"
3116 def MakeFaces(self, theWires, isPlanarWanted):
3118 See geompy.MakeFaceWires() method for details.
3120 # Example: see GEOM_TestOthers.py
3121 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3124 ## Create a shell from the set of faces and shells.
3125 # @param theFacesAndShells List of faces and/or shells.
3126 # @return New GEOM.GEOM_Object, containing the created shell.
3128 # @ref tui_creation_shell "Example"
3129 def MakeShell(self,theFacesAndShells):
3131 Create a shell from the set of faces and shells.
3134 theFacesAndShells List of faces and/or shells.
3137 New GEOM.GEOM_Object, containing the created shell.
3139 # Example: see GEOM_TestAll.py
3140 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3141 RaiseIfFailed("MakeShell", self.ShapesOp)
3144 ## Create a solid, bounded by the given shells.
3145 # @param theShells Sequence of bounding shells.
3146 # @return New GEOM.GEOM_Object, containing the created solid.
3148 # @ref tui_creation_solid "Example"
3149 def MakeSolid(self, theShells):
3151 Create a solid, bounded by the given shells.
3154 theShells Sequence of bounding shells.
3157 New GEOM.GEOM_Object, containing the created solid.
3159 # Example: see GEOM_TestAll.py
3160 if len(theShells) == 1:
3161 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3163 # raise RuntimeError, "MakeSolidShells : " + descr
3164 if descr == "WRN_SHAPE_UNCLOSED":
3165 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3166 anObj = self.ShapesOp.MakeSolidShells(theShells)
3167 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3170 ## Create a compound of the given shapes.
3171 # @param theShapes List of shapes to put in compound.
3172 # @return New GEOM.GEOM_Object, containing the created compound.
3174 # @ref tui_creation_compound "Example"
3175 def MakeCompound(self,theShapes):
3177 Create a compound of the given shapes.
3180 theShapes List of shapes to put in compound.
3183 New GEOM.GEOM_Object, containing the created compound.
3185 # Example: see GEOM_TestAll.py
3186 anObj = self.ShapesOp.MakeCompound(theShapes)
3187 RaiseIfFailed("MakeCompound", self.ShapesOp)
3190 # end of l3_advanced
3193 ## @addtogroup l2_measure
3196 ## Gives quantity of faces in the given shape.
3197 # @param theShape Shape to count faces of.
3198 # @return Quantity of faces.
3200 # @ref swig_NumberOf "Example"
3201 def NumberOfFaces(self, theShape):
3203 Gives quantity of faces in the given shape.
3206 theShape Shape to count faces of.
3211 # Example: see GEOM_TestOthers.py
3212 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3213 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3216 ## Gives quantity of edges in the given shape.
3217 # @param theShape Shape to count edges of.
3218 # @return Quantity of edges.
3220 # @ref swig_NumberOf "Example"
3221 def NumberOfEdges(self, theShape):
3223 Gives quantity of edges in the given shape.
3226 theShape Shape to count edges of.
3231 # Example: see GEOM_TestOthers.py
3232 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3233 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3236 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3237 # @param theShape Shape to count sub-shapes of.
3238 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3239 # @return Quantity of sub-shapes of given type.
3241 # @ref swig_NumberOf "Example"
3242 def NumberOfSubShapes(self, theShape, theShapeType):
3244 Gives quantity of sub-shapes of type theShapeType in the given shape.
3247 theShape Shape to count sub-shapes of.
3248 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3251 Quantity of sub-shapes of given type.
3253 # Example: see GEOM_TestOthers.py
3254 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3255 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3258 ## Gives quantity of solids in the given shape.
3259 # @param theShape Shape to count solids in.
3260 # @return Quantity of solids.
3262 # @ref swig_NumberOf "Example"
3263 def NumberOfSolids(self, theShape):
3265 Gives quantity of solids in the given shape.
3268 theShape Shape to count solids in.
3273 # Example: see GEOM_TestOthers.py
3274 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3275 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3281 ## @addtogroup l3_healing
3284 ## Reverses an orientation the given shape.
3285 # @param theShape Shape to be reversed.
3286 # @return The reversed copy of theShape.
3288 # @ref swig_ChangeOrientation "Example"
3289 def ChangeOrientation(self,theShape):
3291 Reverses an orientation the given shape.
3294 theShape Shape to be reversed.
3297 The reversed copy of theShape.
3299 # Example: see GEOM_TestAll.py
3300 anObj = self.ShapesOp.ChangeOrientation(theShape)
3301 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3304 ## See ChangeOrientation() method for details.
3306 # @ref swig_OrientationChange "Example"
3307 def OrientationChange(self,theShape):
3309 See geompy.ChangeOrientation method for details.
3311 # Example: see GEOM_TestOthers.py
3312 anObj = self.ChangeOrientation(theShape)
3318 ## @addtogroup l4_obtain
3321 ## Retrieve all free faces from the given shape.
3322 # Free face is a face, which is not shared between two shells of the shape.
3323 # @param theShape Shape to find free faces in.
3324 # @return List of IDs of all free faces, contained in theShape.
3326 # @ref tui_measurement_tools_page "Example"
3327 def GetFreeFacesIDs(self,theShape):
3329 Retrieve all free faces from the given shape.
3330 Free face is a face, which is not shared between two shells of the shape.
3333 theShape Shape to find free faces in.
3336 List of IDs of all free faces, contained in theShape.
3338 # Example: see GEOM_TestOthers.py
3339 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3340 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3343 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3344 # @param theShape1 Shape to find sub-shapes in.
3345 # @param theShape2 Shape to find shared sub-shapes with.
3346 # @param theShapeType Type of sub-shapes to be retrieved.
3347 # @return List of sub-shapes of theShape1, shared with theShape2.
3349 # @ref swig_GetSharedShapes "Example"
3350 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3352 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3355 theShape1 Shape to find sub-shapes in.
3356 theShape2 Shape to find shared sub-shapes with.
3357 theShapeType Type of sub-shapes to be retrieved.
3360 List of sub-shapes of theShape1, shared with theShape2.
3362 # Example: see GEOM_TestOthers.py
3363 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3364 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3367 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3368 # @param theShapes Shapes to find common sub-shapes of.
3369 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3370 # @return List of objects, that are sub-shapes of all given shapes.
3372 # @ref swig_GetSharedShapes "Example"
3373 def GetSharedShapesMulti(self, theShapes, theShapeType):
3375 Get all sub-shapes, shared by all shapes in the list theShapes.
3378 theShapes Shapes to find common sub-shapes of.
3379 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3382 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3384 # Example: see GEOM_TestOthers.py
3385 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3386 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3389 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3390 # situated relatively the specified plane by the certain way,
3391 # defined through <VAR>theState</VAR> parameter.
3392 # @param theShape Shape to find sub-shapes of.
3393 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3394 # @param theAx1 Vector (or line, or linear edge), specifying normal
3395 # direction and location of the plane to find shapes on.
3396 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3397 # @return List of all found sub-shapes.
3399 # @ref swig_GetShapesOnPlane "Example"
3400 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3402 Find in theShape all sub-shapes of type theShapeType,
3403 situated relatively the specified plane by the certain way,
3404 defined through theState parameter.
3407 theShape Shape to find sub-shapes of.
3408 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3409 theAx1 Vector (or line, or linear edge), specifying normal
3410 direction and location of the plane to find shapes on.
3411 theState The state of the sub-shapes to find (see GEOM::shape_state)
3414 List of all found sub-shapes.
3416 # Example: see GEOM_TestOthers.py
3417 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3418 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3421 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3422 # situated relatively the specified plane by the certain way,
3423 # defined through <VAR>theState</VAR> parameter.
3424 # @param theShape Shape to find sub-shapes of.
3425 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3426 # @param theAx1 Vector (or line, or linear edge), specifying normal
3427 # direction and location of the plane to find shapes on.
3428 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3429 # @return List of all found sub-shapes indices.
3431 # @ref swig_GetShapesOnPlaneIDs "Example"
3432 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3434 Find in theShape all sub-shapes of type theShapeType,
3435 situated relatively the specified plane by the certain way,
3436 defined through theState parameter.
3439 theShape Shape to find sub-shapes of.
3440 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3441 theAx1 Vector (or line, or linear edge), specifying normal
3442 direction and location of the plane to find shapes on.
3443 theState The state of the sub-shapes to find (see GEOM::shape_state)
3446 List of all found sub-shapes indices.
3448 # Example: see GEOM_TestOthers.py
3449 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3450 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3453 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3454 # situated relatively the specified plane by the certain way,
3455 # defined through <VAR>theState</VAR> parameter.
3456 # @param theShape Shape to find sub-shapes of.
3457 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3458 # @param theAx1 Vector (or line, or linear edge), specifying normal
3459 # direction of the plane to find shapes on.
3460 # @param thePnt Point specifying location of the plane to find shapes on.
3461 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3462 # @return List of all found sub-shapes.
3464 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3465 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3467 Find in theShape all sub-shapes of type theShapeType,
3468 situated relatively the specified plane by the certain way,
3469 defined through theState parameter.
3472 theShape Shape to find sub-shapes of.
3473 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3474 theAx1 Vector (or line, or linear edge), specifying normal
3475 direction and location of the plane to find shapes on.
3476 thePnt Point specifying location of the plane to find shapes on.
3477 theState The state of the sub-shapes to find (see GEOM::shape_state)
3480 List of all found sub-shapes.
3482 # Example: see GEOM_TestOthers.py
3483 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3484 theAx1, thePnt, theState)
3485 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3488 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3489 # situated relatively the specified plane by the certain way,
3490 # defined through <VAR>theState</VAR> parameter.
3491 # @param theShape Shape to find sub-shapes of.
3492 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3493 # @param theAx1 Vector (or line, or linear edge), specifying normal
3494 # direction of the plane to find shapes on.
3495 # @param thePnt Point specifying location of the plane to find shapes on.
3496 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3497 # @return List of all found sub-shapes indices.
3499 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3500 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3502 Find in theShape all sub-shapes of type theShapeType,
3503 situated relatively the specified plane by the certain way,
3504 defined through theState parameter.
3507 theShape Shape to find sub-shapes of.
3508 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3509 theAx1 Vector (or line, or linear edge), specifying normal
3510 direction and location of the plane to find shapes on.
3511 thePnt Point specifying location of the plane to find shapes on.
3512 theState The state of the sub-shapes to find (see GEOM::shape_state)
3515 List of all found sub-shapes indices.
3517 # Example: see GEOM_TestOthers.py
3518 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3519 theAx1, thePnt, theState)
3520 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3523 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3524 # the specified cylinder by the certain way, defined through \a theState parameter.
3525 # @param theShape Shape to find sub-shapes of.
3526 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3527 # @param theAxis Vector (or line, or linear edge), specifying
3528 # axis of the cylinder to find shapes on.
3529 # @param theRadius Radius of the cylinder to find shapes on.
3530 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3531 # @return List of all found sub-shapes.
3533 # @ref swig_GetShapesOnCylinder "Example"
3534 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3536 Find in theShape all sub-shapes of type theShapeType, situated relatively
3537 the specified cylinder by the certain way, defined through theState parameter.
3540 theShape Shape to find sub-shapes of.
3541 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3542 theAxis Vector (or line, or linear edge), specifying
3543 axis of the cylinder to find shapes on.
3544 theRadius Radius of the cylinder to find shapes on.
3545 theState The state of the sub-shapes to find (see GEOM::shape_state)
3548 List of all found sub-shapes.
3550 # Example: see GEOM_TestOthers.py
3551 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3552 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3555 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3556 # the specified cylinder by the certain way, defined through \a theState parameter.
3557 # @param theShape Shape to find sub-shapes of.
3558 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3559 # @param theAxis Vector (or line, or linear edge), specifying
3560 # axis of the cylinder to find shapes on.
3561 # @param theRadius Radius of the cylinder to find shapes on.
3562 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3563 # @return List of all found sub-shapes indices.
3565 # @ref swig_GetShapesOnCylinderIDs "Example"
3566 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3568 Find in theShape all sub-shapes of type theShapeType, situated relatively
3569 the specified cylinder by the certain way, defined through theState parameter.
3572 theShape Shape to find sub-shapes of.
3573 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3574 theAxis Vector (or line, or linear edge), specifying
3575 axis of the cylinder to find shapes on.
3576 theRadius Radius of the cylinder to find shapes on.
3577 theState The state of the sub-shapes to find (see GEOM::shape_state)
3580 List of all found sub-shapes indices.
3582 # Example: see GEOM_TestOthers.py
3583 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3584 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3587 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3588 # the specified cylinder by the certain way, defined through \a theState parameter.
3589 # @param theShape Shape to find sub-shapes of.
3590 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3591 # @param theAxis Vector (or line, or linear edge), specifying
3592 # axis of the cylinder to find shapes on.
3593 # @param thePnt Point specifying location of the bottom of the cylinder.
3594 # @param theRadius Radius of the cylinder to find shapes on.
3595 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3596 # @return List of all found sub-shapes.
3598 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3599 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3601 Find in theShape all sub-shapes of type theShapeType, situated relatively
3602 the specified cylinder by the certain way, defined through theState parameter.
3605 theShape Shape to find sub-shapes of.
3606 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3607 theAxis Vector (or line, or linear edge), specifying
3608 axis of the cylinder to find shapes on.
3609 theRadius Radius of the cylinder to find shapes on.
3610 theState The state of the sub-shapes to find (see GEOM::shape_state)
3613 List of all found sub-shapes.
3615 # Example: see GEOM_TestOthers.py
3616 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3617 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3620 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3621 # the specified cylinder by the certain way, defined through \a theState parameter.
3622 # @param theShape Shape to find sub-shapes of.
3623 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3624 # @param theAxis Vector (or line, or linear edge), specifying
3625 # axis of the cylinder to find shapes on.
3626 # @param thePnt Point specifying location of the bottom of the cylinder.
3627 # @param theRadius Radius of the cylinder to find shapes on.
3628 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3629 # @return List of all found sub-shapes indices
3631 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3632 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3634 Find in theShape all sub-shapes of type theShapeType, situated relatively
3635 the specified cylinder by the certain way, defined through theState parameter.
3638 theShape Shape to find sub-shapes of.
3639 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3640 theAxis Vector (or line, or linear edge), specifying
3641 axis of the cylinder to find shapes on.
3642 theRadius Radius of the cylinder to find shapes on.
3643 theState The state of the sub-shapes to find (see GEOM::shape_state)
3646 List of all found sub-shapes indices.
3648 # Example: see GEOM_TestOthers.py
3649 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3650 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3653 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3654 # the specified sphere by the certain way, defined through \a theState parameter.
3655 # @param theShape Shape to find sub-shapes of.
3656 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3657 # @param theCenter Point, specifying center of the sphere to find shapes on.
3658 # @param theRadius Radius of the sphere to find shapes on.
3659 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3660 # @return List of all found sub-shapes.
3662 # @ref swig_GetShapesOnSphere "Example"
3663 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3665 Find in theShape all sub-shapes of type theShapeType, situated relatively
3666 the specified sphere by the certain way, defined through theState parameter.
3669 theShape Shape to find sub-shapes of.
3670 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3671 theCenter Point, specifying center of the sphere to find shapes on.
3672 theRadius Radius of the sphere to find shapes on.
3673 theState The state of the sub-shapes to find (see GEOM::shape_state)
3676 List of all found sub-shapes.
3678 # Example: see GEOM_TestOthers.py
3679 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3680 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3683 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3684 # the specified sphere by the certain way, defined through \a theState parameter.
3685 # @param theShape Shape to find sub-shapes of.
3686 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3687 # @param theCenter Point, specifying center of the sphere to find shapes on.
3688 # @param theRadius Radius of the sphere to find shapes on.
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_GetShapesOnSphereIDs "Example"
3693 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3695 Find in theShape all sub-shapes of type theShapeType, situated relatively
3696 the specified sphere by the certain way, defined through theState parameter.
3699 theShape Shape to find sub-shapes of.
3700 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3701 theCenter Point, specifying center of the sphere to find shapes on.
3702 theRadius Radius of the sphere to find shapes on.
3703 theState The state of the sub-shapes to find (see GEOM::shape_state)
3706 List of all found sub-shapes indices.
3708 # Example: see GEOM_TestOthers.py
3709 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3710 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3713 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3714 # the specified quadrangle by the certain way, defined through \a theState parameter.
3715 # @param theShape Shape to find sub-shapes of.
3716 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3717 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3718 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3719 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3720 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3721 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3722 # @return List of all found sub-shapes.
3724 # @ref swig_GetShapesOnQuadrangle "Example"
3725 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3726 theTopLeftPoint, theTopRigthPoint,
3727 theBottomLeftPoint, theBottomRigthPoint, theState):
3729 Find in theShape all sub-shapes of type theShapeType, situated relatively
3730 the specified quadrangle by the certain way, defined through theState parameter.
3733 theShape Shape to find sub-shapes of.
3734 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3735 theTopLeftPoint Point, specifying top left corner of a quadrangle
3736 theTopRigthPoint Point, specifying top right corner of a quadrangle
3737 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3738 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3739 theState The state of the sub-shapes to find (see GEOM::shape_state)
3742 List of all found sub-shapes.
3744 # Example: see GEOM_TestOthers.py
3745 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3746 theTopLeftPoint, theTopRigthPoint,
3747 theBottomLeftPoint, theBottomRigthPoint, theState)
3748 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3751 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3752 # the specified quadrangle by the certain way, defined through \a theState parameter.
3753 # @param theShape Shape to find sub-shapes of.
3754 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3755 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3756 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3757 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3758 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3759 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3760 # @return List of all found sub-shapes indices.
3762 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3763 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3764 theTopLeftPoint, theTopRigthPoint,
3765 theBottomLeftPoint, theBottomRigthPoint, theState):
3767 Find in theShape all sub-shapes of type theShapeType, situated relatively
3768 the specified quadrangle by the certain way, defined through theState parameter.
3771 theShape Shape to find sub-shapes of.
3772 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3773 theTopLeftPoint Point, specifying top left corner of a quadrangle
3774 theTopRigthPoint Point, specifying top right corner of a quadrangle
3775 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3776 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3777 theState The state of the sub-shapes to find (see GEOM::shape_state)
3780 List of all found sub-shapes indices.
3783 # Example: see GEOM_TestOthers.py
3784 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3785 theTopLeftPoint, theTopRigthPoint,
3786 theBottomLeftPoint, theBottomRigthPoint, theState)
3787 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3790 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3791 # the specified \a theBox by the certain way, defined through \a theState parameter.
3792 # @param theBox Shape for relative comparing.
3793 # @param theShape Shape to find sub-shapes of.
3794 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3795 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3796 # @return List of all found sub-shapes.
3798 # @ref swig_GetShapesOnBox "Example"
3799 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3801 Find in theShape all sub-shapes of type theShapeType, situated relatively
3802 the specified theBox by the certain way, defined through theState parameter.
3805 theBox Shape for relative comparing.
3806 theShape Shape to find sub-shapes of.
3807 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3808 theState The state of the sub-shapes to find (see GEOM::shape_state)
3811 List of all found sub-shapes.
3813 # Example: see GEOM_TestOthers.py
3814 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3815 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3818 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3819 # the specified \a theBox by the certain way, defined through \a theState parameter.
3820 # @param theBox Shape for relative comparing.
3821 # @param theShape Shape to find sub-shapes of.
3822 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3823 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3824 # @return List of all found sub-shapes indices.
3826 # @ref swig_GetShapesOnBoxIDs "Example"
3827 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3829 Find in theShape all sub-shapes of type theShapeType, situated relatively
3830 the specified theBox by the certain way, defined through theState parameter.
3833 theBox Shape for relative comparing.
3834 theShape Shape to find sub-shapes of.
3835 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3836 theState The state of the sub-shapes to find (see GEOM::shape_state)
3839 List of all found sub-shapes indices.
3841 # Example: see GEOM_TestOthers.py
3842 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3843 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3846 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3847 # situated relatively the specified \a theCheckShape by the
3848 # certain way, defined through \a theState parameter.
3849 # @param theCheckShape Shape for relative comparing. It must be a solid.
3850 # @param theShape Shape to find sub-shapes of.
3851 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3852 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3853 # @return List of all found sub-shapes.
3855 # @ref swig_GetShapesOnShape "Example"
3856 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3858 Find in theShape all sub-shapes of type theShapeType,
3859 situated relatively the specified theCheckShape by the
3860 certain way, defined through theState parameter.
3863 theCheckShape Shape for relative comparing. It must be a solid.
3864 theShape Shape to find sub-shapes of.
3865 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3866 theState The state of the sub-shapes to find (see GEOM::shape_state)
3869 List of all found sub-shapes.
3871 # Example: see GEOM_TestOthers.py
3872 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3873 theShapeType, theState)
3874 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3877 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3878 # situated relatively the specified \a theCheckShape by the
3879 # certain way, defined through \a theState parameter.
3880 # @param theCheckShape Shape for relative comparing. It must be a solid.
3881 # @param theShape Shape to find sub-shapes of.
3882 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3883 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3884 # @return All found sub-shapes as compound.
3886 # @ref swig_GetShapesOnShapeAsCompound "Example"
3887 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3889 Find in theShape all sub-shapes of type theShapeType,
3890 situated relatively the specified theCheckShape by the
3891 certain way, defined through theState parameter.
3894 theCheckShape Shape for relative comparing. It must be a solid.
3895 theShape Shape to find sub-shapes of.
3896 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3897 theState The state of the sub-shapes to find (see GEOM::shape_state)
3900 All found sub-shapes as compound.
3902 # Example: see GEOM_TestOthers.py
3903 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3904 theShapeType, theState)
3905 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3908 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3909 # situated relatively the specified \a theCheckShape by the
3910 # certain way, defined through \a theState parameter.
3911 # @param theCheckShape Shape for relative comparing. It must be a solid.
3912 # @param theShape Shape to find sub-shapes of.
3913 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3914 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3915 # @return List of all found sub-shapes indices.
3917 # @ref swig_GetShapesOnShapeIDs "Example"
3918 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3920 Find in theShape all sub-shapes of type theShapeType,
3921 situated relatively the specified theCheckShape by the
3922 certain way, defined through theState parameter.
3925 theCheckShape Shape for relative comparing. It must be a solid.
3926 theShape Shape to find sub-shapes of.
3927 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3928 theState The state of the sub-shapes to find (see GEOM::shape_state)
3931 List of all found sub-shapes indices.
3933 # Example: see GEOM_TestOthers.py
3934 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3935 theShapeType, theState)
3936 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3939 ## Get sub-shape(s) of theShapeWhere, which are
3940 # coincident with \a theShapeWhat or could be a part of it.
3941 # @param theShapeWhere Shape to find sub-shapes of.
3942 # @param theShapeWhat Shape, specifying what to find.
3943 # @param isNewImplementation implementation of GetInPlace functionality
3944 # (default = False, old alghorithm based on shape properties)
3945 # @return Group of all found sub-shapes or a single found sub-shape.
3947 # @note This function has a restriction on argument shapes.
3948 # If \a theShapeWhere has curved parts with significantly
3949 # outstanding centres (i.e. the mass centre of a part is closer to
3950 # \a theShapeWhat than to the part), such parts will not be found.
3951 # @image html get_in_place_lost_part.png
3953 # @ref swig_GetInPlace "Example"
3954 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3956 Get sub-shape(s) of theShapeWhere, which are
3957 coincident with theShapeWhat or could be a part of it.
3960 theShapeWhere Shape to find sub-shapes of.
3961 theShapeWhat Shape, specifying what to find.
3962 isNewImplementation Implementation of GetInPlace functionality
3963 (default = False, old alghorithm based on shape properties)
3966 Group of all found sub-shapes or a single found sub-shape.
3970 This function has a restriction on argument shapes.
3971 If theShapeWhere has curved parts with significantly
3972 outstanding centres (i.e. the mass centre of a part is closer to
3973 theShapeWhat than to the part), such parts will not be found.
3975 # Example: see GEOM_TestOthers.py
3977 if isNewImplementation:
3978 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3980 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3982 RaiseIfFailed("GetInPlace", self.ShapesOp)
3985 ## Get sub-shape(s) of \a theShapeWhere, which are
3986 # coincident with \a theShapeWhat or could be a part of it.
3988 # Implementation of this method is based on a saved history of an operation,
3989 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3990 # arguments (an argument shape or a sub-shape of an argument shape).
3991 # The operation could be the Partition or one of boolean operations,
3992 # performed on simple shapes (not on compounds).
3994 # @param theShapeWhere Shape to find sub-shapes of.
3995 # @param theShapeWhat Shape, specifying what to find (must be in the
3996 # building history of the ShapeWhere).
3997 # @return Group of all found sub-shapes or a single found sub-shape.
3999 # @ref swig_GetInPlace "Example"
4000 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
4002 Implementation of this method is based on a saved history of an operation,
4003 produced theShapeWhere. The theShapeWhat must be among this operation's
4004 arguments (an argument shape or a sub-shape of an argument shape).
4005 The operation could be the Partition or one of boolean operations,
4006 performed on simple shapes (not on compounds).
4009 theShapeWhere Shape to find sub-shapes of.
4010 theShapeWhat Shape, specifying what to find (must be in the
4011 building history of the ShapeWhere).
4014 Group of all found sub-shapes or a single found sub-shape.
4016 # Example: see GEOM_TestOthers.py
4017 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
4018 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
4021 ## Get sub-shape of theShapeWhere, which is
4022 # equal to \a theShapeWhat.
4023 # @param theShapeWhere Shape to find sub-shape of.
4024 # @param theShapeWhat Shape, specifying what to find.
4025 # @return New GEOM.GEOM_Object for found sub-shape.
4027 # @ref swig_GetSame "Example"
4028 def GetSame(self,theShapeWhere, theShapeWhat):
4030 Get sub-shape of theShapeWhere, which is
4031 equal to theShapeWhat.
4034 theShapeWhere Shape to find sub-shape of.
4035 theShapeWhat Shape, specifying what to find.
4038 New GEOM.GEOM_Object for found sub-shape.
4040 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
4041 RaiseIfFailed("GetSame", self.ShapesOp)
4045 ## Get sub-shape indices of theShapeWhere, which is
4046 # equal to \a theShapeWhat.
4047 # @param theShapeWhere Shape to find sub-shape of.
4048 # @param theShapeWhat Shape, specifying what to find.
4049 # @return List of all found sub-shapes indices.
4051 # @ref swig_GetSame "Example"
4052 def GetSameIDs(self,theShapeWhere, theShapeWhat):
4054 Get sub-shape indices of theShapeWhere, which is
4055 equal to theShapeWhat.
4058 theShapeWhere Shape to find sub-shape of.
4059 theShapeWhat Shape, specifying what to find.
4062 List of all found sub-shapes indices.
4064 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
4065 RaiseIfFailed("GetSameIDs", self.ShapesOp)
4072 ## @addtogroup l4_access
4075 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
4076 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4077 # @param aShape Shape to get sub-shape of.
4078 # @param ListOfID List of sub-shapes indices.
4079 # @return Found sub-shape.
4081 # @ref swig_all_decompose "Example"
4082 def GetSubShape(self, aShape, ListOfID):
4084 Obtain a composite sub-shape of aShape, composed from sub-shapes
4085 of aShape, selected by their unique IDs inside aShape
4088 aShape Shape to get sub-shape of.
4089 ListOfID List of sub-shapes indices.
4094 # Example: see GEOM_TestAll.py
4095 anObj = self.AddSubShape(aShape,ListOfID)
4098 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
4099 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4100 # @param aShape Shape to get sub-shape of.
4101 # @param aSubShape Sub-shapes of aShape.
4102 # @return ID of found sub-shape.
4104 # @ref swig_all_decompose "Example"
4105 def GetSubShapeID(self, aShape, aSubShape):
4107 Obtain unique ID of sub-shape aSubShape inside aShape
4108 of aShape, selected by their unique IDs inside aShape
4111 aShape Shape to get sub-shape of.
4112 aSubShape Sub-shapes of aShape.
4115 ID of found sub-shape.
4117 # Example: see GEOM_TestAll.py
4118 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
4119 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4125 ## @addtogroup l4_decompose
4128 ## Get all sub-shapes and groups of \a theShape,
4129 # that were created already by any other methods.
4130 # @param theShape Any shape.
4131 # @param theGroupsOnly If this parameter is TRUE, only groups will be
4132 # returned, else all found sub-shapes and groups.
4133 # @return List of existing sub-objects of \a theShape.
4135 # @ref swig_all_decompose "Example"
4136 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4138 Get all sub-shapes and groups of theShape,
4139 that were created already by any other methods.
4143 theGroupsOnly If this parameter is TRUE, only groups will be
4144 returned, else all found sub-shapes and groups.
4147 List of existing sub-objects of theShape.
4149 # Example: see GEOM_TestAll.py
4150 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4151 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4154 ## Get all groups of \a theShape,
4155 # that were created already by any other methods.
4156 # @param theShape Any shape.
4157 # @return List of existing groups of \a theShape.
4159 # @ref swig_all_decompose "Example"
4160 def GetGroups(self, theShape):
4162 Get all groups of theShape,
4163 that were created already by any other methods.
4169 List of existing groups of theShape.
4171 # Example: see GEOM_TestAll.py
4172 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4173 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4176 ## Explode a shape on sub-shapes of a given type.
4177 # If the shape itself matches the type, it is also returned.
4178 # @param aShape Shape to be exploded.
4179 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4180 # @return List of sub-shapes of type theShapeType, contained in theShape.
4182 # @ref swig_all_decompose "Example"
4183 def SubShapeAll(self, aShape, aType):
4185 Explode a shape on sub-shapes of a given type.
4186 If the shape itself matches the type, it is also returned.
4189 aShape Shape to be exploded.
4190 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4193 List of sub-shapes of type theShapeType, contained in theShape.
4195 # Example: see GEOM_TestAll.py
4196 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
4197 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4200 ## Explode a shape on sub-shapes of a given type.
4201 # @param aShape Shape to be exploded.
4202 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4203 # @return List of IDs of sub-shapes.
4205 # @ref swig_all_decompose "Example"
4206 def SubShapeAllIDs(self, aShape, aType):
4208 Explode a shape on sub-shapes of a given type.
4211 aShape Shape to be exploded (see geompy.ShapeType)
4212 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4215 List of IDs of sub-shapes.
4217 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
4218 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4221 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4222 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4223 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4224 # @param aShape Shape to get sub-shape of.
4225 # @param ListOfInd List of sub-shapes indices.
4226 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4227 # @return A compound of sub-shapes of aShape.
4229 # @ref swig_all_decompose "Example"
4230 def SubShape(self, aShape, aType, ListOfInd):
4232 Obtain a compound of sub-shapes of aShape,
4233 selected by they indices in list of all sub-shapes of type aType.
4234 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4237 aShape Shape to get sub-shape of.
4238 ListOfID List of sub-shapes indices.
4239 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4242 A compound of sub-shapes of aShape.
4244 # Example: see GEOM_TestAll.py
4246 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
4247 for ind in ListOfInd:
4248 ListOfIDs.append(AllShapeIDsList[ind - 1])
4249 anObj = self.GetSubShape(aShape, ListOfIDs)
4252 ## Explode a shape on sub-shapes of a given type.
4253 # Sub-shapes will be sorted by coordinates of their gravity centers.
4254 # If the shape itself matches the type, it is also returned.
4255 # @param aShape Shape to be exploded.
4256 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4257 # @return List of sub-shapes of type theShapeType, contained in theShape.
4259 # @ref swig_SubShapeAllSorted "Example"
4260 def SubShapeAllSortedCentres(self, aShape, aType):
4262 Explode a shape on sub-shapes of a given type.
4263 Sub-shapes will be sorted by coordinates of their gravity centers.
4264 If the shape itself matches the type, it is also returned.
4267 aShape Shape to be exploded.
4268 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4271 List of sub-shapes of type theShapeType, contained in theShape.
4273 # Example: see GEOM_TestAll.py
4274 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
4275 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4278 ## Explode a shape on sub-shapes of a given type.
4279 # Sub-shapes will be sorted by coordinates of their gravity centers.
4280 # @param aShape Shape to be exploded.
4281 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4282 # @return List of IDs of sub-shapes.
4284 # @ref swig_all_decompose "Example"
4285 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4287 Explode a shape on sub-shapes of a given type.
4288 Sub-shapes will be sorted by coordinates of their gravity centers.
4291 aShape Shape to be exploded.
4292 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4295 List of IDs of sub-shapes.
4297 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
4298 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4301 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4302 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4303 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4304 # @param aShape Shape to get sub-shape of.
4305 # @param ListOfInd List of sub-shapes indices.
4306 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4307 # @return A compound of sub-shapes of aShape.
4309 # @ref swig_all_decompose "Example"
4310 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4312 Obtain a compound of sub-shapes of aShape,
4313 selected by they indices in sorted list of all sub-shapes of type aType.
4314 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4317 aShape Shape to get sub-shape of.
4318 ListOfID List of sub-shapes indices.
4319 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4322 A compound of sub-shapes of aShape.
4324 # Example: see GEOM_TestAll.py
4326 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
4327 for ind in ListOfInd:
4328 ListOfIDs.append(AllShapeIDsList[ind - 1])
4329 anObj = self.GetSubShape(aShape, ListOfIDs)
4332 ## Extract shapes (excluding the main shape) of given type.
4333 # @param aShape The shape.
4334 # @param aType The shape type (see ShapeType())
4335 # @param isSorted Boolean flag to switch sorting on/off.
4336 # @return List of sub-shapes of type aType, contained in aShape.
4338 # @ref swig_FilletChamfer "Example"
4339 def ExtractShapes(self, aShape, aType, isSorted = False):
4341 Extract shapes (excluding the main shape) of given type.
4345 aType The shape type (see geompy.ShapeType)
4346 isSorted Boolean flag to switch sorting on/off.
4349 List of sub-shapes of type aType, contained in aShape.
4351 # Example: see GEOM_TestAll.py
4352 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
4353 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4356 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4357 # @param aShape Main shape.
4358 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4359 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4361 # @ref swig_all_decompose "Example"
4362 def SubShapes(self, aShape, anIDs):
4364 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4368 anIDs List of unique IDs of sub-shapes inside theMainShape.
4371 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4373 # Example: see GEOM_TestAll.py
4374 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4375 RaiseIfFailed("SubShapes", self.ShapesOp)
4378 # end of l4_decompose
4381 ## @addtogroup l4_decompose_d
4384 ## Deprecated method
4385 # It works like SubShapeAllSortedCentres(), but wrongly
4386 # defines centres of faces, shells and solids.
4387 def SubShapeAllSorted(self, aShape, aType):
4390 It works like geompy.SubShapeAllSortedCentres, but wrongly
4391 defines centres of faces, shells and solids.
4393 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
4394 RaiseIfFailed("MakeExplode", self.ShapesOp)
4397 ## Deprecated method
4398 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4399 # defines centres of faces, shells and solids.
4400 def SubShapeAllSortedIDs(self, aShape, aType):
4403 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4404 defines centres of faces, shells and solids.
4406 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
4407 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4410 ## Deprecated method
4411 # It works like SubShapeSortedCentres(), but has a bug
4412 # (wrongly defines centres of faces, shells and solids).
4413 def SubShapeSorted(self, aShape, aType, ListOfInd):
4416 It works like geompy.SubShapeSortedCentres, but has a bug
4417 (wrongly defines centres of faces, shells and solids).
4420 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
4421 for ind in ListOfInd:
4422 ListOfIDs.append(AllShapeIDsList[ind - 1])
4423 anObj = self.GetSubShape(aShape, ListOfIDs)
4426 # end of l4_decompose_d
4429 ## @addtogroup l3_healing
4432 ## Apply a sequence of Shape Healing operators to the given object.
4433 # @param theShape Shape to be processed.
4434 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4435 # @param theParameters List of names of parameters
4436 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4437 # @param theValues List of values of parameters, in the same order
4438 # as parameters are listed in <VAR>theParameters</VAR> list.
4441 # <b> Operators and Parameters: </b> \n
4443 # * \b FixShape - corrects invalid shapes. \n
4444 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4445 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4447 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4448 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4449 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4450 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4452 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4453 # surfaces in segments using a certain angle. \n
4454 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4455 # if Angle=180, four if Angle=90, etc). \n
4456 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4458 # * \b SplitClosedFaces - splits closed faces in segments.
4459 # The number of segments depends on the number of splitting points.\n
4460 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4462 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4463 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4464 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4465 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4466 # This and the previous parameters can take the following values:\n
4467 # \b Parametric \b Continuity \n
4468 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4469 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4470 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4471 # ruling out sharp edges).\n
4472 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4473 # are of the same magnitude).\n
4474 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4475 # or surfaces (d/du C(u)) are the same at junction. \n
4476 # \b Geometric \b Continuity \n
4477 # \b G1: first derivatives are proportional at junction.\n
4478 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4479 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4480 # \b G2: first and second derivatives are proportional at junction.
4481 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4482 # continuity requires that the underlying parameterization was continuous as well.
4483 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4485 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4486 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4487 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4488 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4489 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4490 # with the specified parameters.\n
4491 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4492 # with the specified parameters.\n
4493 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4494 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4495 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4496 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4498 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4499 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4500 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4501 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4502 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4504 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4505 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4508 # @return New GEOM.GEOM_Object, containing processed shape.
4510 # \n @ref tui_shape_processing "Example"
4511 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4513 Apply a sequence of Shape Healing operators to the given object.
4516 theShape Shape to be processed.
4517 theValues List of values of parameters, in the same order
4518 as parameters are listed in theParameters list.
4519 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4520 theParameters List of names of parameters
4521 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4522 Operators and Parameters:
4524 * FixShape - corrects invalid shapes.
4525 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4526 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4527 * FixFaceSize - removes small faces, such as spots and strips.
4528 * FixFaceSize.Tolerance - defines minimum possible face size.
4529 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4530 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4531 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4532 in segments using a certain angle.
4533 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4534 if Angle=180, four if Angle=90, etc).
4535 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4536 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4538 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4539 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4540 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4541 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4542 * SplitContinuity.CurveContinuity - required continuity for curves.
4543 This and the previous parameters can take the following values:
4545 Parametric Continuity:
4546 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4547 coincidental. The curves or surfaces may still meet at an angle,
4548 giving rise to a sharp corner or edge).
4549 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4550 are parallel, ruling out sharp edges).
4551 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4552 or surfaces are of the same magnitude).
4553 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4554 curves or surfaces (d/du C(u)) are the same at junction.
4556 Geometric Continuity:
4557 G1: first derivatives are proportional at junction.
4558 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4559 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4560 G2: first and second derivatives are proportional at junction. As the names imply,
4561 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4562 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4563 geometric continuity of order n, but not vice-versa.
4564 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4565 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4566 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4567 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4568 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4569 the specified parameters.
4570 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4571 the specified parameters.
4572 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4573 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4574 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4575 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4576 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4577 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4578 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4579 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4580 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4581 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4582 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4585 New GEOM.GEOM_Object, containing processed shape.
4587 Note: For more information look through SALOME Geometry User's Guide->
4588 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4590 # Example: see GEOM_TestHealing.py
4591 theValues,Parameters = ParseList(theValues)
4592 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4593 # To avoid script failure in case of good argument shape
4594 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4596 RaiseIfFailed("ProcessShape", self.HealOp)
4597 for string in (theOperators + theParameters):
4598 Parameters = ":" + Parameters
4600 anObj.SetParameters(Parameters)
4603 ## Remove faces from the given object (shape).
4604 # @param theObject Shape to be processed.
4605 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4606 # removes ALL faces of the given object.
4607 # @return New GEOM.GEOM_Object, containing processed shape.
4609 # @ref tui_suppress_faces "Example"
4610 def SuppressFaces(self,theObject, theFaces):
4612 Remove faces from the given object (shape).
4615 theObject Shape to be processed.
4616 theFaces Indices of faces to be removed, if EMPTY then the method
4617 removes ALL faces of the given object.
4620 New GEOM.GEOM_Object, containing processed shape.
4622 # Example: see GEOM_TestHealing.py
4623 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4624 RaiseIfFailed("SuppressFaces", self.HealOp)
4627 ## Sewing of some shapes into single shape.
4628 # @param ListShape Shapes to be processed.
4629 # @param theTolerance Required tolerance value.
4630 # @return New GEOM.GEOM_Object, containing processed shape.
4632 # @ref tui_sewing "Example"
4633 def MakeSewing(self, ListShape, theTolerance):
4635 Sewing of some shapes into single shape.
4638 ListShape Shapes to be processed.
4639 theTolerance Required tolerance value.
4642 New GEOM.GEOM_Object, containing processed shape.
4644 # Example: see GEOM_TestHealing.py
4645 comp = self.MakeCompound(ListShape)
4646 anObj = self.Sew(comp, theTolerance)
4649 ## Sewing of the given object.
4650 # @param theObject Shape to be processed.
4651 # @param theTolerance Required tolerance value.
4652 # @return New GEOM.GEOM_Object, containing processed shape.
4653 def Sew(self, theObject, theTolerance):
4655 Sewing of the given object.
4658 theObject Shape to be processed.
4659 theTolerance Required tolerance value.
4662 New GEOM.GEOM_Object, containing processed shape.
4664 # Example: see MakeSewing() above
4665 theTolerance,Parameters = ParseParameters(theTolerance)
4666 anObj = self.HealOp.Sew(theObject, theTolerance)
4667 RaiseIfFailed("Sew", self.HealOp)
4668 anObj.SetParameters(Parameters)
4671 ## Remove internal wires and edges from the given object (face).
4672 # @param theObject Shape to be processed.
4673 # @param theWires Indices of wires to be removed, if EMPTY then the method
4674 # removes ALL internal wires of the given object.
4675 # @return New GEOM.GEOM_Object, containing processed shape.
4677 # @ref tui_suppress_internal_wires "Example"
4678 def SuppressInternalWires(self,theObject, theWires):
4680 Remove internal wires and edges from the given object (face).
4683 theObject Shape to be processed.
4684 theWires Indices of wires to be removed, if EMPTY then the method
4685 removes ALL internal wires of the given object.
4688 New GEOM.GEOM_Object, containing processed shape.
4690 # Example: see GEOM_TestHealing.py
4691 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4692 RaiseIfFailed("RemoveIntWires", self.HealOp)
4695 ## Remove internal closed contours (holes) from the given object.
4696 # @param theObject Shape to be processed.
4697 # @param theWires Indices of wires to be removed, if EMPTY then the method
4698 # removes ALL internal holes of the given object
4699 # @return New GEOM.GEOM_Object, containing processed shape.
4701 # @ref tui_suppress_holes "Example"
4702 def SuppressHoles(self,theObject, theWires):
4704 Remove internal closed contours (holes) from the given object.
4707 theObject Shape to be processed.
4708 theWires Indices of wires to be removed, if EMPTY then the method
4709 removes ALL internal holes of the given object
4712 New GEOM.GEOM_Object, containing processed shape.
4714 # Example: see GEOM_TestHealing.py
4715 anObj = self.HealOp.FillHoles(theObject, theWires)
4716 RaiseIfFailed("FillHoles", self.HealOp)
4719 ## Close an open wire.
4720 # @param theObject Shape to be processed.
4721 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4722 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4723 # @param isCommonVertex If True : closure by creation of a common vertex,
4724 # If False : closure by creation of an edge between ends.
4725 # @return New GEOM.GEOM_Object, containing processed shape.
4727 # @ref tui_close_contour "Example"
4728 def CloseContour(self,theObject, theWires, isCommonVertex):
4733 theObject Shape to be processed.
4734 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4735 if [ ], then theObject itself is a wire.
4736 isCommonVertex If True : closure by creation of a common vertex,
4737 If False : closure by creation of an edge between ends.
4740 New GEOM.GEOM_Object, containing processed shape.
4742 # Example: see GEOM_TestHealing.py
4743 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4744 RaiseIfFailed("CloseContour", self.HealOp)
4747 ## Addition of a point to a given edge object.
4748 # @param theObject Shape to be processed.
4749 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4750 # if -1, then theObject itself is the edge.
4751 # @param theValue Value of parameter on edge or length parameter,
4752 # depending on \a isByParameter.
4753 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4754 # if FALSE : \a theValue is treated as a length parameter [0..1]
4755 # @return New GEOM.GEOM_Object, containing processed shape.
4757 # @ref tui_add_point_on_edge "Example"
4758 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4760 Addition of a point to a given edge object.
4763 theObject Shape to be processed.
4764 theEdgeIndex Index of edge to be divided within theObject's shape,
4765 if -1, then theObject itself is the edge.
4766 theValue Value of parameter on edge or length parameter,
4767 depending on isByParameter.
4768 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4769 if FALSE : theValue is treated as a length parameter [0..1]
4772 New GEOM.GEOM_Object, containing processed shape.
4774 # Example: see GEOM_TestHealing.py
4775 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4776 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4777 RaiseIfFailed("DivideEdge", self.HealOp)
4778 anObj.SetParameters(Parameters)
4781 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4782 # @param theWire Wire to minimize the number of C1 continuous edges in.
4783 # @param theVertices A list of vertices to suppress. If the list
4784 # is empty, all vertices in a wire will be assumed.
4785 # @return New GEOM.GEOM_Object with modified wire.
4787 # @ref tui_fuse_collinear_edges "Example"
4788 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4790 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4793 theWire Wire to minimize the number of C1 continuous edges in.
4794 theVertices A list of vertices to suppress. If the list
4795 is empty, all vertices in a wire will be assumed.
4798 New GEOM.GEOM_Object with modified wire.
4800 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4801 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4804 ## Change orientation of the given object. Updates given shape.
4805 # @param theObject Shape to be processed.
4806 # @return Updated <var>theObject</var>
4808 # @ref swig_todo "Example"
4809 def ChangeOrientationShell(self,theObject):
4811 Change orientation of the given object. Updates given shape.
4814 theObject Shape to be processed.
4819 theObject = self.HealOp.ChangeOrientation(theObject)
4820 RaiseIfFailed("ChangeOrientation", self.HealOp)
4823 ## Change orientation of the given object.
4824 # @param theObject Shape to be processed.
4825 # @return New GEOM.GEOM_Object, containing processed shape.
4827 # @ref swig_todo "Example"
4828 def ChangeOrientationShellCopy(self, theObject):
4830 Change orientation of the given object.
4833 theObject Shape to be processed.
4836 New GEOM.GEOM_Object, containing processed shape.
4838 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4839 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4842 ## Try to limit tolerance of the given object by value \a theTolerance.
4843 # @param theObject Shape to be processed.
4844 # @param theTolerance Required tolerance value.
4845 # @return New GEOM.GEOM_Object, containing processed shape.
4847 # @ref tui_limit_tolerance "Example"
4848 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4850 Try to limit tolerance of the given object by value theTolerance.
4853 theObject Shape to be processed.
4854 theTolerance Required tolerance value.
4857 New GEOM.GEOM_Object, containing processed shape.
4859 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4860 RaiseIfFailed("LimitTolerance", self.HealOp)
4863 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4864 # that constitute a free boundary of the given shape.
4865 # @param theObject Shape to get free boundary of.
4866 # @return [\a status, \a theClosedWires, \a theOpenWires]
4867 # \n \a status: FALSE, if an error(s) occured during the method execution.
4868 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4869 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4871 # @ref tui_measurement_tools_page "Example"
4872 def GetFreeBoundary(self, theObject):
4874 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4875 that constitute a free boundary of the given shape.
4878 theObject Shape to get free boundary of.
4881 [status, theClosedWires, theOpenWires]
4882 status: FALSE, if an error(s) occured during the method execution.
4883 theClosedWires: Closed wires on the free boundary of the given shape.
4884 theOpenWires: Open wires on the free boundary of the given shape.
4886 # Example: see GEOM_TestHealing.py
4887 anObj = self.HealOp.GetFreeBoundary(theObject)
4888 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4891 ## Replace coincident faces in theShape by one face.
4892 # @param theShape Initial shape.
4893 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4894 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4895 # otherwise all initial shapes.
4896 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4898 # @ref tui_glue_faces "Example"
4899 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4901 Replace coincident faces in theShape by one face.
4904 theShape Initial shape.
4905 theTolerance Maximum distance between faces, which can be considered as coincident.
4906 doKeepNonSolids If FALSE, only solids will present in the result,
4907 otherwise all initial shapes.
4910 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4912 # Example: see GEOM_Spanner.py
4913 theTolerance,Parameters = ParseParameters(theTolerance)
4914 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4916 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4917 anObj.SetParameters(Parameters)
4920 ## Find coincident faces in theShape for possible gluing.
4921 # @param theShape Initial shape.
4922 # @param theTolerance Maximum distance between faces,
4923 # which can be considered as coincident.
4924 # @return GEOM.ListOfGO
4926 # @ref tui_glue_faces "Example"
4927 def GetGlueFaces(self, theShape, theTolerance):
4929 Find coincident faces in theShape for possible gluing.
4932 theShape Initial shape.
4933 theTolerance Maximum distance between faces,
4934 which can be considered as coincident.
4939 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4940 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4943 ## Replace coincident faces in theShape by one face
4944 # in compliance with given list of faces
4945 # @param theShape Initial shape.
4946 # @param theTolerance Maximum distance between faces,
4947 # which can be considered as coincident.
4948 # @param theFaces List of faces for gluing.
4949 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4950 # otherwise all initial shapes.
4951 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4952 # will be glued, otherwise only the edges,
4953 # belonging to <VAR>theFaces</VAR>.
4954 # @return New GEOM.GEOM_Object, containing a copy of theShape
4955 # without some faces.
4957 # @ref tui_glue_faces "Example"
4958 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4959 doKeepNonSolids=True, doGlueAllEdges=True):
4961 Replace coincident faces in theShape by one face
4962 in compliance with given list of faces
4965 theShape Initial shape.
4966 theTolerance Maximum distance between faces,
4967 which can be considered as coincident.
4968 theFaces List of faces for gluing.
4969 doKeepNonSolids If FALSE, only solids will present in the result,
4970 otherwise all initial shapes.
4971 doGlueAllEdges If TRUE, all coincident edges of theShape
4972 will be glued, otherwise only the edges,
4973 belonging to theFaces.
4976 New GEOM.GEOM_Object, containing a copy of theShape
4979 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4980 doKeepNonSolids, doGlueAllEdges)
4982 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4985 ## Replace coincident edges in theShape by one edge.
4986 # @param theShape Initial shape.
4987 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
4988 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4990 # @ref tui_glue_edges "Example"
4991 def MakeGlueEdges(self, theShape, theTolerance):
4993 Replace coincident edges in theShape by one edge.
4996 theShape Initial shape.
4997 theTolerance Maximum distance between edges, which can be considered as coincident.
5000 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5002 theTolerance,Parameters = ParseParameters(theTolerance)
5003 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
5005 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
5006 anObj.SetParameters(Parameters)
5009 ## Find coincident edges in theShape for possible gluing.
5010 # @param theShape Initial shape.
5011 # @param theTolerance Maximum distance between edges,
5012 # which can be considered as coincident.
5013 # @return GEOM.ListOfGO
5015 # @ref tui_glue_edges "Example"
5016 def GetGlueEdges(self, theShape, theTolerance):
5018 Find coincident edges in theShape for possible gluing.
5021 theShape Initial shape.
5022 theTolerance Maximum distance between edges,
5023 which can be considered as coincident.
5028 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
5029 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
5032 ## Replace coincident edges in theShape by one edge
5033 # in compliance with given list of edges.
5034 # @param theShape Initial shape.
5035 # @param theTolerance Maximum distance between edges,
5036 # which can be considered as coincident.
5037 # @param theEdges List of edges for gluing.
5038 # @return New GEOM.GEOM_Object, containing a copy of theShape
5039 # without some edges.
5041 # @ref tui_glue_edges "Example"
5042 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
5044 Replace coincident edges in theShape by one edge
5045 in compliance with given list of edges.
5048 theShape Initial shape.
5049 theTolerance Maximum distance between edges,
5050 which can be considered as coincident.
5051 theEdges List of edges for gluing.
5054 New GEOM.GEOM_Object, containing a copy of theShape
5057 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
5059 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
5065 ## @addtogroup l3_boolean Boolean Operations
5068 # -----------------------------------------------------------------------------
5069 # Boolean (Common, Cut, Fuse, Section)
5070 # -----------------------------------------------------------------------------
5072 ## Perform one of boolean operations on two given shapes.
5073 # @param theShape1 First argument for boolean operation.
5074 # @param theShape2 Second argument for boolean operation.
5075 # @param theOperation Indicates the operation to be done:\n
5076 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5077 # @return New GEOM.GEOM_Object, containing the result shape.
5079 # @ref tui_fuse "Example"
5080 def MakeBoolean(self,theShape1, theShape2, theOperation):
5082 Perform one of boolean operations on two given shapes.
5085 theShape1 First argument for boolean operation.
5086 theShape2 Second argument for boolean operation.
5087 theOperation Indicates the operation to be done:
5088 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5091 New GEOM.GEOM_Object, containing the result shape.
5093 # Example: see GEOM_TestAll.py
5094 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
5095 RaiseIfFailed("MakeBoolean", self.BoolOp)
5098 ## Perform Common boolean operation on two given shapes.
5099 # @param theShape1 First argument for boolean operation.
5100 # @param theShape2 Second argument for boolean operation.
5101 # @return New GEOM.GEOM_Object, containing the result shape.
5103 # @ref tui_common "Example 1"
5104 # \n @ref swig_MakeCommon "Example 2"
5105 def MakeCommon(self, theShape1, theShape2):
5107 Perform Common boolean operation on two given shapes.
5110 theShape1 First argument for boolean operation.
5111 theShape2 Second argument for boolean operation.
5114 New GEOM.GEOM_Object, containing the result shape.
5116 # Example: see GEOM_TestOthers.py
5117 return self.MakeBoolean(theShape1, theShape2, 1)
5119 ## Perform Cut boolean operation on two given shapes.
5120 # @param theShape1 First argument for boolean operation.
5121 # @param theShape2 Second argument for boolean operation.
5122 # @return New GEOM.GEOM_Object, containing the result shape.
5124 # @ref tui_cut "Example 1"
5125 # \n @ref swig_MakeCommon "Example 2"
5126 def MakeCut(self, theShape1, theShape2):
5128 Perform Cut boolean operation on two given shapes.
5131 theShape1 First argument for boolean operation.
5132 theShape2 Second argument for boolean operation.
5135 New GEOM.GEOM_Object, containing the result shape.
5138 # Example: see GEOM_TestOthers.py
5139 return self.MakeBoolean(theShape1, theShape2, 2)
5141 ## Perform Fuse boolean operation on two given shapes.
5142 # @param theShape1 First argument for boolean operation.
5143 # @param theShape2 Second argument for boolean operation.
5144 # @return New GEOM.GEOM_Object, containing the result shape.
5146 # @ref tui_fuse "Example 1"
5147 # \n @ref swig_MakeCommon "Example 2"
5148 def MakeFuse(self, theShape1, theShape2):
5150 Perform Fuse boolean operation on two given shapes.
5153 theShape1 First argument for boolean operation.
5154 theShape2 Second argument for boolean operation.
5157 New GEOM.GEOM_Object, containing the result shape.
5160 # Example: see GEOM_TestOthers.py
5161 return self.MakeBoolean(theShape1, theShape2, 3)
5163 ## Perform Section boolean operation on two given shapes.
5164 # @param theShape1 First argument for boolean operation.
5165 # @param theShape2 Second argument for boolean operation.
5166 # @return New GEOM.GEOM_Object, containing the result shape.
5168 # @ref tui_section "Example 1"
5169 # \n @ref swig_MakeCommon "Example 2"
5170 def MakeSection(self, theShape1, theShape2):
5172 Perform Section boolean operation on two given shapes.
5175 theShape1 First argument for boolean operation.
5176 theShape2 Second argument for boolean operation.
5179 New GEOM.GEOM_Object, containing the result shape.
5182 # Example: see GEOM_TestOthers.py
5183 return self.MakeBoolean(theShape1, theShape2, 4)
5188 ## @addtogroup l3_basic_op
5191 ## Perform partition operation.
5192 # @param ListShapes Shapes to be intersected.
5193 # @param ListTools Shapes to intersect theShapes.
5194 # @param Limit Type of resulting shapes (see ShapeType()).\n
5195 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
5196 # type will be detected automatically.
5197 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5198 # target type (equal to Limit) are kept in the result,
5199 # else standalone shapes of lower dimension
5200 # are kept also (if they exist).
5201 # @note Each compound from ListShapes and ListTools will be exploded
5202 # in order to avoid possible intersection between shapes from this compound.
5204 # After implementation new version of PartitionAlgo (October 2006)
5205 # other parameters are ignored by current functionality. They are kept
5206 # in this function only for support old versions.
5207 # @param ListKeepInside Shapes, outside which the results will be deleted.
5208 # Each shape from theKeepInside must belong to theShapes also.
5209 # @param ListRemoveInside Shapes, inside which the results will be deleted.
5210 # Each shape from theRemoveInside must belong to theShapes also.
5211 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5212 # @param ListMaterials Material indices for each shape. Make sence,
5213 # only if theRemoveWebs is TRUE.
5215 # @return New GEOM.GEOM_Object, containing the result shapes.
5217 # @ref tui_partition "Example"
5218 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5219 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5220 KeepNonlimitShapes=0):
5222 Perform partition operation.
5225 ListShapes Shapes to be intersected.
5226 ListTools Shapes to intersect theShapes.
5227 Limit Type of resulting shapes (see geompy.ShapeType)
5228 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5229 type will be detected automatically.
5230 KeepNonlimitShapes if this parameter == 0, then only shapes of
5231 target type (equal to Limit) are kept in the result,
5232 else standalone shapes of lower dimension
5233 are kept also (if they exist).
5235 Each compound from ListShapes and ListTools will be exploded
5236 in order to avoid possible intersection between shapes from
5239 After implementation new version of PartitionAlgo (October 2006) other
5240 parameters are ignored by current functionality. They are kept in this
5241 function only for support old versions.
5244 ListKeepInside Shapes, outside which the results will be deleted.
5245 Each shape from theKeepInside must belong to theShapes also.
5246 ListRemoveInside Shapes, inside which the results will be deleted.
5247 Each shape from theRemoveInside must belong to theShapes also.
5248 RemoveWebs If TRUE, perform Glue 3D algorithm.
5249 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5252 New GEOM.GEOM_Object, containing the result shapes.
5254 # Example: see GEOM_TestAll.py
5255 if Limit == ShapeType["AUTO"]:
5256 # automatic detection of the most appropriate shape limit type
5258 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5259 Limit = EnumToLong(lim)
5261 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5262 ListKeepInside, ListRemoveInside,
5263 Limit, RemoveWebs, ListMaterials,
5264 KeepNonlimitShapes);
5265 RaiseIfFailed("MakePartition", self.BoolOp)
5268 ## Perform partition operation.
5269 # This method may be useful if it is needed to make a partition for
5270 # compound contains nonintersected shapes. Performance will be better
5271 # since intersection between shapes from compound is not performed.
5273 # Description of all parameters as in previous method MakePartition()
5275 # @note Passed compounds (via ListShapes or via ListTools)
5276 # have to consist of nonintersecting shapes.
5278 # @return New GEOM.GEOM_Object, containing the result shapes.
5280 # @ref swig_todo "Example"
5281 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5282 ListKeepInside=[], ListRemoveInside=[],
5283 Limit=ShapeType["AUTO"], RemoveWebs=0,
5284 ListMaterials=[], KeepNonlimitShapes=0):
5286 Perform partition operation.
5287 This method may be useful if it is needed to make a partition for
5288 compound contains nonintersected shapes. Performance will be better
5289 since intersection between shapes from compound is not performed.
5292 Description of all parameters as in method geompy.MakePartition
5295 Passed compounds (via ListShapes or via ListTools)
5296 have to consist of nonintersecting shapes.
5299 New GEOM.GEOM_Object, containing the result shapes.
5301 if Limit == ShapeType["AUTO"]:
5302 # automatic detection of the most appropriate shape limit type
5304 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5305 Limit = EnumToLong(lim)
5307 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5308 ListKeepInside, ListRemoveInside,
5309 Limit, RemoveWebs, ListMaterials,
5310 KeepNonlimitShapes);
5311 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5314 ## See method MakePartition() for more information.
5316 # @ref tui_partition "Example 1"
5317 # \n @ref swig_Partition "Example 2"
5318 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5319 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5320 KeepNonlimitShapes=0):
5322 See method geompy.MakePartition for more information.
5324 # Example: see GEOM_TestOthers.py
5325 anObj = self.MakePartition(ListShapes, ListTools,
5326 ListKeepInside, ListRemoveInside,
5327 Limit, RemoveWebs, ListMaterials,
5328 KeepNonlimitShapes);
5331 ## Perform partition of the Shape with the Plane
5332 # @param theShape Shape to be intersected.
5333 # @param thePlane Tool shape, to intersect theShape.
5334 # @return New GEOM.GEOM_Object, containing the result shape.
5336 # @ref tui_partition "Example"
5337 def MakeHalfPartition(self,theShape, thePlane):
5339 Perform partition of the Shape with the Plane
5342 theShape Shape to be intersected.
5343 thePlane Tool shape, to intersect theShape.
5346 New GEOM.GEOM_Object, containing the result shape.
5348 # Example: see GEOM_TestAll.py
5349 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5350 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5353 # end of l3_basic_op
5356 ## @addtogroup l3_transform
5359 ## Translate the given object along the vector, specified
5360 # by its end points, creating its copy before the translation.
5361 # @param theObject The object to be translated.
5362 # @param thePoint1 Start point of translation vector.
5363 # @param thePoint2 End point of translation vector.
5364 # @return New GEOM.GEOM_Object, containing the translated object.
5366 # @ref tui_translation "Example 1"
5367 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5368 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5370 Translate the given object along the vector, specified
5371 by its end points, creating its copy before the translation.
5374 theObject The object to be translated.
5375 thePoint1 Start point of translation vector.
5376 thePoint2 End point of translation vector.
5379 New GEOM.GEOM_Object, containing the translated object.
5381 # Example: see GEOM_TestAll.py
5382 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5383 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5386 ## Translate the given object along the vector, specified by its components.
5387 # @param theObject The object to be translated.
5388 # @param theDX,theDY,theDZ Components of translation vector.
5389 # @return Translated GEOM.GEOM_Object.
5391 # @ref tui_translation "Example"
5392 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5394 Translate the given object along the vector, specified by its components.
5397 theObject The object to be translated.
5398 theDX,theDY,theDZ Components of translation vector.
5401 Translated GEOM.GEOM_Object.
5403 # Example: see GEOM_TestAll.py
5404 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5405 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5406 anObj.SetParameters(Parameters)
5407 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5410 ## Translate the given object along the vector, specified
5411 # by its components, creating its copy before the translation.
5412 # @param theObject The object to be translated.
5413 # @param theDX,theDY,theDZ Components of translation vector.
5414 # @return New GEOM.GEOM_Object, containing the translated object.
5416 # @ref tui_translation "Example"
5417 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5419 Translate the given object along the vector, specified
5420 by its components, creating its copy before the translation.
5423 theObject The object to be translated.
5424 theDX,theDY,theDZ Components of translation vector.
5427 New GEOM.GEOM_Object, containing the translated object.
5429 # Example: see GEOM_TestAll.py
5430 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5431 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5432 anObj.SetParameters(Parameters)
5433 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5436 ## Translate the given object along the given vector,
5437 # creating its copy before the translation.
5438 # @param theObject The object to be translated.
5439 # @param theVector The translation vector.
5440 # @return New GEOM.GEOM_Object, containing the translated object.
5442 # @ref tui_translation "Example"
5443 def MakeTranslationVector(self,theObject, theVector):
5445 Translate the given object along the given vector,
5446 creating its copy before the translation.
5449 theObject The object to be translated.
5450 theVector The translation vector.
5453 New GEOM.GEOM_Object, containing the translated object.
5455 # Example: see GEOM_TestAll.py
5456 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5457 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5460 ## Translate the given object along the given vector on given distance.
5461 # @param theObject The object to be translated.
5462 # @param theVector The translation vector.
5463 # @param theDistance The translation distance.
5464 # @param theCopy Flag used to translate object itself or create a copy.
5465 # @return New GEOM.GEOM_Object, containing the translated object.
5467 # @ref tui_translation "Example"
5468 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5470 Translate the given object along the given vector on given distance.
5473 theObject The object to be translated.
5474 theVector The translation vector.
5475 theDistance The translation distance.
5476 theCopy Flag used to translate object itself or create a copy.
5479 New GEOM.GEOM_Object, containing the translated object.
5481 # Example: see GEOM_TestAll.py
5482 theDistance,Parameters = ParseParameters(theDistance)
5483 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5484 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5485 anObj.SetParameters(Parameters)
5488 ## Translate the given object along the given vector on given distance,
5489 # creating its copy before the translation.
5490 # @param theObject The object to be translated.
5491 # @param theVector The translation vector.
5492 # @param theDistance The translation distance.
5493 # @return New GEOM.GEOM_Object, containing the translated object.
5495 # @ref tui_translation "Example"
5496 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5498 Translate the given object along the given vector on given distance,
5499 creating its copy before the translation.
5502 theObject The object to be translated.
5503 theVector The translation vector.
5504 theDistance The translation distance.
5507 New GEOM.GEOM_Object, containing the translated object.
5509 # Example: see GEOM_TestAll.py
5510 theDistance,Parameters = ParseParameters(theDistance)
5511 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5512 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5513 anObj.SetParameters(Parameters)
5516 ## Rotate the given object around the given axis on the given angle.
5517 # @param theObject The object to be rotated.
5518 # @param theAxis Rotation axis.
5519 # @param theAngle Rotation angle in radians.
5520 # @return New GEOM.GEOM_Object, containing the rotated object.
5522 # @ref tui_rotation "Example"
5523 def Rotate(self,theObject, theAxis, theAngle):
5525 Rotate the given object around the given axis on the given angle.
5528 theObject The object to be rotated.
5529 theAxis Rotation axis.
5530 theAngle Rotation angle in radians.
5533 New GEOM.GEOM_Object, containing the rotated object.
5535 # Example: see GEOM_TestAll.py
5537 if isinstance(theAngle,str):
5539 theAngle, Parameters = ParseParameters(theAngle)
5541 theAngle = theAngle*math.pi/180.0
5542 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5543 RaiseIfFailed("RotateCopy", self.TrsfOp)
5544 anObj.SetParameters(Parameters)
5547 ## Rotate the given object around the given axis
5548 # on the given angle, creating its copy before the rotatation.
5549 # @param theObject The object to be rotated.
5550 # @param theAxis Rotation axis.
5551 # @param theAngle Rotation angle in radians.
5552 # @return New GEOM.GEOM_Object, containing the rotated object.
5554 # @ref tui_rotation "Example"
5555 def MakeRotation(self,theObject, theAxis, theAngle):
5557 Rotate the given object around the given axis
5558 on the given angle, creating its copy before the rotatation.
5561 theObject The object to be rotated.
5562 theAxis Rotation axis.
5563 theAngle Rotation angle in radians.
5566 New GEOM.GEOM_Object, containing the rotated object.
5568 # Example: see GEOM_TestAll.py
5570 if isinstance(theAngle,str):
5572 theAngle, Parameters = ParseParameters(theAngle)
5574 theAngle = theAngle*math.pi/180.0
5575 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5576 RaiseIfFailed("RotateCopy", self.TrsfOp)
5577 anObj.SetParameters(Parameters)
5580 ## Rotate given object around vector perpendicular to plane
5581 # containing three points, creating its copy before the rotatation.
5582 # @param theObject The object to be rotated.
5583 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5584 # containing the three points.
5585 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5586 # @return New GEOM.GEOM_Object, containing the rotated object.
5588 # @ref tui_rotation "Example"
5589 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5591 Rotate given object around vector perpendicular to plane
5592 containing three points, creating its copy before the rotatation.
5595 theObject The object to be rotated.
5596 theCentPoint central point the axis is the vector perpendicular to the plane
5597 containing the three points.
5598 thePoint1,thePoint2 in a perpendicular plane of the axis.
5601 New GEOM.GEOM_Object, containing the rotated object.
5603 # Example: see GEOM_TestAll.py
5604 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5605 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5608 ## Scale the given object by the factor, creating its copy before the scaling.
5609 # @param theObject The object to be scaled.
5610 # @param thePoint Center point for scaling.
5611 # Passing None for it means scaling relatively the origin of global CS.
5612 # @param theFactor Scaling factor value.
5613 # @return New GEOM.GEOM_Object, containing the scaled shape.
5615 # @ref tui_scale "Example"
5616 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5618 Scale the given object by the factor, creating its copy before the scaling.
5621 theObject The object to be scaled.
5622 thePoint Center point for scaling.
5623 Passing None for it means scaling relatively the origin of global CS.
5624 theFactor Scaling factor value.
5627 New GEOM.GEOM_Object, containing the scaled shape.
5629 # Example: see GEOM_TestAll.py
5630 theFactor, Parameters = ParseParameters(theFactor)
5631 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5632 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5633 anObj.SetParameters(Parameters)
5636 ## Scale the given object by different factors along coordinate axes,
5637 # creating its copy before the scaling.
5638 # @param theObject The object to be scaled.
5639 # @param thePoint Center point for scaling.
5640 # Passing None for it means scaling relatively the origin of global CS.
5641 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5642 # @return New GEOM.GEOM_Object, containing the scaled shape.
5644 # @ref swig_scale "Example"
5645 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5647 Scale the given object by different factors along coordinate axes,
5648 creating its copy before the scaling.
5651 theObject The object to be scaled.
5652 thePoint Center point for scaling.
5653 Passing None for it means scaling relatively the origin of global CS.
5654 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5657 New GEOM.GEOM_Object, containing the scaled shape.
5659 # Example: see GEOM_TestAll.py
5660 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5661 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5662 theFactorX, theFactorY, theFactorZ)
5663 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5664 anObj.SetParameters(Parameters)
5667 ## Create an object, symmetrical
5668 # to the given one relatively the given plane.
5669 # @param theObject The object to be mirrored.
5670 # @param thePlane Plane of symmetry.
5671 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5673 # @ref tui_mirror "Example"
5674 def MakeMirrorByPlane(self,theObject, thePlane):
5676 Create an object, symmetrical to the given one relatively the given plane.
5679 theObject The object to be mirrored.
5680 thePlane Plane of symmetry.
5683 New GEOM.GEOM_Object, containing the mirrored shape.
5685 # Example: see GEOM_TestAll.py
5686 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5687 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5690 ## Create an object, symmetrical
5691 # to the given one relatively the given axis.
5692 # @param theObject The object to be mirrored.
5693 # @param theAxis Axis of symmetry.
5694 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5696 # @ref tui_mirror "Example"
5697 def MakeMirrorByAxis(self,theObject, theAxis):
5699 Create an object, symmetrical to the given one relatively the given axis.
5702 theObject The object to be mirrored.
5703 theAxis Axis of symmetry.
5706 New GEOM.GEOM_Object, containing the mirrored shape.
5708 # Example: see GEOM_TestAll.py
5709 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5710 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5713 ## Create an object, symmetrical
5714 # to the given one relatively the given point.
5715 # @param theObject The object to be mirrored.
5716 # @param thePoint Point of symmetry.
5717 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5719 # @ref tui_mirror "Example"
5720 def MakeMirrorByPoint(self,theObject, thePoint):
5722 Create an object, symmetrical
5723 to the given one relatively the given point.
5726 theObject The object to be mirrored.
5727 thePoint Point of symmetry.
5730 New GEOM.GEOM_Object, containing the mirrored shape.
5732 # Example: see GEOM_TestAll.py
5733 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5734 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5737 ## Modify the Location of the given object by LCS,
5738 # creating its copy before the setting.
5739 # @param theObject The object to be displaced.
5740 # @param theStartLCS Coordinate system to perform displacement from it.\n
5741 # If \a theStartLCS is NULL, displacement
5742 # will be performed from global CS.\n
5743 # If \a theObject itself is used as \a theStartLCS,
5744 # its location will be changed to \a theEndLCS.
5745 # @param theEndLCS Coordinate system to perform displacement to it.
5746 # @return New GEOM.GEOM_Object, containing the displaced shape.
5748 # @ref tui_modify_location "Example"
5749 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5751 Modify the Location of the given object by LCS, creating its copy before the setting.
5754 theObject The object to be displaced.
5755 theStartLCS Coordinate system to perform displacement from it.
5756 If theStartLCS is NULL, displacement
5757 will be performed from global CS.
5758 If theObject itself is used as theStartLCS,
5759 its location will be changed to theEndLCS.
5760 theEndLCS Coordinate system to perform displacement to it.
5763 New GEOM.GEOM_Object, containing the displaced shape.
5766 # create local coordinate systems
5767 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5768 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5769 # modify the location of the given object
5770 position = geompy.MakePosition(cylinder, cs1, cs2)
5772 # Example: see GEOM_TestAll.py
5773 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5774 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5777 ## Modify the Location of the given object by Path,
5778 # @param theObject The object to be displaced.
5779 # @param thePath Wire or Edge along that the object will be translated.
5780 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5781 # @param theCopy is to create a copy objects if true.
5782 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5783 # @return New GEOM.GEOM_Object, containing the displaced shape.
5785 # @ref tui_modify_location "Example"
5786 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5788 Modify the Location of the given object by Path
5791 theObject The object to be displaced.
5792 thePath Wire or Edge along that the object will be translated.
5793 theDistance progress of Path (0 = start location, 1 = end of path location).
5794 theCopy is to create a copy objects if true.
5795 theReverse 0 - for usual direction, 1 - to reverse path direction.
5798 New GEOM.GEOM_Object, containing the displaced shape.
5801 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5803 # Example: see GEOM_TestAll.py
5804 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5805 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5808 ## Create new object as offset of the given one.
5809 # @param theObject The base object for the offset.
5810 # @param theOffset Offset value.
5811 # @return New GEOM.GEOM_Object, containing the offset object.
5813 # @ref tui_offset "Example"
5814 def MakeOffset(self,theObject, theOffset):
5816 Create new object as offset of the given one.
5819 theObject The base object for the offset.
5820 theOffset Offset value.
5823 New GEOM.GEOM_Object, containing the offset object.
5826 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5827 # create a new object as offset of the given object
5828 offset = geompy.MakeOffset(box, 70.)
5830 # Example: see GEOM_TestAll.py
5831 theOffset, Parameters = ParseParameters(theOffset)
5832 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5833 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5834 anObj.SetParameters(Parameters)
5837 ## Create new object as projection of the given one on a 2D surface.
5838 # @param theSource The source object for the projection. It can be a point, edge or wire.
5839 # @param theTarget The target object. It can be planar or cylindrical face.
5840 # @return New GEOM.GEOM_Object, containing the projection.
5842 # @ref tui_projection "Example"
5843 def MakeProjection(self, theSource, theTarget):
5845 Create new object as projection of the given one on a 2D surface.
5848 theSource The source object for the projection. It can be a point, edge or wire.
5849 theTarget The target object. It can be planar or cylindrical face.
5852 New GEOM.GEOM_Object, containing the projection.
5854 # Example: see GEOM_TestAll.py
5855 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5856 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5859 # -----------------------------------------------------------------------------
5861 # -----------------------------------------------------------------------------
5863 ## Translate the given object along the given vector a given number times
5864 # @param theObject The object to be translated.
5865 # @param theVector Direction of the translation.
5866 # @param theStep Distance to translate on.
5867 # @param theNbTimes Quantity of translations to be done.
5868 # @return New GEOM.GEOM_Object, containing compound of all
5869 # the shapes, obtained after each translation.
5871 # @ref tui_multi_translation "Example"
5872 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5874 Translate the given object along the given vector a given number times
5877 theObject The object to be translated.
5878 theVector Direction of the translation.
5879 theStep Distance to translate on.
5880 theNbTimes Quantity of translations to be done.
5883 New GEOM.GEOM_Object, containing compound of all
5884 the shapes, obtained after each translation.
5887 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5889 # Example: see GEOM_TestAll.py
5890 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5891 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5892 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5893 anObj.SetParameters(Parameters)
5896 ## Conseqently apply two specified translations to theObject specified number of times.
5897 # @param theObject The object to be translated.
5898 # @param theVector1 Direction of the first translation.
5899 # @param theStep1 Step of the first translation.
5900 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5901 # @param theVector2 Direction of the second translation.
5902 # @param theStep2 Step of the second translation.
5903 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5904 # @return New GEOM.GEOM_Object, containing compound of all
5905 # the shapes, obtained after each translation.
5907 # @ref tui_multi_translation "Example"
5908 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5909 theVector2, theStep2, theNbTimes2):
5911 Conseqently apply two specified translations to theObject specified number of times.
5914 theObject The object to be translated.
5915 theVector1 Direction of the first translation.
5916 theStep1 Step of the first translation.
5917 theNbTimes1 Quantity of translations to be done along theVector1.
5918 theVector2 Direction of the second translation.
5919 theStep2 Step of the second translation.
5920 theNbTimes2 Quantity of translations to be done along theVector2.
5923 New GEOM.GEOM_Object, containing compound of all
5924 the shapes, obtained after each translation.
5927 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5929 # Example: see GEOM_TestAll.py
5930 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5931 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5932 theVector2, theStep2, theNbTimes2)
5933 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5934 anObj.SetParameters(Parameters)
5937 ## Rotate the given object around the given axis a given number times.
5938 # Rotation angle will be 2*PI/theNbTimes.
5939 # @param theObject The object to be rotated.
5940 # @param theAxis The rotation axis.
5941 # @param theNbTimes Quantity of rotations to be done.
5942 # @return New GEOM.GEOM_Object, containing compound of all the
5943 # shapes, obtained after each rotation.
5945 # @ref tui_multi_rotation "Example"
5946 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5948 Rotate the given object around the given axis a given number times.
5949 Rotation angle will be 2*PI/theNbTimes.
5952 theObject The object to be rotated.
5953 theAxis The rotation axis.
5954 theNbTimes Quantity of rotations to be done.
5957 New GEOM.GEOM_Object, containing compound of all the
5958 shapes, obtained after each rotation.
5961 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5963 # Example: see GEOM_TestAll.py
5964 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5965 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5966 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5967 anObj.SetParameters(Parameters)
5970 ## Rotate the given object around the
5971 # given axis on the given angle a given number
5972 # times and multi-translate each rotation result.
5973 # Translation direction passes through center of gravity
5974 # of rotated shape and its projection on the rotation axis.
5975 # @param theObject The object to be rotated.
5976 # @param theAxis Rotation axis.
5977 # @param theAngle Rotation angle in graduces.
5978 # @param theNbTimes1 Quantity of rotations to be done.
5979 # @param theStep Translation distance.
5980 # @param theNbTimes2 Quantity of translations to be done.
5981 # @return New GEOM.GEOM_Object, containing compound of all the
5982 # shapes, obtained after each transformation.
5984 # @ref tui_multi_rotation "Example"
5985 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5987 Rotate the given object around the
5988 given axis on the given angle a given number
5989 times and multi-translate each rotation result.
5990 Translation direction passes through center of gravity
5991 of rotated shape and its projection on the rotation axis.
5994 theObject The object to be rotated.
5995 theAxis Rotation axis.
5996 theAngle Rotation angle in graduces.
5997 theNbTimes1 Quantity of rotations to be done.
5998 theStep Translation distance.
5999 theNbTimes2 Quantity of translations to be done.
6002 New GEOM.GEOM_Object, containing compound of all the
6003 shapes, obtained after each transformation.
6006 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
6008 # Example: see GEOM_TestAll.py
6009 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
6010 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
6011 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
6012 anObj.SetParameters(Parameters)
6015 ## The same, as MultiRotate1D(), but axis is given by direction and point
6017 # @ref swig_MakeMultiRotation "Example"
6018 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
6020 The same, as geompy.MultiRotate1D, but axis is given by direction and point
6023 pz = geompy.MakeVertex(0, 0, 100)
6024 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6025 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
6027 # Example: see GEOM_TestOthers.py
6028 aVec = self.MakeLine(aPoint,aDir)
6029 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
6032 ## The same, as MultiRotate2D(), but axis is given by direction and point
6034 # @ref swig_MakeMultiRotation "Example"
6035 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
6037 The same, as MultiRotate2D(), but axis is given by direction and point
6040 pz = geompy.MakeVertex(0, 0, 100)
6041 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6042 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
6044 # Example: see GEOM_TestOthers.py
6045 aVec = self.MakeLine(aPoint,aDir)
6046 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
6049 # end of l3_transform
6052 ## @addtogroup l3_local
6055 ## Perform a fillet on all edges of the given shape.
6056 # @param theShape Shape, to perform fillet on.
6057 # @param theR Fillet radius.
6058 # @return New GEOM.GEOM_Object, containing the result shape.
6060 # @ref tui_fillet "Example 1"
6061 # \n @ref swig_MakeFilletAll "Example 2"
6062 def MakeFilletAll(self,theShape, theR):
6064 Perform a fillet on all edges of the given shape.
6067 theShape Shape, to perform fillet on.
6071 New GEOM.GEOM_Object, containing the result shape.
6074 filletall = geompy.MakeFilletAll(prism, 10.)
6076 # Example: see GEOM_TestOthers.py
6077 theR,Parameters = ParseParameters(theR)
6078 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
6079 RaiseIfFailed("MakeFilletAll", self.LocalOp)
6080 anObj.SetParameters(Parameters)
6083 ## Perform a fillet on the specified edges/faces of the given shape
6084 # @param theShape Shape, to perform fillet on.
6085 # @param theR Fillet radius.
6086 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
6087 # @param theListShapes Global indices of edges/faces to perform fillet on.
6088 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6089 # @return New GEOM.GEOM_Object, containing the result shape.
6091 # @ref tui_fillet "Example"
6092 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
6094 Perform a fillet on the specified edges/faces of the given shape
6097 theShape Shape, to perform fillet on.
6099 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
6100 theListShapes Global indices of edges/faces to perform fillet on.
6103 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6106 New GEOM.GEOM_Object, containing the result shape.
6109 # get the list of IDs (IDList) for the fillet
6110 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6112 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6113 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6114 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6115 # make a fillet on the specified edges of the given shape
6116 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
6118 # Example: see GEOM_TestAll.py
6119 theR,Parameters = ParseParameters(theR)
6121 if theShapeType == ShapeType["EDGE"]:
6122 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6123 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6125 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6126 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6127 anObj.SetParameters(Parameters)
6130 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6131 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6133 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6136 # get the list of IDs (IDList) for the fillet
6137 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6139 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6140 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6141 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6142 # make a fillet on the specified edges of the given shape
6143 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6145 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6147 if theShapeType == ShapeType["EDGE"]:
6148 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6149 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6151 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6152 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6153 anObj.SetParameters(Parameters)
6156 ## Perform a fillet on the specified edges of the given shape
6157 # @param theShape Wire Shape to perform fillet on.
6158 # @param theR Fillet radius.
6159 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6160 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6161 # \note The list of vertices could be empty,
6162 # in this case fillet will done done at all vertices in wire
6163 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6164 # by the length of the edges, nearest to the fillet vertex.
6165 # But sometimes the next edge is C1 continuous with the one, nearest to
6166 # the fillet point, and such two (or more) edges can be united to allow
6167 # bigger radius. Set this flag to TRUE to allow collinear edges union,
6168 # thus ignoring the secant vertex (vertices).
6169 # @return New GEOM.GEOM_Object, containing the result shape.
6171 # @ref tui_fillet2d "Example"
6172 def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6174 Perform a fillet on the specified edges of the given shape
6177 theShape Wire Shape to perform fillet on.
6179 theListOfVertexes Global indices of vertexes to perform fillet on.
6180 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6181 by the length of the edges, nearest to the fillet vertex.
6182 But sometimes the next edge is C1 continuous with the one, nearest to
6183 the fillet point, and such two (or more) edges can be united to allow
6184 bigger radius. Set this flag to TRUE to allow collinear edges union,
6185 thus ignoring the secant vertex (vertices).
6187 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6189 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6192 New GEOM.GEOM_Object, containing the result shape.
6196 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6197 # make fillet at given wire vertices with giver radius
6198 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6200 # Example: see GEOM_TestAll.py
6201 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6202 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6203 RaiseIfFailed("MakeFillet1D", self.LocalOp)
6204 anObj.SetParameters(Parameters)
6207 ## Perform a fillet at the specified vertices of the given face/shell.
6208 # @param theShape Face or Shell shape to perform fillet on.
6209 # @param theR Fillet radius.
6210 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6211 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6212 # @return New GEOM.GEOM_Object, containing the result shape.
6214 # @ref tui_fillet2d "Example"
6215 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6217 Perform a fillet at the specified vertices of the given face/shell.
6220 theShape Face or Shell shape to perform fillet on.
6222 theListOfVertexes Global indices of vertexes to perform fillet on.
6224 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6227 New GEOM.GEOM_Object, containing the result shape.
6230 face = geompy.MakeFaceHW(100, 100, 1)
6231 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6233 # Example: see GEOM_TestAll.py
6234 theR,Parameters = ParseParameters(theR)
6235 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6236 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6237 anObj.SetParameters(Parameters)
6240 ## Perform a symmetric chamfer on all edges of the given shape.
6241 # @param theShape Shape, to perform chamfer on.
6242 # @param theD Chamfer size along each face.
6243 # @return New GEOM.GEOM_Object, containing the result shape.
6245 # @ref tui_chamfer "Example 1"
6246 # \n @ref swig_MakeChamferAll "Example 2"
6247 def MakeChamferAll(self,theShape, theD):
6249 Perform a symmetric chamfer on all edges of the given shape.
6252 theShape Shape, to perform chamfer on.
6253 theD Chamfer size along each face.
6256 New GEOM.GEOM_Object, containing the result shape.
6259 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6261 # Example: see GEOM_TestOthers.py
6262 theD,Parameters = ParseParameters(theD)
6263 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6264 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6265 anObj.SetParameters(Parameters)
6268 ## Perform a chamfer on edges, common to the specified faces,
6269 # with distance D1 on the Face1
6270 # @param theShape Shape, to perform chamfer on.
6271 # @param theD1 Chamfer size along \a theFace1.
6272 # @param theD2 Chamfer size along \a theFace2.
6273 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6274 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6275 # @return New GEOM.GEOM_Object, containing the result shape.
6277 # @ref tui_chamfer "Example"
6278 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6280 Perform a chamfer on edges, common to the specified faces,
6281 with distance D1 on the Face1
6284 theShape Shape, to perform chamfer on.
6285 theD1 Chamfer size along theFace1.
6286 theD2 Chamfer size along theFace2.
6287 theFace1,theFace2 Global indices of two faces of theShape.
6290 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6293 New GEOM.GEOM_Object, containing the result shape.
6296 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6297 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6298 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6299 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6301 # Example: see GEOM_TestAll.py
6302 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6303 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6304 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6305 anObj.SetParameters(Parameters)
6308 ## Perform a chamfer on edges
6309 # @param theShape Shape, to perform chamfer on.
6310 # @param theD Chamfer length
6311 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6312 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6313 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6314 # @return New GEOM.GEOM_Object, containing the result shape.
6315 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6317 Perform a chamfer on edges
6320 theShape Shape, to perform chamfer on.
6321 theD1 Chamfer size along theFace1.
6322 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6323 theFace1,theFace2 Global indices of two faces of theShape.
6326 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6329 New GEOM.GEOM_Object, containing the result shape.
6332 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6333 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6334 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6336 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6339 if isinstance(theAngle,str):
6341 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6343 theAngle = theAngle*math.pi/180.0
6344 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6345 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6346 anObj.SetParameters(Parameters)
6349 ## Perform a chamfer on all edges of the specified faces,
6350 # with distance D1 on the first specified face (if several for one edge)
6351 # @param theShape Shape, to perform chamfer on.
6352 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6353 # connected to the edge, are in \a theFaces, \a theD1
6354 # will be get along face, which is nearer to \a theFaces beginning.
6355 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6356 # @param theFaces Sequence of global indices of faces of \a theShape.
6357 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6358 # @return New GEOM.GEOM_Object, containing the result shape.
6360 # @ref tui_chamfer "Example"
6361 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6363 Perform a chamfer on all edges of the specified faces,
6364 with distance D1 on the first specified face (if several for one edge)
6367 theShape Shape, to perform chamfer on.
6368 theD1 Chamfer size along face from theFaces. If both faces,
6369 connected to the edge, are in theFaces, theD1
6370 will be get along face, which is nearer to theFaces beginning.
6371 theD2 Chamfer size along another of two faces, connected to the edge.
6372 theFaces Sequence of global indices of faces of theShape.
6375 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6378 New GEOM.GEOM_Object, containing the result shape.
6380 # Example: see GEOM_TestAll.py
6381 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6382 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6383 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6384 anObj.SetParameters(Parameters)
6387 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6388 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6390 # @ref swig_FilletChamfer "Example"
6391 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6393 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6394 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6397 if isinstance(theAngle,str):
6399 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6401 theAngle = theAngle*math.pi/180.0
6402 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6403 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6404 anObj.SetParameters(Parameters)
6407 ## Perform a chamfer on edges,
6408 # with distance D1 on the first specified face (if several for one edge)
6409 # @param theShape Shape, to perform chamfer on.
6410 # @param theD1,theD2 Chamfer size
6411 # @param theEdges Sequence of edges of \a theShape.
6412 # @return New GEOM.GEOM_Object, containing the result shape.
6414 # @ref swig_FilletChamfer "Example"
6415 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6417 Perform a chamfer on edges,
6418 with distance D1 on the first specified face (if several for one edge)
6421 theShape Shape, to perform chamfer on.
6422 theD1,theD2 Chamfer size
6423 theEdges Sequence of edges of theShape.
6426 New GEOM.GEOM_Object, containing the result shape.
6428 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6429 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6430 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6431 anObj.SetParameters(Parameters)
6434 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6435 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6436 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6438 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6439 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6442 if isinstance(theAngle,str):
6444 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6446 theAngle = theAngle*math.pi/180.0
6447 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6448 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6449 anObj.SetParameters(Parameters)
6452 ## /sa MakeChamferEdge() and MakeChamferFaces()
6454 # @ref swig_MakeChamfer "Example"
6455 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6457 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6459 # Example: see GEOM_TestOthers.py
6461 if aShapeType == ShapeType["EDGE"]:
6462 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6464 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6467 ## Remove material from a solid by extrusion of the base shape on the given distance.
6468 # @param theInit Shape to remove material from. It must be a solid or
6469 # a compound made of a single solid.
6470 # @param theBase Closed edge or wire defining the base shape to be extruded.
6471 # @param theH Prism dimension along the normal to theBase
6472 # @param theAngle Draft angle in degrees.
6473 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6475 # @ref tui_creation_prism "Example"
6476 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6478 Add material to a solid by extrusion of the base shape on the given distance.
6481 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6482 theBase Closed edge or wire defining the base shape to be extruded.
6483 theH Prism dimension along the normal to theBase
6484 theAngle Draft angle in degrees.
6487 New GEOM.GEOM_Object, containing the initial shape with removed material.
6489 # Example: see GEOM_TestAll.py
6490 #theH,Parameters = ParseParameters(theH)
6491 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6492 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6493 #anObj.SetParameters(Parameters)
6496 ## Add material to a solid by extrusion of the base shape on the given distance.
6497 # @param theInit Shape to add material to. It must be a solid or
6498 # a compound made of a single solid.
6499 # @param theBase Closed edge or wire defining the base shape to be extruded.
6500 # @param theH Prism dimension along the normal to theBase
6501 # @param theAngle Draft angle in degrees.
6502 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6504 # @ref tui_creation_prism "Example"
6505 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6507 Add material to a solid by extrusion of the base shape on the given distance.
6510 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6511 theBase Closed edge or wire defining the base shape to be extruded.
6512 theH Prism dimension along the normal to theBase
6513 theAngle Draft angle in degrees.
6516 New GEOM.GEOM_Object, containing the initial shape with added material.
6518 # Example: see GEOM_TestAll.py
6519 #theH,Parameters = ParseParameters(theH)
6520 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6521 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6522 #anObj.SetParameters(Parameters)
6528 ## @addtogroup l3_basic_op
6531 ## Perform an Archimde operation on the given shape with given parameters.
6532 # The object presenting the resulting face is returned.
6533 # @param theShape Shape to be put in water.
6534 # @param theWeight Weight og the shape.
6535 # @param theWaterDensity Density of the water.
6536 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6537 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6538 # by a plane, corresponding to water level.
6540 # @ref tui_archimede "Example"
6541 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6543 Perform an Archimde operation on the given shape with given parameters.
6544 The object presenting the resulting face is returned.
6547 theShape Shape to be put in water.
6548 theWeight Weight og the shape.
6549 theWaterDensity Density of the water.
6550 theMeshDeflection Deflection of the mesh, using to compute the section.
6553 New GEOM.GEOM_Object, containing a section of theShape
6554 by a plane, corresponding to water level.
6556 # Example: see GEOM_TestAll.py
6557 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6558 theWeight,theWaterDensity,theMeshDeflection)
6559 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6560 RaiseIfFailed("MakeArchimede", self.LocalOp)
6561 anObj.SetParameters(Parameters)
6564 # end of l3_basic_op
6567 ## @addtogroup l2_measure
6570 ## Get point coordinates
6573 # @ref tui_measurement_tools_page "Example"
6574 def PointCoordinates(self,Point):
6576 Get point coordinates
6581 # Example: see GEOM_TestMeasures.py
6582 aTuple = self.MeasuOp.PointCoordinates(Point)
6583 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6586 ## Get summarized length of all wires,
6587 # area of surface and volume of the given shape.
6588 # @param theShape Shape to define properties of.
6589 # @return [theLength, theSurfArea, theVolume]\n
6590 # theLength: Summarized length of all wires of the given shape.\n
6591 # theSurfArea: Area of surface of the given shape.\n
6592 # theVolume: Volume of the given shape.
6594 # @ref tui_measurement_tools_page "Example"
6595 def BasicProperties(self,theShape):
6597 Get summarized length of all wires,
6598 area of surface and volume of the given shape.
6601 theShape Shape to define properties of.
6604 [theLength, theSurfArea, theVolume]
6605 theLength: Summarized length of all wires of the given shape.
6606 theSurfArea: Area of surface of the given shape.
6607 theVolume: Volume of the given shape.
6609 # Example: see GEOM_TestMeasures.py
6610 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6611 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6614 ## Get parameters of bounding box of the given shape
6615 # @param theShape Shape to obtain bounding box of.
6616 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6617 # Xmin,Xmax: Limits of shape along OX axis.
6618 # Ymin,Ymax: Limits of shape along OY axis.
6619 # Zmin,Zmax: Limits of shape along OZ axis.
6621 # @ref tui_measurement_tools_page "Example"
6622 def BoundingBox(self,theShape):
6624 Get parameters of bounding box of the given shape
6627 theShape Shape to obtain bounding box of.
6630 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6631 Xmin,Xmax: Limits of shape along OX axis.
6632 Ymin,Ymax: Limits of shape along OY axis.
6633 Zmin,Zmax: Limits of shape along OZ axis.
6635 # Example: see GEOM_TestMeasures.py
6636 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6637 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6640 ## Get inertia matrix and moments of inertia of theShape.
6641 # @param theShape Shape to calculate inertia of.
6642 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6643 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6644 # Ix,Iy,Iz: Moments of inertia of the given shape.
6646 # @ref tui_measurement_tools_page "Example"
6647 def Inertia(self,theShape):
6649 Get inertia matrix and moments of inertia of theShape.
6652 theShape Shape to calculate inertia of.
6655 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6656 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6657 Ix,Iy,Iz: Moments of inertia of the given shape.
6659 # Example: see GEOM_TestMeasures.py
6660 aTuple = self.MeasuOp.GetInertia(theShape)
6661 RaiseIfFailed("GetInertia", self.MeasuOp)
6664 ## Get if coords are included in the shape (ST_IN or ST_ON)
6665 # @param theShape Shape
6666 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6667 # @param tolerance to be used (default is 1.0e-7)
6668 # @return list_of_boolean = [res1, res2, ...]
6669 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6671 Get if coords are included in the shape (ST_IN or ST_ON)
6675 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6676 tolerance to be used (default is 1.0e-7)
6679 list_of_boolean = [res1, res2, ...]
6681 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6683 ## Get minimal distance between the given shapes.
6684 # @param theShape1,theShape2 Shapes to find minimal distance between.
6685 # @return Value of the minimal distance between the given shapes.
6687 # @ref tui_measurement_tools_page "Example"
6688 def MinDistance(self, theShape1, theShape2):
6690 Get minimal distance between the given shapes.
6693 theShape1,theShape2 Shapes to find minimal distance between.
6696 Value of the minimal distance between the given shapes.
6698 # Example: see GEOM_TestMeasures.py
6699 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6700 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6703 ## Get minimal distance between the given shapes.
6704 # @param theShape1,theShape2 Shapes to find minimal distance between.
6705 # @return Value of the minimal distance between the given shapes.
6707 # @ref swig_all_measure "Example"
6708 def MinDistanceComponents(self, theShape1, theShape2):
6710 Get minimal distance between the given shapes.
6713 theShape1,theShape2 Shapes to find minimal distance between.
6716 Value of the minimal distance between the given shapes.
6718 # Example: see GEOM_TestMeasures.py
6719 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6720 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6721 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6724 ## Get angle between the given shapes in degrees.
6725 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6726 # @note If both arguments are vectors, the angle is computed in accordance
6727 # with their orientations, otherwise the minimum angle is computed.
6728 # @return Value of the angle between the given shapes in degrees.
6730 # @ref tui_measurement_tools_page "Example"
6731 def GetAngle(self, theShape1, theShape2):
6733 Get angle between the given shapes in degrees.
6736 theShape1,theShape2 Lines or linear edges to find angle between.
6739 If both arguments are vectors, the angle is computed in accordance
6740 with their orientations, otherwise the minimum angle is computed.
6743 Value of the angle between the given shapes in degrees.
6745 # Example: see GEOM_TestMeasures.py
6746 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6747 RaiseIfFailed("GetAngle", self.MeasuOp)
6750 ## Get angle between the given shapes in radians.
6751 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6752 # @note If both arguments are vectors, the angle is computed in accordance
6753 # with their orientations, otherwise the minimum angle is computed.
6754 # @return Value of the angle between the given shapes in radians.
6756 # @ref tui_measurement_tools_page "Example"
6757 def GetAngleRadians(self, theShape1, theShape2):
6759 Get angle between the given shapes in radians.
6762 theShape1,theShape2 Lines or linear edges to find angle between.
6766 If both arguments are vectors, the angle is computed in accordance
6767 with their orientations, otherwise the minimum angle is computed.
6770 Value of the angle between the given shapes in radians.
6772 # Example: see GEOM_TestMeasures.py
6773 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6774 RaiseIfFailed("GetAngle", self.MeasuOp)
6777 ## Get angle between the given vectors in degrees.
6778 # @param theShape1,theShape2 Vectors to find angle between.
6779 # @param theFlag If True, the normal vector is defined by the two vectors cross,
6780 # if False, the opposite vector to the normal vector is used.
6781 # @return Value of the angle between the given vectors in degrees.
6783 # @ref tui_measurement_tools_page "Example"
6784 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6786 Get angle between the given vectors in degrees.
6789 theShape1,theShape2 Vectors to find angle between.
6790 theFlag If True, the normal vector is defined by the two vectors cross,
6791 if False, the opposite vector to the normal vector is used.
6794 Value of the angle between the given vectors in degrees.
6796 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6798 anAngle = 360. - anAngle
6799 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6802 ## The same as GetAngleVectors, but the result is in radians.
6803 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6805 Get angle between the given vectors in radians.
6808 theShape1,theShape2 Vectors to find angle between.
6809 theFlag If True, the normal vector is defined by the two vectors cross,
6810 if False, the opposite vector to the normal vector is used.
6813 Value of the angle between the given vectors in radians.
6815 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6818 ## @name Curve Curvature Measurement
6819 # Methods for receiving radius of curvature of curves
6820 # in the given point
6823 ## Measure curvature of a curve at a point, set by parameter.
6824 # @param theCurve a curve.
6825 # @param theParam parameter.
6826 # @return radius of curvature of \a theCurve.
6828 # @ref swig_todo "Example"
6829 def CurveCurvatureByParam(self, theCurve, theParam):
6831 Measure curvature of a curve at a point, set by parameter.
6838 radius of curvature of theCurve.
6840 # Example: see GEOM_TestMeasures.py
6841 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6842 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6845 ## Measure curvature of a curve at a point.
6846 # @param theCurve a curve.
6847 # @param thePoint given point.
6848 # @return radius of curvature of \a theCurve.
6850 # @ref swig_todo "Example"
6851 def CurveCurvatureByPoint(self, theCurve, thePoint):
6853 Measure curvature of a curve at a point.
6857 thePoint given point.
6860 radius of curvature of theCurve.
6862 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6863 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6867 ## @name Surface Curvature Measurement
6868 # Methods for receiving max and min radius of curvature of surfaces
6869 # in the given point
6872 ## Measure max radius of curvature of surface.
6873 # @param theSurf the given surface.
6874 # @param theUParam Value of U-parameter on the referenced surface.
6875 # @param theVParam Value of V-parameter on the referenced surface.
6876 # @return max radius of curvature of theSurf.
6878 ## @ref swig_todo "Example"
6879 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6881 Measure max radius of curvature of surface.
6884 theSurf the given surface.
6885 theUParam Value of U-parameter on the referenced surface.
6886 theVParam Value of V-parameter on the referenced surface.
6889 max radius of curvature of theSurf.
6891 # Example: see GEOM_TestMeasures.py
6892 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6893 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6896 ## Measure max radius of curvature of surface in the given point
6897 # @param theSurf the given surface.
6898 # @param thePoint given point.
6899 # @return max radius of curvature of theSurf.
6901 ## @ref swig_todo "Example"
6902 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6904 Measure max radius of curvature of surface in the given point.
6907 theSurf the given surface.
6908 thePoint given point.
6911 max radius of curvature of theSurf.
6913 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6914 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6917 ## Measure min radius of curvature of surface.
6918 # @param theSurf the given surface.
6919 # @param theUParam Value of U-parameter on the referenced surface.
6920 # @param theVParam Value of V-parameter on the referenced surface.
6921 # @return min radius of curvature of theSurf.
6923 ## @ref swig_todo "Example"
6924 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6926 Measure min radius of curvature of surface.
6929 theSurf the given surface.
6930 theUParam Value of U-parameter on the referenced surface.
6931 theVParam Value of V-parameter on the referenced surface.
6934 Min radius of curvature of theSurf.
6936 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6937 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6940 ## Measure min radius of curvature of surface in the given point
6941 # @param theSurf the given surface.
6942 # @param thePoint given point.
6943 # @return min radius of curvature of theSurf.
6945 ## @ref swig_todo "Example"
6946 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6948 Measure min radius of curvature of surface in the given point.
6951 theSurf the given surface.
6952 thePoint given point.
6955 Min radius of curvature of theSurf.
6957 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6958 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6962 ## Get min and max tolerances of sub-shapes of theShape
6963 # @param theShape Shape, to get tolerances of.
6964 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6965 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
6966 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6967 # VertMin,VertMax: Min and max tolerances of the vertices.
6969 # @ref tui_measurement_tools_page "Example"
6970 def Tolerance(self,theShape):
6972 Get min and max tolerances of sub-shapes of theShape
6975 theShape Shape, to get tolerances of.
6978 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6979 FaceMin,FaceMax: Min and max tolerances of the faces.
6980 EdgeMin,EdgeMax: Min and max tolerances of the edges.
6981 VertMin,VertMax: Min and max tolerances of the vertices.
6983 # Example: see GEOM_TestMeasures.py
6984 aTuple = self.MeasuOp.GetTolerance(theShape)
6985 RaiseIfFailed("GetTolerance", self.MeasuOp)
6988 ## Obtain description of the given shape (number of sub-shapes of each type)
6989 # @param theShape Shape to be described.
6990 # @return Description of the given shape.
6992 # @ref tui_measurement_tools_page "Example"
6993 def WhatIs(self,theShape):
6995 Obtain description of the given shape (number of sub-shapes of each type)
6998 theShape Shape to be described.
7001 Description of the given shape.
7003 # Example: see GEOM_TestMeasures.py
7004 aDescr = self.MeasuOp.WhatIs(theShape)
7005 RaiseIfFailed("WhatIs", self.MeasuOp)
7008 ## Obtain quantity of shapes of the given type in \a theShape.
7009 # If \a theShape is of type \a theType, it is also counted.
7010 # @param theShape Shape to be described.
7011 # @param theType the given ShapeType().
7012 # @return Quantity of shapes of type \a theType in \a theShape.
7014 # @ref tui_measurement_tools_page "Example"
7015 def NbShapes (self, theShape, theType):
7017 Obtain quantity of shapes of the given type in theShape.
7018 If theShape is of type theType, it is also counted.
7021 theShape Shape to be described.
7022 theType the given geompy.ShapeType
7025 Quantity of shapes of type theType in theShape.
7027 # Example: see GEOM_TestMeasures.py
7028 listSh = self.SubShapeAllIDs(theShape, theType)
7030 t = EnumToLong(theShape.GetShapeType())
7031 theType = EnumToLong(theType)
7037 ## Obtain quantity of shapes of each type in \a theShape.
7038 # The \a theShape is also counted.
7039 # @param theShape Shape to be described.
7040 # @return Dictionary of ShapeType() with bound quantities of shapes.
7042 # @ref tui_measurement_tools_page "Example"
7043 def ShapeInfo (self, theShape):
7045 Obtain quantity of shapes of each type in theShape.
7046 The theShape is also counted.
7049 theShape Shape to be described.
7052 Dictionary of geompy.ShapeType with bound quantities of shapes.
7054 # Example: see GEOM_TestMeasures.py
7056 for typeSh in ShapeType:
7057 if typeSh in ( "AUTO", "SHAPE" ): continue
7058 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
7060 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
7067 ## Get a point, situated at the centre of mass of theShape.
7068 # @param theShape Shape to define centre of mass of.
7069 # @return New GEOM.GEOM_Object, containing the created point.
7071 # @ref tui_measurement_tools_page "Example"
7072 def MakeCDG(self,theShape):
7074 Get a point, situated at the centre of mass of theShape.
7077 theShape Shape to define centre of mass of.
7080 New GEOM.GEOM_Object, containing the created point.
7082 # Example: see GEOM_TestMeasures.py
7083 anObj = self.MeasuOp.GetCentreOfMass(theShape)
7084 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
7087 ## Get a vertex sub-shape by index depended with orientation.
7088 # @param theShape Shape to find sub-shape.
7089 # @param theIndex Index to find vertex by this index (starting from zero)
7090 # @return New GEOM.GEOM_Object, containing the created vertex.
7092 # @ref tui_measurement_tools_page "Example"
7093 def GetVertexByIndex(self,theShape, theIndex):
7095 Get a vertex sub-shape by index depended with orientation.
7098 theShape Shape to find sub-shape.
7099 theIndex Index to find vertex by this index (starting from zero)
7102 New GEOM.GEOM_Object, containing the created vertex.
7104 # Example: see GEOM_TestMeasures.py
7105 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
7106 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
7109 ## Get the first vertex of wire/edge depended orientation.
7110 # @param theShape Shape to find first vertex.
7111 # @return New GEOM.GEOM_Object, containing the created vertex.
7113 # @ref tui_measurement_tools_page "Example"
7114 def GetFirstVertex(self,theShape):
7116 Get the first vertex of wire/edge depended orientation.
7119 theShape Shape to find first vertex.
7122 New GEOM.GEOM_Object, containing the created vertex.
7124 # Example: see GEOM_TestMeasures.py
7125 anObj = self.GetVertexByIndex(theShape, 0)
7126 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7129 ## Get the last vertex of wire/edge depended orientation.
7130 # @param theShape Shape to find last vertex.
7131 # @return New GEOM.GEOM_Object, containing the created vertex.
7133 # @ref tui_measurement_tools_page "Example"
7134 def GetLastVertex(self,theShape):
7136 Get the last vertex of wire/edge depended orientation.
7139 theShape Shape to find last vertex.
7142 New GEOM.GEOM_Object, containing the created vertex.
7144 # Example: see GEOM_TestMeasures.py
7145 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7146 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7147 RaiseIfFailed("GetLastVertex", self.MeasuOp)
7150 ## Get a normale to the given face. If the point is not given,
7151 # the normale is calculated at the center of mass.
7152 # @param theFace Face to define normale of.
7153 # @param theOptionalPoint Point to compute the normale at.
7154 # @return New GEOM.GEOM_Object, containing the created vector.
7156 # @ref swig_todo "Example"
7157 def GetNormal(self, theFace, theOptionalPoint = None):
7159 Get a normale to the given face. If the point is not given,
7160 the normale is calculated at the center of mass.
7163 theFace Face to define normale of.
7164 theOptionalPoint Point to compute the normale at.
7167 New GEOM.GEOM_Object, containing the created vector.
7169 # Example: see GEOM_TestMeasures.py
7170 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7171 RaiseIfFailed("GetNormal", self.MeasuOp)
7174 ## Check a topology of the given shape.
7175 # @param theShape Shape to check validity of.
7176 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7177 # if TRUE, the shape's geometry will be checked also.
7178 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7179 # of problem is printed.
7180 # if TRUE and if theShape is invalid, the description
7181 # of problem is also returned.
7182 # @return TRUE, if the shape "seems to be valid".
7184 # @ref tui_measurement_tools_page "Example"
7185 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7187 Check a topology of the given shape.
7190 theShape Shape to check validity of.
7191 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7192 if TRUE, the shape's geometry will be checked also.
7193 theReturnStatus If FALSE and if theShape is invalid, a description
7194 of problem is printed.
7195 if TRUE and if theShape is invalid, the description
7196 of problem is returned.
7199 TRUE, if the shape "seems to be valid".
7200 If theShape is invalid, prints a description of problem.
7201 This description can also be returned.
7203 # Example: see GEOM_TestMeasures.py
7205 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7206 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7208 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7209 RaiseIfFailed("CheckShape", self.MeasuOp)
7211 if theReturnStatus == 0:
7213 if theReturnStatus == 1:
7214 return (IsValid, Status)
7217 ## Detect self-intersections in the given shape.
7218 # @param theShape Shape to check.
7219 # @return TRUE, if the shape contains no self-intersections.
7221 # @ref tui_measurement_tools_page "Example"
7222 def CheckSelfIntersections(self, theShape):
7224 Detect self-intersections in the given shape.
7227 theShape Shape to check.
7230 TRUE, if the shape contains no self-intersections.
7232 # Example: see GEOM_TestMeasures.py
7233 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7234 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7237 ## Get position (LCS) of theShape.
7239 # Origin of the LCS is situated at the shape's center of mass.
7240 # Axes of the LCS are obtained from shape's location or,
7241 # if the shape is a planar face, from position of its plane.
7243 # @param theShape Shape to calculate position of.
7244 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7245 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
7246 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7247 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7249 # @ref swig_todo "Example"
7250 def GetPosition(self,theShape):
7252 Get position (LCS) of theShape.
7253 Origin of the LCS is situated at the shape's center of mass.
7254 Axes of the LCS are obtained from shape's location or,
7255 if the shape is a planar face, from position of its plane.
7258 theShape Shape to calculate position of.
7261 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7262 Ox,Oy,Oz: Coordinates of shape's LCS origin.
7263 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7264 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7266 # Example: see GEOM_TestMeasures.py
7267 aTuple = self.MeasuOp.GetPosition(theShape)
7268 RaiseIfFailed("GetPosition", self.MeasuOp)
7271 ## Get kind of theShape.
7273 # @param theShape Shape to get a kind of.
7274 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7275 # and a list of parameters, describing the shape.
7276 # @note Concrete meaning of each value, returned via \a theIntegers
7277 # or \a theDoubles list depends on the kind() of the shape.
7279 # @ref swig_todo "Example"
7280 def KindOfShape(self,theShape):
7282 Get kind of theShape.
7285 theShape Shape to get a kind of.
7288 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7289 and a list of parameters, describing the shape.
7291 Concrete meaning of each value, returned via theIntegers
7292 or theDoubles list depends on the geompy.kind of the shape
7294 # Example: see GEOM_TestMeasures.py
7295 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7296 RaiseIfFailed("KindOfShape", self.MeasuOp)
7298 aKind = aRoughTuple[0]
7299 anInts = aRoughTuple[1]
7300 aDbls = aRoughTuple[2]
7302 # Now there is no exception from this rule:
7303 aKindTuple = [aKind] + aDbls + anInts
7305 # If they are we will regroup parameters for such kind of shape.
7307 #if aKind == kind.SOME_KIND:
7308 # # SOME_KIND int int double int double double
7309 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7316 ## @addtogroup l2_import_export
7319 ## Import a shape from the BREP or IGES or STEP file
7320 # (depends on given format) with given name.
7321 # @param theFileName The file, containing the shape.
7322 # @param theFormatName Specify format for the file reading.
7323 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7324 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7325 # set to 'meter' and result model will be scaled.
7326 # @return New GEOM.GEOM_Object, containing the imported shape.
7328 # @ref swig_Import_Export "Example"
7329 def ImportFile(self,theFileName, theFormatName):
7331 Import a shape from the BREP or IGES or STEP file
7332 (depends on given format) with given name.
7335 theFileName The file, containing the shape.
7336 theFormatName Specify format for the file reading.
7337 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7338 If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7339 set to 'meter' and result model will be scaled.
7342 New GEOM.GEOM_Object, containing the imported shape.
7344 # Example: see GEOM_TestOthers.py
7345 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7346 RaiseIfFailed("Import", self.InsertOp)
7349 ## Deprecated analog of ImportFile()
7350 def Import(self,theFileName, theFormatName):
7352 Deprecated analog of geompy.ImportFile
7354 print "WARNING: Function Import is deprecated, use ImportFile instead"
7355 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7356 RaiseIfFailed("Import", self.InsertOp)
7359 ## Shortcut to ImportFile() for BREP format
7361 # @ref swig_Import_Export "Example"
7362 def ImportBREP(self,theFileName):
7364 geompy.ImportFile(...) function for BREP format
7366 # Example: see GEOM_TestOthers.py
7367 return self.ImportFile(theFileName, "BREP")
7369 ## Shortcut to ImportFile() for IGES format
7371 # @ref swig_Import_Export "Example"
7372 def ImportIGES(self,theFileName):
7374 geompy.ImportFile(...) function for IGES format
7376 # Example: see GEOM_TestOthers.py
7377 return self.ImportFile(theFileName, "IGES")
7379 ## Return length unit from given IGES file
7381 # @ref swig_Import_Export "Example"
7382 def GetIGESUnit(self,theFileName):
7384 Return length unit from given IGES file
7386 # Example: see GEOM_TestOthers.py
7387 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
7388 #RaiseIfFailed("Import", self.InsertOp)
7389 # recieve name using returned vertex
7391 if anObj.GetShapeType() == GEOM.VERTEX:
7394 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
7396 p = self.PointCoordinates(vertices[0])
7397 if abs(p[0]-0.01) < 1.e-6:
7399 elif abs(p[0]-0.001) < 1.e-6:
7403 ## Shortcut to ImportFile() for STEP format
7405 # @ref swig_Import_Export "Example"
7406 def ImportSTEP(self,theFileName):
7408 geompy.ImportFile(...) function for STEP format
7410 # Example: see GEOM_TestOthers.py
7411 return self.ImportFile(theFileName, "STEP")
7413 ## Read a shape from the binary stream, containing its bounding representation (BRep).
7414 # @note This method will not be dumped to the python script by DumpStudy functionality.
7415 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
7416 # @param theStream The BRep binary stream.
7417 # @return New GEOM_Object, containing the shape, read from theStream.
7419 # @ref swig_Import_Export "Example"
7420 def RestoreShape (self, theStream):
7422 Read a shape from the binary stream, containing its bounding representation (BRep).
7425 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
7428 theStream The BRep binary stream.
7431 New GEOM_Object, containing the shape, read from theStream.
7433 # Example: see GEOM_TestOthers.py
7434 anObj = self.InsertOp.RestoreShape(theStream)
7435 RaiseIfFailed("RestoreShape", self.InsertOp)
7438 ## Export the given shape into a file with given name.
7439 # @param theObject Shape to be stored in the file.
7440 # @param theFileName Name of the file to store the given shape in.
7441 # @param theFormatName Specify format for the shape storage.
7442 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7444 # @ref swig_Import_Export "Example"
7445 def Export(self,theObject, theFileName, theFormatName):
7447 Export the given shape into a file with given name.
7450 theObject Shape to be stored in the file.
7451 theFileName Name of the file to store the given shape in.
7452 theFormatName Specify format for the shape storage.
7453 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7455 # Example: see GEOM_TestOthers.py
7456 self.InsertOp.Export(theObject, theFileName, theFormatName)
7457 if self.InsertOp.IsDone() == 0:
7458 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7462 ## Shortcut to Export() for BREP format
7464 # @ref swig_Import_Export "Example"
7465 def ExportBREP(self,theObject, theFileName):
7467 geompy.Export(...) function for BREP format
7469 # Example: see GEOM_TestOthers.py
7470 return self.Export(theObject, theFileName, "BREP")
7472 ## Shortcut to Export() for IGES format
7474 # @ref swig_Import_Export "Example"
7475 def ExportIGES(self,theObject, theFileName):
7477 geompy.Export(...) function for IGES format
7479 # Example: see GEOM_TestOthers.py
7480 return self.Export(theObject, theFileName, "IGES")
7482 ## Shortcut to Export() for STEP format
7484 # @ref swig_Import_Export "Example"
7485 def ExportSTEP(self,theObject, theFileName):
7487 geompy.Export(...) function for STEP format
7489 # Example: see GEOM_TestOthers.py
7490 return self.Export(theObject, theFileName, "STEP")
7492 # end of l2_import_export
7495 ## @addtogroup l3_blocks
7498 ## Create a quadrangle face from four edges. Order of Edges is not
7499 # important. It is not necessary that edges share the same vertex.
7500 # @param E1,E2,E3,E4 Edges for the face bound.
7501 # @return New GEOM.GEOM_Object, containing the created face.
7503 # @ref tui_building_by_blocks_page "Example"
7504 def MakeQuad(self,E1, E2, E3, E4):
7506 Create a quadrangle face from four edges. Order of Edges is not
7507 important. It is not necessary that edges share the same vertex.
7510 E1,E2,E3,E4 Edges for the face bound.
7513 New GEOM.GEOM_Object, containing the created face.
7516 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7518 # Example: see GEOM_Spanner.py
7519 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7520 RaiseIfFailed("MakeQuad", self.BlocksOp)
7523 ## Create a quadrangle face on two edges.
7524 # The missing edges will be built by creating the shortest ones.
7525 # @param E1,E2 Two opposite edges for the face.
7526 # @return New GEOM.GEOM_Object, containing the created face.
7528 # @ref tui_building_by_blocks_page "Example"
7529 def MakeQuad2Edges(self,E1, E2):
7531 Create a quadrangle face on two edges.
7532 The missing edges will be built by creating the shortest ones.
7535 E1,E2 Two opposite edges for the face.
7538 New GEOM.GEOM_Object, containing the created face.
7542 p1 = geompy.MakeVertex( 0., 0., 0.)
7543 p2 = geompy.MakeVertex(150., 30., 0.)
7544 p3 = geompy.MakeVertex( 0., 120., 50.)
7545 p4 = geompy.MakeVertex( 0., 40., 70.)
7547 edge1 = geompy.MakeEdge(p1, p2)
7548 edge2 = geompy.MakeEdge(p3, p4)
7549 # create a quadrangle face from two edges
7550 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7552 # Example: see GEOM_Spanner.py
7553 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7554 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7557 ## Create a quadrangle face with specified corners.
7558 # The missing edges will be built by creating the shortest ones.
7559 # @param V1,V2,V3,V4 Corner vertices for the face.
7560 # @return New GEOM.GEOM_Object, containing the created face.
7562 # @ref tui_building_by_blocks_page "Example 1"
7563 # \n @ref swig_MakeQuad4Vertices "Example 2"
7564 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7566 Create a quadrangle face with specified corners.
7567 The missing edges will be built by creating the shortest ones.
7570 V1,V2,V3,V4 Corner vertices for the face.
7573 New GEOM.GEOM_Object, containing the created face.
7577 p1 = geompy.MakeVertex( 0., 0., 0.)
7578 p2 = geompy.MakeVertex(150., 30., 0.)
7579 p3 = geompy.MakeVertex( 0., 120., 50.)
7580 p4 = geompy.MakeVertex( 0., 40., 70.)
7581 # create a quadrangle from four points in its corners
7582 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7584 # Example: see GEOM_Spanner.py
7585 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7586 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7589 ## Create a hexahedral solid, bounded by the six given faces. Order of
7590 # faces is not important. It is not necessary that Faces share the same edge.
7591 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7592 # @return New GEOM.GEOM_Object, containing the created solid.
7594 # @ref tui_building_by_blocks_page "Example 1"
7595 # \n @ref swig_MakeHexa "Example 2"
7596 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7598 Create a hexahedral solid, bounded by the six given faces. Order of
7599 faces is not important. It is not necessary that Faces share the same edge.
7602 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7605 New GEOM.GEOM_Object, containing the created solid.
7608 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7610 # Example: see GEOM_Spanner.py
7611 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7612 RaiseIfFailed("MakeHexa", self.BlocksOp)
7615 ## Create a hexahedral solid between two given faces.
7616 # The missing faces will be built by creating the smallest ones.
7617 # @param F1,F2 Two opposite faces for the hexahedral solid.
7618 # @return New GEOM.GEOM_Object, containing the created solid.
7620 # @ref tui_building_by_blocks_page "Example 1"
7621 # \n @ref swig_MakeHexa2Faces "Example 2"
7622 def MakeHexa2Faces(self,F1, F2):
7624 Create a hexahedral solid between two given faces.
7625 The missing faces will be built by creating the smallest ones.
7628 F1,F2 Two opposite faces for the hexahedral solid.
7631 New GEOM.GEOM_Object, containing the created solid.
7634 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7636 # Example: see GEOM_Spanner.py
7637 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7638 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7644 ## @addtogroup l3_blocks_op
7647 ## Get a vertex, found in the given shape by its coordinates.
7648 # @param theShape Block or a compound of blocks.
7649 # @param theX,theY,theZ Coordinates of the sought vertex.
7650 # @param theEpsilon Maximum allowed distance between the resulting
7651 # vertex and point with the given coordinates.
7652 # @return New GEOM.GEOM_Object, containing the found vertex.
7654 # @ref swig_GetPoint "Example"
7655 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7657 Get a vertex, found in the given shape by its coordinates.
7660 theShape Block or a compound of blocks.
7661 theX,theY,theZ Coordinates of the sought vertex.
7662 theEpsilon Maximum allowed distance between the resulting
7663 vertex and point with the given coordinates.
7666 New GEOM.GEOM_Object, containing the found vertex.
7669 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7671 # Example: see GEOM_TestOthers.py
7672 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7673 RaiseIfFailed("GetPoint", self.BlocksOp)
7676 ## Find a vertex of the given shape, which has minimal distance to the given point.
7677 # @param theShape Any shape.
7678 # @param thePoint Point, close to the desired vertex.
7679 # @return New GEOM.GEOM_Object, containing the found vertex.
7681 # @ref swig_GetVertexNearPoint "Example"
7682 def GetVertexNearPoint(self, theShape, thePoint):
7684 Find a vertex of the given shape, which has minimal distance to the given point.
7688 thePoint Point, close to the desired vertex.
7691 New GEOM.GEOM_Object, containing the found vertex.
7694 pmidle = geompy.MakeVertex(50, 0, 50)
7695 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7697 # Example: see GEOM_TestOthers.py
7698 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7699 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7702 ## Get an edge, found in the given shape by two given vertices.
7703 # @param theShape Block or a compound of blocks.
7704 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7705 # @return New GEOM.GEOM_Object, containing the found edge.
7707 # @ref swig_GetEdge "Example"
7708 def GetEdge(self, theShape, thePoint1, thePoint2):
7710 Get an edge, found in the given shape by two given vertices.
7713 theShape Block or a compound of blocks.
7714 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7717 New GEOM.GEOM_Object, containing the found edge.
7719 # Example: see GEOM_Spanner.py
7720 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7721 RaiseIfFailed("GetEdge", self.BlocksOp)
7724 ## Find an edge of the given shape, which has minimal distance to the given point.
7725 # @param theShape Block or a compound of blocks.
7726 # @param thePoint Point, close to the desired edge.
7727 # @return New GEOM.GEOM_Object, containing the found edge.
7729 # @ref swig_GetEdgeNearPoint "Example"
7730 def GetEdgeNearPoint(self, theShape, thePoint):
7732 Find an edge of the given shape, which has minimal distance to the given point.
7735 theShape Block or a compound of blocks.
7736 thePoint Point, close to the desired edge.
7739 New GEOM.GEOM_Object, containing the found edge.
7741 # Example: see GEOM_TestOthers.py
7742 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7743 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7746 ## Returns a face, found in the given shape by four given corner vertices.
7747 # @param theShape Block or a compound of blocks.
7748 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7749 # @return New GEOM.GEOM_Object, containing the found face.
7751 # @ref swig_todo "Example"
7752 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7754 Returns a face, found in the given shape by four given corner vertices.
7757 theShape Block or a compound of blocks.
7758 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7761 New GEOM.GEOM_Object, containing the found face.
7763 # Example: see GEOM_Spanner.py
7764 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7765 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7768 ## Get a face of block, found in the given shape by two given edges.
7769 # @param theShape Block or a compound of blocks.
7770 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7771 # @return New GEOM.GEOM_Object, containing the found face.
7773 # @ref swig_todo "Example"
7774 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7776 Get a face of block, found in the given shape by two given edges.
7779 theShape Block or a compound of blocks.
7780 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7783 New GEOM.GEOM_Object, containing the found face.
7785 # Example: see GEOM_Spanner.py
7786 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7787 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7790 ## Find a face, opposite to the given one in the given block.
7791 # @param theBlock Must be a hexahedral solid.
7792 # @param theFace Face of \a theBlock, opposite to the desired face.
7793 # @return New GEOM.GEOM_Object, containing the found face.
7795 # @ref swig_GetOppositeFace "Example"
7796 def GetOppositeFace(self,theBlock, theFace):
7798 Find a face, opposite to the given one in the given block.
7801 theBlock Must be a hexahedral solid.
7802 theFace Face of theBlock, opposite to the desired face.
7805 New GEOM.GEOM_Object, containing the found face.
7807 # Example: see GEOM_Spanner.py
7808 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7809 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7812 ## Find a face of the given shape, which has minimal distance to the given point.
7813 # @param theShape Block or a compound of blocks.
7814 # @param thePoint Point, close to the desired face.
7815 # @return New GEOM.GEOM_Object, containing the found face.
7817 # @ref swig_GetFaceNearPoint "Example"
7818 def GetFaceNearPoint(self, theShape, thePoint):
7820 Find a face of the given shape, which has minimal distance to the given point.
7823 theShape Block or a compound of blocks.
7824 thePoint Point, close to the desired face.
7827 New GEOM.GEOM_Object, containing the found face.
7829 # Example: see GEOM_Spanner.py
7830 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7831 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7834 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7835 # @param theBlock Block or a compound of blocks.
7836 # @param theVector Vector, close to the normale of the desired face.
7837 # @return New GEOM.GEOM_Object, containing the found face.
7839 # @ref swig_todo "Example"
7840 def GetFaceByNormale(self, theBlock, theVector):
7842 Find a face of block, whose outside normale has minimal angle with the given vector.
7845 theBlock Block or a compound of blocks.
7846 theVector Vector, close to the normale of the desired face.
7849 New GEOM.GEOM_Object, containing the found face.
7851 # Example: see GEOM_Spanner.py
7852 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7853 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7856 ## Find all sub-shapes of type \a theShapeType of the given shape,
7857 # which have minimal distance to the given point.
7858 # @param theShape Any shape.
7859 # @param thePoint Point, close to the desired shape.
7860 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7861 # @param theTolerance The tolerance for distances comparison. All shapes
7862 # with distances to the given point in interval
7863 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7864 # @return New GEOM_Object, containing a group of all found shapes.
7866 # @ref swig_GetShapesNearPoint "Example"
7867 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7869 Find all sub-shapes of type theShapeType of the given shape,
7870 which have minimal distance to the given point.
7874 thePoint Point, close to the desired shape.
7875 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7876 theTolerance The tolerance for distances comparison. All shapes
7877 with distances to the given point in interval
7878 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7881 New GEOM_Object, containing a group of all found shapes.
7883 # Example: see GEOM_TestOthers.py
7884 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7885 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7888 # end of l3_blocks_op
7891 ## @addtogroup l4_blocks_measure
7894 ## Check, if the compound of blocks is given.
7895 # To be considered as a compound of blocks, the
7896 # given shape must satisfy the following conditions:
7897 # - Each element of the compound should be a Block (6 faces and 12 edges).
7898 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7899 # - The compound should be connexe.
7900 # - The glue between two quadrangle faces should be applied.
7901 # @param theCompound The compound to check.
7902 # @return TRUE, if the given shape is a compound of blocks.
7903 # If theCompound is not valid, prints all discovered errors.
7905 # @ref tui_measurement_tools_page "Example 1"
7906 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
7907 def CheckCompoundOfBlocks(self,theCompound):
7909 Check, if the compound of blocks is given.
7910 To be considered as a compound of blocks, the
7911 given shape must satisfy the following conditions:
7912 - Each element of the compound should be a Block (6 faces and 12 edges).
7913 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7914 - The compound should be connexe.
7915 - The glue between two quadrangle faces should be applied.
7918 theCompound The compound to check.
7921 TRUE, if the given shape is a compound of blocks.
7922 If theCompound is not valid, prints all discovered errors.
7924 # Example: see GEOM_Spanner.py
7925 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7926 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7928 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7932 ## Retrieve all non blocks solids and faces from \a theShape.
7933 # @param theShape The shape to explore.
7934 # @return A tuple of two GEOM_Objects. The first object is a group of all
7935 # non block solids (= not 6 faces, or with 6 faces, but with the
7936 # presence of non-quadrangular faces). The second object is a
7937 # group of all non quadrangular faces.
7939 # @ref tui_measurement_tools_page "Example 1"
7940 # \n @ref swig_GetNonBlocks "Example 2"
7941 def GetNonBlocks (self, theShape):
7943 Retrieve all non blocks solids and faces from theShape.
7946 theShape The shape to explore.
7949 A tuple of two GEOM_Objects. The first object is a group of all
7950 non block solids (= not 6 faces, or with 6 faces, but with the
7951 presence of non-quadrangular faces). The second object is a
7952 group of all non quadrangular faces.
7955 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
7957 # Example: see GEOM_Spanner.py
7958 aTuple = self.BlocksOp.GetNonBlocks(theShape)
7959 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
7962 ## Remove all seam and degenerated edges from \a theShape.
7963 # Unite faces and edges, sharing one surface. It means that
7964 # this faces must have references to one C++ surface object (handle).
7965 # @param theShape The compound or single solid to remove irregular edges from.
7966 # @param doUnionFaces If True, then unite faces. If False (the default value),
7967 # do not unite faces.
7968 # @return Improved shape.
7970 # @ref swig_RemoveExtraEdges "Example"
7971 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
7973 Remove all seam and degenerated edges from theShape.
7974 Unite faces and edges, sharing one surface. It means that
7975 this faces must have references to one C++ surface object (handle).
7978 theShape The compound or single solid to remove irregular edges from.
7979 doUnionFaces If True, then unite faces. If False (the default value),
7985 # Example: see GEOM_TestOthers.py
7986 nbFacesOptimum = -1 # -1 means do not unite faces
7987 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
7988 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
7989 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
7992 ## Check, if the given shape is a blocks compound.
7993 # Fix all detected errors.
7994 # \note Single block can be also fixed by this method.
7995 # @param theShape The compound to check and improve.
7996 # @return Improved compound.
7998 # @ref swig_CheckAndImprove "Example"
7999 def CheckAndImprove(self,theShape):
8001 Check, if the given shape is a blocks compound.
8002 Fix all detected errors.
8005 Single block can be also fixed by this method.
8008 theShape The compound to check and improve.
8013 # Example: see GEOM_TestOthers.py
8014 anObj = self.BlocksOp.CheckAndImprove(theShape)
8015 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
8018 # end of l4_blocks_measure
8021 ## @addtogroup l3_blocks_op
8024 ## Get all the blocks, contained in the given compound.
8025 # @param theCompound The compound to explode.
8026 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
8027 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
8028 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8029 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
8031 # @ref tui_explode_on_blocks "Example 1"
8032 # \n @ref swig_MakeBlockExplode "Example 2"
8033 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
8035 Get all the blocks, contained in the given compound.
8038 theCompound The compound to explode.
8039 theMinNbFaces If solid has lower number of faces, it is not a block.
8040 theMaxNbFaces If solid has higher number of faces, it is not a block.
8043 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8046 List of GEOM.GEOM_Object, containing the retrieved blocks.
8048 # Example: see GEOM_TestOthers.py
8049 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
8050 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
8051 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
8053 anObj.SetParameters(Parameters)
8057 ## Find block, containing the given point inside its volume or on boundary.
8058 # @param theCompound Compound, to find block in.
8059 # @param thePoint Point, close to the desired block. If the point lays on
8060 # boundary between some blocks, we return block with nearest center.
8061 # @return New GEOM.GEOM_Object, containing the found block.
8063 # @ref swig_todo "Example"
8064 def GetBlockNearPoint(self,theCompound, thePoint):
8066 Find block, containing the given point inside its volume or on boundary.
8069 theCompound Compound, to find block in.
8070 thePoint Point, close to the desired block. If the point lays on
8071 boundary between some blocks, we return block with nearest center.
8074 New GEOM.GEOM_Object, containing the found block.
8076 # Example: see GEOM_Spanner.py
8077 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
8078 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
8081 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8082 # @param theCompound Compound, to find block in.
8083 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
8084 # @return New GEOM.GEOM_Object, containing the found block.
8086 # @ref swig_GetBlockByParts "Example"
8087 def GetBlockByParts(self,theCompound, theParts):
8089 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8092 theCompound Compound, to find block in.
8093 theParts List of faces and/or edges and/or vertices to be parts of the found block.
8096 New GEOM_Object, containing the found block.
8098 # Example: see GEOM_TestOthers.py
8099 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
8100 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
8103 ## Return all blocks, containing all the elements, passed as the parts.
8104 # @param theCompound Compound, to find blocks in.
8105 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8106 # @return List of GEOM.GEOM_Object, containing the found blocks.
8108 # @ref swig_todo "Example"
8109 def GetBlocksByParts(self,theCompound, theParts):
8111 Return all blocks, containing all the elements, passed as the parts.
8114 theCompound Compound, to find blocks in.
8115 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8118 List of GEOM.GEOM_Object, containing the found blocks.
8120 # Example: see GEOM_Spanner.py
8121 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
8122 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
8125 ## Multi-transformate block and glue the result.
8126 # Transformation is defined so, as to superpose direction faces.
8127 # @param Block Hexahedral solid to be multi-transformed.
8128 # @param DirFace1 ID of First direction face.
8129 # @param DirFace2 ID of Second direction face.
8130 # @param NbTimes Quantity of transformations to be done.
8131 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8132 # @return New GEOM.GEOM_Object, containing the result shape.
8134 # @ref tui_multi_transformation "Example"
8135 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
8137 Multi-transformate block and glue the result.
8138 Transformation is defined so, as to superpose direction faces.
8141 Block Hexahedral solid to be multi-transformed.
8142 DirFace1 ID of First direction face.
8143 DirFace2 ID of Second direction face.
8144 NbTimes Quantity of transformations to be done.
8147 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8150 New GEOM.GEOM_Object, containing the result shape.
8152 # Example: see GEOM_Spanner.py
8153 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8154 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8155 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8156 anObj.SetParameters(Parameters)
8159 ## Multi-transformate block and glue the result.
8160 # @param Block Hexahedral solid to be multi-transformed.
8161 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8162 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8163 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
8164 # @return New GEOM.GEOM_Object, containing the result shape.
8166 # @ref tui_multi_transformation "Example"
8167 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8168 DirFace1V, DirFace2V, NbTimesV):
8170 Multi-transformate block and glue the result.
8173 Block Hexahedral solid to be multi-transformed.
8174 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8175 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8176 NbTimesU,NbTimesV Quantity of transformations to be done.
8179 New GEOM.GEOM_Object, containing the result shape.
8181 # Example: see GEOM_Spanner.py
8182 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8183 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8184 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8185 DirFace1V, DirFace2V, NbTimesV)
8186 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8187 anObj.SetParameters(Parameters)
8190 ## Build all possible propagation groups.
8191 # Propagation group is a set of all edges, opposite to one (main)
8192 # edge of this group directly or through other opposite edges.
8193 # Notion of Opposite Edge make sence only on quadrangle face.
8194 # @param theShape Shape to build propagation groups on.
8195 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
8197 # @ref swig_Propagate "Example"
8198 def Propagate(self,theShape):
8200 Build all possible propagation groups.
8201 Propagation group is a set of all edges, opposite to one (main)
8202 edge of this group directly or through other opposite edges.
8203 Notion of Opposite Edge make sence only on quadrangle face.
8206 theShape Shape to build propagation groups on.
8209 List of GEOM.GEOM_Object, each of them is a propagation group.
8211 # Example: see GEOM_TestOthers.py
8212 listChains = self.BlocksOp.Propagate(theShape)
8213 RaiseIfFailed("Propagate", self.BlocksOp)
8216 # end of l3_blocks_op
8219 ## @addtogroup l3_groups
8222 ## Creates a new group which will store sub-shapes of theMainShape
8223 # @param theMainShape is a GEOM object on which the group is selected
8224 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8225 # @return a newly created GEOM group
8227 # @ref tui_working_with_groups_page "Example 1"
8228 # \n @ref swig_CreateGroup "Example 2"
8229 def CreateGroup(self,theMainShape, theShapeType):
8231 Creates a new group which will store sub-shapes of theMainShape
8234 theMainShape is a GEOM object on which the group is selected
8235 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8236 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8239 a newly created GEOM group
8242 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8245 # Example: see GEOM_TestOthers.py
8246 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8247 RaiseIfFailed("CreateGroup", self.GroupOp)
8250 ## Adds a sub-object with ID theSubShapeId to the group
8251 # @param theGroup is a GEOM group to which the new sub-shape is added
8252 # @param theSubShapeID is a sub-shape ID in the main object.
8253 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8255 # @ref tui_working_with_groups_page "Example"
8256 def AddObject(self,theGroup, theSubShapeID):
8258 Adds a sub-object with ID theSubShapeId to the group
8261 theGroup is a GEOM group to which the new sub-shape is added
8262 theSubShapeID is a sub-shape ID in the main object.
8265 Use method GetSubShapeID() to get an unique ID of the sub-shape
8267 # Example: see GEOM_TestOthers.py
8268 self.GroupOp.AddObject(theGroup, theSubShapeID)
8269 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8270 RaiseIfFailed("AddObject", self.GroupOp)
8274 ## Removes a sub-object with ID \a theSubShapeId from the group
8275 # @param theGroup is a GEOM group from which the new sub-shape is removed
8276 # @param theSubShapeID is a sub-shape ID in the main object.
8277 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8279 # @ref tui_working_with_groups_page "Example"
8280 def RemoveObject(self,theGroup, theSubShapeID):
8282 Removes a sub-object with ID theSubShapeId from the group
8285 theGroup is a GEOM group from which the new sub-shape is removed
8286 theSubShapeID is a sub-shape ID in the main object.
8289 Use method GetSubShapeID() to get an unique ID of the sub-shape
8291 # Example: see GEOM_TestOthers.py
8292 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8293 RaiseIfFailed("RemoveObject", self.GroupOp)
8296 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8297 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8298 # @param theSubShapes is a list of sub-shapes to be added.
8300 # @ref tui_working_with_groups_page "Example"
8301 def UnionList (self,theGroup, theSubShapes):
8303 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8306 theGroup is a GEOM group to which the new sub-shapes are added.
8307 theSubShapes is a list of sub-shapes to be added.
8309 # Example: see GEOM_TestOthers.py
8310 self.GroupOp.UnionList(theGroup, theSubShapes)
8311 RaiseIfFailed("UnionList", self.GroupOp)
8314 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8315 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8316 # @param theSubShapes is a list of indices of sub-shapes to be added.
8318 # @ref swig_UnionIDs "Example"
8319 def UnionIDs(self,theGroup, theSubShapes):
8321 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8324 theGroup is a GEOM group to which the new sub-shapes are added.
8325 theSubShapes is a list of indices of sub-shapes to be added.
8327 # Example: see GEOM_TestOthers.py
8328 self.GroupOp.UnionIDs(theGroup, theSubShapes)
8329 RaiseIfFailed("UnionIDs", self.GroupOp)
8332 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8333 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8334 # @param theSubShapes is a list of sub-shapes to be removed.
8336 # @ref tui_working_with_groups_page "Example"
8337 def DifferenceList (self,theGroup, theSubShapes):
8339 Removes from the group all the given shapes. No errors, if some shapes are not included.
8342 theGroup is a GEOM group from which the sub-shapes are removed.
8343 theSubShapes is a list of sub-shapes to be removed.
8345 # Example: see GEOM_TestOthers.py
8346 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8347 RaiseIfFailed("DifferenceList", self.GroupOp)
8350 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8351 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8352 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8354 # @ref swig_DifferenceIDs "Example"
8355 def DifferenceIDs(self,theGroup, theSubShapes):
8357 Removes from the group all the given shapes. No errors, if some shapes are not included.
8360 theGroup is a GEOM group from which the sub-shapes are removed.
8361 theSubShapes is a list of indices of sub-shapes to be removed.
8363 # Example: see GEOM_TestOthers.py
8364 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8365 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8368 ## Union of two groups.
8369 # New group is created. It will contain all entities
8370 # which are present in groups theGroup1 and theGroup2.
8371 # @param theGroup1, theGroup2 are the initial GEOM groups
8372 # to create the united group from.
8373 # @return a newly created GEOM group.
8374 # @ref tui_union_groups_anchor "Example"
8375 def UnionGroups (self, theGroup1, theGroup2):
8377 Union of two groups.
8378 New group is created. It will contain all entities
8379 which are present in groups theGroup1 and theGroup2.
8382 theGroup1, theGroup2 are the initial GEOM groups
8383 to create the united group from.
8386 a newly created GEOM group.
8388 # Example: see GEOM_TestOthers.py
8389 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
8390 RaiseIfFailed("UnionGroups", self.GroupOp)
8393 ## Intersection of two groups.
8394 # New group is created. It will contain only those entities
8395 # which are present in both groups theGroup1 and theGroup2.
8396 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8397 # @return a newly created GEOM group.
8398 # @ref tui_intersect_groups_anchor "Example"
8399 def IntersectGroups (self, theGroup1, theGroup2):
8401 Intersection of two groups.
8402 New group is created. It will contain only those entities
8403 which are present in both groups theGroup1 and theGroup2.
8406 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8409 a newly created GEOM group.
8411 # Example: see GEOM_TestOthers.py
8412 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
8413 RaiseIfFailed("IntersectGroups", self.GroupOp)
8416 ## Cut of two groups.
8417 # New group is created. It will contain entities which are
8418 # present in group theGroup1 but are not present in group theGroup2.
8419 # @param theGroup1 is a GEOM group to include elements of.
8420 # @param theGroup2 is a GEOM group to exclude elements of.
8421 # @return a newly created GEOM group.
8422 # @ref tui_cut_groups_anchor "Example"
8423 def CutGroups (self, theGroup1, theGroup2):
8426 New group is created. It will contain entities which are
8427 present in group theGroup1 but are not present in group theGroup2.
8430 theGroup1 is a GEOM group to include elements of.
8431 theGroup2 is a GEOM group to exclude elements of.
8434 a newly created GEOM group.
8436 # Example: see GEOM_TestOthers.py
8437 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
8438 RaiseIfFailed("CutGroups", self.GroupOp)
8441 ## Union of list of groups.
8442 # New group is created. It will contain all entities that are
8443 # present in groups listed in theGList.
8444 # @param theGList is a list of GEOM groups to create the united group from.
8445 # @return a newly created GEOM group.
8446 # @ref tui_union_groups_anchor "Example"
8447 def UnionListOfGroups (self, theGList):
8449 Union of list of groups.
8450 New group is created. It will contain all entities that are
8451 present in groups listed in theGList.
8454 theGList is a list of GEOM groups to create the united group from.
8457 a newly created GEOM group.
8459 # Example: see GEOM_TestOthers.py
8460 aGroup = self.GroupOp.UnionListOfGroups(theGList)
8461 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
8464 ## Cut of lists of groups.
8465 # New group is created. It will contain only entities
8466 # which are present in groups listed in theGList1 but
8467 # are not present in groups from theGList2.
8468 # @param theGList1 is a list of GEOM groups to include elements of.
8469 # @param theGList2 is a list of GEOM groups to exclude elements of.
8470 # @return a newly created GEOM group.
8471 # @ref tui_intersect_groups_anchor "Example"
8472 def IntersectListOfGroups (self, theGList):
8474 Cut of lists of groups.
8475 New group is created. It will contain only entities
8476 which are present in groups listed in theGList1 but
8477 are not present in groups from theGList2.
8480 theGList1 is a list of GEOM groups to include elements of.
8481 theGList2 is a list of GEOM groups to exclude elements of.
8484 a newly created GEOM group.
8486 # Example: see GEOM_TestOthers.py
8487 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
8488 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
8491 ## Cut of lists of groups.
8492 # New group is created. It will contain only entities
8493 # which are present in groups listed in theGList1 but
8494 # are not present in groups from theGList2.
8495 # @param theGList1 is a list of GEOM groups to include elements of.
8496 # @param theGList2 is a list of GEOM groups to exclude elements of.
8497 # @return a newly created GEOM group.
8498 # @ref tui_cut_groups_anchor "Example"
8499 def CutListOfGroups (self, theGList1, theGList2):
8501 Cut of lists of groups.
8502 New group is created. It will contain only entities
8503 which are present in groups listed in theGList1 but
8504 are not present in groups from theGList2.
8507 theGList1 is a list of GEOM groups to include elements of.
8508 theGList2 is a list of GEOM groups to exclude elements of.
8511 a newly created GEOM group.
8513 # Example: see GEOM_TestOthers.py
8514 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
8515 RaiseIfFailed("CutListOfGroups", self.GroupOp)
8518 ## Returns a list of sub-objects ID stored in the group
8519 # @param theGroup is a GEOM group for which a list of IDs is requested
8521 # @ref swig_GetObjectIDs "Example"
8522 def GetObjectIDs(self,theGroup):
8524 Returns a list of sub-objects ID stored in the group
8527 theGroup is a GEOM group for which a list of IDs is requested
8529 # Example: see GEOM_TestOthers.py
8530 ListIDs = self.GroupOp.GetObjects(theGroup)
8531 RaiseIfFailed("GetObjects", self.GroupOp)
8534 ## Returns a type of sub-objects stored in the group
8535 # @param theGroup is a GEOM group which type is returned.
8537 # @ref swig_GetType "Example"
8538 def GetType(self,theGroup):
8540 Returns a type of sub-objects stored in the group
8543 theGroup is a GEOM group which type is returned.
8545 # Example: see GEOM_TestOthers.py
8546 aType = self.GroupOp.GetType(theGroup)
8547 RaiseIfFailed("GetType", self.GroupOp)
8550 ## Convert a type of geom object from id to string value
8551 # @param theId is a GEOM obect type id.
8552 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8553 # @ref swig_GetType "Example"
8554 def ShapeIdToType(self, theId):
8556 Convert a type of geom object from id to string value
8559 theId is a GEOM obect type id.
8562 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8637 return "FREE_BOUNDS"
8645 return "THRUSECTIONS"
8647 return "COMPOUNDFILTER"
8649 return "SHAPES_ON_SHAPE"
8651 return "ELLIPSE_ARC"
8660 return "Shape Id not exist."
8662 ## Returns a main shape associated with the group
8663 # @param theGroup is a GEOM group for which a main shape object is requested
8664 # @return a GEOM object which is a main shape for theGroup
8666 # @ref swig_GetMainShape "Example"
8667 def GetMainShape(self,theGroup):
8669 Returns a main shape associated with the group
8672 theGroup is a GEOM group for which a main shape object is requested
8675 a GEOM object which is a main shape for theGroup
8677 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8679 # Example: see GEOM_TestOthers.py
8680 anObj = self.GroupOp.GetMainShape(theGroup)
8681 RaiseIfFailed("GetMainShape", self.GroupOp)
8684 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8685 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8686 # @param theShape given shape (see GEOM.GEOM_Object)
8687 # @param min_length minimum length of edges of theShape
8688 # @param max_length maximum length of edges of theShape
8689 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8690 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8691 # @return a newly created GEOM group of edges
8692 # @@ref swig_todo "Example"
8693 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8695 Create group of edges of theShape, whose length is in range [min_length, max_length].
8696 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8699 theShape given shape
8700 min_length minimum length of edges of theShape
8701 max_length maximum length of edges of theShape
8702 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8703 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8706 a newly created GEOM group of edges.
8708 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8711 Props = self.BasicProperties(edge)
8712 if min_length <= Props[0] and Props[0] <= max_length:
8713 if (not include_min) and (min_length == Props[0]):
8716 if (not include_max) and (Props[0] == max_length):
8719 edges_in_range.append(edge)
8721 if len(edges_in_range) <= 0:
8722 print "No edges found by given criteria"
8725 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8726 self.UnionList(group_edges, edges_in_range)
8730 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8731 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8732 # @param min_length minimum length of edges of selected shape
8733 # @param max_length maximum length of edges of selected shape
8734 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8735 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8736 # @return a newly created GEOM group of edges
8737 # @ref swig_todo "Example"
8738 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8740 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8741 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8744 min_length minimum length of edges of selected shape
8745 max_length maximum length of edges of selected shape
8746 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8747 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8750 a newly created GEOM group of edges.
8752 nb_selected = sg.SelectedCount()
8754 print "Select a shape before calling this function, please."
8757 print "Only one shape must be selected"
8760 id_shape = sg.getSelected(0)
8761 shape = IDToObject( id_shape )
8763 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8767 if include_min: left_str = " <= "
8768 if include_max: right_str = " <= "
8770 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8771 + left_str + "length" + right_str + `max_length`)
8773 sg.updateObjBrowser(1)
8780 ## @addtogroup l4_advanced
8783 ## Create a T-shape object with specified caracteristics for the main
8784 # and the incident pipes (radius, width, half-length).
8785 # The extremities of the main pipe are located on junctions points P1 and P2.
8786 # The extremity of the incident pipe is located on junction point P3.
8787 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8788 # the main plane of the T-shape is XOY.
8789 # @param theR1 Internal radius of main pipe
8790 # @param theW1 Width of main pipe
8791 # @param theL1 Half-length of main pipe
8792 # @param theR2 Internal radius of incident pipe (R2 < R1)
8793 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8794 # @param theL2 Half-length of incident pipe
8795 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8796 # @param theP1 1st junction point of main pipe
8797 # @param theP2 2nd junction point of main pipe
8798 # @param theP3 Junction point of incident pipe
8799 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8801 # @ref tui_creation_pipetshape "Example"
8802 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8804 Create a T-shape object with specified caracteristics for the main
8805 and the incident pipes (radius, width, half-length).
8806 The extremities of the main pipe are located on junctions points P1 and P2.
8807 The extremity of the incident pipe is located on junction point P3.
8808 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8809 the main plane of the T-shape is XOY.
8812 theR1 Internal radius of main pipe
8813 theW1 Width of main pipe
8814 theL1 Half-length of main pipe
8815 theR2 Internal radius of incident pipe (R2 < R1)
8816 theW2 Width of incident pipe (R2+W2 < R1+W1)
8817 theL2 Half-length of incident pipe
8818 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8819 theP1 1st junction point of main pipe
8820 theP2 2nd junction point of main pipe
8821 theP3 Junction point of incident pipe
8824 List of GEOM_Object, containing the created shape and propagation groups.
8827 # create PipeTShape object
8828 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8829 # create PipeTShape object with position
8830 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8832 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8833 if (theP1 and theP2 and theP3):
8834 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8836 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8837 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8838 if Parameters: anObj[0].SetParameters(Parameters)
8841 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8842 # and the incident pipes (radius, width, half-length). The chamfer is
8843 # created on the junction of the pipes.
8844 # The extremities of the main pipe are located on junctions points P1 and P2.
8845 # The extremity of the incident pipe is located on junction point P3.
8846 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8847 # the main plane of the T-shape is XOY.
8848 # @param theR1 Internal radius of main pipe
8849 # @param theW1 Width of main pipe
8850 # @param theL1 Half-length of main pipe
8851 # @param theR2 Internal radius of incident pipe (R2 < R1)
8852 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8853 # @param theL2 Half-length of incident pipe
8854 # @param theH Height of the chamfer.
8855 # @param theW Width of the chamfer.
8856 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8857 # @param theP1 1st junction point of main pipe
8858 # @param theP2 2nd junction point of main pipe
8859 # @param theP3 Junction point of incident pipe
8860 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8862 # @ref tui_creation_pipetshape "Example"
8863 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8865 Create a T-shape object with chamfer and with specified caracteristics for the main
8866 and the incident pipes (radius, width, half-length). The chamfer is
8867 created on the junction of the pipes.
8868 The extremities of the main pipe are located on junctions points P1 and P2.
8869 The extremity of the incident pipe is located on junction point P3.
8870 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8871 the main plane of the T-shape is XOY.
8874 theR1 Internal radius of main pipe
8875 theW1 Width of main pipe
8876 theL1 Half-length of main pipe
8877 theR2 Internal radius of incident pipe (R2 < R1)
8878 theW2 Width of incident pipe (R2+W2 < R1+W1)
8879 theL2 Half-length of incident pipe
8880 theH Height of the chamfer.
8881 theW Width of the chamfer.
8882 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8883 theP1 1st junction point of main pipe
8884 theP2 2nd junction point of main pipe
8885 theP3 Junction point of incident pipe
8888 List of GEOM_Object, containing the created shape and propagation groups.
8891 # create PipeTShape with chamfer object
8892 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8893 # create PipeTShape with chamfer object with position
8894 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8896 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8897 if (theP1 and theP2 and theP3):
8898 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8900 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8901 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8902 if Parameters: anObj[0].SetParameters(Parameters)
8905 ## Create a T-shape object with fillet and with specified caracteristics for the main
8906 # and the incident pipes (radius, width, half-length). The fillet is
8907 # created on the junction of the pipes.
8908 # The extremities of the main pipe are located on junctions points P1 and P2.
8909 # The extremity of the incident pipe is located on junction point P3.
8910 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8911 # the main plane of the T-shape is XOY.
8912 # @param theR1 Internal radius of main pipe
8913 # @param theW1 Width of main pipe
8914 # @param theL1 Half-length of main pipe
8915 # @param theR2 Internal radius of incident pipe (R2 < R1)
8916 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8917 # @param theL2 Half-length of incident pipe
8918 # @param theRF Radius of curvature of fillet.
8919 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8920 # @param theP1 1st junction point of main pipe
8921 # @param theP2 2nd junction point of main pipe
8922 # @param theP3 Junction point of incident pipe
8923 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8925 # @ref tui_creation_pipetshape "Example"
8926 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8928 Create a T-shape object with fillet and with specified caracteristics for the main
8929 and the incident pipes (radius, width, half-length). The fillet is
8930 created on the junction of the pipes.
8931 The extremities of the main pipe are located on junctions points P1 and P2.
8932 The extremity of the incident pipe is located on junction point P3.
8935 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8936 the main plane of the T-shape is XOY.
8937 theR1 Internal radius of main pipe
8938 theW1 Width of main pipe
8939 heL1 Half-length of main pipe
8940 theR2 Internal radius of incident pipe (R2 < R1)
8941 theW2 Width of incident pipe (R2+W2 < R1+W1)
8942 theL2 Half-length of incident pipe
8943 theRF Radius of curvature of fillet.
8944 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8945 theP1 1st junction point of main pipe
8946 theP2 2nd junction point of main pipe
8947 theP3 Junction point of incident pipe
8950 List of GEOM_Object, containing the created shape and propagation groups.
8953 # create PipeTShape with fillet object
8954 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
8955 # create PipeTShape with fillet object with position
8956 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
8959 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
8960 if (theP1 and theP2 and theP3):
8961 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
8963 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
8964 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
8965 if Parameters: anObj[0].SetParameters(Parameters)
8968 ## This function allows creating a disk already divided into blocks. It
8969 # can be used to create divided pipes for later meshing in hexaedra.
8970 # @param theR Radius of the disk
8971 # @param theOrientation Orientation of the plane on which the disk will be built
8972 # 1 = XOY, 2 = OYZ, 3 = OZX
8973 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8974 # @return New GEOM_Object, containing the created shape.
8976 # @ref tui_creation_divideddisk "Example"
8977 def MakeDividedDisk(self, theR, theOrientation, thePattern ):
8978 theR, Parameters = ParseParameters(theR)
8979 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
8980 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
8981 if Parameters: anObj.SetParameters(Parameters)
8984 ## This function allows creating a disk already divided into blocks. It
8985 # can be used to create divided pipes for later meshing in hexaedra.
8986 # @param theCenter Center of the disk
8987 # @param theVector Normal vector to the plane of the created disk
8988 # @param theRadius Radius of the disk
8989 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8990 # @return New GEOM_Object, containing the created shape.
8992 # @ref tui_creation_divideddisk "Example"
8993 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
8994 theRadius, Parameters = ParseParameters(theRadius)
8995 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
8996 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
8997 if Parameters: anObj.SetParameters(Parameters)
9000 ## Builds a cylinder prepared for hexa meshes
9001 # @param theR Radius of the cylinder
9002 # @param theH Height of the cylinder
9003 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9004 # @return New GEOM_Object, containing the created shape.
9006 # @ref tui_creation_dividedcylinder "Example"
9007 def MakeDividedCylinder(self, theR, theH, thePattern):
9008 theR, theH, Parameters = ParseParameters(theR, theH)
9009 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
9010 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
9011 if Parameters: anObj.SetParameters(Parameters)
9014 #@@ insert new functions before this line @@ do not remove this line @@#
9016 # end of l4_advanced
9019 ## Create a copy of the given object
9021 # @param theOriginal geometry object for copy
9022 # @return unique object identifier
9023 # @ingroup l1_geompy_auxiliary
9024 # @ref swig_MakeCopy "Example"
9025 def MakeCopy(self,theOriginal):
9027 Create a copy of the given object
9030 theOriginal geometry object for copy
9033 unique object identifier
9035 Example of usage: Copy = geompy.MakeCopy(Box)
9037 # Example: see GEOM_TestAll.py
9038 anObj = self.InsertOp.MakeCopy(theOriginal)
9039 RaiseIfFailed("MakeCopy", self.InsertOp)
9042 ## Add Path to load python scripts from
9043 # @param Path a path to load python scripts from
9044 # @ingroup l1_geompy_auxiliary
9045 def addPath(self,Path):
9047 Add Path to load python scripts from
9050 Path a path to load python scripts from
9052 if (sys.path.count(Path) < 1):
9053 sys.path.append(Path)
9057 ## Load marker texture from the file
9058 # @param Path a path to the texture file
9059 # @return unique texture identifier
9060 # @ingroup l1_geompy_auxiliary
9061 def LoadTexture(self, Path):
9063 Load marker texture from the file
9066 Path a path to the texture file
9069 unique texture identifier
9071 # Example: see GEOM_TestAll.py
9072 ID = self.InsertOp.LoadTexture(Path)
9073 RaiseIfFailed("LoadTexture", self.InsertOp)
9076 ## Get entry of the object
9077 # @param obj geometry object
9078 # @return unique object identifier
9079 # @ingroup l1_geompy_auxiliary
9080 def getObjectID(self, obj):
9082 Get entry of the object
9088 unique object identifier
9091 entry = salome.ObjectToID(obj)
9092 if entry is not None:
9093 lst = entry.split(":")
9095 ID = lst[-1] # -1 means last item in the list
9101 ## Add marker texture. @a Width and @a Height parameters
9102 # specify width and height of the texture in pixels.
9103 # If @a RowData is @c True, @a Texture parameter should represent texture data
9104 # packed into the byte array. If @a RowData is @c False (default), @a Texture
9105 # parameter should be unpacked string, in which '1' symbols represent opaque
9106 # pixels and '0' represent transparent pixels of the texture bitmap.
9108 # @param Width texture width in pixels
9109 # @param Height texture height in pixels
9110 # @param Texture texture data
9111 # @param RowData if @c True, @a Texture data are packed in the byte stream
9112 # @return unique texture identifier
9113 # @ingroup l1_geompy_auxiliary
9114 def AddTexture(self, Width, Height, Texture, RowData=False):
9116 Add marker texture. Width and Height parameters
9117 specify width and height of the texture in pixels.
9118 If RowData is True, Texture parameter should represent texture data
9119 packed into the byte array. If RowData is False (default), Texture
9120 parameter should be unpacked string, in which '1' symbols represent opaque
9121 pixels and '0' represent transparent pixels of the texture bitmap.
9124 Width texture width in pixels
9125 Height texture height in pixels
9126 Texture texture data
9127 RowData if True, Texture data are packed in the byte stream
9130 return unique texture identifier
9132 if not RowData: Texture = PackData(Texture)
9133 ID = self.InsertOp.AddTexture(Width, Height, Texture)
9134 RaiseIfFailed("AddTexture", self.InsertOp)
9138 #Register the new proxy for GEOM_Gen
9139 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)