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 aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
490 if doRestoreSubShapes:
491 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
492 theFindMethod, theInheritFirstArg, True )
494 print "addToStudy() failed"
496 return aShape.GetStudyEntry()
498 ## Publish in study aShape with name aName as sub-object of previously published aFather
499 # \param aFather previously published object
500 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
501 # \param aName the name for the shape
503 # \return study entry of the published shape in form of string
504 # @ref swig_all_addtostudyInFather "Example"
505 def addToStudyInFather(self, aFather, aShape, aName):
507 Publish in study aShape with name aName as sub-object of previously published aFather
510 aFather previously published object
511 aShape the shape to be published as sub-object of aFather
512 aName the name for the shape
515 study entry of the published shape in form of string
517 # Example: see GEOM_TestAll.py
519 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
520 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
522 print "addToStudyInFather() failed"
524 return aShape.GetStudyEntry()
526 ## Unpublish object in study
528 # \param obj the object to be unpublished
529 def hideInStudy(self, obj):
531 Unpublish object in study
534 obj the object to be unpublished
536 ior = salome.orb.object_to_string(obj)
537 aSObject = self.myStudy.FindObjectIOR(ior)
538 if aSObject is not None:
539 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
540 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
541 drwAttribute.SetDrawable(False)
544 # end of l1_geompy_auxiliary
547 ## @addtogroup l3_restore_ss
550 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
551 # To be used from python scripts out of addToStudy() (non-default usage)
552 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
553 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
554 # If this list is empty, all operation arguments will be published
555 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
556 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
557 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
558 # Do not publish sub-shapes in place of arguments, but only
559 # in place of sub-shapes of the first argument,
560 # because the whole shape corresponds to the first argument.
561 # Mainly to be used after transformations, but it also can be
562 # usefull after partition with one object shape, and some other
563 # operations, where only the first argument has to be considered.
564 # If theObject has only one argument shape, this flag is automatically
565 # considered as True, not regarding really passed value.
566 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
567 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
568 # \return list of published sub-shapes
570 # @ref tui_restore_prs_params "Example"
571 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
572 theInheritFirstArg=False, theAddPrefix=True):
574 Publish sub-shapes, standing for arguments and sub-shapes of arguments
575 To be used from python scripts out of geompy.addToStudy (non-default usage)
578 theObject published GEOM.GEOM_Object, arguments of which will be published
579 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
580 If this list is empty, all operation arguments will be published
581 theFindMethod method to search sub-shapes, corresponding to arguments and
582 their sub-shapes. Value from enumeration GEOM.find_shape_method.
583 theInheritFirstArg set properties of the first argument for theObject.
584 Do not publish sub-shapes in place of arguments, but only
585 in place of sub-shapes of the first argument,
586 because the whole shape corresponds to the first argument.
587 Mainly to be used after transformations, but it also can be
588 usefull after partition with one object shape, and some other
589 operations, where only the first argument has to be considered.
590 If theObject has only one argument shape, this flag is automatically
591 considered as True, not regarding really passed value.
592 theAddPrefix add prefix "from_" to names of restored sub-shapes,
593 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
595 list of published sub-shapes
597 # Example: see GEOM_TestAll.py
598 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
599 theFindMethod, theInheritFirstArg, theAddPrefix)
601 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
602 # To be used from python scripts out of addToStudy() (non-default usage)
603 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
604 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
605 # If this list is empty, all operation arguments will be published
606 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
607 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
608 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
609 # Do not publish sub-shapes in place of arguments, but only
610 # in place of sub-shapes of the first argument,
611 # because the whole shape corresponds to the first argument.
612 # Mainly to be used after transformations, but it also can be
613 # usefull after partition with one object shape, and some other
614 # operations, where only the first argument has to be considered.
615 # If theObject has only one argument shape, this flag is automatically
616 # considered as True, not regarding really passed value.
617 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
618 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
619 # \return list of published sub-shapes
621 # @ref tui_restore_prs_params "Example"
622 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
623 theInheritFirstArg=False, theAddPrefix=True):
625 Publish sub-shapes, standing for arguments and sub-shapes of arguments
626 To be used from python scripts out of geompy.addToStudy() (non-default usage)
629 theObject published GEOM.GEOM_Object, arguments of which will be published
630 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
631 If this list is empty, all operation arguments will be published
632 theFindMethod method to search sub-shapes, corresponding to arguments and
633 their sub-shapes. Value from enumeration GEOM::find_shape_method.
634 theInheritFirstArg set properties of the first argument for theObject.
635 Do not publish sub-shapes in place of arguments, but only
636 in place of sub-shapes of the first argument,
637 because the whole shape corresponds to the first argument.
638 Mainly to be used after transformations, but it also can be
639 usefull after partition with one object shape, and some other
640 operations, where only the first argument has to be considered.
641 If theObject has only one argument shape, this flag is automatically
642 considered as True, not regarding really passed value.
643 theAddPrefix add prefix "from_" to names of restored sub-shapes,
644 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
647 list of published sub-shapes
649 # Example: see GEOM_TestAll.py
650 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
651 theFindMethod, theInheritFirstArg, theAddPrefix)
653 # end of l3_restore_ss
656 ## @addtogroup l3_basic_go
659 ## Create point by three coordinates.
660 # @param theX The X coordinate of the point.
661 # @param theY The Y coordinate of the point.
662 # @param theZ The Z coordinate of the point.
663 # @return New GEOM.GEOM_Object, containing the created point.
665 # @ref tui_creation_point "Example"
666 def MakeVertex(self, theX, theY, theZ):
668 Create point by three coordinates.
671 theX The X coordinate of the point.
672 theY The Y coordinate of the point.
673 theZ The Z coordinate of the point.
676 New GEOM.GEOM_Object, containing the created point.
678 # Example: see GEOM_TestAll.py
679 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
680 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
681 RaiseIfFailed("MakePointXYZ", self.BasicOp)
682 anObj.SetParameters(Parameters)
685 ## Create a point, distant from the referenced point
686 # on the given distances along the coordinate axes.
687 # @param theReference The referenced point.
688 # @param theX Displacement from the referenced point along OX axis.
689 # @param theY Displacement from the referenced point along OY axis.
690 # @param theZ Displacement from the referenced point along OZ axis.
691 # @return New GEOM.GEOM_Object, containing the created point.
693 # @ref tui_creation_point "Example"
694 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
696 Create a point, distant from the referenced point
697 on the given distances along the coordinate axes.
700 theReference The referenced point.
701 theX Displacement from the referenced point along OX axis.
702 theY Displacement from the referenced point along OY axis.
703 theZ Displacement from the referenced point along OZ axis.
706 New GEOM.GEOM_Object, containing the created point.
708 # Example: see GEOM_TestAll.py
709 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
710 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
711 RaiseIfFailed("MakePointWithReference", self.BasicOp)
712 anObj.SetParameters(Parameters)
715 ## Create a point, corresponding to the given parameter on the given curve.
716 # @param theRefCurve The referenced curve.
717 # @param theParameter Value of parameter on the referenced curve.
718 # @return New GEOM.GEOM_Object, containing the created point.
720 # @ref tui_creation_point "Example"
721 def MakeVertexOnCurve(self,theRefCurve, theParameter):
723 Create a point, corresponding to the given parameter on the given curve.
726 theRefCurve The referenced curve.
727 theParameter Value of parameter on the referenced curve.
730 New GEOM.GEOM_Object, containing the created point.
733 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
735 # Example: see GEOM_TestAll.py
736 theParameter, Parameters = ParseParameters(theParameter)
737 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
738 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
739 anObj.SetParameters(Parameters)
742 ## Create a point by projection give coordinates on the given curve
743 # @param theRefCurve The referenced curve.
744 # @param theX X-coordinate in 3D space
745 # @param theY Y-coordinate in 3D space
746 # @param theZ Z-coordinate in 3D space
747 # @return New GEOM.GEOM_Object, containing the created point.
749 # @ref tui_creation_point "Example"
750 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
752 Create a point by projection give coordinates on the given curve
755 theRefCurve The referenced curve.
756 theX X-coordinate in 3D space
757 theY Y-coordinate in 3D space
758 theZ Z-coordinate in 3D space
761 New GEOM.GEOM_Object, containing the created point.
764 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
766 # Example: see GEOM_TestAll.py
767 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
768 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
769 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
770 anObj.SetParameters(Parameters)
773 ## Create a point, corresponding to the given length on the given curve.
774 # @param theRefCurve The referenced curve.
775 # @param theLength Length on the referenced curve. It can be negative.
776 # @param theStartPoint Point allowing to choose the direction for the calculation
777 # of the length. If None, start from the first point of theRefCurve.
778 # @return New GEOM.GEOM_Object, containing the created point.
780 # @ref tui_creation_point "Example"
781 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
783 Create a point, corresponding to the given length on the given curve.
786 theRefCurve The referenced curve.
787 theLength Length on the referenced curve. It can be negative.
788 theStartPoint Point allowing to choose the direction for the calculation
789 of the length. If None, start from the first point of theRefCurve.
792 New GEOM.GEOM_Object, containing the created point.
794 # Example: see GEOM_TestAll.py
795 theLength, Parameters = ParseParameters(theLength)
796 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
797 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
798 anObj.SetParameters(Parameters)
801 ## Create a point, corresponding to the given parameters on the
803 # @param theRefSurf The referenced surface.
804 # @param theUParameter Value of U-parameter on the referenced surface.
805 # @param theVParameter Value of V-parameter on the referenced surface.
806 # @return New GEOM.GEOM_Object, containing the created point.
808 # @ref swig_MakeVertexOnSurface "Example"
809 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
811 Create a point, corresponding to the given parameters on the
815 theRefSurf The referenced surface.
816 theUParameter Value of U-parameter on the referenced surface.
817 theVParameter Value of V-parameter on the referenced surface.
820 New GEOM.GEOM_Object, containing the created point.
823 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object, Double, Double)->GEOM_Object
825 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
826 # Example: see GEOM_TestAll.py
827 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
828 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
829 anObj.SetParameters(Parameters);
832 ## Create a point by projection give coordinates on the given surface
833 # @param theRefSurf The referenced surface.
834 # @param theX X-coordinate in 3D space
835 # @param theY Y-coordinate in 3D space
836 # @param theZ Z-coordinate in 3D space
837 # @return New GEOM.GEOM_Object, containing the created point.
839 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
840 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
842 Create a point by projection give coordinates on the given surface
845 theRefSurf The referenced surface.
846 theX X-coordinate in 3D space
847 theY Y-coordinate in 3D space
848 theZ Z-coordinate in 3D space
851 New GEOM.GEOM_Object, containing the created point.
854 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object, Double, Double, Double)->GEOM_Object
856 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
857 # Example: see GEOM_TestAll.py
858 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
859 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
860 anObj.SetParameters(Parameters);
863 ## Create a point on intersection of two lines.
864 # @param theRefLine1, theRefLine2 The referenced lines.
865 # @return New GEOM.GEOM_Object, containing the created point.
867 # @ref swig_MakeVertexOnLinesIntersection "Example"
868 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
870 Create a point on intersection of two lines.
873 theRefLine1, theRefLine2 The referenced lines.
876 New GEOM.GEOM_Object, containing the created point.
878 # Example: see GEOM_TestAll.py
879 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
880 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
883 ## Create a tangent, corresponding to the given parameter on the given curve.
884 # @param theRefCurve The referenced curve.
885 # @param theParameter Value of parameter on the referenced curve.
886 # @return New GEOM.GEOM_Object, containing the created tangent.
888 # @ref swig_MakeTangentOnCurve "Example"
889 def MakeTangentOnCurve(self, theRefCurve, theParameter):
891 Create a tangent, corresponding to the given parameter on the given curve.
894 theRefCurve The referenced curve.
895 theParameter Value of parameter on the referenced curve.
898 New GEOM.GEOM_Object, containing the created tangent.
901 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object, Double)->GEOM_Object
903 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
904 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
907 ## Create a tangent plane, corresponding to the given parameter on the given face.
908 # @param theFace The face for which tangent plane should be built.
909 # @param theParameterV vertical value of the center point (0.0 - 1.0).
910 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
911 # @param theTrimSize the size of plane.
912 # @return New GEOM.GEOM_Object, containing the created tangent.
914 # @ref swig_MakeTangentPlaneOnFace "Example"
915 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
917 Create a tangent plane, corresponding to the given parameter on the given face.
920 theFace The face for which tangent plane should be built.
921 theParameterV vertical value of the center point (0.0 - 1.0).
922 theParameterU horisontal value of the center point (0.0 - 1.0).
923 theTrimSize the size of plane.
926 New GEOM.GEOM_Object, containing the created tangent.
929 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
931 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
932 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
935 ## Create a vector with the given components.
936 # @param theDX X component of the vector.
937 # @param theDY Y component of the vector.
938 # @param theDZ Z component of the vector.
939 # @return New GEOM.GEOM_Object, containing the created vector.
941 # @ref tui_creation_vector "Example"
942 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
944 Create a vector with the given components.
947 theDX X component of the vector.
948 theDY Y component of the vector.
949 theDZ Z component of the vector.
952 New GEOM.GEOM_Object, containing the created vector.
954 # Example: see GEOM_TestAll.py
955 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
956 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
957 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
958 anObj.SetParameters(Parameters)
961 ## Create a vector between two points.
962 # @param thePnt1 Start point for the vector.
963 # @param thePnt2 End point for the vector.
964 # @return New GEOM.GEOM_Object, containing the created vector.
966 # @ref tui_creation_vector "Example"
967 def MakeVector(self,thePnt1, thePnt2):
969 Create a vector between two points.
972 thePnt1 Start point for the vector.
973 thePnt2 End point for the vector.
976 New GEOM.GEOM_Object, containing the created vector.
978 # Example: see GEOM_TestAll.py
979 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
980 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
983 ## Create a line, passing through the given point
984 # and parrallel to the given direction
985 # @param thePnt Point. The resulting line will pass through it.
986 # @param theDir Direction. The resulting line will be parallel to it.
987 # @return New GEOM.GEOM_Object, containing the created line.
989 # @ref tui_creation_line "Example"
990 def MakeLine(self,thePnt, theDir):
992 Create a line, passing through the given point
993 and parrallel to the given direction
996 thePnt Point. The resulting line will pass through it.
997 theDir Direction. The resulting line will be parallel to it.
1000 New GEOM.GEOM_Object, containing the created line.
1002 # Example: see GEOM_TestAll.py
1003 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1004 RaiseIfFailed("MakeLine", self.BasicOp)
1007 ## Create a line, passing through the given points
1008 # @param thePnt1 First of two points, defining the line.
1009 # @param thePnt2 Second of two points, defining the line.
1010 # @return New GEOM.GEOM_Object, containing the created line.
1012 # @ref tui_creation_line "Example"
1013 def MakeLineTwoPnt(self,thePnt1, thePnt2):
1015 Create a line, passing through the given points
1018 thePnt1 First of two points, defining the line.
1019 thePnt2 Second of two points, defining the line.
1022 New GEOM.GEOM_Object, containing the created line.
1024 # Example: see GEOM_TestAll.py
1025 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1026 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1029 ## Create a line on two faces intersection.
1030 # @param theFace1 First of two faces, defining the line.
1031 # @param theFace2 Second of two faces, defining the line.
1032 # @return New GEOM.GEOM_Object, containing the created line.
1034 # @ref swig_MakeLineTwoFaces "Example"
1035 def MakeLineTwoFaces(self, theFace1, theFace2):
1037 Create a line on two faces intersection.
1040 theFace1 First of two faces, defining the line.
1041 theFace2 Second of two faces, defining the line.
1044 New GEOM.GEOM_Object, containing the created line.
1046 # Example: see GEOM_TestAll.py
1047 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1048 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1051 ## Create a plane, passing through the given point
1052 # and normal to the given vector.
1053 # @param thePnt Point, the plane has to pass through.
1054 # @param theVec Vector, defining the plane normal direction.
1055 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1056 # @return New GEOM.GEOM_Object, containing the created plane.
1058 # @ref tui_creation_plane "Example"
1059 def MakePlane(self,thePnt, theVec, theTrimSize):
1061 Create a plane, passing through the given point
1062 and normal to the given vector.
1065 thePnt Point, the plane has to pass through.
1066 theVec Vector, defining the plane normal direction.
1067 theTrimSize Half size of a side of quadrangle face, representing the plane.
1070 New GEOM.GEOM_Object, containing the created plane.
1072 # Example: see GEOM_TestAll.py
1073 theTrimSize, Parameters = ParseParameters(theTrimSize);
1074 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1075 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1076 anObj.SetParameters(Parameters)
1079 ## Create a plane, passing through the three given points
1080 # @param thePnt1 First of three points, defining the plane.
1081 # @param thePnt2 Second of three points, defining the plane.
1082 # @param thePnt3 Fird of three points, defining the plane.
1083 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1084 # @return New GEOM.GEOM_Object, containing the created plane.
1086 # @ref tui_creation_plane "Example"
1087 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1089 Create a plane, passing through the three given points
1092 thePnt1 First of three points, defining the plane.
1093 thePnt2 Second of three points, defining the plane.
1094 thePnt3 Fird of three points, defining the plane.
1095 theTrimSize Half size of a side of quadrangle face, representing the plane.
1098 New GEOM.GEOM_Object, containing the created plane.
1100 # Example: see GEOM_TestAll.py
1101 theTrimSize, Parameters = ParseParameters(theTrimSize);
1102 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1103 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1104 anObj.SetParameters(Parameters)
1107 ## Create a plane, similar to the existing one, but with another size of representing face.
1108 # @param theFace Referenced plane or LCS(Marker).
1109 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1110 # @return New GEOM.GEOM_Object, containing the created plane.
1112 # @ref tui_creation_plane "Example"
1113 def MakePlaneFace(self,theFace, theTrimSize):
1115 Create a plane, similar to the existing one, but with another size of representing face.
1118 theFace Referenced plane or LCS(Marker).
1119 theTrimSize New half size of a side of quadrangle face, representing the plane.
1122 New GEOM.GEOM_Object, containing the created plane.
1124 # Example: see GEOM_TestAll.py
1125 theTrimSize, Parameters = ParseParameters(theTrimSize);
1126 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1127 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1128 anObj.SetParameters(Parameters)
1131 ## Create a plane, passing through the 2 vectors
1132 # with center in a start point of the first vector.
1133 # @param theVec1 Vector, defining center point and plane direction.
1134 # @param theVec2 Vector, defining the plane normal direction.
1135 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1136 # @return New GEOM.GEOM_Object, containing the created plane.
1138 # @ref tui_creation_plane "Example"
1139 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1141 Create a plane, passing through the 2 vectors
1142 with center in a start point of the first vector.
1145 theVec1 Vector, defining center point and plane direction.
1146 theVec2 Vector, defining the plane normal direction.
1147 theTrimSize Half size of a side of quadrangle face, representing the plane.
1150 New GEOM.GEOM_Object, containing the created plane.
1152 # Example: see GEOM_TestAll.py
1153 theTrimSize, Parameters = ParseParameters(theTrimSize);
1154 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1155 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1156 anObj.SetParameters(Parameters)
1159 ## Create a plane, based on a Local coordinate system.
1160 # @param theLCS coordinate system, defining plane.
1161 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1162 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1163 # @return New GEOM.GEOM_Object, containing the created plane.
1165 # @ref tui_creation_plane "Example"
1166 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1168 Create a plane, based on a Local coordinate system.
1171 theLCS coordinate system, defining plane.
1172 theTrimSize Half size of a side of quadrangle face, representing the plane.
1173 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1176 New GEOM.GEOM_Object, containing the created plane.
1178 # Example: see GEOM_TestAll.py
1179 theTrimSize, Parameters = ParseParameters(theTrimSize);
1180 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1181 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1182 anObj.SetParameters(Parameters)
1185 ## Create a local coordinate system.
1186 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1187 # @param XDX,XDY,XDZ Three components of OX direction
1188 # @param YDX,YDY,YDZ Three components of OY direction
1189 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1191 # @ref swig_MakeMarker "Example"
1192 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1194 Create a local coordinate system.
1197 OX,OY,OZ Three coordinates of coordinate system origin.
1198 XDX,XDY,XDZ Three components of OX direction
1199 YDX,YDY,YDZ Three components of OY direction
1202 New GEOM.GEOM_Object, containing the created coordinate system.
1204 # Example: see GEOM_TestAll.py
1205 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1206 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1207 RaiseIfFailed("MakeMarker", self.BasicOp)
1208 anObj.SetParameters(Parameters)
1211 ## Create a local coordinate system from shape.
1212 # @param theShape The initial shape to detect the coordinate system.
1213 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1215 # @ref tui_creation_lcs "Example"
1216 def MakeMarkerFromShape(self, theShape):
1218 Create a local coordinate system from shape.
1221 theShape The initial shape to detect the coordinate system.
1224 New GEOM.GEOM_Object, containing the created coordinate system.
1226 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1227 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1230 ## Create a local coordinate system from point and two vectors.
1231 # @param theOrigin Point of coordinate system origin.
1232 # @param theXVec Vector of X direction
1233 # @param theYVec Vector of Y direction
1234 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1236 # @ref tui_creation_lcs "Example"
1237 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1239 Create a local coordinate system from point and two vectors.
1242 theOrigin Point of coordinate system origin.
1243 theXVec Vector of X direction
1244 theYVec Vector of Y direction
1247 New GEOM.GEOM_Object, containing the created coordinate system.
1250 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1251 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1254 # end of l3_basic_go
1257 ## @addtogroup l4_curves
1260 ## Create an arc of circle, passing through three given points.
1261 # @param thePnt1 Start point of the arc.
1262 # @param thePnt2 Middle point of the arc.
1263 # @param thePnt3 End point of the arc.
1264 # @return New GEOM.GEOM_Object, containing the created arc.
1266 # @ref swig_MakeArc "Example"
1267 def MakeArc(self,thePnt1, thePnt2, thePnt3):
1269 Create an arc of circle, passing through three given points.
1272 thePnt1 Start point of the arc.
1273 thePnt2 Middle point of the arc.
1274 thePnt3 End point of the arc.
1277 New GEOM.GEOM_Object, containing the created arc.
1279 # Example: see GEOM_TestAll.py
1280 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1281 RaiseIfFailed("MakeArc", self.CurvesOp)
1284 ## Create an arc of circle from a center and 2 points.
1285 # @param thePnt1 Center of the arc
1286 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1287 # @param thePnt3 End point of the arc (Gives also a direction)
1288 # @param theSense Orientation of the arc
1289 # @return New GEOM.GEOM_Object, containing the created arc.
1291 # @ref swig_MakeArc "Example"
1292 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1294 Create an arc of circle from a center and 2 points.
1297 thePnt1 Center of the arc
1298 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1299 thePnt3 End point of the arc (Gives also a direction)
1300 theSense Orientation of the arc
1303 New GEOM.GEOM_Object, containing the created arc.
1305 # Example: see GEOM_TestAll.py
1306 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1307 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1310 ## Create an arc of ellipse, of center and two points.
1311 # @param theCenter Center of the arc.
1312 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1313 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1314 # @return New GEOM.GEOM_Object, containing the created arc.
1316 # @ref swig_MakeArc "Example"
1317 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1319 Create an arc of ellipse, of center and two points.
1322 theCenter Center of the arc.
1323 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1324 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1327 New GEOM.GEOM_Object, containing the created arc.
1329 # Example: see GEOM_TestAll.py
1330 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1331 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1334 ## Create a circle with given center, normal vector and radius.
1335 # @param thePnt Circle center.
1336 # @param theVec Vector, normal to the plane of the circle.
1337 # @param theR Circle radius.
1338 # @return New GEOM.GEOM_Object, containing the created circle.
1340 # @ref tui_creation_circle "Example"
1341 def MakeCircle(self, thePnt, theVec, theR):
1343 Create a circle with given center, normal vector and radius.
1346 thePnt Circle center.
1347 theVec Vector, normal to the plane of the circle.
1351 New GEOM.GEOM_Object, containing the created circle.
1353 # Example: see GEOM_TestAll.py
1354 theR, Parameters = ParseParameters(theR)
1355 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1356 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1357 anObj.SetParameters(Parameters)
1360 ## Create a circle with given radius.
1361 # Center of the circle will be in the origin of global
1362 # coordinate system and normal vector will be codirected with Z axis
1363 # @param theR Circle radius.
1364 # @return New GEOM.GEOM_Object, containing the created circle.
1365 def MakeCircleR(self, theR):
1367 Create a circle with given radius.
1368 Center of the circle will be in the origin of global
1369 coordinate system and normal vector will be codirected with Z axis
1375 New GEOM.GEOM_Object, containing the created circle.
1377 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1378 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1381 ## Create a circle, passing through three given points
1382 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1383 # @return New GEOM.GEOM_Object, containing the created circle.
1385 # @ref tui_creation_circle "Example"
1386 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1388 Create a circle, passing through three given points
1391 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1394 New GEOM.GEOM_Object, containing the created circle.
1396 # Example: see GEOM_TestAll.py
1397 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1398 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1401 ## Create a circle, with given point1 as center,
1402 # passing through the point2 as radius and laying in the plane,
1403 # defined by all three given points.
1404 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1405 # @return New GEOM.GEOM_Object, containing the created circle.
1407 # @ref swig_MakeCircle "Example"
1408 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1410 Create a circle, with given point1 as center,
1411 passing through the point2 as radius and laying in the plane,
1412 defined by all three given points.
1415 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1418 New GEOM.GEOM_Object, containing the created circle.
1420 # Example: see GEOM_example6.py
1421 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1422 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1425 ## Create an ellipse with given center, normal vector and radiuses.
1426 # @param thePnt Ellipse center.
1427 # @param theVec Vector, normal to the plane of the ellipse.
1428 # @param theRMajor Major ellipse radius.
1429 # @param theRMinor Minor ellipse radius.
1430 # @param theVecMaj Vector, direction of the ellipse's main axis.
1431 # @return New GEOM.GEOM_Object, containing the created ellipse.
1433 # @ref tui_creation_ellipse "Example"
1434 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1436 Create an ellipse with given center, normal vector and radiuses.
1439 thePnt Ellipse center.
1440 theVec Vector, normal to the plane of the ellipse.
1441 theRMajor Major ellipse radius.
1442 theRMinor Minor ellipse radius.
1443 theVecMaj Vector, direction of the ellipse's main axis.
1446 New GEOM.GEOM_Object, containing the created ellipse.
1448 # Example: see GEOM_TestAll.py
1449 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1450 if theVecMaj is not None:
1451 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1453 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1455 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1456 anObj.SetParameters(Parameters)
1459 ## Create an ellipse with given radiuses.
1460 # Center of the ellipse will be in the origin of global
1461 # coordinate system and normal vector will be codirected with Z axis
1462 # @param theRMajor Major ellipse radius.
1463 # @param theRMinor Minor ellipse radius.
1464 # @return New GEOM.GEOM_Object, containing the created ellipse.
1465 def MakeEllipseRR(self, theRMajor, theRMinor):
1467 Create an ellipse with given radiuses.
1468 Center of the ellipse will be in the origin of global
1469 coordinate system and normal vector will be codirected with Z axis
1472 theRMajor Major ellipse radius.
1473 theRMinor Minor ellipse radius.
1476 New GEOM.GEOM_Object, containing the created ellipse.
1478 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1479 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1482 ## Create a polyline on the set of points.
1483 # @param thePoints Sequence of points for the polyline.
1484 # @param theIsClosed If True, build a closed wire.
1485 # @return New GEOM.GEOM_Object, containing the created polyline.
1487 # @ref tui_creation_curve "Example"
1488 def MakePolyline(self, thePoints, theIsClosed=False):
1490 Create a polyline on the set of points.
1493 thePoints Sequence of points for the polyline.
1494 theIsClosed If True, build a closed wire.
1497 New GEOM.GEOM_Object, containing the created polyline.
1499 # Example: see GEOM_TestAll.py
1500 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1501 RaiseIfFailed("MakePolyline", self.CurvesOp)
1504 ## Create bezier curve on the set of points.
1505 # @param thePoints Sequence of points for the bezier curve.
1506 # @param theIsClosed If True, build a closed curve.
1507 # @return New GEOM.GEOM_Object, containing the created bezier curve.
1509 # @ref tui_creation_curve "Example"
1510 def MakeBezier(self, thePoints, theIsClosed=False):
1512 Create bezier curve on the set of points.
1515 thePoints Sequence of points for the bezier curve.
1516 theIsClosed If True, build a closed curve.
1519 New GEOM.GEOM_Object, containing the created bezier curve.
1521 # Example: see GEOM_TestAll.py
1522 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1523 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1526 ## Create B-Spline curve on the set of points.
1527 # @param thePoints Sequence of points for the B-Spline curve.
1528 # @param theIsClosed If True, build a closed curve.
1529 # @param theDoReordering If TRUE, the algo does not follow the order of
1530 # \a thePoints but searches for the closest vertex.
1531 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1533 # @ref tui_creation_curve "Example"
1534 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1536 Create B-Spline curve on the set of points.
1539 thePoints Sequence of points for the B-Spline curve.
1540 theIsClosed If True, build a closed curve.
1541 theDoReordering If True, the algo does not follow the order of
1542 thePoints but searches for the closest vertex.
1545 New GEOM.GEOM_Object, containing the created B-Spline curve.
1547 # Example: see GEOM_TestAll.py
1548 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1549 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1553 ## Creates a curve using the parametric definition of the basic points.
1554 # @param thexExpr parametric equation of the coordinates X.
1555 # @param theyExpr parametric equation of the coordinates Y.
1556 # @param thezExpr parametric equation of the coordinates Z.
1557 # @param theParamMin the minimal value of the parameter.
1558 # @param theParamMax the maximum value of the parameter.
1559 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1560 # @param theCurveType the type of the curve.
1561 # @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.
1562 # @return New GEOM.GEOM_Object, containing the created curve.
1564 # @ref tui_creation_curve "Example"
1565 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1566 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1568 Creates a curve using the parametric definition of the basic points.
1571 thexExpr parametric equation of the coordinates X.
1572 theyExpr parametric equation of the coordinates Y.
1573 thezExpr parametric equation of the coordinates Z.
1574 theParamMin the minimal value of the parameter.
1575 theParamMax the maximum value of the parameter.
1576 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1577 theCurveType the type of the curve.
1578 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1579 method is used which can lead to a bug.
1582 New GEOM.GEOM_Object, containing the created curve.
1584 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1586 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1588 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1589 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1590 anObj.SetParameters(Parameters)
1598 ## @addtogroup l3_sketcher
1601 ## Create a sketcher (wire or face), following the textual description,
1602 # passed through <VAR>theCommand</VAR> argument. \n
1603 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1604 # Format of the description string have to be the following:
1606 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1609 # - x1, y1 are coordinates of the first sketcher point (zero by default),
1611 # - "R angle" : Set the direction by angle
1612 # - "D dx dy" : Set the direction by DX & DY
1615 # - "TT x y" : Create segment by point at X & Y
1616 # - "T dx dy" : Create segment by point with DX & DY
1617 # - "L length" : Create segment by direction & Length
1618 # - "IX x" : Create segment by direction & Intersect. X
1619 # - "IY y" : Create segment by direction & Intersect. Y
1622 # - "C radius length" : Create arc by direction, radius and length(in degree)
1623 # - "AA x y": Create arc by point at X & Y
1624 # - "A dx dy" : Create arc by point with DX & DY
1625 # - "A dx dy" : Create arc by point with DX & DY
1626 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1627 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1628 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1629 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1632 # - "WW" : Close Wire (to finish)
1633 # - "WF" : Close Wire and build face (to finish)
1636 # - Flag1 (= reverse) is 0 or 2 ...
1637 # - if 0 the drawn arc is the one of lower angle (< Pi)
1638 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1641 # - Flag2 (= control tolerance) is 0 or 1 ...
1642 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1643 # - if 1 the wire is built only if the end point is on the arc
1644 # with a tolerance of 10^-7 on the distance else the creation fails
1646 # @param theCommand String, defining the sketcher in local
1647 # coordinates of the working plane.
1648 # @param theWorkingPlane Nine double values, defining origin,
1649 # OZ and OX directions of the working plane.
1650 # @return New GEOM.GEOM_Object, containing the created wire.
1652 # @ref tui_sketcher_page "Example"
1653 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1655 Create a sketcher (wire or face), following the textual description, passed
1656 through theCommand argument.
1657 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1658 Format of the description string have to be the following:
1659 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1661 - x1, y1 are coordinates of the first sketcher point (zero by default),
1663 - "R angle" : Set the direction by angle
1664 - "D dx dy" : Set the direction by DX & DY
1666 - "TT x y" : Create segment by point at X & Y
1667 - "T dx dy" : Create segment by point with DX & DY
1668 - "L length" : Create segment by direction & Length
1669 - "IX x" : Create segment by direction & Intersect. X
1670 - "IY y" : Create segment by direction & Intersect. Y
1672 - "C radius length" : Create arc by direction, radius and length(in degree)
1673 - "AA x y": Create arc by point at X & Y
1674 - "A dx dy" : Create arc by point with DX & DY
1675 - "A dx dy" : Create arc by point with DX & DY
1676 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1677 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1678 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1679 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1681 - "WW" : Close Wire (to finish)
1682 - "WF" : Close Wire and build face (to finish)
1684 - Flag1 (= reverse) is 0 or 2 ...
1685 - if 0 the drawn arc is the one of lower angle (< Pi)
1686 - if 2 the drawn arc ius the one of greater angle (> Pi)
1688 - Flag2 (= control tolerance) is 0 or 1 ...
1689 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1690 - if 1 the wire is built only if the end point is on the arc
1691 with a tolerance of 10^-7 on the distance else the creation fails
1694 theCommand String, defining the sketcher in local
1695 coordinates of the working plane.
1696 theWorkingPlane Nine double values, defining origin,
1697 OZ and OX directions of the working plane.
1700 New GEOM.GEOM_Object, containing the created wire.
1702 # Example: see GEOM_TestAll.py
1703 theCommand,Parameters = ParseSketcherCommand(theCommand)
1704 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1705 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1706 anObj.SetParameters(Parameters)
1709 ## Create a sketcher (wire or face), following the textual description,
1710 # passed through <VAR>theCommand</VAR> argument. \n
1711 # For format of the description string see MakeSketcher() method.\n
1712 # @param theCommand String, defining the sketcher in local
1713 # coordinates of the working plane.
1714 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1715 # @return New GEOM.GEOM_Object, containing the created wire.
1717 # @ref tui_sketcher_page "Example"
1718 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1720 Create a sketcher (wire or face), following the textual description,
1721 passed through theCommand argument.
1722 For format of the description string see geompy.MakeSketcher() method.
1725 theCommand String, defining the sketcher in local
1726 coordinates of the working plane.
1727 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1730 New GEOM.GEOM_Object, containing the created wire.
1732 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1733 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1736 ## Create a sketcher wire, following the numerical description,
1737 # passed through <VAR>theCoordinates</VAR> argument. \n
1738 # @param theCoordinates double values, defining points to create a wire,
1740 # @return New GEOM.GEOM_Object, containing the created wire.
1742 # @ref tui_sketcher_page "Example"
1743 def Make3DSketcher(self, theCoordinates):
1745 Create a sketcher wire, following the numerical description,
1746 passed through theCoordinates argument.
1749 theCoordinates double values, defining points to create a wire,
1753 New GEOM_Object, containing the created wire.
1755 theCoordinates,Parameters = ParseParameters(theCoordinates)
1756 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1757 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1758 anObj.SetParameters(Parameters)
1761 # end of l3_sketcher
1764 ## @addtogroup l3_3d_primitives
1767 ## Create a box by coordinates of two opposite vertices.
1769 # @param x1,y1,z1 double values, defining first point it.
1770 # @param x2,y2,z2 double values, defining first point it.
1772 # @return New GEOM.GEOM_Object, containing the created box.
1773 # @ref tui_creation_box "Example"
1774 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1776 Create a box by coordinates of two opposite vertices.
1779 x1,y1,z1 double values, defining first point.
1780 x2,y2,z2 double values, defining second point.
1783 New GEOM.GEOM_Object, containing the created box.
1785 # Example: see GEOM_TestAll.py
1786 pnt1 = self.MakeVertex(x1,y1,z1)
1787 pnt2 = self.MakeVertex(x2,y2,z2)
1788 return self.MakeBoxTwoPnt(pnt1,pnt2)
1790 ## Create a box with specified dimensions along the coordinate axes
1791 # and with edges, parallel to the coordinate axes.
1792 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1793 # @param theDX Length of Box edges, parallel to OX axis.
1794 # @param theDY Length of Box edges, parallel to OY axis.
1795 # @param theDZ Length of Box edges, parallel to OZ axis.
1796 # @return New GEOM.GEOM_Object, containing the created box.
1798 # @ref tui_creation_box "Example"
1799 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1801 Create a box with specified dimensions along the coordinate axes
1802 and with edges, parallel to the coordinate axes.
1803 Center of the box will be at point (DX/2, DY/2, DZ/2).
1806 theDX Length of Box edges, parallel to OX axis.
1807 theDY Length of Box edges, parallel to OY axis.
1808 theDZ Length of Box edges, parallel to OZ axis.
1811 New GEOM.GEOM_Object, containing the created box.
1813 # Example: see GEOM_TestAll.py
1814 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1815 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1816 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1817 anObj.SetParameters(Parameters)
1820 ## Create a box with two specified opposite vertices,
1821 # and with edges, parallel to the coordinate axes
1822 # @param thePnt1 First of two opposite vertices.
1823 # @param thePnt2 Second of two opposite vertices.
1824 # @return New GEOM.GEOM_Object, containing the created box.
1826 # @ref tui_creation_box "Example"
1827 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1829 Create a box with two specified opposite vertices,
1830 and with edges, parallel to the coordinate axes
1833 thePnt1 First of two opposite vertices.
1834 thePnt2 Second of two opposite vertices.
1837 New GEOM.GEOM_Object, containing the created box.
1839 # Example: see GEOM_TestAll.py
1840 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1841 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1844 ## Create a face with specified dimensions with edges parallel to coordinate axes.
1845 # @param theH height of Face.
1846 # @param theW width of Face.
1847 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1848 # @return New GEOM.GEOM_Object, containing the created face.
1850 # @ref tui_creation_face "Example"
1851 def MakeFaceHW(self,theH, theW, theOrientation):
1853 Create a face with specified dimensions with edges parallel to coordinate axes.
1856 theH height of Face.
1858 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1861 New GEOM.GEOM_Object, containing the created face.
1863 # Example: see GEOM_TestAll.py
1864 theH,theW,Parameters = ParseParameters(theH, theW)
1865 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1866 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1867 anObj.SetParameters(Parameters)
1870 ## Create a face from another plane and two sizes,
1871 # vertical size and horisontal size.
1872 # @param theObj Normale vector to the creating face or
1874 # @param theH Height (vertical size).
1875 # @param theW Width (horisontal size).
1876 # @return New GEOM.GEOM_Object, containing the created face.
1878 # @ref tui_creation_face "Example"
1879 def MakeFaceObjHW(self, theObj, theH, theW):
1881 Create a face from another plane and two sizes,
1882 vertical size and horisontal size.
1885 theObj Normale vector to the creating face or
1887 theH Height (vertical size).
1888 theW Width (horisontal size).
1891 New GEOM_Object, containing the created face.
1893 # Example: see GEOM_TestAll.py
1894 theH,theW,Parameters = ParseParameters(theH, theW)
1895 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1896 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1897 anObj.SetParameters(Parameters)
1900 ## Create a disk with given center, normal vector and radius.
1901 # @param thePnt Disk center.
1902 # @param theVec Vector, normal to the plane of the disk.
1903 # @param theR Disk radius.
1904 # @return New GEOM.GEOM_Object, containing the created disk.
1906 # @ref tui_creation_disk "Example"
1907 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1909 Create a disk with given center, normal vector and radius.
1913 theVec Vector, normal to the plane of the disk.
1917 New GEOM.GEOM_Object, containing the created disk.
1919 # Example: see GEOM_TestAll.py
1920 theR,Parameters = ParseParameters(theR)
1921 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1922 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1923 anObj.SetParameters(Parameters)
1926 ## Create a disk, passing through three given points
1927 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1928 # @return New GEOM.GEOM_Object, containing the created disk.
1930 # @ref tui_creation_disk "Example"
1931 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1933 Create a disk, passing through three given points
1936 thePnt1,thePnt2,thePnt3 Points, defining the disk.
1939 New GEOM.GEOM_Object, containing the created disk.
1941 # Example: see GEOM_TestAll.py
1942 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1943 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1946 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1947 # @param theR Radius of Face.
1948 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1949 # @return New GEOM.GEOM_Object, containing the created disk.
1951 # @ref tui_creation_face "Example"
1952 def MakeDiskR(self,theR, theOrientation):
1954 Create a disk with specified dimensions along OX-OY coordinate axes.
1957 theR Radius of Face.
1958 theOrientation set the orientation belong axis OXY or OYZ or OZX
1961 New GEOM.GEOM_Object, containing the created disk.
1964 Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object
1966 # Example: see GEOM_TestAll.py
1967 theR,Parameters = ParseParameters(theR)
1968 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1969 RaiseIfFailed("MakeDiskR", self.PrimOp)
1970 anObj.SetParameters(Parameters)
1973 ## Create a cylinder with given base point, axis, radius and height.
1974 # @param thePnt Central point of cylinder base.
1975 # @param theAxis Cylinder axis.
1976 # @param theR Cylinder radius.
1977 # @param theH Cylinder height.
1978 # @return New GEOM.GEOM_Object, containing the created cylinder.
1980 # @ref tui_creation_cylinder "Example"
1981 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1983 Create a cylinder with given base point, axis, radius and height.
1986 thePnt Central point of cylinder base.
1987 theAxis Cylinder axis.
1988 theR Cylinder radius.
1989 theH Cylinder height.
1992 New GEOM.GEOM_Object, containing the created cylinder.
1994 # Example: see GEOM_TestAll.py
1995 theR,theH,Parameters = ParseParameters(theR, theH)
1996 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1997 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1998 anObj.SetParameters(Parameters)
2001 ## Create a cylinder with given radius and height at
2002 # the origin of coordinate system. Axis of the cylinder
2003 # will be collinear to the OZ axis of the coordinate system.
2004 # @param theR Cylinder radius.
2005 # @param theH Cylinder height.
2006 # @return New GEOM.GEOM_Object, containing the created cylinder.
2008 # @ref tui_creation_cylinder "Example"
2009 def MakeCylinderRH(self,theR, theH):
2011 Create a cylinder with given radius and height at
2012 the origin of coordinate system. Axis of the cylinder
2013 will be collinear to the OZ axis of the coordinate system.
2016 theR Cylinder radius.
2017 theH Cylinder height.
2020 New GEOM.GEOM_Object, containing the created cylinder.
2022 # Example: see GEOM_TestAll.py
2023 theR,theH,Parameters = ParseParameters(theR, theH)
2024 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2025 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2026 anObj.SetParameters(Parameters)
2029 ## Create a sphere with given center and radius.
2030 # @param thePnt Sphere center.
2031 # @param theR Sphere radius.
2032 # @return New GEOM.GEOM_Object, containing the created sphere.
2034 # @ref tui_creation_sphere "Example"
2035 def MakeSpherePntR(self, thePnt, theR):
2037 Create a sphere with given center and radius.
2040 thePnt Sphere center.
2044 New GEOM.GEOM_Object, containing the created sphere.
2046 # Example: see GEOM_TestAll.py
2047 theR,Parameters = ParseParameters(theR)
2048 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2049 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2050 anObj.SetParameters(Parameters)
2053 ## Create a sphere with given center and radius.
2054 # @param x,y,z Coordinates of sphere center.
2055 # @param theR Sphere radius.
2056 # @return New GEOM.GEOM_Object, containing the created sphere.
2058 # @ref tui_creation_sphere "Example"
2059 def MakeSphere(self, x, y, z, theR):
2061 Create a sphere with given center and radius.
2064 x,y,z Coordinates of sphere center.
2068 New GEOM.GEOM_Object, containing the created sphere.
2070 # Example: see GEOM_TestAll.py
2071 point = self.MakeVertex(x, y, z)
2072 anObj = self.MakeSpherePntR(point, theR)
2075 ## Create a sphere with given radius at the origin of coordinate system.
2076 # @param theR Sphere radius.
2077 # @return New GEOM.GEOM_Object, containing the created sphere.
2079 # @ref tui_creation_sphere "Example"
2080 def MakeSphereR(self, theR):
2082 Create a sphere with given radius at the origin of coordinate system.
2088 New GEOM.GEOM_Object, containing the created sphere.
2090 # Example: see GEOM_TestAll.py
2091 theR,Parameters = ParseParameters(theR)
2092 anObj = self.PrimOp.MakeSphereR(theR)
2093 RaiseIfFailed("MakeSphereR", self.PrimOp)
2094 anObj.SetParameters(Parameters)
2097 ## Create a cone with given base point, axis, height and radiuses.
2098 # @param thePnt Central point of the first cone base.
2099 # @param theAxis Cone axis.
2100 # @param theR1 Radius of the first cone base.
2101 # @param theR2 Radius of the second cone base.
2102 # \note If both radiuses are non-zero, the cone will be truncated.
2103 # \note If the radiuses are equal, a cylinder will be created instead.
2104 # @param theH Cone height.
2105 # @return New GEOM.GEOM_Object, containing the created cone.
2107 # @ref tui_creation_cone "Example"
2108 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2110 Create a cone with given base point, axis, height and radiuses.
2113 thePnt Central point of the first cone base.
2115 theR1 Radius of the first cone base.
2116 theR2 Radius of the second cone base.
2120 If both radiuses are non-zero, the cone will be truncated.
2121 If the radiuses are equal, a cylinder will be created instead.
2124 New GEOM.GEOM_Object, containing the created cone.
2126 # Example: see GEOM_TestAll.py
2127 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2128 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2129 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2130 anObj.SetParameters(Parameters)
2133 ## Create a cone with given height and radiuses at
2134 # the origin of coordinate system. Axis of the cone will
2135 # be collinear to the OZ axis of the coordinate system.
2136 # @param theR1 Radius of the first cone base.
2137 # @param theR2 Radius of the second cone base.
2138 # \note If both radiuses are non-zero, the cone will be truncated.
2139 # \note If the radiuses are equal, a cylinder will be created instead.
2140 # @param theH Cone height.
2141 # @return New GEOM.GEOM_Object, containing the created cone.
2143 # @ref tui_creation_cone "Example"
2144 def MakeConeR1R2H(self,theR1, theR2, theH):
2146 Create a cone with given height and radiuses at
2147 the origin of coordinate system. Axis of the cone will
2148 be collinear to the OZ axis of the coordinate system.
2151 theR1 Radius of the first cone base.
2152 theR2 Radius of the second cone base.
2156 If both radiuses are non-zero, the cone will be truncated.
2157 If the radiuses are equal, a cylinder will be created instead.
2160 New GEOM.GEOM_Object, containing the created cone.
2162 # Example: see GEOM_TestAll.py
2163 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2164 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2165 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2166 anObj.SetParameters(Parameters)
2169 ## Create a torus with given center, normal vector and radiuses.
2170 # @param thePnt Torus central point.
2171 # @param theVec Torus axis of symmetry.
2172 # @param theRMajor Torus major radius.
2173 # @param theRMinor Torus minor radius.
2174 # @return New GEOM.GEOM_Object, containing the created torus.
2176 # @ref tui_creation_torus "Example"
2177 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2179 Create a torus with given center, normal vector and radiuses.
2182 thePnt Torus central point.
2183 theVec Torus axis of symmetry.
2184 theRMajor Torus major radius.
2185 theRMinor Torus minor radius.
2188 New GEOM.GEOM_Object, containing the created torus.
2190 # Example: see GEOM_TestAll.py
2191 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2192 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2193 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2194 anObj.SetParameters(Parameters)
2197 ## Create a torus with given radiuses at the origin of coordinate system.
2198 # @param theRMajor Torus major radius.
2199 # @param theRMinor Torus minor radius.
2200 # @return New GEOM.GEOM_Object, containing the created torus.
2202 # @ref tui_creation_torus "Example"
2203 def MakeTorusRR(self, theRMajor, theRMinor):
2205 Create a torus with given radiuses at the origin of coordinate system.
2208 theRMajor Torus major radius.
2209 theRMinor Torus minor radius.
2212 New GEOM.GEOM_Object, containing the created torus.
2214 # Example: see GEOM_TestAll.py
2215 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2216 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2217 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2218 anObj.SetParameters(Parameters)
2221 # end of l3_3d_primitives
2224 ## @addtogroup l3_complex
2227 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2228 # @param theBase Base shape to be extruded.
2229 # @param thePoint1 First end of extrusion vector.
2230 # @param thePoint2 Second end of extrusion vector.
2231 # @param theScaleFactor Use it to make prism with scaled second base.
2232 # Nagative value means not scaled second base.
2233 # @return New GEOM.GEOM_Object, containing the created prism.
2235 # @ref tui_creation_prism "Example"
2236 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2238 Create a shape by extrusion of the base shape along a vector, defined by two points.
2241 theBase Base shape to be extruded.
2242 thePoint1 First end of extrusion vector.
2243 thePoint2 Second end of extrusion vector.
2244 theScaleFactor Use it to make prism with scaled second base.
2245 Nagative value means not scaled second base.
2248 New GEOM.GEOM_Object, containing the created prism.
2250 # Example: see GEOM_TestAll.py
2253 if theScaleFactor > 0:
2254 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2255 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2257 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2258 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2259 anObj.SetParameters(Parameters)
2262 ## Create a shape by extrusion of the base shape along a
2263 # vector, defined by two points, in 2 Ways (forward/backward).
2264 # @param theBase Base shape to be extruded.
2265 # @param thePoint1 First end of extrusion vector.
2266 # @param thePoint2 Second end of extrusion vector.
2267 # @return New GEOM.GEOM_Object, containing the created prism.
2269 # @ref tui_creation_prism "Example"
2270 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2272 Create a shape by extrusion of the base shape along a
2273 vector, defined by two points, in 2 Ways (forward/backward).
2276 theBase Base shape to be extruded.
2277 thePoint1 First end of extrusion vector.
2278 thePoint2 Second end of extrusion vector.
2281 New GEOM.GEOM_Object, containing the created prism.
2283 # Example: see GEOM_TestAll.py
2284 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2285 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2288 ## Create a shape by extrusion of the base shape along the vector,
2289 # i.e. all the space, transfixed by the base shape during its translation
2290 # along the vector on the given distance.
2291 # @param theBase Base shape to be extruded.
2292 # @param theVec Direction of extrusion.
2293 # @param theH Prism dimension along theVec.
2294 # @param theScaleFactor Use it to make prism with scaled second base.
2295 # Negative value means not scaled second base.
2296 # @return New GEOM.GEOM_Object, containing the created prism.
2298 # @ref tui_creation_prism "Example"
2299 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2301 Create a shape by extrusion of the base shape along the vector,
2302 i.e. all the space, transfixed by the base shape during its translation
2303 along the vector on the given distance.
2306 theBase Base shape to be extruded.
2307 theVec Direction of extrusion.
2308 theH Prism dimension along theVec.
2309 theScaleFactor Use it to make prism with scaled second base.
2310 Negative value means not scaled second base.
2313 New GEOM.GEOM_Object, containing the created prism.
2315 # Example: see GEOM_TestAll.py
2318 if theScaleFactor > 0:
2319 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2320 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2322 theH,Parameters = ParseParameters(theH)
2323 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2324 RaiseIfFailed("MakePrismVecH", self.PrimOp)
2325 anObj.SetParameters(Parameters)
2328 ## Create a shape by extrusion of the base shape along the vector,
2329 # i.e. all the space, transfixed by the base shape during its translation
2330 # along the vector on the given distance in 2 Ways (forward/backward).
2331 # @param theBase Base shape to be extruded.
2332 # @param theVec Direction of extrusion.
2333 # @param theH Prism dimension along theVec in forward direction.
2334 # @return New GEOM.GEOM_Object, containing the created prism.
2336 # @ref tui_creation_prism "Example"
2337 def MakePrismVecH2Ways(self, theBase, theVec, theH):
2339 Create a shape by extrusion of the base shape along the vector,
2340 i.e. all the space, transfixed by the base shape during its translation
2341 along the vector on the given distance in 2 Ways (forward/backward).
2344 theBase Base shape to be extruded.
2345 theVec Direction of extrusion.
2346 theH Prism dimension along theVec in forward direction.
2349 New GEOM.GEOM_Object, containing the created prism.
2351 # Example: see GEOM_TestAll.py
2352 theH,Parameters = ParseParameters(theH)
2353 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2354 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2355 anObj.SetParameters(Parameters)
2358 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2359 # @param theBase Base shape to be extruded.
2360 # @param theDX, theDY, theDZ Directions of extrusion.
2361 # @param theScaleFactor Use it to make prism with scaled second base.
2362 # Nagative value means not scaled second base.
2363 # @return New GEOM.GEOM_Object, containing the created prism.
2365 # @ref tui_creation_prism "Example"
2366 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2368 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2371 theBase Base shape to be extruded.
2372 theDX, theDY, theDZ Directions of extrusion.
2373 theScaleFactor Use it to make prism with scaled second base.
2374 Nagative value means not scaled second base.
2377 New GEOM.GEOM_Object, containing the created prism.
2379 # Example: see GEOM_TestAll.py
2382 if theScaleFactor > 0:
2383 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2384 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2386 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2387 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2388 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2389 anObj.SetParameters(Parameters)
2392 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2393 # i.e. all the space, transfixed by the base shape during its translation
2394 # along the vector on the given distance in 2 Ways (forward/backward).
2395 # @param theBase Base shape to be extruded.
2396 # @param theDX, theDY, theDZ Directions of extrusion.
2397 # @return New GEOM.GEOM_Object, containing the created prism.
2399 # @ref tui_creation_prism "Example"
2400 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2402 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2403 i.e. all the space, transfixed by the base shape during its translation
2404 along the vector on the given distance in 2 Ways (forward/backward).
2407 theBase Base shape to be extruded.
2408 theDX, theDY, theDZ Directions of extrusion.
2411 New GEOM.GEOM_Object, containing the created prism.
2413 # Example: see GEOM_TestAll.py
2414 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2415 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2416 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2417 anObj.SetParameters(Parameters)
2420 ## Create a shape by revolution of the base shape around the axis
2421 # on the given angle, i.e. all the space, transfixed by the base
2422 # shape during its rotation around the axis on the given angle.
2423 # @param theBase Base shape to be rotated.
2424 # @param theAxis Rotation axis.
2425 # @param theAngle Rotation angle in radians.
2426 # @return New GEOM.GEOM_Object, containing the created revolution.
2428 # @ref tui_creation_revolution "Example"
2429 def MakeRevolution(self, theBase, theAxis, theAngle):
2431 Create a shape by revolution of the base shape around the axis
2432 on the given angle, i.e. all the space, transfixed by the base
2433 shape during its rotation around the axis on the given angle.
2436 theBase Base shape to be rotated.
2437 theAxis Rotation axis.
2438 theAngle Rotation angle in radians.
2441 New GEOM.GEOM_Object, containing the created revolution.
2443 # Example: see GEOM_TestAll.py
2444 theAngle,Parameters = ParseParameters(theAngle)
2445 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2446 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2447 anObj.SetParameters(Parameters)
2450 ## Create a shape by revolution of the base shape around the axis
2451 # on the given angle, i.e. all the space, transfixed by the base
2452 # shape during its rotation around the axis on the given angle in
2453 # both directions (forward/backward)
2454 # @param theBase Base shape to be rotated.
2455 # @param theAxis Rotation axis.
2456 # @param theAngle Rotation angle in radians.
2457 # @return New GEOM.GEOM_Object, containing the created revolution.
2459 # @ref tui_creation_revolution "Example"
2460 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2462 Create a shape by revolution of the base shape around the axis
2463 on the given angle, i.e. all the space, transfixed by the base
2464 shape during its rotation around the axis on the given angle in
2465 both directions (forward/backward).
2468 theBase Base shape to be rotated.
2469 theAxis Rotation axis.
2470 theAngle Rotation angle in radians.
2473 New GEOM.GEOM_Object, containing the created revolution.
2475 theAngle,Parameters = ParseParameters(theAngle)
2476 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2477 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2478 anObj.SetParameters(Parameters)
2481 ## Create a filling from the given compound of contours.
2482 # @param theShape the compound of contours
2483 # @param theMinDeg a minimal degree of BSpline surface to create
2484 # @param theMaxDeg a maximal degree of BSpline surface to create
2485 # @param theTol2D a 2d tolerance to be reached
2486 # @param theTol3D a 3d tolerance to be reached
2487 # @param theNbIter a number of iteration of approximation algorithm
2488 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2489 # @param isApprox if True, BSpline curves are generated in the process
2490 # of surface construction. By default it is False, that means
2491 # the surface is created using given curves. The usage of
2492 # Approximation makes the algorithm work slower, but allows
2493 # building the surface for rather complex cases.
2494 # @return New GEOM.GEOM_Object, containing the created filling surface.
2496 # @ref tui_creation_filling "Example"
2497 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2498 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2500 Create a filling from the given compound of contours.
2503 theShape the compound of contours
2504 theMinDeg a minimal degree of BSpline surface to create
2505 theMaxDeg a maximal degree of BSpline surface to create
2506 theTol2D a 2d tolerance to be reached
2507 theTol3D a 3d tolerance to be reached
2508 theNbIter a number of iteration of approximation algorithm
2509 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2510 isApprox if True, BSpline curves are generated in the process
2511 of surface construction. By default it is False, that means
2512 the surface is created using given curves. The usage of
2513 Approximation makes the algorithm work slower, but allows
2514 building the surface for rather complex cases
2517 New GEOM.GEOM_Object, containing the created filling surface.
2520 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2522 # Example: see GEOM_TestAll.py
2523 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2524 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2525 theTol2D, theTol3D, theNbIter,
2526 theMethod, isApprox)
2527 RaiseIfFailed("MakeFilling", self.PrimOp)
2528 anObj.SetParameters(Parameters)
2532 ## Create a filling from the given compound of contours.
2533 # This method corresponds to MakeFilling with isApprox=True
2534 # @param theShape the compound of contours
2535 # @param theMinDeg a minimal degree of BSpline surface to create
2536 # @param theMaxDeg a maximal degree of BSpline surface to create
2537 # @param theTol3D a 3d tolerance to be reached
2538 # @return New GEOM.GEOM_Object, containing the created filling surface.
2540 # @ref tui_creation_filling "Example"
2541 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2543 Create a filling from the given compound of contours.
2544 This method corresponds to MakeFilling with isApprox=True
2547 theShape the compound of contours
2548 theMinDeg a minimal degree of BSpline surface to create
2549 theMaxDeg a maximal degree of BSpline surface to create
2550 theTol3D a 3d tolerance to be reached
2553 New GEOM.GEOM_Object, containing the created filling surface.
2556 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2558 # Example: see GEOM_TestAll.py
2559 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2560 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2561 0, theTol3D, 0, GEOM.FOM_Default, True)
2562 RaiseIfFailed("MakeFillingNew", self.PrimOp)
2563 anObj.SetParameters(Parameters)
2566 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2567 # @param theSeqSections - set of specified sections.
2568 # @param theModeSolid - mode defining building solid or shell
2569 # @param thePreci - precision 3D used for smoothing
2570 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2571 # @return New GEOM.GEOM_Object, containing the created shell or solid.
2573 # @ref swig_todo "Example"
2574 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2576 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2579 theSeqSections - set of specified sections.
2580 theModeSolid - mode defining building solid or shell
2581 thePreci - precision 3D used for smoothing
2582 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2585 New GEOM.GEOM_Object, containing the created shell or solid.
2587 # Example: see GEOM_TestAll.py
2588 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2589 RaiseIfFailed("MakeThruSections", self.PrimOp)
2592 ## Create a shape by extrusion of the base shape along
2593 # the path shape. The path shape can be a wire or an edge.
2594 # @param theBase Base shape to be extruded.
2595 # @param thePath Path shape to extrude the base shape along it.
2596 # @return New GEOM.GEOM_Object, containing the created pipe.
2598 # @ref tui_creation_pipe "Example"
2599 def MakePipe(self,theBase, thePath):
2601 Create a shape by extrusion of the base shape along
2602 the path shape. The path shape can be a wire or an edge.
2605 theBase Base shape to be extruded.
2606 thePath Path shape to extrude the base shape along it.
2609 New GEOM.GEOM_Object, containing the created pipe.
2611 # Example: see GEOM_TestAll.py
2612 anObj = self.PrimOp.MakePipe(theBase, thePath)
2613 RaiseIfFailed("MakePipe", self.PrimOp)
2616 ## Create a shape by extrusion of the profile shape along
2617 # the path shape. The path shape can be a wire or an edge.
2618 # the several profiles can be specified in the several locations of path.
2619 # @param theSeqBases - list of Bases shape to be extruded.
2620 # @param theLocations - list of locations on the path corresponding
2621 # specified list of the Bases shapes. Number of locations
2622 # should be equal to number of bases or list of locations can be empty.
2623 # @param thePath - Path shape to extrude the base shape along it.
2624 # @param theWithContact - the mode defining that the section is translated to be in
2625 # contact with the spine.
2626 # @param theWithCorrection - defining that the section is rotated to be
2627 # orthogonal to the spine tangent in the correspondent point
2628 # @return New GEOM.GEOM_Object, containing the created pipe.
2630 # @ref tui_creation_pipe_with_diff_sec "Example"
2631 def MakePipeWithDifferentSections(self, theSeqBases,
2632 theLocations, thePath,
2633 theWithContact, theWithCorrection):
2635 Create a shape by extrusion of the profile shape along
2636 the path shape. The path shape can be a wire or an edge.
2637 the several profiles can be specified in the several locations of path.
2640 theSeqBases - list of Bases shape to be extruded.
2641 theLocations - list of locations on the path corresponding
2642 specified list of the Bases shapes. Number of locations
2643 should be equal to number of bases or list of locations can be empty.
2644 thePath - Path shape to extrude the base shape along it.
2645 theWithContact - the mode defining that the section is translated to be in
2646 contact with the spine(0/1)
2647 theWithCorrection - defining that the section is rotated to be
2648 orthogonal to the spine tangent in the correspondent point (0/1)
2651 New GEOM.GEOM_Object, containing the created pipe.
2653 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2654 theLocations, thePath,
2655 theWithContact, theWithCorrection)
2656 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2659 ## Create a shape by extrusion of the profile shape along
2660 # the path shape. The path shape can be a wire or a edge.
2661 # the several profiles can be specified in the several locations of path.
2662 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
2663 # shell or face. If number of faces in neighbour sections
2664 # aren't coincided result solid between such sections will
2665 # be created using external boundaries of this shells.
2666 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2667 # This list is used for searching correspondences between
2668 # faces in the sections. Size of this list must be equal
2669 # to size of list of base shapes.
2670 # @param theLocations - list of locations on the path corresponding
2671 # specified list of the Bases shapes. Number of locations
2672 # should be equal to number of bases. First and last
2673 # locations must be coincided with first and last vertexes
2674 # of path correspondingly.
2675 # @param thePath - Path shape to extrude the base shape along it.
2676 # @param theWithContact - the mode defining that the section is translated to be in
2677 # contact with the spine.
2678 # @param theWithCorrection - defining that the section is rotated to be
2679 # orthogonal to the spine tangent in the correspondent point
2680 # @return New GEOM.GEOM_Object, containing the created solids.
2682 # @ref tui_creation_pipe_with_shell_sec "Example"
2683 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2684 theLocations, thePath,
2685 theWithContact, theWithCorrection):
2687 Create a shape by extrusion of the profile shape along
2688 the path shape. The path shape can be a wire or a edge.
2689 the several profiles can be specified in the several locations of path.
2692 theSeqBases - list of Bases shape to be extruded. Base shape must be
2693 shell or face. If number of faces in neighbour sections
2694 aren't coincided result solid between such sections will
2695 be created using external boundaries of this shells.
2696 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2697 This list is used for searching correspondences between
2698 faces in the sections. Size of this list must be equal
2699 to size of list of base shapes.
2700 theLocations - list of locations on the path corresponding
2701 specified list of the Bases shapes. Number of locations
2702 should be equal to number of bases. First and last
2703 locations must be coincided with first and last vertexes
2704 of path correspondingly.
2705 thePath - Path shape to extrude the base shape along it.
2706 theWithContact - the mode defining that the section is translated to be in
2707 contact with the spine (0/1)
2708 theWithCorrection - defining that the section is rotated to be
2709 orthogonal to the spine tangent in the correspondent point (0/1)
2712 New GEOM.GEOM_Object, containing the created solids.
2714 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2715 theLocations, thePath,
2716 theWithContact, theWithCorrection)
2717 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2720 ## Create a shape by extrusion of the profile shape along
2721 # the path shape. This function is used only for debug pipe
2722 # functionality - it is a version of function MakePipeWithShellSections()
2723 # which give a possibility to recieve information about
2724 # creating pipe between each pair of sections step by step.
2725 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2726 theLocations, thePath,
2727 theWithContact, theWithCorrection):
2729 Create a shape by extrusion of the profile shape along
2730 the path shape. This function is used only for debug pipe
2731 functionality - it is a version of previous function
2732 geompy.MakePipeWithShellSections() which give a possibility to
2733 recieve information about creating pipe between each pair of
2734 sections step by step.
2737 nbsect = len(theSeqBases)
2738 nbsubsect = len(theSeqSubBases)
2739 #print "nbsect = ",nbsect
2740 for i in range(1,nbsect):
2742 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2743 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2745 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2746 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2747 tmpLocations, thePath,
2748 theWithContact, theWithCorrection)
2749 if self.PrimOp.IsDone() == 0:
2750 print "Problems with pipe creation between ",i," and ",i+1," sections"
2751 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2754 print "Pipe between ",i," and ",i+1," sections is OK"
2759 resc = self.MakeCompound(res)
2760 #resc = self.MakeSewing(res, 0.001)
2761 #print "resc: ",resc
2764 ## Create solids between given sections
2765 # @param theSeqBases - list of sections (shell or face).
2766 # @param theLocations - list of corresponding vertexes
2767 # @return New GEOM.GEOM_Object, containing the created solids.
2769 # @ref tui_creation_pipe_without_path "Example"
2770 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2772 Create solids between given sections
2775 theSeqBases - list of sections (shell or face).
2776 theLocations - list of corresponding vertexes
2779 New GEOM.GEOM_Object, containing the created solids.
2781 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2782 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2785 ## Create a shape by extrusion of the base shape along
2786 # the path shape with constant bi-normal direction along the given vector.
2787 # The path shape can be a wire or an edge.
2788 # @param theBase Base shape to be extruded.
2789 # @param thePath Path shape to extrude the base shape along it.
2790 # @param theVec Vector defines a constant binormal direction to keep the
2791 # same angle beetween the direction and the sections
2792 # along the sweep surface.
2793 # @return New GEOM.GEOM_Object, containing the created pipe.
2795 # @ref tui_creation_pipe "Example"
2796 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2798 Create a shape by extrusion of the base shape along
2799 the path shape with constant bi-normal direction along the given vector.
2800 The path shape can be a wire or an edge.
2803 theBase Base shape to be extruded.
2804 thePath Path shape to extrude the base shape along it.
2805 theVec Vector defines a constant binormal direction to keep the
2806 same angle beetween the direction and the sections
2807 along the sweep surface.
2810 New GEOM.GEOM_Object, containing the created pipe.
2812 # Example: see GEOM_TestAll.py
2813 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2814 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2820 ## @addtogroup l3_advanced
2823 ## Create a linear edge with specified ends.
2824 # @param thePnt1 Point for the first end of edge.
2825 # @param thePnt2 Point for the second end of edge.
2826 # @return New GEOM.GEOM_Object, containing the created edge.
2828 # @ref tui_creation_edge "Example"
2829 def MakeEdge(self,thePnt1, thePnt2):
2831 Create a linear edge with specified ends.
2834 thePnt1 Point for the first end of edge.
2835 thePnt2 Point for the second end of edge.
2838 New GEOM.GEOM_Object, containing the created edge.
2840 # Example: see GEOM_TestAll.py
2841 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2842 RaiseIfFailed("MakeEdge", self.ShapesOp)
2845 ## Create a new edge, corresponding to the given length on the given curve.
2846 # @param theRefCurve The referenced curve (edge).
2847 # @param theLength Length on the referenced curve. It can be negative.
2848 # @param theStartPoint Any point can be selected for it, the new edge will begin
2849 # at the end of \a theRefCurve, close to the selected point.
2850 # If None, start from the first point of \a theRefCurve.
2851 # @return New GEOM.GEOM_Object, containing the created edge.
2853 # @ref tui_creation_edge "Example"
2854 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2856 Create a new edge, corresponding to the given length on the given curve.
2859 theRefCurve The referenced curve (edge).
2860 theLength Length on the referenced curve. It can be negative.
2861 theStartPoint Any point can be selected for it, the new edge will begin
2862 at the end of theRefCurve, close to the selected point.
2863 If None, start from the first point of theRefCurve.
2866 New GEOM.GEOM_Object, containing the created edge.
2868 # Example: see GEOM_TestAll.py
2869 theLength, Parameters = ParseParameters(theLength)
2870 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2871 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2872 anObj.SetParameters(Parameters)
2875 ## Create an edge from specified wire.
2876 # @param theWire source Wire
2877 # @param theLinearTolerance linear tolerance value (default = 1e-07)
2878 # @param theAngularTolerance angular tolerance value (default = 1e-12)
2879 # @return New GEOM.GEOM_Object, containing the created edge.
2881 # @ref tui_creation_edge "Example"
2882 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
2884 Create an edge from specified wire.
2888 theLinearTolerance linear tolerance value (default = 1e-07)
2889 theAngularTolerance angular tolerance value (default = 1e-12)
2892 New GEOM.GEOM_Object, containing the created edge.
2894 # Example: see GEOM_TestAll.py
2895 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
2896 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
2899 ## Create a wire from the set of edges and wires.
2900 # @param theEdgesAndWires List of edges and/or wires.
2901 # @param theTolerance Maximum distance between vertices, that will be merged.
2902 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
2903 # @return New GEOM.GEOM_Object, containing the created wire.
2905 # @ref tui_creation_wire "Example"
2906 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
2908 Create a wire from the set of edges and wires.
2911 theEdgesAndWires List of edges and/or wires.
2912 theTolerance Maximum distance between vertices, that will be merged.
2913 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
2916 New GEOM.GEOM_Object, containing the created wire.
2918 # Example: see GEOM_TestAll.py
2919 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
2920 RaiseIfFailed("MakeWire", self.ShapesOp)
2923 ## Create a face on the given wire.
2924 # @param theWire closed Wire or Edge to build the face on.
2925 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2926 # If the tolerance of the obtained planar face is less
2927 # than 1e-06, this face will be returned, otherwise the
2928 # algorithm tries to build any suitable face on the given
2929 # wire and prints a warning message.
2930 # @return New GEOM.GEOM_Object, containing the created face.
2932 # @ref tui_creation_face "Example"
2933 def MakeFace(self, theWire, isPlanarWanted):
2935 Create a face on the given wire.
2938 theWire closed Wire or Edge to build the face on.
2939 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2940 If the tolerance of the obtained planar face is less
2941 than 1e-06, this face will be returned, otherwise the
2942 algorithm tries to build any suitable face on the given
2943 wire and prints a warning message.
2946 New GEOM.GEOM_Object, containing the created face.
2948 # Example: see GEOM_TestAll.py
2949 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
2950 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
2951 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
2953 RaiseIfFailed("MakeFace", self.ShapesOp)
2956 ## Create a face on the given wires set.
2957 # @param theWires List of closed wires or edges to build the face on.
2958 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2959 # If the tolerance of the obtained planar face is less
2960 # than 1e-06, this face will be returned, otherwise the
2961 # algorithm tries to build any suitable face on the given
2962 # wire and prints a warning message.
2963 # @return New GEOM.GEOM_Object, containing the created face.
2965 # @ref tui_creation_face "Example"
2966 def MakeFaceWires(self, theWires, isPlanarWanted):
2968 Create a face on the given wires set.
2971 theWires List of closed wires or edges to build the face on.
2972 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
2973 If the tolerance of the obtained planar face is less
2974 than 1e-06, this face will be returned, otherwise the
2975 algorithm tries to build any suitable face on the given
2976 wire and prints a warning message.
2979 New GEOM.GEOM_Object, containing the created face.
2981 # Example: see GEOM_TestAll.py
2982 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
2983 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
2984 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
2986 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
2989 ## See MakeFaceWires() method for details.
2991 # @ref tui_creation_face "Example 1"
2992 # \n @ref swig_MakeFaces "Example 2"
2993 def MakeFaces(self, theWires, isPlanarWanted):
2995 See geompy.MakeFaceWires() method for details.
2997 # Example: see GEOM_TestOthers.py
2998 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3001 ## Create a shell from the set of faces and shells.
3002 # @param theFacesAndShells List of faces and/or shells.
3003 # @return New GEOM.GEOM_Object, containing the created shell.
3005 # @ref tui_creation_shell "Example"
3006 def MakeShell(self,theFacesAndShells):
3008 Create a shell from the set of faces and shells.
3011 theFacesAndShells List of faces and/or shells.
3014 New GEOM.GEOM_Object, containing the created shell.
3016 # Example: see GEOM_TestAll.py
3017 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3018 RaiseIfFailed("MakeShell", self.ShapesOp)
3021 ## Create a solid, bounded by the given shells.
3022 # @param theShells Sequence of bounding shells.
3023 # @return New GEOM.GEOM_Object, containing the created solid.
3025 # @ref tui_creation_solid "Example"
3026 def MakeSolid(self, theShells):
3028 Create a solid, bounded by the given shells.
3031 theShells Sequence of bounding shells.
3034 New GEOM.GEOM_Object, containing the created solid.
3036 # Example: see GEOM_TestAll.py
3037 if len(theShells) == 1:
3038 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3040 # raise RuntimeError, "MakeSolidShells : " + descr
3041 if descr == "WRN_SHAPE_UNCLOSED":
3042 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3043 anObj = self.ShapesOp.MakeSolidShells(theShells)
3044 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3047 ## Create a compound of the given shapes.
3048 # @param theShapes List of shapes to put in compound.
3049 # @return New GEOM.GEOM_Object, containing the created compound.
3051 # @ref tui_creation_compound "Example"
3052 def MakeCompound(self,theShapes):
3054 Create a compound of the given shapes.
3057 theShapes List of shapes to put in compound.
3060 New GEOM.GEOM_Object, containing the created compound.
3062 # Example: see GEOM_TestAll.py
3063 anObj = self.ShapesOp.MakeCompound(theShapes)
3064 RaiseIfFailed("MakeCompound", self.ShapesOp)
3067 # end of l3_advanced
3070 ## @addtogroup l2_measure
3073 ## Gives quantity of faces in the given shape.
3074 # @param theShape Shape to count faces of.
3075 # @return Quantity of faces.
3077 # @ref swig_NumberOf "Example"
3078 def NumberOfFaces(self, theShape):
3080 Gives quantity of faces in the given shape.
3083 theShape Shape to count faces of.
3088 # Example: see GEOM_TestOthers.py
3089 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3090 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3093 ## Gives quantity of edges in the given shape.
3094 # @param theShape Shape to count edges of.
3095 # @return Quantity of edges.
3097 # @ref swig_NumberOf "Example"
3098 def NumberOfEdges(self, theShape):
3100 Gives quantity of edges in the given shape.
3103 theShape Shape to count edges of.
3108 # Example: see GEOM_TestOthers.py
3109 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3110 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3113 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3114 # @param theShape Shape to count sub-shapes of.
3115 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3116 # @return Quantity of sub-shapes of given type.
3118 # @ref swig_NumberOf "Example"
3119 def NumberOfSubShapes(self, theShape, theShapeType):
3121 Gives quantity of sub-shapes of type theShapeType in the given shape.
3124 theShape Shape to count sub-shapes of.
3125 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3128 Quantity of sub-shapes of given type.
3130 # Example: see GEOM_TestOthers.py
3131 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3132 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3135 ## Gives quantity of solids in the given shape.
3136 # @param theShape Shape to count solids in.
3137 # @return Quantity of solids.
3139 # @ref swig_NumberOf "Example"
3140 def NumberOfSolids(self, theShape):
3142 Gives quantity of solids in the given shape.
3145 theShape Shape to count solids in.
3150 # Example: see GEOM_TestOthers.py
3151 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3152 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3158 ## @addtogroup l3_healing
3161 ## Reverses an orientation the given shape.
3162 # @param theShape Shape to be reversed.
3163 # @return The reversed copy of theShape.
3165 # @ref swig_ChangeOrientation "Example"
3166 def ChangeOrientation(self,theShape):
3168 Reverses an orientation the given shape.
3171 theShape Shape to be reversed.
3174 The reversed copy of theShape.
3176 # Example: see GEOM_TestAll.py
3177 anObj = self.ShapesOp.ChangeOrientation(theShape)
3178 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3181 ## See ChangeOrientation() method for details.
3183 # @ref swig_OrientationChange "Example"
3184 def OrientationChange(self,theShape):
3186 See geompy.ChangeOrientation method for details.
3188 # Example: see GEOM_TestOthers.py
3189 anObj = self.ChangeOrientation(theShape)
3195 ## @addtogroup l4_obtain
3198 ## Retrieve all free faces from the given shape.
3199 # Free face is a face, which is not shared between two shells of the shape.
3200 # @param theShape Shape to find free faces in.
3201 # @return List of IDs of all free faces, contained in theShape.
3203 # @ref tui_measurement_tools_page "Example"
3204 def GetFreeFacesIDs(self,theShape):
3206 Retrieve all free faces from the given shape.
3207 Free face is a face, which is not shared between two shells of the shape.
3210 theShape Shape to find free faces in.
3213 List of IDs of all free faces, contained in theShape.
3215 # Example: see GEOM_TestOthers.py
3216 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3217 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3220 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3221 # @param theShape1 Shape to find sub-shapes in.
3222 # @param theShape2 Shape to find shared sub-shapes with.
3223 # @param theShapeType Type of sub-shapes to be retrieved.
3224 # @return List of sub-shapes of theShape1, shared with theShape2.
3226 # @ref swig_GetSharedShapes "Example"
3227 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3229 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3232 theShape1 Shape to find sub-shapes in.
3233 theShape2 Shape to find shared sub-shapes with.
3234 theShapeType Type of sub-shapes to be retrieved.
3237 List of sub-shapes of theShape1, shared with theShape2.
3239 # Example: see GEOM_TestOthers.py
3240 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3241 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3244 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3245 # @param theShapes Shapes to find common sub-shapes of.
3246 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3247 # @return List of objects, that are sub-shapes of all given shapes.
3249 # @ref swig_GetSharedShapes "Example"
3250 def GetSharedShapesMulti(self, theShapes, theShapeType):
3252 Get all sub-shapes, shared by all shapes in the list theShapes.
3255 theShapes Shapes to find common sub-shapes of.
3256 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3259 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3261 # Example: see GEOM_TestOthers.py
3262 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3263 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3266 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3267 # situated relatively the specified plane by the certain way,
3268 # defined through <VAR>theState</VAR> parameter.
3269 # @param theShape Shape to find sub-shapes of.
3270 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3271 # @param theAx1 Vector (or line, or linear edge), specifying normal
3272 # direction and location of the plane to find shapes on.
3273 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3274 # @return List of all found sub-shapes.
3276 # @ref swig_GetShapesOnPlane "Example"
3277 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3279 Find in theShape all sub-shapes of type theShapeType,
3280 situated relatively the specified plane by the certain way,
3281 defined through theState parameter.
3284 theShape Shape to find sub-shapes of.
3285 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3286 theAx1 Vector (or line, or linear edge), specifying normal
3287 direction and location of the plane to find shapes on.
3288 theState The state of the sub-shapes to find (see GEOM::shape_state)
3291 List of all found sub-shapes.
3293 # Example: see GEOM_TestOthers.py
3294 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3295 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3298 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3299 # situated relatively the specified plane by the certain way,
3300 # defined through <VAR>theState</VAR> parameter.
3301 # @param theShape Shape to find sub-shapes of.
3302 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3303 # @param theAx1 Vector (or line, or linear edge), specifying normal
3304 # direction and location of the plane to find shapes on.
3305 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3306 # @return List of all found sub-shapes indices.
3308 # @ref swig_GetShapesOnPlaneIDs "Example"
3309 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3311 Find in theShape all sub-shapes of type theShapeType,
3312 situated relatively the specified plane by the certain way,
3313 defined through theState parameter.
3316 theShape Shape to find sub-shapes of.
3317 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3318 theAx1 Vector (or line, or linear edge), specifying normal
3319 direction and location of the plane to find shapes on.
3320 theState The state of the sub-shapes to find (see GEOM::shape_state)
3323 List of all found sub-shapes indices.
3325 # Example: see GEOM_TestOthers.py
3326 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3327 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3330 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3331 # situated relatively the specified plane by the certain way,
3332 # defined through <VAR>theState</VAR> parameter.
3333 # @param theShape Shape to find sub-shapes of.
3334 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3335 # @param theAx1 Vector (or line, or linear edge), specifying normal
3336 # direction of the plane to find shapes on.
3337 # @param thePnt Point specifying location of the plane to find shapes on.
3338 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3339 # @return List of all found sub-shapes.
3341 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3342 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3344 Find in theShape all sub-shapes of type theShapeType,
3345 situated relatively the specified plane by the certain way,
3346 defined through theState parameter.
3349 theShape Shape to find sub-shapes of.
3350 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3351 theAx1 Vector (or line, or linear edge), specifying normal
3352 direction and location of the plane to find shapes on.
3353 thePnt Point specifying location of the plane to find shapes on.
3354 theState The state of the sub-shapes to find (see GEOM::shape_state)
3357 List of all found sub-shapes.
3359 # Example: see GEOM_TestOthers.py
3360 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3361 theAx1, thePnt, theState)
3362 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3365 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3366 # situated relatively the specified plane by the certain way,
3367 # defined through <VAR>theState</VAR> parameter.
3368 # @param theShape Shape to find sub-shapes of.
3369 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3370 # @param theAx1 Vector (or line, or linear edge), specifying normal
3371 # direction of the plane to find shapes on.
3372 # @param thePnt Point specifying location of the plane to find shapes on.
3373 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3374 # @return List of all found sub-shapes indices.
3376 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3377 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3379 Find in theShape all sub-shapes of type theShapeType,
3380 situated relatively the specified plane by the certain way,
3381 defined through theState parameter.
3384 theShape Shape to find sub-shapes of.
3385 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3386 theAx1 Vector (or line, or linear edge), specifying normal
3387 direction and location of the plane to find shapes on.
3388 thePnt Point specifying location of the plane to find shapes on.
3389 theState The state of the sub-shapes to find (see GEOM::shape_state)
3392 List of all found sub-shapes indices.
3394 # Example: see GEOM_TestOthers.py
3395 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3396 theAx1, thePnt, theState)
3397 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3400 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3401 # the specified cylinder by the certain way, defined through \a theState parameter.
3402 # @param theShape Shape to find sub-shapes of.
3403 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3404 # @param theAxis Vector (or line, or linear edge), specifying
3405 # axis of the cylinder to find shapes on.
3406 # @param theRadius Radius of the cylinder to find shapes on.
3407 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3408 # @return List of all found sub-shapes.
3410 # @ref swig_GetShapesOnCylinder "Example"
3411 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3413 Find in theShape all sub-shapes of type theShapeType, situated relatively
3414 the specified cylinder by the certain way, defined through theState parameter.
3417 theShape Shape to find sub-shapes of.
3418 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3419 theAxis Vector (or line, or linear edge), specifying
3420 axis of the cylinder to find shapes on.
3421 theRadius Radius of the cylinder to find shapes on.
3422 theState The state of the sub-shapes to find (see GEOM::shape_state)
3425 List of all found sub-shapes.
3427 # Example: see GEOM_TestOthers.py
3428 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3429 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3432 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3433 # the specified cylinder by the certain way, defined through \a theState parameter.
3434 # @param theShape Shape to find sub-shapes of.
3435 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3436 # @param theAxis Vector (or line, or linear edge), specifying
3437 # axis of the cylinder to find shapes on.
3438 # @param theRadius Radius of the cylinder to find shapes on.
3439 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3440 # @return List of all found sub-shapes indices.
3442 # @ref swig_GetShapesOnCylinderIDs "Example"
3443 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3445 Find in theShape all sub-shapes of type theShapeType, situated relatively
3446 the specified cylinder by the certain way, defined through theState parameter.
3449 theShape Shape to find sub-shapes of.
3450 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3451 theAxis Vector (or line, or linear edge), specifying
3452 axis of the cylinder to find shapes on.
3453 theRadius Radius of the cylinder to find shapes on.
3454 theState The state of the sub-shapes to find (see GEOM::shape_state)
3457 List of all found sub-shapes indices.
3459 # Example: see GEOM_TestOthers.py
3460 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3461 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3464 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3465 # the specified cylinder by the certain way, defined through \a theState parameter.
3466 # @param theShape Shape to find sub-shapes of.
3467 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3468 # @param theAxis Vector (or line, or linear edge), specifying
3469 # axis of the cylinder to find shapes on.
3470 # @param thePnt Point specifying location of the bottom of the cylinder.
3471 # @param theRadius Radius of the cylinder to find shapes on.
3472 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3473 # @return List of all found sub-shapes.
3475 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3476 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3478 Find in theShape all sub-shapes of type theShapeType, situated relatively
3479 the specified cylinder by the certain way, defined through theState parameter.
3482 theShape Shape to find sub-shapes of.
3483 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3484 theAxis Vector (or line, or linear edge), specifying
3485 axis of the cylinder to find shapes on.
3486 theRadius Radius of the cylinder to find shapes on.
3487 theState The state of the sub-shapes to find (see GEOM::shape_state)
3490 List of all found sub-shapes.
3492 # Example: see GEOM_TestOthers.py
3493 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3494 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3497 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3498 # the specified cylinder by the certain way, defined through \a theState parameter.
3499 # @param theShape Shape to find sub-shapes of.
3500 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3501 # @param theAxis Vector (or line, or linear edge), specifying
3502 # axis of the cylinder to find shapes on.
3503 # @param thePnt Point specifying location of the bottom of the cylinder.
3504 # @param theRadius Radius of the cylinder to find shapes on.
3505 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3506 # @return List of all found sub-shapes indices
3508 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3509 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3511 Find in theShape all sub-shapes of type theShapeType, situated relatively
3512 the specified cylinder by the certain way, defined through theState parameter.
3515 theShape Shape to find sub-shapes of.
3516 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3517 theAxis Vector (or line, or linear edge), specifying
3518 axis of the cylinder to find shapes on.
3519 theRadius Radius of the cylinder to find shapes on.
3520 theState The state of the sub-shapes to find (see GEOM::shape_state)
3523 List of all found sub-shapes indices.
3525 # Example: see GEOM_TestOthers.py
3526 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3527 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3530 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3531 # the specified sphere by the certain way, defined through \a theState parameter.
3532 # @param theShape Shape to find sub-shapes of.
3533 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3534 # @param theCenter Point, specifying center of the sphere to find shapes on.
3535 # @param theRadius Radius of the sphere to find shapes on.
3536 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3537 # @return List of all found sub-shapes.
3539 # @ref swig_GetShapesOnSphere "Example"
3540 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3542 Find in theShape all sub-shapes of type theShapeType, situated relatively
3543 the specified sphere by the certain way, defined through theState parameter.
3546 theShape Shape to find sub-shapes of.
3547 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3548 theCenter Point, specifying center of the sphere to find shapes on.
3549 theRadius Radius of the sphere to find shapes on.
3550 theState The state of the sub-shapes to find (see GEOM::shape_state)
3553 List of all found sub-shapes.
3555 # Example: see GEOM_TestOthers.py
3556 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3557 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3560 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3561 # the specified sphere by the certain way, defined through \a theState parameter.
3562 # @param theShape Shape to find sub-shapes of.
3563 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3564 # @param theCenter Point, specifying center of the sphere to find shapes on.
3565 # @param theRadius Radius of the sphere to find shapes on.
3566 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3567 # @return List of all found sub-shapes indices.
3569 # @ref swig_GetShapesOnSphereIDs "Example"
3570 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3572 Find in theShape all sub-shapes of type theShapeType, situated relatively
3573 the specified sphere by the certain way, defined through theState parameter.
3576 theShape Shape to find sub-shapes of.
3577 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3578 theCenter Point, specifying center of the sphere to find shapes on.
3579 theRadius Radius of the sphere to find shapes on.
3580 theState The state of the sub-shapes to find (see GEOM::shape_state)
3583 List of all found sub-shapes indices.
3585 # Example: see GEOM_TestOthers.py
3586 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3587 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3590 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3591 # the specified quadrangle by the certain way, defined through \a theState parameter.
3592 # @param theShape Shape to find sub-shapes of.
3593 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3594 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3595 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3596 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3597 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3598 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3599 # @return List of all found sub-shapes.
3601 # @ref swig_GetShapesOnQuadrangle "Example"
3602 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3603 theTopLeftPoint, theTopRigthPoint,
3604 theBottomLeftPoint, theBottomRigthPoint, theState):
3606 Find in theShape all sub-shapes of type theShapeType, situated relatively
3607 the specified quadrangle by the certain way, defined through theState parameter.
3610 theShape Shape to find sub-shapes of.
3611 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3612 theTopLeftPoint Point, specifying top left corner of a quadrangle
3613 theTopRigthPoint Point, specifying top right corner of a quadrangle
3614 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3615 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3616 theState The state of the sub-shapes to find (see GEOM::shape_state)
3619 List of all found sub-shapes.
3621 # Example: see GEOM_TestOthers.py
3622 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3623 theTopLeftPoint, theTopRigthPoint,
3624 theBottomLeftPoint, theBottomRigthPoint, theState)
3625 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3628 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3629 # the specified quadrangle by the certain way, defined through \a theState parameter.
3630 # @param theShape Shape to find sub-shapes of.
3631 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3632 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3633 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3634 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3635 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3636 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3637 # @return List of all found sub-shapes indices.
3639 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3640 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3641 theTopLeftPoint, theTopRigthPoint,
3642 theBottomLeftPoint, theBottomRigthPoint, theState):
3644 Find in theShape all sub-shapes of type theShapeType, situated relatively
3645 the specified quadrangle by the certain way, defined through theState parameter.
3648 theShape Shape to find sub-shapes of.
3649 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3650 theTopLeftPoint Point, specifying top left corner of a quadrangle
3651 theTopRigthPoint Point, specifying top right corner of a quadrangle
3652 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3653 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3654 theState The state of the sub-shapes to find (see GEOM::shape_state)
3657 List of all found sub-shapes indices.
3660 # Example: see GEOM_TestOthers.py
3661 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3662 theTopLeftPoint, theTopRigthPoint,
3663 theBottomLeftPoint, theBottomRigthPoint, theState)
3664 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3667 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3668 # the specified \a theBox by the certain way, defined through \a theState parameter.
3669 # @param theBox Shape for relative comparing.
3670 # @param theShape Shape to find sub-shapes of.
3671 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3672 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3673 # @return List of all found sub-shapes.
3675 # @ref swig_GetShapesOnBox "Example"
3676 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3678 Find in theShape all sub-shapes of type theShapeType, situated relatively
3679 the specified theBox by the certain way, defined through theState parameter.
3682 theBox Shape for relative comparing.
3683 theShape Shape to find sub-shapes of.
3684 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3685 theState The state of the sub-shapes to find (see GEOM::shape_state)
3688 List of all found sub-shapes.
3690 # Example: see GEOM_TestOthers.py
3691 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3692 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3695 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3696 # the specified \a theBox by the certain way, defined through \a theState parameter.
3697 # @param theBox Shape for relative comparing.
3698 # @param theShape Shape to find sub-shapes of.
3699 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3700 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3701 # @return List of all found sub-shapes indices.
3703 # @ref swig_GetShapesOnBoxIDs "Example"
3704 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3706 Find in theShape all sub-shapes of type theShapeType, situated relatively
3707 the specified theBox by the certain way, defined through theState parameter.
3710 theBox Shape for relative comparing.
3711 theShape Shape to find sub-shapes of.
3712 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3713 theState The state of the sub-shapes to find (see GEOM::shape_state)
3716 List of all found sub-shapes indices.
3718 # Example: see GEOM_TestOthers.py
3719 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3720 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3723 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3724 # situated relatively the specified \a theCheckShape by the
3725 # certain way, defined through \a theState parameter.
3726 # @param theCheckShape Shape for relative comparing. It must be a solid.
3727 # @param theShape Shape to find sub-shapes of.
3728 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3729 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3730 # @return List of all found sub-shapes.
3732 # @ref swig_GetShapesOnShape "Example"
3733 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3735 Find in theShape all sub-shapes of type theShapeType,
3736 situated relatively the specified theCheckShape by the
3737 certain way, defined through theState parameter.
3740 theCheckShape Shape for relative comparing. It must be a solid.
3741 theShape Shape to find sub-shapes of.
3742 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3743 theState The state of the sub-shapes to find (see GEOM::shape_state)
3746 List of all found sub-shapes.
3748 # Example: see GEOM_TestOthers.py
3749 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3750 theShapeType, theState)
3751 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3754 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3755 # situated relatively the specified \a theCheckShape by the
3756 # certain way, defined through \a theState parameter.
3757 # @param theCheckShape Shape for relative comparing. It must be a solid.
3758 # @param theShape Shape to find sub-shapes of.
3759 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3760 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3761 # @return All found sub-shapes as compound.
3763 # @ref swig_GetShapesOnShapeAsCompound "Example"
3764 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3766 Find in theShape all sub-shapes of type theShapeType,
3767 situated relatively the specified theCheckShape by the
3768 certain way, defined through theState parameter.
3771 theCheckShape Shape for relative comparing. It must be a solid.
3772 theShape Shape to find sub-shapes of.
3773 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3774 theState The state of the sub-shapes to find (see GEOM::shape_state)
3777 All found sub-shapes as compound.
3779 # Example: see GEOM_TestOthers.py
3780 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3781 theShapeType, theState)
3782 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3785 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3786 # situated relatively the specified \a theCheckShape by the
3787 # certain way, defined through \a theState parameter.
3788 # @param theCheckShape Shape for relative comparing. It must be a solid.
3789 # @param theShape Shape to find sub-shapes of.
3790 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3791 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3792 # @return List of all found sub-shapes indices.
3794 # @ref swig_GetShapesOnShapeIDs "Example"
3795 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3797 Find in theShape all sub-shapes of type theShapeType,
3798 situated relatively the specified theCheckShape by the
3799 certain way, defined through theState parameter.
3802 theCheckShape Shape for relative comparing. It must be a solid.
3803 theShape Shape to find sub-shapes of.
3804 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3805 theState The state of the sub-shapes to find (see GEOM::shape_state)
3808 List of all found sub-shapes indices.
3810 # Example: see GEOM_TestOthers.py
3811 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3812 theShapeType, theState)
3813 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3816 ## Get sub-shape(s) of theShapeWhere, which are
3817 # coincident with \a theShapeWhat or could be a part of it.
3818 # @param theShapeWhere Shape to find sub-shapes of.
3819 # @param theShapeWhat Shape, specifying what to find.
3820 # @param isNewImplementation implementation of GetInPlace functionality
3821 # (default = False, old alghorithm based on shape properties)
3822 # @return Group of all found sub-shapes or a single found sub-shape.
3824 # @note This function has a restriction on argument shapes.
3825 # If \a theShapeWhere has curved parts with significantly
3826 # outstanding centres (i.e. the mass centre of a part is closer to
3827 # \a theShapeWhat than to the part), such parts will not be found.
3828 # @image html get_in_place_lost_part.png
3830 # @ref swig_GetInPlace "Example"
3831 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3833 Get sub-shape(s) of theShapeWhere, which are
3834 coincident with theShapeWhat or could be a part of it.
3837 theShapeWhere Shape to find sub-shapes of.
3838 theShapeWhat Shape, specifying what to find.
3839 isNewImplementation Implementation of GetInPlace functionality
3840 (default = False, old alghorithm based on shape properties)
3843 Group of all found sub-shapes or a single found sub-shape.
3847 This function has a restriction on argument shapes.
3848 If theShapeWhere has curved parts with significantly
3849 outstanding centres (i.e. the mass centre of a part is closer to
3850 theShapeWhat than to the part), such parts will not be found.
3852 # Example: see GEOM_TestOthers.py
3854 if isNewImplementation:
3855 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3857 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3859 RaiseIfFailed("GetInPlace", self.ShapesOp)
3862 ## Get sub-shape(s) of \a theShapeWhere, which are
3863 # coincident with \a theShapeWhat or could be a part of it.
3865 # Implementation of this method is based on a saved history of an operation,
3866 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3867 # arguments (an argument shape or a sub-shape of an argument shape).
3868 # The operation could be the Partition or one of boolean operations,
3869 # performed on simple shapes (not on compounds).
3871 # @param theShapeWhere Shape to find sub-shapes of.
3872 # @param theShapeWhat Shape, specifying what to find (must be in the
3873 # building history of the ShapeWhere).
3874 # @return Group of all found sub-shapes or a single found sub-shape.
3876 # @ref swig_GetInPlace "Example"
3877 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
3879 Implementation of this method is based on a saved history of an operation,
3880 produced theShapeWhere. The theShapeWhat must be among this operation's
3881 arguments (an argument shape or a sub-shape of an argument shape).
3882 The operation could be the Partition or one of boolean operations,
3883 performed on simple shapes (not on compounds).
3886 theShapeWhere Shape to find sub-shapes of.
3887 theShapeWhat Shape, specifying what to find (must be in the
3888 building history of the ShapeWhere).
3891 Group of all found sub-shapes or a single found sub-shape.
3893 # Example: see GEOM_TestOthers.py
3894 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
3895 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
3898 ## Get sub-shape of theShapeWhere, which is
3899 # equal to \a theShapeWhat.
3900 # @param theShapeWhere Shape to find sub-shape of.
3901 # @param theShapeWhat Shape, specifying what to find.
3902 # @return New GEOM.GEOM_Object for found sub-shape.
3904 # @ref swig_GetSame "Example"
3905 def GetSame(self,theShapeWhere, theShapeWhat):
3907 Get sub-shape of theShapeWhere, which is
3908 equal to theShapeWhat.
3911 theShapeWhere Shape to find sub-shape of.
3912 theShapeWhat Shape, specifying what to find.
3915 New GEOM.GEOM_Object for found sub-shape.
3917 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
3918 RaiseIfFailed("GetSame", self.ShapesOp)
3922 ## Get sub-shape indices of theShapeWhere, which is
3923 # equal to \a theShapeWhat.
3924 # @param theShapeWhere Shape to find sub-shape of.
3925 # @param theShapeWhat Shape, specifying what to find.
3926 # @return List of all found sub-shapes indices.
3928 # @ref swig_GetSame "Example"
3929 def GetSameIDs(self,theShapeWhere, theShapeWhat):
3931 Get sub-shape indices of theShapeWhere, which is
3932 equal to theShapeWhat.
3935 theShapeWhere Shape to find sub-shape of.
3936 theShapeWhat Shape, specifying what to find.
3939 List of all found sub-shapes indices.
3941 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
3942 RaiseIfFailed("GetSameIDs", self.ShapesOp)
3949 ## @addtogroup l4_access
3952 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
3953 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
3954 # @param aShape Shape to get sub-shape of.
3955 # @param ListOfID List of sub-shapes indices.
3956 # @return Found sub-shape.
3958 # @ref swig_all_decompose "Example"
3959 def GetSubShape(self, aShape, ListOfID):
3961 Obtain a composite sub-shape of aShape, composed from sub-shapes
3962 of aShape, selected by their unique IDs inside aShape
3965 aShape Shape to get sub-shape of.
3966 ListOfID List of sub-shapes indices.
3971 # Example: see GEOM_TestAll.py
3972 anObj = self.AddSubShape(aShape,ListOfID)
3975 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
3976 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
3977 # @param aShape Shape to get sub-shape of.
3978 # @param aSubShape Sub-shapes of aShape.
3979 # @return ID of found sub-shape.
3981 # @ref swig_all_decompose "Example"
3982 def GetSubShapeID(self, aShape, aSubShape):
3984 Obtain unique ID of sub-shape aSubShape inside aShape
3985 of aShape, selected by their unique IDs inside aShape
3988 aShape Shape to get sub-shape of.
3989 aSubShape Sub-shapes of aShape.
3992 ID of found sub-shape.
3994 # Example: see GEOM_TestAll.py
3995 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
3996 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4002 ## @addtogroup l4_decompose
4005 ## Get all sub-shapes and groups of \a theShape,
4006 # that were created already by any other methods.
4007 # @param theShape Any shape.
4008 # @param theGroupsOnly If this parameter is TRUE, only groups will be
4009 # returned, else all found sub-shapes and groups.
4010 # @return List of existing sub-objects of \a theShape.
4012 # @ref swig_all_decompose "Example"
4013 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4015 Get all sub-shapes and groups of theShape,
4016 that were created already by any other methods.
4020 theGroupsOnly If this parameter is TRUE, only groups will be
4021 returned, else all found sub-shapes and groups.
4024 List of existing sub-objects of theShape.
4026 # Example: see GEOM_TestAll.py
4027 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4028 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4031 ## Get all groups of \a theShape,
4032 # that were created already by any other methods.
4033 # @param theShape Any shape.
4034 # @return List of existing groups of \a theShape.
4036 # @ref swig_all_decompose "Example"
4037 def GetGroups(self, theShape):
4039 Get all groups of theShape,
4040 that were created already by any other methods.
4046 List of existing groups of theShape.
4048 # Example: see GEOM_TestAll.py
4049 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4050 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4053 ## Explode a shape on sub-shapes of a given type.
4054 # If the shape itself matches the type, it is also returned.
4055 # @param aShape Shape to be exploded.
4056 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4057 # @return List of sub-shapes of type theShapeType, contained in theShape.
4059 # @ref swig_all_decompose "Example"
4060 def SubShapeAll(self, aShape, aType):
4062 Explode a shape on sub-shapes of a given type.
4063 If the shape itself matches the type, it is also returned.
4066 aShape Shape to be exploded.
4067 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4070 List of sub-shapes of type theShapeType, contained in theShape.
4072 # Example: see GEOM_TestAll.py
4073 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
4074 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4077 ## Explode a shape on sub-shapes of a given type.
4078 # @param aShape Shape to be exploded.
4079 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4080 # @return List of IDs of sub-shapes.
4082 # @ref swig_all_decompose "Example"
4083 def SubShapeAllIDs(self, aShape, aType):
4085 Explode a shape on sub-shapes of a given type.
4088 aShape Shape to be exploded (see geompy.ShapeType)
4089 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4092 List of IDs of sub-shapes.
4094 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
4095 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4098 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4099 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4100 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4101 # @param aShape Shape to get sub-shape of.
4102 # @param ListOfInd List of sub-shapes indices.
4103 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4104 # @return A compound of sub-shapes of aShape.
4106 # @ref swig_all_decompose "Example"
4107 def SubShape(self, aShape, aType, ListOfInd):
4109 Obtain a compound of sub-shapes of aShape,
4110 selected by they indices in list of all sub-shapes of type aType.
4111 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4114 aShape Shape to get sub-shape of.
4115 ListOfID List of sub-shapes indices.
4116 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4119 A compound of sub-shapes of aShape.
4121 # Example: see GEOM_TestAll.py
4123 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
4124 for ind in ListOfInd:
4125 ListOfIDs.append(AllShapeIDsList[ind - 1])
4126 anObj = self.GetSubShape(aShape, ListOfIDs)
4129 ## Explode a shape on sub-shapes of a given type.
4130 # Sub-shapes will be sorted by coordinates of their gravity centers.
4131 # If the shape itself matches the type, it is also returned.
4132 # @param aShape Shape to be exploded.
4133 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4134 # @return List of sub-shapes of type theShapeType, contained in theShape.
4136 # @ref swig_SubShapeAllSorted "Example"
4137 def SubShapeAllSortedCentres(self, aShape, aType):
4139 Explode a shape on sub-shapes of a given type.
4140 Sub-shapes will be sorted by coordinates of their gravity centers.
4141 If the shape itself matches the type, it is also returned.
4144 aShape Shape to be exploded.
4145 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4148 List of sub-shapes of type theShapeType, contained in theShape.
4150 # Example: see GEOM_TestAll.py
4151 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
4152 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4155 ## Explode a shape on sub-shapes of a given type.
4156 # Sub-shapes will be sorted by coordinates of their gravity centers.
4157 # @param aShape Shape to be exploded.
4158 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4159 # @return List of IDs of sub-shapes.
4161 # @ref swig_all_decompose "Example"
4162 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4164 Explode a shape on sub-shapes of a given type.
4165 Sub-shapes will be sorted by coordinates of their gravity centers.
4168 aShape Shape to be exploded.
4169 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4172 List of IDs of sub-shapes.
4174 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
4175 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4178 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4179 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4180 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4181 # @param aShape Shape to get sub-shape of.
4182 # @param ListOfInd List of sub-shapes indices.
4183 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4184 # @return A compound of sub-shapes of aShape.
4186 # @ref swig_all_decompose "Example"
4187 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4189 Obtain a compound of sub-shapes of aShape,
4190 selected by they indices in sorted list of all sub-shapes of type aType.
4191 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4194 aShape Shape to get sub-shape of.
4195 ListOfID List of sub-shapes indices.
4196 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4199 A compound of sub-shapes of aShape.
4201 # Example: see GEOM_TestAll.py
4203 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
4204 for ind in ListOfInd:
4205 ListOfIDs.append(AllShapeIDsList[ind - 1])
4206 anObj = self.GetSubShape(aShape, ListOfIDs)
4209 ## Extract shapes (excluding the main shape) of given type.
4210 # @param aShape The shape.
4211 # @param aType The shape type (see ShapeType())
4212 # @param isSorted Boolean flag to switch sorting on/off.
4213 # @return List of sub-shapes of type aType, contained in aShape.
4215 # @ref swig_FilletChamfer "Example"
4216 def ExtractShapes(self, aShape, aType, isSorted = False):
4218 Extract shapes (excluding the main shape) of given type.
4222 aType The shape type (see geompy.ShapeType)
4223 isSorted Boolean flag to switch sorting on/off.
4226 List of sub-shapes of type aType, contained in aShape.
4228 # Example: see GEOM_TestAll.py
4229 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
4230 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4233 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4234 # @param aShape Main shape.
4235 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4236 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4238 # @ref swig_all_decompose "Example"
4239 def SubShapes(self, aShape, anIDs):
4241 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4245 anIDs List of unique IDs of sub-shapes inside theMainShape.
4248 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4250 # Example: see GEOM_TestAll.py
4251 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4252 RaiseIfFailed("SubShapes", self.ShapesOp)
4255 # end of l4_decompose
4258 ## @addtogroup l4_decompose_d
4261 ## Deprecated method
4262 # It works like SubShapeAllSortedCentres(), but wrongly
4263 # defines centres of faces, shells and solids.
4264 def SubShapeAllSorted(self, aShape, aType):
4267 It works like geompy.SubShapeAllSortedCentres, but wrongly
4268 defines centres of faces, shells and solids.
4270 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
4271 RaiseIfFailed("MakeExplode", self.ShapesOp)
4274 ## Deprecated method
4275 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4276 # defines centres of faces, shells and solids.
4277 def SubShapeAllSortedIDs(self, aShape, aType):
4280 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4281 defines centres of faces, shells and solids.
4283 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
4284 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4287 ## Deprecated method
4288 # It works like SubShapeSortedCentres(), but has a bug
4289 # (wrongly defines centres of faces, shells and solids).
4290 def SubShapeSorted(self, aShape, aType, ListOfInd):
4293 It works like geompy.SubShapeSortedCentres, but has a bug
4294 (wrongly defines centres of faces, shells and solids).
4297 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
4298 for ind in ListOfInd:
4299 ListOfIDs.append(AllShapeIDsList[ind - 1])
4300 anObj = self.GetSubShape(aShape, ListOfIDs)
4303 # end of l4_decompose_d
4306 ## @addtogroup l3_healing
4309 ## Apply a sequence of Shape Healing operators to the given object.
4310 # @param theShape Shape to be processed.
4311 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4312 # @param theParameters List of names of parameters
4313 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4314 # @param theValues List of values of parameters, in the same order
4315 # as parameters are listed in <VAR>theParameters</VAR> list.
4318 # <b> Operators and Parameters: </b> \n
4320 # * \b FixShape - corrects invalid shapes. \n
4321 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4322 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4324 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4325 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4326 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4327 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4329 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4330 # surfaces in segments using a certain angle. \n
4331 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4332 # if Angle=180, four if Angle=90, etc). \n
4333 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4335 # * \b SplitClosedFaces - splits closed faces in segments.
4336 # The number of segments depends on the number of splitting points.\n
4337 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4339 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4340 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4341 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4342 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4343 # This and the previous parameters can take the following values:\n
4344 # \b Parametric \b Continuity \n
4345 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4346 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4347 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4348 # ruling out sharp edges).\n
4349 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4350 # are of the same magnitude).\n
4351 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4352 # or surfaces (d/du C(u)) are the same at junction. \n
4353 # \b Geometric \b Continuity \n
4354 # \b G1: first derivatives are proportional at junction.\n
4355 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4356 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4357 # \b G2: first and second derivatives are proportional at junction.
4358 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4359 # continuity requires that the underlying parameterization was continuous as well.
4360 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4362 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4363 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4364 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4365 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4366 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4367 # with the specified parameters.\n
4368 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4369 # with the specified parameters.\n
4370 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4371 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4372 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4373 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4375 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4376 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4377 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4378 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4379 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4381 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4382 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4385 # @return New GEOM.GEOM_Object, containing processed shape.
4387 # \n @ref tui_shape_processing "Example"
4388 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4390 Apply a sequence of Shape Healing operators to the given object.
4393 theShape Shape to be processed.
4394 theValues List of values of parameters, in the same order
4395 as parameters are listed in theParameters list.
4396 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4397 theParameters List of names of parameters
4398 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4399 Operators and Parameters:
4401 * FixShape - corrects invalid shapes.
4402 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4403 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4404 * FixFaceSize - removes small faces, such as spots and strips.
4405 * FixFaceSize.Tolerance - defines minimum possible face size.
4406 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4407 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4408 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4409 in segments using a certain angle.
4410 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4411 if Angle=180, four if Angle=90, etc).
4412 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4413 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4415 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4416 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4417 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4418 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4419 * SplitContinuity.CurveContinuity - required continuity for curves.
4420 This and the previous parameters can take the following values:
4422 Parametric Continuity:
4423 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4424 coincidental. The curves or surfaces may still meet at an angle,
4425 giving rise to a sharp corner or edge).
4426 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4427 are parallel, ruling out sharp edges).
4428 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4429 or surfaces are of the same magnitude).
4430 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4431 curves or surfaces (d/du C(u)) are the same at junction.
4433 Geometric Continuity:
4434 G1: first derivatives are proportional at junction.
4435 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4436 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4437 G2: first and second derivatives are proportional at junction. As the names imply,
4438 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4439 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4440 geometric continuity of order n, but not vice-versa.
4441 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4442 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4443 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4444 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4445 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4446 the specified parameters.
4447 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4448 the specified parameters.
4449 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4450 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4451 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4452 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4453 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4454 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4455 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4456 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4457 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4458 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4459 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4462 New GEOM.GEOM_Object, containing processed shape.
4464 Note: For more information look through SALOME Geometry User's Guide->
4465 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4467 # Example: see GEOM_TestHealing.py
4468 theValues,Parameters = ParseList(theValues)
4469 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4470 # To avoid script failure in case of good argument shape
4471 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4473 RaiseIfFailed("ProcessShape", self.HealOp)
4474 for string in (theOperators + theParameters):
4475 Parameters = ":" + Parameters
4477 anObj.SetParameters(Parameters)
4480 ## Remove faces from the given object (shape).
4481 # @param theObject Shape to be processed.
4482 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4483 # removes ALL faces of the given object.
4484 # @return New GEOM.GEOM_Object, containing processed shape.
4486 # @ref tui_suppress_faces "Example"
4487 def SuppressFaces(self,theObject, theFaces):
4489 Remove faces from the given object (shape).
4492 theObject Shape to be processed.
4493 theFaces Indices of faces to be removed, if EMPTY then the method
4494 removes ALL faces of the given object.
4497 New GEOM.GEOM_Object, containing processed shape.
4499 # Example: see GEOM_TestHealing.py
4500 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4501 RaiseIfFailed("SuppressFaces", self.HealOp)
4504 ## Sewing of some shapes into single shape.
4505 # @param ListShape Shapes to be processed.
4506 # @param theTolerance Required tolerance value.
4507 # @return New GEOM.GEOM_Object, containing processed shape.
4509 # @ref tui_sewing "Example"
4510 def MakeSewing(self, ListShape, theTolerance):
4512 Sewing of some shapes into single shape.
4515 ListShape Shapes to be processed.
4516 theTolerance Required tolerance value.
4519 New GEOM.GEOM_Object, containing processed shape.
4521 # Example: see GEOM_TestHealing.py
4522 comp = self.MakeCompound(ListShape)
4523 anObj = self.Sew(comp, theTolerance)
4526 ## Sewing of the given object.
4527 # @param theObject Shape to be processed.
4528 # @param theTolerance Required tolerance value.
4529 # @return New GEOM.GEOM_Object, containing processed shape.
4530 def Sew(self, theObject, theTolerance):
4532 Sewing of the given object.
4535 theObject Shape to be processed.
4536 theTolerance Required tolerance value.
4539 New GEOM.GEOM_Object, containing processed shape.
4541 # Example: see MakeSewing() above
4542 theTolerance,Parameters = ParseParameters(theTolerance)
4543 anObj = self.HealOp.Sew(theObject, theTolerance)
4544 RaiseIfFailed("Sew", self.HealOp)
4545 anObj.SetParameters(Parameters)
4548 ## Remove internal wires and edges from the given object (face).
4549 # @param theObject Shape to be processed.
4550 # @param theWires Indices of wires to be removed, if EMPTY then the method
4551 # removes ALL internal wires of the given object.
4552 # @return New GEOM.GEOM_Object, containing processed shape.
4554 # @ref tui_suppress_internal_wires "Example"
4555 def SuppressInternalWires(self,theObject, theWires):
4557 Remove internal wires and edges from the given object (face).
4560 theObject Shape to be processed.
4561 theWires Indices of wires to be removed, if EMPTY then the method
4562 removes ALL internal wires of the given object.
4565 New GEOM.GEOM_Object, containing processed shape.
4567 # Example: see GEOM_TestHealing.py
4568 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4569 RaiseIfFailed("RemoveIntWires", self.HealOp)
4572 ## Remove internal closed contours (holes) from the given object.
4573 # @param theObject Shape to be processed.
4574 # @param theWires Indices of wires to be removed, if EMPTY then the method
4575 # removes ALL internal holes of the given object
4576 # @return New GEOM.GEOM_Object, containing processed shape.
4578 # @ref tui_suppress_holes "Example"
4579 def SuppressHoles(self,theObject, theWires):
4581 Remove internal closed contours (holes) from the given object.
4584 theObject Shape to be processed.
4585 theWires Indices of wires to be removed, if EMPTY then the method
4586 removes ALL internal holes of the given object
4589 New GEOM.GEOM_Object, containing processed shape.
4591 # Example: see GEOM_TestHealing.py
4592 anObj = self.HealOp.FillHoles(theObject, theWires)
4593 RaiseIfFailed("FillHoles", self.HealOp)
4596 ## Close an open wire.
4597 # @param theObject Shape to be processed.
4598 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4599 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4600 # @param isCommonVertex If True : closure by creation of a common vertex,
4601 # If False : closure by creation of an edge between ends.
4602 # @return New GEOM.GEOM_Object, containing processed shape.
4604 # @ref tui_close_contour "Example"
4605 def CloseContour(self,theObject, theWires, isCommonVertex):
4610 theObject Shape to be processed.
4611 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4612 if [ ], then theObject itself is a wire.
4613 isCommonVertex If True : closure by creation of a common vertex,
4614 If False : closure by creation of an edge between ends.
4617 New GEOM.GEOM_Object, containing processed shape.
4619 # Example: see GEOM_TestHealing.py
4620 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4621 RaiseIfFailed("CloseContour", self.HealOp)
4624 ## Addition of a point to a given edge object.
4625 # @param theObject Shape to be processed.
4626 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4627 # if -1, then theObject itself is the edge.
4628 # @param theValue Value of parameter on edge or length parameter,
4629 # depending on \a isByParameter.
4630 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4631 # if FALSE : \a theValue is treated as a length parameter [0..1]
4632 # @return New GEOM.GEOM_Object, containing processed shape.
4634 # @ref tui_add_point_on_edge "Example"
4635 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4637 Addition of a point to a given edge object.
4640 theObject Shape to be processed.
4641 theEdgeIndex Index of edge to be divided within theObject's shape,
4642 if -1, then theObject itself is the edge.
4643 theValue Value of parameter on edge or length parameter,
4644 depending on isByParameter.
4645 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4646 if FALSE : theValue is treated as a length parameter [0..1]
4649 New GEOM.GEOM_Object, containing processed shape.
4651 # Example: see GEOM_TestHealing.py
4652 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4653 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4654 RaiseIfFailed("DivideEdge", self.HealOp)
4655 anObj.SetParameters(Parameters)
4658 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4659 # @param theWire Wire to minimize the number of C1 continuous edges in.
4660 # @param theVertices A list of vertices to suppress. If the list
4661 # is empty, all vertices in a wire will be assumed.
4662 # @return New GEOM.GEOM_Object with modified wire.
4664 # @ref tui_fuse_collinear_edges "Example"
4665 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4667 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4670 theWire Wire to minimize the number of C1 continuous edges in.
4671 theVertices A list of vertices to suppress. If the list
4672 is empty, all vertices in a wire will be assumed.
4675 New GEOM.GEOM_Object with modified wire.
4677 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4678 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4681 ## Change orientation of the given object. Updates given shape.
4682 # @param theObject Shape to be processed.
4683 # @return Updated <var>theObject</var>
4685 # @ref swig_todo "Example"
4686 def ChangeOrientationShell(self,theObject):
4688 Change orientation of the given object. Updates given shape.
4691 theObject Shape to be processed.
4696 theObject = self.HealOp.ChangeOrientation(theObject)
4697 RaiseIfFailed("ChangeOrientation", self.HealOp)
4700 ## Change orientation of the given object.
4701 # @param theObject Shape to be processed.
4702 # @return New GEOM.GEOM_Object, containing processed shape.
4704 # @ref swig_todo "Example"
4705 def ChangeOrientationShellCopy(self, theObject):
4707 Change orientation of the given object.
4710 theObject Shape to be processed.
4713 New GEOM.GEOM_Object, containing processed shape.
4715 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4716 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4719 ## Try to limit tolerance of the given object by value \a theTolerance.
4720 # @param theObject Shape to be processed.
4721 # @param theTolerance Required tolerance value.
4722 # @return New GEOM.GEOM_Object, containing processed shape.
4724 # @ref tui_limit_tolerance "Example"
4725 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4727 Try to limit tolerance of the given object by value theTolerance.
4730 theObject Shape to be processed.
4731 theTolerance Required tolerance value.
4734 New GEOM.GEOM_Object, containing processed shape.
4736 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4737 RaiseIfFailed("LimitTolerance", self.HealOp)
4740 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4741 # that constitute a free boundary of the given shape.
4742 # @param theObject Shape to get free boundary of.
4743 # @return [\a status, \a theClosedWires, \a theOpenWires]
4744 # \n \a status: FALSE, if an error(s) occured during the method execution.
4745 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4746 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4748 # @ref tui_measurement_tools_page "Example"
4749 def GetFreeBoundary(self, theObject):
4751 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4752 that constitute a free boundary of the given shape.
4755 theObject Shape to get free boundary of.
4758 [status, theClosedWires, theOpenWires]
4759 status: FALSE, if an error(s) occured during the method execution.
4760 theClosedWires: Closed wires on the free boundary of the given shape.
4761 theOpenWires: Open wires on the free boundary of the given shape.
4763 # Example: see GEOM_TestHealing.py
4764 anObj = self.HealOp.GetFreeBoundary(theObject)
4765 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4768 ## Replace coincident faces in theShape by one face.
4769 # @param theShape Initial shape.
4770 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4771 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4772 # otherwise all initial shapes.
4773 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4775 # @ref tui_glue_faces "Example"
4776 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4778 Replace coincident faces in theShape by one face.
4781 theShape Initial shape.
4782 theTolerance Maximum distance between faces, which can be considered as coincident.
4783 doKeepNonSolids If FALSE, only solids will present in the result,
4784 otherwise all initial shapes.
4787 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4789 # Example: see GEOM_Spanner.py
4790 theTolerance,Parameters = ParseParameters(theTolerance)
4791 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4793 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4794 anObj.SetParameters(Parameters)
4797 ## Find coincident faces in theShape for possible gluing.
4798 # @param theShape Initial shape.
4799 # @param theTolerance Maximum distance between faces,
4800 # which can be considered as coincident.
4801 # @return GEOM.ListOfGO
4803 # @ref tui_glue_faces "Example"
4804 def GetGlueFaces(self, theShape, theTolerance):
4806 Find coincident faces in theShape for possible gluing.
4809 theShape Initial shape.
4810 theTolerance Maximum distance between faces,
4811 which can be considered as coincident.
4816 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4817 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4820 ## Replace coincident faces in theShape by one face
4821 # in compliance with given list of faces
4822 # @param theShape Initial shape.
4823 # @param theTolerance Maximum distance between faces,
4824 # which can be considered as coincident.
4825 # @param theFaces List of faces for gluing.
4826 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4827 # otherwise all initial shapes.
4828 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4829 # will be glued, otherwise only the edges,
4830 # belonging to <VAR>theFaces</VAR>.
4831 # @return New GEOM.GEOM_Object, containing a copy of theShape
4832 # without some faces.
4834 # @ref tui_glue_faces "Example"
4835 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4836 doKeepNonSolids=True, doGlueAllEdges=True):
4838 Replace coincident faces in theShape by one face
4839 in compliance with given list of faces
4842 theShape Initial shape.
4843 theTolerance Maximum distance between faces,
4844 which can be considered as coincident.
4845 theFaces List of faces for gluing.
4846 doKeepNonSolids If FALSE, only solids will present in the result,
4847 otherwise all initial shapes.
4848 doGlueAllEdges If TRUE, all coincident edges of theShape
4849 will be glued, otherwise only the edges,
4850 belonging to theFaces.
4853 New GEOM.GEOM_Object, containing a copy of theShape
4856 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4857 doKeepNonSolids, doGlueAllEdges)
4859 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4862 ## Replace coincident edges in theShape by one edge.
4863 # @param theShape Initial shape.
4864 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
4865 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4867 # @ref tui_glue_edges "Example"
4868 def MakeGlueEdges(self, theShape, theTolerance):
4870 Replace coincident edges in theShape by one edge.
4873 theShape Initial shape.
4874 theTolerance Maximum distance between edges, which can be considered as coincident.
4877 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4879 theTolerance,Parameters = ParseParameters(theTolerance)
4880 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
4882 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
4883 anObj.SetParameters(Parameters)
4886 ## Find coincident edges in theShape for possible gluing.
4887 # @param theShape Initial shape.
4888 # @param theTolerance Maximum distance between edges,
4889 # which can be considered as coincident.
4890 # @return GEOM.ListOfGO
4892 # @ref tui_glue_edges "Example"
4893 def GetGlueEdges(self, theShape, theTolerance):
4895 Find coincident edges in theShape for possible gluing.
4898 theShape Initial shape.
4899 theTolerance Maximum distance between edges,
4900 which can be considered as coincident.
4905 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
4906 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
4909 ## Replace coincident edges in theShape by one edge
4910 # in compliance with given list of edges.
4911 # @param theShape Initial shape.
4912 # @param theTolerance Maximum distance between edges,
4913 # which can be considered as coincident.
4914 # @param theEdges List of edges for gluing.
4915 # @return New GEOM.GEOM_Object, containing a copy of theShape
4916 # without some edges.
4918 # @ref tui_glue_edges "Example"
4919 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
4921 Replace coincident edges in theShape by one edge
4922 in compliance with given list of edges.
4925 theShape Initial shape.
4926 theTolerance Maximum distance between edges,
4927 which can be considered as coincident.
4928 theEdges List of edges for gluing.
4931 New GEOM.GEOM_Object, containing a copy of theShape
4934 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
4936 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
4942 ## @addtogroup l3_boolean Boolean Operations
4945 # -----------------------------------------------------------------------------
4946 # Boolean (Common, Cut, Fuse, Section)
4947 # -----------------------------------------------------------------------------
4949 ## Perform one of boolean operations on two given shapes.
4950 # @param theShape1 First argument for boolean operation.
4951 # @param theShape2 Second argument for boolean operation.
4952 # @param theOperation Indicates the operation to be done:\n
4953 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
4954 # @return New GEOM.GEOM_Object, containing the result shape.
4956 # @ref tui_fuse "Example"
4957 def MakeBoolean(self,theShape1, theShape2, theOperation):
4959 Perform one of boolean operations on two given shapes.
4962 theShape1 First argument for boolean operation.
4963 theShape2 Second argument for boolean operation.
4964 theOperation Indicates the operation to be done:
4965 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
4968 New GEOM.GEOM_Object, containing the result shape.
4970 # Example: see GEOM_TestAll.py
4971 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
4972 RaiseIfFailed("MakeBoolean", self.BoolOp)
4975 ## Perform Common boolean operation on two given shapes.
4976 # @param theShape1 First argument for boolean operation.
4977 # @param theShape2 Second argument for boolean operation.
4978 # @return New GEOM.GEOM_Object, containing the result shape.
4980 # @ref tui_common "Example 1"
4981 # \n @ref swig_MakeCommon "Example 2"
4982 def MakeCommon(self, theShape1, theShape2):
4984 Perform Common boolean operation on two given shapes.
4987 theShape1 First argument for boolean operation.
4988 theShape2 Second argument for boolean operation.
4991 New GEOM.GEOM_Object, containing the result shape.
4993 # Example: see GEOM_TestOthers.py
4994 return self.MakeBoolean(theShape1, theShape2, 1)
4996 ## Perform Cut boolean operation on two given shapes.
4997 # @param theShape1 First argument for boolean operation.
4998 # @param theShape2 Second argument for boolean operation.
4999 # @return New GEOM.GEOM_Object, containing the result shape.
5001 # @ref tui_cut "Example 1"
5002 # \n @ref swig_MakeCommon "Example 2"
5003 def MakeCut(self, theShape1, theShape2):
5005 Perform Cut boolean operation on two given shapes.
5008 theShape1 First argument for boolean operation.
5009 theShape2 Second argument for boolean operation.
5012 New GEOM.GEOM_Object, containing the result shape.
5015 # Example: see GEOM_TestOthers.py
5016 return self.MakeBoolean(theShape1, theShape2, 2)
5018 ## Perform Fuse boolean operation on two given shapes.
5019 # @param theShape1 First argument for boolean operation.
5020 # @param theShape2 Second argument for boolean operation.
5021 # @return New GEOM.GEOM_Object, containing the result shape.
5023 # @ref tui_fuse "Example 1"
5024 # \n @ref swig_MakeCommon "Example 2"
5025 def MakeFuse(self, theShape1, theShape2):
5027 Perform Fuse boolean operation on two given shapes.
5030 theShape1 First argument for boolean operation.
5031 theShape2 Second argument for boolean operation.
5034 New GEOM.GEOM_Object, containing the result shape.
5037 # Example: see GEOM_TestOthers.py
5038 return self.MakeBoolean(theShape1, theShape2, 3)
5040 ## Perform Section boolean operation on two given shapes.
5041 # @param theShape1 First argument for boolean operation.
5042 # @param theShape2 Second argument for boolean operation.
5043 # @return New GEOM.GEOM_Object, containing the result shape.
5045 # @ref tui_section "Example 1"
5046 # \n @ref swig_MakeCommon "Example 2"
5047 def MakeSection(self, theShape1, theShape2):
5049 Perform Section boolean operation on two given shapes.
5052 theShape1 First argument for boolean operation.
5053 theShape2 Second argument for boolean operation.
5056 New GEOM.GEOM_Object, containing the result shape.
5059 # Example: see GEOM_TestOthers.py
5060 return self.MakeBoolean(theShape1, theShape2, 4)
5065 ## @addtogroup l3_basic_op
5068 ## Perform partition operation.
5069 # @param ListShapes Shapes to be intersected.
5070 # @param ListTools Shapes to intersect theShapes.
5071 # @param Limit Type of resulting shapes (see ShapeType()).\n
5072 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
5073 # type will be detected automatically.
5074 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5075 # target type (equal to Limit) are kept in the result,
5076 # else standalone shapes of lower dimension
5077 # are kept also (if they exist).
5078 # @note Each compound from ListShapes and ListTools will be exploded
5079 # in order to avoid possible intersection between shapes from this compound.
5081 # After implementation new version of PartitionAlgo (October 2006)
5082 # other parameters are ignored by current functionality. They are kept
5083 # in this function only for support old versions.
5084 # @param ListKeepInside Shapes, outside which the results will be deleted.
5085 # Each shape from theKeepInside must belong to theShapes also.
5086 # @param ListRemoveInside Shapes, inside which the results will be deleted.
5087 # Each shape from theRemoveInside must belong to theShapes also.
5088 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5089 # @param ListMaterials Material indices for each shape. Make sence,
5090 # only if theRemoveWebs is TRUE.
5092 # @return New GEOM.GEOM_Object, containing the result shapes.
5094 # @ref tui_partition "Example"
5095 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5096 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5097 KeepNonlimitShapes=0):
5099 Perform partition operation.
5102 ListShapes Shapes to be intersected.
5103 ListTools Shapes to intersect theShapes.
5104 Limit Type of resulting shapes (see geompy.ShapeType)
5105 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5106 type will be detected automatically.
5107 KeepNonlimitShapes if this parameter == 0, then only shapes of
5108 target type (equal to Limit) are kept in the result,
5109 else standalone shapes of lower dimension
5110 are kept also (if they exist).
5112 Each compound from ListShapes and ListTools will be exploded
5113 in order to avoid possible intersection between shapes from
5116 After implementation new version of PartitionAlgo (October 2006) other
5117 parameters are ignored by current functionality. They are kept in this
5118 function only for support old versions.
5121 ListKeepInside Shapes, outside which the results will be deleted.
5122 Each shape from theKeepInside must belong to theShapes also.
5123 ListRemoveInside Shapes, inside which the results will be deleted.
5124 Each shape from theRemoveInside must belong to theShapes also.
5125 RemoveWebs If TRUE, perform Glue 3D algorithm.
5126 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5129 New GEOM.GEOM_Object, containing the result shapes.
5131 # Example: see GEOM_TestAll.py
5132 if Limit == ShapeType["AUTO"]:
5133 # automatic detection of the most appropriate shape limit type
5135 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5136 Limit = EnumToLong(lim)
5138 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5139 ListKeepInside, ListRemoveInside,
5140 Limit, RemoveWebs, ListMaterials,
5141 KeepNonlimitShapes);
5142 RaiseIfFailed("MakePartition", self.BoolOp)
5145 ## Perform partition operation.
5146 # This method may be useful if it is needed to make a partition for
5147 # compound contains nonintersected shapes. Performance will be better
5148 # since intersection between shapes from compound is not performed.
5150 # Description of all parameters as in previous method MakePartition()
5152 # @note Passed compounds (via ListShapes or via ListTools)
5153 # have to consist of nonintersecting shapes.
5155 # @return New GEOM.GEOM_Object, containing the result shapes.
5157 # @ref swig_todo "Example"
5158 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5159 ListKeepInside=[], ListRemoveInside=[],
5160 Limit=ShapeType["AUTO"], RemoveWebs=0,
5161 ListMaterials=[], KeepNonlimitShapes=0):
5163 Perform partition operation.
5164 This method may be useful if it is needed to make a partition for
5165 compound contains nonintersected shapes. Performance will be better
5166 since intersection between shapes from compound is not performed.
5169 Description of all parameters as in method geompy.MakePartition
5172 Passed compounds (via ListShapes or via ListTools)
5173 have to consist of nonintersecting shapes.
5176 New GEOM.GEOM_Object, containing the result shapes.
5178 if Limit == ShapeType["AUTO"]:
5179 # automatic detection of the most appropriate shape limit type
5181 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5182 Limit = EnumToLong(lim)
5184 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5185 ListKeepInside, ListRemoveInside,
5186 Limit, RemoveWebs, ListMaterials,
5187 KeepNonlimitShapes);
5188 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5191 ## See method MakePartition() for more information.
5193 # @ref tui_partition "Example 1"
5194 # \n @ref swig_Partition "Example 2"
5195 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5196 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5197 KeepNonlimitShapes=0):
5199 See method geompy.MakePartition for more information.
5201 # Example: see GEOM_TestOthers.py
5202 anObj = self.MakePartition(ListShapes, ListTools,
5203 ListKeepInside, ListRemoveInside,
5204 Limit, RemoveWebs, ListMaterials,
5205 KeepNonlimitShapes);
5208 ## Perform partition of the Shape with the Plane
5209 # @param theShape Shape to be intersected.
5210 # @param thePlane Tool shape, to intersect theShape.
5211 # @return New GEOM.GEOM_Object, containing the result shape.
5213 # @ref tui_partition "Example"
5214 def MakeHalfPartition(self,theShape, thePlane):
5216 Perform partition of the Shape with the Plane
5219 theShape Shape to be intersected.
5220 thePlane Tool shape, to intersect theShape.
5223 New GEOM.GEOM_Object, containing the result shape.
5225 # Example: see GEOM_TestAll.py
5226 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5227 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5230 # end of l3_basic_op
5233 ## @addtogroup l3_transform
5236 ## Translate the given object along the vector, specified
5237 # by its end points, creating its copy before the translation.
5238 # @param theObject The object to be translated.
5239 # @param thePoint1 Start point of translation vector.
5240 # @param thePoint2 End point of translation vector.
5241 # @return New GEOM.GEOM_Object, containing the translated object.
5243 # @ref tui_translation "Example 1"
5244 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5245 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5247 Translate the given object along the vector, specified
5248 by its end points, creating its copy before the translation.
5251 theObject The object to be translated.
5252 thePoint1 Start point of translation vector.
5253 thePoint2 End point of translation vector.
5256 New GEOM.GEOM_Object, containing the translated object.
5258 # Example: see GEOM_TestAll.py
5259 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5260 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5263 ## Translate the given object along the vector, specified by its components.
5264 # @param theObject The object to be translated.
5265 # @param theDX,theDY,theDZ Components of translation vector.
5266 # @return Translated GEOM.GEOM_Object.
5268 # @ref tui_translation "Example"
5269 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5271 Translate the given object along the vector, specified by its components.
5274 theObject The object to be translated.
5275 theDX,theDY,theDZ Components of translation vector.
5278 Translated GEOM.GEOM_Object.
5280 # Example: see GEOM_TestAll.py
5281 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5282 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5283 anObj.SetParameters(Parameters)
5284 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5287 ## Translate the given object along the vector, specified
5288 # by its components, creating its copy before the translation.
5289 # @param theObject The object to be translated.
5290 # @param theDX,theDY,theDZ Components of translation vector.
5291 # @return New GEOM.GEOM_Object, containing the translated object.
5293 # @ref tui_translation "Example"
5294 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5296 Translate the given object along the vector, specified
5297 by its components, creating its copy before the translation.
5300 theObject The object to be translated.
5301 theDX,theDY,theDZ Components of translation vector.
5304 New GEOM.GEOM_Object, containing the translated object.
5306 # Example: see GEOM_TestAll.py
5307 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5308 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5309 anObj.SetParameters(Parameters)
5310 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5313 ## Translate the given object along the given vector,
5314 # creating its copy before the translation.
5315 # @param theObject The object to be translated.
5316 # @param theVector The translation vector.
5317 # @return New GEOM.GEOM_Object, containing the translated object.
5319 # @ref tui_translation "Example"
5320 def MakeTranslationVector(self,theObject, theVector):
5322 Translate the given object along the given vector,
5323 creating its copy before the translation.
5326 theObject The object to be translated.
5327 theVector The translation vector.
5330 New GEOM.GEOM_Object, containing the translated object.
5332 # Example: see GEOM_TestAll.py
5333 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5334 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5337 ## Translate the given object along the given vector on given distance.
5338 # @param theObject The object to be translated.
5339 # @param theVector The translation vector.
5340 # @param theDistance The translation distance.
5341 # @param theCopy Flag used to translate object itself or create a copy.
5342 # @return New GEOM.GEOM_Object, containing the translated object.
5344 # @ref tui_translation "Example"
5345 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5347 Translate the given object along the given vector on given distance.
5350 theObject The object to be translated.
5351 theVector The translation vector.
5352 theDistance The translation distance.
5353 theCopy Flag used to translate object itself or create a copy.
5356 New GEOM.GEOM_Object, containing the translated object.
5358 # Example: see GEOM_TestAll.py
5359 theDistance,Parameters = ParseParameters(theDistance)
5360 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5361 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5362 anObj.SetParameters(Parameters)
5365 ## Translate the given object along the given vector on given distance,
5366 # creating its copy before the translation.
5367 # @param theObject The object to be translated.
5368 # @param theVector The translation vector.
5369 # @param theDistance The translation distance.
5370 # @return New GEOM.GEOM_Object, containing the translated object.
5372 # @ref tui_translation "Example"
5373 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5375 Translate the given object along the given vector on given distance,
5376 creating its copy before the translation.
5379 theObject The object to be translated.
5380 theVector The translation vector.
5381 theDistance The translation distance.
5384 New GEOM.GEOM_Object, containing the translated object.
5386 # Example: see GEOM_TestAll.py
5387 theDistance,Parameters = ParseParameters(theDistance)
5388 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5389 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5390 anObj.SetParameters(Parameters)
5393 ## Rotate the given object around the given axis on the given angle.
5394 # @param theObject The object to be rotated.
5395 # @param theAxis Rotation axis.
5396 # @param theAngle Rotation angle in radians.
5397 # @return New GEOM.GEOM_Object, containing the rotated object.
5399 # @ref tui_rotation "Example"
5400 def Rotate(self,theObject, theAxis, theAngle):
5402 Rotate the given object around the given axis on the given angle.
5405 theObject The object to be rotated.
5406 theAxis Rotation axis.
5407 theAngle Rotation angle in radians.
5410 New GEOM.GEOM_Object, containing the rotated object.
5412 # Example: see GEOM_TestAll.py
5414 if isinstance(theAngle,str):
5416 theAngle, Parameters = ParseParameters(theAngle)
5418 theAngle = theAngle*math.pi/180.0
5419 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5420 RaiseIfFailed("RotateCopy", self.TrsfOp)
5421 anObj.SetParameters(Parameters)
5424 ## Rotate the given object around the given axis
5425 # on the given angle, creating its copy before the rotatation.
5426 # @param theObject The object to be rotated.
5427 # @param theAxis Rotation axis.
5428 # @param theAngle Rotation angle in radians.
5429 # @return New GEOM.GEOM_Object, containing the rotated object.
5431 # @ref tui_rotation "Example"
5432 def MakeRotation(self,theObject, theAxis, theAngle):
5434 Rotate the given object around the given axis
5435 on the given angle, creating its copy before the rotatation.
5438 theObject The object to be rotated.
5439 theAxis Rotation axis.
5440 theAngle Rotation angle in radians.
5443 New GEOM.GEOM_Object, containing the rotated object.
5445 # Example: see GEOM_TestAll.py
5447 if isinstance(theAngle,str):
5449 theAngle, Parameters = ParseParameters(theAngle)
5451 theAngle = theAngle*math.pi/180.0
5452 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5453 RaiseIfFailed("RotateCopy", self.TrsfOp)
5454 anObj.SetParameters(Parameters)
5457 ## Rotate given object around vector perpendicular to plane
5458 # containing three points, creating its copy before the rotatation.
5459 # @param theObject The object to be rotated.
5460 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5461 # containing the three points.
5462 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5463 # @return New GEOM.GEOM_Object, containing the rotated object.
5465 # @ref tui_rotation "Example"
5466 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5468 Rotate given object around vector perpendicular to plane
5469 containing three points, creating its copy before the rotatation.
5472 theObject The object to be rotated.
5473 theCentPoint central point the axis is the vector perpendicular to the plane
5474 containing the three points.
5475 thePoint1,thePoint2 in a perpendicular plane of the axis.
5478 New GEOM.GEOM_Object, containing the rotated object.
5480 # Example: see GEOM_TestAll.py
5481 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5482 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5485 ## Scale the given object by the factor, creating its copy before the scaling.
5486 # @param theObject The object to be scaled.
5487 # @param thePoint Center point for scaling.
5488 # Passing None for it means scaling relatively the origin of global CS.
5489 # @param theFactor Scaling factor value.
5490 # @return New GEOM.GEOM_Object, containing the scaled shape.
5492 # @ref tui_scale "Example"
5493 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5495 Scale the given object by the factor, creating its copy before the scaling.
5498 theObject The object to be scaled.
5499 thePoint Center point for scaling.
5500 Passing None for it means scaling relatively the origin of global CS.
5501 theFactor Scaling factor value.
5504 New GEOM.GEOM_Object, containing the scaled shape.
5506 # Example: see GEOM_TestAll.py
5507 theFactor, Parameters = ParseParameters(theFactor)
5508 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5509 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5510 anObj.SetParameters(Parameters)
5513 ## Scale the given object by different factors along coordinate axes,
5514 # creating its copy before the scaling.
5515 # @param theObject The object to be scaled.
5516 # @param thePoint Center point for scaling.
5517 # Passing None for it means scaling relatively the origin of global CS.
5518 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5519 # @return New GEOM.GEOM_Object, containing the scaled shape.
5521 # @ref swig_scale "Example"
5522 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5524 Scale the given object by different factors along coordinate axes,
5525 creating its copy before the scaling.
5528 theObject The object to be scaled.
5529 thePoint Center point for scaling.
5530 Passing None for it means scaling relatively the origin of global CS.
5531 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5534 New GEOM.GEOM_Object, containing the scaled shape.
5536 # Example: see GEOM_TestAll.py
5537 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5538 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5539 theFactorX, theFactorY, theFactorZ)
5540 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5541 anObj.SetParameters(Parameters)
5544 ## Create an object, symmetrical
5545 # to the given one relatively the given plane.
5546 # @param theObject The object to be mirrored.
5547 # @param thePlane Plane of symmetry.
5548 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5550 # @ref tui_mirror "Example"
5551 def MakeMirrorByPlane(self,theObject, thePlane):
5553 Create an object, symmetrical to the given one relatively the given plane.
5556 theObject The object to be mirrored.
5557 thePlane Plane of symmetry.
5560 New GEOM.GEOM_Object, containing the mirrored shape.
5562 # Example: see GEOM_TestAll.py
5563 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5564 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5567 ## Create an object, symmetrical
5568 # to the given one relatively the given axis.
5569 # @param theObject The object to be mirrored.
5570 # @param theAxis Axis of symmetry.
5571 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5573 # @ref tui_mirror "Example"
5574 def MakeMirrorByAxis(self,theObject, theAxis):
5576 Create an object, symmetrical to the given one relatively the given axis.
5579 theObject The object to be mirrored.
5580 theAxis Axis of symmetry.
5583 New GEOM.GEOM_Object, containing the mirrored shape.
5585 # Example: see GEOM_TestAll.py
5586 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5587 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5590 ## Create an object, symmetrical
5591 # to the given one relatively the given point.
5592 # @param theObject The object to be mirrored.
5593 # @param thePoint Point of symmetry.
5594 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5596 # @ref tui_mirror "Example"
5597 def MakeMirrorByPoint(self,theObject, thePoint):
5599 Create an object, symmetrical
5600 to the given one relatively the given point.
5603 theObject The object to be mirrored.
5604 thePoint Point of symmetry.
5607 New GEOM.GEOM_Object, containing the mirrored shape.
5609 # Example: see GEOM_TestAll.py
5610 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5611 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5614 ## Modify the Location of the given object by LCS,
5615 # creating its copy before the setting.
5616 # @param theObject The object to be displaced.
5617 # @param theStartLCS Coordinate system to perform displacement from it.\n
5618 # If \a theStartLCS is NULL, displacement
5619 # will be performed from global CS.\n
5620 # If \a theObject itself is used as \a theStartLCS,
5621 # its location will be changed to \a theEndLCS.
5622 # @param theEndLCS Coordinate system to perform displacement to it.
5623 # @return New GEOM.GEOM_Object, containing the displaced shape.
5625 # @ref tui_modify_location "Example"
5626 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5628 Modify the Location of the given object by LCS, creating its copy before the setting.
5631 theObject The object to be displaced.
5632 theStartLCS Coordinate system to perform displacement from it.
5633 If theStartLCS is NULL, displacement
5634 will be performed from global CS.
5635 If theObject itself is used as theStartLCS,
5636 its location will be changed to theEndLCS.
5637 theEndLCS Coordinate system to perform displacement to it.
5640 New GEOM.GEOM_Object, containing the displaced shape.
5643 # create local coordinate systems
5644 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5645 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5646 # modify the location of the given object
5647 position = geompy.MakePosition(cylinder, cs1, cs2)
5649 # Example: see GEOM_TestAll.py
5650 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5651 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5654 ## Modify the Location of the given object by Path,
5655 # @param theObject The object to be displaced.
5656 # @param thePath Wire or Edge along that the object will be translated.
5657 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5658 # @param theCopy is to create a copy objects if true.
5659 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5660 # @return New GEOM.GEOM_Object, containing the displaced shape.
5662 # @ref tui_modify_location "Example"
5663 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5665 Modify the Location of the given object by Path
5668 theObject The object to be displaced.
5669 thePath Wire or Edge along that the object will be translated.
5670 theDistance progress of Path (0 = start location, 1 = end of path location).
5671 theCopy is to create a copy objects if true.
5672 theReverse 0 - for usual direction, 1 - to reverse path direction.
5675 New GEOM.GEOM_Object, containing the displaced shape.
5678 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5680 # Example: see GEOM_TestAll.py
5681 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5682 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5685 ## Create new object as offset of the given one.
5686 # @param theObject The base object for the offset.
5687 # @param theOffset Offset value.
5688 # @return New GEOM.GEOM_Object, containing the offset object.
5690 # @ref tui_offset "Example"
5691 def MakeOffset(self,theObject, theOffset):
5693 Create new object as offset of the given one.
5696 theObject The base object for the offset.
5697 theOffset Offset value.
5700 New GEOM.GEOM_Object, containing the offset object.
5703 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5704 # create a new object as offset of the given object
5705 offset = geompy.MakeOffset(box, 70.)
5707 # Example: see GEOM_TestAll.py
5708 theOffset, Parameters = ParseParameters(theOffset)
5709 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5710 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5711 anObj.SetParameters(Parameters)
5714 ## Create new object as projection of the given one on a 2D surface.
5715 # @param theSource The source object for the projection. It can be a point, edge or wire.
5716 # @param theTarget The target object. It can be planar or cylindrical face.
5717 # @return New GEOM.GEOM_Object, containing the projection.
5719 # @ref tui_projection "Example"
5720 def MakeProjection(self, theSource, theTarget):
5722 Create new object as projection of the given one on a 2D surface.
5725 theSource The source object for the projection. It can be a point, edge or wire.
5726 theTarget The target object. It can be planar or cylindrical face.
5729 New GEOM.GEOM_Object, containing the projection.
5731 # Example: see GEOM_TestAll.py
5732 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5733 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5736 # -----------------------------------------------------------------------------
5738 # -----------------------------------------------------------------------------
5740 ## Translate the given object along the given vector a given number times
5741 # @param theObject The object to be translated.
5742 # @param theVector Direction of the translation.
5743 # @param theStep Distance to translate on.
5744 # @param theNbTimes Quantity of translations to be done.
5745 # @return New GEOM.GEOM_Object, containing compound of all
5746 # the shapes, obtained after each translation.
5748 # @ref tui_multi_translation "Example"
5749 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5751 Translate the given object along the given vector a given number times
5754 theObject The object to be translated.
5755 theVector Direction of the translation.
5756 theStep Distance to translate on.
5757 theNbTimes Quantity of translations to be done.
5760 New GEOM.GEOM_Object, containing compound of all
5761 the shapes, obtained after each translation.
5764 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5766 # Example: see GEOM_TestAll.py
5767 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5768 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5769 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5770 anObj.SetParameters(Parameters)
5773 ## Conseqently apply two specified translations to theObject specified number of times.
5774 # @param theObject The object to be translated.
5775 # @param theVector1 Direction of the first translation.
5776 # @param theStep1 Step of the first translation.
5777 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5778 # @param theVector2 Direction of the second translation.
5779 # @param theStep2 Step of the second translation.
5780 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5781 # @return New GEOM.GEOM_Object, containing compound of all
5782 # the shapes, obtained after each translation.
5784 # @ref tui_multi_translation "Example"
5785 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5786 theVector2, theStep2, theNbTimes2):
5788 Conseqently apply two specified translations to theObject specified number of times.
5791 theObject The object to be translated.
5792 theVector1 Direction of the first translation.
5793 theStep1 Step of the first translation.
5794 theNbTimes1 Quantity of translations to be done along theVector1.
5795 theVector2 Direction of the second translation.
5796 theStep2 Step of the second translation.
5797 theNbTimes2 Quantity of translations to be done along theVector2.
5800 New GEOM.GEOM_Object, containing compound of all
5801 the shapes, obtained after each translation.
5804 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5806 # Example: see GEOM_TestAll.py
5807 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5808 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5809 theVector2, theStep2, theNbTimes2)
5810 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5811 anObj.SetParameters(Parameters)
5814 ## Rotate the given object around the given axis a given number times.
5815 # Rotation angle will be 2*PI/theNbTimes.
5816 # @param theObject The object to be rotated.
5817 # @param theAxis The rotation axis.
5818 # @param theNbTimes Quantity of rotations to be done.
5819 # @return New GEOM.GEOM_Object, containing compound of all the
5820 # shapes, obtained after each rotation.
5822 # @ref tui_multi_rotation "Example"
5823 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5825 Rotate the given object around the given axis a given number times.
5826 Rotation angle will be 2*PI/theNbTimes.
5829 theObject The object to be rotated.
5830 theAxis The rotation axis.
5831 theNbTimes Quantity of rotations to be done.
5834 New GEOM.GEOM_Object, containing compound of all the
5835 shapes, obtained after each rotation.
5838 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5840 # Example: see GEOM_TestAll.py
5841 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5842 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5843 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5844 anObj.SetParameters(Parameters)
5847 ## Rotate the given object around the
5848 # given axis on the given angle a given number
5849 # times and multi-translate each rotation result.
5850 # Translation direction passes through center of gravity
5851 # of rotated shape and its projection on the rotation axis.
5852 # @param theObject The object to be rotated.
5853 # @param theAxis Rotation axis.
5854 # @param theAngle Rotation angle in graduces.
5855 # @param theNbTimes1 Quantity of rotations to be done.
5856 # @param theStep Translation distance.
5857 # @param theNbTimes2 Quantity of translations to be done.
5858 # @return New GEOM.GEOM_Object, containing compound of all the
5859 # shapes, obtained after each transformation.
5861 # @ref tui_multi_rotation "Example"
5862 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5864 Rotate the given object around the
5865 given axis on the given angle a given number
5866 times and multi-translate each rotation result.
5867 Translation direction passes through center of gravity
5868 of rotated shape and its projection on the rotation axis.
5871 theObject The object to be rotated.
5872 theAxis Rotation axis.
5873 theAngle Rotation angle in graduces.
5874 theNbTimes1 Quantity of rotations to be done.
5875 theStep Translation distance.
5876 theNbTimes2 Quantity of translations to be done.
5879 New GEOM.GEOM_Object, containing compound of all the
5880 shapes, obtained after each transformation.
5883 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
5885 # Example: see GEOM_TestAll.py
5886 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
5887 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
5888 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
5889 anObj.SetParameters(Parameters)
5892 ## The same, as MultiRotate1D(), but axis is given by direction and point
5894 # @ref swig_MakeMultiRotation "Example"
5895 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
5897 The same, as geompy.MultiRotate1D, but axis is given by direction and point
5900 pz = geompy.MakeVertex(0, 0, 100)
5901 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5902 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
5904 # Example: see GEOM_TestOthers.py
5905 aVec = self.MakeLine(aPoint,aDir)
5906 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
5909 ## The same, as MultiRotate2D(), but axis is given by direction and point
5911 # @ref swig_MakeMultiRotation "Example"
5912 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
5914 The same, as MultiRotate2D(), but axis is given by direction and point
5917 pz = geompy.MakeVertex(0, 0, 100)
5918 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5919 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
5921 # Example: see GEOM_TestOthers.py
5922 aVec = self.MakeLine(aPoint,aDir)
5923 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
5926 # end of l3_transform
5929 ## @addtogroup l3_local
5932 ## Perform a fillet on all edges of the given shape.
5933 # @param theShape Shape, to perform fillet on.
5934 # @param theR Fillet radius.
5935 # @return New GEOM.GEOM_Object, containing the result shape.
5937 # @ref tui_fillet "Example 1"
5938 # \n @ref swig_MakeFilletAll "Example 2"
5939 def MakeFilletAll(self,theShape, theR):
5941 Perform a fillet on all edges of the given shape.
5944 theShape Shape, to perform fillet on.
5948 New GEOM.GEOM_Object, containing the result shape.
5951 filletall = geompy.MakeFilletAll(prism, 10.)
5953 # Example: see GEOM_TestOthers.py
5954 theR,Parameters = ParseParameters(theR)
5955 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
5956 RaiseIfFailed("MakeFilletAll", self.LocalOp)
5957 anObj.SetParameters(Parameters)
5960 ## Perform a fillet on the specified edges/faces of the given shape
5961 # @param theShape Shape, to perform fillet on.
5962 # @param theR Fillet radius.
5963 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
5964 # @param theListShapes Global indices of edges/faces to perform fillet on.
5965 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
5966 # @return New GEOM.GEOM_Object, containing the result shape.
5968 # @ref tui_fillet "Example"
5969 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
5971 Perform a fillet on the specified edges/faces of the given shape
5974 theShape Shape, to perform fillet on.
5976 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
5977 theListShapes Global indices of edges/faces to perform fillet on.
5980 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
5983 New GEOM.GEOM_Object, containing the result shape.
5986 # get the list of IDs (IDList) for the fillet
5987 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
5989 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
5990 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
5991 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
5992 # make a fillet on the specified edges of the given shape
5993 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
5995 # Example: see GEOM_TestAll.py
5996 theR,Parameters = ParseParameters(theR)
5998 if theShapeType == ShapeType["EDGE"]:
5999 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6000 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6002 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6003 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6004 anObj.SetParameters(Parameters)
6007 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6008 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6010 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6013 # get the list of IDs (IDList) for the fillet
6014 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6016 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6017 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6018 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6019 # make a fillet on the specified edges of the given shape
6020 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6022 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6024 if theShapeType == ShapeType["EDGE"]:
6025 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6026 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6028 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6029 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6030 anObj.SetParameters(Parameters)
6033 ## Perform a fillet on the specified edges of the given shape
6034 # @param theShape Wire Shape to perform fillet on.
6035 # @param theR Fillet radius.
6036 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6037 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6038 # \note The list of vertices could be empty,
6039 # in this case fillet will done done at all vertices in wire
6040 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6041 # by the length of the edges, nearest to the fillet vertex.
6042 # But sometimes the next edge is C1 continuous with the one, nearest to
6043 # the fillet point, and such two (or more) edges can be united to allow
6044 # bigger radius. Set this flag to TRUE to allow collinear edges union,
6045 # thus ignoring the secant vertex (vertices).
6046 # @return New GEOM.GEOM_Object, containing the result shape.
6048 # @ref tui_fillet2d "Example"
6049 def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6051 Perform a fillet on the specified edges of the given shape
6054 theShape Wire Shape to perform fillet on.
6056 theListOfVertexes Global indices of vertexes to perform fillet on.
6057 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6058 by the length of the edges, nearest to the fillet vertex.
6059 But sometimes the next edge is C1 continuous with the one, nearest to
6060 the fillet point, and such two (or more) edges can be united to allow
6061 bigger radius. Set this flag to TRUE to allow collinear edges union,
6062 thus ignoring the secant vertex (vertices).
6064 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6066 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6069 New GEOM.GEOM_Object, containing the result shape.
6073 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6074 # make fillet at given wire vertices with giver radius
6075 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6077 # Example: see GEOM_TestAll.py
6078 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6079 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6080 RaiseIfFailed("MakeFillet1D", self.LocalOp)
6081 anObj.SetParameters(Parameters)
6084 ## Perform a fillet at the specified vertices of the given face/shell.
6085 # @param theShape Face or Shell shape to perform fillet on.
6086 # @param theR Fillet radius.
6087 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6088 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6089 # @return New GEOM.GEOM_Object, containing the result shape.
6091 # @ref tui_fillet2d "Example"
6092 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6094 Perform a fillet at the specified vertices of the given face/shell.
6097 theShape Face or Shell shape to perform fillet on.
6099 theListOfVertexes Global indices of vertexes to perform fillet on.
6101 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6104 New GEOM.GEOM_Object, containing the result shape.
6107 face = geompy.MakeFaceHW(100, 100, 1)
6108 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6110 # Example: see GEOM_TestAll.py
6111 theR,Parameters = ParseParameters(theR)
6112 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6113 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6114 anObj.SetParameters(Parameters)
6117 ## Perform a symmetric chamfer on all edges of the given shape.
6118 # @param theShape Shape, to perform chamfer on.
6119 # @param theD Chamfer size along each face.
6120 # @return New GEOM.GEOM_Object, containing the result shape.
6122 # @ref tui_chamfer "Example 1"
6123 # \n @ref swig_MakeChamferAll "Example 2"
6124 def MakeChamferAll(self,theShape, theD):
6126 Perform a symmetric chamfer on all edges of the given shape.
6129 theShape Shape, to perform chamfer on.
6130 theD Chamfer size along each face.
6133 New GEOM.GEOM_Object, containing the result shape.
6136 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6138 # Example: see GEOM_TestOthers.py
6139 theD,Parameters = ParseParameters(theD)
6140 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6141 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6142 anObj.SetParameters(Parameters)
6145 ## Perform a chamfer on edges, common to the specified faces,
6146 # with distance D1 on the Face1
6147 # @param theShape Shape, to perform chamfer on.
6148 # @param theD1 Chamfer size along \a theFace1.
6149 # @param theD2 Chamfer size along \a theFace2.
6150 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6151 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6152 # @return New GEOM.GEOM_Object, containing the result shape.
6154 # @ref tui_chamfer "Example"
6155 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6157 Perform a chamfer on edges, common to the specified faces,
6158 with distance D1 on the Face1
6161 theShape Shape, to perform chamfer on.
6162 theD1 Chamfer size along theFace1.
6163 theD2 Chamfer size along theFace2.
6164 theFace1,theFace2 Global indices of two faces of theShape.
6167 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6170 New GEOM.GEOM_Object, containing the result shape.
6173 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6174 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6175 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6176 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6178 # Example: see GEOM_TestAll.py
6179 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6180 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6181 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6182 anObj.SetParameters(Parameters)
6185 ## Perform a chamfer on edges
6186 # @param theShape Shape, to perform chamfer on.
6187 # @param theD Chamfer length
6188 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6189 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6190 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6191 # @return New GEOM.GEOM_Object, containing the result shape.
6192 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6194 Perform a chamfer on edges
6197 theShape Shape, to perform chamfer on.
6198 theD1 Chamfer size along theFace1.
6199 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6200 theFace1,theFace2 Global indices of two faces of theShape.
6203 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6206 New GEOM.GEOM_Object, containing the result shape.
6209 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6210 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6211 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6213 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6216 if isinstance(theAngle,str):
6218 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6220 theAngle = theAngle*math.pi/180.0
6221 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6222 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6223 anObj.SetParameters(Parameters)
6226 ## Perform a chamfer on all edges of the specified faces,
6227 # with distance D1 on the first specified face (if several for one edge)
6228 # @param theShape Shape, to perform chamfer on.
6229 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6230 # connected to the edge, are in \a theFaces, \a theD1
6231 # will be get along face, which is nearer to \a theFaces beginning.
6232 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6233 # @param theFaces Sequence of global indices of faces of \a theShape.
6234 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6235 # @return New GEOM.GEOM_Object, containing the result shape.
6237 # @ref tui_chamfer "Example"
6238 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6240 Perform a chamfer on all edges of the specified faces,
6241 with distance D1 on the first specified face (if several for one edge)
6244 theShape Shape, to perform chamfer on.
6245 theD1 Chamfer size along face from theFaces. If both faces,
6246 connected to the edge, are in theFaces, theD1
6247 will be get along face, which is nearer to theFaces beginning.
6248 theD2 Chamfer size along another of two faces, connected to the edge.
6249 theFaces Sequence of global indices of faces of theShape.
6252 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6255 New GEOM.GEOM_Object, containing the result shape.
6257 # Example: see GEOM_TestAll.py
6258 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6259 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6260 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6261 anObj.SetParameters(Parameters)
6264 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6265 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6267 # @ref swig_FilletChamfer "Example"
6268 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6270 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6271 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6274 if isinstance(theAngle,str):
6276 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6278 theAngle = theAngle*math.pi/180.0
6279 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6280 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6281 anObj.SetParameters(Parameters)
6284 ## Perform a chamfer on edges,
6285 # with distance D1 on the first specified face (if several for one edge)
6286 # @param theShape Shape, to perform chamfer on.
6287 # @param theD1,theD2 Chamfer size
6288 # @param theEdges Sequence of edges of \a theShape.
6289 # @return New GEOM.GEOM_Object, containing the result shape.
6291 # @ref swig_FilletChamfer "Example"
6292 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6294 Perform a chamfer on edges,
6295 with distance D1 on the first specified face (if several for one edge)
6298 theShape Shape, to perform chamfer on.
6299 theD1,theD2 Chamfer size
6300 theEdges Sequence of edges of theShape.
6303 New GEOM.GEOM_Object, containing the result shape.
6305 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6306 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6307 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6308 anObj.SetParameters(Parameters)
6311 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6312 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6313 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6315 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6316 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6319 if isinstance(theAngle,str):
6321 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6323 theAngle = theAngle*math.pi/180.0
6324 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6325 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6326 anObj.SetParameters(Parameters)
6329 ## /sa MakeChamferEdge() and MakeChamferFaces()
6331 # @ref swig_MakeChamfer "Example"
6332 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6334 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6336 # Example: see GEOM_TestOthers.py
6338 if aShapeType == ShapeType["EDGE"]:
6339 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6341 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6344 ## Remove material from a solid by extrusion of the base shape on the given distance.
6345 # @param theInit Shape to remove material from. It must be a solid or
6346 # a compound made of a single solid.
6347 # @param theBase Closed edge or wire defining the base shape to be extruded.
6348 # @param theH Prism dimension along the normal to theBase
6349 # @param theAngle Draft angle in degrees.
6350 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6352 # @ref tui_creation_prism "Example"
6353 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6355 Add material to a solid by extrusion of the base shape on the given distance.
6358 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6359 theBase Closed edge or wire defining the base shape to be extruded.
6360 theH Prism dimension along the normal to theBase
6361 theAngle Draft angle in degrees.
6364 New GEOM.GEOM_Object, containing the initial shape with removed material.
6366 # Example: see GEOM_TestAll.py
6367 #theH,Parameters = ParseParameters(theH)
6368 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6369 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6370 #anObj.SetParameters(Parameters)
6373 ## Add material to a solid by extrusion of the base shape on the given distance.
6374 # @param theInit Shape to add material to. It must be a solid or
6375 # a compound made of a single solid.
6376 # @param theBase Closed edge or wire defining the base shape to be extruded.
6377 # @param theH Prism dimension along the normal to theBase
6378 # @param theAngle Draft angle in degrees.
6379 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6381 # @ref tui_creation_prism "Example"
6382 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6384 Add material to a solid by extrusion of the base shape on the given distance.
6387 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6388 theBase Closed edge or wire defining the base shape to be extruded.
6389 theH Prism dimension along the normal to theBase
6390 theAngle Draft angle in degrees.
6393 New GEOM.GEOM_Object, containing the initial shape with added material.
6395 # Example: see GEOM_TestAll.py
6396 #theH,Parameters = ParseParameters(theH)
6397 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6398 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6399 #anObj.SetParameters(Parameters)
6405 ## @addtogroup l3_basic_op
6408 ## Perform an Archimde operation on the given shape with given parameters.
6409 # The object presenting the resulting face is returned.
6410 # @param theShape Shape to be put in water.
6411 # @param theWeight Weight og the shape.
6412 # @param theWaterDensity Density of the water.
6413 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6414 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6415 # by a plane, corresponding to water level.
6417 # @ref tui_archimede "Example"
6418 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6420 Perform an Archimde operation on the given shape with given parameters.
6421 The object presenting the resulting face is returned.
6424 theShape Shape to be put in water.
6425 theWeight Weight og the shape.
6426 theWaterDensity Density of the water.
6427 theMeshDeflection Deflection of the mesh, using to compute the section.
6430 New GEOM.GEOM_Object, containing a section of theShape
6431 by a plane, corresponding to water level.
6433 # Example: see GEOM_TestAll.py
6434 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6435 theWeight,theWaterDensity,theMeshDeflection)
6436 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6437 RaiseIfFailed("MakeArchimede", self.LocalOp)
6438 anObj.SetParameters(Parameters)
6441 # end of l3_basic_op
6444 ## @addtogroup l2_measure
6447 ## Get point coordinates
6450 # @ref tui_measurement_tools_page "Example"
6451 def PointCoordinates(self,Point):
6453 Get point coordinates
6458 # Example: see GEOM_TestMeasures.py
6459 aTuple = self.MeasuOp.PointCoordinates(Point)
6460 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6463 ## Get summarized length of all wires,
6464 # area of surface and volume of the given shape.
6465 # @param theShape Shape to define properties of.
6466 # @return [theLength, theSurfArea, theVolume]\n
6467 # theLength: Summarized length of all wires of the given shape.\n
6468 # theSurfArea: Area of surface of the given shape.\n
6469 # theVolume: Volume of the given shape.
6471 # @ref tui_measurement_tools_page "Example"
6472 def BasicProperties(self,theShape):
6474 Get summarized length of all wires,
6475 area of surface and volume of the given shape.
6478 theShape Shape to define properties of.
6481 [theLength, theSurfArea, theVolume]
6482 theLength: Summarized length of all wires of the given shape.
6483 theSurfArea: Area of surface of the given shape.
6484 theVolume: Volume of the given shape.
6486 # Example: see GEOM_TestMeasures.py
6487 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6488 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6491 ## Get parameters of bounding box of the given shape
6492 # @param theShape Shape to obtain bounding box of.
6493 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6494 # Xmin,Xmax: Limits of shape along OX axis.
6495 # Ymin,Ymax: Limits of shape along OY axis.
6496 # Zmin,Zmax: Limits of shape along OZ axis.
6498 # @ref tui_measurement_tools_page "Example"
6499 def BoundingBox(self,theShape):
6501 Get parameters of bounding box of the given shape
6504 theShape Shape to obtain bounding box of.
6507 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6508 Xmin,Xmax: Limits of shape along OX axis.
6509 Ymin,Ymax: Limits of shape along OY axis.
6510 Zmin,Zmax: Limits of shape along OZ axis.
6512 # Example: see GEOM_TestMeasures.py
6513 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6514 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6517 ## Get inertia matrix and moments of inertia of theShape.
6518 # @param theShape Shape to calculate inertia of.
6519 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6520 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6521 # Ix,Iy,Iz: Moments of inertia of the given shape.
6523 # @ref tui_measurement_tools_page "Example"
6524 def Inertia(self,theShape):
6526 Get inertia matrix and moments of inertia of theShape.
6529 theShape Shape to calculate inertia of.
6532 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6533 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6534 Ix,Iy,Iz: Moments of inertia of the given shape.
6536 # Example: see GEOM_TestMeasures.py
6537 aTuple = self.MeasuOp.GetInertia(theShape)
6538 RaiseIfFailed("GetInertia", self.MeasuOp)
6541 ## Get if coords are included in the shape (ST_IN or ST_ON)
6542 # @param theShape Shape
6543 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6544 # @param tolerance to be used (default is 1.0e-7)
6545 # @return list_of_boolean = [res1, res2, ...]
6546 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6548 Get if coords are included in the shape (ST_IN or ST_ON)
6552 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6553 tolerance to be used (default is 1.0e-7)
6556 list_of_boolean = [res1, res2, ...]
6558 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6560 ## Get minimal distance between the given shapes.
6561 # @param theShape1,theShape2 Shapes to find minimal distance between.
6562 # @return Value of the minimal distance between the given shapes.
6564 # @ref tui_measurement_tools_page "Example"
6565 def MinDistance(self, theShape1, theShape2):
6567 Get minimal distance between the given shapes.
6570 theShape1,theShape2 Shapes to find minimal distance between.
6573 Value of the minimal distance between the given shapes.
6575 # Example: see GEOM_TestMeasures.py
6576 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6577 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6580 ## Get minimal distance between the given shapes.
6581 # @param theShape1,theShape2 Shapes to find minimal distance between.
6582 # @return Value of the minimal distance between the given shapes.
6584 # @ref swig_all_measure "Example"
6585 def MinDistanceComponents(self, theShape1, theShape2):
6587 Get minimal distance between the given shapes.
6590 theShape1,theShape2 Shapes to find minimal distance between.
6593 Value of the minimal distance between the given shapes.
6595 # Example: see GEOM_TestMeasures.py
6596 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6597 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6598 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6601 ## Get angle between the given shapes in degrees.
6602 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6603 # @note If both arguments are vectors, the angle is computed in accordance
6604 # with their orientations, otherwise the minimum angle is computed.
6605 # @return Value of the angle between the given shapes in degrees.
6607 # @ref tui_measurement_tools_page "Example"
6608 def GetAngle(self, theShape1, theShape2):
6610 Get angle between the given shapes in degrees.
6613 theShape1,theShape2 Lines or linear edges to find angle between.
6616 If both arguments are vectors, the angle is computed in accordance
6617 with their orientations, otherwise the minimum angle is computed.
6620 Value of the angle between the given shapes in degrees.
6622 # Example: see GEOM_TestMeasures.py
6623 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6624 RaiseIfFailed("GetAngle", self.MeasuOp)
6627 ## Get angle between the given shapes in radians.
6628 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6629 # @note If both arguments are vectors, the angle is computed in accordance
6630 # with their orientations, otherwise the minimum angle is computed.
6631 # @return Value of the angle between the given shapes in radians.
6633 # @ref tui_measurement_tools_page "Example"
6634 def GetAngleRadians(self, theShape1, theShape2):
6636 Get angle between the given shapes in radians.
6639 theShape1,theShape2 Lines or linear edges to find angle between.
6643 If both arguments are vectors, the angle is computed in accordance
6644 with their orientations, otherwise the minimum angle is computed.
6647 Value of the angle between the given shapes in radians.
6649 # Example: see GEOM_TestMeasures.py
6650 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6651 RaiseIfFailed("GetAngle", self.MeasuOp)
6654 ## Get angle between the given vectors in degrees.
6655 # @param theShape1,theShape2 Vectors to find angle between.
6656 # @param theFlag If True, the normal vector is defined by the two vectors cross,
6657 # if False, the opposite vector to the normal vector is used.
6658 # @return Value of the angle between the given vectors in degrees.
6660 # @ref tui_measurement_tools_page "Example"
6661 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6663 Get angle between the given vectors in degrees.
6666 theShape1,theShape2 Vectors to find angle between.
6667 theFlag If True, the normal vector is defined by the two vectors cross,
6668 if False, the opposite vector to the normal vector is used.
6671 Value of the angle between the given vectors in degrees.
6673 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6675 anAngle = 360. - anAngle
6676 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6679 ## The same as GetAngleVectors, but the result is in radians.
6680 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6682 Get angle between the given vectors in radians.
6685 theShape1,theShape2 Vectors to find angle between.
6686 theFlag If True, the normal vector is defined by the two vectors cross,
6687 if False, the opposite vector to the normal vector is used.
6690 Value of the angle between the given vectors in radians.
6692 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6695 ## @name Curve Curvature Measurement
6696 # Methods for receiving radius of curvature of curves
6697 # in the given point
6700 ## Measure curvature of a curve at a point, set by parameter.
6701 # @param theCurve a curve.
6702 # @param theParam parameter.
6703 # @return radius of curvature of \a theCurve.
6705 # @ref swig_todo "Example"
6706 def CurveCurvatureByParam(self, theCurve, theParam):
6708 Measure curvature of a curve at a point, set by parameter.
6715 radius of curvature of theCurve.
6717 # Example: see GEOM_TestMeasures.py
6718 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6719 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6722 ## Measure curvature of a curve at a point.
6723 # @param theCurve a curve.
6724 # @param thePoint given point.
6725 # @return radius of curvature of \a theCurve.
6727 # @ref swig_todo "Example"
6728 def CurveCurvatureByPoint(self, theCurve, thePoint):
6730 Measure curvature of a curve at a point.
6734 thePoint given point.
6737 radius of curvature of theCurve.
6739 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6740 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6744 ## @name Surface Curvature Measurement
6745 # Methods for receiving max and min radius of curvature of surfaces
6746 # in the given point
6749 ## Measure max radius of curvature of surface.
6750 # @param theSurf the given surface.
6751 # @param theUParam Value of U-parameter on the referenced surface.
6752 # @param theVParam Value of V-parameter on the referenced surface.
6753 # @return max radius of curvature of theSurf.
6755 ## @ref swig_todo "Example"
6756 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6758 Measure max radius of curvature of surface.
6761 theSurf the given surface.
6762 theUParam Value of U-parameter on the referenced surface.
6763 theVParam Value of V-parameter on the referenced surface.
6766 max radius of curvature of theSurf.
6768 # Example: see GEOM_TestMeasures.py
6769 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6770 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6773 ## Measure max radius of curvature of surface in the given point
6774 # @param theSurf the given surface.
6775 # @param thePoint given point.
6776 # @return max radius of curvature of theSurf.
6778 ## @ref swig_todo "Example"
6779 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6781 Measure max radius of curvature of surface in the given point.
6784 theSurf the given surface.
6785 thePoint given point.
6788 max radius of curvature of theSurf.
6790 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6791 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6794 ## Measure min radius of curvature of surface.
6795 # @param theSurf the given surface.
6796 # @param theUParam Value of U-parameter on the referenced surface.
6797 # @param theVParam Value of V-parameter on the referenced surface.
6798 # @return min radius of curvature of theSurf.
6800 ## @ref swig_todo "Example"
6801 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6803 Measure min radius of curvature of surface.
6806 theSurf the given surface.
6807 theUParam Value of U-parameter on the referenced surface.
6808 theVParam Value of V-parameter on the referenced surface.
6811 Min radius of curvature of theSurf.
6813 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6814 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6817 ## Measure min radius of curvature of surface in the given point
6818 # @param theSurf the given surface.
6819 # @param thePoint given point.
6820 # @return min radius of curvature of theSurf.
6822 ## @ref swig_todo "Example"
6823 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6825 Measure min radius of curvature of surface in the given point.
6828 theSurf the given surface.
6829 thePoint given point.
6832 Min radius of curvature of theSurf.
6834 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6835 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6839 ## Get min and max tolerances of sub-shapes of theShape
6840 # @param theShape Shape, to get tolerances of.
6841 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6842 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
6843 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6844 # VertMin,VertMax: Min and max tolerances of the vertices.
6846 # @ref tui_measurement_tools_page "Example"
6847 def Tolerance(self,theShape):
6849 Get min and max tolerances of sub-shapes of theShape
6852 theShape Shape, to get tolerances of.
6855 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6856 FaceMin,FaceMax: Min and max tolerances of the faces.
6857 EdgeMin,EdgeMax: Min and max tolerances of the edges.
6858 VertMin,VertMax: Min and max tolerances of the vertices.
6860 # Example: see GEOM_TestMeasures.py
6861 aTuple = self.MeasuOp.GetTolerance(theShape)
6862 RaiseIfFailed("GetTolerance", self.MeasuOp)
6865 ## Obtain description of the given shape (number of sub-shapes of each type)
6866 # @param theShape Shape to be described.
6867 # @return Description of the given shape.
6869 # @ref tui_measurement_tools_page "Example"
6870 def WhatIs(self,theShape):
6872 Obtain description of the given shape (number of sub-shapes of each type)
6875 theShape Shape to be described.
6878 Description of the given shape.
6880 # Example: see GEOM_TestMeasures.py
6881 aDescr = self.MeasuOp.WhatIs(theShape)
6882 RaiseIfFailed("WhatIs", self.MeasuOp)
6885 ## Obtain quantity of shapes of the given type in \a theShape.
6886 # If \a theShape is of type \a theType, it is also counted.
6887 # @param theShape Shape to be described.
6888 # @param theType the given ShapeType().
6889 # @return Quantity of shapes of type \a theType in \a theShape.
6891 # @ref tui_measurement_tools_page "Example"
6892 def NbShapes (self, theShape, theType):
6894 Obtain quantity of shapes of the given type in theShape.
6895 If theShape is of type theType, it is also counted.
6898 theShape Shape to be described.
6899 theType the given geompy.ShapeType
6902 Quantity of shapes of type theType in theShape.
6904 # Example: see GEOM_TestMeasures.py
6905 listSh = self.SubShapeAllIDs(theShape, theType)
6907 t = EnumToLong(theShape.GetShapeType())
6908 theType = EnumToLong(theType)
6914 ## Obtain quantity of shapes of each type in \a theShape.
6915 # The \a theShape is also counted.
6916 # @param theShape Shape to be described.
6917 # @return Dictionary of ShapeType() with bound quantities of shapes.
6919 # @ref tui_measurement_tools_page "Example"
6920 def ShapeInfo (self, theShape):
6922 Obtain quantity of shapes of each type in theShape.
6923 The theShape is also counted.
6926 theShape Shape to be described.
6929 Dictionary of geompy.ShapeType with bound quantities of shapes.
6931 # Example: see GEOM_TestMeasures.py
6933 for typeSh in ShapeType:
6934 if typeSh in ( "AUTO", "SHAPE" ): continue
6935 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
6937 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
6944 ## Get a point, situated at the centre of mass of theShape.
6945 # @param theShape Shape to define centre of mass of.
6946 # @return New GEOM.GEOM_Object, containing the created point.
6948 # @ref tui_measurement_tools_page "Example"
6949 def MakeCDG(self,theShape):
6951 Get a point, situated at the centre of mass of theShape.
6954 theShape Shape to define centre of mass of.
6957 New GEOM.GEOM_Object, containing the created point.
6959 # Example: see GEOM_TestMeasures.py
6960 anObj = self.MeasuOp.GetCentreOfMass(theShape)
6961 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
6964 ## Get a vertex sub-shape by index depended with orientation.
6965 # @param theShape Shape to find sub-shape.
6966 # @param theIndex Index to find vertex by this index (starting from zero)
6967 # @return New GEOM.GEOM_Object, containing the created vertex.
6969 # @ref tui_measurement_tools_page "Example"
6970 def GetVertexByIndex(self,theShape, theIndex):
6972 Get a vertex sub-shape by index depended with orientation.
6975 theShape Shape to find sub-shape.
6976 theIndex Index to find vertex by this index (starting from zero)
6979 New GEOM.GEOM_Object, containing the created vertex.
6981 # Example: see GEOM_TestMeasures.py
6982 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
6983 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
6986 ## Get the first vertex of wire/edge depended orientation.
6987 # @param theShape Shape to find first vertex.
6988 # @return New GEOM.GEOM_Object, containing the created vertex.
6990 # @ref tui_measurement_tools_page "Example"
6991 def GetFirstVertex(self,theShape):
6993 Get the first vertex of wire/edge depended orientation.
6996 theShape Shape to find first vertex.
6999 New GEOM.GEOM_Object, containing the created vertex.
7001 # Example: see GEOM_TestMeasures.py
7002 anObj = self.GetVertexByIndex(theShape, 0)
7003 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7006 ## Get the last vertex of wire/edge depended orientation.
7007 # @param theShape Shape to find last vertex.
7008 # @return New GEOM.GEOM_Object, containing the created vertex.
7010 # @ref tui_measurement_tools_page "Example"
7011 def GetLastVertex(self,theShape):
7013 Get the last vertex of wire/edge depended orientation.
7016 theShape Shape to find last vertex.
7019 New GEOM.GEOM_Object, containing the created vertex.
7021 # Example: see GEOM_TestMeasures.py
7022 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7023 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7024 RaiseIfFailed("GetLastVertex", self.MeasuOp)
7027 ## Get a normale to the given face. If the point is not given,
7028 # the normale is calculated at the center of mass.
7029 # @param theFace Face to define normale of.
7030 # @param theOptionalPoint Point to compute the normale at.
7031 # @return New GEOM.GEOM_Object, containing the created vector.
7033 # @ref swig_todo "Example"
7034 def GetNormal(self, theFace, theOptionalPoint = None):
7036 Get a normale to the given face. If the point is not given,
7037 the normale is calculated at the center of mass.
7040 theFace Face to define normale of.
7041 theOptionalPoint Point to compute the normale at.
7044 New GEOM.GEOM_Object, containing the created vector.
7046 # Example: see GEOM_TestMeasures.py
7047 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7048 RaiseIfFailed("GetNormal", self.MeasuOp)
7051 ## Check a topology of the given shape.
7052 # @param theShape Shape to check validity of.
7053 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7054 # if TRUE, the shape's geometry will be checked also.
7055 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7056 # of problem is printed.
7057 # if TRUE and if theShape is invalid, the description
7058 # of problem is also returned.
7059 # @return TRUE, if the shape "seems to be valid".
7061 # @ref tui_measurement_tools_page "Example"
7062 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7064 Check a topology of the given shape.
7067 theShape Shape to check validity of.
7068 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7069 if TRUE, the shape's geometry will be checked also.
7070 theReturnStatus If FALSE and if theShape is invalid, a description
7071 of problem is printed.
7072 if TRUE and if theShape is invalid, the description
7073 of problem is returned.
7076 TRUE, if the shape "seems to be valid".
7077 If theShape is invalid, prints a description of problem.
7078 This description can also be returned.
7080 # Example: see GEOM_TestMeasures.py
7082 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7083 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7085 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7086 RaiseIfFailed("CheckShape", self.MeasuOp)
7088 if theReturnStatus == 0:
7090 if theReturnStatus == 1:
7091 return (IsValid, Status)
7094 ## Detect self-intersections in the given shape.
7095 # @param theShape Shape to check.
7096 # @return TRUE, if the shape contains no self-intersections.
7098 # @ref tui_measurement_tools_page "Example"
7099 def CheckSelfIntersections(self, theShape):
7101 Detect self-intersections in the given shape.
7104 theShape Shape to check.
7107 TRUE, if the shape contains no self-intersections.
7109 # Example: see GEOM_TestMeasures.py
7110 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7111 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7114 ## Get position (LCS) of theShape.
7116 # Origin of the LCS is situated at the shape's center of mass.
7117 # Axes of the LCS are obtained from shape's location or,
7118 # if the shape is a planar face, from position of its plane.
7120 # @param theShape Shape to calculate position of.
7121 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7122 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
7123 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7124 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7126 # @ref swig_todo "Example"
7127 def GetPosition(self,theShape):
7129 Get position (LCS) of theShape.
7130 Origin of the LCS is situated at the shape's center of mass.
7131 Axes of the LCS are obtained from shape's location or,
7132 if the shape is a planar face, from position of its plane.
7135 theShape Shape to calculate position of.
7138 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7139 Ox,Oy,Oz: Coordinates of shape's LCS origin.
7140 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7141 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7143 # Example: see GEOM_TestMeasures.py
7144 aTuple = self.MeasuOp.GetPosition(theShape)
7145 RaiseIfFailed("GetPosition", self.MeasuOp)
7148 ## Get kind of theShape.
7150 # @param theShape Shape to get a kind of.
7151 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7152 # and a list of parameters, describing the shape.
7153 # @note Concrete meaning of each value, returned via \a theIntegers
7154 # or \a theDoubles list depends on the kind() of the shape.
7156 # @ref swig_todo "Example"
7157 def KindOfShape(self,theShape):
7159 Get kind of theShape.
7162 theShape Shape to get a kind of.
7165 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7166 and a list of parameters, describing the shape.
7168 Concrete meaning of each value, returned via theIntegers
7169 or theDoubles list depends on the geompy.kind of the shape
7171 # Example: see GEOM_TestMeasures.py
7172 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7173 RaiseIfFailed("KindOfShape", self.MeasuOp)
7175 aKind = aRoughTuple[0]
7176 anInts = aRoughTuple[1]
7177 aDbls = aRoughTuple[2]
7179 # Now there is no exception from this rule:
7180 aKindTuple = [aKind] + aDbls + anInts
7182 # If they are we will regroup parameters for such kind of shape.
7184 #if aKind == kind.SOME_KIND:
7185 # # SOME_KIND int int double int double double
7186 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7193 ## @addtogroup l2_import_export
7196 ## Import a shape from the BREP or IGES or STEP file
7197 # (depends on given format) with given name.
7198 # @param theFileName The file, containing the shape.
7199 # @param theFormatName Specify format for the file reading.
7200 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7201 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7202 # set to 'meter' and result model will be scaled.
7203 # @return New GEOM.GEOM_Object, containing the imported shape.
7205 # @ref swig_Import_Export "Example"
7206 def ImportFile(self,theFileName, theFormatName):
7208 Import a shape from the BREP or IGES or STEP file
7209 (depends on given format) with given name.
7212 theFileName The file, containing the shape.
7213 theFormatName Specify format for the file reading.
7214 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7215 If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7216 set to 'meter' and result model will be scaled.
7219 New GEOM.GEOM_Object, containing the imported shape.
7221 # Example: see GEOM_TestOthers.py
7222 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7223 RaiseIfFailed("Import", self.InsertOp)
7226 ## Deprecated analog of ImportFile()
7227 def Import(self,theFileName, theFormatName):
7229 Deprecated analog of geompy.ImportFile
7231 print "WARNING: Function Import is deprecated, use ImportFile instead"
7232 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7233 RaiseIfFailed("Import", self.InsertOp)
7236 ## Shortcut to ImportFile() for BREP format
7238 # @ref swig_Import_Export "Example"
7239 def ImportBREP(self,theFileName):
7241 geompy.ImportFile(...) function for BREP format
7243 # Example: see GEOM_TestOthers.py
7244 return self.ImportFile(theFileName, "BREP")
7246 ## Shortcut to ImportFile() for IGES format
7248 # @ref swig_Import_Export "Example"
7249 def ImportIGES(self,theFileName):
7251 geompy.ImportFile(...) function for IGES format
7253 # Example: see GEOM_TestOthers.py
7254 return self.ImportFile(theFileName, "IGES")
7256 ## Return length unit from given IGES file
7258 # @ref swig_Import_Export "Example"
7259 def GetIGESUnit(self,theFileName):
7261 Return length unit from given IGES file
7263 # Example: see GEOM_TestOthers.py
7264 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
7265 #RaiseIfFailed("Import", self.InsertOp)
7266 # recieve name using returned vertex
7268 if anObj.GetShapeType() == GEOM.VERTEX:
7271 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
7273 p = self.PointCoordinates(vertices[0])
7274 if abs(p[0]-0.01) < 1.e-6:
7276 elif abs(p[0]-0.001) < 1.e-6:
7280 ## Shortcut to ImportFile() for STEP format
7282 # @ref swig_Import_Export "Example"
7283 def ImportSTEP(self,theFileName):
7285 geompy.ImportFile(...) function for STEP format
7287 # Example: see GEOM_TestOthers.py
7288 return self.ImportFile(theFileName, "STEP")
7290 ## Export the given shape into a file with given name.
7291 # @param theObject Shape to be stored in the file.
7292 # @param theFileName Name of the file to store the given shape in.
7293 # @param theFormatName Specify format for the shape storage.
7294 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7296 # @ref swig_Import_Export "Example"
7297 def Export(self,theObject, theFileName, theFormatName):
7299 Export the given shape into a file with given name.
7302 theObject Shape to be stored in the file.
7303 theFileName Name of the file to store the given shape in.
7304 theFormatName Specify format for the shape storage.
7305 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7307 # Example: see GEOM_TestOthers.py
7308 self.InsertOp.Export(theObject, theFileName, theFormatName)
7309 if self.InsertOp.IsDone() == 0:
7310 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7314 ## Shortcut to Export() for BREP format
7316 # @ref swig_Import_Export "Example"
7317 def ExportBREP(self,theObject, theFileName):
7319 geompy.Export(...) function for BREP format
7321 # Example: see GEOM_TestOthers.py
7322 return self.Export(theObject, theFileName, "BREP")
7324 ## Shortcut to Export() for IGES format
7326 # @ref swig_Import_Export "Example"
7327 def ExportIGES(self,theObject, theFileName):
7329 geompy.Export(...) function for IGES format
7331 # Example: see GEOM_TestOthers.py
7332 return self.Export(theObject, theFileName, "IGES")
7334 ## Shortcut to Export() for STEP format
7336 # @ref swig_Import_Export "Example"
7337 def ExportSTEP(self,theObject, theFileName):
7339 geompy.Export(...) function for STEP format
7341 # Example: see GEOM_TestOthers.py
7342 return self.Export(theObject, theFileName, "STEP")
7344 # end of l2_import_export
7347 ## @addtogroup l3_blocks
7350 ## Create a quadrangle face from four edges. Order of Edges is not
7351 # important. It is not necessary that edges share the same vertex.
7352 # @param E1,E2,E3,E4 Edges for the face bound.
7353 # @return New GEOM.GEOM_Object, containing the created face.
7355 # @ref tui_building_by_blocks_page "Example"
7356 def MakeQuad(self,E1, E2, E3, E4):
7358 Create a quadrangle face from four edges. Order of Edges is not
7359 important. It is not necessary that edges share the same vertex.
7362 E1,E2,E3,E4 Edges for the face bound.
7365 New GEOM.GEOM_Object, containing the created face.
7368 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7370 # Example: see GEOM_Spanner.py
7371 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7372 RaiseIfFailed("MakeQuad", self.BlocksOp)
7375 ## Create a quadrangle face on two edges.
7376 # The missing edges will be built by creating the shortest ones.
7377 # @param E1,E2 Two opposite edges for the face.
7378 # @return New GEOM.GEOM_Object, containing the created face.
7380 # @ref tui_building_by_blocks_page "Example"
7381 def MakeQuad2Edges(self,E1, E2):
7383 Create a quadrangle face on two edges.
7384 The missing edges will be built by creating the shortest ones.
7387 E1,E2 Two opposite edges for the face.
7390 New GEOM.GEOM_Object, containing the created face.
7394 p1 = geompy.MakeVertex( 0., 0., 0.)
7395 p2 = geompy.MakeVertex(150., 30., 0.)
7396 p3 = geompy.MakeVertex( 0., 120., 50.)
7397 p4 = geompy.MakeVertex( 0., 40., 70.)
7399 edge1 = geompy.MakeEdge(p1, p2)
7400 edge2 = geompy.MakeEdge(p3, p4)
7401 # create a quadrangle face from two edges
7402 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7404 # Example: see GEOM_Spanner.py
7405 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7406 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7409 ## Create a quadrangle face with specified corners.
7410 # The missing edges will be built by creating the shortest ones.
7411 # @param V1,V2,V3,V4 Corner vertices for the face.
7412 # @return New GEOM.GEOM_Object, containing the created face.
7414 # @ref tui_building_by_blocks_page "Example 1"
7415 # \n @ref swig_MakeQuad4Vertices "Example 2"
7416 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7418 Create a quadrangle face with specified corners.
7419 The missing edges will be built by creating the shortest ones.
7422 V1,V2,V3,V4 Corner vertices for the face.
7425 New GEOM.GEOM_Object, containing the created face.
7429 p1 = geompy.MakeVertex( 0., 0., 0.)
7430 p2 = geompy.MakeVertex(150., 30., 0.)
7431 p3 = geompy.MakeVertex( 0., 120., 50.)
7432 p4 = geompy.MakeVertex( 0., 40., 70.)
7433 # create a quadrangle from four points in its corners
7434 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7436 # Example: see GEOM_Spanner.py
7437 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7438 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7441 ## Create a hexahedral solid, bounded by the six given faces. Order of
7442 # faces is not important. It is not necessary that Faces share the same edge.
7443 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7444 # @return New GEOM.GEOM_Object, containing the created solid.
7446 # @ref tui_building_by_blocks_page "Example 1"
7447 # \n @ref swig_MakeHexa "Example 2"
7448 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7450 Create a hexahedral solid, bounded by the six given faces. Order of
7451 faces is not important. It is not necessary that Faces share the same edge.
7454 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7457 New GEOM.GEOM_Object, containing the created solid.
7460 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7462 # Example: see GEOM_Spanner.py
7463 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7464 RaiseIfFailed("MakeHexa", self.BlocksOp)
7467 ## Create a hexahedral solid between two given faces.
7468 # The missing faces will be built by creating the smallest ones.
7469 # @param F1,F2 Two opposite faces for the hexahedral solid.
7470 # @return New GEOM.GEOM_Object, containing the created solid.
7472 # @ref tui_building_by_blocks_page "Example 1"
7473 # \n @ref swig_MakeHexa2Faces "Example 2"
7474 def MakeHexa2Faces(self,F1, F2):
7476 Create a hexahedral solid between two given faces.
7477 The missing faces will be built by creating the smallest ones.
7480 F1,F2 Two opposite faces for the hexahedral solid.
7483 New GEOM.GEOM_Object, containing the created solid.
7486 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7488 # Example: see GEOM_Spanner.py
7489 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7490 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7496 ## @addtogroup l3_blocks_op
7499 ## Get a vertex, found in the given shape by its coordinates.
7500 # @param theShape Block or a compound of blocks.
7501 # @param theX,theY,theZ Coordinates of the sought vertex.
7502 # @param theEpsilon Maximum allowed distance between the resulting
7503 # vertex and point with the given coordinates.
7504 # @return New GEOM.GEOM_Object, containing the found vertex.
7506 # @ref swig_GetPoint "Example"
7507 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7509 Get a vertex, found in the given shape by its coordinates.
7512 theShape Block or a compound of blocks.
7513 theX,theY,theZ Coordinates of the sought vertex.
7514 theEpsilon Maximum allowed distance between the resulting
7515 vertex and point with the given coordinates.
7518 New GEOM.GEOM_Object, containing the found vertex.
7521 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7523 # Example: see GEOM_TestOthers.py
7524 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7525 RaiseIfFailed("GetPoint", self.BlocksOp)
7528 ## Find a vertex of the given shape, which has minimal distance to the given point.
7529 # @param theShape Any shape.
7530 # @param thePoint Point, close to the desired vertex.
7531 # @return New GEOM.GEOM_Object, containing the found vertex.
7533 # @ref swig_GetVertexNearPoint "Example"
7534 def GetVertexNearPoint(self, theShape, thePoint):
7536 Find a vertex of the given shape, which has minimal distance to the given point.
7540 thePoint Point, close to the desired vertex.
7543 New GEOM.GEOM_Object, containing the found vertex.
7546 pmidle = geompy.MakeVertex(50, 0, 50)
7547 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7549 # Example: see GEOM_TestOthers.py
7550 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7551 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7554 ## Get an edge, found in the given shape by two given vertices.
7555 # @param theShape Block or a compound of blocks.
7556 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7557 # @return New GEOM.GEOM_Object, containing the found edge.
7559 # @ref swig_GetEdge "Example"
7560 def GetEdge(self, theShape, thePoint1, thePoint2):
7562 Get an edge, found in the given shape by two given vertices.
7565 theShape Block or a compound of blocks.
7566 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7569 New GEOM.GEOM_Object, containing the found edge.
7571 # Example: see GEOM_Spanner.py
7572 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7573 RaiseIfFailed("GetEdge", self.BlocksOp)
7576 ## Find an edge of the given shape, which has minimal distance to the given point.
7577 # @param theShape Block or a compound of blocks.
7578 # @param thePoint Point, close to the desired edge.
7579 # @return New GEOM.GEOM_Object, containing the found edge.
7581 # @ref swig_GetEdgeNearPoint "Example"
7582 def GetEdgeNearPoint(self, theShape, thePoint):
7584 Find an edge of the given shape, which has minimal distance to the given point.
7587 theShape Block or a compound of blocks.
7588 thePoint Point, close to the desired edge.
7591 New GEOM.GEOM_Object, containing the found edge.
7593 # Example: see GEOM_TestOthers.py
7594 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7595 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7598 ## Returns a face, found in the given shape by four given corner vertices.
7599 # @param theShape Block or a compound of blocks.
7600 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7601 # @return New GEOM.GEOM_Object, containing the found face.
7603 # @ref swig_todo "Example"
7604 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7606 Returns a face, found in the given shape by four given corner vertices.
7609 theShape Block or a compound of blocks.
7610 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7613 New GEOM.GEOM_Object, containing the found face.
7615 # Example: see GEOM_Spanner.py
7616 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7617 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7620 ## Get a face of block, found in the given shape by two given edges.
7621 # @param theShape Block or a compound of blocks.
7622 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7623 # @return New GEOM.GEOM_Object, containing the found face.
7625 # @ref swig_todo "Example"
7626 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7628 Get a face of block, found in the given shape by two given edges.
7631 theShape Block or a compound of blocks.
7632 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7635 New GEOM.GEOM_Object, containing the found face.
7637 # Example: see GEOM_Spanner.py
7638 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7639 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7642 ## Find a face, opposite to the given one in the given block.
7643 # @param theBlock Must be a hexahedral solid.
7644 # @param theFace Face of \a theBlock, opposite to the desired face.
7645 # @return New GEOM.GEOM_Object, containing the found face.
7647 # @ref swig_GetOppositeFace "Example"
7648 def GetOppositeFace(self,theBlock, theFace):
7650 Find a face, opposite to the given one in the given block.
7653 theBlock Must be a hexahedral solid.
7654 theFace Face of theBlock, opposite to the desired face.
7657 New GEOM.GEOM_Object, containing the found face.
7659 # Example: see GEOM_Spanner.py
7660 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7661 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7664 ## Find a face of the given shape, which has minimal distance to the given point.
7665 # @param theShape Block or a compound of blocks.
7666 # @param thePoint Point, close to the desired face.
7667 # @return New GEOM.GEOM_Object, containing the found face.
7669 # @ref swig_GetFaceNearPoint "Example"
7670 def GetFaceNearPoint(self, theShape, thePoint):
7672 Find a face of the given shape, which has minimal distance to the given point.
7675 theShape Block or a compound of blocks.
7676 thePoint Point, close to the desired face.
7679 New GEOM.GEOM_Object, containing the found face.
7681 # Example: see GEOM_Spanner.py
7682 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7683 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7686 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7687 # @param theBlock Block or a compound of blocks.
7688 # @param theVector Vector, close to the normale of the desired face.
7689 # @return New GEOM.GEOM_Object, containing the found face.
7691 # @ref swig_todo "Example"
7692 def GetFaceByNormale(self, theBlock, theVector):
7694 Find a face of block, whose outside normale has minimal angle with the given vector.
7697 theBlock Block or a compound of blocks.
7698 theVector Vector, close to the normale of the desired face.
7701 New GEOM.GEOM_Object, containing the found face.
7703 # Example: see GEOM_Spanner.py
7704 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7705 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7708 ## Find all sub-shapes of type \a theShapeType of the given shape,
7709 # which have minimal distance to the given point.
7710 # @param theShape Any shape.
7711 # @param thePoint Point, close to the desired shape.
7712 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7713 # @param theTolerance The tolerance for distances comparison. All shapes
7714 # with distances to the given point in interval
7715 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7716 # @return New GEOM_Object, containing a group of all found shapes.
7718 # @ref swig_GetShapesNearPoint "Example"
7719 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7721 Find all sub-shapes of type theShapeType of the given shape,
7722 which have minimal distance to the given point.
7726 thePoint Point, close to the desired shape.
7727 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7728 theTolerance The tolerance for distances comparison. All shapes
7729 with distances to the given point in interval
7730 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7733 New GEOM_Object, containing a group of all found shapes.
7735 # Example: see GEOM_TestOthers.py
7736 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7737 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7740 # end of l3_blocks_op
7743 ## @addtogroup l4_blocks_measure
7746 ## Check, if the compound of blocks is given.
7747 # To be considered as a compound of blocks, the
7748 # given shape must satisfy the following conditions:
7749 # - Each element of the compound should be a Block (6 faces and 12 edges).
7750 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7751 # - The compound should be connexe.
7752 # - The glue between two quadrangle faces should be applied.
7753 # @param theCompound The compound to check.
7754 # @return TRUE, if the given shape is a compound of blocks.
7755 # If theCompound is not valid, prints all discovered errors.
7757 # @ref tui_measurement_tools_page "Example 1"
7758 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
7759 def CheckCompoundOfBlocks(self,theCompound):
7761 Check, if the compound of blocks is given.
7762 To be considered as a compound of blocks, the
7763 given shape must satisfy the following conditions:
7764 - Each element of the compound should be a Block (6 faces and 12 edges).
7765 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7766 - The compound should be connexe.
7767 - The glue between two quadrangle faces should be applied.
7770 theCompound The compound to check.
7773 TRUE, if the given shape is a compound of blocks.
7774 If theCompound is not valid, prints all discovered errors.
7776 # Example: see GEOM_Spanner.py
7777 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7778 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7780 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7784 ## Retrieve all non blocks solids and faces from \a theShape.
7785 # @param theShape The shape to explore.
7786 # @return A tuple of two GEOM_Objects. The first object is a group of all
7787 # non block solids (= not 6 faces, or with 6 faces, but with the
7788 # presence of non-quadrangular faces). The second object is a
7789 # group of all non quadrangular faces.
7791 # @ref tui_measurement_tools_page "Example 1"
7792 # \n @ref swig_GetNonBlocks "Example 2"
7793 def GetNonBlocks (self, theShape):
7795 Retrieve all non blocks solids and faces from theShape.
7798 theShape The shape to explore.
7801 A tuple of two GEOM_Objects. The first object is a group of all
7802 non block solids (= not 6 faces, or with 6 faces, but with the
7803 presence of non-quadrangular faces). The second object is a
7804 group of all non quadrangular faces.
7807 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
7809 # Example: see GEOM_Spanner.py
7810 aTuple = self.BlocksOp.GetNonBlocks(theShape)
7811 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
7814 ## Remove all seam and degenerated edges from \a theShape.
7815 # Unite faces and edges, sharing one surface. It means that
7816 # this faces must have references to one C++ surface object (handle).
7817 # @param theShape The compound or single solid to remove irregular edges from.
7818 # @param doUnionFaces If True, then unite faces. If False (the default value),
7819 # do not unite faces.
7820 # @return Improved shape.
7822 # @ref swig_RemoveExtraEdges "Example"
7823 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
7825 Remove all seam and degenerated edges from theShape.
7826 Unite faces and edges, sharing one surface. It means that
7827 this faces must have references to one C++ surface object (handle).
7830 theShape The compound or single solid to remove irregular edges from.
7831 doUnionFaces If True, then unite faces. If False (the default value),
7837 # Example: see GEOM_TestOthers.py
7838 nbFacesOptimum = -1 # -1 means do not unite faces
7839 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
7840 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
7841 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
7844 ## Check, if the given shape is a blocks compound.
7845 # Fix all detected errors.
7846 # \note Single block can be also fixed by this method.
7847 # @param theShape The compound to check and improve.
7848 # @return Improved compound.
7850 # @ref swig_CheckAndImprove "Example"
7851 def CheckAndImprove(self,theShape):
7853 Check, if the given shape is a blocks compound.
7854 Fix all detected errors.
7857 Single block can be also fixed by this method.
7860 theShape The compound to check and improve.
7865 # Example: see GEOM_TestOthers.py
7866 anObj = self.BlocksOp.CheckAndImprove(theShape)
7867 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
7870 # end of l4_blocks_measure
7873 ## @addtogroup l3_blocks_op
7876 ## Get all the blocks, contained in the given compound.
7877 # @param theCompound The compound to explode.
7878 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
7879 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
7880 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7881 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
7883 # @ref tui_explode_on_blocks "Example 1"
7884 # \n @ref swig_MakeBlockExplode "Example 2"
7885 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
7887 Get all the blocks, contained in the given compound.
7890 theCompound The compound to explode.
7891 theMinNbFaces If solid has lower number of faces, it is not a block.
7892 theMaxNbFaces If solid has higher number of faces, it is not a block.
7895 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7898 List of GEOM.GEOM_Object, containing the retrieved blocks.
7900 # Example: see GEOM_TestOthers.py
7901 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
7902 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
7903 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
7905 anObj.SetParameters(Parameters)
7909 ## Find block, containing the given point inside its volume or on boundary.
7910 # @param theCompound Compound, to find block in.
7911 # @param thePoint Point, close to the desired block. If the point lays on
7912 # boundary between some blocks, we return block with nearest center.
7913 # @return New GEOM.GEOM_Object, containing the found block.
7915 # @ref swig_todo "Example"
7916 def GetBlockNearPoint(self,theCompound, thePoint):
7918 Find block, containing the given point inside its volume or on boundary.
7921 theCompound Compound, to find block in.
7922 thePoint Point, close to the desired block. If the point lays on
7923 boundary between some blocks, we return block with nearest center.
7926 New GEOM.GEOM_Object, containing the found block.
7928 # Example: see GEOM_Spanner.py
7929 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
7930 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
7933 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
7934 # @param theCompound Compound, to find block in.
7935 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
7936 # @return New GEOM.GEOM_Object, containing the found block.
7938 # @ref swig_GetBlockByParts "Example"
7939 def GetBlockByParts(self,theCompound, theParts):
7941 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
7944 theCompound Compound, to find block in.
7945 theParts List of faces and/or edges and/or vertices to be parts of the found block.
7948 New GEOM_Object, containing the found block.
7950 # Example: see GEOM_TestOthers.py
7951 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
7952 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
7955 ## Return all blocks, containing all the elements, passed as the parts.
7956 # @param theCompound Compound, to find blocks in.
7957 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
7958 # @return List of GEOM.GEOM_Object, containing the found blocks.
7960 # @ref swig_todo "Example"
7961 def GetBlocksByParts(self,theCompound, theParts):
7963 Return all blocks, containing all the elements, passed as the parts.
7966 theCompound Compound, to find blocks in.
7967 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
7970 List of GEOM.GEOM_Object, containing the found blocks.
7972 # Example: see GEOM_Spanner.py
7973 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
7974 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
7977 ## Multi-transformate block and glue the result.
7978 # Transformation is defined so, as to superpose direction faces.
7979 # @param Block Hexahedral solid to be multi-transformed.
7980 # @param DirFace1 ID of First direction face.
7981 # @param DirFace2 ID of Second direction face.
7982 # @param NbTimes Quantity of transformations to be done.
7983 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
7984 # @return New GEOM.GEOM_Object, containing the result shape.
7986 # @ref tui_multi_transformation "Example"
7987 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
7989 Multi-transformate block and glue the result.
7990 Transformation is defined so, as to superpose direction faces.
7993 Block Hexahedral solid to be multi-transformed.
7994 DirFace1 ID of First direction face.
7995 DirFace2 ID of Second direction face.
7996 NbTimes Quantity of transformations to be done.
7999 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8002 New GEOM.GEOM_Object, containing the result shape.
8004 # Example: see GEOM_Spanner.py
8005 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8006 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8007 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8008 anObj.SetParameters(Parameters)
8011 ## Multi-transformate block and glue the result.
8012 # @param Block Hexahedral solid to be multi-transformed.
8013 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8014 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8015 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
8016 # @return New GEOM.GEOM_Object, containing the result shape.
8018 # @ref tui_multi_transformation "Example"
8019 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8020 DirFace1V, DirFace2V, NbTimesV):
8022 Multi-transformate block and glue the result.
8025 Block Hexahedral solid to be multi-transformed.
8026 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8027 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8028 NbTimesU,NbTimesV Quantity of transformations to be done.
8031 New GEOM.GEOM_Object, containing the result shape.
8033 # Example: see GEOM_Spanner.py
8034 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8035 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8036 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8037 DirFace1V, DirFace2V, NbTimesV)
8038 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8039 anObj.SetParameters(Parameters)
8042 ## Build all possible propagation groups.
8043 # Propagation group is a set of all edges, opposite to one (main)
8044 # edge of this group directly or through other opposite edges.
8045 # Notion of Opposite Edge make sence only on quadrangle face.
8046 # @param theShape Shape to build propagation groups on.
8047 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
8049 # @ref swig_Propagate "Example"
8050 def Propagate(self,theShape):
8052 Build all possible propagation groups.
8053 Propagation group is a set of all edges, opposite to one (main)
8054 edge of this group directly or through other opposite edges.
8055 Notion of Opposite Edge make sence only on quadrangle face.
8058 theShape Shape to build propagation groups on.
8061 List of GEOM.GEOM_Object, each of them is a propagation group.
8063 # Example: see GEOM_TestOthers.py
8064 listChains = self.BlocksOp.Propagate(theShape)
8065 RaiseIfFailed("Propagate", self.BlocksOp)
8068 # end of l3_blocks_op
8071 ## @addtogroup l3_groups
8074 ## Creates a new group which will store sub-shapes of theMainShape
8075 # @param theMainShape is a GEOM object on which the group is selected
8076 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8077 # @return a newly created GEOM group
8079 # @ref tui_working_with_groups_page "Example 1"
8080 # \n @ref swig_CreateGroup "Example 2"
8081 def CreateGroup(self,theMainShape, theShapeType):
8083 Creates a new group which will store sub-shapes of theMainShape
8086 theMainShape is a GEOM object on which the group is selected
8087 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8088 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8091 a newly created GEOM group
8094 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8097 # Example: see GEOM_TestOthers.py
8098 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8099 RaiseIfFailed("CreateGroup", self.GroupOp)
8102 ## Adds a sub-object with ID theSubShapeId to the group
8103 # @param theGroup is a GEOM group to which the new sub-shape is added
8104 # @param theSubShapeID is a sub-shape ID in the main object.
8105 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8107 # @ref tui_working_with_groups_page "Example"
8108 def AddObject(self,theGroup, theSubShapeID):
8110 Adds a sub-object with ID theSubShapeId to the group
8113 theGroup is a GEOM group to which the new sub-shape is added
8114 theSubShapeID is a sub-shape ID in the main object.
8117 Use method GetSubShapeID() to get an unique ID of the sub-shape
8119 # Example: see GEOM_TestOthers.py
8120 self.GroupOp.AddObject(theGroup, theSubShapeID)
8121 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8122 RaiseIfFailed("AddObject", self.GroupOp)
8126 ## Removes a sub-object with ID \a theSubShapeId from the group
8127 # @param theGroup is a GEOM group from which the new sub-shape is removed
8128 # @param theSubShapeID is a sub-shape ID in the main object.
8129 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8131 # @ref tui_working_with_groups_page "Example"
8132 def RemoveObject(self,theGroup, theSubShapeID):
8134 Removes a sub-object with ID theSubShapeId from the group
8137 theGroup is a GEOM group from which the new sub-shape is removed
8138 theSubShapeID is a sub-shape ID in the main object.
8141 Use method GetSubShapeID() to get an unique ID of the sub-shape
8143 # Example: see GEOM_TestOthers.py
8144 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8145 RaiseIfFailed("RemoveObject", self.GroupOp)
8148 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8149 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8150 # @param theSubShapes is a list of sub-shapes to be added.
8152 # @ref tui_working_with_groups_page "Example"
8153 def UnionList (self,theGroup, theSubShapes):
8155 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8158 theGroup is a GEOM group to which the new sub-shapes are added.
8159 theSubShapes is a list of sub-shapes to be added.
8161 # Example: see GEOM_TestOthers.py
8162 self.GroupOp.UnionList(theGroup, theSubShapes)
8163 RaiseIfFailed("UnionList", self.GroupOp)
8166 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8167 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8168 # @param theSubShapes is a list of indices of sub-shapes to be added.
8170 # @ref swig_UnionIDs "Example"
8171 def UnionIDs(self,theGroup, theSubShapes):
8173 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8176 theGroup is a GEOM group to which the new sub-shapes are added.
8177 theSubShapes is a list of indices of sub-shapes to be added.
8179 # Example: see GEOM_TestOthers.py
8180 self.GroupOp.UnionIDs(theGroup, theSubShapes)
8181 RaiseIfFailed("UnionIDs", self.GroupOp)
8184 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8185 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8186 # @param theSubShapes is a list of sub-shapes to be removed.
8188 # @ref tui_working_with_groups_page "Example"
8189 def DifferenceList (self,theGroup, theSubShapes):
8191 Removes from the group all the given shapes. No errors, if some shapes are not included.
8194 theGroup is a GEOM group from which the sub-shapes are removed.
8195 theSubShapes is a list of sub-shapes to be removed.
8197 # Example: see GEOM_TestOthers.py
8198 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8199 RaiseIfFailed("DifferenceList", self.GroupOp)
8202 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8203 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8204 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8206 # @ref swig_DifferenceIDs "Example"
8207 def DifferenceIDs(self,theGroup, theSubShapes):
8209 Removes from the group all the given shapes. No errors, if some shapes are not included.
8212 theGroup is a GEOM group from which the sub-shapes are removed.
8213 theSubShapes is a list of indices of sub-shapes to be removed.
8215 # Example: see GEOM_TestOthers.py
8216 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8217 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8220 ## Returns a list of sub-objects ID stored in the group
8221 # @param theGroup is a GEOM group for which a list of IDs is requested
8223 # @ref swig_GetObjectIDs "Example"
8224 def GetObjectIDs(self,theGroup):
8226 Returns a list of sub-objects ID stored in the group
8229 theGroup is a GEOM group for which a list of IDs is requested
8231 # Example: see GEOM_TestOthers.py
8232 ListIDs = self.GroupOp.GetObjects(theGroup)
8233 RaiseIfFailed("GetObjects", self.GroupOp)
8236 ## Returns a type of sub-objects stored in the group
8237 # @param theGroup is a GEOM group which type is returned.
8239 # @ref swig_GetType "Example"
8240 def GetType(self,theGroup):
8242 Returns a type of sub-objects stored in the group
8245 theGroup is a GEOM group which type is returned.
8247 # Example: see GEOM_TestOthers.py
8248 aType = self.GroupOp.GetType(theGroup)
8249 RaiseIfFailed("GetType", self.GroupOp)
8252 ## Convert a type of geom object from id to string value
8253 # @param theId is a GEOM obect type id.
8254 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8255 # @ref swig_GetType "Example"
8256 def ShapeIdToType(self, theId):
8258 Convert a type of geom object from id to string value
8261 theId is a GEOM obect type id.
8264 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8339 return "FREE_BOUNDS"
8347 return "THRUSECTIONS"
8349 return "COMPOUNDFILTER"
8351 return "SHAPES_ON_SHAPE"
8353 return "ELLIPSE_ARC"
8362 return "Shape Id not exist."
8364 ## Returns a main shape associated with the group
8365 # @param theGroup is a GEOM group for which a main shape object is requested
8366 # @return a GEOM object which is a main shape for theGroup
8368 # @ref swig_GetMainShape "Example"
8369 def GetMainShape(self,theGroup):
8371 Returns a main shape associated with the group
8374 theGroup is a GEOM group for which a main shape object is requested
8377 a GEOM object which is a main shape for theGroup
8379 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8381 # Example: see GEOM_TestOthers.py
8382 anObj = self.GroupOp.GetMainShape(theGroup)
8383 RaiseIfFailed("GetMainShape", self.GroupOp)
8386 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8387 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8388 # @param theShape given shape (see GEOM.GEOM_Object)
8389 # @param min_length minimum length of edges of theShape
8390 # @param max_length maximum length of edges of theShape
8391 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8392 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8393 # @return a newly created GEOM group of edges
8394 # @@ref swig_todo "Example"
8395 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8397 Create group of edges of theShape, whose length is in range [min_length, max_length].
8398 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8401 theShape given shape
8402 min_length minimum length of edges of theShape
8403 max_length maximum length of edges of theShape
8404 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8405 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8408 a newly created GEOM group of edges.
8410 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8413 Props = self.BasicProperties(edge)
8414 if min_length <= Props[0] and Props[0] <= max_length:
8415 if (not include_min) and (min_length == Props[0]):
8418 if (not include_max) and (Props[0] == max_length):
8421 edges_in_range.append(edge)
8423 if len(edges_in_range) <= 0:
8424 print "No edges found by given criteria"
8427 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8428 self.UnionList(group_edges, edges_in_range)
8432 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8433 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8434 # @param min_length minimum length of edges of selected shape
8435 # @param max_length maximum length of edges of selected shape
8436 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8437 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8438 # @return a newly created GEOM group of edges
8439 # @ref swig_todo "Example"
8440 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8442 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8443 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8446 min_length minimum length of edges of selected shape
8447 max_length maximum length of edges of selected shape
8448 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8449 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8452 a newly created GEOM group of edges.
8454 nb_selected = sg.SelectedCount()
8456 print "Select a shape before calling this function, please."
8459 print "Only one shape must be selected"
8462 id_shape = sg.getSelected(0)
8463 shape = IDToObject( id_shape )
8465 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8469 if include_min: left_str = " <= "
8470 if include_max: right_str = " <= "
8472 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8473 + left_str + "length" + right_str + `max_length`)
8475 sg.updateObjBrowser(1)
8482 ## @addtogroup l4_advanced
8485 ## Create a T-shape object with specified caracteristics for the main
8486 # and the incident pipes (radius, width, half-length).
8487 # The extremities of the main pipe are located on junctions points P1 and P2.
8488 # The extremity of the incident pipe is located on junction point P3.
8489 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8490 # the main plane of the T-shape is XOY.
8491 # @param theR1 Internal radius of main pipe
8492 # @param theW1 Width of main pipe
8493 # @param theL1 Half-length of main pipe
8494 # @param theR2 Internal radius of incident pipe (R2 < R1)
8495 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8496 # @param theL2 Half-length of incident pipe
8497 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8498 # @param theP1 1st junction point of main pipe
8499 # @param theP2 2nd junction point of main pipe
8500 # @param theP3 Junction point of incident pipe
8501 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8503 # @ref tui_creation_pipetshape "Example"
8504 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8506 Create a T-shape object with specified caracteristics for the main
8507 and the incident pipes (radius, width, half-length).
8508 The extremities of the main pipe are located on junctions points P1 and P2.
8509 The extremity of the incident pipe is located on junction point P3.
8510 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8511 the main plane of the T-shape is XOY.
8514 theR1 Internal radius of main pipe
8515 theW1 Width of main pipe
8516 theL1 Half-length of main pipe
8517 theR2 Internal radius of incident pipe (R2 < R1)
8518 theW2 Width of incident pipe (R2+W2 < R1+W1)
8519 theL2 Half-length of incident pipe
8520 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8521 theP1 1st junction point of main pipe
8522 theP2 2nd junction point of main pipe
8523 theP3 Junction point of incident pipe
8526 List of GEOM_Object, containing the created shape and propagation groups.
8529 # create PipeTShape object
8530 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8531 # create PipeTShape object with position
8532 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8534 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8535 if (theP1 and theP2 and theP3):
8536 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8538 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8539 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8540 if Parameters: anObj[0].SetParameters(Parameters)
8543 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8544 # and the incident pipes (radius, width, half-length). The chamfer is
8545 # created on the junction of the pipes.
8546 # The extremities of the main pipe are located on junctions points P1 and P2.
8547 # The extremity of the incident pipe is located on junction point P3.
8548 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8549 # the main plane of the T-shape is XOY.
8550 # @param theR1 Internal radius of main pipe
8551 # @param theW1 Width of main pipe
8552 # @param theL1 Half-length of main pipe
8553 # @param theR2 Internal radius of incident pipe (R2 < R1)
8554 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8555 # @param theL2 Half-length of incident pipe
8556 # @param theH Height of the chamfer.
8557 # @param theW Width of the chamfer.
8558 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8559 # @param theP1 1st junction point of main pipe
8560 # @param theP2 2nd junction point of main pipe
8561 # @param theP3 Junction point of incident pipe
8562 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8564 # @ref tui_creation_pipetshape "Example"
8565 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8567 Create a T-shape object with chamfer and with specified caracteristics for the main
8568 and the incident pipes (radius, width, half-length). The chamfer is
8569 created on the junction of the pipes.
8570 The extremities of the main pipe are located on junctions points P1 and P2.
8571 The extremity of the incident pipe is located on junction point P3.
8572 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8573 the main plane of the T-shape is XOY.
8576 theR1 Internal radius of main pipe
8577 theW1 Width of main pipe
8578 theL1 Half-length of main pipe
8579 theR2 Internal radius of incident pipe (R2 < R1)
8580 theW2 Width of incident pipe (R2+W2 < R1+W1)
8581 theL2 Half-length of incident pipe
8582 theH Height of the chamfer.
8583 theW Width of the chamfer.
8584 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8585 theP1 1st junction point of main pipe
8586 theP2 2nd junction point of main pipe
8587 theP3 Junction point of incident pipe
8590 List of GEOM_Object, containing the created shape and propagation groups.
8593 # create PipeTShape with chamfer object
8594 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8595 # create PipeTShape with chamfer object with position
8596 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8598 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8599 if (theP1 and theP2 and theP3):
8600 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8602 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8603 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8604 if Parameters: anObj[0].SetParameters(Parameters)
8607 ## Create a T-shape object with fillet and with specified caracteristics for the main
8608 # and the incident pipes (radius, width, half-length). The fillet is
8609 # created on the junction of the pipes.
8610 # The extremities of the main pipe are located on junctions points P1 and P2.
8611 # The extremity of the incident pipe is located on junction point P3.
8612 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8613 # the main plane of the T-shape is XOY.
8614 # @param theR1 Internal radius of main pipe
8615 # @param theW1 Width of main pipe
8616 # @param theL1 Half-length of main pipe
8617 # @param theR2 Internal radius of incident pipe (R2 < R1)
8618 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8619 # @param theL2 Half-length of incident pipe
8620 # @param theRF Radius of curvature of fillet.
8621 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8622 # @param theP1 1st junction point of main pipe
8623 # @param theP2 2nd junction point of main pipe
8624 # @param theP3 Junction point of incident pipe
8625 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8627 # @ref tui_creation_pipetshape "Example"
8628 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8630 Create a T-shape object with fillet and with specified caracteristics for the main
8631 and the incident pipes (radius, width, half-length). The fillet is
8632 created on the junction of the pipes.
8633 The extremities of the main pipe are located on junctions points P1 and P2.
8634 The extremity of the incident pipe is located on junction point P3.
8637 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8638 the main plane of the T-shape is XOY.
8639 theR1 Internal radius of main pipe
8640 theW1 Width of main pipe
8641 heL1 Half-length of main pipe
8642 theR2 Internal radius of incident pipe (R2 < R1)
8643 theW2 Width of incident pipe (R2+W2 < R1+W1)
8644 theL2 Half-length of incident pipe
8645 theRF Radius of curvature of fillet.
8646 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8647 theP1 1st junction point of main pipe
8648 theP2 2nd junction point of main pipe
8649 theP3 Junction point of incident pipe
8652 List of GEOM_Object, containing the created shape and propagation groups.
8655 # create PipeTShape with fillet object
8656 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
8657 # create PipeTShape with fillet object with position
8658 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
8661 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
8662 if (theP1 and theP2 and theP3):
8663 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
8665 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
8666 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
8667 if Parameters: anObj[0].SetParameters(Parameters)
8670 ## This function allows creating a disk already divided into blocks. It
8671 # can be used to create divided pipes for later meshing in hexaedra.
8672 # @param theR Radius of the disk
8673 # @param theOrientation Orientation of the plane on which the disk will be built
8674 # 1 = XOY, 2 = OYZ, 3 = OZX
8675 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8676 # @return New GEOM_Object, containing the created shape.
8678 # @ref tui_creation_divideddisk "Example"
8679 def MakeDividedDisk(self, theR, theOrientation, thePattern ):
8680 theR, Parameters = ParseParameters(theR)
8681 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
8682 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
8683 if Parameters: anObj.SetParameters(Parameters)
8686 ## This function allows creating a disk already divided into blocks. It
8687 # can be used to create divided pipes for later meshing in hexaedra.
8688 # @param theCenter Center of the disk
8689 # @param theVector Normal vector to the plane of the created disk
8690 # @param theRadius Radius of the disk
8691 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8692 # @return New GEOM_Object, containing the created shape.
8694 # @ref tui_creation_divideddisk "Example"
8695 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
8696 theRadius, Parameters = ParseParameters(theRadius)
8697 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
8698 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
8699 if Parameters: anObj.SetParameters(Parameters)
8702 ## Builds a cylinder prepared for hexa meshes
8703 # @param theR Radius of the cylinder
8704 # @param theH Height of the cylinder
8705 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
8706 # @return New GEOM_Object, containing the created shape.
8708 # @ref tui_creation_dividedcylinder "Example"
8709 def MakeDividedCylinder(self, theR, theH, thePattern):
8710 theR, theH, Parameters = ParseParameters(theR, theH)
8711 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
8712 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
8713 if Parameters: anObj.SetParameters(Parameters)
8716 #@@ insert new functions before this line @@ do not remove this line @@#
8718 # end of l4_advanced
8721 ## Create a copy of the given object
8723 # @param theOriginal geometry object for copy
8724 # @return unique object identifier
8725 # @ingroup l1_geompy_auxiliary
8726 # @ref swig_MakeCopy "Example"
8727 def MakeCopy(self,theOriginal):
8729 Create a copy of the given object
8732 theOriginal geometry object for copy
8735 unique object identifier
8737 Example of usage: Copy = geompy.MakeCopy(Box)
8739 # Example: see GEOM_TestAll.py
8740 anObj = self.InsertOp.MakeCopy(theOriginal)
8741 RaiseIfFailed("MakeCopy", self.InsertOp)
8744 ## Add Path to load python scripts from
8745 # @param Path a path to load python scripts from
8746 # @ingroup l1_geompy_auxiliary
8747 def addPath(self,Path):
8749 Add Path to load python scripts from
8752 Path a path to load python scripts from
8754 if (sys.path.count(Path) < 1):
8755 sys.path.append(Path)
8759 ## Load marker texture from the file
8760 # @param Path a path to the texture file
8761 # @return unique texture identifier
8762 # @ingroup l1_geompy_auxiliary
8763 def LoadTexture(self, Path):
8765 Load marker texture from the file
8768 Path a path to the texture file
8771 unique texture identifier
8773 # Example: see GEOM_TestAll.py
8774 ID = self.InsertOp.LoadTexture(Path)
8775 RaiseIfFailed("LoadTexture", self.InsertOp)
8778 ## Get entry of the object
8779 # @param obj geometry object
8780 # @return unique object identifier
8781 # @ingroup l1_geompy_auxiliary
8782 def getObjectID(self, obj):
8784 Get entry of the object
8790 unique object identifier
8793 entry = salome.ObjectToID(obj)
8794 if entry is not None:
8795 lst = entry.split(":")
8797 ID = lst[-1] # -1 means last item in the list
8803 ## Add marker texture. @a Width and @a Height parameters
8804 # specify width and height of the texture in pixels.
8805 # If @a RowData is @c True, @a Texture parameter should represent texture data
8806 # packed into the byte array. If @a RowData is @c False (default), @a Texture
8807 # parameter should be unpacked string, in which '1' symbols represent opaque
8808 # pixels and '0' represent transparent pixels of the texture bitmap.
8810 # @param Width texture width in pixels
8811 # @param Height texture height in pixels
8812 # @param Texture texture data
8813 # @param RowData if @c True, @a Texture data are packed in the byte stream
8814 # @return unique texture identifier
8815 # @ingroup l1_geompy_auxiliary
8816 def AddTexture(self, Width, Height, Texture, RowData=False):
8818 Add marker texture. Width and Height parameters
8819 specify width and height of the texture in pixels.
8820 If RowData is True, Texture parameter should represent texture data
8821 packed into the byte array. If RowData is False (default), Texture
8822 parameter should be unpacked string, in which '1' symbols represent opaque
8823 pixels and '0' represent transparent pixels of the texture bitmap.
8826 Width texture width in pixels
8827 Height texture height in pixels
8828 Texture texture data
8829 RowData if True, Texture data are packed in the byte stream
8832 return unique texture identifier
8834 if not RowData: Texture = PackData(Texture)
8835 ID = self.InsertOp.AddTexture(Width, Height, Texture)
8836 RaiseIfFailed("AddTexture", self.InsertOp)
8840 #Register the new proxy for GEOM_Gen
8841 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)