1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Author : Paul RASCLE, EDF
29 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
31 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
33 ## @defgroup l2_import_export Importing/exporting geometrical objects
34 ## @defgroup l2_creating Creating geometrical objects
36 ## @defgroup l3_basic_go Creating Basic Geometric Objects
38 ## @defgroup l4_curves Creating Curves
41 ## @defgroup l3_3d_primitives Creating 3D Primitives
42 ## @defgroup l3_complex Creating Complex Objects
43 ## @defgroup l3_groups Working with groups
44 ## @defgroup l3_blocks Building by blocks
46 ## @defgroup l4_blocks_measure Check and Improve
49 ## @defgroup l3_sketcher Sketcher
50 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
52 ## @defgroup l4_decompose Decompose objects
53 ## @defgroup l4_decompose_d Decompose objects deprecated methods
54 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
55 ## @defgroup l4_obtain Access to sub-shapes by a criteria
56 ## @defgroup l4_advanced Advanced objects creation functions
61 ## @defgroup l2_transforming Transforming geometrical objects
63 ## @defgroup l3_basic_op Basic Operations
64 ## @defgroup l3_boolean Boolean Operations
65 ## @defgroup l3_transform Transformation Operations
66 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
67 ## @defgroup l3_blocks_op Blocks Operations
68 ## @defgroup l3_healing Repairing Operations
69 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
72 ## @defgroup l2_measure Using measurement tools
76 # initialize SALOME session in try/except block
77 # to avoid problems in some cases, e.g. when generating documentation
85 from salome_notebook import *
91 ## Enumeration ShapeType as a dictionary. \n
92 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
93 # @ingroup l1_geompy_auxiliary
94 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
96 ## Raise an Error, containing the Method_name, if Operation is Failed
97 ## @ingroup l1_geompy_auxiliary
98 def RaiseIfFailed (Method_name, Operation):
99 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
100 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
102 ## Return list of variables value from salome notebook
103 ## @ingroup l1_geompy_auxiliary
104 def ParseParameters(*parameters):
107 for parameter in parameters:
108 if isinstance(parameter, list):
109 lResults = ParseParameters(*parameter)
110 if len(lResults) > 0:
111 Result.append(lResults[:-1])
112 StringResult += lResults[-1].split(":")
116 if isinstance(parameter,str):
117 if notebook.isVariable(parameter):
118 Result.append(notebook.get(parameter))
120 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
123 Result.append(parameter)
125 StringResult.append(str(parameter))
129 Result.append(":".join(StringResult))
131 Result = ":".join(StringResult)
134 ## Return list of variables value from salome notebook
135 ## @ingroup l1_geompy_auxiliary
139 for parameter in list:
140 if isinstance(parameter,str) and notebook.isVariable(parameter):
141 Result.append(str(notebook.get(parameter)))
144 Result.append(str(parameter))
147 StringResult = StringResult + str(parameter)
148 StringResult = StringResult + ":"
150 StringResult = StringResult[:len(StringResult)-1]
151 return Result, StringResult
153 ## Return list of variables value from salome notebook
154 ## @ingroup l1_geompy_auxiliary
155 def ParseSketcherCommand(command):
158 sections = command.split(":")
159 for section in sections:
160 parameters = section.split(" ")
162 for parameter in parameters:
163 if paramIndex > 1 and parameter.find("'") != -1:
164 parameter = parameter.replace("'","")
165 if notebook.isVariable(parameter):
166 Result = Result + str(notebook.get(parameter)) + " "
169 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
173 Result = Result + str(parameter) + " "
176 StringResult = StringResult + parameter
177 StringResult = StringResult + ":"
179 paramIndex = paramIndex + 1
181 Result = Result[:len(Result)-1] + ":"
183 Result = Result[:len(Result)-1]
184 return Result, StringResult
186 ## Helper function which can be used to pack the passed string to the byte data.
187 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
188 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
191 ## val = PackData("10001110") # val = 0xAE
192 ## val = PackData("1") # val = 0x80
194 ## @param data unpacked data - a string containing '1' and '0' symbols
195 ## @return data packed to the byte stream
196 ## @ingroup l1_geompy_auxiliary
199 Helper function which can be used to pack the passed string to the byte data.
200 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
201 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
204 data unpacked data - a string containing '1' and '0' symbols
207 data packed to the byte stream
210 val = PackData("10001110") # val = 0xAE
211 val = PackData("1") # val = 0x80
214 if len(data)%8: bytes += 1
216 for b in range(bytes):
217 d = data[b*8:(b+1)*8]
222 if d[i] == "1": val += 1
224 raise "Invalid symbol %s" % d[i]
231 ## Read bitmap texture from the text file.
232 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
233 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
234 ## The function returns width and height of the pixmap in pixels and byte stream representing
235 ## texture bitmap itself.
237 ## This function can be used to read the texture to the byte stream in order to pass it to
238 ## the AddTexture() function of geompy class.
242 ## geompy.init_geom(salome.myStudy)
243 ## texture = geompy.readtexture('mytexture.dat')
244 ## texture = geompy.AddTexture(*texture)
245 ## obj.SetMarkerTexture(texture)
247 ## @param fname texture file name
248 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
249 ## @ingroup l1_geompy_auxiliary
250 def ReadTexture(fname):
252 Read bitmap texture from the text file.
253 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
254 A zero symbol ('0') represents transparent pixel of the texture bitmap.
255 The function returns width and height of the pixmap in pixels and byte stream representing
256 texture bitmap itself.
257 This function can be used to read the texture to the byte stream in order to pass it to
258 the AddTexture() function of geompy class.
261 fname texture file name
264 sequence of tree values: texture's width, height in pixels and its byte stream
268 geompy.init_geom(salome.myStudy)
269 texture = geompy.readtexture('mytexture.dat')
270 texture = geompy.AddTexture(*texture)
271 obj.SetMarkerTexture(texture)
275 lines = [ l.strip() for l in f.readlines()]
278 if lines: maxlen = max([len(x) for x in lines])
280 if maxlen%8: lenbytes += 1
284 lenline = (len(line)/8+1)*8
287 lenline = (len(line)/8)*8
289 for i in range(lenline/8):
292 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
295 bytedata += PackData(byte)
297 for i in range(lenline/8, lenbytes):
298 bytedata += PackData("0")
300 return lenbytes*8, len(lines), bytedata
305 ## Returns a long value from enumeration type
306 # Can be used for CORBA enumerator types like GEOM.shape_type
307 # @param theItem enumeration type
308 # @ingroup l1_geompy_auxiliary
309 def EnumToLong(theItem):
311 Returns a long value from enumeration type
312 Can be used for CORBA enumerator types like geompy.ShapeType
315 theItem enumeration type
318 if hasattr(theItem, "_v"): ret = theItem._v
321 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
322 # and a list of parameters, describing the shape.
323 # List of parameters, describing the shape:
324 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
325 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
327 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
329 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
331 # - SPHERE: [xc yc zc R]
332 # - CYLINDER: [xb yb zb dx dy dz R H]
333 # - BOX: [xc yc zc ax ay az]
334 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
335 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
336 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
337 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
338 # - SOLID: [nb_faces nb_edges nb_vertices]
340 # - SPHERE2D: [xc yc zc R]
341 # - CYLINDER2D: [xb yb zb dx dy dz R H]
342 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
343 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
344 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
345 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
346 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
347 # - PLANE: [xo yo zo dx dy dz]
348 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
349 # - FACE: [nb_edges nb_vertices]
351 # - CIRCLE: [xc yc zc dx dy dz R]
352 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
353 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
354 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
355 # - LINE: [xo yo zo dx dy dz]
356 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
357 # - EDGE: [nb_vertices]
360 # @ingroup l1_geompy_auxiliary
361 kind = GEOM.GEOM_IKindOfShape
363 ## Information about closed/unclosed state of shell or wire
364 # @ingroup l1_geompy_auxiliary
367 Information about closed/unclosed state of shell or wire
373 class geompyDC(GEOM._objref_GEOM_Gen):
376 GEOM._objref_GEOM_Gen.__init__(self)
377 self.myBuilder = None
396 ## @addtogroup l1_geompy_auxiliary
398 def init_geom(self,theStudy):
399 self.myStudy = theStudy
400 self.myStudyId = self.myStudy._get_StudyId()
401 self.myBuilder = self.myStudy.NewBuilder()
402 self.father = self.myStudy.FindComponent("GEOM")
403 if self.father is None:
404 self.father = self.myBuilder.NewComponent("GEOM")
405 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
406 FName = A1._narrow(SALOMEDS.AttributeName)
407 FName.SetValue("Geometry")
408 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
409 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
410 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
411 self.myBuilder.DefineComponentInstance(self.father,self)
413 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
414 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
415 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
416 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
417 self.HealOp = self.GetIHealingOperations (self.myStudyId)
418 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
419 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
420 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
421 self.LocalOp = self.GetILocalOperations (self.myStudyId)
422 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
423 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
424 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
425 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
428 ## Dump component to the Python script
429 # This method overrides IDL function to allow default values for the parameters.
430 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
432 Dump component to the Python script
433 This method overrides IDL function to allow default values for the parameters.
435 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
437 ## Get name for sub-shape aSubObj of shape aMainObj
439 # @ref swig_SubShapeName "Example"
440 def SubShapeName(self,aSubObj, aMainObj):
442 Get name for sub-shape aSubObj of shape aMainObj
444 # Example: see GEOM_TestAll.py
446 #aSubId = orb.object_to_string(aSubObj)
447 #aMainId = orb.object_to_string(aMainObj)
448 #index = gg.getIndexTopology(aSubId, aMainId)
449 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
450 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
451 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
454 ## Publish in study aShape with name aName
456 # \param aShape the shape to be published
457 # \param aName the name for the shape
458 # \param doRestoreSubShapes if True, finds and publishes also
459 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
460 # and published sub-shapes of arguments
461 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
462 # these arguments description
463 # \return study entry of the published shape in form of string
465 # @ref swig_all_addtostudy "Example"
466 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
467 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
469 Publish in study aShape with name aName
472 aShape the shape to be published
473 aName the name for the shape
474 doRestoreSubShapes if True, finds and publishes also
475 sub-shapes of aShape, corresponding to its arguments
476 and published sub-shapes of arguments
477 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
478 these arguments description
481 study entry of the published shape in form of string
484 id_block1 = geompy.addToStudy(Block1, "Block 1")
486 # Example: see GEOM_TestAll.py
488 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
489 if doRestoreSubShapes:
490 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
491 theFindMethod, theInheritFirstArg, True )
493 print "addToStudy() failed"
495 return aShape.GetStudyEntry()
497 ## Publish in study aShape with name aName as sub-object of previously published aFather
498 # \param aFather previously published object
499 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
500 # \param aName the name for the shape
502 # \return study entry of the published shape in form of string
503 # @ref swig_all_addtostudyInFather "Example"
504 def addToStudyInFather(self, aFather, aShape, aName):
506 Publish in study aShape with name aName as sub-object of previously published aFather
509 aFather previously published object
510 aShape the shape to be published as sub-object of aFather
511 aName the name for the shape
514 study entry of the published shape in form of string
516 # Example: see GEOM_TestAll.py
518 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
520 print "addToStudyInFather() failed"
522 return aShape.GetStudyEntry()
524 ## Unpublish object in study
526 # \param obj the object to be unpublished
527 def hideInStudy(self, obj):
529 Unpublish object in study
532 obj the object to be unpublished
534 ior = salome.orb.object_to_string(obj)
535 aSObject = self.myStudy.FindObjectIOR(ior)
536 if aSObject is not None:
537 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
538 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
539 drwAttribute.SetDrawable(False)
542 # end of l1_geompy_auxiliary
545 ## @addtogroup l3_restore_ss
548 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
549 # To be used from python scripts out of addToStudy() (non-default usage)
550 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
551 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
552 # If this list is empty, all operation arguments will be published
553 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
554 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
555 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
556 # Do not publish sub-shapes in place of arguments, but only
557 # in place of sub-shapes of the first argument,
558 # because the whole shape corresponds to the first argument.
559 # Mainly to be used after transformations, but it also can be
560 # usefull after partition with one object shape, and some other
561 # operations, where only the first argument has to be considered.
562 # If theObject has only one argument shape, this flag is automatically
563 # considered as True, not regarding really passed value.
564 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
565 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
566 # \return list of published sub-shapes
568 # @ref tui_restore_prs_params "Example"
569 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
570 theInheritFirstArg=False, theAddPrefix=True):
572 Publish sub-shapes, standing for arguments and sub-shapes of arguments
573 To be used from python scripts out of geompy.addToStudy (non-default usage)
576 theObject published GEOM.GEOM_Object, arguments of which will be published
577 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
578 If this list is empty, all operation arguments will be published
579 theFindMethod method to search sub-shapes, corresponding to arguments and
580 their sub-shapes. Value from enumeration GEOM.find_shape_method.
581 theInheritFirstArg set properties of the first argument for theObject.
582 Do not publish sub-shapes in place of arguments, but only
583 in place of sub-shapes of the first argument,
584 because the whole shape corresponds to the first argument.
585 Mainly to be used after transformations, but it also can be
586 usefull after partition with one object shape, and some other
587 operations, where only the first argument has to be considered.
588 If theObject has only one argument shape, this flag is automatically
589 considered as True, not regarding really passed value.
590 theAddPrefix add prefix "from_" to names of restored sub-shapes,
591 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
593 list of published sub-shapes
595 # Example: see GEOM_TestAll.py
596 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
597 theFindMethod, theInheritFirstArg, theAddPrefix)
599 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
600 # To be used from python scripts out of addToStudy() (non-default usage)
601 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
602 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
603 # If this list is empty, all operation arguments will be published
604 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
605 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
606 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
607 # Do not publish sub-shapes in place of arguments, but only
608 # in place of sub-shapes of the first argument,
609 # because the whole shape corresponds to the first argument.
610 # Mainly to be used after transformations, but it also can be
611 # usefull after partition with one object shape, and some other
612 # operations, where only the first argument has to be considered.
613 # If theObject has only one argument shape, this flag is automatically
614 # considered as True, not regarding really passed value.
615 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
616 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
617 # \return list of published sub-shapes
619 # @ref tui_restore_prs_params "Example"
620 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
621 theInheritFirstArg=False, theAddPrefix=True):
623 Publish sub-shapes, standing for arguments and sub-shapes of arguments
624 To be used from python scripts out of geompy.addToStudy() (non-default usage)
627 theObject published GEOM.GEOM_Object, arguments of which will be published
628 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
629 If this list is empty, all operation arguments will be published
630 theFindMethod method to search sub-shapes, corresponding to arguments and
631 their sub-shapes. Value from enumeration GEOM::find_shape_method.
632 theInheritFirstArg set properties of the first argument for theObject.
633 Do not publish sub-shapes in place of arguments, but only
634 in place of sub-shapes of the first argument,
635 because the whole shape corresponds to the first argument.
636 Mainly to be used after transformations, but it also can be
637 usefull after partition with one object shape, and some other
638 operations, where only the first argument has to be considered.
639 If theObject has only one argument shape, this flag is automatically
640 considered as True, not regarding really passed value.
641 theAddPrefix add prefix "from_" to names of restored sub-shapes,
642 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.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
649 theFindMethod, theInheritFirstArg, theAddPrefix)
651 # end of l3_restore_ss
654 ## @addtogroup l3_basic_go
657 ## Create point by three coordinates.
658 # @param theX The X coordinate of the point.
659 # @param theY The Y coordinate of the point.
660 # @param theZ The Z coordinate of the point.
661 # @return New GEOM.GEOM_Object, containing the created point.
663 # @ref tui_creation_point "Example"
664 def MakeVertex(self, theX, theY, theZ):
666 Create point by three coordinates.
669 theX The X coordinate of the point.
670 theY The Y coordinate of the point.
671 theZ The Z coordinate of the point.
674 New GEOM.GEOM_Object, containing the created point.
676 # Example: see GEOM_TestAll.py
677 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
678 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
679 RaiseIfFailed("MakePointXYZ", self.BasicOp)
680 anObj.SetParameters(Parameters)
683 ## Create a point, distant from the referenced point
684 # on the given distances along the coordinate axes.
685 # @param theReference The referenced point.
686 # @param theX Displacement from the referenced point along OX axis.
687 # @param theY Displacement from the referenced point along OY axis.
688 # @param theZ Displacement from the referenced point along OZ axis.
689 # @return New GEOM.GEOM_Object, containing the created point.
691 # @ref tui_creation_point "Example"
692 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
694 Create a point, distant from the referenced point
695 on the given distances along the coordinate axes.
698 theReference The referenced point.
699 theX Displacement from the referenced point along OX axis.
700 theY Displacement from the referenced point along OY axis.
701 theZ Displacement from the referenced point along OZ axis.
704 New GEOM.GEOM_Object, containing the created point.
706 # Example: see GEOM_TestAll.py
707 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
708 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
709 RaiseIfFailed("MakePointWithReference", self.BasicOp)
710 anObj.SetParameters(Parameters)
713 ## Create a point, corresponding to the given parameter on the given curve.
714 # @param theRefCurve The referenced curve.
715 # @param theParameter Value of parameter on the referenced curve.
716 # @return New GEOM.GEOM_Object, containing the created point.
718 # @ref tui_creation_point "Example"
719 def MakeVertexOnCurve(self,theRefCurve, theParameter):
721 Create a point, corresponding to the given parameter on the given curve.
724 theRefCurve The referenced curve.
725 theParameter Value of parameter on the referenced curve.
728 New GEOM.GEOM_Object, containing the created point.
731 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
733 # Example: see GEOM_TestAll.py
734 theParameter, Parameters = ParseParameters(theParameter)
735 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
736 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
737 anObj.SetParameters(Parameters)
740 ## Create a point by projection give coordinates on the given curve
741 # @param theRefCurve The referenced curve.
742 # @param theX X-coordinate in 3D space
743 # @param theY Y-coordinate in 3D space
744 # @param theZ Z-coordinate in 3D space
745 # @return New GEOM.GEOM_Object, containing the created point.
747 # @ref tui_creation_point "Example"
748 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
750 Create a point by projection give coordinates on the given curve
753 theRefCurve The referenced curve.
754 theX X-coordinate in 3D space
755 theY Y-coordinate in 3D space
756 theZ Z-coordinate in 3D space
759 New GEOM.GEOM_Object, containing the created point.
762 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
764 # Example: see GEOM_TestAll.py
765 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
766 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
767 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
768 anObj.SetParameters(Parameters)
771 ## Create a point, corresponding to the given length on the given curve.
772 # @param theRefCurve The referenced curve.
773 # @param theLength Length on the referenced curve. It can be negative.
774 # @param theStartPoint Point allowing to choose the direction for the calculation
775 # of the length. If None, start from the first point of theRefCurve.
776 # @return New GEOM.GEOM_Object, containing the created point.
778 # @ref tui_creation_point "Example"
779 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
781 Create a point, corresponding to the given length on the given curve.
784 theRefCurve The referenced curve.
785 theLength Length on the referenced curve. It can be negative.
786 theStartPoint Point allowing to choose the direction for the calculation
787 of the length. If None, start from the first point of theRefCurve.
790 New GEOM.GEOM_Object, containing the created point.
792 # Example: see GEOM_TestAll.py
793 theLength, Parameters = ParseParameters(theLength)
794 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
795 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
796 anObj.SetParameters(Parameters)
799 ## Create a point, corresponding to the given parameters on the
801 # @param theRefSurf The referenced surface.
802 # @param theUParameter Value of U-parameter on the referenced surface.
803 # @param theVParameter Value of V-parameter on the referenced surface.
804 # @return New GEOM.GEOM_Object, containing the created point.
806 # @ref swig_MakeVertexOnSurface "Example"
807 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
809 Create a point, corresponding to the given parameters on the
813 theRefSurf The referenced surface.
814 theUParameter Value of U-parameter on the referenced surface.
815 theVParameter Value of V-parameter on the referenced surface.
818 New GEOM.GEOM_Object, containing the created point.
821 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object, Double, Double)->GEOM_Object
823 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
824 # Example: see GEOM_TestAll.py
825 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
826 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
827 anObj.SetParameters(Parameters);
830 ## Create a point by projection give coordinates on the given surface
831 # @param theRefSurf The referenced surface.
832 # @param theX X-coordinate in 3D space
833 # @param theY Y-coordinate in 3D space
834 # @param theZ Z-coordinate in 3D space
835 # @return New GEOM.GEOM_Object, containing the created point.
837 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
838 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
840 Create a point by projection give coordinates on the given surface
843 theRefSurf The referenced surface.
844 theX X-coordinate in 3D space
845 theY Y-coordinate in 3D space
846 theZ Z-coordinate in 3D space
849 New GEOM.GEOM_Object, containing the created point.
852 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object, Double, Double, Double)->GEOM_Object
854 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
855 # Example: see GEOM_TestAll.py
856 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
857 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
858 anObj.SetParameters(Parameters);
861 ## Create a point on intersection of two lines.
862 # @param theRefLine1, theRefLine2 The referenced lines.
863 # @return New GEOM.GEOM_Object, containing the created point.
865 # @ref swig_MakeVertexOnLinesIntersection "Example"
866 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
868 Create a point on intersection of two lines.
871 theRefLine1, theRefLine2 The referenced lines.
874 New GEOM.GEOM_Object, containing the created point.
876 # Example: see GEOM_TestAll.py
877 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
878 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
881 ## Create a tangent, corresponding to the given parameter on the given curve.
882 # @param theRefCurve The referenced curve.
883 # @param theParameter Value of parameter on the referenced curve.
884 # @return New GEOM.GEOM_Object, containing the created tangent.
886 # @ref swig_MakeTangentOnCurve "Example"
887 def MakeTangentOnCurve(self, theRefCurve, theParameter):
889 Create a tangent, corresponding to the given parameter on the given curve.
892 theRefCurve The referenced curve.
893 theParameter Value of parameter on the referenced curve.
896 New GEOM.GEOM_Object, containing the created tangent.
899 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object, Double)->GEOM_Object
901 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
902 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
905 ## Create a tangent plane, corresponding to the given parameter on the given face.
906 # @param theFace The face for which tangent plane should be built.
907 # @param theParameterV vertical value of the center point (0.0 - 1.0).
908 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
909 # @param theTrimSize the size of plane.
910 # @return New GEOM.GEOM_Object, containing the created tangent.
912 # @ref swig_MakeTangentPlaneOnFace "Example"
913 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
915 Create a tangent plane, corresponding to the given parameter on the given face.
918 theFace The face for which tangent plane should be built.
919 theParameterV vertical value of the center point (0.0 - 1.0).
920 theParameterU horisontal value of the center point (0.0 - 1.0).
921 theTrimSize the size of plane.
924 New GEOM.GEOM_Object, containing the created tangent.
927 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
929 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
930 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
933 ## Create a vector with the given components.
934 # @param theDX X component of the vector.
935 # @param theDY Y component of the vector.
936 # @param theDZ Z component of the vector.
937 # @return New GEOM.GEOM_Object, containing the created vector.
939 # @ref tui_creation_vector "Example"
940 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
942 Create a vector with the given components.
945 theDX X component of the vector.
946 theDY Y component of the vector.
947 theDZ Z component of the vector.
950 New GEOM.GEOM_Object, containing the created vector.
952 # Example: see GEOM_TestAll.py
953 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
954 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
955 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
956 anObj.SetParameters(Parameters)
959 ## Create a vector between two points.
960 # @param thePnt1 Start point for the vector.
961 # @param thePnt2 End point for the vector.
962 # @return New GEOM.GEOM_Object, containing the created vector.
964 # @ref tui_creation_vector "Example"
965 def MakeVector(self,thePnt1, thePnt2):
967 Create a vector between two points.
970 thePnt1 Start point for the vector.
971 thePnt2 End point for the vector.
974 New GEOM.GEOM_Object, containing the created vector.
976 # Example: see GEOM_TestAll.py
977 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
978 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
981 ## Create a line, passing through the given point
982 # and parrallel to the given direction
983 # @param thePnt Point. The resulting line will pass through it.
984 # @param theDir Direction. The resulting line will be parallel to it.
985 # @return New GEOM.GEOM_Object, containing the created line.
987 # @ref tui_creation_line "Example"
988 def MakeLine(self,thePnt, theDir):
990 Create a line, passing through the given point
991 and parrallel to the given direction
994 thePnt Point. The resulting line will pass through it.
995 theDir Direction. The resulting line will be parallel to it.
998 New GEOM.GEOM_Object, containing the created line.
1000 # Example: see GEOM_TestAll.py
1001 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1002 RaiseIfFailed("MakeLine", self.BasicOp)
1005 ## Create a line, passing through the given points
1006 # @param thePnt1 First of two points, defining the line.
1007 # @param thePnt2 Second of two points, defining the line.
1008 # @return New GEOM.GEOM_Object, containing the created line.
1010 # @ref tui_creation_line "Example"
1011 def MakeLineTwoPnt(self,thePnt1, thePnt2):
1013 Create a line, passing through the given points
1016 thePnt1 First of two points, defining the line.
1017 thePnt2 Second of two points, defining the line.
1020 New GEOM.GEOM_Object, containing the created line.
1022 # Example: see GEOM_TestAll.py
1023 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1024 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1027 ## Create a line on two faces intersection.
1028 # @param theFace1 First of two faces, defining the line.
1029 # @param theFace2 Second of two faces, defining the line.
1030 # @return New GEOM.GEOM_Object, containing the created line.
1032 # @ref swig_MakeLineTwoFaces "Example"
1033 def MakeLineTwoFaces(self, theFace1, theFace2):
1035 Create a line on two faces intersection.
1038 theFace1 First of two faces, defining the line.
1039 theFace2 Second of two faces, defining the line.
1042 New GEOM.GEOM_Object, containing the created line.
1044 # Example: see GEOM_TestAll.py
1045 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1046 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1049 ## Create a plane, passing through the given point
1050 # and normal to the given vector.
1051 # @param thePnt Point, the plane has to pass through.
1052 # @param theVec Vector, defining the plane normal direction.
1053 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1054 # @return New GEOM.GEOM_Object, containing the created plane.
1056 # @ref tui_creation_plane "Example"
1057 def MakePlane(self,thePnt, theVec, theTrimSize):
1059 Create a plane, passing through the given point
1060 and normal to the given vector.
1063 thePnt Point, the plane has to pass through.
1064 theVec Vector, defining the plane normal direction.
1065 theTrimSize Half size of a side of quadrangle face, representing the plane.
1068 New GEOM.GEOM_Object, containing the created plane.
1070 # Example: see GEOM_TestAll.py
1071 theTrimSize, Parameters = ParseParameters(theTrimSize);
1072 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1073 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1074 anObj.SetParameters(Parameters)
1077 ## Create a plane, passing through the three given points
1078 # @param thePnt1 First of three points, defining the plane.
1079 # @param thePnt2 Second of three points, defining the plane.
1080 # @param thePnt3 Fird of three points, defining the plane.
1081 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1082 # @return New GEOM.GEOM_Object, containing the created plane.
1084 # @ref tui_creation_plane "Example"
1085 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1087 Create a plane, passing through the three given points
1090 thePnt1 First of three points, defining the plane.
1091 thePnt2 Second of three points, defining the plane.
1092 thePnt3 Fird of three points, defining the plane.
1093 theTrimSize Half size of a side of quadrangle face, representing the plane.
1096 New GEOM.GEOM_Object, containing the created plane.
1098 # Example: see GEOM_TestAll.py
1099 theTrimSize, Parameters = ParseParameters(theTrimSize);
1100 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1101 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1102 anObj.SetParameters(Parameters)
1105 ## Create a plane, similar to the existing one, but with another size of representing face.
1106 # @param theFace Referenced plane or LCS(Marker).
1107 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1108 # @return New GEOM.GEOM_Object, containing the created plane.
1110 # @ref tui_creation_plane "Example"
1111 def MakePlaneFace(self,theFace, theTrimSize):
1113 Create a plane, similar to the existing one, but with another size of representing face.
1116 theFace Referenced plane or LCS(Marker).
1117 theTrimSize New half size of a side of quadrangle face, representing the plane.
1120 New GEOM.GEOM_Object, containing the created plane.
1122 # Example: see GEOM_TestAll.py
1123 theTrimSize, Parameters = ParseParameters(theTrimSize);
1124 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1125 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1126 anObj.SetParameters(Parameters)
1129 ## Create a plane, passing through the 2 vectors
1130 # with center in a start point of the first vector.
1131 # @param theVec1 Vector, defining center point and plane direction.
1132 # @param theVec2 Vector, defining the plane normal direction.
1133 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1134 # @return New GEOM.GEOM_Object, containing the created plane.
1136 # @ref tui_creation_plane "Example"
1137 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1139 Create a plane, passing through the 2 vectors
1140 with center in a start point of the first vector.
1143 theVec1 Vector, defining center point and plane direction.
1144 theVec2 Vector, defining the plane normal direction.
1145 theTrimSize Half size of a side of quadrangle face, representing the plane.
1148 New GEOM.GEOM_Object, containing the created plane.
1150 # Example: see GEOM_TestAll.py
1151 theTrimSize, Parameters = ParseParameters(theTrimSize);
1152 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1153 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1154 anObj.SetParameters(Parameters)
1157 ## Create a plane, based on a Local coordinate system.
1158 # @param theLCS coordinate system, defining plane.
1159 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1160 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1161 # @return New GEOM.GEOM_Object, containing the created plane.
1163 # @ref tui_creation_plane "Example"
1164 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1166 Create a plane, based on a Local coordinate system.
1169 theLCS coordinate system, defining plane.
1170 theTrimSize Half size of a side of quadrangle face, representing the plane.
1171 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1174 New GEOM.GEOM_Object, containing the created plane.
1176 # Example: see GEOM_TestAll.py
1177 theTrimSize, Parameters = ParseParameters(theTrimSize);
1178 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1179 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1180 anObj.SetParameters(Parameters)
1183 ## Create a local coordinate system.
1184 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1185 # @param XDX,XDY,XDZ Three components of OX direction
1186 # @param YDX,YDY,YDZ Three components of OY direction
1187 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1189 # @ref swig_MakeMarker "Example"
1190 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1192 Create a local coordinate system.
1195 OX,OY,OZ Three coordinates of coordinate system origin.
1196 XDX,XDY,XDZ Three components of OX direction
1197 YDX,YDY,YDZ Three components of OY direction
1200 New GEOM.GEOM_Object, containing the created coordinate system.
1202 # Example: see GEOM_TestAll.py
1203 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1204 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1205 RaiseIfFailed("MakeMarker", self.BasicOp)
1206 anObj.SetParameters(Parameters)
1209 ## Create a local coordinate system from shape.
1210 # @param theShape The initial shape to detect the coordinate system.
1211 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1213 # @ref tui_creation_lcs "Example"
1214 def MakeMarkerFromShape(self, theShape):
1216 Create a local coordinate system from shape.
1219 theShape The initial shape to detect the coordinate system.
1222 New GEOM.GEOM_Object, containing the created coordinate system.
1224 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1225 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1228 ## Create a local coordinate system from point and two vectors.
1229 # @param theOrigin Point of coordinate system origin.
1230 # @param theXVec Vector of X direction
1231 # @param theYVec Vector of Y direction
1232 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1234 # @ref tui_creation_lcs "Example"
1235 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1237 Create a local coordinate system from point and two vectors.
1240 theOrigin Point of coordinate system origin.
1241 theXVec Vector of X direction
1242 theYVec Vector of Y direction
1245 New GEOM.GEOM_Object, containing the created coordinate system.
1248 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1249 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1252 # end of l3_basic_go
1255 ## @addtogroup l4_curves
1258 ## Create an arc of circle, passing through three given points.
1259 # @param thePnt1 Start point of the arc.
1260 # @param thePnt2 Middle point of the arc.
1261 # @param thePnt3 End point of the arc.
1262 # @return New GEOM.GEOM_Object, containing the created arc.
1264 # @ref swig_MakeArc "Example"
1265 def MakeArc(self,thePnt1, thePnt2, thePnt3):
1267 Create an arc of circle, passing through three given points.
1270 thePnt1 Start point of the arc.
1271 thePnt2 Middle point of the arc.
1272 thePnt3 End point of the arc.
1275 New GEOM.GEOM_Object, containing the created arc.
1277 # Example: see GEOM_TestAll.py
1278 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1279 RaiseIfFailed("MakeArc", self.CurvesOp)
1282 ## Create an arc of circle from a center and 2 points.
1283 # @param thePnt1 Center of the arc
1284 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1285 # @param thePnt3 End point of the arc (Gives also a direction)
1286 # @param theSense Orientation of the arc
1287 # @return New GEOM.GEOM_Object, containing the created arc.
1289 # @ref swig_MakeArc "Example"
1290 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1292 Create an arc of circle from a center and 2 points.
1295 thePnt1 Center of the arc
1296 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1297 thePnt3 End point of the arc (Gives also a direction)
1298 theSense Orientation of the arc
1301 New GEOM.GEOM_Object, containing the created arc.
1303 # Example: see GEOM_TestAll.py
1304 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1305 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1308 ## Create an arc of ellipse, of center and two points.
1309 # @param theCenter Center of the arc.
1310 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1311 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1312 # @return New GEOM.GEOM_Object, containing the created arc.
1314 # @ref swig_MakeArc "Example"
1315 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1317 Create an arc of ellipse, of center and two points.
1320 theCenter Center of the arc.
1321 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1322 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1325 New GEOM.GEOM_Object, containing the created arc.
1327 # Example: see GEOM_TestAll.py
1328 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1329 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1332 ## Create a circle with given center, normal vector and radius.
1333 # @param thePnt Circle center.
1334 # @param theVec Vector, normal to the plane of the circle.
1335 # @param theR Circle radius.
1336 # @return New GEOM.GEOM_Object, containing the created circle.
1338 # @ref tui_creation_circle "Example"
1339 def MakeCircle(self, thePnt, theVec, theR):
1341 Create a circle with given center, normal vector and radius.
1344 thePnt Circle center.
1345 theVec Vector, normal to the plane of the circle.
1349 New GEOM.GEOM_Object, containing the created circle.
1351 # Example: see GEOM_TestAll.py
1352 theR, Parameters = ParseParameters(theR)
1353 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1354 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1355 anObj.SetParameters(Parameters)
1358 ## Create a circle with given radius.
1359 # Center of the circle will be in the origin of global
1360 # coordinate system and normal vector will be codirected with Z axis
1361 # @param theR Circle radius.
1362 # @return New GEOM.GEOM_Object, containing the created circle.
1363 def MakeCircleR(self, theR):
1365 Create a circle with given radius.
1366 Center of the circle will be in the origin of global
1367 coordinate system and normal vector will be codirected with Z axis
1373 New GEOM.GEOM_Object, containing the created circle.
1375 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1376 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1379 ## Create a circle, passing through three given points
1380 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1381 # @return New GEOM.GEOM_Object, containing the created circle.
1383 # @ref tui_creation_circle "Example"
1384 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1386 Create a circle, passing through three given points
1389 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1392 New GEOM.GEOM_Object, containing the created circle.
1394 # Example: see GEOM_TestAll.py
1395 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1396 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1399 ## Create a circle, with given point1 as center,
1400 # passing through the point2 as radius and laying in the plane,
1401 # defined by all three given points.
1402 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1403 # @return New GEOM.GEOM_Object, containing the created circle.
1405 # @ref swig_MakeCircle "Example"
1406 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1408 Create a circle, with given point1 as center,
1409 passing through the point2 as radius and laying in the plane,
1410 defined by all three given points.
1413 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1416 New GEOM.GEOM_Object, containing the created circle.
1418 # Example: see GEOM_example6.py
1419 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1420 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1423 ## Create an ellipse with given center, normal vector and radiuses.
1424 # @param thePnt Ellipse center.
1425 # @param theVec Vector, normal to the plane of the ellipse.
1426 # @param theRMajor Major ellipse radius.
1427 # @param theRMinor Minor ellipse radius.
1428 # @param theVecMaj Vector, direction of the ellipse's main axis.
1429 # @return New GEOM.GEOM_Object, containing the created ellipse.
1431 # @ref tui_creation_ellipse "Example"
1432 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1434 Create an ellipse with given center, normal vector and radiuses.
1437 thePnt Ellipse center.
1438 theVec Vector, normal to the plane of the ellipse.
1439 theRMajor Major ellipse radius.
1440 theRMinor Minor ellipse radius.
1441 theVecMaj Vector, direction of the ellipse's main axis.
1444 New GEOM.GEOM_Object, containing the created ellipse.
1446 # Example: see GEOM_TestAll.py
1447 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1448 if theVecMaj is not None:
1449 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1451 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1453 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1454 anObj.SetParameters(Parameters)
1457 ## Create an ellipse with given radiuses.
1458 # Center of the ellipse will be in the origin of global
1459 # coordinate system and normal vector will be codirected with Z axis
1460 # @param theRMajor Major ellipse radius.
1461 # @param theRMinor Minor ellipse radius.
1462 # @return New GEOM.GEOM_Object, containing the created ellipse.
1463 def MakeEllipseRR(self, theRMajor, theRMinor):
1465 Create an ellipse with given radiuses.
1466 Center of the ellipse will be in the origin of global
1467 coordinate system and normal vector will be codirected with Z axis
1470 theRMajor Major ellipse radius.
1471 theRMinor Minor ellipse radius.
1474 New GEOM.GEOM_Object, containing the created ellipse.
1476 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1477 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1480 ## Create a polyline on the set of points.
1481 # @param thePoints Sequence of points for the polyline.
1482 # @param theIsClosed If True, build a closed wire.
1483 # @return New GEOM.GEOM_Object, containing the created polyline.
1485 # @ref tui_creation_curve "Example"
1486 def MakePolyline(self, thePoints, theIsClosed=False):
1488 Create a polyline on the set of points.
1491 thePoints Sequence of points for the polyline.
1492 theIsClosed If True, build a closed wire.
1495 New GEOM.GEOM_Object, containing the created polyline.
1497 # Example: see GEOM_TestAll.py
1498 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1499 RaiseIfFailed("MakePolyline", self.CurvesOp)
1502 ## Create bezier curve on the set of points.
1503 # @param thePoints Sequence of points for the bezier curve.
1504 # @param theIsClosed If True, build a closed curve.
1505 # @return New GEOM.GEOM_Object, containing the created bezier curve.
1507 # @ref tui_creation_curve "Example"
1508 def MakeBezier(self, thePoints, theIsClosed=False):
1510 Create bezier curve on the set of points.
1513 thePoints Sequence of points for the bezier curve.
1514 theIsClosed If True, build a closed curve.
1517 New GEOM.GEOM_Object, containing the created bezier curve.
1519 # Example: see GEOM_TestAll.py
1520 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1521 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1524 ## Create B-Spline curve on the set of points.
1525 # @param thePoints Sequence of points for the B-Spline curve.
1526 # @param theIsClosed If True, build a closed curve.
1527 # @param theDoReordering If TRUE, the algo does not follow the order of
1528 # \a thePoints but searches for the closest vertex.
1529 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1531 # @ref tui_creation_curve "Example"
1532 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1534 Create B-Spline curve on the set of points.
1537 thePoints Sequence of points for the B-Spline curve.
1538 theIsClosed If True, build a closed curve.
1539 theDoReordering If True, the algo does not follow the order of
1540 thePoints but searches for the closest vertex.
1543 New GEOM.GEOM_Object, containing the created B-Spline curve.
1545 # Example: see GEOM_TestAll.py
1546 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1547 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1551 ## Creates a curve using the parametric definition of the basic points.
1552 # @param thexExpr parametric equation of the coordinates X.
1553 # @param theyExpr parametric equation of the coordinates Y.
1554 # @param thezExpr parametric equation of the coordinates Z.
1555 # @param theParamMin the minimal value of the parameter.
1556 # @param theParamMax the maximum value of the parameter.
1557 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1558 # @param theCurveType the type of the curve.
1559 # @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.
1560 # @return New GEOM.GEOM_Object, containing the created curve.
1562 # @ref tui_creation_curve "Example"
1563 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1564 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1566 Creates a curve using the parametric definition of the basic points.
1569 thexExpr parametric equation of the coordinates X.
1570 theyExpr parametric equation of the coordinates Y.
1571 thezExpr parametric equation of the coordinates Z.
1572 theParamMin the minimal value of the parameter.
1573 theParamMax the maximum value of the parameter.
1574 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1575 theCurveType the type of the curve.
1576 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1577 method is used which can lead to a bug.
1580 New GEOM.GEOM_Object, containing the created curve.
1582 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1584 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1586 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1587 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1588 anObj.SetParameters(Parameters)
1596 ## @addtogroup l3_sketcher
1599 ## Create a sketcher (wire or face), following the textual description,
1600 # passed through <VAR>theCommand</VAR> argument. \n
1601 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1602 # Format of the description string have to be the following:
1604 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1607 # - x1, y1 are coordinates of the first sketcher point (zero by default),
1609 # - "R angle" : Set the direction by angle
1610 # - "D dx dy" : Set the direction by DX & DY
1613 # - "TT x y" : Create segment by point at X & Y
1614 # - "T dx dy" : Create segment by point with DX & DY
1615 # - "L length" : Create segment by direction & Length
1616 # - "IX x" : Create segment by direction & Intersect. X
1617 # - "IY y" : Create segment by direction & Intersect. Y
1620 # - "C radius length" : Create arc by direction, radius and length(in degree)
1621 # - "AA x y": Create arc by point at X & Y
1622 # - "A dx dy" : Create arc by point with DX & DY
1623 # - "A dx dy" : Create arc by point with DX & DY
1624 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1625 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1626 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1627 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1630 # - "WW" : Close Wire (to finish)
1631 # - "WF" : Close Wire and build face (to finish)
1634 # - Flag1 (= reverse) is 0 or 2 ...
1635 # - if 0 the drawn arc is the one of lower angle (< Pi)
1636 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1639 # - Flag2 (= control tolerance) is 0 or 1 ...
1640 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1641 # - if 1 the wire is built only if the end point is on the arc
1642 # with a tolerance of 10^-7 on the distance else the creation fails
1644 # @param theCommand String, defining the sketcher in local
1645 # coordinates of the working plane.
1646 # @param theWorkingPlane Nine double values, defining origin,
1647 # OZ and OX directions of the working plane.
1648 # @return New GEOM.GEOM_Object, containing the created wire.
1650 # @ref tui_sketcher_page "Example"
1651 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1653 Create a sketcher (wire or face), following the textual description, passed
1654 through theCommand argument.
1655 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1656 Format of the description string have to be the following:
1657 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1659 - x1, y1 are coordinates of the first sketcher point (zero by default),
1661 - "R angle" : Set the direction by angle
1662 - "D dx dy" : Set the direction by DX & DY
1664 - "TT x y" : Create segment by point at X & Y
1665 - "T dx dy" : Create segment by point with DX & DY
1666 - "L length" : Create segment by direction & Length
1667 - "IX x" : Create segment by direction & Intersect. X
1668 - "IY y" : Create segment by direction & Intersect. Y
1670 - "C radius length" : Create arc by direction, radius and length(in degree)
1671 - "AA x y": Create arc by point at X & Y
1672 - "A dx dy" : Create arc by point with DX & DY
1673 - "A dx dy" : Create arc by point with DX & DY
1674 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1675 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1676 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1677 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1679 - "WW" : Close Wire (to finish)
1680 - "WF" : Close Wire and build face (to finish)
1682 - Flag1 (= reverse) is 0 or 2 ...
1683 - if 0 the drawn arc is the one of lower angle (< Pi)
1684 - if 2 the drawn arc ius the one of greater angle (> Pi)
1686 - Flag2 (= control tolerance) is 0 or 1 ...
1687 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1688 - if 1 the wire is built only if the end point is on the arc
1689 with a tolerance of 10^-7 on the distance else the creation fails
1692 theCommand String, defining the sketcher in local
1693 coordinates of the working plane.
1694 theWorkingPlane Nine double values, defining origin,
1695 OZ and OX directions of the working plane.
1698 New GEOM.GEOM_Object, containing the created wire.
1700 # Example: see GEOM_TestAll.py
1701 theCommand,Parameters = ParseSketcherCommand(theCommand)
1702 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1703 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1704 anObj.SetParameters(Parameters)
1707 ## Create a sketcher (wire or face), following the textual description,
1708 # passed through <VAR>theCommand</VAR> argument. \n
1709 # For format of the description string see MakeSketcher() method.\n
1710 # @param theCommand String, defining the sketcher in local
1711 # coordinates of the working plane.
1712 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1713 # @return New GEOM.GEOM_Object, containing the created wire.
1715 # @ref tui_sketcher_page "Example"
1716 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1718 Create a sketcher (wire or face), following the textual description,
1719 passed through theCommand argument.
1720 For format of the description string see geompy.MakeSketcher() method.
1723 theCommand String, defining the sketcher in local
1724 coordinates of the working plane.
1725 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1728 New GEOM.GEOM_Object, containing the created wire.
1730 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1731 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1734 ## Create a sketcher wire, following the numerical description,
1735 # passed through <VAR>theCoordinates</VAR> argument. \n
1736 # @param theCoordinates double values, defining points to create a wire,
1738 # @return New GEOM.GEOM_Object, containing the created wire.
1740 # @ref tui_sketcher_page "Example"
1741 def Make3DSketcher(self, theCoordinates):
1743 Create a sketcher wire, following the numerical description,
1744 passed through theCoordinates argument.
1747 theCoordinates double values, defining points to create a wire,
1751 New GEOM_Object, containing the created wire.
1753 theCoordinates,Parameters = ParseParameters(theCoordinates)
1754 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1755 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1756 anObj.SetParameters(Parameters)
1759 # end of l3_sketcher
1762 ## @addtogroup l3_3d_primitives
1765 ## Create a box by coordinates of two opposite vertices.
1767 # @param x1,y1,z1 double values, defining first point it.
1768 # @param x2,y2,z2 double values, defining first point it.
1770 # @return New GEOM.GEOM_Object, containing the created box.
1771 # @ref tui_creation_box "Example"
1772 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1774 Create a box by coordinates of two opposite vertices.
1777 x1,y1,z1 double values, defining first point.
1778 x2,y2,z2 double values, defining second point.
1781 New GEOM.GEOM_Object, containing the created box.
1783 # Example: see GEOM_TestAll.py
1784 pnt1 = self.MakeVertex(x1,y1,z1)
1785 pnt2 = self.MakeVertex(x2,y2,z2)
1786 return self.MakeBoxTwoPnt(pnt1,pnt2)
1788 ## Create a box with specified dimensions along the coordinate axes
1789 # and with edges, parallel to the coordinate axes.
1790 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1791 # @param theDX Length of Box edges, parallel to OX axis.
1792 # @param theDY Length of Box edges, parallel to OY axis.
1793 # @param theDZ Length of Box edges, parallel to OZ axis.
1794 # @return New GEOM.GEOM_Object, containing the created box.
1796 # @ref tui_creation_box "Example"
1797 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1799 Create a box with specified dimensions along the coordinate axes
1800 and with edges, parallel to the coordinate axes.
1801 Center of the box will be at point (DX/2, DY/2, DZ/2).
1804 theDX Length of Box edges, parallel to OX axis.
1805 theDY Length of Box edges, parallel to OY axis.
1806 theDZ Length of Box edges, parallel to OZ axis.
1809 New GEOM.GEOM_Object, containing the created box.
1811 # Example: see GEOM_TestAll.py
1812 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1813 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1814 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1815 anObj.SetParameters(Parameters)
1818 ## Create a box with two specified opposite vertices,
1819 # and with edges, parallel to the coordinate axes
1820 # @param thePnt1 First of two opposite vertices.
1821 # @param thePnt2 Second of two opposite vertices.
1822 # @return New GEOM.GEOM_Object, containing the created box.
1824 # @ref tui_creation_box "Example"
1825 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1827 Create a box with two specified opposite vertices,
1828 and with edges, parallel to the coordinate axes
1831 thePnt1 First of two opposite vertices.
1832 thePnt2 Second of two opposite vertices.
1835 New GEOM.GEOM_Object, containing the created box.
1837 # Example: see GEOM_TestAll.py
1838 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1839 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1842 ## Create a face with specified dimensions with edges parallel to coordinate axes.
1843 # @param theH height of Face.
1844 # @param theW width of Face.
1845 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1846 # @return New GEOM.GEOM_Object, containing the created face.
1848 # @ref tui_creation_face "Example"
1849 def MakeFaceHW(self,theH, theW, theOrientation):
1851 Create a face with specified dimensions with edges parallel to coordinate axes.
1854 theH height of Face.
1856 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1859 New GEOM.GEOM_Object, containing the created face.
1861 # Example: see GEOM_TestAll.py
1862 theH,theW,Parameters = ParseParameters(theH, theW)
1863 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1864 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1865 anObj.SetParameters(Parameters)
1868 ## Create a face from another plane and two sizes,
1869 # vertical size and horisontal size.
1870 # @param theObj Normale vector to the creating face or
1872 # @param theH Height (vertical size).
1873 # @param theW Width (horisontal size).
1874 # @return New GEOM.GEOM_Object, containing the created face.
1876 # @ref tui_creation_face "Example"
1877 def MakeFaceObjHW(self, theObj, theH, theW):
1879 Create a face from another plane and two sizes,
1880 vertical size and horisontal size.
1883 theObj Normale vector to the creating face or
1885 theH Height (vertical size).
1886 theW Width (horisontal size).
1889 New GEOM_Object, containing the created face.
1891 # Example: see GEOM_TestAll.py
1892 theH,theW,Parameters = ParseParameters(theH, theW)
1893 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1894 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1895 anObj.SetParameters(Parameters)
1898 ## Create a disk with given center, normal vector and radius.
1899 # @param thePnt Disk center.
1900 # @param theVec Vector, normal to the plane of the disk.
1901 # @param theR Disk radius.
1902 # @return New GEOM.GEOM_Object, containing the created disk.
1904 # @ref tui_creation_disk "Example"
1905 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1907 Create a disk with given center, normal vector and radius.
1911 theVec Vector, normal to the plane of the disk.
1915 New GEOM.GEOM_Object, containing the created disk.
1917 # Example: see GEOM_TestAll.py
1918 theR,Parameters = ParseParameters(theR)
1919 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1920 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1921 anObj.SetParameters(Parameters)
1924 ## Create a disk, passing through three given points
1925 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1926 # @return New GEOM.GEOM_Object, containing the created disk.
1928 # @ref tui_creation_disk "Example"
1929 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1931 Create a disk, passing through three given points
1934 thePnt1,thePnt2,thePnt3 Points, defining the disk.
1937 New GEOM.GEOM_Object, containing the created disk.
1939 # Example: see GEOM_TestAll.py
1940 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1941 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1944 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1945 # @param theR Radius of Face.
1946 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1947 # @return New GEOM.GEOM_Object, containing the created disk.
1949 # @ref tui_creation_face "Example"
1950 def MakeDiskR(self,theR, theOrientation):
1952 Create a disk with specified dimensions along OX-OY coordinate axes.
1955 theR Radius of Face.
1956 theOrientation set the orientation belong axis OXY or OYZ or OZX
1959 New GEOM.GEOM_Object, containing the created disk.
1962 Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object
1964 # Example: see GEOM_TestAll.py
1965 theR,Parameters = ParseParameters(theR)
1966 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1967 RaiseIfFailed("MakeDiskR", self.PrimOp)
1968 anObj.SetParameters(Parameters)
1971 ## Create a cylinder with given base point, axis, radius and height.
1972 # @param thePnt Central point of cylinder base.
1973 # @param theAxis Cylinder axis.
1974 # @param theR Cylinder radius.
1975 # @param theH Cylinder height.
1976 # @return New GEOM.GEOM_Object, containing the created cylinder.
1978 # @ref tui_creation_cylinder "Example"
1979 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1981 Create a cylinder with given base point, axis, radius and height.
1984 thePnt Central point of cylinder base.
1985 theAxis Cylinder axis.
1986 theR Cylinder radius.
1987 theH Cylinder height.
1990 New GEOM.GEOM_Object, containing the created cylinder.
1992 # Example: see GEOM_TestAll.py
1993 theR,theH,Parameters = ParseParameters(theR, theH)
1994 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1995 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1996 anObj.SetParameters(Parameters)
1999 ## Create a cylinder with given radius and height at
2000 # the origin of coordinate system. Axis of the cylinder
2001 # will be collinear to the OZ axis of the coordinate system.
2002 # @param theR Cylinder radius.
2003 # @param theH Cylinder height.
2004 # @return New GEOM.GEOM_Object, containing the created cylinder.
2006 # @ref tui_creation_cylinder "Example"
2007 def MakeCylinderRH(self,theR, theH):
2009 Create a cylinder with given radius and height at
2010 the origin of coordinate system. Axis of the cylinder
2011 will be collinear to the OZ axis of the coordinate system.
2014 theR Cylinder radius.
2015 theH Cylinder height.
2018 New GEOM.GEOM_Object, containing the created cylinder.
2020 # Example: see GEOM_TestAll.py
2021 theR,theH,Parameters = ParseParameters(theR, theH)
2022 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2023 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2024 anObj.SetParameters(Parameters)
2027 ## Create a sphere with given center and radius.
2028 # @param thePnt Sphere center.
2029 # @param theR Sphere radius.
2030 # @return New GEOM.GEOM_Object, containing the created sphere.
2032 # @ref tui_creation_sphere "Example"
2033 def MakeSpherePntR(self, thePnt, theR):
2035 Create a sphere with given center and radius.
2038 thePnt Sphere center.
2042 New GEOM.GEOM_Object, containing the created sphere.
2044 # Example: see GEOM_TestAll.py
2045 theR,Parameters = ParseParameters(theR)
2046 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2047 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2048 anObj.SetParameters(Parameters)
2051 ## Create a sphere with given center and radius.
2052 # @param x,y,z Coordinates of sphere center.
2053 # @param theR Sphere radius.
2054 # @return New GEOM.GEOM_Object, containing the created sphere.
2056 # @ref tui_creation_sphere "Example"
2057 def MakeSphere(self, x, y, z, theR):
2059 Create a sphere with given center and radius.
2062 x,y,z Coordinates of sphere center.
2066 New GEOM.GEOM_Object, containing the created sphere.
2068 # Example: see GEOM_TestAll.py
2069 point = self.MakeVertex(x, y, z)
2070 anObj = self.MakeSpherePntR(point, theR)
2073 ## Create a sphere with given radius at the origin of coordinate system.
2074 # @param theR Sphere radius.
2075 # @return New GEOM.GEOM_Object, containing the created sphere.
2077 # @ref tui_creation_sphere "Example"
2078 def MakeSphereR(self, theR):
2080 Create a sphere with given radius at the origin of coordinate system.
2086 New GEOM.GEOM_Object, containing the created sphere.
2088 # Example: see GEOM_TestAll.py
2089 theR,Parameters = ParseParameters(theR)
2090 anObj = self.PrimOp.MakeSphereR(theR)
2091 RaiseIfFailed("MakeSphereR", self.PrimOp)
2092 anObj.SetParameters(Parameters)
2095 ## Create a cone with given base point, axis, height and radiuses.
2096 # @param thePnt Central point of the first cone base.
2097 # @param theAxis Cone axis.
2098 # @param theR1 Radius of the first cone base.
2099 # @param theR2 Radius of the second cone base.
2100 # \note If both radiuses are non-zero, the cone will be truncated.
2101 # \note If the radiuses are equal, a cylinder will be created instead.
2102 # @param theH Cone height.
2103 # @return New GEOM.GEOM_Object, containing the created cone.
2105 # @ref tui_creation_cone "Example"
2106 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2108 Create a cone with given base point, axis, height and radiuses.
2111 thePnt Central point of the first cone base.
2113 theR1 Radius of the first cone base.
2114 theR2 Radius of the second cone base.
2118 If both radiuses are non-zero, the cone will be truncated.
2119 If the radiuses are equal, a cylinder will be created instead.
2122 New GEOM.GEOM_Object, containing the created cone.
2124 # Example: see GEOM_TestAll.py
2125 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2126 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2127 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2128 anObj.SetParameters(Parameters)
2131 ## Create a cone with given height and radiuses at
2132 # the origin of coordinate system. Axis of the cone will
2133 # be collinear to the OZ axis of the coordinate system.
2134 # @param theR1 Radius of the first cone base.
2135 # @param theR2 Radius of the second cone base.
2136 # \note If both radiuses are non-zero, the cone will be truncated.
2137 # \note If the radiuses are equal, a cylinder will be created instead.
2138 # @param theH Cone height.
2139 # @return New GEOM.GEOM_Object, containing the created cone.
2141 # @ref tui_creation_cone "Example"
2142 def MakeConeR1R2H(self,theR1, theR2, theH):
2144 Create a cone with given height and radiuses at
2145 the origin of coordinate system. Axis of the cone will
2146 be collinear to the OZ axis of the coordinate system.
2149 theR1 Radius of the first cone base.
2150 theR2 Radius of the second cone base.
2154 If both radiuses are non-zero, the cone will be truncated.
2155 If the radiuses are equal, a cylinder will be created instead.
2158 New GEOM.GEOM_Object, containing the created cone.
2160 # Example: see GEOM_TestAll.py
2161 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2162 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2163 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2164 anObj.SetParameters(Parameters)
2167 ## Create a torus with given center, normal vector and radiuses.
2168 # @param thePnt Torus central point.
2169 # @param theVec Torus axis of symmetry.
2170 # @param theRMajor Torus major radius.
2171 # @param theRMinor Torus minor radius.
2172 # @return New GEOM.GEOM_Object, containing the created torus.
2174 # @ref tui_creation_torus "Example"
2175 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2177 Create a torus with given center, normal vector and radiuses.
2180 thePnt Torus central point.
2181 theVec Torus axis of symmetry.
2182 theRMajor Torus major radius.
2183 theRMinor Torus minor radius.
2186 New GEOM.GEOM_Object, containing the created torus.
2188 # Example: see GEOM_TestAll.py
2189 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2190 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2191 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2192 anObj.SetParameters(Parameters)
2195 ## Create a torus with given radiuses at the origin of coordinate system.
2196 # @param theRMajor Torus major radius.
2197 # @param theRMinor Torus minor radius.
2198 # @return New GEOM.GEOM_Object, containing the created torus.
2200 # @ref tui_creation_torus "Example"
2201 def MakeTorusRR(self, theRMajor, theRMinor):
2203 Create a torus with given radiuses at the origin of coordinate system.
2206 theRMajor Torus major radius.
2207 theRMinor Torus minor radius.
2210 New GEOM.GEOM_Object, containing the created torus.
2212 # Example: see GEOM_TestAll.py
2213 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2214 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2215 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2216 anObj.SetParameters(Parameters)
2219 # end of l3_3d_primitives
2222 ## @addtogroup l3_complex
2225 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2226 # @param theBase Base shape to be extruded.
2227 # @param thePoint1 First end of extrusion vector.
2228 # @param thePoint2 Second end of extrusion vector.
2229 # @param theScaleFactor Use it to make prism with scaled second base.
2230 # Nagative value means not scaled second base.
2231 # @return New GEOM.GEOM_Object, containing the created prism.
2233 # @ref tui_creation_prism "Example"
2234 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2236 Create a shape by extrusion of the base shape along a vector, defined by two points.
2239 theBase Base shape to be extruded.
2240 thePoint1 First end of extrusion vector.
2241 thePoint2 Second end of extrusion vector.
2242 theScaleFactor Use it to make prism with scaled second base.
2243 Nagative value means not scaled second base.
2246 New GEOM.GEOM_Object, containing the created prism.
2248 # Example: see GEOM_TestAll.py
2251 if theScaleFactor > 0:
2252 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2253 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2255 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2256 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2257 anObj.SetParameters(Parameters)
2260 ## Create a shape by extrusion of the base shape along a
2261 # vector, defined by two points, in 2 Ways (forward/backward).
2262 # @param theBase Base shape to be extruded.
2263 # @param thePoint1 First end of extrusion vector.
2264 # @param thePoint2 Second end of extrusion vector.
2265 # @return New GEOM.GEOM_Object, containing the created prism.
2267 # @ref tui_creation_prism "Example"
2268 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2270 Create a shape by extrusion of the base shape along a
2271 vector, defined by two points, in 2 Ways (forward/backward).
2274 theBase Base shape to be extruded.
2275 thePoint1 First end of extrusion vector.
2276 thePoint2 Second end of extrusion vector.
2279 New GEOM.GEOM_Object, containing the created prism.
2281 # Example: see GEOM_TestAll.py
2282 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2283 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2286 ## Create a shape by extrusion of the base shape along the vector,
2287 # i.e. all the space, transfixed by the base shape during its translation
2288 # along the vector on the given distance.
2289 # @param theBase Base shape to be extruded.
2290 # @param theVec Direction of extrusion.
2291 # @param theH Prism dimension along theVec.
2292 # @param theScaleFactor Use it to make prism with scaled second base.
2293 # Negative value means not scaled second base.
2294 # @return New GEOM.GEOM_Object, containing the created prism.
2296 # @ref tui_creation_prism "Example"
2297 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2299 Create a shape by extrusion of the base shape along the vector,
2300 i.e. all the space, transfixed by the base shape during its translation
2301 along the vector on the given distance.
2304 theBase Base shape to be extruded.
2305 theVec Direction of extrusion.
2306 theH Prism dimension along theVec.
2307 theScaleFactor Use it to make prism with scaled second base.
2308 Negative value means not scaled second base.
2311 New GEOM.GEOM_Object, containing the created prism.
2313 # Example: see GEOM_TestAll.py
2316 if theScaleFactor > 0:
2317 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2318 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2320 theH,Parameters = ParseParameters(theH)
2321 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2322 RaiseIfFailed("MakePrismVecH", self.PrimOp)
2323 anObj.SetParameters(Parameters)
2326 ## Create a shape by extrusion of the base shape along the vector,
2327 # i.e. all the space, transfixed by the base shape during its translation
2328 # along the vector on the given distance in 2 Ways (forward/backward).
2329 # @param theBase Base shape to be extruded.
2330 # @param theVec Direction of extrusion.
2331 # @param theH Prism dimension along theVec in forward direction.
2332 # @return New GEOM.GEOM_Object, containing the created prism.
2334 # @ref tui_creation_prism "Example"
2335 def MakePrismVecH2Ways(self, theBase, theVec, theH):
2337 Create a shape by extrusion of the base shape along the vector,
2338 i.e. all the space, transfixed by the base shape during its translation
2339 along the vector on the given distance in 2 Ways (forward/backward).
2342 theBase Base shape to be extruded.
2343 theVec Direction of extrusion.
2344 theH Prism dimension along theVec in forward direction.
2347 New GEOM.GEOM_Object, containing the created prism.
2349 # Example: see GEOM_TestAll.py
2350 theH,Parameters = ParseParameters(theH)
2351 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2352 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2353 anObj.SetParameters(Parameters)
2356 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2357 # @param theBase Base shape to be extruded.
2358 # @param theDX, theDY, theDZ Directions of extrusion.
2359 # @param theScaleFactor Use it to make prism with scaled second base.
2360 # Nagative value means not scaled second base.
2361 # @return New GEOM.GEOM_Object, containing the created prism.
2363 # @ref tui_creation_prism "Example"
2364 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2366 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2369 theBase Base shape to be extruded.
2370 theDX, theDY, theDZ Directions of extrusion.
2371 theScaleFactor Use it to make prism with scaled second base.
2372 Nagative value means not scaled second base.
2375 New GEOM.GEOM_Object, containing the created prism.
2377 # Example: see GEOM_TestAll.py
2380 if theScaleFactor > 0:
2381 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2382 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2384 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2385 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2386 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2387 anObj.SetParameters(Parameters)
2390 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2391 # i.e. all the space, transfixed by the base shape during its translation
2392 # along the vector on the given distance in 2 Ways (forward/backward).
2393 # @param theBase Base shape to be extruded.
2394 # @param theDX, theDY, theDZ Directions of extrusion.
2395 # @return New GEOM.GEOM_Object, containing the created prism.
2397 # @ref tui_creation_prism "Example"
2398 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2400 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2401 i.e. all the space, transfixed by the base shape during its translation
2402 along the vector on the given distance in 2 Ways (forward/backward).
2405 theBase Base shape to be extruded.
2406 theDX, theDY, theDZ Directions of extrusion.
2409 New GEOM.GEOM_Object, containing the created prism.
2411 # Example: see GEOM_TestAll.py
2412 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2413 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2414 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2415 anObj.SetParameters(Parameters)
2418 ## Create a shape by revolution of the base shape around the axis
2419 # on the given angle, i.e. all the space, transfixed by the base
2420 # shape during its rotation around the axis on the given angle.
2421 # @param theBase Base shape to be rotated.
2422 # @param theAxis Rotation axis.
2423 # @param theAngle Rotation angle in radians.
2424 # @return New GEOM.GEOM_Object, containing the created revolution.
2426 # @ref tui_creation_revolution "Example"
2427 def MakeRevolution(self, theBase, theAxis, theAngle):
2429 Create a shape by revolution of the base shape around the axis
2430 on the given angle, i.e. all the space, transfixed by the base
2431 shape during its rotation around the axis on the given angle.
2434 theBase Base shape to be rotated.
2435 theAxis Rotation axis.
2436 theAngle Rotation angle in radians.
2439 New GEOM.GEOM_Object, containing the created revolution.
2441 # Example: see GEOM_TestAll.py
2442 theAngle,Parameters = ParseParameters(theAngle)
2443 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2444 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2445 anObj.SetParameters(Parameters)
2448 ## Create a shape by revolution of the base shape around the axis
2449 # on the given angle, i.e. all the space, transfixed by the base
2450 # shape during its rotation around the axis on the given angle in
2451 # both directions (forward/backward)
2452 # @param theBase Base shape to be rotated.
2453 # @param theAxis Rotation axis.
2454 # @param theAngle Rotation angle in radians.
2455 # @return New GEOM.GEOM_Object, containing the created revolution.
2457 # @ref tui_creation_revolution "Example"
2458 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2460 Create a shape by revolution of the base shape around the axis
2461 on the given angle, i.e. all the space, transfixed by the base
2462 shape during its rotation around the axis on the given angle in
2463 both directions (forward/backward).
2466 theBase Base shape to be rotated.
2467 theAxis Rotation axis.
2468 theAngle Rotation angle in radians.
2471 New GEOM.GEOM_Object, containing the created revolution.
2473 theAngle,Parameters = ParseParameters(theAngle)
2474 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2475 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2476 anObj.SetParameters(Parameters)
2479 ## Create a filling from the given compound of contours.
2480 # @param theShape the compound of contours
2481 # @param theMinDeg a minimal degree of BSpline surface to create
2482 # @param theMaxDeg a maximal degree of BSpline surface to create
2483 # @param theTol2D a 2d tolerance to be reached
2484 # @param theTol3D a 3d tolerance to be reached
2485 # @param theNbIter a number of iteration of approximation algorithm
2486 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2487 # @param isApprox if True, BSpline curves are generated in the process
2488 # of surface construction. By default it is False, that means
2489 # the surface is created using given curves. The usage of
2490 # Approximation makes the algorithm work slower, but allows
2491 # building the surface for rather complex cases.
2492 # @return New GEOM.GEOM_Object, containing the created filling surface.
2494 # @ref tui_creation_filling "Example"
2495 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2496 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2498 Create a filling from the given compound of contours.
2501 theShape the compound of contours
2502 theMinDeg a minimal degree of BSpline surface to create
2503 theMaxDeg a maximal degree of BSpline surface to create
2504 theTol2D a 2d tolerance to be reached
2505 theTol3D a 3d tolerance to be reached
2506 theNbIter a number of iteration of approximation algorithm
2507 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2508 isApprox if True, BSpline curves are generated in the process
2509 of surface construction. By default it is False, that means
2510 the surface is created using given curves. The usage of
2511 Approximation makes the algorithm work slower, but allows
2512 building the surface for rather complex cases
2515 New GEOM.GEOM_Object, containing the created filling surface.
2518 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2520 # Example: see GEOM_TestAll.py
2521 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2522 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2523 theTol2D, theTol3D, theNbIter,
2524 theMethod, isApprox)
2525 RaiseIfFailed("MakeFilling", self.PrimOp)
2526 anObj.SetParameters(Parameters)
2530 ## Create a filling from the given compound of contours.
2531 # This method corresponds to MakeFilling with isApprox=True
2532 # @param theShape the compound of contours
2533 # @param theMinDeg a minimal degree of BSpline surface to create
2534 # @param theMaxDeg a maximal degree of BSpline surface to create
2535 # @param theTol3D a 3d tolerance to be reached
2536 # @return New GEOM.GEOM_Object, containing the created filling surface.
2538 # @ref tui_creation_filling "Example"
2539 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2541 Create a filling from the given compound of contours.
2542 This method corresponds to MakeFilling with isApprox=True
2545 theShape the compound of contours
2546 theMinDeg a minimal degree of BSpline surface to create
2547 theMaxDeg a maximal degree of BSpline surface to create
2548 theTol3D a 3d tolerance to be reached
2551 New GEOM.GEOM_Object, containing the created filling surface.
2554 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2556 # Example: see GEOM_TestAll.py
2557 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2558 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2559 0, theTol3D, 0, GEOM.FOM_Default, True)
2560 RaiseIfFailed("MakeFillingNew", self.PrimOp)
2561 anObj.SetParameters(Parameters)
2564 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2565 # @param theSeqSections - set of specified sections.
2566 # @param theModeSolid - mode defining building solid or shell
2567 # @param thePreci - precision 3D used for smoothing
2568 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2569 # @return New GEOM.GEOM_Object, containing the created shell or solid.
2571 # @ref swig_todo "Example"
2572 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2574 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2577 theSeqSections - set of specified sections.
2578 theModeSolid - mode defining building solid or shell
2579 thePreci - precision 3D used for smoothing
2580 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2583 New GEOM.GEOM_Object, containing the created shell or solid.
2585 # Example: see GEOM_TestAll.py
2586 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2587 RaiseIfFailed("MakeThruSections", self.PrimOp)
2590 ## Create a shape by extrusion of the base shape along
2591 # the path shape. The path shape can be a wire or an edge.
2592 # @param theBase Base shape to be extruded.
2593 # @param thePath Path shape to extrude the base shape along it.
2594 # @return New GEOM.GEOM_Object, containing the created pipe.
2596 # @ref tui_creation_pipe "Example"
2597 def MakePipe(self,theBase, thePath):
2599 Create a shape by extrusion of the base shape along
2600 the path shape. The path shape can be a wire or an edge.
2603 theBase Base shape to be extruded.
2604 thePath Path shape to extrude the base shape along it.
2607 New GEOM.GEOM_Object, containing the created pipe.
2609 # Example: see GEOM_TestAll.py
2610 anObj = self.PrimOp.MakePipe(theBase, thePath)
2611 RaiseIfFailed("MakePipe", self.PrimOp)
2614 ## Create a shape by extrusion of the profile shape along
2615 # the path shape. The path shape can be a wire or an edge.
2616 # the several profiles can be specified in the several locations of path.
2617 # @param theSeqBases - list of Bases shape to be extruded.
2618 # @param theLocations - list of locations on the path corresponding
2619 # specified list of the Bases shapes. Number of locations
2620 # should be equal to number of bases or list of locations can be empty.
2621 # @param thePath - Path shape to extrude the base shape along it.
2622 # @param theWithContact - the mode defining that the section is translated to be in
2623 # contact with the spine.
2624 # @param theWithCorrection - defining that the section is rotated to be
2625 # orthogonal to the spine tangent in the correspondent point
2626 # @return New GEOM.GEOM_Object, containing the created pipe.
2628 # @ref tui_creation_pipe_with_diff_sec "Example"
2629 def MakePipeWithDifferentSections(self, theSeqBases,
2630 theLocations, thePath,
2631 theWithContact, theWithCorrection):
2633 Create a shape by extrusion of the profile shape along
2634 the path shape. The path shape can be a wire or an edge.
2635 the several profiles can be specified in the several locations of path.
2638 theSeqBases - list of Bases shape to be extruded.
2639 theLocations - list of locations on the path corresponding
2640 specified list of the Bases shapes. Number of locations
2641 should be equal to number of bases or list of locations can be empty.
2642 thePath - Path shape to extrude the base shape along it.
2643 theWithContact - the mode defining that the section is translated to be in
2644 contact with the spine(0/1)
2645 theWithCorrection - defining that the section is rotated to be
2646 orthogonal to the spine tangent in the correspondent point (0/1)
2649 New GEOM.GEOM_Object, containing the created pipe.
2651 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2652 theLocations, thePath,
2653 theWithContact, theWithCorrection)
2654 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2657 ## Create a shape by extrusion of the profile shape along
2658 # the path shape. The path shape can be a wire or a edge.
2659 # the several profiles can be specified in the several locations of path.
2660 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
2661 # shell or face. If number of faces in neighbour sections
2662 # aren't coincided result solid between such sections will
2663 # be created using external boundaries of this shells.
2664 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2665 # This list is used for searching correspondences between
2666 # faces in the sections. Size of this list must be equal
2667 # to size of list of base shapes.
2668 # @param theLocations - list of locations on the path corresponding
2669 # specified list of the Bases shapes. Number of locations
2670 # should be equal to number of bases. First and last
2671 # locations must be coincided with first and last vertexes
2672 # of path correspondingly.
2673 # @param thePath - Path shape to extrude the base shape along it.
2674 # @param theWithContact - the mode defining that the section is translated to be in
2675 # contact with the spine.
2676 # @param theWithCorrection - defining that the section is rotated to be
2677 # orthogonal to the spine tangent in the correspondent point
2678 # @return New GEOM.GEOM_Object, containing the created solids.
2680 # @ref tui_creation_pipe_with_shell_sec "Example"
2681 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2682 theLocations, thePath,
2683 theWithContact, theWithCorrection):
2685 Create a shape by extrusion of the profile shape along
2686 the path shape. The path shape can be a wire or a edge.
2687 the several profiles can be specified in the several locations of path.
2690 theSeqBases - list of Bases shape to be extruded. Base shape must be
2691 shell or face. If number of faces in neighbour sections
2692 aren't coincided result solid between such sections will
2693 be created using external boundaries of this shells.
2694 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2695 This list is used for searching correspondences between
2696 faces in the sections. Size of this list must be equal
2697 to size of list of base shapes.
2698 theLocations - list of locations on the path corresponding
2699 specified list of the Bases shapes. Number of locations
2700 should be equal to number of bases. First and last
2701 locations must be coincided with first and last vertexes
2702 of path correspondingly.
2703 thePath - Path shape to extrude the base shape along it.
2704 theWithContact - the mode defining that the section is translated to be in
2705 contact with the spine (0/1)
2706 theWithCorrection - defining that the section is rotated to be
2707 orthogonal to the spine tangent in the correspondent point (0/1)
2710 New GEOM.GEOM_Object, containing the created solids.
2712 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2713 theLocations, thePath,
2714 theWithContact, theWithCorrection)
2715 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2718 ## Create a shape by extrusion of the profile shape along
2719 # the path shape. This function is used only for debug pipe
2720 # functionality - it is a version of function MakePipeWithShellSections()
2721 # which give a possibility to recieve information about
2722 # creating pipe between each pair of sections step by step.
2723 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2724 theLocations, thePath,
2725 theWithContact, theWithCorrection):
2727 Create a shape by extrusion of the profile shape along
2728 the path shape. This function is used only for debug pipe
2729 functionality - it is a version of previous function
2730 geompy.MakePipeWithShellSections() which give a possibility to
2731 recieve information about creating pipe between each pair of
2732 sections step by step.
2735 nbsect = len(theSeqBases)
2736 nbsubsect = len(theSeqSubBases)
2737 #print "nbsect = ",nbsect
2738 for i in range(1,nbsect):
2740 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2741 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2743 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2744 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2745 tmpLocations, thePath,
2746 theWithContact, theWithCorrection)
2747 if self.PrimOp.IsDone() == 0:
2748 print "Problems with pipe creation between ",i," and ",i+1," sections"
2749 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2752 print "Pipe between ",i," and ",i+1," sections is OK"
2757 resc = self.MakeCompound(res)
2758 #resc = self.MakeSewing(res, 0.001)
2759 #print "resc: ",resc
2762 ## Create solids between given sections
2763 # @param theSeqBases - list of sections (shell or face).
2764 # @param theLocations - list of corresponding vertexes
2765 # @return New GEOM.GEOM_Object, containing the created solids.
2767 # @ref tui_creation_pipe_without_path "Example"
2768 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2770 Create solids between given sections
2773 theSeqBases - list of sections (shell or face).
2774 theLocations - list of corresponding vertexes
2777 New GEOM.GEOM_Object, containing the created solids.
2779 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2780 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2783 ## Create a shape by extrusion of the base shape along
2784 # the path shape with constant bi-normal direction along the given vector.
2785 # The path shape can be a wire or an edge.
2786 # @param theBase Base shape to be extruded.
2787 # @param thePath Path shape to extrude the base shape along it.
2788 # @param theVec Vector defines a constant binormal direction to keep the
2789 # same angle beetween the direction and the sections
2790 # along the sweep surface.
2791 # @return New GEOM.GEOM_Object, containing the created pipe.
2793 # @ref tui_creation_pipe "Example"
2794 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2796 Create a shape by extrusion of the base shape along
2797 the path shape with constant bi-normal direction along the given vector.
2798 The path shape can be a wire or an edge.
2801 theBase Base shape to be extruded.
2802 thePath Path shape to extrude the base shape along it.
2803 theVec Vector defines a constant binormal direction to keep the
2804 same angle beetween the direction and the sections
2805 along the sweep surface.
2808 New GEOM.GEOM_Object, containing the created pipe.
2810 # Example: see GEOM_TestAll.py
2811 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2812 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2818 ## @addtogroup l3_advanced
2821 ## Create a linear edge with specified ends.
2822 # @param thePnt1 Point for the first end of edge.
2823 # @param thePnt2 Point for the second end of edge.
2824 # @return New GEOM.GEOM_Object, containing the created edge.
2826 # @ref tui_creation_edge "Example"
2827 def MakeEdge(self,thePnt1, thePnt2):
2829 Create a linear edge with specified ends.
2832 thePnt1 Point for the first end of edge.
2833 thePnt2 Point for the second end of edge.
2836 New GEOM.GEOM_Object, containing the created edge.
2838 # Example: see GEOM_TestAll.py
2839 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2840 RaiseIfFailed("MakeEdge", self.ShapesOp)
2843 ## Create a new edge, corresponding to the given length on the given curve.
2844 # @param theRefCurve The referenced curve (edge).
2845 # @param theLength Length on the referenced curve. It can be negative.
2846 # @param theStartPoint Any point can be selected for it, the new edge will begin
2847 # at the end of \a theRefCurve, close to the selected point.
2848 # If None, start from the first point of \a theRefCurve.
2849 # @return New GEOM.GEOM_Object, containing the created edge.
2851 # @ref tui_creation_edge "Example"
2852 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2854 Create a new edge, corresponding to the given length on the given curve.
2857 theRefCurve The referenced curve (edge).
2858 theLength Length on the referenced curve. It can be negative.
2859 theStartPoint Any point can be selected for it, the new edge will begin
2860 at the end of theRefCurve, close to the selected point.
2861 If None, start from the first point of theRefCurve.
2864 New GEOM.GEOM_Object, containing the created edge.
2866 # Example: see GEOM_TestAll.py
2867 theLength, Parameters = ParseParameters(theLength)
2868 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2869 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2870 anObj.SetParameters(Parameters)
2873 ## Create an edge from specified wire.
2874 # @param theWire source Wire
2875 # @param theLinearTolerance linear tolerance value (default = 1e-07)
2876 # @param theAngularTolerance angular tolerance value (default = 1e-12)
2877 # @return New GEOM.GEOM_Object, containing the created edge.
2879 # @ref tui_creation_edge "Example"
2880 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
2882 Create an edge from specified wire.
2886 theLinearTolerance linear tolerance value (default = 1e-07)
2887 theAngularTolerance angular tolerance value (default = 1e-12)
2890 New GEOM.GEOM_Object, containing the created edge.
2892 # Example: see GEOM_TestAll.py
2893 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
2894 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
2897 ## Create a wire from the set of edges and wires.
2898 # @param theEdgesAndWires List of edges and/or wires.
2899 # @param theTolerance Maximum distance between vertices, that will be merged.
2900 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
2901 # @return New GEOM.GEOM_Object, containing the created wire.
2903 # @ref tui_creation_wire "Example"
2904 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
2906 Create a wire from the set of edges and wires.
2909 theEdgesAndWires List of edges and/or wires.
2910 theTolerance Maximum distance between vertices, that will be merged.
2911 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
2914 New GEOM.GEOM_Object, containing the created wire.
2916 # Example: see GEOM_TestAll.py
2917 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
2918 RaiseIfFailed("MakeWire", self.ShapesOp)
2921 ## Create a face on the given wire.
2922 # @param theWire closed Wire or Edge to build the face on.
2923 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2924 # If the tolerance of the obtained planar face is less
2925 # than 1e-06, this face will be returned, otherwise the
2926 # algorithm tries to build any suitable face on the given
2927 # wire and prints a warning message.
2928 # @return New GEOM.GEOM_Object, containing the created face.
2930 # @ref tui_creation_face "Example"
2931 def MakeFace(self, theWire, isPlanarWanted):
2933 Create a face on the given wire.
2936 theWire closed Wire or Edge to build the face on.
2937 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2938 If the tolerance of the obtained planar face is less
2939 than 1e-06, this face will be returned, otherwise the
2940 algorithm tries to build any suitable face on the given
2941 wire and prints a warning message.
2944 New GEOM.GEOM_Object, containing the created face.
2946 # Example: see GEOM_TestAll.py
2947 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
2948 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
2949 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
2951 RaiseIfFailed("MakeFace", self.ShapesOp)
2954 ## Create a face on the given wires set.
2955 # @param theWires List of closed wires or edges to build the face on.
2956 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2957 # If the tolerance of the obtained planar face is less
2958 # than 1e-06, this face will be returned, otherwise the
2959 # algorithm tries to build any suitable face on the given
2960 # wire and prints a warning message.
2961 # @return New GEOM.GEOM_Object, containing the created face.
2963 # @ref tui_creation_face "Example"
2964 def MakeFaceWires(self, theWires, isPlanarWanted):
2966 Create a face on the given wires set.
2969 theWires List of closed wires or edges to build the face on.
2970 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2971 If the tolerance of the obtained planar face is less
2972 than 1e-06, this face will be returned, otherwise the
2973 algorithm tries to build any suitable face on the given
2974 wire and prints a warning message.
2977 New GEOM.GEOM_Object, containing the created face.
2979 # Example: see GEOM_TestAll.py
2980 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
2981 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
2982 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
2984 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
2987 ## See MakeFaceWires() method for details.
2989 # @ref tui_creation_face "Example 1"
2990 # \n @ref swig_MakeFaces "Example 2"
2991 def MakeFaces(self, theWires, isPlanarWanted):
2993 See geompy.MakeFaceWires() method for details.
2995 # Example: see GEOM_TestOthers.py
2996 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
2999 ## Create a shell from the set of faces and shells.
3000 # @param theFacesAndShells List of faces and/or shells.
3001 # @return New GEOM.GEOM_Object, containing the created shell.
3003 # @ref tui_creation_shell "Example"
3004 def MakeShell(self,theFacesAndShells):
3006 Create a shell from the set of faces and shells.
3009 theFacesAndShells List of faces and/or shells.
3012 New GEOM.GEOM_Object, containing the created shell.
3014 # Example: see GEOM_TestAll.py
3015 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3016 RaiseIfFailed("MakeShell", self.ShapesOp)
3019 ## Create a solid, bounded by the given shells.
3020 # @param theShells Sequence of bounding shells.
3021 # @return New GEOM.GEOM_Object, containing the created solid.
3023 # @ref tui_creation_solid "Example"
3024 def MakeSolid(self, theShells):
3026 Create a solid, bounded by the given shells.
3029 theShells Sequence of bounding shells.
3032 New GEOM.GEOM_Object, containing the created solid.
3034 # Example: see GEOM_TestAll.py
3035 if len(theShells) == 1:
3036 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3038 # raise RuntimeError, "MakeSolidShells : " + descr
3039 if descr == "WRN_SHAPE_UNCLOSED":
3040 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3041 anObj = self.ShapesOp.MakeSolidShells(theShells)
3042 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3045 ## Create a compound of the given shapes.
3046 # @param theShapes List of shapes to put in compound.
3047 # @return New GEOM.GEOM_Object, containing the created compound.
3049 # @ref tui_creation_compound "Example"
3050 def MakeCompound(self,theShapes):
3052 Create a compound of the given shapes.
3055 theShapes List of shapes to put in compound.
3058 New GEOM.GEOM_Object, containing the created compound.
3060 # Example: see GEOM_TestAll.py
3061 anObj = self.ShapesOp.MakeCompound(theShapes)
3062 RaiseIfFailed("MakeCompound", self.ShapesOp)
3065 # end of l3_advanced
3068 ## @addtogroup l2_measure
3071 ## Gives quantity of faces in the given shape.
3072 # @param theShape Shape to count faces of.
3073 # @return Quantity of faces.
3075 # @ref swig_NumberOf "Example"
3076 def NumberOfFaces(self, theShape):
3078 Gives quantity of faces in the given shape.
3081 theShape Shape to count faces of.
3086 # Example: see GEOM_TestOthers.py
3087 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3088 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3091 ## Gives quantity of edges in the given shape.
3092 # @param theShape Shape to count edges of.
3093 # @return Quantity of edges.
3095 # @ref swig_NumberOf "Example"
3096 def NumberOfEdges(self, theShape):
3098 Gives quantity of edges in the given shape.
3101 theShape Shape to count edges of.
3106 # Example: see GEOM_TestOthers.py
3107 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3108 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3111 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3112 # @param theShape Shape to count sub-shapes of.
3113 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3114 # @return Quantity of sub-shapes of given type.
3116 # @ref swig_NumberOf "Example"
3117 def NumberOfSubShapes(self, theShape, theShapeType):
3119 Gives quantity of sub-shapes of type theShapeType in the given shape.
3122 theShape Shape to count sub-shapes of.
3123 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3126 Quantity of sub-shapes of given type.
3128 # Example: see GEOM_TestOthers.py
3129 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3130 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3133 ## Gives quantity of solids in the given shape.
3134 # @param theShape Shape to count solids in.
3135 # @return Quantity of solids.
3137 # @ref swig_NumberOf "Example"
3138 def NumberOfSolids(self, theShape):
3140 Gives quantity of solids in the given shape.
3143 theShape Shape to count solids in.
3148 # Example: see GEOM_TestOthers.py
3149 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3150 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3156 ## @addtogroup l3_healing
3159 ## Reverses an orientation the given shape.
3160 # @param theShape Shape to be reversed.
3161 # @return The reversed copy of theShape.
3163 # @ref swig_ChangeOrientation "Example"
3164 def ChangeOrientation(self,theShape):
3166 Reverses an orientation the given shape.
3169 theShape Shape to be reversed.
3172 The reversed copy of theShape.
3174 # Example: see GEOM_TestAll.py
3175 anObj = self.ShapesOp.ChangeOrientation(theShape)
3176 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3179 ## See ChangeOrientation() method for details.
3181 # @ref swig_OrientationChange "Example"
3182 def OrientationChange(self,theShape):
3184 See geompy.ChangeOrientation method for details.
3186 # Example: see GEOM_TestOthers.py
3187 anObj = self.ChangeOrientation(theShape)
3193 ## @addtogroup l4_obtain
3196 ## Retrieve all free faces from the given shape.
3197 # Free face is a face, which is not shared between two shells of the shape.
3198 # @param theShape Shape to find free faces in.
3199 # @return List of IDs of all free faces, contained in theShape.
3201 # @ref tui_measurement_tools_page "Example"
3202 def GetFreeFacesIDs(self,theShape):
3204 Retrieve all free faces from the given shape.
3205 Free face is a face, which is not shared between two shells of the shape.
3208 theShape Shape to find free faces in.
3211 List of IDs of all free faces, contained in theShape.
3213 # Example: see GEOM_TestOthers.py
3214 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3215 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3218 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3219 # @param theShape1 Shape to find sub-shapes in.
3220 # @param theShape2 Shape to find shared sub-shapes with.
3221 # @param theShapeType Type of sub-shapes to be retrieved.
3222 # @return List of sub-shapes of theShape1, shared with theShape2.
3224 # @ref swig_GetSharedShapes "Example"
3225 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3227 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3230 theShape1 Shape to find sub-shapes in.
3231 theShape2 Shape to find shared sub-shapes with.
3232 theShapeType Type of sub-shapes to be retrieved.
3235 List of sub-shapes of theShape1, shared with theShape2.
3237 # Example: see GEOM_TestOthers.py
3238 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3239 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3242 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3243 # @param theShapes Shapes to find common sub-shapes of.
3244 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3245 # @return List of objects, that are sub-shapes of all given shapes.
3247 # @ref swig_GetSharedShapes "Example"
3248 def GetSharedShapesMulti(self, theShapes, theShapeType):
3250 Get all sub-shapes, shared by all shapes in the list theShapes.
3253 theShapes Shapes to find common sub-shapes of.
3254 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3257 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3259 # Example: see GEOM_TestOthers.py
3260 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3261 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3264 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3265 # situated relatively the specified plane by the certain way,
3266 # defined through <VAR>theState</VAR> parameter.
3267 # @param theShape Shape to find sub-shapes of.
3268 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3269 # @param theAx1 Vector (or line, or linear edge), specifying normal
3270 # direction and location of the plane to find shapes on.
3271 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3272 # @return List of all found sub-shapes.
3274 # @ref swig_GetShapesOnPlane "Example"
3275 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3277 Find in theShape all sub-shapes of type theShapeType,
3278 situated relatively the specified plane by the certain way,
3279 defined through theState parameter.
3282 theShape Shape to find sub-shapes of.
3283 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3284 theAx1 Vector (or line, or linear edge), specifying normal
3285 direction and location of the plane to find shapes on.
3286 theState The state of the sub-shapes to find (see GEOM::shape_state)
3289 List of all found sub-shapes.
3291 # Example: see GEOM_TestOthers.py
3292 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3293 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3296 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3297 # situated relatively the specified plane by the certain way,
3298 # defined through <VAR>theState</VAR> parameter.
3299 # @param theShape Shape to find sub-shapes of.
3300 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3301 # @param theAx1 Vector (or line, or linear edge), specifying normal
3302 # direction and location of the plane to find shapes on.
3303 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3304 # @return List of all found sub-shapes indices.
3306 # @ref swig_GetShapesOnPlaneIDs "Example"
3307 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3309 Find in theShape all sub-shapes of type theShapeType,
3310 situated relatively the specified plane by the certain way,
3311 defined through theState parameter.
3314 theShape Shape to find sub-shapes of.
3315 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3316 theAx1 Vector (or line, or linear edge), specifying normal
3317 direction and location of the plane to find shapes on.
3318 theState The state of the sub-shapes to find (see GEOM::shape_state)
3321 List of all found sub-shapes indices.
3323 # Example: see GEOM_TestOthers.py
3324 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3325 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3328 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3329 # situated relatively the specified plane by the certain way,
3330 # defined through <VAR>theState</VAR> parameter.
3331 # @param theShape Shape to find sub-shapes of.
3332 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3333 # @param theAx1 Vector (or line, or linear edge), specifying normal
3334 # direction of the plane to find shapes on.
3335 # @param thePnt Point specifying location of the plane to find shapes on.
3336 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3337 # @return List of all found sub-shapes.
3339 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3340 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3342 Find in theShape all sub-shapes of type theShapeType,
3343 situated relatively the specified plane by the certain way,
3344 defined through theState parameter.
3347 theShape Shape to find sub-shapes of.
3348 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3349 theAx1 Vector (or line, or linear edge), specifying normal
3350 direction and location of the plane to find shapes on.
3351 thePnt Point specifying location of the plane to find shapes on.
3352 theState The state of the sub-shapes to find (see GEOM::shape_state)
3355 List of all found sub-shapes.
3357 # Example: see GEOM_TestOthers.py
3358 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3359 theAx1, thePnt, theState)
3360 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3363 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3364 # situated relatively the specified plane by the certain way,
3365 # defined through <VAR>theState</VAR> parameter.
3366 # @param theShape Shape to find sub-shapes of.
3367 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3368 # @param theAx1 Vector (or line, or linear edge), specifying normal
3369 # direction of the plane to find shapes on.
3370 # @param thePnt Point specifying location of the plane to find shapes on.
3371 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3372 # @return List of all found sub-shapes indices.
3374 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3375 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3377 Find in theShape all sub-shapes of type theShapeType,
3378 situated relatively the specified plane by the certain way,
3379 defined through theState parameter.
3382 theShape Shape to find sub-shapes of.
3383 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3384 theAx1 Vector (or line, or linear edge), specifying normal
3385 direction and location of the plane to find shapes on.
3386 thePnt Point specifying location of the plane to find shapes on.
3387 theState The state of the sub-shapes to find (see GEOM::shape_state)
3390 List of all found sub-shapes indices.
3392 # Example: see GEOM_TestOthers.py
3393 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3394 theAx1, thePnt, theState)
3395 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3398 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3399 # the specified cylinder by the certain way, defined through \a theState parameter.
3400 # @param theShape Shape to find sub-shapes of.
3401 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3402 # @param theAxis Vector (or line, or linear edge), specifying
3403 # axis of the cylinder to find shapes on.
3404 # @param theRadius Radius of the cylinder to find shapes on.
3405 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3406 # @return List of all found sub-shapes.
3408 # @ref swig_GetShapesOnCylinder "Example"
3409 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3411 Find in theShape all sub-shapes of type theShapeType, situated relatively
3412 the specified cylinder by the certain way, defined through theState parameter.
3415 theShape Shape to find sub-shapes of.
3416 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3417 theAxis Vector (or line, or linear edge), specifying
3418 axis of the cylinder to find shapes on.
3419 theRadius Radius of the cylinder to find shapes on.
3420 theState The state of the sub-shapes to find (see GEOM::shape_state)
3423 List of all found sub-shapes.
3425 # Example: see GEOM_TestOthers.py
3426 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3427 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3430 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3431 # the specified cylinder by the certain way, defined through \a theState parameter.
3432 # @param theShape Shape to find sub-shapes of.
3433 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3434 # @param theAxis Vector (or line, or linear edge), specifying
3435 # axis of the cylinder to find shapes on.
3436 # @param theRadius Radius of the cylinder to find shapes on.
3437 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3438 # @return List of all found sub-shapes indices.
3440 # @ref swig_GetShapesOnCylinderIDs "Example"
3441 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3443 Find in theShape all sub-shapes of type theShapeType, situated relatively
3444 the specified cylinder by the certain way, defined through theState parameter.
3447 theShape Shape to find sub-shapes of.
3448 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3449 theAxis Vector (or line, or linear edge), specifying
3450 axis of the cylinder to find shapes on.
3451 theRadius Radius of the cylinder to find shapes on.
3452 theState The state of the sub-shapes to find (see GEOM::shape_state)
3455 List of all found sub-shapes indices.
3457 # Example: see GEOM_TestOthers.py
3458 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3459 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3462 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3463 # the specified cylinder by the certain way, defined through \a theState parameter.
3464 # @param theShape Shape to find sub-shapes of.
3465 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3466 # @param theAxis Vector (or line, or linear edge), specifying
3467 # axis of the cylinder to find shapes on.
3468 # @param thePnt Point specifying location of the bottom of the cylinder.
3469 # @param theRadius Radius of the cylinder to find shapes on.
3470 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3471 # @return List of all found sub-shapes.
3473 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3474 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3476 Find in theShape all sub-shapes of type theShapeType, situated relatively
3477 the specified cylinder by the certain way, defined through theState parameter.
3480 theShape Shape to find sub-shapes of.
3481 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3482 theAxis Vector (or line, or linear edge), specifying
3483 axis of the cylinder to find shapes on.
3484 theRadius Radius of the cylinder to find shapes on.
3485 theState The state of the sub-shapes to find (see GEOM::shape_state)
3488 List of all found sub-shapes.
3490 # Example: see GEOM_TestOthers.py
3491 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3492 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3495 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3496 # the specified cylinder by the certain way, defined through \a theState parameter.
3497 # @param theShape Shape to find sub-shapes of.
3498 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3499 # @param theAxis Vector (or line, or linear edge), specifying
3500 # axis of the cylinder to find shapes on.
3501 # @param thePnt Point specifying location of the bottom of the cylinder.
3502 # @param theRadius Radius of the cylinder to find shapes on.
3503 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3504 # @return List of all found sub-shapes indices
3506 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3507 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3509 Find in theShape all sub-shapes of type theShapeType, situated relatively
3510 the specified cylinder by the certain way, defined through theState parameter.
3513 theShape Shape to find sub-shapes of.
3514 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3515 theAxis Vector (or line, or linear edge), specifying
3516 axis of the cylinder to find shapes on.
3517 theRadius Radius of the cylinder to find shapes on.
3518 theState The state of the sub-shapes to find (see GEOM::shape_state)
3521 List of all found sub-shapes indices.
3523 # Example: see GEOM_TestOthers.py
3524 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3525 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3528 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3529 # the specified sphere by the certain way, defined through \a theState parameter.
3530 # @param theShape Shape to find sub-shapes of.
3531 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3532 # @param theCenter Point, specifying center of the sphere to find shapes on.
3533 # @param theRadius Radius of the sphere to find shapes on.
3534 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3535 # @return List of all found sub-shapes.
3537 # @ref swig_GetShapesOnSphere "Example"
3538 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3540 Find in theShape all sub-shapes of type theShapeType, situated relatively
3541 the specified sphere by the certain way, defined through theState parameter.
3544 theShape Shape to find sub-shapes of.
3545 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3546 theCenter Point, specifying center of the sphere to find shapes on.
3547 theRadius Radius of the sphere to find shapes on.
3548 theState The state of the sub-shapes to find (see GEOM::shape_state)
3551 List of all found sub-shapes.
3553 # Example: see GEOM_TestOthers.py
3554 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3555 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3558 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3559 # the specified sphere by the certain way, defined through \a theState parameter.
3560 # @param theShape Shape to find sub-shapes of.
3561 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3562 # @param theCenter Point, specifying center of the sphere to find shapes on.
3563 # @param theRadius Radius of the sphere to find shapes on.
3564 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3565 # @return List of all found sub-shapes indices.
3567 # @ref swig_GetShapesOnSphereIDs "Example"
3568 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3570 Find in theShape all sub-shapes of type theShapeType, situated relatively
3571 the specified sphere by the certain way, defined through theState parameter.
3574 theShape Shape to find sub-shapes of.
3575 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3576 theCenter Point, specifying center of the sphere to find shapes on.
3577 theRadius Radius of the sphere to find shapes on.
3578 theState The state of the sub-shapes to find (see GEOM::shape_state)
3581 List of all found sub-shapes indices.
3583 # Example: see GEOM_TestOthers.py
3584 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3585 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3588 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3589 # the specified quadrangle by the certain way, defined through \a theState parameter.
3590 # @param theShape Shape to find sub-shapes of.
3591 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3592 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3593 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3594 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3595 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3596 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3597 # @return List of all found sub-shapes.
3599 # @ref swig_GetShapesOnQuadrangle "Example"
3600 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3601 theTopLeftPoint, theTopRigthPoint,
3602 theBottomLeftPoint, theBottomRigthPoint, theState):
3604 Find in theShape all sub-shapes of type theShapeType, situated relatively
3605 the specified quadrangle by the certain way, defined through theState parameter.
3608 theShape Shape to find sub-shapes of.
3609 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3610 theTopLeftPoint Point, specifying top left corner of a quadrangle
3611 theTopRigthPoint Point, specifying top right corner of a quadrangle
3612 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3613 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3614 theState The state of the sub-shapes to find (see GEOM::shape_state)
3617 List of all found sub-shapes.
3619 # Example: see GEOM_TestOthers.py
3620 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3621 theTopLeftPoint, theTopRigthPoint,
3622 theBottomLeftPoint, theBottomRigthPoint, theState)
3623 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3626 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3627 # the specified quadrangle by the certain way, defined through \a theState parameter.
3628 # @param theShape Shape to find sub-shapes of.
3629 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3630 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3631 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3632 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3633 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3634 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3635 # @return List of all found sub-shapes indices.
3637 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3638 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3639 theTopLeftPoint, theTopRigthPoint,
3640 theBottomLeftPoint, theBottomRigthPoint, theState):
3642 Find in theShape all sub-shapes of type theShapeType, situated relatively
3643 the specified quadrangle by the certain way, defined through theState parameter.
3646 theShape Shape to find sub-shapes of.
3647 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3648 theTopLeftPoint Point, specifying top left corner of a quadrangle
3649 theTopRigthPoint Point, specifying top right corner of a quadrangle
3650 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3651 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3652 theState The state of the sub-shapes to find (see GEOM::shape_state)
3655 List of all found sub-shapes indices.
3658 # Example: see GEOM_TestOthers.py
3659 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3660 theTopLeftPoint, theTopRigthPoint,
3661 theBottomLeftPoint, theBottomRigthPoint, theState)
3662 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3665 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3666 # the specified \a theBox by the certain way, defined through \a theState parameter.
3667 # @param theBox Shape for relative comparing.
3668 # @param theShape Shape to find sub-shapes of.
3669 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3670 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3671 # @return List of all found sub-shapes.
3673 # @ref swig_GetShapesOnBox "Example"
3674 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3676 Find in theShape all sub-shapes of type theShapeType, situated relatively
3677 the specified theBox by the certain way, defined through theState parameter.
3680 theBox Shape for relative comparing.
3681 theShape Shape to find sub-shapes of.
3682 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3683 theState The state of the sub-shapes to find (see GEOM::shape_state)
3686 List of all found sub-shapes.
3688 # Example: see GEOM_TestOthers.py
3689 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3690 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3693 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3694 # the specified \a theBox by the certain way, defined through \a theState parameter.
3695 # @param theBox Shape for relative comparing.
3696 # @param theShape Shape to find sub-shapes of.
3697 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3698 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3699 # @return List of all found sub-shapes indices.
3701 # @ref swig_GetShapesOnBoxIDs "Example"
3702 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3704 Find in theShape all sub-shapes of type theShapeType, situated relatively
3705 the specified theBox by the certain way, defined through theState parameter.
3708 theBox Shape for relative comparing.
3709 theShape Shape to find sub-shapes of.
3710 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3711 theState The state of the sub-shapes to find (see GEOM::shape_state)
3714 List of all found sub-shapes indices.
3716 # Example: see GEOM_TestOthers.py
3717 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3718 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3721 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3722 # situated relatively the specified \a theCheckShape by the
3723 # certain way, defined through \a theState parameter.
3724 # @param theCheckShape Shape for relative comparing. It must be a solid.
3725 # @param theShape Shape to find sub-shapes of.
3726 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3727 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3728 # @return List of all found sub-shapes.
3730 # @ref swig_GetShapesOnShape "Example"
3731 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3733 Find in theShape all sub-shapes of type theShapeType,
3734 situated relatively the specified theCheckShape by the
3735 certain way, defined through theState parameter.
3738 theCheckShape Shape for relative comparing. It must be a solid.
3739 theShape Shape to find sub-shapes of.
3740 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3741 theState The state of the sub-shapes to find (see GEOM::shape_state)
3744 List of all found sub-shapes.
3746 # Example: see GEOM_TestOthers.py
3747 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3748 theShapeType, theState)
3749 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3752 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3753 # situated relatively the specified \a theCheckShape by the
3754 # certain way, defined through \a theState parameter.
3755 # @param theCheckShape Shape for relative comparing. It must be a solid.
3756 # @param theShape Shape to find sub-shapes of.
3757 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3758 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3759 # @return All found sub-shapes as compound.
3761 # @ref swig_GetShapesOnShapeAsCompound "Example"
3762 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3764 Find in theShape all sub-shapes of type theShapeType,
3765 situated relatively the specified theCheckShape by the
3766 certain way, defined through theState parameter.
3769 theCheckShape Shape for relative comparing. It must be a solid.
3770 theShape Shape to find sub-shapes of.
3771 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3772 theState The state of the sub-shapes to find (see GEOM::shape_state)
3775 All found sub-shapes as compound.
3777 # Example: see GEOM_TestOthers.py
3778 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3779 theShapeType, theState)
3780 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3783 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3784 # situated relatively the specified \a theCheckShape by the
3785 # certain way, defined through \a theState parameter.
3786 # @param theCheckShape Shape for relative comparing. It must be a solid.
3787 # @param theShape Shape to find sub-shapes of.
3788 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3789 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3790 # @return List of all found sub-shapes indices.
3792 # @ref swig_GetShapesOnShapeIDs "Example"
3793 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3795 Find in theShape all sub-shapes of type theShapeType,
3796 situated relatively the specified theCheckShape by the
3797 certain way, defined through theState parameter.
3800 theCheckShape Shape for relative comparing. It must be a solid.
3801 theShape Shape to find sub-shapes of.
3802 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3803 theState The state of the sub-shapes to find (see GEOM::shape_state)
3806 List of all found sub-shapes indices.
3808 # Example: see GEOM_TestOthers.py
3809 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3810 theShapeType, theState)
3811 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3814 ## Get sub-shape(s) of theShapeWhere, which are
3815 # coincident with \a theShapeWhat or could be a part of it.
3816 # @param theShapeWhere Shape to find sub-shapes of.
3817 # @param theShapeWhat Shape, specifying what to find.
3818 # @param isNewImplementation implementation of GetInPlace functionality
3819 # (default = False, old alghorithm based on shape properties)
3820 # @return Group of all found sub-shapes or a single found sub-shape.
3822 # @note This function has a restriction on argument shapes.
3823 # If \a theShapeWhere has curved parts with significantly
3824 # outstanding centres (i.e. the mass centre of a part is closer to
3825 # \a theShapeWhat than to the part), such parts will not be found.
3826 # @image html get_in_place_lost_part.png
3828 # @ref swig_GetInPlace "Example"
3829 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3831 Get sub-shape(s) of theShapeWhere, which are
3832 coincident with theShapeWhat or could be a part of it.
3835 theShapeWhere Shape to find sub-shapes of.
3836 theShapeWhat Shape, specifying what to find.
3837 isNewImplementation Implementation of GetInPlace functionality
3838 (default = False, old alghorithm based on shape properties)
3841 Group of all found sub-shapes or a single found sub-shape.
3845 This function has a restriction on argument shapes.
3846 If theShapeWhere has curved parts with significantly
3847 outstanding centres (i.e. the mass centre of a part is closer to
3848 theShapeWhat than to the part), such parts will not be found.
3850 # Example: see GEOM_TestOthers.py
3852 if isNewImplementation:
3853 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3855 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3857 RaiseIfFailed("GetInPlace", self.ShapesOp)
3860 ## Get sub-shape(s) of \a theShapeWhere, which are
3861 # coincident with \a theShapeWhat or could be a part of it.
3863 # Implementation of this method is based on a saved history of an operation,
3864 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3865 # arguments (an argument shape or a sub-shape of an argument shape).
3866 # The operation could be the Partition or one of boolean operations,
3867 # performed on simple shapes (not on compounds).
3869 # @param theShapeWhere Shape to find sub-shapes of.
3870 # @param theShapeWhat Shape, specifying what to find (must be in the
3871 # building history of the ShapeWhere).
3872 # @return Group of all found sub-shapes or a single found sub-shape.
3874 # @ref swig_GetInPlace "Example"
3875 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
3877 Implementation of this method is based on a saved history of an operation,
3878 produced theShapeWhere. The theShapeWhat must be among this operation's
3879 arguments (an argument shape or a sub-shape of an argument shape).
3880 The operation could be the Partition or one of boolean operations,
3881 performed on simple shapes (not on compounds).
3884 theShapeWhere Shape to find sub-shapes of.
3885 theShapeWhat Shape, specifying what to find (must be in the
3886 building history of the ShapeWhere).
3889 Group of all found sub-shapes or a single found sub-shape.
3891 # Example: see GEOM_TestOthers.py
3892 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
3893 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
3896 ## Get sub-shape of theShapeWhere, which is
3897 # equal to \a theShapeWhat.
3898 # @param theShapeWhere Shape to find sub-shape of.
3899 # @param theShapeWhat Shape, specifying what to find.
3900 # @return New GEOM.GEOM_Object for found sub-shape.
3902 # @ref swig_GetSame "Example"
3903 def GetSame(self,theShapeWhere, theShapeWhat):
3905 Get sub-shape of theShapeWhere, which is
3906 equal to theShapeWhat.
3909 theShapeWhere Shape to find sub-shape of.
3910 theShapeWhat Shape, specifying what to find.
3913 New GEOM.GEOM_Object for found sub-shape.
3915 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
3916 RaiseIfFailed("GetSame", self.ShapesOp)
3920 ## Get sub-shape indices of theShapeWhere, which is
3921 # equal to \a theShapeWhat.
3922 # @param theShapeWhere Shape to find sub-shape of.
3923 # @param theShapeWhat Shape, specifying what to find.
3924 # @return List of all found sub-shapes indices.
3926 # @ref swig_GetSame "Example"
3927 def GetSameIDs(self,theShapeWhere, theShapeWhat):
3929 Get sub-shape indices of theShapeWhere, which is
3930 equal to theShapeWhat.
3933 theShapeWhere Shape to find sub-shape of.
3934 theShapeWhat Shape, specifying what to find.
3937 List of all found sub-shapes indices.
3939 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
3940 RaiseIfFailed("GetSameIDs", self.ShapesOp)
3947 ## @addtogroup l4_access
3950 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
3951 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
3952 # @param aShape Shape to get sub-shape of.
3953 # @param ListOfID List of sub-shapes indices.
3954 # @return Found sub-shape.
3956 # @ref swig_all_decompose "Example"
3957 def GetSubShape(self, aShape, ListOfID):
3959 Obtain a composite sub-shape of aShape, composed from sub-shapes
3960 of aShape, selected by their unique IDs inside aShape
3963 aShape Shape to get sub-shape of.
3964 ListOfID List of sub-shapes indices.
3969 # Example: see GEOM_TestAll.py
3970 anObj = self.AddSubShape(aShape,ListOfID)
3973 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
3974 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
3975 # @param aShape Shape to get sub-shape of.
3976 # @param aSubShape Sub-shapes of aShape.
3977 # @return ID of found sub-shape.
3979 # @ref swig_all_decompose "Example"
3980 def GetSubShapeID(self, aShape, aSubShape):
3982 Obtain unique ID of sub-shape aSubShape inside aShape
3983 of aShape, selected by their unique IDs inside aShape
3986 aShape Shape to get sub-shape of.
3987 aSubShape Sub-shapes of aShape.
3990 ID of found sub-shape.
3992 # Example: see GEOM_TestAll.py
3993 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
3994 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4000 ## @addtogroup l4_decompose
4003 ## Get all sub-shapes and groups of \a theShape,
4004 # that were created already by any other methods.
4005 # @param theShape Any shape.
4006 # @param theGroupsOnly If this parameter is TRUE, only groups will be
4007 # returned, else all found sub-shapes and groups.
4008 # @return List of existing sub-objects of \a theShape.
4010 # @ref swig_all_decompose "Example"
4011 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4013 Get all sub-shapes and groups of theShape,
4014 that were created already by any other methods.
4018 theGroupsOnly If this parameter is TRUE, only groups will be
4019 returned, else all found sub-shapes and groups.
4022 List of existing sub-objects of theShape.
4024 # Example: see GEOM_TestAll.py
4025 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4026 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4029 ## Get all groups of \a theShape,
4030 # that were created already by any other methods.
4031 # @param theShape Any shape.
4032 # @return List of existing groups of \a theShape.
4034 # @ref swig_all_decompose "Example"
4035 def GetGroups(self, theShape):
4037 Get all groups of theShape,
4038 that were created already by any other methods.
4044 List of existing groups of theShape.
4046 # Example: see GEOM_TestAll.py
4047 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4048 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4051 ## Explode a shape on sub-shapes of a given type.
4052 # If the shape itself matches the type, it is also returned.
4053 # @param aShape Shape to be exploded.
4054 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4055 # @return List of sub-shapes of type theShapeType, contained in theShape.
4057 # @ref swig_all_decompose "Example"
4058 def SubShapeAll(self, aShape, aType):
4060 Explode a shape on sub-shapes of a given type.
4061 If the shape itself matches the type, it is also returned.
4064 aShape Shape to be exploded.
4065 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4068 List of sub-shapes of type theShapeType, contained in theShape.
4070 # Example: see GEOM_TestAll.py
4071 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
4072 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4075 ## Explode a shape on sub-shapes of a given type.
4076 # @param aShape Shape to be exploded.
4077 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4078 # @return List of IDs of sub-shapes.
4080 # @ref swig_all_decompose "Example"
4081 def SubShapeAllIDs(self, aShape, aType):
4083 Explode a shape on sub-shapes of a given type.
4086 aShape Shape to be exploded (see geompy.ShapeType)
4087 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4090 List of IDs of sub-shapes.
4092 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
4093 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4096 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4097 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4098 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4099 # @param aShape Shape to get sub-shape of.
4100 # @param ListOfInd List of sub-shapes indices.
4101 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4102 # @return A compound of sub-shapes of aShape.
4104 # @ref swig_all_decompose "Example"
4105 def SubShape(self, aShape, aType, ListOfInd):
4107 Obtain a compound of sub-shapes of aShape,
4108 selected by they indices in list of all sub-shapes of type aType.
4109 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4112 aShape Shape to get sub-shape of.
4113 ListOfID List of sub-shapes indices.
4114 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4117 A compound of sub-shapes of aShape.
4119 # Example: see GEOM_TestAll.py
4121 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
4122 for ind in ListOfInd:
4123 ListOfIDs.append(AllShapeIDsList[ind - 1])
4124 anObj = self.GetSubShape(aShape, ListOfIDs)
4127 ## Explode a shape on sub-shapes of a given type.
4128 # Sub-shapes will be sorted by coordinates of their gravity centers.
4129 # If the shape itself matches the type, it is also returned.
4130 # @param aShape Shape to be exploded.
4131 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4132 # @return List of sub-shapes of type theShapeType, contained in theShape.
4134 # @ref swig_SubShapeAllSorted "Example"
4135 def SubShapeAllSortedCentres(self, aShape, aType):
4137 Explode a shape on sub-shapes of a given type.
4138 Sub-shapes will be sorted by coordinates of their gravity centers.
4139 If the shape itself matches the type, it is also returned.
4142 aShape Shape to be exploded.
4143 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4146 List of sub-shapes of type theShapeType, contained in theShape.
4148 # Example: see GEOM_TestAll.py
4149 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
4150 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4153 ## Explode a shape on sub-shapes of a given type.
4154 # Sub-shapes will be sorted by coordinates of their gravity centers.
4155 # @param aShape Shape to be exploded.
4156 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4157 # @return List of IDs of sub-shapes.
4159 # @ref swig_all_decompose "Example"
4160 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4162 Explode a shape on sub-shapes of a given type.
4163 Sub-shapes will be sorted by coordinates of their gravity centers.
4166 aShape Shape to be exploded.
4167 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4170 List of IDs of sub-shapes.
4172 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
4173 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4176 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4177 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4178 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4179 # @param aShape Shape to get sub-shape of.
4180 # @param ListOfInd List of sub-shapes indices.
4181 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4182 # @return A compound of sub-shapes of aShape.
4184 # @ref swig_all_decompose "Example"
4185 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4187 Obtain a compound of sub-shapes of aShape,
4188 selected by they indices in sorted list of all sub-shapes of type aType.
4189 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4192 aShape Shape to get sub-shape of.
4193 ListOfID List of sub-shapes indices.
4194 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4197 A compound of sub-shapes of aShape.
4199 # Example: see GEOM_TestAll.py
4201 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
4202 for ind in ListOfInd:
4203 ListOfIDs.append(AllShapeIDsList[ind - 1])
4204 anObj = self.GetSubShape(aShape, ListOfIDs)
4207 ## Extract shapes (excluding the main shape) of given type.
4208 # @param aShape The shape.
4209 # @param aType The shape type (see ShapeType())
4210 # @param isSorted Boolean flag to switch sorting on/off.
4211 # @return List of sub-shapes of type aType, contained in aShape.
4213 # @ref swig_FilletChamfer "Example"
4214 def ExtractShapes(self, aShape, aType, isSorted = False):
4216 Extract shapes (excluding the main shape) of given type.
4220 aType The shape type (see geompy.ShapeType)
4221 isSorted Boolean flag to switch sorting on/off.
4224 List of sub-shapes of type aType, contained in aShape.
4226 # Example: see GEOM_TestAll.py
4227 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
4228 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4231 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4232 # @param aShape Main shape.
4233 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4234 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4236 # @ref swig_all_decompose "Example"
4237 def SubShapes(self, aShape, anIDs):
4239 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4243 anIDs List of unique IDs of sub-shapes inside theMainShape.
4246 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4248 # Example: see GEOM_TestAll.py
4249 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4250 RaiseIfFailed("SubShapes", self.ShapesOp)
4253 # end of l4_decompose
4256 ## @addtogroup l4_decompose_d
4259 ## Deprecated method
4260 # It works like SubShapeAllSortedCentres(), but wrongly
4261 # defines centres of faces, shells and solids.
4262 def SubShapeAllSorted(self, aShape, aType):
4265 It works like geompy.SubShapeAllSortedCentres, but wrongly
4266 defines centres of faces, shells and solids.
4268 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
4269 RaiseIfFailed("MakeExplode", self.ShapesOp)
4272 ## Deprecated method
4273 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4274 # defines centres of faces, shells and solids.
4275 def SubShapeAllSortedIDs(self, aShape, aType):
4278 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4279 defines centres of faces, shells and solids.
4281 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
4282 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4285 ## Deprecated method
4286 # It works like SubShapeSortedCentres(), but has a bug
4287 # (wrongly defines centres of faces, shells and solids).
4288 def SubShapeSorted(self, aShape, aType, ListOfInd):
4291 It works like geompy.SubShapeSortedCentres, but has a bug
4292 (wrongly defines centres of faces, shells and solids).
4295 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
4296 for ind in ListOfInd:
4297 ListOfIDs.append(AllShapeIDsList[ind - 1])
4298 anObj = self.GetSubShape(aShape, ListOfIDs)
4301 # end of l4_decompose_d
4304 ## @addtogroup l3_healing
4307 ## Apply a sequence of Shape Healing operators to the given object.
4308 # @param theShape Shape to be processed.
4309 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4310 # @param theParameters List of names of parameters
4311 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4312 # @param theValues List of values of parameters, in the same order
4313 # as parameters are listed in <VAR>theParameters</VAR> list.
4316 # <b> Operators and Parameters: </b> \n
4318 # * \b FixShape - corrects invalid shapes. \n
4319 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4320 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4322 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4323 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4324 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4325 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4327 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4328 # surfaces in segments using a certain angle. \n
4329 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4330 # if Angle=180, four if Angle=90, etc). \n
4331 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4333 # * \b SplitClosedFaces - splits closed faces in segments.
4334 # The number of segments depends on the number of splitting points.\n
4335 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4337 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4338 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4339 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4340 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4341 # This and the previous parameters can take the following values:\n
4342 # \b Parametric \b Continuity \n
4343 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4344 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4345 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4346 # ruling out sharp edges).\n
4347 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4348 # are of the same magnitude).\n
4349 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4350 # or surfaces (d/du C(u)) are the same at junction. \n
4351 # \b Geometric \b Continuity \n
4352 # \b G1: first derivatives are proportional at junction.\n
4353 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4354 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4355 # \b G2: first and second derivatives are proportional at junction.
4356 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4357 # continuity requires that the underlying parameterization was continuous as well.
4358 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4360 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4361 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4362 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4363 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4364 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4365 # with the specified parameters.\n
4366 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4367 # with the specified parameters.\n
4368 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4369 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4370 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4371 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4373 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4374 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4375 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4376 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4377 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4379 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4380 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4383 # @return New GEOM.GEOM_Object, containing processed shape.
4385 # \n @ref tui_shape_processing "Example"
4386 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4388 Apply a sequence of Shape Healing operators to the given object.
4391 theShape Shape to be processed.
4392 theValues List of values of parameters, in the same order
4393 as parameters are listed in theParameters list.
4394 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4395 theParameters List of names of parameters
4396 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4397 Operators and Parameters:
4399 * FixShape - corrects invalid shapes.
4400 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4401 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4402 * FixFaceSize - removes small faces, such as spots and strips.
4403 * FixFaceSize.Tolerance - defines minimum possible face size.
4404 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4405 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4406 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4407 in segments using a certain angle.
4408 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4409 if Angle=180, four if Angle=90, etc).
4410 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4411 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4413 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4414 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4415 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4416 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4417 * SplitContinuity.CurveContinuity - required continuity for curves.
4418 This and the previous parameters can take the following values:
4420 Parametric Continuity:
4421 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4422 coincidental. The curves or surfaces may still meet at an angle,
4423 giving rise to a sharp corner or edge).
4424 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4425 are parallel, ruling out sharp edges).
4426 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4427 or surfaces are of the same magnitude).
4428 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4429 curves or surfaces (d/du C(u)) are the same at junction.
4431 Geometric Continuity:
4432 G1: first derivatives are proportional at junction.
4433 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4434 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4435 G2: first and second derivatives are proportional at junction. As the names imply,
4436 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4437 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4438 geometric continuity of order n, but not vice-versa.
4439 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4440 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4441 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4442 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4443 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4444 the specified parameters.
4445 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4446 the specified parameters.
4447 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4448 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4449 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4450 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4451 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4452 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4453 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4454 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4455 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4456 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4457 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4460 New GEOM.GEOM_Object, containing processed shape.
4462 Note: For more information look through SALOME Geometry User's Guide->
4463 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4465 # Example: see GEOM_TestHealing.py
4466 theValues,Parameters = ParseList(theValues)
4467 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4468 # To avoid script failure in case of good argument shape
4469 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4471 RaiseIfFailed("ProcessShape", self.HealOp)
4472 for string in (theOperators + theParameters):
4473 Parameters = ":" + Parameters
4475 anObj.SetParameters(Parameters)
4478 ## Remove faces from the given object (shape).
4479 # @param theObject Shape to be processed.
4480 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4481 # removes ALL faces of the given object.
4482 # @return New GEOM.GEOM_Object, containing processed shape.
4484 # @ref tui_suppress_faces "Example"
4485 def SuppressFaces(self,theObject, theFaces):
4487 Remove faces from the given object (shape).
4490 theObject Shape to be processed.
4491 theFaces Indices of faces to be removed, if EMPTY then the method
4492 removes ALL faces of the given object.
4495 New GEOM.GEOM_Object, containing processed shape.
4497 # Example: see GEOM_TestHealing.py
4498 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4499 RaiseIfFailed("SuppressFaces", self.HealOp)
4502 ## Sewing of some shapes into single shape.
4503 # @param ListShape Shapes to be processed.
4504 # @param theTolerance Required tolerance value.
4505 # @return New GEOM.GEOM_Object, containing processed shape.
4507 # @ref tui_sewing "Example"
4508 def MakeSewing(self, ListShape, theTolerance):
4510 Sewing of some shapes into single shape.
4513 ListShape Shapes to be processed.
4514 theTolerance Required tolerance value.
4517 New GEOM.GEOM_Object, containing processed shape.
4519 # Example: see GEOM_TestHealing.py
4520 comp = self.MakeCompound(ListShape)
4521 anObj = self.Sew(comp, theTolerance)
4524 ## Sewing of the given object.
4525 # @param theObject Shape to be processed.
4526 # @param theTolerance Required tolerance value.
4527 # @return New GEOM.GEOM_Object, containing processed shape.
4528 def Sew(self, theObject, theTolerance):
4530 Sewing of the given object.
4533 theObject Shape to be processed.
4534 theTolerance Required tolerance value.
4537 New GEOM.GEOM_Object, containing processed shape.
4539 # Example: see MakeSewing() above
4540 theTolerance,Parameters = ParseParameters(theTolerance)
4541 anObj = self.HealOp.Sew(theObject, theTolerance)
4542 RaiseIfFailed("Sew", self.HealOp)
4543 anObj.SetParameters(Parameters)
4546 ## Remove internal wires and edges from the given object (face).
4547 # @param theObject Shape to be processed.
4548 # @param theWires Indices of wires to be removed, if EMPTY then the method
4549 # removes ALL internal wires of the given object.
4550 # @return New GEOM.GEOM_Object, containing processed shape.
4552 # @ref tui_suppress_internal_wires "Example"
4553 def SuppressInternalWires(self,theObject, theWires):
4555 Remove internal wires and edges from the given object (face).
4558 theObject Shape to be processed.
4559 theWires Indices of wires to be removed, if EMPTY then the method
4560 removes ALL internal wires of the given object.
4563 New GEOM.GEOM_Object, containing processed shape.
4565 # Example: see GEOM_TestHealing.py
4566 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4567 RaiseIfFailed("RemoveIntWires", self.HealOp)
4570 ## Remove internal closed contours (holes) from the given object.
4571 # @param theObject Shape to be processed.
4572 # @param theWires Indices of wires to be removed, if EMPTY then the method
4573 # removes ALL internal holes of the given object
4574 # @return New GEOM.GEOM_Object, containing processed shape.
4576 # @ref tui_suppress_holes "Example"
4577 def SuppressHoles(self,theObject, theWires):
4579 Remove internal closed contours (holes) from the given object.
4582 theObject Shape to be processed.
4583 theWires Indices of wires to be removed, if EMPTY then the method
4584 removes ALL internal holes of the given object
4587 New GEOM.GEOM_Object, containing processed shape.
4589 # Example: see GEOM_TestHealing.py
4590 anObj = self.HealOp.FillHoles(theObject, theWires)
4591 RaiseIfFailed("FillHoles", self.HealOp)
4594 ## Close an open wire.
4595 # @param theObject Shape to be processed.
4596 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4597 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4598 # @param isCommonVertex If True : closure by creation of a common vertex,
4599 # If False : closure by creation of an edge between ends.
4600 # @return New GEOM.GEOM_Object, containing processed shape.
4602 # @ref tui_close_contour "Example"
4603 def CloseContour(self,theObject, theWires, isCommonVertex):
4608 theObject Shape to be processed.
4609 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4610 if [ ], then theObject itself is a wire.
4611 isCommonVertex If True : closure by creation of a common vertex,
4612 If False : closure by creation of an edge between ends.
4615 New GEOM.GEOM_Object, containing processed shape.
4617 # Example: see GEOM_TestHealing.py
4618 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4619 RaiseIfFailed("CloseContour", self.HealOp)
4622 ## Addition of a point to a given edge object.
4623 # @param theObject Shape to be processed.
4624 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4625 # if -1, then theObject itself is the edge.
4626 # @param theValue Value of parameter on edge or length parameter,
4627 # depending on \a isByParameter.
4628 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4629 # if FALSE : \a theValue is treated as a length parameter [0..1]
4630 # @return New GEOM.GEOM_Object, containing processed shape.
4632 # @ref tui_add_point_on_edge "Example"
4633 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4635 Addition of a point to a given edge object.
4638 theObject Shape to be processed.
4639 theEdgeIndex Index of edge to be divided within theObject's shape,
4640 if -1, then theObject itself is the edge.
4641 theValue Value of parameter on edge or length parameter,
4642 depending on isByParameter.
4643 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4644 if FALSE : theValue is treated as a length parameter [0..1]
4647 New GEOM.GEOM_Object, containing processed shape.
4649 # Example: see GEOM_TestHealing.py
4650 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4651 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4652 RaiseIfFailed("DivideEdge", self.HealOp)
4653 anObj.SetParameters(Parameters)
4656 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4657 # @param theWire Wire to minimize the number of C1 continuous edges in.
4658 # @param theVertices A list of vertices to suppress. If the list
4659 # is empty, all vertices in a wire will be assumed.
4660 # @return New GEOM.GEOM_Object with modified wire.
4662 # @ref tui_fuse_collinear_edges "Example"
4663 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4665 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4668 theWire Wire to minimize the number of C1 continuous edges in.
4669 theVertices A list of vertices to suppress. If the list
4670 is empty, all vertices in a wire will be assumed.
4673 New GEOM.GEOM_Object with modified wire.
4675 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4676 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4679 ## Change orientation of the given object. Updates given shape.
4680 # @param theObject Shape to be processed.
4681 # @return Updated <var>theObject</var>
4683 # @ref swig_todo "Example"
4684 def ChangeOrientationShell(self,theObject):
4686 Change orientation of the given object. Updates given shape.
4689 theObject Shape to be processed.
4694 theObject = self.HealOp.ChangeOrientation(theObject)
4695 RaiseIfFailed("ChangeOrientation", self.HealOp)
4698 ## Change orientation of the given object.
4699 # @param theObject Shape to be processed.
4700 # @return New GEOM.GEOM_Object, containing processed shape.
4702 # @ref swig_todo "Example"
4703 def ChangeOrientationShellCopy(self, theObject):
4705 Change orientation of the given object.
4708 theObject Shape to be processed.
4711 New GEOM.GEOM_Object, containing processed shape.
4713 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4714 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4717 ## Try to limit tolerance of the given object by value \a theTolerance.
4718 # @param theObject Shape to be processed.
4719 # @param theTolerance Required tolerance value.
4720 # @return New GEOM.GEOM_Object, containing processed shape.
4722 # @ref tui_limit_tolerance "Example"
4723 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4725 Try to limit tolerance of the given object by value theTolerance.
4728 theObject Shape to be processed.
4729 theTolerance Required tolerance value.
4732 New GEOM.GEOM_Object, containing processed shape.
4734 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4735 RaiseIfFailed("LimitTolerance", self.HealOp)
4738 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4739 # that constitute a free boundary of the given shape.
4740 # @param theObject Shape to get free boundary of.
4741 # @return [\a status, \a theClosedWires, \a theOpenWires]
4742 # \n \a status: FALSE, if an error(s) occured during the method execution.
4743 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4744 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4746 # @ref tui_measurement_tools_page "Example"
4747 def GetFreeBoundary(self, theObject):
4749 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4750 that constitute a free boundary of the given shape.
4753 theObject Shape to get free boundary of.
4756 [status, theClosedWires, theOpenWires]
4757 status: FALSE, if an error(s) occured during the method execution.
4758 theClosedWires: Closed wires on the free boundary of the given shape.
4759 theOpenWires: Open wires on the free boundary of the given shape.
4761 # Example: see GEOM_TestHealing.py
4762 anObj = self.HealOp.GetFreeBoundary(theObject)
4763 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4766 ## Replace coincident faces in theShape by one face.
4767 # @param theShape Initial shape.
4768 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4769 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4770 # otherwise all initial shapes.
4771 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4773 # @ref tui_glue_faces "Example"
4774 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4776 Replace coincident faces in theShape by one face.
4779 theShape Initial shape.
4780 theTolerance Maximum distance between faces, which can be considered as coincident.
4781 doKeepNonSolids If FALSE, only solids will present in the result,
4782 otherwise all initial shapes.
4785 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4787 # Example: see GEOM_Spanner.py
4788 theTolerance,Parameters = ParseParameters(theTolerance)
4789 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4791 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4792 anObj.SetParameters(Parameters)
4795 ## Find coincident faces in theShape for possible gluing.
4796 # @param theShape Initial shape.
4797 # @param theTolerance Maximum distance between faces,
4798 # which can be considered as coincident.
4799 # @return GEOM.ListOfGO
4801 # @ref tui_glue_faces "Example"
4802 def GetGlueFaces(self, theShape, theTolerance):
4804 Find coincident faces in theShape for possible gluing.
4807 theShape Initial shape.
4808 theTolerance Maximum distance between faces,
4809 which can be considered as coincident.
4814 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4815 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4818 ## Replace coincident faces in theShape by one face
4819 # in compliance with given list of faces
4820 # @param theShape Initial shape.
4821 # @param theTolerance Maximum distance between faces,
4822 # which can be considered as coincident.
4823 # @param theFaces List of faces for gluing.
4824 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4825 # otherwise all initial shapes.
4826 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4827 # will be glued, otherwise only the edges,
4828 # belonging to <VAR>theFaces</VAR>.
4829 # @return New GEOM.GEOM_Object, containing a copy of theShape
4830 # without some faces.
4832 # @ref tui_glue_faces "Example"
4833 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4834 doKeepNonSolids=True, doGlueAllEdges=True):
4836 Replace coincident faces in theShape by one face
4837 in compliance with given list of faces
4840 theShape Initial shape.
4841 theTolerance Maximum distance between faces,
4842 which can be considered as coincident.
4843 theFaces List of faces for gluing.
4844 doKeepNonSolids If FALSE, only solids will present in the result,
4845 otherwise all initial shapes.
4846 doGlueAllEdges If TRUE, all coincident edges of theShape
4847 will be glued, otherwise only the edges,
4848 belonging to theFaces.
4851 New GEOM.GEOM_Object, containing a copy of theShape
4854 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4855 doKeepNonSolids, doGlueAllEdges)
4857 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4860 ## Replace coincident edges in theShape by one edge.
4861 # @param theShape Initial shape.
4862 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
4863 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4865 # @ref tui_glue_edges "Example"
4866 def MakeGlueEdges(self, theShape, theTolerance):
4868 Replace coincident edges in theShape by one edge.
4871 theShape Initial shape.
4872 theTolerance Maximum distance between edges, which can be considered as coincident.
4875 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4877 theTolerance,Parameters = ParseParameters(theTolerance)
4878 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
4880 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
4881 anObj.SetParameters(Parameters)
4884 ## Find coincident edges in theShape for possible gluing.
4885 # @param theShape Initial shape.
4886 # @param theTolerance Maximum distance between edges,
4887 # which can be considered as coincident.
4888 # @return GEOM.ListOfGO
4890 # @ref tui_glue_edges "Example"
4891 def GetGlueEdges(self, theShape, theTolerance):
4893 Find coincident edges in theShape for possible gluing.
4896 theShape Initial shape.
4897 theTolerance Maximum distance between edges,
4898 which can be considered as coincident.
4903 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
4904 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
4907 ## Replace coincident edges in theShape by one edge
4908 # in compliance with given list of edges.
4909 # @param theShape Initial shape.
4910 # @param theTolerance Maximum distance between edges,
4911 # which can be considered as coincident.
4912 # @param theEdges List of edges for gluing.
4913 # @return New GEOM.GEOM_Object, containing a copy of theShape
4914 # without some edges.
4916 # @ref tui_glue_edges "Example"
4917 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
4919 Replace coincident edges in theShape by one edge
4920 in compliance with given list of edges.
4923 theShape Initial shape.
4924 theTolerance Maximum distance between edges,
4925 which can be considered as coincident.
4926 theEdges List of edges for gluing.
4929 New GEOM.GEOM_Object, containing a copy of theShape
4932 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
4934 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
4940 ## @addtogroup l3_boolean Boolean Operations
4943 # -----------------------------------------------------------------------------
4944 # Boolean (Common, Cut, Fuse, Section)
4945 # -----------------------------------------------------------------------------
4947 ## Perform one of boolean operations on two given shapes.
4948 # @param theShape1 First argument for boolean operation.
4949 # @param theShape2 Second argument for boolean operation.
4950 # @param theOperation Indicates the operation to be done:\n
4951 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
4952 # @return New GEOM.GEOM_Object, containing the result shape.
4954 # @ref tui_fuse "Example"
4955 def MakeBoolean(self,theShape1, theShape2, theOperation):
4957 Perform one of boolean operations on two given shapes.
4960 theShape1 First argument for boolean operation.
4961 theShape2 Second argument for boolean operation.
4962 theOperation Indicates the operation to be done:
4963 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
4966 New GEOM.GEOM_Object, containing the result shape.
4968 # Example: see GEOM_TestAll.py
4969 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
4970 RaiseIfFailed("MakeBoolean", self.BoolOp)
4973 ## Perform Common boolean operation on two given shapes.
4974 # @param theShape1 First argument for boolean operation.
4975 # @param theShape2 Second argument for boolean operation.
4976 # @return New GEOM.GEOM_Object, containing the result shape.
4978 # @ref tui_common "Example 1"
4979 # \n @ref swig_MakeCommon "Example 2"
4980 def MakeCommon(self, theShape1, theShape2):
4982 Perform Common boolean operation on two given shapes.
4985 theShape1 First argument for boolean operation.
4986 theShape2 Second argument for boolean operation.
4989 New GEOM.GEOM_Object, containing the result shape.
4991 # Example: see GEOM_TestOthers.py
4992 return self.MakeBoolean(theShape1, theShape2, 1)
4994 ## Perform Cut boolean operation on two given shapes.
4995 # @param theShape1 First argument for boolean operation.
4996 # @param theShape2 Second argument for boolean operation.
4997 # @return New GEOM.GEOM_Object, containing the result shape.
4999 # @ref tui_cut "Example 1"
5000 # \n @ref swig_MakeCommon "Example 2"
5001 def MakeCut(self, theShape1, theShape2):
5003 Perform Cut boolean operation on two given shapes.
5006 theShape1 First argument for boolean operation.
5007 theShape2 Second argument for boolean operation.
5010 New GEOM.GEOM_Object, containing the result shape.
5013 # Example: see GEOM_TestOthers.py
5014 return self.MakeBoolean(theShape1, theShape2, 2)
5016 ## Perform Fuse boolean operation on two given shapes.
5017 # @param theShape1 First argument for boolean operation.
5018 # @param theShape2 Second argument for boolean operation.
5019 # @return New GEOM.GEOM_Object, containing the result shape.
5021 # @ref tui_fuse "Example 1"
5022 # \n @ref swig_MakeCommon "Example 2"
5023 def MakeFuse(self, theShape1, theShape2):
5025 Perform Fuse boolean operation on two given shapes.
5028 theShape1 First argument for boolean operation.
5029 theShape2 Second argument for boolean operation.
5032 New GEOM.GEOM_Object, containing the result shape.
5035 # Example: see GEOM_TestOthers.py
5036 return self.MakeBoolean(theShape1, theShape2, 3)
5038 ## Perform Section boolean operation on two given shapes.
5039 # @param theShape1 First argument for boolean operation.
5040 # @param theShape2 Second argument for boolean operation.
5041 # @return New GEOM.GEOM_Object, containing the result shape.
5043 # @ref tui_section "Example 1"
5044 # \n @ref swig_MakeCommon "Example 2"
5045 def MakeSection(self, theShape1, theShape2):
5047 Perform Section boolean operation on two given shapes.
5050 theShape1 First argument for boolean operation.
5051 theShape2 Second argument for boolean operation.
5054 New GEOM.GEOM_Object, containing the result shape.
5057 # Example: see GEOM_TestOthers.py
5058 return self.MakeBoolean(theShape1, theShape2, 4)
5063 ## @addtogroup l3_basic_op
5066 ## Perform partition operation.
5067 # @param ListShapes Shapes to be intersected.
5068 # @param ListTools Shapes to intersect theShapes.
5069 # @param Limit Type of resulting shapes (see ShapeType()).\n
5070 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
5071 # type will be detected automatically.
5072 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5073 # target type (equal to Limit) are kept in the result,
5074 # else standalone shapes of lower dimension
5075 # are kept also (if they exist).
5076 # @note Each compound from ListShapes and ListTools will be exploded
5077 # in order to avoid possible intersection between shapes from this compound.
5079 # After implementation new version of PartitionAlgo (October 2006)
5080 # other parameters are ignored by current functionality. They are kept
5081 # in this function only for support old versions.
5082 # @param ListKeepInside Shapes, outside which the results will be deleted.
5083 # Each shape from theKeepInside must belong to theShapes also.
5084 # @param ListRemoveInside Shapes, inside which the results will be deleted.
5085 # Each shape from theRemoveInside must belong to theShapes also.
5086 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5087 # @param ListMaterials Material indices for each shape. Make sence,
5088 # only if theRemoveWebs is TRUE.
5090 # @return New GEOM.GEOM_Object, containing the result shapes.
5092 # @ref tui_partition "Example"
5093 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5094 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5095 KeepNonlimitShapes=0):
5097 Perform partition operation.
5100 ListShapes Shapes to be intersected.
5101 ListTools Shapes to intersect theShapes.
5102 Limit Type of resulting shapes (see geompy.ShapeType)
5103 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5104 type will be detected automatically.
5105 KeepNonlimitShapes if this parameter == 0, then only shapes of
5106 target type (equal to Limit) are kept in the result,
5107 else standalone shapes of lower dimension
5108 are kept also (if they exist).
5110 Each compound from ListShapes and ListTools will be exploded
5111 in order to avoid possible intersection between shapes from
5114 After implementation new version of PartitionAlgo (October 2006) other
5115 parameters are ignored by current functionality. They are kept in this
5116 function only for support old versions.
5119 ListKeepInside Shapes, outside which the results will be deleted.
5120 Each shape from theKeepInside must belong to theShapes also.
5121 ListRemoveInside Shapes, inside which the results will be deleted.
5122 Each shape from theRemoveInside must belong to theShapes also.
5123 RemoveWebs If TRUE, perform Glue 3D algorithm.
5124 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5127 New GEOM.GEOM_Object, containing the result shapes.
5129 # Example: see GEOM_TestAll.py
5130 if Limit == ShapeType["AUTO"]:
5131 # automatic detection of the most appropriate shape limit type
5133 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5134 Limit = EnumToLong(lim)
5136 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5137 ListKeepInside, ListRemoveInside,
5138 Limit, RemoveWebs, ListMaterials,
5139 KeepNonlimitShapes);
5140 RaiseIfFailed("MakePartition", self.BoolOp)
5143 ## Perform partition operation.
5144 # This method may be useful if it is needed to make a partition for
5145 # compound contains nonintersected shapes. Performance will be better
5146 # since intersection between shapes from compound is not performed.
5148 # Description of all parameters as in previous method MakePartition()
5150 # @note Passed compounds (via ListShapes or via ListTools)
5151 # have to consist of nonintersecting shapes.
5153 # @return New GEOM.GEOM_Object, containing the result shapes.
5155 # @ref swig_todo "Example"
5156 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5157 ListKeepInside=[], ListRemoveInside=[],
5158 Limit=ShapeType["AUTO"], RemoveWebs=0,
5159 ListMaterials=[], KeepNonlimitShapes=0):
5161 Perform partition operation.
5162 This method may be useful if it is needed to make a partition for
5163 compound contains nonintersected shapes. Performance will be better
5164 since intersection between shapes from compound is not performed.
5167 Description of all parameters as in method geompy.MakePartition
5170 Passed compounds (via ListShapes or via ListTools)
5171 have to consist of nonintersecting shapes.
5174 New GEOM.GEOM_Object, containing the result shapes.
5176 if Limit == ShapeType["AUTO"]:
5177 # automatic detection of the most appropriate shape limit type
5179 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5180 Limit = EnumToLong(lim)
5182 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5183 ListKeepInside, ListRemoveInside,
5184 Limit, RemoveWebs, ListMaterials,
5185 KeepNonlimitShapes);
5186 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5189 ## See method MakePartition() for more information.
5191 # @ref tui_partition "Example 1"
5192 # \n @ref swig_Partition "Example 2"
5193 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5194 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5195 KeepNonlimitShapes=0):
5197 See method geompy.MakePartition for more information.
5199 # Example: see GEOM_TestOthers.py
5200 anObj = self.MakePartition(ListShapes, ListTools,
5201 ListKeepInside, ListRemoveInside,
5202 Limit, RemoveWebs, ListMaterials,
5203 KeepNonlimitShapes);
5206 ## Perform partition of the Shape with the Plane
5207 # @param theShape Shape to be intersected.
5208 # @param thePlane Tool shape, to intersect theShape.
5209 # @return New GEOM.GEOM_Object, containing the result shape.
5211 # @ref tui_partition "Example"
5212 def MakeHalfPartition(self,theShape, thePlane):
5214 Perform partition of the Shape with the Plane
5217 theShape Shape to be intersected.
5218 thePlane Tool shape, to intersect theShape.
5221 New GEOM.GEOM_Object, containing the result shape.
5223 # Example: see GEOM_TestAll.py
5224 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5225 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5228 # end of l3_basic_op
5231 ## @addtogroup l3_transform
5234 ## Translate the given object along the vector, specified
5235 # by its end points, creating its copy before the translation.
5236 # @param theObject The object to be translated.
5237 # @param thePoint1 Start point of translation vector.
5238 # @param thePoint2 End point of translation vector.
5239 # @return New GEOM.GEOM_Object, containing the translated object.
5241 # @ref tui_translation "Example 1"
5242 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5243 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5245 Translate the given object along the vector, specified
5246 by its end points, creating its copy before the translation.
5249 theObject The object to be translated.
5250 thePoint1 Start point of translation vector.
5251 thePoint2 End point of translation vector.
5254 New GEOM.GEOM_Object, containing the translated object.
5256 # Example: see GEOM_TestAll.py
5257 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5258 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5261 ## Translate the given object along the vector, specified by its components.
5262 # @param theObject The object to be translated.
5263 # @param theDX,theDY,theDZ Components of translation vector.
5264 # @return Translated GEOM.GEOM_Object.
5266 # @ref tui_translation "Example"
5267 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5269 Translate the given object along the vector, specified by its components.
5272 theObject The object to be translated.
5273 theDX,theDY,theDZ Components of translation vector.
5276 Translated GEOM.GEOM_Object.
5278 # Example: see GEOM_TestAll.py
5279 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5280 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5281 anObj.SetParameters(Parameters)
5282 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5285 ## Translate the given object along the vector, specified
5286 # by its components, creating its copy before the translation.
5287 # @param theObject The object to be translated.
5288 # @param theDX,theDY,theDZ Components of translation vector.
5289 # @return New GEOM.GEOM_Object, containing the translated object.
5291 # @ref tui_translation "Example"
5292 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5294 Translate the given object along the vector, specified
5295 by its components, creating its copy before the translation.
5298 theObject The object to be translated.
5299 theDX,theDY,theDZ Components of translation vector.
5302 New GEOM.GEOM_Object, containing the translated object.
5304 # Example: see GEOM_TestAll.py
5305 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5306 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5307 anObj.SetParameters(Parameters)
5308 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5311 ## Translate the given object along the given vector,
5312 # creating its copy before the translation.
5313 # @param theObject The object to be translated.
5314 # @param theVector The translation vector.
5315 # @return New GEOM.GEOM_Object, containing the translated object.
5317 # @ref tui_translation "Example"
5318 def MakeTranslationVector(self,theObject, theVector):
5320 Translate the given object along the given vector,
5321 creating its copy before the translation.
5324 theObject The object to be translated.
5325 theVector The translation vector.
5328 New GEOM.GEOM_Object, containing the translated object.
5330 # Example: see GEOM_TestAll.py
5331 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5332 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5335 ## Translate the given object along the given vector on given distance.
5336 # @param theObject The object to be translated.
5337 # @param theVector The translation vector.
5338 # @param theDistance The translation distance.
5339 # @param theCopy Flag used to translate object itself or create a copy.
5340 # @return New GEOM.GEOM_Object, containing the translated object.
5342 # @ref tui_translation "Example"
5343 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5345 Translate the given object along the given vector on given distance.
5348 theObject The object to be translated.
5349 theVector The translation vector.
5350 theDistance The translation distance.
5351 theCopy Flag used to translate object itself or create a copy.
5354 New GEOM.GEOM_Object, containing the translated object.
5356 # Example: see GEOM_TestAll.py
5357 theDistance,Parameters = ParseParameters(theDistance)
5358 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5359 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5360 anObj.SetParameters(Parameters)
5363 ## Translate the given object along the given vector on given distance,
5364 # creating its copy before the translation.
5365 # @param theObject The object to be translated.
5366 # @param theVector The translation vector.
5367 # @param theDistance The translation distance.
5368 # @return New GEOM.GEOM_Object, containing the translated object.
5370 # @ref tui_translation "Example"
5371 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5373 Translate the given object along the given vector on given distance,
5374 creating its copy before the translation.
5377 theObject The object to be translated.
5378 theVector The translation vector.
5379 theDistance The translation distance.
5382 New GEOM.GEOM_Object, containing the translated object.
5384 # Example: see GEOM_TestAll.py
5385 theDistance,Parameters = ParseParameters(theDistance)
5386 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5387 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5388 anObj.SetParameters(Parameters)
5391 ## Rotate the given object around the given axis on the given angle.
5392 # @param theObject The object to be rotated.
5393 # @param theAxis Rotation axis.
5394 # @param theAngle Rotation angle in radians.
5395 # @return New GEOM.GEOM_Object, containing the rotated object.
5397 # @ref tui_rotation "Example"
5398 def Rotate(self,theObject, theAxis, theAngle):
5400 Rotate the given object around the given axis on the given angle.
5403 theObject The object to be rotated.
5404 theAxis Rotation axis.
5405 theAngle Rotation angle in radians.
5408 New GEOM.GEOM_Object, containing the rotated object.
5410 # Example: see GEOM_TestAll.py
5412 if isinstance(theAngle,str):
5414 theAngle, Parameters = ParseParameters(theAngle)
5416 theAngle = theAngle*math.pi/180.0
5417 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5418 RaiseIfFailed("RotateCopy", self.TrsfOp)
5419 anObj.SetParameters(Parameters)
5422 ## Rotate the given object around the given axis
5423 # on the given angle, creating its copy before the rotatation.
5424 # @param theObject The object to be rotated.
5425 # @param theAxis Rotation axis.
5426 # @param theAngle Rotation angle in radians.
5427 # @return New GEOM.GEOM_Object, containing the rotated object.
5429 # @ref tui_rotation "Example"
5430 def MakeRotation(self,theObject, theAxis, theAngle):
5432 Rotate the given object around the given axis
5433 on the given angle, creating its copy before the rotatation.
5436 theObject The object to be rotated.
5437 theAxis Rotation axis.
5438 theAngle Rotation angle in radians.
5441 New GEOM.GEOM_Object, containing the rotated object.
5443 # Example: see GEOM_TestAll.py
5445 if isinstance(theAngle,str):
5447 theAngle, Parameters = ParseParameters(theAngle)
5449 theAngle = theAngle*math.pi/180.0
5450 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5451 RaiseIfFailed("RotateCopy", self.TrsfOp)
5452 anObj.SetParameters(Parameters)
5455 ## Rotate given object around vector perpendicular to plane
5456 # containing three points, creating its copy before the rotatation.
5457 # @param theObject The object to be rotated.
5458 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5459 # containing the three points.
5460 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5461 # @return New GEOM.GEOM_Object, containing the rotated object.
5463 # @ref tui_rotation "Example"
5464 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5466 Rotate given object around vector perpendicular to plane
5467 containing three points, creating its copy before the rotatation.
5470 theObject The object to be rotated.
5471 theCentPoint central point the axis is the vector perpendicular to the plane
5472 containing the three points.
5473 thePoint1,thePoint2 in a perpendicular plane of the axis.
5476 New GEOM.GEOM_Object, containing the rotated object.
5478 # Example: see GEOM_TestAll.py
5479 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5480 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5483 ## Scale the given object by the factor, creating its copy before the scaling.
5484 # @param theObject The object to be scaled.
5485 # @param thePoint Center point for scaling.
5486 # Passing None for it means scaling relatively the origin of global CS.
5487 # @param theFactor Scaling factor value.
5488 # @return New GEOM.GEOM_Object, containing the scaled shape.
5490 # @ref tui_scale "Example"
5491 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5493 Scale the given object by the factor, creating its copy before the scaling.
5496 theObject The object to be scaled.
5497 thePoint Center point for scaling.
5498 Passing None for it means scaling relatively the origin of global CS.
5499 theFactor Scaling factor value.
5502 New GEOM.GEOM_Object, containing the scaled shape.
5504 # Example: see GEOM_TestAll.py
5505 theFactor, Parameters = ParseParameters(theFactor)
5506 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5507 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5508 anObj.SetParameters(Parameters)
5511 ## Scale the given object by different factors along coordinate axes,
5512 # creating its copy before the scaling.
5513 # @param theObject The object to be scaled.
5514 # @param thePoint Center point for scaling.
5515 # Passing None for it means scaling relatively the origin of global CS.
5516 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5517 # @return New GEOM.GEOM_Object, containing the scaled shape.
5519 # @ref swig_scale "Example"
5520 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5522 Scale the given object by different factors along coordinate axes,
5523 creating its copy before the scaling.
5526 theObject The object to be scaled.
5527 thePoint Center point for scaling.
5528 Passing None for it means scaling relatively the origin of global CS.
5529 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5532 New GEOM.GEOM_Object, containing the scaled shape.
5534 # Example: see GEOM_TestAll.py
5535 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5536 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5537 theFactorX, theFactorY, theFactorZ)
5538 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5539 anObj.SetParameters(Parameters)
5542 ## Create an object, symmetrical
5543 # to the given one relatively the given plane.
5544 # @param theObject The object to be mirrored.
5545 # @param thePlane Plane of symmetry.
5546 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5548 # @ref tui_mirror "Example"
5549 def MakeMirrorByPlane(self,theObject, thePlane):
5551 Create an object, symmetrical to the given one relatively the given plane.
5554 theObject The object to be mirrored.
5555 thePlane Plane of symmetry.
5558 New GEOM.GEOM_Object, containing the mirrored shape.
5560 # Example: see GEOM_TestAll.py
5561 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5562 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5565 ## Create an object, symmetrical
5566 # to the given one relatively the given axis.
5567 # @param theObject The object to be mirrored.
5568 # @param theAxis Axis of symmetry.
5569 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5571 # @ref tui_mirror "Example"
5572 def MakeMirrorByAxis(self,theObject, theAxis):
5574 Create an object, symmetrical to the given one relatively the given axis.
5577 theObject The object to be mirrored.
5578 theAxis Axis of symmetry.
5581 New GEOM.GEOM_Object, containing the mirrored shape.
5583 # Example: see GEOM_TestAll.py
5584 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5585 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5588 ## Create an object, symmetrical
5589 # to the given one relatively the given point.
5590 # @param theObject The object to be mirrored.
5591 # @param thePoint Point of symmetry.
5592 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5594 # @ref tui_mirror "Example"
5595 def MakeMirrorByPoint(self,theObject, thePoint):
5597 Create an object, symmetrical
5598 to the given one relatively the given point.
5601 theObject The object to be mirrored.
5602 thePoint Point of symmetry.
5605 New GEOM.GEOM_Object, containing the mirrored shape.
5607 # Example: see GEOM_TestAll.py
5608 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5609 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5612 ## Modify the Location of the given object by LCS,
5613 # creating its copy before the setting.
5614 # @param theObject The object to be displaced.
5615 # @param theStartLCS Coordinate system to perform displacement from it.\n
5616 # If \a theStartLCS is NULL, displacement
5617 # will be performed from global CS.\n
5618 # If \a theObject itself is used as \a theStartLCS,
5619 # its location will be changed to \a theEndLCS.
5620 # @param theEndLCS Coordinate system to perform displacement to it.
5621 # @return New GEOM.GEOM_Object, containing the displaced shape.
5623 # @ref tui_modify_location "Example"
5624 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5626 Modify the Location of the given object by LCS, creating its copy before the setting.
5629 theObject The object to be displaced.
5630 theStartLCS Coordinate system to perform displacement from it.
5631 If theStartLCS is NULL, displacement
5632 will be performed from global CS.
5633 If theObject itself is used as theStartLCS,
5634 its location will be changed to theEndLCS.
5635 theEndLCS Coordinate system to perform displacement to it.
5638 New GEOM.GEOM_Object, containing the displaced shape.
5641 # create local coordinate systems
5642 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5643 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5644 # modify the location of the given object
5645 position = geompy.MakePosition(cylinder, cs1, cs2)
5647 # Example: see GEOM_TestAll.py
5648 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5649 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5652 ## Modify the Location of the given object by Path,
5653 # @param theObject The object to be displaced.
5654 # @param thePath Wire or Edge along that the object will be translated.
5655 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5656 # @param theCopy is to create a copy objects if true.
5657 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5658 # @return New GEOM.GEOM_Object, containing the displaced shape.
5660 # @ref tui_modify_location "Example"
5661 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5663 Modify the Location of the given object by Path
5666 theObject The object to be displaced.
5667 thePath Wire or Edge along that the object will be translated.
5668 theDistance progress of Path (0 = start location, 1 = end of path location).
5669 theCopy is to create a copy objects if true.
5670 theReverse 0 - for usual direction, 1 - to reverse path direction.
5673 New GEOM.GEOM_Object, containing the displaced shape.
5676 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5678 # Example: see GEOM_TestAll.py
5679 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5680 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5683 ## Create new object as offset of the given one.
5684 # @param theObject The base object for the offset.
5685 # @param theOffset Offset value.
5686 # @return New GEOM.GEOM_Object, containing the offset object.
5688 # @ref tui_offset "Example"
5689 def MakeOffset(self,theObject, theOffset):
5691 Create new object as offset of the given one.
5694 theObject The base object for the offset.
5695 theOffset Offset value.
5698 New GEOM.GEOM_Object, containing the offset object.
5701 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5702 # create a new object as offset of the given object
5703 offset = geompy.MakeOffset(box, 70.)
5705 # Example: see GEOM_TestAll.py
5706 theOffset, Parameters = ParseParameters(theOffset)
5707 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5708 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5709 anObj.SetParameters(Parameters)
5712 ## Create new object as projection of the given one on a 2D surface.
5713 # @param theSource The source object for the projection. It can be a point, edge or wire.
5714 # @param theTarget The target object. It can be planar or cylindrical face.
5715 # @return New GEOM.GEOM_Object, containing the projection.
5717 # @ref tui_projection "Example"
5718 def MakeProjection(self, theSource, theTarget):
5720 Create new object as projection of the given one on a 2D surface.
5723 theSource The source object for the projection. It can be a point, edge or wire.
5724 theTarget The target object. It can be planar or cylindrical face.
5727 New GEOM.GEOM_Object, containing the projection.
5729 # Example: see GEOM_TestAll.py
5730 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5731 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5734 # -----------------------------------------------------------------------------
5736 # -----------------------------------------------------------------------------
5738 ## Translate the given object along the given vector a given number times
5739 # @param theObject The object to be translated.
5740 # @param theVector Direction of the translation.
5741 # @param theStep Distance to translate on.
5742 # @param theNbTimes Quantity of translations to be done.
5743 # @return New GEOM.GEOM_Object, containing compound of all
5744 # the shapes, obtained after each translation.
5746 # @ref tui_multi_translation "Example"
5747 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5749 Translate the given object along the given vector a given number times
5752 theObject The object to be translated.
5753 theVector Direction of the translation.
5754 theStep Distance to translate on.
5755 theNbTimes Quantity of translations to be done.
5758 New GEOM.GEOM_Object, containing compound of all
5759 the shapes, obtained after each translation.
5762 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5764 # Example: see GEOM_TestAll.py
5765 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5766 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5767 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5768 anObj.SetParameters(Parameters)
5771 ## Conseqently apply two specified translations to theObject specified number of times.
5772 # @param theObject The object to be translated.
5773 # @param theVector1 Direction of the first translation.
5774 # @param theStep1 Step of the first translation.
5775 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5776 # @param theVector2 Direction of the second translation.
5777 # @param theStep2 Step of the second translation.
5778 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5779 # @return New GEOM.GEOM_Object, containing compound of all
5780 # the shapes, obtained after each translation.
5782 # @ref tui_multi_translation "Example"
5783 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5784 theVector2, theStep2, theNbTimes2):
5786 Conseqently apply two specified translations to theObject specified number of times.
5789 theObject The object to be translated.
5790 theVector1 Direction of the first translation.
5791 theStep1 Step of the first translation.
5792 theNbTimes1 Quantity of translations to be done along theVector1.
5793 theVector2 Direction of the second translation.
5794 theStep2 Step of the second translation.
5795 theNbTimes2 Quantity of translations to be done along theVector2.
5798 New GEOM.GEOM_Object, containing compound of all
5799 the shapes, obtained after each translation.
5802 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5804 # Example: see GEOM_TestAll.py
5805 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5806 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5807 theVector2, theStep2, theNbTimes2)
5808 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5809 anObj.SetParameters(Parameters)
5812 ## Rotate the given object around the given axis a given number times.
5813 # Rotation angle will be 2*PI/theNbTimes.
5814 # @param theObject The object to be rotated.
5815 # @param theAxis The rotation axis.
5816 # @param theNbTimes Quantity of rotations to be done.
5817 # @return New GEOM.GEOM_Object, containing compound of all the
5818 # shapes, obtained after each rotation.
5820 # @ref tui_multi_rotation "Example"
5821 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5823 Rotate the given object around the given axis a given number times.
5824 Rotation angle will be 2*PI/theNbTimes.
5827 theObject The object to be rotated.
5828 theAxis The rotation axis.
5829 theNbTimes Quantity of rotations to be done.
5832 New GEOM.GEOM_Object, containing compound of all the
5833 shapes, obtained after each rotation.
5836 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5838 # Example: see GEOM_TestAll.py
5839 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5840 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5841 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5842 anObj.SetParameters(Parameters)
5845 ## Rotate the given object around the
5846 # given axis on the given angle a given number
5847 # times and multi-translate each rotation result.
5848 # Translation direction passes through center of gravity
5849 # of rotated shape and its projection on the rotation axis.
5850 # @param theObject The object to be rotated.
5851 # @param theAxis Rotation axis.
5852 # @param theAngle Rotation angle in graduces.
5853 # @param theNbTimes1 Quantity of rotations to be done.
5854 # @param theStep Translation distance.
5855 # @param theNbTimes2 Quantity of translations to be done.
5856 # @return New GEOM.GEOM_Object, containing compound of all the
5857 # shapes, obtained after each transformation.
5859 # @ref tui_multi_rotation "Example"
5860 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5862 Rotate the given object around the
5863 given axis on the given angle a given number
5864 times and multi-translate each rotation result.
5865 Translation direction passes through center of gravity
5866 of rotated shape and its projection on the rotation axis.
5869 theObject The object to be rotated.
5870 theAxis Rotation axis.
5871 theAngle Rotation angle in graduces.
5872 theNbTimes1 Quantity of rotations to be done.
5873 theStep Translation distance.
5874 theNbTimes2 Quantity of translations to be done.
5877 New GEOM.GEOM_Object, containing compound of all the
5878 shapes, obtained after each transformation.
5881 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
5883 # Example: see GEOM_TestAll.py
5884 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
5885 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
5886 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
5887 anObj.SetParameters(Parameters)
5890 ## The same, as MultiRotate1D(), but axis is given by direction and point
5892 # @ref swig_MakeMultiRotation "Example"
5893 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
5895 The same, as geompy.MultiRotate1D, but axis is given by direction and point
5898 pz = geompy.MakeVertex(0, 0, 100)
5899 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5900 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
5902 # Example: see GEOM_TestOthers.py
5903 aVec = self.MakeLine(aPoint,aDir)
5904 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
5907 ## The same, as MultiRotate2D(), but axis is given by direction and point
5909 # @ref swig_MakeMultiRotation "Example"
5910 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
5912 The same, as MultiRotate2D(), but axis is given by direction and point
5915 pz = geompy.MakeVertex(0, 0, 100)
5916 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5917 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
5919 # Example: see GEOM_TestOthers.py
5920 aVec = self.MakeLine(aPoint,aDir)
5921 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
5924 # end of l3_transform
5927 ## @addtogroup l3_local
5930 ## Perform a fillet on all edges of the given shape.
5931 # @param theShape Shape, to perform fillet on.
5932 # @param theR Fillet radius.
5933 # @return New GEOM.GEOM_Object, containing the result shape.
5935 # @ref tui_fillet "Example 1"
5936 # \n @ref swig_MakeFilletAll "Example 2"
5937 def MakeFilletAll(self,theShape, theR):
5939 Perform a fillet on all edges of the given shape.
5942 theShape Shape, to perform fillet on.
5946 New GEOM.GEOM_Object, containing the result shape.
5949 filletall = geompy.MakeFilletAll(prism, 10.)
5951 # Example: see GEOM_TestOthers.py
5952 theR,Parameters = ParseParameters(theR)
5953 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
5954 RaiseIfFailed("MakeFilletAll", self.LocalOp)
5955 anObj.SetParameters(Parameters)
5958 ## Perform a fillet on the specified edges/faces of the given shape
5959 # @param theShape Shape, to perform fillet on.
5960 # @param theR Fillet radius.
5961 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
5962 # @param theListShapes Global indices of edges/faces to perform fillet on.
5963 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
5964 # @return New GEOM.GEOM_Object, containing the result shape.
5966 # @ref tui_fillet "Example"
5967 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
5969 Perform a fillet on the specified edges/faces of the given shape
5972 theShape Shape, to perform fillet on.
5974 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
5975 theListShapes Global indices of edges/faces to perform fillet on.
5978 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
5981 New GEOM.GEOM_Object, containing the result shape.
5984 # get the list of IDs (IDList) for the fillet
5985 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
5987 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
5988 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
5989 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
5990 # make a fillet on the specified edges of the given shape
5991 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
5993 # Example: see GEOM_TestAll.py
5994 theR,Parameters = ParseParameters(theR)
5996 if theShapeType == ShapeType["EDGE"]:
5997 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
5998 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6000 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6001 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6002 anObj.SetParameters(Parameters)
6005 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6006 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6008 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6011 # get the list of IDs (IDList) for the fillet
6012 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6014 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6015 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6016 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6017 # make a fillet on the specified edges of the given shape
6018 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6020 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6022 if theShapeType == ShapeType["EDGE"]:
6023 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6024 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6026 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6027 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6028 anObj.SetParameters(Parameters)
6031 ## Perform a fillet on the specified edges of the given shape
6032 # @param theShape Wire Shape to perform fillet on.
6033 # @param theR Fillet radius.
6034 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6035 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6036 # \note The list of vertices could be empty,
6037 # in this case fillet will done done at all vertices in wire
6038 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6039 # by the length of the edges, nearest to the fillet vertex.
6040 # But sometimes the next edge is C1 continuous with the one, nearest to
6041 # the fillet point, and such two (or more) edges can be united to allow
6042 # bigger radius. Set this flag to TRUE to allow collinear edges union,
6043 # thus ignoring the secant vertex (vertices).
6044 # @return New GEOM.GEOM_Object, containing the result shape.
6046 # @ref tui_fillet2d "Example"
6047 def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6049 Perform a fillet on the specified edges of the given shape
6052 theShape Wire Shape to perform fillet on.
6054 theListOfVertexes Global indices of vertexes to perform fillet on.
6055 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6056 by the length of the edges, nearest to the fillet vertex.
6057 But sometimes the next edge is C1 continuous with the one, nearest to
6058 the fillet point, and such two (or more) edges can be united to allow
6059 bigger radius. Set this flag to TRUE to allow collinear edges union,
6060 thus ignoring the secant vertex (vertices).
6062 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6064 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6067 New GEOM.GEOM_Object, containing the result shape.
6071 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6072 # make fillet at given wire vertices with giver radius
6073 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6075 # Example: see GEOM_TestAll.py
6076 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6077 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6078 RaiseIfFailed("MakeFillet1D", self.LocalOp)
6079 anObj.SetParameters(Parameters)
6082 ## Perform a fillet at the specified vertices of the given face/shell.
6083 # @param theShape Face or Shell shape to perform fillet on.
6084 # @param theR Fillet radius.
6085 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6086 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6087 # @return New GEOM.GEOM_Object, containing the result shape.
6089 # @ref tui_fillet2d "Example"
6090 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6092 Perform a fillet at the specified vertices of the given face/shell.
6095 theShape Face or Shell shape to perform fillet on.
6097 theListOfVertexes Global indices of vertexes to perform fillet on.
6099 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6102 New GEOM.GEOM_Object, containing the result shape.
6105 face = geompy.MakeFaceHW(100, 100, 1)
6106 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6108 # Example: see GEOM_TestAll.py
6109 theR,Parameters = ParseParameters(theR)
6110 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6111 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6112 anObj.SetParameters(Parameters)
6115 ## Perform a symmetric chamfer on all edges of the given shape.
6116 # @param theShape Shape, to perform chamfer on.
6117 # @param theD Chamfer size along each face.
6118 # @return New GEOM.GEOM_Object, containing the result shape.
6120 # @ref tui_chamfer "Example 1"
6121 # \n @ref swig_MakeChamferAll "Example 2"
6122 def MakeChamferAll(self,theShape, theD):
6124 Perform a symmetric chamfer on all edges of the given shape.
6127 theShape Shape, to perform chamfer on.
6128 theD Chamfer size along each face.
6131 New GEOM.GEOM_Object, containing the result shape.
6134 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6136 # Example: see GEOM_TestOthers.py
6137 theD,Parameters = ParseParameters(theD)
6138 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6139 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6140 anObj.SetParameters(Parameters)
6143 ## Perform a chamfer on edges, common to the specified faces,
6144 # with distance D1 on the Face1
6145 # @param theShape Shape, to perform chamfer on.
6146 # @param theD1 Chamfer size along \a theFace1.
6147 # @param theD2 Chamfer size along \a theFace2.
6148 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6149 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6150 # @return New GEOM.GEOM_Object, containing the result shape.
6152 # @ref tui_chamfer "Example"
6153 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6155 Perform a chamfer on edges, common to the specified faces,
6156 with distance D1 on the Face1
6159 theShape Shape, to perform chamfer on.
6160 theD1 Chamfer size along theFace1.
6161 theD2 Chamfer size along theFace2.
6162 theFace1,theFace2 Global indices of two faces of theShape.
6165 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6168 New GEOM.GEOM_Object, containing the result shape.
6171 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6172 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6173 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6174 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6176 # Example: see GEOM_TestAll.py
6177 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6178 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6179 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6180 anObj.SetParameters(Parameters)
6183 ## Perform a chamfer on edges
6184 # @param theShape Shape, to perform chamfer on.
6185 # @param theD Chamfer length
6186 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6187 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6188 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6189 # @return New GEOM.GEOM_Object, containing the result shape.
6190 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6192 Perform a chamfer on edges
6195 theShape Shape, to perform chamfer on.
6196 theD1 Chamfer size along theFace1.
6197 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6198 theFace1,theFace2 Global indices of two faces of theShape.
6201 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6204 New GEOM.GEOM_Object, containing the result shape.
6207 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6208 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6209 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6211 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6214 if isinstance(theAngle,str):
6216 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6218 theAngle = theAngle*math.pi/180.0
6219 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6220 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6221 anObj.SetParameters(Parameters)
6224 ## Perform a chamfer on all edges of the specified faces,
6225 # with distance D1 on the first specified face (if several for one edge)
6226 # @param theShape Shape, to perform chamfer on.
6227 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6228 # connected to the edge, are in \a theFaces, \a theD1
6229 # will be get along face, which is nearer to \a theFaces beginning.
6230 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6231 # @param theFaces Sequence of global indices of faces of \a theShape.
6232 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6233 # @return New GEOM.GEOM_Object, containing the result shape.
6235 # @ref tui_chamfer "Example"
6236 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6238 Perform a chamfer on all edges of the specified faces,
6239 with distance D1 on the first specified face (if several for one edge)
6242 theShape Shape, to perform chamfer on.
6243 theD1 Chamfer size along face from theFaces. If both faces,
6244 connected to the edge, are in theFaces, theD1
6245 will be get along face, which is nearer to theFaces beginning.
6246 theD2 Chamfer size along another of two faces, connected to the edge.
6247 theFaces Sequence of global indices of faces of theShape.
6250 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6253 New GEOM.GEOM_Object, containing the result shape.
6255 # Example: see GEOM_TestAll.py
6256 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6257 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6258 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6259 anObj.SetParameters(Parameters)
6262 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6263 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6265 # @ref swig_FilletChamfer "Example"
6266 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6268 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6269 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6272 if isinstance(theAngle,str):
6274 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6276 theAngle = theAngle*math.pi/180.0
6277 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6278 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6279 anObj.SetParameters(Parameters)
6282 ## Perform a chamfer on edges,
6283 # with distance D1 on the first specified face (if several for one edge)
6284 # @param theShape Shape, to perform chamfer on.
6285 # @param theD1,theD2 Chamfer size
6286 # @param theEdges Sequence of edges of \a theShape.
6287 # @return New GEOM.GEOM_Object, containing the result shape.
6289 # @ref swig_FilletChamfer "Example"
6290 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6292 Perform a chamfer on edges,
6293 with distance D1 on the first specified face (if several for one edge)
6296 theShape Shape, to perform chamfer on.
6297 theD1,theD2 Chamfer size
6298 theEdges Sequence of edges of theShape.
6301 New GEOM.GEOM_Object, containing the result shape.
6303 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6304 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6305 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6306 anObj.SetParameters(Parameters)
6309 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6310 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6311 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6313 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6314 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6317 if isinstance(theAngle,str):
6319 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6321 theAngle = theAngle*math.pi/180.0
6322 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6323 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6324 anObj.SetParameters(Parameters)
6327 ## /sa MakeChamferEdge() and MakeChamferFaces()
6329 # @ref swig_MakeChamfer "Example"
6330 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6332 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6334 # Example: see GEOM_TestOthers.py
6336 if aShapeType == ShapeType["EDGE"]:
6337 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6339 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6342 ## Remove material from a solid by extrusion of the base shape on the given distance.
6343 # @param theInit Shape to remove material from. It must be a solid or
6344 # a compound made of a single solid.
6345 # @param theBase Closed edge or wire defining the base shape to be extruded.
6346 # @param theH Prism dimension along the normal to theBase
6347 # @param theAngle Draft angle in degrees.
6348 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6350 # @ref tui_creation_prism "Example"
6351 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6353 Add material to a solid by extrusion of the base shape on the given distance.
6356 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6357 theBase Closed edge or wire defining the base shape to be extruded.
6358 theH Prism dimension along the normal to theBase
6359 theAngle Draft angle in degrees.
6362 New GEOM.GEOM_Object, containing the initial shape with removed material.
6364 # Example: see GEOM_TestAll.py
6365 #theH,Parameters = ParseParameters(theH)
6366 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6367 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6368 #anObj.SetParameters(Parameters)
6371 ## Add material to a solid by extrusion of the base shape on the given distance.
6372 # @param theInit Shape to add material to. It must be a solid or
6373 # a compound made of a single solid.
6374 # @param theBase Closed edge or wire defining the base shape to be extruded.
6375 # @param theH Prism dimension along the normal to theBase
6376 # @param theAngle Draft angle in degrees.
6377 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6379 # @ref tui_creation_prism "Example"
6380 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6382 Add material to a solid by extrusion of the base shape on the given distance.
6385 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6386 theBase Closed edge or wire defining the base shape to be extruded.
6387 theH Prism dimension along the normal to theBase
6388 theAngle Draft angle in degrees.
6391 New GEOM.GEOM_Object, containing the initial shape with added material.
6393 # Example: see GEOM_TestAll.py
6394 #theH,Parameters = ParseParameters(theH)
6395 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6396 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6397 #anObj.SetParameters(Parameters)
6403 ## @addtogroup l3_basic_op
6406 ## Perform an Archimde operation on the given shape with given parameters.
6407 # The object presenting the resulting face is returned.
6408 # @param theShape Shape to be put in water.
6409 # @param theWeight Weight og the shape.
6410 # @param theWaterDensity Density of the water.
6411 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6412 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6413 # by a plane, corresponding to water level.
6415 # @ref tui_archimede "Example"
6416 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6418 Perform an Archimde operation on the given shape with given parameters.
6419 The object presenting the resulting face is returned.
6422 theShape Shape to be put in water.
6423 theWeight Weight og the shape.
6424 theWaterDensity Density of the water.
6425 theMeshDeflection Deflection of the mesh, using to compute the section.
6428 New GEOM.GEOM_Object, containing a section of theShape
6429 by a plane, corresponding to water level.
6431 # Example: see GEOM_TestAll.py
6432 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6433 theWeight,theWaterDensity,theMeshDeflection)
6434 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6435 RaiseIfFailed("MakeArchimede", self.LocalOp)
6436 anObj.SetParameters(Parameters)
6439 # end of l3_basic_op
6442 ## @addtogroup l2_measure
6445 ## Get point coordinates
6448 # @ref tui_measurement_tools_page "Example"
6449 def PointCoordinates(self,Point):
6451 Get point coordinates
6456 # Example: see GEOM_TestMeasures.py
6457 aTuple = self.MeasuOp.PointCoordinates(Point)
6458 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6461 ## Get summarized length of all wires,
6462 # area of surface and volume of the given shape.
6463 # @param theShape Shape to define properties of.
6464 # @return [theLength, theSurfArea, theVolume]\n
6465 # theLength: Summarized length of all wires of the given shape.\n
6466 # theSurfArea: Area of surface of the given shape.\n
6467 # theVolume: Volume of the given shape.
6469 # @ref tui_measurement_tools_page "Example"
6470 def BasicProperties(self,theShape):
6472 Get summarized length of all wires,
6473 area of surface and volume of the given shape.
6476 theShape Shape to define properties of.
6479 [theLength, theSurfArea, theVolume]
6480 theLength: Summarized length of all wires of the given shape.
6481 theSurfArea: Area of surface of the given shape.
6482 theVolume: Volume of the given shape.
6484 # Example: see GEOM_TestMeasures.py
6485 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6486 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6489 ## Get parameters of bounding box of the given shape
6490 # @param theShape Shape to obtain bounding box of.
6491 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6492 # Xmin,Xmax: Limits of shape along OX axis.
6493 # Ymin,Ymax: Limits of shape along OY axis.
6494 # Zmin,Zmax: Limits of shape along OZ axis.
6496 # @ref tui_measurement_tools_page "Example"
6497 def BoundingBox(self,theShape):
6499 Get parameters of bounding box of the given shape
6502 theShape Shape to obtain bounding box of.
6505 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6506 Xmin,Xmax: Limits of shape along OX axis.
6507 Ymin,Ymax: Limits of shape along OY axis.
6508 Zmin,Zmax: Limits of shape along OZ axis.
6510 # Example: see GEOM_TestMeasures.py
6511 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6512 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6515 ## Get inertia matrix and moments of inertia of theShape.
6516 # @param theShape Shape to calculate inertia of.
6517 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6518 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6519 # Ix,Iy,Iz: Moments of inertia of the given shape.
6521 # @ref tui_measurement_tools_page "Example"
6522 def Inertia(self,theShape):
6524 Get inertia matrix and moments of inertia of theShape.
6527 theShape Shape to calculate inertia of.
6530 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6531 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6532 Ix,Iy,Iz: Moments of inertia of the given shape.
6534 # Example: see GEOM_TestMeasures.py
6535 aTuple = self.MeasuOp.GetInertia(theShape)
6536 RaiseIfFailed("GetInertia", self.MeasuOp)
6539 ## Get if coords are included in the shape (ST_IN or ST_ON)
6540 # @param theShape Shape
6541 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6542 # @param tolerance to be used (default is 1.0e-7)
6543 # @return list_of_boolean = [res1, res2, ...]
6544 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6546 Get if coords are included in the shape (ST_IN or ST_ON)
6550 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6551 tolerance to be used (default is 1.0e-7)
6554 list_of_boolean = [res1, res2, ...]
6556 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6558 ## Get minimal distance between the given shapes.
6559 # @param theShape1,theShape2 Shapes to find minimal distance between.
6560 # @return Value of the minimal distance between the given shapes.
6562 # @ref tui_measurement_tools_page "Example"
6563 def MinDistance(self, theShape1, theShape2):
6565 Get minimal distance between the given shapes.
6568 theShape1,theShape2 Shapes to find minimal distance between.
6571 Value of the minimal distance between the given shapes.
6573 # Example: see GEOM_TestMeasures.py
6574 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6575 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6578 ## Get minimal distance between the given shapes.
6579 # @param theShape1,theShape2 Shapes to find minimal distance between.
6580 # @return Value of the minimal distance between the given shapes.
6582 # @ref swig_all_measure "Example"
6583 def MinDistanceComponents(self, theShape1, theShape2):
6585 Get minimal distance between the given shapes.
6588 theShape1,theShape2 Shapes to find minimal distance between.
6591 Value of the minimal distance between the given shapes.
6593 # Example: see GEOM_TestMeasures.py
6594 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6595 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6596 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6599 ## Get angle between the given shapes in degrees.
6600 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6601 # @note If both arguments are vectors, the angle is computed in accordance
6602 # with their orientations, otherwise the minimum angle is computed.
6603 # @return Value of the angle between the given shapes in degrees.
6605 # @ref tui_measurement_tools_page "Example"
6606 def GetAngle(self, theShape1, theShape2):
6608 Get angle between the given shapes in degrees.
6611 theShape1,theShape2 Lines or linear edges to find angle between.
6614 If both arguments are vectors, the angle is computed in accordance
6615 with their orientations, otherwise the minimum angle is computed.
6618 Value of the angle between the given shapes in degrees.
6620 # Example: see GEOM_TestMeasures.py
6621 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6622 RaiseIfFailed("GetAngle", self.MeasuOp)
6625 ## Get angle between the given shapes in radians.
6626 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6627 # @note If both arguments are vectors, the angle is computed in accordance
6628 # with their orientations, otherwise the minimum angle is computed.
6629 # @return Value of the angle between the given shapes in radians.
6631 # @ref tui_measurement_tools_page "Example"
6632 def GetAngleRadians(self, theShape1, theShape2):
6634 Get angle between the given shapes in radians.
6637 theShape1,theShape2 Lines or linear edges to find angle between.
6641 If both arguments are vectors, the angle is computed in accordance
6642 with their orientations, otherwise the minimum angle is computed.
6645 Value of the angle between the given shapes in radians.
6647 # Example: see GEOM_TestMeasures.py
6648 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6649 RaiseIfFailed("GetAngle", self.MeasuOp)
6652 ## Get angle between the given vectors in degrees.
6653 # @param theShape1,theShape2 Vectors to find angle between.
6654 # @param theFlag If True, the normal vector is defined by the two vectors cross,
6655 # if False, the opposite vector to the normal vector is used.
6656 # @return Value of the angle between the given vectors in degrees.
6658 # @ref tui_measurement_tools_page "Example"
6659 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6661 Get angle between the given vectors in degrees.
6664 theShape1,theShape2 Vectors to find angle between.
6665 theFlag If True, the normal vector is defined by the two vectors cross,
6666 if False, the opposite vector to the normal vector is used.
6669 Value of the angle between the given vectors in degrees.
6671 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6673 anAngle = 360. - anAngle
6674 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6677 ## The same as GetAngleVectors, but the result is in radians.
6678 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6680 Get angle between the given vectors in radians.
6683 theShape1,theShape2 Vectors to find angle between.
6684 theFlag If True, the normal vector is defined by the two vectors cross,
6685 if False, the opposite vector to the normal vector is used.
6688 Value of the angle between the given vectors in radians.
6690 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6693 ## @name Curve Curvature Measurement
6694 # Methods for receiving radius of curvature of curves
6695 # in the given point
6698 ## Measure curvature of a curve at a point, set by parameter.
6699 # @param theCurve a curve.
6700 # @param theParam parameter.
6701 # @return radius of curvature of \a theCurve.
6703 # @ref swig_todo "Example"
6704 def CurveCurvatureByParam(self, theCurve, theParam):
6706 Measure curvature of a curve at a point, set by parameter.
6713 radius of curvature of theCurve.
6715 # Example: see GEOM_TestMeasures.py
6716 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6717 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6720 ## Measure curvature of a curve at a point.
6721 # @param theCurve a curve.
6722 # @param thePoint given point.
6723 # @return radius of curvature of \a theCurve.
6725 # @ref swig_todo "Example"
6726 def CurveCurvatureByPoint(self, theCurve, thePoint):
6728 Measure curvature of a curve at a point.
6732 thePoint given point.
6735 radius of curvature of theCurve.
6737 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6738 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6742 ## @name Surface Curvature Measurement
6743 # Methods for receiving max and min radius of curvature of surfaces
6744 # in the given point
6747 ## Measure max radius of curvature of surface.
6748 # @param theSurf the given surface.
6749 # @param theUParam Value of U-parameter on the referenced surface.
6750 # @param theVParam Value of V-parameter on the referenced surface.
6751 # @return max radius of curvature of theSurf.
6753 ## @ref swig_todo "Example"
6754 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6756 Measure max radius of curvature of surface.
6759 theSurf the given surface.
6760 theUParam Value of U-parameter on the referenced surface.
6761 theVParam Value of V-parameter on the referenced surface.
6764 max radius of curvature of theSurf.
6766 # Example: see GEOM_TestMeasures.py
6767 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6768 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6771 ## Measure max radius of curvature of surface in the given point
6772 # @param theSurf the given surface.
6773 # @param thePoint given point.
6774 # @return max radius of curvature of theSurf.
6776 ## @ref swig_todo "Example"
6777 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6779 Measure max radius of curvature of surface in the given point.
6782 theSurf the given surface.
6783 thePoint given point.
6786 max radius of curvature of theSurf.
6788 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6789 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6792 ## Measure min radius of curvature of surface.
6793 # @param theSurf the given surface.
6794 # @param theUParam Value of U-parameter on the referenced surface.
6795 # @param theVParam Value of V-parameter on the referenced surface.
6796 # @return min radius of curvature of theSurf.
6798 ## @ref swig_todo "Example"
6799 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6801 Measure min radius of curvature of surface.
6804 theSurf the given surface.
6805 theUParam Value of U-parameter on the referenced surface.
6806 theVParam Value of V-parameter on the referenced surface.
6809 Min radius of curvature of theSurf.
6811 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6812 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6815 ## Measure min radius of curvature of surface in the given point
6816 # @param theSurf the given surface.
6817 # @param thePoint given point.
6818 # @return min radius of curvature of theSurf.
6820 ## @ref swig_todo "Example"
6821 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6823 Measure min radius of curvature of surface in the given point.
6826 theSurf the given surface.
6827 thePoint given point.
6830 Min radius of curvature of theSurf.
6832 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6833 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6837 ## Get min and max tolerances of sub-shapes of theShape
6838 # @param theShape Shape, to get tolerances of.
6839 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6840 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
6841 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6842 # VertMin,VertMax: Min and max tolerances of the vertices.
6844 # @ref tui_measurement_tools_page "Example"
6845 def Tolerance(self,theShape):
6847 Get min and max tolerances of sub-shapes of theShape
6850 theShape Shape, to get tolerances of.
6853 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6854 FaceMin,FaceMax: Min and max tolerances of the faces.
6855 EdgeMin,EdgeMax: Min and max tolerances of the edges.
6856 VertMin,VertMax: Min and max tolerances of the vertices.
6858 # Example: see GEOM_TestMeasures.py
6859 aTuple = self.MeasuOp.GetTolerance(theShape)
6860 RaiseIfFailed("GetTolerance", self.MeasuOp)
6863 ## Obtain description of the given shape (number of sub-shapes of each type)
6864 # @param theShape Shape to be described.
6865 # @return Description of the given shape.
6867 # @ref tui_measurement_tools_page "Example"
6868 def WhatIs(self,theShape):
6870 Obtain description of the given shape (number of sub-shapes of each type)
6873 theShape Shape to be described.
6876 Description of the given shape.
6878 # Example: see GEOM_TestMeasures.py
6879 aDescr = self.MeasuOp.WhatIs(theShape)
6880 RaiseIfFailed("WhatIs", self.MeasuOp)
6883 ## Obtain quantity of shapes of the given type in \a theShape.
6884 # If \a theShape is of type \a theType, it is also counted.
6885 # @param theShape Shape to be described.
6886 # @param theType the given ShapeType().
6887 # @return Quantity of shapes of type \a theType in \a theShape.
6889 # @ref tui_measurement_tools_page "Example"
6890 def NbShapes (self, theShape, theType):
6892 Obtain quantity of shapes of the given type in theShape.
6893 If theShape is of type theType, it is also counted.
6896 theShape Shape to be described.
6897 theType the given geompy.ShapeType
6900 Quantity of shapes of type theType in theShape.
6902 # Example: see GEOM_TestMeasures.py
6903 listSh = self.SubShapeAllIDs(theShape, theType)
6905 t = EnumToLong(theShape.GetShapeType())
6906 theType = EnumToLong(theType)
6912 ## Obtain quantity of shapes of each type in \a theShape.
6913 # The \a theShape is also counted.
6914 # @param theShape Shape to be described.
6915 # @return Dictionary of ShapeType() with bound quantities of shapes.
6917 # @ref tui_measurement_tools_page "Example"
6918 def ShapeInfo (self, theShape):
6920 Obtain quantity of shapes of each type in theShape.
6921 The theShape is also counted.
6924 theShape Shape to be described.
6927 Dictionary of geompy.ShapeType with bound quantities of shapes.
6929 # Example: see GEOM_TestMeasures.py
6931 for typeSh in ShapeType:
6932 if typeSh in ( "AUTO", "SHAPE" ): continue
6933 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
6935 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
6942 ## Get a point, situated at the centre of mass of theShape.
6943 # @param theShape Shape to define centre of mass of.
6944 # @return New GEOM.GEOM_Object, containing the created point.
6946 # @ref tui_measurement_tools_page "Example"
6947 def MakeCDG(self,theShape):
6949 Get a point, situated at the centre of mass of theShape.
6952 theShape Shape to define centre of mass of.
6955 New GEOM.GEOM_Object, containing the created point.
6957 # Example: see GEOM_TestMeasures.py
6958 anObj = self.MeasuOp.GetCentreOfMass(theShape)
6959 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
6962 ## Get a vertex sub-shape by index depended with orientation.
6963 # @param theShape Shape to find sub-shape.
6964 # @param theIndex Index to find vertex by this index (starting from zero)
6965 # @return New GEOM.GEOM_Object, containing the created vertex.
6967 # @ref tui_measurement_tools_page "Example"
6968 def GetVertexByIndex(self,theShape, theIndex):
6970 Get a vertex sub-shape by index depended with orientation.
6973 theShape Shape to find sub-shape.
6974 theIndex Index to find vertex by this index (starting from zero)
6977 New GEOM.GEOM_Object, containing the created vertex.
6979 # Example: see GEOM_TestMeasures.py
6980 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
6981 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
6984 ## Get the first vertex of wire/edge depended orientation.
6985 # @param theShape Shape to find first vertex.
6986 # @return New GEOM.GEOM_Object, containing the created vertex.
6988 # @ref tui_measurement_tools_page "Example"
6989 def GetFirstVertex(self,theShape):
6991 Get the first vertex of wire/edge depended orientation.
6994 theShape Shape to find first vertex.
6997 New GEOM.GEOM_Object, containing the created vertex.
6999 # Example: see GEOM_TestMeasures.py
7000 anObj = self.GetVertexByIndex(theShape, 0)
7001 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7004 ## Get the last vertex of wire/edge depended orientation.
7005 # @param theShape Shape to find last vertex.
7006 # @return New GEOM.GEOM_Object, containing the created vertex.
7008 # @ref tui_measurement_tools_page "Example"
7009 def GetLastVertex(self,theShape):
7011 Get the last vertex of wire/edge depended orientation.
7014 theShape Shape to find last vertex.
7017 New GEOM.GEOM_Object, containing the created vertex.
7019 # Example: see GEOM_TestMeasures.py
7020 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7021 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7022 RaiseIfFailed("GetLastVertex", self.MeasuOp)
7025 ## Get a normale to the given face. If the point is not given,
7026 # the normale is calculated at the center of mass.
7027 # @param theFace Face to define normale of.
7028 # @param theOptionalPoint Point to compute the normale at.
7029 # @return New GEOM.GEOM_Object, containing the created vector.
7031 # @ref swig_todo "Example"
7032 def GetNormal(self, theFace, theOptionalPoint = None):
7034 Get a normale to the given face. If the point is not given,
7035 the normale is calculated at the center of mass.
7038 theFace Face to define normale of.
7039 theOptionalPoint Point to compute the normale at.
7042 New GEOM.GEOM_Object, containing the created vector.
7044 # Example: see GEOM_TestMeasures.py
7045 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7046 RaiseIfFailed("GetNormal", self.MeasuOp)
7049 ## Check a topology of the given shape.
7050 # @param theShape Shape to check validity of.
7051 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7052 # if TRUE, the shape's geometry will be checked also.
7053 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7054 # of problem is printed.
7055 # if TRUE and if theShape is invalid, the description
7056 # of problem is also returned.
7057 # @return TRUE, if the shape "seems to be valid".
7059 # @ref tui_measurement_tools_page "Example"
7060 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7062 Check a topology of the given shape.
7065 theShape Shape to check validity of.
7066 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7067 if TRUE, the shape's geometry will be checked also.
7068 theReturnStatus If FALSE and if theShape is invalid, a description
7069 of problem is printed.
7070 if TRUE and if theShape is invalid, the description
7071 of problem is returned.
7074 TRUE, if the shape "seems to be valid".
7075 If theShape is invalid, prints a description of problem.
7076 This description can also be returned.
7078 # Example: see GEOM_TestMeasures.py
7080 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7081 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7083 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7084 RaiseIfFailed("CheckShape", self.MeasuOp)
7086 if theReturnStatus == 0:
7088 if theReturnStatus == 1:
7089 return (IsValid, Status)
7092 ## Detect self-intersections in the given shape.
7093 # @param theShape Shape to check.
7094 # @return TRUE, if the shape contains no self-intersections.
7096 # @ref tui_measurement_tools_page "Example"
7097 def CheckSelfIntersections(self, theShape):
7099 Detect self-intersections in the given shape.
7102 theShape Shape to check.
7105 TRUE, if the shape contains no self-intersections.
7107 # Example: see GEOM_TestMeasures.py
7108 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7109 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7112 ## Get position (LCS) of theShape.
7114 # Origin of the LCS is situated at the shape's center of mass.
7115 # Axes of the LCS are obtained from shape's location or,
7116 # if the shape is a planar face, from position of its plane.
7118 # @param theShape Shape to calculate position of.
7119 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7120 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
7121 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7122 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7124 # @ref swig_todo "Example"
7125 def GetPosition(self,theShape):
7127 Get position (LCS) of theShape.
7128 Origin of the LCS is situated at the shape's center of mass.
7129 Axes of the LCS are obtained from shape's location or,
7130 if the shape is a planar face, from position of its plane.
7133 theShape Shape to calculate position of.
7136 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7137 Ox,Oy,Oz: Coordinates of shape's LCS origin.
7138 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7139 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7141 # Example: see GEOM_TestMeasures.py
7142 aTuple = self.MeasuOp.GetPosition(theShape)
7143 RaiseIfFailed("GetPosition", self.MeasuOp)
7146 ## Get kind of theShape.
7148 # @param theShape Shape to get a kind of.
7149 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7150 # and a list of parameters, describing the shape.
7151 # @note Concrete meaning of each value, returned via \a theIntegers
7152 # or \a theDoubles list depends on the kind() of the shape.
7154 # @ref swig_todo "Example"
7155 def KindOfShape(self,theShape):
7157 Get kind of theShape.
7160 theShape Shape to get a kind of.
7163 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7164 and a list of parameters, describing the shape.
7166 Concrete meaning of each value, returned via theIntegers
7167 or theDoubles list depends on the geompy.kind of the shape
7169 # Example: see GEOM_TestMeasures.py
7170 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7171 RaiseIfFailed("KindOfShape", self.MeasuOp)
7173 aKind = aRoughTuple[0]
7174 anInts = aRoughTuple[1]
7175 aDbls = aRoughTuple[2]
7177 # Now there is no exception from this rule:
7178 aKindTuple = [aKind] + aDbls + anInts
7180 # If they are we will regroup parameters for such kind of shape.
7182 #if aKind == kind.SOME_KIND:
7183 # # SOME_KIND int int double int double double
7184 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7191 ## @addtogroup l2_import_export
7194 ## Import a shape from the BREP or IGES or STEP file
7195 # (depends on given format) with given name.
7196 # @param theFileName The file, containing the shape.
7197 # @param theFormatName Specify format for the file reading.
7198 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7199 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7200 # set to 'meter' and result model will be scaled.
7201 # @return New GEOM.GEOM_Object, containing the imported shape.
7203 # @ref swig_Import_Export "Example"
7204 def ImportFile(self,theFileName, theFormatName):
7206 Import a shape from the BREP or IGES or STEP file
7207 (depends on given format) with given name.
7210 theFileName The file, containing the shape.
7211 theFormatName Specify format for the file reading.
7212 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7213 If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7214 set to 'meter' and result model will be scaled.
7217 New GEOM.GEOM_Object, containing the imported shape.
7219 # Example: see GEOM_TestOthers.py
7220 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7221 RaiseIfFailed("Import", self.InsertOp)
7224 ## Deprecated analog of ImportFile()
7225 def Import(self,theFileName, theFormatName):
7227 Deprecated analog of geompy.ImportFile
7229 print "WARNING: Function Import is deprecated, use ImportFile instead"
7230 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7231 RaiseIfFailed("Import", self.InsertOp)
7234 ## Shortcut to ImportFile() for BREP format
7236 # @ref swig_Import_Export "Example"
7237 def ImportBREP(self,theFileName):
7239 geompy.ImportFile(...) function for BREP format
7241 # Example: see GEOM_TestOthers.py
7242 return self.ImportFile(theFileName, "BREP")
7244 ## Shortcut to ImportFile() for IGES format
7246 # @ref swig_Import_Export "Example"
7247 def ImportIGES(self,theFileName):
7249 geompy.ImportFile(...) function for IGES format
7251 # Example: see GEOM_TestOthers.py
7252 return self.ImportFile(theFileName, "IGES")
7254 ## Return length unit from given IGES file
7256 # @ref swig_Import_Export "Example"
7257 def GetIGESUnit(self,theFileName):
7259 Return length unit from given IGES file
7261 # Example: see GEOM_TestOthers.py
7262 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
7263 #RaiseIfFailed("Import", self.InsertOp)
7264 # recieve name using returned vertex
7266 if anObj.GetShapeType() == GEOM.VERTEX:
7269 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
7271 p = self.PointCoordinates(vertices[0])
7272 if abs(p[0]-0.01) < 1.e-6:
7274 elif abs(p[0]-0.001) < 1.e-6:
7278 ## Shortcut to ImportFile() for STEP format
7280 # @ref swig_Import_Export "Example"
7281 def ImportSTEP(self,theFileName):
7283 geompy.ImportFile(...) function for STEP format
7285 # Example: see GEOM_TestOthers.py
7286 return self.ImportFile(theFileName, "STEP")
7288 ## Export the given shape into a file with given name.
7289 # @param theObject Shape to be stored in the file.
7290 # @param theFileName Name of the file to store the given shape in.
7291 # @param theFormatName Specify format for the shape storage.
7292 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7294 # @ref swig_Import_Export "Example"
7295 def Export(self,theObject, theFileName, theFormatName):
7297 Export the given shape into a file with given name.
7300 theObject Shape to be stored in the file.
7301 theFileName Name of the file to store the given shape in.
7302 theFormatName Specify format for the shape storage.
7303 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7305 # Example: see GEOM_TestOthers.py
7306 self.InsertOp.Export(theObject, theFileName, theFormatName)
7307 if self.InsertOp.IsDone() == 0:
7308 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7312 ## Shortcut to Export() for BREP format
7314 # @ref swig_Import_Export "Example"
7315 def ExportBREP(self,theObject, theFileName):
7317 geompy.Export(...) function for BREP format
7319 # Example: see GEOM_TestOthers.py
7320 return self.Export(theObject, theFileName, "BREP")
7322 ## Shortcut to Export() for IGES format
7324 # @ref swig_Import_Export "Example"
7325 def ExportIGES(self,theObject, theFileName):
7327 geompy.Export(...) function for IGES format
7329 # Example: see GEOM_TestOthers.py
7330 return self.Export(theObject, theFileName, "IGES")
7332 ## Shortcut to Export() for STEP format
7334 # @ref swig_Import_Export "Example"
7335 def ExportSTEP(self,theObject, theFileName):
7337 geompy.Export(...) function for STEP format
7339 # Example: see GEOM_TestOthers.py
7340 return self.Export(theObject, theFileName, "STEP")
7342 # end of l2_import_export
7345 ## @addtogroup l3_blocks
7348 ## Create a quadrangle face from four edges. Order of Edges is not
7349 # important. It is not necessary that edges share the same vertex.
7350 # @param E1,E2,E3,E4 Edges for the face bound.
7351 # @return New GEOM.GEOM_Object, containing the created face.
7353 # @ref tui_building_by_blocks_page "Example"
7354 def MakeQuad(self,E1, E2, E3, E4):
7356 Create a quadrangle face from four edges. Order of Edges is not
7357 important. It is not necessary that edges share the same vertex.
7360 E1,E2,E3,E4 Edges for the face bound.
7363 New GEOM.GEOM_Object, containing the created face.
7366 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7368 # Example: see GEOM_Spanner.py
7369 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7370 RaiseIfFailed("MakeQuad", self.BlocksOp)
7373 ## Create a quadrangle face on two edges.
7374 # The missing edges will be built by creating the shortest ones.
7375 # @param E1,E2 Two opposite edges for the face.
7376 # @return New GEOM.GEOM_Object, containing the created face.
7378 # @ref tui_building_by_blocks_page "Example"
7379 def MakeQuad2Edges(self,E1, E2):
7381 Create a quadrangle face on two edges.
7382 The missing edges will be built by creating the shortest ones.
7385 E1,E2 Two opposite edges for the face.
7388 New GEOM.GEOM_Object, containing the created face.
7392 p1 = geompy.MakeVertex( 0., 0., 0.)
7393 p2 = geompy.MakeVertex(150., 30., 0.)
7394 p3 = geompy.MakeVertex( 0., 120., 50.)
7395 p4 = geompy.MakeVertex( 0., 40., 70.)
7397 edge1 = geompy.MakeEdge(p1, p2)
7398 edge2 = geompy.MakeEdge(p3, p4)
7399 # create a quadrangle face from two edges
7400 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7402 # Example: see GEOM_Spanner.py
7403 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7404 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7407 ## Create a quadrangle face with specified corners.
7408 # The missing edges will be built by creating the shortest ones.
7409 # @param V1,V2,V3,V4 Corner vertices for the face.
7410 # @return New GEOM.GEOM_Object, containing the created face.
7412 # @ref tui_building_by_blocks_page "Example 1"
7413 # \n @ref swig_MakeQuad4Vertices "Example 2"
7414 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7416 Create a quadrangle face with specified corners.
7417 The missing edges will be built by creating the shortest ones.
7420 V1,V2,V3,V4 Corner vertices for the face.
7423 New GEOM.GEOM_Object, containing the created face.
7427 p1 = geompy.MakeVertex( 0., 0., 0.)
7428 p2 = geompy.MakeVertex(150., 30., 0.)
7429 p3 = geompy.MakeVertex( 0., 120., 50.)
7430 p4 = geompy.MakeVertex( 0., 40., 70.)
7431 # create a quadrangle from four points in its corners
7432 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7434 # Example: see GEOM_Spanner.py
7435 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7436 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7439 ## Create a hexahedral solid, bounded by the six given faces. Order of
7440 # faces is not important. It is not necessary that Faces share the same edge.
7441 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7442 # @return New GEOM.GEOM_Object, containing the created solid.
7444 # @ref tui_building_by_blocks_page "Example 1"
7445 # \n @ref swig_MakeHexa "Example 2"
7446 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7448 Create a hexahedral solid, bounded by the six given faces. Order of
7449 faces is not important. It is not necessary that Faces share the same edge.
7452 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7455 New GEOM.GEOM_Object, containing the created solid.
7458 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7460 # Example: see GEOM_Spanner.py
7461 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7462 RaiseIfFailed("MakeHexa", self.BlocksOp)
7465 ## Create a hexahedral solid between two given faces.
7466 # The missing faces will be built by creating the smallest ones.
7467 # @param F1,F2 Two opposite faces for the hexahedral solid.
7468 # @return New GEOM.GEOM_Object, containing the created solid.
7470 # @ref tui_building_by_blocks_page "Example 1"
7471 # \n @ref swig_MakeHexa2Faces "Example 2"
7472 def MakeHexa2Faces(self,F1, F2):
7474 Create a hexahedral solid between two given faces.
7475 The missing faces will be built by creating the smallest ones.
7478 F1,F2 Two opposite faces for the hexahedral solid.
7481 New GEOM.GEOM_Object, containing the created solid.
7484 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7486 # Example: see GEOM_Spanner.py
7487 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7488 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7494 ## @addtogroup l3_blocks_op
7497 ## Get a vertex, found in the given shape by its coordinates.
7498 # @param theShape Block or a compound of blocks.
7499 # @param theX,theY,theZ Coordinates of the sought vertex.
7500 # @param theEpsilon Maximum allowed distance between the resulting
7501 # vertex and point with the given coordinates.
7502 # @return New GEOM.GEOM_Object, containing the found vertex.
7504 # @ref swig_GetPoint "Example"
7505 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7507 Get a vertex, found in the given shape by its coordinates.
7510 theShape Block or a compound of blocks.
7511 theX,theY,theZ Coordinates of the sought vertex.
7512 theEpsilon Maximum allowed distance between the resulting
7513 vertex and point with the given coordinates.
7516 New GEOM.GEOM_Object, containing the found vertex.
7519 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7521 # Example: see GEOM_TestOthers.py
7522 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7523 RaiseIfFailed("GetPoint", self.BlocksOp)
7526 ## Find a vertex of the given shape, which has minimal distance to the given point.
7527 # @param theShape Any shape.
7528 # @param thePoint Point, close to the desired vertex.
7529 # @return New GEOM.GEOM_Object, containing the found vertex.
7531 # @ref swig_GetVertexNearPoint "Example"
7532 def GetVertexNearPoint(self, theShape, thePoint):
7534 Find a vertex of the given shape, which has minimal distance to the given point.
7538 thePoint Point, close to the desired vertex.
7541 New GEOM.GEOM_Object, containing the found vertex.
7544 pmidle = geompy.MakeVertex(50, 0, 50)
7545 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7547 # Example: see GEOM_TestOthers.py
7548 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7549 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7552 ## Get an edge, found in the given shape by two given vertices.
7553 # @param theShape Block or a compound of blocks.
7554 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7555 # @return New GEOM.GEOM_Object, containing the found edge.
7557 # @ref swig_GetEdge "Example"
7558 def GetEdge(self, theShape, thePoint1, thePoint2):
7560 Get an edge, found in the given shape by two given vertices.
7563 theShape Block or a compound of blocks.
7564 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7567 New GEOM.GEOM_Object, containing the found edge.
7569 # Example: see GEOM_Spanner.py
7570 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7571 RaiseIfFailed("GetEdge", self.BlocksOp)
7574 ## Find an edge of the given shape, which has minimal distance to the given point.
7575 # @param theShape Block or a compound of blocks.
7576 # @param thePoint Point, close to the desired edge.
7577 # @return New GEOM.GEOM_Object, containing the found edge.
7579 # @ref swig_GetEdgeNearPoint "Example"
7580 def GetEdgeNearPoint(self, theShape, thePoint):
7582 Find an edge of the given shape, which has minimal distance to the given point.
7585 theShape Block or a compound of blocks.
7586 thePoint Point, close to the desired edge.
7589 New GEOM.GEOM_Object, containing the found edge.
7591 # Example: see GEOM_TestOthers.py
7592 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7593 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7596 ## Returns a face, found in the given shape by four given corner vertices.
7597 # @param theShape Block or a compound of blocks.
7598 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7599 # @return New GEOM.GEOM_Object, containing the found face.
7601 # @ref swig_todo "Example"
7602 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7604 Returns a face, found in the given shape by four given corner vertices.
7607 theShape Block or a compound of blocks.
7608 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7611 New GEOM.GEOM_Object, containing the found face.
7613 # Example: see GEOM_Spanner.py
7614 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7615 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7618 ## Get a face of block, found in the given shape by two given edges.
7619 # @param theShape Block or a compound of blocks.
7620 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7621 # @return New GEOM.GEOM_Object, containing the found face.
7623 # @ref swig_todo "Example"
7624 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7626 Get a face of block, found in the given shape by two given edges.
7629 theShape Block or a compound of blocks.
7630 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7633 New GEOM.GEOM_Object, containing the found face.
7635 # Example: see GEOM_Spanner.py
7636 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7637 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7640 ## Find a face, opposite to the given one in the given block.
7641 # @param theBlock Must be a hexahedral solid.
7642 # @param theFace Face of \a theBlock, opposite to the desired face.
7643 # @return New GEOM.GEOM_Object, containing the found face.
7645 # @ref swig_GetOppositeFace "Example"
7646 def GetOppositeFace(self,theBlock, theFace):
7648 Find a face, opposite to the given one in the given block.
7651 theBlock Must be a hexahedral solid.
7652 theFace Face of theBlock, opposite to the desired face.
7655 New GEOM.GEOM_Object, containing the found face.
7657 # Example: see GEOM_Spanner.py
7658 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7659 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7662 ## Find a face of the given shape, which has minimal distance to the given point.
7663 # @param theShape Block or a compound of blocks.
7664 # @param thePoint Point, close to the desired face.
7665 # @return New GEOM.GEOM_Object, containing the found face.
7667 # @ref swig_GetFaceNearPoint "Example"
7668 def GetFaceNearPoint(self, theShape, thePoint):
7670 Find a face of the given shape, which has minimal distance to the given point.
7673 theShape Block or a compound of blocks.
7674 thePoint Point, close to the desired face.
7677 New GEOM.GEOM_Object, containing the found face.
7679 # Example: see GEOM_Spanner.py
7680 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7681 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7684 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7685 # @param theBlock Block or a compound of blocks.
7686 # @param theVector Vector, close to the normale of the desired face.
7687 # @return New GEOM.GEOM_Object, containing the found face.
7689 # @ref swig_todo "Example"
7690 def GetFaceByNormale(self, theBlock, theVector):
7692 Find a face of block, whose outside normale has minimal angle with the given vector.
7695 theBlock Block or a compound of blocks.
7696 theVector Vector, close to the normale of the desired face.
7699 New GEOM.GEOM_Object, containing the found face.
7701 # Example: see GEOM_Spanner.py
7702 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7703 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7706 ## Find all sub-shapes of type \a theShapeType of the given shape,
7707 # which have minimal distance to the given point.
7708 # @param theShape Any shape.
7709 # @param thePoint Point, close to the desired shape.
7710 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7711 # @param theTolerance The tolerance for distances comparison. All shapes
7712 # with distances to the given point in interval
7713 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7714 # @return New GEOM_Object, containing a group of all found shapes.
7716 # @ref swig_GetShapesNearPoint "Example"
7717 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7719 Find all sub-shapes of type theShapeType of the given shape,
7720 which have minimal distance to the given point.
7724 thePoint Point, close to the desired shape.
7725 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7726 theTolerance The tolerance for distances comparison. All shapes
7727 with distances to the given point in interval
7728 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7731 New GEOM_Object, containing a group of all found shapes.
7733 # Example: see GEOM_TestOthers.py
7734 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7735 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7738 # end of l3_blocks_op
7741 ## @addtogroup l4_blocks_measure
7744 ## Check, if the compound of blocks is given.
7745 # To be considered as a compound of blocks, the
7746 # given shape must satisfy the following conditions:
7747 # - Each element of the compound should be a Block (6 faces and 12 edges).
7748 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7749 # - The compound should be connexe.
7750 # - The glue between two quadrangle faces should be applied.
7751 # @param theCompound The compound to check.
7752 # @return TRUE, if the given shape is a compound of blocks.
7753 # If theCompound is not valid, prints all discovered errors.
7755 # @ref tui_measurement_tools_page "Example 1"
7756 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
7757 def CheckCompoundOfBlocks(self,theCompound):
7759 Check, if the compound of blocks is given.
7760 To be considered as a compound of blocks, the
7761 given shape must satisfy the following conditions:
7762 - Each element of the compound should be a Block (6 faces and 12 edges).
7763 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7764 - The compound should be connexe.
7765 - The glue between two quadrangle faces should be applied.
7768 theCompound The compound to check.
7771 TRUE, if the given shape is a compound of blocks.
7772 If theCompound is not valid, prints all discovered errors.
7774 # Example: see GEOM_Spanner.py
7775 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7776 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7778 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7782 ## Retrieve all non blocks solids and faces from \a theShape.
7783 # @param theShape The shape to explore.
7784 # @return A tuple of two GEOM_Objects. The first object is a group of all
7785 # non block solids (= not 6 faces, or with 6 faces, but with the
7786 # presence of non-quadrangular faces). The second object is a
7787 # group of all non quadrangular faces.
7789 # @ref tui_measurement_tools_page "Example 1"
7790 # \n @ref swig_GetNonBlocks "Example 2"
7791 def GetNonBlocks (self, theShape):
7793 Retrieve all non blocks solids and faces from theShape.
7796 theShape The shape to explore.
7799 A tuple of two GEOM_Objects. The first object is a group of all
7800 non block solids (= not 6 faces, or with 6 faces, but with the
7801 presence of non-quadrangular faces). The second object is a
7802 group of all non quadrangular faces.
7805 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
7807 # Example: see GEOM_Spanner.py
7808 aTuple = self.BlocksOp.GetNonBlocks(theShape)
7809 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
7812 ## Remove all seam and degenerated edges from \a theShape.
7813 # Unite faces and edges, sharing one surface. It means that
7814 # this faces must have references to one C++ surface object (handle).
7815 # @param theShape The compound or single solid to remove irregular edges from.
7816 # @param doUnionFaces If True, then unite faces. If False (the default value),
7817 # do not unite faces.
7818 # @return Improved shape.
7820 # @ref swig_RemoveExtraEdges "Example"
7821 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
7823 Remove all seam and degenerated edges from theShape.
7824 Unite faces and edges, sharing one surface. It means that
7825 this faces must have references to one C++ surface object (handle).
7828 theShape The compound or single solid to remove irregular edges from.
7829 doUnionFaces If True, then unite faces. If False (the default value),
7835 # Example: see GEOM_TestOthers.py
7836 nbFacesOptimum = -1 # -1 means do not unite faces
7837 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
7838 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
7839 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
7842 ## Check, if the given shape is a blocks compound.
7843 # Fix all detected errors.
7844 # \note Single block can be also fixed by this method.
7845 # @param theShape The compound to check and improve.
7846 # @return Improved compound.
7848 # @ref swig_CheckAndImprove "Example"
7849 def CheckAndImprove(self,theShape):
7851 Check, if the given shape is a blocks compound.
7852 Fix all detected errors.
7855 Single block can be also fixed by this method.
7858 theShape The compound to check and improve.
7863 # Example: see GEOM_TestOthers.py
7864 anObj = self.BlocksOp.CheckAndImprove(theShape)
7865 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
7868 # end of l4_blocks_measure
7871 ## @addtogroup l3_blocks_op
7874 ## Get all the blocks, contained in the given compound.
7875 # @param theCompound The compound to explode.
7876 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
7877 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
7878 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7879 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
7881 # @ref tui_explode_on_blocks "Example 1"
7882 # \n @ref swig_MakeBlockExplode "Example 2"
7883 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
7885 Get all the blocks, contained in the given compound.
7888 theCompound The compound to explode.
7889 theMinNbFaces If solid has lower number of faces, it is not a block.
7890 theMaxNbFaces If solid has higher number of faces, it is not a block.
7893 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7896 List of GEOM.GEOM_Object, containing the retrieved blocks.
7898 # Example: see GEOM_TestOthers.py
7899 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
7900 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
7901 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
7903 anObj.SetParameters(Parameters)
7907 ## Find block, containing the given point inside its volume or on boundary.
7908 # @param theCompound Compound, to find block in.
7909 # @param thePoint Point, close to the desired block. If the point lays on
7910 # boundary between some blocks, we return block with nearest center.
7911 # @return New GEOM.GEOM_Object, containing the found block.
7913 # @ref swig_todo "Example"
7914 def GetBlockNearPoint(self,theCompound, thePoint):
7916 Find block, containing the given point inside its volume or on boundary.
7919 theCompound Compound, to find block in.
7920 thePoint Point, close to the desired block. If the point lays on
7921 boundary between some blocks, we return block with nearest center.
7924 New GEOM.GEOM_Object, containing the found block.
7926 # Example: see GEOM_Spanner.py
7927 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
7928 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
7931 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
7932 # @param theCompound Compound, to find block in.
7933 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
7934 # @return New GEOM.GEOM_Object, containing the found block.
7936 # @ref swig_GetBlockByParts "Example"
7937 def GetBlockByParts(self,theCompound, theParts):
7939 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
7942 theCompound Compound, to find block in.
7943 theParts List of faces and/or edges and/or vertices to be parts of the found block.
7946 New GEOM_Object, containing the found block.
7948 # Example: see GEOM_TestOthers.py
7949 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
7950 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
7953 ## Return all blocks, containing all the elements, passed as the parts.
7954 # @param theCompound Compound, to find blocks in.
7955 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
7956 # @return List of GEOM.GEOM_Object, containing the found blocks.
7958 # @ref swig_todo "Example"
7959 def GetBlocksByParts(self,theCompound, theParts):
7961 Return all blocks, containing all the elements, passed as the parts.
7964 theCompound Compound, to find blocks in.
7965 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
7968 List of GEOM.GEOM_Object, containing the found blocks.
7970 # Example: see GEOM_Spanner.py
7971 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
7972 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
7975 ## Multi-transformate block and glue the result.
7976 # Transformation is defined so, as to superpose direction faces.
7977 # @param Block Hexahedral solid to be multi-transformed.
7978 # @param DirFace1 ID of First direction face.
7979 # @param DirFace2 ID of Second direction face.
7980 # @param NbTimes Quantity of transformations to be done.
7981 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
7982 # @return New GEOM.GEOM_Object, containing the result shape.
7984 # @ref tui_multi_transformation "Example"
7985 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
7987 Multi-transformate block and glue the result.
7988 Transformation is defined so, as to superpose direction faces.
7991 Block Hexahedral solid to be multi-transformed.
7992 DirFace1 ID of First direction face.
7993 DirFace2 ID of Second direction face.
7994 NbTimes Quantity of transformations to be done.
7997 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8000 New GEOM.GEOM_Object, containing the result shape.
8002 # Example: see GEOM_Spanner.py
8003 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8004 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8005 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8006 anObj.SetParameters(Parameters)
8009 ## Multi-transformate block and glue the result.
8010 # @param Block Hexahedral solid to be multi-transformed.
8011 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8012 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8013 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
8014 # @return New GEOM.GEOM_Object, containing the result shape.
8016 # @ref tui_multi_transformation "Example"
8017 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8018 DirFace1V, DirFace2V, NbTimesV):
8020 Multi-transformate block and glue the result.
8023 Block Hexahedral solid to be multi-transformed.
8024 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8025 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8026 NbTimesU,NbTimesV Quantity of transformations to be done.
8029 New GEOM.GEOM_Object, containing the result shape.
8031 # Example: see GEOM_Spanner.py
8032 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8033 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8034 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8035 DirFace1V, DirFace2V, NbTimesV)
8036 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8037 anObj.SetParameters(Parameters)
8040 ## Build all possible propagation groups.
8041 # Propagation group is a set of all edges, opposite to one (main)
8042 # edge of this group directly or through other opposite edges.
8043 # Notion of Opposite Edge make sence only on quadrangle face.
8044 # @param theShape Shape to build propagation groups on.
8045 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
8047 # @ref swig_Propagate "Example"
8048 def Propagate(self,theShape):
8050 Build all possible propagation groups.
8051 Propagation group is a set of all edges, opposite to one (main)
8052 edge of this group directly or through other opposite edges.
8053 Notion of Opposite Edge make sence only on quadrangle face.
8056 theShape Shape to build propagation groups on.
8059 List of GEOM.GEOM_Object, each of them is a propagation group.
8061 # Example: see GEOM_TestOthers.py
8062 listChains = self.BlocksOp.Propagate(theShape)
8063 RaiseIfFailed("Propagate", self.BlocksOp)
8066 # end of l3_blocks_op
8069 ## @addtogroup l3_groups
8072 ## Creates a new group which will store sub-shapes of theMainShape
8073 # @param theMainShape is a GEOM object on which the group is selected
8074 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8075 # @return a newly created GEOM group
8077 # @ref tui_working_with_groups_page "Example 1"
8078 # \n @ref swig_CreateGroup "Example 2"
8079 def CreateGroup(self,theMainShape, theShapeType):
8081 Creates a new group which will store sub-shapes of theMainShape
8084 theMainShape is a GEOM object on which the group is selected
8085 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8086 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8089 a newly created GEOM group
8092 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8095 # Example: see GEOM_TestOthers.py
8096 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8097 RaiseIfFailed("CreateGroup", self.GroupOp)
8100 ## Adds a sub-object with ID theSubShapeId to the group
8101 # @param theGroup is a GEOM group to which the new sub-shape is added
8102 # @param theSubShapeID is a sub-shape ID in the main object.
8103 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8105 # @ref tui_working_with_groups_page "Example"
8106 def AddObject(self,theGroup, theSubShapeID):
8108 Adds a sub-object with ID theSubShapeId to the group
8111 theGroup is a GEOM group to which the new sub-shape is added
8112 theSubShapeID is a sub-shape ID in the main object.
8115 Use method GetSubShapeID() to get an unique ID of the sub-shape
8117 # Example: see GEOM_TestOthers.py
8118 self.GroupOp.AddObject(theGroup, theSubShapeID)
8119 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8120 RaiseIfFailed("AddObject", self.GroupOp)
8124 ## Removes a sub-object with ID \a theSubShapeId from the group
8125 # @param theGroup is a GEOM group from which the new sub-shape is removed
8126 # @param theSubShapeID is a sub-shape ID in the main object.
8127 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8129 # @ref tui_working_with_groups_page "Example"
8130 def RemoveObject(self,theGroup, theSubShapeID):
8132 Removes a sub-object with ID theSubShapeId from the group
8135 theGroup is a GEOM group from which the new sub-shape is removed
8136 theSubShapeID is a sub-shape ID in the main object.
8139 Use method GetSubShapeID() to get an unique ID of the sub-shape
8141 # Example: see GEOM_TestOthers.py
8142 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8143 RaiseIfFailed("RemoveObject", self.GroupOp)
8146 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8147 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8148 # @param theSubShapes is a list of sub-shapes to be added.
8150 # @ref tui_working_with_groups_page "Example"
8151 def UnionList (self,theGroup, theSubShapes):
8153 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8156 theGroup is a GEOM group to which the new sub-shapes are added.
8157 theSubShapes is a list of sub-shapes to be added.
8159 # Example: see GEOM_TestOthers.py
8160 self.GroupOp.UnionList(theGroup, theSubShapes)
8161 RaiseIfFailed("UnionList", self.GroupOp)
8164 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8165 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8166 # @param theSubShapes is a list of indices of sub-shapes to be added.
8168 # @ref swig_UnionIDs "Example"
8169 def UnionIDs(self,theGroup, theSubShapes):
8171 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8174 theGroup is a GEOM group to which the new sub-shapes are added.
8175 theSubShapes is a list of indices of sub-shapes to be added.
8177 # Example: see GEOM_TestOthers.py
8178 self.GroupOp.UnionIDs(theGroup, theSubShapes)
8179 RaiseIfFailed("UnionIDs", self.GroupOp)
8182 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8183 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8184 # @param theSubShapes is a list of sub-shapes to be removed.
8186 # @ref tui_working_with_groups_page "Example"
8187 def DifferenceList (self,theGroup, theSubShapes):
8189 Removes from the group all the given shapes. No errors, if some shapes are not included.
8192 theGroup is a GEOM group from which the sub-shapes are removed.
8193 theSubShapes is a list of sub-shapes to be removed.
8195 # Example: see GEOM_TestOthers.py
8196 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8197 RaiseIfFailed("DifferenceList", self.GroupOp)
8200 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8201 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8202 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8204 # @ref swig_DifferenceIDs "Example"
8205 def DifferenceIDs(self,theGroup, theSubShapes):
8207 Removes from the group all the given shapes. No errors, if some shapes are not included.
8210 theGroup is a GEOM group from which the sub-shapes are removed.
8211 theSubShapes is a list of indices of sub-shapes to be removed.
8213 # Example: see GEOM_TestOthers.py
8214 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8215 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8218 ## Returns a list of sub-objects ID stored in the group
8219 # @param theGroup is a GEOM group for which a list of IDs is requested
8221 # @ref swig_GetObjectIDs "Example"
8222 def GetObjectIDs(self,theGroup):
8224 Returns a list of sub-objects ID stored in the group
8227 theGroup is a GEOM group for which a list of IDs is requested
8229 # Example: see GEOM_TestOthers.py
8230 ListIDs = self.GroupOp.GetObjects(theGroup)
8231 RaiseIfFailed("GetObjects", self.GroupOp)
8234 ## Returns a type of sub-objects stored in the group
8235 # @param theGroup is a GEOM group which type is returned.
8237 # @ref swig_GetType "Example"
8238 def GetType(self,theGroup):
8240 Returns a type of sub-objects stored in the group
8243 theGroup is a GEOM group which type is returned.
8245 # Example: see GEOM_TestOthers.py
8246 aType = self.GroupOp.GetType(theGroup)
8247 RaiseIfFailed("GetType", self.GroupOp)
8250 ## Convert a type of geom object from id to string value
8251 # @param theId is a GEOM obect type id.
8252 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8253 # @ref swig_GetType "Example"
8254 def ShapeIdToType(self, theId):
8256 Convert a type of geom object from id to string value
8259 theId is a GEOM obect type id.
8262 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8337 return "FREE_BOUNDS"
8345 return "THRUSECTIONS"
8347 return "COMPOUNDFILTER"
8349 return "SHAPES_ON_SHAPE"
8351 return "ELLIPSE_ARC"
8360 return "Shape Id not exist."
8362 ## Returns a main shape associated with the group
8363 # @param theGroup is a GEOM group for which a main shape object is requested
8364 # @return a GEOM object which is a main shape for theGroup
8366 # @ref swig_GetMainShape "Example"
8367 def GetMainShape(self,theGroup):
8369 Returns a main shape associated with the group
8372 theGroup is a GEOM group for which a main shape object is requested
8375 a GEOM object which is a main shape for theGroup
8377 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8379 # Example: see GEOM_TestOthers.py
8380 anObj = self.GroupOp.GetMainShape(theGroup)
8381 RaiseIfFailed("GetMainShape", self.GroupOp)
8384 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8385 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8386 # @param theShape given shape (see GEOM.GEOM_Object)
8387 # @param min_length minimum length of edges of theShape
8388 # @param max_length maximum length of edges of theShape
8389 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8390 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8391 # @return a newly created GEOM group of edges
8392 # @@ref swig_todo "Example"
8393 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8395 Create group of edges of theShape, whose length is in range [min_length, max_length].
8396 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8399 theShape given shape
8400 min_length minimum length of edges of theShape
8401 max_length maximum length of edges of theShape
8402 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8403 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8406 a newly created GEOM group of edges.
8408 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8411 Props = self.BasicProperties(edge)
8412 if min_length <= Props[0] and Props[0] <= max_length:
8413 if (not include_min) and (min_length == Props[0]):
8416 if (not include_max) and (Props[0] == max_length):
8419 edges_in_range.append(edge)
8421 if len(edges_in_range) <= 0:
8422 print "No edges found by given criteria"
8425 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8426 self.UnionList(group_edges, edges_in_range)
8430 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8431 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8432 # @param min_length minimum length of edges of selected shape
8433 # @param max_length maximum length of edges of selected shape
8434 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8435 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8436 # @return a newly created GEOM group of edges
8437 # @ref swig_todo "Example"
8438 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8440 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8441 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8444 min_length minimum length of edges of selected shape
8445 max_length maximum length of edges of selected shape
8446 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8447 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8450 a newly created GEOM group of edges.
8452 nb_selected = sg.SelectedCount()
8454 print "Select a shape before calling this function, please."
8457 print "Only one shape must be selected"
8460 id_shape = sg.getSelected(0)
8461 shape = IDToObject( id_shape )
8463 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8467 if include_min: left_str = " <= "
8468 if include_max: right_str = " <= "
8470 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8471 + left_str + "length" + right_str + `max_length`)
8473 sg.updateObjBrowser(1)
8480 ## @addtogroup l4_advanced
8483 ## Create a T-shape object with specified caracteristics for the main
8484 # and the incident pipes (radius, width, half-length).
8485 # The extremities of the main pipe are located on junctions points P1 and P2.
8486 # The extremity of the incident pipe is located on junction point P3.
8487 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8488 # the main plane of the T-shape is XOY.
8489 # @param theR1 Internal radius of main pipe
8490 # @param theW1 Width of main pipe
8491 # @param theL1 Half-length of main pipe
8492 # @param theR2 Internal radius of incident pipe (R2 < R1)
8493 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8494 # @param theL2 Half-length of incident pipe
8495 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8496 # @param theP1 1st junction point of main pipe
8497 # @param theP2 2nd junction point of main pipe
8498 # @param theP3 Junction point of incident pipe
8499 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8501 # @ref tui_creation_pipetshape "Example"
8502 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8504 Create a T-shape object with specified caracteristics for the main
8505 and the incident pipes (radius, width, half-length).
8506 The extremities of the main pipe are located on junctions points P1 and P2.
8507 The extremity of the incident pipe is located on junction point P3.
8508 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8509 the main plane of the T-shape is XOY.
8512 theR1 Internal radius of main pipe
8513 theW1 Width of main pipe
8514 theL1 Half-length of main pipe
8515 theR2 Internal radius of incident pipe (R2 < R1)
8516 theW2 Width of incident pipe (R2+W2 < R1+W1)
8517 theL2 Half-length of incident pipe
8518 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8519 theP1 1st junction point of main pipe
8520 theP2 2nd junction point of main pipe
8521 theP3 Junction point of incident pipe
8524 List of GEOM_Object, containing the created shape and propagation groups.
8527 # create PipeTShape object
8528 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8529 # create PipeTShape object with position
8530 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8532 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8533 if (theP1 and theP2 and theP3):
8534 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8536 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8537 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8538 if Parameters: anObj[0].SetParameters(Parameters)
8541 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8542 # and the incident pipes (radius, width, half-length). The chamfer is
8543 # created on the junction of the pipes.
8544 # The extremities of the main pipe are located on junctions points P1 and P2.
8545 # The extremity of the incident pipe is located on junction point P3.
8546 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8547 # the main plane of the T-shape is XOY.
8548 # @param theR1 Internal radius of main pipe
8549 # @param theW1 Width of main pipe
8550 # @param theL1 Half-length of main pipe
8551 # @param theR2 Internal radius of incident pipe (R2 < R1)
8552 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8553 # @param theL2 Half-length of incident pipe
8554 # @param theH Height of the chamfer.
8555 # @param theW Width of the chamfer.
8556 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8557 # @param theP1 1st junction point of main pipe
8558 # @param theP2 2nd junction point of main pipe
8559 # @param theP3 Junction point of incident pipe
8560 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8562 # @ref tui_creation_pipetshape "Example"
8563 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8565 Create a T-shape object with chamfer and with specified caracteristics for the main
8566 and the incident pipes (radius, width, half-length). The chamfer is
8567 created on the junction of the pipes.
8568 The extremities of the main pipe are located on junctions points P1 and P2.
8569 The extremity of the incident pipe is located on junction point P3.
8570 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8571 the main plane of the T-shape is XOY.
8574 theR1 Internal radius of main pipe
8575 theW1 Width of main pipe
8576 theL1 Half-length of main pipe
8577 theR2 Internal radius of incident pipe (R2 < R1)
8578 theW2 Width of incident pipe (R2+W2 < R1+W1)
8579 theL2 Half-length of incident pipe
8580 theH Height of the chamfer.
8581 theW Width of the chamfer.
8582 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8583 theP1 1st junction point of main pipe
8584 theP2 2nd junction point of main pipe
8585 theP3 Junction point of incident pipe
8588 List of GEOM_Object, containing the created shape and propagation groups.
8591 # create PipeTShape with chamfer object
8592 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8593 # create PipeTShape with chamfer object with position
8594 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8596 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8597 if (theP1 and theP2 and theP3):
8598 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8600 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8601 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8602 if Parameters: anObj[0].SetParameters(Parameters)
8605 ## Create a T-shape object with fillet and with specified caracteristics for the main
8606 # and the incident pipes (radius, width, half-length). The fillet is
8607 # created on the junction of the pipes.
8608 # The extremities of the main pipe are located on junctions points P1 and P2.
8609 # The extremity of the incident pipe is located on junction point P3.
8610 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8611 # the main plane of the T-shape is XOY.
8612 # @param theR1 Internal radius of main pipe
8613 # @param theW1 Width of main pipe
8614 # @param theL1 Half-length of main pipe
8615 # @param theR2 Internal radius of incident pipe (R2 < R1)
8616 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8617 # @param theL2 Half-length of incident pipe
8618 # @param theRF Radius of curvature of fillet.
8619 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8620 # @param theP1 1st junction point of main pipe
8621 # @param theP2 2nd junction point of main pipe
8622 # @param theP3 Junction point of incident pipe
8623 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8625 # @ref tui_creation_pipetshape "Example"
8626 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8628 Create a T-shape object with fillet and with specified caracteristics for the main
8629 and the incident pipes (radius, width, half-length). The fillet is
8630 created on the junction of the pipes.
8631 The extremities of the main pipe are located on junctions points P1 and P2.
8632 The extremity of the incident pipe is located on junction point P3.
8635 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8636 the main plane of the T-shape is XOY.
8637 theR1 Internal radius of main pipe
8638 theW1 Width of main pipe
8639 heL1 Half-length of main pipe
8640 theR2 Internal radius of incident pipe (R2 < R1)
8641 theW2 Width of incident pipe (R2+W2 < R1+W1)
8642 theL2 Half-length of incident pipe
8643 theRF Radius of curvature of fillet.
8644 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8645 theP1 1st junction point of main pipe
8646 theP2 2nd junction point of main pipe
8647 theP3 Junction point of incident pipe
8650 List of GEOM_Object, containing the created shape and propagation groups.
8653 # create PipeTShape with fillet object
8654 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
8655 # create PipeTShape with fillet object with position
8656 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
8659 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
8660 if (theP1 and theP2 and theP3):
8661 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
8663 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
8664 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
8665 if Parameters: anObj[0].SetParameters(Parameters)
8668 ## This function allows creating a disk already divided into blocks. It
8669 # can be used to create divided pipes for later meshing in hexaedra.
8670 # @param theR Radius of the disk
8671 # @param theOrientation Orientation of the plane on which the disk will be built
8672 # 1 = XOY, 2 = OYZ, 3 = OZX
8673 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8674 # @return New GEOM_Object, containing the created shape.
8676 # @ref tui_creation_divideddisk "Example"
8677 def MakeDividedDisk(self, theR, theOrientation, thePattern ):
8678 theR, Parameters = ParseParameters(theR)
8679 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
8680 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
8681 if Parameters: anObj.SetParameters(Parameters)
8684 ## This function allows creating a disk already divided into blocks. It
8685 # can be used to create divided pipes for later meshing in hexaedra.
8686 # @param theCenter Center of the disk
8687 # @param theVector Normal vector to the plane of the created disk
8688 # @param theRadius Radius of the disk
8689 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8690 # @return New GEOM_Object, containing the created shape.
8692 # @ref tui_creation_divideddisk "Example"
8693 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
8694 theRadius, Parameters = ParseParameters(theRadius)
8695 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
8696 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
8697 if Parameters: anObj.SetParameters(Parameters)
8700 ## Builds a cylinder prepared for hexa meshes
8701 # @param theR Radius of the cylinder
8702 # @param theH Height of the cylinder
8703 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8704 # @return New GEOM_Object, containing the created shape.
8706 # @ref tui_creation_dividedcylinder "Example"
8707 def MakeDividedCylinder(self, theR, theH, thePattern):
8708 theR, theH, Parameters = ParseParameters(theR, theH)
8709 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
8710 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
8711 if Parameters: anObj.SetParameters(Parameters)
8714 #@@ insert new functions before this line @@ do not remove this line @@#
8716 # end of l4_advanced
8719 ## Create a copy of the given object
8721 # @param theOriginal geometry object for copy
8722 # @return unique object identifier
8723 # @ingroup l1_geompy_auxiliary
8724 # @ref swig_MakeCopy "Example"
8725 def MakeCopy(self,theOriginal):
8727 Create a copy of the given object
8730 theOriginal geometry object for copy
8733 unique object identifier
8735 Example of usage: Copy = geompy.MakeCopy(Box)
8737 # Example: see GEOM_TestAll.py
8738 anObj = self.InsertOp.MakeCopy(theOriginal)
8739 RaiseIfFailed("MakeCopy", self.InsertOp)
8742 ## Add Path to load python scripts from
8743 # @param Path a path to load python scripts from
8744 # @ingroup l1_geompy_auxiliary
8745 def addPath(self,Path):
8747 Add Path to load python scripts from
8750 Path a path to load python scripts from
8752 if (sys.path.count(Path) < 1):
8753 sys.path.append(Path)
8757 ## Load marker texture from the file
8758 # @param Path a path to the texture file
8759 # @return unique texture identifier
8760 # @ingroup l1_geompy_auxiliary
8761 def LoadTexture(self, Path):
8763 Load marker texture from the file
8766 Path a path to the texture file
8769 unique texture identifier
8771 # Example: see GEOM_TestAll.py
8772 ID = self.InsertOp.LoadTexture(Path)
8773 RaiseIfFailed("LoadTexture", self.InsertOp)
8776 ## Get entry of the object
8777 # @param obj geometry object
8778 # @return unique object identifier
8779 # @ingroup l1_geompy_auxiliary
8780 def getObjectID(self, obj):
8782 Get entry of the object
8788 unique object identifier
8791 entry = salome.ObjectToID(obj)
8792 if entry is not None:
8793 lst = entry.split(":")
8795 ID = lst[-1] # -1 means last item in the list
8801 ## Add marker texture. @a Width and @a Height parameters
8802 # specify width and height of the texture in pixels.
8803 # If @a RowData is @c True, @a Texture parameter should represent texture data
8804 # packed into the byte array. If @a RowData is @c False (default), @a Texture
8805 # parameter should be unpacked string, in which '1' symbols represent opaque
8806 # pixels and '0' represent transparent pixels of the texture bitmap.
8808 # @param Width texture width in pixels
8809 # @param Height texture height in pixels
8810 # @param Texture texture data
8811 # @param RowData if @c True, @a Texture data are packed in the byte stream
8812 # @return unique texture identifier
8813 # @ingroup l1_geompy_auxiliary
8814 def AddTexture(self, Width, Height, Texture, RowData=False):
8816 Add marker texture. Width and Height parameters
8817 specify width and height of the texture in pixels.
8818 If RowData is True, Texture parameter should represent texture data
8819 packed into the byte array. If RowData is False (default), Texture
8820 parameter should be unpacked string, in which '1' symbols represent opaque
8821 pixels and '0' represent transparent pixels of the texture bitmap.
8824 Width texture width in pixels
8825 Height texture height in pixels
8826 Texture texture data
8827 RowData if True, Texture data are packed in the byte stream
8830 return unique texture identifier
8832 if not RowData: Texture = PackData(Texture)
8833 ID = self.InsertOp.AddTexture(Width, Height, Texture)
8834 RaiseIfFailed("AddTexture", self.InsertOp)
8838 #Register the new proxy for GEOM_Gen
8839 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)