Mantis issue 0021432: EDF GEOM: Faces with huge tolerance can be built in GEOM.

This commit is contained in:
jfa 2012-04-17 10:22:51 +00:00
parent d25a037763
commit 9e220a72d5

View File

@ -2882,8 +2882,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a face on the given wire. ## Create a face on the given wire.
# @param theWire closed Wire or Edge to build the face on. # @param theWire closed Wire or Edge to build the face on.
# @param isPlanarWanted If TRUE, only planar face will be built. # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
# If impossible, NULL object will be returned. # If the tolerance of the obtained planar face is less
# than 1e-06, this face will be returned, otherwise the
# algorithm tries to build any suitable face on the given
# wire and prints a warning message.
# @return New GEOM.GEOM_Object, containing the created face. # @return New GEOM.GEOM_Object, containing the created face.
# #
# @ref tui_creation_face "Example" # @ref tui_creation_face "Example"
@ -2893,27 +2896,30 @@ class geompyDC(GEOM._objref_GEOM_Gen):
Parameters: Parameters:
theWire closed Wire or Edge to build the face on. theWire closed Wire or Edge to build the face on.
isPlanarWanted If TRUE, only planar face will be built. isPlanarWanted If TRUE, the algorithm tries to build a planar face.
If impossible, NULL object will be returned. If the tolerance of the obtained planar face is less
than 1e-06, this face will be returned, otherwise the
algorithm tries to build any suitable face on the given
wire and prints a warning message.
Returns: Returns:
New GEOM.GEOM_Object, containing the created face. New GEOM.GEOM_Object, containing the created face.
""" """
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted) anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
if anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG": if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
if os.getenv("GEOM_MAKEFACE_ALLOW_NONPLANAR") is not None: print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
else:
RaiseIfFailed("MakeFace", self.ShapesOp)
else: else:
RaiseIfFailed("MakeFace", self.ShapesOp) RaiseIfFailed("MakeFace", self.ShapesOp)
return anObj return anObj
## Create a face on the given wires set. ## Create a face on the given wires set.
# @param theWires List of closed wires or edges to build the face on. # @param theWires List of closed wires or edges to build the face on.
# @param isPlanarWanted If TRUE, only planar face will be built. # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
# If impossible, NULL object will be returned. # If the tolerance of the obtained planar face is less
# than 1e-06, this face will be returned, otherwise the
# algorithm tries to build any suitable face on the given
# wire and prints a warning message.
# @return New GEOM.GEOM_Object, containing the created face. # @return New GEOM.GEOM_Object, containing the created face.
# #
# @ref tui_creation_face "Example" # @ref tui_creation_face "Example"
@ -2923,19 +2929,19 @@ class geompyDC(GEOM._objref_GEOM_Gen):
Parameters: Parameters:
theWires List of closed wires or edges to build the face on. theWires List of closed wires or edges to build the face on.
isPlanarWanted If TRUE, only planar face will be built. isPlanarWanted If TRUE, the algorithm tries to build a planar face.
If impossible, NULL object will be returned. If the tolerance of the obtained planar face is less
than 1e-06, this face will be returned, otherwise the
algorithm tries to build any suitable face on the given
wire and prints a warning message.
Returns: Returns:
New GEOM.GEOM_Object, containing the created face. New GEOM.GEOM_Object, containing the created face.
""" """
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted) anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
if anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG": if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
if os.getenv("GEOM_MAKEFACE_ALLOW_NONPLANAR") is not None: print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
else:
RaiseIfFailed("MakeFace", self.ShapesOp)
else: else:
RaiseIfFailed("MakeFaceWires", self.ShapesOp) RaiseIfFailed("MakeFaceWires", self.ShapesOp)
return anObj return anObj