X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_SWIG%2FgeompyDC.py;h=0f570563f7b0d62df73223995b8cd0682beffa88;hb=da9569a4257702366c8a827ee0f7c31594110282;hp=443c90e91b6867d4bcdd404cd065d4c44c71ac65;hpb=3ba64429c6c1ee8c3899ab32270b1223918f917c;p=modules%2Fgeom.git diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 443c90e91..0f570563f 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -1,8 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -56,6 +53,7 @@ ## @defgroup l4_decompose Decompose objects ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape ## @defgroup l4_obtain Access to subshapes by a criteria +## @defgroup l4_advanced Advanced objects creation functions ## @} @@ -98,22 +96,32 @@ def RaiseIfFailed (Method_name, Operation): ## @ingroup l1_geompy_auxiliary def ParseParameters(*parameters): Result = [] - StringResult = "" + StringResult = [] for parameter in parameters: - if isinstance(parameter,str): - if notebook.isVariable(parameter): - Result.append(notebook.get(parameter)) - else: - raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!" + if isinstance(parameter, list): + lResults = ParseParameters(*parameter) + if len(lResults) > 0: + Result.append(lResults[:-1]) + StringResult += lResults[-1].split(":") + pass + pass else: - Result.append(parameter) + if isinstance(parameter,str): + if notebook.isVariable(parameter): + Result.append(notebook.get(parameter)) + else: + raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!" + pass + else: + Result.append(parameter) + pass + StringResult.append(str(parameter)) pass - - StringResult = StringResult + str(parameter) - StringResult = StringResult + ":" pass - StringResult = StringResult[:len(StringResult)-1] - Result.append(StringResult) + if Result: + Result.append(":".join(StringResult)) + else: + Result = ":".join(StringResult) return Result ## Return list of variables value from salome notebook @@ -281,6 +289,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): self.MeasuOp = None self.BlocksOp = None self.GroupOp = None + self.AdvOp = None pass ## @addtogroup l1_geompy_auxiliary @@ -312,6 +321,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): self.MeasuOp = self.GetIMeasureOperations (self.myStudyId) self.BlocksOp = self.GetIBlocksOperations (self.myStudyId) self.GroupOp = self.GetIGroupOperations (self.myStudyId) + self.AdvOp = self.GetIAdvancedOperations (self.myStudyId) pass ## Get name for sub-shape aSubObj of shape aMainObj @@ -347,7 +357,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): aSObject = self.AddInStudy(self.myStudy, aShape, aName, None) if doRestoreSubShapes: self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs, - theFindMethod, theInheritFirstArg) + theFindMethod, theInheritFirstArg, True ) except: print "addToStudy() failed" return "" @@ -387,14 +397,43 @@ class geompyDC(GEOM._objref_GEOM_Gen): # operations, where only the first argument has to be considered. # If theObject has only one argument shape, this flag is automatically # considered as True, not regarding really passed value. + # \param theAddPrefix add prefix "from_" to names of restored sub-shapes, + # and prefix "from_subshapes_of_" to names of partially restored subshapes. # \return list of published sub-shapes # # @ref tui_restore_prs_params "Example" - def RestoreSubShapes (self, theObject, theArgs=[], - theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False): + def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, + theInheritFirstArg=False, theAddPrefix=True): # Example: see GEOM_TestAll.py return self.RestoreSubShapesO(self.myStudy, theObject, theArgs, - theFindMethod, theInheritFirstArg) + theFindMethod, theInheritFirstArg, theAddPrefix) + + ## Publish sub-shapes, standing for arguments and sub-shapes of arguments + # To be used from python scripts out of geompy.addToStudy (non-default usage) + # \param theObject published GEOM object, arguments of which will be published + # \param theArgs list of GEOM_Object, operation arguments to be published. + # If this list is empty, all operation arguments will be published + # \param theFindMethod method to search subshapes, corresponding to arguments and + # their subshapes. Value from enumeration GEOM::find_shape_method. + # \param theInheritFirstArg set properties of the first argument for theObject. + # Do not publish subshapes in place of arguments, but only + # in place of subshapes of the first argument, + # because the whole shape corresponds to the first argument. + # Mainly to be used after transformations, but it also can be + # usefull after partition with one object shape, and some other + # operations, where only the first argument has to be considered. + # If theObject has only one argument shape, this flag is automatically + # considered as True, not regarding really passed value. + # \param theAddPrefix add prefix "from_" to names of restored sub-shapes, + # and prefix "from_subshapes_of_" to names of partially restored subshapes. + # \return list of published sub-shapes + # + # @ref tui_restore_prs_params "Example" + def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, + theInheritFirstArg=False, theAddPrefix=True): + # Example: see GEOM_TestAll.py + return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs, + theFindMethod, theInheritFirstArg, theAddPrefix) # end of l3_restore_ss ## @} @@ -409,7 +448,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the created point. # # @ref tui_creation_point "Example" - def MakeVertex(self,theX, theY, theZ): + def MakeVertex(self, theX, theY, theZ): # Example: see GEOM_TestAll.py theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ) anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ) @@ -522,13 +561,13 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @param theFace The face for which tangent plane should be built. # @param theParameterV vertical value of the center point (0.0 - 1.0). # @param theParameterU horisontal value of the center point (0.0 - 1.0). - # @param theTrimSize the size of plane. + # @param theTrimSize the size of plane. # @return New GEOM_Object, containing the created tangent. # # @ref swig_MakeTangentPlaneOnFace "Example" - def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize): - anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize) - RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp) + def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize): + anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize) + RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp) return anObj ## Create a vector with the given components. @@ -686,7 +725,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("MakeMarker", self.BasicOp) anObj.SetParameters(Parameters) return anObj - + ## Create a local coordinate system from shape. # @param theShape The initial shape to detect the coordinate system. # @return New GEOM_Object, containing the created coordinate system. @@ -703,7 +742,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @param theYVec Vector of Y direction # @return New GEOM_Object, containing the created coordinate system. # - # @ref tui_creation_lcs "Example" + # @ref tui_creation_lcs "Example" def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec): anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec) RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp) @@ -741,7 +780,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense) RaiseIfFailed("MakeArcCenter", self.CurvesOp) return anObj - + ## Create an arc of ellipse, of center and two points. # @param theCenter Center of the arc. # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2. @@ -932,16 +971,18 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp) return anObj - ## Create a sketcher wire, following the numerical description, + ## Create a sketcher wire, following the numerical description, # passed through theCoordinates argument. \n - # @param theCoordinates double values, defining points to create a wire, + # @param theCoordinates double values, defining points to create a wire, # passing from it. # @return New GEOM_Object, containing the created wire. # # @ref tui_sketcher_page "Example" def Make3DSketcher(self, theCoordinates): + theCoordinates,Parameters = ParseParameters(theCoordinates) anObj = self.CurvesOp.Make3DSketcher(theCoordinates) RaiseIfFailed("Make3DSketcher", self.CurvesOp) + anObj.SetParameters(Parameters) return anObj # end of l3_sketcher @@ -993,7 +1034,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # with edges, parallel to this coordinate axes. # @param theH height of Face. # @param theW width of Face. - # @param theOrientation orientation belong axis OXY OYZ OZX + # @param theOrientation orientation belong axis OXY OYZ OZX # @return New GEOM_Object, containing the created face. # # @ref tui_creation_face "Example" @@ -1008,7 +1049,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Create a face from another plane and two sizes, # vertical size and horisontal size. # @param theObj Normale vector to the creating face or - # the face object. + # the face object. # @param theH Height (vertical size). # @param theW Width (horisontal size). # @return New GEOM_Object, containing the created face. @@ -1050,7 +1091,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Create a disk with specified dimensions along OX-OY coordinate axes. # @param theR Radius of Face. - # @param theOrientation set the orientation belong axis OXY or OYZ or OZX + # @param theOrientation set the orientation belong axis OXY or OYZ or OZX # @return New GEOM_Object, containing the created disk. # # @ref tui_creation_face "Example" @@ -1316,7 +1357,14 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @param theTol2D a 2d tolerance to be reached # @param theTol3D a 3d tolerance to be reached # @param theNbIter a number of iteration of approximation algorithm - # @param isUseOri flag for take into account orientation of edges + # @param theMethod Kind of method to perform filling operation: + # 0 - Default - standard behaviour + # 1 - Use edges orientation - orientation of edges are + # used: if edge is reversed curve from this edge + # is reversed before using in filling algorithm. + # 2 - Auto-correct orientation - change orientation + # of curves using minimization of sum of distances + # between ends points of edges. # @param isApprox if True, BSpline curves are generated in the process # of surface construction. By default it is False, that means # the surface is created using Besier curves. The usage of @@ -1326,13 +1374,12 @@ class geompyDC(GEOM._objref_GEOM_Gen): # # @ref tui_creation_filling "Example" def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, - theTol3D, theNbIter, isUseOri=0, isApprox=0): + theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0): # Example: see GEOM_TestAll.py - theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, - theTol2D, theTol3D, theNbIter) + theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter) anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, - isUseOri, isApprox) + theMethod, isApprox) RaiseIfFailed("MakeFilling", self.PrimOp) anObj.SetParameters(Parameters) return anObj @@ -1366,7 +1413,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Create a shape by extrusion of the profile shape along # the path shape. The path shape can be a wire or an edge. - # the several profiles can be specified in the several locations of path. + # the several profiles can be specified in the several locations of path. # @param theSeqBases - list of Bases shape to be extruded. # @param theLocations - list of locations on the path corresponding # specified list of the Bases shapes. Number of locations @@ -1390,7 +1437,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Create a shape by extrusion of the profile shape along # the path shape. The path shape can be a wire or a edge. - # the several profiles can be specified in the several locations of path. + # the several profiles can be specified in the several locations of path. # @param theSeqBases - list of Bases shape to be extruded. Base shape must be # shell or face. If number of faces in neighbour sections # aren't coincided result solid between such sections will @@ -2097,10 +2144,13 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing processed shape. # # @ref tui_shape_processing "Example" - def ProcessShape(self,theShape, theOperators, theParameters, theValues): + def ProcessShape(self, theShape, theOperators, theParameters, theValues): # Example: see GEOM_TestHealing.py theValues,Parameters = ParseList(theValues) anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues) + # To avoid script failure in case of good argument shape + if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg": + return theShape RaiseIfFailed("ProcessShape", self.HealOp) for string in (theOperators + theParameters): Parameters = ":" + Parameters @@ -2216,11 +2266,22 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing processed shape. # # @ref swig_todo "Example" - def ChangeOrientationShellCopy(self,theObject): + def ChangeOrientationShellCopy(self, theObject): anObj = self.HealOp.ChangeOrientationCopy(theObject) RaiseIfFailed("ChangeOrientationCopy", self.HealOp) return anObj + ## Try to limit tolerance of the given object by value \a theTolerance. + # @param theObject Shape to be processed. + # @param theTolerance Required tolerance value. + # @return New GEOM_Object, containing processed shape. + # + # @ref tui_limit_tolerance "Example" + def LimitTolerance(self, theObject, theTolerance = 1e-07): + anObj = self.HealOp.LimitTolerance(theObject, theTolerance) + RaiseIfFailed("LimitTolerance", self.HealOp) + return anObj + ## Get a list of wires (wrapped in GEOM_Object-s), # that constitute a free boundary of the given shape. # @param theObject Shape to get free boundary of. @@ -2230,7 +2291,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # theOpenWires: Open wires on the free boundary of the given shape. # # @ref tui_measurement_tools_page "Example" - def GetFreeBoundary(self,theObject): + def GetFreeBoundary(self, theObject): # Example: see GEOM_TestHealing.py anObj = self.HealOp.GetFreeBoundary(theObject) RaiseIfFailed("GetFreeBoundary", self.HealOp) @@ -2354,10 +2415,10 @@ class geompyDC(GEOM._objref_GEOM_Gen): # in order to avoid possible intersection between shapes from # this compound. # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum). - # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with - # type <= Limit are kept in the result, - # else - shapes with type > Limit are kept - # also (if they exist) + # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of + # target type (equal to Limit) are kept in the result, + # else standalone shapes of lower dimension + # are kept also (if they exist). # # After implementation new version of PartitionAlgo (October 2006) # other parameters are ignored by current functionality. They are kept @@ -2680,9 +2741,9 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Modify the Location of the given object by Path, # @param theObject The object to be displaced. # @param thePath Wire or Edge along that the object will be translated. - # @param theDistance progress of Path (0 = start location, 1 = end of path location). - # @param theCopy is to create a copy objects if true. - # @param theReverse - 0 for usual direction, 1 to reverse path direction. + # @param theDistance progress of Path (0 = start location, 1 = end of path location). + # @param theCopy is to create a copy objects if true. + # @param theReverse - 0 for usual direction, 1 to reverse path direction. # @return New GEOM_Object, containing the displaced shape. # # @ref tui_modify_location "Example" @@ -3570,19 +3631,31 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the found vertex. # # @ref swig_GetPoint "Example" - def GetPoint(self,theShape, theX, theY, theZ, theEpsilon): + def GetPoint(self, theShape, theX, theY, theZ, theEpsilon): # Example: see GEOM_TestOthers.py anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon) RaiseIfFailed("GetPoint", self.BlocksOp) return anObj + ## Find a vertex of the given shape, which has minimal distance to the given point. + # @param theShape Any shape. + # @param thePoint Point, close to the desired vertex. + # @return New GEOM_Object, containing the found vertex. + # + # @ref swig_GetVertexNearPoint "Example" + def GetVertexNearPoint(self, theShape, thePoint): + # Example: see GEOM_TestOthers.py + anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint) + RaiseIfFailed("GetVertexNearPoint", self.BlocksOp) + return anObj + ## Get an edge, found in the given shape by two given vertices. # @param theShape Block or a compound of blocks. # @param thePoint1,thePoint2 Points, close to the ends of the desired edge. # @return New GEOM_Object, containing the found edge. # - # @ref swig_todo "Example" - def GetEdge(self,theShape, thePoint1, thePoint2): + # @ref swig_GetEdge "Example" + def GetEdge(self, theShape, thePoint1, thePoint2): # Example: see GEOM_Spanner.py anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2) RaiseIfFailed("GetEdge", self.BlocksOp) @@ -3594,7 +3667,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the found edge. # # @ref swig_GetEdgeNearPoint "Example" - def GetEdgeNearPoint(self,theShape, thePoint): + def GetEdgeNearPoint(self, theShape, thePoint): # Example: see GEOM_TestOthers.py anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint) RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp) @@ -3642,7 +3715,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the found face. # # @ref swig_GetFaceNearPoint "Example" - def GetFaceNearPoint(self,theShape, thePoint): + def GetFaceNearPoint(self, theShape, thePoint): # Example: see GEOM_Spanner.py anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint) RaiseIfFailed("GetFaceNearPoint", self.BlocksOp) @@ -3660,6 +3733,23 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("GetFaceByNormale", self.BlocksOp) return anObj + ## Find all subshapes of type \a theShapeType of the given shape, + # which have minimal distance to the given point. + # @param theShape Any shape. + # @param thePoint Point, close to the desired shape. + # @param theShapeType Defines what kind of subshapes is searched. + # @param theTolerance The tolerance for distances comparison. All shapes + # with distances to the given point in interval + # [minimal_distance, minimal_distance + theTolerance] will be gathered. + # @return New GEOM_Object, containing a group of all found shapes. + # + # @ref swig_GetShapesNearPoint "Example" + def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07): + # Example: see GEOM_TestOthers.py + anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance) + RaiseIfFailed("GetShapesNearPoint", self.BlocksOp) + return anObj + # end of l3_blocks_op ## @} @@ -4108,6 +4198,106 @@ class geompyDC(GEOM._objref_GEOM_Gen): # end of l3_groups ## @} + ## @addtogroup l4_advanced + ## @{ + + ## Create a T-shape object with specified caracteristics for the main + # and the incident pipes (radius, width, half-length). + # The extremities of the main pipe are located on junctions points P1 and P2. + # The extremity of the incident pipe is located on junction point P3. + # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and + # the main plane of the T-shape is XOY. + # @param theR1 Internal radius of main pipe + # @param theW1 Width of main pipe + # @param theL1 Half-length of main pipe + # @param theR2 Internal radius of incident pipe (R2 < R1) + # @param theW2 Width of incident pipe (R2+W2 < R1+W1) + # @param theL2 Half-length of incident pipe + # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True) + # @param theP1 1st junction point of main pipe + # @param theP2 2nd junction point of main pipe + # @param theP3 Junction point of incident pipe + # @return List of GEOM_Objects, containing the created shape and propagation groups. + # + # @ref tui_creation_pipetshape "Example" + def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None): + theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2) + if (theP1 and theP2 and theP3): + anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3) + else: + anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh) + RaiseIfFailed("MakePipeTShape", self.AdvOp) + if Parameters: anObj[0].SetParameters(Parameters) + return anObj + + ## Create a T-shape object with chamfer and with specified caracteristics for the main + # and the incident pipes (radius, width, half-length). The chamfer is + # created on the junction of the pipes. + # The extremities of the main pipe are located on junctions points P1 and P2. + # The extremity of the incident pipe is located on junction point P3. + # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and + # the main plane of the T-shape is XOY. + # @param theR1 Internal radius of main pipe + # @param theW1 Width of main pipe + # @param theL1 Half-length of main pipe + # @param theR2 Internal radius of incident pipe (R2 < R1) + # @param theW2 Width of incident pipe (R2+W2 < R1+W1) + # @param theL2 Half-length of incident pipe + # @param theH Height of the chamfer. + # @param theW Width of the chamfer. + # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True) + # @param theP1 1st junction point of main pipe + # @param theP2 2nd junction point of main pipe + # @param theP3 Junction point of incident pipe + # @return List of GEOM_Objects, containing the created shape and propagation groups. + # + # @ref tui_creation_pipetshape "Example" + def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None): + theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW) + if (theP1 and theP2 and theP3): + anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3) + else: + anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh) + RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp) + if Parameters: anObj[0].SetParameters(Parameters) + return anObj + + ## Create a T-shape object with fillet and with specified caracteristics for the main + # and the incident pipes (radius, width, half-length). The fillet is + # created on the junction of the pipes. + # The extremities of the main pipe are located on junctions points P1 and P2. + # The extremity of the incident pipe is located on junction point P3. + # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and + # the main plane of the T-shape is XOY. + # @param theR1 Internal radius of main pipe + # @param theW1 Width of main pipe + # @param theL1 Half-length of main pipe + # @param theR2 Internal radius of incident pipe (R2 < R1) + # @param theW2 Width of incident pipe (R2+W2 < R1+W1) + # @param theL2 Half-length of incident pipe + # @param theRF Radius of curvature of fillet. + # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True) + # @param theP1 1st junction point of main pipe + # @param theP2 2nd junction point of main pipe + # @param theP3 Junction point of incident pipe + # @return List of GEOM_Objects, containing the created shape and propagation groups. + # + # @ref tui_creation_pipetshape "Example" + def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None): + theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF) + if (theP1 and theP2 and theP3): + anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3) + else: + anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh) + RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp) + if Parameters: anObj[0].SetParameters(Parameters) + return anObj + + #@@ insert new functions before this line @@ do not remove this line @@# + + # end of l4_advanced + ## @} + ## Create a copy of the given object # @ingroup l1_geompy_auxiliary #