1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Author : Paul RASCLE, EDF
29 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
31 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
33 ## @defgroup l2_import_export Importing/exporting geometrical objects
34 ## @defgroup l2_creating Creating geometrical objects
36 ## @defgroup l3_basic_go Creating Basic Geometric Objects
38 ## @defgroup l4_curves Creating Curves
41 ## @defgroup l3_3d_primitives Creating 3D Primitives
42 ## @defgroup l3_complex Creating Complex Objects
43 ## @defgroup l3_groups Working with groups
44 ## @defgroup l3_blocks Building by blocks
46 ## @defgroup l4_blocks_measure Check and Improve
49 ## @defgroup l3_sketcher Sketcher
50 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
52 ## @defgroup l4_decompose Decompose objects
53 ## @defgroup l4_decompose_d Decompose objects deprecated methods
54 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
55 ## @defgroup l4_obtain Access to sub-shapes by a criteria
56 ## @defgroup l4_advanced Advanced objects creation functions
61 ## @defgroup l2_transforming Transforming geometrical objects
63 ## @defgroup l3_basic_op Basic Operations
64 ## @defgroup l3_boolean Boolean Operations
65 ## @defgroup l3_transform Transformation Operations
66 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
67 ## @defgroup l3_blocks_op Blocks Operations
68 ## @defgroup l3_healing Repairing Operations
69 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
72 ## @defgroup l2_measure Using measurement tools
76 # initialize SALOME session in try/except block
77 # to avoid problems in some cases, e.g. when generating documentation
85 from salome_notebook import *
91 from gsketcher import Sketcher3D
93 ## Enumeration ShapeType as a dictionary. \n
94 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
95 # @ingroup l1_geompy_auxiliary
96 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
98 ## Raise an Error, containing the Method_name, if Operation is Failed
99 ## @ingroup l1_geompy_auxiliary
100 def RaiseIfFailed (Method_name, Operation):
101 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
102 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
104 ## Return list of variables value from salome notebook
105 ## @ingroup l1_geompy_auxiliary
106 def ParseParameters(*parameters):
109 for parameter in parameters:
110 if isinstance(parameter, list):
111 lResults = ParseParameters(*parameter)
112 if len(lResults) > 0:
113 Result.append(lResults[:-1])
114 StringResult += lResults[-1].split(":")
118 if isinstance(parameter,str):
119 if notebook.isVariable(parameter):
120 Result.append(notebook.get(parameter))
122 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
125 Result.append(parameter)
127 StringResult.append(str(parameter))
131 Result.append(":".join(StringResult))
133 Result = ":".join(StringResult)
136 ## Return list of variables value from salome notebook
137 ## @ingroup l1_geompy_auxiliary
141 for parameter in list:
142 if isinstance(parameter,str) and notebook.isVariable(parameter):
143 Result.append(str(notebook.get(parameter)))
146 Result.append(str(parameter))
149 StringResult = StringResult + str(parameter)
150 StringResult = StringResult + ":"
152 StringResult = StringResult[:len(StringResult)-1]
153 return Result, StringResult
155 ## Return list of variables value from salome notebook
156 ## @ingroup l1_geompy_auxiliary
157 def ParseSketcherCommand(command):
160 sections = command.split(":")
161 for section in sections:
162 parameters = section.split(" ")
164 for parameter in parameters:
165 if paramIndex > 1 and parameter.find("'") != -1:
166 parameter = parameter.replace("'","")
167 if notebook.isVariable(parameter):
168 Result = Result + str(notebook.get(parameter)) + " "
171 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
175 Result = Result + str(parameter) + " "
178 StringResult = StringResult + parameter
179 StringResult = StringResult + ":"
181 paramIndex = paramIndex + 1
183 Result = Result[:len(Result)-1] + ":"
185 Result = Result[:len(Result)-1]
186 return Result, StringResult
188 ## Helper function which can be used to pack the passed string to the byte data.
189 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
190 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
193 ## val = PackData("10001110") # val = 0xAE
194 ## val = PackData("1") # val = 0x80
196 ## @param data unpacked data - a string containing '1' and '0' symbols
197 ## @return data packed to the byte stream
198 ## @ingroup l1_geompy_auxiliary
201 Helper function which can be used to pack the passed string to the byte data.
202 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
203 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
206 data unpacked data - a string containing '1' and '0' symbols
209 data packed to the byte stream
212 val = PackData("10001110") # val = 0xAE
213 val = PackData("1") # val = 0x80
216 if len(data)%8: bytes += 1
218 for b in range(bytes):
219 d = data[b*8:(b+1)*8]
224 if d[i] == "1": val += 1
226 raise "Invalid symbol %s" % d[i]
233 ## Read bitmap texture from the text file.
234 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
235 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
236 ## The function returns width and height of the pixmap in pixels and byte stream representing
237 ## texture bitmap itself.
239 ## This function can be used to read the texture to the byte stream in order to pass it to
240 ## the AddTexture() function of geompy class.
244 ## geompy.init_geom(salome.myStudy)
245 ## texture = geompy.readtexture('mytexture.dat')
246 ## texture = geompy.AddTexture(*texture)
247 ## obj.SetMarkerTexture(texture)
249 ## @param fname texture file name
250 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
251 ## @ingroup l1_geompy_auxiliary
252 def ReadTexture(fname):
254 Read bitmap texture from the text file.
255 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
256 A zero symbol ('0') represents transparent pixel of the texture bitmap.
257 The function returns width and height of the pixmap in pixels and byte stream representing
258 texture bitmap itself.
259 This function can be used to read the texture to the byte stream in order to pass it to
260 the AddTexture() function of geompy class.
263 fname texture file name
266 sequence of tree values: texture's width, height in pixels and its byte stream
270 geompy.init_geom(salome.myStudy)
271 texture = geompy.readtexture('mytexture.dat')
272 texture = geompy.AddTexture(*texture)
273 obj.SetMarkerTexture(texture)
277 lines = [ l.strip() for l in f.readlines()]
280 if lines: maxlen = max([len(x) for x in lines])
282 if maxlen%8: lenbytes += 1
286 lenline = (len(line)/8+1)*8
289 lenline = (len(line)/8)*8
291 for i in range(lenline/8):
294 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
297 bytedata += PackData(byte)
299 for i in range(lenline/8, lenbytes):
300 bytedata += PackData("0")
302 return lenbytes*8, len(lines), bytedata
307 ## Returns a long value from enumeration type
308 # Can be used for CORBA enumerator types like GEOM.shape_type
309 # @param theItem enumeration type
310 # @ingroup l1_geompy_auxiliary
311 def EnumToLong(theItem):
313 Returns a long value from enumeration type
314 Can be used for CORBA enumerator types like geompy.ShapeType
317 theItem enumeration type
320 if hasattr(theItem, "_v"): ret = theItem._v
323 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
324 # and a list of parameters, describing the shape.
325 # List of parameters, describing the shape:
326 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
327 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
329 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
331 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
333 # - SPHERE: [xc yc zc R]
334 # - CYLINDER: [xb yb zb dx dy dz R H]
335 # - BOX: [xc yc zc ax ay az]
336 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
337 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
338 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
339 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
340 # - SOLID: [nb_faces nb_edges nb_vertices]
342 # - SPHERE2D: [xc yc zc R]
343 # - CYLINDER2D: [xb yb zb dx dy dz R H]
344 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
345 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
346 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
347 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
348 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
349 # - PLANE: [xo yo zo dx dy dz]
350 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
351 # - FACE: [nb_edges nb_vertices]
353 # - CIRCLE: [xc yc zc dx dy dz R]
354 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
355 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
356 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
357 # - LINE: [xo yo zo dx dy dz]
358 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
359 # - EDGE: [nb_vertices]
362 # @ingroup l1_geompy_auxiliary
363 kind = GEOM.GEOM_IKindOfShape
365 ## Information about closed/unclosed state of shell or wire
366 # @ingroup l1_geompy_auxiliary
369 Information about closed/unclosed state of shell or wire
375 class geompyDC(GEOM._objref_GEOM_Gen):
378 GEOM._objref_GEOM_Gen.__init__(self)
379 self.myBuilder = None
399 ## @addtogroup l1_geompy_auxiliary
401 def init_geom(self,theStudy):
402 self.myStudy = theStudy
403 self.myStudyId = self.myStudy._get_StudyId()
404 self.myBuilder = self.myStudy.NewBuilder()
405 self.father = self.myStudy.FindComponent("GEOM")
406 if self.father is None:
407 self.father = self.myBuilder.NewComponent("GEOM")
408 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
409 FName = A1._narrow(SALOMEDS.AttributeName)
410 FName.SetValue("Geometry")
411 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
412 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
413 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
414 self.myBuilder.DefineComponentInstance(self.father,self)
416 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
417 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
418 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
419 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
420 self.HealOp = self.GetIHealingOperations (self.myStudyId)
421 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
422 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
423 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
424 self.LocalOp = self.GetILocalOperations (self.myStudyId)
425 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
426 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
427 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
428 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
429 self.ImpExpOp = self.GetIImportExportOperations (self.myStudyId)
432 ## Dump component to the Python script
433 # This method overrides IDL function to allow default values for the parameters.
434 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
436 Dump component to the Python script
437 This method overrides IDL function to allow default values for the parameters.
439 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
441 ## Get name for sub-shape aSubObj of shape aMainObj
443 # @ref swig_SubShapeName "Example"
444 def SubShapeName(self,aSubObj, aMainObj):
446 Get name for sub-shape aSubObj of shape aMainObj
448 # Example: see GEOM_TestAll.py
450 #aSubId = orb.object_to_string(aSubObj)
451 #aMainId = orb.object_to_string(aMainObj)
452 #index = gg.getIndexTopology(aSubId, aMainId)
453 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
454 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
455 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
458 ## Publish in study aShape with name aName
460 # \param aShape the shape to be published
461 # \param aName the name for the shape
462 # \param doRestoreSubShapes if True, finds and publishes also
463 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
464 # and published sub-shapes of arguments
465 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
466 # these arguments description
467 # \return study entry of the published shape in form of string
469 # @ref swig_all_addtostudy "Example"
470 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
471 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
473 Publish in study aShape with name aName
476 aShape the shape to be published
477 aName the name for the shape
478 doRestoreSubShapes if True, finds and publishes also
479 sub-shapes of aShape, corresponding to its arguments
480 and published sub-shapes of arguments
481 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
482 these arguments description
485 study entry of the published shape in form of string
488 id_block1 = geompy.addToStudy(Block1, "Block 1")
490 # Example: see GEOM_TestAll.py
492 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
493 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
494 if doRestoreSubShapes:
495 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
496 theFindMethod, theInheritFirstArg, True )
498 print "addToStudy() failed"
500 return aShape.GetStudyEntry()
502 ## Publish in study aShape with name aName as sub-object of previously published aFather
503 # \param aFather previously published object
504 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
505 # \param aName the name for the shape
507 # \return study entry of the published shape in form of string
508 # @ref swig_all_addtostudyInFather "Example"
509 def addToStudyInFather(self, aFather, aShape, aName):
511 Publish in study aShape with name aName as sub-object of previously published aFather
514 aFather previously published object
515 aShape the shape to be published as sub-object of aFather
516 aName the name for the shape
519 study entry of the published shape in form of string
521 # Example: see GEOM_TestAll.py
523 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
524 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
526 print "addToStudyInFather() failed"
528 return aShape.GetStudyEntry()
530 ## Unpublish object in study
532 # \param obj the object to be unpublished
533 def hideInStudy(self, obj):
535 Unpublish object in study
538 obj the object to be unpublished
540 ior = salome.orb.object_to_string(obj)
541 aSObject = self.myStudy.FindObjectIOR(ior)
542 if aSObject is not None:
543 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
544 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
545 drwAttribute.SetDrawable(False)
548 # end of l1_geompy_auxiliary
551 ## @addtogroup l3_restore_ss
554 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
555 # To be used from python scripts out of addToStudy() (non-default usage)
556 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
557 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
558 # If this list is empty, all operation arguments will be published
559 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
560 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
561 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
562 # Do not publish sub-shapes in place of arguments, but only
563 # in place of sub-shapes of the first argument,
564 # because the whole shape corresponds to the first argument.
565 # Mainly to be used after transformations, but it also can be
566 # usefull after partition with one object shape, and some other
567 # operations, where only the first argument has to be considered.
568 # If theObject has only one argument shape, this flag is automatically
569 # considered as True, not regarding really passed value.
570 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
571 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
572 # \return list of published sub-shapes
574 # @ref tui_restore_prs_params "Example"
575 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
576 theInheritFirstArg=False, theAddPrefix=True):
578 Publish sub-shapes, standing for arguments and sub-shapes of arguments
579 To be used from python scripts out of geompy.addToStudy (non-default usage)
582 theObject published GEOM.GEOM_Object, arguments of which will be published
583 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
584 If this list is empty, all operation arguments will be published
585 theFindMethod method to search sub-shapes, corresponding to arguments and
586 their sub-shapes. Value from enumeration GEOM.find_shape_method.
587 theInheritFirstArg set properties of the first argument for theObject.
588 Do not publish sub-shapes in place of arguments, but only
589 in place of sub-shapes of the first argument,
590 because the whole shape corresponds to the first argument.
591 Mainly to be used after transformations, but it also can be
592 usefull after partition with one object shape, and some other
593 operations, where only the first argument has to be considered.
594 If theObject has only one argument shape, this flag is automatically
595 considered as True, not regarding really passed value.
596 theAddPrefix add prefix "from_" to names of restored sub-shapes,
597 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
599 list of published sub-shapes
601 # Example: see GEOM_TestAll.py
602 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
603 theFindMethod, theInheritFirstArg, theAddPrefix)
605 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
606 # To be used from python scripts out of addToStudy() (non-default usage)
607 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
608 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
609 # If this list is empty, all operation arguments will be published
610 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
611 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
612 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
613 # Do not publish sub-shapes in place of arguments, but only
614 # in place of sub-shapes of the first argument,
615 # because the whole shape corresponds to the first argument.
616 # Mainly to be used after transformations, but it also can be
617 # usefull after partition with one object shape, and some other
618 # operations, where only the first argument has to be considered.
619 # If theObject has only one argument shape, this flag is automatically
620 # considered as True, not regarding really passed value.
621 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
622 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
623 # \return list of published sub-shapes
625 # @ref tui_restore_prs_params "Example"
626 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
627 theInheritFirstArg=False, theAddPrefix=True):
629 Publish sub-shapes, standing for arguments and sub-shapes of arguments
630 To be used from python scripts out of geompy.addToStudy() (non-default usage)
633 theObject published GEOM.GEOM_Object, arguments of which will be published
634 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
635 If this list is empty, all operation arguments will be published
636 theFindMethod method to search sub-shapes, corresponding to arguments and
637 their sub-shapes. Value from enumeration GEOM::find_shape_method.
638 theInheritFirstArg set properties of the first argument for theObject.
639 Do not publish sub-shapes in place of arguments, but only
640 in place of sub-shapes of the first argument,
641 because the whole shape corresponds to the first argument.
642 Mainly to be used after transformations, but it also can be
643 usefull after partition with one object shape, and some other
644 operations, where only the first argument has to be considered.
645 If theObject has only one argument shape, this flag is automatically
646 considered as True, not regarding really passed value.
647 theAddPrefix add prefix "from_" to names of restored sub-shapes,
648 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
651 list of published sub-shapes
653 # Example: see GEOM_TestAll.py
654 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
655 theFindMethod, theInheritFirstArg, theAddPrefix)
657 # end of l3_restore_ss
660 ## @addtogroup l3_basic_go
663 ## Create point by three coordinates.
664 # @param theX The X coordinate of the point.
665 # @param theY The Y coordinate of the point.
666 # @param theZ The Z coordinate of the point.
667 # @return New GEOM.GEOM_Object, containing the created point.
669 # @ref tui_creation_point "Example"
670 def MakeVertex(self, theX, theY, theZ):
672 Create point by three coordinates.
675 theX The X coordinate of the point.
676 theY The Y coordinate of the point.
677 theZ The Z coordinate of the point.
680 New GEOM.GEOM_Object, containing the created point.
682 # Example: see GEOM_TestAll.py
683 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
684 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
685 RaiseIfFailed("MakePointXYZ", self.BasicOp)
686 anObj.SetParameters(Parameters)
689 ## Create a point, distant from the referenced point
690 # on the given distances along the coordinate axes.
691 # @param theReference The referenced point.
692 # @param theX Displacement from the referenced point along OX axis.
693 # @param theY Displacement from the referenced point along OY axis.
694 # @param theZ Displacement from the referenced point along OZ axis.
695 # @return New GEOM.GEOM_Object, containing the created point.
697 # @ref tui_creation_point "Example"
698 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
700 Create a point, distant from the referenced point
701 on the given distances along the coordinate axes.
704 theReference The referenced point.
705 theX Displacement from the referenced point along OX axis.
706 theY Displacement from the referenced point along OY axis.
707 theZ Displacement from the referenced point along OZ axis.
710 New GEOM.GEOM_Object, containing the created point.
712 # Example: see GEOM_TestAll.py
713 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
714 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
715 RaiseIfFailed("MakePointWithReference", self.BasicOp)
716 anObj.SetParameters(Parameters)
719 ## Create a point, corresponding to the given parameter on the given curve.
720 # @param theRefCurve The referenced curve.
721 # @param theParameter Value of parameter on the referenced curve.
722 # @return New GEOM.GEOM_Object, containing the created point.
724 # @ref tui_creation_point "Example"
725 def MakeVertexOnCurve(self,theRefCurve, theParameter):
727 Create a point, corresponding to the given parameter on the given curve.
730 theRefCurve The referenced curve.
731 theParameter Value of parameter on the referenced curve.
734 New GEOM.GEOM_Object, containing the created point.
737 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
739 # Example: see GEOM_TestAll.py
740 theParameter, Parameters = ParseParameters(theParameter)
741 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
742 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
743 anObj.SetParameters(Parameters)
746 ## Create a point by projection give coordinates on the given curve
747 # @param theRefCurve The referenced curve.
748 # @param theX X-coordinate in 3D space
749 # @param theY Y-coordinate in 3D space
750 # @param theZ Z-coordinate in 3D space
751 # @return New GEOM.GEOM_Object, containing the created point.
753 # @ref tui_creation_point "Example"
754 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
756 Create a point by projection give coordinates on the given curve
759 theRefCurve The referenced curve.
760 theX X-coordinate in 3D space
761 theY Y-coordinate in 3D space
762 theZ Z-coordinate in 3D space
765 New GEOM.GEOM_Object, containing the created point.
768 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
770 # Example: see GEOM_TestAll.py
771 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
772 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
773 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
774 anObj.SetParameters(Parameters)
777 ## Create a point, corresponding to the given length on the given curve.
778 # @param theRefCurve The referenced curve.
779 # @param theLength Length on the referenced curve. It can be negative.
780 # @param theStartPoint Point allowing to choose the direction for the calculation
781 # of the length. If None, start from the first point of theRefCurve.
782 # @return New GEOM.GEOM_Object, containing the created point.
784 # @ref tui_creation_point "Example"
785 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
787 Create a point, corresponding to the given length on the given curve.
790 theRefCurve The referenced curve.
791 theLength Length on the referenced curve. It can be negative.
792 theStartPoint Point allowing to choose the direction for the calculation
793 of the length. If None, start from the first point of theRefCurve.
796 New GEOM.GEOM_Object, containing the created point.
798 # Example: see GEOM_TestAll.py
799 theLength, Parameters = ParseParameters(theLength)
800 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
801 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
802 anObj.SetParameters(Parameters)
805 ## Create a point, corresponding to the given parameters on the
807 # @param theRefSurf The referenced surface.
808 # @param theUParameter Value of U-parameter on the referenced surface.
809 # @param theVParameter Value of V-parameter on the referenced surface.
810 # @return New GEOM.GEOM_Object, containing the created point.
812 # @ref swig_MakeVertexOnSurface "Example"
813 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
815 Create a point, corresponding to the given parameters on the
819 theRefSurf The referenced surface.
820 theUParameter Value of U-parameter on the referenced surface.
821 theVParameter Value of V-parameter on the referenced surface.
824 New GEOM.GEOM_Object, containing the created point.
827 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
829 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
830 # Example: see GEOM_TestAll.py
831 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
832 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
833 anObj.SetParameters(Parameters);
836 ## Create a point by projection give coordinates on the given surface
837 # @param theRefSurf The referenced surface.
838 # @param theX X-coordinate in 3D space
839 # @param theY Y-coordinate in 3D space
840 # @param theZ Z-coordinate in 3D space
841 # @return New GEOM.GEOM_Object, containing the created point.
843 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
844 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
846 Create a point by projection give coordinates on the given surface
849 theRefSurf The referenced surface.
850 theX X-coordinate in 3D space
851 theY Y-coordinate in 3D space
852 theZ Z-coordinate in 3D space
855 New GEOM.GEOM_Object, containing the created point.
858 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
860 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
861 # Example: see GEOM_TestAll.py
862 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
863 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
864 anObj.SetParameters(Parameters);
867 ## Create a point, which lays on the given face.
868 # The point will lay in arbitrary place of the face.
869 # The only condition on it is a non-zero distance to the face boundary.
870 # Such point can be used to uniquely identify the face inside any
871 # shape in case, when the shape does not contain overlapped faces.
872 # @param theFace The referenced face.
873 # @return New GEOM.GEOM_Object, containing the created point.
875 # @ref swig_MakeVertexInsideFace "Example"
876 def MakeVertexInsideFace (self, theFace):
878 Create a point, which lays on the given face.
879 The point will lay in arbitrary place of the face.
880 The only condition on it is a non-zero distance to the face boundary.
881 Such point can be used to uniquely identify the face inside any
882 shape in case, when the shape does not contain overlapped faces.
885 theFace The referenced face.
888 New GEOM.GEOM_Object, containing the created point.
891 p_on_face = geompy.MakeVertexInsideFace(Face)
893 # Example: see GEOM_TestAll.py
894 anObj = self.BasicOp.MakePointOnFace(theFace)
895 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
898 ## Create a point on intersection of two lines.
899 # @param theRefLine1, theRefLine2 The referenced lines.
900 # @return New GEOM.GEOM_Object, containing the created point.
902 # @ref swig_MakeVertexOnLinesIntersection "Example"
903 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
905 Create a point on intersection of two lines.
908 theRefLine1, theRefLine2 The referenced lines.
911 New GEOM.GEOM_Object, containing the created point.
913 # Example: see GEOM_TestAll.py
914 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
915 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
918 ## Create a tangent, corresponding to the given parameter on the given curve.
919 # @param theRefCurve The referenced curve.
920 # @param theParameter Value of parameter on the referenced curve.
921 # @return New GEOM.GEOM_Object, containing the created tangent.
923 # @ref swig_MakeTangentOnCurve "Example"
924 def MakeTangentOnCurve(self, theRefCurve, theParameter):
926 Create a tangent, corresponding to the given parameter on the given curve.
929 theRefCurve The referenced curve.
930 theParameter Value of parameter on the referenced curve.
933 New GEOM.GEOM_Object, containing the created tangent.
936 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
938 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
939 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
942 ## Create a tangent plane, corresponding to the given parameter on the given face.
943 # @param theFace The face for which tangent plane should be built.
944 # @param theParameterV vertical value of the center point (0.0 - 1.0).
945 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
946 # @param theTrimSize the size of plane.
947 # @return New GEOM.GEOM_Object, containing the created tangent.
949 # @ref swig_MakeTangentPlaneOnFace "Example"
950 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
952 Create a tangent plane, corresponding to the given parameter on the given face.
955 theFace The face for which tangent plane should be built.
956 theParameterV vertical value of the center point (0.0 - 1.0).
957 theParameterU horisontal value of the center point (0.0 - 1.0).
958 theTrimSize the size of plane.
961 New GEOM.GEOM_Object, containing the created tangent.
964 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
966 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
967 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
970 ## Create a vector with the given components.
971 # @param theDX X component of the vector.
972 # @param theDY Y component of the vector.
973 # @param theDZ Z component of the vector.
974 # @return New GEOM.GEOM_Object, containing the created vector.
976 # @ref tui_creation_vector "Example"
977 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
979 Create a vector with the given components.
982 theDX X component of the vector.
983 theDY Y component of the vector.
984 theDZ Z component of the vector.
987 New GEOM.GEOM_Object, containing the created vector.
989 # Example: see GEOM_TestAll.py
990 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
991 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
992 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
993 anObj.SetParameters(Parameters)
996 ## Create a vector between two points.
997 # @param thePnt1 Start point for the vector.
998 # @param thePnt2 End point for the vector.
999 # @return New GEOM.GEOM_Object, containing the created vector.
1001 # @ref tui_creation_vector "Example"
1002 def MakeVector(self,thePnt1, thePnt2):
1004 Create a vector between two points.
1007 thePnt1 Start point for the vector.
1008 thePnt2 End point for the vector.
1011 New GEOM.GEOM_Object, containing the created vector.
1013 # Example: see GEOM_TestAll.py
1014 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1015 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1018 ## Create a line, passing through the given point
1019 # and parrallel to the given direction
1020 # @param thePnt Point. The resulting line will pass through it.
1021 # @param theDir Direction. The resulting line will be parallel to it.
1022 # @return New GEOM.GEOM_Object, containing the created line.
1024 # @ref tui_creation_line "Example"
1025 def MakeLine(self,thePnt, theDir):
1027 Create a line, passing through the given point
1028 and parrallel to the given direction
1031 thePnt Point. The resulting line will pass through it.
1032 theDir Direction. The resulting line will be parallel to it.
1035 New GEOM.GEOM_Object, containing the created line.
1037 # Example: see GEOM_TestAll.py
1038 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1039 RaiseIfFailed("MakeLine", self.BasicOp)
1042 ## Create a line, passing through the given points
1043 # @param thePnt1 First of two points, defining the line.
1044 # @param thePnt2 Second of two points, defining the line.
1045 # @return New GEOM.GEOM_Object, containing the created line.
1047 # @ref tui_creation_line "Example"
1048 def MakeLineTwoPnt(self,thePnt1, thePnt2):
1050 Create a line, passing through the given points
1053 thePnt1 First of two points, defining the line.
1054 thePnt2 Second of two points, defining the line.
1057 New GEOM.GEOM_Object, containing the created line.
1059 # Example: see GEOM_TestAll.py
1060 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1061 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1064 ## Create a line on two faces intersection.
1065 # @param theFace1 First of two faces, defining the line.
1066 # @param theFace2 Second of two faces, defining the line.
1067 # @return New GEOM.GEOM_Object, containing the created line.
1069 # @ref swig_MakeLineTwoFaces "Example"
1070 def MakeLineTwoFaces(self, theFace1, theFace2):
1072 Create a line on two faces intersection.
1075 theFace1 First of two faces, defining the line.
1076 theFace2 Second of two faces, defining the line.
1079 New GEOM.GEOM_Object, containing the created line.
1081 # Example: see GEOM_TestAll.py
1082 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1083 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1086 ## Create a plane, passing through the given point
1087 # and normal to the given vector.
1088 # @param thePnt Point, the plane has to pass through.
1089 # @param theVec Vector, defining the plane normal direction.
1090 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1091 # @return New GEOM.GEOM_Object, containing the created plane.
1093 # @ref tui_creation_plane "Example"
1094 def MakePlane(self,thePnt, theVec, theTrimSize):
1096 Create a plane, passing through the given point
1097 and normal to the given vector.
1100 thePnt Point, the plane has to pass through.
1101 theVec Vector, defining the plane normal direction.
1102 theTrimSize Half size of a side of quadrangle face, representing the plane.
1105 New GEOM.GEOM_Object, containing the created plane.
1107 # Example: see GEOM_TestAll.py
1108 theTrimSize, Parameters = ParseParameters(theTrimSize);
1109 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1110 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1111 anObj.SetParameters(Parameters)
1114 ## Create a plane, passing through the three given points
1115 # @param thePnt1 First of three points, defining the plane.
1116 # @param thePnt2 Second of three points, defining the plane.
1117 # @param thePnt3 Fird of three points, defining the plane.
1118 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1119 # @return New GEOM.GEOM_Object, containing the created plane.
1121 # @ref tui_creation_plane "Example"
1122 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1124 Create a plane, passing through the three given points
1127 thePnt1 First of three points, defining the plane.
1128 thePnt2 Second of three points, defining the plane.
1129 thePnt3 Fird of three points, defining the plane.
1130 theTrimSize Half size of a side of quadrangle face, representing the plane.
1133 New GEOM.GEOM_Object, containing the created plane.
1135 # Example: see GEOM_TestAll.py
1136 theTrimSize, Parameters = ParseParameters(theTrimSize);
1137 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1138 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1139 anObj.SetParameters(Parameters)
1142 ## Create a plane, similar to the existing one, but with another size of representing face.
1143 # @param theFace Referenced plane or LCS(Marker).
1144 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1145 # @return New GEOM.GEOM_Object, containing the created plane.
1147 # @ref tui_creation_plane "Example"
1148 def MakePlaneFace(self,theFace, theTrimSize):
1150 Create a plane, similar to the existing one, but with another size of representing face.
1153 theFace Referenced plane or LCS(Marker).
1154 theTrimSize New half size of a side of quadrangle face, representing the plane.
1157 New GEOM.GEOM_Object, containing the created plane.
1159 # Example: see GEOM_TestAll.py
1160 theTrimSize, Parameters = ParseParameters(theTrimSize);
1161 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1162 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1163 anObj.SetParameters(Parameters)
1166 ## Create a plane, passing through the 2 vectors
1167 # with center in a start point of the first vector.
1168 # @param theVec1 Vector, defining center point and plane direction.
1169 # @param theVec2 Vector, defining the plane normal direction.
1170 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1171 # @return New GEOM.GEOM_Object, containing the created plane.
1173 # @ref tui_creation_plane "Example"
1174 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1176 Create a plane, passing through the 2 vectors
1177 with center in a start point of the first vector.
1180 theVec1 Vector, defining center point and plane direction.
1181 theVec2 Vector, defining the plane normal direction.
1182 theTrimSize Half size of a side of quadrangle face, representing the plane.
1185 New GEOM.GEOM_Object, containing the created plane.
1187 # Example: see GEOM_TestAll.py
1188 theTrimSize, Parameters = ParseParameters(theTrimSize);
1189 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1190 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1191 anObj.SetParameters(Parameters)
1194 ## Create a plane, based on a Local coordinate system.
1195 # @param theLCS coordinate system, defining plane.
1196 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1197 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1198 # @return New GEOM.GEOM_Object, containing the created plane.
1200 # @ref tui_creation_plane "Example"
1201 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1203 Create a plane, based on a Local coordinate system.
1206 theLCS coordinate system, defining plane.
1207 theTrimSize Half size of a side of quadrangle face, representing the plane.
1208 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1211 New GEOM.GEOM_Object, containing the created plane.
1213 # Example: see GEOM_TestAll.py
1214 theTrimSize, Parameters = ParseParameters(theTrimSize);
1215 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1216 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1217 anObj.SetParameters(Parameters)
1220 ## Create a local coordinate system.
1221 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1222 # @param XDX,XDY,XDZ Three components of OX direction
1223 # @param YDX,YDY,YDZ Three components of OY direction
1224 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1226 # @ref swig_MakeMarker "Example"
1227 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1229 Create a local coordinate system.
1232 OX,OY,OZ Three coordinates of coordinate system origin.
1233 XDX,XDY,XDZ Three components of OX direction
1234 YDX,YDY,YDZ Three components of OY direction
1237 New GEOM.GEOM_Object, containing the created coordinate system.
1239 # Example: see GEOM_TestAll.py
1240 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1241 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1242 RaiseIfFailed("MakeMarker", self.BasicOp)
1243 anObj.SetParameters(Parameters)
1246 ## Create a local coordinate system from shape.
1247 # @param theShape The initial shape to detect the coordinate system.
1248 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1250 # @ref tui_creation_lcs "Example"
1251 def MakeMarkerFromShape(self, theShape):
1253 Create a local coordinate system from shape.
1256 theShape The initial shape to detect the coordinate system.
1259 New GEOM.GEOM_Object, containing the created coordinate system.
1261 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1262 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1265 ## Create a local coordinate system from point and two vectors.
1266 # @param theOrigin Point of coordinate system origin.
1267 # @param theXVec Vector of X direction
1268 # @param theYVec Vector of Y direction
1269 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1271 # @ref tui_creation_lcs "Example"
1272 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1274 Create a local coordinate system from point and two vectors.
1277 theOrigin Point of coordinate system origin.
1278 theXVec Vector of X direction
1279 theYVec Vector of Y direction
1282 New GEOM.GEOM_Object, containing the created coordinate system.
1285 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1286 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1289 # end of l3_basic_go
1292 ## @addtogroup l4_curves
1295 ## Create an arc of circle, passing through three given points.
1296 # @param thePnt1 Start point of the arc.
1297 # @param thePnt2 Middle point of the arc.
1298 # @param thePnt3 End point of the arc.
1299 # @return New GEOM.GEOM_Object, containing the created arc.
1301 # @ref swig_MakeArc "Example"
1302 def MakeArc(self,thePnt1, thePnt2, thePnt3):
1304 Create an arc of circle, passing through three given points.
1307 thePnt1 Start point of the arc.
1308 thePnt2 Middle point of the arc.
1309 thePnt3 End point of the arc.
1312 New GEOM.GEOM_Object, containing the created arc.
1314 # Example: see GEOM_TestAll.py
1315 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1316 RaiseIfFailed("MakeArc", self.CurvesOp)
1319 ## Create an arc of circle from a center and 2 points.
1320 # @param thePnt1 Center of the arc
1321 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1322 # @param thePnt3 End point of the arc (Gives also a direction)
1323 # @param theSense Orientation of the arc
1324 # @return New GEOM.GEOM_Object, containing the created arc.
1326 # @ref swig_MakeArc "Example"
1327 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1329 Create an arc of circle from a center and 2 points.
1332 thePnt1 Center of the arc
1333 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1334 thePnt3 End point of the arc (Gives also a direction)
1335 theSense Orientation of the arc
1338 New GEOM.GEOM_Object, containing the created arc.
1340 # Example: see GEOM_TestAll.py
1341 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1342 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1345 ## Create an arc of ellipse, of center and two points.
1346 # @param theCenter Center of the arc.
1347 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1348 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1349 # @return New GEOM.GEOM_Object, containing the created arc.
1351 # @ref swig_MakeArc "Example"
1352 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1354 Create an arc of ellipse, of center and two points.
1357 theCenter Center of the arc.
1358 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1359 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1362 New GEOM.GEOM_Object, containing the created arc.
1364 # Example: see GEOM_TestAll.py
1365 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1366 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1369 ## Create a circle with given center, normal vector and radius.
1370 # @param thePnt Circle center.
1371 # @param theVec Vector, normal to the plane of the circle.
1372 # @param theR Circle radius.
1373 # @return New GEOM.GEOM_Object, containing the created circle.
1375 # @ref tui_creation_circle "Example"
1376 def MakeCircle(self, thePnt, theVec, theR):
1378 Create a circle with given center, normal vector and radius.
1381 thePnt Circle center.
1382 theVec Vector, normal to the plane of the circle.
1386 New GEOM.GEOM_Object, containing the created circle.
1388 # Example: see GEOM_TestAll.py
1389 theR, Parameters = ParseParameters(theR)
1390 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1391 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1392 anObj.SetParameters(Parameters)
1395 ## Create a circle with given radius.
1396 # Center of the circle will be in the origin of global
1397 # coordinate system and normal vector will be codirected with Z axis
1398 # @param theR Circle radius.
1399 # @return New GEOM.GEOM_Object, containing the created circle.
1400 def MakeCircleR(self, theR):
1402 Create a circle with given radius.
1403 Center of the circle will be in the origin of global
1404 coordinate system and normal vector will be codirected with Z axis
1410 New GEOM.GEOM_Object, containing the created circle.
1412 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1413 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1416 ## Create a circle, passing through three given points
1417 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1418 # @return New GEOM.GEOM_Object, containing the created circle.
1420 # @ref tui_creation_circle "Example"
1421 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1423 Create a circle, passing through three given points
1426 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1429 New GEOM.GEOM_Object, containing the created circle.
1431 # Example: see GEOM_TestAll.py
1432 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1433 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1436 ## Create a circle, with given point1 as center,
1437 # passing through the point2 as radius and laying in the plane,
1438 # defined by all three given points.
1439 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1440 # @return New GEOM.GEOM_Object, containing the created circle.
1442 # @ref swig_MakeCircle "Example"
1443 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1445 Create a circle, with given point1 as center,
1446 passing through the point2 as radius and laying in the plane,
1447 defined by all three given points.
1450 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1453 New GEOM.GEOM_Object, containing the created circle.
1455 # Example: see GEOM_example6.py
1456 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1457 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1460 ## Create an ellipse with given center, normal vector and radiuses.
1461 # @param thePnt Ellipse center.
1462 # @param theVec Vector, normal to the plane of the ellipse.
1463 # @param theRMajor Major ellipse radius.
1464 # @param theRMinor Minor ellipse radius.
1465 # @param theVecMaj Vector, direction of the ellipse's main axis.
1466 # @return New GEOM.GEOM_Object, containing the created ellipse.
1468 # @ref tui_creation_ellipse "Example"
1469 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1471 Create an ellipse with given center, normal vector and radiuses.
1474 thePnt Ellipse center.
1475 theVec Vector, normal to the plane of the ellipse.
1476 theRMajor Major ellipse radius.
1477 theRMinor Minor ellipse radius.
1478 theVecMaj Vector, direction of the ellipse's main axis.
1481 New GEOM.GEOM_Object, containing the created ellipse.
1483 # Example: see GEOM_TestAll.py
1484 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1485 if theVecMaj is not None:
1486 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1488 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1490 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1491 anObj.SetParameters(Parameters)
1494 ## Create an ellipse with given radiuses.
1495 # Center of the ellipse will be in the origin of global
1496 # coordinate system and normal vector will be codirected with Z axis
1497 # @param theRMajor Major ellipse radius.
1498 # @param theRMinor Minor ellipse radius.
1499 # @return New GEOM.GEOM_Object, containing the created ellipse.
1500 def MakeEllipseRR(self, theRMajor, theRMinor):
1502 Create an ellipse with given radiuses.
1503 Center of the ellipse will be in the origin of global
1504 coordinate system and normal vector will be codirected with Z axis
1507 theRMajor Major ellipse radius.
1508 theRMinor Minor ellipse radius.
1511 New GEOM.GEOM_Object, containing the created ellipse.
1513 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1514 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1517 ## Create a polyline on the set of points.
1518 # @param thePoints Sequence of points for the polyline.
1519 # @param theIsClosed If True, build a closed wire.
1520 # @return New GEOM.GEOM_Object, containing the created polyline.
1522 # @ref tui_creation_curve "Example"
1523 def MakePolyline(self, thePoints, theIsClosed=False):
1525 Create a polyline on the set of points.
1528 thePoints Sequence of points for the polyline.
1529 theIsClosed If True, build a closed wire.
1532 New GEOM.GEOM_Object, containing the created polyline.
1534 # Example: see GEOM_TestAll.py
1535 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1536 RaiseIfFailed("MakePolyline", self.CurvesOp)
1539 ## Create bezier curve on the set of points.
1540 # @param thePoints Sequence of points for the bezier curve.
1541 # @param theIsClosed If True, build a closed curve.
1542 # @return New GEOM.GEOM_Object, containing the created bezier curve.
1544 # @ref tui_creation_curve "Example"
1545 def MakeBezier(self, thePoints, theIsClosed=False):
1547 Create bezier curve on the set of points.
1550 thePoints Sequence of points for the bezier curve.
1551 theIsClosed If True, build a closed curve.
1554 New GEOM.GEOM_Object, containing the created bezier curve.
1556 # Example: see GEOM_TestAll.py
1557 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1558 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1561 ## Create B-Spline curve on the set of points.
1562 # @param thePoints Sequence of points for the B-Spline curve.
1563 # @param theIsClosed If True, build a closed curve.
1564 # @param theDoReordering If TRUE, the algo does not follow the order of
1565 # \a thePoints but searches for the closest vertex.
1566 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1568 # @ref tui_creation_curve "Example"
1569 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1571 Create B-Spline curve on the set of points.
1574 thePoints Sequence of points for the B-Spline curve.
1575 theIsClosed If True, build a closed curve.
1576 theDoReordering If True, the algo does not follow the order of
1577 thePoints but searches for the closest vertex.
1580 New GEOM.GEOM_Object, containing the created B-Spline curve.
1582 # Example: see GEOM_TestAll.py
1583 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1584 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1588 ## Creates a curve using the parametric definition of the basic points.
1589 # @param thexExpr parametric equation of the coordinates X.
1590 # @param theyExpr parametric equation of the coordinates Y.
1591 # @param thezExpr parametric equation of the coordinates Z.
1592 # @param theParamMin the minimal value of the parameter.
1593 # @param theParamMax the maximum value of the parameter.
1594 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1595 # @param theCurveType the type of the curve.
1596 # @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.
1597 # @return New GEOM.GEOM_Object, containing the created curve.
1599 # @ref tui_creation_curve "Example"
1600 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1601 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1603 Creates a curve using the parametric definition of the basic points.
1606 thexExpr parametric equation of the coordinates X.
1607 theyExpr parametric equation of the coordinates Y.
1608 thezExpr parametric equation of the coordinates Z.
1609 theParamMin the minimal value of the parameter.
1610 theParamMax the maximum value of the parameter.
1611 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1612 theCurveType the type of the curve.
1613 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1614 method is used which can lead to a bug.
1617 New GEOM.GEOM_Object, containing the created curve.
1619 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1621 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1623 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1624 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1625 anObj.SetParameters(Parameters)
1633 ## @addtogroup l3_sketcher
1636 ## Create a sketcher (wire or face), following the textual description,
1637 # passed through <VAR>theCommand</VAR> argument. \n
1638 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1639 # Format of the description string have to be the following:
1641 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1644 # - x1, y1 are coordinates of the first sketcher point (zero by default),
1646 # - "R angle" : Set the direction by angle
1647 # - "D dx dy" : Set the direction by DX & DY
1650 # - "TT x y" : Create segment by point at X & Y
1651 # - "T dx dy" : Create segment by point with DX & DY
1652 # - "L length" : Create segment by direction & Length
1653 # - "IX x" : Create segment by direction & Intersect. X
1654 # - "IY y" : Create segment by direction & Intersect. Y
1657 # - "C radius length" : Create arc by direction, radius and length(in degree)
1658 # - "AA x y": Create arc by point at X & Y
1659 # - "A dx dy" : Create arc by point with DX & DY
1660 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1661 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1662 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1663 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1666 # - "WW" : Close Wire (to finish)
1667 # - "WF" : Close Wire and build face (to finish)
1670 # - Flag1 (= reverse) is 0 or 2 ...
1671 # - if 0 the drawn arc is the one of lower angle (< Pi)
1672 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1675 # - Flag2 (= control tolerance) is 0 or 1 ...
1676 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1677 # - if 1 the wire is built only if the end point is on the arc
1678 # with a tolerance of 10^-7 on the distance else the creation fails
1680 # @param theCommand String, defining the sketcher in local
1681 # coordinates of the working plane.
1682 # @param theWorkingPlane Nine double values, defining origin,
1683 # OZ and OX directions of the working plane.
1684 # @return New GEOM.GEOM_Object, containing the created wire.
1686 # @ref tui_sketcher_page "Example"
1687 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1689 Create a sketcher (wire or face), following the textual description, passed
1690 through theCommand argument.
1691 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1692 Format of the description string have to be the following:
1693 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1695 - x1, y1 are coordinates of the first sketcher point (zero by default),
1697 - "R angle" : Set the direction by angle
1698 - "D dx dy" : Set the direction by DX & DY
1700 - "TT x y" : Create segment by point at X & Y
1701 - "T dx dy" : Create segment by point with DX & DY
1702 - "L length" : Create segment by direction & Length
1703 - "IX x" : Create segment by direction & Intersect. X
1704 - "IY y" : Create segment by direction & Intersect. Y
1706 - "C radius length" : Create arc by direction, radius and length(in degree)
1707 - "AA x y": Create arc by point at X & Y
1708 - "A dx dy" : Create arc by point with DX & DY
1709 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1710 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1711 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1712 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1714 - "WW" : Close Wire (to finish)
1715 - "WF" : Close Wire and build face (to finish)
1717 - Flag1 (= reverse) is 0 or 2 ...
1718 - if 0 the drawn arc is the one of lower angle (< Pi)
1719 - if 2 the drawn arc ius the one of greater angle (> Pi)
1721 - Flag2 (= control tolerance) is 0 or 1 ...
1722 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1723 - if 1 the wire is built only if the end point is on the arc
1724 with a tolerance of 10^-7 on the distance else the creation fails
1727 theCommand String, defining the sketcher in local
1728 coordinates of the working plane.
1729 theWorkingPlane Nine double values, defining origin,
1730 OZ and OX directions of the working plane.
1733 New GEOM.GEOM_Object, containing the created wire.
1735 # Example: see GEOM_TestAll.py
1736 theCommand,Parameters = ParseSketcherCommand(theCommand)
1737 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1738 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1739 anObj.SetParameters(Parameters)
1742 ## Create a sketcher (wire or face), following the textual description,
1743 # passed through <VAR>theCommand</VAR> argument. \n
1744 # For format of the description string see MakeSketcher() method.\n
1745 # @param theCommand String, defining the sketcher in local
1746 # coordinates of the working plane.
1747 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1748 # @return New GEOM.GEOM_Object, containing the created wire.
1750 # @ref tui_sketcher_page "Example"
1751 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1753 Create a sketcher (wire or face), following the textual description,
1754 passed through theCommand argument.
1755 For format of the description string see geompy.MakeSketcher() method.
1758 theCommand String, defining the sketcher in local
1759 coordinates of the working plane.
1760 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1763 New GEOM.GEOM_Object, containing the created wire.
1765 theCommand,Parameters = ParseSketcherCommand(theCommand)
1766 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1767 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1768 anObj.SetParameters(Parameters)
1771 ## Create a sketcher wire, following the numerical description,
1772 # passed through <VAR>theCoordinates</VAR> argument. \n
1773 # @param theCoordinates double values, defining points to create a wire,
1775 # @return New GEOM.GEOM_Object, containing the created wire.
1777 # @ref tui_3dsketcher_page "Example"
1778 def Make3DSketcher(self, theCoordinates):
1780 Create a sketcher wire, following the numerical description,
1781 passed through theCoordinates argument.
1784 theCoordinates double values, defining points to create a wire,
1788 New GEOM_Object, containing the created wire.
1790 theCoordinates,Parameters = ParseParameters(theCoordinates)
1791 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1792 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1793 anObj.SetParameters(Parameters)
1796 ## Obtain a 3D sketcher interface
1797 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
1799 # @ref tui_3dsketcher_page "Example"
1800 def Sketcher3D (self):
1802 Obtain a 3D sketcher interface.
1805 sk = geompy.Sketcher3D()
1806 sk.addPointsAbsolute(0,0,0, 70,0,0)
1807 sk.addPointsRelative(0, 0, 130)
1808 sk.addPointAnglesLength("OXY", 50, 0, 100)
1809 sk.addPointAnglesLength("OXZ", 30, 80, 130)
1811 a3D_Sketcher_1 = sk.wire()
1813 sk = Sketcher3D (self)
1816 # end of l3_sketcher
1819 ## @addtogroup l3_3d_primitives
1822 ## Create a box by coordinates of two opposite vertices.
1824 # @param x1,y1,z1 double values, defining first point it.
1825 # @param x2,y2,z2 double values, defining first point it.
1827 # @return New GEOM.GEOM_Object, containing the created box.
1828 # @ref tui_creation_box "Example"
1829 def MakeBox (self, x1,y1,z1, x2,y2,z2):
1831 Create a box by coordinates of two opposite vertices.
1834 x1,y1,z1 double values, defining first point.
1835 x2,y2,z2 double values, defining second point.
1838 New GEOM.GEOM_Object, containing the created box.
1840 # Example: see GEOM_TestAll.py
1841 pnt1 = self.MakeVertex(x1,y1,z1)
1842 pnt2 = self.MakeVertex(x2,y2,z2)
1843 return self.MakeBoxTwoPnt(pnt1,pnt2)
1845 ## Create a box with specified dimensions along the coordinate axes
1846 # and with edges, parallel to the coordinate axes.
1847 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1848 # @param theDX Length of Box edges, parallel to OX axis.
1849 # @param theDY Length of Box edges, parallel to OY axis.
1850 # @param theDZ Length of Box edges, parallel to OZ axis.
1851 # @return New GEOM.GEOM_Object, containing the created box.
1853 # @ref tui_creation_box "Example"
1854 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1856 Create a box with specified dimensions along the coordinate axes
1857 and with edges, parallel to the coordinate axes.
1858 Center of the box will be at point (DX/2, DY/2, DZ/2).
1861 theDX Length of Box edges, parallel to OX axis.
1862 theDY Length of Box edges, parallel to OY axis.
1863 theDZ Length of Box edges, parallel to OZ axis.
1866 New GEOM.GEOM_Object, containing the created box.
1868 # Example: see GEOM_TestAll.py
1869 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1870 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1871 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1872 anObj.SetParameters(Parameters)
1875 ## Create a box with two specified opposite vertices,
1876 # and with edges, parallel to the coordinate axes
1877 # @param thePnt1 First of two opposite vertices.
1878 # @param thePnt2 Second of two opposite vertices.
1879 # @return New GEOM.GEOM_Object, containing the created box.
1881 # @ref tui_creation_box "Example"
1882 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1884 Create a box with two specified opposite vertices,
1885 and with edges, parallel to the coordinate axes
1888 thePnt1 First of two opposite vertices.
1889 thePnt2 Second of two opposite vertices.
1892 New GEOM.GEOM_Object, containing the created box.
1894 # Example: see GEOM_TestAll.py
1895 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1896 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1899 ## Create a face with specified dimensions with edges parallel to coordinate axes.
1900 # @param theH height of Face.
1901 # @param theW width of Face.
1902 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1903 # @return New GEOM.GEOM_Object, containing the created face.
1905 # @ref tui_creation_face "Example"
1906 def MakeFaceHW(self,theH, theW, theOrientation):
1908 Create a face with specified dimensions with edges parallel to coordinate axes.
1911 theH height of Face.
1913 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1916 New GEOM.GEOM_Object, containing the created face.
1918 # Example: see GEOM_TestAll.py
1919 theH,theW,Parameters = ParseParameters(theH, theW)
1920 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1921 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1922 anObj.SetParameters(Parameters)
1925 ## Create a face from another plane and two sizes,
1926 # vertical size and horisontal size.
1927 # @param theObj Normale vector to the creating face or
1929 # @param theH Height (vertical size).
1930 # @param theW Width (horisontal size).
1931 # @return New GEOM.GEOM_Object, containing the created face.
1933 # @ref tui_creation_face "Example"
1934 def MakeFaceObjHW(self, theObj, theH, theW):
1936 Create a face from another plane and two sizes,
1937 vertical size and horisontal size.
1940 theObj Normale vector to the creating face or
1942 theH Height (vertical size).
1943 theW Width (horisontal size).
1946 New GEOM_Object, containing the created face.
1948 # Example: see GEOM_TestAll.py
1949 theH,theW,Parameters = ParseParameters(theH, theW)
1950 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1951 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1952 anObj.SetParameters(Parameters)
1955 ## Create a disk with given center, normal vector and radius.
1956 # @param thePnt Disk center.
1957 # @param theVec Vector, normal to the plane of the disk.
1958 # @param theR Disk radius.
1959 # @return New GEOM.GEOM_Object, containing the created disk.
1961 # @ref tui_creation_disk "Example"
1962 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1964 Create a disk with given center, normal vector and radius.
1968 theVec Vector, normal to the plane of the disk.
1972 New GEOM.GEOM_Object, containing the created disk.
1974 # Example: see GEOM_TestAll.py
1975 theR,Parameters = ParseParameters(theR)
1976 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1977 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1978 anObj.SetParameters(Parameters)
1981 ## Create a disk, passing through three given points
1982 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1983 # @return New GEOM.GEOM_Object, containing the created disk.
1985 # @ref tui_creation_disk "Example"
1986 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1988 Create a disk, passing through three given points
1991 thePnt1,thePnt2,thePnt3 Points, defining the disk.
1994 New GEOM.GEOM_Object, containing the created disk.
1996 # Example: see GEOM_TestAll.py
1997 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1998 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2001 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2002 # @param theR Radius of Face.
2003 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2004 # @return New GEOM.GEOM_Object, containing the created disk.
2006 # @ref tui_creation_face "Example"
2007 def MakeDiskR(self,theR, theOrientation):
2009 Create a disk with specified dimensions along OX-OY coordinate axes.
2012 theR Radius of Face.
2013 theOrientation set the orientation belong axis OXY or OYZ or OZX
2016 New GEOM.GEOM_Object, containing the created disk.
2019 Disk3 = geompy.MakeDiskR(100., 1)
2021 # Example: see GEOM_TestAll.py
2022 theR,Parameters = ParseParameters(theR)
2023 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2024 RaiseIfFailed("MakeDiskR", self.PrimOp)
2025 anObj.SetParameters(Parameters)
2028 ## Create a cylinder with given base point, axis, radius and height.
2029 # @param thePnt Central point of cylinder base.
2030 # @param theAxis Cylinder axis.
2031 # @param theR Cylinder radius.
2032 # @param theH Cylinder height.
2033 # @return New GEOM.GEOM_Object, containing the created cylinder.
2035 # @ref tui_creation_cylinder "Example"
2036 def MakeCylinder(self,thePnt, theAxis, theR, theH):
2038 Create a cylinder with given base point, axis, radius and height.
2041 thePnt Central point of cylinder base.
2042 theAxis Cylinder axis.
2043 theR Cylinder radius.
2044 theH Cylinder height.
2047 New GEOM.GEOM_Object, containing the created cylinder.
2049 # Example: see GEOM_TestAll.py
2050 theR,theH,Parameters = ParseParameters(theR, theH)
2051 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2052 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2053 anObj.SetParameters(Parameters)
2056 ## Create a cylinder with given radius and height at
2057 # the origin of coordinate system. Axis of the cylinder
2058 # will be collinear to the OZ axis of the coordinate system.
2059 # @param theR Cylinder radius.
2060 # @param theH Cylinder height.
2061 # @return New GEOM.GEOM_Object, containing the created cylinder.
2063 # @ref tui_creation_cylinder "Example"
2064 def MakeCylinderRH(self,theR, theH):
2066 Create a cylinder with given radius and height at
2067 the origin of coordinate system. Axis of the cylinder
2068 will be collinear to the OZ axis of the coordinate system.
2071 theR Cylinder radius.
2072 theH Cylinder height.
2075 New GEOM.GEOM_Object, containing the created cylinder.
2077 # Example: see GEOM_TestAll.py
2078 theR,theH,Parameters = ParseParameters(theR, theH)
2079 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2080 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2081 anObj.SetParameters(Parameters)
2084 ## Create a sphere with given center and radius.
2085 # @param thePnt Sphere center.
2086 # @param theR Sphere radius.
2087 # @return New GEOM.GEOM_Object, containing the created sphere.
2089 # @ref tui_creation_sphere "Example"
2090 def MakeSpherePntR(self, thePnt, theR):
2092 Create a sphere with given center and radius.
2095 thePnt Sphere center.
2099 New GEOM.GEOM_Object, containing the created sphere.
2101 # Example: see GEOM_TestAll.py
2102 theR,Parameters = ParseParameters(theR)
2103 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2104 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2105 anObj.SetParameters(Parameters)
2108 ## Create a sphere with given center and radius.
2109 # @param x,y,z Coordinates of sphere center.
2110 # @param theR Sphere radius.
2111 # @return New GEOM.GEOM_Object, containing the created sphere.
2113 # @ref tui_creation_sphere "Example"
2114 def MakeSphere(self, x, y, z, theR):
2116 Create a sphere with given center and radius.
2119 x,y,z Coordinates of sphere center.
2123 New GEOM.GEOM_Object, containing the created sphere.
2125 # Example: see GEOM_TestAll.py
2126 point = self.MakeVertex(x, y, z)
2127 anObj = self.MakeSpherePntR(point, theR)
2130 ## Create a sphere with given radius at the origin of coordinate system.
2131 # @param theR Sphere radius.
2132 # @return New GEOM.GEOM_Object, containing the created sphere.
2134 # @ref tui_creation_sphere "Example"
2135 def MakeSphereR(self, theR):
2137 Create a sphere with given radius at the origin of coordinate system.
2143 New GEOM.GEOM_Object, containing the created sphere.
2145 # Example: see GEOM_TestAll.py
2146 theR,Parameters = ParseParameters(theR)
2147 anObj = self.PrimOp.MakeSphereR(theR)
2148 RaiseIfFailed("MakeSphereR", self.PrimOp)
2149 anObj.SetParameters(Parameters)
2152 ## Create a cone with given base point, axis, height and radiuses.
2153 # @param thePnt Central point of the first cone base.
2154 # @param theAxis Cone axis.
2155 # @param theR1 Radius of the first cone base.
2156 # @param theR2 Radius of the second cone base.
2157 # \note If both radiuses are non-zero, the cone will be truncated.
2158 # \note If the radiuses are equal, a cylinder will be created instead.
2159 # @param theH Cone height.
2160 # @return New GEOM.GEOM_Object, containing the created cone.
2162 # @ref tui_creation_cone "Example"
2163 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2165 Create a cone with given base point, axis, height and radiuses.
2168 thePnt Central point of the first cone base.
2170 theR1 Radius of the first cone base.
2171 theR2 Radius of the second cone base.
2175 If both radiuses are non-zero, the cone will be truncated.
2176 If the radiuses are equal, a cylinder will be created instead.
2179 New GEOM.GEOM_Object, containing the created cone.
2181 # Example: see GEOM_TestAll.py
2182 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2183 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2184 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2185 anObj.SetParameters(Parameters)
2188 ## Create a cone with given height and radiuses at
2189 # the origin of coordinate system. Axis of the cone will
2190 # be collinear to the OZ axis of the coordinate system.
2191 # @param theR1 Radius of the first cone base.
2192 # @param theR2 Radius of the second cone base.
2193 # \note If both radiuses are non-zero, the cone will be truncated.
2194 # \note If the radiuses are equal, a cylinder will be created instead.
2195 # @param theH Cone height.
2196 # @return New GEOM.GEOM_Object, containing the created cone.
2198 # @ref tui_creation_cone "Example"
2199 def MakeConeR1R2H(self,theR1, theR2, theH):
2201 Create a cone with given height and radiuses at
2202 the origin of coordinate system. Axis of the cone will
2203 be collinear to the OZ axis of the coordinate system.
2206 theR1 Radius of the first cone base.
2207 theR2 Radius of the second cone base.
2211 If both radiuses are non-zero, the cone will be truncated.
2212 If the radiuses are equal, a cylinder will be created instead.
2215 New GEOM.GEOM_Object, containing the created cone.
2217 # Example: see GEOM_TestAll.py
2218 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2219 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2220 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2221 anObj.SetParameters(Parameters)
2224 ## Create a torus with given center, normal vector and radiuses.
2225 # @param thePnt Torus central point.
2226 # @param theVec Torus axis of symmetry.
2227 # @param theRMajor Torus major radius.
2228 # @param theRMinor Torus minor radius.
2229 # @return New GEOM.GEOM_Object, containing the created torus.
2231 # @ref tui_creation_torus "Example"
2232 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2234 Create a torus with given center, normal vector and radiuses.
2237 thePnt Torus central point.
2238 theVec Torus axis of symmetry.
2239 theRMajor Torus major radius.
2240 theRMinor Torus minor radius.
2243 New GEOM.GEOM_Object, containing the created torus.
2245 # Example: see GEOM_TestAll.py
2246 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2247 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2248 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2249 anObj.SetParameters(Parameters)
2252 ## Create a torus with given radiuses at the origin of coordinate system.
2253 # @param theRMajor Torus major radius.
2254 # @param theRMinor Torus minor radius.
2255 # @return New GEOM.GEOM_Object, containing the created torus.
2257 # @ref tui_creation_torus "Example"
2258 def MakeTorusRR(self, theRMajor, theRMinor):
2260 Create a torus with given radiuses at the origin of coordinate system.
2263 theRMajor Torus major radius.
2264 theRMinor Torus minor radius.
2267 New GEOM.GEOM_Object, containing the created torus.
2269 # Example: see GEOM_TestAll.py
2270 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2271 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2272 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2273 anObj.SetParameters(Parameters)
2276 # end of l3_3d_primitives
2279 ## @addtogroup l3_complex
2282 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2283 # @param theBase Base shape to be extruded.
2284 # @param thePoint1 First end of extrusion vector.
2285 # @param thePoint2 Second end of extrusion vector.
2286 # @param theScaleFactor Use it to make prism with scaled second base.
2287 # Nagative value means not scaled second base.
2288 # @return New GEOM.GEOM_Object, containing the created prism.
2290 # @ref tui_creation_prism "Example"
2291 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2293 Create a shape by extrusion of the base shape along a vector, defined by two points.
2296 theBase Base shape to be extruded.
2297 thePoint1 First end of extrusion vector.
2298 thePoint2 Second end of extrusion vector.
2299 theScaleFactor Use it to make prism with scaled second base.
2300 Nagative value means not scaled second base.
2303 New GEOM.GEOM_Object, containing the created prism.
2305 # Example: see GEOM_TestAll.py
2308 if theScaleFactor > 0:
2309 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2310 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2312 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2313 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2314 anObj.SetParameters(Parameters)
2317 ## Create a shape by extrusion of the base shape along a
2318 # vector, defined by two points, in 2 Ways (forward/backward).
2319 # @param theBase Base shape to be extruded.
2320 # @param thePoint1 First end of extrusion vector.
2321 # @param thePoint2 Second end of extrusion vector.
2322 # @return New GEOM.GEOM_Object, containing the created prism.
2324 # @ref tui_creation_prism "Example"
2325 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2327 Create a shape by extrusion of the base shape along a
2328 vector, defined by two points, in 2 Ways (forward/backward).
2331 theBase Base shape to be extruded.
2332 thePoint1 First end of extrusion vector.
2333 thePoint2 Second end of extrusion vector.
2336 New GEOM.GEOM_Object, containing the created prism.
2338 # Example: see GEOM_TestAll.py
2339 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2340 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2343 ## Create a shape by extrusion of the base shape along the vector,
2344 # i.e. all the space, transfixed by the base shape during its translation
2345 # along the vector on the given distance.
2346 # @param theBase Base shape to be extruded.
2347 # @param theVec Direction of extrusion.
2348 # @param theH Prism dimension along theVec.
2349 # @param theScaleFactor Use it to make prism with scaled second base.
2350 # Negative value means not scaled second base.
2351 # @return New GEOM.GEOM_Object, containing the created prism.
2353 # @ref tui_creation_prism "Example"
2354 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2356 Create a shape by extrusion of the base shape along the vector,
2357 i.e. all the space, transfixed by the base shape during its translation
2358 along the vector on the given distance.
2361 theBase Base shape to be extruded.
2362 theVec Direction of extrusion.
2363 theH Prism dimension along theVec.
2364 theScaleFactor Use it to make prism with scaled second base.
2365 Negative value means not scaled second base.
2368 New GEOM.GEOM_Object, containing the created prism.
2370 # Example: see GEOM_TestAll.py
2373 if theScaleFactor > 0:
2374 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2375 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2377 theH,Parameters = ParseParameters(theH)
2378 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2379 RaiseIfFailed("MakePrismVecH", self.PrimOp)
2380 anObj.SetParameters(Parameters)
2383 ## Create a shape by extrusion of the base shape along the vector,
2384 # i.e. all the space, transfixed by the base shape during its translation
2385 # along the vector on the given distance in 2 Ways (forward/backward).
2386 # @param theBase Base shape to be extruded.
2387 # @param theVec Direction of extrusion.
2388 # @param theH Prism dimension along theVec in forward direction.
2389 # @return New GEOM.GEOM_Object, containing the created prism.
2391 # @ref tui_creation_prism "Example"
2392 def MakePrismVecH2Ways(self, theBase, theVec, theH):
2394 Create a shape by extrusion of the base shape along the vector,
2395 i.e. all the space, transfixed by the base shape during its translation
2396 along the vector on the given distance in 2 Ways (forward/backward).
2399 theBase Base shape to be extruded.
2400 theVec Direction of extrusion.
2401 theH Prism dimension along theVec in forward direction.
2404 New GEOM.GEOM_Object, containing the created prism.
2406 # Example: see GEOM_TestAll.py
2407 theH,Parameters = ParseParameters(theH)
2408 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2409 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2410 anObj.SetParameters(Parameters)
2413 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2414 # @param theBase Base shape to be extruded.
2415 # @param theDX, theDY, theDZ Directions of extrusion.
2416 # @param theScaleFactor Use it to make prism with scaled second base.
2417 # Nagative value means not scaled second base.
2418 # @return New GEOM.GEOM_Object, containing the created prism.
2420 # @ref tui_creation_prism "Example"
2421 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2423 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2426 theBase Base shape to be extruded.
2427 theDX, theDY, theDZ Directions of extrusion.
2428 theScaleFactor Use it to make prism with scaled second base.
2429 Nagative value means not scaled second base.
2432 New GEOM.GEOM_Object, containing the created prism.
2434 # Example: see GEOM_TestAll.py
2437 if theScaleFactor > 0:
2438 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2439 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2441 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2442 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2443 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2444 anObj.SetParameters(Parameters)
2447 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2448 # i.e. all the space, transfixed by the base shape during its translation
2449 # along the vector on the given distance in 2 Ways (forward/backward).
2450 # @param theBase Base shape to be extruded.
2451 # @param theDX, theDY, theDZ Directions of extrusion.
2452 # @return New GEOM.GEOM_Object, containing the created prism.
2454 # @ref tui_creation_prism "Example"
2455 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2457 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2458 i.e. all the space, transfixed by the base shape during its translation
2459 along the vector on the given distance in 2 Ways (forward/backward).
2462 theBase Base shape to be extruded.
2463 theDX, theDY, theDZ Directions of extrusion.
2466 New GEOM.GEOM_Object, containing the created prism.
2468 # Example: see GEOM_TestAll.py
2469 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2470 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2471 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2472 anObj.SetParameters(Parameters)
2475 ## Create a shape by revolution of the base shape around the axis
2476 # on the given angle, i.e. all the space, transfixed by the base
2477 # shape during its rotation around the axis on the given angle.
2478 # @param theBase Base shape to be rotated.
2479 # @param theAxis Rotation axis.
2480 # @param theAngle Rotation angle in radians.
2481 # @return New GEOM.GEOM_Object, containing the created revolution.
2483 # @ref tui_creation_revolution "Example"
2484 def MakeRevolution(self, theBase, theAxis, theAngle):
2486 Create a shape by revolution of the base shape around the axis
2487 on the given angle, i.e. all the space, transfixed by the base
2488 shape during its rotation around the axis on the given angle.
2491 theBase Base shape to be rotated.
2492 theAxis Rotation axis.
2493 theAngle Rotation angle in radians.
2496 New GEOM.GEOM_Object, containing the created revolution.
2498 # Example: see GEOM_TestAll.py
2499 theAngle,Parameters = ParseParameters(theAngle)
2500 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2501 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2502 anObj.SetParameters(Parameters)
2505 ## Create a shape by revolution of the base shape around the axis
2506 # on the given angle, i.e. all the space, transfixed by the base
2507 # shape during its rotation around the axis on the given angle in
2508 # both directions (forward/backward)
2509 # @param theBase Base shape to be rotated.
2510 # @param theAxis Rotation axis.
2511 # @param theAngle Rotation angle in radians.
2512 # @return New GEOM.GEOM_Object, containing the created revolution.
2514 # @ref tui_creation_revolution "Example"
2515 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2517 Create a shape by revolution of the base shape around the axis
2518 on the given angle, i.e. all the space, transfixed by the base
2519 shape during its rotation around the axis on the given angle in
2520 both directions (forward/backward).
2523 theBase Base shape to be rotated.
2524 theAxis Rotation axis.
2525 theAngle Rotation angle in radians.
2528 New GEOM.GEOM_Object, containing the created revolution.
2530 theAngle,Parameters = ParseParameters(theAngle)
2531 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2532 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2533 anObj.SetParameters(Parameters)
2536 ## Create a filling from the given compound of contours.
2537 # @param theShape the compound of contours
2538 # @param theMinDeg a minimal degree of BSpline surface to create
2539 # @param theMaxDeg a maximal degree of BSpline surface to create
2540 # @param theTol2D a 2d tolerance to be reached
2541 # @param theTol3D a 3d tolerance to be reached
2542 # @param theNbIter a number of iteration of approximation algorithm
2543 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2544 # @param isApprox if True, BSpline curves are generated in the process
2545 # of surface construction. By default it is False, that means
2546 # the surface is created using given curves. The usage of
2547 # Approximation makes the algorithm work slower, but allows
2548 # building the surface for rather complex cases.
2549 # @return New GEOM.GEOM_Object, containing the created filling surface.
2551 # @ref tui_creation_filling "Example"
2552 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2553 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2555 Create a filling from the given compound of contours.
2558 theShape the compound of contours
2559 theMinDeg a minimal degree of BSpline surface to create
2560 theMaxDeg a maximal degree of BSpline surface to create
2561 theTol2D a 2d tolerance to be reached
2562 theTol3D a 3d tolerance to be reached
2563 theNbIter a number of iteration of approximation algorithm
2564 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2565 isApprox if True, BSpline curves are generated in the process
2566 of surface construction. By default it is False, that means
2567 the surface is created using given curves. The usage of
2568 Approximation makes the algorithm work slower, but allows
2569 building the surface for rather complex cases
2572 New GEOM.GEOM_Object, containing the created filling surface.
2575 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2577 # Example: see GEOM_TestAll.py
2578 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2579 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2580 theTol2D, theTol3D, theNbIter,
2581 theMethod, isApprox)
2582 RaiseIfFailed("MakeFilling", self.PrimOp)
2583 anObj.SetParameters(Parameters)
2587 ## Create a filling from the given compound of contours.
2588 # This method corresponds to MakeFilling with isApprox=True
2589 # @param theShape the compound of contours
2590 # @param theMinDeg a minimal degree of BSpline surface to create
2591 # @param theMaxDeg a maximal degree of BSpline surface to create
2592 # @param theTol3D a 3d tolerance to be reached
2593 # @return New GEOM.GEOM_Object, containing the created filling surface.
2595 # @ref tui_creation_filling "Example"
2596 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2598 Create a filling from the given compound of contours.
2599 This method corresponds to MakeFilling with isApprox=True
2602 theShape the compound of contours
2603 theMinDeg a minimal degree of BSpline surface to create
2604 theMaxDeg a maximal degree of BSpline surface to create
2605 theTol3D a 3d tolerance to be reached
2608 New GEOM.GEOM_Object, containing the created filling surface.
2611 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2613 # Example: see GEOM_TestAll.py
2614 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2615 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2616 0, theTol3D, 0, GEOM.FOM_Default, True)
2617 RaiseIfFailed("MakeFillingNew", self.PrimOp)
2618 anObj.SetParameters(Parameters)
2621 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2622 # @param theSeqSections - set of specified sections.
2623 # @param theModeSolid - mode defining building solid or shell
2624 # @param thePreci - precision 3D used for smoothing
2625 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2626 # @return New GEOM.GEOM_Object, containing the created shell or solid.
2628 # @ref swig_todo "Example"
2629 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2631 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2634 theSeqSections - set of specified sections.
2635 theModeSolid - mode defining building solid or shell
2636 thePreci - precision 3D used for smoothing
2637 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2640 New GEOM.GEOM_Object, containing the created shell or solid.
2642 # Example: see GEOM_TestAll.py
2643 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2644 RaiseIfFailed("MakeThruSections", self.PrimOp)
2647 ## Create a shape by extrusion of the base shape along
2648 # the path shape. The path shape can be a wire or an edge.
2649 # @param theBase Base shape to be extruded.
2650 # @param thePath Path shape to extrude the base shape along it.
2651 # @return New GEOM.GEOM_Object, containing the created pipe.
2653 # @ref tui_creation_pipe "Example"
2654 def MakePipe(self,theBase, thePath):
2656 Create a shape by extrusion of the base shape along
2657 the path shape. The path shape can be a wire or an edge.
2660 theBase Base shape to be extruded.
2661 thePath Path shape to extrude the base shape along it.
2664 New GEOM.GEOM_Object, containing the created pipe.
2666 # Example: see GEOM_TestAll.py
2667 anObj = self.PrimOp.MakePipe(theBase, thePath)
2668 RaiseIfFailed("MakePipe", self.PrimOp)
2671 ## Create a shape by extrusion of the profile shape along
2672 # the path shape. The path shape can be a wire or an edge.
2673 # the several profiles can be specified in the several locations of path.
2674 # @param theSeqBases - list of Bases shape to be extruded.
2675 # @param theLocations - list of locations on the path corresponding
2676 # specified list of the Bases shapes. Number of locations
2677 # should be equal to number of bases or list of locations can be empty.
2678 # @param thePath - Path shape to extrude the base shape along it.
2679 # @param theWithContact - the mode defining that the section is translated to be in
2680 # contact with the spine.
2681 # @param theWithCorrection - defining that the section is rotated to be
2682 # orthogonal to the spine tangent in the correspondent point
2683 # @return New GEOM.GEOM_Object, containing the created pipe.
2685 # @ref tui_creation_pipe_with_diff_sec "Example"
2686 def MakePipeWithDifferentSections(self, theSeqBases,
2687 theLocations, thePath,
2688 theWithContact, theWithCorrection):
2690 Create a shape by extrusion of the profile shape along
2691 the path shape. The path shape can be a wire or an edge.
2692 the several profiles can be specified in the several locations of path.
2695 theSeqBases - list of Bases shape to be extruded.
2696 theLocations - list of locations on the path corresponding
2697 specified list of the Bases shapes. Number of locations
2698 should be equal to number of bases or list of locations can be empty.
2699 thePath - Path shape to extrude the base shape along it.
2700 theWithContact - the mode defining that the section is translated to be in
2701 contact with the spine(0/1)
2702 theWithCorrection - defining that the section is rotated to be
2703 orthogonal to the spine tangent in the correspondent point (0/1)
2706 New GEOM.GEOM_Object, containing the created pipe.
2708 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2709 theLocations, thePath,
2710 theWithContact, theWithCorrection)
2711 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2714 ## Create a shape by extrusion of the profile shape along
2715 # the path shape. The path shape can be a wire or a edge.
2716 # the several profiles can be specified in the several locations of path.
2717 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
2718 # shell or face. If number of faces in neighbour sections
2719 # aren't coincided result solid between such sections will
2720 # be created using external boundaries of this shells.
2721 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2722 # This list is used for searching correspondences between
2723 # faces in the sections. Size of this list must be equal
2724 # to size of list of base shapes.
2725 # @param theLocations - list of locations on the path corresponding
2726 # specified list of the Bases shapes. Number of locations
2727 # should be equal to number of bases. First and last
2728 # locations must be coincided with first and last vertexes
2729 # of path correspondingly.
2730 # @param thePath - Path shape to extrude the base shape along it.
2731 # @param theWithContact - the mode defining that the section is translated to be in
2732 # contact with the spine.
2733 # @param theWithCorrection - defining that the section is rotated to be
2734 # orthogonal to the spine tangent in the correspondent point
2735 # @return New GEOM.GEOM_Object, containing the created solids.
2737 # @ref tui_creation_pipe_with_shell_sec "Example"
2738 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2739 theLocations, thePath,
2740 theWithContact, theWithCorrection):
2742 Create a shape by extrusion of the profile shape along
2743 the path shape. The path shape can be a wire or a edge.
2744 the several profiles can be specified in the several locations of path.
2747 theSeqBases - list of Bases shape to be extruded. Base shape must be
2748 shell or face. If number of faces in neighbour sections
2749 aren't coincided result solid between such sections will
2750 be created using external boundaries of this shells.
2751 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2752 This list is used for searching correspondences between
2753 faces in the sections. Size of this list must be equal
2754 to size of list of base shapes.
2755 theLocations - list of locations on the path corresponding
2756 specified list of the Bases shapes. Number of locations
2757 should be equal to number of bases. First and last
2758 locations must be coincided with first and last vertexes
2759 of path correspondingly.
2760 thePath - Path shape to extrude the base shape along it.
2761 theWithContact - the mode defining that the section is translated to be in
2762 contact with the spine (0/1)
2763 theWithCorrection - defining that the section is rotated to be
2764 orthogonal to the spine tangent in the correspondent point (0/1)
2767 New GEOM.GEOM_Object, containing the created solids.
2769 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2770 theLocations, thePath,
2771 theWithContact, theWithCorrection)
2772 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2775 ## Create a shape by extrusion of the profile shape along
2776 # the path shape. This function is used only for debug pipe
2777 # functionality - it is a version of function MakePipeWithShellSections()
2778 # which give a possibility to recieve information about
2779 # creating pipe between each pair of sections step by step.
2780 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2781 theLocations, thePath,
2782 theWithContact, theWithCorrection):
2784 Create a shape by extrusion of the profile shape along
2785 the path shape. This function is used only for debug pipe
2786 functionality - it is a version of previous function
2787 geompy.MakePipeWithShellSections() which give a possibility to
2788 recieve information about creating pipe between each pair of
2789 sections step by step.
2792 nbsect = len(theSeqBases)
2793 nbsubsect = len(theSeqSubBases)
2794 #print "nbsect = ",nbsect
2795 for i in range(1,nbsect):
2797 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2798 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2800 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2801 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2802 tmpLocations, thePath,
2803 theWithContact, theWithCorrection)
2804 if self.PrimOp.IsDone() == 0:
2805 print "Problems with pipe creation between ",i," and ",i+1," sections"
2806 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2809 print "Pipe between ",i," and ",i+1," sections is OK"
2814 resc = self.MakeCompound(res)
2815 #resc = self.MakeSewing(res, 0.001)
2816 #print "resc: ",resc
2819 ## Create solids between given sections
2820 # @param theSeqBases - list of sections (shell or face).
2821 # @param theLocations - list of corresponding vertexes
2822 # @return New GEOM.GEOM_Object, containing the created solids.
2824 # @ref tui_creation_pipe_without_path "Example"
2825 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2827 Create solids between given sections
2830 theSeqBases - list of sections (shell or face).
2831 theLocations - list of corresponding vertexes
2834 New GEOM.GEOM_Object, containing the created solids.
2836 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2837 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2840 ## Create a shape by extrusion of the base shape along
2841 # the path shape with constant bi-normal direction along the given vector.
2842 # The path shape can be a wire or an edge.
2843 # @param theBase Base shape to be extruded.
2844 # @param thePath Path shape to extrude the base shape along it.
2845 # @param theVec Vector defines a constant binormal direction to keep the
2846 # same angle beetween the direction and the sections
2847 # along the sweep surface.
2848 # @return New GEOM.GEOM_Object, containing the created pipe.
2850 # @ref tui_creation_pipe "Example"
2851 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2853 Create a shape by extrusion of the base shape along
2854 the path shape with constant bi-normal direction along the given vector.
2855 The path shape can be a wire or an edge.
2858 theBase Base shape to be extruded.
2859 thePath Path shape to extrude the base shape along it.
2860 theVec Vector defines a constant binormal direction to keep the
2861 same angle beetween the direction and the sections
2862 along the sweep surface.
2865 New GEOM.GEOM_Object, containing the created pipe.
2867 # Example: see GEOM_TestAll.py
2868 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2869 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2872 ## Build a middle path of a pipe-like shape.
2873 # The path shape can be a wire or an edge.
2874 # @param theShape It can be closed or unclosed pipe-like shell
2875 # or a pipe-like solid.
2876 # @param theBase1, theBase2 Two bases of the supposed pipe. This
2877 # should be wires or faces of theShape.
2878 # @note It is not assumed that exact or approximate copy of theShape
2879 # can be obtained by applying existing Pipe operation on the
2880 # resulting "Path" wire taking theBase1 as the base - it is not
2881 # always possible; though in some particular cases it might work
2882 # it is not guaranteed. Thus, RestorePath function should not be
2883 # considered as an exact reverse operation of the Pipe.
2884 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
2885 # source pipe's "path".
2887 # @ref tui_creation_pipe_path "Example"
2888 def RestorePath (self, theShape, theBase1, theBase2):
2890 Build a middle path of a pipe-like shape.
2891 The path shape can be a wire or an edge.
2894 theShape It can be closed or unclosed pipe-like shell
2895 or a pipe-like solid.
2896 theBase1, theBase2 Two bases of the supposed pipe. This
2897 should be wires or faces of theShape.
2900 New GEOM_Object, containing an edge or wire that represent
2903 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
2904 RaiseIfFailed("RestorePath", self.PrimOp)
2907 ## Build a middle path of a pipe-like shape.
2908 # The path shape can be a wire or an edge.
2909 # @param theShape It can be closed or unclosed pipe-like shell
2910 # or a pipe-like solid.
2911 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
2912 # should be lists of edges of theShape.
2913 # @note It is not assumed that exact or approximate copy of theShape
2914 # can be obtained by applying existing Pipe operation on the
2915 # resulting "Path" wire taking theBase1 as the base - it is not
2916 # always possible; though in some particular cases it might work
2917 # it is not guaranteed. Thus, RestorePath function should not be
2918 # considered as an exact reverse operation of the Pipe.
2919 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
2920 # source pipe's "path".
2922 # @ref tui_creation_pipe_path "Example"
2923 def RestorePathEdges (self, theShape, listEdges1, listEdges2):
2925 Build a middle path of a pipe-like shape.
2926 The path shape can be a wire or an edge.
2929 theShape It can be closed or unclosed pipe-like shell
2930 or a pipe-like solid.
2931 listEdges1, listEdges2 Two bases of the supposed pipe. This
2932 should be lists of edges of theShape.
2935 New GEOM_Object, containing an edge or wire that represent
2938 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
2939 RaiseIfFailed("RestorePath", self.PrimOp)
2945 ## @addtogroup l3_advanced
2948 ## Create a linear edge with specified ends.
2949 # @param thePnt1 Point for the first end of edge.
2950 # @param thePnt2 Point for the second end of edge.
2951 # @return New GEOM.GEOM_Object, containing the created edge.
2953 # @ref tui_creation_edge "Example"
2954 def MakeEdge(self,thePnt1, thePnt2):
2956 Create a linear edge with specified ends.
2959 thePnt1 Point for the first end of edge.
2960 thePnt2 Point for the second end of edge.
2963 New GEOM.GEOM_Object, containing the created edge.
2965 # Example: see GEOM_TestAll.py
2966 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2967 RaiseIfFailed("MakeEdge", self.ShapesOp)
2970 ## Create a new edge, corresponding to the given length on the given curve.
2971 # @param theRefCurve The referenced curve (edge).
2972 # @param theLength Length on the referenced curve. It can be negative.
2973 # @param theStartPoint Any point can be selected for it, the new edge will begin
2974 # at the end of \a theRefCurve, close to the selected point.
2975 # If None, start from the first point of \a theRefCurve.
2976 # @return New GEOM.GEOM_Object, containing the created edge.
2978 # @ref tui_creation_edge "Example"
2979 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2981 Create a new edge, corresponding to the given length on the given curve.
2984 theRefCurve The referenced curve (edge).
2985 theLength Length on the referenced curve. It can be negative.
2986 theStartPoint Any point can be selected for it, the new edge will begin
2987 at the end of theRefCurve, close to the selected point.
2988 If None, start from the first point of theRefCurve.
2991 New GEOM.GEOM_Object, containing the created edge.
2993 # Example: see GEOM_TestAll.py
2994 theLength, Parameters = ParseParameters(theLength)
2995 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2996 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2997 anObj.SetParameters(Parameters)
3000 ## Create an edge from specified wire.
3001 # @param theWire source Wire
3002 # @param theLinearTolerance linear tolerance value (default = 1e-07)
3003 # @param theAngularTolerance angular tolerance value (default = 1e-12)
3004 # @return New GEOM.GEOM_Object, containing the created edge.
3006 # @ref tui_creation_edge "Example"
3007 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
3009 Create an edge from specified wire.
3013 theLinearTolerance linear tolerance value (default = 1e-07)
3014 theAngularTolerance angular tolerance value (default = 1e-12)
3017 New GEOM.GEOM_Object, containing the created edge.
3019 # Example: see GEOM_TestAll.py
3020 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3021 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3024 ## Create a wire from the set of edges and wires.
3025 # @param theEdgesAndWires List of edges and/or wires.
3026 # @param theTolerance Maximum distance between vertices, that will be merged.
3027 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3028 # @return New GEOM.GEOM_Object, containing the created wire.
3030 # @ref tui_creation_wire "Example"
3031 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
3033 Create a wire from the set of edges and wires.
3036 theEdgesAndWires List of edges and/or wires.
3037 theTolerance Maximum distance between vertices, that will be merged.
3038 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3041 New GEOM.GEOM_Object, containing the created wire.
3043 # Example: see GEOM_TestAll.py
3044 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3045 RaiseIfFailed("MakeWire", self.ShapesOp)
3048 ## Create a face on the given wire.
3049 # @param theWire closed Wire or Edge to build the face on.
3050 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3051 # If the tolerance of the obtained planar face is less
3052 # than 1e-06, this face will be returned, otherwise the
3053 # algorithm tries to build any suitable face on the given
3054 # wire and prints a warning message.
3055 # @return New GEOM.GEOM_Object, containing the created face.
3057 # @ref tui_creation_face "Example"
3058 def MakeFace(self, theWire, isPlanarWanted):
3060 Create a face on the given wire.
3063 theWire closed Wire or Edge to build the face on.
3064 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3065 If the tolerance of the obtained planar face is less
3066 than 1e-06, this face will be returned, otherwise the
3067 algorithm tries to build any suitable face on the given
3068 wire and prints a warning message.
3071 New GEOM.GEOM_Object, containing the created face.
3073 # Example: see GEOM_TestAll.py
3074 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
3075 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3076 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3078 RaiseIfFailed("MakeFace", self.ShapesOp)
3081 ## Create a face on the given wires set.
3082 # @param theWires List of closed wires or edges to build the face on.
3083 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3084 # If the tolerance of the obtained planar face is less
3085 # than 1e-06, this face will be returned, otherwise the
3086 # algorithm tries to build any suitable face on the given
3087 # wire and prints a warning message.
3088 # @return New GEOM.GEOM_Object, containing the created face.
3090 # @ref tui_creation_face "Example"
3091 def MakeFaceWires(self, theWires, isPlanarWanted):
3093 Create a face on the given wires set.
3096 theWires List of closed wires or edges to build the face on.
3097 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3098 If the tolerance of the obtained planar face is less
3099 than 1e-06, this face will be returned, otherwise the
3100 algorithm tries to build any suitable face on the given
3101 wire and prints a warning message.
3104 New GEOM.GEOM_Object, containing the created face.
3106 # Example: see GEOM_TestAll.py
3107 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
3108 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3109 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3111 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
3114 ## See MakeFaceWires() method for details.
3116 # @ref tui_creation_face "Example 1"
3117 # \n @ref swig_MakeFaces "Example 2"
3118 def MakeFaces(self, theWires, isPlanarWanted):
3120 See geompy.MakeFaceWires() method for details.
3122 # Example: see GEOM_TestOthers.py
3123 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3126 ## Create a shell from the set of faces and shells.
3127 # @param theFacesAndShells List of faces and/or shells.
3128 # @return New GEOM.GEOM_Object, containing the created shell.
3130 # @ref tui_creation_shell "Example"
3131 def MakeShell(self,theFacesAndShells):
3133 Create a shell from the set of faces and shells.
3136 theFacesAndShells List of faces and/or shells.
3139 New GEOM.GEOM_Object, containing the created shell.
3141 # Example: see GEOM_TestAll.py
3142 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3143 RaiseIfFailed("MakeShell", self.ShapesOp)
3146 ## Create a solid, bounded by the given shells.
3147 # @param theShells Sequence of bounding shells.
3148 # @return New GEOM.GEOM_Object, containing the created solid.
3150 # @ref tui_creation_solid "Example"
3151 def MakeSolid(self, theShells):
3153 Create a solid, bounded by the given shells.
3156 theShells Sequence of bounding shells.
3159 New GEOM.GEOM_Object, containing the created solid.
3161 # Example: see GEOM_TestAll.py
3162 if len(theShells) == 1:
3163 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3165 # raise RuntimeError, "MakeSolidShells : " + descr
3166 if descr == "WRN_SHAPE_UNCLOSED":
3167 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3168 anObj = self.ShapesOp.MakeSolidShells(theShells)
3169 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3172 ## Create a compound of the given shapes.
3173 # @param theShapes List of shapes to put in compound.
3174 # @return New GEOM.GEOM_Object, containing the created compound.
3176 # @ref tui_creation_compound "Example"
3177 def MakeCompound(self,theShapes):
3179 Create a compound of the given shapes.
3182 theShapes List of shapes to put in compound.
3185 New GEOM.GEOM_Object, containing the created compound.
3187 # Example: see GEOM_TestAll.py
3188 anObj = self.ShapesOp.MakeCompound(theShapes)
3189 RaiseIfFailed("MakeCompound", self.ShapesOp)
3192 # end of l3_advanced
3195 ## @addtogroup l2_measure
3198 ## Gives quantity of faces in the given shape.
3199 # @param theShape Shape to count faces of.
3200 # @return Quantity of faces.
3202 # @ref swig_NumberOf "Example"
3203 def NumberOfFaces(self, theShape):
3205 Gives quantity of faces in the given shape.
3208 theShape Shape to count faces of.
3213 # Example: see GEOM_TestOthers.py
3214 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3215 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3218 ## Gives quantity of edges in the given shape.
3219 # @param theShape Shape to count edges of.
3220 # @return Quantity of edges.
3222 # @ref swig_NumberOf "Example"
3223 def NumberOfEdges(self, theShape):
3225 Gives quantity of edges in the given shape.
3228 theShape Shape to count edges of.
3233 # Example: see GEOM_TestOthers.py
3234 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3235 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3238 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3239 # @param theShape Shape to count sub-shapes of.
3240 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3241 # @return Quantity of sub-shapes of given type.
3243 # @ref swig_NumberOf "Example"
3244 def NumberOfSubShapes(self, theShape, theShapeType):
3246 Gives quantity of sub-shapes of type theShapeType in the given shape.
3249 theShape Shape to count sub-shapes of.
3250 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3253 Quantity of sub-shapes of given type.
3255 # Example: see GEOM_TestOthers.py
3256 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3257 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3260 ## Gives quantity of solids in the given shape.
3261 # @param theShape Shape to count solids in.
3262 # @return Quantity of solids.
3264 # @ref swig_NumberOf "Example"
3265 def NumberOfSolids(self, theShape):
3267 Gives quantity of solids in the given shape.
3270 theShape Shape to count solids in.
3275 # Example: see GEOM_TestOthers.py
3276 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3277 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3283 ## @addtogroup l3_healing
3286 ## Reverses an orientation the given shape.
3287 # @param theShape Shape to be reversed.
3288 # @return The reversed copy of theShape.
3290 # @ref swig_ChangeOrientation "Example"
3291 def ChangeOrientation(self,theShape):
3293 Reverses an orientation the given shape.
3296 theShape Shape to be reversed.
3299 The reversed copy of theShape.
3301 # Example: see GEOM_TestAll.py
3302 anObj = self.ShapesOp.ChangeOrientation(theShape)
3303 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3306 ## See ChangeOrientation() method for details.
3308 # @ref swig_OrientationChange "Example"
3309 def OrientationChange(self,theShape):
3311 See geompy.ChangeOrientation method for details.
3313 # Example: see GEOM_TestOthers.py
3314 anObj = self.ChangeOrientation(theShape)
3320 ## @addtogroup l4_obtain
3323 ## Retrieve all free faces from the given shape.
3324 # Free face is a face, which is not shared between two shells of the shape.
3325 # @param theShape Shape to find free faces in.
3326 # @return List of IDs of all free faces, contained in theShape.
3328 # @ref tui_measurement_tools_page "Example"
3329 def GetFreeFacesIDs(self,theShape):
3331 Retrieve all free faces from the given shape.
3332 Free face is a face, which is not shared between two shells of the shape.
3335 theShape Shape to find free faces in.
3338 List of IDs of all free faces, contained in theShape.
3340 # Example: see GEOM_TestOthers.py
3341 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3342 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3345 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3346 # @param theShape1 Shape to find sub-shapes in.
3347 # @param theShape2 Shape to find shared sub-shapes with.
3348 # @param theShapeType Type of sub-shapes to be retrieved.
3349 # @return List of sub-shapes of theShape1, shared with theShape2.
3351 # @ref swig_GetSharedShapes "Example"
3352 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3354 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3357 theShape1 Shape to find sub-shapes in.
3358 theShape2 Shape to find shared sub-shapes with.
3359 theShapeType Type of sub-shapes to be retrieved.
3362 List of sub-shapes of theShape1, shared with theShape2.
3364 # Example: see GEOM_TestOthers.py
3365 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3366 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3369 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3370 # @param theShapes Shapes to find common sub-shapes of.
3371 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3372 # @return List of objects, that are sub-shapes of all given shapes.
3374 # @ref swig_GetSharedShapes "Example"
3375 def GetSharedShapesMulti(self, theShapes, theShapeType):
3377 Get all sub-shapes, shared by all shapes in the list theShapes.
3380 theShapes Shapes to find common sub-shapes of.
3381 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3384 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3386 # Example: see GEOM_TestOthers.py
3387 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3388 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3391 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3392 # situated relatively the specified plane by the certain way,
3393 # defined through <VAR>theState</VAR> parameter.
3394 # @param theShape Shape to find sub-shapes of.
3395 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3396 # @param theAx1 Vector (or line, or linear edge), specifying normal
3397 # direction and location of the plane to find shapes on.
3398 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3399 # @return List of all found sub-shapes.
3401 # @ref swig_GetShapesOnPlane "Example"
3402 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3404 Find in theShape all sub-shapes of type theShapeType,
3405 situated relatively the specified plane by the certain way,
3406 defined through theState parameter.
3409 theShape Shape to find sub-shapes of.
3410 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3411 theAx1 Vector (or line, or linear edge), specifying normal
3412 direction and location of the plane to find shapes on.
3413 theState The state of the sub-shapes to find (see GEOM::shape_state)
3416 List of all found sub-shapes.
3418 # Example: see GEOM_TestOthers.py
3419 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3420 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3423 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3424 # situated relatively the specified plane by the certain way,
3425 # defined through <VAR>theState</VAR> parameter.
3426 # @param theShape Shape to find sub-shapes of.
3427 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3428 # @param theAx1 Vector (or line, or linear edge), specifying normal
3429 # direction and location of the plane to find shapes on.
3430 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3431 # @return List of all found sub-shapes indices.
3433 # @ref swig_GetShapesOnPlaneIDs "Example"
3434 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3436 Find in theShape all sub-shapes of type theShapeType,
3437 situated relatively the specified plane by the certain way,
3438 defined through theState parameter.
3441 theShape Shape to find sub-shapes of.
3442 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3443 theAx1 Vector (or line, or linear edge), specifying normal
3444 direction and location of the plane to find shapes on.
3445 theState The state of the sub-shapes to find (see GEOM::shape_state)
3448 List of all found sub-shapes indices.
3450 # Example: see GEOM_TestOthers.py
3451 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3452 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3455 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3456 # situated relatively the specified plane by the certain way,
3457 # defined through <VAR>theState</VAR> parameter.
3458 # @param theShape Shape to find sub-shapes of.
3459 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3460 # @param theAx1 Vector (or line, or linear edge), specifying normal
3461 # direction of the plane to find shapes on.
3462 # @param thePnt Point specifying location of the plane to find shapes on.
3463 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3464 # @return List of all found sub-shapes.
3466 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3467 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3469 Find in theShape all sub-shapes of type theShapeType,
3470 situated relatively the specified plane by the certain way,
3471 defined through theState parameter.
3474 theShape Shape to find sub-shapes of.
3475 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3476 theAx1 Vector (or line, or linear edge), specifying normal
3477 direction and location of the plane to find shapes on.
3478 thePnt Point specifying location of the plane to find shapes on.
3479 theState The state of the sub-shapes to find (see GEOM::shape_state)
3482 List of all found sub-shapes.
3484 # Example: see GEOM_TestOthers.py
3485 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3486 theAx1, thePnt, theState)
3487 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3490 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3491 # situated relatively the specified plane by the certain way,
3492 # defined through <VAR>theState</VAR> parameter.
3493 # @param theShape Shape to find sub-shapes of.
3494 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3495 # @param theAx1 Vector (or line, or linear edge), specifying normal
3496 # direction of the plane to find shapes on.
3497 # @param thePnt Point specifying location of the plane to find shapes on.
3498 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3499 # @return List of all found sub-shapes indices.
3501 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3502 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3504 Find in theShape all sub-shapes of type theShapeType,
3505 situated relatively the specified plane by the certain way,
3506 defined through theState parameter.
3509 theShape Shape to find sub-shapes of.
3510 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3511 theAx1 Vector (or line, or linear edge), specifying normal
3512 direction and location of the plane to find shapes on.
3513 thePnt Point specifying location of the plane to find shapes on.
3514 theState The state of the sub-shapes to find (see GEOM::shape_state)
3517 List of all found sub-shapes indices.
3519 # Example: see GEOM_TestOthers.py
3520 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3521 theAx1, thePnt, theState)
3522 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3525 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3526 # the specified cylinder by the certain way, defined through \a theState parameter.
3527 # @param theShape Shape to find sub-shapes of.
3528 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3529 # @param theAxis Vector (or line, or linear edge), specifying
3530 # axis of the cylinder to find shapes on.
3531 # @param theRadius Radius of the cylinder to find shapes on.
3532 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3533 # @return List of all found sub-shapes.
3535 # @ref swig_GetShapesOnCylinder "Example"
3536 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3538 Find in theShape all sub-shapes of type theShapeType, situated relatively
3539 the specified cylinder by the certain way, defined through theState parameter.
3542 theShape Shape to find sub-shapes of.
3543 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3544 theAxis Vector (or line, or linear edge), specifying
3545 axis of the cylinder to find shapes on.
3546 theRadius Radius of the cylinder to find shapes on.
3547 theState The state of the sub-shapes to find (see GEOM::shape_state)
3550 List of all found sub-shapes.
3552 # Example: see GEOM_TestOthers.py
3553 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3554 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3557 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3558 # the specified cylinder by the certain way, defined through \a theState parameter.
3559 # @param theShape Shape to find sub-shapes of.
3560 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3561 # @param theAxis Vector (or line, or linear edge), specifying
3562 # axis of the cylinder to find shapes on.
3563 # @param theRadius Radius of the cylinder to find shapes on.
3564 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3565 # @return List of all found sub-shapes indices.
3567 # @ref swig_GetShapesOnCylinderIDs "Example"
3568 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3570 Find in theShape all sub-shapes of type theShapeType, situated relatively
3571 the specified cylinder by the certain way, defined through theState parameter.
3574 theShape Shape to find sub-shapes of.
3575 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3576 theAxis Vector (or line, or linear edge), specifying
3577 axis of the cylinder to find shapes on.
3578 theRadius Radius of the cylinder to find shapes on.
3579 theState The state of the sub-shapes to find (see GEOM::shape_state)
3582 List of all found sub-shapes indices.
3584 # Example: see GEOM_TestOthers.py
3585 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3586 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3589 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3590 # the specified cylinder by the certain way, defined through \a theState parameter.
3591 # @param theShape Shape to find sub-shapes of.
3592 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3593 # @param theAxis Vector (or line, or linear edge), specifying
3594 # axis of the cylinder to find shapes on.
3595 # @param thePnt Point specifying location of the bottom of the cylinder.
3596 # @param theRadius Radius of the cylinder to find shapes on.
3597 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3598 # @return List of all found sub-shapes.
3600 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3601 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3603 Find in theShape all sub-shapes of type theShapeType, situated relatively
3604 the specified cylinder by the certain way, defined through theState parameter.
3607 theShape Shape to find sub-shapes of.
3608 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3609 theAxis Vector (or line, or linear edge), specifying
3610 axis of the cylinder to find shapes on.
3611 theRadius Radius of the cylinder to find shapes on.
3612 theState The state of the sub-shapes to find (see GEOM::shape_state)
3615 List of all found sub-shapes.
3617 # Example: see GEOM_TestOthers.py
3618 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3619 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3622 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3623 # the specified cylinder by the certain way, defined through \a theState parameter.
3624 # @param theShape Shape to find sub-shapes of.
3625 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3626 # @param theAxis Vector (or line, or linear edge), specifying
3627 # axis of the cylinder to find shapes on.
3628 # @param thePnt Point specifying location of the bottom of the cylinder.
3629 # @param theRadius Radius of the cylinder to find shapes on.
3630 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3631 # @return List of all found sub-shapes indices
3633 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3634 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3636 Find in theShape all sub-shapes of type theShapeType, situated relatively
3637 the specified cylinder by the certain way, defined through theState parameter.
3640 theShape Shape to find sub-shapes of.
3641 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3642 theAxis Vector (or line, or linear edge), specifying
3643 axis of the cylinder to find shapes on.
3644 theRadius Radius of the cylinder to find shapes on.
3645 theState The state of the sub-shapes to find (see GEOM::shape_state)
3648 List of all found sub-shapes indices.
3650 # Example: see GEOM_TestOthers.py
3651 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3652 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3655 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3656 # the specified sphere by the certain way, defined through \a theState parameter.
3657 # @param theShape Shape to find sub-shapes of.
3658 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3659 # @param theCenter Point, specifying center of the sphere to find shapes on.
3660 # @param theRadius Radius of the sphere to find shapes on.
3661 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3662 # @return List of all found sub-shapes.
3664 # @ref swig_GetShapesOnSphere "Example"
3665 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3667 Find in theShape all sub-shapes of type theShapeType, situated relatively
3668 the specified sphere by the certain way, defined through theState parameter.
3671 theShape Shape to find sub-shapes of.
3672 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3673 theCenter Point, specifying center of the sphere to find shapes on.
3674 theRadius Radius of the sphere to find shapes on.
3675 theState The state of the sub-shapes to find (see GEOM::shape_state)
3678 List of all found sub-shapes.
3680 # Example: see GEOM_TestOthers.py
3681 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3682 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3685 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3686 # the specified sphere by the certain way, defined through \a theState parameter.
3687 # @param theShape Shape to find sub-shapes of.
3688 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3689 # @param theCenter Point, specifying center of the sphere to find shapes on.
3690 # @param theRadius Radius of the sphere to find shapes on.
3691 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3692 # @return List of all found sub-shapes indices.
3694 # @ref swig_GetShapesOnSphereIDs "Example"
3695 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3697 Find in theShape all sub-shapes of type theShapeType, situated relatively
3698 the specified sphere by the certain way, defined through theState parameter.
3701 theShape Shape to find sub-shapes of.
3702 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3703 theCenter Point, specifying center of the sphere to find shapes on.
3704 theRadius Radius of the sphere to find shapes on.
3705 theState The state of the sub-shapes to find (see GEOM::shape_state)
3708 List of all found sub-shapes indices.
3710 # Example: see GEOM_TestOthers.py
3711 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3712 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3715 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3716 # the specified quadrangle by the certain way, defined through \a theState parameter.
3717 # @param theShape Shape to find sub-shapes of.
3718 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3719 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3720 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3721 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3722 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3723 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3724 # @return List of all found sub-shapes.
3726 # @ref swig_GetShapesOnQuadrangle "Example"
3727 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3728 theTopLeftPoint, theTopRigthPoint,
3729 theBottomLeftPoint, theBottomRigthPoint, theState):
3731 Find in theShape all sub-shapes of type theShapeType, situated relatively
3732 the specified quadrangle by the certain way, defined through theState parameter.
3735 theShape Shape to find sub-shapes of.
3736 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3737 theTopLeftPoint Point, specifying top left corner of a quadrangle
3738 theTopRigthPoint Point, specifying top right corner of a quadrangle
3739 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3740 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3741 theState The state of the sub-shapes to find (see GEOM::shape_state)
3744 List of all found sub-shapes.
3746 # Example: see GEOM_TestOthers.py
3747 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3748 theTopLeftPoint, theTopRigthPoint,
3749 theBottomLeftPoint, theBottomRigthPoint, theState)
3750 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3753 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3754 # the specified quadrangle by the certain way, defined through \a theState parameter.
3755 # @param theShape Shape to find sub-shapes of.
3756 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3757 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3758 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3759 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3760 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3761 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3762 # @return List of all found sub-shapes indices.
3764 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3765 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3766 theTopLeftPoint, theTopRigthPoint,
3767 theBottomLeftPoint, theBottomRigthPoint, theState):
3769 Find in theShape all sub-shapes of type theShapeType, situated relatively
3770 the specified quadrangle by the certain way, defined through theState parameter.
3773 theShape Shape to find sub-shapes of.
3774 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3775 theTopLeftPoint Point, specifying top left corner of a quadrangle
3776 theTopRigthPoint Point, specifying top right corner of a quadrangle
3777 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3778 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3779 theState The state of the sub-shapes to find (see GEOM::shape_state)
3782 List of all found sub-shapes indices.
3785 # Example: see GEOM_TestOthers.py
3786 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3787 theTopLeftPoint, theTopRigthPoint,
3788 theBottomLeftPoint, theBottomRigthPoint, theState)
3789 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3792 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3793 # the specified \a theBox by the certain way, defined through \a theState parameter.
3794 # @param theBox Shape for relative comparing.
3795 # @param theShape Shape to find sub-shapes of.
3796 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3797 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3798 # @return List of all found sub-shapes.
3800 # @ref swig_GetShapesOnBox "Example"
3801 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3803 Find in theShape all sub-shapes of type theShapeType, situated relatively
3804 the specified theBox by the certain way, defined through theState parameter.
3807 theBox Shape for relative comparing.
3808 theShape Shape to find sub-shapes of.
3809 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3810 theState The state of the sub-shapes to find (see GEOM::shape_state)
3813 List of all found sub-shapes.
3815 # Example: see GEOM_TestOthers.py
3816 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3817 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3820 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3821 # the specified \a theBox by the certain way, defined through \a theState parameter.
3822 # @param theBox Shape for relative comparing.
3823 # @param theShape Shape to find sub-shapes of.
3824 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3825 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3826 # @return List of all found sub-shapes indices.
3828 # @ref swig_GetShapesOnBoxIDs "Example"
3829 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3831 Find in theShape all sub-shapes of type theShapeType, situated relatively
3832 the specified theBox by the certain way, defined through theState parameter.
3835 theBox Shape for relative comparing.
3836 theShape Shape to find sub-shapes of.
3837 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3838 theState The state of the sub-shapes to find (see GEOM::shape_state)
3841 List of all found sub-shapes indices.
3843 # Example: see GEOM_TestOthers.py
3844 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3845 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3848 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3849 # situated relatively the specified \a theCheckShape by the
3850 # certain way, defined through \a theState parameter.
3851 # @param theCheckShape Shape for relative comparing. It must be a solid.
3852 # @param theShape Shape to find sub-shapes of.
3853 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3854 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3855 # @return List of all found sub-shapes.
3857 # @ref swig_GetShapesOnShape "Example"
3858 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3860 Find in theShape all sub-shapes of type theShapeType,
3861 situated relatively the specified theCheckShape by the
3862 certain way, defined through theState parameter.
3865 theCheckShape Shape for relative comparing. It must be a solid.
3866 theShape Shape to find sub-shapes of.
3867 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3868 theState The state of the sub-shapes to find (see GEOM::shape_state)
3871 List of all found sub-shapes.
3873 # Example: see GEOM_TestOthers.py
3874 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3875 theShapeType, theState)
3876 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3879 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3880 # situated relatively the specified \a theCheckShape by the
3881 # certain way, defined through \a theState parameter.
3882 # @param theCheckShape Shape for relative comparing. It must be a solid.
3883 # @param theShape Shape to find sub-shapes of.
3884 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3885 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3886 # @return All found sub-shapes as compound.
3888 # @ref swig_GetShapesOnShapeAsCompound "Example"
3889 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3891 Find in theShape all sub-shapes of type theShapeType,
3892 situated relatively the specified theCheckShape by the
3893 certain way, defined through theState parameter.
3896 theCheckShape Shape for relative comparing. It must be a solid.
3897 theShape Shape to find sub-shapes of.
3898 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3899 theState The state of the sub-shapes to find (see GEOM::shape_state)
3902 All found sub-shapes as compound.
3904 # Example: see GEOM_TestOthers.py
3905 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3906 theShapeType, theState)
3907 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3910 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3911 # situated relatively the specified \a theCheckShape by the
3912 # certain way, defined through \a theState parameter.
3913 # @param theCheckShape Shape for relative comparing. It must be a solid.
3914 # @param theShape Shape to find sub-shapes of.
3915 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3916 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3917 # @return List of all found sub-shapes indices.
3919 # @ref swig_GetShapesOnShapeIDs "Example"
3920 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3922 Find in theShape all sub-shapes of type theShapeType,
3923 situated relatively the specified theCheckShape by the
3924 certain way, defined through theState parameter.
3927 theCheckShape Shape for relative comparing. It must be a solid.
3928 theShape Shape to find sub-shapes of.
3929 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3930 theState The state of the sub-shapes to find (see GEOM::shape_state)
3933 List of all found sub-shapes indices.
3935 # Example: see GEOM_TestOthers.py
3936 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3937 theShapeType, theState)
3938 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3941 ## Get sub-shape(s) of theShapeWhere, which are
3942 # coincident with \a theShapeWhat or could be a part of it.
3943 # @param theShapeWhere Shape to find sub-shapes of.
3944 # @param theShapeWhat Shape, specifying what to find.
3945 # @param isNewImplementation implementation of GetInPlace functionality
3946 # (default = False, old alghorithm based on shape properties)
3947 # @return Group of all found sub-shapes or a single found sub-shape.
3949 # @note This function has a restriction on argument shapes.
3950 # If \a theShapeWhere has curved parts with significantly
3951 # outstanding centres (i.e. the mass centre of a part is closer to
3952 # \a theShapeWhat than to the part), such parts will not be found.
3953 # @image html get_in_place_lost_part.png
3955 # @ref swig_GetInPlace "Example"
3956 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3958 Get sub-shape(s) of theShapeWhere, which are
3959 coincident with theShapeWhat or could be a part of it.
3962 theShapeWhere Shape to find sub-shapes of.
3963 theShapeWhat Shape, specifying what to find.
3964 isNewImplementation Implementation of GetInPlace functionality
3965 (default = False, old alghorithm based on shape properties)
3968 Group of all found sub-shapes or a single found sub-shape.
3972 This function has a restriction on argument shapes.
3973 If theShapeWhere has curved parts with significantly
3974 outstanding centres (i.e. the mass centre of a part is closer to
3975 theShapeWhat than to the part), such parts will not be found.
3977 # Example: see GEOM_TestOthers.py
3979 if isNewImplementation:
3980 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3982 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3984 RaiseIfFailed("GetInPlace", self.ShapesOp)
3987 ## Get sub-shape(s) of \a theShapeWhere, which are
3988 # coincident with \a theShapeWhat or could be a part of it.
3990 # Implementation of this method is based on a saved history of an operation,
3991 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3992 # arguments (an argument shape or a sub-shape of an argument shape).
3993 # The operation could be the Partition or one of boolean operations,
3994 # performed on simple shapes (not on compounds).
3996 # @param theShapeWhere Shape to find sub-shapes of.
3997 # @param theShapeWhat Shape, specifying what to find (must be in the
3998 # building history of the ShapeWhere).
3999 # @return Group of all found sub-shapes or a single found sub-shape.
4001 # @ref swig_GetInPlace "Example"
4002 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
4004 Implementation of this method is based on a saved history of an operation,
4005 produced theShapeWhere. The theShapeWhat must be among this operation's
4006 arguments (an argument shape or a sub-shape of an argument shape).
4007 The operation could be the Partition or one of boolean operations,
4008 performed on simple shapes (not on compounds).
4011 theShapeWhere Shape to find sub-shapes of.
4012 theShapeWhat Shape, specifying what to find (must be in the
4013 building history of the ShapeWhere).
4016 Group of all found sub-shapes or a single found sub-shape.
4018 # Example: see GEOM_TestOthers.py
4019 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
4020 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
4023 ## Get sub-shape of theShapeWhere, which is
4024 # equal to \a theShapeWhat.
4025 # @param theShapeWhere Shape to find sub-shape of.
4026 # @param theShapeWhat Shape, specifying what to find.
4027 # @return New GEOM.GEOM_Object for found sub-shape.
4029 # @ref swig_GetSame "Example"
4030 def GetSame(self,theShapeWhere, theShapeWhat):
4032 Get sub-shape of theShapeWhere, which is
4033 equal to theShapeWhat.
4036 theShapeWhere Shape to find sub-shape of.
4037 theShapeWhat Shape, specifying what to find.
4040 New GEOM.GEOM_Object for found sub-shape.
4042 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
4043 RaiseIfFailed("GetSame", self.ShapesOp)
4047 ## Get sub-shape indices of theShapeWhere, which is
4048 # equal to \a theShapeWhat.
4049 # @param theShapeWhere Shape to find sub-shape of.
4050 # @param theShapeWhat Shape, specifying what to find.
4051 # @return List of all found sub-shapes indices.
4053 # @ref swig_GetSame "Example"
4054 def GetSameIDs(self,theShapeWhere, theShapeWhat):
4056 Get sub-shape indices of theShapeWhere, which is
4057 equal to theShapeWhat.
4060 theShapeWhere Shape to find sub-shape of.
4061 theShapeWhat Shape, specifying what to find.
4064 List of all found sub-shapes indices.
4066 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
4067 RaiseIfFailed("GetSameIDs", self.ShapesOp)
4074 ## @addtogroup l4_access
4077 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
4078 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4079 # @param aShape Shape to get sub-shape of.
4080 # @param ListOfID List of sub-shapes indices.
4081 # @return Found sub-shape.
4083 # @ref swig_all_decompose "Example"
4084 def GetSubShape(self, aShape, ListOfID):
4086 Obtain a composite sub-shape of aShape, composed from sub-shapes
4087 of aShape, selected by their unique IDs inside aShape
4090 aShape Shape to get sub-shape of.
4091 ListOfID List of sub-shapes indices.
4096 # Example: see GEOM_TestAll.py
4097 anObj = self.AddSubShape(aShape,ListOfID)
4100 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
4101 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4102 # @param aShape Shape to get sub-shape of.
4103 # @param aSubShape Sub-shapes of aShape.
4104 # @return ID of found sub-shape.
4106 # @ref swig_all_decompose "Example"
4107 def GetSubShapeID(self, aShape, aSubShape):
4109 Obtain unique ID of sub-shape aSubShape inside aShape
4110 of aShape, selected by their unique IDs inside aShape
4113 aShape Shape to get sub-shape of.
4114 aSubShape Sub-shapes of aShape.
4117 ID of found sub-shape.
4119 # Example: see GEOM_TestAll.py
4120 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
4121 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4127 ## @addtogroup l4_decompose
4130 ## Get all sub-shapes and groups of \a theShape,
4131 # that were created already by any other methods.
4132 # @param theShape Any shape.
4133 # @param theGroupsOnly If this parameter is TRUE, only groups will be
4134 # returned, else all found sub-shapes and groups.
4135 # @return List of existing sub-objects of \a theShape.
4137 # @ref swig_all_decompose "Example"
4138 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4140 Get all sub-shapes and groups of theShape,
4141 that were created already by any other methods.
4145 theGroupsOnly If this parameter is TRUE, only groups will be
4146 returned, else all found sub-shapes and groups.
4149 List of existing sub-objects of theShape.
4151 # Example: see GEOM_TestAll.py
4152 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4153 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4156 ## Get all groups of \a theShape,
4157 # that were created already by any other methods.
4158 # @param theShape Any shape.
4159 # @return List of existing groups of \a theShape.
4161 # @ref swig_all_decompose "Example"
4162 def GetGroups(self, theShape):
4164 Get all groups of theShape,
4165 that were created already by any other methods.
4171 List of existing groups of theShape.
4173 # Example: see GEOM_TestAll.py
4174 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4175 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4178 ## Explode a shape on sub-shapes of a given type.
4179 # If the shape itself matches the type, it is also returned.
4180 # @param aShape Shape to be exploded.
4181 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4182 # @return List of sub-shapes of type theShapeType, contained in theShape.
4184 # @ref swig_all_decompose "Example"
4185 def SubShapeAll(self, aShape, aType):
4187 Explode a shape on sub-shapes of a given type.
4188 If the shape itself matches the type, it is also returned.
4191 aShape Shape to be exploded.
4192 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4195 List of sub-shapes of type theShapeType, contained in theShape.
4197 # Example: see GEOM_TestAll.py
4198 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
4199 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4202 ## Explode a shape on sub-shapes of a given type.
4203 # @param aShape Shape to be exploded.
4204 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4205 # @return List of IDs of sub-shapes.
4207 # @ref swig_all_decompose "Example"
4208 def SubShapeAllIDs(self, aShape, aType):
4210 Explode a shape on sub-shapes of a given type.
4213 aShape Shape to be exploded (see geompy.ShapeType)
4214 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4217 List of IDs of sub-shapes.
4219 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
4220 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4223 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4224 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4225 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4226 # @param aShape Shape to get sub-shape of.
4227 # @param ListOfInd List of sub-shapes indices.
4228 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4229 # @return A compound of sub-shapes of aShape.
4231 # @ref swig_all_decompose "Example"
4232 def SubShape(self, aShape, aType, ListOfInd):
4234 Obtain a compound of sub-shapes of aShape,
4235 selected by they indices in list of all sub-shapes of type aType.
4236 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4239 aShape Shape to get sub-shape of.
4240 ListOfID List of sub-shapes indices.
4241 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4244 A compound of sub-shapes of aShape.
4246 # Example: see GEOM_TestAll.py
4248 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
4249 for ind in ListOfInd:
4250 ListOfIDs.append(AllShapeIDsList[ind - 1])
4251 anObj = self.GetSubShape(aShape, ListOfIDs)
4254 ## Explode a shape on sub-shapes of a given type.
4255 # Sub-shapes will be sorted by coordinates of their gravity centers.
4256 # If the shape itself matches the type, it is also returned.
4257 # @param aShape Shape to be exploded.
4258 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4259 # @return List of sub-shapes of type theShapeType, contained in theShape.
4261 # @ref swig_SubShapeAllSorted "Example"
4262 def SubShapeAllSortedCentres(self, aShape, aType):
4264 Explode a shape on sub-shapes of a given type.
4265 Sub-shapes will be sorted by coordinates of their gravity centers.
4266 If the shape itself matches the type, it is also returned.
4269 aShape Shape to be exploded.
4270 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4273 List of sub-shapes of type theShapeType, contained in theShape.
4275 # Example: see GEOM_TestAll.py
4276 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
4277 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4280 ## Explode a shape on sub-shapes of a given type.
4281 # Sub-shapes will be sorted by coordinates of their gravity centers.
4282 # @param aShape Shape to be exploded.
4283 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4284 # @return List of IDs of sub-shapes.
4286 # @ref swig_all_decompose "Example"
4287 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4289 Explode a shape on sub-shapes of a given type.
4290 Sub-shapes will be sorted by coordinates of their gravity centers.
4293 aShape Shape to be exploded.
4294 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4297 List of IDs of sub-shapes.
4299 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
4300 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4303 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4304 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4305 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4306 # @param aShape Shape to get sub-shape of.
4307 # @param ListOfInd List of sub-shapes indices.
4308 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4309 # @return A compound of sub-shapes of aShape.
4311 # @ref swig_all_decompose "Example"
4312 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4314 Obtain a compound of sub-shapes of aShape,
4315 selected by they indices in sorted list of all sub-shapes of type aType.
4316 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4319 aShape Shape to get sub-shape of.
4320 ListOfID List of sub-shapes indices.
4321 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4324 A compound of sub-shapes of aShape.
4326 # Example: see GEOM_TestAll.py
4328 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
4329 for ind in ListOfInd:
4330 ListOfIDs.append(AllShapeIDsList[ind - 1])
4331 anObj = self.GetSubShape(aShape, ListOfIDs)
4334 ## Extract shapes (excluding the main shape) of given type.
4335 # @param aShape The shape.
4336 # @param aType The shape type (see ShapeType())
4337 # @param isSorted Boolean flag to switch sorting on/off.
4338 # @return List of sub-shapes of type aType, contained in aShape.
4340 # @ref swig_FilletChamfer "Example"
4341 def ExtractShapes(self, aShape, aType, isSorted = False):
4343 Extract shapes (excluding the main shape) of given type.
4347 aType The shape type (see geompy.ShapeType)
4348 isSorted Boolean flag to switch sorting on/off.
4351 List of sub-shapes of type aType, contained in aShape.
4353 # Example: see GEOM_TestAll.py
4354 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
4355 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4358 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4359 # @param aShape Main shape.
4360 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4361 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4363 # @ref swig_all_decompose "Example"
4364 def SubShapes(self, aShape, anIDs):
4366 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4370 anIDs List of unique IDs of sub-shapes inside theMainShape.
4373 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4375 # Example: see GEOM_TestAll.py
4376 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4377 RaiseIfFailed("SubShapes", self.ShapesOp)
4380 # end of l4_decompose
4383 ## @addtogroup l4_decompose_d
4386 ## Deprecated method
4387 # It works like SubShapeAllSortedCentres(), but wrongly
4388 # defines centres of faces, shells and solids.
4389 def SubShapeAllSorted(self, aShape, aType):
4392 It works like geompy.SubShapeAllSortedCentres, but wrongly
4393 defines centres of faces, shells and solids.
4395 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
4396 RaiseIfFailed("MakeExplode", self.ShapesOp)
4399 ## Deprecated method
4400 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4401 # defines centres of faces, shells and solids.
4402 def SubShapeAllSortedIDs(self, aShape, aType):
4405 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4406 defines centres of faces, shells and solids.
4408 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
4409 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4412 ## Deprecated method
4413 # It works like SubShapeSortedCentres(), but has a bug
4414 # (wrongly defines centres of faces, shells and solids).
4415 def SubShapeSorted(self, aShape, aType, ListOfInd):
4418 It works like geompy.SubShapeSortedCentres, but has a bug
4419 (wrongly defines centres of faces, shells and solids).
4422 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
4423 for ind in ListOfInd:
4424 ListOfIDs.append(AllShapeIDsList[ind - 1])
4425 anObj = self.GetSubShape(aShape, ListOfIDs)
4428 # end of l4_decompose_d
4431 ## @addtogroup l3_healing
4434 ## Apply a sequence of Shape Healing operators to the given object.
4435 # @param theShape Shape to be processed.
4436 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4437 # @param theParameters List of names of parameters
4438 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4439 # @param theValues List of values of parameters, in the same order
4440 # as parameters are listed in <VAR>theParameters</VAR> list.
4443 # <b> Operators and Parameters: </b> \n
4445 # * \b FixShape - corrects invalid shapes. \n
4446 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4447 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4449 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4450 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4451 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4452 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4454 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4455 # surfaces in segments using a certain angle. \n
4456 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4457 # if Angle=180, four if Angle=90, etc). \n
4458 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4460 # * \b SplitClosedFaces - splits closed faces in segments.
4461 # The number of segments depends on the number of splitting points.\n
4462 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4464 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4465 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4466 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4467 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4468 # This and the previous parameters can take the following values:\n
4469 # \b Parametric \b Continuity \n
4470 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4471 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4472 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4473 # ruling out sharp edges).\n
4474 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4475 # are of the same magnitude).\n
4476 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4477 # or surfaces (d/du C(u)) are the same at junction. \n
4478 # \b Geometric \b Continuity \n
4479 # \b G1: first derivatives are proportional at junction.\n
4480 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4481 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4482 # \b G2: first and second derivatives are proportional at junction.
4483 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4484 # continuity requires that the underlying parameterization was continuous as well.
4485 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4487 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4488 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4489 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4490 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4491 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4492 # with the specified parameters.\n
4493 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4494 # with the specified parameters.\n
4495 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4496 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4497 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4498 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4500 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4501 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4502 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4503 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4504 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4506 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4507 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4510 # @return New GEOM.GEOM_Object, containing processed shape.
4512 # \n @ref tui_shape_processing "Example"
4513 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4515 Apply a sequence of Shape Healing operators to the given object.
4518 theShape Shape to be processed.
4519 theValues List of values of parameters, in the same order
4520 as parameters are listed in theParameters list.
4521 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4522 theParameters List of names of parameters
4523 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4524 Operators and Parameters:
4526 * FixShape - corrects invalid shapes.
4527 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4528 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4529 * FixFaceSize - removes small faces, such as spots and strips.
4530 * FixFaceSize.Tolerance - defines minimum possible face size.
4531 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4532 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4533 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4534 in segments using a certain angle.
4535 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4536 if Angle=180, four if Angle=90, etc).
4537 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4538 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4540 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4541 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4542 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4543 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4544 * SplitContinuity.CurveContinuity - required continuity for curves.
4545 This and the previous parameters can take the following values:
4547 Parametric Continuity:
4548 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4549 coincidental. The curves or surfaces may still meet at an angle,
4550 giving rise to a sharp corner or edge).
4551 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4552 are parallel, ruling out sharp edges).
4553 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4554 or surfaces are of the same magnitude).
4555 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4556 curves or surfaces (d/du C(u)) are the same at junction.
4558 Geometric Continuity:
4559 G1: first derivatives are proportional at junction.
4560 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4561 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4562 G2: first and second derivatives are proportional at junction. As the names imply,
4563 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4564 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4565 geometric continuity of order n, but not vice-versa.
4566 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4567 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4568 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4569 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4570 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4571 the specified parameters.
4572 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4573 the specified parameters.
4574 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4575 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4576 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4577 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4578 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4579 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4580 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4581 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4582 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4583 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4584 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4587 New GEOM.GEOM_Object, containing processed shape.
4589 Note: For more information look through SALOME Geometry User's Guide->
4590 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4592 # Example: see GEOM_TestHealing.py
4593 theValues,Parameters = ParseList(theValues)
4594 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4595 # To avoid script failure in case of good argument shape
4596 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4598 RaiseIfFailed("ProcessShape", self.HealOp)
4599 for string in (theOperators + theParameters):
4600 Parameters = ":" + Parameters
4602 anObj.SetParameters(Parameters)
4605 ## Remove faces from the given object (shape).
4606 # @param theObject Shape to be processed.
4607 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4608 # removes ALL faces of the given object.
4609 # @return New GEOM.GEOM_Object, containing processed shape.
4611 # @ref tui_suppress_faces "Example"
4612 def SuppressFaces(self,theObject, theFaces):
4614 Remove faces from the given object (shape).
4617 theObject Shape to be processed.
4618 theFaces Indices of faces to be removed, if EMPTY then the method
4619 removes ALL faces of the given object.
4622 New GEOM.GEOM_Object, containing processed shape.
4624 # Example: see GEOM_TestHealing.py
4625 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4626 RaiseIfFailed("SuppressFaces", self.HealOp)
4629 ## Sewing of some shapes into single shape.
4630 # @param ListShape Shapes to be processed.
4631 # @param theTolerance Required tolerance value.
4632 # @return New GEOM.GEOM_Object, containing processed shape.
4634 # @ref tui_sewing "Example"
4635 def MakeSewing(self, ListShape, theTolerance):
4637 Sewing of some shapes into single shape.
4640 ListShape Shapes to be processed.
4641 theTolerance Required tolerance value.
4644 New GEOM.GEOM_Object, containing processed shape.
4646 # Example: see GEOM_TestHealing.py
4647 comp = self.MakeCompound(ListShape)
4648 anObj = self.Sew(comp, theTolerance)
4651 ## Sewing of the given object.
4652 # @param theObject Shape to be processed.
4653 # @param theTolerance Required tolerance value.
4654 # @return New GEOM.GEOM_Object, containing processed shape.
4655 def Sew(self, theObject, theTolerance):
4657 Sewing of the given object.
4660 theObject Shape to be processed.
4661 theTolerance Required tolerance value.
4664 New GEOM.GEOM_Object, containing processed shape.
4666 # Example: see MakeSewing() above
4667 theTolerance,Parameters = ParseParameters(theTolerance)
4668 anObj = self.HealOp.Sew(theObject, theTolerance)
4669 RaiseIfFailed("Sew", self.HealOp)
4670 anObj.SetParameters(Parameters)
4673 ## Remove internal wires and edges from the given object (face).
4674 # @param theObject Shape to be processed.
4675 # @param theWires Indices of wires to be removed, if EMPTY then the method
4676 # removes ALL internal wires of the given object.
4677 # @return New GEOM.GEOM_Object, containing processed shape.
4679 # @ref tui_suppress_internal_wires "Example"
4680 def SuppressInternalWires(self,theObject, theWires):
4682 Remove internal wires and edges from the given object (face).
4685 theObject Shape to be processed.
4686 theWires Indices of wires to be removed, if EMPTY then the method
4687 removes ALL internal wires of the given object.
4690 New GEOM.GEOM_Object, containing processed shape.
4692 # Example: see GEOM_TestHealing.py
4693 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4694 RaiseIfFailed("RemoveIntWires", self.HealOp)
4697 ## Remove internal closed contours (holes) from the given object.
4698 # @param theObject Shape to be processed.
4699 # @param theWires Indices of wires to be removed, if EMPTY then the method
4700 # removes ALL internal holes of the given object
4701 # @return New GEOM.GEOM_Object, containing processed shape.
4703 # @ref tui_suppress_holes "Example"
4704 def SuppressHoles(self,theObject, theWires):
4706 Remove internal closed contours (holes) from the given object.
4709 theObject Shape to be processed.
4710 theWires Indices of wires to be removed, if EMPTY then the method
4711 removes ALL internal holes of the given object
4714 New GEOM.GEOM_Object, containing processed shape.
4716 # Example: see GEOM_TestHealing.py
4717 anObj = self.HealOp.FillHoles(theObject, theWires)
4718 RaiseIfFailed("FillHoles", self.HealOp)
4721 ## Close an open wire.
4722 # @param theObject Shape to be processed.
4723 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4724 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4725 # @param isCommonVertex If True : closure by creation of a common vertex,
4726 # If False : closure by creation of an edge between ends.
4727 # @return New GEOM.GEOM_Object, containing processed shape.
4729 # @ref tui_close_contour "Example"
4730 def CloseContour(self,theObject, theWires, isCommonVertex):
4735 theObject Shape to be processed.
4736 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4737 if [ ], then theObject itself is a wire.
4738 isCommonVertex If True : closure by creation of a common vertex,
4739 If False : closure by creation of an edge between ends.
4742 New GEOM.GEOM_Object, containing processed shape.
4744 # Example: see GEOM_TestHealing.py
4745 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4746 RaiseIfFailed("CloseContour", self.HealOp)
4749 ## Addition of a point to a given edge object.
4750 # @param theObject Shape to be processed.
4751 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4752 # if -1, then theObject itself is the edge.
4753 # @param theValue Value of parameter on edge or length parameter,
4754 # depending on \a isByParameter.
4755 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4756 # if FALSE : \a theValue is treated as a length parameter [0..1]
4757 # @return New GEOM.GEOM_Object, containing processed shape.
4759 # @ref tui_add_point_on_edge "Example"
4760 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4762 Addition of a point to a given edge object.
4765 theObject Shape to be processed.
4766 theEdgeIndex Index of edge to be divided within theObject's shape,
4767 if -1, then theObject itself is the edge.
4768 theValue Value of parameter on edge or length parameter,
4769 depending on isByParameter.
4770 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4771 if FALSE : theValue is treated as a length parameter [0..1]
4774 New GEOM.GEOM_Object, containing processed shape.
4776 # Example: see GEOM_TestHealing.py
4777 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4778 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4779 RaiseIfFailed("DivideEdge", self.HealOp)
4780 anObj.SetParameters(Parameters)
4783 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4784 # @param theWire Wire to minimize the number of C1 continuous edges in.
4785 # @param theVertices A list of vertices to suppress. If the list
4786 # is empty, all vertices in a wire will be assumed.
4787 # @return New GEOM.GEOM_Object with modified wire.
4789 # @ref tui_fuse_collinear_edges "Example"
4790 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4792 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4795 theWire Wire to minimize the number of C1 continuous edges in.
4796 theVertices A list of vertices to suppress. If the list
4797 is empty, all vertices in a wire will be assumed.
4800 New GEOM.GEOM_Object with modified wire.
4802 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4803 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4806 ## Change orientation of the given object. Updates given shape.
4807 # @param theObject Shape to be processed.
4808 # @return Updated <var>theObject</var>
4810 # @ref swig_todo "Example"
4811 def ChangeOrientationShell(self,theObject):
4813 Change orientation of the given object. Updates given shape.
4816 theObject Shape to be processed.
4821 theObject = self.HealOp.ChangeOrientation(theObject)
4822 RaiseIfFailed("ChangeOrientation", self.HealOp)
4825 ## Change orientation of the given object.
4826 # @param theObject Shape to be processed.
4827 # @return New GEOM.GEOM_Object, containing processed shape.
4829 # @ref swig_todo "Example"
4830 def ChangeOrientationShellCopy(self, theObject):
4832 Change orientation of the given object.
4835 theObject Shape to be processed.
4838 New GEOM.GEOM_Object, containing processed shape.
4840 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4841 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4844 ## Try to limit tolerance of the given object by value \a theTolerance.
4845 # @param theObject Shape to be processed.
4846 # @param theTolerance Required tolerance value.
4847 # @return New GEOM.GEOM_Object, containing processed shape.
4849 # @ref tui_limit_tolerance "Example"
4850 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4852 Try to limit tolerance of the given object by value theTolerance.
4855 theObject Shape to be processed.
4856 theTolerance Required tolerance value.
4859 New GEOM.GEOM_Object, containing processed shape.
4861 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4862 RaiseIfFailed("LimitTolerance", self.HealOp)
4865 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4866 # that constitute a free boundary of the given shape.
4867 # @param theObject Shape to get free boundary of.
4868 # @return [\a status, \a theClosedWires, \a theOpenWires]
4869 # \n \a status: FALSE, if an error(s) occured during the method execution.
4870 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4871 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4873 # @ref tui_measurement_tools_page "Example"
4874 def GetFreeBoundary(self, theObject):
4876 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4877 that constitute a free boundary of the given shape.
4880 theObject Shape to get free boundary of.
4883 [status, theClosedWires, theOpenWires]
4884 status: FALSE, if an error(s) occured during the method execution.
4885 theClosedWires: Closed wires on the free boundary of the given shape.
4886 theOpenWires: Open wires on the free boundary of the given shape.
4888 # Example: see GEOM_TestHealing.py
4889 anObj = self.HealOp.GetFreeBoundary(theObject)
4890 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4893 ## Replace coincident faces in theShape by one face.
4894 # @param theShape Initial shape.
4895 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4896 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4897 # otherwise all initial shapes.
4898 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4900 # @ref tui_glue_faces "Example"
4901 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4903 Replace coincident faces in theShape by one face.
4906 theShape Initial shape.
4907 theTolerance Maximum distance between faces, which can be considered as coincident.
4908 doKeepNonSolids If FALSE, only solids will present in the result,
4909 otherwise all initial shapes.
4912 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4914 # Example: see GEOM_Spanner.py
4915 theTolerance,Parameters = ParseParameters(theTolerance)
4916 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4918 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4919 anObj.SetParameters(Parameters)
4922 ## Find coincident faces in theShape for possible gluing.
4923 # @param theShape Initial shape.
4924 # @param theTolerance Maximum distance between faces,
4925 # which can be considered as coincident.
4926 # @return GEOM.ListOfGO
4928 # @ref tui_glue_faces "Example"
4929 def GetGlueFaces(self, theShape, theTolerance):
4931 Find coincident faces in theShape for possible gluing.
4934 theShape Initial shape.
4935 theTolerance Maximum distance between faces,
4936 which can be considered as coincident.
4941 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4942 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4945 ## Replace coincident faces in theShape by one face
4946 # in compliance with given list of faces
4947 # @param theShape Initial shape.
4948 # @param theTolerance Maximum distance between faces,
4949 # which can be considered as coincident.
4950 # @param theFaces List of faces for gluing.
4951 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4952 # otherwise all initial shapes.
4953 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4954 # will be glued, otherwise only the edges,
4955 # belonging to <VAR>theFaces</VAR>.
4956 # @return New GEOM.GEOM_Object, containing a copy of theShape
4957 # without some faces.
4959 # @ref tui_glue_faces "Example"
4960 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4961 doKeepNonSolids=True, doGlueAllEdges=True):
4963 Replace coincident faces in theShape by one face
4964 in compliance with given list of faces
4967 theShape Initial shape.
4968 theTolerance Maximum distance between faces,
4969 which can be considered as coincident.
4970 theFaces List of faces for gluing.
4971 doKeepNonSolids If FALSE, only solids will present in the result,
4972 otherwise all initial shapes.
4973 doGlueAllEdges If TRUE, all coincident edges of theShape
4974 will be glued, otherwise only the edges,
4975 belonging to theFaces.
4978 New GEOM.GEOM_Object, containing a copy of theShape
4981 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4982 doKeepNonSolids, doGlueAllEdges)
4984 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4987 ## Replace coincident edges in theShape by one edge.
4988 # @param theShape Initial shape.
4989 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
4990 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4992 # @ref tui_glue_edges "Example"
4993 def MakeGlueEdges(self, theShape, theTolerance):
4995 Replace coincident edges in theShape by one edge.
4998 theShape Initial shape.
4999 theTolerance Maximum distance between edges, which can be considered as coincident.
5002 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5004 theTolerance,Parameters = ParseParameters(theTolerance)
5005 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
5007 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
5008 anObj.SetParameters(Parameters)
5011 ## Find coincident edges in theShape for possible gluing.
5012 # @param theShape Initial shape.
5013 # @param theTolerance Maximum distance between edges,
5014 # which can be considered as coincident.
5015 # @return GEOM.ListOfGO
5017 # @ref tui_glue_edges "Example"
5018 def GetGlueEdges(self, theShape, theTolerance):
5020 Find coincident edges in theShape for possible gluing.
5023 theShape Initial shape.
5024 theTolerance Maximum distance between edges,
5025 which can be considered as coincident.
5030 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
5031 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
5034 ## Replace coincident edges in theShape by one edge
5035 # in compliance with given list of edges.
5036 # @param theShape Initial shape.
5037 # @param theTolerance Maximum distance between edges,
5038 # which can be considered as coincident.
5039 # @param theEdges List of edges for gluing.
5040 # @return New GEOM.GEOM_Object, containing a copy of theShape
5041 # without some edges.
5043 # @ref tui_glue_edges "Example"
5044 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
5046 Replace coincident edges in theShape by one edge
5047 in compliance with given list of edges.
5050 theShape Initial shape.
5051 theTolerance Maximum distance between edges,
5052 which can be considered as coincident.
5053 theEdges List of edges for gluing.
5056 New GEOM.GEOM_Object, containing a copy of theShape
5059 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
5061 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
5067 ## @addtogroup l3_boolean Boolean Operations
5070 # -----------------------------------------------------------------------------
5071 # Boolean (Common, Cut, Fuse, Section)
5072 # -----------------------------------------------------------------------------
5074 ## Perform one of boolean operations on two given shapes.
5075 # @param theShape1 First argument for boolean operation.
5076 # @param theShape2 Second argument for boolean operation.
5077 # @param theOperation Indicates the operation to be done:\n
5078 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5079 # @return New GEOM.GEOM_Object, containing the result shape.
5081 # @ref tui_fuse "Example"
5082 def MakeBoolean(self,theShape1, theShape2, theOperation):
5084 Perform one of boolean operations on two given shapes.
5087 theShape1 First argument for boolean operation.
5088 theShape2 Second argument for boolean operation.
5089 theOperation Indicates the operation to be done:
5090 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5093 New GEOM.GEOM_Object, containing the result shape.
5095 # Example: see GEOM_TestAll.py
5096 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
5097 RaiseIfFailed("MakeBoolean", self.BoolOp)
5100 ## Perform Common boolean operation on two given shapes.
5101 # @param theShape1 First argument for boolean operation.
5102 # @param theShape2 Second argument for boolean operation.
5103 # @return New GEOM.GEOM_Object, containing the result shape.
5105 # @ref tui_common "Example 1"
5106 # \n @ref swig_MakeCommon "Example 2"
5107 def MakeCommon(self, theShape1, theShape2):
5109 Perform Common boolean operation on two given shapes.
5112 theShape1 First argument for boolean operation.
5113 theShape2 Second argument for boolean operation.
5116 New GEOM.GEOM_Object, containing the result shape.
5118 # Example: see GEOM_TestOthers.py
5119 return self.MakeBoolean(theShape1, theShape2, 1)
5121 ## Perform Cut boolean operation on two given shapes.
5122 # @param theShape1 First argument for boolean operation.
5123 # @param theShape2 Second argument for boolean operation.
5124 # @return New GEOM.GEOM_Object, containing the result shape.
5126 # @ref tui_cut "Example 1"
5127 # \n @ref swig_MakeCommon "Example 2"
5128 def MakeCut(self, theShape1, theShape2):
5130 Perform Cut boolean operation on two given shapes.
5133 theShape1 First argument for boolean operation.
5134 theShape2 Second argument for boolean operation.
5137 New GEOM.GEOM_Object, containing the result shape.
5140 # Example: see GEOM_TestOthers.py
5141 return self.MakeBoolean(theShape1, theShape2, 2)
5143 ## Perform Fuse boolean operation on two given shapes.
5144 # @param theShape1 First argument for boolean operation.
5145 # @param theShape2 Second argument for boolean operation.
5146 # @return New GEOM.GEOM_Object, containing the result shape.
5148 # @ref tui_fuse "Example 1"
5149 # \n @ref swig_MakeCommon "Example 2"
5150 def MakeFuse(self, theShape1, theShape2):
5152 Perform Fuse boolean operation on two given shapes.
5155 theShape1 First argument for boolean operation.
5156 theShape2 Second argument for boolean operation.
5159 New GEOM.GEOM_Object, containing the result shape.
5162 # Example: see GEOM_TestOthers.py
5163 return self.MakeBoolean(theShape1, theShape2, 3)
5165 ## Perform Section boolean operation on two given shapes.
5166 # @param theShape1 First argument for boolean operation.
5167 # @param theShape2 Second argument for boolean operation.
5168 # @return New GEOM.GEOM_Object, containing the result shape.
5170 # @ref tui_section "Example 1"
5171 # \n @ref swig_MakeCommon "Example 2"
5172 def MakeSection(self, theShape1, theShape2):
5174 Perform Section boolean operation on two given shapes.
5177 theShape1 First argument for boolean operation.
5178 theShape2 Second argument for boolean operation.
5181 New GEOM.GEOM_Object, containing the result shape.
5184 # Example: see GEOM_TestOthers.py
5185 return self.MakeBoolean(theShape1, theShape2, 4)
5190 ## @addtogroup l3_basic_op
5193 ## Perform partition operation.
5194 # @param ListShapes Shapes to be intersected.
5195 # @param ListTools Shapes to intersect theShapes.
5196 # @param Limit Type of resulting shapes (see ShapeType()).\n
5197 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
5198 # type will be detected automatically.
5199 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5200 # target type (equal to Limit) are kept in the result,
5201 # else standalone shapes of lower dimension
5202 # are kept also (if they exist).
5203 # @note Each compound from ListShapes and ListTools will be exploded
5204 # in order to avoid possible intersection between shapes from this compound.
5206 # After implementation new version of PartitionAlgo (October 2006)
5207 # other parameters are ignored by current functionality. They are kept
5208 # in this function only for support old versions.
5209 # @param ListKeepInside Shapes, outside which the results will be deleted.
5210 # Each shape from theKeepInside must belong to theShapes also.
5211 # @param ListRemoveInside Shapes, inside which the results will be deleted.
5212 # Each shape from theRemoveInside must belong to theShapes also.
5213 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5214 # @param ListMaterials Material indices for each shape. Make sence,
5215 # only if theRemoveWebs is TRUE.
5217 # @return New GEOM.GEOM_Object, containing the result shapes.
5219 # @ref tui_partition "Example"
5220 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5221 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5222 KeepNonlimitShapes=0):
5224 Perform partition operation.
5227 ListShapes Shapes to be intersected.
5228 ListTools Shapes to intersect theShapes.
5229 Limit Type of resulting shapes (see geompy.ShapeType)
5230 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5231 type will be detected automatically.
5232 KeepNonlimitShapes if this parameter == 0, then only shapes of
5233 target type (equal to Limit) are kept in the result,
5234 else standalone shapes of lower dimension
5235 are kept also (if they exist).
5237 Each compound from ListShapes and ListTools will be exploded
5238 in order to avoid possible intersection between shapes from
5241 After implementation new version of PartitionAlgo (October 2006) other
5242 parameters are ignored by current functionality. They are kept in this
5243 function only for support old versions.
5246 ListKeepInside Shapes, outside which the results will be deleted.
5247 Each shape from theKeepInside must belong to theShapes also.
5248 ListRemoveInside Shapes, inside which the results will be deleted.
5249 Each shape from theRemoveInside must belong to theShapes also.
5250 RemoveWebs If TRUE, perform Glue 3D algorithm.
5251 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5254 New GEOM.GEOM_Object, containing the result shapes.
5256 # Example: see GEOM_TestAll.py
5257 if Limit == ShapeType["AUTO"]:
5258 # automatic detection of the most appropriate shape limit type
5260 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5261 Limit = EnumToLong(lim)
5263 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5264 ListKeepInside, ListRemoveInside,
5265 Limit, RemoveWebs, ListMaterials,
5266 KeepNonlimitShapes);
5267 RaiseIfFailed("MakePartition", self.BoolOp)
5270 ## Perform partition operation.
5271 # This method may be useful if it is needed to make a partition for
5272 # compound contains nonintersected shapes. Performance will be better
5273 # since intersection between shapes from compound is not performed.
5275 # Description of all parameters as in previous method MakePartition()
5277 # @note Passed compounds (via ListShapes or via ListTools)
5278 # have to consist of nonintersecting shapes.
5280 # @return New GEOM.GEOM_Object, containing the result shapes.
5282 # @ref swig_todo "Example"
5283 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5284 ListKeepInside=[], ListRemoveInside=[],
5285 Limit=ShapeType["AUTO"], RemoveWebs=0,
5286 ListMaterials=[], KeepNonlimitShapes=0):
5288 Perform partition operation.
5289 This method may be useful if it is needed to make a partition for
5290 compound contains nonintersected shapes. Performance will be better
5291 since intersection between shapes from compound is not performed.
5294 Description of all parameters as in method geompy.MakePartition
5297 Passed compounds (via ListShapes or via ListTools)
5298 have to consist of nonintersecting shapes.
5301 New GEOM.GEOM_Object, containing the result shapes.
5303 if Limit == ShapeType["AUTO"]:
5304 # automatic detection of the most appropriate shape limit type
5306 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5307 Limit = EnumToLong(lim)
5309 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5310 ListKeepInside, ListRemoveInside,
5311 Limit, RemoveWebs, ListMaterials,
5312 KeepNonlimitShapes);
5313 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5316 ## See method MakePartition() for more information.
5318 # @ref tui_partition "Example 1"
5319 # \n @ref swig_Partition "Example 2"
5320 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5321 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5322 KeepNonlimitShapes=0):
5324 See method geompy.MakePartition for more information.
5326 # Example: see GEOM_TestOthers.py
5327 anObj = self.MakePartition(ListShapes, ListTools,
5328 ListKeepInside, ListRemoveInside,
5329 Limit, RemoveWebs, ListMaterials,
5330 KeepNonlimitShapes);
5333 ## Perform partition of the Shape with the Plane
5334 # @param theShape Shape to be intersected.
5335 # @param thePlane Tool shape, to intersect theShape.
5336 # @return New GEOM.GEOM_Object, containing the result shape.
5338 # @ref tui_partition "Example"
5339 def MakeHalfPartition(self,theShape, thePlane):
5341 Perform partition of the Shape with the Plane
5344 theShape Shape to be intersected.
5345 thePlane Tool shape, to intersect theShape.
5348 New GEOM.GEOM_Object, containing the result shape.
5350 # Example: see GEOM_TestAll.py
5351 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5352 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5355 # end of l3_basic_op
5358 ## @addtogroup l3_transform
5361 ## Translate the given object along the vector, specified
5362 # by its end points, creating its copy before the translation.
5363 # @param theObject The object to be translated.
5364 # @param thePoint1 Start point of translation vector.
5365 # @param thePoint2 End point of translation vector.
5366 # @return New GEOM.GEOM_Object, containing the translated object.
5368 # @ref tui_translation "Example 1"
5369 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5370 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5372 Translate the given object along the vector, specified
5373 by its end points, creating its copy before the translation.
5376 theObject The object to be translated.
5377 thePoint1 Start point of translation vector.
5378 thePoint2 End point of translation vector.
5381 New GEOM.GEOM_Object, containing the translated object.
5383 # Example: see GEOM_TestAll.py
5384 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5385 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5388 ## Translate the given object along the vector, specified by its components.
5389 # @param theObject The object to be translated.
5390 # @param theDX,theDY,theDZ Components of translation vector.
5391 # @return Translated GEOM.GEOM_Object.
5393 # @ref tui_translation "Example"
5394 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5396 Translate the given object along the vector, specified by its components.
5399 theObject The object to be translated.
5400 theDX,theDY,theDZ Components of translation vector.
5403 Translated GEOM.GEOM_Object.
5405 # Example: see GEOM_TestAll.py
5406 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5407 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5408 anObj.SetParameters(Parameters)
5409 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5412 ## Translate the given object along the vector, specified
5413 # by its components, creating its copy before the translation.
5414 # @param theObject The object to be translated.
5415 # @param theDX,theDY,theDZ Components of translation vector.
5416 # @return New GEOM.GEOM_Object, containing the translated object.
5418 # @ref tui_translation "Example"
5419 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5421 Translate the given object along the vector, specified
5422 by its components, creating its copy before the translation.
5425 theObject The object to be translated.
5426 theDX,theDY,theDZ Components of translation vector.
5429 New GEOM.GEOM_Object, containing the translated object.
5431 # Example: see GEOM_TestAll.py
5432 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5433 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5434 anObj.SetParameters(Parameters)
5435 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5438 ## Translate the given object along the given vector,
5439 # creating its copy before the translation.
5440 # @param theObject The object to be translated.
5441 # @param theVector The translation vector.
5442 # @return New GEOM.GEOM_Object, containing the translated object.
5444 # @ref tui_translation "Example"
5445 def MakeTranslationVector(self,theObject, theVector):
5447 Translate the given object along the given vector,
5448 creating its copy before the translation.
5451 theObject The object to be translated.
5452 theVector The translation vector.
5455 New GEOM.GEOM_Object, containing the translated object.
5457 # Example: see GEOM_TestAll.py
5458 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5459 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5462 ## Translate the given object along the given vector on given distance.
5463 # @param theObject The object to be translated.
5464 # @param theVector The translation vector.
5465 # @param theDistance The translation distance.
5466 # @param theCopy Flag used to translate object itself or create a copy.
5467 # @return New GEOM.GEOM_Object, containing the translated object.
5469 # @ref tui_translation "Example"
5470 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5472 Translate the given object along the given vector on given distance.
5475 theObject The object to be translated.
5476 theVector The translation vector.
5477 theDistance The translation distance.
5478 theCopy Flag used to translate object itself or create a copy.
5481 New GEOM.GEOM_Object, containing the translated object.
5483 # Example: see GEOM_TestAll.py
5484 theDistance,Parameters = ParseParameters(theDistance)
5485 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5486 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5487 anObj.SetParameters(Parameters)
5490 ## Translate the given object along the given vector on given distance,
5491 # creating its copy before the translation.
5492 # @param theObject The object to be translated.
5493 # @param theVector The translation vector.
5494 # @param theDistance The translation distance.
5495 # @return New GEOM.GEOM_Object, containing the translated object.
5497 # @ref tui_translation "Example"
5498 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5500 Translate the given object along the given vector on given distance,
5501 creating its copy before the translation.
5504 theObject The object to be translated.
5505 theVector The translation vector.
5506 theDistance The translation distance.
5509 New GEOM.GEOM_Object, containing the translated object.
5511 # Example: see GEOM_TestAll.py
5512 theDistance,Parameters = ParseParameters(theDistance)
5513 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5514 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5515 anObj.SetParameters(Parameters)
5518 ## Rotate the given object around the given axis on the given angle.
5519 # @param theObject The object to be rotated.
5520 # @param theAxis Rotation axis.
5521 # @param theAngle Rotation angle in radians.
5522 # @return New GEOM.GEOM_Object, containing the rotated object.
5524 # @ref tui_rotation "Example"
5525 def Rotate(self,theObject, theAxis, theAngle):
5527 Rotate the given object around the given axis on the given angle.
5530 theObject The object to be rotated.
5531 theAxis Rotation axis.
5532 theAngle Rotation angle in radians.
5535 New GEOM.GEOM_Object, containing the rotated object.
5537 # Example: see GEOM_TestAll.py
5539 if isinstance(theAngle,str):
5541 theAngle, Parameters = ParseParameters(theAngle)
5543 theAngle = theAngle*math.pi/180.0
5544 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5545 RaiseIfFailed("RotateCopy", self.TrsfOp)
5546 anObj.SetParameters(Parameters)
5549 ## Rotate the given object around the given axis
5550 # on the given angle, creating its copy before the rotatation.
5551 # @param theObject The object to be rotated.
5552 # @param theAxis Rotation axis.
5553 # @param theAngle Rotation angle in radians.
5554 # @return New GEOM.GEOM_Object, containing the rotated object.
5556 # @ref tui_rotation "Example"
5557 def MakeRotation(self,theObject, theAxis, theAngle):
5559 Rotate the given object around the given axis
5560 on the given angle, creating its copy before the rotatation.
5563 theObject The object to be rotated.
5564 theAxis Rotation axis.
5565 theAngle Rotation angle in radians.
5568 New GEOM.GEOM_Object, containing the rotated object.
5570 # Example: see GEOM_TestAll.py
5572 if isinstance(theAngle,str):
5574 theAngle, Parameters = ParseParameters(theAngle)
5576 theAngle = theAngle*math.pi/180.0
5577 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5578 RaiseIfFailed("RotateCopy", self.TrsfOp)
5579 anObj.SetParameters(Parameters)
5582 ## Rotate given object around vector perpendicular to plane
5583 # containing three points, creating its copy before the rotatation.
5584 # @param theObject The object to be rotated.
5585 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5586 # containing the three points.
5587 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5588 # @return New GEOM.GEOM_Object, containing the rotated object.
5590 # @ref tui_rotation "Example"
5591 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5593 Rotate given object around vector perpendicular to plane
5594 containing three points, creating its copy before the rotatation.
5597 theObject The object to be rotated.
5598 theCentPoint central point the axis is the vector perpendicular to the plane
5599 containing the three points.
5600 thePoint1,thePoint2 in a perpendicular plane of the axis.
5603 New GEOM.GEOM_Object, containing the rotated object.
5605 # Example: see GEOM_TestAll.py
5606 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5607 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5610 ## Scale the given object by the factor, creating its copy before the scaling.
5611 # @param theObject The object to be scaled.
5612 # @param thePoint Center point for scaling.
5613 # Passing None for it means scaling relatively the origin of global CS.
5614 # @param theFactor Scaling factor value.
5615 # @return New GEOM.GEOM_Object, containing the scaled shape.
5617 # @ref tui_scale "Example"
5618 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5620 Scale the given object by the factor, creating its copy before the scaling.
5623 theObject The object to be scaled.
5624 thePoint Center point for scaling.
5625 Passing None for it means scaling relatively the origin of global CS.
5626 theFactor Scaling factor value.
5629 New GEOM.GEOM_Object, containing the scaled shape.
5631 # Example: see GEOM_TestAll.py
5632 theFactor, Parameters = ParseParameters(theFactor)
5633 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5634 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5635 anObj.SetParameters(Parameters)
5638 ## Scale the given object by different factors along coordinate axes,
5639 # creating its copy before the scaling.
5640 # @param theObject The object to be scaled.
5641 # @param thePoint Center point for scaling.
5642 # Passing None for it means scaling relatively the origin of global CS.
5643 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5644 # @return New GEOM.GEOM_Object, containing the scaled shape.
5646 # @ref swig_scale "Example"
5647 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5649 Scale the given object by different factors along coordinate axes,
5650 creating its copy before the scaling.
5653 theObject The object to be scaled.
5654 thePoint Center point for scaling.
5655 Passing None for it means scaling relatively the origin of global CS.
5656 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5659 New GEOM.GEOM_Object, containing the scaled shape.
5661 # Example: see GEOM_TestAll.py
5662 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5663 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5664 theFactorX, theFactorY, theFactorZ)
5665 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5666 anObj.SetParameters(Parameters)
5669 ## Create an object, symmetrical
5670 # to the given one relatively the given plane.
5671 # @param theObject The object to be mirrored.
5672 # @param thePlane Plane of symmetry.
5673 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5675 # @ref tui_mirror "Example"
5676 def MakeMirrorByPlane(self,theObject, thePlane):
5678 Create an object, symmetrical to the given one relatively the given plane.
5681 theObject The object to be mirrored.
5682 thePlane Plane of symmetry.
5685 New GEOM.GEOM_Object, containing the mirrored shape.
5687 # Example: see GEOM_TestAll.py
5688 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5689 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5692 ## Create an object, symmetrical
5693 # to the given one relatively the given axis.
5694 # @param theObject The object to be mirrored.
5695 # @param theAxis Axis of symmetry.
5696 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5698 # @ref tui_mirror "Example"
5699 def MakeMirrorByAxis(self,theObject, theAxis):
5701 Create an object, symmetrical to the given one relatively the given axis.
5704 theObject The object to be mirrored.
5705 theAxis Axis of symmetry.
5708 New GEOM.GEOM_Object, containing the mirrored shape.
5710 # Example: see GEOM_TestAll.py
5711 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5712 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5715 ## Create an object, symmetrical
5716 # to the given one relatively the given point.
5717 # @param theObject The object to be mirrored.
5718 # @param thePoint Point of symmetry.
5719 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5721 # @ref tui_mirror "Example"
5722 def MakeMirrorByPoint(self,theObject, thePoint):
5724 Create an object, symmetrical
5725 to the given one relatively the given point.
5728 theObject The object to be mirrored.
5729 thePoint Point of symmetry.
5732 New GEOM.GEOM_Object, containing the mirrored shape.
5734 # Example: see GEOM_TestAll.py
5735 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5736 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5739 ## Modify the Location of the given object by LCS,
5740 # creating its copy before the setting.
5741 # @param theObject The object to be displaced.
5742 # @param theStartLCS Coordinate system to perform displacement from it.\n
5743 # If \a theStartLCS is NULL, displacement
5744 # will be performed from global CS.\n
5745 # If \a theObject itself is used as \a theStartLCS,
5746 # its location will be changed to \a theEndLCS.
5747 # @param theEndLCS Coordinate system to perform displacement to it.
5748 # @return New GEOM.GEOM_Object, containing the displaced shape.
5750 # @ref tui_modify_location "Example"
5751 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5753 Modify the Location of the given object by LCS, creating its copy before the setting.
5756 theObject The object to be displaced.
5757 theStartLCS Coordinate system to perform displacement from it.
5758 If theStartLCS is NULL, displacement
5759 will be performed from global CS.
5760 If theObject itself is used as theStartLCS,
5761 its location will be changed to theEndLCS.
5762 theEndLCS Coordinate system to perform displacement to it.
5765 New GEOM.GEOM_Object, containing the displaced shape.
5768 # create local coordinate systems
5769 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5770 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5771 # modify the location of the given object
5772 position = geompy.MakePosition(cylinder, cs1, cs2)
5774 # Example: see GEOM_TestAll.py
5775 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5776 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5779 ## Modify the Location of the given object by Path,
5780 # @param theObject The object to be displaced.
5781 # @param thePath Wire or Edge along that the object will be translated.
5782 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5783 # @param theCopy is to create a copy objects if true.
5784 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5785 # @return New GEOM.GEOM_Object, containing the displaced shape.
5787 # @ref tui_modify_location "Example"
5788 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5790 Modify the Location of the given object by Path
5793 theObject The object to be displaced.
5794 thePath Wire or Edge along that the object will be translated.
5795 theDistance progress of Path (0 = start location, 1 = end of path location).
5796 theCopy is to create a copy objects if true.
5797 theReverse 0 - for usual direction, 1 - to reverse path direction.
5800 New GEOM.GEOM_Object, containing the displaced shape.
5803 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5805 # Example: see GEOM_TestAll.py
5806 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5807 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5810 ## Create new object as offset of the given one.
5811 # @param theObject The base object for the offset.
5812 # @param theOffset Offset value.
5813 # @return New GEOM.GEOM_Object, containing the offset object.
5815 # @ref tui_offset "Example"
5816 def MakeOffset(self,theObject, theOffset):
5818 Create new object as offset of the given one.
5821 theObject The base object for the offset.
5822 theOffset Offset value.
5825 New GEOM.GEOM_Object, containing the offset object.
5828 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5829 # create a new object as offset of the given object
5830 offset = geompy.MakeOffset(box, 70.)
5832 # Example: see GEOM_TestAll.py
5833 theOffset, Parameters = ParseParameters(theOffset)
5834 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5835 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5836 anObj.SetParameters(Parameters)
5839 ## Create new object as projection of the given one on a 2D surface.
5840 # @param theSource The source object for the projection. It can be a point, edge or wire.
5841 # @param theTarget The target object. It can be planar or cylindrical face.
5842 # @return New GEOM.GEOM_Object, containing the projection.
5844 # @ref tui_projection "Example"
5845 def MakeProjection(self, theSource, theTarget):
5847 Create new object as projection of the given one on a 2D surface.
5850 theSource The source object for the projection. It can be a point, edge or wire.
5851 theTarget The target object. It can be planar or cylindrical face.
5854 New GEOM.GEOM_Object, containing the projection.
5856 # Example: see GEOM_TestAll.py
5857 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5858 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5861 # -----------------------------------------------------------------------------
5863 # -----------------------------------------------------------------------------
5865 ## Translate the given object along the given vector a given number times
5866 # @param theObject The object to be translated.
5867 # @param theVector Direction of the translation.
5868 # @param theStep Distance to translate on.
5869 # @param theNbTimes Quantity of translations to be done.
5870 # @return New GEOM.GEOM_Object, containing compound of all
5871 # the shapes, obtained after each translation.
5873 # @ref tui_multi_translation "Example"
5874 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5876 Translate the given object along the given vector a given number times
5879 theObject The object to be translated.
5880 theVector Direction of the translation.
5881 theStep Distance to translate on.
5882 theNbTimes Quantity of translations to be done.
5885 New GEOM.GEOM_Object, containing compound of all
5886 the shapes, obtained after each translation.
5889 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5891 # Example: see GEOM_TestAll.py
5892 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5893 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5894 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5895 anObj.SetParameters(Parameters)
5898 ## Conseqently apply two specified translations to theObject specified number of times.
5899 # @param theObject The object to be translated.
5900 # @param theVector1 Direction of the first translation.
5901 # @param theStep1 Step of the first translation.
5902 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5903 # @param theVector2 Direction of the second translation.
5904 # @param theStep2 Step of the second translation.
5905 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5906 # @return New GEOM.GEOM_Object, containing compound of all
5907 # the shapes, obtained after each translation.
5909 # @ref tui_multi_translation "Example"
5910 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5911 theVector2, theStep2, theNbTimes2):
5913 Conseqently apply two specified translations to theObject specified number of times.
5916 theObject The object to be translated.
5917 theVector1 Direction of the first translation.
5918 theStep1 Step of the first translation.
5919 theNbTimes1 Quantity of translations to be done along theVector1.
5920 theVector2 Direction of the second translation.
5921 theStep2 Step of the second translation.
5922 theNbTimes2 Quantity of translations to be done along theVector2.
5925 New GEOM.GEOM_Object, containing compound of all
5926 the shapes, obtained after each translation.
5929 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5931 # Example: see GEOM_TestAll.py
5932 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5933 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5934 theVector2, theStep2, theNbTimes2)
5935 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5936 anObj.SetParameters(Parameters)
5939 ## Rotate the given object around the given axis a given number times.
5940 # Rotation angle will be 2*PI/theNbTimes.
5941 # @param theObject The object to be rotated.
5942 # @param theAxis The rotation axis.
5943 # @param theNbTimes Quantity of rotations to be done.
5944 # @return New GEOM.GEOM_Object, containing compound of all the
5945 # shapes, obtained after each rotation.
5947 # @ref tui_multi_rotation "Example"
5948 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5950 Rotate the given object around the given axis a given number times.
5951 Rotation angle will be 2*PI/theNbTimes.
5954 theObject The object to be rotated.
5955 theAxis The rotation axis.
5956 theNbTimes Quantity of rotations to be done.
5959 New GEOM.GEOM_Object, containing compound of all the
5960 shapes, obtained after each rotation.
5963 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5965 # Example: see GEOM_TestAll.py
5966 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5967 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5968 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5969 anObj.SetParameters(Parameters)
5972 ## Rotate the given object around the
5973 # given axis on the given angle a given number
5974 # times and multi-translate each rotation result.
5975 # Translation direction passes through center of gravity
5976 # of rotated shape and its projection on the rotation axis.
5977 # @param theObject The object to be rotated.
5978 # @param theAxis Rotation axis.
5979 # @param theAngle Rotation angle in graduces.
5980 # @param theNbTimes1 Quantity of rotations to be done.
5981 # @param theStep Translation distance.
5982 # @param theNbTimes2 Quantity of translations to be done.
5983 # @return New GEOM.GEOM_Object, containing compound of all the
5984 # shapes, obtained after each transformation.
5986 # @ref tui_multi_rotation "Example"
5987 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5989 Rotate the given object around the
5990 given axis on the given angle a given number
5991 times and multi-translate each rotation result.
5992 Translation direction passes through center of gravity
5993 of rotated shape and its projection on the rotation axis.
5996 theObject The object to be rotated.
5997 theAxis Rotation axis.
5998 theAngle Rotation angle in graduces.
5999 theNbTimes1 Quantity of rotations to be done.
6000 theStep Translation distance.
6001 theNbTimes2 Quantity of translations to be done.
6004 New GEOM.GEOM_Object, containing compound of all the
6005 shapes, obtained after each transformation.
6008 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
6010 # Example: see GEOM_TestAll.py
6011 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
6012 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
6013 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
6014 anObj.SetParameters(Parameters)
6017 ## The same, as MultiRotate1D(), but axis is given by direction and point
6019 # @ref swig_MakeMultiRotation "Example"
6020 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
6022 The same, as geompy.MultiRotate1D, but axis is given by direction and point
6025 pz = geompy.MakeVertex(0, 0, 100)
6026 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6027 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
6029 # Example: see GEOM_TestOthers.py
6030 aVec = self.MakeLine(aPoint,aDir)
6031 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
6034 ## The same, as MultiRotate2D(), but axis is given by direction and point
6036 # @ref swig_MakeMultiRotation "Example"
6037 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
6039 The same, as MultiRotate2D(), but axis is given by direction and point
6042 pz = geompy.MakeVertex(0, 0, 100)
6043 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6044 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
6046 # Example: see GEOM_TestOthers.py
6047 aVec = self.MakeLine(aPoint,aDir)
6048 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
6051 # end of l3_transform
6054 ## @addtogroup l3_local
6057 ## Perform a fillet on all edges of the given shape.
6058 # @param theShape Shape, to perform fillet on.
6059 # @param theR Fillet radius.
6060 # @return New GEOM.GEOM_Object, containing the result shape.
6062 # @ref tui_fillet "Example 1"
6063 # \n @ref swig_MakeFilletAll "Example 2"
6064 def MakeFilletAll(self,theShape, theR):
6066 Perform a fillet on all edges of the given shape.
6069 theShape Shape, to perform fillet on.
6073 New GEOM.GEOM_Object, containing the result shape.
6076 filletall = geompy.MakeFilletAll(prism, 10.)
6078 # Example: see GEOM_TestOthers.py
6079 theR,Parameters = ParseParameters(theR)
6080 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
6081 RaiseIfFailed("MakeFilletAll", self.LocalOp)
6082 anObj.SetParameters(Parameters)
6085 ## Perform a fillet on the specified edges/faces of the given shape
6086 # @param theShape Shape, to perform fillet on.
6087 # @param theR Fillet radius.
6088 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
6089 # @param theListShapes Global indices of edges/faces to perform fillet on.
6090 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6091 # @return New GEOM.GEOM_Object, containing the result shape.
6093 # @ref tui_fillet "Example"
6094 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
6096 Perform a fillet on the specified edges/faces of the given shape
6099 theShape Shape, to perform fillet on.
6101 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
6102 theListShapes Global indices of edges/faces to perform fillet on.
6105 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6108 New GEOM.GEOM_Object, containing the result shape.
6111 # get the list of IDs (IDList) for the fillet
6112 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6114 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6115 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6116 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6117 # make a fillet on the specified edges of the given shape
6118 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
6120 # Example: see GEOM_TestAll.py
6121 theR,Parameters = ParseParameters(theR)
6123 if theShapeType == ShapeType["EDGE"]:
6124 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6125 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6127 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6128 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6129 anObj.SetParameters(Parameters)
6132 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6133 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6135 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6138 # get the list of IDs (IDList) for the fillet
6139 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6141 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6142 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6143 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6144 # make a fillet on the specified edges of the given shape
6145 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6147 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6149 if theShapeType == ShapeType["EDGE"]:
6150 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6151 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6153 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6154 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6155 anObj.SetParameters(Parameters)
6158 ## Perform a fillet on the specified edges of the given shape
6159 # @param theShape Wire Shape to perform fillet on.
6160 # @param theR Fillet radius.
6161 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6162 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6163 # \note The list of vertices could be empty,
6164 # in this case fillet will done done at all vertices in wire
6165 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6166 # by the length of the edges, nearest to the fillet vertex.
6167 # But sometimes the next edge is C1 continuous with the one, nearest to
6168 # the fillet point, and such two (or more) edges can be united to allow
6169 # bigger radius. Set this flag to TRUE to allow collinear edges union,
6170 # thus ignoring the secant vertex (vertices).
6171 # @return New GEOM.GEOM_Object, containing the result shape.
6173 # @ref tui_fillet2d "Example"
6174 def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6176 Perform a fillet on the specified edges of the given shape
6179 theShape Wire Shape to perform fillet on.
6181 theListOfVertexes Global indices of vertexes to perform fillet on.
6182 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6183 by the length of the edges, nearest to the fillet vertex.
6184 But sometimes the next edge is C1 continuous with the one, nearest to
6185 the fillet point, and such two (or more) edges can be united to allow
6186 bigger radius. Set this flag to TRUE to allow collinear edges union,
6187 thus ignoring the secant vertex (vertices).
6189 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6191 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6194 New GEOM.GEOM_Object, containing the result shape.
6198 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6199 # make fillet at given wire vertices with giver radius
6200 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6202 # Example: see GEOM_TestAll.py
6203 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6204 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6205 RaiseIfFailed("MakeFillet1D", self.LocalOp)
6206 anObj.SetParameters(Parameters)
6209 ## Perform a fillet at the specified vertices of the given face/shell.
6210 # @param theShape Face or Shell shape to perform fillet on.
6211 # @param theR Fillet radius.
6212 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
6213 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6214 # @return New GEOM.GEOM_Object, containing the result shape.
6216 # @ref tui_fillet2d "Example"
6217 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6219 Perform a fillet at the specified vertices of the given face/shell.
6222 theShape Face or Shell shape to perform fillet on.
6224 theListOfVertexes Global indices of vertexes to perform fillet on.
6226 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6229 New GEOM.GEOM_Object, containing the result shape.
6232 face = geompy.MakeFaceHW(100, 100, 1)
6233 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6235 # Example: see GEOM_TestAll.py
6236 theR,Parameters = ParseParameters(theR)
6237 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6238 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6239 anObj.SetParameters(Parameters)
6242 ## Perform a symmetric chamfer on all edges of the given shape.
6243 # @param theShape Shape, to perform chamfer on.
6244 # @param theD Chamfer size along each face.
6245 # @return New GEOM.GEOM_Object, containing the result shape.
6247 # @ref tui_chamfer "Example 1"
6248 # \n @ref swig_MakeChamferAll "Example 2"
6249 def MakeChamferAll(self,theShape, theD):
6251 Perform a symmetric chamfer on all edges of the given shape.
6254 theShape Shape, to perform chamfer on.
6255 theD Chamfer size along each face.
6258 New GEOM.GEOM_Object, containing the result shape.
6261 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6263 # Example: see GEOM_TestOthers.py
6264 theD,Parameters = ParseParameters(theD)
6265 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6266 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6267 anObj.SetParameters(Parameters)
6270 ## Perform a chamfer on edges, common to the specified faces,
6271 # with distance D1 on the Face1
6272 # @param theShape Shape, to perform chamfer on.
6273 # @param theD1 Chamfer size along \a theFace1.
6274 # @param theD2 Chamfer size along \a theFace2.
6275 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6276 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6277 # @return New GEOM.GEOM_Object, containing the result shape.
6279 # @ref tui_chamfer "Example"
6280 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6282 Perform a chamfer on edges, common to the specified faces,
6283 with distance D1 on the Face1
6286 theShape Shape, to perform chamfer on.
6287 theD1 Chamfer size along theFace1.
6288 theD2 Chamfer size along theFace2.
6289 theFace1,theFace2 Global indices of two faces of theShape.
6292 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6295 New GEOM.GEOM_Object, containing the result shape.
6298 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6299 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6300 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6301 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6303 # Example: see GEOM_TestAll.py
6304 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6305 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6306 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6307 anObj.SetParameters(Parameters)
6310 ## Perform a chamfer on edges
6311 # @param theShape Shape, to perform chamfer on.
6312 # @param theD Chamfer length
6313 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6314 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6315 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6316 # @return New GEOM.GEOM_Object, containing the result shape.
6317 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6319 Perform a chamfer on edges
6322 theShape Shape, to perform chamfer on.
6323 theD1 Chamfer size along theFace1.
6324 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6325 theFace1,theFace2 Global indices of two faces of theShape.
6328 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6331 New GEOM.GEOM_Object, containing the result shape.
6334 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6335 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6336 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6338 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6341 if isinstance(theAngle,str):
6343 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6345 theAngle = theAngle*math.pi/180.0
6346 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6347 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6348 anObj.SetParameters(Parameters)
6351 ## Perform a chamfer on all edges of the specified faces,
6352 # with distance D1 on the first specified face (if several for one edge)
6353 # @param theShape Shape, to perform chamfer on.
6354 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6355 # connected to the edge, are in \a theFaces, \a theD1
6356 # will be get along face, which is nearer to \a theFaces beginning.
6357 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6358 # @param theFaces Sequence of global indices of faces of \a theShape.
6359 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6360 # @return New GEOM.GEOM_Object, containing the result shape.
6362 # @ref tui_chamfer "Example"
6363 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6365 Perform a chamfer on all edges of the specified faces,
6366 with distance D1 on the first specified face (if several for one edge)
6369 theShape Shape, to perform chamfer on.
6370 theD1 Chamfer size along face from theFaces. If both faces,
6371 connected to the edge, are in theFaces, theD1
6372 will be get along face, which is nearer to theFaces beginning.
6373 theD2 Chamfer size along another of two faces, connected to the edge.
6374 theFaces Sequence of global indices of faces of theShape.
6377 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6380 New GEOM.GEOM_Object, containing the result shape.
6382 # Example: see GEOM_TestAll.py
6383 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6384 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6385 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6386 anObj.SetParameters(Parameters)
6389 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6390 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6392 # @ref swig_FilletChamfer "Example"
6393 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6395 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6396 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6399 if isinstance(theAngle,str):
6401 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6403 theAngle = theAngle*math.pi/180.0
6404 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6405 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6406 anObj.SetParameters(Parameters)
6409 ## Perform a chamfer on edges,
6410 # with distance D1 on the first specified face (if several for one edge)
6411 # @param theShape Shape, to perform chamfer on.
6412 # @param theD1,theD2 Chamfer size
6413 # @param theEdges Sequence of edges of \a theShape.
6414 # @return New GEOM.GEOM_Object, containing the result shape.
6416 # @ref swig_FilletChamfer "Example"
6417 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6419 Perform a chamfer on edges,
6420 with distance D1 on the first specified face (if several for one edge)
6423 theShape Shape, to perform chamfer on.
6424 theD1,theD2 Chamfer size
6425 theEdges Sequence of edges of theShape.
6428 New GEOM.GEOM_Object, containing the result shape.
6430 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6431 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6432 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6433 anObj.SetParameters(Parameters)
6436 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6437 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6438 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6440 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6441 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6444 if isinstance(theAngle,str):
6446 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6448 theAngle = theAngle*math.pi/180.0
6449 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6450 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6451 anObj.SetParameters(Parameters)
6454 ## /sa MakeChamferEdge() and MakeChamferFaces()
6456 # @ref swig_MakeChamfer "Example"
6457 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6459 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6461 # Example: see GEOM_TestOthers.py
6463 if aShapeType == ShapeType["EDGE"]:
6464 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6466 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6469 ## Remove material from a solid by extrusion of the base shape on the given distance.
6470 # @param theInit Shape to remove material from. It must be a solid or
6471 # a compound made of a single solid.
6472 # @param theBase Closed edge or wire defining the base shape to be extruded.
6473 # @param theH Prism dimension along the normal to theBase
6474 # @param theAngle Draft angle in degrees.
6475 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6477 # @ref tui_creation_prism "Example"
6478 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6480 Add material to a solid by extrusion of the base shape on the given distance.
6483 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6484 theBase Closed edge or wire defining the base shape to be extruded.
6485 theH Prism dimension along the normal to theBase
6486 theAngle Draft angle in degrees.
6489 New GEOM.GEOM_Object, containing the initial shape with removed material.
6491 # Example: see GEOM_TestAll.py
6492 #theH,Parameters = ParseParameters(theH)
6493 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6494 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6495 #anObj.SetParameters(Parameters)
6498 ## Add material to a solid by extrusion of the base shape on the given distance.
6499 # @param theInit Shape to add material to. It must be a solid or
6500 # a compound made of a single solid.
6501 # @param theBase Closed edge or wire defining the base shape to be extruded.
6502 # @param theH Prism dimension along the normal to theBase
6503 # @param theAngle Draft angle in degrees.
6504 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6506 # @ref tui_creation_prism "Example"
6507 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6509 Add material to a solid by extrusion of the base shape on the given distance.
6512 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6513 theBase Closed edge or wire defining the base shape to be extruded.
6514 theH Prism dimension along the normal to theBase
6515 theAngle Draft angle in degrees.
6518 New GEOM.GEOM_Object, containing the initial shape with added material.
6520 # Example: see GEOM_TestAll.py
6521 #theH,Parameters = ParseParameters(theH)
6522 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6523 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6524 #anObj.SetParameters(Parameters)
6530 ## @addtogroup l3_basic_op
6533 ## Perform an Archimde operation on the given shape with given parameters.
6534 # The object presenting the resulting face is returned.
6535 # @param theShape Shape to be put in water.
6536 # @param theWeight Weight og the shape.
6537 # @param theWaterDensity Density of the water.
6538 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6539 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6540 # by a plane, corresponding to water level.
6542 # @ref tui_archimede "Example"
6543 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6545 Perform an Archimde operation on the given shape with given parameters.
6546 The object presenting the resulting face is returned.
6549 theShape Shape to be put in water.
6550 theWeight Weight og the shape.
6551 theWaterDensity Density of the water.
6552 theMeshDeflection Deflection of the mesh, using to compute the section.
6555 New GEOM.GEOM_Object, containing a section of theShape
6556 by a plane, corresponding to water level.
6558 # Example: see GEOM_TestAll.py
6559 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6560 theWeight,theWaterDensity,theMeshDeflection)
6561 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6562 RaiseIfFailed("MakeArchimede", self.LocalOp)
6563 anObj.SetParameters(Parameters)
6566 # end of l3_basic_op
6569 ## @addtogroup l2_measure
6572 ## Get point coordinates
6575 # @ref tui_measurement_tools_page "Example"
6576 def PointCoordinates(self,Point):
6578 Get point coordinates
6583 # Example: see GEOM_TestMeasures.py
6584 aTuple = self.MeasuOp.PointCoordinates(Point)
6585 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6588 ## Get summarized length of all wires,
6589 # area of surface and volume of the given shape.
6590 # @param theShape Shape to define properties of.
6591 # @return [theLength, theSurfArea, theVolume]\n
6592 # theLength: Summarized length of all wires of the given shape.\n
6593 # theSurfArea: Area of surface of the given shape.\n
6594 # theVolume: Volume of the given shape.
6596 # @ref tui_measurement_tools_page "Example"
6597 def BasicProperties(self,theShape):
6599 Get summarized length of all wires,
6600 area of surface and volume of the given shape.
6603 theShape Shape to define properties of.
6606 [theLength, theSurfArea, theVolume]
6607 theLength: Summarized length of all wires of the given shape.
6608 theSurfArea: Area of surface of the given shape.
6609 theVolume: Volume of the given shape.
6611 # Example: see GEOM_TestMeasures.py
6612 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6613 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6616 ## Get parameters of bounding box of the given shape
6617 # @param theShape Shape to obtain bounding box of.
6618 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6619 # Xmin,Xmax: Limits of shape along OX axis.
6620 # Ymin,Ymax: Limits of shape along OY axis.
6621 # Zmin,Zmax: Limits of shape along OZ axis.
6623 # @ref tui_measurement_tools_page "Example"
6624 def BoundingBox(self,theShape):
6626 Get parameters of bounding box of the given shape
6629 theShape Shape to obtain bounding box of.
6632 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6633 Xmin,Xmax: Limits of shape along OX axis.
6634 Ymin,Ymax: Limits of shape along OY axis.
6635 Zmin,Zmax: Limits of shape along OZ axis.
6637 # Example: see GEOM_TestMeasures.py
6638 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6639 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6642 ## Get inertia matrix and moments of inertia of theShape.
6643 # @param theShape Shape to calculate inertia of.
6644 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6645 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6646 # Ix,Iy,Iz: Moments of inertia of the given shape.
6648 # @ref tui_measurement_tools_page "Example"
6649 def Inertia(self,theShape):
6651 Get inertia matrix and moments of inertia of theShape.
6654 theShape Shape to calculate inertia of.
6657 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6658 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6659 Ix,Iy,Iz: Moments of inertia of the given shape.
6661 # Example: see GEOM_TestMeasures.py
6662 aTuple = self.MeasuOp.GetInertia(theShape)
6663 RaiseIfFailed("GetInertia", self.MeasuOp)
6666 ## Get if coords are included in the shape (ST_IN or ST_ON)
6667 # @param theShape Shape
6668 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6669 # @param tolerance to be used (default is 1.0e-7)
6670 # @return list_of_boolean = [res1, res2, ...]
6671 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6673 Get if coords are included in the shape (ST_IN or ST_ON)
6677 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6678 tolerance to be used (default is 1.0e-7)
6681 list_of_boolean = [res1, res2, ...]
6683 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6685 ## Get minimal distance between the given shapes.
6686 # @param theShape1,theShape2 Shapes to find minimal distance between.
6687 # @return Value of the minimal distance between the given shapes.
6689 # @ref tui_measurement_tools_page "Example"
6690 def MinDistance(self, theShape1, theShape2):
6692 Get minimal distance between the given shapes.
6695 theShape1,theShape2 Shapes to find minimal distance between.
6698 Value of the minimal distance between the given shapes.
6700 # Example: see GEOM_TestMeasures.py
6701 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6702 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6705 ## Get minimal distance between the given shapes.
6706 # @param theShape1,theShape2 Shapes to find minimal distance between.
6707 # @return Value of the minimal distance between the given shapes.
6709 # @ref swig_all_measure "Example"
6710 def MinDistanceComponents(self, theShape1, theShape2):
6712 Get minimal distance between the given shapes.
6715 theShape1,theShape2 Shapes to find minimal distance between.
6718 Value of the minimal distance between the given shapes.
6720 # Example: see GEOM_TestMeasures.py
6721 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6722 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6723 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6726 ## Get angle between the given shapes in degrees.
6727 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6728 # @note If both arguments are vectors, the angle is computed in accordance
6729 # with their orientations, otherwise the minimum angle is computed.
6730 # @return Value of the angle between the given shapes in degrees.
6732 # @ref tui_measurement_tools_page "Example"
6733 def GetAngle(self, theShape1, theShape2):
6735 Get angle between the given shapes in degrees.
6738 theShape1,theShape2 Lines or linear edges to find angle between.
6741 If both arguments are vectors, the angle is computed in accordance
6742 with their orientations, otherwise the minimum angle is computed.
6745 Value of the angle between the given shapes in degrees.
6747 # Example: see GEOM_TestMeasures.py
6748 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6749 RaiseIfFailed("GetAngle", self.MeasuOp)
6752 ## Get angle between the given shapes in radians.
6753 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6754 # @note If both arguments are vectors, the angle is computed in accordance
6755 # with their orientations, otherwise the minimum angle is computed.
6756 # @return Value of the angle between the given shapes in radians.
6758 # @ref tui_measurement_tools_page "Example"
6759 def GetAngleRadians(self, theShape1, theShape2):
6761 Get angle between the given shapes in radians.
6764 theShape1,theShape2 Lines or linear edges to find angle between.
6768 If both arguments are vectors, the angle is computed in accordance
6769 with their orientations, otherwise the minimum angle is computed.
6772 Value of the angle between the given shapes in radians.
6774 # Example: see GEOM_TestMeasures.py
6775 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6776 RaiseIfFailed("GetAngle", self.MeasuOp)
6779 ## Get angle between the given vectors in degrees.
6780 # @param theShape1,theShape2 Vectors to find angle between.
6781 # @param theFlag If True, the normal vector is defined by the two vectors cross,
6782 # if False, the opposite vector to the normal vector is used.
6783 # @return Value of the angle between the given vectors in degrees.
6785 # @ref tui_measurement_tools_page "Example"
6786 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6788 Get angle between the given vectors in degrees.
6791 theShape1,theShape2 Vectors to find angle between.
6792 theFlag If True, the normal vector is defined by the two vectors cross,
6793 if False, the opposite vector to the normal vector is used.
6796 Value of the angle between the given vectors in degrees.
6798 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6800 anAngle = 360. - anAngle
6801 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6804 ## The same as GetAngleVectors, but the result is in radians.
6805 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6807 Get angle between the given vectors in radians.
6810 theShape1,theShape2 Vectors to find angle between.
6811 theFlag If True, the normal vector is defined by the two vectors cross,
6812 if False, the opposite vector to the normal vector is used.
6815 Value of the angle between the given vectors in radians.
6817 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6820 ## @name Curve Curvature Measurement
6821 # Methods for receiving radius of curvature of curves
6822 # in the given point
6825 ## Measure curvature of a curve at a point, set by parameter.
6826 # @param theCurve a curve.
6827 # @param theParam parameter.
6828 # @return radius of curvature of \a theCurve.
6830 # @ref swig_todo "Example"
6831 def CurveCurvatureByParam(self, theCurve, theParam):
6833 Measure curvature of a curve at a point, set by parameter.
6840 radius of curvature of theCurve.
6842 # Example: see GEOM_TestMeasures.py
6843 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6844 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6847 ## Measure curvature of a curve at a point.
6848 # @param theCurve a curve.
6849 # @param thePoint given point.
6850 # @return radius of curvature of \a theCurve.
6852 # @ref swig_todo "Example"
6853 def CurveCurvatureByPoint(self, theCurve, thePoint):
6855 Measure curvature of a curve at a point.
6859 thePoint given point.
6862 radius of curvature of theCurve.
6864 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6865 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6869 ## @name Surface Curvature Measurement
6870 # Methods for receiving max and min radius of curvature of surfaces
6871 # in the given point
6874 ## Measure max radius of curvature of surface.
6875 # @param theSurf the given surface.
6876 # @param theUParam Value of U-parameter on the referenced surface.
6877 # @param theVParam Value of V-parameter on the referenced surface.
6878 # @return max radius of curvature of theSurf.
6880 ## @ref swig_todo "Example"
6881 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6883 Measure max radius of curvature of surface.
6886 theSurf the given surface.
6887 theUParam Value of U-parameter on the referenced surface.
6888 theVParam Value of V-parameter on the referenced surface.
6891 max radius of curvature of theSurf.
6893 # Example: see GEOM_TestMeasures.py
6894 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6895 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6898 ## Measure max radius of curvature of surface in the given point
6899 # @param theSurf the given surface.
6900 # @param thePoint given point.
6901 # @return max radius of curvature of theSurf.
6903 ## @ref swig_todo "Example"
6904 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6906 Measure max radius of curvature of surface in the given point.
6909 theSurf the given surface.
6910 thePoint given point.
6913 max radius of curvature of theSurf.
6915 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6916 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6919 ## Measure min radius of curvature of surface.
6920 # @param theSurf the given surface.
6921 # @param theUParam Value of U-parameter on the referenced surface.
6922 # @param theVParam Value of V-parameter on the referenced surface.
6923 # @return min radius of curvature of theSurf.
6925 ## @ref swig_todo "Example"
6926 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6928 Measure min radius of curvature of surface.
6931 theSurf the given surface.
6932 theUParam Value of U-parameter on the referenced surface.
6933 theVParam Value of V-parameter on the referenced surface.
6936 Min radius of curvature of theSurf.
6938 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6939 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6942 ## Measure min radius of curvature of surface in the given point
6943 # @param theSurf the given surface.
6944 # @param thePoint given point.
6945 # @return min radius of curvature of theSurf.
6947 ## @ref swig_todo "Example"
6948 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6950 Measure min radius of curvature of surface in the given point.
6953 theSurf the given surface.
6954 thePoint given point.
6957 Min radius of curvature of theSurf.
6959 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6960 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6964 ## Get min and max tolerances of sub-shapes of theShape
6965 # @param theShape Shape, to get tolerances of.
6966 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6967 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
6968 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6969 # VertMin,VertMax: Min and max tolerances of the vertices.
6971 # @ref tui_measurement_tools_page "Example"
6972 def Tolerance(self,theShape):
6974 Get min and max tolerances of sub-shapes of theShape
6977 theShape Shape, to get tolerances of.
6980 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6981 FaceMin,FaceMax: Min and max tolerances of the faces.
6982 EdgeMin,EdgeMax: Min and max tolerances of the edges.
6983 VertMin,VertMax: Min and max tolerances of the vertices.
6985 # Example: see GEOM_TestMeasures.py
6986 aTuple = self.MeasuOp.GetTolerance(theShape)
6987 RaiseIfFailed("GetTolerance", self.MeasuOp)
6990 ## Obtain description of the given shape (number of sub-shapes of each type)
6991 # @param theShape Shape to be described.
6992 # @return Description of the given shape.
6994 # @ref tui_measurement_tools_page "Example"
6995 def WhatIs(self,theShape):
6997 Obtain description of the given shape (number of sub-shapes of each type)
7000 theShape Shape to be described.
7003 Description of the given shape.
7005 # Example: see GEOM_TestMeasures.py
7006 aDescr = self.MeasuOp.WhatIs(theShape)
7007 RaiseIfFailed("WhatIs", self.MeasuOp)
7010 ## Obtain quantity of shapes of the given type in \a theShape.
7011 # If \a theShape is of type \a theType, it is also counted.
7012 # @param theShape Shape to be described.
7013 # @param theType the given ShapeType().
7014 # @return Quantity of shapes of type \a theType in \a theShape.
7016 # @ref tui_measurement_tools_page "Example"
7017 def NbShapes (self, theShape, theType):
7019 Obtain quantity of shapes of the given type in theShape.
7020 If theShape is of type theType, it is also counted.
7023 theShape Shape to be described.
7024 theType the given geompy.ShapeType
7027 Quantity of shapes of type theType in theShape.
7029 # Example: see GEOM_TestMeasures.py
7030 listSh = self.SubShapeAllIDs(theShape, theType)
7032 t = EnumToLong(theShape.GetShapeType())
7033 theType = EnumToLong(theType)
7039 ## Obtain quantity of shapes of each type in \a theShape.
7040 # The \a theShape is also counted.
7041 # @param theShape Shape to be described.
7042 # @return Dictionary of ShapeType() with bound quantities of shapes.
7044 # @ref tui_measurement_tools_page "Example"
7045 def ShapeInfo (self, theShape):
7047 Obtain quantity of shapes of each type in theShape.
7048 The theShape is also counted.
7051 theShape Shape to be described.
7054 Dictionary of geompy.ShapeType with bound quantities of shapes.
7056 # Example: see GEOM_TestMeasures.py
7058 for typeSh in ShapeType:
7059 if typeSh in ( "AUTO", "SHAPE" ): continue
7060 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
7062 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
7069 ## Get a point, situated at the centre of mass of theShape.
7070 # @param theShape Shape to define centre of mass of.
7071 # @return New GEOM.GEOM_Object, containing the created point.
7073 # @ref tui_measurement_tools_page "Example"
7074 def MakeCDG(self,theShape):
7076 Get a point, situated at the centre of mass of theShape.
7079 theShape Shape to define centre of mass of.
7082 New GEOM.GEOM_Object, containing the created point.
7084 # Example: see GEOM_TestMeasures.py
7085 anObj = self.MeasuOp.GetCentreOfMass(theShape)
7086 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
7089 ## Get a vertex sub-shape by index depended with orientation.
7090 # @param theShape Shape to find sub-shape.
7091 # @param theIndex Index to find vertex by this index (starting from zero)
7092 # @return New GEOM.GEOM_Object, containing the created vertex.
7094 # @ref tui_measurement_tools_page "Example"
7095 def GetVertexByIndex(self,theShape, theIndex):
7097 Get a vertex sub-shape by index depended with orientation.
7100 theShape Shape to find sub-shape.
7101 theIndex Index to find vertex by this index (starting from zero)
7104 New GEOM.GEOM_Object, containing the created vertex.
7106 # Example: see GEOM_TestMeasures.py
7107 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
7108 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
7111 ## Get the first vertex of wire/edge depended orientation.
7112 # @param theShape Shape to find first vertex.
7113 # @return New GEOM.GEOM_Object, containing the created vertex.
7115 # @ref tui_measurement_tools_page "Example"
7116 def GetFirstVertex(self,theShape):
7118 Get the first vertex of wire/edge depended orientation.
7121 theShape Shape to find first vertex.
7124 New GEOM.GEOM_Object, containing the created vertex.
7126 # Example: see GEOM_TestMeasures.py
7127 anObj = self.GetVertexByIndex(theShape, 0)
7128 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7131 ## Get the last vertex of wire/edge depended orientation.
7132 # @param theShape Shape to find last vertex.
7133 # @return New GEOM.GEOM_Object, containing the created vertex.
7135 # @ref tui_measurement_tools_page "Example"
7136 def GetLastVertex(self,theShape):
7138 Get the last vertex of wire/edge depended orientation.
7141 theShape Shape to find last vertex.
7144 New GEOM.GEOM_Object, containing the created vertex.
7146 # Example: see GEOM_TestMeasures.py
7147 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7148 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7149 RaiseIfFailed("GetLastVertex", self.MeasuOp)
7152 ## Get a normale to the given face. If the point is not given,
7153 # the normale is calculated at the center of mass.
7154 # @param theFace Face to define normale of.
7155 # @param theOptionalPoint Point to compute the normale at.
7156 # @return New GEOM.GEOM_Object, containing the created vector.
7158 # @ref swig_todo "Example"
7159 def GetNormal(self, theFace, theOptionalPoint = None):
7161 Get a normale to the given face. If the point is not given,
7162 the normale is calculated at the center of mass.
7165 theFace Face to define normale of.
7166 theOptionalPoint Point to compute the normale at.
7169 New GEOM.GEOM_Object, containing the created vector.
7171 # Example: see GEOM_TestMeasures.py
7172 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7173 RaiseIfFailed("GetNormal", self.MeasuOp)
7176 ## Check a topology of the given shape.
7177 # @param theShape Shape to check validity of.
7178 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7179 # if TRUE, the shape's geometry will be checked also.
7180 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7181 # of problem is printed.
7182 # if TRUE and if theShape is invalid, the description
7183 # of problem is also returned.
7184 # @return TRUE, if the shape "seems to be valid".
7186 # @ref tui_measurement_tools_page "Example"
7187 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7189 Check a topology of the given shape.
7192 theShape Shape to check validity of.
7193 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7194 if TRUE, the shape's geometry will be checked also.
7195 theReturnStatus If FALSE and if theShape is invalid, a description
7196 of problem is printed.
7197 if TRUE and if theShape is invalid, the description
7198 of problem is returned.
7201 TRUE, if the shape "seems to be valid".
7202 If theShape is invalid, prints a description of problem.
7203 This description can also be returned.
7205 # Example: see GEOM_TestMeasures.py
7207 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7208 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7210 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7211 RaiseIfFailed("CheckShape", self.MeasuOp)
7213 if theReturnStatus == 0:
7215 if theReturnStatus == 1:
7216 return (IsValid, Status)
7219 ## Detect self-intersections in the given shape.
7220 # @param theShape Shape to check.
7221 # @return TRUE, if the shape contains no self-intersections.
7223 # @ref tui_measurement_tools_page "Example"
7224 def CheckSelfIntersections(self, theShape):
7226 Detect self-intersections in the given shape.
7229 theShape Shape to check.
7232 TRUE, if the shape contains no self-intersections.
7234 # Example: see GEOM_TestMeasures.py
7235 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7236 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7239 ## Get position (LCS) of theShape.
7241 # Origin of the LCS is situated at the shape's center of mass.
7242 # Axes of the LCS are obtained from shape's location or,
7243 # if the shape is a planar face, from position of its plane.
7245 # @param theShape Shape to calculate position of.
7246 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7247 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
7248 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7249 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7251 # @ref swig_todo "Example"
7252 def GetPosition(self,theShape):
7254 Get position (LCS) of theShape.
7255 Origin of the LCS is situated at the shape's center of mass.
7256 Axes of the LCS are obtained from shape's location or,
7257 if the shape is a planar face, from position of its plane.
7260 theShape Shape to calculate position of.
7263 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7264 Ox,Oy,Oz: Coordinates of shape's LCS origin.
7265 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7266 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7268 # Example: see GEOM_TestMeasures.py
7269 aTuple = self.MeasuOp.GetPosition(theShape)
7270 RaiseIfFailed("GetPosition", self.MeasuOp)
7273 ## Get kind of theShape.
7275 # @param theShape Shape to get a kind of.
7276 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7277 # and a list of parameters, describing the shape.
7278 # @note Concrete meaning of each value, returned via \a theIntegers
7279 # or \a theDoubles list depends on the kind() of the shape.
7281 # @ref swig_todo "Example"
7282 def KindOfShape(self,theShape):
7284 Get kind of theShape.
7287 theShape Shape to get a kind of.
7290 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7291 and a list of parameters, describing the shape.
7293 Concrete meaning of each value, returned via theIntegers
7294 or theDoubles list depends on the geompy.kind of the shape
7296 # Example: see GEOM_TestMeasures.py
7297 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7298 RaiseIfFailed("KindOfShape", self.MeasuOp)
7300 aKind = aRoughTuple[0]
7301 anInts = aRoughTuple[1]
7302 aDbls = aRoughTuple[2]
7304 # Now there is no exception from this rule:
7305 aKindTuple = [aKind] + aDbls + anInts
7307 # If they are we will regroup parameters for such kind of shape.
7309 #if aKind == kind.SOME_KIND:
7310 # # SOME_KIND int int double int double double
7311 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7318 ## @addtogroup l2_import_export
7321 ## Import a shape from the BREP or IGES or STEP file
7322 # (depends on given format) with given name.
7323 # @param theFileName The file, containing the shape.
7324 # @param theFormatName Specify format for the file reading.
7325 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7326 # If format 'IGES_SCALE' is used instead of 'IGES' or
7327 # format 'STEP_SCALE' is used instead of 'STEP',
7328 # length unit will be set to 'meter' and result model will be scaled.
7329 # @return New GEOM.GEOM_Object, containing the imported shape.
7331 # @ref swig_Import_Export "Example"
7332 def ImportFile(self, theFileName, theFormatName):
7334 Import a shape from the BREP or IGES or STEP file
7335 (depends on given format) with given name.
7338 theFileName The file, containing the shape.
7339 theFormatName Specify format for the file reading.
7340 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7341 If format 'IGES_SCALE' is used instead of 'IGES' or
7342 format 'STEP_SCALE' is used instead of 'STEP',
7343 length unit will be set to 'meter' and result model will be scaled.
7346 New GEOM.GEOM_Object, containing the imported shape.
7348 # Example: see GEOM_TestOthers.py
7349 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7350 RaiseIfFailed("Import", self.InsertOp)
7353 ## Deprecated analog of ImportFile()
7354 def Import(self, theFileName, theFormatName):
7356 Deprecated analog of geompy.ImportFile
7358 print "WARNING: Function Import is deprecated, use ImportFile instead"
7359 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7360 RaiseIfFailed("Import", self.InsertOp)
7363 ## Shortcut to ImportFile() for BREP format.
7364 # Import a shape from the BREP file with given name.
7365 # @param theFileName The file, containing the shape.
7366 # @return New GEOM.GEOM_Object, containing the imported shape.
7368 # @ref swig_Import_Export "Example"
7369 def ImportBREP(self, theFileName):
7371 geompy.ImportFile(...) function for BREP format
7372 Import a shape from the BREP file with given name.
7375 theFileName The file, containing the shape.
7378 New GEOM.GEOM_Object, containing the imported shape.
7380 # Example: see GEOM_TestOthers.py
7381 return self.ImportFile(theFileName, "BREP")
7383 ## Shortcut to ImportFile() for IGES format
7384 # Import a shape from the IGES file with given name.
7385 # @param theFileName The file, containing the shape.
7386 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7387 # and result model will be scaled, if its units are not meters.
7388 # If False (default), file length units will be taken into account.
7389 # @return New GEOM.GEOM_Object, containing the imported shape.
7391 # @ref swig_Import_Export "Example"
7392 def ImportIGES(self, theFileName, ignoreUnits = False):
7394 geompy.ImportFile(...) function for IGES format
7397 theFileName The file, containing the shape.
7398 ignoreUnits If True, file length units will be ignored (set to 'meter')
7399 and result model will be scaled, if its units are not meters.
7400 If False (default), file length units will be taken into account.
7403 New GEOM.GEOM_Object, containing the imported shape.
7405 # Example: see GEOM_TestOthers.py
7407 return self.ImportFile(theFileName, "IGES_SCALE")
7408 return self.ImportFile(theFileName, "IGES")
7410 ## Return length unit from given IGES file
7411 # @param theFileName The file, containing the shape.
7412 # @return String, containing the units name.
7414 # @ref swig_Import_Export "Example"
7415 def GetIGESUnit(self, theFileName):
7417 Return length units from given IGES file
7420 theFileName The file, containing the shape.
7423 String, containing the units name.
7425 # Example: see GEOM_TestOthers.py
7426 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
7429 ## Shortcut to ImportFile() for STEP format
7430 # Import a shape from the STEP file with given name.
7431 # @param theFileName The file, containing the shape.
7432 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7433 # and result model will be scaled, if its units are not meters.
7434 # If False (default), file length units will be taken into account.
7435 # @return New GEOM.GEOM_Object, containing the imported shape.
7437 # @ref swig_Import_Export "Example"
7438 def ImportSTEP(self, theFileName, ignoreUnits = False):
7440 geompy.ImportFile(...) function for STEP format
7443 theFileName The file, containing the shape.
7444 ignoreUnits If True, file length units will be ignored (set to 'meter')
7445 and result model will be scaled, if its units are not meters.
7446 If False (default), file length units will be taken into account.
7449 New GEOM.GEOM_Object, containing the imported shape.
7451 # Example: see GEOM_TestOthers.py
7453 return self.ImportFile(theFileName, "STEP_SCALE")
7454 return self.ImportFile(theFileName, "STEP")
7456 ## Return length unit from given IGES or STEP file
7457 # @param theFileName The file, containing the shape.
7458 # @return String, containing the units name.
7460 # @ref swig_Import_Export "Example"
7461 def GetSTEPUnit(self, theFileName):
7463 Return length units from given STEP file
7466 theFileName The file, containing the shape.
7469 String, containing the units name.
7471 # Example: see GEOM_TestOthers.py
7472 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
7475 ## Read a shape from the binary stream, containing its bounding representation (BRep).
7476 # @note This method will not be dumped to the python script by DumpStudy functionality.
7477 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
7478 # @param theStream The BRep binary stream.
7479 # @return New GEOM_Object, containing the shape, read from theStream.
7481 # @ref swig_Import_Export "Example"
7482 def RestoreShape (self, theStream):
7484 Read a shape from the binary stream, containing its bounding representation (BRep).
7487 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
7490 theStream The BRep binary stream.
7493 New GEOM_Object, containing the shape, read from theStream.
7495 # Example: see GEOM_TestOthers.py
7496 anObj = self.InsertOp.RestoreShape(theStream)
7497 RaiseIfFailed("RestoreShape", self.InsertOp)
7500 ## Export the given shape into a file with given name.
7501 # @param theObject Shape to be stored in the file.
7502 # @param theFileName Name of the file to store the given shape in.
7503 # @param theFormatName Specify format for the shape storage.
7504 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7506 # @ref swig_Import_Export "Example"
7507 def Export(self, theObject, theFileName, theFormatName):
7509 Export the given shape into a file with given name.
7512 theObject Shape to be stored in the file.
7513 theFileName Name of the file to store the given shape in.
7514 theFormatName Specify format for the shape storage.
7515 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7517 # Example: see GEOM_TestOthers.py
7518 self.InsertOp.Export(theObject, theFileName, theFormatName)
7519 if self.InsertOp.IsDone() == 0:
7520 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7524 ## Shortcut to Export() for BREP format
7526 # @ref swig_Import_Export "Example"
7527 def ExportBREP(self,theObject, theFileName):
7529 geompy.Export(...) function for BREP format
7531 # Example: see GEOM_TestOthers.py
7532 return self.Export(theObject, theFileName, "BREP")
7534 ## Shortcut to Export() for IGES format
7536 # @ref swig_Import_Export "Example"
7537 def ExportIGES(self,theObject, theFileName):
7539 geompy.Export(...) function for IGES format
7541 # Example: see GEOM_TestOthers.py
7542 return self.Export(theObject, theFileName, "IGES")
7544 ## Shortcut to Export() for STEP format
7546 # @ref swig_Import_Export "Example"
7547 def ExportSTEP(self,theObject, theFileName):
7549 geompy.Export(...) function for STEP format
7551 # Example: see GEOM_TestOthers.py
7552 return self.Export(theObject, theFileName, "STEP")
7554 # end of l2_import_export
7557 ## @addtogroup l3_blocks
7560 ## Create a quadrangle face from four edges. Order of Edges is not
7561 # important. It is not necessary that edges share the same vertex.
7562 # @param E1,E2,E3,E4 Edges for the face bound.
7563 # @return New GEOM.GEOM_Object, containing the created face.
7565 # @ref tui_building_by_blocks_page "Example"
7566 def MakeQuad(self,E1, E2, E3, E4):
7568 Create a quadrangle face from four edges. Order of Edges is not
7569 important. It is not necessary that edges share the same vertex.
7572 E1,E2,E3,E4 Edges for the face bound.
7575 New GEOM.GEOM_Object, containing the created face.
7578 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7580 # Example: see GEOM_Spanner.py
7581 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7582 RaiseIfFailed("MakeQuad", self.BlocksOp)
7585 ## Create a quadrangle face on two edges.
7586 # The missing edges will be built by creating the shortest ones.
7587 # @param E1,E2 Two opposite edges for the face.
7588 # @return New GEOM.GEOM_Object, containing the created face.
7590 # @ref tui_building_by_blocks_page "Example"
7591 def MakeQuad2Edges(self,E1, E2):
7593 Create a quadrangle face on two edges.
7594 The missing edges will be built by creating the shortest ones.
7597 E1,E2 Two opposite edges for the face.
7600 New GEOM.GEOM_Object, containing the created face.
7604 p1 = geompy.MakeVertex( 0., 0., 0.)
7605 p2 = geompy.MakeVertex(150., 30., 0.)
7606 p3 = geompy.MakeVertex( 0., 120., 50.)
7607 p4 = geompy.MakeVertex( 0., 40., 70.)
7609 edge1 = geompy.MakeEdge(p1, p2)
7610 edge2 = geompy.MakeEdge(p3, p4)
7611 # create a quadrangle face from two edges
7612 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7614 # Example: see GEOM_Spanner.py
7615 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7616 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7619 ## Create a quadrangle face with specified corners.
7620 # The missing edges will be built by creating the shortest ones.
7621 # @param V1,V2,V3,V4 Corner vertices for the face.
7622 # @return New GEOM.GEOM_Object, containing the created face.
7624 # @ref tui_building_by_blocks_page "Example 1"
7625 # \n @ref swig_MakeQuad4Vertices "Example 2"
7626 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7628 Create a quadrangle face with specified corners.
7629 The missing edges will be built by creating the shortest ones.
7632 V1,V2,V3,V4 Corner vertices for the face.
7635 New GEOM.GEOM_Object, containing the created face.
7639 p1 = geompy.MakeVertex( 0., 0., 0.)
7640 p2 = geompy.MakeVertex(150., 30., 0.)
7641 p3 = geompy.MakeVertex( 0., 120., 50.)
7642 p4 = geompy.MakeVertex( 0., 40., 70.)
7643 # create a quadrangle from four points in its corners
7644 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7646 # Example: see GEOM_Spanner.py
7647 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7648 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7651 ## Create a hexahedral solid, bounded by the six given faces. Order of
7652 # faces is not important. It is not necessary that Faces share the same edge.
7653 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7654 # @return New GEOM.GEOM_Object, containing the created solid.
7656 # @ref tui_building_by_blocks_page "Example 1"
7657 # \n @ref swig_MakeHexa "Example 2"
7658 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7660 Create a hexahedral solid, bounded by the six given faces. Order of
7661 faces is not important. It is not necessary that Faces share the same edge.
7664 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7667 New GEOM.GEOM_Object, containing the created solid.
7670 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7672 # Example: see GEOM_Spanner.py
7673 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7674 RaiseIfFailed("MakeHexa", self.BlocksOp)
7677 ## Create a hexahedral solid between two given faces.
7678 # The missing faces will be built by creating the smallest ones.
7679 # @param F1,F2 Two opposite faces for the hexahedral solid.
7680 # @return New GEOM.GEOM_Object, containing the created solid.
7682 # @ref tui_building_by_blocks_page "Example 1"
7683 # \n @ref swig_MakeHexa2Faces "Example 2"
7684 def MakeHexa2Faces(self,F1, F2):
7686 Create a hexahedral solid between two given faces.
7687 The missing faces will be built by creating the smallest ones.
7690 F1,F2 Two opposite faces for the hexahedral solid.
7693 New GEOM.GEOM_Object, containing the created solid.
7696 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7698 # Example: see GEOM_Spanner.py
7699 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7700 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7706 ## @addtogroup l3_blocks_op
7709 ## Get a vertex, found in the given shape by its coordinates.
7710 # @param theShape Block or a compound of blocks.
7711 # @param theX,theY,theZ Coordinates of the sought vertex.
7712 # @param theEpsilon Maximum allowed distance between the resulting
7713 # vertex and point with the given coordinates.
7714 # @return New GEOM.GEOM_Object, containing the found vertex.
7716 # @ref swig_GetPoint "Example"
7717 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7719 Get a vertex, found in the given shape by its coordinates.
7722 theShape Block or a compound of blocks.
7723 theX,theY,theZ Coordinates of the sought vertex.
7724 theEpsilon Maximum allowed distance between the resulting
7725 vertex and point with the given coordinates.
7728 New GEOM.GEOM_Object, containing the found vertex.
7731 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7733 # Example: see GEOM_TestOthers.py
7734 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7735 RaiseIfFailed("GetPoint", self.BlocksOp)
7738 ## Find a vertex of the given shape, which has minimal distance to the given point.
7739 # @param theShape Any shape.
7740 # @param thePoint Point, close to the desired vertex.
7741 # @return New GEOM.GEOM_Object, containing the found vertex.
7743 # @ref swig_GetVertexNearPoint "Example"
7744 def GetVertexNearPoint(self, theShape, thePoint):
7746 Find a vertex of the given shape, which has minimal distance to the given point.
7750 thePoint Point, close to the desired vertex.
7753 New GEOM.GEOM_Object, containing the found vertex.
7756 pmidle = geompy.MakeVertex(50, 0, 50)
7757 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7759 # Example: see GEOM_TestOthers.py
7760 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7761 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7764 ## Get an edge, found in the given shape by two given vertices.
7765 # @param theShape Block or a compound of blocks.
7766 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7767 # @return New GEOM.GEOM_Object, containing the found edge.
7769 # @ref swig_GetEdge "Example"
7770 def GetEdge(self, theShape, thePoint1, thePoint2):
7772 Get an edge, found in the given shape by two given vertices.
7775 theShape Block or a compound of blocks.
7776 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7779 New GEOM.GEOM_Object, containing the found edge.
7781 # Example: see GEOM_Spanner.py
7782 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7783 RaiseIfFailed("GetEdge", self.BlocksOp)
7786 ## Find an edge of the given shape, which has minimal distance to the given point.
7787 # @param theShape Block or a compound of blocks.
7788 # @param thePoint Point, close to the desired edge.
7789 # @return New GEOM.GEOM_Object, containing the found edge.
7791 # @ref swig_GetEdgeNearPoint "Example"
7792 def GetEdgeNearPoint(self, theShape, thePoint):
7794 Find an edge of the given shape, which has minimal distance to the given point.
7797 theShape Block or a compound of blocks.
7798 thePoint Point, close to the desired edge.
7801 New GEOM.GEOM_Object, containing the found edge.
7803 # Example: see GEOM_TestOthers.py
7804 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7805 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7808 ## Returns a face, found in the given shape by four given corner vertices.
7809 # @param theShape Block or a compound of blocks.
7810 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7811 # @return New GEOM.GEOM_Object, containing the found face.
7813 # @ref swig_todo "Example"
7814 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7816 Returns a face, found in the given shape by four given corner vertices.
7819 theShape Block or a compound of blocks.
7820 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7823 New GEOM.GEOM_Object, containing the found face.
7825 # Example: see GEOM_Spanner.py
7826 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7827 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7830 ## Get a face of block, found in the given shape by two given edges.
7831 # @param theShape Block or a compound of blocks.
7832 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7833 # @return New GEOM.GEOM_Object, containing the found face.
7835 # @ref swig_todo "Example"
7836 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7838 Get a face of block, found in the given shape by two given edges.
7841 theShape Block or a compound of blocks.
7842 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7845 New GEOM.GEOM_Object, containing the found face.
7847 # Example: see GEOM_Spanner.py
7848 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7849 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7852 ## Find a face, opposite to the given one in the given block.
7853 # @param theBlock Must be a hexahedral solid.
7854 # @param theFace Face of \a theBlock, opposite to the desired face.
7855 # @return New GEOM.GEOM_Object, containing the found face.
7857 # @ref swig_GetOppositeFace "Example"
7858 def GetOppositeFace(self,theBlock, theFace):
7860 Find a face, opposite to the given one in the given block.
7863 theBlock Must be a hexahedral solid.
7864 theFace Face of theBlock, opposite to the desired face.
7867 New GEOM.GEOM_Object, containing the found face.
7869 # Example: see GEOM_Spanner.py
7870 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7871 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7874 ## Find a face of the given shape, which has minimal distance to the given point.
7875 # @param theShape Block or a compound of blocks.
7876 # @param thePoint Point, close to the desired face.
7877 # @return New GEOM.GEOM_Object, containing the found face.
7879 # @ref swig_GetFaceNearPoint "Example"
7880 def GetFaceNearPoint(self, theShape, thePoint):
7882 Find a face of the given shape, which has minimal distance to the given point.
7885 theShape Block or a compound of blocks.
7886 thePoint Point, close to the desired face.
7889 New GEOM.GEOM_Object, containing the found face.
7891 # Example: see GEOM_Spanner.py
7892 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7893 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7896 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7897 # @param theBlock Block or a compound of blocks.
7898 # @param theVector Vector, close to the normale of the desired face.
7899 # @return New GEOM.GEOM_Object, containing the found face.
7901 # @ref swig_todo "Example"
7902 def GetFaceByNormale(self, theBlock, theVector):
7904 Find a face of block, whose outside normale has minimal angle with the given vector.
7907 theBlock Block or a compound of blocks.
7908 theVector Vector, close to the normale of the desired face.
7911 New GEOM.GEOM_Object, containing the found face.
7913 # Example: see GEOM_Spanner.py
7914 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7915 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7918 ## Find all sub-shapes of type \a theShapeType of the given shape,
7919 # which have minimal distance to the given point.
7920 # @param theShape Any shape.
7921 # @param thePoint Point, close to the desired shape.
7922 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7923 # @param theTolerance The tolerance for distances comparison. All shapes
7924 # with distances to the given point in interval
7925 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7926 # @return New GEOM_Object, containing a group of all found shapes.
7928 # @ref swig_GetShapesNearPoint "Example"
7929 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7931 Find all sub-shapes of type theShapeType of the given shape,
7932 which have minimal distance to the given point.
7936 thePoint Point, close to the desired shape.
7937 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7938 theTolerance The tolerance for distances comparison. All shapes
7939 with distances to the given point in interval
7940 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7943 New GEOM_Object, containing a group of all found shapes.
7945 # Example: see GEOM_TestOthers.py
7946 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7947 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7950 # end of l3_blocks_op
7953 ## @addtogroup l4_blocks_measure
7956 ## Check, if the compound of blocks is given.
7957 # To be considered as a compound of blocks, the
7958 # given shape must satisfy the following conditions:
7959 # - Each element of the compound should be a Block (6 faces and 12 edges).
7960 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7961 # - The compound should be connexe.
7962 # - The glue between two quadrangle faces should be applied.
7963 # @param theCompound The compound to check.
7964 # @return TRUE, if the given shape is a compound of blocks.
7965 # If theCompound is not valid, prints all discovered errors.
7967 # @ref tui_measurement_tools_page "Example 1"
7968 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
7969 def CheckCompoundOfBlocks(self,theCompound):
7971 Check, if the compound of blocks is given.
7972 To be considered as a compound of blocks, the
7973 given shape must satisfy the following conditions:
7974 - Each element of the compound should be a Block (6 faces and 12 edges).
7975 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7976 - The compound should be connexe.
7977 - The glue between two quadrangle faces should be applied.
7980 theCompound The compound to check.
7983 TRUE, if the given shape is a compound of blocks.
7984 If theCompound is not valid, prints all discovered errors.
7986 # Example: see GEOM_Spanner.py
7987 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7988 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7990 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7994 ## Retrieve all non blocks solids and faces from \a theShape.
7995 # @param theShape The shape to explore.
7996 # @return A tuple of two GEOM_Objects. The first object is a group of all
7997 # non block solids (= not 6 faces, or with 6 faces, but with the
7998 # presence of non-quadrangular faces). The second object is a
7999 # group of all non quadrangular faces.
8001 # @ref tui_measurement_tools_page "Example 1"
8002 # \n @ref swig_GetNonBlocks "Example 2"
8003 def GetNonBlocks (self, theShape):
8005 Retrieve all non blocks solids and faces from theShape.
8008 theShape The shape to explore.
8011 A tuple of two GEOM_Objects. The first object is a group of all
8012 non block solids (= not 6 faces, or with 6 faces, but with the
8013 presence of non-quadrangular faces). The second object is a
8014 group of all non quadrangular faces.
8017 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
8019 # Example: see GEOM_Spanner.py
8020 aTuple = self.BlocksOp.GetNonBlocks(theShape)
8021 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
8024 ## Remove all seam and degenerated edges from \a theShape.
8025 # Unite faces and edges, sharing one surface. It means that
8026 # this faces must have references to one C++ surface object (handle).
8027 # @param theShape The compound or single solid to remove irregular edges from.
8028 # @param doUnionFaces If True, then unite faces. If False (the default value),
8029 # do not unite faces.
8030 # @return Improved shape.
8032 # @ref swig_RemoveExtraEdges "Example"
8033 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
8035 Remove all seam and degenerated edges from theShape.
8036 Unite faces and edges, sharing one surface. It means that
8037 this faces must have references to one C++ surface object (handle).
8040 theShape The compound or single solid to remove irregular edges from.
8041 doUnionFaces If True, then unite faces. If False (the default value),
8047 # Example: see GEOM_TestOthers.py
8048 nbFacesOptimum = -1 # -1 means do not unite faces
8049 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
8050 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
8051 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
8054 ## Check, if the given shape is a blocks compound.
8055 # Fix all detected errors.
8056 # \note Single block can be also fixed by this method.
8057 # @param theShape The compound to check and improve.
8058 # @return Improved compound.
8060 # @ref swig_CheckAndImprove "Example"
8061 def CheckAndImprove(self,theShape):
8063 Check, if the given shape is a blocks compound.
8064 Fix all detected errors.
8067 Single block can be also fixed by this method.
8070 theShape The compound to check and improve.
8075 # Example: see GEOM_TestOthers.py
8076 anObj = self.BlocksOp.CheckAndImprove(theShape)
8077 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
8080 # end of l4_blocks_measure
8083 ## @addtogroup l3_blocks_op
8086 ## Get all the blocks, contained in the given compound.
8087 # @param theCompound The compound to explode.
8088 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
8089 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
8090 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8091 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
8093 # @ref tui_explode_on_blocks "Example 1"
8094 # \n @ref swig_MakeBlockExplode "Example 2"
8095 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
8097 Get all the blocks, contained in the given compound.
8100 theCompound The compound to explode.
8101 theMinNbFaces If solid has lower number of faces, it is not a block.
8102 theMaxNbFaces If solid has higher number of faces, it is not a block.
8105 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8108 List of GEOM.GEOM_Object, containing the retrieved blocks.
8110 # Example: see GEOM_TestOthers.py
8111 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
8112 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
8113 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
8115 anObj.SetParameters(Parameters)
8119 ## Find block, containing the given point inside its volume or on boundary.
8120 # @param theCompound Compound, to find block in.
8121 # @param thePoint Point, close to the desired block. If the point lays on
8122 # boundary between some blocks, we return block with nearest center.
8123 # @return New GEOM.GEOM_Object, containing the found block.
8125 # @ref swig_todo "Example"
8126 def GetBlockNearPoint(self,theCompound, thePoint):
8128 Find block, containing the given point inside its volume or on boundary.
8131 theCompound Compound, to find block in.
8132 thePoint Point, close to the desired block. If the point lays on
8133 boundary between some blocks, we return block with nearest center.
8136 New GEOM.GEOM_Object, containing the found block.
8138 # Example: see GEOM_Spanner.py
8139 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
8140 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
8143 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8144 # @param theCompound Compound, to find block in.
8145 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
8146 # @return New GEOM.GEOM_Object, containing the found block.
8148 # @ref swig_GetBlockByParts "Example"
8149 def GetBlockByParts(self,theCompound, theParts):
8151 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8154 theCompound Compound, to find block in.
8155 theParts List of faces and/or edges and/or vertices to be parts of the found block.
8158 New GEOM_Object, containing the found block.
8160 # Example: see GEOM_TestOthers.py
8161 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
8162 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
8165 ## Return all blocks, containing all the elements, passed as the parts.
8166 # @param theCompound Compound, to find blocks in.
8167 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8168 # @return List of GEOM.GEOM_Object, containing the found blocks.
8170 # @ref swig_todo "Example"
8171 def GetBlocksByParts(self,theCompound, theParts):
8173 Return all blocks, containing all the elements, passed as the parts.
8176 theCompound Compound, to find blocks in.
8177 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8180 List of GEOM.GEOM_Object, containing the found blocks.
8182 # Example: see GEOM_Spanner.py
8183 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
8184 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
8187 ## Multi-transformate block and glue the result.
8188 # Transformation is defined so, as to superpose direction faces.
8189 # @param Block Hexahedral solid to be multi-transformed.
8190 # @param DirFace1 ID of First direction face.
8191 # @param DirFace2 ID of Second direction face.
8192 # @param NbTimes Quantity of transformations to be done.
8193 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8194 # @return New GEOM.GEOM_Object, containing the result shape.
8196 # @ref tui_multi_transformation "Example"
8197 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
8199 Multi-transformate block and glue the result.
8200 Transformation is defined so, as to superpose direction faces.
8203 Block Hexahedral solid to be multi-transformed.
8204 DirFace1 ID of First direction face.
8205 DirFace2 ID of Second direction face.
8206 NbTimes Quantity of transformations to be done.
8209 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8212 New GEOM.GEOM_Object, containing the result shape.
8214 # Example: see GEOM_Spanner.py
8215 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8216 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8217 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8218 anObj.SetParameters(Parameters)
8221 ## Multi-transformate block and glue the result.
8222 # @param Block Hexahedral solid to be multi-transformed.
8223 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8224 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8225 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
8226 # @return New GEOM.GEOM_Object, containing the result shape.
8228 # @ref tui_multi_transformation "Example"
8229 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8230 DirFace1V, DirFace2V, NbTimesV):
8232 Multi-transformate block and glue the result.
8235 Block Hexahedral solid to be multi-transformed.
8236 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8237 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8238 NbTimesU,NbTimesV Quantity of transformations to be done.
8241 New GEOM.GEOM_Object, containing the result shape.
8243 # Example: see GEOM_Spanner.py
8244 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8245 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8246 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8247 DirFace1V, DirFace2V, NbTimesV)
8248 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8249 anObj.SetParameters(Parameters)
8252 ## Build all possible propagation groups.
8253 # Propagation group is a set of all edges, opposite to one (main)
8254 # edge of this group directly or through other opposite edges.
8255 # Notion of Opposite Edge make sence only on quadrangle face.
8256 # @param theShape Shape to build propagation groups on.
8257 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
8259 # @ref swig_Propagate "Example"
8260 def Propagate(self,theShape):
8262 Build all possible propagation groups.
8263 Propagation group is a set of all edges, opposite to one (main)
8264 edge of this group directly or through other opposite edges.
8265 Notion of Opposite Edge make sence only on quadrangle face.
8268 theShape Shape to build propagation groups on.
8271 List of GEOM.GEOM_Object, each of them is a propagation group.
8273 # Example: see GEOM_TestOthers.py
8274 listChains = self.BlocksOp.Propagate(theShape)
8275 RaiseIfFailed("Propagate", self.BlocksOp)
8278 # end of l3_blocks_op
8281 ## @addtogroup l3_groups
8284 ## Creates a new group which will store sub-shapes of theMainShape
8285 # @param theMainShape is a GEOM object on which the group is selected
8286 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8287 # @return a newly created GEOM group
8289 # @ref tui_working_with_groups_page "Example 1"
8290 # \n @ref swig_CreateGroup "Example 2"
8291 def CreateGroup(self,theMainShape, theShapeType):
8293 Creates a new group which will store sub-shapes of theMainShape
8296 theMainShape is a GEOM object on which the group is selected
8297 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8298 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8301 a newly created GEOM group
8304 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8307 # Example: see GEOM_TestOthers.py
8308 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8309 RaiseIfFailed("CreateGroup", self.GroupOp)
8312 ## Adds a sub-object with ID theSubShapeId to the group
8313 # @param theGroup is a GEOM group to which the new sub-shape is added
8314 # @param theSubShapeID is a sub-shape ID in the main object.
8315 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8317 # @ref tui_working_with_groups_page "Example"
8318 def AddObject(self,theGroup, theSubShapeID):
8320 Adds a sub-object with ID theSubShapeId to the group
8323 theGroup is a GEOM group to which the new sub-shape is added
8324 theSubShapeID is a sub-shape ID in the main object.
8327 Use method GetSubShapeID() to get an unique ID of the sub-shape
8329 # Example: see GEOM_TestOthers.py
8330 self.GroupOp.AddObject(theGroup, theSubShapeID)
8331 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8332 RaiseIfFailed("AddObject", self.GroupOp)
8336 ## Removes a sub-object with ID \a theSubShapeId from the group
8337 # @param theGroup is a GEOM group from which the new sub-shape is removed
8338 # @param theSubShapeID is a sub-shape ID in the main object.
8339 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8341 # @ref tui_working_with_groups_page "Example"
8342 def RemoveObject(self,theGroup, theSubShapeID):
8344 Removes a sub-object with ID theSubShapeId from the group
8347 theGroup is a GEOM group from which the new sub-shape is removed
8348 theSubShapeID is a sub-shape ID in the main object.
8351 Use method GetSubShapeID() to get an unique ID of the sub-shape
8353 # Example: see GEOM_TestOthers.py
8354 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8355 RaiseIfFailed("RemoveObject", self.GroupOp)
8358 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8359 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8360 # @param theSubShapes is a list of sub-shapes to be added.
8362 # @ref tui_working_with_groups_page "Example"
8363 def UnionList (self,theGroup, theSubShapes):
8365 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8368 theGroup is a GEOM group to which the new sub-shapes are added.
8369 theSubShapes is a list of sub-shapes to be added.
8371 # Example: see GEOM_TestOthers.py
8372 self.GroupOp.UnionList(theGroup, theSubShapes)
8373 RaiseIfFailed("UnionList", self.GroupOp)
8376 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8377 # @param theGroup is a GEOM group to which the new sub-shapes are added.
8378 # @param theSubShapes is a list of indices of sub-shapes to be added.
8380 # @ref swig_UnionIDs "Example"
8381 def UnionIDs(self,theGroup, theSubShapes):
8383 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8386 theGroup is a GEOM group to which the new sub-shapes are added.
8387 theSubShapes is a list of indices of sub-shapes to be added.
8389 # Example: see GEOM_TestOthers.py
8390 self.GroupOp.UnionIDs(theGroup, theSubShapes)
8391 RaiseIfFailed("UnionIDs", self.GroupOp)
8394 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8395 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8396 # @param theSubShapes is a list of sub-shapes to be removed.
8398 # @ref tui_working_with_groups_page "Example"
8399 def DifferenceList (self,theGroup, theSubShapes):
8401 Removes from the group all the given shapes. No errors, if some shapes are not included.
8404 theGroup is a GEOM group from which the sub-shapes are removed.
8405 theSubShapes is a list of sub-shapes to be removed.
8407 # Example: see GEOM_TestOthers.py
8408 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8409 RaiseIfFailed("DifferenceList", self.GroupOp)
8412 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8413 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8414 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8416 # @ref swig_DifferenceIDs "Example"
8417 def DifferenceIDs(self,theGroup, theSubShapes):
8419 Removes from the group all the given shapes. No errors, if some shapes are not included.
8422 theGroup is a GEOM group from which the sub-shapes are removed.
8423 theSubShapes is a list of indices of sub-shapes to be removed.
8425 # Example: see GEOM_TestOthers.py
8426 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8427 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8430 ## Union of two groups.
8431 # New group is created. It will contain all entities
8432 # which are present in groups theGroup1 and theGroup2.
8433 # @param theGroup1, theGroup2 are the initial GEOM groups
8434 # to create the united group from.
8435 # @return a newly created GEOM group.
8436 # @ref tui_union_groups_anchor "Example"
8437 def UnionGroups (self, theGroup1, theGroup2):
8439 Union of two groups.
8440 New group is created. It will contain all entities
8441 which are present in groups theGroup1 and theGroup2.
8444 theGroup1, theGroup2 are the initial GEOM groups
8445 to create the united group from.
8448 a newly created GEOM group.
8450 # Example: see GEOM_TestOthers.py
8451 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
8452 RaiseIfFailed("UnionGroups", self.GroupOp)
8455 ## Intersection of two groups.
8456 # New group is created. It will contain only those entities
8457 # which are present in both groups theGroup1 and theGroup2.
8458 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8459 # @return a newly created GEOM group.
8460 # @ref tui_intersect_groups_anchor "Example"
8461 def IntersectGroups (self, theGroup1, theGroup2):
8463 Intersection of two groups.
8464 New group is created. It will contain only those entities
8465 which are present in both groups theGroup1 and theGroup2.
8468 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8471 a newly created GEOM group.
8473 # Example: see GEOM_TestOthers.py
8474 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
8475 RaiseIfFailed("IntersectGroups", self.GroupOp)
8478 ## Cut of two groups.
8479 # New group is created. It will contain entities which are
8480 # present in group theGroup1 but are not present in group theGroup2.
8481 # @param theGroup1 is a GEOM group to include elements of.
8482 # @param theGroup2 is a GEOM group to exclude elements of.
8483 # @return a newly created GEOM group.
8484 # @ref tui_cut_groups_anchor "Example"
8485 def CutGroups (self, theGroup1, theGroup2):
8488 New group is created. It will contain entities which are
8489 present in group theGroup1 but are not present in group theGroup2.
8492 theGroup1 is a GEOM group to include elements of.
8493 theGroup2 is a GEOM group to exclude elements of.
8496 a newly created GEOM group.
8498 # Example: see GEOM_TestOthers.py
8499 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
8500 RaiseIfFailed("CutGroups", self.GroupOp)
8503 ## Union of list of groups.
8504 # New group is created. It will contain all entities that are
8505 # present in groups listed in theGList.
8506 # @param theGList is a list of GEOM groups to create the united group from.
8507 # @return a newly created GEOM group.
8508 # @ref tui_union_groups_anchor "Example"
8509 def UnionListOfGroups (self, theGList):
8511 Union of list of groups.
8512 New group is created. It will contain all entities that are
8513 present in groups listed in theGList.
8516 theGList is a list of GEOM groups to create the united group from.
8519 a newly created GEOM group.
8521 # Example: see GEOM_TestOthers.py
8522 aGroup = self.GroupOp.UnionListOfGroups(theGList)
8523 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
8526 ## Cut of lists of groups.
8527 # New group is created. It will contain only entities
8528 # which are present in groups listed in theGList1 but
8529 # are not present in groups from theGList2.
8530 # @param theGList1 is a list of GEOM groups to include elements of.
8531 # @param theGList2 is a list of GEOM groups to exclude elements of.
8532 # @return a newly created GEOM group.
8533 # @ref tui_intersect_groups_anchor "Example"
8534 def IntersectListOfGroups (self, theGList):
8536 Cut of lists of groups.
8537 New group is created. It will contain only entities
8538 which are present in groups listed in theGList1 but
8539 are not present in groups from theGList2.
8542 theGList1 is a list of GEOM groups to include elements of.
8543 theGList2 is a list of GEOM groups to exclude elements of.
8546 a newly created GEOM group.
8548 # Example: see GEOM_TestOthers.py
8549 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
8550 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
8553 ## Cut of lists of groups.
8554 # New group is created. It will contain only entities
8555 # which are present in groups listed in theGList1 but
8556 # are not present in groups from theGList2.
8557 # @param theGList1 is a list of GEOM groups to include elements of.
8558 # @param theGList2 is a list of GEOM groups to exclude elements of.
8559 # @return a newly created GEOM group.
8560 # @ref tui_cut_groups_anchor "Example"
8561 def CutListOfGroups (self, theGList1, theGList2):
8563 Cut of lists of groups.
8564 New group is created. It will contain only entities
8565 which are present in groups listed in theGList1 but
8566 are not present in groups from theGList2.
8569 theGList1 is a list of GEOM groups to include elements of.
8570 theGList2 is a list of GEOM groups to exclude elements of.
8573 a newly created GEOM group.
8575 # Example: see GEOM_TestOthers.py
8576 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
8577 RaiseIfFailed("CutListOfGroups", self.GroupOp)
8580 ## Returns a list of sub-objects ID stored in the group
8581 # @param theGroup is a GEOM group for which a list of IDs is requested
8583 # @ref swig_GetObjectIDs "Example"
8584 def GetObjectIDs(self,theGroup):
8586 Returns a list of sub-objects ID stored in the group
8589 theGroup is a GEOM group for which a list of IDs is requested
8591 # Example: see GEOM_TestOthers.py
8592 ListIDs = self.GroupOp.GetObjects(theGroup)
8593 RaiseIfFailed("GetObjects", self.GroupOp)
8596 ## Returns a type of sub-objects stored in the group
8597 # @param theGroup is a GEOM group which type is returned.
8599 # @ref swig_GetType "Example"
8600 def GetType(self,theGroup):
8602 Returns a type of sub-objects stored in the group
8605 theGroup is a GEOM group which type is returned.
8607 # Example: see GEOM_TestOthers.py
8608 aType = self.GroupOp.GetType(theGroup)
8609 RaiseIfFailed("GetType", self.GroupOp)
8612 ## Convert a type of geom object from id to string value
8613 # @param theId is a GEOM obect type id.
8614 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8615 # @ref swig_GetType "Example"
8616 def ShapeIdToType(self, theId):
8618 Convert a type of geom object from id to string value
8621 theId is a GEOM obect type id.
8624 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8699 return "FREE_BOUNDS"
8707 return "THRUSECTIONS"
8709 return "COMPOUNDFILTER"
8711 return "SHAPES_ON_SHAPE"
8713 return "ELLIPSE_ARC"
8722 return "Shape Id not exist."
8724 ## Returns a main shape associated with the group
8725 # @param theGroup is a GEOM group for which a main shape object is requested
8726 # @return a GEOM object which is a main shape for theGroup
8728 # @ref swig_GetMainShape "Example"
8729 def GetMainShape(self,theGroup):
8731 Returns a main shape associated with the group
8734 theGroup is a GEOM group for which a main shape object is requested
8737 a GEOM object which is a main shape for theGroup
8739 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8741 # Example: see GEOM_TestOthers.py
8742 anObj = self.GroupOp.GetMainShape(theGroup)
8743 RaiseIfFailed("GetMainShape", self.GroupOp)
8746 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8747 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8748 # @param theShape given shape (see GEOM.GEOM_Object)
8749 # @param min_length minimum length of edges of theShape
8750 # @param max_length maximum length of edges of theShape
8751 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8752 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8753 # @return a newly created GEOM group of edges
8754 # @@ref swig_todo "Example"
8755 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8757 Create group of edges of theShape, whose length is in range [min_length, max_length].
8758 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8761 theShape given shape
8762 min_length minimum length of edges of theShape
8763 max_length maximum length of edges of theShape
8764 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8765 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8768 a newly created GEOM group of edges.
8770 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8773 Props = self.BasicProperties(edge)
8774 if min_length <= Props[0] and Props[0] <= max_length:
8775 if (not include_min) and (min_length == Props[0]):
8778 if (not include_max) and (Props[0] == max_length):
8781 edges_in_range.append(edge)
8783 if len(edges_in_range) <= 0:
8784 print "No edges found by given criteria"
8787 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8788 self.UnionList(group_edges, edges_in_range)
8792 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8793 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8794 # @param min_length minimum length of edges of selected shape
8795 # @param max_length maximum length of edges of selected shape
8796 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8797 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8798 # @return a newly created GEOM group of edges
8799 # @ref swig_todo "Example"
8800 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8802 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8803 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8806 min_length minimum length of edges of selected shape
8807 max_length maximum length of edges of selected shape
8808 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8809 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8812 a newly created GEOM group of edges.
8814 nb_selected = sg.SelectedCount()
8816 print "Select a shape before calling this function, please."
8819 print "Only one shape must be selected"
8822 id_shape = sg.getSelected(0)
8823 shape = IDToObject( id_shape )
8825 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8829 if include_min: left_str = " <= "
8830 if include_max: right_str = " <= "
8832 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8833 + left_str + "length" + right_str + `max_length`)
8835 sg.updateObjBrowser(1)
8842 ## @addtogroup l4_advanced
8845 ## Create a T-shape object with specified caracteristics for the main
8846 # and the incident pipes (radius, width, half-length).
8847 # The extremities of the main pipe are located on junctions points P1 and P2.
8848 # The extremity of the incident pipe is located on junction point P3.
8849 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8850 # the main plane of the T-shape is XOY.
8851 # @param theR1 Internal radius of main pipe
8852 # @param theW1 Width of main pipe
8853 # @param theL1 Half-length of main pipe
8854 # @param theR2 Internal radius of incident pipe (R2 < R1)
8855 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8856 # @param theL2 Half-length of incident pipe
8857 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8858 # @param theP1 1st junction point of main pipe
8859 # @param theP2 2nd junction point of main pipe
8860 # @param theP3 Junction point of incident pipe
8861 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8863 # @ref tui_creation_pipetshape "Example"
8864 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8866 Create a T-shape object with specified caracteristics for the main
8867 and the incident pipes (radius, width, half-length).
8868 The extremities of the main pipe are located on junctions points P1 and P2.
8869 The extremity of the incident pipe is located on junction point P3.
8870 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8871 the main plane of the T-shape is XOY.
8874 theR1 Internal radius of main pipe
8875 theW1 Width of main pipe
8876 theL1 Half-length of main pipe
8877 theR2 Internal radius of incident pipe (R2 < R1)
8878 theW2 Width of incident pipe (R2+W2 < R1+W1)
8879 theL2 Half-length of incident pipe
8880 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8881 theP1 1st junction point of main pipe
8882 theP2 2nd junction point of main pipe
8883 theP3 Junction point of incident pipe
8886 List of GEOM_Object, containing the created shape and propagation groups.
8889 # create PipeTShape object
8890 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8891 # create PipeTShape object with position
8892 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8894 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8895 if (theP1 and theP2 and theP3):
8896 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8898 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8899 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8900 if Parameters: anObj[0].SetParameters(Parameters)
8903 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8904 # and the incident pipes (radius, width, half-length). The chamfer is
8905 # created on the junction of the pipes.
8906 # The extremities of the main pipe are located on junctions points P1 and P2.
8907 # The extremity of the incident pipe is located on junction point P3.
8908 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8909 # the main plane of the T-shape is XOY.
8910 # @param theR1 Internal radius of main pipe
8911 # @param theW1 Width of main pipe
8912 # @param theL1 Half-length of main pipe
8913 # @param theR2 Internal radius of incident pipe (R2 < R1)
8914 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8915 # @param theL2 Half-length of incident pipe
8916 # @param theH Height of the chamfer.
8917 # @param theW Width of the chamfer.
8918 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8919 # @param theP1 1st junction point of main pipe
8920 # @param theP2 2nd junction point of main pipe
8921 # @param theP3 Junction point of incident pipe
8922 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8924 # @ref tui_creation_pipetshape "Example"
8925 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8927 Create a T-shape object with chamfer and with specified caracteristics for the main
8928 and the incident pipes (radius, width, half-length). The chamfer is
8929 created on the junction of the pipes.
8930 The extremities of the main pipe are located on junctions points P1 and P2.
8931 The extremity of the incident pipe is located on junction point P3.
8932 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8933 the main plane of the T-shape is XOY.
8936 theR1 Internal radius of main pipe
8937 theW1 Width of main pipe
8938 theL1 Half-length of main pipe
8939 theR2 Internal radius of incident pipe (R2 < R1)
8940 theW2 Width of incident pipe (R2+W2 < R1+W1)
8941 theL2 Half-length of incident pipe
8942 theH Height of the chamfer.
8943 theW Width of the chamfer.
8944 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8945 theP1 1st junction point of main pipe
8946 theP2 2nd junction point of main pipe
8947 theP3 Junction point of incident pipe
8950 List of GEOM_Object, containing the created shape and propagation groups.
8953 # create PipeTShape with chamfer object
8954 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8955 # create PipeTShape with chamfer object with position
8956 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8958 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8959 if (theP1 and theP2 and theP3):
8960 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8962 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8963 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8964 if Parameters: anObj[0].SetParameters(Parameters)
8967 ## Create a T-shape object with fillet and with specified caracteristics for the main
8968 # and the incident pipes (radius, width, half-length). The fillet is
8969 # created on the junction of the pipes.
8970 # The extremities of the main pipe are located on junctions points P1 and P2.
8971 # The extremity of the incident pipe is located on junction point P3.
8972 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8973 # the main plane of the T-shape is XOY.
8974 # @param theR1 Internal radius of main pipe
8975 # @param theW1 Width of main pipe
8976 # @param theL1 Half-length of main pipe
8977 # @param theR2 Internal radius of incident pipe (R2 < R1)
8978 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8979 # @param theL2 Half-length of incident pipe
8980 # @param theRF Radius of curvature of fillet.
8981 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8982 # @param theP1 1st junction point of main pipe
8983 # @param theP2 2nd junction point of main pipe
8984 # @param theP3 Junction point of incident pipe
8985 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8987 # @ref tui_creation_pipetshape "Example"
8988 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8990 Create a T-shape object with fillet and with specified caracteristics for the main
8991 and the incident pipes (radius, width, half-length). The fillet is
8992 created on the junction of the pipes.
8993 The extremities of the main pipe are located on junctions points P1 and P2.
8994 The extremity of the incident pipe is located on junction point P3.
8997 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8998 the main plane of the T-shape is XOY.
8999 theR1 Internal radius of main pipe
9000 theW1 Width of main pipe
9001 heL1 Half-length of main pipe
9002 theR2 Internal radius of incident pipe (R2 < R1)
9003 theW2 Width of incident pipe (R2+W2 < R1+W1)
9004 theL2 Half-length of incident pipe
9005 theRF Radius of curvature of fillet.
9006 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
9007 theP1 1st junction point of main pipe
9008 theP2 2nd junction point of main pipe
9009 theP3 Junction point of incident pipe
9012 List of GEOM_Object, containing the created shape and propagation groups.
9015 # create PipeTShape with fillet object
9016 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
9017 # create PipeTShape with fillet object with position
9018 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
9021 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
9022 if (theP1 and theP2 and theP3):
9023 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
9025 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
9026 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
9027 if Parameters: anObj[0].SetParameters(Parameters)
9030 ## This function allows creating a disk already divided into blocks. It
9031 # can be used to create divided pipes for later meshing in hexaedra.
9032 # @param theR Radius of the disk
9033 # @param theOrientation Orientation of the plane on which the disk will be built
9034 # 1 = XOY, 2 = OYZ, 3 = OZX
9035 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9036 # @return New GEOM_Object, containing the created shape.
9038 # @ref tui_creation_divideddisk "Example"
9039 def MakeDividedDisk(self, theR, theOrientation, thePattern ):
9040 theR, Parameters = ParseParameters(theR)
9041 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
9042 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
9043 if Parameters: anObj.SetParameters(Parameters)
9046 ## This function allows creating a disk already divided into blocks. It
9047 # can be used to create divided pipes for later meshing in hexaedra.
9048 # @param theCenter Center of the disk
9049 # @param theVector Normal vector to the plane of the created disk
9050 # @param theRadius Radius of the disk
9051 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9052 # @return New GEOM_Object, containing the created shape.
9054 # @ref tui_creation_divideddisk "Example"
9055 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
9056 theRadius, Parameters = ParseParameters(theRadius)
9057 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
9058 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
9059 if Parameters: anObj.SetParameters(Parameters)
9062 ## Builds a cylinder prepared for hexa meshes
9063 # @param theR Radius of the cylinder
9064 # @param theH Height of the cylinder
9065 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9066 # @return New GEOM_Object, containing the created shape.
9068 # @ref tui_creation_dividedcylinder "Example"
9069 def MakeDividedCylinder(self, theR, theH, thePattern):
9070 theR, theH, Parameters = ParseParameters(theR, theH)
9071 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
9072 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
9073 if Parameters: anObj.SetParameters(Parameters)
9076 ## Export a shape to XAO Format
9077 # @param shape Shape to export
9078 # @param fileName The name of the exported file
9079 # @param groups List of groups to export
9080 # @param fields List of fields to export
9083 # @ref tui_creation_exportxao "Example"
9084 def ExportXAO(self, fileName, shape, groups, fields):
9085 fileName, shape, groups, fields, Parameters = ParseParameters(fileName, shape, groups, fields)
9086 isGood = self.ImpExpOp.ExportXAO(fileName, shape, groups, fields)
9087 RaiseIfFailed("ExportXAO", self.ImpExpOp)
9088 #if Parameters: anObj.SetParameters(Parameters)
9091 #@@ insert new functions before this line @@ do not remove this line @@#
9093 # end of l4_advanced
9096 ## Create a copy of the given object
9098 # @param theOriginal geometry object for copy
9099 # @return unique object identifier
9100 # @ingroup l1_geompy_auxiliary
9101 # @ref swig_MakeCopy "Example"
9102 def MakeCopy(self,theOriginal):
9104 Create a copy of the given object
9107 theOriginal geometry object for copy
9110 unique object identifier
9112 Example of usage: Copy = geompy.MakeCopy(Box)
9114 # Example: see GEOM_TestAll.py
9115 anObj = self.InsertOp.MakeCopy(theOriginal)
9116 RaiseIfFailed("MakeCopy", self.InsertOp)
9119 ## Add Path to load python scripts from
9120 # @param Path a path to load python scripts from
9121 # @ingroup l1_geompy_auxiliary
9122 def addPath(self,Path):
9124 Add Path to load python scripts from
9127 Path a path to load python scripts from
9129 if (sys.path.count(Path) < 1):
9130 sys.path.append(Path)
9134 ## Load marker texture from the file
9135 # @param Path a path to the texture file
9136 # @return unique texture identifier
9137 # @ingroup l1_geompy_auxiliary
9138 def LoadTexture(self, Path):
9140 Load marker texture from the file
9143 Path a path to the texture file
9146 unique texture identifier
9148 # Example: see GEOM_TestAll.py
9149 ID = self.InsertOp.LoadTexture(Path)
9150 RaiseIfFailed("LoadTexture", self.InsertOp)
9153 ## Get internal name of the object based on its study entry
9154 # @note This method does not provide an unique identifier of the geometry object.
9155 # @note This is internal function of GEOM component, though it can be used outside it for
9156 # appropriate reason (e.g. for identification of geometry object).
9157 # @param obj geometry object
9158 # @return unique object identifier
9159 # @ingroup l1_geompy_auxiliary
9160 def getObjectID(self, obj):
9162 Get internal name of the object based on its study entry.
9163 Note: this method does not provide an unique identifier of the geometry object.
9164 It is an internal function of GEOM component, though it can be used outside GEOM for
9165 appropriate reason (e.g. for identification of geometry object).
9171 unique object identifier
9174 entry = salome.ObjectToID(obj)
9175 if entry is not None:
9176 lst = entry.split(":")
9178 ID = lst[-1] # -1 means last item in the list
9184 ## Add marker texture. @a Width and @a Height parameters
9185 # specify width and height of the texture in pixels.
9186 # If @a RowData is @c True, @a Texture parameter should represent texture data
9187 # packed into the byte array. If @a RowData is @c False (default), @a Texture
9188 # parameter should be unpacked string, in which '1' symbols represent opaque
9189 # pixels and '0' represent transparent pixels of the texture bitmap.
9191 # @param Width texture width in pixels
9192 # @param Height texture height in pixels
9193 # @param Texture texture data
9194 # @param RowData if @c True, @a Texture data are packed in the byte stream
9195 # @return unique texture identifier
9196 # @ingroup l1_geompy_auxiliary
9197 def AddTexture(self, Width, Height, Texture, RowData=False):
9199 Add marker texture. Width and Height parameters
9200 specify width and height of the texture in pixels.
9201 If RowData is True, Texture parameter should represent texture data
9202 packed into the byte array. If RowData is False (default), Texture
9203 parameter should be unpacked string, in which '1' symbols represent opaque
9204 pixels and '0' represent transparent pixels of the texture bitmap.
9207 Width texture width in pixels
9208 Height texture height in pixels
9209 Texture texture data
9210 RowData if True, Texture data are packed in the byte stream
9213 return unique texture identifier
9215 if not RowData: Texture = PackData(Texture)
9216 ID = self.InsertOp.AddTexture(Width, Height, Texture)
9217 RaiseIfFailed("AddTexture", self.InsertOp)
9221 #Register the new proxy for GEOM_Gen
9222 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)