1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2011 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
80 from salome_notebook import *
86 ## Enumeration ShapeType as a dictionary. \n
87 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
88 # @ingroup l1_geompy_auxiliary
89 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
91 ## Raise an Error, containing the Method_name, if Operation is Failed
92 ## @ingroup l1_geompy_auxiliary
93 def RaiseIfFailed (Method_name, Operation):
94 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
95 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
97 ## Return list of variables value from salome notebook
98 ## @ingroup l1_geompy_auxiliary
99 def ParseParameters(*parameters):
102 for parameter in parameters:
103 if isinstance(parameter, list):
104 lResults = ParseParameters(*parameter)
105 if len(lResults) > 0:
106 Result.append(lResults[:-1])
107 StringResult += lResults[-1].split(":")
111 if isinstance(parameter,str):
112 if notebook.isVariable(parameter):
113 Result.append(notebook.get(parameter))
115 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
118 Result.append(parameter)
120 StringResult.append(str(parameter))
124 Result.append(":".join(StringResult))
126 Result = ":".join(StringResult)
129 ## Return list of variables value from salome notebook
130 ## @ingroup l1_geompy_auxiliary
134 for parameter in list:
135 if isinstance(parameter,str) and notebook.isVariable(parameter):
136 Result.append(str(notebook.get(parameter)))
139 Result.append(str(parameter))
142 StringResult = StringResult + str(parameter)
143 StringResult = StringResult + ":"
145 StringResult = StringResult[:len(StringResult)-1]
146 return Result, StringResult
148 ## Return list of variables value from salome notebook
149 ## @ingroup l1_geompy_auxiliary
150 def ParseSketcherCommand(command):
153 sections = command.split(":")
154 for section in sections:
155 parameters = section.split(" ")
157 for parameter in parameters:
158 if paramIndex > 1 and parameter.find("'") != -1:
159 parameter = parameter.replace("'","")
160 if notebook.isVariable(parameter):
161 Result = Result + str(notebook.get(parameter)) + " "
164 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
168 Result = Result + str(parameter) + " "
171 StringResult = StringResult + parameter
172 StringResult = StringResult + ":"
174 paramIndex = paramIndex + 1
176 Result = Result[:len(Result)-1] + ":"
178 Result = Result[:len(Result)-1]
179 return Result, StringResult
181 ## Helper function which can be used to pack the passed string to the byte data.
182 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
183 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
186 ## val = PackData("10001110") # val = 0xAE
187 ## val = PackData("1") # val = 0x80
189 ## @param data unpacked data - a string containing '1' and '0' symbols
190 ## @return data packed to the byte stream
191 ## @ingroup l1_geompy_auxiliary
194 Helper function which can be used to pack the passed string to the byte data.
195 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
196 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
199 data unpacked data - a string containing '1' and '0' symbols
202 data packed to the byte stream
205 val = PackData("10001110") # val = 0xAE
206 val = PackData("1") # val = 0x80
209 if len(data)%8: bytes += 1
211 for b in range(bytes):
212 d = data[b*8:(b+1)*8]
217 if d[i] == "1": val += 1
219 raise "Invalid symbol %s" % d[i]
226 ## Read bitmap texture from the text file.
227 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
228 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
229 ## The function returns width and height of the pixmap in pixels and byte stream representing
230 ## texture bitmap itself.
232 ## This function can be used to read the texture to the byte stream in order to pass it to
233 ## the AddTexture() function of geompy class.
237 ## geompy.init_geom(salome.myStudy)
238 ## texture = geompy.readtexture('mytexture.dat')
239 ## texture = geompy.AddTexture(*texture)
240 ## obj.SetMarkerTexture(texture)
242 ## @param fname texture file name
243 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
244 ## @ingroup l1_geompy_auxiliary
245 def ReadTexture(fname):
247 Read bitmap texture from the text file.
248 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
249 A zero symbol ('0') represents transparent pixel of the texture bitmap.
250 The function returns width and height of the pixmap in pixels and byte stream representing
251 texture bitmap itself.
252 This function can be used to read the texture to the byte stream in order to pass it to
253 the AddTexture() function of geompy class.
256 fname texture file name
259 sequence of tree values: texture's width, height in pixels and its byte stream
263 geompy.init_geom(salome.myStudy)
264 texture = geompy.readtexture('mytexture.dat')
265 texture = geompy.AddTexture(*texture)
266 obj.SetMarkerTexture(texture)
270 lines = [ l.strip() for l in f.readlines()]
273 if lines: maxlen = max([len(x) for x in lines])
275 if maxlen%8: lenbytes += 1
279 lenline = (len(line)/8+1)*8
282 lenline = (len(line)/8)*8
284 for i in range(lenline/8):
287 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
290 bytedata += PackData(byte)
292 for i in range(lenline/8, lenbytes):
293 bytedata += PackData("0")
295 return lenbytes*8, len(lines), bytedata
300 ## Returns a long value from enumeration type
301 # Can be used for CORBA enumerator types like GEOM.shape_type
302 # @param theItem enumeration type
303 # @ingroup l1_geompy_auxiliary
304 def EnumToLong(theItem):
306 Returns a long value from enumeration type
307 Can be used for CORBA enumerator types like geompy.ShapeType
310 theItem enumeration type
313 if hasattr(theItem, "_v"): ret = theItem._v
316 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
317 # and a list of parameters, describing the shape.
318 # List of parameters, describing the shape:
319 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
320 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
322 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
324 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
326 # - SPHERE: [xc yc zc R]
327 # - CYLINDER: [xb yb zb dx dy dz R H]
328 # - BOX: [xc yc zc ax ay az]
329 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
330 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
331 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
332 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
333 # - SOLID: [nb_faces nb_edges nb_vertices]
335 # - SPHERE2D: [xc yc zc R]
336 # - CYLINDER2D: [xb yb zb dx dy dz R H]
337 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
338 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
339 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
340 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
341 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
342 # - PLANE: [xo yo zo dx dy dz]
343 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
344 # - FACE: [nb_edges nb_vertices]
346 # - CIRCLE: [xc yc zc dx dy dz R]
347 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
348 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
349 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
350 # - LINE: [xo yo zo dx dy dz]
351 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
352 # - EDGE: [nb_vertices]
355 # @ingroup l1_geompy_auxiliary
356 kind = GEOM.GEOM_IKindOfShape
358 ## Information about closed/unclosed state of shell or wire
359 # @ingroup l1_geompy_auxiliary
362 Information about closed/unclosed state of shell or wire
368 class geompyDC(GEOM._objref_GEOM_Gen):
371 GEOM._objref_GEOM_Gen.__init__(self)
372 self.myBuilder = None
391 ## @addtogroup l1_geompy_auxiliary
393 def init_geom(self,theStudy):
394 self.myStudy = theStudy
395 self.myStudyId = self.myStudy._get_StudyId()
396 self.myBuilder = self.myStudy.NewBuilder()
397 self.father = self.myStudy.FindComponent("GEOM")
398 if self.father is None:
399 self.father = self.myBuilder.NewComponent("GEOM")
400 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
401 FName = A1._narrow(SALOMEDS.AttributeName)
402 FName.SetValue("Geometry")
403 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
404 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
405 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
406 self.myBuilder.DefineComponentInstance(self.father,self)
408 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
409 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
410 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
411 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
412 self.HealOp = self.GetIHealingOperations (self.myStudyId)
413 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
414 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
415 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
416 self.LocalOp = self.GetILocalOperations (self.myStudyId)
417 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
418 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
419 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
420 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
423 ## Dump component to the Python script
424 # This method overrides IDL function to allow default values for the parameters.
425 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
427 Dump component to the Python script
428 This method overrides IDL function to allow default values for the parameters.
430 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
432 ## Get name for sub-shape aSubObj of shape aMainObj
434 # @ref swig_SubShapeName "Example"
435 def SubShapeName(self,aSubObj, aMainObj):
437 Get name for sub-shape aSubObj of shape aMainObj
439 # Example: see GEOM_TestAll.py
441 #aSubId = orb.object_to_string(aSubObj)
442 #aMainId = orb.object_to_string(aMainObj)
443 #index = gg.getIndexTopology(aSubId, aMainId)
444 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
445 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
446 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
449 ## Publish in study aShape with name aName
451 # \param aShape the shape to be published
452 # \param aName the name for the shape
453 # \param doRestoreSubShapes if True, finds and publishes also
454 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
455 # and published sub-shapes of arguments
456 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
457 # these arguments description
458 # \return study entry of the published shape in form of string
460 # @ref swig_all_addtostudy "Example"
461 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
462 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
464 Publish in study aShape with name aName
467 aShape the shape to be published
468 aName the name for the shape
469 doRestoreSubShapes if True, finds and publishes also
470 sub-shapes of aShape, corresponding to its arguments
471 and published sub-shapes of arguments
472 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
473 these arguments description
476 study entry of the published shape in form of string
479 id_block1 = geompy.addToStudy(Block1, "Block 1")
481 # Example: see GEOM_TestAll.py
483 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
484 if doRestoreSubShapes:
485 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
486 theFindMethod, theInheritFirstArg, True )
488 print "addToStudy() failed"
490 return aShape.GetStudyEntry()
492 ## Publish in study aShape with name aName as sub-object of previously published aFather
493 # \param aFather previously published object
494 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
495 # \param aName the name for the shape
497 # \return study entry of the published shape in form of string
498 # @ref swig_all_addtostudyInFather "Example"
499 def addToStudyInFather(self, aFather, aShape, aName):
501 Publish in study aShape with name aName as sub-object of previously published aFather
504 aFather previously published object
505 aShape the shape to be published as sub-object of aFather
506 aName the name for the shape
509 study entry of the published shape in form of string
511 # Example: see GEOM_TestAll.py
513 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
515 print "addToStudyInFather() failed"
517 return aShape.GetStudyEntry()
519 ## Unpublish object in study
521 # \param obj the object to be unpublished
522 def hideInStudy(self, obj):
524 Unpublish object in study
527 obj the object to be unpublished
529 ior = salome.orb.object_to_string(obj)
530 aSObject = self.myStudy.FindObjectIOR(ior)
531 if aSObject is not None:
532 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
533 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
534 drwAttribute.SetDrawable(False)
537 # end of l1_geompy_auxiliary
540 ## @addtogroup l3_restore_ss
543 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
544 # To be used from python scripts out of addToStudy() (non-default usage)
545 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
546 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
547 # If this list is empty, all operation arguments will be published
548 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
549 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
550 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
551 # Do not publish sub-shapes in place of arguments, but only
552 # in place of sub-shapes of the first argument,
553 # because the whole shape corresponds to the first argument.
554 # Mainly to be used after transformations, but it also can be
555 # usefull after partition with one object shape, and some other
556 # operations, where only the first argument has to be considered.
557 # If theObject has only one argument shape, this flag is automatically
558 # considered as True, not regarding really passed value.
559 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
560 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
561 # \return list of published sub-shapes
563 # @ref tui_restore_prs_params "Example"
564 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
565 theInheritFirstArg=False, theAddPrefix=True):
567 Publish sub-shapes, standing for arguments and sub-shapes of arguments
568 To be used from python scripts out of geompy.addToStudy (non-default usage)
571 theObject published GEOM.GEOM_Object, arguments of which will be published
572 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
573 If this list is empty, all operation arguments will be published
574 theFindMethod method to search sub-shapes, corresponding to arguments and
575 their sub-shapes. Value from enumeration GEOM.find_shape_method.
576 theInheritFirstArg set properties of the first argument for theObject.
577 Do not publish sub-shapes in place of arguments, but only
578 in place of sub-shapes of the first argument,
579 because the whole shape corresponds to the first argument.
580 Mainly to be used after transformations, but it also can be
581 usefull after partition with one object shape, and some other
582 operations, where only the first argument has to be considered.
583 If theObject has only one argument shape, this flag is automatically
584 considered as True, not regarding really passed value.
585 theAddPrefix add prefix "from_" to names of restored sub-shapes,
586 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
588 list of published sub-shapes
590 # Example: see GEOM_TestAll.py
591 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
592 theFindMethod, theInheritFirstArg, theAddPrefix)
594 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
595 # To be used from python scripts out of addToStudy() (non-default usage)
596 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
597 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
598 # If this list is empty, all operation arguments will be published
599 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
600 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
601 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
602 # Do not publish sub-shapes in place of arguments, but only
603 # in place of sub-shapes of the first argument,
604 # because the whole shape corresponds to the first argument.
605 # Mainly to be used after transformations, but it also can be
606 # usefull after partition with one object shape, and some other
607 # operations, where only the first argument has to be considered.
608 # If theObject has only one argument shape, this flag is automatically
609 # considered as True, not regarding really passed value.
610 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
611 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
612 # \return list of published sub-shapes
614 # @ref tui_restore_prs_params "Example"
615 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
616 theInheritFirstArg=False, theAddPrefix=True):
618 Publish sub-shapes, standing for arguments and sub-shapes of arguments
619 To be used from python scripts out of geompy.addToStudy() (non-default usage)
622 theObject published GEOM.GEOM_Object, arguments of which will be published
623 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
624 If this list is empty, all operation arguments will be published
625 theFindMethod method to search sub-shapes, corresponding to arguments and
626 their sub-shapes. Value from enumeration GEOM::find_shape_method.
627 theInheritFirstArg set properties of the first argument for theObject.
628 Do not publish sub-shapes in place of arguments, but only
629 in place of sub-shapes of the first argument,
630 because the whole shape corresponds to the first argument.
631 Mainly to be used after transformations, but it also can be
632 usefull after partition with one object shape, and some other
633 operations, where only the first argument has to be considered.
634 If theObject has only one argument shape, this flag is automatically
635 considered as True, not regarding really passed value.
636 theAddPrefix add prefix "from_" to names of restored sub-shapes,
637 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
640 list of published sub-shapes
642 # Example: see GEOM_TestAll.py
643 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
644 theFindMethod, theInheritFirstArg, theAddPrefix)
646 # end of l3_restore_ss
649 ## @addtogroup l3_basic_go
652 ## Create point by three coordinates.
653 # @param theX The X coordinate of the point.
654 # @param theY The Y coordinate of the point.
655 # @param theZ The Z coordinate of the point.
656 # @return New GEOM.GEOM_Object, containing the created point.
658 # @ref tui_creation_point "Example"
659 def MakeVertex(self, theX, theY, theZ):
661 Create point by three coordinates.
664 theX The X coordinate of the point.
665 theY The Y coordinate of the point.
666 theZ The Z coordinate of the point.
669 New GEOM.GEOM_Object, containing the created point.
671 # Example: see GEOM_TestAll.py
672 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
673 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
674 RaiseIfFailed("MakePointXYZ", self.BasicOp)
675 anObj.SetParameters(Parameters)
678 ## Create a point, distant from the referenced point
679 # on the given distances along the coordinate axes.
680 # @param theReference The referenced point.
681 # @param theX Displacement from the referenced point along OX axis.
682 # @param theY Displacement from the referenced point along OY axis.
683 # @param theZ Displacement from the referenced point along OZ axis.
684 # @return New GEOM.GEOM_Object, containing the created point.
686 # @ref tui_creation_point "Example"
687 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
689 Create a point, distant from the referenced point
690 on the given distances along the coordinate axes.
693 theReference The referenced point.
694 theX Displacement from the referenced point along OX axis.
695 theY Displacement from the referenced point along OY axis.
696 theZ Displacement from the referenced point along OZ axis.
699 New GEOM.GEOM_Object, containing the created point.
701 # Example: see GEOM_TestAll.py
702 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
703 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
704 RaiseIfFailed("MakePointWithReference", self.BasicOp)
705 anObj.SetParameters(Parameters)
708 ## Create a point, corresponding to the given parameter on the given curve.
709 # @param theRefCurve The referenced curve.
710 # @param theParameter Value of parameter on the referenced curve.
711 # @return New GEOM.GEOM_Object, containing the created point.
713 # @ref tui_creation_point "Example"
714 def MakeVertexOnCurve(self,theRefCurve, theParameter):
716 Create a point, corresponding to the given parameter on the given curve.
719 theRefCurve The referenced curve.
720 theParameter Value of parameter on the referenced curve.
723 New GEOM.GEOM_Object, containing the created point.
726 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
728 # Example: see GEOM_TestAll.py
729 theParameter, Parameters = ParseParameters(theParameter)
730 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
731 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
732 anObj.SetParameters(Parameters)
735 ## Create a point by projection give coordinates on the given curve
736 # @param theRefCurve The referenced curve.
737 # @param theX X-coordinate in 3D space
738 # @param theY Y-coordinate in 3D space
739 # @param theZ Z-coordinate in 3D space
740 # @return New GEOM.GEOM_Object, containing the created point.
742 # @ref tui_creation_point "Example"
743 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
745 Create a point by projection give coordinates on the given curve
748 theRefCurve The referenced curve.
749 theX X-coordinate in 3D space
750 theY Y-coordinate in 3D space
751 theZ Z-coordinate in 3D space
754 New GEOM.GEOM_Object, containing the created point.
757 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
759 # Example: see GEOM_TestAll.py
760 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
761 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
762 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
763 anObj.SetParameters(Parameters)
766 ## Create a point, corresponding to the given length on the given curve.
767 # @param theRefCurve The referenced curve.
768 # @param theLength Length on the referenced curve. It can be negative.
769 # @param theStartPoint Point allowing to choose the direction for the calculation
770 # of the length. If None, start from the first point of theRefCurve.
771 # @return New GEOM.GEOM_Object, containing the created point.
773 # @ref tui_creation_point "Example"
774 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
776 Create a point, corresponding to the given length on the given curve.
779 theRefCurve The referenced curve.
780 theLength Length on the referenced curve. It can be negative.
781 theStartPoint Point allowing to choose the direction for the calculation
782 of the length. If None, start from the first point of theRefCurve.
785 New GEOM.GEOM_Object, containing the created point.
787 # Example: see GEOM_TestAll.py
788 theLength, Parameters = ParseParameters(theLength)
789 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
790 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
791 anObj.SetParameters(Parameters)
794 ## Create a point, corresponding to the given parameters on the
796 # @param theRefSurf The referenced surface.
797 # @param theUParameter Value of U-parameter on the referenced surface.
798 # @param theVParameter Value of V-parameter on the referenced surface.
799 # @return New GEOM.GEOM_Object, containing the created point.
801 # @ref swig_MakeVertexOnSurface "Example"
802 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
804 Create a point, corresponding to the given parameters on the
808 theRefSurf The referenced surface.
809 theUParameter Value of U-parameter on the referenced surface.
810 theVParameter Value of V-parameter on the referenced surface.
813 New GEOM.GEOM_Object, containing the created point.
816 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object, Double, Double)->GEOM_Object
818 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
819 # Example: see GEOM_TestAll.py
820 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
821 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
822 anObj.SetParameters(Parameters);
825 ## Create a point by projection give coordinates on the given surface
826 # @param theRefSurf The referenced surface.
827 # @param theX X-coordinate in 3D space
828 # @param theY Y-coordinate in 3D space
829 # @param theZ Z-coordinate in 3D space
830 # @return New GEOM.GEOM_Object, containing the created point.
832 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
833 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
835 Create a point by projection give coordinates on the given surface
838 theRefSurf The referenced surface.
839 theX X-coordinate in 3D space
840 theY Y-coordinate in 3D space
841 theZ Z-coordinate in 3D space
844 New GEOM.GEOM_Object, containing the created point.
847 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object, Double, Double, Double)->GEOM_Object
849 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
850 # Example: see GEOM_TestAll.py
851 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
852 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
853 anObj.SetParameters(Parameters);
856 ## Create a point on intersection of two lines.
857 # @param theRefLine1, theRefLine2 The referenced lines.
858 # @return New GEOM.GEOM_Object, containing the created point.
860 # @ref swig_MakeVertexOnLinesIntersection "Example"
861 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
863 Create a point on intersection of two lines.
866 theRefLine1, theRefLine2 The referenced lines.
869 New GEOM.GEOM_Object, containing the created point.
871 # Example: see GEOM_TestAll.py
872 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
873 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
876 ## Create a tangent, corresponding to the given parameter on the given curve.
877 # @param theRefCurve The referenced curve.
878 # @param theParameter Value of parameter on the referenced curve.
879 # @return New GEOM.GEOM_Object, containing the created tangent.
881 # @ref swig_MakeTangentOnCurve "Example"
882 def MakeTangentOnCurve(self, theRefCurve, theParameter):
884 Create a tangent, corresponding to the given parameter on the given curve.
887 theRefCurve The referenced curve.
888 theParameter Value of parameter on the referenced curve.
891 New GEOM.GEOM_Object, containing the created tangent.
894 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object, Double)->GEOM_Object
896 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
897 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
900 ## Create a tangent plane, corresponding to the given parameter on the given face.
901 # @param theFace The face for which tangent plane should be built.
902 # @param theParameterV vertical value of the center point (0.0 - 1.0).
903 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
904 # @param theTrimSize the size of plane.
905 # @return New GEOM.GEOM_Object, containing the created tangent.
907 # @ref swig_MakeTangentPlaneOnFace "Example"
908 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
910 Create a tangent plane, corresponding to the given parameter on the given face.
913 theFace The face for which tangent plane should be built.
914 theParameterV vertical value of the center point (0.0 - 1.0).
915 theParameterU horisontal value of the center point (0.0 - 1.0).
916 theTrimSize the size of plane.
919 New GEOM.GEOM_Object, containing the created tangent.
922 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
924 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
925 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
928 ## Create a vector with the given components.
929 # @param theDX X component of the vector.
930 # @param theDY Y component of the vector.
931 # @param theDZ Z component of the vector.
932 # @return New GEOM.GEOM_Object, containing the created vector.
934 # @ref tui_creation_vector "Example"
935 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
937 Create a vector with the given components.
940 theDX X component of the vector.
941 theDY Y component of the vector.
942 theDZ Z component of the vector.
945 New GEOM.GEOM_Object, containing the created vector.
947 # Example: see GEOM_TestAll.py
948 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
949 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
950 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
951 anObj.SetParameters(Parameters)
954 ## Create a vector between two points.
955 # @param thePnt1 Start point for the vector.
956 # @param thePnt2 End point for the vector.
957 # @return New GEOM.GEOM_Object, containing the created vector.
959 # @ref tui_creation_vector "Example"
960 def MakeVector(self,thePnt1, thePnt2):
962 Create a vector between two points.
965 thePnt1 Start point for the vector.
966 thePnt2 End point for the vector.
969 New GEOM.GEOM_Object, containing the created vector.
971 # Example: see GEOM_TestAll.py
972 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
973 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
976 ## Create a line, passing through the given point
977 # and parrallel to the given direction
978 # @param thePnt Point. The resulting line will pass through it.
979 # @param theDir Direction. The resulting line will be parallel to it.
980 # @return New GEOM.GEOM_Object, containing the created line.
982 # @ref tui_creation_line "Example"
983 def MakeLine(self,thePnt, theDir):
985 Create a line, passing through the given point
986 and parrallel to the given direction
989 thePnt Point. The resulting line will pass through it.
990 theDir Direction. The resulting line will be parallel to it.
993 New GEOM.GEOM_Object, containing the created line.
995 # Example: see GEOM_TestAll.py
996 anObj = self.BasicOp.MakeLine(thePnt, theDir)
997 RaiseIfFailed("MakeLine", self.BasicOp)
1000 ## Create a line, passing through the given points
1001 # @param thePnt1 First of two points, defining the line.
1002 # @param thePnt2 Second of two points, defining the line.
1003 # @return New GEOM.GEOM_Object, containing the created line.
1005 # @ref tui_creation_line "Example"
1006 def MakeLineTwoPnt(self,thePnt1, thePnt2):
1008 Create a line, passing through the given points
1011 thePnt1 First of two points, defining the line.
1012 thePnt2 Second of two points, defining the line.
1015 New GEOM.GEOM_Object, containing the created line.
1017 # Example: see GEOM_TestAll.py
1018 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1019 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1022 ## Create a line on two faces intersection.
1023 # @param theFace1 First of two faces, defining the line.
1024 # @param theFace2 Second of two faces, defining the line.
1025 # @return New GEOM.GEOM_Object, containing the created line.
1027 # @ref swig_MakeLineTwoFaces "Example"
1028 def MakeLineTwoFaces(self, theFace1, theFace2):
1030 Create a line on two faces intersection.
1033 theFace1 First of two faces, defining the line.
1034 theFace2 Second of two faces, defining the line.
1037 New GEOM.GEOM_Object, containing the created line.
1039 # Example: see GEOM_TestAll.py
1040 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1041 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1044 ## Create a plane, passing through the given point
1045 # and normal to the given vector.
1046 # @param thePnt Point, the plane has to pass through.
1047 # @param theVec Vector, defining the plane normal direction.
1048 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1049 # @return New GEOM.GEOM_Object, containing the created plane.
1051 # @ref tui_creation_plane "Example"
1052 def MakePlane(self,thePnt, theVec, theTrimSize):
1054 Create a plane, passing through the given point
1055 and normal to the given vector.
1058 thePnt Point, the plane has to pass through.
1059 theVec Vector, defining the plane normal direction.
1060 theTrimSize Half size of a side of quadrangle face, representing the plane.
1063 New GEOM.GEOM_Object, containing the created plane.
1065 # Example: see GEOM_TestAll.py
1066 theTrimSize, Parameters = ParseParameters(theTrimSize);
1067 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1068 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1069 anObj.SetParameters(Parameters)
1072 ## Create a plane, passing through the three given points
1073 # @param thePnt1 First of three points, defining the plane.
1074 # @param thePnt2 Second of three points, defining the plane.
1075 # @param thePnt3 Fird of three points, defining the plane.
1076 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1077 # @return New GEOM.GEOM_Object, containing the created plane.
1079 # @ref tui_creation_plane "Example"
1080 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1082 Create a plane, passing through the three given points
1085 thePnt1 First of three points, defining the plane.
1086 thePnt2 Second of three points, defining the plane.
1087 thePnt3 Fird of three points, defining the plane.
1088 theTrimSize Half size of a side of quadrangle face, representing the plane.
1091 New GEOM.GEOM_Object, containing the created plane.
1093 # Example: see GEOM_TestAll.py
1094 theTrimSize, Parameters = ParseParameters(theTrimSize);
1095 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1096 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1097 anObj.SetParameters(Parameters)
1100 ## Create a plane, similar to the existing one, but with another size of representing face.
1101 # @param theFace Referenced plane or LCS(Marker).
1102 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1103 # @return New GEOM.GEOM_Object, containing the created plane.
1105 # @ref tui_creation_plane "Example"
1106 def MakePlaneFace(self,theFace, theTrimSize):
1108 Create a plane, similar to the existing one, but with another size of representing face.
1111 theFace Referenced plane or LCS(Marker).
1112 theTrimSize New half size of a side of quadrangle face, representing the plane.
1115 New GEOM.GEOM_Object, containing the created plane.
1117 # Example: see GEOM_TestAll.py
1118 theTrimSize, Parameters = ParseParameters(theTrimSize);
1119 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1120 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1121 anObj.SetParameters(Parameters)
1124 ## Create a plane, passing through the 2 vectors
1125 # with center in a start point of the first vector.
1126 # @param theVec1 Vector, defining center point and plane direction.
1127 # @param theVec2 Vector, defining the plane normal direction.
1128 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1129 # @return New GEOM.GEOM_Object, containing the created plane.
1131 # @ref tui_creation_plane "Example"
1132 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1134 Create a plane, passing through the 2 vectors
1135 with center in a start point of the first vector.
1138 theVec1 Vector, defining center point and plane direction.
1139 theVec2 Vector, defining the plane normal direction.
1140 theTrimSize Half size of a side of quadrangle face, representing the plane.
1143 New GEOM.GEOM_Object, containing the created plane.
1145 # Example: see GEOM_TestAll.py
1146 theTrimSize, Parameters = ParseParameters(theTrimSize);
1147 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1148 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1149 anObj.SetParameters(Parameters)
1152 ## Create a plane, based on a Local coordinate system.
1153 # @param theLCS coordinate system, defining plane.
1154 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1155 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1156 # @return New GEOM.GEOM_Object, containing the created plane.
1158 # @ref tui_creation_plane "Example"
1159 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1161 Create a plane, based on a Local coordinate system.
1164 theLCS coordinate system, defining plane.
1165 theTrimSize Half size of a side of quadrangle face, representing the plane.
1166 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1169 New GEOM.GEOM_Object, containing the created plane.
1171 # Example: see GEOM_TestAll.py
1172 theTrimSize, Parameters = ParseParameters(theTrimSize);
1173 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1174 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1175 anObj.SetParameters(Parameters)
1178 ## Create a local coordinate system.
1179 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1180 # @param XDX,XDY,XDZ Three components of OX direction
1181 # @param YDX,YDY,YDZ Three components of OY direction
1182 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1184 # @ref swig_MakeMarker "Example"
1185 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1187 Create a local coordinate system.
1190 OX,OY,OZ Three coordinates of coordinate system origin.
1191 XDX,XDY,XDZ Three components of OX direction
1192 YDX,YDY,YDZ Three components of OY direction
1195 New GEOM.GEOM_Object, containing the created coordinate system.
1197 # Example: see GEOM_TestAll.py
1198 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1199 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1200 RaiseIfFailed("MakeMarker", self.BasicOp)
1201 anObj.SetParameters(Parameters)
1204 ## Create a local coordinate system from shape.
1205 # @param theShape The initial shape to detect the coordinate system.
1206 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1208 # @ref tui_creation_lcs "Example"
1209 def MakeMarkerFromShape(self, theShape):
1211 Create a local coordinate system from shape.
1214 theShape The initial shape to detect the coordinate system.
1217 New GEOM.GEOM_Object, containing the created coordinate system.
1219 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1220 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1223 ## Create a local coordinate system from point and two vectors.
1224 # @param theOrigin Point of coordinate system origin.
1225 # @param theXVec Vector of X direction
1226 # @param theYVec Vector of Y direction
1227 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1229 # @ref tui_creation_lcs "Example"
1230 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1232 Create a local coordinate system from point and two vectors.
1235 theOrigin Point of coordinate system origin.
1236 theXVec Vector of X direction
1237 theYVec Vector of Y direction
1240 New GEOM.GEOM_Object, containing the created coordinate system.
1243 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1244 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1247 # end of l3_basic_go
1250 ## @addtogroup l4_curves
1253 ## Create an arc of circle, passing through three given points.
1254 # @param thePnt1 Start point of the arc.
1255 # @param thePnt2 Middle point of the arc.
1256 # @param thePnt3 End point of the arc.
1257 # @return New GEOM.GEOM_Object, containing the created arc.
1259 # @ref swig_MakeArc "Example"
1260 def MakeArc(self,thePnt1, thePnt2, thePnt3):
1262 Create an arc of circle, passing through three given points.
1265 thePnt1 Start point of the arc.
1266 thePnt2 Middle point of the arc.
1267 thePnt3 End point of the arc.
1270 New GEOM.GEOM_Object, containing the created arc.
1272 # Example: see GEOM_TestAll.py
1273 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1274 RaiseIfFailed("MakeArc", self.CurvesOp)
1277 ## Create an arc of circle from a center and 2 points.
1278 # @param thePnt1 Center of the arc
1279 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1280 # @param thePnt3 End point of the arc (Gives also a direction)
1281 # @param theSense Orientation of the arc
1282 # @return New GEOM.GEOM_Object, containing the created arc.
1284 # @ref swig_MakeArc "Example"
1285 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1287 Create an arc of circle from a center and 2 points.
1290 thePnt1 Center of the arc
1291 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1292 thePnt3 End point of the arc (Gives also a direction)
1293 theSense Orientation of the arc
1296 New GEOM.GEOM_Object, containing the created arc.
1298 # Example: see GEOM_TestAll.py
1299 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1300 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1303 ## Create an arc of ellipse, of center and two points.
1304 # @param theCenter Center of the arc.
1305 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1306 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1307 # @return New GEOM.GEOM_Object, containing the created arc.
1309 # @ref swig_MakeArc "Example"
1310 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1312 Create an arc of ellipse, of center and two points.
1315 theCenter Center of the arc.
1316 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1317 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1320 New GEOM.GEOM_Object, containing the created arc.
1322 # Example: see GEOM_TestAll.py
1323 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1324 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1327 ## Create a circle with given center, normal vector and radius.
1328 # @param thePnt Circle center.
1329 # @param theVec Vector, normal to the plane of the circle.
1330 # @param theR Circle radius.
1331 # @return New GEOM.GEOM_Object, containing the created circle.
1333 # @ref tui_creation_circle "Example"
1334 def MakeCircle(self, thePnt, theVec, theR):
1336 Create a circle with given center, normal vector and radius.
1339 thePnt Circle center.
1340 theVec Vector, normal to the plane of the circle.
1344 New GEOM.GEOM_Object, containing the created circle.
1346 # Example: see GEOM_TestAll.py
1347 theR, Parameters = ParseParameters(theR)
1348 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1349 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1350 anObj.SetParameters(Parameters)
1353 ## Create a circle with given radius.
1354 # Center of the circle will be in the origin of global
1355 # coordinate system and normal vector will be codirected with Z axis
1356 # @param theR Circle radius.
1357 # @return New GEOM.GEOM_Object, containing the created circle.
1358 def MakeCircleR(self, theR):
1360 Create a circle with given radius.
1361 Center of the circle will be in the origin of global
1362 coordinate system and normal vector will be codirected with Z axis
1368 New GEOM.GEOM_Object, containing the created circle.
1370 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1371 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1374 ## Create a circle, passing through three given points
1375 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1376 # @return New GEOM.GEOM_Object, containing the created circle.
1378 # @ref tui_creation_circle "Example"
1379 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1381 Create a circle, passing through three given points
1384 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1387 New GEOM.GEOM_Object, containing the created circle.
1389 # Example: see GEOM_TestAll.py
1390 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1391 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1394 ## Create a circle, with given point1 as center,
1395 # passing through the point2 as radius and laying in the plane,
1396 # defined by all three given points.
1397 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1398 # @return New GEOM.GEOM_Object, containing the created circle.
1400 # @ref swig_MakeCircle "Example"
1401 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1403 Create a circle, with given point1 as center,
1404 passing through the point2 as radius and laying in the plane,
1405 defined by all three given points.
1408 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1411 New GEOM.GEOM_Object, containing the created circle.
1413 # Example: see GEOM_example6.py
1414 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1415 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1418 ## Create an ellipse with given center, normal vector and radiuses.
1419 # @param thePnt Ellipse center.
1420 # @param theVec Vector, normal to the plane of the ellipse.
1421 # @param theRMajor Major ellipse radius.
1422 # @param theRMinor Minor ellipse radius.
1423 # @param theVecMaj Vector, direction of the ellipse's main axis.
1424 # @return New GEOM.GEOM_Object, containing the created ellipse.
1426 # @ref tui_creation_ellipse "Example"
1427 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1429 Create an ellipse with given center, normal vector and radiuses.
1432 thePnt Ellipse center.
1433 theVec Vector, normal to the plane of the ellipse.
1434 theRMajor Major ellipse radius.
1435 theRMinor Minor ellipse radius.
1436 theVecMaj Vector, direction of the ellipse's main axis.
1439 New GEOM.GEOM_Object, containing the created ellipse.
1441 # Example: see GEOM_TestAll.py
1442 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1443 if theVecMaj is not None:
1444 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1446 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1448 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1449 anObj.SetParameters(Parameters)
1452 ## Create an ellipse with given radiuses.
1453 # Center of the ellipse will be in the origin of global
1454 # coordinate system and normal vector will be codirected with Z axis
1455 # @param theRMajor Major ellipse radius.
1456 # @param theRMinor Minor ellipse radius.
1457 # @return New GEOM.GEOM_Object, containing the created ellipse.
1458 def MakeEllipseRR(self, theRMajor, theRMinor):
1460 Create an ellipse with given radiuses.
1461 Center of the ellipse will be in the origin of global
1462 coordinate system and normal vector will be codirected with Z axis
1465 theRMajor Major ellipse radius.
1466 theRMinor Minor ellipse radius.
1469 New GEOM.GEOM_Object, containing the created ellipse.
1471 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1472 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1475 ## Create a polyline on the set of points.
1476 # @param thePoints Sequence of points for the polyline.
1477 # @param theIsClosed If True, build a closed wire.
1478 # @return New GEOM.GEOM_Object, containing the created polyline.
1480 # @ref tui_creation_curve "Example"
1481 def MakePolyline(self, thePoints, theIsClosed=False):
1483 Create a polyline on the set of points.
1486 thePoints Sequence of points for the polyline.
1487 theIsClosed If True, build a closed wire.
1490 New GEOM.GEOM_Object, containing the created polyline.
1492 # Example: see GEOM_TestAll.py
1493 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1494 RaiseIfFailed("MakePolyline", self.CurvesOp)
1497 ## Create bezier curve on the set of points.
1498 # @param thePoints Sequence of points for the bezier curve.
1499 # @param theIsClosed If True, build a closed curve.
1500 # @return New GEOM.GEOM_Object, containing the created bezier curve.
1502 # @ref tui_creation_curve "Example"
1503 def MakeBezier(self, thePoints, theIsClosed=False):
1505 Create bezier curve on the set of points.
1508 thePoints Sequence of points for the bezier curve.
1509 theIsClosed If True, build a closed curve.
1512 New GEOM.GEOM_Object, containing the created bezier curve.
1514 # Example: see GEOM_TestAll.py
1515 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1516 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1519 ## Create B-Spline curve on the set of points.
1520 # @param thePoints Sequence of points for the B-Spline curve.
1521 # @param theIsClosed If True, build a closed curve.
1522 # @param theDoReordering If TRUE, the algo does not follow the order of
1523 # \a thePoints but searches for the closest vertex.
1524 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1526 # @ref tui_creation_curve "Example"
1527 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1529 Create B-Spline curve on the set of points.
1532 thePoints Sequence of points for the B-Spline curve.
1533 theIsClosed If True, build a closed curve.
1534 theDoReordering If True, the algo does not follow the order of
1535 thePoints but searches for the closest vertex.
1538 New GEOM.GEOM_Object, containing the created B-Spline curve.
1540 # Example: see GEOM_TestAll.py
1541 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1542 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1546 ## Creates a curve using the parametric definition of the basic points.
1547 # @param thexExpr parametric equation of the coordinates X.
1548 # @param theyExpr parametric equation of the coordinates Y.
1549 # @param thezExpr parametric equation of the coordinates Z.
1550 # @param theParamMin the minimal value of the parameter.
1551 # @param theParamMax the maximum value of the parameter.
1552 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1553 # @param theCurveType the type of the curve.
1554 # @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.
1555 # @return New GEOM.GEOM_Object, containing the created curve.
1557 # @ref tui_creation_curve "Example"
1558 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1559 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1561 Creates a curve using the parametric definition of the basic points.
1564 thexExpr parametric equation of the coordinates X.
1565 theyExpr parametric equation of the coordinates Y.
1566 thezExpr parametric equation of the coordinates Z.
1567 theParamMin the minimal value of the parameter.
1568 theParamMax the maximum value of the parameter.
1569 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1570 theCurveType the type of the curve.
1571 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1572 method is used which can lead to a bug.
1575 New GEOM.GEOM_Object, containing the created curve.
1577 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1579 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1581 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1582 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1583 anObj.SetParameters(Parameters)
1591 ## @addtogroup l3_sketcher
1594 ## Create a sketcher (wire or face), following the textual description,
1595 # passed through <VAR>theCommand</VAR> argument. \n
1596 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1597 # Format of the description string have to be the following:
1599 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1602 # - x1, y1 are coordinates of the first sketcher point (zero by default),
1604 # - "R angle" : Set the direction by angle
1605 # - "D dx dy" : Set the direction by DX & DY
1608 # - "TT x y" : Create segment by point at X & Y
1609 # - "T dx dy" : Create segment by point with DX & DY
1610 # - "L length" : Create segment by direction & Length
1611 # - "IX x" : Create segment by direction & Intersect. X
1612 # - "IY y" : Create segment by direction & Intersect. Y
1615 # - "C radius length" : Create arc by direction, radius and length(in degree)
1616 # - "AA x y": Create arc by point at X & Y
1617 # - "A dx dy" : Create arc by point with DX & DY
1618 # - "A dx dy" : Create arc by point with DX & DY
1619 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1620 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1621 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1622 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1625 # - "WW" : Close Wire (to finish)
1626 # - "WF" : Close Wire and build face (to finish)
1629 # - Flag1 (= reverse) is 0 or 2 ...
1630 # - if 0 the drawn arc is the one of lower angle (< Pi)
1631 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1634 # - Flag2 (= control tolerance) is 0 or 1 ...
1635 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1636 # - if 1 the wire is built only if the end point is on the arc
1637 # with a tolerance of 10^-7 on the distance else the creation fails
1639 # @param theCommand String, defining the sketcher in local
1640 # coordinates of the working plane.
1641 # @param theWorkingPlane Nine double values, defining origin,
1642 # OZ and OX directions of the working plane.
1643 # @return New GEOM.GEOM_Object, containing the created wire.
1645 # @ref tui_sketcher_page "Example"
1646 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1648 Create a sketcher (wire or face), following the textual description, passed
1649 through theCommand argument.
1650 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1651 Format of the description string have to be the following:
1652 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1654 - x1, y1 are coordinates of the first sketcher point (zero by default),
1656 - "R angle" : Set the direction by angle
1657 - "D dx dy" : Set the direction by DX & DY
1659 - "TT x y" : Create segment by point at X & Y
1660 - "T dx dy" : Create segment by point with DX & DY
1661 - "L length" : Create segment by direction & Length
1662 - "IX x" : Create segment by direction & Intersect. X
1663 - "IY y" : Create segment by direction & Intersect. Y
1665 - "C radius length" : Create arc by direction, radius and length(in degree)
1666 - "AA x y": Create arc by point at X & Y
1667 - "A dx dy" : Create arc by point with DX & DY
1668 - "A dx dy" : Create arc by point with DX & DY
1669 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1670 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1671 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1672 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1674 - "WW" : Close Wire (to finish)
1675 - "WF" : Close Wire and build face (to finish)
1677 - Flag1 (= reverse) is 0 or 2 ...
1678 - if 0 the drawn arc is the one of lower angle (< Pi)
1679 - if 2 the drawn arc ius the one of greater angle (> Pi)
1681 - Flag2 (= control tolerance) is 0 or 1 ...
1682 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1683 - if 1 the wire is built only if the end point is on the arc
1684 with a tolerance of 10^-7 on the distance else the creation fails
1687 theCommand String, defining the sketcher in local
1688 coordinates of the working plane.
1689 theWorkingPlane Nine double values, defining origin,
1690 OZ and OX directions of the working plane.
1693 New GEOM.GEOM_Object, containing the created wire.
1695 # Example: see GEOM_TestAll.py
1696 theCommand,Parameters = ParseSketcherCommand(theCommand)
1697 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1698 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1699 anObj.SetParameters(Parameters)
1702 ## Create a sketcher (wire or face), following the textual description,
1703 # passed through <VAR>theCommand</VAR> argument. \n
1704 # For format of the description string see MakeSketcher() method.\n
1705 # @param theCommand String, defining the sketcher in local
1706 # coordinates of the working plane.
1707 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1708 # @return New GEOM.GEOM_Object, containing the created wire.
1710 # @ref tui_sketcher_page "Example"
1711 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1713 Create a sketcher (wire or face), following the textual description,
1714 passed through theCommand argument.
1715 For format of the description string see geompy.MakeSketcher() method.
1718 theCommand String, defining the sketcher in local
1719 coordinates of the working plane.
1720 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1723 New GEOM.GEOM_Object, containing the created wire.
1725 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1726 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1729 ## Create a sketcher wire, following the numerical description,
1730 # passed through <VAR>theCoordinates</VAR> argument. \n
1731 # @param theCoordinates double values, defining points to create a wire,
1733 # @return New GEOM.GEOM_Object, containing the created wire.
1735 # @ref tui_sketcher_page "Example"
1736 def Make3DSketcher(self, theCoordinates):
1738 Create a sketcher wire, following the numerical description,
1739 passed through theCoordinates argument.
1742 theCoordinates double values, defining points to create a wire,
1746 New GEOM_Object, containing the created wire.
1748 theCoordinates,Parameters = ParseParameters(theCoordinates)
1749 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1750 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1751 anObj.SetParameters(Parameters)
1754 # end of l3_sketcher
1757 ## @addtogroup l3_3d_primitives
1760 ## Create a box by coordinates of two opposite vertices.
1762 # @param x1,y1,z1 double values, defining first point it.
1763 # @param x2,y2,z2 double values, defining first point it.
1765 # @return New GEOM.GEOM_Object, containing the created box.
1766 # @ref tui_creation_box "Example"
1767 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1769 Create a box by coordinates of two opposite vertices.
1772 x1,y1,z1 double values, defining first point.
1773 x2,y2,z2 double values, defining second point.
1776 New GEOM.GEOM_Object, containing the created box.
1778 # Example: see GEOM_TestAll.py
1779 pnt1 = self.MakeVertex(x1,y1,z1)
1780 pnt2 = self.MakeVertex(x2,y2,z2)
1781 return self.MakeBoxTwoPnt(pnt1,pnt2)
1783 ## Create a box with specified dimensions along the coordinate axes
1784 # and with edges, parallel to the coordinate axes.
1785 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1786 # @param theDX Length of Box edges, parallel to OX axis.
1787 # @param theDY Length of Box edges, parallel to OY axis.
1788 # @param theDZ Length of Box edges, parallel to OZ axis.
1789 # @return New GEOM.GEOM_Object, containing the created box.
1791 # @ref tui_creation_box "Example"
1792 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1794 Create a box with specified dimensions along the coordinate axes
1795 and with edges, parallel to the coordinate axes.
1796 Center of the box will be at point (DX/2, DY/2, DZ/2).
1799 theDX Length of Box edges, parallel to OX axis.
1800 theDY Length of Box edges, parallel to OY axis.
1801 theDZ Length of Box edges, parallel to OZ axis.
1804 New GEOM.GEOM_Object, containing the created box.
1806 # Example: see GEOM_TestAll.py
1807 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1808 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1809 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1810 anObj.SetParameters(Parameters)
1813 ## Create a box with two specified opposite vertices,
1814 # and with edges, parallel to the coordinate axes
1815 # @param thePnt1 First of two opposite vertices.
1816 # @param thePnt2 Second of two opposite vertices.
1817 # @return New GEOM.GEOM_Object, containing the created box.
1819 # @ref tui_creation_box "Example"
1820 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1822 Create a box with two specified opposite vertices,
1823 and with edges, parallel to the coordinate axes
1826 thePnt1 First of two opposite vertices.
1827 thePnt2 Second of two opposite vertices.
1830 New GEOM.GEOM_Object, containing the created box.
1832 # Example: see GEOM_TestAll.py
1833 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1834 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1837 ## Create a face with specified dimensions along OX-OY coordinate axes,
1838 # with edges, parallel to this coordinate axes.
1839 # @param theH height of Face.
1840 # @param theW width of Face.
1841 # @param theOrientation orientation belong axis OXY OYZ OZX
1842 # @return New GEOM.GEOM_Object, containing the created face.
1844 # @ref tui_creation_face "Example"
1845 def MakeFaceHW(self,theH, theW, theOrientation):
1847 Create a face with specified dimensions along OX-OY coordinate axes,
1848 with edges, parallel to this coordinate axes.
1851 theH height of Face.
1853 theOrientation orientation belong axis OXY OYZ OZX
1856 New GEOM.GEOM_Object, containing the created face.
1858 # Example: see GEOM_TestAll.py
1859 theH,theW,Parameters = ParseParameters(theH, theW)
1860 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1861 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1862 anObj.SetParameters(Parameters)
1865 ## Create a face from another plane and two sizes,
1866 # vertical size and horisontal size.
1867 # @param theObj Normale vector to the creating face or
1869 # @param theH Height (vertical size).
1870 # @param theW Width (horisontal size).
1871 # @return New GEOM.GEOM_Object, containing the created face.
1873 # @ref tui_creation_face "Example"
1874 def MakeFaceObjHW(self, theObj, theH, theW):
1876 Create a face from another plane and two sizes,
1877 vertical size and horisontal size.
1880 theObj Normale vector to the creating face or
1882 theH Height (vertical size).
1883 theW Width (horisontal size).
1886 New GEOM_Object, containing the created face.
1888 # Example: see GEOM_TestAll.py
1889 theH,theW,Parameters = ParseParameters(theH, theW)
1890 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1891 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1892 anObj.SetParameters(Parameters)
1895 ## Create a disk with given center, normal vector and radius.
1896 # @param thePnt Disk center.
1897 # @param theVec Vector, normal to the plane of the disk.
1898 # @param theR Disk radius.
1899 # @return New GEOM.GEOM_Object, containing the created disk.
1901 # @ref tui_creation_disk "Example"
1902 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1904 Create a disk with given center, normal vector and radius.
1908 theVec Vector, normal to the plane of the disk.
1912 New GEOM.GEOM_Object, containing the created disk.
1914 # Example: see GEOM_TestAll.py
1915 theR,Parameters = ParseParameters(theR)
1916 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1917 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1918 anObj.SetParameters(Parameters)
1921 ## Create a disk, passing through three given points
1922 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1923 # @return New GEOM.GEOM_Object, containing the created disk.
1925 # @ref tui_creation_disk "Example"
1926 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1928 Create a disk, passing through three given points
1931 thePnt1,thePnt2,thePnt3 Points, defining the disk.
1934 New GEOM.GEOM_Object, containing the created disk.
1936 # Example: see GEOM_TestAll.py
1937 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1938 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1941 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1942 # @param theR Radius of Face.
1943 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1944 # @return New GEOM.GEOM_Object, containing the created disk.
1946 # @ref tui_creation_face "Example"
1947 def MakeDiskR(self,theR, theOrientation):
1949 Create a disk with specified dimensions along OX-OY coordinate axes.
1952 theR Radius of Face.
1953 theOrientation set the orientation belong axis OXY or OYZ or OZX
1956 New GEOM.GEOM_Object, containing the created disk.
1959 Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object
1961 # Example: see GEOM_TestAll.py
1962 theR,Parameters = ParseParameters(theR)
1963 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1964 RaiseIfFailed("MakeDiskR", self.PrimOp)
1965 anObj.SetParameters(Parameters)
1968 ## Create a cylinder with given base point, axis, radius and height.
1969 # @param thePnt Central point of cylinder base.
1970 # @param theAxis Cylinder axis.
1971 # @param theR Cylinder radius.
1972 # @param theH Cylinder height.
1973 # @return New GEOM.GEOM_Object, containing the created cylinder.
1975 # @ref tui_creation_cylinder "Example"
1976 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1978 Create a cylinder with given base point, axis, radius and height.
1981 thePnt Central point of cylinder base.
1982 theAxis Cylinder axis.
1983 theR Cylinder radius.
1984 theH Cylinder height.
1987 New GEOM.GEOM_Object, containing the created cylinder.
1989 # Example: see GEOM_TestAll.py
1990 theR,theH,Parameters = ParseParameters(theR, theH)
1991 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1992 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1993 anObj.SetParameters(Parameters)
1996 ## Create a cylinder with given radius and height at
1997 # the origin of coordinate system. Axis of the cylinder
1998 # will be collinear to the OZ axis of the coordinate system.
1999 # @param theR Cylinder radius.
2000 # @param theH Cylinder height.
2001 # @return New GEOM.GEOM_Object, containing the created cylinder.
2003 # @ref tui_creation_cylinder "Example"
2004 def MakeCylinderRH(self,theR, theH):
2006 Create a cylinder with given radius and height at
2007 the origin of coordinate system. Axis of the cylinder
2008 will be collinear to the OZ axis of the coordinate system.
2011 theR Cylinder radius.
2012 theH Cylinder height.
2015 New GEOM.GEOM_Object, containing the created cylinder.
2017 # Example: see GEOM_TestAll.py
2018 theR,theH,Parameters = ParseParameters(theR, theH)
2019 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2020 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2021 anObj.SetParameters(Parameters)
2024 ## Create a sphere with given center and radius.
2025 # @param thePnt Sphere center.
2026 # @param theR Sphere radius.
2027 # @return New GEOM.GEOM_Object, containing the created sphere.
2029 # @ref tui_creation_sphere "Example"
2030 def MakeSpherePntR(self, thePnt, theR):
2032 Create a sphere with given center and radius.
2035 thePnt Sphere center.
2039 New GEOM.GEOM_Object, containing the created sphere.
2041 # Example: see GEOM_TestAll.py
2042 theR,Parameters = ParseParameters(theR)
2043 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2044 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2045 anObj.SetParameters(Parameters)
2048 ## Create a sphere with given center and radius.
2049 # @param x,y,z Coordinates of sphere center.
2050 # @param theR Sphere radius.
2051 # @return New GEOM.GEOM_Object, containing the created sphere.
2053 # @ref tui_creation_sphere "Example"
2054 def MakeSphere(self, x, y, z, theR):
2056 Create a sphere with given center and radius.
2059 x,y,z Coordinates of sphere center.
2063 New GEOM.GEOM_Object, containing the created sphere.
2065 # Example: see GEOM_TestAll.py
2066 point = self.MakeVertex(x, y, z)
2067 anObj = self.MakeSpherePntR(point, theR)
2070 ## Create a sphere with given radius at the origin of coordinate system.
2071 # @param theR Sphere radius.
2072 # @return New GEOM.GEOM_Object, containing the created sphere.
2074 # @ref tui_creation_sphere "Example"
2075 def MakeSphereR(self, theR):
2077 Create a sphere with given radius at the origin of coordinate system.
2083 New GEOM.GEOM_Object, containing the created sphere.
2085 # Example: see GEOM_TestAll.py
2086 theR,Parameters = ParseParameters(theR)
2087 anObj = self.PrimOp.MakeSphereR(theR)
2088 RaiseIfFailed("MakeSphereR", self.PrimOp)
2089 anObj.SetParameters(Parameters)
2092 ## Create a cone with given base point, axis, height and radiuses.
2093 # @param thePnt Central point of the first cone base.
2094 # @param theAxis Cone axis.
2095 # @param theR1 Radius of the first cone base.
2096 # @param theR2 Radius of the second cone base.
2097 # \note If both radiuses are non-zero, the cone will be truncated.
2098 # \note If the radiuses are equal, a cylinder will be created instead.
2099 # @param theH Cone height.
2100 # @return New GEOM.GEOM_Object, containing the created cone.
2102 # @ref tui_creation_cone "Example"
2103 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2105 Create a cone with given base point, axis, height and radiuses.
2108 thePnt Central point of the first cone base.
2110 theR1 Radius of the first cone base.
2111 theR2 Radius of the second cone base.
2115 If both radiuses are non-zero, the cone will be truncated.
2116 If the radiuses are equal, a cylinder will be created instead.
2119 New GEOM.GEOM_Object, containing the created cone.
2121 # Example: see GEOM_TestAll.py
2122 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2123 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2124 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2125 anObj.SetParameters(Parameters)
2128 ## Create a cone with given height and radiuses at
2129 # the origin of coordinate system. Axis of the cone will
2130 # be collinear to the OZ axis of the coordinate system.
2131 # @param theR1 Radius of the first cone base.
2132 # @param theR2 Radius of the second cone base.
2133 # \note If both radiuses are non-zero, the cone will be truncated.
2134 # \note If the radiuses are equal, a cylinder will be created instead.
2135 # @param theH Cone height.
2136 # @return New GEOM.GEOM_Object, containing the created cone.
2138 # @ref tui_creation_cone "Example"
2139 def MakeConeR1R2H(self,theR1, theR2, theH):
2141 Create a cone with given height and radiuses at
2142 the origin of coordinate system. Axis of the cone will
2143 be collinear to the OZ axis of the coordinate system.
2146 theR1 Radius of the first cone base.
2147 theR2 Radius of the second cone base.
2151 If both radiuses are non-zero, the cone will be truncated.
2152 If the radiuses are equal, a cylinder will be created instead.
2155 New GEOM.GEOM_Object, containing the created cone.
2157 # Example: see GEOM_TestAll.py
2158 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2159 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2160 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2161 anObj.SetParameters(Parameters)
2164 ## Create a torus with given center, normal vector and radiuses.
2165 # @param thePnt Torus central point.
2166 # @param theVec Torus axis of symmetry.
2167 # @param theRMajor Torus major radius.
2168 # @param theRMinor Torus minor radius.
2169 # @return New GEOM.GEOM_Object, containing the created torus.
2171 # @ref tui_creation_torus "Example"
2172 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2174 Create a torus with given center, normal vector and radiuses.
2177 thePnt Torus central point.
2178 theVec Torus axis of symmetry.
2179 theRMajor Torus major radius.
2180 theRMinor Torus minor radius.
2183 New GEOM.GEOM_Object, containing the created torus.
2185 # Example: see GEOM_TestAll.py
2186 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2187 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2188 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2189 anObj.SetParameters(Parameters)
2192 ## Create a torus with given radiuses at the origin of coordinate system.
2193 # @param theRMajor Torus major radius.
2194 # @param theRMinor Torus minor radius.
2195 # @return New GEOM.GEOM_Object, containing the created torus.
2197 # @ref tui_creation_torus "Example"
2198 def MakeTorusRR(self, theRMajor, theRMinor):
2200 Create a torus with given radiuses at the origin of coordinate system.
2203 theRMajor Torus major radius.
2204 theRMinor Torus minor radius.
2207 New GEOM.GEOM_Object, containing the created torus.
2209 # Example: see GEOM_TestAll.py
2210 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2211 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2212 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2213 anObj.SetParameters(Parameters)
2216 # end of l3_3d_primitives
2219 ## @addtogroup l3_complex
2222 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2223 # @param theBase Base shape to be extruded.
2224 # @param thePoint1 First end of extrusion vector.
2225 # @param thePoint2 Second end of extrusion vector.
2226 # @param theScaleFactor Use it to make prism with scaled second base.
2227 # Nagative value means not scaled second base.
2228 # @return New GEOM.GEOM_Object, containing the created prism.
2230 # @ref tui_creation_prism "Example"
2231 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2233 Create a shape by extrusion of the base shape along a vector, defined by two points.
2236 theBase Base shape to be extruded.
2237 thePoint1 First end of extrusion vector.
2238 thePoint2 Second end of extrusion vector.
2239 theScaleFactor Use it to make prism with scaled second base.
2240 Nagative value means not scaled second base.
2243 New GEOM.GEOM_Object, containing the created prism.
2245 # Example: see GEOM_TestAll.py
2248 if theScaleFactor > 0:
2249 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2250 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2252 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2253 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2254 anObj.SetParameters(Parameters)
2257 ## Create a shape by extrusion of the base shape along a
2258 # vector, defined by two points, in 2 Ways (forward/backward).
2259 # @param theBase Base shape to be extruded.
2260 # @param thePoint1 First end of extrusion vector.
2261 # @param thePoint2 Second end of extrusion vector.
2262 # @return New GEOM.GEOM_Object, containing the created prism.
2264 # @ref tui_creation_prism "Example"
2265 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2267 Create a shape by extrusion of the base shape along a
2268 vector, defined by two points, in 2 Ways (forward/backward).
2271 theBase Base shape to be extruded.
2272 thePoint1 First end of extrusion vector.
2273 thePoint2 Second end of extrusion vector.
2276 New GEOM.GEOM_Object, containing the created prism.
2278 # Example: see GEOM_TestAll.py
2279 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2280 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2283 ## Create a shape by extrusion of the base shape along the vector,
2284 # i.e. all the space, transfixed by the base shape during its translation
2285 # along the vector on the given distance.
2286 # @param theBase Base shape to be extruded.
2287 # @param theVec Direction of extrusion.
2288 # @param theH Prism dimension along theVec.
2289 # @param theScaleFactor Use it to make prism with scaled second base.
2290 # Negative value means not scaled second base.
2291 # @return New GEOM.GEOM_Object, containing the created prism.
2293 # @ref tui_creation_prism "Example"
2294 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2296 Create a shape by extrusion of the base shape along the vector,
2297 i.e. all the space, transfixed by the base shape during its translation
2298 along the vector on the given distance.
2301 theBase Base shape to be extruded.
2302 theVec Direction of extrusion.
2303 theH Prism dimension along theVec.
2304 theScaleFactor Use it to make prism with scaled second base.
2305 Negative value means not scaled second base.
2308 New GEOM.GEOM_Object, containing the created prism.
2310 # Example: see GEOM_TestAll.py
2313 if theScaleFactor > 0:
2314 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2315 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2317 theH,Parameters = ParseParameters(theH)
2318 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2319 RaiseIfFailed("MakePrismVecH", self.PrimOp)
2320 anObj.SetParameters(Parameters)
2323 ## Create a shape by extrusion of the base shape along the vector,
2324 # i.e. all the space, transfixed by the base shape during its translation
2325 # along the vector on the given distance in 2 Ways (forward/backward).
2326 # @param theBase Base shape to be extruded.
2327 # @param theVec Direction of extrusion.
2328 # @param theH Prism dimension along theVec in forward direction.
2329 # @return New GEOM.GEOM_Object, containing the created prism.
2331 # @ref tui_creation_prism "Example"
2332 def MakePrismVecH2Ways(self, theBase, theVec, theH):
2334 Create a shape by extrusion of the base shape along the vector,
2335 i.e. all the space, transfixed by the base shape during its translation
2336 along the vector on the given distance in 2 Ways (forward/backward).
2339 theBase Base shape to be extruded.
2340 theVec Direction of extrusion.
2341 theH Prism dimension along theVec in forward direction.
2344 New GEOM.GEOM_Object, containing the created prism.
2346 # Example: see GEOM_TestAll.py
2347 theH,Parameters = ParseParameters(theH)
2348 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2349 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2350 anObj.SetParameters(Parameters)
2353 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2354 # @param theBase Base shape to be extruded.
2355 # @param theDX, theDY, theDZ Directions of extrusion.
2356 # @param theScaleFactor Use it to make prism with scaled second base.
2357 # Nagative value means not scaled second base.
2358 # @return New GEOM.GEOM_Object, containing the created prism.
2360 # @ref tui_creation_prism "Example"
2361 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2363 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2366 theBase Base shape to be extruded.
2367 theDX, theDY, theDZ Directions of extrusion.
2368 theScaleFactor Use it to make prism with scaled second base.
2369 Nagative value means not scaled second base.
2372 New GEOM.GEOM_Object, containing the created prism.
2374 # Example: see GEOM_TestAll.py
2377 if theScaleFactor > 0:
2378 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2379 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2381 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2382 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2383 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2384 anObj.SetParameters(Parameters)
2387 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2388 # i.e. all the space, transfixed by the base shape during its translation
2389 # along the vector on the given distance in 2 Ways (forward/backward).
2390 # @param theBase Base shape to be extruded.
2391 # @param theDX, theDY, theDZ Directions of extrusion.
2392 # @return New GEOM.GEOM_Object, containing the created prism.
2394 # @ref tui_creation_prism "Example"
2395 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2397 Create a shape by extrusion of the base shape along the dx, dy, dz direction
2398 i.e. all the space, transfixed by the base shape during its translation
2399 along the vector on the given distance in 2 Ways (forward/backward).
2402 theBase Base shape to be extruded.
2403 theDX, theDY, theDZ Directions of extrusion.
2406 New GEOM.GEOM_Object, containing the created prism.
2408 # Example: see GEOM_TestAll.py
2409 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2410 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2411 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2412 anObj.SetParameters(Parameters)
2415 ## Create a shape by revolution of the base shape around the axis
2416 # on the given angle, i.e. all the space, transfixed by the base
2417 # shape during its rotation around the axis on the given angle.
2418 # @param theBase Base shape to be rotated.
2419 # @param theAxis Rotation axis.
2420 # @param theAngle Rotation angle in radians.
2421 # @return New GEOM.GEOM_Object, containing the created revolution.
2423 # @ref tui_creation_revolution "Example"
2424 def MakeRevolution(self, theBase, theAxis, theAngle):
2426 Create a shape by revolution of the base shape around the axis
2427 on the given angle, i.e. all the space, transfixed by the base
2428 shape during its rotation around the axis on the given angle.
2431 theBase Base shape to be rotated.
2432 theAxis Rotation axis.
2433 theAngle Rotation angle in radians.
2436 New GEOM.GEOM_Object, containing the created revolution.
2438 # Example: see GEOM_TestAll.py
2439 theAngle,Parameters = ParseParameters(theAngle)
2440 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2441 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2442 anObj.SetParameters(Parameters)
2445 ## Create a shape by revolution of the base shape around the axis
2446 # on the given angle, i.e. all the space, transfixed by the base
2447 # shape during its rotation around the axis on the given angle in
2448 # both directions (forward/backward)
2449 # @param theBase Base shape to be rotated.
2450 # @param theAxis Rotation axis.
2451 # @param theAngle Rotation angle in radians.
2452 # @return New GEOM.GEOM_Object, containing the created revolution.
2454 # @ref tui_creation_revolution "Example"
2455 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2457 Create a shape by revolution of the base shape around the axis
2458 on the given angle, i.e. all the space, transfixed by the base
2459 shape during its rotation around the axis on the given angle in
2460 both directions (forward/backward).
2463 theBase Base shape to be rotated.
2464 theAxis Rotation axis.
2465 theAngle Rotation angle in radians.
2468 New GEOM.GEOM_Object, containing the created revolution.
2470 theAngle,Parameters = ParseParameters(theAngle)
2471 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2472 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2473 anObj.SetParameters(Parameters)
2476 ## Create a filling from the given compound of contours.
2477 # @param theShape the compound of contours
2478 # @param theMinDeg a minimal degree of BSpline surface to create
2479 # @param theMaxDeg a maximal degree of BSpline surface to create
2480 # @param theTol2D a 2d tolerance to be reached
2481 # @param theTol3D a 3d tolerance to be reached
2482 # @param theNbIter a number of iteration of approximation algorithm
2483 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2484 # @param isApprox if True, BSpline curves are generated in the process
2485 # of surface construction. By default it is False, that means
2486 # the surface is created using Besier curves. The usage of
2487 # Approximation makes the algorithm work slower, but allows
2488 # building the surface for rather complex cases
2489 # @return New GEOM.GEOM_Object, containing the created filling surface.
2491 # @ref tui_creation_filling "Example"
2492 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
2493 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
2495 Create a filling from the given compound of contours.
2498 theShape the compound of contours
2499 theMinDeg a minimal degree of BSpline surface to create
2500 theMaxDeg a maximal degree of BSpline surface to create
2501 theTol2D a 2d tolerance to be reached
2502 theTol3D a 3d tolerance to be reached
2503 theNbIter a number of iteration of approximation algorithm
2504 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2505 isApprox if True, BSpline curves are generated in the process
2506 of surface construction. By default it is False, that means
2507 the surface is created using Besier curves. The usage of
2508 Approximation makes the algorithm work slower, but allows
2509 building the surface for rather complex cases
2512 New GEOM.GEOM_Object, containing the created filling surface.
2515 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2517 # Example: see GEOM_TestAll.py
2518 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2519 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2520 theTol2D, theTol3D, theNbIter,
2521 theMethod, isApprox)
2522 RaiseIfFailed("MakeFilling", self.PrimOp)
2523 anObj.SetParameters(Parameters)
2526 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2527 # @param theSeqSections - set of specified sections.
2528 # @param theModeSolid - mode defining building solid or shell
2529 # @param thePreci - precision 3D used for smoothing
2530 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2531 # @return New GEOM.GEOM_Object, containing the created shell or solid.
2533 # @ref swig_todo "Example"
2534 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2536 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2539 theSeqSections - set of specified sections.
2540 theModeSolid - mode defining building solid or shell
2541 thePreci - precision 3D used for smoothing
2542 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2545 New GEOM.GEOM_Object, containing the created shell or solid.
2547 # Example: see GEOM_TestAll.py
2548 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2549 RaiseIfFailed("MakeThruSections", self.PrimOp)
2552 ## Create a shape by extrusion of the base shape along
2553 # the path shape. The path shape can be a wire or an edge.
2554 # @param theBase Base shape to be extruded.
2555 # @param thePath Path shape to extrude the base shape along it.
2556 # @return New GEOM.GEOM_Object, containing the created pipe.
2558 # @ref tui_creation_pipe "Example"
2559 def MakePipe(self,theBase, thePath):
2561 Create a shape by extrusion of the base shape along
2562 the path shape. The path shape can be a wire or an edge.
2565 theBase Base shape to be extruded.
2566 thePath Path shape to extrude the base shape along it.
2569 New GEOM.GEOM_Object, containing the created pipe.
2571 # Example: see GEOM_TestAll.py
2572 anObj = self.PrimOp.MakePipe(theBase, thePath)
2573 RaiseIfFailed("MakePipe", self.PrimOp)
2576 ## Create a shape by extrusion of the profile shape along
2577 # the path shape. The path shape can be a wire or an edge.
2578 # the several profiles can be specified in the several locations of path.
2579 # @param theSeqBases - list of Bases shape to be extruded.
2580 # @param theLocations - list of locations on the path corresponding
2581 # specified list of the Bases shapes. Number of locations
2582 # should be equal to number of bases or list of locations can be empty.
2583 # @param thePath - Path shape to extrude the base shape along it.
2584 # @param theWithContact - the mode defining that the section is translated to be in
2585 # contact with the spine.
2586 # @param theWithCorrection - defining that the section is rotated to be
2587 # orthogonal to the spine tangent in the correspondent point
2588 # @return New GEOM.GEOM_Object, containing the created pipe.
2590 # @ref tui_creation_pipe_with_diff_sec "Example"
2591 def MakePipeWithDifferentSections(self, theSeqBases,
2592 theLocations, thePath,
2593 theWithContact, theWithCorrection):
2595 Create a shape by extrusion of the profile shape along
2596 the path shape. The path shape can be a wire or an edge.
2597 the several profiles can be specified in the several locations of path.
2600 theSeqBases - list of Bases shape to be extruded.
2601 theLocations - list of locations on the path corresponding
2602 specified list of the Bases shapes. Number of locations
2603 should be equal to number of bases or list of locations can be empty.
2604 thePath - Path shape to extrude the base shape along it.
2605 theWithContact - the mode defining that the section is translated to be in
2606 contact with the spine(0/1)
2607 theWithCorrection - defining that the section is rotated to be
2608 orthogonal to the spine tangent in the correspondent point (0/1)
2611 New GEOM.GEOM_Object, containing the created pipe.
2613 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2614 theLocations, thePath,
2615 theWithContact, theWithCorrection)
2616 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2619 ## Create a shape by extrusion of the profile shape along
2620 # the path shape. The path shape can be a wire or a edge.
2621 # the several profiles can be specified in the several locations of path.
2622 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
2623 # shell or face. If number of faces in neighbour sections
2624 # aren't coincided result solid between such sections will
2625 # be created using external boundaries of this shells.
2626 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2627 # This list is used for searching correspondences between
2628 # faces in the sections. Size of this list must be equal
2629 # to size of list of base shapes.
2630 # @param theLocations - list of locations on the path corresponding
2631 # specified list of the Bases shapes. Number of locations
2632 # should be equal to number of bases. First and last
2633 # locations must be coincided with first and last vertexes
2634 # of path correspondingly.
2635 # @param thePath - Path shape to extrude the base shape along it.
2636 # @param theWithContact - the mode defining that the section is translated to be in
2637 # contact with the spine.
2638 # @param theWithCorrection - defining that the section is rotated to be
2639 # orthogonal to the spine tangent in the correspondent point
2640 # @return New GEOM.GEOM_Object, containing the created solids.
2642 # @ref tui_creation_pipe_with_shell_sec "Example"
2643 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2644 theLocations, thePath,
2645 theWithContact, theWithCorrection):
2647 Create a shape by extrusion of the profile shape along
2648 the path shape. The path shape can be a wire or a edge.
2649 the several profiles can be specified in the several locations of path.
2652 theSeqBases - list of Bases shape to be extruded. Base shape must be
2653 shell or face. If number of faces in neighbour sections
2654 aren't coincided result solid between such sections will
2655 be created using external boundaries of this shells.
2656 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2657 This list is used for searching correspondences between
2658 faces in the sections. Size of this list must be equal
2659 to size of list of base shapes.
2660 theLocations - list of locations on the path corresponding
2661 specified list of the Bases shapes. Number of locations
2662 should be equal to number of bases. First and last
2663 locations must be coincided with first and last vertexes
2664 of path correspondingly.
2665 thePath - Path shape to extrude the base shape along it.
2666 theWithContact - the mode defining that the section is translated to be in
2667 contact with the spine (0/1)
2668 theWithCorrection - defining that the section is rotated to be
2669 orthogonal to the spine tangent in the correspondent point (0/1)
2672 New GEOM.GEOM_Object, containing the created solids.
2674 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2675 theLocations, thePath,
2676 theWithContact, theWithCorrection)
2677 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2680 ## Create a shape by extrusion of the profile shape along
2681 # the path shape. This function is used only for debug pipe
2682 # functionality - it is a version of function MakePipeWithShellSections()
2683 # which give a possibility to recieve information about
2684 # creating pipe between each pair of sections step by step.
2685 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2686 theLocations, thePath,
2687 theWithContact, theWithCorrection):
2689 Create a shape by extrusion of the profile shape along
2690 the path shape. This function is used only for debug pipe
2691 functionality - it is a version of previous function
2692 geompy.MakePipeWithShellSections() which give a possibility to
2693 recieve information about creating pipe between each pair of
2694 sections step by step.
2697 nbsect = len(theSeqBases)
2698 nbsubsect = len(theSeqSubBases)
2699 #print "nbsect = ",nbsect
2700 for i in range(1,nbsect):
2702 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2703 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2705 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2706 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2707 tmpLocations, thePath,
2708 theWithContact, theWithCorrection)
2709 if self.PrimOp.IsDone() == 0:
2710 print "Problems with pipe creation between ",i," and ",i+1," sections"
2711 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2714 print "Pipe between ",i," and ",i+1," sections is OK"
2719 resc = self.MakeCompound(res)
2720 #resc = self.MakeSewing(res, 0.001)
2721 #print "resc: ",resc
2724 ## Create solids between given sections
2725 # @param theSeqBases - list of sections (shell or face).
2726 # @param theLocations - list of corresponding vertexes
2727 # @return New GEOM.GEOM_Object, containing the created solids.
2729 # @ref tui_creation_pipe_without_path "Example"
2730 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2732 Create solids between given sections
2735 theSeqBases - list of sections (shell or face).
2736 theLocations - list of corresponding vertexes
2739 New GEOM.GEOM_Object, containing the created solids.
2741 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2742 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2745 ## Create a shape by extrusion of the base shape along
2746 # the path shape with constant bi-normal direction along the given vector.
2747 # The path shape can be a wire or an edge.
2748 # @param theBase Base shape to be extruded.
2749 # @param thePath Path shape to extrude the base shape along it.
2750 # @param theVec Vector defines a constant binormal direction to keep the
2751 # same angle beetween the direction and the sections
2752 # along the sweep surface.
2753 # @return New GEOM.GEOM_Object, containing the created pipe.
2755 # @ref tui_creation_pipe "Example"
2756 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2758 Create a shape by extrusion of the base shape along
2759 the path shape with constant bi-normal direction along the given vector.
2760 The path shape can be a wire or an edge.
2763 theBase Base shape to be extruded.
2764 thePath Path shape to extrude the base shape along it.
2765 theVec Vector defines a constant binormal direction to keep the
2766 same angle beetween the direction and the sections
2767 along the sweep surface.
2770 New GEOM.GEOM_Object, containing the created pipe.
2772 # Example: see GEOM_TestAll.py
2773 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2774 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2780 ## @addtogroup l3_advanced
2783 ## Create a linear edge with specified ends.
2784 # @param thePnt1 Point for the first end of edge.
2785 # @param thePnt2 Point for the second end of edge.
2786 # @return New GEOM.GEOM_Object, containing the created edge.
2788 # @ref tui_creation_edge "Example"
2789 def MakeEdge(self,thePnt1, thePnt2):
2791 Create a linear edge with specified ends.
2794 thePnt1 Point for the first end of edge.
2795 thePnt2 Point for the second end of edge.
2798 New GEOM.GEOM_Object, containing the created edge.
2800 # Example: see GEOM_TestAll.py
2801 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
2802 RaiseIfFailed("MakeEdge", self.ShapesOp)
2805 ## Create a new edge, corresponding to the given length on the given curve.
2806 # @param theRefCurve The referenced curve (edge).
2807 # @param theLength Length on the referenced curve. It can be negative.
2808 # @param theStartPoint Any point can be selected for it, the new edge will begin
2809 # at the end of \a theRefCurve, close to the selected point.
2810 # If None, start from the first point of \a theRefCurve.
2811 # @return New GEOM.GEOM_Object, containing the created edge.
2813 # @ref tui_creation_edge "Example"
2814 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
2816 Create a new edge, corresponding to the given length on the given curve.
2819 theRefCurve The referenced curve (edge).
2820 theLength Length on the referenced curve. It can be negative.
2821 theStartPoint Any point can be selected for it, the new edge will begin
2822 at the end of theRefCurve, close to the selected point.
2823 If None, start from the first point of theRefCurve.
2826 New GEOM.GEOM_Object, containing the created edge.
2828 # Example: see GEOM_TestAll.py
2829 theLength, Parameters = ParseParameters(theLength)
2830 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
2831 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
2832 anObj.SetParameters(Parameters)
2835 ## Create an edge from specified wire.
2836 # @param theWire source Wire
2837 # @param theLinearTolerance linear tolerance value (default = 1e-07)
2838 # @param theAngularTolerance angular tolerance value (default = 1e-12)
2839 # @return New GEOM.GEOM_Object, containing the created edge.
2841 # @ref tui_creation_edge "Example"
2842 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
2844 Create an edge from specified wire.
2848 theLinearTolerance linear tolerance value (default = 1e-07)
2849 theAngularTolerance angular tolerance value (default = 1e-12)
2852 New GEOM.GEOM_Object, containing the created edge.
2854 # Example: see GEOM_TestAll.py
2855 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
2856 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
2859 ## Create a wire from the set of edges and wires.
2860 # @param theEdgesAndWires List of edges and/or wires.
2861 # @param theTolerance Maximum distance between vertices, that will be merged.
2862 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
2863 # @return New GEOM.GEOM_Object, containing the created wire.
2865 # @ref tui_creation_wire "Example"
2866 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
2868 Create a wire from the set of edges and wires.
2871 theEdgesAndWires List of edges and/or wires.
2872 theTolerance Maximum distance between vertices, that will be merged.
2873 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
2876 New GEOM.GEOM_Object, containing the created wire.
2878 # Example: see GEOM_TestAll.py
2879 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
2880 RaiseIfFailed("MakeWire", self.ShapesOp)
2883 ## Create a face on the given wire.
2884 # @param theWire closed Wire or Edge to build the face on.
2885 # @param isPlanarWanted If TRUE, only planar face will be built.
2886 # If impossible, NULL object will be returned.
2887 # @return New GEOM.GEOM_Object, containing the created face.
2889 # @ref tui_creation_face "Example"
2890 def MakeFace(self, theWire, isPlanarWanted):
2892 Create a face on the given wire.
2895 theWire closed Wire or Edge to build the face on.
2896 isPlanarWanted If TRUE, only planar face will be built.
2897 If impossible, NULL object will be returned.
2900 New GEOM.GEOM_Object, containing the created face.
2902 # Example: see GEOM_TestAll.py
2903 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
2904 if anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
2905 if os.getenv("GEOM_MAKEFACE_ALLOW_NONPLANAR") is not None:
2906 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
2908 RaiseIfFailed("MakeFace", self.ShapesOp)
2910 RaiseIfFailed("MakeFace", self.ShapesOp)
2913 ## Create a face on the given wires set.
2914 # @param theWires List of closed wires or edges to build the face on.
2915 # @param isPlanarWanted If TRUE, only planar face will be built.
2916 # If impossible, NULL object will be returned.
2917 # @return New GEOM.GEOM_Object, containing the created face.
2919 # @ref tui_creation_face "Example"
2920 def MakeFaceWires(self, theWires, isPlanarWanted):
2922 Create a face on the given wires set.
2925 theWires List of closed wires or edges to build the face on.
2926 isPlanarWanted If TRUE, only planar face will be built.
2927 If impossible, NULL object will be returned.
2930 New GEOM.GEOM_Object, containing the created face.
2932 # Example: see GEOM_TestAll.py
2933 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
2934 if anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
2935 if os.getenv("GEOM_MAKEFACE_ALLOW_NONPLANAR") is not None:
2936 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
2938 RaiseIfFailed("MakeFace", self.ShapesOp)
2940 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
2943 ## See MakeFaceWires() method for details.
2945 # @ref tui_creation_face "Example 1"
2946 # \n @ref swig_MakeFaces "Example 2"
2947 def MakeFaces(self, theWires, isPlanarWanted):
2949 See geompy.MakeFaceWires() method for details.
2951 # Example: see GEOM_TestOthers.py
2952 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
2955 ## Create a shell from the set of faces and shells.
2956 # @param theFacesAndShells List of faces and/or shells.
2957 # @return New GEOM.GEOM_Object, containing the created shell.
2959 # @ref tui_creation_shell "Example"
2960 def MakeShell(self,theFacesAndShells):
2962 Create a shell from the set of faces and shells.
2965 theFacesAndShells List of faces and/or shells.
2968 New GEOM.GEOM_Object, containing the created shell.
2970 # Example: see GEOM_TestAll.py
2971 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
2972 RaiseIfFailed("MakeShell", self.ShapesOp)
2975 ## Create a solid, bounded by the given shells.
2976 # @param theShells Sequence of bounding shells.
2977 # @return New GEOM.GEOM_Object, containing the created solid.
2979 # @ref tui_creation_solid "Example"
2980 def MakeSolid(self,theShells):
2982 Create a solid, bounded by the given shells.
2985 theShells Sequence of bounding shells.
2988 New GEOM.GEOM_Object, containing the created solid.
2990 # Example: see GEOM_TestAll.py
2991 anObj = self.ShapesOp.MakeSolidShells(theShells)
2992 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
2995 ## Create a compound of the given shapes.
2996 # @param theShapes List of shapes to put in compound.
2997 # @return New GEOM.GEOM_Object, containing the created compound.
2999 # @ref tui_creation_compound "Example"
3000 def MakeCompound(self,theShapes):
3002 Create a compound of the given shapes.
3005 theShapes List of shapes to put in compound.
3008 New GEOM.GEOM_Object, containing the created compound.
3010 # Example: see GEOM_TestAll.py
3011 anObj = self.ShapesOp.MakeCompound(theShapes)
3012 RaiseIfFailed("MakeCompound", self.ShapesOp)
3015 # end of l3_advanced
3018 ## @addtogroup l2_measure
3021 ## Gives quantity of faces in the given shape.
3022 # @param theShape Shape to count faces of.
3023 # @return Quantity of faces.
3025 # @ref swig_NumberOf "Example"
3026 def NumberOfFaces(self, theShape):
3028 Gives quantity of faces in the given shape.
3031 theShape Shape to count faces of.
3036 # Example: see GEOM_TestOthers.py
3037 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3038 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3041 ## Gives quantity of edges in the given shape.
3042 # @param theShape Shape to count edges of.
3043 # @return Quantity of edges.
3045 # @ref swig_NumberOf "Example"
3046 def NumberOfEdges(self, theShape):
3048 Gives quantity of edges in the given shape.
3051 theShape Shape to count edges of.
3056 # Example: see GEOM_TestOthers.py
3057 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3058 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3061 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3062 # @param theShape Shape to count sub-shapes of.
3063 # @param theShapeType Type of sub-shapes to count (see ShapeType())
3064 # @return Quantity of sub-shapes of given type.
3066 # @ref swig_NumberOf "Example"
3067 def NumberOfSubShapes(self, theShape, theShapeType):
3069 Gives quantity of sub-shapes of type theShapeType in the given shape.
3072 theShape Shape to count sub-shapes of.
3073 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3076 Quantity of sub-shapes of given type.
3078 # Example: see GEOM_TestOthers.py
3079 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3080 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3083 ## Gives quantity of solids in the given shape.
3084 # @param theShape Shape to count solids in.
3085 # @return Quantity of solids.
3087 # @ref swig_NumberOf "Example"
3088 def NumberOfSolids(self, theShape):
3090 Gives quantity of solids in the given shape.
3093 theShape Shape to count solids in.
3098 # Example: see GEOM_TestOthers.py
3099 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3100 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3106 ## @addtogroup l3_healing
3109 ## Reverses an orientation the given shape.
3110 # @param theShape Shape to be reversed.
3111 # @return The reversed copy of theShape.
3113 # @ref swig_ChangeOrientation "Example"
3114 def ChangeOrientation(self,theShape):
3116 Reverses an orientation the given shape.
3119 theShape Shape to be reversed.
3122 The reversed copy of theShape.
3124 # Example: see GEOM_TestAll.py
3125 anObj = self.ShapesOp.ChangeOrientation(theShape)
3126 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3129 ## See ChangeOrientation() method for details.
3131 # @ref swig_OrientationChange "Example"
3132 def OrientationChange(self,theShape):
3134 See geompy.ChangeOrientation method for details.
3136 # Example: see GEOM_TestOthers.py
3137 anObj = self.ChangeOrientation(theShape)
3143 ## @addtogroup l4_obtain
3146 ## Retrieve all free faces from the given shape.
3147 # Free face is a face, which is not shared between two shells of the shape.
3148 # @param theShape Shape to find free faces in.
3149 # @return List of IDs of all free faces, contained in theShape.
3151 # @ref tui_measurement_tools_page "Example"
3152 def GetFreeFacesIDs(self,theShape):
3154 Retrieve all free faces from the given shape.
3155 Free face is a face, which is not shared between two shells of the shape.
3158 theShape Shape to find free faces in.
3161 List of IDs of all free faces, contained in theShape.
3163 # Example: see GEOM_TestOthers.py
3164 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3165 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3168 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3169 # @param theShape1 Shape to find sub-shapes in.
3170 # @param theShape2 Shape to find shared sub-shapes with.
3171 # @param theShapeType Type of sub-shapes to be retrieved.
3172 # @return List of sub-shapes of theShape1, shared with theShape2.
3174 # @ref swig_GetSharedShapes "Example"
3175 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3177 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3180 theShape1 Shape to find sub-shapes in.
3181 theShape2 Shape to find shared sub-shapes with.
3182 theShapeType Type of sub-shapes to be retrieved.
3185 List of sub-shapes of theShape1, shared with theShape2.
3187 # Example: see GEOM_TestOthers.py
3188 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3189 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3192 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3193 # @param theShapes Shapes to find common sub-shapes of.
3194 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3195 # @return List of objects, that are sub-shapes of all given shapes.
3197 # @ref swig_GetSharedShapes "Example"
3198 def GetSharedShapesMulti(self, theShapes, theShapeType):
3200 Get all sub-shapes, shared by all shapes in the list theShapes.
3203 theShapes Shapes to find common sub-shapes of.
3204 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3207 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3209 # Example: see GEOM_TestOthers.py
3210 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3211 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3214 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3215 # situated relatively the specified plane by the certain way,
3216 # defined through <VAR>theState</VAR> parameter.
3217 # @param theShape Shape to find sub-shapes of.
3218 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3219 # @param theAx1 Vector (or line, or linear edge), specifying normal
3220 # direction and location of the plane to find shapes on.
3221 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3222 # @return List of all found sub-shapes.
3224 # @ref swig_GetShapesOnPlane "Example"
3225 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3227 Find in theShape all sub-shapes of type theShapeType,
3228 situated relatively the specified plane by the certain way,
3229 defined through theState parameter.
3232 theShape Shape to find sub-shapes of.
3233 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3234 theAx1 Vector (or line, or linear edge), specifying normal
3235 direction and location of the plane to find shapes on.
3236 theState The state of the sub-shapes to find (see GEOM::shape_state)
3239 List of all found sub-shapes.
3241 # Example: see GEOM_TestOthers.py
3242 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3243 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3246 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3247 # situated relatively the specified plane by the certain way,
3248 # defined through <VAR>theState</VAR> parameter.
3249 # @param theShape Shape to find sub-shapes of.
3250 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3251 # @param theAx1 Vector (or line, or linear edge), specifying normal
3252 # direction and location of the plane to find shapes on.
3253 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3254 # @return List of all found sub-shapes indices.
3256 # @ref swig_GetShapesOnPlaneIDs "Example"
3257 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3259 Find in theShape all sub-shapes of type theShapeType,
3260 situated relatively the specified plane by the certain way,
3261 defined through theState parameter.
3264 theShape Shape to find sub-shapes of.
3265 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3266 theAx1 Vector (or line, or linear edge), specifying normal
3267 direction and location of the plane to find shapes on.
3268 theState The state of the sub-shapes to find (see GEOM::shape_state)
3271 List of all found sub-shapes indices.
3273 # Example: see GEOM_TestOthers.py
3274 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3275 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3278 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3279 # situated relatively the specified plane by the certain way,
3280 # defined through <VAR>theState</VAR> parameter.
3281 # @param theShape Shape to find sub-shapes of.
3282 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3283 # @param theAx1 Vector (or line, or linear edge), specifying normal
3284 # direction of the plane to find shapes on.
3285 # @param thePnt Point specifying location of the plane to find shapes on.
3286 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3287 # @return List of all found sub-shapes.
3289 # @ref swig_GetShapesOnPlaneWithLocation "Example"
3290 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3292 Find in theShape all sub-shapes of type theShapeType,
3293 situated relatively the specified plane by the certain way,
3294 defined through theState parameter.
3297 theShape Shape to find sub-shapes of.
3298 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3299 theAx1 Vector (or line, or linear edge), specifying normal
3300 direction and location of the plane to find shapes on.
3301 thePnt Point specifying location of the plane to find shapes on.
3302 theState The state of the sub-shapes to find (see GEOM::shape_state)
3305 List of all found sub-shapes.
3307 # Example: see GEOM_TestOthers.py
3308 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3309 theAx1, thePnt, theState)
3310 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3313 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3314 # situated relatively the specified plane by the certain way,
3315 # defined through <VAR>theState</VAR> parameter.
3316 # @param theShape Shape to find sub-shapes of.
3317 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3318 # @param theAx1 Vector (or line, or linear edge), specifying normal
3319 # direction of the plane to find shapes on.
3320 # @param thePnt Point specifying location of the plane to find shapes on.
3321 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3322 # @return List of all found sub-shapes indices.
3324 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3325 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3327 Find in theShape all sub-shapes of type theShapeType,
3328 situated relatively the specified plane by the certain way,
3329 defined through theState parameter.
3332 theShape Shape to find sub-shapes of.
3333 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3334 theAx1 Vector (or line, or linear edge), specifying normal
3335 direction and location of the plane to find shapes on.
3336 thePnt Point specifying location of the plane to find shapes on.
3337 theState The state of the sub-shapes to find (see GEOM::shape_state)
3340 List of all found sub-shapes indices.
3342 # Example: see GEOM_TestOthers.py
3343 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3344 theAx1, thePnt, theState)
3345 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3348 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3349 # the specified cylinder by the certain way, defined through \a theState parameter.
3350 # @param theShape Shape to find sub-shapes of.
3351 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3352 # @param theAxis Vector (or line, or linear edge), specifying
3353 # axis of the cylinder to find shapes on.
3354 # @param theRadius Radius of the cylinder to find shapes on.
3355 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3356 # @return List of all found sub-shapes.
3358 # @ref swig_GetShapesOnCylinder "Example"
3359 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3361 Find in theShape all sub-shapes of type theShapeType, situated relatively
3362 the specified cylinder by the certain way, defined through theState parameter.
3365 theShape Shape to find sub-shapes of.
3366 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3367 theAxis Vector (or line, or linear edge), specifying
3368 axis of the cylinder to find shapes on.
3369 theRadius Radius of the cylinder to find shapes on.
3370 theState The state of the sub-shapes to find (see GEOM::shape_state)
3373 List of all found sub-shapes.
3375 # Example: see GEOM_TestOthers.py
3376 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3377 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3380 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3381 # the specified cylinder by the certain way, defined through \a theState parameter.
3382 # @param theShape Shape to find sub-shapes of.
3383 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3384 # @param theAxis Vector (or line, or linear edge), specifying
3385 # axis of the cylinder to find shapes on.
3386 # @param theRadius Radius of the cylinder to find shapes on.
3387 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3388 # @return List of all found sub-shapes indices.
3390 # @ref swig_GetShapesOnCylinderIDs "Example"
3391 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3393 Find in theShape all sub-shapes of type theShapeType, situated relatively
3394 the specified cylinder by the certain way, defined through theState parameter.
3397 theShape Shape to find sub-shapes of.
3398 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3399 theAxis Vector (or line, or linear edge), specifying
3400 axis of the cylinder to find shapes on.
3401 theRadius Radius of the cylinder to find shapes on.
3402 theState The state of the sub-shapes to find (see GEOM::shape_state)
3405 List of all found sub-shapes indices.
3407 # Example: see GEOM_TestOthers.py
3408 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3409 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3412 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3413 # the specified cylinder by the certain way, defined through \a theState parameter.
3414 # @param theShape Shape to find sub-shapes of.
3415 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3416 # @param theAxis Vector (or line, or linear edge), specifying
3417 # axis of the cylinder to find shapes on.
3418 # @param thePnt Point specifying location of the bottom of the cylinder.
3419 # @param theRadius Radius of the cylinder to find shapes on.
3420 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3421 # @return List of all found sub-shapes.
3423 # @ref swig_GetShapesOnCylinderWithLocation "Example"
3424 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3426 Find in theShape all sub-shapes of type theShapeType, situated relatively
3427 the specified cylinder by the certain way, defined through theState parameter.
3430 theShape Shape to find sub-shapes of.
3431 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3432 theAxis Vector (or line, or linear edge), specifying
3433 axis of the cylinder to find shapes on.
3434 theRadius Radius of the cylinder to find shapes on.
3435 theState The state of the sub-shapes to find (see GEOM::shape_state)
3438 List of all found sub-shapes.
3440 # Example: see GEOM_TestOthers.py
3441 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3442 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3445 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3446 # the specified cylinder by the certain way, defined through \a theState parameter.
3447 # @param theShape Shape to find sub-shapes of.
3448 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3449 # @param theAxis Vector (or line, or linear edge), specifying
3450 # axis of the cylinder to find shapes on.
3451 # @param thePnt Point specifying location of the bottom of the cylinder.
3452 # @param theRadius Radius of the cylinder to find shapes on.
3453 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3454 # @return List of all found sub-shapes indices
3456 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3457 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3459 Find in theShape all sub-shapes of type theShapeType, situated relatively
3460 the specified cylinder by the certain way, defined through theState parameter.
3463 theShape Shape to find sub-shapes of.
3464 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3465 theAxis Vector (or line, or linear edge), specifying
3466 axis of the cylinder to find shapes on.
3467 theRadius Radius of the cylinder to find shapes on.
3468 theState The state of the sub-shapes to find (see GEOM::shape_state)
3471 List of all found sub-shapes indices.
3473 # Example: see GEOM_TestOthers.py
3474 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3475 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3478 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3479 # the specified sphere by the certain way, defined through \a theState parameter.
3480 # @param theShape Shape to find sub-shapes of.
3481 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3482 # @param theCenter Point, specifying center of the sphere to find shapes on.
3483 # @param theRadius Radius of the sphere to find shapes on.
3484 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3485 # @return List of all found sub-shapes.
3487 # @ref swig_GetShapesOnSphere "Example"
3488 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3490 Find in theShape all sub-shapes of type theShapeType, situated relatively
3491 the specified sphere by the certain way, defined through theState parameter.
3494 theShape Shape to find sub-shapes of.
3495 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3496 theCenter Point, specifying center of the sphere to find shapes on.
3497 theRadius Radius of the sphere to find shapes on.
3498 theState The state of the sub-shapes to find (see GEOM::shape_state)
3501 List of all found sub-shapes.
3503 # Example: see GEOM_TestOthers.py
3504 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3505 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3508 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3509 # the specified sphere by the certain way, defined through \a theState parameter.
3510 # @param theShape Shape to find sub-shapes of.
3511 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3512 # @param theCenter Point, specifying center of the sphere to find shapes on.
3513 # @param theRadius Radius of the sphere to find shapes on.
3514 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3515 # @return List of all found sub-shapes indices.
3517 # @ref swig_GetShapesOnSphereIDs "Example"
3518 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3520 Find in theShape all sub-shapes of type theShapeType, situated relatively
3521 the specified sphere by the certain way, defined through theState parameter.
3524 theShape Shape to find sub-shapes of.
3525 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3526 theCenter Point, specifying center of the sphere to find shapes on.
3527 theRadius Radius of the sphere to find shapes on.
3528 theState The state of the sub-shapes to find (see GEOM::shape_state)
3531 List of all found sub-shapes indices.
3533 # Example: see GEOM_TestOthers.py
3534 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3535 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3538 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3539 # the specified quadrangle by the certain way, defined through \a theState parameter.
3540 # @param theShape Shape to find sub-shapes of.
3541 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3542 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3543 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3544 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3545 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3546 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3547 # @return List of all found sub-shapes.
3549 # @ref swig_GetShapesOnQuadrangle "Example"
3550 def GetShapesOnQuadrangle(self, theShape, theShapeType,
3551 theTopLeftPoint, theTopRigthPoint,
3552 theBottomLeftPoint, theBottomRigthPoint, theState):
3554 Find in theShape all sub-shapes of type theShapeType, situated relatively
3555 the specified quadrangle by the certain way, defined through theState parameter.
3558 theShape Shape to find sub-shapes of.
3559 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3560 theTopLeftPoint Point, specifying top left corner of a quadrangle
3561 theTopRigthPoint Point, specifying top right corner of a quadrangle
3562 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3563 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3564 theState The state of the sub-shapes to find (see GEOM::shape_state)
3567 List of all found sub-shapes.
3569 # Example: see GEOM_TestOthers.py
3570 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3571 theTopLeftPoint, theTopRigthPoint,
3572 theBottomLeftPoint, theBottomRigthPoint, theState)
3573 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3576 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3577 # the specified quadrangle by the certain way, defined through \a theState parameter.
3578 # @param theShape Shape to find sub-shapes of.
3579 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3580 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3581 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3582 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3583 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3584 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3585 # @return List of all found sub-shapes indices.
3587 # @ref swig_GetShapesOnQuadrangleIDs "Example"
3588 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3589 theTopLeftPoint, theTopRigthPoint,
3590 theBottomLeftPoint, theBottomRigthPoint, theState):
3592 Find in theShape all sub-shapes of type theShapeType, situated relatively
3593 the specified quadrangle by the certain way, defined through theState parameter.
3596 theShape Shape to find sub-shapes of.
3597 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3598 theTopLeftPoint Point, specifying top left corner of a quadrangle
3599 theTopRigthPoint Point, specifying top right corner of a quadrangle
3600 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3601 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3602 theState The state of the sub-shapes to find (see GEOM::shape_state)
3605 List of all found sub-shapes indices.
3608 # Example: see GEOM_TestOthers.py
3609 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3610 theTopLeftPoint, theTopRigthPoint,
3611 theBottomLeftPoint, theBottomRigthPoint, theState)
3612 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3615 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3616 # the specified \a theBox by the certain way, defined through \a theState parameter.
3617 # @param theBox Shape for relative comparing.
3618 # @param theShape Shape to find sub-shapes of.
3619 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3620 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3621 # @return List of all found sub-shapes.
3623 # @ref swig_GetShapesOnBox "Example"
3624 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3626 Find in theShape all sub-shapes of type theShapeType, situated relatively
3627 the specified theBox by the certain way, defined through theState parameter.
3630 theBox Shape for relative comparing.
3631 theShape Shape to find sub-shapes of.
3632 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3633 theState The state of the sub-shapes to find (see GEOM::shape_state)
3636 List of all found sub-shapes.
3638 # Example: see GEOM_TestOthers.py
3639 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3640 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3643 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3644 # the specified \a theBox by the certain way, defined through \a theState parameter.
3645 # @param theBox Shape for relative comparing.
3646 # @param theShape Shape to find sub-shapes of.
3647 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3648 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3649 # @return List of all found sub-shapes indices.
3651 # @ref swig_GetShapesOnBoxIDs "Example"
3652 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3654 Find in theShape all sub-shapes of type theShapeType, situated relatively
3655 the specified theBox by the certain way, defined through theState parameter.
3658 theBox Shape for relative comparing.
3659 theShape Shape to find sub-shapes of.
3660 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3661 theState The state of the sub-shapes to find (see GEOM::shape_state)
3664 List of all found sub-shapes indices.
3666 # Example: see GEOM_TestOthers.py
3667 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3668 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3671 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3672 # situated relatively the specified \a theCheckShape by the
3673 # certain way, defined through \a theState parameter.
3674 # @param theCheckShape Shape for relative comparing. It must be a solid.
3675 # @param theShape Shape to find sub-shapes of.
3676 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3677 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3678 # @return List of all found sub-shapes.
3680 # @ref swig_GetShapesOnShape "Example"
3681 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3683 Find in theShape all sub-shapes of type theShapeType,
3684 situated relatively the specified theCheckShape by the
3685 certain way, defined through theState parameter.
3688 theCheckShape Shape for relative comparing. It must be a solid.
3689 theShape Shape to find sub-shapes of.
3690 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3691 theState The state of the sub-shapes to find (see GEOM::shape_state)
3694 List of all found sub-shapes.
3696 # Example: see GEOM_TestOthers.py
3697 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3698 theShapeType, theState)
3699 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3702 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3703 # situated relatively the specified \a theCheckShape by the
3704 # certain way, defined through \a theState parameter.
3705 # @param theCheckShape Shape for relative comparing. It must be a solid.
3706 # @param theShape Shape to find sub-shapes of.
3707 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3708 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3709 # @return All found sub-shapes as compound.
3711 # @ref swig_GetShapesOnShapeAsCompound "Example"
3712 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3714 Find in theShape all sub-shapes of type theShapeType,
3715 situated relatively the specified theCheckShape by the
3716 certain way, defined through theState parameter.
3719 theCheckShape Shape for relative comparing. It must be a solid.
3720 theShape Shape to find sub-shapes of.
3721 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3722 theState The state of the sub-shapes to find (see GEOM::shape_state)
3725 All found sub-shapes as compound.
3727 # Example: see GEOM_TestOthers.py
3728 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3729 theShapeType, theState)
3730 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3733 ## Find in \a theShape all sub-shapes of type \a theShapeType,
3734 # situated relatively the specified \a theCheckShape by the
3735 # certain way, defined through \a theState parameter.
3736 # @param theCheckShape Shape for relative comparing. It must be a solid.
3737 # @param theShape Shape to find sub-shapes of.
3738 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3739 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3740 # @return List of all found sub-shapes indices.
3742 # @ref swig_GetShapesOnShapeIDs "Example"
3743 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3745 Find in theShape all sub-shapes of type theShapeType,
3746 situated relatively the specified theCheckShape by the
3747 certain way, defined through theState parameter.
3750 theCheckShape Shape for relative comparing. It must be a solid.
3751 theShape Shape to find sub-shapes of.
3752 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3753 theState The state of the sub-shapes to find (see GEOM::shape_state)
3756 List of all found sub-shapes indices.
3758 # Example: see GEOM_TestOthers.py
3759 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3760 theShapeType, theState)
3761 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3764 ## Get sub-shape(s) of theShapeWhere, which are
3765 # coincident with \a theShapeWhat or could be a part of it.
3766 # @param theShapeWhere Shape to find sub-shapes of.
3767 # @param theShapeWhat Shape, specifying what to find.
3768 # @param isNewImplementation implementation of GetInPlace functionality
3769 # (default = False, old alghorithm based on shape properties)
3770 # @return Group of all found sub-shapes or a single found sub-shape.
3772 # @note This function has a restriction on argument shapes.
3773 # If \a theShapeWhere has curved parts with significantly
3774 # outstanding centres (i.e. the mass centre of a part is closer to
3775 # \a theShapeWhat than to the part), such parts will not be found.
3776 # @image html get_in_place_lost_part.png
3778 # @ref swig_GetInPlace "Example"
3779 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
3781 Get sub-shape(s) of theShapeWhere, which are
3782 coincident with theShapeWhat or could be a part of it.
3785 theShapeWhere Shape to find sub-shapes of.
3786 theShapeWhat Shape, specifying what to find.
3787 isNewImplementation Implementation of GetInPlace functionality
3788 (default = False, old alghorithm based on shape properties)
3791 Group of all found sub-shapes or a single found sub-shape.
3795 This function has a restriction on argument shapes.
3796 If theShapeWhere has curved parts with significantly
3797 outstanding centres (i.e. the mass centre of a part is closer to
3798 theShapeWhat than to the part), such parts will not be found.
3800 # Example: see GEOM_TestOthers.py
3802 if isNewImplementation:
3803 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
3805 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
3807 RaiseIfFailed("GetInPlace", self.ShapesOp)
3810 ## Get sub-shape(s) of \a theShapeWhere, which are
3811 # coincident with \a theShapeWhat or could be a part of it.
3813 # Implementation of this method is based on a saved history of an operation,
3814 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
3815 # arguments (an argument shape or a sub-shape of an argument shape).
3816 # The operation could be the Partition or one of boolean operations,
3817 # performed on simple shapes (not on compounds).
3819 # @param theShapeWhere Shape to find sub-shapes of.
3820 # @param theShapeWhat Shape, specifying what to find (must be in the
3821 # building history of the ShapeWhere).
3822 # @return Group of all found sub-shapes or a single found sub-shape.
3824 # @ref swig_GetInPlace "Example"
3825 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
3827 Implementation of this method is based on a saved history of an operation,
3828 produced theShapeWhere. The theShapeWhat must be among this operation's
3829 arguments (an argument shape or a sub-shape of an argument shape).
3830 The operation could be the Partition or one of boolean operations,
3831 performed on simple shapes (not on compounds).
3834 theShapeWhere Shape to find sub-shapes of.
3835 theShapeWhat Shape, specifying what to find (must be in the
3836 building history of the ShapeWhere).
3839 Group of all found sub-shapes or a single found sub-shape.
3841 # Example: see GEOM_TestOthers.py
3842 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
3843 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
3846 ## Get sub-shape of theShapeWhere, which is
3847 # equal to \a theShapeWhat.
3848 # @param theShapeWhere Shape to find sub-shape of.
3849 # @param theShapeWhat Shape, specifying what to find.
3850 # @return New GEOM.GEOM_Object for found sub-shape.
3852 # @ref swig_GetSame "Example"
3853 def GetSame(self,theShapeWhere, theShapeWhat):
3855 Get sub-shape of theShapeWhere, which is
3856 equal to theShapeWhat.
3859 theShapeWhere Shape to find sub-shape of.
3860 theShapeWhat Shape, specifying what to find.
3863 New GEOM.GEOM_Object for found sub-shape.
3865 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
3866 RaiseIfFailed("GetSame", self.ShapesOp)
3872 ## @addtogroup l4_access
3875 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
3876 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
3877 # @param aShape Shape to get sub-shape of.
3878 # @param ListOfID List of sub-shapes indices.
3879 # @return Found sub-shape.
3881 # @ref swig_all_decompose "Example"
3882 def GetSubShape(self, aShape, ListOfID):
3884 Obtain a composite sub-shape of aShape, composed from sub-shapes
3885 of aShape, selected by their unique IDs inside aShape
3888 aShape Shape to get sub-shape of.
3889 ListOfID List of sub-shapes indices.
3894 # Example: see GEOM_TestAll.py
3895 anObj = self.AddSubShape(aShape,ListOfID)
3898 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
3899 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
3900 # @param aShape Shape to get sub-shape of.
3901 # @param aSubShape Sub-shapes of aShape.
3902 # @return ID of found sub-shape.
3904 # @ref swig_all_decompose "Example"
3905 def GetSubShapeID(self, aShape, aSubShape):
3907 Obtain unique ID of sub-shape aSubShape inside aShape
3908 of aShape, selected by their unique IDs inside aShape
3911 aShape Shape to get sub-shape of.
3912 aSubShape Sub-shapes of aShape.
3915 ID of found sub-shape.
3917 # Example: see GEOM_TestAll.py
3918 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
3919 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
3925 ## @addtogroup l4_decompose
3928 ## Get all sub-shapes and groups of \a theShape,
3929 # that were created already by any other methods.
3930 # @param theShape Any shape.
3931 # @param theGroupsOnly If this parameter is TRUE, only groups will be
3932 # returned, else all found sub-shapes and groups.
3933 # @return List of existing sub-objects of \a theShape.
3935 # @ref swig_all_decompose "Example"
3936 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
3938 Get all sub-shapes and groups of theShape,
3939 that were created already by any other methods.
3943 theGroupsOnly If this parameter is TRUE, only groups will be
3944 returned, else all found sub-shapes and groups.
3947 List of existing sub-objects of theShape.
3949 # Example: see GEOM_TestAll.py
3950 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
3951 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
3954 ## Get all groups of \a theShape,
3955 # that were created already by any other methods.
3956 # @param theShape Any shape.
3957 # @return List of existing groups of \a theShape.
3959 # @ref swig_all_decompose "Example"
3960 def GetGroups(self, theShape):
3962 Get all groups of theShape,
3963 that were created already by any other methods.
3969 List of existing groups of theShape.
3971 # Example: see GEOM_TestAll.py
3972 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
3973 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
3976 ## Explode a shape on sub-shapes of a given type.
3977 # If the shape itself matches the type, it is also returned.
3978 # @param aShape Shape to be exploded.
3979 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
3980 # @return List of sub-shapes of type theShapeType, contained in theShape.
3982 # @ref swig_all_decompose "Example"
3983 def SubShapeAll(self, aShape, aType):
3985 Explode a shape on sub-shapes of a given type.
3986 If the shape itself matches the type, it is also returned.
3989 aShape Shape to be exploded.
3990 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3993 List of sub-shapes of type theShapeType, contained in theShape.
3995 # Example: see GEOM_TestAll.py
3996 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
3997 RaiseIfFailed("SubShapeAll", self.ShapesOp)
4000 ## Explode a shape on sub-shapes of a given type.
4001 # @param aShape Shape to be exploded.
4002 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4003 # @return List of IDs of sub-shapes.
4005 # @ref swig_all_decompose "Example"
4006 def SubShapeAllIDs(self, aShape, aType):
4008 Explode a shape on sub-shapes of a given type.
4011 aShape Shape to be exploded (see geompy.ShapeType)
4012 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4015 List of IDs of sub-shapes.
4017 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
4018 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4021 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4022 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4023 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4024 # @param aShape Shape to get sub-shape of.
4025 # @param ListOfInd List of sub-shapes indices.
4026 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4027 # @return A compound of sub-shapes of aShape.
4029 # @ref swig_all_decompose "Example"
4030 def SubShape(self, aShape, aType, ListOfInd):
4032 Obtain a compound of sub-shapes of aShape,
4033 selected by they indices in list of all sub-shapes of type aType.
4034 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4037 aShape Shape to get sub-shape of.
4038 ListOfID List of sub-shapes indices.
4039 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4042 A compound of sub-shapes of aShape.
4044 # Example: see GEOM_TestAll.py
4046 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
4047 for ind in ListOfInd:
4048 ListOfIDs.append(AllShapeIDsList[ind - 1])
4049 anObj = self.GetSubShape(aShape, ListOfIDs)
4052 ## Explode a shape on sub-shapes of a given type.
4053 # Sub-shapes will be sorted by coordinates of their gravity centers.
4054 # If the shape itself matches the type, it is also returned.
4055 # @param aShape Shape to be exploded.
4056 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4057 # @return List of sub-shapes of type theShapeType, contained in theShape.
4059 # @ref swig_SubShapeAllSorted "Example"
4060 def SubShapeAllSortedCentres(self, aShape, aType):
4062 Explode a shape on sub-shapes of a given type.
4063 Sub-shapes will be sorted by coordinates of their gravity centers.
4064 If the shape itself matches the type, it is also returned.
4067 aShape Shape to be exploded.
4068 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4071 List of sub-shapes of type theShapeType, contained in theShape.
4073 # Example: see GEOM_TestAll.py
4074 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
4075 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4078 ## Explode a shape on sub-shapes of a given type.
4079 # Sub-shapes will be sorted by coordinates of their gravity centers.
4080 # @param aShape Shape to be exploded.
4081 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4082 # @return List of IDs of sub-shapes.
4084 # @ref swig_all_decompose "Example"
4085 def SubShapeAllSortedCentresIDs(self, aShape, aType):
4087 Explode a shape on sub-shapes of a given type.
4088 Sub-shapes will be sorted by coordinates of their gravity centers.
4091 aShape Shape to be exploded.
4092 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4095 List of IDs of sub-shapes.
4097 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
4098 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4101 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4102 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4103 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4104 # @param aShape Shape to get sub-shape of.
4105 # @param ListOfInd List of sub-shapes indices.
4106 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
4107 # @return A compound of sub-shapes of aShape.
4109 # @ref swig_all_decompose "Example"
4110 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4112 Obtain a compound of sub-shapes of aShape,
4113 selected by they indices in sorted list of all sub-shapes of type aType.
4114 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4117 aShape Shape to get sub-shape of.
4118 ListOfID List of sub-shapes indices.
4119 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4122 A compound of sub-shapes of aShape.
4124 # Example: see GEOM_TestAll.py
4126 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
4127 for ind in ListOfInd:
4128 ListOfIDs.append(AllShapeIDsList[ind - 1])
4129 anObj = self.GetSubShape(aShape, ListOfIDs)
4132 ## Extract shapes (excluding the main shape) of given type.
4133 # @param aShape The shape.
4134 # @param aType The shape type (see ShapeType())
4135 # @param isSorted Boolean flag to switch sorting on/off.
4136 # @return List of sub-shapes of type aType, contained in aShape.
4138 # @ref swig_FilletChamfer "Example"
4139 def ExtractShapes(self, aShape, aType, isSorted = False):
4141 Extract shapes (excluding the main shape) of given type.
4145 aType The shape type (see geompy.ShapeType)
4146 isSorted Boolean flag to switch sorting on/off.
4149 List of sub-shapes of type aType, contained in aShape.
4151 # Example: see GEOM_TestAll.py
4152 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
4153 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4156 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4157 # @param aShape Main shape.
4158 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4159 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4161 # @ref swig_all_decompose "Example"
4162 def SubShapes(self, aShape, anIDs):
4164 Get a set of sub-shapes defined by their unique IDs inside theMainShape
4168 anIDs List of unique IDs of sub-shapes inside theMainShape.
4171 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4173 # Example: see GEOM_TestAll.py
4174 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4175 RaiseIfFailed("SubShapes", self.ShapesOp)
4178 # end of l4_decompose
4181 ## @addtogroup l4_decompose_d
4184 ## Deprecated method
4185 # It works like SubShapeAllSortedCentres(), but wrongly
4186 # defines centres of faces, shells and solids.
4187 def SubShapeAllSorted(self, aShape, aType):
4190 It works like geompy.SubShapeAllSortedCentres, but wrongly
4191 defines centres of faces, shells and solids.
4193 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
4194 RaiseIfFailed("MakeExplode", self.ShapesOp)
4197 ## Deprecated method
4198 # It works like SubShapeAllSortedCentresIDs(), but wrongly
4199 # defines centres of faces, shells and solids.
4200 def SubShapeAllSortedIDs(self, aShape, aType):
4203 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4204 defines centres of faces, shells and solids.
4206 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
4207 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4210 ## Deprecated method
4211 # It works like SubShapeSortedCentres(), but has a bug
4212 # (wrongly defines centres of faces, shells and solids).
4213 def SubShapeSorted(self, aShape, aType, ListOfInd):
4216 It works like geompy.SubShapeSortedCentres, but has a bug
4217 (wrongly defines centres of faces, shells and solids).
4220 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
4221 for ind in ListOfInd:
4222 ListOfIDs.append(AllShapeIDsList[ind - 1])
4223 anObj = self.GetSubShape(aShape, ListOfIDs)
4226 # end of l4_decompose_d
4229 ## @addtogroup l3_healing
4232 ## Apply a sequence of Shape Healing operators to the given object.
4233 # @param theShape Shape to be processed.
4234 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4235 # @param theParameters List of names of parameters
4236 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4237 # @param theValues List of values of parameters, in the same order
4238 # as parameters are listed in <VAR>theParameters</VAR> list.
4241 # <b> Operators and Parameters: </b> \n
4243 # * \b FixShape - corrects invalid shapes. \n
4244 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4245 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4247 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
4248 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4249 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4250 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4252 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4253 # surfaces in segments using a certain angle. \n
4254 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4255 # if Angle=180, four if Angle=90, etc). \n
4256 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4258 # * \b SplitClosedFaces - splits closed faces in segments.
4259 # The number of segments depends on the number of splitting points.\n
4260 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4262 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4263 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4264 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4265 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4266 # This and the previous parameters can take the following values:\n
4267 # \b Parametric \b Continuity \n
4268 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4269 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4270 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4271 # ruling out sharp edges).\n
4272 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
4273 # are of the same magnitude).\n
4274 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4275 # or surfaces (d/du C(u)) are the same at junction. \n
4276 # \b Geometric \b Continuity \n
4277 # \b G1: first derivatives are proportional at junction.\n
4278 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
4279 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4280 # \b G2: first and second derivatives are proportional at junction.
4281 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4282 # continuity requires that the underlying parameterization was continuous as well.
4283 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4285 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4286 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4287 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4288 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4289 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4290 # with the specified parameters.\n
4291 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4292 # with the specified parameters.\n
4293 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4294 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4295 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4296 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4298 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4299 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4300 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4301 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4302 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4304 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4305 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4308 # @return New GEOM.GEOM_Object, containing processed shape.
4310 # \n @ref tui_shape_processing "Example"
4311 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4313 Apply a sequence of Shape Healing operators to the given object.
4316 theShape Shape to be processed.
4317 theValues List of values of parameters, in the same order
4318 as parameters are listed in theParameters list.
4319 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4320 theParameters List of names of parameters
4321 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4322 Operators and Parameters:
4324 * FixShape - corrects invalid shapes.
4325 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4326 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4327 * FixFaceSize - removes small faces, such as spots and strips.
4328 * FixFaceSize.Tolerance - defines minimum possible face size.
4329 * DropSmallEdges - removes edges, which merge with neighbouring edges.
4330 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4331 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4332 in segments using a certain angle.
4333 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4334 if Angle=180, four if Angle=90, etc).
4335 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4336 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4338 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4339 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4340 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4341 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4342 * SplitContinuity.CurveContinuity - required continuity for curves.
4343 This and the previous parameters can take the following values:
4345 Parametric Continuity:
4346 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4347 coincidental. The curves or surfaces may still meet at an angle,
4348 giving rise to a sharp corner or edge).
4349 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4350 are parallel, ruling out sharp edges).
4351 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4352 or surfaces are of the same magnitude).
4353 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4354 curves or surfaces (d/du C(u)) are the same at junction.
4356 Geometric Continuity:
4357 G1: first derivatives are proportional at junction.
4358 The curve tangents thus have the same direction, but not necessarily the same magnitude.
4359 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4360 G2: first and second derivatives are proportional at junction. As the names imply,
4361 geometric continuity requires the geometry to be continuous, while parametric continuity requires
4362 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4363 geometric continuity of order n, but not vice-versa.
4364 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4365 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4366 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4367 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4368 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4369 the specified parameters.
4370 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4371 the specified parameters.
4372 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4373 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4374 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4375 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4376 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4377 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4378 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4379 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4380 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4381 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4382 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4385 New GEOM.GEOM_Object, containing processed shape.
4387 Note: For more information look through SALOME Geometry User's Guide->
4388 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4390 # Example: see GEOM_TestHealing.py
4391 theValues,Parameters = ParseList(theValues)
4392 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4393 # To avoid script failure in case of good argument shape
4394 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4396 RaiseIfFailed("ProcessShape", self.HealOp)
4397 for string in (theOperators + theParameters):
4398 Parameters = ":" + Parameters
4400 anObj.SetParameters(Parameters)
4403 ## Remove faces from the given object (shape).
4404 # @param theObject Shape to be processed.
4405 # @param theFaces Indices of faces to be removed, if EMPTY then the method
4406 # removes ALL faces of the given object.
4407 # @return New GEOM.GEOM_Object, containing processed shape.
4409 # @ref tui_suppress_faces "Example"
4410 def SuppressFaces(self,theObject, theFaces):
4412 Remove faces from the given object (shape).
4415 theObject Shape to be processed.
4416 theFaces Indices of faces to be removed, if EMPTY then the method
4417 removes ALL faces of the given object.
4420 New GEOM.GEOM_Object, containing processed shape.
4422 # Example: see GEOM_TestHealing.py
4423 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4424 RaiseIfFailed("SuppressFaces", self.HealOp)
4427 ## Sewing of some shapes into single shape.
4428 # @param ListShape Shapes to be processed.
4429 # @param theTolerance Required tolerance value.
4430 # @return New GEOM.GEOM_Object, containing processed shape.
4432 # @ref tui_sewing "Example"
4433 def MakeSewing(self, ListShape, theTolerance):
4435 Sewing of some shapes into single shape.
4438 ListShape Shapes to be processed.
4439 theTolerance Required tolerance value.
4442 New GEOM.GEOM_Object, containing processed shape.
4444 # Example: see GEOM_TestHealing.py
4445 comp = self.MakeCompound(ListShape)
4446 anObj = self.Sew(comp, theTolerance)
4449 ## Sewing of the given object.
4450 # @param theObject Shape to be processed.
4451 # @param theTolerance Required tolerance value.
4452 # @return New GEOM.GEOM_Object, containing processed shape.
4453 def Sew(self, theObject, theTolerance):
4455 Sewing of the given object.
4458 theObject Shape to be processed.
4459 theTolerance Required tolerance value.
4462 New GEOM.GEOM_Object, containing processed shape.
4464 # Example: see MakeSewing() above
4465 theTolerance,Parameters = ParseParameters(theTolerance)
4466 anObj = self.HealOp.Sew(theObject, theTolerance)
4467 RaiseIfFailed("Sew", self.HealOp)
4468 anObj.SetParameters(Parameters)
4471 ## Remove internal wires and edges from the given object (face).
4472 # @param theObject Shape to be processed.
4473 # @param theWires Indices of wires to be removed, if EMPTY then the method
4474 # removes ALL internal wires of the given object.
4475 # @return New GEOM.GEOM_Object, containing processed shape.
4477 # @ref tui_suppress_internal_wires "Example"
4478 def SuppressInternalWires(self,theObject, theWires):
4480 Remove internal wires and edges from the given object (face).
4483 theObject Shape to be processed.
4484 theWires Indices of wires to be removed, if EMPTY then the method
4485 removes ALL internal wires of the given object.
4488 New GEOM.GEOM_Object, containing processed shape.
4490 # Example: see GEOM_TestHealing.py
4491 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4492 RaiseIfFailed("RemoveIntWires", self.HealOp)
4495 ## Remove internal closed contours (holes) from the given object.
4496 # @param theObject Shape to be processed.
4497 # @param theWires Indices of wires to be removed, if EMPTY then the method
4498 # removes ALL internal holes of the given object
4499 # @return New GEOM.GEOM_Object, containing processed shape.
4501 # @ref tui_suppress_holes "Example"
4502 def SuppressHoles(self,theObject, theWires):
4504 Remove internal closed contours (holes) from the given object.
4507 theObject Shape to be processed.
4508 theWires Indices of wires to be removed, if EMPTY then the method
4509 removes ALL internal holes of the given object
4512 New GEOM.GEOM_Object, containing processed shape.
4514 # Example: see GEOM_TestHealing.py
4515 anObj = self.HealOp.FillHoles(theObject, theWires)
4516 RaiseIfFailed("FillHoles", self.HealOp)
4519 ## Close an open wire.
4520 # @param theObject Shape to be processed.
4521 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4522 # if [ ], then <VAR>theObject</VAR> itself is a wire.
4523 # @param isCommonVertex If True : closure by creation of a common vertex,
4524 # If False : closure by creation of an edge between ends.
4525 # @return New GEOM.GEOM_Object, containing processed shape.
4527 # @ref tui_close_contour "Example"
4528 def CloseContour(self,theObject, theWires, isCommonVertex):
4533 theObject Shape to be processed.
4534 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4535 if [ ], then theObject itself is a wire.
4536 isCommonVertex If True : closure by creation of a common vertex,
4537 If False : closure by creation of an edge between ends.
4540 New GEOM.GEOM_Object, containing processed shape.
4542 # Example: see GEOM_TestHealing.py
4543 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4544 RaiseIfFailed("CloseContour", self.HealOp)
4547 ## Addition of a point to a given edge object.
4548 # @param theObject Shape to be processed.
4549 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
4550 # if -1, then theObject itself is the edge.
4551 # @param theValue Value of parameter on edge or length parameter,
4552 # depending on \a isByParameter.
4553 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4554 # if FALSE : \a theValue is treated as a length parameter [0..1]
4555 # @return New GEOM.GEOM_Object, containing processed shape.
4557 # @ref tui_add_point_on_edge "Example"
4558 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4560 Addition of a point to a given edge object.
4563 theObject Shape to be processed.
4564 theEdgeIndex Index of edge to be divided within theObject's shape,
4565 if -1, then theObject itself is the edge.
4566 theValue Value of parameter on edge or length parameter,
4567 depending on isByParameter.
4568 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
4569 if FALSE : theValue is treated as a length parameter [0..1]
4572 New GEOM.GEOM_Object, containing processed shape.
4574 # Example: see GEOM_TestHealing.py
4575 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4576 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4577 RaiseIfFailed("DivideEdge", self.HealOp)
4578 anObj.SetParameters(Parameters)
4581 ## Change orientation of the given object. Updates given shape.
4582 # @param theObject Shape to be processed.
4583 # @return Updated <var>theObject</var>
4585 # @ref swig_todo "Example"
4586 def ChangeOrientationShell(self,theObject):
4588 Change orientation of the given object. Updates given shape.
4591 theObject Shape to be processed.
4596 theObject = self.HealOp.ChangeOrientation(theObject)
4597 RaiseIfFailed("ChangeOrientation", self.HealOp)
4600 ## Change orientation of the given object.
4601 # @param theObject Shape to be processed.
4602 # @return New GEOM.GEOM_Object, containing processed shape.
4604 # @ref swig_todo "Example"
4605 def ChangeOrientationShellCopy(self, theObject):
4607 Change orientation of the given object.
4610 theObject Shape to be processed.
4613 New GEOM.GEOM_Object, containing processed shape.
4615 anObj = self.HealOp.ChangeOrientationCopy(theObject)
4616 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4619 ## Try to limit tolerance of the given object by value \a theTolerance.
4620 # @param theObject Shape to be processed.
4621 # @param theTolerance Required tolerance value.
4622 # @return New GEOM.GEOM_Object, containing processed shape.
4624 # @ref tui_limit_tolerance "Example"
4625 def LimitTolerance(self, theObject, theTolerance = 1e-07):
4627 Try to limit tolerance of the given object by value theTolerance.
4630 theObject Shape to be processed.
4631 theTolerance Required tolerance value.
4634 New GEOM.GEOM_Object, containing processed shape.
4636 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4637 RaiseIfFailed("LimitTolerance", self.HealOp)
4640 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4641 # that constitute a free boundary of the given shape.
4642 # @param theObject Shape to get free boundary of.
4643 # @return [\a status, \a theClosedWires, \a theOpenWires]
4644 # \n \a status: FALSE, if an error(s) occured during the method execution.
4645 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4646 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
4648 # @ref tui_measurement_tools_page "Example"
4649 def GetFreeBoundary(self, theObject):
4651 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4652 that constitute a free boundary of the given shape.
4655 theObject Shape to get free boundary of.
4658 [status, theClosedWires, theOpenWires]
4659 status: FALSE, if an error(s) occured during the method execution.
4660 theClosedWires: Closed wires on the free boundary of the given shape.
4661 theOpenWires: Open wires on the free boundary of the given shape.
4663 # Example: see GEOM_TestHealing.py
4664 anObj = self.HealOp.GetFreeBoundary(theObject)
4665 RaiseIfFailed("GetFreeBoundary", self.HealOp)
4668 ## Replace coincident faces in theShape by one face.
4669 # @param theShape Initial shape.
4670 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
4671 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4672 # otherwise all initial shapes.
4673 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4675 # @ref tui_glue_faces "Example"
4676 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4678 Replace coincident faces in theShape by one face.
4681 theShape Initial shape.
4682 theTolerance Maximum distance between faces, which can be considered as coincident.
4683 doKeepNonSolids If FALSE, only solids will present in the result,
4684 otherwise all initial shapes.
4687 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4689 # Example: see GEOM_Spanner.py
4690 theTolerance,Parameters = ParseParameters(theTolerance)
4691 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4693 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4694 anObj.SetParameters(Parameters)
4697 ## Find coincident faces in theShape for possible gluing.
4698 # @param theShape Initial shape.
4699 # @param theTolerance Maximum distance between faces,
4700 # which can be considered as coincident.
4701 # @return GEOM.ListOfGO
4703 # @ref tui_glue_faces "Example"
4704 def GetGlueFaces(self, theShape, theTolerance):
4706 Find coincident faces in theShape for possible gluing.
4709 theShape Initial shape.
4710 theTolerance Maximum distance between faces,
4711 which can be considered as coincident.
4716 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4717 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4720 ## Replace coincident faces in theShape by one face
4721 # in compliance with given list of faces
4722 # @param theShape Initial shape.
4723 # @param theTolerance Maximum distance between faces,
4724 # which can be considered as coincident.
4725 # @param theFaces List of faces for gluing.
4726 # @param doKeepNonSolids If FALSE, only solids will present in the result,
4727 # otherwise all initial shapes.
4728 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
4729 # will be glued, otherwise only the edges,
4730 # belonging to <VAR>theFaces</VAR>.
4731 # @return New GEOM.GEOM_Object, containing a copy of theShape
4732 # without some faces.
4734 # @ref tui_glue_faces "Example"
4735 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
4736 doKeepNonSolids=True, doGlueAllEdges=True):
4738 Replace coincident faces in theShape by one face
4739 in compliance with given list of faces
4742 theShape Initial shape.
4743 theTolerance Maximum distance between faces,
4744 which can be considered as coincident.
4745 theFaces List of faces for gluing.
4746 doKeepNonSolids If FALSE, only solids will present in the result,
4747 otherwise all initial shapes.
4748 doGlueAllEdges If TRUE, all coincident edges of theShape
4749 will be glued, otherwise only the edges,
4750 belonging to theFaces.
4753 New GEOM.GEOM_Object, containing a copy of theShape
4756 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
4757 doKeepNonSolids, doGlueAllEdges)
4759 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
4762 ## Replace coincident edges in theShape by one edge.
4763 # @param theShape Initial shape.
4764 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
4765 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4767 # @ref tui_glue_edges "Example"
4768 def MakeGlueEdges(self, theShape, theTolerance):
4770 Replace coincident edges in theShape by one edge.
4773 theShape Initial shape.
4774 theTolerance Maximum distance between edges, which can be considered as coincident.
4777 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
4779 theTolerance,Parameters = ParseParameters(theTolerance)
4780 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
4782 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
4783 anObj.SetParameters(Parameters)
4786 ## Find coincident edges in theShape for possible gluing.
4787 # @param theShape Initial shape.
4788 # @param theTolerance Maximum distance between edges,
4789 # which can be considered as coincident.
4790 # @return GEOM.ListOfGO
4792 # @ref tui_glue_edges "Example"
4793 def GetGlueEdges(self, theShape, theTolerance):
4795 Find coincident edges in theShape for possible gluing.
4798 theShape Initial shape.
4799 theTolerance Maximum distance between edges,
4800 which can be considered as coincident.
4805 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
4806 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
4809 ## Replace coincident edges in theShape by one edge
4810 # in compliance with given list of edges.
4811 # @param theShape Initial shape.
4812 # @param theTolerance Maximum distance between edges,
4813 # which can be considered as coincident.
4814 # @param theEdges List of edges for gluing.
4815 # @return New GEOM.GEOM_Object, containing a copy of theShape
4816 # without some edges.
4818 # @ref tui_glue_edges "Example"
4819 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
4821 Replace coincident edges in theShape by one edge
4822 in compliance with given list of edges.
4825 theShape Initial shape.
4826 theTolerance Maximum distance between edges,
4827 which can be considered as coincident.
4828 theEdges List of edges for gluing.
4831 New GEOM.GEOM_Object, containing a copy of theShape
4834 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
4836 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
4842 ## @addtogroup l3_boolean Boolean Operations
4845 # -----------------------------------------------------------------------------
4846 # Boolean (Common, Cut, Fuse, Section)
4847 # -----------------------------------------------------------------------------
4849 ## Perform one of boolean operations on two given shapes.
4850 # @param theShape1 First argument for boolean operation.
4851 # @param theShape2 Second argument for boolean operation.
4852 # @param theOperation Indicates the operation to be done:\n
4853 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
4854 # @return New GEOM.GEOM_Object, containing the result shape.
4856 # @ref tui_fuse "Example"
4857 def MakeBoolean(self,theShape1, theShape2, theOperation):
4859 Perform one of boolean operations on two given shapes.
4862 theShape1 First argument for boolean operation.
4863 theShape2 Second argument for boolean operation.
4864 theOperation Indicates the operation to be done:
4865 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
4868 New GEOM.GEOM_Object, containing the result shape.
4870 # Example: see GEOM_TestAll.py
4871 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
4872 RaiseIfFailed("MakeBoolean", self.BoolOp)
4875 ## Perform Common boolean operation on two given shapes.
4876 # @param theShape1 First argument for boolean operation.
4877 # @param theShape2 Second argument for boolean operation.
4878 # @return New GEOM.GEOM_Object, containing the result shape.
4880 # @ref tui_common "Example 1"
4881 # \n @ref swig_MakeCommon "Example 2"
4882 def MakeCommon(self, theShape1, theShape2):
4884 Perform Common boolean operation on two given shapes.
4887 theShape1 First argument for boolean operation.
4888 theShape2 Second argument for boolean operation.
4891 New GEOM.GEOM_Object, containing the result shape.
4893 # Example: see GEOM_TestOthers.py
4894 return self.MakeBoolean(theShape1, theShape2, 1)
4896 ## Perform Cut boolean operation on two given shapes.
4897 # @param theShape1 First argument for boolean operation.
4898 # @param theShape2 Second argument for boolean operation.
4899 # @return New GEOM.GEOM_Object, containing the result shape.
4901 # @ref tui_cut "Example 1"
4902 # \n @ref swig_MakeCommon "Example 2"
4903 def MakeCut(self, theShape1, theShape2):
4905 Perform Cut boolean operation on two given shapes.
4908 theShape1 First argument for boolean operation.
4909 theShape2 Second argument for boolean operation.
4912 New GEOM.GEOM_Object, containing the result shape.
4915 # Example: see GEOM_TestOthers.py
4916 return self.MakeBoolean(theShape1, theShape2, 2)
4918 ## Perform Fuse boolean operation on two given shapes.
4919 # @param theShape1 First argument for boolean operation.
4920 # @param theShape2 Second argument for boolean operation.
4921 # @return New GEOM.GEOM_Object, containing the result shape.
4923 # @ref tui_fuse "Example 1"
4924 # \n @ref swig_MakeCommon "Example 2"
4925 def MakeFuse(self, theShape1, theShape2):
4927 Perform Fuse boolean operation on two given shapes.
4930 theShape1 First argument for boolean operation.
4931 theShape2 Second argument for boolean operation.
4934 New GEOM.GEOM_Object, containing the result shape.
4937 # Example: see GEOM_TestOthers.py
4938 return self.MakeBoolean(theShape1, theShape2, 3)
4940 ## Perform Section boolean operation on two given shapes.
4941 # @param theShape1 First argument for boolean operation.
4942 # @param theShape2 Second argument for boolean operation.
4943 # @return New GEOM.GEOM_Object, containing the result shape.
4945 # @ref tui_section "Example 1"
4946 # \n @ref swig_MakeCommon "Example 2"
4947 def MakeSection(self, theShape1, theShape2):
4949 Perform Section boolean operation on two given shapes.
4952 theShape1 First argument for boolean operation.
4953 theShape2 Second argument for boolean operation.
4956 New GEOM.GEOM_Object, containing the result shape.
4959 # Example: see GEOM_TestOthers.py
4960 return self.MakeBoolean(theShape1, theShape2, 4)
4965 ## @addtogroup l3_basic_op
4968 ## Perform partition operation.
4969 # @param ListShapes Shapes to be intersected.
4970 # @param ListTools Shapes to intersect theShapes.
4971 # @param Limit Type of resulting shapes (see ShapeType()).\n
4972 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
4973 # type will be detected automatically.
4974 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
4975 # target type (equal to Limit) are kept in the result,
4976 # else standalone shapes of lower dimension
4977 # are kept also (if they exist).
4978 # @note Each compound from ListShapes and ListTools will be exploded
4979 # in order to avoid possible intersection between shapes from this compound.
4981 # After implementation new version of PartitionAlgo (October 2006)
4982 # other parameters are ignored by current functionality. They are kept
4983 # in this function only for support old versions.
4984 # @param ListKeepInside Shapes, outside which the results will be deleted.
4985 # Each shape from theKeepInside must belong to theShapes also.
4986 # @param ListRemoveInside Shapes, inside which the results will be deleted.
4987 # Each shape from theRemoveInside must belong to theShapes also.
4988 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
4989 # @param ListMaterials Material indices for each shape. Make sence,
4990 # only if theRemoveWebs is TRUE.
4992 # @return New GEOM.GEOM_Object, containing the result shapes.
4994 # @ref tui_partition "Example"
4995 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
4996 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
4997 KeepNonlimitShapes=0):
4999 Perform partition operation.
5002 ListShapes Shapes to be intersected.
5003 ListTools Shapes to intersect theShapes.
5004 Limit Type of resulting shapes (see geompy.ShapeType)
5005 If this parameter is set to -1 ("Auto"), most appropriate shape limit
5006 type will be detected automatically.
5007 KeepNonlimitShapes if this parameter == 0, then only shapes of
5008 target type (equal to Limit) are kept in the result,
5009 else standalone shapes of lower dimension
5010 are kept also (if they exist).
5012 Each compound from ListShapes and ListTools will be exploded
5013 in order to avoid possible intersection between shapes from
5016 After implementation new version of PartitionAlgo (October 2006) other
5017 parameters are ignored by current functionality. They are kept in this
5018 function only for support old versions.
5021 ListKeepInside Shapes, outside which the results will be deleted.
5022 Each shape from theKeepInside must belong to theShapes also.
5023 ListRemoveInside Shapes, inside which the results will be deleted.
5024 Each shape from theRemoveInside must belong to theShapes also.
5025 RemoveWebs If TRUE, perform Glue 3D algorithm.
5026 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5029 New GEOM.GEOM_Object, containing the result shapes.
5031 # Example: see GEOM_TestAll.py
5032 if Limit == ShapeType["AUTO"]:
5033 # automatic detection of the most appropriate shape limit type
5035 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5036 Limit = EnumToLong(lim)
5038 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5039 ListKeepInside, ListRemoveInside,
5040 Limit, RemoveWebs, ListMaterials,
5041 KeepNonlimitShapes);
5042 RaiseIfFailed("MakePartition", self.BoolOp)
5045 ## Perform partition operation.
5046 # This method may be useful if it is needed to make a partition for
5047 # compound contains nonintersected shapes. Performance will be better
5048 # since intersection between shapes from compound is not performed.
5050 # Description of all parameters as in previous method MakePartition()
5052 # @note Passed compounds (via ListShapes or via ListTools)
5053 # have to consist of nonintersecting shapes.
5055 # @return New GEOM.GEOM_Object, containing the result shapes.
5057 # @ref swig_todo "Example"
5058 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5059 ListKeepInside=[], ListRemoveInside=[],
5060 Limit=ShapeType["AUTO"], RemoveWebs=0,
5061 ListMaterials=[], KeepNonlimitShapes=0):
5063 Perform partition operation.
5064 This method may be useful if it is needed to make a partition for
5065 compound contains nonintersected shapes. Performance will be better
5066 since intersection between shapes from compound is not performed.
5069 Description of all parameters as in method geompy.MakePartition
5072 Passed compounds (via ListShapes or via ListTools)
5073 have to consist of nonintersecting shapes.
5076 New GEOM.GEOM_Object, containing the result shapes.
5078 if Limit == ShapeType["AUTO"]:
5079 # automatic detection of the most appropriate shape limit type
5081 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5082 Limit = EnumToLong(lim)
5084 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5085 ListKeepInside, ListRemoveInside,
5086 Limit, RemoveWebs, ListMaterials,
5087 KeepNonlimitShapes);
5088 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5091 ## See method MakePartition() for more information.
5093 # @ref tui_partition "Example 1"
5094 # \n @ref swig_Partition "Example 2"
5095 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5096 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5097 KeepNonlimitShapes=0):
5099 See method geompy.MakePartition for more information.
5101 # Example: see GEOM_TestOthers.py
5102 anObj = self.MakePartition(ListShapes, ListTools,
5103 ListKeepInside, ListRemoveInside,
5104 Limit, RemoveWebs, ListMaterials,
5105 KeepNonlimitShapes);
5108 ## Perform partition of the Shape with the Plane
5109 # @param theShape Shape to be intersected.
5110 # @param thePlane Tool shape, to intersect theShape.
5111 # @return New GEOM.GEOM_Object, containing the result shape.
5113 # @ref tui_partition "Example"
5114 def MakeHalfPartition(self,theShape, thePlane):
5116 Perform partition of the Shape with the Plane
5119 theShape Shape to be intersected.
5120 thePlane Tool shape, to intersect theShape.
5123 New GEOM.GEOM_Object, containing the result shape.
5125 # Example: see GEOM_TestAll.py
5126 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5127 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5130 # end of l3_basic_op
5133 ## @addtogroup l3_transform
5136 ## Translate the given object along the vector, specified
5137 # by its end points, creating its copy before the translation.
5138 # @param theObject The object to be translated.
5139 # @param thePoint1 Start point of translation vector.
5140 # @param thePoint2 End point of translation vector.
5141 # @return New GEOM.GEOM_Object, containing the translated object.
5143 # @ref tui_translation "Example 1"
5144 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
5145 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5147 Translate the given object along the vector, specified
5148 by its end points, creating its copy before the translation.
5151 theObject The object to be translated.
5152 thePoint1 Start point of translation vector.
5153 thePoint2 End point of translation vector.
5156 New GEOM.GEOM_Object, containing the translated object.
5158 # Example: see GEOM_TestAll.py
5159 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5160 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5163 ## Translate the given object along the vector, specified by its components.
5164 # @param theObject The object to be translated.
5165 # @param theDX,theDY,theDZ Components of translation vector.
5166 # @return Translated GEOM.GEOM_Object.
5168 # @ref tui_translation "Example"
5169 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5171 Translate the given object along the vector, specified by its components.
5174 theObject The object to be translated.
5175 theDX,theDY,theDZ Components of translation vector.
5178 Translated GEOM.GEOM_Object.
5180 # Example: see GEOM_TestAll.py
5181 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5182 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5183 anObj.SetParameters(Parameters)
5184 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5187 ## Translate the given object along the vector, specified
5188 # by its components, creating its copy before the translation.
5189 # @param theObject The object to be translated.
5190 # @param theDX,theDY,theDZ Components of translation vector.
5191 # @return New GEOM.GEOM_Object, containing the translated object.
5193 # @ref tui_translation "Example"
5194 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5196 Translate the given object along the vector, specified
5197 by its components, creating its copy before the translation.
5200 theObject The object to be translated.
5201 theDX,theDY,theDZ Components of translation vector.
5204 New GEOM.GEOM_Object, containing the translated object.
5206 # Example: see GEOM_TestAll.py
5207 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5208 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5209 anObj.SetParameters(Parameters)
5210 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5213 ## Translate the given object along the given vector,
5214 # creating its copy before the translation.
5215 # @param theObject The object to be translated.
5216 # @param theVector The translation vector.
5217 # @return New GEOM.GEOM_Object, containing the translated object.
5219 # @ref tui_translation "Example"
5220 def MakeTranslationVector(self,theObject, theVector):
5222 Translate the given object along the given vector,
5223 creating its copy before the translation.
5226 theObject The object to be translated.
5227 theVector The translation vector.
5230 New GEOM.GEOM_Object, containing the translated object.
5232 # Example: see GEOM_TestAll.py
5233 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5234 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5237 ## Translate the given object along the given vector on given distance.
5238 # @param theObject The object to be translated.
5239 # @param theVector The translation vector.
5240 # @param theDistance The translation distance.
5241 # @param theCopy Flag used to translate object itself or create a copy.
5242 # @return New GEOM.GEOM_Object, containing the translated object.
5244 # @ref tui_translation "Example"
5245 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5247 Translate the given object along the given vector on given distance.
5250 theObject The object to be translated.
5251 theVector The translation vector.
5252 theDistance The translation distance.
5253 theCopy Flag used to translate object itself or create a copy.
5256 New GEOM.GEOM_Object, containing the translated object.
5258 # Example: see GEOM_TestAll.py
5259 theDistance,Parameters = ParseParameters(theDistance)
5260 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5261 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5262 anObj.SetParameters(Parameters)
5265 ## Translate the given object along the given vector on given distance,
5266 # creating its copy before the translation.
5267 # @param theObject The object to be translated.
5268 # @param theVector The translation vector.
5269 # @param theDistance The translation distance.
5270 # @return New GEOM.GEOM_Object, containing the translated object.
5272 # @ref tui_translation "Example"
5273 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5275 Translate the given object along the given vector on given distance,
5276 creating its copy before the translation.
5279 theObject The object to be translated.
5280 theVector The translation vector.
5281 theDistance The translation distance.
5284 New GEOM.GEOM_Object, containing the translated object.
5286 # Example: see GEOM_TestAll.py
5287 theDistance,Parameters = ParseParameters(theDistance)
5288 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5289 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5290 anObj.SetParameters(Parameters)
5293 ## Rotate the given object around the given axis on the given angle.
5294 # @param theObject The object to be rotated.
5295 # @param theAxis Rotation axis.
5296 # @param theAngle Rotation angle in radians.
5297 # @return New GEOM.GEOM_Object, containing the rotated object.
5299 # @ref tui_rotation "Example"
5300 def Rotate(self,theObject, theAxis, theAngle):
5302 Rotate the given object around the given axis on the given angle.
5305 theObject The object to be rotated.
5306 theAxis Rotation axis.
5307 theAngle Rotation angle in radians.
5310 New GEOM.GEOM_Object, containing the rotated object.
5312 # Example: see GEOM_TestAll.py
5314 if isinstance(theAngle,str):
5316 theAngle, Parameters = ParseParameters(theAngle)
5318 theAngle = theAngle*math.pi/180.0
5319 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5320 RaiseIfFailed("RotateCopy", self.TrsfOp)
5321 anObj.SetParameters(Parameters)
5324 ## Rotate the given object around the given axis
5325 # on the given angle, creating its copy before the rotatation.
5326 # @param theObject The object to be rotated.
5327 # @param theAxis Rotation axis.
5328 # @param theAngle Rotation angle in radians.
5329 # @return New GEOM.GEOM_Object, containing the rotated object.
5331 # @ref tui_rotation "Example"
5332 def MakeRotation(self,theObject, theAxis, theAngle):
5334 Rotate the given object around the given axis
5335 on the given angle, creating its copy before the rotatation.
5338 theObject The object to be rotated.
5339 theAxis Rotation axis.
5340 theAngle Rotation angle in radians.
5343 New GEOM.GEOM_Object, containing the rotated object.
5345 # Example: see GEOM_TestAll.py
5347 if isinstance(theAngle,str):
5349 theAngle, Parameters = ParseParameters(theAngle)
5351 theAngle = theAngle*math.pi/180.0
5352 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5353 RaiseIfFailed("RotateCopy", self.TrsfOp)
5354 anObj.SetParameters(Parameters)
5357 ## Rotate given object around vector perpendicular to plane
5358 # containing three points, creating its copy before the rotatation.
5359 # @param theObject The object to be rotated.
5360 # @param theCentPoint central point the axis is the vector perpendicular to the plane
5361 # containing the three points.
5362 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5363 # @return New GEOM.GEOM_Object, containing the rotated object.
5365 # @ref tui_rotation "Example"
5366 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5368 Rotate given object around vector perpendicular to plane
5369 containing three points, creating its copy before the rotatation.
5372 theObject The object to be rotated.
5373 theCentPoint central point the axis is the vector perpendicular to the plane
5374 containing the three points.
5375 thePoint1,thePoint2 in a perpendicular plane of the axis.
5378 New GEOM.GEOM_Object, containing the rotated object.
5380 # Example: see GEOM_TestAll.py
5381 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5382 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5385 ## Scale the given object by the factor, creating its copy before the scaling.
5386 # @param theObject The object to be scaled.
5387 # @param thePoint Center point for scaling.
5388 # Passing None for it means scaling relatively the origin of global CS.
5389 # @param theFactor Scaling factor value.
5390 # @return New GEOM.GEOM_Object, containing the scaled shape.
5392 # @ref tui_scale "Example"
5393 def MakeScaleTransform(self, theObject, thePoint, theFactor):
5395 Scale the given object by the factor, creating its copy before the scaling.
5398 theObject The object to be scaled.
5399 thePoint Center point for scaling.
5400 Passing None for it means scaling relatively the origin of global CS.
5401 theFactor Scaling factor value.
5404 New GEOM.GEOM_Object, containing the scaled shape.
5406 # Example: see GEOM_TestAll.py
5407 theFactor, Parameters = ParseParameters(theFactor)
5408 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5409 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5410 anObj.SetParameters(Parameters)
5413 ## Scale the given object by different factors along coordinate axes,
5414 # creating its copy before the scaling.
5415 # @param theObject The object to be scaled.
5416 # @param thePoint Center point for scaling.
5417 # Passing None for it means scaling relatively the origin of global CS.
5418 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5419 # @return New GEOM.GEOM_Object, containing the scaled shape.
5421 # @ref swig_scale "Example"
5422 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5424 Scale the given object by different factors along coordinate axes,
5425 creating its copy before the scaling.
5428 theObject The object to be scaled.
5429 thePoint Center point for scaling.
5430 Passing None for it means scaling relatively the origin of global CS.
5431 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5434 New GEOM.GEOM_Object, containing the scaled shape.
5436 # Example: see GEOM_TestAll.py
5437 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5438 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5439 theFactorX, theFactorY, theFactorZ)
5440 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5441 anObj.SetParameters(Parameters)
5444 ## Create an object, symmetrical
5445 # to the given one relatively the given plane.
5446 # @param theObject The object to be mirrored.
5447 # @param thePlane Plane of symmetry.
5448 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5450 # @ref tui_mirror "Example"
5451 def MakeMirrorByPlane(self,theObject, thePlane):
5453 Create an object, symmetrical to the given one relatively the given plane.
5456 theObject The object to be mirrored.
5457 thePlane Plane of symmetry.
5460 New GEOM.GEOM_Object, containing the mirrored shape.
5462 # Example: see GEOM_TestAll.py
5463 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5464 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5467 ## Create an object, symmetrical
5468 # to the given one relatively the given axis.
5469 # @param theObject The object to be mirrored.
5470 # @param theAxis Axis of symmetry.
5471 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5473 # @ref tui_mirror "Example"
5474 def MakeMirrorByAxis(self,theObject, theAxis):
5476 Create an object, symmetrical to the given one relatively the given axis.
5479 theObject The object to be mirrored.
5480 theAxis Axis of symmetry.
5483 New GEOM.GEOM_Object, containing the mirrored shape.
5485 # Example: see GEOM_TestAll.py
5486 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5487 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5490 ## Create an object, symmetrical
5491 # to the given one relatively the given point.
5492 # @param theObject The object to be mirrored.
5493 # @param thePoint Point of symmetry.
5494 # @return New GEOM.GEOM_Object, containing the mirrored shape.
5496 # @ref tui_mirror "Example"
5497 def MakeMirrorByPoint(self,theObject, thePoint):
5499 Create an object, symmetrical
5500 to the given one relatively the given point.
5503 theObject The object to be mirrored.
5504 thePoint Point of symmetry.
5507 New GEOM.GEOM_Object, containing the mirrored shape.
5509 # Example: see GEOM_TestAll.py
5510 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5511 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5514 ## Modify the Location of the given object by LCS,
5515 # creating its copy before the setting.
5516 # @param theObject The object to be displaced.
5517 # @param theStartLCS Coordinate system to perform displacement from it.\n
5518 # If \a theStartLCS is NULL, displacement
5519 # will be performed from global CS.\n
5520 # If \a theObject itself is used as \a theStartLCS,
5521 # its location will be changed to \a theEndLCS.
5522 # @param theEndLCS Coordinate system to perform displacement to it.
5523 # @return New GEOM.GEOM_Object, containing the displaced shape.
5525 # @ref tui_modify_location "Example"
5526 def MakePosition(self,theObject, theStartLCS, theEndLCS):
5528 Modify the Location of the given object by LCS, creating its copy before the setting.
5531 theObject The object to be displaced.
5532 theStartLCS Coordinate system to perform displacement from it.
5533 If theStartLCS is NULL, displacement
5534 will be performed from global CS.
5535 If theObject itself is used as theStartLCS,
5536 its location will be changed to theEndLCS.
5537 theEndLCS Coordinate system to perform displacement to it.
5540 New GEOM.GEOM_Object, containing the displaced shape.
5543 # create local coordinate systems
5544 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5545 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5546 # modify the location of the given object
5547 position = geompy.MakePosition(cylinder, cs1, cs2)
5549 # Example: see GEOM_TestAll.py
5550 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5551 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5554 ## Modify the Location of the given object by Path,
5555 # @param theObject The object to be displaced.
5556 # @param thePath Wire or Edge along that the object will be translated.
5557 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
5558 # @param theCopy is to create a copy objects if true.
5559 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
5560 # @return New GEOM.GEOM_Object, containing the displaced shape.
5562 # @ref tui_modify_location "Example"
5563 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5565 Modify the Location of the given object by Path
5568 theObject The object to be displaced.
5569 thePath Wire or Edge along that the object will be translated.
5570 theDistance progress of Path (0 = start location, 1 = end of path location).
5571 theCopy is to create a copy objects if true.
5572 theReverse 0 - for usual direction, 1 - to reverse path direction.
5575 New GEOM.GEOM_Object, containing the displaced shape.
5578 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5580 # Example: see GEOM_TestAll.py
5581 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5582 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5585 ## Create new object as offset of the given one.
5586 # @param theObject The base object for the offset.
5587 # @param theOffset Offset value.
5588 # @return New GEOM.GEOM_Object, containing the offset object.
5590 # @ref tui_offset "Example"
5591 def MakeOffset(self,theObject, theOffset):
5593 Create new object as offset of the given one.
5596 theObject The base object for the offset.
5597 theOffset Offset value.
5600 New GEOM.GEOM_Object, containing the offset object.
5603 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5604 # create a new object as offset of the given object
5605 offset = geompy.MakeOffset(box, 70.)
5607 # Example: see GEOM_TestAll.py
5608 theOffset, Parameters = ParseParameters(theOffset)
5609 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5610 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5611 anObj.SetParameters(Parameters)
5614 ## Create new object as projection of the given one on a 2D surface.
5615 # @param theSource The source object for the projection. It can be a point, edge or wire.
5616 # @param theTarget The target object. It can be planar or cylindrical face.
5617 # @return New GEOM.GEOM_Object, containing the projection.
5619 # @ref tui_projection "Example"
5620 def MakeProjection(self, theSource, theTarget):
5622 Create new object as projection of the given one on a 2D surface.
5625 theSource The source object for the projection. It can be a point, edge or wire.
5626 theTarget The target object. It can be planar or cylindrical face.
5629 New GEOM.GEOM_Object, containing the projection.
5631 # Example: see GEOM_TestAll.py
5632 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5633 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5636 # -----------------------------------------------------------------------------
5638 # -----------------------------------------------------------------------------
5640 ## Translate the given object along the given vector a given number times
5641 # @param theObject The object to be translated.
5642 # @param theVector Direction of the translation.
5643 # @param theStep Distance to translate on.
5644 # @param theNbTimes Quantity of translations to be done.
5645 # @return New GEOM.GEOM_Object, containing compound of all
5646 # the shapes, obtained after each translation.
5648 # @ref tui_multi_translation "Example"
5649 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5651 Translate the given object along the given vector a given number times
5654 theObject The object to be translated.
5655 theVector Direction of the translation.
5656 theStep Distance to translate on.
5657 theNbTimes Quantity of translations to be done.
5660 New GEOM.GEOM_Object, containing compound of all
5661 the shapes, obtained after each translation.
5664 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5666 # Example: see GEOM_TestAll.py
5667 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5668 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5669 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5670 anObj.SetParameters(Parameters)
5673 ## Conseqently apply two specified translations to theObject specified number of times.
5674 # @param theObject The object to be translated.
5675 # @param theVector1 Direction of the first translation.
5676 # @param theStep1 Step of the first translation.
5677 # @param theNbTimes1 Quantity of translations to be done along theVector1.
5678 # @param theVector2 Direction of the second translation.
5679 # @param theStep2 Step of the second translation.
5680 # @param theNbTimes2 Quantity of translations to be done along theVector2.
5681 # @return New GEOM.GEOM_Object, containing compound of all
5682 # the shapes, obtained after each translation.
5684 # @ref tui_multi_translation "Example"
5685 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5686 theVector2, theStep2, theNbTimes2):
5688 Conseqently apply two specified translations to theObject specified number of times.
5691 theObject The object to be translated.
5692 theVector1 Direction of the first translation.
5693 theStep1 Step of the first translation.
5694 theNbTimes1 Quantity of translations to be done along theVector1.
5695 theVector2 Direction of the second translation.
5696 theStep2 Step of the second translation.
5697 theNbTimes2 Quantity of translations to be done along theVector2.
5700 New GEOM.GEOM_Object, containing compound of all
5701 the shapes, obtained after each translation.
5704 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5706 # Example: see GEOM_TestAll.py
5707 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5708 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5709 theVector2, theStep2, theNbTimes2)
5710 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5711 anObj.SetParameters(Parameters)
5714 ## Rotate the given object around the given axis a given number times.
5715 # Rotation angle will be 2*PI/theNbTimes.
5716 # @param theObject The object to be rotated.
5717 # @param theAxis The rotation axis.
5718 # @param theNbTimes Quantity of rotations to be done.
5719 # @return New GEOM.GEOM_Object, containing compound of all the
5720 # shapes, obtained after each rotation.
5722 # @ref tui_multi_rotation "Example"
5723 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5725 Rotate the given object around the given axis a given number times.
5726 Rotation angle will be 2*PI/theNbTimes.
5729 theObject The object to be rotated.
5730 theAxis The rotation axis.
5731 theNbTimes Quantity of rotations to be done.
5734 New GEOM.GEOM_Object, containing compound of all the
5735 shapes, obtained after each rotation.
5738 rot1d = geompy.MultiRotate1D(prism, vect, 4)
5740 # Example: see GEOM_TestAll.py
5741 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
5742 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
5743 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
5744 anObj.SetParameters(Parameters)
5747 ## Rotate the given object around the
5748 # given axis on the given angle a given number
5749 # times and multi-translate each rotation result.
5750 # Translation direction passes through center of gravity
5751 # of rotated shape and its projection on the rotation axis.
5752 # @param theObject The object to be rotated.
5753 # @param theAxis Rotation axis.
5754 # @param theAngle Rotation angle in graduces.
5755 # @param theNbTimes1 Quantity of rotations to be done.
5756 # @param theStep Translation distance.
5757 # @param theNbTimes2 Quantity of translations to be done.
5758 # @return New GEOM.GEOM_Object, containing compound of all the
5759 # shapes, obtained after each transformation.
5761 # @ref tui_multi_rotation "Example"
5762 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
5764 Rotate the given object around the
5765 given axis on the given angle a given number
5766 times and multi-translate each rotation result.
5767 Translation direction passes through center of gravity
5768 of rotated shape and its projection on the rotation axis.
5771 theObject The object to be rotated.
5772 theAxis Rotation axis.
5773 theAngle Rotation angle in graduces.
5774 theNbTimes1 Quantity of rotations to be done.
5775 theStep Translation distance.
5776 theNbTimes2 Quantity of translations to be done.
5779 New GEOM.GEOM_Object, containing compound of all the
5780 shapes, obtained after each transformation.
5783 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
5785 # Example: see GEOM_TestAll.py
5786 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
5787 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
5788 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
5789 anObj.SetParameters(Parameters)
5792 ## The same, as MultiRotate1D(), but axis is given by direction and point
5794 # @ref swig_MakeMultiRotation "Example"
5795 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
5797 The same, as geompy.MultiRotate1D, but axis is given by direction and point
5800 pz = geompy.MakeVertex(0, 0, 100)
5801 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5802 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
5804 # Example: see GEOM_TestOthers.py
5805 aVec = self.MakeLine(aPoint,aDir)
5806 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
5809 ## The same, as MultiRotate2D(), but axis is given by direction and point
5811 # @ref swig_MakeMultiRotation "Example"
5812 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
5814 The same, as MultiRotate2D(), but axis is given by direction and point
5817 pz = geompy.MakeVertex(0, 0, 100)
5818 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
5819 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
5821 # Example: see GEOM_TestOthers.py
5822 aVec = self.MakeLine(aPoint,aDir)
5823 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
5826 # end of l3_transform
5829 ## @addtogroup l3_local
5832 ## Perform a fillet on all edges of the given shape.
5833 # @param theShape Shape, to perform fillet on.
5834 # @param theR Fillet radius.
5835 # @return New GEOM.GEOM_Object, containing the result shape.
5837 # @ref tui_fillet "Example 1"
5838 # \n @ref swig_MakeFilletAll "Example 2"
5839 def MakeFilletAll(self,theShape, theR):
5841 Perform a fillet on all edges of the given shape.
5844 theShape Shape, to perform fillet on.
5848 New GEOM.GEOM_Object, containing the result shape.
5851 filletall = geompy.MakeFilletAll(prism, 10.)
5853 # Example: see GEOM_TestOthers.py
5854 theR,Parameters = ParseParameters(theR)
5855 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
5856 RaiseIfFailed("MakeFilletAll", self.LocalOp)
5857 anObj.SetParameters(Parameters)
5860 ## Perform a fillet on the specified edges/faces of the given shape
5861 # @param theShape Shape, to perform fillet on.
5862 # @param theR Fillet radius.
5863 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
5864 # @param theListShapes Global indices of edges/faces to perform fillet on.
5865 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
5866 # @return New GEOM.GEOM_Object, containing the result shape.
5868 # @ref tui_fillet "Example"
5869 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
5871 Perform a fillet on the specified edges/faces of the given shape
5874 theShape Shape, to perform fillet on.
5876 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
5877 theListShapes Global indices of edges/faces to perform fillet on.
5880 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
5883 New GEOM.GEOM_Object, containing the result shape.
5886 # get the list of IDs (IDList) for the fillet
5887 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
5889 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
5890 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
5891 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
5892 # make a fillet on the specified edges of the given shape
5893 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
5895 # Example: see GEOM_TestAll.py
5896 theR,Parameters = ParseParameters(theR)
5898 if theShapeType == ShapeType["EDGE"]:
5899 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
5900 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
5902 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
5903 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
5904 anObj.SetParameters(Parameters)
5907 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
5908 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
5910 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
5913 # get the list of IDs (IDList) for the fillet
5914 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
5916 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
5917 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
5918 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
5919 # make a fillet on the specified edges of the given shape
5920 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
5922 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
5924 if theShapeType == ShapeType["EDGE"]:
5925 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
5926 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
5928 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
5929 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
5930 anObj.SetParameters(Parameters)
5933 ## Perform a fillet on the specified edges of the given shape
5934 # @param theShape Wire Shape to perform fillet on.
5935 # @param theR Fillet radius.
5936 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
5937 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
5938 # \note The list of vertices could be empty,
5939 # in this case fillet will done done at all vertices in wire
5940 # @return New GEOM.GEOM_Object, containing the result shape.
5942 # @ref tui_fillet2d "Example"
5943 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
5945 Perform a fillet on the specified edges of the given shape
5948 theShape Wire Shape to perform fillet on.
5950 theListOfVertexes Global indices of vertexes to perform fillet on.
5952 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
5954 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
5957 New GEOM.GEOM_Object, containing the result shape.
5961 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
5962 # make fillet at given wire vertices with giver radius
5963 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
5965 # Example: see GEOM_TestAll.py
5966 theR,Parameters = ParseParameters(theR)
5967 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
5968 RaiseIfFailed("MakeFillet1D", self.LocalOp)
5969 anObj.SetParameters(Parameters)
5972 ## Perform a fillet at the specified vertices of the given face/shell.
5973 # @param theShape Face or Shell shape to perform fillet on.
5974 # @param theR Fillet radius.
5975 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
5976 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
5977 # @return New GEOM.GEOM_Object, containing the result shape.
5979 # @ref tui_fillet2d "Example"
5980 def MakeFillet2D(self, theShape, theR, theListOfVertexes):
5982 Perform a fillet at the specified vertices of the given face/shell.
5985 theShape Face or Shell shape to perform fillet on.
5987 theListOfVertexes Global indices of vertexes to perform fillet on.
5989 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
5992 New GEOM.GEOM_Object, containing the result shape.
5995 face = geompy.MakeFaceHW(100, 100, 1)
5996 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
5998 # Example: see GEOM_TestAll.py
5999 theR,Parameters = ParseParameters(theR)
6000 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6001 RaiseIfFailed("MakeFillet2D", self.LocalOp)
6002 anObj.SetParameters(Parameters)
6005 ## Perform a symmetric chamfer on all edges of the given shape.
6006 # @param theShape Shape, to perform chamfer on.
6007 # @param theD Chamfer size along each face.
6008 # @return New GEOM.GEOM_Object, containing the result shape.
6010 # @ref tui_chamfer "Example 1"
6011 # \n @ref swig_MakeChamferAll "Example 2"
6012 def MakeChamferAll(self,theShape, theD):
6014 Perform a symmetric chamfer on all edges of the given shape.
6017 theShape Shape, to perform chamfer on.
6018 theD Chamfer size along each face.
6021 New GEOM.GEOM_Object, containing the result shape.
6024 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6026 # Example: see GEOM_TestOthers.py
6027 theD,Parameters = ParseParameters(theD)
6028 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6029 RaiseIfFailed("MakeChamferAll", self.LocalOp)
6030 anObj.SetParameters(Parameters)
6033 ## Perform a chamfer on edges, common to the specified faces,
6034 # with distance D1 on the Face1
6035 # @param theShape Shape, to perform chamfer on.
6036 # @param theD1 Chamfer size along \a theFace1.
6037 # @param theD2 Chamfer size along \a theFace2.
6038 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6039 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6040 # @return New GEOM.GEOM_Object, containing the result shape.
6042 # @ref tui_chamfer "Example"
6043 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6045 Perform a chamfer on edges, common to the specified faces,
6046 with distance D1 on the Face1
6049 theShape Shape, to perform chamfer on.
6050 theD1 Chamfer size along theFace1.
6051 theD2 Chamfer size along theFace2.
6052 theFace1,theFace2 Global indices of two faces of theShape.
6055 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6058 New GEOM.GEOM_Object, containing the result shape.
6061 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6062 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6063 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6064 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6066 # Example: see GEOM_TestAll.py
6067 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6068 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6069 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6070 anObj.SetParameters(Parameters)
6073 ## Perform a chamfer on edges
6074 # @param theShape Shape, to perform chamfer on.
6075 # @param theD Chamfer length
6076 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6077 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
6078 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6079 # @return New GEOM.GEOM_Object, containing the result shape.
6080 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6082 Perform a chamfer on edges
6085 theShape Shape, to perform chamfer on.
6086 theD1 Chamfer size along theFace1.
6087 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6088 theFace1,theFace2 Global indices of two faces of theShape.
6091 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6094 New GEOM.GEOM_Object, containing the result shape.
6097 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6098 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6099 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6101 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6104 if isinstance(theAngle,str):
6106 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6108 theAngle = theAngle*math.pi/180.0
6109 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6110 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6111 anObj.SetParameters(Parameters)
6114 ## Perform a chamfer on all edges of the specified faces,
6115 # with distance D1 on the first specified face (if several for one edge)
6116 # @param theShape Shape, to perform chamfer on.
6117 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
6118 # connected to the edge, are in \a theFaces, \a theD1
6119 # will be get along face, which is nearer to \a theFaces beginning.
6120 # @param theD2 Chamfer size along another of two faces, connected to the edge.
6121 # @param theFaces Sequence of global indices of faces of \a theShape.
6122 # \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6123 # @return New GEOM.GEOM_Object, containing the result shape.
6125 # @ref tui_chamfer "Example"
6126 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6128 Perform a chamfer on all edges of the specified faces,
6129 with distance D1 on the first specified face (if several for one edge)
6132 theShape Shape, to perform chamfer on.
6133 theD1 Chamfer size along face from theFaces. If both faces,
6134 connected to the edge, are in theFaces, theD1
6135 will be get along face, which is nearer to theFaces beginning.
6136 theD2 Chamfer size along another of two faces, connected to the edge.
6137 theFaces Sequence of global indices of faces of theShape.
6140 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6143 New GEOM.GEOM_Object, containing the result shape.
6145 # Example: see GEOM_TestAll.py
6146 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6147 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6148 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6149 anObj.SetParameters(Parameters)
6152 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6153 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6155 # @ref swig_FilletChamfer "Example"
6156 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6158 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6159 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6162 if isinstance(theAngle,str):
6164 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6166 theAngle = theAngle*math.pi/180.0
6167 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6168 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6169 anObj.SetParameters(Parameters)
6172 ## Perform a chamfer on edges,
6173 # with distance D1 on the first specified face (if several for one edge)
6174 # @param theShape Shape, to perform chamfer on.
6175 # @param theD1,theD2 Chamfer size
6176 # @param theEdges Sequence of edges of \a theShape.
6177 # @return New GEOM.GEOM_Object, containing the result shape.
6179 # @ref swig_FilletChamfer "Example"
6180 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6182 Perform a chamfer on edges,
6183 with distance D1 on the first specified face (if several for one edge)
6186 theShape Shape, to perform chamfer on.
6187 theD1,theD2 Chamfer size
6188 theEdges Sequence of edges of theShape.
6191 New GEOM.GEOM_Object, containing the result shape.
6193 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6194 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6195 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6196 anObj.SetParameters(Parameters)
6199 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6200 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6201 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6203 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6204 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6207 if isinstance(theAngle,str):
6209 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6211 theAngle = theAngle*math.pi/180.0
6212 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6213 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6214 anObj.SetParameters(Parameters)
6217 ## /sa MakeChamferEdge() and MakeChamferFaces()
6219 # @ref swig_MakeChamfer "Example"
6220 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6222 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6224 # Example: see GEOM_TestOthers.py
6226 if aShapeType == ShapeType["EDGE"]:
6227 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6229 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6232 ## Remove material from a solid by extrusion of the base shape on the given distance.
6233 # @param theInit Shape to remove material from. It must be a solid or
6234 # a compound made of a single solid.
6235 # @param theBase Closed edge or wire defining the base shape to be extruded.
6236 # @param theH Prism dimension along the normal to theBase
6237 # @param theAngle Draft angle in degrees.
6238 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
6240 # @ref tui_creation_prism "Example"
6241 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6243 Add material to a solid by extrusion of the base shape on the given distance.
6246 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6247 theBase Closed edge or wire defining the base shape to be extruded.
6248 theH Prism dimension along the normal to theBase
6249 theAngle Draft angle in degrees.
6252 New GEOM.GEOM_Object, containing the initial shape with removed material.
6254 # Example: see GEOM_TestAll.py
6255 #theH,Parameters = ParseParameters(theH)
6256 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6257 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6258 #anObj.SetParameters(Parameters)
6261 ## Add material to a solid by extrusion of the base shape on the given distance.
6262 # @param theInit Shape to add material to. It must be a solid or
6263 # a compound made of a single solid.
6264 # @param theBase Closed edge or wire defining the base shape to be extruded.
6265 # @param theH Prism dimension along the normal to theBase
6266 # @param theAngle Draft angle in degrees.
6267 # @return New GEOM.GEOM_Object, containing the initial shape with added material
6269 # @ref tui_creation_prism "Example"
6270 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6272 Add material to a solid by extrusion of the base shape on the given distance.
6275 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6276 theBase Closed edge or wire defining the base shape to be extruded.
6277 theH Prism dimension along the normal to theBase
6278 theAngle Draft angle in degrees.
6281 New GEOM.GEOM_Object, containing the initial shape with added material.
6283 # Example: see GEOM_TestAll.py
6284 #theH,Parameters = ParseParameters(theH)
6285 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6286 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6287 #anObj.SetParameters(Parameters)
6293 ## @addtogroup l3_basic_op
6296 ## Perform an Archimde operation on the given shape with given parameters.
6297 # The object presenting the resulting face is returned.
6298 # @param theShape Shape to be put in water.
6299 # @param theWeight Weight og the shape.
6300 # @param theWaterDensity Density of the water.
6301 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
6302 # @return New GEOM.GEOM_Object, containing a section of \a theShape
6303 # by a plane, corresponding to water level.
6305 # @ref tui_archimede "Example"
6306 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6308 Perform an Archimde operation on the given shape with given parameters.
6309 The object presenting the resulting face is returned.
6312 theShape Shape to be put in water.
6313 theWeight Weight og the shape.
6314 theWaterDensity Density of the water.
6315 theMeshDeflection Deflection of the mesh, using to compute the section.
6318 New GEOM.GEOM_Object, containing a section of theShape
6319 by a plane, corresponding to water level.
6321 # Example: see GEOM_TestAll.py
6322 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6323 theWeight,theWaterDensity,theMeshDeflection)
6324 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6325 RaiseIfFailed("MakeArchimede", self.LocalOp)
6326 anObj.SetParameters(Parameters)
6329 # end of l3_basic_op
6332 ## @addtogroup l2_measure
6335 ## Get point coordinates
6338 # @ref tui_measurement_tools_page "Example"
6339 def PointCoordinates(self,Point):
6341 Get point coordinates
6346 # Example: see GEOM_TestMeasures.py
6347 aTuple = self.MeasuOp.PointCoordinates(Point)
6348 RaiseIfFailed("PointCoordinates", self.MeasuOp)
6351 ## Get summarized length of all wires,
6352 # area of surface and volume of the given shape.
6353 # @param theShape Shape to define properties of.
6354 # @return [theLength, theSurfArea, theVolume]\n
6355 # theLength: Summarized length of all wires of the given shape.\n
6356 # theSurfArea: Area of surface of the given shape.\n
6357 # theVolume: Volume of the given shape.
6359 # @ref tui_measurement_tools_page "Example"
6360 def BasicProperties(self,theShape):
6362 Get summarized length of all wires,
6363 area of surface and volume of the given shape.
6366 theShape Shape to define properties of.
6369 [theLength, theSurfArea, theVolume]
6370 theLength: Summarized length of all wires of the given shape.
6371 theSurfArea: Area of surface of the given shape.
6372 theVolume: Volume of the given shape.
6374 # Example: see GEOM_TestMeasures.py
6375 aTuple = self.MeasuOp.GetBasicProperties(theShape)
6376 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6379 ## Get parameters of bounding box of the given shape
6380 # @param theShape Shape to obtain bounding box of.
6381 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6382 # Xmin,Xmax: Limits of shape along OX axis.
6383 # Ymin,Ymax: Limits of shape along OY axis.
6384 # Zmin,Zmax: Limits of shape along OZ axis.
6386 # @ref tui_measurement_tools_page "Example"
6387 def BoundingBox(self,theShape):
6389 Get parameters of bounding box of the given shape
6392 theShape Shape to obtain bounding box of.
6395 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6396 Xmin,Xmax: Limits of shape along OX axis.
6397 Ymin,Ymax: Limits of shape along OY axis.
6398 Zmin,Zmax: Limits of shape along OZ axis.
6400 # Example: see GEOM_TestMeasures.py
6401 aTuple = self.MeasuOp.GetBoundingBox(theShape)
6402 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6405 ## Get inertia matrix and moments of inertia of theShape.
6406 # @param theShape Shape to calculate inertia of.
6407 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6408 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
6409 # Ix,Iy,Iz: Moments of inertia of the given shape.
6411 # @ref tui_measurement_tools_page "Example"
6412 def Inertia(self,theShape):
6414 Get inertia matrix and moments of inertia of theShape.
6417 theShape Shape to calculate inertia of.
6420 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6421 I(1-3)(1-3): Components of the inertia matrix of the given shape.
6422 Ix,Iy,Iz: Moments of inertia of the given shape.
6424 # Example: see GEOM_TestMeasures.py
6425 aTuple = self.MeasuOp.GetInertia(theShape)
6426 RaiseIfFailed("GetInertia", self.MeasuOp)
6429 ## Get if coords are included in the shape (ST_IN or ST_ON)
6430 # @param theShape Shape
6431 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6432 # @param tolerance to be used (default is 1.0e-7)
6433 # @return list_of_boolean = [res1, res2, ...]
6434 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6436 Get if coords are included in the shape (ST_IN or ST_ON)
6440 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6441 tolerance to be used (default is 1.0e-7)
6444 list_of_boolean = [res1, res2, ...]
6446 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6448 ## Get minimal distance between the given shapes.
6449 # @param theShape1,theShape2 Shapes to find minimal distance between.
6450 # @return Value of the minimal distance between the given shapes.
6452 # @ref tui_measurement_tools_page "Example"
6453 def MinDistance(self, theShape1, theShape2):
6455 Get minimal distance between the given shapes.
6458 theShape1,theShape2 Shapes to find minimal distance between.
6461 Value of the minimal distance between the given shapes.
6463 # Example: see GEOM_TestMeasures.py
6464 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6465 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6468 ## Get minimal distance between the given shapes.
6469 # @param theShape1,theShape2 Shapes to find minimal distance between.
6470 # @return Value of the minimal distance between the given shapes.
6472 # @ref swig_all_measure "Example"
6473 def MinDistanceComponents(self, theShape1, theShape2):
6475 Get minimal distance between the given shapes.
6478 theShape1,theShape2 Shapes to find minimal distance between.
6481 Value of the minimal distance between the given shapes.
6483 # Example: see GEOM_TestMeasures.py
6484 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6485 RaiseIfFailed("GetMinDistance", self.MeasuOp)
6486 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6489 ## Get angle between the given shapes in degrees.
6490 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6491 # @note If both arguments are vectors, the angle is computed in accordance
6492 # with their orientations, otherwise the minimum angle is computed.
6493 # @return Value of the angle between the given shapes in degrees.
6495 # @ref tui_measurement_tools_page "Example"
6496 def GetAngle(self, theShape1, theShape2):
6498 Get angle between the given shapes in degrees.
6501 theShape1,theShape2 Lines or linear edges to find angle between.
6504 If both arguments are vectors, the angle is computed in accordance
6505 with their orientations, otherwise the minimum angle is computed.
6508 Value of the angle between the given shapes in degrees.
6510 # Example: see GEOM_TestMeasures.py
6511 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6512 RaiseIfFailed("GetAngle", self.MeasuOp)
6515 ## Get angle between the given shapes in radians.
6516 # @param theShape1,theShape2 Lines or linear edges to find angle between.
6517 # @note If both arguments are vectors, the angle is computed in accordance
6518 # with their orientations, otherwise the minimum angle is computed.
6519 # @return Value of the angle between the given shapes in radians.
6521 # @ref tui_measurement_tools_page "Example"
6522 def GetAngleRadians(self, theShape1, theShape2):
6524 Get angle between the given shapes in radians.
6527 theShape1,theShape2 Lines or linear edges to find angle between.
6531 If both arguments are vectors, the angle is computed in accordance
6532 with their orientations, otherwise the minimum angle is computed.
6535 Value of the angle between the given shapes in radians.
6537 # Example: see GEOM_TestMeasures.py
6538 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6539 RaiseIfFailed("GetAngle", self.MeasuOp)
6542 ## @name Curve Curvature Measurement
6543 # Methods for receiving radius of curvature of curves
6544 # in the given point
6547 ## Measure curvature of a curve at a point, set by parameter.
6548 # @param theCurve a curve.
6549 # @param theParam parameter.
6550 # @return radius of curvature of \a theCurve.
6552 # @ref swig_todo "Example"
6553 def CurveCurvatureByParam(self, theCurve, theParam):
6555 Measure curvature of a curve at a point, set by parameter.
6562 radius of curvature of theCurve.
6564 # Example: see GEOM_TestMeasures.py
6565 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6566 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6569 ## Measure curvature of a curve at a point.
6570 # @param theCurve a curve.
6571 # @param thePoint given point.
6572 # @return radius of curvature of \a theCurve.
6574 # @ref swig_todo "Example"
6575 def CurveCurvatureByPoint(self, theCurve, thePoint):
6577 Measure curvature of a curve at a point.
6581 thePoint given point.
6584 radius of curvature of theCurve.
6586 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6587 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6591 ## @name Surface Curvature Measurement
6592 # Methods for receiving max and min radius of curvature of surfaces
6593 # in the given point
6596 ## Measure max radius of curvature of surface.
6597 # @param theSurf the given surface.
6598 # @param theUParam Value of U-parameter on the referenced surface.
6599 # @param theVParam Value of V-parameter on the referenced surface.
6600 # @return max radius of curvature of theSurf.
6602 ## @ref swig_todo "Example"
6603 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6605 Measure max radius of curvature of surface.
6608 theSurf the given surface.
6609 theUParam Value of U-parameter on the referenced surface.
6610 theVParam Value of V-parameter on the referenced surface.
6613 max radius of curvature of theSurf.
6615 # Example: see GEOM_TestMeasures.py
6616 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6617 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6620 ## Measure max radius of curvature of surface in the given point
6621 # @param theSurf the given surface.
6622 # @param thePoint given point.
6623 # @return max radius of curvature of theSurf.
6625 ## @ref swig_todo "Example"
6626 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6628 Measure max radius of curvature of surface in the given point.
6631 theSurf the given surface.
6632 thePoint given point.
6635 max radius of curvature of theSurf.
6637 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6638 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6641 ## Measure min radius of curvature of surface.
6642 # @param theSurf the given surface.
6643 # @param theUParam Value of U-parameter on the referenced surface.
6644 # @param theVParam Value of V-parameter on the referenced surface.
6645 # @return min radius of curvature of theSurf.
6647 ## @ref swig_todo "Example"
6648 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6650 Measure min radius of curvature of surface.
6653 theSurf the given surface.
6654 theUParam Value of U-parameter on the referenced surface.
6655 theVParam Value of V-parameter on the referenced surface.
6658 Min radius of curvature of theSurf.
6660 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6661 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6664 ## Measure min radius of curvature of surface in the given point
6665 # @param theSurf the given surface.
6666 # @param thePoint given point.
6667 # @return min radius of curvature of theSurf.
6669 ## @ref swig_todo "Example"
6670 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6672 Measure min radius of curvature of surface in the given point.
6675 theSurf the given surface.
6676 thePoint given point.
6679 Min radius of curvature of theSurf.
6681 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
6682 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
6686 ## Get min and max tolerances of sub-shapes of theShape
6687 # @param theShape Shape, to get tolerances of.
6688 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
6689 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
6690 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
6691 # VertMin,VertMax: Min and max tolerances of the vertices.
6693 # @ref tui_measurement_tools_page "Example"
6694 def Tolerance(self,theShape):
6696 Get min and max tolerances of sub-shapes of theShape
6699 theShape Shape, to get tolerances of.
6702 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
6703 FaceMin,FaceMax: Min and max tolerances of the faces.
6704 EdgeMin,EdgeMax: Min and max tolerances of the edges.
6705 VertMin,VertMax: Min and max tolerances of the vertices.
6707 # Example: see GEOM_TestMeasures.py
6708 aTuple = self.MeasuOp.GetTolerance(theShape)
6709 RaiseIfFailed("GetTolerance", self.MeasuOp)
6712 ## Obtain description of the given shape (number of sub-shapes of each type)
6713 # @param theShape Shape to be described.
6714 # @return Description of the given shape.
6716 # @ref tui_measurement_tools_page "Example"
6717 def WhatIs(self,theShape):
6719 Obtain description of the given shape (number of sub-shapes of each type)
6722 theShape Shape to be described.
6725 Description of the given shape.
6727 # Example: see GEOM_TestMeasures.py
6728 aDescr = self.MeasuOp.WhatIs(theShape)
6729 RaiseIfFailed("WhatIs", self.MeasuOp)
6732 ## Obtain quantity of shapes of the given type in \a theShape.
6733 # If \a theShape is of type \a theType, it is also counted.
6734 # @param theShape Shape to be described.
6735 # @param theType the given ShapeType().
6736 # @return Quantity of shapes of type \a theType in \a theShape.
6738 # @ref tui_measurement_tools_page "Example"
6739 def NbShapes (self, theShape, theType):
6741 Obtain quantity of shapes of the given type in theShape.
6742 If theShape is of type theType, it is also counted.
6745 theShape Shape to be described.
6746 theType the given geompy.ShapeType
6749 Quantity of shapes of type theType in theShape.
6751 # Example: see GEOM_TestMeasures.py
6752 listSh = self.SubShapeAllIDs(theShape, theType)
6754 t = EnumToLong(theShape.GetShapeType())
6755 theType = EnumToLong(theType)
6761 ## Obtain quantity of shapes of each type in \a theShape.
6762 # The \a theShape is also counted.
6763 # @param theShape Shape to be described.
6764 # @return Dictionary of ShapeType() with bound quantities of shapes.
6766 # @ref tui_measurement_tools_page "Example"
6767 def ShapeInfo (self, theShape):
6769 Obtain quantity of shapes of each type in theShape.
6770 The theShape is also counted.
6773 theShape Shape to be described.
6776 Dictionary of geompy.ShapeType with bound quantities of shapes.
6778 # Example: see GEOM_TestMeasures.py
6780 for typeSh in ShapeType:
6781 if typeSh in ( "AUTO", "SHAPE" ): continue
6782 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
6784 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
6791 ## Get a point, situated at the centre of mass of theShape.
6792 # @param theShape Shape to define centre of mass of.
6793 # @return New GEOM.GEOM_Object, containing the created point.
6795 # @ref tui_measurement_tools_page "Example"
6796 def MakeCDG(self,theShape):
6798 Get a point, situated at the centre of mass of theShape.
6801 theShape Shape to define centre of mass of.
6804 New GEOM.GEOM_Object, containing the created point.
6806 # Example: see GEOM_TestMeasures.py
6807 anObj = self.MeasuOp.GetCentreOfMass(theShape)
6808 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
6811 ## Get a vertex sub-shape by index depended with orientation.
6812 # @param theShape Shape to find sub-shape.
6813 # @param theIndex Index to find vertex by this index (starting from zero)
6814 # @return New GEOM.GEOM_Object, containing the created vertex.
6816 # @ref tui_measurement_tools_page "Example"
6817 def GetVertexByIndex(self,theShape, theIndex):
6819 Get a vertex sub-shape by index depended with orientation.
6822 theShape Shape to find sub-shape.
6823 theIndex Index to find vertex by this index (starting from zero)
6826 New GEOM.GEOM_Object, containing the created vertex.
6828 # Example: see GEOM_TestMeasures.py
6829 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
6830 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
6833 ## Get the first vertex of wire/edge depended orientation.
6834 # @param theShape Shape to find first vertex.
6835 # @return New GEOM.GEOM_Object, containing the created vertex.
6837 # @ref tui_measurement_tools_page "Example"
6838 def GetFirstVertex(self,theShape):
6840 Get the first vertex of wire/edge depended orientation.
6843 theShape Shape to find first vertex.
6846 New GEOM.GEOM_Object, containing the created vertex.
6848 # Example: see GEOM_TestMeasures.py
6849 anObj = self.GetVertexByIndex(theShape, 0)
6850 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
6853 ## Get the last vertex of wire/edge depended orientation.
6854 # @param theShape Shape to find last vertex.
6855 # @return New GEOM.GEOM_Object, containing the created vertex.
6857 # @ref tui_measurement_tools_page "Example"
6858 def GetLastVertex(self,theShape):
6860 Get the last vertex of wire/edge depended orientation.
6863 theShape Shape to find last vertex.
6866 New GEOM.GEOM_Object, containing the created vertex.
6868 # Example: see GEOM_TestMeasures.py
6869 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
6870 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
6871 RaiseIfFailed("GetLastVertex", self.MeasuOp)
6874 ## Get a normale to the given face. If the point is not given,
6875 # the normale is calculated at the center of mass.
6876 # @param theFace Face to define normale of.
6877 # @param theOptionalPoint Point to compute the normale at.
6878 # @return New GEOM.GEOM_Object, containing the created vector.
6880 # @ref swig_todo "Example"
6881 def GetNormal(self, theFace, theOptionalPoint = None):
6883 Get a normale to the given face. If the point is not given,
6884 the normale is calculated at the center of mass.
6887 theFace Face to define normale of.
6888 theOptionalPoint Point to compute the normale at.
6891 New GEOM.GEOM_Object, containing the created vector.
6893 # Example: see GEOM_TestMeasures.py
6894 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
6895 RaiseIfFailed("GetNormal", self.MeasuOp)
6898 ## Check a topology of the given shape.
6899 # @param theShape Shape to check validity of.
6900 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
6901 # if TRUE, the shape's geometry will be checked also.
6902 # @return TRUE, if the shape "seems to be valid".
6903 # If theShape is invalid, prints a description of problem.
6905 # @ref tui_measurement_tools_page "Example"
6906 def CheckShape(self,theShape, theIsCheckGeom = 0):
6908 Check a topology of the given shape.
6911 theShape Shape to check validity of.
6912 theIsCheckGeom If FALSE, only the shape's topology will be checked,
6913 if TRUE, the shape's geometry will be checked also.
6916 TRUE, if the shape "seems to be valid".
6917 If theShape is invalid, prints a description of problem.
6919 # Example: see GEOM_TestMeasures.py
6921 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
6922 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
6924 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
6925 RaiseIfFailed("CheckShape", self.MeasuOp)
6930 ## Detect self-intersections in the given shape.
6931 # @param theShape Shape to check.
6932 # @return TRUE, if the shape contains no self-intersections.
6934 # @ref tui_measurement_tools_page "Example"
6935 def CheckSelfIntersections (self, theShape):
6937 Detect self-intersections in the given shape.
6940 theShape Shape to check.
6943 TRUE, if the shape contains no self-intersections.
6945 # Example: see GEOM_TestMeasures.py
6946 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
6947 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
6950 ## Get position (LCS) of theShape.
6952 # Origin of the LCS is situated at the shape's center of mass.
6953 # Axes of the LCS are obtained from shape's location or,
6954 # if the shape is a planar face, from position of its plane.
6956 # @param theShape Shape to calculate position of.
6957 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
6958 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
6959 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
6960 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
6962 # @ref swig_todo "Example"
6963 def GetPosition(self,theShape):
6965 Get position (LCS) of theShape.
6966 Origin of the LCS is situated at the shape's center of mass.
6967 Axes of the LCS are obtained from shape's location or,
6968 if the shape is a planar face, from position of its plane.
6971 theShape Shape to calculate position of.
6974 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
6975 Ox,Oy,Oz: Coordinates of shape's LCS origin.
6976 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
6977 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
6979 # Example: see GEOM_TestMeasures.py
6980 aTuple = self.MeasuOp.GetPosition(theShape)
6981 RaiseIfFailed("GetPosition", self.MeasuOp)
6984 ## Get kind of theShape.
6986 # @param theShape Shape to get a kind of.
6987 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
6988 # and a list of parameters, describing the shape.
6989 # @note Concrete meaning of each value, returned via \a theIntegers
6990 # or \a theDoubles list depends on the kind() of the shape.
6992 # @ref swig_todo "Example"
6993 def KindOfShape(self,theShape):
6995 Get kind of theShape.
6998 theShape Shape to get a kind of.
7001 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7002 and a list of parameters, describing the shape.
7004 Concrete meaning of each value, returned via theIntegers
7005 or theDoubles list depends on the geompy.kind of the shape
7007 # Example: see GEOM_TestMeasures.py
7008 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7009 RaiseIfFailed("KindOfShape", self.MeasuOp)
7011 aKind = aRoughTuple[0]
7012 anInts = aRoughTuple[1]
7013 aDbls = aRoughTuple[2]
7015 # Now there is no exception from this rule:
7016 aKindTuple = [aKind] + aDbls + anInts
7018 # If they are we will regroup parameters for such kind of shape.
7020 #if aKind == kind.SOME_KIND:
7021 # # SOME_KIND int int double int double double
7022 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7029 ## @addtogroup l2_import_export
7032 ## Import a shape from the BREP or IGES or STEP file
7033 # (depends on given format) with given name.
7034 # @param theFileName The file, containing the shape.
7035 # @param theFormatName Specify format for the file reading.
7036 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7037 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7038 # set to 'meter' and result model will be scaled.
7039 # @return New GEOM.GEOM_Object, containing the imported shape.
7041 # @ref swig_Import_Export "Example"
7042 def ImportFile(self,theFileName, theFormatName):
7044 Import a shape from the BREP or IGES or STEP file
7045 (depends on given format) with given name.
7048 theFileName The file, containing the shape.
7049 theFormatName Specify format for the file reading.
7050 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7051 If format 'IGES_SCALE' is used instead 'IGES' length unit will be
7052 set to 'meter' and result model will be scaled.
7055 New GEOM.GEOM_Object, containing the imported shape.
7057 # Example: see GEOM_TestOthers.py
7058 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7059 RaiseIfFailed("Import", self.InsertOp)
7062 ## Deprecated analog of ImportFile()
7063 def Import(self,theFileName, theFormatName):
7065 Deprecated analog of geompy.ImportFile
7067 print "WARNING: Function Import is deprecated, use ImportFile instead"
7068 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7069 RaiseIfFailed("Import", self.InsertOp)
7072 ## Shortcut to ImportFile() for BREP format
7074 # @ref swig_Import_Export "Example"
7075 def ImportBREP(self,theFileName):
7077 geompy.ImportFile(...) function for BREP format
7079 # Example: see GEOM_TestOthers.py
7080 return self.ImportFile(theFileName, "BREP")
7082 ## Shortcut to ImportFile() for IGES format
7084 # @ref swig_Import_Export "Example"
7085 def ImportIGES(self,theFileName):
7087 geompy.ImportFile(...) function for IGES format
7089 # Example: see GEOM_TestOthers.py
7090 return self.ImportFile(theFileName, "IGES")
7092 ## Return length unit from given IGES file
7094 # @ref swig_Import_Export "Example"
7095 def GetIGESUnit(self,theFileName):
7097 Return length unit from given IGES file
7099 # Example: see GEOM_TestOthers.py
7100 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
7101 #RaiseIfFailed("Import", self.InsertOp)
7102 # recieve name using returned vertex
7104 if anObj.GetShapeType() == GEOM.VERTEX:
7107 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
7109 p = self.PointCoordinates(vertices[0])
7110 if abs(p[0]-0.01) < 1.e-6:
7112 elif abs(p[0]-0.001) < 1.e-6:
7116 ## Shortcut to ImportFile() for STEP format
7118 # @ref swig_Import_Export "Example"
7119 def ImportSTEP(self,theFileName):
7121 geompy.ImportFile(...) function for STEP format
7123 # Example: see GEOM_TestOthers.py
7124 return self.ImportFile(theFileName, "STEP")
7126 ## Export the given shape into a file with given name.
7127 # @param theObject Shape to be stored in the file.
7128 # @param theFileName Name of the file to store the given shape in.
7129 # @param theFormatName Specify format for the shape storage.
7130 # Available formats can be obtained with InsertOp.ImportTranslators() method.
7132 # @ref swig_Import_Export "Example"
7133 def Export(self,theObject, theFileName, theFormatName):
7135 Export the given shape into a file with given name.
7138 theObject Shape to be stored in the file.
7139 theFileName Name of the file to store the given shape in.
7140 theFormatName Specify format for the shape storage.
7141 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7143 # Example: see GEOM_TestOthers.py
7144 self.InsertOp.Export(theObject, theFileName, theFormatName)
7145 if self.InsertOp.IsDone() == 0:
7146 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
7150 ## Shortcut to Export() for BREP format
7152 # @ref swig_Import_Export "Example"
7153 def ExportBREP(self,theObject, theFileName):
7155 geompy.Export(...) function for BREP format
7157 # Example: see GEOM_TestOthers.py
7158 return self.Export(theObject, theFileName, "BREP")
7160 ## Shortcut to Export() for IGES format
7162 # @ref swig_Import_Export "Example"
7163 def ExportIGES(self,theObject, theFileName):
7165 geompy.Export(...) function for IGES format
7167 # Example: see GEOM_TestOthers.py
7168 return self.Export(theObject, theFileName, "IGES")
7170 ## Shortcut to Export() for STEP format
7172 # @ref swig_Import_Export "Example"
7173 def ExportSTEP(self,theObject, theFileName):
7175 geompy.Export(...) function for STEP format
7177 # Example: see GEOM_TestOthers.py
7178 return self.Export(theObject, theFileName, "STEP")
7180 # end of l2_import_export
7183 ## @addtogroup l3_blocks
7186 ## Create a quadrangle face from four edges. Order of Edges is not
7187 # important. It is not necessary that edges share the same vertex.
7188 # @param E1,E2,E3,E4 Edges for the face bound.
7189 # @return New GEOM.GEOM_Object, containing the created face.
7191 # @ref tui_building_by_blocks_page "Example"
7192 def MakeQuad(self,E1, E2, E3, E4):
7194 Create a quadrangle face from four edges. Order of Edges is not
7195 important. It is not necessary that edges share the same vertex.
7198 E1,E2,E3,E4 Edges for the face bound.
7201 New GEOM.GEOM_Object, containing the created face.
7204 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7206 # Example: see GEOM_Spanner.py
7207 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7208 RaiseIfFailed("MakeQuad", self.BlocksOp)
7211 ## Create a quadrangle face on two edges.
7212 # The missing edges will be built by creating the shortest ones.
7213 # @param E1,E2 Two opposite edges for the face.
7214 # @return New GEOM.GEOM_Object, containing the created face.
7216 # @ref tui_building_by_blocks_page "Example"
7217 def MakeQuad2Edges(self,E1, E2):
7219 Create a quadrangle face on two edges.
7220 The missing edges will be built by creating the shortest ones.
7223 E1,E2 Two opposite edges for the face.
7226 New GEOM.GEOM_Object, containing the created face.
7230 p1 = geompy.MakeVertex( 0., 0., 0.)
7231 p2 = geompy.MakeVertex(150., 30., 0.)
7232 p3 = geompy.MakeVertex( 0., 120., 50.)
7233 p4 = geompy.MakeVertex( 0., 40., 70.)
7235 edge1 = geompy.MakeEdge(p1, p2)
7236 edge2 = geompy.MakeEdge(p3, p4)
7237 # create a quadrangle face from two edges
7238 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7240 # Example: see GEOM_Spanner.py
7241 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7242 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7245 ## Create a quadrangle face with specified corners.
7246 # The missing edges will be built by creating the shortest ones.
7247 # @param V1,V2,V3,V4 Corner vertices for the face.
7248 # @return New GEOM.GEOM_Object, containing the created face.
7250 # @ref tui_building_by_blocks_page "Example 1"
7251 # \n @ref swig_MakeQuad4Vertices "Example 2"
7252 def MakeQuad4Vertices(self,V1, V2, V3, V4):
7254 Create a quadrangle face with specified corners.
7255 The missing edges will be built by creating the shortest ones.
7258 V1,V2,V3,V4 Corner vertices for the face.
7261 New GEOM.GEOM_Object, containing the created face.
7265 p1 = geompy.MakeVertex( 0., 0., 0.)
7266 p2 = geompy.MakeVertex(150., 30., 0.)
7267 p3 = geompy.MakeVertex( 0., 120., 50.)
7268 p4 = geompy.MakeVertex( 0., 40., 70.)
7269 # create a quadrangle from four points in its corners
7270 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7272 # Example: see GEOM_Spanner.py
7273 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7274 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7277 ## Create a hexahedral solid, bounded by the six given faces. Order of
7278 # faces is not important. It is not necessary that Faces share the same edge.
7279 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7280 # @return New GEOM.GEOM_Object, containing the created solid.
7282 # @ref tui_building_by_blocks_page "Example 1"
7283 # \n @ref swig_MakeHexa "Example 2"
7284 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7286 Create a hexahedral solid, bounded by the six given faces. Order of
7287 faces is not important. It is not necessary that Faces share the same edge.
7290 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7293 New GEOM.GEOM_Object, containing the created solid.
7296 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7298 # Example: see GEOM_Spanner.py
7299 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7300 RaiseIfFailed("MakeHexa", self.BlocksOp)
7303 ## Create a hexahedral solid between two given faces.
7304 # The missing faces will be built by creating the smallest ones.
7305 # @param F1,F2 Two opposite faces for the hexahedral solid.
7306 # @return New GEOM.GEOM_Object, containing the created solid.
7308 # @ref tui_building_by_blocks_page "Example 1"
7309 # \n @ref swig_MakeHexa2Faces "Example 2"
7310 def MakeHexa2Faces(self,F1, F2):
7312 Create a hexahedral solid between two given faces.
7313 The missing faces will be built by creating the smallest ones.
7316 F1,F2 Two opposite faces for the hexahedral solid.
7319 New GEOM.GEOM_Object, containing the created solid.
7322 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7324 # Example: see GEOM_Spanner.py
7325 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7326 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7332 ## @addtogroup l3_blocks_op
7335 ## Get a vertex, found in the given shape by its coordinates.
7336 # @param theShape Block or a compound of blocks.
7337 # @param theX,theY,theZ Coordinates of the sought vertex.
7338 # @param theEpsilon Maximum allowed distance between the resulting
7339 # vertex and point with the given coordinates.
7340 # @return New GEOM.GEOM_Object, containing the found vertex.
7342 # @ref swig_GetPoint "Example"
7343 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7345 Get a vertex, found in the given shape by its coordinates.
7348 theShape Block or a compound of blocks.
7349 theX,theY,theZ Coordinates of the sought vertex.
7350 theEpsilon Maximum allowed distance between the resulting
7351 vertex and point with the given coordinates.
7354 New GEOM.GEOM_Object, containing the found vertex.
7357 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
7359 # Example: see GEOM_TestOthers.py
7360 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7361 RaiseIfFailed("GetPoint", self.BlocksOp)
7364 ## Find a vertex of the given shape, which has minimal distance to the given point.
7365 # @param theShape Any shape.
7366 # @param thePoint Point, close to the desired vertex.
7367 # @return New GEOM.GEOM_Object, containing the found vertex.
7369 # @ref swig_GetVertexNearPoint "Example"
7370 def GetVertexNearPoint(self, theShape, thePoint):
7372 Find a vertex of the given shape, which has minimal distance to the given point.
7376 thePoint Point, close to the desired vertex.
7379 New GEOM.GEOM_Object, containing the found vertex.
7382 pmidle = geompy.MakeVertex(50, 0, 50)
7383 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7385 # Example: see GEOM_TestOthers.py
7386 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7387 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7390 ## Get an edge, found in the given shape by two given vertices.
7391 # @param theShape Block or a compound of blocks.
7392 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7393 # @return New GEOM.GEOM_Object, containing the found edge.
7395 # @ref swig_GetEdge "Example"
7396 def GetEdge(self, theShape, thePoint1, thePoint2):
7398 Get an edge, found in the given shape by two given vertices.
7401 theShape Block or a compound of blocks.
7402 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7405 New GEOM.GEOM_Object, containing the found edge.
7407 # Example: see GEOM_Spanner.py
7408 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7409 RaiseIfFailed("GetEdge", self.BlocksOp)
7412 ## Find an edge of the given shape, which has minimal distance to the given point.
7413 # @param theShape Block or a compound of blocks.
7414 # @param thePoint Point, close to the desired edge.
7415 # @return New GEOM.GEOM_Object, containing the found edge.
7417 # @ref swig_GetEdgeNearPoint "Example"
7418 def GetEdgeNearPoint(self, theShape, thePoint):
7420 Find an edge of the given shape, which has minimal distance to the given point.
7423 theShape Block or a compound of blocks.
7424 thePoint Point, close to the desired edge.
7427 New GEOM.GEOM_Object, containing the found edge.
7429 # Example: see GEOM_TestOthers.py
7430 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7431 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7434 ## Returns a face, found in the given shape by four given corner vertices.
7435 # @param theShape Block or a compound of blocks.
7436 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7437 # @return New GEOM.GEOM_Object, containing the found face.
7439 # @ref swig_todo "Example"
7440 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7442 Returns a face, found in the given shape by four given corner vertices.
7445 theShape Block or a compound of blocks.
7446 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7449 New GEOM.GEOM_Object, containing the found face.
7451 # Example: see GEOM_Spanner.py
7452 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7453 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7456 ## Get a face of block, found in the given shape by two given edges.
7457 # @param theShape Block or a compound of blocks.
7458 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7459 # @return New GEOM.GEOM_Object, containing the found face.
7461 # @ref swig_todo "Example"
7462 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7464 Get a face of block, found in the given shape by two given edges.
7467 theShape Block or a compound of blocks.
7468 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7471 New GEOM.GEOM_Object, containing the found face.
7473 # Example: see GEOM_Spanner.py
7474 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7475 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7478 ## Find a face, opposite to the given one in the given block.
7479 # @param theBlock Must be a hexahedral solid.
7480 # @param theFace Face of \a theBlock, opposite to the desired face.
7481 # @return New GEOM.GEOM_Object, containing the found face.
7483 # @ref swig_GetOppositeFace "Example"
7484 def GetOppositeFace(self,theBlock, theFace):
7486 Find a face, opposite to the given one in the given block.
7489 theBlock Must be a hexahedral solid.
7490 theFace Face of theBlock, opposite to the desired face.
7493 New GEOM.GEOM_Object, containing the found face.
7495 # Example: see GEOM_Spanner.py
7496 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7497 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7500 ## Find a face of the given shape, which has minimal distance to the given point.
7501 # @param theShape Block or a compound of blocks.
7502 # @param thePoint Point, close to the desired face.
7503 # @return New GEOM.GEOM_Object, containing the found face.
7505 # @ref swig_GetFaceNearPoint "Example"
7506 def GetFaceNearPoint(self, theShape, thePoint):
7508 Find a face of the given shape, which has minimal distance to the given point.
7511 theShape Block or a compound of blocks.
7512 thePoint Point, close to the desired face.
7515 New GEOM.GEOM_Object, containing the found face.
7517 # Example: see GEOM_Spanner.py
7518 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7519 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7522 ## Find a face of block, whose outside normale has minimal angle with the given vector.
7523 # @param theBlock Block or a compound of blocks.
7524 # @param theVector Vector, close to the normale of the desired face.
7525 # @return New GEOM.GEOM_Object, containing the found face.
7527 # @ref swig_todo "Example"
7528 def GetFaceByNormale(self, theBlock, theVector):
7530 Find a face of block, whose outside normale has minimal angle with the given vector.
7533 theBlock Block or a compound of blocks.
7534 theVector Vector, close to the normale of the desired face.
7537 New GEOM.GEOM_Object, containing the found face.
7539 # Example: see GEOM_Spanner.py
7540 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7541 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7544 ## Find all sub-shapes of type \a theShapeType of the given shape,
7545 # which have minimal distance to the given point.
7546 # @param theShape Any shape.
7547 # @param thePoint Point, close to the desired shape.
7548 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7549 # @param theTolerance The tolerance for distances comparison. All shapes
7550 # with distances to the given point in interval
7551 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
7552 # @return New GEOM_Object, containing a group of all found shapes.
7554 # @ref swig_GetShapesNearPoint "Example"
7555 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7557 Find all sub-shapes of type theShapeType of the given shape,
7558 which have minimal distance to the given point.
7562 thePoint Point, close to the desired shape.
7563 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7564 theTolerance The tolerance for distances comparison. All shapes
7565 with distances to the given point in interval
7566 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7569 New GEOM_Object, containing a group of all found shapes.
7571 # Example: see GEOM_TestOthers.py
7572 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7573 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7576 # end of l3_blocks_op
7579 ## @addtogroup l4_blocks_measure
7582 ## Check, if the compound of blocks is given.
7583 # To be considered as a compound of blocks, the
7584 # given shape must satisfy the following conditions:
7585 # - Each element of the compound should be a Block (6 faces and 12 edges).
7586 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7587 # - The compound should be connexe.
7588 # - The glue between two quadrangle faces should be applied.
7589 # @param theCompound The compound to check.
7590 # @return TRUE, if the given shape is a compound of blocks.
7591 # If theCompound is not valid, prints all discovered errors.
7593 # @ref tui_measurement_tools_page "Example 1"
7594 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
7595 def CheckCompoundOfBlocks(self,theCompound):
7597 Check, if the compound of blocks is given.
7598 To be considered as a compound of blocks, the
7599 given shape must satisfy the following conditions:
7600 - Each element of the compound should be a Block (6 faces and 12 edges).
7601 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
7602 - The compound should be connexe.
7603 - The glue between two quadrangle faces should be applied.
7606 theCompound The compound to check.
7609 TRUE, if the given shape is a compound of blocks.
7610 If theCompound is not valid, prints all discovered errors.
7612 # Example: see GEOM_Spanner.py
7613 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
7614 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
7616 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
7620 ## Remove all seam and degenerated edges from \a theShape.
7621 # Unite faces and edges, sharing one surface. It means that
7622 # this faces must have references to one C++ surface object (handle).
7623 # @param theShape The compound or single solid to remove irregular edges from.
7624 # @param doUnionFaces If True, then unite faces. If False (the default value),
7625 # do not unite faces.
7626 # @return Improved shape.
7628 # @ref swig_RemoveExtraEdges "Example"
7629 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
7631 Remove all seam and degenerated edges from theShape.
7632 Unite faces and edges, sharing one surface. It means that
7633 this faces must have references to one C++ surface object (handle).
7636 theShape The compound or single solid to remove irregular edges from.
7637 doUnionFaces If True, then unite faces. If False (the default value),
7643 # Example: see GEOM_TestOthers.py
7644 nbFacesOptimum = -1 # -1 means do not unite faces
7645 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
7646 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
7647 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
7650 ## Check, if the given shape is a blocks compound.
7651 # Fix all detected errors.
7652 # \note Single block can be also fixed by this method.
7653 # @param theShape The compound to check and improve.
7654 # @return Improved compound.
7656 # @ref swig_CheckAndImprove "Example"
7657 def CheckAndImprove(self,theShape):
7659 Check, if the given shape is a blocks compound.
7660 Fix all detected errors.
7663 Single block can be also fixed by this method.
7666 theShape The compound to check and improve.
7671 # Example: see GEOM_TestOthers.py
7672 anObj = self.BlocksOp.CheckAndImprove(theShape)
7673 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
7676 # end of l4_blocks_measure
7679 ## @addtogroup l3_blocks_op
7682 ## Get all the blocks, contained in the given compound.
7683 # @param theCompound The compound to explode.
7684 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
7685 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
7686 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7687 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
7689 # @ref tui_explode_on_blocks "Example 1"
7690 # \n @ref swig_MakeBlockExplode "Example 2"
7691 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
7693 Get all the blocks, contained in the given compound.
7696 theCompound The compound to explode.
7697 theMinNbFaces If solid has lower number of faces, it is not a block.
7698 theMaxNbFaces If solid has higher number of faces, it is not a block.
7701 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
7704 List of GEOM.GEOM_Object, containing the retrieved blocks.
7706 # Example: see GEOM_TestOthers.py
7707 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
7708 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
7709 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
7711 anObj.SetParameters(Parameters)
7715 ## Find block, containing the given point inside its volume or on boundary.
7716 # @param theCompound Compound, to find block in.
7717 # @param thePoint Point, close to the desired block. If the point lays on
7718 # boundary between some blocks, we return block with nearest center.
7719 # @return New GEOM.GEOM_Object, containing the found block.
7721 # @ref swig_todo "Example"
7722 def GetBlockNearPoint(self,theCompound, thePoint):
7724 Find block, containing the given point inside its volume or on boundary.
7727 theCompound Compound, to find block in.
7728 thePoint Point, close to the desired block. If the point lays on
7729 boundary between some blocks, we return block with nearest center.
7732 New GEOM.GEOM_Object, containing the found block.
7734 # Example: see GEOM_Spanner.py
7735 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
7736 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
7739 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
7740 # @param theCompound Compound, to find block in.
7741 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
7742 # @return New GEOM.GEOM_Object, containing the found block.
7744 # @ref swig_GetBlockByParts "Example"
7745 def GetBlockByParts(self,theCompound, theParts):
7747 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
7750 theCompound Compound, to find block in.
7751 theParts List of faces and/or edges and/or vertices to be parts of the found block.
7754 New GEOM_Object, containing the found block.
7756 # Example: see GEOM_TestOthers.py
7757 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
7758 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
7761 ## Return all blocks, containing all the elements, passed as the parts.
7762 # @param theCompound Compound, to find blocks in.
7763 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
7764 # @return List of GEOM.GEOM_Object, containing the found blocks.
7766 # @ref swig_todo "Example"
7767 def GetBlocksByParts(self,theCompound, theParts):
7769 Return all blocks, containing all the elements, passed as the parts.
7772 theCompound Compound, to find blocks in.
7773 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
7776 List of GEOM.GEOM_Object, containing the found blocks.
7778 # Example: see GEOM_Spanner.py
7779 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
7780 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
7783 ## Multi-transformate block and glue the result.
7784 # Transformation is defined so, as to superpose direction faces.
7785 # @param Block Hexahedral solid to be multi-transformed.
7786 # @param DirFace1 ID of First direction face.
7787 # @param DirFace2 ID of Second direction face.
7788 # @param NbTimes Quantity of transformations to be done.
7789 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
7790 # @return New GEOM.GEOM_Object, containing the result shape.
7792 # @ref tui_multi_transformation "Example"
7793 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
7795 Multi-transformate block and glue the result.
7796 Transformation is defined so, as to superpose direction faces.
7799 Block Hexahedral solid to be multi-transformed.
7800 DirFace1 ID of First direction face.
7801 DirFace2 ID of Second direction face.
7802 NbTimes Quantity of transformations to be done.
7805 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
7808 New GEOM.GEOM_Object, containing the result shape.
7810 # Example: see GEOM_Spanner.py
7811 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
7812 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
7813 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
7814 anObj.SetParameters(Parameters)
7817 ## Multi-transformate block and glue the result.
7818 # @param Block Hexahedral solid to be multi-transformed.
7819 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
7820 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
7821 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
7822 # @return New GEOM.GEOM_Object, containing the result shape.
7824 # @ref tui_multi_transformation "Example"
7825 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
7826 DirFace1V, DirFace2V, NbTimesV):
7828 Multi-transformate block and glue the result.
7831 Block Hexahedral solid to be multi-transformed.
7832 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
7833 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
7834 NbTimesU,NbTimesV Quantity of transformations to be done.
7837 New GEOM.GEOM_Object, containing the result shape.
7839 # Example: see GEOM_Spanner.py
7840 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
7841 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
7842 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
7843 DirFace1V, DirFace2V, NbTimesV)
7844 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
7845 anObj.SetParameters(Parameters)
7848 ## Build all possible propagation groups.
7849 # Propagation group is a set of all edges, opposite to one (main)
7850 # edge of this group directly or through other opposite edges.
7851 # Notion of Opposite Edge make sence only on quadrangle face.
7852 # @param theShape Shape to build propagation groups on.
7853 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
7855 # @ref swig_Propagate "Example"
7856 def Propagate(self,theShape):
7858 Build all possible propagation groups.
7859 Propagation group is a set of all edges, opposite to one (main)
7860 edge of this group directly or through other opposite edges.
7861 Notion of Opposite Edge make sence only on quadrangle face.
7864 theShape Shape to build propagation groups on.
7867 List of GEOM.GEOM_Object, each of them is a propagation group.
7869 # Example: see GEOM_TestOthers.py
7870 listChains = self.BlocksOp.Propagate(theShape)
7871 RaiseIfFailed("Propagate", self.BlocksOp)
7874 # end of l3_blocks_op
7877 ## @addtogroup l3_groups
7880 ## Creates a new group which will store sub-shapes of theMainShape
7881 # @param theMainShape is a GEOM object on which the group is selected
7882 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
7883 # @return a newly created GEOM group
7885 # @ref tui_working_with_groups_page "Example 1"
7886 # \n @ref swig_CreateGroup "Example 2"
7887 def CreateGroup(self,theMainShape, theShapeType):
7889 Creates a new group which will store sub-shapes of theMainShape
7892 theMainShape is a GEOM object on which the group is selected
7893 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
7894 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
7897 a newly created GEOM group
7900 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
7903 # Example: see GEOM_TestOthers.py
7904 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
7905 RaiseIfFailed("CreateGroup", self.GroupOp)
7908 ## Adds a sub-object with ID theSubShapeId to the group
7909 # @param theGroup is a GEOM group to which the new sub-shape is added
7910 # @param theSubShapeID is a sub-shape ID in the main object.
7911 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
7913 # @ref tui_working_with_groups_page "Example"
7914 def AddObject(self,theGroup, theSubShapeID):
7916 Adds a sub-object with ID theSubShapeId to the group
7919 theGroup is a GEOM group to which the new sub-shape is added
7920 theSubShapeID is a sub-shape ID in the main object.
7923 Use method GetSubShapeID() to get an unique ID of the sub-shape
7925 # Example: see GEOM_TestOthers.py
7926 self.GroupOp.AddObject(theGroup, theSubShapeID)
7927 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
7928 RaiseIfFailed("AddObject", self.GroupOp)
7932 ## Removes a sub-object with ID \a theSubShapeId from the group
7933 # @param theGroup is a GEOM group from which the new sub-shape is removed
7934 # @param theSubShapeID is a sub-shape ID in the main object.
7935 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
7937 # @ref tui_working_with_groups_page "Example"
7938 def RemoveObject(self,theGroup, theSubShapeID):
7940 Removes a sub-object with ID theSubShapeId from the group
7943 theGroup is a GEOM group from which the new sub-shape is removed
7944 theSubShapeID is a sub-shape ID in the main object.
7947 Use method GetSubShapeID() to get an unique ID of the sub-shape
7949 # Example: see GEOM_TestOthers.py
7950 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
7951 RaiseIfFailed("RemoveObject", self.GroupOp)
7954 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
7955 # @param theGroup is a GEOM group to which the new sub-shapes are added.
7956 # @param theSubShapes is a list of sub-shapes to be added.
7958 # @ref tui_working_with_groups_page "Example"
7959 def UnionList (self,theGroup, theSubShapes):
7961 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
7964 theGroup is a GEOM group to which the new sub-shapes are added.
7965 theSubShapes is a list of sub-shapes to be added.
7967 # Example: see GEOM_TestOthers.py
7968 self.GroupOp.UnionList(theGroup, theSubShapes)
7969 RaiseIfFailed("UnionList", self.GroupOp)
7972 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
7973 # @param theGroup is a GEOM group to which the new sub-shapes are added.
7974 # @param theSubShapes is a list of indices of sub-shapes to be added.
7976 # @ref swig_UnionIDs "Example"
7977 def UnionIDs(self,theGroup, theSubShapes):
7979 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
7982 theGroup is a GEOM group to which the new sub-shapes are added.
7983 theSubShapes is a list of indices of sub-shapes to be added.
7985 # Example: see GEOM_TestOthers.py
7986 self.GroupOp.UnionIDs(theGroup, theSubShapes)
7987 RaiseIfFailed("UnionIDs", self.GroupOp)
7990 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
7991 # @param theGroup is a GEOM group from which the sub-shapes are removed.
7992 # @param theSubShapes is a list of sub-shapes to be removed.
7994 # @ref tui_working_with_groups_page "Example"
7995 def DifferenceList (self,theGroup, theSubShapes):
7997 Removes from the group all the given shapes. No errors, if some shapes are not included.
8000 theGroup is a GEOM group from which the sub-shapes are removed.
8001 theSubShapes is a list of sub-shapes to be removed.
8003 # Example: see GEOM_TestOthers.py
8004 self.GroupOp.DifferenceList(theGroup, theSubShapes)
8005 RaiseIfFailed("DifferenceList", self.GroupOp)
8008 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8009 # @param theGroup is a GEOM group from which the sub-shapes are removed.
8010 # @param theSubShapes is a list of indices of sub-shapes to be removed.
8012 # @ref swig_DifferenceIDs "Example"
8013 def DifferenceIDs(self,theGroup, theSubShapes):
8015 Removes from the group all the given shapes. No errors, if some shapes are not included.
8018 theGroup is a GEOM group from which the sub-shapes are removed.
8019 theSubShapes is a list of indices of sub-shapes to be removed.
8021 # Example: see GEOM_TestOthers.py
8022 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8023 RaiseIfFailed("DifferenceIDs", self.GroupOp)
8026 ## Returns a list of sub-objects ID stored in the group
8027 # @param theGroup is a GEOM group for which a list of IDs is requested
8029 # @ref swig_GetObjectIDs "Example"
8030 def GetObjectIDs(self,theGroup):
8032 Returns a list of sub-objects ID stored in the group
8035 theGroup is a GEOM group for which a list of IDs is requested
8037 # Example: see GEOM_TestOthers.py
8038 ListIDs = self.GroupOp.GetObjects(theGroup)
8039 RaiseIfFailed("GetObjects", self.GroupOp)
8042 ## Returns a type of sub-objects stored in the group
8043 # @param theGroup is a GEOM group which type is returned.
8045 # @ref swig_GetType "Example"
8046 def GetType(self,theGroup):
8048 Returns a type of sub-objects stored in the group
8051 theGroup is a GEOM group which type is returned.
8053 # Example: see GEOM_TestOthers.py
8054 aType = self.GroupOp.GetType(theGroup)
8055 RaiseIfFailed("GetType", self.GroupOp)
8058 ## Convert a type of geom object from id to string value
8059 # @param theId is a GEOM obect type id.
8060 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8061 # @ref swig_GetType "Example"
8062 def ShapeIdToType(self, theId):
8064 Convert a type of geom object from id to string value
8067 theId is a GEOM obect type id.
8070 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8145 return "FREE_BOUNDS"
8153 return "THRUSECTIONS"
8155 return "COMPOUNDFILTER"
8157 return "SHAPES_ON_SHAPE"
8159 return "ELLIPSE_ARC"
8166 return "Shape Id not exist."
8168 ## Returns a main shape associated with the group
8169 # @param theGroup is a GEOM group for which a main shape object is requested
8170 # @return a GEOM object which is a main shape for theGroup
8172 # @ref swig_GetMainShape "Example"
8173 def GetMainShape(self,theGroup):
8175 Returns a main shape associated with the group
8178 theGroup is a GEOM group for which a main shape object is requested
8181 a GEOM object which is a main shape for theGroup
8183 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8185 # Example: see GEOM_TestOthers.py
8186 anObj = self.GroupOp.GetMainShape(theGroup)
8187 RaiseIfFailed("GetMainShape", self.GroupOp)
8190 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8191 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8192 # @param theShape given shape (see GEOM.GEOM_Object)
8193 # @param min_length minimum length of edges of theShape
8194 # @param max_length maximum length of edges of theShape
8195 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8196 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8197 # @return a newly created GEOM group of edges
8198 # @@ref swig_todo "Example"
8199 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8201 Create group of edges of theShape, whose length is in range [min_length, max_length].
8202 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8205 theShape given shape
8206 min_length minimum length of edges of theShape
8207 max_length maximum length of edges of theShape
8208 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8209 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8212 a newly created GEOM group of edges.
8214 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8217 Props = self.BasicProperties(edge)
8218 if min_length <= Props[0] and Props[0] <= max_length:
8219 if (not include_min) and (min_length == Props[0]):
8222 if (not include_max) and (Props[0] == max_length):
8225 edges_in_range.append(edge)
8227 if len(edges_in_range) <= 0:
8228 print "No edges found by given criteria"
8231 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8232 self.UnionList(group_edges, edges_in_range)
8236 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8237 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
8238 # @param min_length minimum length of edges of selected shape
8239 # @param max_length maximum length of edges of selected shape
8240 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8241 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8242 # @return a newly created GEOM group of edges
8243 # @ref swig_todo "Example"
8244 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8246 Create group of edges of selected shape, whose length is in range [min_length, max_length].
8247 If include_min/max == 0, edges with length == min/max_length will not be included in result.
8250 min_length minimum length of edges of selected shape
8251 max_length maximum length of edges of selected shape
8252 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8253 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8256 a newly created GEOM group of edges.
8258 nb_selected = sg.SelectedCount()
8260 print "Select a shape before calling this function, please."
8263 print "Only one shape must be selected"
8266 id_shape = sg.getSelected(0)
8267 shape = IDToObject( id_shape )
8269 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8273 if include_min: left_str = " <= "
8274 if include_max: right_str = " <= "
8276 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8277 + left_str + "length" + right_str + `max_length`)
8279 sg.updateObjBrowser(1)
8286 ## @addtogroup l4_advanced
8289 ## Create a T-shape object with specified caracteristics for the main
8290 # and the incident pipes (radius, width, half-length).
8291 # The extremities of the main pipe are located on junctions points P1 and P2.
8292 # The extremity of the incident pipe is located on junction point P3.
8293 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8294 # the main plane of the T-shape is XOY.
8295 # @param theR1 Internal radius of main pipe
8296 # @param theW1 Width of main pipe
8297 # @param theL1 Half-length of main pipe
8298 # @param theR2 Internal radius of incident pipe (R2 < R1)
8299 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8300 # @param theL2 Half-length of incident pipe
8301 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8302 # @param theP1 1st junction point of main pipe
8303 # @param theP2 2nd junction point of main pipe
8304 # @param theP3 Junction point of incident pipe
8305 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8307 # @ref tui_creation_pipetshape "Example"
8308 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8310 Create a T-shape object with specified caracteristics for the main
8311 and the incident pipes (radius, width, half-length).
8312 The extremities of the main pipe are located on junctions points P1 and P2.
8313 The extremity of the incident pipe is located on junction point P3.
8314 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8315 the main plane of the T-shape is XOY.
8318 theR1 Internal radius of main pipe
8319 theW1 Width of main pipe
8320 theL1 Half-length of main pipe
8321 theR2 Internal radius of incident pipe (R2 < R1)
8322 theW2 Width of incident pipe (R2+W2 < R1+W1)
8323 theL2 Half-length of incident pipe
8324 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8325 theP1 1st junction point of main pipe
8326 theP2 2nd junction point of main pipe
8327 theP3 Junction point of incident pipe
8330 List of GEOM_Object, containing the created shape and propagation groups.
8333 # create PipeTShape object
8334 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8335 # create PipeTShape object with position
8336 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8338 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
8339 if (theP1 and theP2 and theP3):
8340 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8342 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8343 RaiseIfFailed("MakePipeTShape", self.AdvOp)
8344 if Parameters: anObj[0].SetParameters(Parameters)
8347 ## Create a T-shape object with chamfer and with specified caracteristics for the main
8348 # and the incident pipes (radius, width, half-length). The chamfer is
8349 # created on the junction of the pipes.
8350 # The extremities of the main pipe are located on junctions points P1 and P2.
8351 # The extremity of the incident pipe is located on junction point P3.
8352 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8353 # the main plane of the T-shape is XOY.
8354 # @param theR1 Internal radius of main pipe
8355 # @param theW1 Width of main pipe
8356 # @param theL1 Half-length of main pipe
8357 # @param theR2 Internal radius of incident pipe (R2 < R1)
8358 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8359 # @param theL2 Half-length of incident pipe
8360 # @param theH Height of the chamfer.
8361 # @param theW Width of the chamfer.
8362 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8363 # @param theP1 1st junction point of main pipe
8364 # @param theP2 2nd junction point of main pipe
8365 # @param theP3 Junction point of incident pipe
8366 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8368 # @ref tui_creation_pipetshape "Example"
8369 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8371 Create a T-shape object with chamfer and with specified caracteristics for the main
8372 and the incident pipes (radius, width, half-length). The chamfer is
8373 created on the junction of the pipes.
8374 The extremities of the main pipe are located on junctions points P1 and P2.
8375 The extremity of the incident pipe is located on junction point P3.
8376 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8377 the main plane of the T-shape is XOY.
8380 theR1 Internal radius of main pipe
8381 theW1 Width of main pipe
8382 theL1 Half-length of main pipe
8383 theR2 Internal radius of incident pipe (R2 < R1)
8384 theW2 Width of incident pipe (R2+W2 < R1+W1)
8385 theL2 Half-length of incident pipe
8386 theH Height of the chamfer.
8387 theW Width of the chamfer.
8388 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8389 theP1 1st junction point of main pipe
8390 theP2 2nd junction point of main pipe
8391 theP3 Junction point of incident pipe
8394 List of GEOM_Object, containing the created shape and propagation groups.
8397 # create PipeTShape with chamfer object
8398 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
8399 # create PipeTShape with chamfer object with position
8400 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
8402 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
8403 if (theP1 and theP2 and theP3):
8404 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
8406 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
8407 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
8408 if Parameters: anObj[0].SetParameters(Parameters)
8411 ## Create a T-shape object with fillet and with specified caracteristics for the main
8412 # and the incident pipes (radius, width, half-length). The fillet is
8413 # created on the junction of the pipes.
8414 # The extremities of the main pipe are located on junctions points P1 and P2.
8415 # The extremity of the incident pipe is located on junction point P3.
8416 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8417 # the main plane of the T-shape is XOY.
8418 # @param theR1 Internal radius of main pipe
8419 # @param theW1 Width of main pipe
8420 # @param theL1 Half-length of main pipe
8421 # @param theR2 Internal radius of incident pipe (R2 < R1)
8422 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8423 # @param theL2 Half-length of incident pipe
8424 # @param theRF Radius of curvature of fillet.
8425 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8426 # @param theP1 1st junction point of main pipe
8427 # @param theP2 2nd junction point of main pipe
8428 # @param theP3 Junction point of incident pipe
8429 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8431 # @ref tui_creation_pipetshape "Example"
8432 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8434 Create a T-shape object with fillet and with specified caracteristics for the main
8435 and the incident pipes (radius, width, half-length). The fillet is
8436 created on the junction of the pipes.
8437 The extremities of the main pipe are located on junctions points P1 and P2.
8438 The extremity of the incident pipe is located on junction point P3.
8441 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8442 the main plane of the T-shape is XOY.
8443 theR1 Internal radius of main pipe
8444 theW1 Width of main pipe
8445 heL1 Half-length of main pipe
8446 theR2 Internal radius of incident pipe (R2 < R1)
8447 theW2 Width of incident pipe (R2+W2 < R1+W1)
8448 theL2 Half-length of incident pipe
8449 theRF Radius of curvature of fillet.
8450 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8451 theP1 1st junction point of main pipe
8452 theP2 2nd junction point of main pipe
8453 theP3 Junction point of incident pipe
8456 List of GEOM_Object, containing the created shape and propagation groups.
8459 # create PipeTShape with fillet object
8460 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
8461 # create PipeTShape with fillet object with position
8462 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
8465 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
8466 if (theP1 and theP2 and theP3):
8467 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
8469 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
8470 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
8471 if Parameters: anObj[0].SetParameters(Parameters)
8474 #@@ insert new functions before this line @@ do not remove this line @@#
8476 # end of l4_advanced
8479 ## Create a copy of the given object
8481 # @param theOriginal geometry object for copy
8482 # @return unique object identifier
8483 # @ingroup l1_geompy_auxiliary
8484 # @ref swig_MakeCopy "Example"
8485 def MakeCopy(self,theOriginal):
8487 Create a copy of the given object
8490 theOriginal geometry object for copy
8493 unique object identifier
8495 Example of usage: Copy = geompy.MakeCopy(Box)
8497 # Example: see GEOM_TestAll.py
8498 anObj = self.InsertOp.MakeCopy(theOriginal)
8499 RaiseIfFailed("MakeCopy", self.InsertOp)
8502 ## Add Path to load python scripts from
8503 # @param Path a path to load python scripts from
8504 # @ingroup l1_geompy_auxiliary
8505 def addPath(self,Path):
8507 Add Path to load python scripts from
8510 Path a path to load python scripts from
8512 if (sys.path.count(Path) < 1):
8513 sys.path.append(Path)
8517 ## Load marker texture from the file
8518 # @param Path a path to the texture file
8519 # @return unique texture identifier
8520 # @ingroup l1_geompy_auxiliary
8521 def LoadTexture(self, Path):
8523 Load marker texture from the file
8526 Path a path to the texture file
8529 unique texture identifier
8531 # Example: see GEOM_TestAll.py
8532 ID = self.InsertOp.LoadTexture(Path)
8533 RaiseIfFailed("LoadTexture", self.InsertOp)
8536 ## Get entry of the object
8537 # @param obj geometry object
8538 # @return unique object identifier
8539 # @ingroup l1_geompy_auxiliary
8540 def getObjectID(self, obj):
8542 Get entry of the object
8548 unique object identifier
8551 entry = salome.ObjectToID(obj)
8552 if entry is not None:
8553 lst = entry.split(":")
8555 ID = lst[-1] # -1 means last item in the list
8561 ## Add marker texture. @a Width and @a Height parameters
8562 # specify width and height of the texture in pixels.
8563 # If @a RowData is @c True, @a Texture parameter should represent texture data
8564 # packed into the byte array. If @a RowData is @c False (default), @a Texture
8565 # parameter should be unpacked string, in which '1' symbols represent opaque
8566 # pixels and '0' represent transparent pixels of the texture bitmap.
8568 # @param Width texture width in pixels
8569 # @param Height texture height in pixels
8570 # @param Texture texture data
8571 # @param RowData if @c True, @a Texture data are packed in the byte stream
8572 # @return unique texture identifier
8573 # @ingroup l1_geompy_auxiliary
8574 def AddTexture(self, Width, Height, Texture, RowData=False):
8576 Add marker texture. Width and Height parameters
8577 specify width and height of the texture in pixels.
8578 If RowData is True, Texture parameter should represent texture data
8579 packed into the byte array. If RowData is False (default), Texture
8580 parameter should be unpacked string, in which '1' symbols represent opaque
8581 pixels and '0' represent transparent pixels of the texture bitmap.
8584 Width texture width in pixels
8585 Height texture height in pixels
8586 Texture texture data
8587 RowData if True, Texture data are packed in the byte stream
8590 return unique texture identifier
8592 if not RowData: Texture = PackData(Texture)
8593 ID = self.InsertOp.AddTexture(Width, Height, Texture)
8594 RaiseIfFailed("AddTexture", self.InsertOp)
8598 #Register the new proxy for GEOM_Gen
8599 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)