1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2010 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
20 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
22 # Author : Paul RASCLE, EDF
30 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
32 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
34 ## @defgroup l2_import_export Importing/exporting geometrical objects
35 ## @defgroup l2_creating Creating geometrical objects
37 ## @defgroup l3_basic_go Creating Basic Geometric Objects
39 ## @defgroup l4_curves Creating Curves
42 ## @defgroup l3_3d_primitives Creating 3D Primitives
43 ## @defgroup l3_complex Creating Complex Objects
44 ## @defgroup l3_groups Working with groups
45 ## @defgroup l3_blocks Building by blocks
47 ## @defgroup l4_blocks_measure Check and Improve
50 ## @defgroup l3_sketcher Sketcher
51 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
53 ## @defgroup l4_decompose Decompose objects
54 ## @defgroup l4_decompose_d Decompose objects deprecated methods
55 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
56 ## @defgroup l4_obtain Access to subshapes by a criteria
57 ## @defgroup l4_advanced Advanced objects creation functions
62 ## @defgroup l2_transforming Transforming geometrical objects
64 ## @defgroup l3_basic_op Basic Operations
65 ## @defgroup l3_boolean Boolean Operations
66 ## @defgroup l3_transform Transformation Operations
67 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
68 ## @defgroup l3_blocks_op Blocks Operations
69 ## @defgroup l3_healing Repairing Operations
70 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
73 ## @defgroup l2_measure Using measurement tools
81 from salome_notebook import *
86 ## Enumeration ShapeType as a dictionary
87 # @ingroup l1_geompy_auxiliary
88 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
90 ## Raise an Error, containing the Method_name, if Operation is Failed
91 ## @ingroup l1_geompy_auxiliary
92 def RaiseIfFailed (Method_name, Operation):
93 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
94 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
96 ## Return list of variables value from salome notebook
97 ## @ingroup l1_geompy_auxiliary
98 def ParseParameters(*parameters):
101 for parameter in parameters:
102 if isinstance(parameter, list):
103 lResults = ParseParameters(*parameter)
104 if len(lResults) > 0:
105 Result.append(lResults[:-1])
106 StringResult += lResults[-1].split(":")
110 if isinstance(parameter,str):
111 if notebook.isVariable(parameter):
112 Result.append(notebook.get(parameter))
114 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
117 Result.append(parameter)
119 StringResult.append(str(parameter))
123 Result.append(":".join(StringResult))
125 Result = ":".join(StringResult)
128 ## Return list of variables value from salome notebook
129 ## @ingroup l1_geompy_auxiliary
133 for parameter in list:
134 if isinstance(parameter,str) and notebook.isVariable(parameter):
135 Result.append(str(notebook.get(parameter)))
138 Result.append(str(parameter))
141 StringResult = StringResult + str(parameter)
142 StringResult = StringResult + ":"
144 StringResult = StringResult[:len(StringResult)-1]
145 return Result, StringResult
147 ## Return list of variables value from salome notebook
148 ## @ingroup l1_geompy_auxiliary
149 def ParseSketcherCommand(command):
152 sections = command.split(":")
153 for section in sections:
154 parameters = section.split(" ")
156 for parameter in parameters:
157 if paramIndex > 1 and parameter.find("'") != -1:
158 parameter = parameter.replace("'","")
159 if notebook.isVariable(parameter):
160 Result = Result + str(notebook.get(parameter)) + " "
163 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
167 Result = Result + str(parameter) + " "
170 StringResult = StringResult + parameter
171 StringResult = StringResult + ":"
173 paramIndex = paramIndex + 1
175 Result = Result[:len(Result)-1] + ":"
177 Result = Result[:len(Result)-1]
178 return Result, StringResult
180 ## Helper function which can be used to pack the passed string to the byte data.
181 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
182 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
185 ## val = PackData("10001110") # val = 0xAE
186 ## val = PackData("1") # val = 0x80
188 ## @param data unpacked data - a string containing '1' and '0' symbols
189 ## @return data packed to the byte stream
190 ## @ingroup l1_geompy_auxiliary
193 if len(data)%8: bytes += 1
195 for b in range(bytes):
196 d = data[b*8:(b+1)*8]
201 if d[i] == "1": val += 1
203 raise "Invalid symbol %s" % d[i]
210 ## Read bitmap texture from the text file.
211 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
212 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
213 ## The function returns width and height of the pixmap in pixels and byte stream representing
214 ## texture bitmap itself.
216 ## This function can be used to read the texture to the byte stream in order to pass it to
217 ## the AddTexture() function of geompy class.
221 ## geompy.init_geom(salome.myStudy)
222 ## texture = geompy.readtexture('mytexture.dat')
223 ## texture = geompy.AddTexture(*texture)
224 ## obj.SetMarkerTexture(texture)
226 ## @param fname texture file name
227 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
228 ## @ingroup l1_geompy_auxiliary
229 def ReadTexture(fname):
232 lines = [ l.strip() for l in f.readlines()]
235 if lines: maxlen = max([len(x) for x in lines])
237 if maxlen%8: lenbytes += 1
241 lenline = (len(line)/8+1)*8
244 lenline = (len(line)/8)*8
246 for i in range(lenline/8):
249 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
252 bytedata += PackData(byte)
254 for i in range(lenline/8, lenbytes):
255 bytedata += PackData("0")
257 return lenbytes*8, len(lines), bytedata
262 ## Kinds of shape enumeration
263 # @ingroup l1_geompy_auxiliary
264 kind = GEOM.GEOM_IKindOfShape
266 ## Information about closed/unclosed state of shell or wire
267 # @ingroup l1_geompy_auxiliary
273 class geompyDC(GEOM._objref_GEOM_Gen):
276 GEOM._objref_GEOM_Gen.__init__(self)
277 self.myBuilder = None
296 ## @addtogroup l1_geompy_auxiliary
298 def init_geom(self,theStudy):
299 self.myStudy = theStudy
300 self.myStudyId = self.myStudy._get_StudyId()
301 self.myBuilder = self.myStudy.NewBuilder()
302 self.father = self.myStudy.FindComponent("GEOM")
303 if self.father is None:
304 self.father = self.myBuilder.NewComponent("GEOM")
305 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
306 FName = A1._narrow(SALOMEDS.AttributeName)
307 FName.SetValue("Geometry")
308 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
309 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
310 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
311 self.myBuilder.DefineComponentInstance(self.father,self)
313 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
314 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
315 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
316 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
317 self.HealOp = self.GetIHealingOperations (self.myStudyId)
318 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
319 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
320 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
321 self.LocalOp = self.GetILocalOperations (self.myStudyId)
322 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
323 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
324 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
325 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
328 ## Get name for sub-shape aSubObj of shape aMainObj
330 # @ref swig_SubShapeAllSorted "Example"
331 def SubShapeName(self,aSubObj, aMainObj):
332 # Example: see GEOM_TestAll.py
334 #aSubId = orb.object_to_string(aSubObj)
335 #aMainId = orb.object_to_string(aMainObj)
336 #index = gg.getIndexTopology(aSubId, aMainId)
337 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
338 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
339 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
342 ## Publish in study aShape with name aName
344 # \param aShape the shape to be published
345 # \param aName the name for the shape
346 # \param doRestoreSubShapes if True, finds and publishes also
347 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
348 # and published sub-shapes of arguments
349 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
350 # these arguments description
351 # \return study entry of the published shape in form of string
353 # @ref swig_MakeQuad4Vertices "Example"
354 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
355 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
356 # Example: see GEOM_TestAll.py
358 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
359 if doRestoreSubShapes:
360 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
361 theFindMethod, theInheritFirstArg, True )
363 print "addToStudy() failed"
365 return aShape.GetStudyEntry()
367 ## Publish in study aShape with name aName as sub-object of previously published aFather
369 # @ref swig_SubShapeAllSorted "Example"
370 def addToStudyInFather(self, aFather, aShape, aName):
371 # Example: see GEOM_TestAll.py
373 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
375 print "addToStudyInFather() failed"
377 return aShape.GetStudyEntry()
379 # end of l1_geompy_auxiliary
382 ## @addtogroup l3_restore_ss
385 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
386 # To be used from python scripts out of geompy.addToStudy (non-default usage)
387 # \param theObject published GEOM object, arguments of which will be published
388 # \param theArgs list of GEOM_Object, operation arguments to be published.
389 # If this list is empty, all operation arguments will be published
390 # \param theFindMethod method to search subshapes, corresponding to arguments and
391 # their subshapes. Value from enumeration GEOM::find_shape_method.
392 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
393 # Do not publish subshapes in place of arguments, but only
394 # in place of subshapes of the first argument,
395 # because the whole shape corresponds to the first argument.
396 # Mainly to be used after transformations, but it also can be
397 # usefull after partition with one object shape, and some other
398 # operations, where only the first argument has to be considered.
399 # If theObject has only one argument shape, this flag is automatically
400 # considered as True, not regarding really passed value.
401 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
402 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
403 # \return list of published sub-shapes
405 # @ref tui_restore_prs_params "Example"
406 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
407 theInheritFirstArg=False, theAddPrefix=True):
408 # Example: see GEOM_TestAll.py
409 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
410 theFindMethod, theInheritFirstArg, theAddPrefix)
412 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
413 # To be used from python scripts out of geompy.addToStudy (non-default usage)
414 # \param theObject published GEOM object, arguments of which will be published
415 # \param theArgs list of GEOM_Object, operation arguments to be published.
416 # If this list is empty, all operation arguments will be published
417 # \param theFindMethod method to search subshapes, corresponding to arguments and
418 # their subshapes. Value from enumeration GEOM::find_shape_method.
419 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
420 # Do not publish subshapes in place of arguments, but only
421 # in place of subshapes of the first argument,
422 # because the whole shape corresponds to the first argument.
423 # Mainly to be used after transformations, but it also can be
424 # usefull after partition with one object shape, and some other
425 # operations, where only the first argument has to be considered.
426 # If theObject has only one argument shape, this flag is automatically
427 # considered as True, not regarding really passed value.
428 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
429 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
430 # \return list of published sub-shapes
432 # @ref tui_restore_prs_params "Example"
433 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
434 theInheritFirstArg=False, theAddPrefix=True):
435 # Example: see GEOM_TestAll.py
436 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
437 theFindMethod, theInheritFirstArg, theAddPrefix)
439 # end of l3_restore_ss
442 ## @addtogroup l3_basic_go
445 ## Create point by three coordinates.
446 # @param theX The X coordinate of the point.
447 # @param theY The Y coordinate of the point.
448 # @param theZ The Z coordinate of the point.
449 # @return New GEOM_Object, containing the created point.
451 # @ref tui_creation_point "Example"
452 def MakeVertex(self, theX, theY, theZ):
453 # Example: see GEOM_TestAll.py
454 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
455 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
456 RaiseIfFailed("MakePointXYZ", self.BasicOp)
457 anObj.SetParameters(Parameters)
460 ## Create a point, distant from the referenced point
461 # on the given distances along the coordinate axes.
462 # @param theReference The referenced point.
463 # @param theX Displacement from the referenced point along OX axis.
464 # @param theY Displacement from the referenced point along OY axis.
465 # @param theZ Displacement from the referenced point along OZ axis.
466 # @return New GEOM_Object, containing the created point.
468 # @ref tui_creation_point "Example"
469 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
470 # Example: see GEOM_TestAll.py
471 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
472 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
473 RaiseIfFailed("MakePointWithReference", self.BasicOp)
474 anObj.SetParameters(Parameters)
477 ## Create a point, corresponding to the given parameter on the given curve.
478 # @param theRefCurve The referenced curve.
479 # @param theParameter Value of parameter on the referenced curve.
480 # @return New GEOM_Object, containing the created point.
482 # @ref tui_creation_point "Example"
483 def MakeVertexOnCurve(self,theRefCurve, theParameter):
484 # Example: see GEOM_TestAll.py
485 theParameter, Parameters = ParseParameters(theParameter)
486 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
487 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
488 anObj.SetParameters(Parameters)
491 ## Create a point by projection give coordinates on the given curve
492 # @param theRefCurve The referenced curve.
493 # @param theX X-coordinate in 3D space
494 # @param theY Y-coordinate in 3D space
495 # @param theZ Z-coordinate in 3D space
496 # @return New GEOM_Object, containing the created point.
498 # @ref tui_creation_point "Example"
499 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
500 # Example: see GEOM_TestAll.py
501 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
502 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
503 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
504 anObj.SetParameters(Parameters)
507 ## Create a point, corresponding to the given parameters on the
509 # @param theRefSurf The referenced surface.
510 # @param theUParameter Value of U-parameter on the referenced surface.
511 # @param theVParameter Value of V-parameter on the referenced surface.
512 # @return New GEOM_Object, containing the created point.
514 # @ref swig_MakeVertexOnSurface "Example"
515 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
516 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
517 # Example: see GEOM_TestAll.py
518 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
519 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
520 anObj.SetParameters(Parameters);
523 ## Create a point by projection give coordinates on the given surface
524 # @param theRefSurf The referenced surface.
525 # @param theX X-coordinate in 3D space
526 # @param theY Y-coordinate in 3D space
527 # @param theZ Z-coordinate in 3D space
528 # @return New GEOM_Object, containing the created point.
530 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
531 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
532 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
533 # Example: see GEOM_TestAll.py
534 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
535 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
536 anObj.SetParameters(Parameters);
539 ## Create a point on intersection of two lines.
540 # @param theRefLine1, theRefLine2 The referenced lines.
541 # @return New GEOM_Object, containing the created point.
543 # @ref swig_MakeVertexOnLinesIntersection "Example"
544 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
545 # Example: see GEOM_TestAll.py
546 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
547 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
550 ## Create a tangent, corresponding to the given parameter on the given curve.
551 # @param theRefCurve The referenced curve.
552 # @param theParameter Value of parameter on the referenced curve.
553 # @return New GEOM_Object, containing the created tangent.
555 # @ref swig_MakeTangentOnCurve "Example"
556 def MakeTangentOnCurve(self, theRefCurve, theParameter):
557 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
558 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
561 ## Create a tangent plane, corresponding to the given parameter on the given face.
562 # @param theFace The face for which tangent plane should be built.
563 # @param theParameterV vertical value of the center point (0.0 - 1.0).
564 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
565 # @param theTrimSize the size of plane.
566 # @return New GEOM_Object, containing the created tangent.
568 # @ref swig_MakeTangentPlaneOnFace "Example"
569 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
570 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
571 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
574 ## Create a vector with the given components.
575 # @param theDX X component of the vector.
576 # @param theDY Y component of the vector.
577 # @param theDZ Z component of the vector.
578 # @return New GEOM_Object, containing the created vector.
580 # @ref tui_creation_vector "Example"
581 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
582 # Example: see GEOM_TestAll.py
583 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
584 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
585 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
586 anObj.SetParameters(Parameters)
589 ## Create a vector between two points.
590 # @param thePnt1 Start point for the vector.
591 # @param thePnt2 End point for the vector.
592 # @return New GEOM_Object, containing the created vector.
594 # @ref tui_creation_vector "Example"
595 def MakeVector(self,thePnt1, thePnt2):
596 # Example: see GEOM_TestAll.py
597 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
598 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
601 ## Create a line, passing through the given point
602 # and parrallel to the given direction
603 # @param thePnt Point. The resulting line will pass through it.
604 # @param theDir Direction. The resulting line will be parallel to it.
605 # @return New GEOM_Object, containing the created line.
607 # @ref tui_creation_line "Example"
608 def MakeLine(self,thePnt, theDir):
609 # Example: see GEOM_TestAll.py
610 anObj = self.BasicOp.MakeLine(thePnt, theDir)
611 RaiseIfFailed("MakeLine", self.BasicOp)
614 ## Create a line, passing through the given points
615 # @param thePnt1 First of two points, defining the line.
616 # @param thePnt2 Second of two points, defining the line.
617 # @return New GEOM_Object, containing the created line.
619 # @ref tui_creation_line "Example"
620 def MakeLineTwoPnt(self,thePnt1, thePnt2):
621 # Example: see GEOM_TestAll.py
622 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
623 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
626 ## Create a line on two faces intersection.
627 # @param theFace1 First of two faces, defining the line.
628 # @param theFace2 Second of two faces, defining the line.
629 # @return New GEOM_Object, containing the created line.
631 # @ref swig_MakeLineTwoFaces "Example"
632 def MakeLineTwoFaces(self, theFace1, theFace2):
633 # Example: see GEOM_TestAll.py
634 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
635 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
638 ## Create a plane, passing through the given point
639 # and normal to the given vector.
640 # @param thePnt Point, the plane has to pass through.
641 # @param theVec Vector, defining the plane normal direction.
642 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
643 # @return New GEOM_Object, containing the created plane.
645 # @ref tui_creation_plane "Example"
646 def MakePlane(self,thePnt, theVec, theTrimSize):
647 # Example: see GEOM_TestAll.py
648 theTrimSize, Parameters = ParseParameters(theTrimSize);
649 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
650 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
651 anObj.SetParameters(Parameters)
654 ## Create a plane, passing through the three given points
655 # @param thePnt1 First of three points, defining the plane.
656 # @param thePnt2 Second of three points, defining the plane.
657 # @param thePnt3 Fird of three points, defining the plane.
658 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
659 # @return New GEOM_Object, containing the created plane.
661 # @ref tui_creation_plane "Example"
662 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
663 # Example: see GEOM_TestAll.py
664 theTrimSize, Parameters = ParseParameters(theTrimSize);
665 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
666 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
667 anObj.SetParameters(Parameters)
670 ## Create a plane, similar to the existing one, but with another size of representing face.
671 # @param theFace Referenced plane or LCS(Marker).
672 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
673 # @return New GEOM_Object, containing the created plane.
675 # @ref tui_creation_plane "Example"
676 def MakePlaneFace(self,theFace, theTrimSize):
677 # Example: see GEOM_TestAll.py
678 theTrimSize, Parameters = ParseParameters(theTrimSize);
679 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
680 RaiseIfFailed("MakePlaneFace", self.BasicOp)
681 anObj.SetParameters(Parameters)
684 ## Create a plane, passing through the 2 vectors
685 # with center in a start point of the first vector.
686 # @param theVec1 Vector, defining center point and plane direction.
687 # @param theVec2 Vector, defining the plane normal direction.
688 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
689 # @return New GEOM_Object, containing the created plane.
691 # @ref tui_creation_plane "Example"
692 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
693 # Example: see GEOM_TestAll.py
694 theTrimSize, Parameters = ParseParameters(theTrimSize);
695 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
696 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
697 anObj.SetParameters(Parameters)
700 ## Create a plane, based on a Local coordinate system.
701 # @param theLCS coordinate system, defining plane.
702 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
703 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
704 # @return New GEOM_Object, containing the created plane.
706 # @ref tui_creation_plane "Example"
707 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
708 # Example: see GEOM_TestAll.py
709 theTrimSize, Parameters = ParseParameters(theTrimSize);
710 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
711 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
712 anObj.SetParameters(Parameters)
715 ## Create a local coordinate system.
716 # @param OX,OY,OZ Three coordinates of coordinate system origin.
717 # @param XDX,XDY,XDZ Three components of OX direction
718 # @param YDX,YDY,YDZ Three components of OY direction
719 # @return New GEOM_Object, containing the created coordinate system.
721 # @ref swig_MakeMarker "Example"
722 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
723 # Example: see GEOM_TestAll.py
724 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
725 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
726 RaiseIfFailed("MakeMarker", self.BasicOp)
727 anObj.SetParameters(Parameters)
730 ## Create a local coordinate system from shape.
731 # @param theShape The initial shape to detect the coordinate system.
732 # @return New GEOM_Object, containing the created coordinate system.
734 # @ref tui_creation_lcs "Example"
735 def MakeMarkerFromShape(self, theShape):
736 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
737 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
740 ## Create a local coordinate system from point and two vectors.
741 # @param theOrigin Point of coordinate system origin.
742 # @param theXVec Vector of X direction
743 # @param theYVec Vector of Y direction
744 # @return New GEOM_Object, containing the created coordinate system.
746 # @ref tui_creation_lcs "Example"
747 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
748 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
749 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
755 ## @addtogroup l4_curves
758 ## Create an arc of circle, passing through three given points.
759 # @param thePnt1 Start point of the arc.
760 # @param thePnt2 Middle point of the arc.
761 # @param thePnt3 End point of the arc.
762 # @return New GEOM_Object, containing the created arc.
764 # @ref swig_MakeArc "Example"
765 def MakeArc(self,thePnt1, thePnt2, thePnt3):
766 # Example: see GEOM_TestAll.py
767 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
768 RaiseIfFailed("MakeArc", self.CurvesOp)
771 ## Create an arc of circle from a center and 2 points.
772 # @param thePnt1 Center of the arc
773 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
774 # @param thePnt3 End point of the arc (Gives also a direction)
775 # @param theSense Orientation of the arc
776 # @return New GEOM_Object, containing the created arc.
778 # @ref swig_MakeArc "Example"
779 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
780 # Example: see GEOM_TestAll.py
781 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
782 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
785 ## Create an arc of ellipse, of center and two points.
786 # @param theCenter Center of the arc.
787 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
788 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
789 # @return New GEOM_Object, containing the created arc.
791 # @ref swig_MakeArc "Example"
792 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
793 # Example: see GEOM_TestAll.py
794 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
795 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
798 ## Create a circle with given center, normal vector and radius.
799 # @param thePnt Circle center.
800 # @param theVec Vector, normal to the plane of the circle.
801 # @param theR Circle radius.
802 # @return New GEOM_Object, containing the created circle.
804 # @ref tui_creation_circle "Example"
805 def MakeCircle(self, thePnt, theVec, theR):
806 # Example: see GEOM_TestAll.py
807 theR, Parameters = ParseParameters(theR)
808 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
809 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
810 anObj.SetParameters(Parameters)
813 ## Create a circle with given radius.
814 # Center of the circle will be in the origin of global
815 # coordinate system and normal vector will be codirected with Z axis
816 # @param theR Circle radius.
817 # @return New GEOM_Object, containing the created circle.
818 def MakeCircleR(self, theR):
819 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
820 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
823 ## Create a circle, passing through three given points
824 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
825 # @return New GEOM_Object, containing the created circle.
827 # @ref tui_creation_circle "Example"
828 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
829 # Example: see GEOM_TestAll.py
830 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
831 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
834 ## Create a circle, with given point1 as center,
835 # passing through the point2 as radius and laying in the plane,
836 # defined by all three given points.
837 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
838 # @return New GEOM_Object, containing the created circle.
840 # @ref swig_MakeCircle "Example"
841 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
842 # Example: see GEOM_example6.py
843 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
844 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
847 ## Create an ellipse with given center, normal vector and radiuses.
848 # @param thePnt Ellipse center.
849 # @param theVec Vector, normal to the plane of the ellipse.
850 # @param theRMajor Major ellipse radius.
851 # @param theRMinor Minor ellipse radius.
852 # @param theVecMaj Vector, direction of the ellipse's main axis.
853 # @return New GEOM_Object, containing the created ellipse.
855 # @ref tui_creation_ellipse "Example"
856 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
857 # Example: see GEOM_TestAll.py
858 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
859 if theVecMaj is not None:
860 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
862 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
864 RaiseIfFailed("MakeEllipse", self.CurvesOp)
865 anObj.SetParameters(Parameters)
868 ## Create an ellipse with given radiuses.
869 # Center of the ellipse will be in the origin of global
870 # coordinate system and normal vector will be codirected with Z axis
871 # @param theRMajor Major ellipse radius.
872 # @param theRMinor Minor ellipse radius.
873 # @return New GEOM_Object, containing the created ellipse.
874 def MakeEllipseRR(self, theRMajor, theRMinor):
875 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
876 RaiseIfFailed("MakeEllipse", self.CurvesOp)
879 ## Create a polyline on the set of points.
880 # @param thePoints Sequence of points for the polyline.
881 # @return New GEOM_Object, containing the created polyline.
883 # @ref tui_creation_curve "Example"
884 def MakePolyline(self,thePoints):
885 # Example: see GEOM_TestAll.py
886 anObj = self.CurvesOp.MakePolyline(thePoints)
887 RaiseIfFailed("MakePolyline", self.CurvesOp)
890 ## Create bezier curve on the set of points.
891 # @param thePoints Sequence of points for the bezier curve.
892 # @return New GEOM_Object, containing the created bezier curve.
894 # @ref tui_creation_curve "Example"
895 def MakeBezier(self,thePoints):
896 # Example: see GEOM_TestAll.py
897 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
898 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
901 ## Create B-Spline curve on the set of points.
902 # @param thePoints Sequence of points for the B-Spline curve.
903 # @param theIsClosed If True, build a closed curve.
904 # @return New GEOM_Object, containing the created B-Spline curve.
906 # @ref tui_creation_curve "Example"
907 def MakeInterpol(self, thePoints, theIsClosed=False):
908 # Example: see GEOM_TestAll.py
909 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
910 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
916 ## @addtogroup l3_sketcher
919 ## Create a sketcher (wire or face), following the textual description,
920 # passed through <VAR>theCommand</VAR> argument. \n
921 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
922 # Format of the description string have to be the following:
924 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
927 # - x1, y1 are coordinates of the first sketcher point (zero by default),
929 # - "R angle" : Set the direction by angle
930 # - "D dx dy" : Set the direction by DX & DY
933 # - "TT x y" : Create segment by point at X & Y
934 # - "T dx dy" : Create segment by point with DX & DY
935 # - "L length" : Create segment by direction & Length
936 # - "IX x" : Create segment by direction & Intersect. X
937 # - "IY y" : Create segment by direction & Intersect. Y
940 # - "C radius length" : Create arc by direction, radius and length(in degree)
941 # - "AA x y": Create arc by point at X & Y
942 # - "A dx dy" : Create arc by point with DX & DY
943 # - "A dx dy" : Create arc by point with DX & DY
944 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
945 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
946 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
947 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
950 # - "WW" : Close Wire (to finish)
951 # - "WF" : Close Wire and build face (to finish)
954 # - Flag1 (= reverse) is 0 or 2 ...
955 # - if 0 the drawn arc is the one of lower angle (< Pi)
956 # - if 2 the drawn arc ius the one of greater angle (> Pi)
959 # - Flag2 (= control tolerance) is 0 or 1 ...
960 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
961 # - if 1 the wire is built only if the end point is on the arc
962 # with a tolerance of 10^-7 on the distance else the creation fails
964 # @param theCommand String, defining the sketcher in local
965 # coordinates of the working plane.
966 # @param theWorkingPlane Nine double values, defining origin,
967 # OZ and OX directions of the working plane.
968 # @return New GEOM_Object, containing the created wire.
970 # @ref tui_sketcher_page "Example"
971 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
972 # Example: see GEOM_TestAll.py
973 theCommand,Parameters = ParseSketcherCommand(theCommand)
974 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
975 RaiseIfFailed("MakeSketcher", self.CurvesOp)
976 anObj.SetParameters(Parameters)
979 ## Create a sketcher (wire or face), following the textual description,
980 # passed through <VAR>theCommand</VAR> argument. \n
981 # For format of the description string see the previous method.\n
982 # @param theCommand String, defining the sketcher in local
983 # coordinates of the working plane.
984 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
985 # @return New GEOM_Object, containing the created wire.
987 # @ref tui_sketcher_page "Example"
988 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
989 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
990 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
993 ## Create a sketcher wire, following the numerical description,
994 # passed through <VAR>theCoordinates</VAR> argument. \n
995 # @param theCoordinates double values, defining points to create a wire,
997 # @return New GEOM_Object, containing the created wire.
999 # @ref tui_sketcher_page "Example"
1000 def Make3DSketcher(self, theCoordinates):
1001 theCoordinates,Parameters = ParseParameters(theCoordinates)
1002 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1003 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1004 anObj.SetParameters(Parameters)
1007 # end of l3_sketcher
1010 ## @addtogroup l3_3d_primitives
1013 ## Create a box by coordinates of two opposite vertices.
1015 # @ref tui_creation_box "Example"
1016 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1017 # Example: see GEOM_TestAll.py
1018 pnt1 = self.MakeVertex(x1,y1,z1)
1019 pnt2 = self.MakeVertex(x2,y2,z2)
1020 return self.MakeBoxTwoPnt(pnt1,pnt2)
1022 ## Create a box with specified dimensions along the coordinate axes
1023 # and with edges, parallel to the coordinate axes.
1024 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1025 # @param theDX Length of Box edges, parallel to OX axis.
1026 # @param theDY Length of Box edges, parallel to OY axis.
1027 # @param theDZ Length of Box edges, parallel to OZ axis.
1028 # @return New GEOM_Object, containing the created box.
1030 # @ref tui_creation_box "Example"
1031 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1032 # Example: see GEOM_TestAll.py
1033 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1034 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1035 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1036 anObj.SetParameters(Parameters)
1039 ## Create a box with two specified opposite vertices,
1040 # and with edges, parallel to the coordinate axes
1041 # @param thePnt1 First of two opposite vertices.
1042 # @param thePnt2 Second of two opposite vertices.
1043 # @return New GEOM_Object, containing the created box.
1045 # @ref tui_creation_box "Example"
1046 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1047 # Example: see GEOM_TestAll.py
1048 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1049 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1052 ## Create a face with specified dimensions along OX-OY coordinate axes,
1053 # with edges, parallel to this coordinate axes.
1054 # @param theH height of Face.
1055 # @param theW width of Face.
1056 # @param theOrientation orientation belong axis OXY OYZ OZX
1057 # @return New GEOM_Object, containing the created face.
1059 # @ref tui_creation_face "Example"
1060 def MakeFaceHW(self,theH, theW, theOrientation):
1061 # Example: see GEOM_TestAll.py
1062 theH,theW,Parameters = ParseParameters(theH, theW)
1063 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1064 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1065 anObj.SetParameters(Parameters)
1068 ## Create a face from another plane and two sizes,
1069 # vertical size and horisontal size.
1070 # @param theObj Normale vector to the creating face or
1072 # @param theH Height (vertical size).
1073 # @param theW Width (horisontal size).
1074 # @return New GEOM_Object, containing the created face.
1076 # @ref tui_creation_face "Example"
1077 def MakeFaceObjHW(self, theObj, theH, theW):
1078 # Example: see GEOM_TestAll.py
1079 theH,theW,Parameters = ParseParameters(theH, theW)
1080 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1081 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1082 anObj.SetParameters(Parameters)
1085 ## Create a disk with given center, normal vector and radius.
1086 # @param thePnt Disk center.
1087 # @param theVec Vector, normal to the plane of the disk.
1088 # @param theR Disk radius.
1089 # @return New GEOM_Object, containing the created disk.
1091 # @ref tui_creation_disk "Example"
1092 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1093 # Example: see GEOM_TestAll.py
1094 theR,Parameters = ParseParameters(theR)
1095 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1096 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1097 anObj.SetParameters(Parameters)
1100 ## Create a disk, passing through three given points
1101 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1102 # @return New GEOM_Object, containing the created disk.
1104 # @ref tui_creation_disk "Example"
1105 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1106 # Example: see GEOM_TestAll.py
1107 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1108 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1111 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1112 # @param theR Radius of Face.
1113 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1114 # @return New GEOM_Object, containing the created disk.
1116 # @ref tui_creation_face "Example"
1117 def MakeDiskR(self,theR, theOrientation):
1118 # Example: see GEOM_TestAll.py
1119 theR,Parameters = ParseParameters(theR)
1120 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1121 RaiseIfFailed("MakeDiskR", self.PrimOp)
1122 anObj.SetParameters(Parameters)
1125 ## Create a cylinder with given base point, axis, radius and height.
1126 # @param thePnt Central point of cylinder base.
1127 # @param theAxis Cylinder axis.
1128 # @param theR Cylinder radius.
1129 # @param theH Cylinder height.
1130 # @return New GEOM_Object, containing the created cylinder.
1132 # @ref tui_creation_cylinder "Example"
1133 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1134 # Example: see GEOM_TestAll.py
1135 theR,theH,Parameters = ParseParameters(theR, theH)
1136 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1137 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1138 anObj.SetParameters(Parameters)
1141 ## Create a cylinder with given radius and height at
1142 # the origin of coordinate system. Axis of the cylinder
1143 # will be collinear to the OZ axis of the coordinate system.
1144 # @param theR Cylinder radius.
1145 # @param theH Cylinder height.
1146 # @return New GEOM_Object, containing the created cylinder.
1148 # @ref tui_creation_cylinder "Example"
1149 def MakeCylinderRH(self,theR, theH):
1150 # Example: see GEOM_TestAll.py
1151 theR,theH,Parameters = ParseParameters(theR, theH)
1152 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1153 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1154 anObj.SetParameters(Parameters)
1157 ## Create a sphere with given center and radius.
1158 # @param thePnt Sphere center.
1159 # @param theR Sphere radius.
1160 # @return New GEOM_Object, containing the created sphere.
1162 # @ref tui_creation_sphere "Example"
1163 def MakeSpherePntR(self, thePnt, theR):
1164 # Example: see GEOM_TestAll.py
1165 theR,Parameters = ParseParameters(theR)
1166 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1167 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1168 anObj.SetParameters(Parameters)
1171 ## Create a sphere with given center and radius.
1172 # @param x,y,z Coordinates of sphere center.
1173 # @param theR Sphere radius.
1174 # @return New GEOM_Object, containing the created sphere.
1176 # @ref tui_creation_sphere "Example"
1177 def MakeSphere(self, x, y, z, theR):
1178 # Example: see GEOM_TestAll.py
1179 point = self.MakeVertex(x, y, z)
1180 anObj = self.MakeSpherePntR(point, theR)
1183 ## Create a sphere with given radius at the origin of coordinate system.
1184 # @param theR Sphere radius.
1185 # @return New GEOM_Object, containing the created sphere.
1187 # @ref tui_creation_sphere "Example"
1188 def MakeSphereR(self, theR):
1189 # Example: see GEOM_TestAll.py
1190 theR,Parameters = ParseParameters(theR)
1191 anObj = self.PrimOp.MakeSphereR(theR)
1192 RaiseIfFailed("MakeSphereR", self.PrimOp)
1193 anObj.SetParameters(Parameters)
1196 ## Create a cone with given base point, axis, height and radiuses.
1197 # @param thePnt Central point of the first cone base.
1198 # @param theAxis Cone axis.
1199 # @param theR1 Radius of the first cone base.
1200 # @param theR2 Radius of the second cone base.
1201 # \note If both radiuses are non-zero, the cone will be truncated.
1202 # \note If the radiuses are equal, a cylinder will be created instead.
1203 # @param theH Cone height.
1204 # @return New GEOM_Object, containing the created cone.
1206 # @ref tui_creation_cone "Example"
1207 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1208 # Example: see GEOM_TestAll.py
1209 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1210 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1211 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1212 anObj.SetParameters(Parameters)
1215 ## Create a cone with given height and radiuses at
1216 # the origin of coordinate system. Axis of the cone will
1217 # be collinear to the OZ axis of the coordinate system.
1218 # @param theR1 Radius of the first cone base.
1219 # @param theR2 Radius of the second cone base.
1220 # \note If both radiuses are non-zero, the cone will be truncated.
1221 # \note If the radiuses are equal, a cylinder will be created instead.
1222 # @param theH Cone height.
1223 # @return New GEOM_Object, containing the created cone.
1225 # @ref tui_creation_cone "Example"
1226 def MakeConeR1R2H(self,theR1, theR2, theH):
1227 # Example: see GEOM_TestAll.py
1228 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1229 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1230 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1231 anObj.SetParameters(Parameters)
1234 ## Create a torus with given center, normal vector and radiuses.
1235 # @param thePnt Torus central point.
1236 # @param theVec Torus axis of symmetry.
1237 # @param theRMajor Torus major radius.
1238 # @param theRMinor Torus minor radius.
1239 # @return New GEOM_Object, containing the created torus.
1241 # @ref tui_creation_torus "Example"
1242 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1243 # Example: see GEOM_TestAll.py
1244 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1245 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1246 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1247 anObj.SetParameters(Parameters)
1250 ## Create a torus with given radiuses at the origin of coordinate system.
1251 # @param theRMajor Torus major radius.
1252 # @param theRMinor Torus minor radius.
1253 # @return New GEOM_Object, containing the created torus.
1255 # @ref tui_creation_torus "Example"
1256 def MakeTorusRR(self, theRMajor, theRMinor):
1257 # Example: see GEOM_TestAll.py
1258 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1259 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1260 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1261 anObj.SetParameters(Parameters)
1264 # end of l3_3d_primitives
1267 ## @addtogroup l3_complex
1270 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1271 # @param theBase Base shape to be extruded.
1272 # @param thePoint1 First end of extrusion vector.
1273 # @param thePoint2 Second end of extrusion vector.
1274 # @return New GEOM_Object, containing the created prism.
1276 # @ref tui_creation_prism "Example"
1277 def MakePrism(self, theBase, thePoint1, thePoint2):
1278 # Example: see GEOM_TestAll.py
1279 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1280 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1283 ## Create a shape by extrusion of the base shape along the vector,
1284 # i.e. all the space, transfixed by the base shape during its translation
1285 # along the vector on the given distance.
1286 # @param theBase Base shape to be extruded.
1287 # @param theVec Direction of extrusion.
1288 # @param theH Prism dimension along theVec.
1289 # @return New GEOM_Object, containing the created prism.
1291 # @ref tui_creation_prism "Example"
1292 def MakePrismVecH(self, theBase, theVec, theH):
1293 # Example: see GEOM_TestAll.py
1294 theH,Parameters = ParseParameters(theH)
1295 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1296 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1297 anObj.SetParameters(Parameters)
1300 ## Create a shape by extrusion of the base shape along the vector,
1301 # i.e. all the space, transfixed by the base shape during its translation
1302 # along the vector on the given distance in 2 Ways (forward/backward) .
1303 # @param theBase Base shape to be extruded.
1304 # @param theVec Direction of extrusion.
1305 # @param theH Prism dimension along theVec in forward direction.
1306 # @return New GEOM_Object, containing the created prism.
1308 # @ref tui_creation_prism "Example"
1309 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1310 # Example: see GEOM_TestAll.py
1311 theH,Parameters = ParseParameters(theH)
1312 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1313 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1314 anObj.SetParameters(Parameters)
1317 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1318 # @param theBase Base shape to be extruded.
1319 # @param theDX, theDY, theDZ Directions of extrusion.
1320 # @return New GEOM_Object, containing the created prism.
1322 # @ref tui_creation_prism "Example"
1323 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1324 # Example: see GEOM_TestAll.py
1325 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1326 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1327 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1328 anObj.SetParameters(Parameters)
1331 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1332 # i.e. all the space, transfixed by the base shape during its translation
1333 # along the vector on the given distance in 2 Ways (forward/backward) .
1334 # @param theBase Base shape to be extruded.
1335 # @param theDX, theDY, theDZ Directions of extrusion.
1336 # @return New GEOM_Object, containing the created prism.
1338 # @ref tui_creation_prism "Example"
1339 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1340 # Example: see GEOM_TestAll.py
1341 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1342 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1343 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1344 anObj.SetParameters(Parameters)
1347 ## Create a shape by revolution of the base shape around the axis
1348 # on the given angle, i.e. all the space, transfixed by the base
1349 # shape during its rotation around the axis on the given angle.
1350 # @param theBase Base shape to be rotated.
1351 # @param theAxis Rotation axis.
1352 # @param theAngle Rotation angle in radians.
1353 # @return New GEOM_Object, containing the created revolution.
1355 # @ref tui_creation_revolution "Example"
1356 def MakeRevolution(self, theBase, theAxis, theAngle):
1357 # Example: see GEOM_TestAll.py
1358 theAngle,Parameters = ParseParameters(theAngle)
1359 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1360 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1361 anObj.SetParameters(Parameters)
1364 ## The Same Revolution but in both ways forward&backward.
1365 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1366 theAngle,Parameters = ParseParameters(theAngle)
1367 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1368 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1369 anObj.SetParameters(Parameters)
1372 ## Create a filling from the given compound of contours.
1373 # @param theShape the compound of contours
1374 # @param theMinDeg a minimal degree of BSpline surface to create
1375 # @param theMaxDeg a maximal degree of BSpline surface to create
1376 # @param theTol2D a 2d tolerance to be reached
1377 # @param theTol3D a 3d tolerance to be reached
1378 # @param theNbIter a number of iteration of approximation algorithm
1379 # @param theMethod Kind of method to perform filling operation:
1380 # GEOM.FOM_Default - Default - standard behaviour
1381 # /GEOM.FOM_UseOri - Use edges orientation - orientation of edges is
1382 # used: if the edge is reversed, the curve from this edge
1383 # is reversed before using it in the filling algorithm.
1384 # /GEOM.FOM_AutoCorrect - Auto-correct orientation - changes the orientation
1385 # of the curves using minimization of sum of distances
1386 # between the end points of the edges.
1387 # @param isApprox if True, BSpline curves are generated in the process
1388 # of surface construction. By default it is False, that means
1389 # the surface is created using Besier curves. The usage of
1390 # Approximation makes the algorithm work slower, but allows
1391 # building the surface for rather complex cases
1392 # @return New GEOM_Object, containing the created filling surface.
1394 # @ref tui_creation_filling "Example"
1395 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1396 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1397 # Example: see GEOM_TestAll.py
1398 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1399 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1400 theTol2D, theTol3D, theNbIter,
1401 theMethod, isApprox)
1402 RaiseIfFailed("MakeFilling", self.PrimOp)
1403 anObj.SetParameters(Parameters)
1406 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1407 # @param theSeqSections - set of specified sections.
1408 # @param theModeSolid - mode defining building solid or shell
1409 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1410 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1411 # @return New GEOM_Object, containing the created shell or solid.
1413 # @ref swig_todo "Example"
1414 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1415 # Example: see GEOM_TestAll.py
1416 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1417 RaiseIfFailed("MakeThruSections", self.PrimOp)
1420 ## Create a shape by extrusion of the base shape along
1421 # the path shape. The path shape can be a wire or an edge.
1422 # @param theBase Base shape to be extruded.
1423 # @param thePath Path shape to extrude the base shape along it.
1424 # @return New GEOM_Object, containing the created pipe.
1426 # @ref tui_creation_pipe "Example"
1427 def MakePipe(self,theBase, thePath):
1428 # Example: see GEOM_TestAll.py
1429 anObj = self.PrimOp.MakePipe(theBase, thePath)
1430 RaiseIfFailed("MakePipe", self.PrimOp)
1433 ## Create a shape by extrusion of the profile shape along
1434 # the path shape. The path shape can be a wire or an edge.
1435 # the several profiles can be specified in the several locations of path.
1436 # @param theSeqBases - list of Bases shape to be extruded.
1437 # @param theLocations - list of locations on the path corresponding
1438 # specified list of the Bases shapes. Number of locations
1439 # should be equal to number of bases or list of locations can be empty.
1440 # @param thePath - Path shape to extrude the base shape along it.
1441 # @param theWithContact - the mode defining that the section is translated to be in
1442 # contact with the spine.
1443 # @param theWithCorrection - defining that the section is rotated to be
1444 # orthogonal to the spine tangent in the correspondent point
1445 # @return New GEOM_Object, containing the created pipe.
1447 # @ref tui_creation_pipe_with_diff_sec "Example"
1448 def MakePipeWithDifferentSections(self, theSeqBases,
1449 theLocations, thePath,
1450 theWithContact, theWithCorrection):
1451 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1452 theLocations, thePath,
1453 theWithContact, theWithCorrection)
1454 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1457 ## Create a shape by extrusion of the profile shape along
1458 # the path shape. The path shape can be a wire or a edge.
1459 # the several profiles can be specified in the several locations of path.
1460 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1461 # shell or face. If number of faces in neighbour sections
1462 # aren't coincided result solid between such sections will
1463 # be created using external boundaries of this shells.
1464 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1465 # This list is used for searching correspondences between
1466 # faces in the sections. Size of this list must be equal
1467 # to size of list of base shapes.
1468 # @param theLocations - list of locations on the path corresponding
1469 # specified list of the Bases shapes. Number of locations
1470 # should be equal to number of bases. First and last
1471 # locations must be coincided with first and last vertexes
1472 # of path correspondingly.
1473 # @param thePath - Path shape to extrude the base shape along it.
1474 # @param theWithContact - the mode defining that the section is translated to be in
1475 # contact with the spine.
1476 # @param theWithCorrection - defining that the section is rotated to be
1477 # orthogonal to the spine tangent in the correspondent point
1478 # @return New GEOM_Object, containing the created solids.
1480 # @ref tui_creation_pipe_with_shell_sec "Example"
1481 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1482 theLocations, thePath,
1483 theWithContact, theWithCorrection):
1484 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1485 theLocations, thePath,
1486 theWithContact, theWithCorrection)
1487 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1490 ## Create a shape by extrusion of the profile shape along
1491 # the path shape. This function is used only for debug pipe
1492 # functionality - it is a version of previous function
1493 # (MakePipeWithShellSections(...)) which give a possibility to
1494 # recieve information about creating pipe between each pair of
1495 # sections step by step.
1496 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1497 theLocations, thePath,
1498 theWithContact, theWithCorrection):
1500 nbsect = len(theSeqBases)
1501 nbsubsect = len(theSeqSubBases)
1502 #print "nbsect = ",nbsect
1503 for i in range(1,nbsect):
1505 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1506 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1508 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1509 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1510 tmpLocations, thePath,
1511 theWithContact, theWithCorrection)
1512 if self.PrimOp.IsDone() == 0:
1513 print "Problems with pipe creation between ",i," and ",i+1," sections"
1514 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1517 print "Pipe between ",i," and ",i+1," sections is OK"
1522 resc = self.MakeCompound(res)
1523 #resc = self.MakeSewing(res, 0.001)
1524 #print "resc: ",resc
1527 ## Create solids between given sections
1528 # @param theSeqBases - list of sections (shell or face).
1529 # @param theLocations - list of corresponding vertexes
1530 # @return New GEOM_Object, containing the created solids.
1532 # @ref tui_creation_pipe_without_path "Example"
1533 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1534 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1535 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1538 ## Create a shape by extrusion of the base shape along
1539 # the path shape with constant bi-normal direction along the given vector.
1540 # The path shape can be a wire or an edge.
1541 # @param theBase Base shape to be extruded.
1542 # @param thePath Path shape to extrude the base shape along it.
1543 # @param theVec Vector defines a constant binormal direction to keep the
1544 # same angle beetween the direction and the sections
1545 # along the sweep surface.
1546 # @return New GEOM_Object, containing the created pipe.
1548 # @ref tui_creation_pipe "Example"
1549 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1550 # Example: see GEOM_TestAll.py
1551 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1552 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1558 ## @addtogroup l3_advanced
1561 ## Create a linear edge with specified ends.
1562 # @param thePnt1 Point for the first end of edge.
1563 # @param thePnt2 Point for the second end of edge.
1564 # @return New GEOM_Object, containing the created edge.
1566 # @ref tui_creation_edge "Example"
1567 def MakeEdge(self,thePnt1, thePnt2):
1568 # Example: see GEOM_TestAll.py
1569 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1570 RaiseIfFailed("MakeEdge", self.ShapesOp)
1573 ## Create an edge from specified wire.
1574 # @param theWire source Wire.
1575 # @param theLinearTolerance linear tolerance value.
1576 # @param theAngularTolerance angular tolerance value.
1577 # @return New GEOM_Object, containing the created edge.
1579 # @ref tui_creation_edge "Example"
1580 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
1581 # Example: see GEOM_TestAll.py
1582 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
1583 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
1586 ## Create a wire from the set of edges and wires.
1587 # @param theEdgesAndWires List of edges and/or wires.
1588 # @param theTolerance Maximum distance between vertices, that will be merged.
1589 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1590 # @return New GEOM_Object, containing the created wire.
1592 # @ref tui_creation_wire "Example"
1593 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1594 # Example: see GEOM_TestAll.py
1595 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1596 RaiseIfFailed("MakeWire", self.ShapesOp)
1599 ## Create a face on the given wire.
1600 # @param theWire closed Wire or Edge to build the face on.
1601 # @param isPlanarWanted If TRUE, only planar face will be built.
1602 # If impossible, NULL object will be returned.
1603 # @return New GEOM_Object, containing the created face.
1605 # @ref tui_creation_face "Example"
1606 def MakeFace(self,theWire, isPlanarWanted):
1607 # Example: see GEOM_TestAll.py
1608 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1609 RaiseIfFailed("MakeFace", self.ShapesOp)
1612 ## Create a face on the given wires set.
1613 # @param theWires List of closed wires or edges to build the face on.
1614 # @param isPlanarWanted If TRUE, only planar face will be built.
1615 # If impossible, NULL object will be returned.
1616 # @return New GEOM_Object, containing the created face.
1618 # @ref tui_creation_face "Example"
1619 def MakeFaceWires(self,theWires, isPlanarWanted):
1620 # Example: see GEOM_TestAll.py
1621 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1622 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1625 ## Shortcut to MakeFaceWires()
1627 # @ref tui_creation_face "Example 1"
1628 # \n @ref swig_MakeFaces "Example 2"
1629 def MakeFaces(self,theWires, isPlanarWanted):
1630 # Example: see GEOM_TestOthers.py
1631 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1634 ## Create a shell from the set of faces and shells.
1635 # @param theFacesAndShells List of faces and/or shells.
1636 # @return New GEOM_Object, containing the created shell.
1638 # @ref tui_creation_shell "Example"
1639 def MakeShell(self,theFacesAndShells):
1640 # Example: see GEOM_TestAll.py
1641 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1642 RaiseIfFailed("MakeShell", self.ShapesOp)
1645 ## Create a solid, bounded by the given shells.
1646 # @param theShells Sequence of bounding shells.
1647 # @return New GEOM_Object, containing the created solid.
1649 # @ref tui_creation_solid "Example"
1650 def MakeSolid(self,theShells):
1651 # Example: see GEOM_TestAll.py
1652 anObj = self.ShapesOp.MakeSolidShells(theShells)
1653 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1656 ## Create a compound of the given shapes.
1657 # @param theShapes List of shapes to put in compound.
1658 # @return New GEOM_Object, containing the created compound.
1660 # @ref tui_creation_compound "Example"
1661 def MakeCompound(self,theShapes):
1662 # Example: see GEOM_TestAll.py
1663 anObj = self.ShapesOp.MakeCompound(theShapes)
1664 RaiseIfFailed("MakeCompound", self.ShapesOp)
1667 # end of l3_advanced
1670 ## @addtogroup l2_measure
1673 ## Gives quantity of faces in the given shape.
1674 # @param theShape Shape to count faces of.
1675 # @return Quantity of faces.
1677 # @ref swig_NumberOf "Example"
1678 def NumberOfFaces(self, theShape):
1679 # Example: see GEOM_TestOthers.py
1680 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1681 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1684 ## Gives quantity of edges in the given shape.
1685 # @param theShape Shape to count edges of.
1686 # @return Quantity of edges.
1688 # @ref swig_NumberOf "Example"
1689 def NumberOfEdges(self, theShape):
1690 # Example: see GEOM_TestOthers.py
1691 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1692 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1695 ## Gives quantity of subshapes of type theShapeType in the given shape.
1696 # @param theShape Shape to count subshapes of.
1697 # @param theShapeType Type of subshapes to count.
1698 # @return Quantity of subshapes of given type.
1700 # @ref swig_NumberOf "Example"
1701 def NumberOfSubShapes(self, theShape, theShapeType):
1702 # Example: see GEOM_TestOthers.py
1703 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1704 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1707 ## Gives quantity of solids in the given shape.
1708 # @param theShape Shape to count solids in.
1709 # @return Quantity of solids.
1711 # @ref swig_NumberOf "Example"
1712 def NumberOfSolids(self, theShape):
1713 # Example: see GEOM_TestOthers.py
1714 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1715 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1721 ## @addtogroup l3_healing
1724 ## Reverses an orientation the given shape.
1725 # @param theShape Shape to be reversed.
1726 # @return The reversed copy of theShape.
1728 # @ref swig_ChangeOrientation "Example"
1729 def ChangeOrientation(self,theShape):
1730 # Example: see GEOM_TestAll.py
1731 anObj = self.ShapesOp.ChangeOrientation(theShape)
1732 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1735 ## Shortcut to ChangeOrientation()
1737 # @ref swig_OrientationChange "Example"
1738 def OrientationChange(self,theShape):
1739 # Example: see GEOM_TestOthers.py
1740 anObj = self.ChangeOrientation(theShape)
1746 ## @addtogroup l4_obtain
1749 ## Retrieve all free faces from the given shape.
1750 # Free face is a face, which is not shared between two shells of the shape.
1751 # @param theShape Shape to find free faces in.
1752 # @return List of IDs of all free faces, contained in theShape.
1754 # @ref tui_measurement_tools_page "Example"
1755 def GetFreeFacesIDs(self,theShape):
1756 # Example: see GEOM_TestOthers.py
1757 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1758 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1761 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1762 # @param theShape1 Shape to find sub-shapes in.
1763 # @param theShape2 Shape to find shared sub-shapes with.
1764 # @param theShapeType Type of sub-shapes to be retrieved.
1765 # @return List of sub-shapes of theShape1, shared with theShape2.
1767 # @ref swig_GetSharedShapes "Example"
1768 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1769 # Example: see GEOM_TestOthers.py
1770 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1771 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1774 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1775 # @param theShapes Shapes to find common sub-shapes of.
1776 # @param theShapeType Type of sub-shapes to be retrieved.
1777 # @return List of objects, that are sub-shapes of all given shapes.
1779 # @ref swig_GetSharedShapes "Example"
1780 def GetSharedShapesMulti(self, theShapes, theShapeType):
1781 # Example: see GEOM_TestOthers.py
1782 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1783 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1786 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1787 # situated relatively the specified plane by the certain way,
1788 # defined through <VAR>theState</VAR> parameter.
1789 # @param theShape Shape to find sub-shapes of.
1790 # @param theShapeType Type of sub-shapes to be retrieved.
1791 # @param theAx1 Vector (or line, or linear edge), specifying normal
1792 # direction and location of the plane to find shapes on.
1793 # @param theState The state of the subshapes to find. It can be one of
1794 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1795 # @return List of all found sub-shapes.
1797 # @ref swig_GetShapesOnPlane "Example"
1798 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1799 # Example: see GEOM_TestOthers.py
1800 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1801 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1804 ## Works like the above method, but returns list of sub-shapes indices
1806 # @ref swig_GetShapesOnPlaneIDs "Example"
1807 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1808 # Example: see GEOM_TestOthers.py
1809 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1810 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1813 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1814 # situated relatively the specified plane by the certain way,
1815 # defined through <VAR>theState</VAR> parameter.
1816 # @param theShape Shape to find sub-shapes of.
1817 # @param theShapeType Type of sub-shapes to be retrieved.
1818 # @param theAx1 Vector (or line, or linear edge), specifying normal
1819 # direction of the plane to find shapes on.
1820 # @param thePnt Point specifying location of the plane to find shapes on.
1821 # @param theState The state of the subshapes to find. It can be one of
1822 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1823 # @return List of all found sub-shapes.
1825 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1826 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1827 # Example: see GEOM_TestOthers.py
1828 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1829 theAx1, thePnt, theState)
1830 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1833 ## Works like the above method, but returns list of sub-shapes indices
1835 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1836 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1837 # Example: see GEOM_TestOthers.py
1838 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1839 theAx1, thePnt, theState)
1840 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1843 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1844 # the specified cylinder by the certain way, defined through \a theState parameter.
1845 # @param theShape Shape to find sub-shapes of.
1846 # @param theShapeType Type of sub-shapes to be retrieved.
1847 # @param theAxis Vector (or line, or linear edge), specifying
1848 # axis of the cylinder to find shapes on.
1849 # @param theRadius Radius of the cylinder to find shapes on.
1850 # @param theState The state of the subshapes to find. It can be one of
1851 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1852 # @return List of all found sub-shapes.
1854 # @ref swig_GetShapesOnCylinder "Example"
1855 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1856 # Example: see GEOM_TestOthers.py
1857 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1858 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1861 ## Works like the above method, but returns list of sub-shapes indices
1863 # @ref swig_GetShapesOnCylinderIDs "Example"
1864 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1865 # Example: see GEOM_TestOthers.py
1866 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1867 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1870 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1871 # the specified cylinder by the certain way, defined through \a theState parameter.
1872 # @param theShape Shape to find sub-shapes of.
1873 # @param theShapeType Type of sub-shapes to be retrieved.
1874 # @param theAxis Vector (or line, or linear edge), specifying
1875 # axis of the cylinder to find shapes on.
1876 # @param thePnt Point specifying location of the bottom of the cylinder.
1877 # @param theRadius Radius of the cylinder to find shapes on.
1878 # @param theState The state of the subshapes to find. It can be one of
1879 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1880 # @return List of all found sub-shapes.
1882 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1883 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1884 # Example: see GEOM_TestOthers.py
1885 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1886 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1889 ## Works like the above method, but returns list of sub-shapes indices
1891 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1892 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1893 # Example: see GEOM_TestOthers.py
1894 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1895 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1898 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1899 # the specified sphere by the certain way, defined through \a theState parameter.
1900 # @param theShape Shape to find sub-shapes of.
1901 # @param theShapeType Type of sub-shapes to be retrieved.
1902 # @param theCenter Point, specifying center of the sphere to find shapes on.
1903 # @param theRadius Radius of the sphere to find shapes on.
1904 # @param theState The state of the subshapes to find. It can be one of
1905 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1906 # @return List of all found sub-shapes.
1908 # @ref swig_GetShapesOnSphere "Example"
1909 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1910 # Example: see GEOM_TestOthers.py
1911 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1912 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1915 ## Works like the above method, but returns list of sub-shapes indices
1917 # @ref swig_GetShapesOnSphereIDs "Example"
1918 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1919 # Example: see GEOM_TestOthers.py
1920 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1921 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1924 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1925 # the specified quadrangle by the certain way, defined through \a theState parameter.
1926 # @param theShape Shape to find sub-shapes of.
1927 # @param theShapeType Type of sub-shapes to be retrieved.
1928 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1929 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1930 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1931 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1932 # @param theState The state of the subshapes to find. It can be one of
1933 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1934 # @return List of all found sub-shapes.
1936 # @ref swig_GetShapesOnQuadrangle "Example"
1937 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1938 theTopLeftPoint, theTopRigthPoint,
1939 theBottomLeftPoint, theBottomRigthPoint, theState):
1940 # Example: see GEOM_TestOthers.py
1941 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1942 theTopLeftPoint, theTopRigthPoint,
1943 theBottomLeftPoint, theBottomRigthPoint, theState)
1944 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1947 ## Works like the above method, but returns list of sub-shapes indices
1949 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1950 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1951 theTopLeftPoint, theTopRigthPoint,
1952 theBottomLeftPoint, theBottomRigthPoint, theState):
1953 # Example: see GEOM_TestOthers.py
1954 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1955 theTopLeftPoint, theTopRigthPoint,
1956 theBottomLeftPoint, theBottomRigthPoint, theState)
1957 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1960 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1961 # the specified \a theBox by the certain way, defined through \a theState parameter.
1962 # @param theBox Shape for relative comparing.
1963 # @param theShape Shape to find sub-shapes of.
1964 # @param theShapeType Type of sub-shapes to be retrieved.
1965 # @param theState The state of the subshapes to find. It can be one of
1966 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1967 # @return List of all found sub-shapes.
1969 # @ref swig_GetShapesOnBox "Example"
1970 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1971 # Example: see GEOM_TestOthers.py
1972 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1973 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1976 ## Works like the above method, but returns list of sub-shapes indices
1978 # @ref swig_GetShapesOnBoxIDs "Example"
1979 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1980 # Example: see GEOM_TestOthers.py
1981 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1982 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1985 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1986 # situated relatively the specified \a theCheckShape by the
1987 # certain way, defined through \a theState parameter.
1988 # @param theCheckShape Shape for relative comparing. It must be a solid.
1989 # @param theShape Shape to find sub-shapes of.
1990 # @param theShapeType Type of sub-shapes to be retrieved.
1991 # @param theState The state of the subshapes to find. It can be one of
1992 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1993 # @return List of all found sub-shapes.
1995 # @ref swig_GetShapesOnShape "Example"
1996 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1997 # Example: see GEOM_TestOthers.py
1998 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1999 theShapeType, theState)
2000 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
2003 ## Works like the above method, but returns result as compound
2005 # @ref swig_GetShapesOnShapeAsCompound "Example"
2006 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
2007 # Example: see GEOM_TestOthers.py
2008 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
2009 theShapeType, theState)
2010 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
2013 ## Works like the above method, but returns list of sub-shapes indices
2015 # @ref swig_GetShapesOnShapeIDs "Example"
2016 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
2017 # Example: see GEOM_TestOthers.py
2018 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
2019 theShapeType, theState)
2020 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
2023 ## Get sub-shape(s) of theShapeWhere, which are
2024 # coincident with \a theShapeWhat or could be a part of it.
2025 # @param theShapeWhere Shape to find sub-shapes of.
2026 # @param theShapeWhat Shape, specifying what to find.
2027 # @return Group of all found sub-shapes or a single found sub-shape.
2029 # @note This function has a restriction on argument shapes.
2030 # If \a theShapeWhere has curved parts with significantly
2031 # outstanding centres (i.e. the mass centre of a part is closer to
2032 # \a theShapeWhat than to the part), such parts will not be found.
2033 # @image html get_in_place_lost_part.png
2035 # @ref swig_GetInPlace "Example"
2036 def GetInPlace(self, theShapeWhere, theShapeWhat):
2037 # Example: see GEOM_TestOthers.py
2038 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
2039 RaiseIfFailed("GetInPlace", self.ShapesOp)
2042 ## Get sub-shape(s) of \a theShapeWhere, which are
2043 # coincident with \a theShapeWhat or could be a part of it.
2045 # Implementation of this method is based on a saved history of an operation,
2046 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2047 # arguments (an argument shape or a sub-shape of an argument shape).
2048 # The operation could be the Partition or one of boolean operations,
2049 # performed on simple shapes (not on compounds).
2051 # @param theShapeWhere Shape to find sub-shapes of.
2052 # @param theShapeWhat Shape, specifying what to find (must be in the
2053 # building history of the ShapeWhere).
2054 # @return Group of all found sub-shapes or a single found sub-shape.
2056 # @ref swig_GetInPlace "Example"
2057 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2058 # Example: see GEOM_TestOthers.py
2059 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2060 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2063 ## Get sub-shape of theShapeWhere, which is
2064 # equal to \a theShapeWhat.
2065 # @param theShapeWhere Shape to find sub-shape of.
2066 # @param theShapeWhat Shape, specifying what to find.
2067 # @return New GEOM_Object for found sub-shape.
2069 # @ref swig_GetSame "Example"
2070 def GetSame(self,theShapeWhere, theShapeWhat):
2071 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2072 RaiseIfFailed("GetSame", self.ShapesOp)
2078 ## @addtogroup l4_access
2081 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2082 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2084 # @ref swig_all_decompose "Example"
2085 def GetSubShape(self, aShape, ListOfID):
2086 # Example: see GEOM_TestAll.py
2087 anObj = self.AddSubShape(aShape,ListOfID)
2090 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2092 # @ref swig_all_decompose "Example"
2093 def GetSubShapeID(self, aShape, aSubShape):
2094 # Example: see GEOM_TestAll.py
2095 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2096 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2102 ## @addtogroup l4_decompose
2105 ## Get all sub-shapes and groups of \a theShape,
2106 # that were created already by any other methods.
2107 # @param theShape Any shape.
2108 # @param theGroupsOnly If this parameter is TRUE, only groups will be
2109 # returned, else all found sub-shapes and groups.
2110 # @return List of existing sub-objects of \a theShape.
2112 # @ref swig_all_decompose "Example"
2113 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
2114 # Example: see GEOM_TestAll.py
2115 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
2116 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2119 ## Get all groups of \a theShape,
2120 # that were created already by any other methods.
2121 # @param theShape Any shape.
2122 # @return List of existing groups of \a theShape.
2124 # @ref swig_all_decompose "Example"
2125 def GetGroups(self, theShape):
2126 # Example: see GEOM_TestAll.py
2127 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
2128 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2131 ## Explode a shape on subshapes of a given type.
2132 # @param aShape Shape to be exploded.
2133 # @param aType Type of sub-shapes to be retrieved.
2134 # @return List of sub-shapes of type theShapeType, contained in theShape.
2136 # @ref swig_all_decompose "Example"
2137 def SubShapeAll(self, aShape, aType):
2138 # Example: see GEOM_TestAll.py
2139 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2140 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2143 ## Explode a shape on subshapes of a given type.
2144 # @param aShape Shape to be exploded.
2145 # @param aType Type of sub-shapes to be retrieved.
2146 # @return List of IDs of sub-shapes.
2148 # @ref swig_all_decompose "Example"
2149 def SubShapeAllIDs(self, aShape, aType):
2150 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2151 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2154 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2155 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2156 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2158 # @ref swig_all_decompose "Example"
2159 def SubShape(self, aShape, aType, ListOfInd):
2160 # Example: see GEOM_TestAll.py
2162 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2163 for ind in ListOfInd:
2164 ListOfIDs.append(AllShapeIDsList[ind - 1])
2165 anObj = self.GetSubShape(aShape, ListOfIDs)
2168 ## Explode a shape on subshapes of a given type.
2169 # Sub-shapes will be sorted by coordinates of their gravity centers.
2170 # @param aShape Shape to be exploded.
2171 # @param aType Type of sub-shapes to be retrieved.
2172 # @return List of sub-shapes of type theShapeType, contained in theShape.
2174 # @ref swig_SubShapeAllSorted "Example"
2175 def SubShapeAllSortedCentres(self, aShape, aType):
2176 # Example: see GEOM_TestAll.py
2177 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2178 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2181 ## Explode a shape on subshapes of a given type.
2182 # Sub-shapes will be sorted by coordinates of their gravity centers.
2183 # @param aShape Shape to be exploded.
2184 # @param aType Type of sub-shapes to be retrieved.
2185 # @return List of IDs of sub-shapes.
2187 # @ref swig_all_decompose "Example"
2188 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2189 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2190 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2193 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2194 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2195 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2197 # @ref swig_all_decompose "Example"
2198 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2199 # Example: see GEOM_TestAll.py
2201 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2202 for ind in ListOfInd:
2203 ListOfIDs.append(AllShapeIDsList[ind - 1])
2204 anObj = self.GetSubShape(aShape, ListOfIDs)
2207 # end of l4_decompose
2210 ## @addtogroup l4_decompose_d
2213 ## Deprecated method
2214 # It works like SubShapeAllSortedCentres, but wrongly
2215 # defines centres of faces, shells and solids.
2216 def SubShapeAllSorted(self, aShape, aType):
2217 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2218 RaiseIfFailed("MakeExplode", self.ShapesOp)
2221 ## Deprecated method
2222 # It works like SubShapeAllSortedCentresIDs, but wrongly
2223 # defines centres of faces, shells and solids.
2224 def SubShapeAllSortedIDs(self, aShape, aType):
2225 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2226 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2229 ## Deprecated method
2230 # It works like SubShapeSortedCentres, but has a bug
2231 # (wrongly defines centres of faces, shells and solids).
2232 def SubShapeSorted(self, aShape, aType, ListOfInd):
2234 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2235 for ind in ListOfInd:
2236 ListOfIDs.append(AllShapeIDsList[ind - 1])
2237 anObj = self.GetSubShape(aShape, ListOfIDs)
2240 # end of l4_decompose_d
2243 ## @addtogroup l3_healing
2246 ## Apply a sequence of Shape Healing operators to the given object.
2247 # @param theShape Shape to be processed.
2248 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2249 # @param theParameters List of names of parameters
2250 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2251 # @param theValues List of values of parameters, in the same order
2252 # as parameters are listed in <VAR>theParameters</VAR> list.
2253 # @return New GEOM_Object, containing processed shape.
2255 # @ref tui_shape_processing "Example"
2256 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2257 # Example: see GEOM_TestHealing.py
2258 theValues,Parameters = ParseList(theValues)
2259 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2260 # To avoid script failure in case of good argument shape
2261 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2263 RaiseIfFailed("ProcessShape", self.HealOp)
2264 for string in (theOperators + theParameters):
2265 Parameters = ":" + Parameters
2267 anObj.SetParameters(Parameters)
2270 ## Remove faces from the given object (shape).
2271 # @param theObject Shape to be processed.
2272 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2273 # removes ALL faces of the given object.
2274 # @return New GEOM_Object, containing processed shape.
2276 # @ref tui_suppress_faces "Example"
2277 def SuppressFaces(self,theObject, theFaces):
2278 # Example: see GEOM_TestHealing.py
2279 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2280 RaiseIfFailed("SuppressFaces", self.HealOp)
2283 ## Sewing of some shapes into single shape.
2285 # @ref tui_sewing "Example"
2286 def MakeSewing(self, ListShape, theTolerance):
2287 # Example: see GEOM_TestHealing.py
2288 comp = self.MakeCompound(ListShape)
2289 anObj = self.Sew(comp, theTolerance)
2292 ## Sewing of the given object.
2293 # @param theObject Shape to be processed.
2294 # @param theTolerance Required tolerance value.
2295 # @return New GEOM_Object, containing processed shape.
2296 def Sew(self, theObject, theTolerance):
2297 # Example: see MakeSewing() above
2298 theTolerance,Parameters = ParseParameters(theTolerance)
2299 anObj = self.HealOp.Sew(theObject, theTolerance)
2300 RaiseIfFailed("Sew", self.HealOp)
2301 anObj.SetParameters(Parameters)
2304 ## Remove internal wires and edges from the given object (face).
2305 # @param theObject Shape to be processed.
2306 # @param theWires Indices of wires to be removed, if EMPTY then the method
2307 # removes ALL internal wires of the given object.
2308 # @return New GEOM_Object, containing processed shape.
2310 # @ref tui_suppress_internal_wires "Example"
2311 def SuppressInternalWires(self,theObject, theWires):
2312 # Example: see GEOM_TestHealing.py
2313 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2314 RaiseIfFailed("RemoveIntWires", self.HealOp)
2317 ## Remove internal closed contours (holes) from the given object.
2318 # @param theObject Shape to be processed.
2319 # @param theWires Indices of wires to be removed, if EMPTY then the method
2320 # removes ALL internal holes of the given object
2321 # @return New GEOM_Object, containing processed shape.
2323 # @ref tui_suppress_holes "Example"
2324 def SuppressHoles(self,theObject, theWires):
2325 # Example: see GEOM_TestHealing.py
2326 anObj = self.HealOp.FillHoles(theObject, theWires)
2327 RaiseIfFailed("FillHoles", self.HealOp)
2330 ## Close an open wire.
2331 # @param theObject Shape to be processed.
2332 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2333 # if -1, then <VAR>theObject</VAR> itself is a wire.
2334 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2335 # If FALS : closure by creation of an edge between ends.
2336 # @return New GEOM_Object, containing processed shape.
2338 # @ref tui_close_contour "Example"
2339 def CloseContour(self,theObject, theWires, isCommonVertex):
2340 # Example: see GEOM_TestHealing.py
2341 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2342 RaiseIfFailed("CloseContour", self.HealOp)
2345 ## Addition of a point to a given edge object.
2346 # @param theObject Shape to be processed.
2347 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2348 # if -1, then theObject itself is the edge.
2349 # @param theValue Value of parameter on edge or length parameter,
2350 # depending on \a isByParameter.
2351 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2352 # if FALSE : \a theValue is treated as a length parameter [0..1]
2353 # @return New GEOM_Object, containing processed shape.
2355 # @ref tui_add_point_on_edge "Example"
2356 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2357 # Example: see GEOM_TestHealing.py
2358 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2359 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2360 RaiseIfFailed("DivideEdge", self.HealOp)
2361 anObj.SetParameters(Parameters)
2364 ## Change orientation of the given object. Updates given shape.
2365 # @param theObject Shape to be processed.
2367 # @ref swig_todo "Example"
2368 def ChangeOrientationShell(self,theObject):
2369 theObject = self.HealOp.ChangeOrientation(theObject)
2370 RaiseIfFailed("ChangeOrientation", self.HealOp)
2373 ## Change orientation of the given object.
2374 # @param theObject Shape to be processed.
2375 # @return New GEOM_Object, containing processed shape.
2377 # @ref swig_todo "Example"
2378 def ChangeOrientationShellCopy(self, theObject):
2379 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2380 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2383 ## Try to limit tolerance of the given object by value \a theTolerance.
2384 # @param theObject Shape to be processed.
2385 # @param theTolerance Required tolerance value.
2386 # @return New GEOM_Object, containing processed shape.
2388 # @ref tui_limit_tolerance "Example"
2389 def LimitTolerance(self, theObject, theTolerance = 1e-07):
2390 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
2391 RaiseIfFailed("LimitTolerance", self.HealOp)
2394 ## Get a list of wires (wrapped in GEOM_Object-s),
2395 # that constitute a free boundary of the given shape.
2396 # @param theObject Shape to get free boundary of.
2397 # @return [status, theClosedWires, theOpenWires]
2398 # status: FALSE, if an error(s) occured during the method execution.
2399 # theClosedWires: Closed wires on the free boundary of the given shape.
2400 # theOpenWires: Open wires on the free boundary of the given shape.
2402 # @ref tui_measurement_tools_page "Example"
2403 def GetFreeBoundary(self, theObject):
2404 # Example: see GEOM_TestHealing.py
2405 anObj = self.HealOp.GetFreeBoundary(theObject)
2406 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2409 ## Replace coincident faces in theShape by one face.
2410 # @param theShape Initial shape.
2411 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2412 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2413 # otherwise all initial shapes.
2414 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2416 # @ref tui_glue_faces "Example"
2417 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2418 # Example: see GEOM_Spanner.py
2419 theTolerance,Parameters = ParseParameters(theTolerance)
2420 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2422 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2423 anObj.SetParameters(Parameters)
2426 ## Find coincident faces in theShape for possible gluing.
2427 # @param theShape Initial shape.
2428 # @param theTolerance Maximum distance between faces,
2429 # which can be considered as coincident.
2432 # @ref swig_todo "Example"
2433 def GetGlueFaces(self, theShape, theTolerance):
2434 # Example: see GEOM_Spanner.py
2435 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2436 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2439 ## Replace coincident faces in theShape by one face
2440 # in compliance with given list of faces
2441 # @param theShape Initial shape.
2442 # @param theTolerance Maximum distance between faces,
2443 # which can be considered as coincident.
2444 # @param theFaces List of faces for gluing.
2445 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2446 # otherwise all initial shapes.
2447 # @return New GEOM_Object, containing a copy of theShape
2448 # without some faces.
2450 # @ref swig_todo "Example"
2451 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2452 # Example: see GEOM_Spanner.py
2453 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2455 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2461 ## @addtogroup l3_boolean Boolean Operations
2464 # -----------------------------------------------------------------------------
2465 # Boolean (Common, Cut, Fuse, Section)
2466 # -----------------------------------------------------------------------------
2468 ## Perform one of boolean operations on two given shapes.
2469 # @param theShape1 First argument for boolean operation.
2470 # @param theShape2 Second argument for boolean operation.
2471 # @param theOperation Indicates the operation to be done:
2472 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2473 # @return New GEOM_Object, containing the result shape.
2475 # @ref tui_fuse "Example"
2476 def MakeBoolean(self,theShape1, theShape2, theOperation):
2477 # Example: see GEOM_TestAll.py
2478 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2479 RaiseIfFailed("MakeBoolean", self.BoolOp)
2482 ## Shortcut to MakeBoolean(s1, s2, 1)
2484 # @ref tui_common "Example 1"
2485 # \n @ref swig_MakeCommon "Example 2"
2486 def MakeCommon(self, s1, s2):
2487 # Example: see GEOM_TestOthers.py
2488 return self.MakeBoolean(s1, s2, 1)
2490 ## Shortcut to MakeBoolean(s1, s2, 2)
2492 # @ref tui_cut "Example 1"
2493 # \n @ref swig_MakeCommon "Example 2"
2494 def MakeCut(self, s1, s2):
2495 # Example: see GEOM_TestOthers.py
2496 return self.MakeBoolean(s1, s2, 2)
2498 ## Shortcut to MakeBoolean(s1, s2, 3)
2500 # @ref tui_fuse "Example 1"
2501 # \n @ref swig_MakeCommon "Example 2"
2502 def MakeFuse(self, s1, s2):
2503 # Example: see GEOM_TestOthers.py
2504 return self.MakeBoolean(s1, s2, 3)
2506 ## Shortcut to MakeBoolean(s1, s2, 4)
2508 # @ref tui_section "Example 1"
2509 # \n @ref swig_MakeCommon "Example 2"
2510 def MakeSection(self, s1, s2):
2511 # Example: see GEOM_TestOthers.py
2512 return self.MakeBoolean(s1, s2, 4)
2517 ## @addtogroup l3_basic_op
2520 ## Perform partition operation.
2521 # @param ListShapes Shapes to be intersected.
2522 # @param ListTools Shapes to intersect theShapes.
2523 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2524 # in order to avoid possible intersection between shapes from
2526 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2527 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
2528 # type will be detected automatically.
2529 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2530 # target type (equal to Limit) are kept in the result,
2531 # else standalone shapes of lower dimension
2532 # are kept also (if they exist).
2534 # After implementation new version of PartitionAlgo (October 2006)
2535 # other parameters are ignored by current functionality. They are kept
2536 # in this function only for support old versions.
2537 # Ignored parameters:
2538 # @param ListKeepInside Shapes, outside which the results will be deleted.
2539 # Each shape from theKeepInside must belong to theShapes also.
2540 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2541 # Each shape from theRemoveInside must belong to theShapes also.
2542 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2543 # @param ListMaterials Material indices for each shape. Make sence,
2544 # only if theRemoveWebs is TRUE.
2546 # @return New GEOM_Object, containing the result shapes.
2548 # @ref tui_partition "Example"
2549 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2550 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2551 KeepNonlimitShapes=0):
2552 # Example: see GEOM_TestAll.py
2553 if Limit == ShapeType["AUTO"]:
2554 # automatic detection of the most appropriate shape limit type
2556 for s in ListShapes: lim = max( lim, s.GetMinShapeType() )
2559 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2560 ListKeepInside, ListRemoveInside,
2561 Limit, RemoveWebs, ListMaterials,
2562 KeepNonlimitShapes);
2563 RaiseIfFailed("MakePartition", self.BoolOp)
2566 ## Perform partition operation.
2567 # This method may be useful if it is needed to make a partition for
2568 # compound contains nonintersected shapes. Performance will be better
2569 # since intersection between shapes from compound is not performed.
2571 # Description of all parameters as in previous method MakePartition()
2573 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2574 # have to consist of nonintersecting shapes.
2576 # @return New GEOM_Object, containing the result shapes.
2578 # @ref swig_todo "Example"
2579 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2580 ListKeepInside=[], ListRemoveInside=[],
2581 Limit=ShapeType["AUTO"], RemoveWebs=0,
2582 ListMaterials=[], KeepNonlimitShapes=0):
2583 if Limit == ShapeType["AUTO"]:
2584 # automatic detection of the most appropriate shape limit type
2586 for s in ListShapes: lim = max( lim, s.GetMinShapeType() )
2589 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2590 ListKeepInside, ListRemoveInside,
2591 Limit, RemoveWebs, ListMaterials,
2592 KeepNonlimitShapes);
2593 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2596 ## Shortcut to MakePartition()
2598 # @ref tui_partition "Example 1"
2599 # \n @ref swig_Partition "Example 2"
2600 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2601 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2602 KeepNonlimitShapes=0):
2603 # Example: see GEOM_TestOthers.py
2604 anObj = self.MakePartition(ListShapes, ListTools,
2605 ListKeepInside, ListRemoveInside,
2606 Limit, RemoveWebs, ListMaterials,
2607 KeepNonlimitShapes);
2610 ## Perform partition of the Shape with the Plane
2611 # @param theShape Shape to be intersected.
2612 # @param thePlane Tool shape, to intersect theShape.
2613 # @return New GEOM_Object, containing the result shape.
2615 # @ref tui_partition "Example"
2616 def MakeHalfPartition(self,theShape, thePlane):
2617 # Example: see GEOM_TestAll.py
2618 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2619 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2622 # end of l3_basic_op
2625 ## @addtogroup l3_transform
2628 ## Translate the given object along the vector, specified
2629 # by its end points, creating its copy before the translation.
2630 # @param theObject The object to be translated.
2631 # @param thePoint1 Start point of translation vector.
2632 # @param thePoint2 End point of translation vector.
2633 # @return New GEOM_Object, containing the translated object.
2635 # @ref tui_translation "Example 1"
2636 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2637 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2638 # Example: see GEOM_TestAll.py
2639 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2640 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2643 ## Translate the given object along the vector, specified by its components.
2644 # @param theObject The object to be translated.
2645 # @param theDX,theDY,theDZ Components of translation vector.
2646 # @return Translated GEOM_Object.
2648 # @ref tui_translation "Example"
2649 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2650 # Example: see GEOM_TestAll.py
2651 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2652 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2653 anObj.SetParameters(Parameters)
2654 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2657 ## Translate the given object along the vector, specified
2658 # by its components, creating its copy before the translation.
2659 # @param theObject The object to be translated.
2660 # @param theDX,theDY,theDZ Components of translation vector.
2661 # @return New GEOM_Object, containing the translated object.
2663 # @ref tui_translation "Example"
2664 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2665 # Example: see GEOM_TestAll.py
2666 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2667 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2668 anObj.SetParameters(Parameters)
2669 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2672 ## Translate the given object along the given vector,
2673 # creating its copy before the translation.
2674 # @param theObject The object to be translated.
2675 # @param theVector The translation vector.
2676 # @return New GEOM_Object, containing the translated object.
2678 # @ref tui_translation "Example"
2679 def MakeTranslationVector(self,theObject, theVector):
2680 # Example: see GEOM_TestAll.py
2681 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2682 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2685 ## Translate the given object along the given vector on given distance.
2686 # @param theObject The object to be translated.
2687 # @param theVector The translation vector.
2688 # @param theDistance The translation distance.
2689 # @param theCopy Flag used to translate object itself or create a copy.
2690 # @return Translated GEOM_Object.
2692 # @ref tui_translation "Example"
2693 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2694 # Example: see GEOM_TestAll.py
2695 theDistance,Parameters = ParseParameters(theDistance)
2696 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2697 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2698 anObj.SetParameters(Parameters)
2701 ## Translate the given object along the given vector on given distance,
2702 # creating its copy before the translation.
2703 # @param theObject The object to be translated.
2704 # @param theVector The translation vector.
2705 # @param theDistance The translation distance.
2706 # @return New GEOM_Object, containing the translated object.
2708 # @ref tui_translation "Example"
2709 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2710 # Example: see GEOM_TestAll.py
2711 theDistance,Parameters = ParseParameters(theDistance)
2712 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2713 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2714 anObj.SetParameters(Parameters)
2717 ## Rotate the given object around the given axis on the given angle.
2718 # @param theObject The object to be rotated.
2719 # @param theAxis Rotation axis.
2720 # @param theAngle Rotation angle in radians.
2721 # @return Rotated GEOM_Object.
2723 # @ref tui_rotation "Example"
2724 def Rotate(self,theObject, theAxis, theAngle):
2725 # Example: see GEOM_TestAll.py
2727 if isinstance(theAngle,str):
2729 theAngle, Parameters = ParseParameters(theAngle)
2731 theAngle = theAngle*math.pi/180.0
2732 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2733 RaiseIfFailed("RotateCopy", self.TrsfOp)
2734 anObj.SetParameters(Parameters)
2737 ## Rotate the given object around the given axis
2738 # on the given angle, creating its copy before the rotatation.
2739 # @param theObject The object to be rotated.
2740 # @param theAxis Rotation axis.
2741 # @param theAngle Rotation angle in radians.
2742 # @return New GEOM_Object, containing the rotated object.
2744 # @ref tui_rotation "Example"
2745 def MakeRotation(self,theObject, theAxis, theAngle):
2746 # Example: see GEOM_TestAll.py
2748 if isinstance(theAngle,str):
2750 theAngle, Parameters = ParseParameters(theAngle)
2752 theAngle = theAngle*math.pi/180.0
2753 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2754 RaiseIfFailed("RotateCopy", self.TrsfOp)
2755 anObj.SetParameters(Parameters)
2758 ## Rotate given object around vector perpendicular to plane
2759 # containing three points, creating its copy before the rotatation.
2760 # @param theObject The object to be rotated.
2761 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2762 # containing the three points.
2763 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2764 # @return New GEOM_Object, containing the rotated object.
2766 # @ref tui_rotation "Example"
2767 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2768 # Example: see GEOM_TestAll.py
2769 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2770 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2773 ## Scale the given object by the factor, creating its copy before the scaling.
2774 # @param theObject The object to be scaled.
2775 # @param thePoint Center point for scaling.
2776 # Passing None for it means scaling relatively the origin of global CS.
2777 # @param theFactor Scaling factor value.
2778 # @return New GEOM_Object, containing the scaled shape.
2780 # @ref tui_scale "Example"
2781 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2782 # Example: see GEOM_TestAll.py
2783 theFactor, Parameters = ParseParameters(theFactor)
2784 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2785 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2786 anObj.SetParameters(Parameters)
2789 ## Scale the given object by different factors along coordinate axes,
2790 # creating its copy before the scaling.
2791 # @param theObject The object to be scaled.
2792 # @param thePoint Center point for scaling.
2793 # Passing None for it means scaling relatively the origin of global CS.
2794 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2795 # @return New GEOM_Object, containing the scaled shape.
2797 # @ref swig_scale "Example"
2798 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2799 # Example: see GEOM_TestAll.py
2800 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2801 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2802 theFactorX, theFactorY, theFactorZ)
2803 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2804 anObj.SetParameters(Parameters)
2807 ## Create an object, symmetrical
2808 # to the given one relatively the given plane.
2809 # @param theObject The object to be mirrored.
2810 # @param thePlane Plane of symmetry.
2811 # @return New GEOM_Object, containing the mirrored shape.
2813 # @ref tui_mirror "Example"
2814 def MakeMirrorByPlane(self,theObject, thePlane):
2815 # Example: see GEOM_TestAll.py
2816 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2817 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2820 ## Create an object, symmetrical
2821 # to the given one relatively the given axis.
2822 # @param theObject The object to be mirrored.
2823 # @param theAxis Axis of symmetry.
2824 # @return New GEOM_Object, containing the mirrored shape.
2826 # @ref tui_mirror "Example"
2827 def MakeMirrorByAxis(self,theObject, theAxis):
2828 # Example: see GEOM_TestAll.py
2829 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2830 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2833 ## Create an object, symmetrical
2834 # to the given one relatively the given point.
2835 # @param theObject The object to be mirrored.
2836 # @param thePoint Point of symmetry.
2837 # @return New GEOM_Object, containing the mirrored shape.
2839 # @ref tui_mirror "Example"
2840 def MakeMirrorByPoint(self,theObject, thePoint):
2841 # Example: see GEOM_TestAll.py
2842 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2843 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2846 ## Modify the Location of the given object by LCS,
2847 # creating its copy before the setting.
2848 # @param theObject The object to be displaced.
2849 # @param theStartLCS Coordinate system to perform displacement from it.
2850 # If \a theStartLCS is NULL, displacement
2851 # will be performed from global CS.
2852 # If \a theObject itself is used as \a theStartLCS,
2853 # its location will be changed to \a theEndLCS.
2854 # @param theEndLCS Coordinate system to perform displacement to it.
2855 # @return New GEOM_Object, containing the displaced shape.
2857 # @ref tui_modify_location "Example"
2858 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2859 # Example: see GEOM_TestAll.py
2860 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2861 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2864 ## Modify the Location of the given object by Path,
2865 # @param theObject The object to be displaced.
2866 # @param thePath Wire or Edge along that the object will be translated.
2867 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2868 # @param theCopy is to create a copy objects if true.
2869 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2870 # @return New GEOM_Object, containing the displaced shape.
2872 # @ref tui_modify_location "Example"
2873 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2874 # Example: see GEOM_TestAll.py
2875 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2876 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2879 ## Create new object as offset of the given one.
2880 # @param theObject The base object for the offset.
2881 # @param theOffset Offset value.
2882 # @return New GEOM_Object, containing the offset object.
2884 # @ref tui_offset "Example"
2885 def MakeOffset(self,theObject, theOffset):
2886 # Example: see GEOM_TestAll.py
2887 theOffset, Parameters = ParseParameters(theOffset)
2888 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2889 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2890 anObj.SetParameters(Parameters)
2893 # -----------------------------------------------------------------------------
2895 # -----------------------------------------------------------------------------
2897 ## Translate the given object along the given vector a given number times
2898 # @param theObject The object to be translated.
2899 # @param theVector Direction of the translation.
2900 # @param theStep Distance to translate on.
2901 # @param theNbTimes Quantity of translations to be done.
2902 # @return New GEOM_Object, containing compound of all
2903 # the shapes, obtained after each translation.
2905 # @ref tui_multi_translation "Example"
2906 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2907 # Example: see GEOM_TestAll.py
2908 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2909 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2910 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2911 anObj.SetParameters(Parameters)
2914 ## Conseqently apply two specified translations to theObject specified number of times.
2915 # @param theObject The object to be translated.
2916 # @param theVector1 Direction of the first translation.
2917 # @param theStep1 Step of the first translation.
2918 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2919 # @param theVector2 Direction of the second translation.
2920 # @param theStep2 Step of the second translation.
2921 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2922 # @return New GEOM_Object, containing compound of all
2923 # the shapes, obtained after each translation.
2925 # @ref tui_multi_translation "Example"
2926 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2927 theVector2, theStep2, theNbTimes2):
2928 # Example: see GEOM_TestAll.py
2929 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2930 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2931 theVector2, theStep2, theNbTimes2)
2932 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2933 anObj.SetParameters(Parameters)
2936 ## Rotate the given object around the given axis a given number times.
2937 # Rotation angle will be 2*PI/theNbTimes.
2938 # @param theObject The object to be rotated.
2939 # @param theAxis The rotation axis.
2940 # @param theNbTimes Quantity of rotations to be done.
2941 # @return New GEOM_Object, containing compound of all the
2942 # shapes, obtained after each rotation.
2944 # @ref tui_multi_rotation "Example"
2945 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2946 # Example: see GEOM_TestAll.py
2947 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2948 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2949 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2950 anObj.SetParameters(Parameters)
2953 ## Rotate the given object around the
2954 # given axis on the given angle a given number
2955 # times and multi-translate each rotation result.
2956 # Translation direction passes through center of gravity
2957 # of rotated shape and its projection on the rotation axis.
2958 # @param theObject The object to be rotated.
2959 # @param theAxis Rotation axis.
2960 # @param theAngle Rotation angle in graduces.
2961 # @param theNbTimes1 Quantity of rotations to be done.
2962 # @param theStep Translation distance.
2963 # @param theNbTimes2 Quantity of translations to be done.
2964 # @return New GEOM_Object, containing compound of all the
2965 # shapes, obtained after each transformation.
2967 # @ref tui_multi_rotation "Example"
2968 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2969 # Example: see GEOM_TestAll.py
2970 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2971 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2972 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2973 anObj.SetParameters(Parameters)
2976 ## The same, as MultiRotate1D(), but axis is given by direction and point
2977 # @ref swig_MakeMultiRotation "Example"
2978 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2979 # Example: see GEOM_TestOthers.py
2980 aVec = self.MakeLine(aPoint,aDir)
2981 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2984 ## The same, as MultiRotate2D(), but axis is given by direction and point
2985 # @ref swig_MakeMultiRotation "Example"
2986 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2987 # Example: see GEOM_TestOthers.py
2988 aVec = self.MakeLine(aPoint,aDir)
2989 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2992 # end of l3_transform
2995 ## @addtogroup l3_local
2998 ## Perform a fillet on all edges of the given shape.
2999 # @param theShape Shape, to perform fillet on.
3000 # @param theR Fillet radius.
3001 # @return New GEOM_Object, containing the result shape.
3003 # @ref tui_fillet "Example 1"
3004 # \n @ref swig_MakeFilletAll "Example 2"
3005 def MakeFilletAll(self,theShape, theR):
3006 # Example: see GEOM_TestOthers.py
3007 theR,Parameters = ParseParameters(theR)
3008 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
3009 RaiseIfFailed("MakeFilletAll", self.LocalOp)
3010 anObj.SetParameters(Parameters)
3013 ## Perform a fillet on the specified edges/faces of the given shape
3014 # @param theShape Shape, to perform fillet on.
3015 # @param theR Fillet radius.
3016 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
3017 # @param theListShapes Global indices of edges/faces to perform fillet on.
3018 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3019 # @return New GEOM_Object, containing the result shape.
3021 # @ref tui_fillet "Example"
3022 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
3023 # Example: see GEOM_TestAll.py
3024 theR,Parameters = ParseParameters(theR)
3026 if theShapeType == ShapeType["EDGE"]:
3027 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
3028 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
3030 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
3031 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
3032 anObj.SetParameters(Parameters)
3035 ## The same that MakeFillet but with two Fillet Radius R1 and R2
3036 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
3037 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
3039 if theShapeType == ShapeType["EDGE"]:
3040 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
3041 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
3043 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
3044 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
3045 anObj.SetParameters(Parameters)
3048 ## Perform a fillet on the specified edges of the given shape
3049 # @param theShape - Wire Shape to perform fillet on.
3050 # @param theR - Fillet radius.
3051 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3052 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3053 # \note The list of vertices could be empty,
3054 # in this case fillet will done done at all vertices in wire
3055 # @return New GEOM_Object, containing the result shape.
3057 # @ref tui_fillet2d "Example"
3058 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
3059 # Example: see GEOM_TestAll.py
3060 theR,Parameters = ParseParameters(theR)
3061 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
3062 RaiseIfFailed("MakeFillet1D", self.LocalOp)
3063 anObj.SetParameters(Parameters)
3066 ## Perform a fillet on the specified edges/faces of the given shape
3067 # @param theShape - Face Shape to perform fillet on.
3068 # @param theR - Fillet radius.
3069 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3070 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3071 # @return New GEOM_Object, containing the result shape.
3073 # @ref tui_fillet2d "Example"
3074 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
3075 # Example: see GEOM_TestAll.py
3076 theR,Parameters = ParseParameters(theR)
3077 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
3078 RaiseIfFailed("MakeFillet2D", self.LocalOp)
3079 anObj.SetParameters(Parameters)
3082 ## Perform a symmetric chamfer on all edges of the given shape.
3083 # @param theShape Shape, to perform chamfer on.
3084 # @param theD Chamfer size along each face.
3085 # @return New GEOM_Object, containing the result shape.
3087 # @ref tui_chamfer "Example 1"
3088 # \n @ref swig_MakeChamferAll "Example 2"
3089 def MakeChamferAll(self,theShape, theD):
3090 # Example: see GEOM_TestOthers.py
3091 theD,Parameters = ParseParameters(theD)
3092 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
3093 RaiseIfFailed("MakeChamferAll", self.LocalOp)
3094 anObj.SetParameters(Parameters)
3097 ## Perform a chamfer on edges, common to the specified faces,
3098 # with distance D1 on the Face1
3099 # @param theShape Shape, to perform chamfer on.
3100 # @param theD1 Chamfer size along \a theFace1.
3101 # @param theD2 Chamfer size along \a theFace2.
3102 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3103 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3104 # @return New GEOM_Object, containing the result shape.
3106 # @ref tui_chamfer "Example"
3107 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3108 # Example: see GEOM_TestAll.py
3109 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3110 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3111 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3112 anObj.SetParameters(Parameters)
3115 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3116 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3117 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3119 if isinstance(theAngle,str):
3121 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3123 theAngle = theAngle*math.pi/180.0
3124 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3125 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3126 anObj.SetParameters(Parameters)
3129 ## Perform a chamfer on all edges of the specified faces,
3130 # with distance D1 on the first specified face (if several for one edge)
3131 # @param theShape Shape, to perform chamfer on.
3132 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3133 # connected to the edge, are in \a theFaces, \a theD1
3134 # will be get along face, which is nearer to \a theFaces beginning.
3135 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3136 # @param theFaces Sequence of global indices of faces of \a theShape.
3137 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3138 # @return New GEOM_Object, containing the result shape.
3140 # @ref tui_chamfer "Example"
3141 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3142 # Example: see GEOM_TestAll.py
3143 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3144 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3145 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3146 anObj.SetParameters(Parameters)
3149 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3150 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3152 # @ref swig_FilletChamfer "Example"
3153 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3155 if isinstance(theAngle,str):
3157 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3159 theAngle = theAngle*math.pi/180.0
3160 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3161 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3162 anObj.SetParameters(Parameters)
3165 ## Perform a chamfer on edges,
3166 # with distance D1 on the first specified face (if several for one edge)
3167 # @param theShape Shape, to perform chamfer on.
3168 # @param theD1,theD2 Chamfer size
3169 # @param theEdges Sequence of edges of \a theShape.
3170 # @return New GEOM_Object, containing the result shape.
3172 # @ref swig_FilletChamfer "Example"
3173 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3174 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3175 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3176 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3177 anObj.SetParameters(Parameters)
3180 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3181 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3182 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3184 if isinstance(theAngle,str):
3186 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3188 theAngle = theAngle*math.pi/180.0
3189 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3190 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3191 anObj.SetParameters(Parameters)
3194 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3196 # @ref swig_MakeChamfer "Example"
3197 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3198 # Example: see GEOM_TestOthers.py
3200 if aShapeType == ShapeType["EDGE"]:
3201 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3203 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3209 ## @addtogroup l3_basic_op
3212 ## Perform an Archimde operation on the given shape with given parameters.
3213 # The object presenting the resulting face is returned.
3214 # @param theShape Shape to be put in water.
3215 # @param theWeight Weight og the shape.
3216 # @param theWaterDensity Density of the water.
3217 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3218 # @return New GEOM_Object, containing a section of \a theShape
3219 # by a plane, corresponding to water level.
3221 # @ref tui_archimede "Example"
3222 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3223 # Example: see GEOM_TestAll.py
3224 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3225 theWeight,theWaterDensity,theMeshDeflection)
3226 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3227 RaiseIfFailed("MakeArchimede", self.LocalOp)
3228 anObj.SetParameters(Parameters)
3231 # end of l3_basic_op
3234 ## @addtogroup l2_measure
3237 ## Get point coordinates
3240 # @ref tui_measurement_tools_page "Example"
3241 def PointCoordinates(self,Point):
3242 # Example: see GEOM_TestMeasures.py
3243 aTuple = self.MeasuOp.PointCoordinates(Point)
3244 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3247 ## Get summarized length of all wires,
3248 # area of surface and volume of the given shape.
3249 # @param theShape Shape to define properties of.
3250 # @return [theLength, theSurfArea, theVolume]
3251 # theLength: Summarized length of all wires of the given shape.
3252 # theSurfArea: Area of surface of the given shape.
3253 # theVolume: Volume of the given shape.
3255 # @ref tui_measurement_tools_page "Example"
3256 def BasicProperties(self,theShape):
3257 # Example: see GEOM_TestMeasures.py
3258 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3259 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3262 ## Get parameters of bounding box of the given shape
3263 # @param theShape Shape to obtain bounding box of.
3264 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3265 # Xmin,Xmax: Limits of shape along OX axis.
3266 # Ymin,Ymax: Limits of shape along OY axis.
3267 # Zmin,Zmax: Limits of shape along OZ axis.
3269 # @ref tui_measurement_tools_page "Example"
3270 def BoundingBox(self,theShape):
3271 # Example: see GEOM_TestMeasures.py
3272 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3273 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3276 ## Get inertia matrix and moments of inertia of theShape.
3277 # @param theShape Shape to calculate inertia of.
3278 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3279 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3280 # Ix,Iy,Iz: Moments of inertia of the given shape.
3282 # @ref tui_measurement_tools_page "Example"
3283 def Inertia(self,theShape):
3284 # Example: see GEOM_TestMeasures.py
3285 aTuple = self.MeasuOp.GetInertia(theShape)
3286 RaiseIfFailed("GetInertia", self.MeasuOp)
3289 ## Get minimal distance between the given shapes.
3290 # @param theShape1,theShape2 Shapes to find minimal distance between.
3291 # @return Value of the minimal distance between the given shapes.
3293 # @ref tui_measurement_tools_page "Example"
3294 def MinDistance(self, theShape1, theShape2):
3295 # Example: see GEOM_TestMeasures.py
3296 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3297 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3300 ## Get minimal distance between the given shapes.
3301 # @param theShape1,theShape2 Shapes to find minimal distance between.
3302 # @return Value of the minimal distance between the given shapes.
3304 # @ref swig_all_measure "Example"
3305 def MinDistanceComponents(self, theShape1, theShape2):
3306 # Example: see GEOM_TestMeasures.py
3307 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3308 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3309 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3312 ## Get angle between the given shapes in degrees.
3313 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3314 # @return Value of the angle between the given shapes in degrees.
3316 # @ref tui_measurement_tools_page "Example"
3317 def GetAngle(self, theShape1, theShape2):
3318 # Example: see GEOM_TestMeasures.py
3319 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3320 RaiseIfFailed("GetAngle", self.MeasuOp)
3322 ## Get angle between the given shapes in radians.
3323 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3324 # @return Value of the angle between the given shapes in radians.
3326 # @ref tui_measurement_tools_page "Example"
3327 def GetAngleRadians(self, theShape1, theShape2):
3328 # Example: see GEOM_TestMeasures.py
3329 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3330 RaiseIfFailed("GetAngle", self.MeasuOp)
3333 ## @name Curve Curvature Measurement
3334 # Methods for receiving radius of curvature of curves
3335 # in the given point
3338 ## Measure curvature of a curve at a point, set by parameter.
3339 # @ref swig_todo "Example"
3340 def CurveCurvatureByParam(self, theCurve, theParam):
3341 # Example: see GEOM_TestMeasures.py
3342 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3343 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3347 # @ref swig_todo "Example"
3348 def CurveCurvatureByPoint(self, theCurve, thePoint):
3349 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3350 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3354 ## @name Surface Curvature Measurement
3355 # Methods for receiving max and min radius of curvature of surfaces
3356 # in the given point
3360 ## @ref swig_todo "Example"
3361 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3362 # Example: see GEOM_TestMeasures.py
3363 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3364 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3368 ## @ref swig_todo "Example"
3369 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3370 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3371 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3375 ## @ref swig_todo "Example"
3376 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3377 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3378 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3382 ## @ref swig_todo "Example"
3383 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3384 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3385 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3389 ## Get min and max tolerances of sub-shapes of theShape
3390 # @param theShape Shape, to get tolerances of.
3391 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3392 # FaceMin,FaceMax: Min and max tolerances of the faces.
3393 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3394 # VertMin,VertMax: Min and max tolerances of the vertices.
3396 # @ref tui_measurement_tools_page "Example"
3397 def Tolerance(self,theShape):
3398 # Example: see GEOM_TestMeasures.py
3399 aTuple = self.MeasuOp.GetTolerance(theShape)
3400 RaiseIfFailed("GetTolerance", self.MeasuOp)
3403 ## Obtain description of the given shape (number of sub-shapes of each type)
3404 # @param theShape Shape to be described.
3405 # @return Description of the given shape.
3407 # @ref tui_measurement_tools_page "Example"
3408 def WhatIs(self,theShape):
3409 # Example: see GEOM_TestMeasures.py
3410 aDescr = self.MeasuOp.WhatIs(theShape)
3411 RaiseIfFailed("WhatIs", self.MeasuOp)
3414 ## Get a point, situated at the centre of mass of theShape.
3415 # @param theShape Shape to define centre of mass of.
3416 # @return New GEOM_Object, containing the created point.
3418 # @ref tui_measurement_tools_page "Example"
3419 def MakeCDG(self,theShape):
3420 # Example: see GEOM_TestMeasures.py
3421 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3422 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3425 ## Get a vertex subshape by index depended with orientation.
3426 # @param theShape Shape to find subshape.
3427 # @param theIndex Index to find vertex by this index.
3428 # @return New GEOM_Object, containing the created vertex.
3430 # @ref tui_measurement_tools_page "Example"
3431 def GetVertexByIndex(self,theShape, theIndex):
3432 # Example: see GEOM_TestMeasures.py
3433 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3434 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3437 ## Get the first vertex of wire/edge depended orientation.
3438 # @param theShape Shape to find first vertex.
3439 # @return New GEOM_Object, containing the created vertex.
3441 # @ref tui_measurement_tools_page "Example"
3442 def GetFirstVertex(self,theShape):
3443 # Example: see GEOM_TestMeasures.py
3444 anObj = self.GetVertexByIndex(theShape, 0)
3445 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3448 ## Get the last vertex of wire/edge depended orientation.
3449 # @param theShape Shape to find last vertex.
3450 # @return New GEOM_Object, containing the created vertex.
3452 # @ref tui_measurement_tools_page "Example"
3453 def GetLastVertex(self,theShape):
3454 # Example: see GEOM_TestMeasures.py
3455 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3456 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3457 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3460 ## Get a normale to the given face. If the point is not given,
3461 # the normale is calculated at the center of mass.
3462 # @param theFace Face to define normale of.
3463 # @param theOptionalPoint Point to compute the normale at.
3464 # @return New GEOM_Object, containing the created vector.
3466 # @ref swig_todo "Example"
3467 def GetNormal(self, theFace, theOptionalPoint = None):
3468 # Example: see GEOM_TestMeasures.py
3469 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3470 RaiseIfFailed("GetNormal", self.MeasuOp)
3473 ## Check a topology of the given shape.
3474 # @param theShape Shape to check validity of.
3475 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3476 # if TRUE, the shape's geometry will be checked also.
3477 # @return TRUE, if the shape "seems to be valid".
3478 # If theShape is invalid, prints a description of problem.
3480 # @ref tui_measurement_tools_page "Example"
3481 def CheckShape(self,theShape, theIsCheckGeom = 0):
3482 # Example: see GEOM_TestMeasures.py
3484 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3485 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3487 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3488 RaiseIfFailed("CheckShape", self.MeasuOp)
3493 ## Get position (LCS) of theShape.
3495 # Origin of the LCS is situated at the shape's center of mass.
3496 # Axes of the LCS are obtained from shape's location or,
3497 # if the shape is a planar face, from position of its plane.
3499 # @param theShape Shape to calculate position of.
3500 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3501 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3502 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3503 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3505 # @ref swig_todo "Example"
3506 def GetPosition(self,theShape):
3507 # Example: see GEOM_TestMeasures.py
3508 aTuple = self.MeasuOp.GetPosition(theShape)
3509 RaiseIfFailed("GetPosition", self.MeasuOp)
3512 ## Get kind of theShape.
3514 # @param theShape Shape to get a kind of.
3515 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3516 # and a list of parameters, describing the shape.
3517 # @note Concrete meaning of each value, returned via \a theIntegers
3518 # or \a theDoubles list depends on the kind of the shape.
3519 # The full list of possible outputs is:
3521 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3522 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3524 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3525 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3527 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3528 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3530 # - geompy.kind.SPHERE xc yc zc R
3531 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3532 # - geompy.kind.BOX xc yc zc ax ay az
3533 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3534 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3535 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3536 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3537 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3539 # - geompy.kind.SPHERE2D xc yc zc R
3540 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3541 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3542 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3543 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3544 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3545 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3546 # - geompy.kind.PLANE xo yo zo dx dy dz
3547 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3548 # - geompy.kind.FACE nb_edges nb_vertices
3550 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3551 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3552 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3553 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3554 # - geompy.kind.LINE xo yo zo dx dy dz
3555 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3556 # - geompy.kind.EDGE nb_vertices
3558 # - geompy.kind.VERTEX x y z
3560 # @ref swig_todo "Example"
3561 def KindOfShape(self,theShape):
3562 # Example: see GEOM_TestMeasures.py
3563 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3564 RaiseIfFailed("KindOfShape", self.MeasuOp)
3566 aKind = aRoughTuple[0]
3567 anInts = aRoughTuple[1]
3568 aDbls = aRoughTuple[2]
3570 # Now there is no exception from this rule:
3571 aKindTuple = [aKind] + aDbls + anInts
3573 # If they are we will regroup parameters for such kind of shape.
3575 #if aKind == kind.SOME_KIND:
3576 # # SOME_KIND int int double int double double
3577 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3584 ## @addtogroup l2_import_export
3587 ## Import a shape from the BREP or IGES or STEP file
3588 # (depends on given format) with given name.
3589 # @param theFileName The file, containing the shape.
3590 # @param theFormatName Specify format for the file reading.
3591 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3592 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3593 # set to 'meter' and result model will be scaled.
3594 # @return New GEOM_Object, containing the imported shape.
3596 # @ref swig_Import_Export "Example"
3597 def Import(self,theFileName, theFormatName):
3598 # Example: see GEOM_TestOthers.py
3599 anObj = self.InsertOp.Import(theFileName, theFormatName)
3600 RaiseIfFailed("Import", self.InsertOp)
3603 ## Shortcut to Import() for BREP format
3605 # @ref swig_Import_Export "Example"
3606 def ImportBREP(self,theFileName):
3607 # Example: see GEOM_TestOthers.py
3608 return self.Import(theFileName, "BREP")
3610 ## Shortcut to Import() for IGES format
3612 # @ref swig_Import_Export "Example"
3613 def ImportIGES(self,theFileName):
3614 # Example: see GEOM_TestOthers.py
3615 return self.Import(theFileName, "IGES")
3617 ## Return length unit from given IGES file
3619 # @ref swig_Import_Export "Example"
3620 def GetIGESUnit(self,theFileName):
3621 # Example: see GEOM_TestOthers.py
3622 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3623 #RaiseIfFailed("Import", self.InsertOp)
3624 # recieve name using returned vertex
3626 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3628 p = self.PointCoordinates(vertices[0])
3629 if abs(p[0]-0.01) < 1.e-6:
3631 elif abs(p[0]-0.001) < 1.e-6:
3635 ## Shortcut to Import() for STEP format
3637 # @ref swig_Import_Export "Example"
3638 def ImportSTEP(self,theFileName):
3639 # Example: see GEOM_TestOthers.py
3640 return self.Import(theFileName, "STEP")
3642 ## Export the given shape into a file with given name.
3643 # @param theObject Shape to be stored in the file.
3644 # @param theFileName Name of the file to store the given shape in.
3645 # @param theFormatName Specify format for the shape storage.
3646 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3648 # @ref swig_Import_Export "Example"
3649 def Export(self,theObject, theFileName, theFormatName):
3650 # Example: see GEOM_TestOthers.py
3651 self.InsertOp.Export(theObject, theFileName, theFormatName)
3652 if self.InsertOp.IsDone() == 0:
3653 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3657 ## Shortcut to Export() for BREP format
3659 # @ref swig_Import_Export "Example"
3660 def ExportBREP(self,theObject, theFileName):
3661 # Example: see GEOM_TestOthers.py
3662 return self.Export(theObject, theFileName, "BREP")
3664 ## Shortcut to Export() for IGES format
3666 # @ref swig_Import_Export "Example"
3667 def ExportIGES(self,theObject, theFileName):
3668 # Example: see GEOM_TestOthers.py
3669 return self.Export(theObject, theFileName, "IGES")
3671 ## Shortcut to Export() for STEP format
3673 # @ref swig_Import_Export "Example"
3674 def ExportSTEP(self,theObject, theFileName):
3675 # Example: see GEOM_TestOthers.py
3676 return self.Export(theObject, theFileName, "STEP")
3678 # end of l2_import_export
3681 ## @addtogroup l3_blocks
3684 ## Create a quadrangle face from four edges. Order of Edges is not
3685 # important. It is not necessary that edges share the same vertex.
3686 # @param E1,E2,E3,E4 Edges for the face bound.
3687 # @return New GEOM_Object, containing the created face.
3689 # @ref tui_building_by_blocks_page "Example"
3690 def MakeQuad(self,E1, E2, E3, E4):
3691 # Example: see GEOM_Spanner.py
3692 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3693 RaiseIfFailed("MakeQuad", self.BlocksOp)
3696 ## Create a quadrangle face on two edges.
3697 # The missing edges will be built by creating the shortest ones.
3698 # @param E1,E2 Two opposite edges for the face.
3699 # @return New GEOM_Object, containing the created face.
3701 # @ref tui_building_by_blocks_page "Example"
3702 def MakeQuad2Edges(self,E1, E2):
3703 # Example: see GEOM_Spanner.py
3704 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3705 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3708 ## Create a quadrangle face with specified corners.
3709 # The missing edges will be built by creating the shortest ones.
3710 # @param V1,V2,V3,V4 Corner vertices for the face.
3711 # @return New GEOM_Object, containing the created face.
3713 # @ref tui_building_by_blocks_page "Example 1"
3714 # \n @ref swig_MakeQuad4Vertices "Example 2"
3715 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3716 # Example: see GEOM_Spanner.py
3717 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3718 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3721 ## Create a hexahedral solid, bounded by the six given faces. Order of
3722 # faces is not important. It is not necessary that Faces share the same edge.
3723 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3724 # @return New GEOM_Object, containing the created solid.
3726 # @ref tui_building_by_blocks_page "Example 1"
3727 # \n @ref swig_MakeHexa "Example 2"
3728 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3729 # Example: see GEOM_Spanner.py
3730 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3731 RaiseIfFailed("MakeHexa", self.BlocksOp)
3734 ## Create a hexahedral solid between two given faces.
3735 # The missing faces will be built by creating the smallest ones.
3736 # @param F1,F2 Two opposite faces for the hexahedral solid.
3737 # @return New GEOM_Object, containing the created solid.
3739 # @ref tui_building_by_blocks_page "Example 1"
3740 # \n @ref swig_MakeHexa2Faces "Example 2"
3741 def MakeHexa2Faces(self,F1, F2):
3742 # Example: see GEOM_Spanner.py
3743 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3744 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3750 ## @addtogroup l3_blocks_op
3753 ## Get a vertex, found in the given shape by its coordinates.
3754 # @param theShape Block or a compound of blocks.
3755 # @param theX,theY,theZ Coordinates of the sought vertex.
3756 # @param theEpsilon Maximum allowed distance between the resulting
3757 # vertex and point with the given coordinates.
3758 # @return New GEOM_Object, containing the found vertex.
3760 # @ref swig_GetPoint "Example"
3761 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
3762 # Example: see GEOM_TestOthers.py
3763 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3764 RaiseIfFailed("GetPoint", self.BlocksOp)
3767 ## Find a vertex of the given shape, which has minimal distance to the given point.
3768 # @param theShape Any shape.
3769 # @param thePoint Point, close to the desired vertex.
3770 # @return New GEOM_Object, containing the found vertex.
3772 # @ref swig_GetVertexNearPoint "Example"
3773 def GetVertexNearPoint(self, theShape, thePoint):
3774 # Example: see GEOM_TestOthers.py
3775 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
3776 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
3779 ## Get an edge, found in the given shape by two given vertices.
3780 # @param theShape Block or a compound of blocks.
3781 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3782 # @return New GEOM_Object, containing the found edge.
3784 # @ref swig_GetEdge "Example"
3785 def GetEdge(self, theShape, thePoint1, thePoint2):
3786 # Example: see GEOM_Spanner.py
3787 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3788 RaiseIfFailed("GetEdge", self.BlocksOp)
3791 ## Find an edge of the given shape, which has minimal distance to the given point.
3792 # @param theShape Block or a compound of blocks.
3793 # @param thePoint Point, close to the desired edge.
3794 # @return New GEOM_Object, containing the found edge.
3796 # @ref swig_GetEdgeNearPoint "Example"
3797 def GetEdgeNearPoint(self, theShape, thePoint):
3798 # Example: see GEOM_TestOthers.py
3799 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3800 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3803 ## Returns a face, found in the given shape by four given corner vertices.
3804 # @param theShape Block or a compound of blocks.
3805 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3806 # @return New GEOM_Object, containing the found face.
3808 # @ref swig_todo "Example"
3809 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3810 # Example: see GEOM_Spanner.py
3811 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3812 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3815 ## Get a face of block, found in the given shape by two given edges.
3816 # @param theShape Block or a compound of blocks.
3817 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3818 # @return New GEOM_Object, containing the found face.
3820 # @ref swig_todo "Example"
3821 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3822 # Example: see GEOM_Spanner.py
3823 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3824 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3827 ## Find a face, opposite to the given one in the given block.
3828 # @param theBlock Must be a hexahedral solid.
3829 # @param theFace Face of \a theBlock, opposite to the desired face.
3830 # @return New GEOM_Object, containing the found face.
3832 # @ref swig_GetOppositeFace "Example"
3833 def GetOppositeFace(self,theBlock, theFace):
3834 # Example: see GEOM_Spanner.py
3835 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3836 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3839 ## Find a face of the given shape, which has minimal distance to the given point.
3840 # @param theShape Block or a compound of blocks.
3841 # @param thePoint Point, close to the desired face.
3842 # @return New GEOM_Object, containing the found face.
3844 # @ref swig_GetFaceNearPoint "Example"
3845 def GetFaceNearPoint(self, theShape, thePoint):
3846 # Example: see GEOM_Spanner.py
3847 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3848 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3851 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3852 # @param theBlock Block or a compound of blocks.
3853 # @param theVector Vector, close to the normale of the desired face.
3854 # @return New GEOM_Object, containing the found face.
3856 # @ref swig_todo "Example"
3857 def GetFaceByNormale(self, theBlock, theVector):
3858 # Example: see GEOM_Spanner.py
3859 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3860 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3863 ## Find all subshapes of type \a theShapeType of the given shape,
3864 # which have minimal distance to the given point.
3865 # @param theShape Any shape.
3866 # @param thePoint Point, close to the desired shape.
3867 # @param theShapeType Defines what kind of subshapes is searched.
3868 # @param theTolerance The tolerance for distances comparison. All shapes
3869 # with distances to the given point in interval
3870 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
3871 # @return New GEOM_Object, containing a group of all found shapes.
3873 # @ref swig_GetShapesNearPoint "Example"
3874 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
3875 # Example: see GEOM_TestOthers.py
3876 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
3877 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
3880 # end of l3_blocks_op
3883 ## @addtogroup l4_blocks_measure
3886 ## Check, if the compound of blocks is given.
3887 # To be considered as a compound of blocks, the
3888 # given shape must satisfy the following conditions:
3889 # - Each element of the compound should be a Block (6 faces and 12 edges).
3890 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3891 # - The compound should be connexe.
3892 # - The glue between two quadrangle faces should be applied.
3893 # @param theCompound The compound to check.
3894 # @return TRUE, if the given shape is a compound of blocks.
3895 # If theCompound is not valid, prints all discovered errors.
3897 # @ref tui_measurement_tools_page "Example 1"
3898 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3899 def CheckCompoundOfBlocks(self,theCompound):
3900 # Example: see GEOM_Spanner.py
3901 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3902 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3904 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3908 ## Remove all seam and degenerated edges from \a theShape.
3909 # Unite faces and edges, sharing one surface. It means that
3910 # this faces must have references to one C++ surface object (handle).
3911 # @param theShape The compound or single solid to remove irregular edges from.
3912 # @param doUnionFaces If True, then unite faces. If False (the default value),
3913 # do not unite faces.
3914 # @return Improved shape.
3916 # @ref swig_RemoveExtraEdges "Example"
3917 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3918 # Example: see GEOM_TestOthers.py
3919 nbFacesOptimum = -1 # -1 means do not unite faces
3920 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3921 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3922 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3925 ## Check, if the given shape is a blocks compound.
3926 # Fix all detected errors.
3927 # \note Single block can be also fixed by this method.
3928 # @param theShape The compound to check and improve.
3929 # @return Improved compound.
3931 # @ref swig_CheckAndImprove "Example"
3932 def CheckAndImprove(self,theShape):
3933 # Example: see GEOM_TestOthers.py
3934 anObj = self.BlocksOp.CheckAndImprove(theShape)
3935 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3938 # end of l4_blocks_measure
3941 ## @addtogroup l3_blocks_op
3944 ## Get all the blocks, contained in the given compound.
3945 # @param theCompound The compound to explode.
3946 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3947 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3948 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3949 # @return List of GEOM_Objects, containing the retrieved blocks.
3951 # @ref tui_explode_on_blocks "Example 1"
3952 # \n @ref swig_MakeBlockExplode "Example 2"
3953 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3954 # Example: see GEOM_TestOthers.py
3955 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3956 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3957 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3959 anObj.SetParameters(Parameters)
3963 ## Find block, containing the given point inside its volume or on boundary.
3964 # @param theCompound Compound, to find block in.
3965 # @param thePoint Point, close to the desired block. If the point lays on
3966 # boundary between some blocks, we return block with nearest center.
3967 # @return New GEOM_Object, containing the found block.
3969 # @ref swig_todo "Example"
3970 def GetBlockNearPoint(self,theCompound, thePoint):
3971 # Example: see GEOM_Spanner.py
3972 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3973 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3976 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3977 # @param theCompound Compound, to find block in.
3978 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3979 # @return New GEOM_Object, containing the found block.
3981 # @ref swig_GetBlockByParts "Example"
3982 def GetBlockByParts(self,theCompound, theParts):
3983 # Example: see GEOM_TestOthers.py
3984 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3985 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3988 ## Return all blocks, containing all the elements, passed as the parts.
3989 # @param theCompound Compound, to find blocks in.
3990 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3991 # @return List of GEOM_Objects, containing the found blocks.
3993 # @ref swig_todo "Example"
3994 def GetBlocksByParts(self,theCompound, theParts):
3995 # Example: see GEOM_Spanner.py
3996 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3997 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
4000 ## Multi-transformate block and glue the result.
4001 # Transformation is defined so, as to superpose direction faces.
4002 # @param Block Hexahedral solid to be multi-transformed.
4003 # @param DirFace1 ID of First direction face.
4004 # @param DirFace2 ID of Second direction face.
4005 # @param NbTimes Quantity of transformations to be done.
4006 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
4007 # @return New GEOM_Object, containing the result shape.
4009 # @ref tui_multi_transformation "Example"
4010 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
4011 # Example: see GEOM_Spanner.py
4012 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
4013 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
4014 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
4015 anObj.SetParameters(Parameters)
4018 ## Multi-transformate block and glue the result.
4019 # @param Block Hexahedral solid to be multi-transformed.
4020 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
4021 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
4022 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
4023 # @return New GEOM_Object, containing the result shape.
4025 # @ref tui_multi_transformation "Example"
4026 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
4027 DirFace1V, DirFace2V, NbTimesV):
4028 # Example: see GEOM_Spanner.py
4029 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
4030 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
4031 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
4032 DirFace1V, DirFace2V, NbTimesV)
4033 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
4034 anObj.SetParameters(Parameters)
4037 ## Build all possible propagation groups.
4038 # Propagation group is a set of all edges, opposite to one (main)
4039 # edge of this group directly or through other opposite edges.
4040 # Notion of Opposite Edge make sence only on quadrangle face.
4041 # @param theShape Shape to build propagation groups on.
4042 # @return List of GEOM_Objects, each of them is a propagation group.
4044 # @ref swig_Propagate "Example"
4045 def Propagate(self,theShape):
4046 # Example: see GEOM_TestOthers.py
4047 listChains = self.BlocksOp.Propagate(theShape)
4048 RaiseIfFailed("Propagate", self.BlocksOp)
4051 # end of l3_blocks_op
4054 ## @addtogroup l3_groups
4057 ## Creates a new group which will store sub shapes of theMainShape
4058 # @param theMainShape is a GEOM object on which the group is selected
4059 # @param theShapeType defines a shape type of the group
4060 # @return a newly created GEOM group
4062 # @ref tui_working_with_groups_page "Example 1"
4063 # \n @ref swig_CreateGroup "Example 2"
4064 def CreateGroup(self,theMainShape, theShapeType):
4065 # Example: see GEOM_TestOthers.py
4066 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
4067 RaiseIfFailed("CreateGroup", self.GroupOp)
4070 ## Adds a sub object with ID theSubShapeId to the group
4071 # @param theGroup is a GEOM group to which the new sub shape is added
4072 # @param theSubShapeID is a sub shape ID in the main object.
4073 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4075 # @ref tui_working_with_groups_page "Example"
4076 def AddObject(self,theGroup, theSubShapeID):
4077 # Example: see GEOM_TestOthers.py
4078 self.GroupOp.AddObject(theGroup, theSubShapeID)
4079 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
4080 RaiseIfFailed("AddObject", self.GroupOp)
4084 ## Removes a sub object with ID \a theSubShapeId from the group
4085 # @param theGroup is a GEOM group from which the new sub shape is removed
4086 # @param theSubShapeID is a sub shape ID in the main object.
4087 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4089 # @ref tui_working_with_groups_page "Example"
4090 def RemoveObject(self,theGroup, theSubShapeID):
4091 # Example: see GEOM_TestOthers.py
4092 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
4093 RaiseIfFailed("RemoveObject", self.GroupOp)
4096 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4097 # @param theGroup is a GEOM group to which the new sub shapes are added.
4098 # @param theSubShapes is a list of sub shapes to be added.
4100 # @ref tui_working_with_groups_page "Example"
4101 def UnionList (self,theGroup, theSubShapes):
4102 # Example: see GEOM_TestOthers.py
4103 self.GroupOp.UnionList(theGroup, theSubShapes)
4104 RaiseIfFailed("UnionList", self.GroupOp)
4107 ## Works like the above method, but argument
4108 # theSubShapes here is a list of sub-shapes indices
4110 # @ref swig_UnionIDs "Example"
4111 def UnionIDs(self,theGroup, theSubShapes):
4112 # Example: see GEOM_TestOthers.py
4113 self.GroupOp.UnionIDs(theGroup, theSubShapes)
4114 RaiseIfFailed("UnionIDs", self.GroupOp)
4117 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
4118 # @param theGroup is a GEOM group from which the sub-shapes are removed.
4119 # @param theSubShapes is a list of sub-shapes to be removed.
4121 # @ref tui_working_with_groups_page "Example"
4122 def DifferenceList (self,theGroup, theSubShapes):
4123 # Example: see GEOM_TestOthers.py
4124 self.GroupOp.DifferenceList(theGroup, theSubShapes)
4125 RaiseIfFailed("DifferenceList", self.GroupOp)
4128 ## Works like the above method, but argument
4129 # theSubShapes here is a list of sub-shapes indices
4131 # @ref swig_DifferenceIDs "Example"
4132 def DifferenceIDs(self,theGroup, theSubShapes):
4133 # Example: see GEOM_TestOthers.py
4134 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4135 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4138 ## Returns a list of sub objects ID stored in the group
4139 # @param theGroup is a GEOM group for which a list of IDs is requested
4141 # @ref swig_GetObjectIDs "Example"
4142 def GetObjectIDs(self,theGroup):
4143 # Example: see GEOM_TestOthers.py
4144 ListIDs = self.GroupOp.GetObjects(theGroup)
4145 RaiseIfFailed("GetObjects", self.GroupOp)
4148 ## Returns a type of sub objects stored in the group
4149 # @param theGroup is a GEOM group which type is returned.
4151 # @ref swig_GetType "Example"
4152 def GetType(self,theGroup):
4153 # Example: see GEOM_TestOthers.py
4154 aType = self.GroupOp.GetType(theGroup)
4155 RaiseIfFailed("GetType", self.GroupOp)
4158 ## Convert a type of geom object from id to string value
4159 # @param theId is a GEOM obect type id.
4161 # @ref swig_GetType "Example"
4162 def ShapeIdToType(self, theId):
4236 return "FREE_BOUNDS"
4244 return "THRUSECTIONS"
4246 return "COMPOUNDFILTER"
4248 return "SHAPES_ON_SHAPE"
4250 return "ELLIPSE_ARC"
4257 return "Shape Id not exist."
4259 ## Returns a main shape associated with the group
4260 # @param theGroup is a GEOM group for which a main shape object is requested
4261 # @return a GEOM object which is a main shape for theGroup
4263 # @ref swig_GetMainShape "Example"
4264 def GetMainShape(self,theGroup):
4265 # Example: see GEOM_TestOthers.py
4266 anObj = self.GroupOp.GetMainShape(theGroup)
4267 RaiseIfFailed("GetMainShape", self.GroupOp)
4270 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4271 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4273 # @ref swig_todo "Example"
4274 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4275 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4278 Props = self.BasicProperties(edge)
4279 if min_length <= Props[0] and Props[0] <= max_length:
4280 if (not include_min) and (min_length == Props[0]):
4283 if (not include_max) and (Props[0] == max_length):
4286 edges_in_range.append(edge)
4288 if len(edges_in_range) <= 0:
4289 print "No edges found by given criteria"
4292 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4293 self.UnionList(group_edges, edges_in_range)
4297 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4298 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4300 # @ref swig_todo "Example"
4301 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4302 nb_selected = sg.SelectedCount()
4304 print "Select a shape before calling this function, please."
4307 print "Only one shape must be selected"
4310 id_shape = sg.getSelected(0)
4311 shape = IDToObject( id_shape )
4313 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4317 if include_min: left_str = " <= "
4318 if include_max: right_str = " <= "
4320 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4321 + left_str + "length" + right_str + `max_length`)
4323 sg.updateObjBrowser(1)
4330 ## @addtogroup l4_advanced
4333 ## Create a T-shape object with specified caracteristics for the main
4334 # and the incident pipes (radius, width, half-length).
4335 # The extremities of the main pipe are located on junctions points P1 and P2.
4336 # The extremity of the incident pipe is located on junction point P3.
4337 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4338 # the main plane of the T-shape is XOY.
4339 # @param theR1 Internal radius of main pipe
4340 # @param theW1 Width of main pipe
4341 # @param theL1 Half-length of main pipe
4342 # @param theR2 Internal radius of incident pipe (R2 < R1)
4343 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4344 # @param theL2 Half-length of incident pipe
4345 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4346 # @param theP1 1st junction point of main pipe
4347 # @param theP2 2nd junction point of main pipe
4348 # @param theP3 Junction point of incident pipe
4349 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4351 # @ref tui_creation_pipetshape "Example"
4352 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4353 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4354 if (theP1 and theP2 and theP3):
4355 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4357 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4358 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4359 if Parameters: anObj[0].SetParameters(Parameters)
4362 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4363 # and the incident pipes (radius, width, half-length). The chamfer is
4364 # created on the junction of the pipes.
4365 # The extremities of the main pipe are located on junctions points P1 and P2.
4366 # The extremity of the incident pipe is located on junction point P3.
4367 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4368 # the main plane of the T-shape is XOY.
4369 # @param theR1 Internal radius of main pipe
4370 # @param theW1 Width of main pipe
4371 # @param theL1 Half-length of main pipe
4372 # @param theR2 Internal radius of incident pipe (R2 < R1)
4373 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4374 # @param theL2 Half-length of incident pipe
4375 # @param theH Height of the chamfer.
4376 # @param theW Width of the chamfer.
4377 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4378 # @param theP1 1st junction point of main pipe
4379 # @param theP2 2nd junction point of main pipe
4380 # @param theP3 Junction point of incident pipe
4381 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4383 # @ref tui_creation_pipetshape "Example"
4384 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4385 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4386 if (theP1 and theP2 and theP3):
4387 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4389 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4390 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4391 if Parameters: anObj[0].SetParameters(Parameters)
4394 ## Create a T-shape object with fillet and with specified caracteristics for the main
4395 # and the incident pipes (radius, width, half-length). The fillet is
4396 # created on the junction of the pipes.
4397 # The extremities of the main pipe are located on junctions points P1 and P2.
4398 # The extremity of the incident pipe is located on junction point P3.
4399 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4400 # the main plane of the T-shape is XOY.
4401 # @param theR1 Internal radius of main pipe
4402 # @param theW1 Width of main pipe
4403 # @param theL1 Half-length of main pipe
4404 # @param theR2 Internal radius of incident pipe (R2 < R1)
4405 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4406 # @param theL2 Half-length of incident pipe
4407 # @param theRF Radius of curvature of fillet.
4408 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4409 # @param theP1 1st junction point of main pipe
4410 # @param theP2 2nd junction point of main pipe
4411 # @param theP3 Junction point of incident pipe
4412 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4414 # @ref tui_creation_pipetshape "Example"
4415 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4416 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4417 if (theP1 and theP2 and theP3):
4418 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4420 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4421 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4422 if Parameters: anObj[0].SetParameters(Parameters)
4425 #@@ insert new functions before this line @@ do not remove this line @@#
4427 # end of l4_advanced
4430 ## Create a copy of the given object
4431 # @ingroup l1_geompy_auxiliary
4433 # @ref swig_all_advanced "Example"
4434 def MakeCopy(self,theOriginal):
4435 # Example: see GEOM_TestAll.py
4436 anObj = self.InsertOp.MakeCopy(theOriginal)
4437 RaiseIfFailed("MakeCopy", self.InsertOp)
4440 ## Add Path to load python scripts from
4441 # @ingroup l1_geompy_auxiliary
4442 def addPath(self,Path):
4443 if (sys.path.count(Path) < 1):
4444 sys.path.append(Path)
4448 ## Load marker texture from the file
4449 # @param Path a path to the texture file
4450 # @return unique texture identifier
4451 # @ingroup l1_geompy_auxiliary
4452 def LoadTexture(self, Path):
4453 # Example: see GEOM_TestAll.py
4454 ID = self.InsertOp.LoadTexture(Path)
4455 RaiseIfFailed("LoadTexture", self.InsertOp)
4458 ## Add marker texture. @a Width and @a Height parameters
4459 # specify width and height of the texture in pixels.
4460 # If @a RowData is @c True, @a Texture parameter should represent texture data
4461 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4462 # parameter should be unpacked string, in which '1' symbols represent opaque
4463 # pixels and '0' represent transparent pixels of the texture bitmap.
4465 # @param Width texture width in pixels
4466 # @param Height texture height in pixels
4467 # @param Texture texture data
4468 # @param RowData if @c True, @a Texture data are packed in the byte stream
4469 # @ingroup l1_geompy_auxiliary
4470 def AddTexture(self, Width, Height, Texture, RowData=False):
4471 # Example: see GEOM_TestAll.py
4472 if not RowData: Texture = PackData(Texture)
4473 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4474 RaiseIfFailed("AddTexture", self.InsertOp)
4478 #Register the new proxy for GEOM_Gen
4479 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)