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 # GEOM GEOM_SWIG : binding of C++ implementation with Python
23 # Author : Paul RASCLE, EDF
28 \brief Module geompyDC
31 ## @defgroup l1_geompyDC_auxiliary Auxiliary data structures and methods
33 ## @defgroup l1_geompyDC_purpose All package methods, grouped by their purpose
35 ## @defgroup l2_import_export Importing/exporting geometrical objects
36 ## @defgroup l2_creating Creating geometrical objects
38 ## @defgroup l3_basic_go Creating Basic Geometric Objects
40 ## @defgroup l4_curves Creating Curves
43 ## @defgroup l3_3d_primitives Creating 3D Primitives
44 ## @defgroup l3_complex Creating Complex Objects
45 ## @defgroup l3_groups Working with groups
46 ## @defgroup l3_blocks Building by blocks
48 ## @defgroup l4_blocks_measure Check and Improve
51 ## @defgroup l3_sketcher Sketcher
52 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
54 ## @defgroup l4_decompose Decompose objects
55 ## @defgroup l4_decompose_d Decompose objects deprecated methods
56 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
57 ## @defgroup l4_obtain Access to sub-shapes by a criteria
58 ## @defgroup l4_advanced Advanced objects creation functions
63 ## @defgroup l2_transforming Transforming geometrical objects
65 ## @defgroup l3_basic_op Basic Operations
66 ## @defgroup l3_boolean Boolean Operations
67 ## @defgroup l3_transform Transformation Operations
68 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
69 ## @defgroup l3_blocks_op Blocks Operations
70 ## @defgroup l3_healing Repairing Operations
71 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
74 ## @defgroup l2_measure Using measurement tools
78 # initialize SALOME session in try/except block
79 # to avoid problems in some cases, e.g. when generating documentation
87 from salome_notebook import *
93 from gsketcher import Sketcher3D
95 ## Enumeration ShapeType as a dictionary. \n
96 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
97 # @ingroup l1_geompyDC_auxiliary
98 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
100 ## Raise an Error, containing the Method_name, if Operation is Failed
101 ## @ingroup l1_geompyDC_auxiliary
102 def RaiseIfFailed (Method_name, Operation):
103 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
104 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
106 ## Return list of variables value from salome notebook
107 ## @ingroup l1_geompyDC_auxiliary
108 def ParseParameters(*parameters):
111 for parameter in parameters:
112 if isinstance(parameter, list):
113 lResults = ParseParameters(*parameter)
114 if len(lResults) > 0:
115 Result.append(lResults[:-1])
116 StringResult += lResults[-1].split(":")
120 if isinstance(parameter,str):
121 if notebook.isVariable(parameter):
122 Result.append(notebook.get(parameter))
124 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
127 Result.append(parameter)
129 StringResult.append(str(parameter))
133 Result.append(":".join(StringResult))
135 Result = ":".join(StringResult)
138 ## Return list of variables value from salome notebook
139 ## @ingroup l1_geompyDC_auxiliary
143 for parameter in list:
144 if isinstance(parameter,str) and notebook.isVariable(parameter):
145 Result.append(str(notebook.get(parameter)))
148 Result.append(str(parameter))
151 StringResult = StringResult + str(parameter)
152 StringResult = StringResult + ":"
154 StringResult = StringResult[:len(StringResult)-1]
155 return Result, StringResult
157 ## Return list of variables value from salome notebook
158 ## @ingroup l1_geompyDC_auxiliary
159 def ParseSketcherCommand(command):
162 sections = command.split(":")
163 for section in sections:
164 parameters = section.split(" ")
166 for parameter in parameters:
167 if paramIndex > 1 and parameter.find("'") != -1:
168 parameter = parameter.replace("'","")
169 if notebook.isVariable(parameter):
170 Result = Result + str(notebook.get(parameter)) + " "
173 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
177 Result = Result + str(parameter) + " "
180 StringResult = StringResult + parameter
181 StringResult = StringResult + ":"
183 paramIndex = paramIndex + 1
185 Result = Result[:len(Result)-1] + ":"
187 Result = Result[:len(Result)-1]
188 return Result, StringResult
190 ## Helper function which can be used to pack the passed string to the byte data.
191 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
192 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
195 ## val = PackData("10001110") # val = 0xAE
196 ## val = PackData("1") # val = 0x80
198 ## @param data unpacked data - a string containing '1' and '0' symbols
199 ## @return data packed to the byte stream
200 ## @ingroup l1_geompyDC_auxiliary
203 Helper function which can be used to pack the passed string to the byte data.
204 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
205 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
208 data unpacked data - a string containing '1' and '0' symbols
211 data packed to the byte stream
214 val = PackData("10001110") # val = 0xAE
215 val = PackData("1") # val = 0x80
218 if len(data)%8: bytes += 1
220 for b in range(bytes):
221 d = data[b*8:(b+1)*8]
226 if d[i] == "1": val += 1
228 raise "Invalid symbol %s" % d[i]
235 ## Read bitmap texture from the text file.
236 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
237 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
238 ## The function returns width and height of the pixmap in pixels and byte stream representing
239 ## texture bitmap itself.
241 ## This function can be used to read the texture to the byte stream in order to pass it to
242 ## the AddTexture() function of geompyDC class.
246 ## geompy = geompyDC.geomInstance(salome.myStudy)
247 ## texture = geompy.readtexture('mytexture.dat')
248 ## texture = geompy.AddTexture(*texture)
249 ## obj.SetMarkerTexture(texture)
251 ## @param fname texture file name
252 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
253 ## @ingroup l1_geompyDC_auxiliary
254 def ReadTexture(fname):
256 Read bitmap texture from the text file.
257 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
258 A zero symbol ('0') represents transparent pixel of the texture bitmap.
259 The function returns width and height of the pixmap in pixels and byte stream representing
260 texture bitmap itself.
261 This function can be used to read the texture to the byte stream in order to pass it to
262 the AddTexture() function of geompyDC class.
265 fname texture file name
268 sequence of tree values: texture's width, height in pixels and its byte stream
272 geompy = geompyDC.geomInstance(salome.myStudy)
273 texture = geompy.readtexture('mytexture.dat')
274 texture = geompy.AddTexture(*texture)
275 obj.SetMarkerTexture(texture)
279 lines = [ l.strip() for l in f.readlines()]
282 if lines: maxlen = max([len(x) for x in lines])
284 if maxlen%8: lenbytes += 1
288 lenline = (len(line)/8+1)*8
291 lenline = (len(line)/8)*8
293 for i in range(lenline/8):
296 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
299 bytedata += PackData(byte)
301 for i in range(lenline/8, lenbytes):
302 bytedata += PackData("0")
304 return lenbytes*8, len(lines), bytedata
309 ## Returns a long value from enumeration type
310 # Can be used for CORBA enumerator types like GEOM.shape_type
311 # @param theItem enumeration type
312 # @ingroup l1_geompyDC_auxiliary
313 def EnumToLong(theItem):
315 Returns a long value from enumeration type
316 Can be used for CORBA enumerator types like geompyDC.ShapeType
319 theItem enumeration type
322 if hasattr(theItem, "_v"): ret = theItem._v
325 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
326 # and a list of parameters, describing the shape.
327 # List of parameters, describing the shape:
328 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
329 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
331 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
333 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
335 # - SPHERE: [xc yc zc R]
336 # - CYLINDER: [xb yb zb dx dy dz R H]
337 # - BOX: [xc yc zc ax ay az]
338 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
339 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
340 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
341 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
342 # - SOLID: [nb_faces nb_edges nb_vertices]
344 # - SPHERE2D: [xc yc zc R]
345 # - CYLINDER2D: [xb yb zb dx dy dz R H]
346 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
347 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
348 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
349 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
350 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
351 # - PLANE: [xo yo zo dx dy dz]
352 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
353 # - FACE: [nb_edges nb_vertices]
355 # - CIRCLE: [xc yc zc dx dy dz R]
356 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
357 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
358 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
359 # - LINE: [xo yo zo dx dy dz]
360 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
361 # - EDGE: [nb_vertices]
364 # @ingroup l1_geompyDC_auxiliary
365 kind = GEOM.GEOM_IKindOfShape
367 ## Information about closed/unclosed state of shell or wire
368 # @ingroup l1_geompyDC_auxiliary
371 Information about closed/unclosed state of shell or wire
377 # Warning: geom is a singleton
383 class geompyDC(object, GEOM._objref_GEOM_Gen):
390 print "__new__ ", engine, geom, doLcc, created
392 # geom engine is either retrieved from engine, or created
394 # Following test avoids a recursive loop
397 # geom engine not created: existing engine found
399 if doLcc and not created:
402 # FindOrLoadComponent called:
403 # 1. CORBA resolution of server
404 # 2. the __new__ method is called again
405 print "FindOrLoadComponent ", engine, geom, doLcc, created
406 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
408 # FindOrLoadComponent not called
410 # geompyDC instance is created from lcc.FindOrLoadComponent
412 print "super ", engine, geom, doLcc, created
413 geom = super(geompyDC,cls).__new__(cls)
415 # geom engine not created: existing engine found
416 print "existing ", engine, geom, doLcc, created
425 #print "-------- geompyDC __init__ --- ", created, self
426 GEOM._objref_GEOM_Gen.__init__(self)
427 self.myBuilder = None
446 ## @addtogroup l1_geompyDC_auxiliary
448 def init_geom(self,theStudy):
449 self.myStudy = theStudy
450 self.myStudyId = self.myStudy._get_StudyId()
451 self.myBuilder = self.myStudy.NewBuilder()
452 self.father = self.myStudy.FindComponent("GEOM")
453 if self.father is None:
454 self.father = self.myBuilder.NewComponent("GEOM")
455 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
456 FName = A1._narrow(SALOMEDS.AttributeName)
457 FName.SetValue("Geometry")
458 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
459 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
460 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
461 self.myBuilder.DefineComponentInstance(self.father,self)
463 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
464 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
465 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
466 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
467 self.HealOp = self.GetIHealingOperations (self.myStudyId)
468 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
469 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
470 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
471 self.LocalOp = self.GetILocalOperations (self.myStudyId)
472 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
473 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
474 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
475 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
478 ## Dump component to the Python script
479 # This method overrides IDL function to allow default values for the parameters.
480 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
482 Dump component to the Python script
483 This method overrides IDL function to allow default values for the parameters.
485 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
487 ## Get name for sub-shape aSubObj of shape aMainObj
489 # @ref swig_SubShapeName "Example"
490 def SubShapeName(self,aSubObj, aMainObj):
492 Get name for sub-shape aSubObj of shape aMainObj
494 # Example: see GEOM_TestAll.py
496 #aSubId = orb.object_to_string(aSubObj)
497 #aMainId = orb.object_to_string(aMainObj)
498 #index = gg.getIndexTopology(aSubId, aMainId)
499 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
500 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
501 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
504 ## Publish in study aShape with name aName
506 # \param aShape the shape to be published
507 # \param aName the name for the shape
508 # \param doRestoreSubShapes if True, finds and publishes also
509 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
510 # and published sub-shapes of arguments
511 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
512 # these arguments description
513 # \return study entry of the published shape in form of string
515 # @ref swig_all_addtostudy "Example"
516 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
517 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
519 Publish in study aShape with name aName
522 aShape the shape to be published
523 aName the name for the shape
524 doRestoreSubShapes if True, finds and publishes also
525 sub-shapes of aShape, corresponding to its arguments
526 and published sub-shapes of arguments
527 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
528 these arguments description
531 study entry of the published shape in form of string
534 id_block1 = geompy.addToStudy(Block1, "Block 1")
536 # Example: see GEOM_TestAll.py
538 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
539 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
540 if doRestoreSubShapes:
541 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
542 theFindMethod, theInheritFirstArg, True )
544 print "addToStudy() failed"
546 return aShape.GetStudyEntry()
548 ## Publish in study aShape with name aName as sub-object of previously published aFather
549 # \param aFather previously published object
550 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
551 # \param aName the name for the shape
553 # \return study entry of the published shape in form of string
554 # @ref swig_all_addtostudyInFather "Example"
555 def addToStudyInFather(self, aFather, aShape, aName):
557 Publish in study aShape with name aName as sub-object of previously published aFather
560 aFather previously published object
561 aShape the shape to be published as sub-object of aFather
562 aName the name for the shape
565 study entry of the published shape in form of string
567 # Example: see GEOM_TestAll.py
569 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
570 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
572 print "addToStudyInFather() failed"
574 return aShape.GetStudyEntry()
576 ## Unpublish object in study
578 # \param obj the object to be unpublished
579 def hideInStudy(self, obj):
581 Unpublish object in study
584 obj the object to be unpublished
586 ior = salome.orb.object_to_string(obj)
587 aSObject = self.myStudy.FindObjectIOR(ior)
588 if aSObject is not None:
589 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
590 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
591 drwAttribute.SetDrawable(False)
594 # end of l1_geompyDC_auxiliary
597 ## @addtogroup l3_restore_ss
600 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
601 # To be used from python scripts out of addToStudy() (non-default usage)
602 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
603 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
604 # If this list is empty, all operation arguments will be published
605 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
606 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
607 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
608 # Do not publish sub-shapes in place of arguments, but only
609 # in place of sub-shapes of the first argument,
610 # because the whole shape corresponds to the first argument.
611 # Mainly to be used after transformations, but it also can be
612 # usefull after partition with one object shape, and some other
613 # operations, where only the first argument has to be considered.
614 # If theObject has only one argument shape, this flag is automatically
615 # considered as True, not regarding really passed value.
616 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
617 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
618 # \return list of published sub-shapes
620 # @ref tui_restore_prs_params "Example"
621 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
622 theInheritFirstArg=False, theAddPrefix=True):
624 Publish sub-shapes, standing for arguments and sub-shapes of arguments
625 To be used from python scripts out of geompy.addToStudy (non-default usage)
628 theObject published GEOM.GEOM_Object, arguments of which will be published
629 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
630 If this list is empty, all operation arguments will be published
631 theFindMethod method to search sub-shapes, corresponding to arguments and
632 their sub-shapes. Value from enumeration GEOM.find_shape_method.
633 theInheritFirstArg set properties of the first argument for theObject.
634 Do not publish sub-shapes in place of arguments, but only
635 in place of sub-shapes of the first argument,
636 because the whole shape corresponds to the first argument.
637 Mainly to be used after transformations, but it also can be
638 usefull after partition with one object shape, and some other
639 operations, where only the first argument has to be considered.
640 If theObject has only one argument shape, this flag is automatically
641 considered as True, not regarding really passed value.
642 theAddPrefix add prefix "from_" to names of restored sub-shapes,
643 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
645 list of published sub-shapes
647 # Example: see GEOM_TestAll.py
648 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
649 theFindMethod, theInheritFirstArg, theAddPrefix)
651 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
652 # To be used from python scripts out of addToStudy() (non-default usage)
653 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
654 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
655 # If this list is empty, all operation arguments will be published
656 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
657 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
658 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
659 # Do not publish sub-shapes in place of arguments, but only
660 # in place of sub-shapes of the first argument,
661 # because the whole shape corresponds to the first argument.
662 # Mainly to be used after transformations, but it also can be
663 # usefull after partition with one object shape, and some other
664 # operations, where only the first argument has to be considered.
665 # If theObject has only one argument shape, this flag is automatically
666 # considered as True, not regarding really passed value.
667 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
668 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
669 # \return list of published sub-shapes
671 # @ref tui_restore_prs_params "Example"
672 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
673 theInheritFirstArg=False, theAddPrefix=True):
675 Publish sub-shapes, standing for arguments and sub-shapes of arguments
676 To be used from python scripts out of geompy.addToStudy() (non-default usage)
679 theObject published GEOM.GEOM_Object, arguments of which will be published
680 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
681 If this list is empty, all operation arguments will be published
682 theFindMethod method to search sub-shapes, corresponding to arguments and
683 their sub-shapes. Value from enumeration GEOM::find_shape_method.
684 theInheritFirstArg set properties of the first argument for theObject.
685 Do not publish sub-shapes in place of arguments, but only
686 in place of sub-shapes of the first argument,
687 because the whole shape corresponds to the first argument.
688 Mainly to be used after transformations, but it also can be
689 usefull after partition with one object shape, and some other
690 operations, where only the first argument has to be considered.
691 If theObject has only one argument shape, this flag is automatically
692 considered as True, not regarding really passed value.
693 theAddPrefix add prefix "from_" to names of restored sub-shapes,
694 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
697 list of published sub-shapes
699 # Example: see GEOM_TestAll.py
700 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
701 theFindMethod, theInheritFirstArg, theAddPrefix)
703 # end of l3_restore_ss
706 ## @addtogroup l3_basic_go
709 ## Create point by three coordinates.
710 # @param theX The X coordinate of the point.
711 # @param theY The Y coordinate of the point.
712 # @param theZ The Z coordinate of the point.
713 # @return New GEOM.GEOM_Object, containing the created point.
715 # @ref tui_creation_point "Example"
716 def MakeVertex(self, theX, theY, theZ):
718 Create point by three coordinates.
721 theX The X coordinate of the point.
722 theY The Y coordinate of the point.
723 theZ The Z coordinate of the point.
726 New GEOM.GEOM_Object, containing the created point.
728 # Example: see GEOM_TestAll.py
729 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
730 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
731 RaiseIfFailed("MakePointXYZ", self.BasicOp)
732 anObj.SetParameters(Parameters)
735 ## Create a point, distant from the referenced point
736 # on the given distances along the coordinate axes.
737 # @param theReference The referenced point.
738 # @param theX Displacement from the referenced point along OX axis.
739 # @param theY Displacement from the referenced point along OY axis.
740 # @param theZ Displacement from the referenced point along OZ axis.
741 # @return New GEOM.GEOM_Object, containing the created point.
743 # @ref tui_creation_point "Example"
744 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
746 Create a point, distant from the referenced point
747 on the given distances along the coordinate axes.
750 theReference The referenced point.
751 theX Displacement from the referenced point along OX axis.
752 theY Displacement from the referenced point along OY axis.
753 theZ Displacement from the referenced point along OZ axis.
756 New GEOM.GEOM_Object, containing the created point.
758 # Example: see GEOM_TestAll.py
759 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
760 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
761 RaiseIfFailed("MakePointWithReference", self.BasicOp)
762 anObj.SetParameters(Parameters)
765 ## Create a point, corresponding to the given parameter on the given curve.
766 # @param theRefCurve The referenced curve.
767 # @param theParameter Value of parameter on the referenced curve.
768 # @return New GEOM.GEOM_Object, containing the created point.
770 # @ref tui_creation_point "Example"
771 def MakeVertexOnCurve(self,theRefCurve, theParameter):
773 Create a point, corresponding to the given parameter on the given curve.
776 theRefCurve The referenced curve.
777 theParameter Value of parameter on the referenced curve.
780 New GEOM.GEOM_Object, containing the created point.
783 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
785 # Example: see GEOM_TestAll.py
786 theParameter, Parameters = ParseParameters(theParameter)
787 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
788 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
789 anObj.SetParameters(Parameters)
792 ## Create a point by projection give coordinates on the given curve
793 # @param theRefCurve The referenced curve.
794 # @param theX X-coordinate in 3D space
795 # @param theY Y-coordinate in 3D space
796 # @param theZ Z-coordinate in 3D space
797 # @return New GEOM.GEOM_Object, containing the created point.
799 # @ref tui_creation_point "Example"
800 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
802 Create a point by projection give coordinates on the given curve
805 theRefCurve The referenced curve.
806 theX X-coordinate in 3D space
807 theY Y-coordinate in 3D space
808 theZ Z-coordinate in 3D space
811 New GEOM.GEOM_Object, containing the created point.
814 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
816 # Example: see GEOM_TestAll.py
817 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
818 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
819 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
820 anObj.SetParameters(Parameters)
823 ## Create a point, corresponding to the given length on the given curve.
824 # @param theRefCurve The referenced curve.
825 # @param theLength Length on the referenced curve. It can be negative.
826 # @param theStartPoint Point allowing to choose the direction for the calculation
827 # of the length. If None, start from the first point of theRefCurve.
828 # @return New GEOM.GEOM_Object, containing the created point.
830 # @ref tui_creation_point "Example"
831 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
833 Create a point, corresponding to the given length on the given curve.
836 theRefCurve The referenced curve.
837 theLength Length on the referenced curve. It can be negative.
838 theStartPoint Point allowing to choose the direction for the calculation
839 of the length. If None, start from the first point of theRefCurve.
842 New GEOM.GEOM_Object, containing the created point.
844 # Example: see GEOM_TestAll.py
845 theLength, Parameters = ParseParameters(theLength)
846 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
847 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
848 anObj.SetParameters(Parameters)
851 ## Create a point, corresponding to the given parameters on the
853 # @param theRefSurf The referenced surface.
854 # @param theUParameter Value of U-parameter on the referenced surface.
855 # @param theVParameter Value of V-parameter on the referenced surface.
856 # @return New GEOM.GEOM_Object, containing the created point.
858 # @ref swig_MakeVertexOnSurface "Example"
859 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
861 Create a point, corresponding to the given parameters on the
865 theRefSurf The referenced surface.
866 theUParameter Value of U-parameter on the referenced surface.
867 theVParameter Value of V-parameter on the referenced surface.
870 New GEOM.GEOM_Object, containing the created point.
873 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
875 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
876 # Example: see GEOM_TestAll.py
877 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
878 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
879 anObj.SetParameters(Parameters);
882 ## Create a point by projection give coordinates on the given surface
883 # @param theRefSurf The referenced surface.
884 # @param theX X-coordinate in 3D space
885 # @param theY Y-coordinate in 3D space
886 # @param theZ Z-coordinate in 3D space
887 # @return New GEOM.GEOM_Object, containing the created point.
889 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
890 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
892 Create a point by projection give coordinates on the given surface
895 theRefSurf The referenced surface.
896 theX X-coordinate in 3D space
897 theY Y-coordinate in 3D space
898 theZ Z-coordinate in 3D space
901 New GEOM.GEOM_Object, containing the created point.
904 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
906 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
907 # Example: see GEOM_TestAll.py
908 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
909 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
910 anObj.SetParameters(Parameters);
913 ## Create a point, which lays on the given face.
914 # The point will lay in arbitrary place of the face.
915 # The only condition on it is a non-zero distance to the face boundary.
916 # Such point can be used to uniquely identify the face inside any
917 # shape in case, when the shape does not contain overlapped faces.
918 # @param theFace The referenced face.
919 # @return New GEOM.GEOM_Object, containing the created point.
921 # @ref swig_MakeVertexInsideFace "Example"
922 def MakeVertexInsideFace (self, theFace):
924 Create a point, which lays on the given face.
925 The point will lay in arbitrary place of the face.
926 The only condition on it is a non-zero distance to the face boundary.
927 Such point can be used to uniquely identify the face inside any
928 shape in case, when the shape does not contain overlapped faces.
931 theFace The referenced face.
934 New GEOM.GEOM_Object, containing the created point.
937 p_on_face = geompy.MakeVertexInsideFace(Face)
939 # Example: see GEOM_TestAll.py
940 anObj = self.BasicOp.MakePointOnFace(theFace)
941 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
944 ## Create a point on intersection of two lines.
945 # @param theRefLine1, theRefLine2 The referenced lines.
946 # @return New GEOM.GEOM_Object, containing the created point.
948 # @ref swig_MakeVertexOnLinesIntersection "Example"
949 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
951 Create a point on intersection of two lines.
954 theRefLine1, theRefLine2 The referenced lines.
957 New GEOM.GEOM_Object, containing the created point.
959 # Example: see GEOM_TestAll.py
960 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
961 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
964 ## Create a tangent, corresponding to the given parameter on the given curve.
965 # @param theRefCurve The referenced curve.
966 # @param theParameter Value of parameter on the referenced curve.
967 # @return New GEOM.GEOM_Object, containing the created tangent.
969 # @ref swig_MakeTangentOnCurve "Example"
970 def MakeTangentOnCurve(self, theRefCurve, theParameter):
972 Create a tangent, corresponding to the given parameter on the given curve.
975 theRefCurve The referenced curve.
976 theParameter Value of parameter on the referenced curve.
979 New GEOM.GEOM_Object, containing the created tangent.
982 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
984 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
985 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
988 ## Create a tangent plane, corresponding to the given parameter on the given face.
989 # @param theFace The face for which tangent plane should be built.
990 # @param theParameterV vertical value of the center point (0.0 - 1.0).
991 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
992 # @param theTrimSize the size of plane.
993 # @return New GEOM.GEOM_Object, containing the created tangent.
995 # @ref swig_MakeTangentPlaneOnFace "Example"
996 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
998 Create a tangent plane, corresponding to the given parameter on the given face.
1001 theFace The face for which tangent plane should be built.
1002 theParameterV vertical value of the center point (0.0 - 1.0).
1003 theParameterU horisontal value of the center point (0.0 - 1.0).
1004 theTrimSize the size of plane.
1007 New GEOM.GEOM_Object, containing the created tangent.
1010 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1012 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1013 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1016 ## Create a vector with the given components.
1017 # @param theDX X component of the vector.
1018 # @param theDY Y component of the vector.
1019 # @param theDZ Z component of the vector.
1020 # @return New GEOM.GEOM_Object, containing the created vector.
1022 # @ref tui_creation_vector "Example"
1023 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
1025 Create a vector with the given components.
1028 theDX X component of the vector.
1029 theDY Y component of the vector.
1030 theDZ Z component of the vector.
1033 New GEOM.GEOM_Object, containing the created vector.
1035 # Example: see GEOM_TestAll.py
1036 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1037 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1038 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1039 anObj.SetParameters(Parameters)
1042 ## Create a vector between two points.
1043 # @param thePnt1 Start point for the vector.
1044 # @param thePnt2 End point for the vector.
1045 # @return New GEOM.GEOM_Object, containing the created vector.
1047 # @ref tui_creation_vector "Example"
1048 def MakeVector(self,thePnt1, thePnt2):
1050 Create a vector between two points.
1053 thePnt1 Start point for the vector.
1054 thePnt2 End point for the vector.
1057 New GEOM.GEOM_Object, containing the created vector.
1059 # Example: see GEOM_TestAll.py
1060 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1061 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1064 ## Create a line, passing through the given point
1065 # and parrallel to the given direction
1066 # @param thePnt Point. The resulting line will pass through it.
1067 # @param theDir Direction. The resulting line will be parallel to it.
1068 # @return New GEOM.GEOM_Object, containing the created line.
1070 # @ref tui_creation_line "Example"
1071 def MakeLine(self,thePnt, theDir):
1073 Create a line, passing through the given point
1074 and parrallel to the given direction
1077 thePnt Point. The resulting line will pass through it.
1078 theDir Direction. The resulting line will be parallel to it.
1081 New GEOM.GEOM_Object, containing the created line.
1083 # Example: see GEOM_TestAll.py
1084 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1085 RaiseIfFailed("MakeLine", self.BasicOp)
1088 ## Create a line, passing through the given points
1089 # @param thePnt1 First of two points, defining the line.
1090 # @param thePnt2 Second of two points, defining the line.
1091 # @return New GEOM.GEOM_Object, containing the created line.
1093 # @ref tui_creation_line "Example"
1094 def MakeLineTwoPnt(self,thePnt1, thePnt2):
1096 Create a line, passing through the given points
1099 thePnt1 First of two points, defining the line.
1100 thePnt2 Second of two points, defining the line.
1103 New GEOM.GEOM_Object, containing the created line.
1105 # Example: see GEOM_TestAll.py
1106 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1107 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1110 ## Create a line on two faces intersection.
1111 # @param theFace1 First of two faces, defining the line.
1112 # @param theFace2 Second of two faces, defining the line.
1113 # @return New GEOM.GEOM_Object, containing the created line.
1115 # @ref swig_MakeLineTwoFaces "Example"
1116 def MakeLineTwoFaces(self, theFace1, theFace2):
1118 Create a line on two faces intersection.
1121 theFace1 First of two faces, defining the line.
1122 theFace2 Second of two faces, defining the line.
1125 New GEOM.GEOM_Object, containing the created line.
1127 # Example: see GEOM_TestAll.py
1128 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1129 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1132 ## Create a plane, passing through the given point
1133 # and normal to the given vector.
1134 # @param thePnt Point, the plane has to pass through.
1135 # @param theVec Vector, defining the plane normal direction.
1136 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1137 # @return New GEOM.GEOM_Object, containing the created plane.
1139 # @ref tui_creation_plane "Example"
1140 def MakePlane(self,thePnt, theVec, theTrimSize):
1142 Create a plane, passing through the given point
1143 and normal to the given vector.
1146 thePnt Point, the plane has to pass through.
1147 theVec Vector, defining the plane normal direction.
1148 theTrimSize Half size of a side of quadrangle face, representing the plane.
1151 New GEOM.GEOM_Object, containing the created plane.
1153 # Example: see GEOM_TestAll.py
1154 theTrimSize, Parameters = ParseParameters(theTrimSize);
1155 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1156 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1157 anObj.SetParameters(Parameters)
1160 ## Create a plane, passing through the three given points
1161 # @param thePnt1 First of three points, defining the plane.
1162 # @param thePnt2 Second of three points, defining the plane.
1163 # @param thePnt3 Fird of three points, defining the plane.
1164 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1165 # @return New GEOM.GEOM_Object, containing the created plane.
1167 # @ref tui_creation_plane "Example"
1168 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1170 Create a plane, passing through the three given points
1173 thePnt1 First of three points, defining the plane.
1174 thePnt2 Second of three points, defining the plane.
1175 thePnt3 Fird of three points, defining the plane.
1176 theTrimSize Half size of a side of quadrangle face, representing the plane.
1179 New GEOM.GEOM_Object, containing the created plane.
1181 # Example: see GEOM_TestAll.py
1182 theTrimSize, Parameters = ParseParameters(theTrimSize);
1183 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1184 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1185 anObj.SetParameters(Parameters)
1188 ## Create a plane, similar to the existing one, but with another size of representing face.
1189 # @param theFace Referenced plane or LCS(Marker).
1190 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1191 # @return New GEOM.GEOM_Object, containing the created plane.
1193 # @ref tui_creation_plane "Example"
1194 def MakePlaneFace(self,theFace, theTrimSize):
1196 Create a plane, similar to the existing one, but with another size of representing face.
1199 theFace Referenced plane or LCS(Marker).
1200 theTrimSize New half size of a side of quadrangle face, representing the plane.
1203 New GEOM.GEOM_Object, containing the created plane.
1205 # Example: see GEOM_TestAll.py
1206 theTrimSize, Parameters = ParseParameters(theTrimSize);
1207 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1208 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1209 anObj.SetParameters(Parameters)
1212 ## Create a plane, passing through the 2 vectors
1213 # with center in a start point of the first vector.
1214 # @param theVec1 Vector, defining center point and plane direction.
1215 # @param theVec2 Vector, defining the plane normal direction.
1216 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1217 # @return New GEOM.GEOM_Object, containing the created plane.
1219 # @ref tui_creation_plane "Example"
1220 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1222 Create a plane, passing through the 2 vectors
1223 with center in a start point of the first vector.
1226 theVec1 Vector, defining center point and plane direction.
1227 theVec2 Vector, defining the plane normal direction.
1228 theTrimSize Half size of a side of quadrangle face, representing the plane.
1231 New GEOM.GEOM_Object, containing the created plane.
1233 # Example: see GEOM_TestAll.py
1234 theTrimSize, Parameters = ParseParameters(theTrimSize);
1235 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1236 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1237 anObj.SetParameters(Parameters)
1240 ## Create a plane, based on a Local coordinate system.
1241 # @param theLCS coordinate system, defining plane.
1242 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1243 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1244 # @return New GEOM.GEOM_Object, containing the created plane.
1246 # @ref tui_creation_plane "Example"
1247 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1249 Create a plane, based on a Local coordinate system.
1252 theLCS coordinate system, defining plane.
1253 theTrimSize Half size of a side of quadrangle face, representing the plane.
1254 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1257 New GEOM.GEOM_Object, containing the created plane.
1259 # Example: see GEOM_TestAll.py
1260 theTrimSize, Parameters = ParseParameters(theTrimSize);
1261 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1262 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1263 anObj.SetParameters(Parameters)
1266 ## Create a local coordinate system.
1267 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1268 # @param XDX,XDY,XDZ Three components of OX direction
1269 # @param YDX,YDY,YDZ Three components of OY direction
1270 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1272 # @ref swig_MakeMarker "Example"
1273 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1275 Create a local coordinate system.
1278 OX,OY,OZ Three coordinates of coordinate system origin.
1279 XDX,XDY,XDZ Three components of OX direction
1280 YDX,YDY,YDZ Three components of OY direction
1283 New GEOM.GEOM_Object, containing the created coordinate system.
1285 # Example: see GEOM_TestAll.py
1286 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1287 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1288 RaiseIfFailed("MakeMarker", self.BasicOp)
1289 anObj.SetParameters(Parameters)
1292 ## Create a local coordinate system from shape.
1293 # @param theShape The initial shape to detect the coordinate system.
1294 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1296 # @ref tui_creation_lcs "Example"
1297 def MakeMarkerFromShape(self, theShape):
1299 Create a local coordinate system from shape.
1302 theShape The initial shape to detect the coordinate system.
1305 New GEOM.GEOM_Object, containing the created coordinate system.
1307 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1308 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1311 ## Create a local coordinate system from point and two vectors.
1312 # @param theOrigin Point of coordinate system origin.
1313 # @param theXVec Vector of X direction
1314 # @param theYVec Vector of Y direction
1315 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1317 # @ref tui_creation_lcs "Example"
1318 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1320 Create a local coordinate system from point and two vectors.
1323 theOrigin Point of coordinate system origin.
1324 theXVec Vector of X direction
1325 theYVec Vector of Y direction
1328 New GEOM.GEOM_Object, containing the created coordinate system.
1331 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1332 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1335 # end of l3_basic_go
1338 ## @addtogroup l4_curves
1341 ## Create an arc of circle, passing through three given points.
1342 # @param thePnt1 Start point of the arc.
1343 # @param thePnt2 Middle point of the arc.
1344 # @param thePnt3 End point of the arc.
1345 # @return New GEOM.GEOM_Object, containing the created arc.
1347 # @ref swig_MakeArc "Example"
1348 def MakeArc(self,thePnt1, thePnt2, thePnt3):
1350 Create an arc of circle, passing through three given points.
1353 thePnt1 Start point of the arc.
1354 thePnt2 Middle point of the arc.
1355 thePnt3 End point of the arc.
1358 New GEOM.GEOM_Object, containing the created arc.
1360 # Example: see GEOM_TestAll.py
1361 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1362 RaiseIfFailed("MakeArc", self.CurvesOp)
1365 ## Create an arc of circle from a center and 2 points.
1366 # @param thePnt1 Center of the arc
1367 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1368 # @param thePnt3 End point of the arc (Gives also a direction)
1369 # @param theSense Orientation of the arc
1370 # @return New GEOM.GEOM_Object, containing the created arc.
1372 # @ref swig_MakeArc "Example"
1373 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1375 Create an arc of circle from a center and 2 points.
1378 thePnt1 Center of the arc
1379 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1380 thePnt3 End point of the arc (Gives also a direction)
1381 theSense Orientation of the arc
1384 New GEOM.GEOM_Object, containing the created arc.
1386 # Example: see GEOM_TestAll.py
1387 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1388 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1391 ## Create an arc of ellipse, of center and two points.
1392 # @param theCenter Center of the arc.
1393 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1394 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1395 # @return New GEOM.GEOM_Object, containing the created arc.
1397 # @ref swig_MakeArc "Example"
1398 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1400 Create an arc of ellipse, of center and two points.
1403 theCenter Center of the arc.
1404 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1405 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1408 New GEOM.GEOM_Object, containing the created arc.
1410 # Example: see GEOM_TestAll.py
1411 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1412 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1415 ## Create a circle with given center, normal vector and radius.
1416 # @param thePnt Circle center.
1417 # @param theVec Vector, normal to the plane of the circle.
1418 # @param theR Circle radius.
1419 # @return New GEOM.GEOM_Object, containing the created circle.
1421 # @ref tui_creation_circle "Example"
1422 def MakeCircle(self, thePnt, theVec, theR):
1424 Create a circle with given center, normal vector and radius.
1427 thePnt Circle center.
1428 theVec Vector, normal to the plane of the circle.
1432 New GEOM.GEOM_Object, containing the created circle.
1434 # Example: see GEOM_TestAll.py
1435 theR, Parameters = ParseParameters(theR)
1436 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1437 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1438 anObj.SetParameters(Parameters)
1441 ## Create a circle with given radius.
1442 # Center of the circle will be in the origin of global
1443 # coordinate system and normal vector will be codirected with Z axis
1444 # @param theR Circle radius.
1445 # @return New GEOM.GEOM_Object, containing the created circle.
1446 def MakeCircleR(self, theR):
1448 Create a circle with given radius.
1449 Center of the circle will be in the origin of global
1450 coordinate system and normal vector will be codirected with Z axis
1456 New GEOM.GEOM_Object, containing the created circle.
1458 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1459 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1462 ## Create a circle, passing through three given points
1463 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1464 # @return New GEOM.GEOM_Object, containing the created circle.
1466 # @ref tui_creation_circle "Example"
1467 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1469 Create a circle, passing through three given points
1472 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1475 New GEOM.GEOM_Object, containing the created circle.
1477 # Example: see GEOM_TestAll.py
1478 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1479 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1482 ## Create a circle, with given point1 as center,
1483 # passing through the point2 as radius and laying in the plane,
1484 # defined by all three given points.
1485 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1486 # @return New GEOM.GEOM_Object, containing the created circle.
1488 # @ref swig_MakeCircle "Example"
1489 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1491 Create a circle, with given point1 as center,
1492 passing through the point2 as radius and laying in the plane,
1493 defined by all three given points.
1496 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1499 New GEOM.GEOM_Object, containing the created circle.
1501 # Example: see GEOM_example6.py
1502 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1503 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1506 ## Create an ellipse with given center, normal vector and radiuses.
1507 # @param thePnt Ellipse center.
1508 # @param theVec Vector, normal to the plane of the ellipse.
1509 # @param theRMajor Major ellipse radius.
1510 # @param theRMinor Minor ellipse radius.
1511 # @param theVecMaj Vector, direction of the ellipse's main axis.
1512 # @return New GEOM.GEOM_Object, containing the created ellipse.
1514 # @ref tui_creation_ellipse "Example"
1515 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1517 Create an ellipse with given center, normal vector and radiuses.
1520 thePnt Ellipse center.
1521 theVec Vector, normal to the plane of the ellipse.
1522 theRMajor Major ellipse radius.
1523 theRMinor Minor ellipse radius.
1524 theVecMaj Vector, direction of the ellipse's main axis.
1527 New GEOM.GEOM_Object, containing the created ellipse.
1529 # Example: see GEOM_TestAll.py
1530 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1531 if theVecMaj is not None:
1532 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1534 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1536 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1537 anObj.SetParameters(Parameters)
1540 ## Create an ellipse with given radiuses.
1541 # Center of the ellipse will be in the origin of global
1542 # coordinate system and normal vector will be codirected with Z axis
1543 # @param theRMajor Major ellipse radius.
1544 # @param theRMinor Minor ellipse radius.
1545 # @return New GEOM.GEOM_Object, containing the created ellipse.
1546 def MakeEllipseRR(self, theRMajor, theRMinor):
1548 Create an ellipse with given radiuses.
1549 Center of the ellipse will be in the origin of global
1550 coordinate system and normal vector will be codirected with Z axis
1553 theRMajor Major ellipse radius.
1554 theRMinor Minor ellipse radius.
1557 New GEOM.GEOM_Object, containing the created ellipse.
1559 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1560 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1563 ## Create a polyline on the set of points.
1564 # @param thePoints Sequence of points for the polyline.
1565 # @param theIsClosed If True, build a closed wire.
1566 # @return New GEOM.GEOM_Object, containing the created polyline.
1568 # @ref tui_creation_curve "Example"
1569 def MakePolyline(self, thePoints, theIsClosed=False):
1571 Create a polyline on the set of points.
1574 thePoints Sequence of points for the polyline.
1575 theIsClosed If True, build a closed wire.
1578 New GEOM.GEOM_Object, containing the created polyline.
1580 # Example: see GEOM_TestAll.py
1581 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1582 RaiseIfFailed("MakePolyline", self.CurvesOp)
1585 ## Create bezier curve on the set of points.
1586 # @param thePoints Sequence of points for the bezier curve.
1587 # @param theIsClosed If True, build a closed curve.
1588 # @return New GEOM.GEOM_Object, containing the created bezier curve.
1590 # @ref tui_creation_curve "Example"
1591 def MakeBezier(self, thePoints, theIsClosed=False):
1593 Create bezier curve on the set of points.
1596 thePoints Sequence of points for the bezier curve.
1597 theIsClosed If True, build a closed curve.
1600 New GEOM.GEOM_Object, containing the created bezier curve.
1602 # Example: see GEOM_TestAll.py
1603 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1604 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1607 ## Create B-Spline curve on the set of points.
1608 # @param thePoints Sequence of points for the B-Spline curve.
1609 # @param theIsClosed If True, build a closed curve.
1610 # @param theDoReordering If TRUE, the algo does not follow the order of
1611 # \a thePoints but searches for the closest vertex.
1612 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1614 # @ref tui_creation_curve "Example"
1615 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1617 Create B-Spline curve on the set of points.
1620 thePoints Sequence of points for the B-Spline curve.
1621 theIsClosed If True, build a closed curve.
1622 theDoReordering If True, the algo does not follow the order of
1623 thePoints but searches for the closest vertex.
1626 New GEOM.GEOM_Object, containing the created B-Spline curve.
1628 # Example: see GEOM_TestAll.py
1629 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1630 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1634 ## Creates a curve using the parametric definition of the basic points.
1635 # @param thexExpr parametric equation of the coordinates X.
1636 # @param theyExpr parametric equation of the coordinates Y.
1637 # @param thezExpr parametric equation of the coordinates Z.
1638 # @param theParamMin the minimal value of the parameter.
1639 # @param theParamMax the maximum value of the parameter.
1640 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1641 # @param theCurveType the type of the curve.
1642 # @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.
1643 # @return New GEOM.GEOM_Object, containing the created curve.
1645 # @ref tui_creation_curve "Example"
1646 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1647 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1649 Creates a curve using the parametric definition of the basic points.
1652 thexExpr parametric equation of the coordinates X.
1653 theyExpr parametric equation of the coordinates Y.
1654 thezExpr parametric equation of the coordinates Z.
1655 theParamMin the minimal value of the parameter.
1656 theParamMax the maximum value of the parameter.
1657 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1658 theCurveType the type of the curve.
1659 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1660 method is used which can lead to a bug.
1663 New GEOM.GEOM_Object, containing the created curve.
1665 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1667 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1669 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1670 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1671 anObj.SetParameters(Parameters)
1679 ## @addtogroup l3_sketcher
1682 ## Create a sketcher (wire or face), following the textual description,
1683 # passed through <VAR>theCommand</VAR> argument. \n
1684 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1685 # Format of the description string have to be the following:
1687 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1690 # - x1, y1 are coordinates of the first sketcher point (zero by default),
1692 # - "R angle" : Set the direction by angle
1693 # - "D dx dy" : Set the direction by DX & DY
1696 # - "TT x y" : Create segment by point at X & Y
1697 # - "T dx dy" : Create segment by point with DX & DY
1698 # - "L length" : Create segment by direction & Length
1699 # - "IX x" : Create segment by direction & Intersect. X
1700 # - "IY y" : Create segment by direction & Intersect. Y
1703 # - "C radius length" : Create arc by direction, radius and length(in degree)
1704 # - "AA x y": Create arc by point at X & Y
1705 # - "A dx dy" : Create arc by point with DX & DY
1706 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1707 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1708 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1709 # - "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)
1716 # - Flag1 (= reverse) is 0 or 2 ...
1717 # - if 0 the drawn arc is the one of lower angle (< Pi)
1718 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1721 # - Flag2 (= control tolerance) is 0 or 1 ...
1722 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1723 # - if 1 the wire is built only if the end point is on the arc
1724 # with a tolerance of 10^-7 on the distance else the creation fails
1726 # @param theCommand String, defining the sketcher in local
1727 # coordinates of the working plane.
1728 # @param theWorkingPlane Nine double values, defining origin,
1729 # OZ and OX directions of the working plane.
1730 # @return New GEOM.GEOM_Object, containing the created wire.
1732 # @ref tui_sketcher_page "Example"
1733 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1735 Create a sketcher (wire or face), following the textual description, passed
1736 through theCommand argument.
1737 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1738 Format of the description string have to be the following:
1739 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1741 - x1, y1 are coordinates of the first sketcher point (zero by default),
1743 - "R angle" : Set the direction by angle
1744 - "D dx dy" : Set the direction by DX & DY
1746 - "TT x y" : Create segment by point at X & Y
1747 - "T dx dy" : Create segment by point with DX & DY
1748 - "L length" : Create segment by direction & Length
1749 - "IX x" : Create segment by direction & Intersect. X
1750 - "IY y" : Create segment by direction & Intersect. Y
1752 - "C radius length" : Create arc by direction, radius and length(in degree)
1753 - "AA x y": Create arc by point at X & Y
1754 - "A dx dy" : Create arc by point with DX & DY
1755 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1756 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1757 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1758 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1760 - "WW" : Close Wire (to finish)
1761 - "WF" : Close Wire and build face (to finish)
1763 - Flag1 (= reverse) is 0 or 2 ...
1764 - if 0 the drawn arc is the one of lower angle (< Pi)
1765 - if 2 the drawn arc ius the one of greater angle (> Pi)
1767 - Flag2 (= control tolerance) is 0 or 1 ...
1768 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1769 - if 1 the wire is built only if the end point is on the arc
1770 with a tolerance of 10^-7 on the distance else the creation fails
1773 theCommand String, defining the sketcher in local
1774 coordinates of the working plane.
1775 theWorkingPlane Nine double values, defining origin,
1776 OZ and OX directions of the working plane.
1779 New GEOM.GEOM_Object, containing the created wire.
1781 # Example: see GEOM_TestAll.py
1782 theCommand,Parameters = ParseSketcherCommand(theCommand)
1783 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1784 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1785 anObj.SetParameters(Parameters)
1788 ## Create a sketcher (wire or face), following the textual description,
1789 # passed through <VAR>theCommand</VAR> argument. \n
1790 # For format of the description string see MakeSketcher() method.\n
1791 # @param theCommand String, defining the sketcher in local
1792 # coordinates of the working plane.
1793 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1794 # @return New GEOM.GEOM_Object, containing the created wire.
1796 # @ref tui_sketcher_page "Example"
1797 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1799 Create a sketcher (wire or face), following the textual description,
1800 passed through theCommand argument.
1801 For format of the description string see geompy.MakeSketcher() method.
1804 theCommand String, defining the sketcher in local
1805 coordinates of the working plane.
1806 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1809 New GEOM.GEOM_Object, containing the created wire.
1811 theCommand,Parameters = ParseSketcherCommand(theCommand)
1812 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1813 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1814 anObj.SetParameters(Parameters)
1817 ## Create a sketcher wire, following the numerical description,
1818 # passed through <VAR>theCoordinates</VAR> argument. \n
1819 # @param theCoordinates double values, defining points to create a wire,
1821 # @return New GEOM.GEOM_Object, containing the created wire.
1823 # @ref tui_3dsketcher_page "Example"
1824 def Make3DSketcher(self, theCoordinates):
1826 Create a sketcher wire, following the numerical description,
1827 passed through theCoordinates argument.
1830 theCoordinates double values, defining points to create a wire,
1834 New GEOM_Object, containing the created wire.
1836 theCoordinates,Parameters = ParseParameters(theCoordinates)
1837 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1838 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1839 anObj.SetParameters(Parameters)
1842 ## Obtain a 3D sketcher interface
1843 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
1845 # @ref tui_3dsketcher_page "Example"
1846 def Sketcher3D (self):
1848 Obtain a 3D sketcher interface.
1851 sk = geompy.Sketcher3D()
1852 sk.addPointsAbsolute(0,0,0, 70,0,0)
1853 sk.addPointsRelative(0, 0, 130)
1854 sk.addPointAnglesLength("OXY", 50, 0, 100)
1855 sk.addPointAnglesLength("OXZ", 30, 80, 130)
1857 a3D_Sketcher_1 = sk.wire()
1859 sk = Sketcher3D (self)
1862 # end of l3_sketcher
1865 ## @addtogroup l3_3d_primitives
1868 ## Create a box by coordinates of two opposite vertices.
1870 # @param x1,y1,z1 double values, defining first point it.
1871 # @param x2,y2,z2 double values, defining first point it.
1873 # @return New GEOM.GEOM_Object, containing the created box.
1874 # @ref tui_creation_box "Example"
1875 def MakeBox (self, x1,y1,z1, x2,y2,z2):
1877 Create a box by coordinates of two opposite vertices.
1880 x1,y1,z1 double values, defining first point.
1881 x2,y2,z2 double values, defining second point.
1884 New GEOM.GEOM_Object, containing the created box.
1886 # Example: see GEOM_TestAll.py
1887 pnt1 = self.MakeVertex(x1,y1,z1)
1888 pnt2 = self.MakeVertex(x2,y2,z2)
1889 return self.MakeBoxTwoPnt(pnt1,pnt2)
1891 ## Create a box with specified dimensions along the coordinate axes
1892 # and with edges, parallel to the coordinate axes.
1893 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1894 # @param theDX Length of Box edges, parallel to OX axis.
1895 # @param theDY Length of Box edges, parallel to OY axis.
1896 # @param theDZ Length of Box edges, parallel to OZ axis.
1897 # @return New GEOM.GEOM_Object, containing the created box.
1899 # @ref tui_creation_box "Example"
1900 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1902 Create a box with specified dimensions along the coordinate axes
1903 and with edges, parallel to the coordinate axes.
1904 Center of the box will be at point (DX/2, DY/2, DZ/2).
1907 theDX Length of Box edges, parallel to OX axis.
1908 theDY Length of Box edges, parallel to OY axis.
1909 theDZ Length of Box edges, parallel to OZ axis.
1912 New GEOM.GEOM_Object, containing the created box.
1914 # Example: see GEOM_TestAll.py
1915 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1916 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1917 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1918 anObj.SetParameters(Parameters)
1921 ## Create a box with two specified opposite vertices,
1922 # and with edges, parallel to the coordinate axes
1923 # @param thePnt1 First of two opposite vertices.
1924 # @param thePnt2 Second of two opposite vertices.
1925 # @return New GEOM.GEOM_Object, containing the created box.
1927 # @ref tui_creation_box "Example"
1928 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1930 Create a box with two specified opposite vertices,
1931 and with edges, parallel to the coordinate axes
1934 thePnt1 First of two opposite vertices.
1935 thePnt2 Second of two opposite vertices.
1938 New GEOM.GEOM_Object, containing the created box.
1940 # Example: see GEOM_TestAll.py
1941 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1942 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1945 ## Create a face with specified dimensions with edges parallel to coordinate axes.
1946 # @param theH height of Face.
1947 # @param theW width of Face.
1948 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1949 # @return New GEOM.GEOM_Object, containing the created face.
1951 # @ref tui_creation_face "Example"
1952 def MakeFaceHW(self,theH, theW, theOrientation):
1954 Create a face with specified dimensions with edges parallel to coordinate axes.
1957 theH height of Face.
1959 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1962 New GEOM.GEOM_Object, containing the created face.
1964 # Example: see GEOM_TestAll.py
1965 theH,theW,Parameters = ParseParameters(theH, theW)
1966 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1967 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1968 anObj.SetParameters(Parameters)
1971 ## Create a face from another plane and two sizes,
1972 # vertical size and horisontal size.
1973 # @param theObj Normale vector to the creating face or
1975 # @param theH Height (vertical size).
1976 # @param theW Width (horisontal size).
1977 # @return New GEOM.GEOM_Object, containing the created face.
1979 # @ref tui_creation_face "Example"
1980 def MakeFaceObjHW(self, theObj, theH, theW):
1982 Create a face from another plane and two sizes,
1983 vertical size and horisontal size.
1986 theObj Normale vector to the creating face or
1988 theH Height (vertical size).
1989 theW Width (horisontal size).
1992 New GEOM_Object, containing the created face.
1994 # Example: see GEOM_TestAll.py
1995 theH,theW,Parameters = ParseParameters(theH, theW)
1996 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1997 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1998 anObj.SetParameters(Parameters)
2001 ## Create a disk with given center, normal vector and radius.
2002 # @param thePnt Disk center.
2003 # @param theVec Vector, normal to the plane of the disk.
2004 # @param theR Disk radius.
2005 # @return New GEOM.GEOM_Object, containing the created disk.
2007 # @ref tui_creation_disk "Example"
2008 def MakeDiskPntVecR(self,thePnt, theVec, theR):
2010 Create a disk with given center, normal vector and radius.
2014 theVec Vector, normal to the plane of the disk.
2018 New GEOM.GEOM_Object, containing the created disk.
2020 # Example: see GEOM_TestAll.py
2021 theR,Parameters = ParseParameters(theR)
2022 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2023 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2024 anObj.SetParameters(Parameters)
2027 ## Create a disk, passing through three given points
2028 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2029 # @return New GEOM.GEOM_Object, containing the created disk.
2031 # @ref tui_creation_disk "Example"
2032 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
2034 Create a disk, passing through three given points
2037 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2040 New GEOM.GEOM_Object, containing the created disk.
2042 # Example: see GEOM_TestAll.py
2043 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2044 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2047 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2048 # @param theR Radius of Face.
2049 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2050 # @return New GEOM.GEOM_Object, containing the created disk.
2052 # @ref tui_creation_face "Example"
2053 def MakeDiskR(self,theR, theOrientation):
2055 Create a disk with specified dimensions along OX-OY coordinate axes.
2058 theR Radius of Face.
2059 theOrientation set the orientation belong axis OXY or OYZ or OZX
2062 New GEOM.GEOM_Object, containing the created disk.
2065 Disk3 = geompy.MakeDiskR(100., 1)
2067 # Example: see GEOM_TestAll.py
2068 theR,Parameters = ParseParameters(theR)
2069 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2070 RaiseIfFailed("MakeDiskR", self.PrimOp)
2071 anObj.SetParameters(Parameters)
2074 ## Create a cylinder with given base point, axis, radius and height.
2075 # @param thePnt Central point of cylinder base.
2076 # @param theAxis Cylinder axis.
2077 # @param theR Cylinder radius.
2078 # @param theH Cylinder height.
2079 # @return New GEOM.GEOM_Object, containing the created cylinder.
2081 # @ref tui_creation_cylinder "Example"
2082 def MakeCylinder(self,thePnt, theAxis, theR, theH):
2084 Create a cylinder with given base point, axis, radius and height.
2087 thePnt Central point of cylinder base.
2088 theAxis Cylinder axis.
2089 theR Cylinder radius.
2090 theH Cylinder height.
2093 New GEOM.GEOM_Object, containing the created cylinder.
2095 # Example: see GEOM_TestAll.py
2096 theR,theH,Parameters = ParseParameters(theR, theH)
2097 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2098 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2099 anObj.SetParameters(Parameters)
2102 ## Create a cylinder with given radius and height at
2103 # the origin of coordinate system. Axis of the cylinder
2104 # will be collinear to the OZ axis of the coordinate system.
2105 # @param theR Cylinder radius.
2106 # @param theH Cylinder height.
2107 # @return New GEOM.GEOM_Object, containing the created cylinder.
2109 # @ref tui_creation_cylinder "Example"
2110 def MakeCylinderRH(self,theR, theH):
2112 Create a cylinder with given radius and height at
2113 the origin of coordinate system. Axis of the cylinder
2114 will be collinear to the OZ axis of the coordinate system.
2117 theR Cylinder radius.
2118 theH Cylinder height.
2121 New GEOM.GEOM_Object, containing the created cylinder.
2123 # Example: see GEOM_TestAll.py
2124 theR,theH,Parameters = ParseParameters(theR, theH)
2125 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2126 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2127 anObj.SetParameters(Parameters)
2130 ## Create a sphere with given center and radius.
2131 # @param thePnt Sphere center.
2132 # @param theR Sphere radius.
2133 # @return New GEOM.GEOM_Object, containing the created sphere.
2135 # @ref tui_creation_sphere "Example"
2136 def MakeSpherePntR(self, thePnt, theR):
2138 Create a sphere with given center and radius.
2141 thePnt Sphere center.
2145 New GEOM.GEOM_Object, containing the created sphere.
2147 # Example: see GEOM_TestAll.py
2148 theR,Parameters = ParseParameters(theR)
2149 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2150 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2151 anObj.SetParameters(Parameters)
2154 ## Create a sphere with given center and radius.
2155 # @param x,y,z Coordinates of sphere center.
2156 # @param theR Sphere radius.
2157 # @return New GEOM.GEOM_Object, containing the created sphere.
2159 # @ref tui_creation_sphere "Example"
2160 def MakeSphere(self, x, y, z, theR):
2162 Create a sphere with given center and radius.
2165 x,y,z Coordinates of sphere center.
2169 New GEOM.GEOM_Object, containing the created sphere.
2171 # Example: see GEOM_TestAll.py
2172 point = self.MakeVertex(x, y, z)
2173 anObj = self.MakeSpherePntR(point, theR)
2176 ## Create a sphere with given radius at the origin of coordinate system.
2177 # @param theR Sphere radius.
2178 # @return New GEOM.GEOM_Object, containing the created sphere.
2180 # @ref tui_creation_sphere "Example"
2181 def MakeSphereR(self, theR):
2183 Create a sphere with given radius at the origin of coordinate system.
2189 New GEOM.GEOM_Object, containing the created sphere.
2191 # Example: see GEOM_TestAll.py
2192 theR,Parameters = ParseParameters(theR)
2193 anObj = self.PrimOp.MakeSphereR(theR)
2194 RaiseIfFailed("MakeSphereR", self.PrimOp)
2195 anObj.SetParameters(Parameters)
2198 ## Create a cone with given base point, axis, height and radiuses.
2199 # @param thePnt Central point of the first cone base.
2200 # @param theAxis Cone axis.
2201 # @param theR1 Radius of the first cone base.
2202 # @param theR2 Radius of the second cone base.
2203 # \note If both radiuses are non-zero, the cone will be truncated.
2204 # \note If the radiuses are equal, a cylinder will be created instead.
2205 # @param theH Cone height.
2206 # @return New GEOM.GEOM_Object, containing the created cone.
2208 # @ref tui_creation_cone "Example"
2209 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2211 Create a cone with given base point, axis, height and radiuses.
2214 thePnt Central point of the first cone base.
2216 theR1 Radius of the first cone base.
2217 theR2 Radius of the second cone base.
2221 If both radiuses are non-zero, the cone will be truncated.
2222 If the radiuses are equal, a cylinder will be created instead.
2225 New GEOM.GEOM_Object, containing the created cone.
2227 # Example: see GEOM_TestAll.py
2228 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2229 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2230 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2231 anObj.SetParameters(Parameters)
2234 ## Create a cone with given height and radiuses at
2235 # the origin of coordinate system. Axis of the cone will
2236 # be collinear to the OZ axis of the coordinate system.
2237 # @param theR1 Radius of the first cone base.
2238 # @param theR2 Radius of the second cone base.
2239 # \note If both radiuses are non-zero, the cone will be truncated.
2240 # \note If the radiuses are equal, a cylinder will be created instead.
2241 # @param theH Cone height.
2242 # @return New GEOM.GEOM_Object, containing the created cone.
2244 # @ref tui_creation_cone "Example"
2245 def MakeConeR1R2H(self,theR1, theR2, theH):
2247 Create a cone with given height and radiuses at
2248 the origin of coordinate system. Axis of the cone will
2249 be collinear to the OZ axis of the coordinate system.
2252 theR1 Radius of the first cone base.
2253 theR2 Radius of the second cone base.
2257 If both radiuses are non-zero, the cone will be truncated.
2258 If the radiuses are equal, a cylinder will be created instead.
2261 New GEOM.GEOM_Object, containing the created cone.
2263 # Example: see GEOM_TestAll.py
2264 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2265 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2266 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2267 anObj.SetParameters(Parameters)
2270 ## Create a torus with given center, normal vector and radiuses.
2271 # @param thePnt Torus central point.
2272 # @param theVec Torus axis of symmetry.
2273 # @param theRMajor Torus major radius.
2274 # @param theRMinor Torus minor radius.
2275 # @return New GEOM.GEOM_Object, containing the created torus.
2277 # @ref tui_creation_torus "Example"
2278 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2280 Create a torus with given center, normal vector and radiuses.
2283 thePnt Torus central point.
2284 theVec Torus axis of symmetry.
2285 theRMajor Torus major radius.
2286 theRMinor Torus minor radius.
2289 New GEOM.GEOM_Object, containing the created torus.
2291 # Example: see GEOM_TestAll.py
2292 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2293 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2294 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2295 anObj.SetParameters(Parameters)
2298 ## Create a torus with given radiuses at the origin of coordinate system.
2299 # @param theRMajor Torus major radius.
2300 # @param theRMinor Torus minor radius.
2301 # @return New GEOM.GEOM_Object, containing the created torus.
2303 # @ref tui_creation_torus "Example"
2304 def MakeTorusRR(self, theRMajor, theRMinor):
2306 Create a torus with given radiuses at the origin of coordinate system.
2309 theRMajor Torus major radius.
2310 theRMinor Torus minor radius.
2313 New GEOM.GEOM_Object, containing the created torus.
2315 # Example: see GEOM_TestAll.py
2316 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2317 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2318 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2319 anObj.SetParameters(Parameters)
2322 # end of l3_3d_primitives
2325 ## @addtogroup l3_complex
2328 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2329 # @param theBase Base shape to be extruded.
2330 # @param thePoint1 First end of extrusion vector.
2331 # @param thePoint2 Second end of extrusion vector.
2332 # @param theScaleFactor Use it to make prism with scaled second base.
2333 # Nagative value means not scaled second base.
2334 # @return New GEOM.GEOM_Object, containing the created prism.
2336 # @ref tui_creation_prism "Example"
2337 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2339 Create a shape by extrusion of the base shape along a vector, defined by two points.
2342 theBase Base shape to be extruded.
2343 thePoint1 First end of extrusion vector.
2344 thePoint2 Second end of extrusion vector.
2345 theScaleFactor Use it to make prism with scaled second base.
2346 Nagative value means not scaled second base.
2349 New GEOM.GEOM_Object, containing the created prism.
2351 # Example: see GEOM_TestAll.py
2354 if theScaleFactor > 0:
2355 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2356 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2358 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2359 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2360 anObj.SetParameters(Parameters)
2363 ## Create a shape by extrusion of the base shape along a
2364 # vector, defined by two points, in 2 Ways (forward/backward).
2365 # @param theBase Base shape to be extruded.
2366 # @param thePoint1 First end of extrusion vector.
2367 # @param thePoint2 Second end of extrusion vector.
2368 # @return New GEOM.GEOM_Object, containing the created prism.
2370 # @ref tui_creation_prism "Example"
2371 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2373 Create a shape by extrusion of the base shape along a
2374 vector, defined by two points, in 2 Ways (forward/backward).
2377 theBase Base shape to be extruded.
2378 thePoint1 First end of extrusion vector.
2379 thePoint2 Second end of extrusion vector.
2382 New GEOM.GEOM_Object, containing the created prism.
2384 # Example: see GEOM_TestAll.py
2385 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2386 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2389 ## Create a shape by extrusion of the base shape along the vector,
2390 # i.e. all the space, transfixed by the base shape during its translation
2391 # along the vector on the given distance.
2392 # @param theBase Base shape to be extruded.
2393 # @param theVec Direction of extrusion.
2394 # @param theH Prism dimension along theVec.
2395 # @param theScaleFactor Use it to make prism with scaled second base.
2396 # Negative value means not scaled second base.
2397 # @return New GEOM.GEOM_Object, containing the created prism.
2399 # @ref tui_creation_prism "Example"
2400 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2402 Create a shape by extrusion of the base shape along the vector,
2403 i.e. all the space, transfixed by the base shape during its translation
2404 along the vector on the given distance.
2407 theBase Base shape to be extruded.
2408 theVec Direction of extrusion.
2409 theH Prism dimension along theVec.
2410 theScaleFactor Use it to make prism with scaled second base.
2411 Negative value means not scaled second base.
2414 New GEOM.GEOM_Object, containing the created prism.
2416 # Example: see GEOM_TestAll.py
2419 if theScaleFactor > 0:
2420 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2421 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2423 theH,Parameters = ParseParameters(theH)
2424 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2425 RaiseIfFailed("MakePrismVecH", self.PrimOp)
2426 anObj.SetParameters(Parameters)
2429 ## Create a shape by extrusion of the base shape along the vector,
2430 # i.e. all the space, transfixed by the base shape during its translation
2431 # along the vector on the given distance in 2 Ways (forward/backward).
2432 # @param theBase Base shape to be extruded.
2433 # @param theVec Direction of extrusion.
2434 # @param theH Prism dimension along theVec in forward direction.
2435 # @return New GEOM.GEOM_Object, containing the created prism.
2437 # @ref tui_creation_prism "Example"
2438 def MakePrismVecH2Ways(self, theBase, theVec, theH):
2440 Create a shape by extrusion of the base shape along the vector,
2441 i.e. all the space, transfixed by the base shape during its translation
2442 along the vector on the given distance in 2 Ways (forward/backward).
2445 theBase Base shape to be extruded.
2446 theVec Direction of extrusion.
2447 theH Prism dimension along theVec in forward direction.
2450 New GEOM.GEOM_Object, containing the created prism.
2452 # Example: see GEOM_TestAll.py
2453 theH,Parameters = ParseParameters(theH)
2454 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2455 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2456 anObj.SetParameters(Parameters)
2459 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2460 # @param theBase Base shape to be extruded.
2461 # @param theDX, theDY, theDZ Directions of extrusion.
2462 # @param theScaleFactor Use it to make prism with scaled second base.
2463 # Nagative value means not scaled second base.
2464 # @return New GEOM.GEOM_Object, containing the created prism.
2466 # @ref tui_creation_prism "Example"
2467 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2469 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2472 theBase Base shape to be extruded.
2473 theDX, theDY, theDZ Directions of extrusion.
2474 theScaleFactor Use it to make prism with scaled second base.
2475 Nagative value means not scaled second base.
2478 New GEOM.GEOM_Object, containing the created prism.
2480 # Example: see GEOM_TestAll.py
2483 if theScaleFactor > 0:
2484 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2485 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2487 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2488 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2489 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2490 anObj.SetParameters(Parameters)
2493 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2494 # i.e. all the space, transfixed by the base shape during its translation
2495 # along the vector on the given distance in 2 Ways (forward/backward).
2496 # @param theBase Base shape to be extruded.
2497 # @param theDX, theDY, theDZ Directions of extrusion.
2498 # @return New GEOM.GEOM_Object, containing the created prism.
2500 # @ref tui_creation_prism "Example"
2501 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2503 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2504 i.e. all the space, transfixed by the base shape during its translation
2505 along the vector on the given distance in 2 Ways (forward/backward).
2508 theBase Base shape to be extruded.
2509 theDX, theDY, theDZ Directions of extrusion.
2512 New GEOM.GEOM_Object, containing the created prism.
2514 # Example: see GEOM_TestAll.py
2515 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2516 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2517 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2518 anObj.SetParameters(Parameters)
2521 ## Create a shape by revolution of the base shape around the axis
2522 # on the given angle, i.e. all the space, transfixed by the base
2523 # shape during its rotation around the axis on the given angle.
2524 # @param theBase Base shape to be rotated.
2525 # @param theAxis Rotation axis.
2526 # @param theAngle Rotation angle in radians.
2527 # @return New GEOM.GEOM_Object, containing the created revolution.
2529 # @ref tui_creation_revolution "Example"
2530 def MakeRevolution(self, theBase, theAxis, theAngle):
2532 Create a shape by revolution of the base shape around the axis
2533 on the given angle, i.e. all the space, transfixed by the base
2534 shape during its rotation around the axis on the given angle.
2537 theBase Base shape to be rotated.
2538 theAxis Rotation axis.
2539 theAngle Rotation angle in radians.
2542 New GEOM.GEOM_Object, containing the created revolution.
2544 # Example: see GEOM_TestAll.py
2545 theAngle,Parameters = ParseParameters(theAngle)
2546 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2547 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2548 anObj.SetParameters(Parameters)
2551 ## Create a shape by revolution of the base shape around the axis
2552 # on the given angle, i.e. all the space, transfixed by the base
2553 # shape during its rotation around the axis on the given angle in
2554 # both directions (forward/backward)
2555 # @param theBase Base shape to be rotated.
2556 # @param theAxis Rotation axis.
2557 # @param theAngle Rotation angle in radians.
2558 # @return New GEOM.GEOM_Object, containing the created revolution.
2560 # @ref tui_creation_revolution "Example"
2561 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2563 Create a shape by revolution of the base shape around the axis
2564 on the given angle, i.e. all the space, transfixed by the base
2565 shape during its rotation around the axis on the given angle in
2566 both directions (forward/backward).
2569 theBase Base shape to be rotated.
2570 theAxis Rotation axis.
2571 theAngle Rotation angle in radians.
2574 New GEOM.GEOM_Object, containing the created revolution.
2576 theAngle,Parameters = ParseParameters(theAngle)
2577 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2578 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2579 anObj.SetParameters(Parameters)
2582 ## Create a filling from the given compound of contours.
2583 # @param theShape the compound of contours
2584 # @param theMinDeg a minimal degree of BSpline surface to create
2585 # @param theMaxDeg a maximal degree of BSpline surface to create
2586 # @param theTol2D a 2d tolerance to be reached
2587 # @param theTol3D a 3d tolerance to be reached
2588 # @param theNbIter a number of iteration of approximation algorithm
2589 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2590 # @param isApprox if True, BSpline curves are generated in the process
2591 # of surface construction. By default it is False, that means
2592 # the surface is created using given curves. The usage of
2593 # Approximation makes the algorithm work slower, but allows
2594 # building the surface for rather complex cases.
2595 # @return New GEOM.GEOM_Object, containing the created filling surface.
2597 # @ref tui_creation_filling "Example"
2598 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2599 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2601 Create a filling from the given compound of contours.
2604 theShape the compound of contours
2605 theMinDeg a minimal degree of BSpline surface to create
2606 theMaxDeg a maximal degree of BSpline surface to create
2607 theTol2D a 2d tolerance to be reached
2608 theTol3D a 3d tolerance to be reached
2609 theNbIter a number of iteration of approximation algorithm
2610 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2611 isApprox if True, BSpline curves are generated in the process
2612 of surface construction. By default it is False, that means
2613 the surface is created using given curves. The usage of
2614 Approximation makes the algorithm work slower, but allows
2615 building the surface for rather complex cases
2618 New GEOM.GEOM_Object, containing the created filling surface.
2621 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2623 # Example: see GEOM_TestAll.py
2624 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2625 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2626 theTol2D, theTol3D, theNbIter,
2627 theMethod, isApprox)
2628 RaiseIfFailed("MakeFilling", self.PrimOp)
2629 anObj.SetParameters(Parameters)
2633 ## Create a filling from the given compound of contours.
2634 # This method corresponds to MakeFilling with isApprox=True
2635 # @param theShape the compound of contours
2636 # @param theMinDeg a minimal degree of BSpline surface to create
2637 # @param theMaxDeg a maximal degree of BSpline surface to create
2638 # @param theTol3D a 3d tolerance to be reached
2639 # @return New GEOM.GEOM_Object, containing the created filling surface.
2641 # @ref tui_creation_filling "Example"
2642 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2644 Create a filling from the given compound of contours.
2645 This method corresponds to MakeFilling with isApprox=True
2648 theShape the compound of contours
2649 theMinDeg a minimal degree of BSpline surface to create
2650 theMaxDeg a maximal degree of BSpline surface to create
2651 theTol3D a 3d tolerance to be reached
2654 New GEOM.GEOM_Object, containing the created filling surface.
2657 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2659 # Example: see GEOM_TestAll.py
2660 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2661 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2662 0, theTol3D, 0, GEOM.FOM_Default, True)
2663 RaiseIfFailed("MakeFillingNew", self.PrimOp)
2664 anObj.SetParameters(Parameters)
2667 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2668 # @param theSeqSections - set of specified sections.
2669 # @param theModeSolid - mode defining building solid or shell
2670 # @param thePreci - precision 3D used for smoothing
2671 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2672 # @return New GEOM.GEOM_Object, containing the created shell or solid.
2674 # @ref swig_todo "Example"
2675 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2677 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2680 theSeqSections - set of specified sections.
2681 theModeSolid - mode defining building solid or shell
2682 thePreci - precision 3D used for smoothing
2683 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2686 New GEOM.GEOM_Object, containing the created shell or solid.
2688 # Example: see GEOM_TestAll.py
2689 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2690 RaiseIfFailed("MakeThruSections", self.PrimOp)
2693 ## Create a shape by extrusion of the base shape along
2694 # the path shape. The path shape can be a wire or an edge.
2695 # @param theBase Base shape to be extruded.
2696 # @param thePath Path shape to extrude the base shape along it.
2697 # @return New GEOM.GEOM_Object, containing the created pipe.
2699 # @ref tui_creation_pipe "Example"
2700 def MakePipe(self,theBase, thePath):
2702 Create a shape by extrusion of the base shape along
2703 the path shape. The path shape can be a wire or an edge.
2706 theBase Base shape to be extruded.
2707 thePath Path shape to extrude the base shape along it.
2710 New GEOM.GEOM_Object, containing the created pipe.
2712 # Example: see GEOM_TestAll.py
2713 anObj = self.PrimOp.MakePipe(theBase, thePath)
2714 RaiseIfFailed("MakePipe", self.PrimOp)
2717 ## Create a shape by extrusion of the profile shape along
2718 # the path shape. The path shape can be a wire or an edge.
2719 # the several profiles can be specified in the several locations of path.
2720 # @param theSeqBases - list of Bases shape to be extruded.
2721 # @param theLocations - list of locations on the path corresponding
2722 # specified list of the Bases shapes. Number of locations
2723 # should be equal to number of bases or list of locations can be empty.
2724 # @param thePath - Path shape to extrude the base shape along it.
2725 # @param theWithContact - the mode defining that the section is translated to be in
2726 # contact with the spine.
2727 # @param theWithCorrection - defining that the section is rotated to be
2728 # orthogonal to the spine tangent in the correspondent point
2729 # @return New GEOM.GEOM_Object, containing the created pipe.
2731 # @ref tui_creation_pipe_with_diff_sec "Example"
2732 def MakePipeWithDifferentSections(self, theSeqBases,
2733 theLocations, thePath,
2734 theWithContact, theWithCorrection):
2736 Create a shape by extrusion of the profile shape along
2737 the path shape. The path shape can be a wire or an edge.
2738 the several profiles can be specified in the several locations of path.
2741 theSeqBases - list of Bases shape to be extruded.
2742 theLocations - list of locations on the path corresponding
2743 specified list of the Bases shapes. Number of locations
2744 should be equal to number of bases or list of locations can be empty.
2745 thePath - Path shape to extrude the base shape along it.
2746 theWithContact - the mode defining that the section is translated to be in
2747 contact with the spine(0/1)
2748 theWithCorrection - defining that the section is rotated to be
2749 orthogonal to the spine tangent in the correspondent point (0/1)
2752 New GEOM.GEOM_Object, containing the created pipe.
2754 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2755 theLocations, thePath,
2756 theWithContact, theWithCorrection)
2757 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2760 ## Create a shape by extrusion of the profile shape along
2761 # the path shape. The path shape can be a wire or a edge.
2762 # the several profiles can be specified in the several locations of path.
2763 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
2764 # shell or face. If number of faces in neighbour sections
2765 # aren't coincided result solid between such sections will
2766 # be created using external boundaries of this shells.
2767 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2768 # This list is used for searching correspondences between
2769 # faces in the sections. Size of this list must be equal
2770 # to size of list of base shapes.
2771 # @param theLocations - list of locations on the path corresponding
2772 # specified list of the Bases shapes. Number of locations
2773 # should be equal to number of bases. First and last
2774 # locations must be coincided with first and last vertexes
2775 # of path correspondingly.
2776 # @param thePath - Path shape to extrude the base shape along it.
2777 # @param theWithContact - the mode defining that the section is translated to be in
2778 # contact with the spine.
2779 # @param theWithCorrection - defining that the section is rotated to be
2780 # orthogonal to the spine tangent in the correspondent point
2781 # @return New GEOM.GEOM_Object, containing the created solids.
2783 # @ref tui_creation_pipe_with_shell_sec "Example"
2784 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2785 theLocations, thePath,
2786 theWithContact, theWithCorrection):
2788 Create a shape by extrusion of the profile shape along
2789 the path shape. The path shape can be a wire or a edge.
2790 the several profiles can be specified in the several locations of path.
2793 theSeqBases - list of Bases shape to be extruded. Base shape must be
2794 shell or face. If number of faces in neighbour sections
2795 aren't coincided result solid between such sections will
2796 be created using external boundaries of this shells.
2797 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2798 This list is used for searching correspondences between
2799 faces in the sections. Size of this list must be equal
2800 to size of list of base shapes.
2801 theLocations - list of locations on the path corresponding
2802 specified list of the Bases shapes. Number of locations
2803 should be equal to number of bases. First and last
2804 locations must be coincided with first and last vertexes
2805 of path correspondingly.
2806 thePath - Path shape to extrude the base shape along it.
2807 theWithContact - the mode defining that the section is translated to be in
2808 contact with the spine (0/1)
2809 theWithCorrection - defining that the section is rotated to be
2810 orthogonal to the spine tangent in the correspondent point (0/1)
2813 New GEOM.GEOM_Object, containing the created solids.
2815 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2816 theLocations, thePath,
2817 theWithContact, theWithCorrection)
2818 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2821 ## Create a shape by extrusion of the profile shape along
2822 # the path shape. This function is used only for debug pipe
2823 # functionality - it is a version of function MakePipeWithShellSections()
2824 # which give a possibility to recieve information about
2825 # creating pipe between each pair of sections step by step.
2826 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2827 theLocations, thePath,
2828 theWithContact, theWithCorrection):
2830 Create a shape by extrusion of the profile shape along
2831 the path shape. This function is used only for debug pipe
2832 functionality - it is a version of previous function
2833 geompy.MakePipeWithShellSections() which give a possibility to
2834 recieve information about creating pipe between each pair of
2835 sections step by step.
2838 nbsect = len(theSeqBases)
2839 nbsubsect = len(theSeqSubBases)
2840 #print "nbsect = ",nbsect
2841 for i in range(1,nbsect):
2843 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2844 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2846 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2847 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2848 tmpLocations, thePath,
2849 theWithContact, theWithCorrection)
2850 if self.PrimOp.IsDone() == 0:
2851 print "Problems with pipe creation between ",i," and ",i+1," sections"
2852 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2855 print "Pipe between ",i," and ",i+1," sections is OK"
2860 resc = self.MakeCompound(res)
2861 #resc = self.MakeSewing(res, 0.001)
2862 #print "resc: ",resc
2865 ## Create solids between given sections
2866 # @param theSeqBases - list of sections (shell or face).
2867 # @param theLocations - list of corresponding vertexes
2868 # @return New GEOM.GEOM_Object, containing the created solids.
2870 # @ref tui_creation_pipe_without_path "Example"
2871 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2873 Create solids between given sections
2876 theSeqBases - list of sections (shell or face).
2877 theLocations - list of corresponding vertexes
2880 New GEOM.GEOM_Object, containing the created solids.
2882 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2883 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2886 ## Create a shape by extrusion of the base shape along
2887 # the path shape with constant bi-normal direction along the given vector.
2888 # The path shape can be a wire or an edge.
2889 # @param theBase Base shape to be extruded.
2890 # @param thePath Path shape to extrude the base shape along it.
2891 # @param theVec Vector defines a constant binormal direction to keep the
2892 # same angle beetween the direction and the sections
2893 # along the sweep surface.
2894 # @return New GEOM.GEOM_Object, containing the created pipe.
2896 # @ref tui_creation_pipe "Example"
2897 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2899 Create a shape by extrusion of the base shape along
2900 the path shape with constant bi-normal direction along the given vector.
2901 The path shape can be a wire or an edge.
2904 theBase Base shape to be extruded.
2905 thePath Path shape to extrude the base shape along it.
2906 theVec Vector defines a constant binormal direction to keep the
2907 same angle beetween the direction and the sections
2908 along the sweep surface.
2911 New GEOM.GEOM_Object, containing the created pipe.
2913 # Example: see GEOM_TestAll.py
2914 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2915 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2918 ## Build a middle path of a pipe-like shape.
2919 # The path shape can be a wire or an edge.
2920 # @param theShape It can be closed or unclosed pipe-like shell
2921 # or a pipe-like solid.
2922 # @param theBase1, theBase2 Two bases of the supposed pipe. This
2923 # should be wires or faces of theShape.
2924 # @note It is not assumed that exact or approximate copy of theShape
2925 # can be obtained by applying existing Pipe operation on the
2926 # resulting "Path" wire taking theBase1 as the base - it is not
2927 # always possible; though in some particular cases it might work
2928 # it is not guaranteed. Thus, RestorePath function should not be
2929 # considered as an exact reverse operation of the Pipe.
2930 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
2931 # source pipe's "path".
2933 # @ref tui_creation_pipe_path "Example"
2934 def RestorePath (self, theShape, theBase1, theBase2):
2936 Build a middle path of a pipe-like shape.
2937 The path shape can be a wire or an edge.
2940 theShape It can be closed or unclosed pipe-like shell
2941 or a pipe-like solid.
2942 theBase1, theBase2 Two bases of the supposed pipe. This
2943 should be wires or faces of theShape.
2946 New GEOM_Object, containing an edge or wire that represent
2949 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
2950 RaiseIfFailed("RestorePath", self.PrimOp)
2953 ## Build a middle path of a pipe-like shape.
2954 # The path shape can be a wire or an edge.
2955 # @param theShape It can be closed or unclosed pipe-like shell
2956 # or a pipe-like solid.
2957 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
2958 # should be lists of edges of theShape.
2959 # @note It is not assumed that exact or approximate copy of theShape
2960 # can be obtained by applying existing Pipe operation on the
2961 # resulting "Path" wire taking theBase1 as the base - it is not
2962 # always possible; though in some particular cases it might work
2963 # it is not guaranteed. Thus, RestorePath function should not be
2964 # considered as an exact reverse operation of the Pipe.
2965 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
2966 # source pipe's "path".
2968 # @ref tui_creation_pipe_path "Example"
2969 def RestorePathEdges (self, theShape, listEdges1, listEdges2):
2971 Build a middle path of a pipe-like shape.
2972 The path shape can be a wire or an edge.
2975 theShape It can be closed or unclosed pipe-like shell
2976 or a pipe-like solid.
2977 listEdges1, listEdges2 Two bases of the supposed pipe. This
2978 should be lists of edges of theShape.
2981 New GEOM_Object, containing an edge or wire that represent
2984 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
2985 RaiseIfFailed("RestorePath", self.PrimOp)
2991 ## @addtogroup l3_advanced
2994 ## Create a linear edge with specified ends.
2995 # @param thePnt1 Point for the first end of edge.
2996 # @param thePnt2 Point for the second end of edge.
2997 # @return New GEOM.GEOM_Object, containing the created edge.
2999 # @ref tui_creation_edge "Example"
3000 def MakeEdge(self,thePnt1, thePnt2):
3002 Create a linear edge with specified ends.
3005 thePnt1 Point for the first end of edge.
3006 thePnt2 Point for the second end of edge.
3009 New GEOM.GEOM_Object, containing the created edge.
3011 # Example: see GEOM_TestAll.py
3012 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3013 RaiseIfFailed("MakeEdge", self.ShapesOp)
3016 ## Create a new edge, corresponding to the given length on the given curve.
3017 # @param theRefCurve The referenced curve (edge).
3018 # @param theLength Length on the referenced curve. It can be negative.
3019 # @param theStartPoint Any point can be selected for it, the new edge will begin
3020 # at the end of \a theRefCurve, close to the selected point.
3021 # If None, start from the first point of \a theRefCurve.
3022 # @return New GEOM.GEOM_Object, containing the created edge.
3024 # @ref tui_creation_edge "Example"
3025 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
3027 Create a new edge, corresponding to the given length on the given curve.
3030 theRefCurve The referenced curve (edge).
3031 theLength Length on the referenced curve. It can be negative.
3032 theStartPoint Any point can be selected for it, the new edge will begin
3033 at the end of theRefCurve, close to the selected point.
3034 If None, start from the first point of theRefCurve.
3037 New GEOM.GEOM_Object, containing the created edge.
3039 # Example: see GEOM_TestAll.py
3040 theLength, Parameters = ParseParameters(theLength)
3041 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
3042 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
3043 anObj.SetParameters(Parameters)
3046 ## Create an edge from specified wire.
3047 # @param theWire source Wire
3048 # @param theLinearTolerance linear tolerance value (default = 1e-07)
3049 # @param theAngularTolerance angular tolerance value (default = 1e-12)
3050 # @return New GEOM.GEOM_Object, containing the created edge.
3052 # @ref tui_creation_edge "Example"
3053 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
3055 Create an edge from specified wire.
3059 theLinearTolerance linear tolerance value (default = 1e-07)
3060 theAngularTolerance angular tolerance value (default = 1e-12)
3063 New GEOM.GEOM_Object, containing the created edge.
3065 # Example: see GEOM_TestAll.py
3066 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3067 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3070 ## Create a wire from the set of edges and wires.
3071 # @param theEdgesAndWires List of edges and/or wires.
3072 # @param theTolerance Maximum distance between vertices, that will be merged.
3073 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3074 # @return New GEOM.GEOM_Object, containing the created wire.
3076 # @ref tui_creation_wire "Example"
3077 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
3079 Create a wire from the set of edges and wires.
3082 theEdgesAndWires List of edges and/or wires.
3083 theTolerance Maximum distance between vertices, that will be merged.
3084 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3087 New GEOM.GEOM_Object, containing the created wire.
3089 # Example: see GEOM_TestAll.py
3090 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3091 RaiseIfFailed("MakeWire", self.ShapesOp)
3094 ## Create a face on the given wire.
3095 # @param theWire closed Wire or Edge to build the face on.
3096 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3097 # If the tolerance of the obtained planar face is less
3098 # than 1e-06, this face will be returned, otherwise the
3099 # algorithm tries to build any suitable face on the given
3100 # wire and prints a warning message.
3101 # @return New GEOM.GEOM_Object, containing the created face.
3103 # @ref tui_creation_face "Example"
3104 def MakeFace(self, theWire, isPlanarWanted):
3106 Create a face on the given wire.
3109 theWire closed Wire or Edge to build the face on.
3110 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3111 If the tolerance of the obtained planar face is less
3112 than 1e-06, this face will be returned, otherwise the
3113 algorithm tries to build any suitable face on the given
3114 wire and prints a warning message.
3117 New GEOM.GEOM_Object, containing the created face.
3119 # Example: see GEOM_TestAll.py
3120 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
3121 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3122 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3124 RaiseIfFailed("MakeFace", self.ShapesOp)
3127 ## Create a face on the given wires set.
3128 # @param theWires List of closed wires or edges to build the face on.
3129 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3130 # If the tolerance of the obtained planar face is less
3131 # than 1e-06, this face will be returned, otherwise the
3132 # algorithm tries to build any suitable face on the given
3133 # wire and prints a warning message.
3134 # @return New GEOM.GEOM_Object, containing the created face.
3136 # @ref tui_creation_face "Example"
3137 def MakeFaceWires(self, theWires, isPlanarWanted):
3139 Create a face on the given wires set.
3142 theWires List of closed wires or edges to build the face on.
3143 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3144 If the tolerance of the obtained planar face is less
3145 than 1e-06, this face will be returned, otherwise the
3146 algorithm tries to build any suitable face on the given
3147 wire and prints a warning message.
3150 New GEOM.GEOM_Object, containing the created face.
3152 # Example: see GEOM_TestAll.py
3153 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
3154 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3155 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3157 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
3160 ## See MakeFaceWires() method for details.
3162 # @ref tui_creation_face "Example 1"
3163 # \n @ref swig_MakeFaces "Example 2"
3164 def MakeFaces(self, theWires, isPlanarWanted):
3166 See geompy.MakeFaceWires() method for details.
3168 # Example: see GEOM_TestOthers.py
3169 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3172 ## Create a shell from the set of faces and shells.
3173 # @param theFacesAndShells List of faces and/or shells.
3174 # @return New GEOM.GEOM_Object, containing the created shell.
3176 # @ref tui_creation_shell "Example"
3177 def MakeShell(self,theFacesAndShells):
3179 Create a shell from the set of faces and shells.
3182 theFacesAndShells List of faces and/or shells.
3185 New GEOM.GEOM_Object, containing the created shell.
3187 # Example: see GEOM_TestAll.py
3188 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3189 RaiseIfFailed("MakeShell", self.ShapesOp)
3192 ## Create a solid, bounded by the given shells.
3193 # @param theShells Sequence of bounding shells.
3194 # @return New GEOM.GEOM_Object, containing the created solid.
3196 # @ref tui_creation_solid "Example"
3197 def MakeSolid(self, theShells):
3199 Create a solid, bounded by the given shells.
3202 theShells Sequence of bounding shells.
3205 New GEOM.GEOM_Object, containing the created solid.
3207 # Example: see GEOM_TestAll.py
3208 if len(theShells) == 1:
3209 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3211 # raise RuntimeError, "MakeSolidShells : " + descr
3212 if descr == "WRN_SHAPE_UNCLOSED":
3213 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3214 anObj = self.ShapesOp.MakeSolidShells(theShells)
3215 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3218 ## Create a compound of the given shapes.
3219 # @param theShapes List of shapes to put in compound.
3220 # @return New GEOM.GEOM_Object, containing the created compound.
3222 # @ref tui_creation_compound "Example"
3223 def MakeCompound(self,theShapes):
3225 Create a compound of the given shapes.
3228 theShapes List of shapes to put in compound.
3231 New GEOM.GEOM_Object, containing the created compound.
3233 # Example: see GEOM_TestAll.py
3234 anObj = self.ShapesOp.MakeCompound(theShapes)
3235 RaiseIfFailed("MakeCompound", self.ShapesOp)
3238 # end of l3_advanced
3241 ## @addtogroup l2_measure
3244 ## Gives quantity of faces in the given shape.
3245 # @param theShape Shape to count faces of.
3246 # @return Quantity of faces.
3248 # @ref swig_NumberOf "Example"
3249 def NumberOfFaces(self, theShape):
3251 Gives quantity of faces in the given shape.
3254 theShape Shape to count faces of.
3259 # Example: see GEOM_TestOthers.py
3260 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3261 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3264 ## Gives quantity of edges in the given shape.
3265 # @param theShape Shape to count edges of.
3266 # @return Quantity of edges.
3268 # @ref swig_NumberOf "Example"
3269 def NumberOfEdges(self, theShape):
3271 Gives quantity of edges in the given shape.
3274 theShape Shape to count edges of.
3279 # Example: see GEOM_TestOthers.py
3280 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3281 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3284 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3285 # @param theShape Shape to count sub-shapes of.
3286 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3287 # @return Quantity of sub-shapes of given type.
3289 # @ref swig_NumberOf "Example"
3290 def NumberOfSubShapes(self, theShape, theShapeType):
3292 Gives quantity of sub-shapes of type theShapeType in the given shape.
3295 theShape Shape to count sub-shapes of.
3296 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3299 Quantity of sub-shapes of given type.
3301 # Example: see GEOM_TestOthers.py
3302 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3303 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3306 ## Gives quantity of solids in the given shape.
3307 # @param theShape Shape to count solids in.
3308 # @return Quantity of solids.
3310 # @ref swig_NumberOf "Example"
3311 def NumberOfSolids(self, theShape):
3313 Gives quantity of solids in the given shape.
3316 theShape Shape to count solids in.
3321 # Example: see GEOM_TestOthers.py
3322 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3323 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3329 ## @addtogroup l3_healing
3332 ## Reverses an orientation the given shape.
3333 # @param theShape Shape to be reversed.
3334 # @return The reversed copy of theShape.
3336 # @ref swig_ChangeOrientation "Example"
3337 def ChangeOrientation(self,theShape):
3339 Reverses an orientation the given shape.
3342 theShape Shape to be reversed.
3345 The reversed copy of theShape.
3347 # Example: see GEOM_TestAll.py
3348 anObj = self.ShapesOp.ChangeOrientation(theShape)
3349 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3352 ## See ChangeOrientation() method for details.
3354 # @ref swig_OrientationChange "Example"
3355 def OrientationChange(self,theShape):
3357 See geompy.ChangeOrientation method for details.
3359 # Example: see GEOM_TestOthers.py
3360 anObj = self.ChangeOrientation(theShape)
3366 ## @addtogroup l4_obtain
3369 ## Retrieve all free faces from the given shape.
3370 # Free face is a face, which is not shared between two shells of the shape.
3371 # @param theShape Shape to find free faces in.
3372 # @return List of IDs of all free faces, contained in theShape.
3374 # @ref tui_measurement_tools_page "Example"
3375 def GetFreeFacesIDs(self,theShape):
3377 Retrieve all free faces from the given shape.
3378 Free face is a face, which is not shared between two shells of the shape.
3381 theShape Shape to find free faces in.
3384 List of IDs of all free faces, contained in theShape.
3386 # Example: see GEOM_TestOthers.py
3387 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3388 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3391 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3392 # @param theShape1 Shape to find sub-shapes in.
3393 # @param theShape2 Shape to find shared sub-shapes with.
3394 # @param theShapeType Type of sub-shapes to be retrieved.
3395 # @return List of sub-shapes of theShape1, shared with theShape2.
3397 # @ref swig_GetSharedShapes "Example"
3398 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3400 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3403 theShape1 Shape to find sub-shapes in.
3404 theShape2 Shape to find shared sub-shapes with.
3405 theShapeType Type of sub-shapes to be retrieved.
3408 List of sub-shapes of theShape1, shared with theShape2.
3410 # Example: see GEOM_TestOthers.py
3411 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3412 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3415 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3416 # @param theShapes Shapes to find common sub-shapes of.
3417 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3418 # @return List of objects, that are sub-shapes of all given shapes.
3420 # @ref swig_GetSharedShapes "Example"
3421 def GetSharedShapesMulti(self, theShapes, theShapeType):
3423 Get all sub-shapes, shared by all shapes in the list theShapes.
3426 theShapes Shapes to find common sub-shapes of.
3427 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3430 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3432 # Example: see GEOM_TestOthers.py
3433 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3434 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3437 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3438 # situated relatively the specified plane by the certain way,
3439 # defined through <VAR>theState</VAR> parameter.
3440 # @param theShape Shape to find sub-shapes of.
3441 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3442 # @param theAx1 Vector (or line, or linear edge), specifying normal
3443 # direction and location of the plane to find shapes on.
3444 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3445 # @return List of all found sub-shapes.
3447 # @ref swig_GetShapesOnPlane "Example"
3448 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3450 Find in theShape all sub-shapes of type theShapeType,
3451 situated relatively the specified plane by the certain way,
3452 defined through theState parameter.
3455 theShape Shape to find sub-shapes of.
3456 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3457 theAx1 Vector (or line, or linear edge), specifying normal
3458 direction and location of the plane to find shapes on.
3459 theState The state of the sub-shapes to find (see GEOM::shape_state)
3462 List of all found sub-shapes.
3464 # Example: see GEOM_TestOthers.py
3465 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3466 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3469 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3470 # situated relatively the specified plane by the certain way,
3471 # defined through <VAR>theState</VAR> parameter.
3472 # @param theShape Shape to find sub-shapes of.
3473 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3474 # @param theAx1 Vector (or line, or linear edge), specifying normal
3475 # direction and location of the plane to find shapes on.
3476 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3477 # @return List of all found sub-shapes indices.
3479 # @ref swig_GetShapesOnPlaneIDs "Example"
3480 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3482 Find in theShape all sub-shapes of type theShapeType,
3483 situated relatively the specified plane by the certain way,
3484 defined through theState parameter.
3487 theShape Shape to find sub-shapes of.
3488 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3489 theAx1 Vector (or line, or linear edge), specifying normal
3490 direction and location of the plane to find shapes on.
3491 theState The state of the sub-shapes to find (see GEOM::shape_state)
3494 List of all found sub-shapes indices.
3496 # Example: see GEOM_TestOthers.py
3497 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3498 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3501 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3502 # situated relatively the specified plane by the certain way,
3503 # defined through <VAR>theState</VAR> parameter.
3504 # @param theShape Shape to find sub-shapes of.
3505 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3506 # @param theAx1 Vector (or line, or linear edge), specifying normal
3507 # direction of the plane to find shapes on.
3508 # @param thePnt Point specifying location of the plane to find shapes on.
3509 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3510 # @return List of all found sub-shapes.
3512 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3513 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3515 Find in theShape all sub-shapes of type theShapeType,
3516 situated relatively the specified plane by the certain way,
3517 defined through theState parameter.
3520 theShape Shape to find sub-shapes of.
3521 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3522 theAx1 Vector (or line, or linear edge), specifying normal
3523 direction and location of the plane to find shapes on.
3524 thePnt Point specifying location of the plane to find shapes on.
3525 theState The state of the sub-shapes to find (see GEOM::shape_state)
3528 List of all found sub-shapes.
3530 # Example: see GEOM_TestOthers.py
3531 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3532 theAx1, thePnt, theState)
3533 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3536 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3537 # situated relatively the specified plane by the certain way,
3538 # defined through <VAR>theState</VAR> parameter.
3539 # @param theShape Shape to find sub-shapes of.
3540 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3541 # @param theAx1 Vector (or line, or linear edge), specifying normal
3542 # direction of the plane to find shapes on.
3543 # @param thePnt Point specifying location of the plane to find shapes on.
3544 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3545 # @return List of all found sub-shapes indices.
3547 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3548 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3550 Find in theShape all sub-shapes of type theShapeType,
3551 situated relatively the specified plane by the certain way,
3552 defined through theState parameter.
3555 theShape Shape to find sub-shapes of.
3556 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3557 theAx1 Vector (or line, or linear edge), specifying normal
3558 direction and location of the plane to find shapes on.
3559 thePnt Point specifying location of the plane to find shapes on.
3560 theState The state of the sub-shapes to find (see GEOM::shape_state)
3563 List of all found sub-shapes indices.
3565 # Example: see GEOM_TestOthers.py
3566 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3567 theAx1, thePnt, theState)
3568 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3571 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3572 # the specified cylinder by the certain way, defined through \a theState parameter.
3573 # @param theShape Shape to find sub-shapes of.
3574 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3575 # @param theAxis Vector (or line, or linear edge), specifying
3576 # axis of the cylinder to find shapes on.
3577 # @param theRadius Radius of the cylinder to find shapes on.
3578 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3579 # @return List of all found sub-shapes.
3581 # @ref swig_GetShapesOnCylinder "Example"
3582 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3584 Find in theShape all sub-shapes of type theShapeType, situated relatively
3585 the specified cylinder by the certain way, defined through theState parameter.
3588 theShape Shape to find sub-shapes of.
3589 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3590 theAxis Vector (or line, or linear edge), specifying
3591 axis of the cylinder to find shapes on.
3592 theRadius Radius of the cylinder to find shapes on.
3593 theState The state of the sub-shapes to find (see GEOM::shape_state)
3596 List of all found sub-shapes.
3598 # Example: see GEOM_TestOthers.py
3599 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3600 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3603 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3604 # the specified cylinder by the certain way, defined through \a theState parameter.
3605 # @param theShape Shape to find sub-shapes of.
3606 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3607 # @param theAxis Vector (or line, or linear edge), specifying
3608 # axis of the cylinder to find shapes on.
3609 # @param theRadius Radius of the cylinder to find shapes on.
3610 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3611 # @return List of all found sub-shapes indices.
3613 # @ref swig_GetShapesOnCylinderIDs "Example"
3614 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3616 Find in theShape all sub-shapes of type theShapeType, situated relatively
3617 the specified cylinder by the certain way, defined through theState parameter.
3620 theShape Shape to find sub-shapes of.
3621 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3622 theAxis Vector (or line, or linear edge), specifying
3623 axis of the cylinder to find shapes on.
3624 theRadius Radius of the cylinder to find shapes on.
3625 theState The state of the sub-shapes to find (see GEOM::shape_state)
3628 List of all found sub-shapes indices.
3630 # Example: see GEOM_TestOthers.py
3631 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3632 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3635 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3636 # the specified cylinder by the certain way, defined through \a theState parameter.
3637 # @param theShape Shape to find sub-shapes of.
3638 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3639 # @param theAxis Vector (or line, or linear edge), specifying
3640 # axis of the cylinder to find shapes on.
3641 # @param thePnt Point specifying location of the bottom of the cylinder.
3642 # @param theRadius Radius of the cylinder to find shapes on.
3643 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3644 # @return List of all found sub-shapes.
3646 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3647 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3649 Find in theShape all sub-shapes of type theShapeType, situated relatively
3650 the specified cylinder by the certain way, defined through theState parameter.
3653 theShape Shape to find sub-shapes of.
3654 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3655 theAxis Vector (or line, or linear edge), specifying
3656 axis of the cylinder to find shapes on.
3657 theRadius Radius of the cylinder to find shapes on.
3658 theState The state of the sub-shapes to find (see GEOM::shape_state)
3661 List of all found sub-shapes.
3663 # Example: see GEOM_TestOthers.py
3664 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3665 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3668 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3669 # the specified cylinder by the certain way, defined through \a theState parameter.
3670 # @param theShape Shape to find sub-shapes of.
3671 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3672 # @param theAxis Vector (or line, or linear edge), specifying
3673 # axis of the cylinder to find shapes on.
3674 # @param thePnt Point specifying location of the bottom of the cylinder.
3675 # @param theRadius Radius of the cylinder to find shapes on.
3676 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3677 # @return List of all found sub-shapes indices
3679 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3680 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3682 Find in theShape all sub-shapes of type theShapeType, situated relatively
3683 the specified cylinder by the certain way, defined through theState parameter.
3686 theShape Shape to find sub-shapes of.
3687 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3688 theAxis Vector (or line, or linear edge), specifying
3689 axis of the cylinder to find shapes on.
3690 theRadius Radius of the cylinder to find shapes on.
3691 theState The state of the sub-shapes to find (see GEOM::shape_state)
3694 List of all found sub-shapes indices.
3696 # Example: see GEOM_TestOthers.py
3697 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3698 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3701 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3702 # the specified sphere by the certain way, defined through \a theState parameter.
3703 # @param theShape Shape to find sub-shapes of.
3704 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3705 # @param theCenter Point, specifying center of the sphere to find shapes on.
3706 # @param theRadius Radius of the sphere to find shapes on.
3707 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3708 # @return List of all found sub-shapes.
3710 # @ref swig_GetShapesOnSphere "Example"
3711 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3713 Find in theShape all sub-shapes of type theShapeType, situated relatively
3714 the specified sphere by the certain way, defined through theState parameter.
3717 theShape Shape to find sub-shapes of.
3718 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3719 theCenter Point, specifying center of the sphere to find shapes on.
3720 theRadius Radius of the sphere to find shapes on.
3721 theState The state of the sub-shapes to find (see GEOM::shape_state)
3724 List of all found sub-shapes.
3726 # Example: see GEOM_TestOthers.py
3727 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3728 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3731 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3732 # the specified sphere by the certain way, defined through \a theState parameter.
3733 # @param theShape Shape to find sub-shapes of.
3734 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3735 # @param theCenter Point, specifying center of the sphere to find shapes on.
3736 # @param theRadius Radius of the sphere to find shapes on.
3737 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3738 # @return List of all found sub-shapes indices.
3740 # @ref swig_GetShapesOnSphereIDs "Example"
3741 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3743 Find in theShape all sub-shapes of type theShapeType, situated relatively
3744 the specified sphere by the certain way, defined through theState parameter.
3747 theShape Shape to find sub-shapes of.
3748 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3749 theCenter Point, specifying center of the sphere to find shapes on.
3750 theRadius Radius of the sphere to find shapes on.
3751 theState The state of the sub-shapes to find (see GEOM::shape_state)
3754 List of all found sub-shapes indices.
3756 # Example: see GEOM_TestOthers.py
3757 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3758 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3761 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3762 # the specified quadrangle by the certain way, defined through \a theState parameter.
3763 # @param theShape Shape to find sub-shapes of.
3764 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3765 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3766 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3767 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3768 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3769 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3770 # @return List of all found sub-shapes.
3772 # @ref swig_GetShapesOnQuadrangle "Example"
3773 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3774 theTopLeftPoint, theTopRigthPoint,
3775 theBottomLeftPoint, theBottomRigthPoint, theState):
3777 Find in theShape all sub-shapes of type theShapeType, situated relatively
3778 the specified quadrangle by the certain way, defined through theState parameter.
3781 theShape Shape to find sub-shapes of.
3782 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3783 theTopLeftPoint Point, specifying top left corner of a quadrangle
3784 theTopRigthPoint Point, specifying top right corner of a quadrangle
3785 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3786 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3787 theState The state of the sub-shapes to find (see GEOM::shape_state)
3790 List of all found sub-shapes.
3792 # Example: see GEOM_TestOthers.py
3793 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3794 theTopLeftPoint, theTopRigthPoint,
3795 theBottomLeftPoint, theBottomRigthPoint, theState)
3796 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3799 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3800 # the specified quadrangle by the certain way, defined through \a theState parameter.
3801 # @param theShape Shape to find sub-shapes of.
3802 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3803 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3804 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3805 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3806 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3807 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3808 # @return List of all found sub-shapes indices.
3810 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3811 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3812 theTopLeftPoint, theTopRigthPoint,
3813 theBottomLeftPoint, theBottomRigthPoint, theState):
3815 Find in theShape all sub-shapes of type theShapeType, situated relatively
3816 the specified quadrangle by the certain way, defined through theState parameter.
3819 theShape Shape to find sub-shapes of.
3820 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3821 theTopLeftPoint Point, specifying top left corner of a quadrangle
3822 theTopRigthPoint Point, specifying top right corner of a quadrangle
3823 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3824 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3825 theState The state of the sub-shapes to find (see GEOM::shape_state)
3828 List of all found sub-shapes indices.
3831 # Example: see GEOM_TestOthers.py
3832 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3833 theTopLeftPoint, theTopRigthPoint,
3834 theBottomLeftPoint, theBottomRigthPoint, theState)
3835 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3838 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3839 # the specified \a theBox by the certain way, defined through \a theState parameter.
3840 # @param theBox Shape for relative comparing.
3841 # @param theShape Shape to find sub-shapes of.
3842 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3843 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3844 # @return List of all found sub-shapes.
3846 # @ref swig_GetShapesOnBox "Example"
3847 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3849 Find in theShape all sub-shapes of type theShapeType, situated relatively
3850 the specified theBox by the certain way, defined through theState parameter.
3853 theBox Shape for relative comparing.
3854 theShape Shape to find sub-shapes of.
3855 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3856 theState The state of the sub-shapes to find (see GEOM::shape_state)
3859 List of all found sub-shapes.
3861 # Example: see GEOM_TestOthers.py
3862 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3863 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3866 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3867 # the specified \a theBox by the certain way, defined through \a theState parameter.
3868 # @param theBox Shape for relative comparing.
3869 # @param theShape Shape to find sub-shapes of.
3870 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3871 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3872 # @return List of all found sub-shapes indices.
3874 # @ref swig_GetShapesOnBoxIDs "Example"
3875 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3877 Find in theShape all sub-shapes of type theShapeType, situated relatively
3878 the specified theBox by the certain way, defined through theState parameter.
3881 theBox Shape for relative comparing.
3882 theShape Shape to find sub-shapes of.
3883 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3884 theState The state of the sub-shapes to find (see GEOM::shape_state)
3887 List of all found sub-shapes indices.
3889 # Example: see GEOM_TestOthers.py
3890 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3891 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3894 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3895 # situated relatively the specified \a theCheckShape by the
3896 # certain way, defined through \a theState parameter.
3897 # @param theCheckShape Shape for relative comparing. It must be a solid.
3898 # @param theShape Shape to find sub-shapes of.
3899 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3900 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3901 # @return List of all found sub-shapes.
3903 # @ref swig_GetShapesOnShape "Example"
3904 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3906 Find in theShape all sub-shapes of type theShapeType,
3907 situated relatively the specified theCheckShape by the
3908 certain way, defined through theState parameter.
3911 theCheckShape Shape for relative comparing. It must be a solid.
3912 theShape Shape to find sub-shapes of.
3913 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3914 theState The state of the sub-shapes to find (see GEOM::shape_state)
3917 List of all found sub-shapes.
3919 # Example: see GEOM_TestOthers.py
3920 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3921 theShapeType, theState)
3922 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3925 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3926 # situated relatively the specified \a theCheckShape by the
3927 # certain way, defined through \a theState parameter.
3928 # @param theCheckShape Shape for relative comparing. It must be a solid.
3929 # @param theShape Shape to find sub-shapes of.
3930 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3931 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3932 # @return All found sub-shapes as compound.
3934 # @ref swig_GetShapesOnShapeAsCompound "Example"
3935 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3937 Find in theShape all sub-shapes of type theShapeType,
3938 situated relatively the specified theCheckShape by the
3939 certain way, defined through theState parameter.
3942 theCheckShape Shape for relative comparing. It must be a solid.
3943 theShape Shape to find sub-shapes of.
3944 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3945 theState The state of the sub-shapes to find (see GEOM::shape_state)
3948 All found sub-shapes as compound.
3950 # Example: see GEOM_TestOthers.py
3951 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3952 theShapeType, theState)
3953 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3956 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3957 # situated relatively the specified \a theCheckShape by the
3958 # certain way, defined through \a theState parameter.
3959 # @param theCheckShape Shape for relative comparing. It must be a solid.
3960 # @param theShape Shape to find sub-shapes of.
3961 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3962 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3963 # @return List of all found sub-shapes indices.
3965 # @ref swig_GetShapesOnShapeIDs "Example"
3966 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3968 Find in theShape all sub-shapes of type theShapeType,
3969 situated relatively the specified theCheckShape by the
3970 certain way, defined through theState parameter.
3973 theCheckShape Shape for relative comparing. It must be a solid.
3974 theShape Shape to find sub-shapes of.
3975 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3976 theState The state of the sub-shapes to find (see GEOM::shape_state)
3979 List of all found sub-shapes indices.
3981 # Example: see GEOM_TestOthers.py
3982 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3983 theShapeType, theState)
3984 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3987 ## Get sub-shape(s) of theShapeWhere, which are
3988 # coincident with \a theShapeWhat or could be a part of it.
3989 # @param theShapeWhere Shape to find sub-shapes of.
3990 # @param theShapeWhat Shape, specifying what to find.
3991 # @param isNewImplementation implementation of GetInPlace functionality
3992 # (default = False, old alghorithm based on shape properties)
3993 # @return Group of all found sub-shapes or a single found sub-shape.
3995 # @note This function has a restriction on argument shapes.
3996 # If \a theShapeWhere has curved parts with significantly
3997 # outstanding centres (i.e. the mass centre of a part is closer to
3998 # \a theShapeWhat than to the part), such parts will not be found.
3999 # @image html get_in_place_lost_part.png
4001 # @ref swig_GetInPlace "Example"
4002 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
4004 Get sub-shape(s) of theShapeWhere, which are
4005 coincident with theShapeWhat or could be a part of it.
4008 theShapeWhere Shape to find sub-shapes of.
4009 theShapeWhat Shape, specifying what to find.
4010 isNewImplementation Implementation of GetInPlace functionality
4011 (default = False, old alghorithm based on shape properties)
4014 Group of all found sub-shapes or a single found sub-shape.
4018 This function has a restriction on argument shapes.
4019 If theShapeWhere has curved parts with significantly
4020 outstanding centres (i.e. the mass centre of a part is closer to
4021 theShapeWhat than to the part), such parts will not be found.
4023 # Example: see GEOM_TestOthers.py
4025 if isNewImplementation:
4026 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
4028 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
4030 RaiseIfFailed("GetInPlace", self.ShapesOp)
4033 ## Get sub-shape(s) of \a theShapeWhere, which are
4034 # coincident with \a theShapeWhat or could be a part of it.
4036 # Implementation of this method is based on a saved history of an operation,
4037 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
4038 # arguments (an argument shape or a sub-shape of an argument shape).
4039 # The operation could be the Partition or one of boolean operations,
4040 # performed on simple shapes (not on compounds).
4042 # @param theShapeWhere Shape to find sub-shapes of.
4043 # @param theShapeWhat Shape, specifying what to find (must be in the
4044 # building history of the ShapeWhere).
4045 # @return Group of all found sub-shapes or a single found sub-shape.
4047 # @ref swig_GetInPlace "Example"
4048 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
4050 Implementation of this method is based on a saved history of an operation,
4051 produced theShapeWhere. The theShapeWhat must be among this operation's
4052 arguments (an argument shape or a sub-shape of an argument shape).
4053 The operation could be the Partition or one of boolean operations,
4054 performed on simple shapes (not on compounds).
4057 theShapeWhere Shape to find sub-shapes of.
4058 theShapeWhat Shape, specifying what to find (must be in the
4059 building history of the ShapeWhere).
4062 Group of all found sub-shapes or a single found sub-shape.
4064 # Example: see GEOM_TestOthers.py
4065 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
4066 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
4069 ## Get sub-shape of theShapeWhere, which is
4070 # equal to \a theShapeWhat.
4071 # @param theShapeWhere Shape to find sub-shape of.
4072 # @param theShapeWhat Shape, specifying what to find.
4073 # @return New GEOM.GEOM_Object for found sub-shape.
4075 # @ref swig_GetSame "Example"
4076 def GetSame(self,theShapeWhere, theShapeWhat):
4078 Get sub-shape of theShapeWhere, which is
4079 equal to theShapeWhat.
4082 theShapeWhere Shape to find sub-shape of.
4083 theShapeWhat Shape, specifying what to find.
4086 New GEOM.GEOM_Object for found sub-shape.
4088 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
4089 RaiseIfFailed("GetSame", self.ShapesOp)
4093 ## Get sub-shape indices of theShapeWhere, which is
4094 # equal to \a theShapeWhat.
4095 # @param theShapeWhere Shape to find sub-shape of.
4096 # @param theShapeWhat Shape, specifying what to find.
4097 # @return List of all found sub-shapes indices.
4099 # @ref swig_GetSame "Example"
4100 def GetSameIDs(self,theShapeWhere, theShapeWhat):
4102 Get sub-shape indices of theShapeWhere, which is
4103 equal to theShapeWhat.
4106 theShapeWhere Shape to find sub-shape of.
4107 theShapeWhat Shape, specifying what to find.
4110 List of all found sub-shapes indices.
4112 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
4113 RaiseIfFailed("GetSameIDs", self.ShapesOp)
4120 ## @addtogroup l4_access
4123 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
4124 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4125 # @param aShape Shape to get sub-shape of.
4126 # @param ListOfID List of sub-shapes indices.
4127 # @return Found sub-shape.
4129 # @ref swig_all_decompose "Example"
4130 def GetSubShape(self, aShape, ListOfID):
4132 Obtain a composite sub-shape of aShape, composed from sub-shapes
4133 of aShape, selected by their unique IDs inside aShape
4136 aShape Shape to get sub-shape of.
4137 ListOfID List of sub-shapes indices.
4142 # Example: see GEOM_TestAll.py
4143 anObj = self.AddSubShape(aShape,ListOfID)
4146 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
4147 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4148 # @param aShape Shape to get sub-shape of.
4149 # @param aSubShape Sub-shapes of aShape.
4150 # @return ID of found sub-shape.
4152 # @ref swig_all_decompose "Example"
4153 def GetSubShapeID(self, aShape, aSubShape):
4155 Obtain unique ID of sub-shape aSubShape inside aShape
4156 of aShape, selected by their unique IDs inside aShape
4159 aShape Shape to get sub-shape of.
4160 aSubShape Sub-shapes of aShape.
4163 ID of found sub-shape.
4165 # Example: see GEOM_TestAll.py
4166 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
4167 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4173 ## @addtogroup l4_decompose
4176 ## Get all sub-shapes and groups of \a theShape,
4177 # that were created already by any other methods.
4178 # @param theShape Any shape.
4179 # @param theGroupsOnly If this parameter is TRUE, only groups will be
4180 # returned, else all found sub-shapes and groups.
4181 # @return List of existing sub-objects of \a theShape.
4183 # @ref swig_all_decompose "Example"
4184 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4186 Get all sub-shapes and groups of theShape,
4187 that were created already by any other methods.
4191 theGroupsOnly If this parameter is TRUE, only groups will be
4192 returned, else all found sub-shapes and groups.
4195 List of existing sub-objects of theShape.
4197 # Example: see GEOM_TestAll.py
4198 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4199 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4202 ## Get all groups of \a theShape,
4203 # that were created already by any other methods.
4204 # @param theShape Any shape.
4205 # @return List of existing groups of \a theShape.
4207 # @ref swig_all_decompose "Example"
4208 def GetGroups(self, theShape):
4210 Get all groups of theShape,
4211 that were created already by any other methods.
4217 List of existing groups of theShape.
4219 # Example: see GEOM_TestAll.py
4220 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4221 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4224 ## Explode a shape on sub-shapes of a given type.
4225 # If the shape itself matches the type, it is also returned.
4226 # @param aShape Shape to be exploded.
4227 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4228 # @return List of sub-shapes of type theShapeType, contained in theShape.
4230 # @ref swig_all_decompose "Example"
4231 def SubShapeAll(self, aShape, aType):
4233 Explode a shape on sub-shapes of a given type.
4234 If the shape itself matches the type, it is also returned.
4237 aShape Shape to be exploded.
4238 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4241 List of sub-shapes of type theShapeType, contained in theShape.
4243 # Example: see GEOM_TestAll.py
4244 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
4245 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4248 ## Explode a shape on sub-shapes of a given type.
4249 # @param aShape Shape to be exploded.
4250 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4251 # @return List of IDs of sub-shapes.
4253 # @ref swig_all_decompose "Example"
4254 def SubShapeAllIDs(self, aShape, aType):
4256 Explode a shape on sub-shapes of a given type.
4259 aShape Shape to be exploded (see geompy.ShapeType)
4260 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4263 List of IDs of sub-shapes.
4265 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
4266 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4269 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4270 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4271 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4272 # @param aShape Shape to get sub-shape of.
4273 # @param ListOfInd List of sub-shapes indices.
4274 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4275 # @return A compound of sub-shapes of aShape.
4277 # @ref swig_all_decompose "Example"
4278 def SubShape(self, aShape, aType, ListOfInd):
4280 Obtain a compound of sub-shapes of aShape,
4281 selected by they indices in list of all sub-shapes of type aType.
4282 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4285 aShape Shape to get sub-shape of.
4286 ListOfID List of sub-shapes indices.
4287 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4290 A compound of sub-shapes of aShape.
4292 # Example: see GEOM_TestAll.py
4294 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
4295 for ind in ListOfInd:
4296 ListOfIDs.append(AllShapeIDsList[ind - 1])
4297 anObj = self.GetSubShape(aShape, ListOfIDs)
4300 ## Explode a shape on sub-shapes of a given type.
4301 # Sub-shapes will be sorted by coordinates of their gravity centers.
4302 # If the shape itself matches the type, it is also returned.
4303 # @param aShape Shape to be exploded.
4304 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4305 # @return List of sub-shapes of type theShapeType, contained in theShape.
4307 # @ref swig_SubShapeAllSorted "Example"
4308 def SubShapeAllSortedCentres(self, aShape, aType):
4310 Explode a shape on sub-shapes of a given type.
4311 Sub-shapes will be sorted by coordinates of their gravity centers.
4312 If the shape itself matches the type, it is also returned.
4315 aShape Shape to be exploded.
4316 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4319 List of sub-shapes of type theShapeType, contained in theShape.
4321 # Example: see GEOM_TestAll.py
4322 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
4323 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4326 ## Explode a shape on sub-shapes of a given type.
4327 # Sub-shapes will be sorted by coordinates of their gravity centers.
4328 # @param aShape Shape to be exploded.
4329 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4330 # @return List of IDs of sub-shapes.
4332 # @ref swig_all_decompose "Example"
4333 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4335 Explode a shape on sub-shapes of a given type.
4336 Sub-shapes will be sorted by coordinates of their gravity centers.
4339 aShape Shape to be exploded.
4340 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4343 List of IDs of sub-shapes.
4345 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
4346 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4349 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4350 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4351 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4352 # @param aShape Shape to get sub-shape of.
4353 # @param ListOfInd List of sub-shapes indices.
4354 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4355 # @return A compound of sub-shapes of aShape.
4357 # @ref swig_all_decompose "Example"
4358 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4360 Obtain a compound of sub-shapes of aShape,
4361 selected by they indices in sorted list of all sub-shapes of type aType.
4362 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4365 aShape Shape to get sub-shape of.
4366 ListOfID List of sub-shapes indices.
4367 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4370 A compound of sub-shapes of aShape.
4372 # Example: see GEOM_TestAll.py
4374 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
4375 for ind in ListOfInd:
4376 ListOfIDs.append(AllShapeIDsList[ind - 1])
4377 anObj = self.GetSubShape(aShape, ListOfIDs)
4380 ## Extract shapes (excluding the main shape) of given type.
4381 # @param aShape The shape.
4382 # @param aType The shape type (see ShapeType())
4383 # @param isSorted Boolean flag to switch sorting on/off.
4384 # @return List of sub-shapes of type aType, contained in aShape.
4386 # @ref swig_FilletChamfer "Example"
4387 def ExtractShapes(self, aShape, aType, isSorted = False):
4389 Extract shapes (excluding the main shape) of given type.
4393 aType The shape type (see geompy.ShapeType)
4394 isSorted Boolean flag to switch sorting on/off.
4397 List of sub-shapes of type aType, contained in aShape.
4399 # Example: see GEOM_TestAll.py
4400 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
4401 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4404 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4405 # @param aShape Main shape.
4406 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4407 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4409 # @ref swig_all_decompose "Example"
4410 def SubShapes(self, aShape, anIDs):
4412 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4416 anIDs List of unique IDs of sub-shapes inside theMainShape.
4419 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4421 # Example: see GEOM_TestAll.py
4422 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4423 RaiseIfFailed("SubShapes", self.ShapesOp)
4426 # end of l4_decompose
4429 ## @addtogroup l4_decompose_d
4432 ## Deprecated method
4433 # It works like SubShapeAllSortedCentres(), but wrongly
4434 # defines centres of faces, shells and solids.
4435 def SubShapeAllSorted(self, aShape, aType):
4438 It works like geompy.SubShapeAllSortedCentres, but wrongly
4439 defines centres of faces, shells and solids.
4441 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
4442 RaiseIfFailed("MakeExplode", self.ShapesOp)
4445 ## Deprecated method
4446 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4447 # defines centres of faces, shells and solids.
4448 def SubShapeAllSortedIDs(self, aShape, aType):
4451 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4452 defines centres of faces, shells and solids.
4454 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
4455 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4458 ## Deprecated method
4459 # It works like SubShapeSortedCentres(), but has a bug
4460 # (wrongly defines centres of faces, shells and solids).
4461 def SubShapeSorted(self, aShape, aType, ListOfInd):
4464 It works like geompy.SubShapeSortedCentres, but has a bug
4465 (wrongly defines centres of faces, shells and solids).
4468 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
4469 for ind in ListOfInd:
4470 ListOfIDs.append(AllShapeIDsList[ind - 1])
4471 anObj = self.GetSubShape(aShape, ListOfIDs)
4474 # end of l4_decompose_d
4477 ## @addtogroup l3_healing
4480 ## Apply a sequence of Shape Healing operators to the given object.
4481 # @param theShape Shape to be processed.
4482 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4483 # @param theParameters List of names of parameters
4484 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4485 # @param theValues List of values of parameters, in the same order
4486 # as parameters are listed in <VAR>theParameters</VAR> list.
4489 # <b> Operators and Parameters: </b> \n
4491 # * \b FixShape - corrects invalid shapes. \n
4492 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4493 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4495 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4496 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4497 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4498 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4500 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4501 # surfaces in segments using a certain angle. \n
4502 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4503 # if Angle=180, four if Angle=90, etc). \n
4504 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4506 # * \b SplitClosedFaces - splits closed faces in segments.
4507 # The number of segments depends on the number of splitting points.\n
4508 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4510 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4511 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4512 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4513 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4514 # This and the previous parameters can take the following values:\n
4515 # \b Parametric \b Continuity \n
4516 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4517 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4518 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4519 # ruling out sharp edges).\n
4520 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4521 # are of the same magnitude).\n
4522 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4523 # or surfaces (d/du C(u)) are the same at junction. \n
4524 # \b Geometric \b Continuity \n
4525 # \b G1: first derivatives are proportional at junction.\n
4526 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4527 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4528 # \b G2: first and second derivatives are proportional at junction.
4529 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4530 # continuity requires that the underlying parameterization was continuous as well.
4531 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4533 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4534 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4535 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4536 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4537 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4538 # with the specified parameters.\n
4539 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4540 # with the specified parameters.\n
4541 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4542 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4543 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4544 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4546 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4547 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4548 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4549 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4550 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4552 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4553 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4556 # @return New GEOM.GEOM_Object, containing processed shape.
4558 # \n @ref tui_shape_processing "Example"
4559 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4561 Apply a sequence of Shape Healing operators to the given object.
4564 theShape Shape to be processed.
4565 theValues List of values of parameters, in the same order
4566 as parameters are listed in theParameters list.
4567 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4568 theParameters List of names of parameters
4569 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4570 Operators and Parameters:
4572 * FixShape - corrects invalid shapes.
4573 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4574 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4575 * FixFaceSize - removes small faces, such as spots and strips.
4576 * FixFaceSize.Tolerance - defines minimum possible face size.
4577 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4578 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4579 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4580 in segments using a certain angle.
4581 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4582 if Angle=180, four if Angle=90, etc).
4583 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4584 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4586 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4587 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4588 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4589 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4590 * SplitContinuity.CurveContinuity - required continuity for curves.
4591 This and the previous parameters can take the following values:
4593 Parametric Continuity:
4594 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4595 coincidental. The curves or surfaces may still meet at an angle,
4596 giving rise to a sharp corner or edge).
4597 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4598 are parallel, ruling out sharp edges).
4599 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4600 or surfaces are of the same magnitude).
4601 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4602 curves or surfaces (d/du C(u)) are the same at junction.
4604 Geometric Continuity:
4605 G1: first derivatives are proportional at junction.
4606 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4607 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4608 G2: first and second derivatives are proportional at junction. As the names imply,
4609 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4610 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4611 geometric continuity of order n, but not vice-versa.
4612 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4613 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4614 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4615 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4616 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4617 the specified parameters.
4618 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4619 the specified parameters.
4620 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4621 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4622 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4623 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4624 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4625 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4626 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4627 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4628 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4629 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4630 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4633 New GEOM.GEOM_Object, containing processed shape.
4635 Note: For more information look through SALOME Geometry User's Guide->
4636 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4638 # Example: see GEOM_TestHealing.py
4639 theValues,Parameters = ParseList(theValues)
4640 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4641 # To avoid script failure in case of good argument shape
4642 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4644 RaiseIfFailed("ProcessShape", self.HealOp)
4645 for string in (theOperators + theParameters):
4646 Parameters = ":" + Parameters
4648 anObj.SetParameters(Parameters)
4651 ## Remove faces from the given object (shape).
4652 # @param theObject Shape to be processed.
4653 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4654 # removes ALL faces of the given object.
4655 # @return New GEOM.GEOM_Object, containing processed shape.
4657 # @ref tui_suppress_faces "Example"
4658 def SuppressFaces(self,theObject, theFaces):
4660 Remove faces from the given object (shape).
4663 theObject Shape to be processed.
4664 theFaces Indices of faces to be removed, if EMPTY then the method
4665 removes ALL faces of the given object.
4668 New GEOM.GEOM_Object, containing processed shape.
4670 # Example: see GEOM_TestHealing.py
4671 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4672 RaiseIfFailed("SuppressFaces", self.HealOp)
4675 ## Sewing of some shapes into single shape.
4676 # @param ListShape Shapes to be processed.
4677 # @param theTolerance Required tolerance value.
4678 # @return New GEOM.GEOM_Object, containing processed shape.
4680 # @ref tui_sewing "Example"
4681 def MakeSewing(self, ListShape, theTolerance):
4683 Sewing of some shapes into single shape.
4686 ListShape Shapes to be processed.
4687 theTolerance Required tolerance value.
4690 New GEOM.GEOM_Object, containing processed shape.
4692 # Example: see GEOM_TestHealing.py
4693 comp = self.MakeCompound(ListShape)
4694 anObj = self.Sew(comp, theTolerance)
4697 ## Sewing of the given object.
4698 # @param theObject Shape to be processed.
4699 # @param theTolerance Required tolerance value.
4700 # @return New GEOM.GEOM_Object, containing processed shape.
4701 def Sew(self, theObject, theTolerance):
4703 Sewing of the given object.
4706 theObject Shape to be processed.
4707 theTolerance Required tolerance value.
4710 New GEOM.GEOM_Object, containing processed shape.
4712 # Example: see MakeSewing() above
4713 theTolerance,Parameters = ParseParameters(theTolerance)
4714 anObj = self.HealOp.Sew(theObject, theTolerance)
4715 RaiseIfFailed("Sew", self.HealOp)
4716 anObj.SetParameters(Parameters)
4719 ## Remove internal wires and edges from the given object (face).
4720 # @param theObject Shape to be processed.
4721 # @param theWires Indices of wires to be removed, if EMPTY then the method
4722 # removes ALL internal wires of the given object.
4723 # @return New GEOM.GEOM_Object, containing processed shape.
4725 # @ref tui_suppress_internal_wires "Example"
4726 def SuppressInternalWires(self,theObject, theWires):
4728 Remove internal wires and edges from the given object (face).
4731 theObject Shape to be processed.
4732 theWires Indices of wires to be removed, if EMPTY then the method
4733 removes ALL internal wires of the given object.
4736 New GEOM.GEOM_Object, containing processed shape.
4738 # Example: see GEOM_TestHealing.py
4739 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4740 RaiseIfFailed("RemoveIntWires", self.HealOp)
4743 ## Remove internal closed contours (holes) from the given object.
4744 # @param theObject Shape to be processed.
4745 # @param theWires Indices of wires to be removed, if EMPTY then the method
4746 # removes ALL internal holes of the given object
4747 # @return New GEOM.GEOM_Object, containing processed shape.
4749 # @ref tui_suppress_holes "Example"
4750 def SuppressHoles(self,theObject, theWires):
4752 Remove internal closed contours (holes) from the given object.
4755 theObject Shape to be processed.
4756 theWires Indices of wires to be removed, if EMPTY then the method
4757 removes ALL internal holes of the given object
4760 New GEOM.GEOM_Object, containing processed shape.
4762 # Example: see GEOM_TestHealing.py
4763 anObj = self.HealOp.FillHoles(theObject, theWires)
4764 RaiseIfFailed("FillHoles", self.HealOp)
4767 ## Close an open wire.
4768 # @param theObject Shape to be processed.
4769 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4770 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4771 # @param isCommonVertex If True : closure by creation of a common vertex,
4772 # If False : closure by creation of an edge between ends.
4773 # @return New GEOM.GEOM_Object, containing processed shape.
4775 # @ref tui_close_contour "Example"
4776 def CloseContour(self,theObject, theWires, isCommonVertex):
4781 theObject Shape to be processed.
4782 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4783 if [ ], then theObject itself is a wire.
4784 isCommonVertex If True : closure by creation of a common vertex,
4785 If False : closure by creation of an edge between ends.
4788 New GEOM.GEOM_Object, containing processed shape.
4790 # Example: see GEOM_TestHealing.py
4791 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4792 RaiseIfFailed("CloseContour", self.HealOp)
4795 ## Addition of a point to a given edge object.
4796 # @param theObject Shape to be processed.
4797 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4798 # if -1, then theObject itself is the edge.
4799 # @param theValue Value of parameter on edge or length parameter,
4800 # depending on \a isByParameter.
4801 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4802 # if FALSE : \a theValue is treated as a length parameter [0..1]
4803 # @return New GEOM.GEOM_Object, containing processed shape.
4805 # @ref tui_add_point_on_edge "Example"
4806 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4808 Addition of a point to a given edge object.
4811 theObject Shape to be processed.
4812 theEdgeIndex Index of edge to be divided within theObject's shape,
4813 if -1, then theObject itself is the edge.
4814 theValue Value of parameter on edge or length parameter,
4815 depending on isByParameter.
4816 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4817 if FALSE : theValue is treated as a length parameter [0..1]
4820 New GEOM.GEOM_Object, containing processed shape.
4822 # Example: see GEOM_TestHealing.py
4823 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4824 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4825 RaiseIfFailed("DivideEdge", self.HealOp)
4826 anObj.SetParameters(Parameters)
4829 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4830 # @param theWire Wire to minimize the number of C1 continuous edges in.
4831 # @param theVertices A list of vertices to suppress. If the list
4832 # is empty, all vertices in a wire will be assumed.
4833 # @return New GEOM.GEOM_Object with modified wire.
4835 # @ref tui_fuse_collinear_edges "Example"
4836 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4838 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4841 theWire Wire to minimize the number of C1 continuous edges in.
4842 theVertices A list of vertices to suppress. If the list
4843 is empty, all vertices in a wire will be assumed.
4846 New GEOM.GEOM_Object with modified wire.
4848 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4849 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4852 ## Change orientation of the given object. Updates given shape.
4853 # @param theObject Shape to be processed.
4854 # @return Updated <var>theObject</var>
4856 # @ref swig_todo "Example"
4857 def ChangeOrientationShell(self,theObject):
4859 Change orientation of the given object. Updates given shape.
4862 theObject Shape to be processed.
4867 theObject = self.HealOp.ChangeOrientation(theObject)
4868 RaiseIfFailed("ChangeOrientation", self.HealOp)
4871 ## Change orientation of the given object.
4872 # @param theObject Shape to be processed.
4873 # @return New GEOM.GEOM_Object, containing processed shape.
4875 # @ref swig_todo "Example"
4876 def ChangeOrientationShellCopy(self, theObject):
4878 Change orientation of the given object.
4881 theObject Shape to be processed.
4884 New GEOM.GEOM_Object, containing processed shape.
4886 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4887 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4890 ## Try to limit tolerance of the given object by value \a theTolerance.
4891 # @param theObject Shape to be processed.
4892 # @param theTolerance Required tolerance value.
4893 # @return New GEOM.GEOM_Object, containing processed shape.
4895 # @ref tui_limit_tolerance "Example"
4896 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4898 Try to limit tolerance of the given object by value theTolerance.
4901 theObject Shape to be processed.
4902 theTolerance Required tolerance value.
4905 New GEOM.GEOM_Object, containing processed shape.
4907 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4908 RaiseIfFailed("LimitTolerance", self.HealOp)
4911 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4912 # that constitute a free boundary of the given shape.
4913 # @param theObject Shape to get free boundary of.
4914 # @return [\a status, \a theClosedWires, \a theOpenWires]
4915 # \n \a status: FALSE, if an error(s) occured during the method execution.
4916 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4917 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4919 # @ref tui_measurement_tools_page "Example"
4920 def GetFreeBoundary(self, theObject):
4922 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4923 that constitute a free boundary of the given shape.
4926 theObject Shape to get free boundary of.
4929 [status, theClosedWires, theOpenWires]
4930 status: FALSE, if an error(s) occured during the method execution.
4931 theClosedWires: Closed wires on the free boundary of the given shape.
4932 theOpenWires: Open wires on the free boundary of the given shape.
4934 # Example: see GEOM_TestHealing.py
4935 anObj = self.HealOp.GetFreeBoundary(theObject)
4936 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4939 ## Replace coincident faces in theShape by one face.
4940 # @param theShape Initial shape.
4941 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4942 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4943 # otherwise all initial shapes.
4944 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4946 # @ref tui_glue_faces "Example"
4947 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4949 Replace coincident faces in theShape by one face.
4952 theShape Initial shape.
4953 theTolerance Maximum distance between faces, which can be considered as coincident.
4954 doKeepNonSolids If FALSE, only solids will present in the result,
4955 otherwise all initial shapes.
4958 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4960 # Example: see GEOM_Spanner.py
4961 theTolerance,Parameters = ParseParameters(theTolerance)
4962 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4964 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4965 anObj.SetParameters(Parameters)
4968 ## Find coincident faces in theShape for possible gluing.
4969 # @param theShape Initial shape.
4970 # @param theTolerance Maximum distance between faces,
4971 # which can be considered as coincident.
4972 # @return GEOM.ListOfGO
4974 # @ref tui_glue_faces "Example"
4975 def GetGlueFaces(self, theShape, theTolerance):
4977 Find coincident faces in theShape for possible gluing.
4980 theShape Initial shape.
4981 theTolerance Maximum distance between faces,
4982 which can be considered as coincident.
4987 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4988 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4991 ## Replace coincident faces in theShape by one face
4992 # in compliance with given list of faces
4993 # @param theShape Initial shape.
4994 # @param theTolerance Maximum distance between faces,
4995 # which can be considered as coincident.
4996 # @param theFaces List of faces for gluing.
4997 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4998 # otherwise all initial shapes.
4999 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
5000 # will be glued, otherwise only the edges,
5001 # belonging to <VAR>theFaces</VAR>.
5002 # @return New GEOM.GEOM_Object, containing a copy of theShape
5003 # without some faces.
5005 # @ref tui_glue_faces "Example"
5006 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
5007 doKeepNonSolids=True, doGlueAllEdges=True):
5009 Replace coincident faces in theShape by one face
5010 in compliance with given list of faces
5013 theShape Initial shape.
5014 theTolerance Maximum distance between faces,
5015 which can be considered as coincident.
5016 theFaces List of faces for gluing.
5017 doKeepNonSolids If FALSE, only solids will present in the result,
5018 otherwise all initial shapes.
5019 doGlueAllEdges If TRUE, all coincident edges of theShape
5020 will be glued, otherwise only the edges,
5021 belonging to theFaces.
5024 New GEOM.GEOM_Object, containing a copy of theShape
5027 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
5028 doKeepNonSolids, doGlueAllEdges)
5030 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
5033 ## Replace coincident edges in theShape by one edge.
5034 # @param theShape Initial shape.
5035 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
5036 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5038 # @ref tui_glue_edges "Example"
5039 def MakeGlueEdges(self, theShape, theTolerance):
5041 Replace coincident edges in theShape by one edge.
5044 theShape Initial shape.
5045 theTolerance Maximum distance between edges, which can be considered as coincident.
5048 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5050 theTolerance,Parameters = ParseParameters(theTolerance)
5051 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
5053 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
5054 anObj.SetParameters(Parameters)
5057 ## Find coincident edges in theShape for possible gluing.
5058 # @param theShape Initial shape.
5059 # @param theTolerance Maximum distance between edges,
5060 # which can be considered as coincident.
5061 # @return GEOM.ListOfGO
5063 # @ref tui_glue_edges "Example"
5064 def GetGlueEdges(self, theShape, theTolerance):
5066 Find coincident edges in theShape for possible gluing.
5069 theShape Initial shape.
5070 theTolerance Maximum distance between edges,
5071 which can be considered as coincident.
5076 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
5077 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
5080 ## Replace coincident edges in theShape by one edge
5081 # in compliance with given list of edges.
5082 # @param theShape Initial shape.
5083 # @param theTolerance Maximum distance between edges,
5084 # which can be considered as coincident.
5085 # @param theEdges List of edges for gluing.
5086 # @return New GEOM.GEOM_Object, containing a copy of theShape
5087 # without some edges.
5089 # @ref tui_glue_edges "Example"
5090 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
5092 Replace coincident edges in theShape by one edge
5093 in compliance with given list of edges.
5096 theShape Initial shape.
5097 theTolerance Maximum distance between edges,
5098 which can be considered as coincident.
5099 theEdges List of edges for gluing.
5102 New GEOM.GEOM_Object, containing a copy of theShape
5105 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
5107 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
5113 ## @addtogroup l3_boolean Boolean Operations
5116 # -----------------------------------------------------------------------------
5117 # Boolean (Common, Cut, Fuse, Section)
5118 # -----------------------------------------------------------------------------
5120 ## Perform one of boolean operations on two given shapes.
5121 # @param theShape1 First argument for boolean operation.
5122 # @param theShape2 Second argument for boolean operation.
5123 # @param theOperation Indicates the operation to be done:\n
5124 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5125 # @return New GEOM.GEOM_Object, containing the result shape.
5127 # @ref tui_fuse "Example"
5128 def MakeBoolean(self,theShape1, theShape2, theOperation):
5130 Perform one of boolean operations on two given shapes.
5133 theShape1 First argument for boolean operation.
5134 theShape2 Second argument for boolean operation.
5135 theOperation Indicates the operation to be done:
5136 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5139 New GEOM.GEOM_Object, containing the result shape.
5141 # Example: see GEOM_TestAll.py
5142 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
5143 RaiseIfFailed("MakeBoolean", self.BoolOp)
5146 ## Perform Common boolean operation on two given shapes.
5147 # @param theShape1 First argument for boolean operation.
5148 # @param theShape2 Second argument for boolean operation.
5149 # @return New GEOM.GEOM_Object, containing the result shape.
5151 # @ref tui_common "Example 1"
5152 # \n @ref swig_MakeCommon "Example 2"
5153 def MakeCommon(self, theShape1, theShape2):
5155 Perform Common boolean operation on two given shapes.
5158 theShape1 First argument for boolean operation.
5159 theShape2 Second argument for boolean operation.
5162 New GEOM.GEOM_Object, containing the result shape.
5164 # Example: see GEOM_TestOthers.py
5165 return self.MakeBoolean(theShape1, theShape2, 1)
5167 ## Perform Cut boolean operation on two given shapes.
5168 # @param theShape1 First argument for boolean operation.
5169 # @param theShape2 Second argument for boolean operation.
5170 # @return New GEOM.GEOM_Object, containing the result shape.
5172 # @ref tui_cut "Example 1"
5173 # \n @ref swig_MakeCommon "Example 2"
5174 def MakeCut(self, theShape1, theShape2):
5176 Perform Cut boolean operation on two given shapes.
5179 theShape1 First argument for boolean operation.
5180 theShape2 Second argument for boolean operation.
5183 New GEOM.GEOM_Object, containing the result shape.
5186 # Example: see GEOM_TestOthers.py
5187 return self.MakeBoolean(theShape1, theShape2, 2)
5189 ## Perform Fuse boolean operation on two given shapes.
5190 # @param theShape1 First argument for boolean operation.
5191 # @param theShape2 Second argument for boolean operation.
5192 # @return New GEOM.GEOM_Object, containing the result shape.
5194 # @ref tui_fuse "Example 1"
5195 # \n @ref swig_MakeCommon "Example 2"
5196 def MakeFuse(self, theShape1, theShape2):
5198 Perform Fuse boolean operation on two given shapes.
5201 theShape1 First argument for boolean operation.
5202 theShape2 Second argument for boolean operation.
5205 New GEOM.GEOM_Object, containing the result shape.
5208 # Example: see GEOM_TestOthers.py
5209 return self.MakeBoolean(theShape1, theShape2, 3)
5211 ## Perform Section boolean operation on two given shapes.
5212 # @param theShape1 First argument for boolean operation.
5213 # @param theShape2 Second argument for boolean operation.
5214 # @return New GEOM.GEOM_Object, containing the result shape.
5216 # @ref tui_section "Example 1"
5217 # \n @ref swig_MakeCommon "Example 2"
5218 def MakeSection(self, theShape1, theShape2):
5220 Perform Section boolean operation on two given shapes.
5223 theShape1 First argument for boolean operation.
5224 theShape2 Second argument for boolean operation.
5227 New GEOM.GEOM_Object, containing the result shape.
5230 # Example: see GEOM_TestOthers.py
5231 return self.MakeBoolean(theShape1, theShape2, 4)
5236 ## @addtogroup l3_basic_op
5239 ## Perform partition operation.
5240 # @param ListShapes Shapes to be intersected.
5241 # @param ListTools Shapes to intersect theShapes.
5242 # @param Limit Type of resulting shapes (see ShapeType()).\n
5243 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
5244 # type will be detected automatically.
5245 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5246 # target type (equal to Limit) are kept in the result,
5247 # else standalone shapes of lower dimension
5248 # are kept also (if they exist).
5249 # @note Each compound from ListShapes and ListTools will be exploded
5250 # in order to avoid possible intersection between shapes from this compound.
5252 # After implementation new version of PartitionAlgo (October 2006)
5253 # other parameters are ignored by current functionality. They are kept
5254 # in this function only for support old versions.
5255 # @param ListKeepInside Shapes, outside which the results will be deleted.
5256 # Each shape from theKeepInside must belong to theShapes also.
5257 # @param ListRemoveInside Shapes, inside which the results will be deleted.
5258 # Each shape from theRemoveInside must belong to theShapes also.
5259 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5260 # @param ListMaterials Material indices for each shape. Make sence,
5261 # only if theRemoveWebs is TRUE.
5263 # @return New GEOM.GEOM_Object, containing the result shapes.
5265 # @ref tui_partition "Example"
5266 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5267 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5268 KeepNonlimitShapes=0):
5270 Perform partition operation.
5273 ListShapes Shapes to be intersected.
5274 ListTools Shapes to intersect theShapes.
5275 Limit Type of resulting shapes (see geompy.ShapeType)
5276 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5277 type will be detected automatically.
5278 KeepNonlimitShapes if this parameter == 0, then only shapes of
5279 target type (equal to Limit) are kept in the result,
5280 else standalone shapes of lower dimension
5281 are kept also (if they exist).
5283 Each compound from ListShapes and ListTools will be exploded
5284 in order to avoid possible intersection between shapes from
5287 After implementation new version of PartitionAlgo (October 2006) other
5288 parameters are ignored by current functionality. They are kept in this
5289 function only for support old versions.
5292 ListKeepInside Shapes, outside which the results will be deleted.
5293 Each shape from theKeepInside must belong to theShapes also.
5294 ListRemoveInside Shapes, inside which the results will be deleted.
5295 Each shape from theRemoveInside must belong to theShapes also.
5296 RemoveWebs If TRUE, perform Glue 3D algorithm.
5297 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5300 New GEOM.GEOM_Object, containing the result shapes.
5302 # Example: see GEOM_TestAll.py
5303 if Limit == ShapeType["AUTO"]:
5304 # automatic detection of the most appropriate shape limit type
5306 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5307 Limit = EnumToLong(lim)
5309 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5310 ListKeepInside, ListRemoveInside,
5311 Limit, RemoveWebs, ListMaterials,
5312 KeepNonlimitShapes);
5313 RaiseIfFailed("MakePartition", self.BoolOp)
5316 ## Perform partition operation.
5317 # This method may be useful if it is needed to make a partition for
5318 # compound contains nonintersected shapes. Performance will be better
5319 # since intersection between shapes from compound is not performed.
5321 # Description of all parameters as in previous method MakePartition()
5323 # @note Passed compounds (via ListShapes or via ListTools)
5324 # have to consist of nonintersecting shapes.
5326 # @return New GEOM.GEOM_Object, containing the result shapes.
5328 # @ref swig_todo "Example"
5329 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5330 ListKeepInside=[], ListRemoveInside=[],
5331 Limit=ShapeType["AUTO"], RemoveWebs=0,
5332 ListMaterials=[], KeepNonlimitShapes=0):
5334 Perform partition operation.
5335 This method may be useful if it is needed to make a partition for
5336 compound contains nonintersected shapes. Performance will be better
5337 since intersection between shapes from compound is not performed.
5340 Description of all parameters as in method geompy.MakePartition
5343 Passed compounds (via ListShapes or via ListTools)
5344 have to consist of nonintersecting shapes.
5347 New GEOM.GEOM_Object, containing the result shapes.
5349 if Limit == ShapeType["AUTO"]:
5350 # automatic detection of the most appropriate shape limit type
5352 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5353 Limit = EnumToLong(lim)
5355 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5356 ListKeepInside, ListRemoveInside,
5357 Limit, RemoveWebs, ListMaterials,
5358 KeepNonlimitShapes);
5359 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5362 ## See method MakePartition() for more information.
5364 # @ref tui_partition "Example 1"
5365 # \n @ref swig_Partition "Example 2"
5366 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5367 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5368 KeepNonlimitShapes=0):
5370 See method geompy.MakePartition for more information.
5372 # Example: see GEOM_TestOthers.py
5373 anObj = self.MakePartition(ListShapes, ListTools,
5374 ListKeepInside, ListRemoveInside,
5375 Limit, RemoveWebs, ListMaterials,
5376 KeepNonlimitShapes);
5379 ## Perform partition of the Shape with the Plane
5380 # @param theShape Shape to be intersected.
5381 # @param thePlane Tool shape, to intersect theShape.
5382 # @return New GEOM.GEOM_Object, containing the result shape.
5384 # @ref tui_partition "Example"
5385 def MakeHalfPartition(self,theShape, thePlane):
5387 Perform partition of the Shape with the Plane
5390 theShape Shape to be intersected.
5391 thePlane Tool shape, to intersect theShape.
5394 New GEOM.GEOM_Object, containing the result shape.
5396 # Example: see GEOM_TestAll.py
5397 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5398 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5401 # end of l3_basic_op
5404 ## @addtogroup l3_transform
5407 ## Translate the given object along the vector, specified
5408 # by its end points, creating its copy before the translation.
5409 # @param theObject The object to be translated.
5410 # @param thePoint1 Start point of translation vector.
5411 # @param thePoint2 End point of translation vector.
5412 # @return New GEOM.GEOM_Object, containing the translated object.
5414 # @ref tui_translation "Example 1"
5415 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5416 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5418 Translate the given object along the vector, specified
5419 by its end points, creating its copy before the translation.
5422 theObject The object to be translated.
5423 thePoint1 Start point of translation vector.
5424 thePoint2 End point of translation vector.
5427 New GEOM.GEOM_Object, containing the translated object.
5429 # Example: see GEOM_TestAll.py
5430 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5431 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5434 ## Translate the given object along the vector, specified by its components.
5435 # @param theObject The object to be translated.
5436 # @param theDX,theDY,theDZ Components of translation vector.
5437 # @return Translated GEOM.GEOM_Object.
5439 # @ref tui_translation "Example"
5440 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5442 Translate the given object along the vector, specified by its components.
5445 theObject The object to be translated.
5446 theDX,theDY,theDZ Components of translation vector.
5449 Translated GEOM.GEOM_Object.
5451 # Example: see GEOM_TestAll.py
5452 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5453 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5454 anObj.SetParameters(Parameters)
5455 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5458 ## Translate the given object along the vector, specified
5459 # by its components, creating its copy before the translation.
5460 # @param theObject The object to be translated.
5461 # @param theDX,theDY,theDZ Components of translation vector.
5462 # @return New GEOM.GEOM_Object, containing the translated object.
5464 # @ref tui_translation "Example"
5465 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5467 Translate the given object along the vector, specified
5468 by its components, creating its copy before the translation.
5471 theObject The object to be translated.
5472 theDX,theDY,theDZ Components of translation vector.
5475 New GEOM.GEOM_Object, containing the translated object.
5477 # Example: see GEOM_TestAll.py
5478 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5479 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5480 anObj.SetParameters(Parameters)
5481 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5484 ## Translate the given object along the given vector,
5485 # creating its copy before the translation.
5486 # @param theObject The object to be translated.
5487 # @param theVector The translation vector.
5488 # @return New GEOM.GEOM_Object, containing the translated object.
5490 # @ref tui_translation "Example"
5491 def MakeTranslationVector(self,theObject, theVector):
5493 Translate the given object along the given vector,
5494 creating its copy before the translation.
5497 theObject The object to be translated.
5498 theVector The translation vector.
5501 New GEOM.GEOM_Object, containing the translated object.
5503 # Example: see GEOM_TestAll.py
5504 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5505 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5508 ## Translate the given object along the given vector on given distance.
5509 # @param theObject The object to be translated.
5510 # @param theVector The translation vector.
5511 # @param theDistance The translation distance.
5512 # @param theCopy Flag used to translate object itself or create a copy.
5513 # @return New GEOM.GEOM_Object, containing the translated object.
5515 # @ref tui_translation "Example"
5516 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5518 Translate the given object along the given vector on given distance.
5521 theObject The object to be translated.
5522 theVector The translation vector.
5523 theDistance The translation distance.
5524 theCopy Flag used to translate object itself or create a copy.
5527 New GEOM.GEOM_Object, containing the translated object.
5529 # Example: see GEOM_TestAll.py
5530 theDistance,Parameters = ParseParameters(theDistance)
5531 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5532 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5533 anObj.SetParameters(Parameters)
5536 ## Translate the given object along the given vector on given distance,
5537 # creating its copy before the translation.
5538 # @param theObject The object to be translated.
5539 # @param theVector The translation vector.
5540 # @param theDistance The translation distance.
5541 # @return New GEOM.GEOM_Object, containing the translated object.
5543 # @ref tui_translation "Example"
5544 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5546 Translate the given object along the given vector on given distance,
5547 creating its copy before the translation.
5550 theObject The object to be translated.
5551 theVector The translation vector.
5552 theDistance The translation distance.
5555 New GEOM.GEOM_Object, containing the translated object.
5557 # Example: see GEOM_TestAll.py
5558 theDistance,Parameters = ParseParameters(theDistance)
5559 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5560 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5561 anObj.SetParameters(Parameters)
5564 ## Rotate the given object around the given axis on the given angle.
5565 # @param theObject The object to be rotated.
5566 # @param theAxis Rotation axis.
5567 # @param theAngle Rotation angle in radians.
5568 # @return New GEOM.GEOM_Object, containing the rotated object.
5570 # @ref tui_rotation "Example"
5571 def Rotate(self,theObject, theAxis, theAngle):
5573 Rotate the given object around the given axis on the given angle.
5576 theObject The object to be rotated.
5577 theAxis Rotation axis.
5578 theAngle Rotation angle in radians.
5581 New GEOM.GEOM_Object, containing the rotated object.
5583 # Example: see GEOM_TestAll.py
5585 if isinstance(theAngle,str):
5587 theAngle, Parameters = ParseParameters(theAngle)
5589 theAngle = theAngle*math.pi/180.0
5590 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5591 RaiseIfFailed("RotateCopy", self.TrsfOp)
5592 anObj.SetParameters(Parameters)
5595 ## Rotate the given object around the given axis
5596 # on the given angle, creating its copy before the rotatation.
5597 # @param theObject The object to be rotated.
5598 # @param theAxis Rotation axis.
5599 # @param theAngle Rotation angle in radians.
5600 # @return New GEOM.GEOM_Object, containing the rotated object.
5602 # @ref tui_rotation "Example"
5603 def MakeRotation(self,theObject, theAxis, theAngle):
5605 Rotate the given object around the given axis
5606 on the given angle, creating its copy before the rotatation.
5609 theObject The object to be rotated.
5610 theAxis Rotation axis.
5611 theAngle Rotation angle in radians.
5614 New GEOM.GEOM_Object, containing the rotated object.
5616 # Example: see GEOM_TestAll.py
5618 if isinstance(theAngle,str):
5620 theAngle, Parameters = ParseParameters(theAngle)
5622 theAngle = theAngle*math.pi/180.0
5623 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5624 RaiseIfFailed("RotateCopy", self.TrsfOp)
5625 anObj.SetParameters(Parameters)
5628 ## Rotate given object around vector perpendicular to plane
5629 # containing three points, creating its copy before the rotatation.
5630 # @param theObject The object to be rotated.
5631 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5632 # containing the three points.
5633 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5634 # @return New GEOM.GEOM_Object, containing the rotated object.
5636 # @ref tui_rotation "Example"
5637 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5639 Rotate given object around vector perpendicular to plane
5640 containing three points, creating its copy before the rotatation.
5643 theObject The object to be rotated.
5644 theCentPoint central point the axis is the vector perpendicular to the plane
5645 containing the three points.
5646 thePoint1,thePoint2 in a perpendicular plane of the axis.
5649 New GEOM.GEOM_Object, containing the rotated object.
5651 # Example: see GEOM_TestAll.py
5652 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5653 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5656 ## Scale the given object by the factor, creating its copy before the scaling.
5657 # @param theObject The object to be scaled.
5658 # @param thePoint Center point for scaling.
5659 # Passing None for it means scaling relatively the origin of global CS.
5660 # @param theFactor Scaling factor value.
5661 # @return New GEOM.GEOM_Object, containing the scaled shape.
5663 # @ref tui_scale "Example"
5664 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5666 Scale the given object by the factor, creating its copy before the scaling.
5669 theObject The object to be scaled.
5670 thePoint Center point for scaling.
5671 Passing None for it means scaling relatively the origin of global CS.
5672 theFactor Scaling factor value.
5675 New GEOM.GEOM_Object, containing the scaled shape.
5677 # Example: see GEOM_TestAll.py
5678 theFactor, Parameters = ParseParameters(theFactor)
5679 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5680 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5681 anObj.SetParameters(Parameters)
5684 ## Scale the given object by different factors along coordinate axes,
5685 # creating its copy before the scaling.
5686 # @param theObject The object to be scaled.
5687 # @param thePoint Center point for scaling.
5688 # Passing None for it means scaling relatively the origin of global CS.
5689 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5690 # @return New GEOM.GEOM_Object, containing the scaled shape.
5692 # @ref swig_scale "Example"
5693 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5695 Scale the given object by different factors along coordinate axes,
5696 creating its copy before the scaling.
5699 theObject The object to be scaled.
5700 thePoint Center point for scaling.
5701 Passing None for it means scaling relatively the origin of global CS.
5702 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5705 New GEOM.GEOM_Object, containing the scaled shape.
5707 # Example: see GEOM_TestAll.py
5708 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5709 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5710 theFactorX, theFactorY, theFactorZ)
5711 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5712 anObj.SetParameters(Parameters)
5715 ## Create an object, symmetrical
5716 # to the given one relatively the given plane.
5717 # @param theObject The object to be mirrored.
5718 # @param thePlane Plane of symmetry.
5719 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5721 # @ref tui_mirror "Example"
5722 def MakeMirrorByPlane(self,theObject, thePlane):
5724 Create an object, symmetrical to the given one relatively the given plane.
5727 theObject The object to be mirrored.
5728 thePlane Plane of symmetry.
5731 New GEOM.GEOM_Object, containing the mirrored shape.
5733 # Example: see GEOM_TestAll.py
5734 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5735 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5738 ## Create an object, symmetrical
5739 # to the given one relatively the given axis.
5740 # @param theObject The object to be mirrored.
5741 # @param theAxis Axis of symmetry.
5742 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5744 # @ref tui_mirror "Example"
5745 def MakeMirrorByAxis(self,theObject, theAxis):
5747 Create an object, symmetrical to the given one relatively the given axis.
5750 theObject The object to be mirrored.
5751 theAxis Axis of symmetry.
5754 New GEOM.GEOM_Object, containing the mirrored shape.
5756 # Example: see GEOM_TestAll.py
5757 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5758 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5761 ## Create an object, symmetrical
5762 # to the given one relatively the given point.
5763 # @param theObject The object to be mirrored.
5764 # @param thePoint Point of symmetry.
5765 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5767 # @ref tui_mirror "Example"
5768 def MakeMirrorByPoint(self,theObject, thePoint):
5770 Create an object, symmetrical
5771 to the given one relatively the given point.
5774 theObject The object to be mirrored.
5775 thePoint Point of symmetry.
5778 New GEOM.GEOM_Object, containing the mirrored shape.
5780 # Example: see GEOM_TestAll.py
5781 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5782 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5785 ## Modify the Location of the given object by LCS,
5786 # creating its copy before the setting.
5787 # @param theObject The object to be displaced.
5788 # @param theStartLCS Coordinate system to perform displacement from it.\n
5789 # If \a theStartLCS is NULL, displacement
5790 # will be performed from global CS.\n
5791 # If \a theObject itself is used as \a theStartLCS,
5792 # its location will be changed to \a theEndLCS.
5793 # @param theEndLCS Coordinate system to perform displacement to it.
5794 # @return New GEOM.GEOM_Object, containing the displaced shape.
5796 # @ref tui_modify_location "Example"
5797 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5799 Modify the Location of the given object by LCS, creating its copy before the setting.
5802 theObject The object to be displaced.
5803 theStartLCS Coordinate system to perform displacement from it.
5804 If theStartLCS is NULL, displacement
5805 will be performed from global CS.
5806 If theObject itself is used as theStartLCS,
5807 its location will be changed to theEndLCS.
5808 theEndLCS Coordinate system to perform displacement to it.
5811 New GEOM.GEOM_Object, containing the displaced shape.
5814 # create local coordinate systems
5815 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5816 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5817 # modify the location of the given object
5818 position = geompy.MakePosition(cylinder, cs1, cs2)
5820 # Example: see GEOM_TestAll.py
5821 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5822 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5825 ## Modify the Location of the given object by Path,
5826 # @param theObject The object to be displaced.
5827 # @param thePath Wire or Edge along that the object will be translated.
5828 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5829 # @param theCopy is to create a copy objects if true.
5830 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5831 # @return New GEOM.GEOM_Object, containing the displaced shape.
5833 # @ref tui_modify_location "Example"
5834 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5836 Modify the Location of the given object by Path
5839 theObject The object to be displaced.
5840 thePath Wire or Edge along that the object will be translated.
5841 theDistance progress of Path (0 = start location, 1 = end of path location).
5842 theCopy is to create a copy objects if true.
5843 theReverse 0 - for usual direction, 1 - to reverse path direction.
5846 New GEOM.GEOM_Object, containing the displaced shape.
5849 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5851 # Example: see GEOM_TestAll.py
5852 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5853 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5856 ## Create new object as offset of the given one.
5857 # @param theObject The base object for the offset.
5858 # @param theOffset Offset value.
5859 # @return New GEOM.GEOM_Object, containing the offset object.
5861 # @ref tui_offset "Example"
5862 def MakeOffset(self,theObject, theOffset):
5864 Create new object as offset of the given one.
5867 theObject The base object for the offset.
5868 theOffset Offset value.
5871 New GEOM.GEOM_Object, containing the offset object.
5874 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5875 # create a new object as offset of the given object
5876 offset = geompy.MakeOffset(box, 70.)
5878 # Example: see GEOM_TestAll.py
5879 theOffset, Parameters = ParseParameters(theOffset)
5880 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5881 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5882 anObj.SetParameters(Parameters)
5885 ## Create new object as projection of the given one on a 2D surface.
5886 # @param theSource The source object for the projection. It can be a point, edge or wire.
5887 # @param theTarget The target object. It can be planar or cylindrical face.
5888 # @return New GEOM.GEOM_Object, containing the projection.
5890 # @ref tui_projection "Example"
5891 def MakeProjection(self, theSource, theTarget):
5893 Create new object as projection of the given one on a 2D surface.
5896 theSource The source object for the projection. It can be a point, edge or wire.
5897 theTarget The target object. It can be planar or cylindrical face.
5900 New GEOM.GEOM_Object, containing the projection.
5902 # Example: see GEOM_TestAll.py
5903 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5904 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5907 # -----------------------------------------------------------------------------
5909 # -----------------------------------------------------------------------------
5911 ## Translate the given object along the given vector a given number times
5912 # @param theObject The object to be translated.
5913 # @param theVector Direction of the translation.
5914 # @param theStep Distance to translate on.
5915 # @param theNbTimes Quantity of translations to be done.
5916 # @return New GEOM.GEOM_Object, containing compound of all
5917 # the shapes, obtained after each translation.
5919 # @ref tui_multi_translation "Example"
5920 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5922 Translate the given object along the given vector a given number times
5925 theObject The object to be translated.
5926 theVector Direction of the translation.
5927 theStep Distance to translate on.
5928 theNbTimes Quantity of translations to be done.
5931 New GEOM.GEOM_Object, containing compound of all
5932 the shapes, obtained after each translation.
5935 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5937 # Example: see GEOM_TestAll.py
5938 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5939 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5940 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5941 anObj.SetParameters(Parameters)
5944 ## Conseqently apply two specified translations to theObject specified number of times.
5945 # @param theObject The object to be translated.
5946 # @param theVector1 Direction of the first translation.
5947 # @param theStep1 Step of the first translation.
5948 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5949 # @param theVector2 Direction of the second translation.
5950 # @param theStep2 Step of the second translation.
5951 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5952 # @return New GEOM.GEOM_Object, containing compound of all
5953 # the shapes, obtained after each translation.
5955 # @ref tui_multi_translation "Example"
5956 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5957 theVector2, theStep2, theNbTimes2):
5959 Conseqently apply two specified translations to theObject specified number of times.
5962 theObject The object to be translated.
5963 theVector1 Direction of the first translation.
5964 theStep1 Step of the first translation.
5965 theNbTimes1 Quantity of translations to be done along theVector1.
5966 theVector2 Direction of the second translation.
5967 theStep2 Step of the second translation.
5968 theNbTimes2 Quantity of translations to be done along theVector2.
5971 New GEOM.GEOM_Object, containing compound of all
5972 the shapes, obtained after each translation.
5975 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5977 # Example: see GEOM_TestAll.py
5978 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5979 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5980 theVector2, theStep2, theNbTimes2)
5981 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5982 anObj.SetParameters(Parameters)
5985 ## Rotate the given object around the given axis a given number times.
5986 # Rotation angle will be 2*PI/theNbTimes.
5987 # @param theObject The object to be rotated.
5988 # @param theAxis The rotation axis.
5989 # @param theNbTimes Quantity of rotations to be done.
5990 # @return New GEOM.GEOM_Object, containing compound of all the
5991 # shapes, obtained after each rotation.
5993 # @ref tui_multi_rotation "Example"
5994 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5996 Rotate the given object around the given axis a given number times.
5997 Rotation angle will be 2*PI/theNbTimes.
6000 theObject The object to be rotated.
6001 theAxis The rotation axis.
6002 theNbTimes Quantity of rotations to be done.
6005 New GEOM.GEOM_Object, containing compound of all the
6006 shapes, obtained after each rotation.
6009 rot1d = geompy.MultiRotate1D(prism, vect, 4)
6011 # Example: see GEOM_TestAll.py
6012 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
6013 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
6014 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
6015 anObj.SetParameters(Parameters)
6018 ## Rotate the given object around the
6019 # given axis on the given angle a given number
6020 # times and multi-translate each rotation result.
6021 # Translation direction passes through center of gravity
6022 # of rotated shape and its projection on the rotation axis.
6023 # @param theObject The object to be rotated.
6024 # @param theAxis Rotation axis.
6025 # @param theAngle Rotation angle in graduces.
6026 # @param theNbTimes1 Quantity of rotations to be done.
6027 # @param theStep Translation distance.
6028 # @param theNbTimes2 Quantity of translations to be done.
6029 # @return New GEOM.GEOM_Object, containing compound of all the
6030 # shapes, obtained after each transformation.
6032 # @ref tui_multi_rotation "Example"
6033 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
6035 Rotate the given object around the
6036 given axis on the given angle a given number
6037 times and multi-translate each rotation result.
6038 Translation direction passes through center of gravity
6039 of rotated shape and its projection on the rotation axis.
6042 theObject The object to be rotated.
6043 theAxis Rotation axis.
6044 theAngle Rotation angle in graduces.
6045 theNbTimes1 Quantity of rotations to be done.
6046 theStep Translation distance.
6047 theNbTimes2 Quantity of translations to be done.
6050 New GEOM.GEOM_Object, containing compound of all the
6051 shapes, obtained after each transformation.
6054 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
6056 # Example: see GEOM_TestAll.py
6057 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
6058 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
6059 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
6060 anObj.SetParameters(Parameters)
6063 ## The same, as MultiRotate1D(), but axis is given by direction and point
6065 # @ref swig_MakeMultiRotation "Example"
6066 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
6068 The same, as geompy.MultiRotate1D, but axis is given by direction and point
6071 pz = geompy.MakeVertex(0, 0, 100)
6072 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6073 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
6075 # Example: see GEOM_TestOthers.py
6076 aVec = self.MakeLine(aPoint,aDir)
6077 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
6080 ## The same, as MultiRotate2D(), but axis is given by direction and point
6082 # @ref swig_MakeMultiRotation "Example"
6083 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
6085 The same, as MultiRotate2D(), but axis is given by direction and point
6088 pz = geompy.MakeVertex(0, 0, 100)
6089 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6090 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
6092 # Example: see GEOM_TestOthers.py
6093 aVec = self.MakeLine(aPoint,aDir)
6094 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
6097 # end of l3_transform
6100 ## @addtogroup l3_local
6103 ## Perform a fillet on all edges of the given shape.
6104 # @param theShape Shape, to perform fillet on.
6105 # @param theR Fillet radius.
6106 # @return New GEOM.GEOM_Object, containing the result shape.
6108 # @ref tui_fillet "Example 1"
6109 # \n @ref swig_MakeFilletAll "Example 2"
6110 def MakeFilletAll(self,theShape, theR):
6112 Perform a fillet on all edges of the given shape.
6115 theShape Shape, to perform fillet on.
6119 New GEOM.GEOM_Object, containing the result shape.
6122 filletall = geompy.MakeFilletAll(prism, 10.)
6124 # Example: see GEOM_TestOthers.py
6125 theR,Parameters = ParseParameters(theR)
6126 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
6127 RaiseIfFailed("MakeFilletAll", self.LocalOp)
6128 anObj.SetParameters(Parameters)
6131 ## Perform a fillet on the specified edges/faces of the given shape
6132 # @param theShape Shape, to perform fillet on.
6133 # @param theR Fillet radius.
6134 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
6135 # @param theListShapes Global indices of edges/faces to perform fillet on.
6136 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6137 # @return New GEOM.GEOM_Object, containing the result shape.
6139 # @ref tui_fillet "Example"
6140 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
6142 Perform a fillet on the specified edges/faces of the given shape
6145 theShape Shape, to perform fillet on.
6147 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
6148 theListShapes Global indices of edges/faces to perform fillet on.
6151 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6154 New GEOM.GEOM_Object, containing the result shape.
6157 # get the list of IDs (IDList) for the fillet
6158 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6160 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6161 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6162 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6163 # make a fillet on the specified edges of the given shape
6164 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
6166 # Example: see GEOM_TestAll.py
6167 theR,Parameters = ParseParameters(theR)
6169 if theShapeType == ShapeType["EDGE"]:
6170 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6171 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6173 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6174 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6175 anObj.SetParameters(Parameters)
6178 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6179 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6181 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6184 # get the list of IDs (IDList) for the fillet
6185 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6187 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6188 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6189 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6190 # make a fillet on the specified edges of the given shape
6191 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6193 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6195 if theShapeType == ShapeType["EDGE"]:
6196 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6197 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6199 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6200 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6201 anObj.SetParameters(Parameters)
6204 ## Perform a fillet on the specified edges of the given shape
6205 # @param theShape Wire Shape to perform fillet on.
6206 # @param theR Fillet radius.
6207 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6208 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6209 # \note The list of vertices could be empty,
6210 # in this case fillet will done done at all vertices in wire
6211 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6212 # by the length of the edges, nearest to the fillet vertex.
6213 # But sometimes the next edge is C1 continuous with the one, nearest to
6214 # the fillet point, and such two (or more) edges can be united to allow
6215 # bigger radius. Set this flag to TRUE to allow collinear edges union,
6216 # thus ignoring the secant vertex (vertices).
6217 # @return New GEOM.GEOM_Object, containing the result shape.
6219 # @ref tui_fillet2d "Example"
6220 def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6222 Perform a fillet on the specified edges of the given shape
6225 theShape Wire Shape to perform fillet on.
6227 theListOfVertexes Global indices of vertexes to perform fillet on.
6228 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6229 by the length of the edges, nearest to the fillet vertex.
6230 But sometimes the next edge is C1 continuous with the one, nearest to
6231 the fillet point, and such two (or more) edges can be united to allow
6232 bigger radius. Set this flag to TRUE to allow collinear edges union,
6233 thus ignoring the secant vertex (vertices).
6235 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6237 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6240 New GEOM.GEOM_Object, containing the result shape.
6244 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6245 # make fillet at given wire vertices with giver radius
6246 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6248 # Example: see GEOM_TestAll.py
6249 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6250 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6251 RaiseIfFailed("MakeFillet1D", self.LocalOp)
6252 anObj.SetParameters(Parameters)
6255 ## Perform a fillet at the specified vertices of the given face/shell.
6256 # @param theShape Face or Shell shape to perform fillet on.
6257 # @param theR Fillet radius.
6258 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6259 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6260 # @return New GEOM.GEOM_Object, containing the result shape.
6262 # @ref tui_fillet2d "Example"
6263 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6265 Perform a fillet at the specified vertices of the given face/shell.
6268 theShape Face or Shell shape to perform fillet on.
6270 theListOfVertexes Global indices of vertexes to perform fillet on.
6272 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6275 New GEOM.GEOM_Object, containing the result shape.
6278 face = geompy.MakeFaceHW(100, 100, 1)
6279 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6281 # Example: see GEOM_TestAll.py
6282 theR,Parameters = ParseParameters(theR)
6283 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6284 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6285 anObj.SetParameters(Parameters)
6288 ## Perform a symmetric chamfer on all edges of the given shape.
6289 # @param theShape Shape, to perform chamfer on.
6290 # @param theD Chamfer size along each face.
6291 # @return New GEOM.GEOM_Object, containing the result shape.
6293 # @ref tui_chamfer "Example 1"
6294 # \n @ref swig_MakeChamferAll "Example 2"
6295 def MakeChamferAll(self,theShape, theD):
6297 Perform a symmetric chamfer on all edges of the given shape.
6300 theShape Shape, to perform chamfer on.
6301 theD Chamfer size along each face.
6304 New GEOM.GEOM_Object, containing the result shape.
6307 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6309 # Example: see GEOM_TestOthers.py
6310 theD,Parameters = ParseParameters(theD)
6311 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6312 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6313 anObj.SetParameters(Parameters)
6316 ## Perform a chamfer on edges, common to the specified faces,
6317 # with distance D1 on the Face1
6318 # @param theShape Shape, to perform chamfer on.
6319 # @param theD1 Chamfer size along \a theFace1.
6320 # @param theD2 Chamfer size along \a theFace2.
6321 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6322 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6323 # @return New GEOM.GEOM_Object, containing the result shape.
6325 # @ref tui_chamfer "Example"
6326 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6328 Perform a chamfer on edges, common to the specified faces,
6329 with distance D1 on the Face1
6332 theShape Shape, to perform chamfer on.
6333 theD1 Chamfer size along theFace1.
6334 theD2 Chamfer size along theFace2.
6335 theFace1,theFace2 Global indices of two faces of theShape.
6338 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6341 New GEOM.GEOM_Object, containing the result shape.
6344 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6345 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6346 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6347 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6349 # Example: see GEOM_TestAll.py
6350 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6351 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6352 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6353 anObj.SetParameters(Parameters)
6356 ## Perform a chamfer on edges
6357 # @param theShape Shape, to perform chamfer on.
6358 # @param theD Chamfer length
6359 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6360 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6361 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6362 # @return New GEOM.GEOM_Object, containing the result shape.
6363 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6365 Perform a chamfer on edges
6368 theShape Shape, to perform chamfer on.
6369 theD1 Chamfer size along theFace1.
6370 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6371 theFace1,theFace2 Global indices of two faces of theShape.
6374 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6377 New GEOM.GEOM_Object, containing the result shape.
6380 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6381 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6382 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6384 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6387 if isinstance(theAngle,str):
6389 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6391 theAngle = theAngle*math.pi/180.0
6392 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6393 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6394 anObj.SetParameters(Parameters)
6397 ## Perform a chamfer on all edges of the specified faces,
6398 # with distance D1 on the first specified face (if several for one edge)
6399 # @param theShape Shape, to perform chamfer on.
6400 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6401 # connected to the edge, are in \a theFaces, \a theD1
6402 # will be get along face, which is nearer to \a theFaces beginning.
6403 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6404 # @param theFaces Sequence of global indices of faces of \a theShape.
6405 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6406 # @return New GEOM.GEOM_Object, containing the result shape.
6408 # @ref tui_chamfer "Example"
6409 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6411 Perform a chamfer on all edges of the specified faces,
6412 with distance D1 on the first specified face (if several for one edge)
6415 theShape Shape, to perform chamfer on.
6416 theD1 Chamfer size along face from theFaces. If both faces,
6417 connected to the edge, are in theFaces, theD1
6418 will be get along face, which is nearer to theFaces beginning.
6419 theD2 Chamfer size along another of two faces, connected to the edge.
6420 theFaces Sequence of global indices of faces of theShape.
6423 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6426 New GEOM.GEOM_Object, containing the result shape.
6428 # Example: see GEOM_TestAll.py
6429 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6430 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6431 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6432 anObj.SetParameters(Parameters)
6435 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6436 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6438 # @ref swig_FilletChamfer "Example"
6439 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6441 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6442 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6445 if isinstance(theAngle,str):
6447 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6449 theAngle = theAngle*math.pi/180.0
6450 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6451 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6452 anObj.SetParameters(Parameters)
6455 ## Perform a chamfer on edges,
6456 # with distance D1 on the first specified face (if several for one edge)
6457 # @param theShape Shape, to perform chamfer on.
6458 # @param theD1,theD2 Chamfer size
6459 # @param theEdges Sequence of edges of \a theShape.
6460 # @return New GEOM.GEOM_Object, containing the result shape.
6462 # @ref swig_FilletChamfer "Example"
6463 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6465 Perform a chamfer on edges,
6466 with distance D1 on the first specified face (if several for one edge)
6469 theShape Shape, to perform chamfer on.
6470 theD1,theD2 Chamfer size
6471 theEdges Sequence of edges of theShape.
6474 New GEOM.GEOM_Object, containing the result shape.
6476 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6477 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6478 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6479 anObj.SetParameters(Parameters)
6482 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6483 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6484 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6486 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6487 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6490 if isinstance(theAngle,str):
6492 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6494 theAngle = theAngle*math.pi/180.0
6495 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6496 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6497 anObj.SetParameters(Parameters)
6500 ## /sa MakeChamferEdge() and MakeChamferFaces()
6502 # @ref swig_MakeChamfer "Example"
6503 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6505 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6507 # Example: see GEOM_TestOthers.py
6509 if aShapeType == ShapeType["EDGE"]:
6510 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6512 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6515 ## Remove material from a solid by extrusion of the base shape on the given distance.
6516 # @param theInit Shape to remove material from. It must be a solid or
6517 # a compound made of a single solid.
6518 # @param theBase Closed edge or wire defining the base shape to be extruded.
6519 # @param theH Prism dimension along the normal to theBase
6520 # @param theAngle Draft angle in degrees.
6521 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6523 # @ref tui_creation_prism "Example"
6524 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6526 Add material to a solid by extrusion of the base shape on the given distance.
6529 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6530 theBase Closed edge or wire defining the base shape to be extruded.
6531 theH Prism dimension along the normal to theBase
6532 theAngle Draft angle in degrees.
6535 New GEOM.GEOM_Object, containing the initial shape with removed material.
6537 # Example: see GEOM_TestAll.py
6538 #theH,Parameters = ParseParameters(theH)
6539 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6540 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6541 #anObj.SetParameters(Parameters)
6544 ## Add material to a solid by extrusion of the base shape on the given distance.
6545 # @param theInit Shape to add material to. It must be a solid or
6546 # a compound made of a single solid.
6547 # @param theBase Closed edge or wire defining the base shape to be extruded.
6548 # @param theH Prism dimension along the normal to theBase
6549 # @param theAngle Draft angle in degrees.
6550 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6552 # @ref tui_creation_prism "Example"
6553 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6555 Add material to a solid by extrusion of the base shape on the given distance.
6558 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6559 theBase Closed edge or wire defining the base shape to be extruded.
6560 theH Prism dimension along the normal to theBase
6561 theAngle Draft angle in degrees.
6564 New GEOM.GEOM_Object, containing the initial shape with added material.
6566 # Example: see GEOM_TestAll.py
6567 #theH,Parameters = ParseParameters(theH)
6568 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6569 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6570 #anObj.SetParameters(Parameters)
6576 ## @addtogroup l3_basic_op
6579 ## Perform an Archimde operation on the given shape with given parameters.
6580 # The object presenting the resulting face is returned.
6581 # @param theShape Shape to be put in water.
6582 # @param theWeight Weight og the shape.
6583 # @param theWaterDensity Density of the water.
6584 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6585 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6586 # by a plane, corresponding to water level.
6588 # @ref tui_archimede "Example"
6589 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6591 Perform an Archimde operation on the given shape with given parameters.
6592 The object presenting the resulting face is returned.
6595 theShape Shape to be put in water.
6596 theWeight Weight og the shape.
6597 theWaterDensity Density of the water.
6598 theMeshDeflection Deflection of the mesh, using to compute the section.
6601 New GEOM.GEOM_Object, containing a section of theShape
6602 by a plane, corresponding to water level.
6604 # Example: see GEOM_TestAll.py
6605 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6606 theWeight,theWaterDensity,theMeshDeflection)
6607 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6608 RaiseIfFailed("MakeArchimede", self.LocalOp)
6609 anObj.SetParameters(Parameters)
6612 # end of l3_basic_op
6615 ## @addtogroup l2_measure
6618 ## Get point coordinates
6621 # @ref tui_measurement_tools_page "Example"
6622 def PointCoordinates(self,Point):
6624 Get point coordinates
6629 # Example: see GEOM_TestMeasures.py
6630 aTuple = self.MeasuOp.PointCoordinates(Point)
6631 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6634 ## Get summarized length of all wires,
6635 # area of surface and volume of the given shape.
6636 # @param theShape Shape to define properties of.
6637 # @return [theLength, theSurfArea, theVolume]\n
6638 # theLength: Summarized length of all wires of the given shape.\n
6639 # theSurfArea: Area of surface of the given shape.\n
6640 # theVolume: Volume of the given shape.
6642 # @ref tui_measurement_tools_page "Example"
6643 def BasicProperties(self,theShape):
6645 Get summarized length of all wires,
6646 area of surface and volume of the given shape.
6649 theShape Shape to define properties of.
6652 [theLength, theSurfArea, theVolume]
6653 theLength: Summarized length of all wires of the given shape.
6654 theSurfArea: Area of surface of the given shape.
6655 theVolume: Volume of the given shape.
6657 # Example: see GEOM_TestMeasures.py
6658 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6659 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6662 ## Get parameters of bounding box of the given shape
6663 # @param theShape Shape to obtain bounding box of.
6664 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6665 # Xmin,Xmax: Limits of shape along OX axis.
6666 # Ymin,Ymax: Limits of shape along OY axis.
6667 # Zmin,Zmax: Limits of shape along OZ axis.
6669 # @ref tui_measurement_tools_page "Example"
6670 def BoundingBox(self,theShape):
6672 Get parameters of bounding box of the given shape
6675 theShape Shape to obtain bounding box of.
6678 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6679 Xmin,Xmax: Limits of shape along OX axis.
6680 Ymin,Ymax: Limits of shape along OY axis.
6681 Zmin,Zmax: Limits of shape along OZ axis.
6683 # Example: see GEOM_TestMeasures.py
6684 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6685 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6688 ## Get inertia matrix and moments of inertia of theShape.
6689 # @param theShape Shape to calculate inertia of.
6690 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6691 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6692 # Ix,Iy,Iz: Moments of inertia of the given shape.
6694 # @ref tui_measurement_tools_page "Example"
6695 def Inertia(self,theShape):
6697 Get inertia matrix and moments of inertia of theShape.
6700 theShape Shape to calculate inertia of.
6703 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6704 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6705 Ix,Iy,Iz: Moments of inertia of the given shape.
6707 # Example: see GEOM_TestMeasures.py
6708 aTuple = self.MeasuOp.GetInertia(theShape)
6709 RaiseIfFailed("GetInertia", self.MeasuOp)
6712 ## Get if coords are included in the shape (ST_IN or ST_ON)
6713 # @param theShape Shape
6714 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6715 # @param tolerance to be used (default is 1.0e-7)
6716 # @return list_of_boolean = [res1, res2, ...]
6717 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6719 Get if coords are included in the shape (ST_IN or ST_ON)
6723 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6724 tolerance to be used (default is 1.0e-7)
6727 list_of_boolean = [res1, res2, ...]
6729 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6731 ## Get minimal distance between the given shapes.
6732 # @param theShape1,theShape2 Shapes to find minimal distance between.
6733 # @return Value of the minimal distance between the given shapes.
6735 # @ref tui_measurement_tools_page "Example"
6736 def MinDistance(self, theShape1, theShape2):
6738 Get minimal distance between the given shapes.
6741 theShape1,theShape2 Shapes to find minimal distance between.
6744 Value of the minimal distance between the given shapes.
6746 # Example: see GEOM_TestMeasures.py
6747 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6748 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6751 ## Get minimal distance between the given shapes.
6752 # @param theShape1,theShape2 Shapes to find minimal distance between.
6753 # @return Value of the minimal distance between the given shapes.
6755 # @ref swig_all_measure "Example"
6756 def MinDistanceComponents(self, theShape1, theShape2):
6758 Get minimal distance between the given shapes.
6761 theShape1,theShape2 Shapes to find minimal distance between.
6764 Value of the minimal distance between the given shapes.
6766 # Example: see GEOM_TestMeasures.py
6767 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6768 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6769 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6772 ## Get angle between the given shapes in degrees.
6773 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6774 # @note If both arguments are vectors, the angle is computed in accordance
6775 # with their orientations, otherwise the minimum angle is computed.
6776 # @return Value of the angle between the given shapes in degrees.
6778 # @ref tui_measurement_tools_page "Example"
6779 def GetAngle(self, theShape1, theShape2):
6781 Get angle between the given shapes in degrees.
6784 theShape1,theShape2 Lines or linear edges to find angle between.
6787 If both arguments are vectors, the angle is computed in accordance
6788 with their orientations, otherwise the minimum angle is computed.
6791 Value of the angle between the given shapes in degrees.
6793 # Example: see GEOM_TestMeasures.py
6794 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6795 RaiseIfFailed("GetAngle", self.MeasuOp)
6798 ## Get angle between the given shapes in radians.
6799 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6800 # @note If both arguments are vectors, the angle is computed in accordance
6801 # with their orientations, otherwise the minimum angle is computed.
6802 # @return Value of the angle between the given shapes in radians.
6804 # @ref tui_measurement_tools_page "Example"
6805 def GetAngleRadians(self, theShape1, theShape2):
6807 Get angle between the given shapes in radians.
6810 theShape1,theShape2 Lines or linear edges to find angle between.
6814 If both arguments are vectors, the angle is computed in accordance
6815 with their orientations, otherwise the minimum angle is computed.
6818 Value of the angle between the given shapes in radians.
6820 # Example: see GEOM_TestMeasures.py
6821 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6822 RaiseIfFailed("GetAngle", self.MeasuOp)
6825 ## Get angle between the given vectors in degrees.
6826 # @param theShape1,theShape2 Vectors to find angle between.
6827 # @param theFlag If True, the normal vector is defined by the two vectors cross,
6828 # if False, the opposite vector to the normal vector is used.
6829 # @return Value of the angle between the given vectors in degrees.
6831 # @ref tui_measurement_tools_page "Example"
6832 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6834 Get angle between the given vectors in degrees.
6837 theShape1,theShape2 Vectors to find angle between.
6838 theFlag If True, the normal vector is defined by the two vectors cross,
6839 if False, the opposite vector to the normal vector is used.
6842 Value of the angle between the given vectors in degrees.
6844 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6846 anAngle = 360. - anAngle
6847 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6850 ## The same as GetAngleVectors, but the result is in radians.
6851 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6853 Get angle between the given vectors in radians.
6856 theShape1,theShape2 Vectors to find angle between.
6857 theFlag If True, the normal vector is defined by the two vectors cross,
6858 if False, the opposite vector to the normal vector is used.
6861 Value of the angle between the given vectors in radians.
6863 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6866 ## @name Curve Curvature Measurement
6867 # Methods for receiving radius of curvature of curves
6868 # in the given point
6871 ## Measure curvature of a curve at a point, set by parameter.
6872 # @param theCurve a curve.
6873 # @param theParam parameter.
6874 # @return radius of curvature of \a theCurve.
6876 # @ref swig_todo "Example"
6877 def CurveCurvatureByParam(self, theCurve, theParam):
6879 Measure curvature of a curve at a point, set by parameter.
6886 radius of curvature of theCurve.
6888 # Example: see GEOM_TestMeasures.py
6889 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6890 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6893 ## Measure curvature of a curve at a point.
6894 # @param theCurve a curve.
6895 # @param thePoint given point.
6896 # @return radius of curvature of \a theCurve.
6898 # @ref swig_todo "Example"
6899 def CurveCurvatureByPoint(self, theCurve, thePoint):
6901 Measure curvature of a curve at a point.
6905 thePoint given point.
6908 radius of curvature of theCurve.
6910 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6911 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6915 ## @name Surface Curvature Measurement
6916 # Methods for receiving max and min radius of curvature of surfaces
6917 # in the given point
6920 ## Measure max radius of curvature of surface.
6921 # @param theSurf the given surface.
6922 # @param theUParam Value of U-parameter on the referenced surface.
6923 # @param theVParam Value of V-parameter on the referenced surface.
6924 # @return max radius of curvature of theSurf.
6926 ## @ref swig_todo "Example"
6927 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6929 Measure max radius of curvature of surface.
6932 theSurf the given surface.
6933 theUParam Value of U-parameter on the referenced surface.
6934 theVParam Value of V-parameter on the referenced surface.
6937 max radius of curvature of theSurf.
6939 # Example: see GEOM_TestMeasures.py
6940 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6941 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6944 ## Measure max radius of curvature of surface in the given point
6945 # @param theSurf the given surface.
6946 # @param thePoint given point.
6947 # @return max radius of curvature of theSurf.
6949 ## @ref swig_todo "Example"
6950 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6952 Measure max radius of curvature of surface in the given point.
6955 theSurf the given surface.
6956 thePoint given point.
6959 max radius of curvature of theSurf.
6961 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6962 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6965 ## Measure min radius of curvature of surface.
6966 # @param theSurf the given surface.
6967 # @param theUParam Value of U-parameter on the referenced surface.
6968 # @param theVParam Value of V-parameter on the referenced surface.
6969 # @return min radius of curvature of theSurf.
6971 ## @ref swig_todo "Example"
6972 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6974 Measure min radius of curvature of surface.
6977 theSurf the given surface.
6978 theUParam Value of U-parameter on the referenced surface.
6979 theVParam Value of V-parameter on the referenced surface.
6982 Min radius of curvature of theSurf.
6984 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6985 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6988 ## Measure min radius of curvature of surface in the given point
6989 # @param theSurf the given surface.
6990 # @param thePoint given point.
6991 # @return min radius of curvature of theSurf.
6993 ## @ref swig_todo "Example"
6994 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6996 Measure min radius of curvature of surface in the given point.
6999 theSurf the given surface.
7000 thePoint given point.
7003 Min radius of curvature of theSurf.
7005 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
7006 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
7010 ## Get min and max tolerances of sub-shapes of theShape
7011 # @param theShape Shape, to get tolerances of.
7012 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
7013 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
7014 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
7015 # VertMin,VertMax: Min and max tolerances of the vertices.
7017 # @ref tui_measurement_tools_page "Example"
7018 def Tolerance(self,theShape):
7020 Get min and max tolerances of sub-shapes of theShape
7023 theShape Shape, to get tolerances of.
7026 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
7027 FaceMin,FaceMax: Min and max tolerances of the faces.
7028 EdgeMin,EdgeMax: Min and max tolerances of the edges.
7029 VertMin,VertMax: Min and max tolerances of the vertices.
7031 # Example: see GEOM_TestMeasures.py
7032 aTuple = self.MeasuOp.GetTolerance(theShape)
7033 RaiseIfFailed("GetTolerance", self.MeasuOp)
7036 ## Obtain description of the given shape (number of sub-shapes of each type)
7037 # @param theShape Shape to be described.
7038 # @return Description of the given shape.
7040 # @ref tui_measurement_tools_page "Example"
7041 def WhatIs(self,theShape):
7043 Obtain description of the given shape (number of sub-shapes of each type)
7046 theShape Shape to be described.
7049 Description of the given shape.
7051 # Example: see GEOM_TestMeasures.py
7052 aDescr = self.MeasuOp.WhatIs(theShape)
7053 RaiseIfFailed("WhatIs", self.MeasuOp)
7056 ## Obtain quantity of shapes of the given type in \a theShape.
7057 # If \a theShape is of type \a theType, it is also counted.
7058 # @param theShape Shape to be described.
7059 # @param theType the given ShapeType().
7060 # @return Quantity of shapes of type \a theType in \a theShape.
7062 # @ref tui_measurement_tools_page "Example"
7063 def NbShapes (self, theShape, theType):
7065 Obtain quantity of shapes of the given type in theShape.
7066 If theShape is of type theType, it is also counted.
7069 theShape Shape to be described.
7070 theType the given geompy.ShapeType
7073 Quantity of shapes of type theType in theShape.
7075 # Example: see GEOM_TestMeasures.py
7076 listSh = self.SubShapeAllIDs(theShape, theType)
7078 t = EnumToLong(theShape.GetShapeType())
7079 theType = EnumToLong(theType)
7085 ## Obtain quantity of shapes of each type in \a theShape.
7086 # The \a theShape is also counted.
7087 # @param theShape Shape to be described.
7088 # @return Dictionary of ShapeType() with bound quantities of shapes.
7090 # @ref tui_measurement_tools_page "Example"
7091 def ShapeInfo (self, theShape):
7093 Obtain quantity of shapes of each type in theShape.
7094 The theShape is also counted.
7097 theShape Shape to be described.
7100 Dictionary of geompy.ShapeType with bound quantities of shapes.
7102 # Example: see GEOM_TestMeasures.py
7104 for typeSh in ShapeType:
7105 if typeSh in ( "AUTO", "SHAPE" ): continue
7106 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
7108 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
7115 ## Get a point, situated at the centre of mass of theShape.
7116 # @param theShape Shape to define centre of mass of.
7117 # @return New GEOM.GEOM_Object, containing the created point.
7119 # @ref tui_measurement_tools_page "Example"
7120 def MakeCDG(self,theShape):
7122 Get a point, situated at the centre of mass of theShape.
7125 theShape Shape to define centre of mass of.
7128 New GEOM.GEOM_Object, containing the created point.
7130 # Example: see GEOM_TestMeasures.py
7131 anObj = self.MeasuOp.GetCentreOfMass(theShape)
7132 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
7135 ## Get a vertex sub-shape by index depended with orientation.
7136 # @param theShape Shape to find sub-shape.
7137 # @param theIndex Index to find vertex by this index (starting from zero)
7138 # @return New GEOM.GEOM_Object, containing the created vertex.
7140 # @ref tui_measurement_tools_page "Example"
7141 def GetVertexByIndex(self,theShape, theIndex):
7143 Get a vertex sub-shape by index depended with orientation.
7146 theShape Shape to find sub-shape.
7147 theIndex Index to find vertex by this index (starting from zero)
7150 New GEOM.GEOM_Object, containing the created vertex.
7152 # Example: see GEOM_TestMeasures.py
7153 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
7154 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
7157 ## Get the first vertex of wire/edge depended orientation.
7158 # @param theShape Shape to find first vertex.
7159 # @return New GEOM.GEOM_Object, containing the created vertex.
7161 # @ref tui_measurement_tools_page "Example"
7162 def GetFirstVertex(self,theShape):
7164 Get the first vertex of wire/edge depended orientation.
7167 theShape Shape to find first vertex.
7170 New GEOM.GEOM_Object, containing the created vertex.
7172 # Example: see GEOM_TestMeasures.py
7173 anObj = self.GetVertexByIndex(theShape, 0)
7174 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7177 ## Get the last vertex of wire/edge depended orientation.
7178 # @param theShape Shape to find last vertex.
7179 # @return New GEOM.GEOM_Object, containing the created vertex.
7181 # @ref tui_measurement_tools_page "Example"
7182 def GetLastVertex(self,theShape):
7184 Get the last vertex of wire/edge depended orientation.
7187 theShape Shape to find last vertex.
7190 New GEOM.GEOM_Object, containing the created vertex.
7192 # Example: see GEOM_TestMeasures.py
7193 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7194 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7195 RaiseIfFailed("GetLastVertex", self.MeasuOp)
7198 ## Get a normale to the given face. If the point is not given,
7199 # the normale is calculated at the center of mass.
7200 # @param theFace Face to define normale of.
7201 # @param theOptionalPoint Point to compute the normale at.
7202 # @return New GEOM.GEOM_Object, containing the created vector.
7204 # @ref swig_todo "Example"
7205 def GetNormal(self, theFace, theOptionalPoint = None):
7207 Get a normale to the given face. If the point is not given,
7208 the normale is calculated at the center of mass.
7211 theFace Face to define normale of.
7212 theOptionalPoint Point to compute the normale at.
7215 New GEOM.GEOM_Object, containing the created vector.
7217 # Example: see GEOM_TestMeasures.py
7218 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7219 RaiseIfFailed("GetNormal", self.MeasuOp)
7222 ## Check a topology of the given shape.
7223 # @param theShape Shape to check validity of.
7224 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7225 # if TRUE, the shape's geometry will be checked also.
7226 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7227 # of problem is printed.
7228 # if TRUE and if theShape is invalid, the description
7229 # of problem is also returned.
7230 # @return TRUE, if the shape "seems to be valid".
7232 # @ref tui_measurement_tools_page "Example"
7233 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7235 Check a topology of the given shape.
7238 theShape Shape to check validity of.
7239 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7240 if TRUE, the shape's geometry will be checked also.
7241 theReturnStatus If FALSE and if theShape is invalid, a description
7242 of problem is printed.
7243 if TRUE and if theShape is invalid, the description
7244 of problem is returned.
7247 TRUE, if the shape "seems to be valid".
7248 If theShape is invalid, prints a description of problem.
7249 This description can also be returned.
7251 # Example: see GEOM_TestMeasures.py
7253 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7254 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7256 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7257 RaiseIfFailed("CheckShape", self.MeasuOp)
7259 if theReturnStatus == 0:
7261 if theReturnStatus == 1:
7262 return (IsValid, Status)
7265 ## Detect self-intersections in the given shape.
7266 # @param theShape Shape to check.
7267 # @return TRUE, if the shape contains no self-intersections.
7269 # @ref tui_measurement_tools_page "Example"
7270 def CheckSelfIntersections(self, theShape):
7272 Detect self-intersections in the given shape.
7275 theShape Shape to check.
7278 TRUE, if the shape contains no self-intersections.
7280 # Example: see GEOM_TestMeasures.py
7281 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7282 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7285 ## Get position (LCS) of theShape.
7287 # Origin of the LCS is situated at the shape's center of mass.
7288 # Axes of the LCS are obtained from shape's location or,
7289 # if the shape is a planar face, from position of its plane.
7291 # @param theShape Shape to calculate position of.
7292 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7293 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
7294 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7295 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7297 # @ref swig_todo "Example"
7298 def GetPosition(self,theShape):
7300 Get position (LCS) of theShape.
7301 Origin of the LCS is situated at the shape's center of mass.
7302 Axes of the LCS are obtained from shape's location or,
7303 if the shape is a planar face, from position of its plane.
7306 theShape Shape to calculate position of.
7309 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7310 Ox,Oy,Oz: Coordinates of shape's LCS origin.
7311 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7312 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7314 # Example: see GEOM_TestMeasures.py
7315 aTuple = self.MeasuOp.GetPosition(theShape)
7316 RaiseIfFailed("GetPosition", self.MeasuOp)
7319 ## Get kind of theShape.
7321 # @param theShape Shape to get a kind of.
7322 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7323 # and a list of parameters, describing the shape.
7324 # @note Concrete meaning of each value, returned via \a theIntegers
7325 # or \a theDoubles list depends on the kind() of the shape.
7327 # @ref swig_todo "Example"
7328 def KindOfShape(self,theShape):
7330 Get kind of theShape.
7333 theShape Shape to get a kind of.
7336 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7337 and a list of parameters, describing the shape.
7339 Concrete meaning of each value, returned via theIntegers
7340 or theDoubles list depends on the geompy.kind of the shape
7342 # Example: see GEOM_TestMeasures.py
7343 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7344 RaiseIfFailed("KindOfShape", self.MeasuOp)
7346 aKind = aRoughTuple[0]
7347 anInts = aRoughTuple[1]
7348 aDbls = aRoughTuple[2]
7350 # Now there is no exception from this rule:
7351 aKindTuple = [aKind] + aDbls + anInts
7353 # If they are we will regroup parameters for such kind of shape.
7355 #if aKind == kind.SOME_KIND:
7356 # # SOME_KIND int int double int double double
7357 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7364 ## @addtogroup l2_import_export
7367 ## Import a shape from the BREP or IGES or STEP file
7368 # (depends on given format) with given name.
7369 # @param theFileName The file, containing the shape.
7370 # @param theFormatName Specify format for the file reading.
7371 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7372 # If format 'IGES_SCALE' is used instead of 'IGES' or
7373 # format 'STEP_SCALE' is used instead of 'STEP',
7374 # length unit will be set to 'meter' and result model will be scaled.
7375 # @return New GEOM.GEOM_Object, containing the imported shape.
7377 # @ref swig_Import_Export "Example"
7378 def ImportFile(self, theFileName, theFormatName):
7380 Import a shape from the BREP or IGES or STEP file
7381 (depends on given format) with given name.
7384 theFileName The file, containing the shape.
7385 theFormatName Specify format for the file reading.
7386 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7387 If format 'IGES_SCALE' is used instead of 'IGES' or
7388 format 'STEP_SCALE' is used instead of 'STEP',
7389 length unit will be set to 'meter' and result model will be scaled.
7392 New GEOM.GEOM_Object, containing the imported shape.
7394 # Example: see GEOM_TestOthers.py
7395 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7396 RaiseIfFailed("Import", self.InsertOp)
7399 ## Deprecated analog of ImportFile()
7400 def Import(self, theFileName, theFormatName):
7402 Deprecated analog of geompy.ImportFile
7404 print "WARNING: Function Import is deprecated, use ImportFile instead"
7405 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7406 RaiseIfFailed("Import", self.InsertOp)
7409 ## Shortcut to ImportFile() for BREP format.
7410 # Import a shape from the BREP file with given name.
7411 # @param theFileName The file, containing the shape.
7412 # @return New GEOM.GEOM_Object, containing the imported shape.
7414 # @ref swig_Import_Export "Example"
7415 def ImportBREP(self, theFileName):
7417 geompy.ImportFile(...) function for BREP format
7418 Import a shape from the BREP file with given name.
7421 theFileName The file, containing the shape.
7424 New GEOM.GEOM_Object, containing the imported shape.
7426 # Example: see GEOM_TestOthers.py
7427 return self.ImportFile(theFileName, "BREP")
7429 ## Shortcut to ImportFile() for IGES format
7430 # Import a shape from the IGES file with given name.
7431 # @param theFileName The file, containing the shape.
7432 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7433 # and result model will be scaled, if its units are not meters.
7434 # If False (default), file length units will be taken into account.
7435 # @return New GEOM.GEOM_Object, containing the imported shape.
7437 # @ref swig_Import_Export "Example"
7438 def ImportIGES(self, theFileName, ignoreUnits = False):
7440 geompy.ImportFile(...) function for IGES format
7443 theFileName The file, containing the shape.
7444 ignoreUnits If True, file length units will be ignored (set to 'meter')
7445 and result model will be scaled, if its units are not meters.
7446 If False (default), file length units will be taken into account.
7449 New GEOM.GEOM_Object, containing the imported shape.
7451 # Example: see GEOM_TestOthers.py
7453 return self.ImportFile(theFileName, "IGES_SCALE")
7454 return self.ImportFile(theFileName, "IGES")
7456 ## Return length unit from given IGES file
7457 # @param theFileName The file, containing the shape.
7458 # @return String, containing the units name.
7460 # @ref swig_Import_Export "Example"
7461 def GetIGESUnit(self, theFileName):
7463 Return length units from given IGES file
7466 theFileName The file, containing the shape.
7469 String, containing the units name.
7471 # Example: see GEOM_TestOthers.py
7472 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
7475 ## Shortcut to ImportFile() for STEP format
7476 # Import a shape from the STEP file with given name.
7477 # @param theFileName The file, containing the shape.
7478 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7479 # and result model will be scaled, if its units are not meters.
7480 # If False (default), file length units will be taken into account.
7481 # @return New GEOM.GEOM_Object, containing the imported shape.
7483 # @ref swig_Import_Export "Example"
7484 def ImportSTEP(self, theFileName, ignoreUnits = False):
7486 geompy.ImportFile(...) function for STEP format
7489 theFileName The file, containing the shape.
7490 ignoreUnits If True, file length units will be ignored (set to 'meter')
7491 and result model will be scaled, if its units are not meters.
7492 If False (default), file length units will be taken into account.
7495 New GEOM.GEOM_Object, containing the imported shape.
7497 # Example: see GEOM_TestOthers.py
7499 return self.ImportFile(theFileName, "STEP_SCALE")
7500 return self.ImportFile(theFileName, "STEP")
7502 ## Return length unit from given IGES or STEP file
7503 # @param theFileName The file, containing the shape.
7504 # @return String, containing the units name.
7506 # @ref swig_Import_Export "Example"
7507 def GetSTEPUnit(self, theFileName):
7509 Return length units from given STEP file
7512 theFileName The file, containing the shape.
7515 String, containing the units name.
7517 # Example: see GEOM_TestOthers.py
7518 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
7521 ## Read a shape from the binary stream, containing its bounding representation (BRep).
7522 # @note This method will not be dumped to the python script by DumpStudy functionality.
7523 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
7524 # @param theStream The BRep binary stream.
7525 # @return New GEOM_Object, containing the shape, read from theStream.
7527 # @ref swig_Import_Export "Example"
7528 def RestoreShape (self, theStream):
7530 Read a shape from the binary stream, containing its bounding representation (BRep).
7533 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
7536 theStream The BRep binary stream.
7539 New GEOM_Object, containing the shape, read from theStream.
7541 # Example: see GEOM_TestOthers.py
7542 anObj = self.InsertOp.RestoreShape(theStream)
7543 RaiseIfFailed("RestoreShape", self.InsertOp)
7546 ## Export the given shape into a file with given name.
7547 # @param theObject Shape to be stored in the file.
7548 # @param theFileName Name of the file to store the given shape in.
7549 # @param theFormatName Specify format for the shape storage.
7550 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7552 # @ref swig_Import_Export "Example"
7553 def Export(self, theObject, theFileName, theFormatName):
7555 Export the given shape into a file with given name.
7558 theObject Shape to be stored in the file.
7559 theFileName Name of the file to store the given shape in.
7560 theFormatName Specify format for the shape storage.
7561 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7563 # Example: see GEOM_TestOthers.py
7564 self.InsertOp.Export(theObject, theFileName, theFormatName)
7565 if self.InsertOp.IsDone() == 0:
7566 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7570 ## Shortcut to Export() for BREP format
7572 # @ref swig_Import_Export "Example"
7573 def ExportBREP(self,theObject, theFileName):
7575 geompy.Export(...) function for BREP format
7577 # Example: see GEOM_TestOthers.py
7578 return self.Export(theObject, theFileName, "BREP")
7580 ## Shortcut to Export() for IGES format
7582 # @ref swig_Import_Export "Example"
7583 def ExportIGES(self,theObject, theFileName):
7585 geompy.Export(...) function for IGES format
7587 # Example: see GEOM_TestOthers.py
7588 return self.Export(theObject, theFileName, "IGES")
7590 ## Shortcut to Export() for STEP format
7592 # @ref swig_Import_Export "Example"
7593 def ExportSTEP(self,theObject, theFileName):
7595 geompy.Export(...) function for STEP format
7597 # Example: see GEOM_TestOthers.py
7598 return self.Export(theObject, theFileName, "STEP")
7600 # end of l2_import_export
7603 ## @addtogroup l3_blocks
7606 ## Create a quadrangle face from four edges. Order of Edges is not
7607 # important. It is not necessary that edges share the same vertex.
7608 # @param E1,E2,E3,E4 Edges for the face bound.
7609 # @return New GEOM.GEOM_Object, containing the created face.
7611 # @ref tui_building_by_blocks_page "Example"
7612 def MakeQuad(self,E1, E2, E3, E4):
7614 Create a quadrangle face from four edges. Order of Edges is not
7615 important. It is not necessary that edges share the same vertex.
7618 E1,E2,E3,E4 Edges for the face bound.
7621 New GEOM.GEOM_Object, containing the created face.
7624 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7626 # Example: see GEOM_Spanner.py
7627 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7628 RaiseIfFailed("MakeQuad", self.BlocksOp)
7631 ## Create a quadrangle face on two edges.
7632 # The missing edges will be built by creating the shortest ones.
7633 # @param E1,E2 Two opposite edges for the face.
7634 # @return New GEOM.GEOM_Object, containing the created face.
7636 # @ref tui_building_by_blocks_page "Example"
7637 def MakeQuad2Edges(self,E1, E2):
7639 Create a quadrangle face on two edges.
7640 The missing edges will be built by creating the shortest ones.
7643 E1,E2 Two opposite edges for the face.
7646 New GEOM.GEOM_Object, containing the created face.
7650 p1 = geompy.MakeVertex( 0., 0., 0.)
7651 p2 = geompy.MakeVertex(150., 30., 0.)
7652 p3 = geompy.MakeVertex( 0., 120., 50.)
7653 p4 = geompy.MakeVertex( 0., 40., 70.)
7655 edge1 = geompy.MakeEdge(p1, p2)
7656 edge2 = geompy.MakeEdge(p3, p4)
7657 # create a quadrangle face from two edges
7658 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7660 # Example: see GEOM_Spanner.py
7661 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7662 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7665 ## Create a quadrangle face with specified corners.
7666 # The missing edges will be built by creating the shortest ones.
7667 # @param V1,V2,V3,V4 Corner vertices for the face.
7668 # @return New GEOM.GEOM_Object, containing the created face.
7670 # @ref tui_building_by_blocks_page "Example 1"
7671 # \n @ref swig_MakeQuad4Vertices "Example 2"
7672 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7674 Create a quadrangle face with specified corners.
7675 The missing edges will be built by creating the shortest ones.
7678 V1,V2,V3,V4 Corner vertices for the face.
7681 New GEOM.GEOM_Object, containing the created face.
7685 p1 = geompy.MakeVertex( 0., 0., 0.)
7686 p2 = geompy.MakeVertex(150., 30., 0.)
7687 p3 = geompy.MakeVertex( 0., 120., 50.)
7688 p4 = geompy.MakeVertex( 0., 40., 70.)
7689 # create a quadrangle from four points in its corners
7690 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7692 # Example: see GEOM_Spanner.py
7693 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7694 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7697 ## Create a hexahedral solid, bounded by the six given faces. Order of
7698 # faces is not important. It is not necessary that Faces share the same edge.
7699 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7700 # @return New GEOM.GEOM_Object, containing the created solid.
7702 # @ref tui_building_by_blocks_page "Example 1"
7703 # \n @ref swig_MakeHexa "Example 2"
7704 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7706 Create a hexahedral solid, bounded by the six given faces. Order of
7707 faces is not important. It is not necessary that Faces share the same edge.
7710 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7713 New GEOM.GEOM_Object, containing the created solid.
7716 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7718 # Example: see GEOM_Spanner.py
7719 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7720 RaiseIfFailed("MakeHexa", self.BlocksOp)
7723 ## Create a hexahedral solid between two given faces.
7724 # The missing faces will be built by creating the smallest ones.
7725 # @param F1,F2 Two opposite faces for the hexahedral solid.
7726 # @return New GEOM.GEOM_Object, containing the created solid.
7728 # @ref tui_building_by_blocks_page "Example 1"
7729 # \n @ref swig_MakeHexa2Faces "Example 2"
7730 def MakeHexa2Faces(self,F1, F2):
7732 Create a hexahedral solid between two given faces.
7733 The missing faces will be built by creating the smallest ones.
7736 F1,F2 Two opposite faces for the hexahedral solid.
7739 New GEOM.GEOM_Object, containing the created solid.
7742 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7744 # Example: see GEOM_Spanner.py
7745 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7746 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7752 ## @addtogroup l3_blocks_op
7755 ## Get a vertex, found in the given shape by its coordinates.
7756 # @param theShape Block or a compound of blocks.
7757 # @param theX,theY,theZ Coordinates of the sought vertex.
7758 # @param theEpsilon Maximum allowed distance between the resulting
7759 # vertex and point with the given coordinates.
7760 # @return New GEOM.GEOM_Object, containing the found vertex.
7762 # @ref swig_GetPoint "Example"
7763 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7765 Get a vertex, found in the given shape by its coordinates.
7768 theShape Block or a compound of blocks.
7769 theX,theY,theZ Coordinates of the sought vertex.
7770 theEpsilon Maximum allowed distance between the resulting
7771 vertex and point with the given coordinates.
7774 New GEOM.GEOM_Object, containing the found vertex.
7777 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7779 # Example: see GEOM_TestOthers.py
7780 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7781 RaiseIfFailed("GetPoint", self.BlocksOp)
7784 ## Find a vertex of the given shape, which has minimal distance to the given point.
7785 # @param theShape Any shape.
7786 # @param thePoint Point, close to the desired vertex.
7787 # @return New GEOM.GEOM_Object, containing the found vertex.
7789 # @ref swig_GetVertexNearPoint "Example"
7790 def GetVertexNearPoint(self, theShape, thePoint):
7792 Find a vertex of the given shape, which has minimal distance to the given point.
7796 thePoint Point, close to the desired vertex.
7799 New GEOM.GEOM_Object, containing the found vertex.
7802 pmidle = geompy.MakeVertex(50, 0, 50)
7803 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7805 # Example: see GEOM_TestOthers.py
7806 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7807 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7810 ## Get an edge, found in the given shape by two given vertices.
7811 # @param theShape Block or a compound of blocks.
7812 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7813 # @return New GEOM.GEOM_Object, containing the found edge.
7815 # @ref swig_GetEdge "Example"
7816 def GetEdge(self, theShape, thePoint1, thePoint2):
7818 Get an edge, found in the given shape by two given vertices.
7821 theShape Block or a compound of blocks.
7822 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7825 New GEOM.GEOM_Object, containing the found edge.
7827 # Example: see GEOM_Spanner.py
7828 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7829 RaiseIfFailed("GetEdge", self.BlocksOp)
7832 ## Find an edge of the given shape, which has minimal distance to the given point.
7833 # @param theShape Block or a compound of blocks.
7834 # @param thePoint Point, close to the desired edge.
7835 # @return New GEOM.GEOM_Object, containing the found edge.
7837 # @ref swig_GetEdgeNearPoint "Example"
7838 def GetEdgeNearPoint(self, theShape, thePoint):
7840 Find an edge of the given shape, which has minimal distance to the given point.
7843 theShape Block or a compound of blocks.
7844 thePoint Point, close to the desired edge.
7847 New GEOM.GEOM_Object, containing the found edge.
7849 # Example: see GEOM_TestOthers.py
7850 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7851 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7854 ## Returns a face, found in the given shape by four given corner vertices.
7855 # @param theShape Block or a compound of blocks.
7856 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7857 # @return New GEOM.GEOM_Object, containing the found face.
7859 # @ref swig_todo "Example"
7860 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7862 Returns a face, found in the given shape by four given corner vertices.
7865 theShape Block or a compound of blocks.
7866 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7869 New GEOM.GEOM_Object, containing the found face.
7871 # Example: see GEOM_Spanner.py
7872 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7873 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7876 ## Get a face of block, found in the given shape by two given edges.
7877 # @param theShape Block or a compound of blocks.
7878 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7879 # @return New GEOM.GEOM_Object, containing the found face.
7881 # @ref swig_todo "Example"
7882 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7884 Get a face of block, found in the given shape by two given edges.
7887 theShape Block or a compound of blocks.
7888 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7891 New GEOM.GEOM_Object, containing the found face.
7893 # Example: see GEOM_Spanner.py
7894 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7895 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7898 ## Find a face, opposite to the given one in the given block.
7899 # @param theBlock Must be a hexahedral solid.
7900 # @param theFace Face of \a theBlock, opposite to the desired face.
7901 # @return New GEOM.GEOM_Object, containing the found face.
7903 # @ref swig_GetOppositeFace "Example"
7904 def GetOppositeFace(self,theBlock, theFace):
7906 Find a face, opposite to the given one in the given block.
7909 theBlock Must be a hexahedral solid.
7910 theFace Face of theBlock, opposite to the desired face.
7913 New GEOM.GEOM_Object, containing the found face.
7915 # Example: see GEOM_Spanner.py
7916 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7917 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7920 ## Find a face of the given shape, which has minimal distance to the given point.
7921 # @param theShape Block or a compound of blocks.
7922 # @param thePoint Point, close to the desired face.
7923 # @return New GEOM.GEOM_Object, containing the found face.
7925 # @ref swig_GetFaceNearPoint "Example"
7926 def GetFaceNearPoint(self, theShape, thePoint):
7928 Find a face of the given shape, which has minimal distance to the given point.
7931 theShape Block or a compound of blocks.
7932 thePoint Point, close to the desired face.
7935 New GEOM.GEOM_Object, containing the found face.
7937 # Example: see GEOM_Spanner.py
7938 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7939 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7942 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7943 # @param theBlock Block or a compound of blocks.
7944 # @param theVector Vector, close to the normale of the desired face.
7945 # @return New GEOM.GEOM_Object, containing the found face.
7947 # @ref swig_todo "Example"
7948 def GetFaceByNormale(self, theBlock, theVector):
7950 Find a face of block, whose outside normale has minimal angle with the given vector.
7953 theBlock Block or a compound of blocks.
7954 theVector Vector, close to the normale of the desired face.
7957 New GEOM.GEOM_Object, containing the found face.
7959 # Example: see GEOM_Spanner.py
7960 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7961 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7964 ## Find all sub-shapes of type \a theShapeType of the given shape,
7965 # which have minimal distance to the given point.
7966 # @param theShape Any shape.
7967 # @param thePoint Point, close to the desired shape.
7968 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7969 # @param theTolerance The tolerance for distances comparison. All shapes
7970 # with distances to the given point in interval
7971 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7972 # @return New GEOM_Object, containing a group of all found shapes.
7974 # @ref swig_GetShapesNearPoint "Example"
7975 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7977 Find all sub-shapes of type theShapeType of the given shape,
7978 which have minimal distance to the given point.
7982 thePoint Point, close to the desired shape.
7983 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7984 theTolerance The tolerance for distances comparison. All shapes
7985 with distances to the given point in interval
7986 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7989 New GEOM_Object, containing a group of all found shapes.
7991 # Example: see GEOM_TestOthers.py
7992 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7993 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7996 # end of l3_blocks_op
7999 ## @addtogroup l4_blocks_measure
8002 ## Check, if the compound of blocks is given.
8003 # To be considered as a compound of blocks, the
8004 # given shape must satisfy the following conditions:
8005 # - Each element of the compound should be a Block (6 faces and 12 edges).
8006 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
8007 # - The compound should be connexe.
8008 # - The glue between two quadrangle faces should be applied.
8009 # @param theCompound The compound to check.
8010 # @return TRUE, if the given shape is a compound of blocks.
8011 # If theCompound is not valid, prints all discovered errors.
8013 # @ref tui_measurement_tools_page "Example 1"
8014 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
8015 def CheckCompoundOfBlocks(self,theCompound):
8017 Check, if the compound of blocks is given.
8018 To be considered as a compound of blocks, the
8019 given shape must satisfy the following conditions:
8020 - Each element of the compound should be a Block (6 faces and 12 edges).
8021 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
8022 - The compound should be connexe.
8023 - The glue between two quadrangle faces should be applied.
8026 theCompound The compound to check.
8029 TRUE, if the given shape is a compound of blocks.
8030 If theCompound is not valid, prints all discovered errors.
8032 # Example: see GEOM_Spanner.py
8033 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
8034 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
8036 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
8040 ## Retrieve all non blocks solids and faces from \a theShape.
8041 # @param theShape The shape to explore.
8042 # @return A tuple of two GEOM_Objects. The first object is a group of all
8043 # non block solids (= not 6 faces, or with 6 faces, but with the
8044 # presence of non-quadrangular faces). The second object is a
8045 # group of all non quadrangular faces.
8047 # @ref tui_measurement_tools_page "Example 1"
8048 # \n @ref swig_GetNonBlocks "Example 2"
8049 def GetNonBlocks (self, theShape):
8051 Retrieve all non blocks solids and faces from theShape.
8054 theShape The shape to explore.
8057 A tuple of two GEOM_Objects. The first object is a group of all
8058 non block solids (= not 6 faces, or with 6 faces, but with the
8059 presence of non-quadrangular faces). The second object is a
8060 group of all non quadrangular faces.
8063 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
8065 # Example: see GEOM_Spanner.py
8066 aTuple = self.BlocksOp.GetNonBlocks(theShape)
8067 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
8070 ## Remove all seam and degenerated edges from \a theShape.
8071 # Unite faces and edges, sharing one surface. It means that
8072 # this faces must have references to one C++ surface object (handle).
8073 # @param theShape The compound or single solid to remove irregular edges from.
8074 # @param doUnionFaces If True, then unite faces. If False (the default value),
8075 # do not unite faces.
8076 # @return Improved shape.
8078 # @ref swig_RemoveExtraEdges "Example"
8079 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
8081 Remove all seam and degenerated edges from theShape.
8082 Unite faces and edges, sharing one surface. It means that
8083 this faces must have references to one C++ surface object (handle).
8086 theShape The compound or single solid to remove irregular edges from.
8087 doUnionFaces If True, then unite faces. If False (the default value),
8093 # Example: see GEOM_TestOthers.py
8094 nbFacesOptimum = -1 # -1 means do not unite faces
8095 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
8096 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
8097 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
8100 ## Check, if the given shape is a blocks compound.
8101 # Fix all detected errors.
8102 # \note Single block can be also fixed by this method.
8103 # @param theShape The compound to check and improve.
8104 # @return Improved compound.
8106 # @ref swig_CheckAndImprove "Example"
8107 def CheckAndImprove(self,theShape):
8109 Check, if the given shape is a blocks compound.
8110 Fix all detected errors.
8113 Single block can be also fixed by this method.
8116 theShape The compound to check and improve.
8121 # Example: see GEOM_TestOthers.py
8122 anObj = self.BlocksOp.CheckAndImprove(theShape)
8123 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
8126 # end of l4_blocks_measure
8129 ## @addtogroup l3_blocks_op
8132 ## Get all the blocks, contained in the given compound.
8133 # @param theCompound The compound to explode.
8134 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
8135 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
8136 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8137 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
8139 # @ref tui_explode_on_blocks "Example 1"
8140 # \n @ref swig_MakeBlockExplode "Example 2"
8141 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
8143 Get all the blocks, contained in the given compound.
8146 theCompound The compound to explode.
8147 theMinNbFaces If solid has lower number of faces, it is not a block.
8148 theMaxNbFaces If solid has higher number of faces, it is not a block.
8151 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8154 List of GEOM.GEOM_Object, containing the retrieved blocks.
8156 # Example: see GEOM_TestOthers.py
8157 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
8158 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
8159 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
8161 anObj.SetParameters(Parameters)
8165 ## Find block, containing the given point inside its volume or on boundary.
8166 # @param theCompound Compound, to find block in.
8167 # @param thePoint Point, close to the desired block. If the point lays on
8168 # boundary between some blocks, we return block with nearest center.
8169 # @return New GEOM.GEOM_Object, containing the found block.
8171 # @ref swig_todo "Example"
8172 def GetBlockNearPoint(self,theCompound, thePoint):
8174 Find block, containing the given point inside its volume or on boundary.
8177 theCompound Compound, to find block in.
8178 thePoint Point, close to the desired block. If the point lays on
8179 boundary between some blocks, we return block with nearest center.
8182 New GEOM.GEOM_Object, containing the found block.
8184 # Example: see GEOM_Spanner.py
8185 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
8186 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
8189 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8190 # @param theCompound Compound, to find block in.
8191 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
8192 # @return New GEOM.GEOM_Object, containing the found block.
8194 # @ref swig_GetBlockByParts "Example"
8195 def GetBlockByParts(self,theCompound, theParts):
8197 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8200 theCompound Compound, to find block in.
8201 theParts List of faces and/or edges and/or vertices to be parts of the found block.
8204 New GEOM_Object, containing the found block.
8206 # Example: see GEOM_TestOthers.py
8207 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
8208 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
8211 ## Return all blocks, containing all the elements, passed as the parts.
8212 # @param theCompound Compound, to find blocks in.
8213 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8214 # @return List of GEOM.GEOM_Object, containing the found blocks.
8216 # @ref swig_todo "Example"
8217 def GetBlocksByParts(self,theCompound, theParts):
8219 Return all blocks, containing all the elements, passed as the parts.
8222 theCompound Compound, to find blocks in.
8223 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8226 List of GEOM.GEOM_Object, containing the found blocks.
8228 # Example: see GEOM_Spanner.py
8229 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
8230 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
8233 ## Multi-transformate block and glue the result.
8234 # Transformation is defined so, as to superpose direction faces.
8235 # @param Block Hexahedral solid to be multi-transformed.
8236 # @param DirFace1 ID of First direction face.
8237 # @param DirFace2 ID of Second direction face.
8238 # @param NbTimes Quantity of transformations to be done.
8239 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8240 # @return New GEOM.GEOM_Object, containing the result shape.
8242 # @ref tui_multi_transformation "Example"
8243 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
8245 Multi-transformate block and glue the result.
8246 Transformation is defined so, as to superpose direction faces.
8249 Block Hexahedral solid to be multi-transformed.
8250 DirFace1 ID of First direction face.
8251 DirFace2 ID of Second direction face.
8252 NbTimes Quantity of transformations to be done.
8255 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8258 New GEOM.GEOM_Object, containing the result shape.
8260 # Example: see GEOM_Spanner.py
8261 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8262 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8263 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8264 anObj.SetParameters(Parameters)
8267 ## Multi-transformate block and glue the result.
8268 # @param Block Hexahedral solid to be multi-transformed.
8269 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8270 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8271 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
8272 # @return New GEOM.GEOM_Object, containing the result shape.
8274 # @ref tui_multi_transformation "Example"
8275 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8276 DirFace1V, DirFace2V, NbTimesV):
8278 Multi-transformate block and glue the result.
8281 Block Hexahedral solid to be multi-transformed.
8282 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8283 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8284 NbTimesU,NbTimesV Quantity of transformations to be done.
8287 New GEOM.GEOM_Object, containing the result shape.
8289 # Example: see GEOM_Spanner.py
8290 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8291 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8292 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8293 DirFace1V, DirFace2V, NbTimesV)
8294 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8295 anObj.SetParameters(Parameters)
8298 ## Build all possible propagation groups.
8299 # Propagation group is a set of all edges, opposite to one (main)
8300 # edge of this group directly or through other opposite edges.
8301 # Notion of Opposite Edge make sence only on quadrangle face.
8302 # @param theShape Shape to build propagation groups on.
8303 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
8305 # @ref swig_Propagate "Example"
8306 def Propagate(self,theShape):
8308 Build all possible propagation groups.
8309 Propagation group is a set of all edges, opposite to one (main)
8310 edge of this group directly or through other opposite edges.
8311 Notion of Opposite Edge make sence only on quadrangle face.
8314 theShape Shape to build propagation groups on.
8317 List of GEOM.GEOM_Object, each of them is a propagation group.
8319 # Example: see GEOM_TestOthers.py
8320 listChains = self.BlocksOp.Propagate(theShape)
8321 RaiseIfFailed("Propagate", self.BlocksOp)
8324 # end of l3_blocks_op
8327 ## @addtogroup l3_groups
8330 ## Creates a new group which will store sub-shapes of theMainShape
8331 # @param theMainShape is a GEOM object on which the group is selected
8332 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8333 # @return a newly created GEOM group
8335 # @ref tui_working_with_groups_page "Example 1"
8336 # \n @ref swig_CreateGroup "Example 2"
8337 def CreateGroup(self,theMainShape, theShapeType):
8339 Creates a new group which will store sub-shapes of theMainShape
8342 theMainShape is a GEOM object on which the group is selected
8343 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8344 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8347 a newly created GEOM group
8350 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8353 # Example: see GEOM_TestOthers.py
8354 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8355 RaiseIfFailed("CreateGroup", self.GroupOp)
8358 ## Adds a sub-object with ID theSubShapeId to the group
8359 # @param theGroup is a GEOM group to which the new sub-shape is added
8360 # @param theSubShapeID is a sub-shape ID in the main object.
8361 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8363 # @ref tui_working_with_groups_page "Example"
8364 def AddObject(self,theGroup, theSubShapeID):
8366 Adds a sub-object with ID theSubShapeId to the group
8369 theGroup is a GEOM group to which the new sub-shape is added
8370 theSubShapeID is a sub-shape ID in the main object.
8373 Use method GetSubShapeID() to get an unique ID of the sub-shape
8375 # Example: see GEOM_TestOthers.py
8376 self.GroupOp.AddObject(theGroup, theSubShapeID)
8377 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8378 RaiseIfFailed("AddObject", self.GroupOp)
8382 ## Removes a sub-object with ID \a theSubShapeId from the group
8383 # @param theGroup is a GEOM group from which the new sub-shape is removed
8384 # @param theSubShapeID is a sub-shape ID in the main object.
8385 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8387 # @ref tui_working_with_groups_page "Example"
8388 def RemoveObject(self,theGroup, theSubShapeID):
8390 Removes a sub-object with ID theSubShapeId from the group
8393 theGroup is a GEOM group from which the new sub-shape is removed
8394 theSubShapeID is a sub-shape ID in the main object.
8397 Use method GetSubShapeID() to get an unique ID of the sub-shape
8399 # Example: see GEOM_TestOthers.py
8400 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8401 RaiseIfFailed("RemoveObject", self.GroupOp)
8404 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8405 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8406 # @param theSubShapes is a list of sub-shapes to be added.
8408 # @ref tui_working_with_groups_page "Example"
8409 def UnionList (self,theGroup, theSubShapes):
8411 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8414 theGroup is a GEOM group to which the new sub-shapes are added.
8415 theSubShapes is a list of sub-shapes to be added.
8417 # Example: see GEOM_TestOthers.py
8418 self.GroupOp.UnionList(theGroup, theSubShapes)
8419 RaiseIfFailed("UnionList", self.GroupOp)
8422 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8423 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8424 # @param theSubShapes is a list of indices of sub-shapes to be added.
8426 # @ref swig_UnionIDs "Example"
8427 def UnionIDs(self,theGroup, theSubShapes):
8429 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8432 theGroup is a GEOM group to which the new sub-shapes are added.
8433 theSubShapes is a list of indices of sub-shapes to be added.
8435 # Example: see GEOM_TestOthers.py
8436 self.GroupOp.UnionIDs(theGroup, theSubShapes)
8437 RaiseIfFailed("UnionIDs", self.GroupOp)
8440 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8441 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8442 # @param theSubShapes is a list of sub-shapes to be removed.
8444 # @ref tui_working_with_groups_page "Example"
8445 def DifferenceList (self,theGroup, theSubShapes):
8447 Removes from the group all the given shapes. No errors, if some shapes are not included.
8450 theGroup is a GEOM group from which the sub-shapes are removed.
8451 theSubShapes is a list of sub-shapes to be removed.
8453 # Example: see GEOM_TestOthers.py
8454 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8455 RaiseIfFailed("DifferenceList", self.GroupOp)
8458 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8459 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8460 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8462 # @ref swig_DifferenceIDs "Example"
8463 def DifferenceIDs(self,theGroup, theSubShapes):
8465 Removes from the group all the given shapes. No errors, if some shapes are not included.
8468 theGroup is a GEOM group from which the sub-shapes are removed.
8469 theSubShapes is a list of indices of sub-shapes to be removed.
8471 # Example: see GEOM_TestOthers.py
8472 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8473 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8476 ## Union of two groups.
8477 # New group is created. It will contain all entities
8478 # which are present in groups theGroup1 and theGroup2.
8479 # @param theGroup1, theGroup2 are the initial GEOM groups
8480 # to create the united group from.
8481 # @return a newly created GEOM group.
8482 # @ref tui_union_groups_anchor "Example"
8483 def UnionGroups (self, theGroup1, theGroup2):
8485 Union of two groups.
8486 New group is created. It will contain all entities
8487 which are present in groups theGroup1 and theGroup2.
8490 theGroup1, theGroup2 are the initial GEOM groups
8491 to create the united group from.
8494 a newly created GEOM group.
8496 # Example: see GEOM_TestOthers.py
8497 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
8498 RaiseIfFailed("UnionGroups", self.GroupOp)
8501 ## Intersection of two groups.
8502 # New group is created. It will contain only those entities
8503 # which are present in both groups theGroup1 and theGroup2.
8504 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8505 # @return a newly created GEOM group.
8506 # @ref tui_intersect_groups_anchor "Example"
8507 def IntersectGroups (self, theGroup1, theGroup2):
8509 Intersection of two groups.
8510 New group is created. It will contain only those entities
8511 which are present in both groups theGroup1 and theGroup2.
8514 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8517 a newly created GEOM group.
8519 # Example: see GEOM_TestOthers.py
8520 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
8521 RaiseIfFailed("IntersectGroups", self.GroupOp)
8524 ## Cut of two groups.
8525 # New group is created. It will contain entities which are
8526 # present in group theGroup1 but are not present in group theGroup2.
8527 # @param theGroup1 is a GEOM group to include elements of.
8528 # @param theGroup2 is a GEOM group to exclude elements of.
8529 # @return a newly created GEOM group.
8530 # @ref tui_cut_groups_anchor "Example"
8531 def CutGroups (self, theGroup1, theGroup2):
8534 New group is created. It will contain entities which are
8535 present in group theGroup1 but are not present in group theGroup2.
8538 theGroup1 is a GEOM group to include elements of.
8539 theGroup2 is a GEOM group to exclude elements of.
8542 a newly created GEOM group.
8544 # Example: see GEOM_TestOthers.py
8545 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
8546 RaiseIfFailed("CutGroups", self.GroupOp)
8549 ## Union of list of groups.
8550 # New group is created. It will contain all entities that are
8551 # present in groups listed in theGList.
8552 # @param theGList is a list of GEOM groups to create the united group from.
8553 # @return a newly created GEOM group.
8554 # @ref tui_union_groups_anchor "Example"
8555 def UnionListOfGroups (self, theGList):
8557 Union of list of groups.
8558 New group is created. It will contain all entities that are
8559 present in groups listed in theGList.
8562 theGList is a list of GEOM groups to create the united group from.
8565 a newly created GEOM group.
8567 # Example: see GEOM_TestOthers.py
8568 aGroup = self.GroupOp.UnionListOfGroups(theGList)
8569 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
8572 ## Cut of lists of groups.
8573 # New group is created. It will contain only entities
8574 # which are present in groups listed in theGList1 but
8575 # are not present in groups from theGList2.
8576 # @param theGList1 is a list of GEOM groups to include elements of.
8577 # @param theGList2 is a list of GEOM groups to exclude elements of.
8578 # @return a newly created GEOM group.
8579 # @ref tui_intersect_groups_anchor "Example"
8580 def IntersectListOfGroups (self, theGList):
8582 Cut of lists of groups.
8583 New group is created. It will contain only entities
8584 which are present in groups listed in theGList1 but
8585 are not present in groups from theGList2.
8588 theGList1 is a list of GEOM groups to include elements of.
8589 theGList2 is a list of GEOM groups to exclude elements of.
8592 a newly created GEOM group.
8594 # Example: see GEOM_TestOthers.py
8595 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
8596 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
8599 ## Cut of lists of groups.
8600 # New group is created. It will contain only entities
8601 # which are present in groups listed in theGList1 but
8602 # are not present in groups from theGList2.
8603 # @param theGList1 is a list of GEOM groups to include elements of.
8604 # @param theGList2 is a list of GEOM groups to exclude elements of.
8605 # @return a newly created GEOM group.
8606 # @ref tui_cut_groups_anchor "Example"
8607 def CutListOfGroups (self, theGList1, theGList2):
8609 Cut of lists of groups.
8610 New group is created. It will contain only entities
8611 which are present in groups listed in theGList1 but
8612 are not present in groups from theGList2.
8615 theGList1 is a list of GEOM groups to include elements of.
8616 theGList2 is a list of GEOM groups to exclude elements of.
8619 a newly created GEOM group.
8621 # Example: see GEOM_TestOthers.py
8622 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
8623 RaiseIfFailed("CutListOfGroups", self.GroupOp)
8626 ## Returns a list of sub-objects ID stored in the group
8627 # @param theGroup is a GEOM group for which a list of IDs is requested
8629 # @ref swig_GetObjectIDs "Example"
8630 def GetObjectIDs(self,theGroup):
8632 Returns a list of sub-objects ID stored in the group
8635 theGroup is a GEOM group for which a list of IDs is requested
8637 # Example: see GEOM_TestOthers.py
8638 ListIDs = self.GroupOp.GetObjects(theGroup)
8639 RaiseIfFailed("GetObjects", self.GroupOp)
8642 ## Returns a type of sub-objects stored in the group
8643 # @param theGroup is a GEOM group which type is returned.
8645 # @ref swig_GetType "Example"
8646 def GetType(self,theGroup):
8648 Returns a type of sub-objects stored in the group
8651 theGroup is a GEOM group which type is returned.
8653 # Example: see GEOM_TestOthers.py
8654 aType = self.GroupOp.GetType(theGroup)
8655 RaiseIfFailed("GetType", self.GroupOp)
8658 ## Convert a type of geom object from id to string value
8659 # @param theId is a GEOM obect type id.
8660 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8661 # @ref swig_GetType "Example"
8662 def ShapeIdToType(self, theId):
8664 Convert a type of geom object from id to string value
8667 theId is a GEOM obect type id.
8670 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8745 return "FREE_BOUNDS"
8753 return "THRUSECTIONS"
8755 return "COMPOUNDFILTER"
8757 return "SHAPES_ON_SHAPE"
8759 return "ELLIPSE_ARC"
8768 return "Shape Id not exist."
8770 ## Returns a main shape associated with the group
8771 # @param theGroup is a GEOM group for which a main shape object is requested
8772 # @return a GEOM object which is a main shape for theGroup
8774 # @ref swig_GetMainShape "Example"
8775 def GetMainShape(self,theGroup):
8777 Returns a main shape associated with the group
8780 theGroup is a GEOM group for which a main shape object is requested
8783 a GEOM object which is a main shape for theGroup
8785 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8787 # Example: see GEOM_TestOthers.py
8788 anObj = self.GroupOp.GetMainShape(theGroup)
8789 RaiseIfFailed("GetMainShape", self.GroupOp)
8792 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8793 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8794 # @param theShape given shape (see GEOM.GEOM_Object)
8795 # @param min_length minimum length of edges of theShape
8796 # @param max_length maximum length of edges of theShape
8797 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8798 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8799 # @return a newly created GEOM group of edges
8800 # @@ref swig_todo "Example"
8801 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8803 Create group of edges of theShape, whose length is in range [min_length, max_length].
8804 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8807 theShape given shape
8808 min_length minimum length of edges of theShape
8809 max_length maximum length of edges of theShape
8810 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8811 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8814 a newly created GEOM group of edges.
8816 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8819 Props = self.BasicProperties(edge)
8820 if min_length <= Props[0] and Props[0] <= max_length:
8821 if (not include_min) and (min_length == Props[0]):
8824 if (not include_max) and (Props[0] == max_length):
8827 edges_in_range.append(edge)
8829 if len(edges_in_range) <= 0:
8830 print "No edges found by given criteria"
8833 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8834 self.UnionList(group_edges, edges_in_range)
8838 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8839 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8840 # @param min_length minimum length of edges of selected shape
8841 # @param max_length maximum length of edges of selected shape
8842 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8843 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8844 # @return a newly created GEOM group of edges
8845 # @ref swig_todo "Example"
8846 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8848 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8849 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8852 min_length minimum length of edges of selected shape
8853 max_length maximum length of edges of selected shape
8854 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8855 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8858 a newly created GEOM group of edges.
8860 nb_selected = sg.SelectedCount()
8862 print "Select a shape before calling this function, please."
8865 print "Only one shape must be selected"
8868 id_shape = sg.getSelected(0)
8869 shape = IDToObject( id_shape )
8871 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8875 if include_min: left_str = " <= "
8876 if include_max: right_str = " <= "
8878 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8879 + left_str + "length" + right_str + `max_length`)
8881 sg.updateObjBrowser(1)
8888 ## @addtogroup l4_advanced
8891 ## Create a T-shape object with specified caracteristics for the main
8892 # and the incident pipes (radius, width, half-length).
8893 # The extremities of the main pipe are located on junctions points P1 and P2.
8894 # The extremity of the incident pipe is located on junction point P3.
8895 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8896 # the main plane of the T-shape is XOY.
8897 # @param theR1 Internal radius of main pipe
8898 # @param theW1 Width of main pipe
8899 # @param theL1 Half-length of main pipe
8900 # @param theR2 Internal radius of incident pipe (R2 < R1)
8901 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8902 # @param theL2 Half-length of incident pipe
8903 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8904 # @param theP1 1st junction point of main pipe
8905 # @param theP2 2nd junction point of main pipe
8906 # @param theP3 Junction point of incident pipe
8907 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8909 # @ref tui_creation_pipetshape "Example"
8910 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8912 Create a T-shape object with specified caracteristics for the main
8913 and the incident pipes (radius, width, half-length).
8914 The extremities of the main pipe are located on junctions points P1 and P2.
8915 The extremity of the incident pipe is located on junction point P3.
8916 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8917 the main plane of the T-shape is XOY.
8920 theR1 Internal radius of main pipe
8921 theW1 Width of main pipe
8922 theL1 Half-length of main pipe
8923 theR2 Internal radius of incident pipe (R2 < R1)
8924 theW2 Width of incident pipe (R2+W2 < R1+W1)
8925 theL2 Half-length of incident pipe
8926 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8927 theP1 1st junction point of main pipe
8928 theP2 2nd junction point of main pipe
8929 theP3 Junction point of incident pipe
8932 List of GEOM_Object, containing the created shape and propagation groups.
8935 # create PipeTShape object
8936 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8937 # create PipeTShape object with position
8938 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8940 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8941 if (theP1 and theP2 and theP3):
8942 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8944 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8945 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8946 if Parameters: anObj[0].SetParameters(Parameters)
8949 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8950 # and the incident pipes (radius, width, half-length). The chamfer is
8951 # created on the junction of the pipes.
8952 # The extremities of the main pipe are located on junctions points P1 and P2.
8953 # The extremity of the incident pipe is located on junction point P3.
8954 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8955 # the main plane of the T-shape is XOY.
8956 # @param theR1 Internal radius of main pipe
8957 # @param theW1 Width of main pipe
8958 # @param theL1 Half-length of main pipe
8959 # @param theR2 Internal radius of incident pipe (R2 < R1)
8960 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8961 # @param theL2 Half-length of incident pipe
8962 # @param theH Height of the chamfer.
8963 # @param theW Width of the chamfer.
8964 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8965 # @param theP1 1st junction point of main pipe
8966 # @param theP2 2nd junction point of main pipe
8967 # @param theP3 Junction point of incident pipe
8968 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8970 # @ref tui_creation_pipetshape "Example"
8971 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8973 Create a T-shape object with chamfer and with specified caracteristics for the main
8974 and the incident pipes (radius, width, half-length). The chamfer is
8975 created on the junction of the pipes.
8976 The extremities of the main pipe are located on junctions points P1 and P2.
8977 The extremity of the incident pipe is located on junction point P3.
8978 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8979 the main plane of the T-shape is XOY.
8982 theR1 Internal radius of main pipe
8983 theW1 Width of main pipe
8984 theL1 Half-length of main pipe
8985 theR2 Internal radius of incident pipe (R2 < R1)
8986 theW2 Width of incident pipe (R2+W2 < R1+W1)
8987 theL2 Half-length of incident pipe
8988 theH Height of the chamfer.
8989 theW Width of the chamfer.
8990 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8991 theP1 1st junction point of main pipe
8992 theP2 2nd junction point of main pipe
8993 theP3 Junction point of incident pipe
8996 List of GEOM_Object, containing the created shape and propagation groups.
8999 # create PipeTShape with chamfer object
9000 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
9001 # create PipeTShape with chamfer object with position
9002 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
9004 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
9005 if (theP1 and theP2 and theP3):
9006 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
9008 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
9009 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
9010 if Parameters: anObj[0].SetParameters(Parameters)
9013 ## Create a T-shape object with fillet and with specified caracteristics for the main
9014 # and the incident pipes (radius, width, half-length). The fillet is
9015 # created on the junction of the pipes.
9016 # The extremities of the main pipe are located on junctions points P1 and P2.
9017 # The extremity of the incident pipe is located on junction point P3.
9018 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
9019 # the main plane of the T-shape is XOY.
9020 # @param theR1 Internal radius of main pipe
9021 # @param theW1 Width of main pipe
9022 # @param theL1 Half-length of main pipe
9023 # @param theR2 Internal radius of incident pipe (R2 < R1)
9024 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
9025 # @param theL2 Half-length of incident pipe
9026 # @param theRF Radius of curvature of fillet.
9027 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
9028 # @param theP1 1st junction point of main pipe
9029 # @param theP2 2nd junction point of main pipe
9030 # @param theP3 Junction point of incident pipe
9031 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
9033 # @ref tui_creation_pipetshape "Example"
9034 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
9036 Create a T-shape object with fillet and with specified caracteristics for the main
9037 and the incident pipes (radius, width, half-length). The fillet is
9038 created on the junction of the pipes.
9039 The extremities of the main pipe are located on junctions points P1 and P2.
9040 The extremity of the incident pipe is located on junction point P3.
9043 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
9044 the main plane of the T-shape is XOY.
9045 theR1 Internal radius of main pipe
9046 theW1 Width of main pipe
9047 heL1 Half-length of main pipe
9048 theR2 Internal radius of incident pipe (R2 < R1)
9049 theW2 Width of incident pipe (R2+W2 < R1+W1)
9050 theL2 Half-length of incident pipe
9051 theRF Radius of curvature of fillet.
9052 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
9053 theP1 1st junction point of main pipe
9054 theP2 2nd junction point of main pipe
9055 theP3 Junction point of incident pipe
9058 List of GEOM_Object, containing the created shape and propagation groups.
9061 # create PipeTShape with fillet object
9062 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
9063 # create PipeTShape with fillet object with position
9064 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
9067 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
9068 if (theP1 and theP2 and theP3):
9069 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
9071 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
9072 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
9073 if Parameters: anObj[0].SetParameters(Parameters)
9076 ## This function allows creating a disk already divided into blocks. It
9077 # can be used to create divided pipes for later meshing in hexaedra.
9078 # @param theR Radius of the disk
9079 # @param theOrientation Orientation of the plane on which the disk will be built
9080 # 1 = XOY, 2 = OYZ, 3 = OZX
9081 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9082 # @return New GEOM_Object, containing the created shape.
9084 # @ref tui_creation_divideddisk "Example"
9085 def MakeDividedDisk(self, theR, theOrientation, thePattern ):
9086 theR, Parameters = ParseParameters(theR)
9087 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
9088 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
9089 if Parameters: anObj.SetParameters(Parameters)
9092 ## This function allows creating a disk already divided into blocks. It
9093 # can be used to create divided pipes for later meshing in hexaedra.
9094 # @param theCenter Center of the disk
9095 # @param theVector Normal vector to the plane of the created disk
9096 # @param theRadius Radius of the disk
9097 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9098 # @return New GEOM_Object, containing the created shape.
9100 # @ref tui_creation_divideddisk "Example"
9101 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
9102 theRadius, Parameters = ParseParameters(theRadius)
9103 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
9104 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
9105 if Parameters: anObj.SetParameters(Parameters)
9108 ## Builds a cylinder prepared for hexa meshes
9109 # @param theR Radius of the cylinder
9110 # @param theH Height of the cylinder
9111 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9112 # @return New GEOM_Object, containing the created shape.
9114 # @ref tui_creation_dividedcylinder "Example"
9115 def MakeDividedCylinder(self, theR, theH, thePattern):
9116 theR, theH, Parameters = ParseParameters(theR, theH)
9117 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
9118 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
9119 if Parameters: anObj.SetParameters(Parameters)
9122 #@@ insert new functions before this line @@ do not remove this line @@#
9124 # end of l4_advanced
9127 ## Create a copy of the given object
9129 # @param theOriginal geometry object for copy
9130 # @return unique object identifier
9131 # @ingroup l1_geompyDC_auxiliary
9132 # @ref swig_MakeCopy "Example"
9133 def MakeCopy(self,theOriginal):
9135 Create a copy of the given object
9138 theOriginal geometry object for copy
9141 unique object identifier
9143 Example of usage: Copy = geompy.MakeCopy(Box)
9145 # Example: see GEOM_TestAll.py
9146 anObj = self.InsertOp.MakeCopy(theOriginal)
9147 RaiseIfFailed("MakeCopy", self.InsertOp)
9150 ## Add Path to load python scripts from
9151 # @param Path a path to load python scripts from
9152 # @ingroup l1_geompyDC_auxiliary
9153 def addPath(self,Path):
9155 Add Path to load python scripts from
9158 Path a path to load python scripts from
9160 if (sys.path.count(Path) < 1):
9161 sys.path.append(Path)
9165 ## Load marker texture from the file
9166 # @param Path a path to the texture file
9167 # @return unique texture identifier
9168 # @ingroup l1_geompyDC_auxiliary
9169 def LoadTexture(self, Path):
9171 Load marker texture from the file
9174 Path a path to the texture file
9177 unique texture identifier
9179 # Example: see GEOM_TestAll.py
9180 ID = self.InsertOp.LoadTexture(Path)
9181 RaiseIfFailed("LoadTexture", self.InsertOp)
9184 ## Get internal name of the object based on its study entry
9185 # @note This method does not provide an unique identifier of the geometry object.
9186 # @note This is internal function of GEOM component, though it can be used outside it for
9187 # appropriate reason (e.g. for identification of geometry object).
9188 # @param obj geometry object
9189 # @return unique object identifier
9190 # @ingroup l1_geompyDC_auxiliary
9191 def getObjectID(self, obj):
9193 Get internal name of the object based on its study entry.
9194 Note: this method does not provide an unique identifier of the geometry object.
9195 It is an internal function of GEOM component, though it can be used outside GEOM for
9196 appropriate reason (e.g. for identification of geometry object).
9202 unique object identifier
9205 entry = salome.ObjectToID(obj)
9206 if entry is not None:
9207 lst = entry.split(":")
9209 ID = lst[-1] # -1 means last item in the list
9215 ## Add marker texture. @a Width and @a Height parameters
9216 # specify width and height of the texture in pixels.
9217 # If @a RowData is @c True, @a Texture parameter should represent texture data
9218 # packed into the byte array. If @a RowData is @c False (default), @a Texture
9219 # parameter should be unpacked string, in which '1' symbols represent opaque
9220 # pixels and '0' represent transparent pixels of the texture bitmap.
9222 # @param Width texture width in pixels
9223 # @param Height texture height in pixels
9224 # @param Texture texture data
9225 # @param RowData if @c True, @a Texture data are packed in the byte stream
9226 # @return unique texture identifier
9227 # @ingroup l1_geompyDC_auxiliary
9228 def AddTexture(self, Width, Height, Texture, RowData=False):
9230 Add marker texture. Width and Height parameters
9231 specify width and height of the texture in pixels.
9232 If RowData is True, Texture parameter should represent texture data
9233 packed into the byte array. If RowData is False (default), Texture
9234 parameter should be unpacked string, in which '1' symbols represent opaque
9235 pixels and '0' represent transparent pixels of the texture bitmap.
9238 Width texture width in pixels
9239 Height texture height in pixels
9240 Texture texture data
9241 RowData if True, Texture data are packed in the byte stream
9244 return unique texture identifier
9246 if not RowData: Texture = PackData(Texture)
9247 ID = self.InsertOp.AddTexture(Width, Height, Texture)
9248 RaiseIfFailed("AddTexture", self.InsertOp)
9252 # Register the new proxy for GEOM_Gen
9253 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)
9255 def geomInstance( study, instance=None):
9256 print "geomInstance ", study, instance
9264 assert isinstance(geom,geompyDC), "Geom engine class is %s but should be geompyDC.geompyDC. Import geompyDC before creating the instance."%geom.__class__
9265 geom.init_geom(study)