Mantis issue 20052: RemoveExtraEdges signature changed (integer parameter theOptimumNbFaces replaced with boolean doUnionFaces).

This commit is contained in:
jfa 2009-11-04 09:04:43 +00:00
parent f5e416e256
commit 16fc7fed7d
2 changed files with 27 additions and 27 deletions

View File

@ -456,13 +456,13 @@ def TestOtherOperations (geompy, math):
Shell_1 = geompy.MakeShell([Face_1, Rotation_1, Rotation_2, Rotation_3, Rotation_4, Rotation_5]) Shell_1 = geompy.MakeShell([Face_1, Rotation_1, Rotation_2, Rotation_3, Rotation_4, Rotation_5])
Solid_1 = geompy.MakeSolid([Shell_1]) Solid_1 = geompy.MakeSolid([Shell_1])
NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, 0) NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, True) # doUnionFaces = True
geompy.addToStudy(Shell_1, "Shell_1") geompy.addToStudy(Shell_1, "Shell_1")
geompy.addToStudy(Solid_1, "Solid_1") geompy.addToStudy(Solid_1, "Solid_1")
geompy.addToStudy(NoExtraEdges_1, "NoExtraEdges_1") geompy.addToStudy(NoExtraEdges_1, "NoExtraEdges_1")
# RemoveExtraEdges # RemoveExtraEdges (by default, doUnionFaces = False)
freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces) freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces)
geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra") geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra")
@ -529,7 +529,7 @@ def TestOtherOperations (geompy, math):
v_y, Loc, geompy.GEOM.ST_ON) v_y, Loc, geompy.GEOM.ST_ON)
for edge_i in edges_on_pln: for edge_i in edges_on_pln:
geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)") geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)")
# GetShapesOnPlaneWithLocationIDs # GetShapesOnPlaneWithLocationIDs
edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs( edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(
blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, geompy.GEOM.ST_ON) blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, geompy.GEOM.ST_ON)

View File

@ -93,9 +93,9 @@ ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE"
def RaiseIfFailed (Method_name, Operation): def RaiseIfFailed (Method_name, Operation):
if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY": if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
raise RuntimeError, Method_name + " : " + Operation.GetErrorCode() raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
## Return list of variables value from salome notebook ## Return list of variables value from salome notebook
## @ingroup l1_geompy_auxiliary ## @ingroup l1_geompy_auxiliary
def ParseParameters(*parameters): def ParseParameters(*parameters):
Result = [] Result = []
StringResult = "" StringResult = ""
@ -108,16 +108,16 @@ def ParseParameters(*parameters):
else: else:
Result.append(parameter) Result.append(parameter)
pass pass
StringResult = StringResult + str(parameter) StringResult = StringResult + str(parameter)
StringResult = StringResult + ":" StringResult = StringResult + ":"
pass pass
StringResult = StringResult[:len(StringResult)-1] StringResult = StringResult[:len(StringResult)-1]
Result.append(StringResult) Result.append(StringResult)
return Result return Result
## Return list of variables value from salome notebook ## Return list of variables value from salome notebook
## @ingroup l1_geompy_auxiliary ## @ingroup l1_geompy_auxiliary
def ParseList(list): def ParseList(list):
Result = [] Result = []
StringResult = "" StringResult = ""
@ -128,15 +128,15 @@ def ParseList(list):
else: else:
Result.append(str(parameter)) Result.append(str(parameter))
pass pass
StringResult = StringResult + str(parameter) StringResult = StringResult + str(parameter)
StringResult = StringResult + ":" StringResult = StringResult + ":"
pass pass
StringResult = StringResult[:len(StringResult)-1] StringResult = StringResult[:len(StringResult)-1]
return Result, StringResult return Result, StringResult
## Return list of variables value from salome notebook ## Return list of variables value from salome notebook
## @ingroup l1_geompy_auxiliary ## @ingroup l1_geompy_auxiliary
def ParseSketcherCommand(command): def ParseSketcherCommand(command):
Result = "" Result = ""
StringResult = "" StringResult = ""
@ -178,7 +178,7 @@ def ParseSketcherCommand(command):
## \endcode ## \endcode
## @param data unpacked data - a string containing '1' and '0' symbols ## @param data unpacked data - a string containing '1' and '0' symbols
## @return data packed to the byte stream ## @return data packed to the byte stream
## @ingroup l1_geompy_auxiliary ## @ingroup l1_geompy_auxiliary
def PackData(data): def PackData(data):
bytes = len(data)/8 bytes = len(data)/8
if len(data)%8: bytes += 1 if len(data)%8: bytes += 1
@ -203,7 +203,7 @@ def PackData(data):
## A zero symbol ('0') represents transparent pixel of the texture bitmap. ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
## The function returns width and height of the pixmap in pixels and byte stream representing ## The function returns width and height of the pixmap in pixels and byte stream representing
## texture bitmap itself. ## texture bitmap itself.
## ##
## This function can be used to read the texture to the byte stream in order to pass it to ## This function can be used to read the texture to the byte stream in order to pass it to
## the AddTexture() function of geompy class. ## the AddTexture() function of geompy class.
## For example, ## For example,
@ -216,7 +216,7 @@ def PackData(data):
## \endcode ## \endcode
## @param fname texture file name ## @param fname texture file name
## @return sequence of tree values: texture's width, height in pixels and its byte stream ## @return sequence of tree values: texture's width, height in pixels and its byte stream
## @ingroup l1_geompy_auxiliary ## @ingroup l1_geompy_auxiliary
def ReadTexture(fname): def ReadTexture(fname):
try: try:
f = open(fname) f = open(fname)
@ -517,7 +517,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter) anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
RaiseIfFailed("MakeTangentOnCurve", self.BasicOp) RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
return anObj return anObj
## Create a tangent plane, corresponding to the given parameter on the given face. ## Create a tangent plane, corresponding to the given parameter on the given face.
# @param theFace The face for which tangent plane should be built. # @param theFace The face for which tangent plane should be built.
# @param theParameterV vertical value of the center point (0.0 - 1.0). # @param theParameterV vertical value of the center point (0.0 - 1.0).
@ -640,7 +640,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePlaneFace", self.BasicOp) RaiseIfFailed("MakePlaneFace", self.BasicOp)
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
return anObj return anObj
## Create a plane, passing through the 2 vectors ## Create a plane, passing through the 2 vectors
# with center in a start point of the first vector. # with center in a start point of the first vector.
# @param theVec1 Vector, defining center point and plane direction. # @param theVec1 Vector, defining center point and plane direction.
@ -656,7 +656,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePlane2Vec", self.BasicOp) RaiseIfFailed("MakePlane2Vec", self.BasicOp)
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
return anObj return anObj
## Create a plane, based on a Local coordinate system. ## Create a plane, based on a Local coordinate system.
# @param theLCS coordinate system, defining plane. # @param theLCS coordinate system, defining plane.
# @param theTrimSize Half size of a side of quadrangle face, representing the plane. # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
@ -681,7 +681,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @ref swig_MakeMarker "Example" # @ref swig_MakeMarker "Example"
def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ): def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ); OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ) anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
RaiseIfFailed("MakeMarker", self.BasicOp) RaiseIfFailed("MakeMarker", self.BasicOp)
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
@ -932,7 +932,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane) anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp) RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
return anObj return anObj
## Create a sketcher wire, following the numerical description, ## Create a sketcher wire, following the numerical description,
# passed through <VAR>theCoordinates</VAR> argument. \n # passed through <VAR>theCoordinates</VAR> argument. \n
# @param theCoordinates double values, defining points to create a wire, # @param theCoordinates double values, defining points to create a wire,
@ -989,12 +989,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2) anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp) RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
return anObj return anObj
## Create a face with specified dimensions along OX-OY coordinate axes, ## Create a face with specified dimensions along OX-OY coordinate axes,
# with edges, parallel to this coordinate axes. # with edges, parallel to this coordinate axes.
# @param theH height of Face. # @param theH height of Face.
# @param theW width 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. # @return New GEOM_Object, containing the created face.
# #
# @ref tui_creation_face "Example" # @ref tui_creation_face "Example"
@ -1051,7 +1051,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a disk with specified dimensions along OX-OY coordinate axes. ## Create a disk with specified dimensions along OX-OY coordinate axes.
# @param theR Radius of Face. # @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. # @return New GEOM_Object, containing the created disk.
# #
# @ref tui_creation_face "Example" # @ref tui_creation_face "Example"
@ -1254,7 +1254,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp) RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
return anObj return anObj
## Create a shape by extrusion of the base shape along the dx, dy, dz direction ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
# @param theBase Base shape to be extruded. # @param theBase Base shape to be extruded.
# @param theDX, theDY, theDZ Directions of extrusion. # @param theDX, theDY, theDZ Directions of extrusion.
@ -1268,7 +1268,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp) RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
return anObj return anObj
## Create a shape by extrusion of the base shape along the dx, dy, dz direction ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
# i.e. all the space, transfixed by the base shape during its translation # i.e. all the space, transfixed by the base shape during its translation
# along the vector on the given distance in 2 Ways (forward/backward) . # along the vector on the given distance in 2 Ways (forward/backward) .
@ -2830,7 +2830,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp) RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
anObj.SetParameters(Parameters) anObj.SetParameters(Parameters)
return anObj return anObj
## Perform a fillet on the specified edges of the given shape ## Perform a fillet on the specified edges of the given shape
# @param theShape - Wire Shape to perform fillet on. # @param theShape - Wire Shape to perform fillet on.
# @param theR - Fillet radius. # @param theR - Fillet radius.
@ -2846,7 +2846,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes) anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
RaiseIfFailed("MakeFillet1D", self.LocalOp) RaiseIfFailed("MakeFillet1D", self.LocalOp)
return anObj return anObj
## Perform a fillet on the specified edges/faces of the given shape ## Perform a fillet on the specified edges/faces of the given shape
# @param theShape - Face Shape to perform fillet on. # @param theShape - Face Shape to perform fillet on.
# @param theR - Fillet radius. # @param theR - Fillet radius.
@ -3979,7 +3979,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# #
# @param Width texture width in pixels # @param Width texture width in pixels
# @param Height texture height in pixels # @param Height texture height in pixels
# @param Texture texture data # @param Texture texture data
# @param RowData if @c True, @a Texture data are packed in the byte stream # @param RowData if @c True, @a Texture data are packed in the byte stream
# @ingroup l1_geompy_auxiliary # @ingroup l1_geompy_auxiliary
def AddTexture(self, Width, Height, Texture, RowData=False): def AddTexture(self, Width, Height, Texture, RowData=False):