1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0029698: Regression vs 7.2.0: Common operation raises FLT_INVALID_OPERATION exception

When checking if the split edge is oriented as the original one (BOPTools_AlgoTools::IsSplitToReverse()) the tangent vectors should be computed for both edges at the same point. This point is taken on the split edge and projected on the original edge.
The fix is intended to ensuring that the reference point will be taken inside the valid range of the split edge (i.e. not covered by the tolerance spheres of its bounding vertices) and the projection of this point on the original edge will be successful. Moreover, several sampling points are now taken on the split edge and processed until first valid point is found.

If requested (by a not null pointer) all *BOPTools_AlgoTools::IsSplitToReverse()* methods are now return the error status of the check. Before using the returned flag, the calling program should check this error status. For successful check the error status should be equal to zero.

New warning *BOPAlgo_AlertUnableToOrientTheShape* is now returned in the algorithms in Boolean component in case the check for correct shape orientation failed.

Test case for the issue.
This commit is contained in:
emv
2018-04-16 15:21:35 +03:00
committed by abv
parent ea1114eb85
commit 80d55adf7c
15 changed files with 749 additions and 491 deletions

View File

@@ -42,19 +42,17 @@ public:
DEFINE_STANDARD_ALLOC
//! Compute P-Curve for the edge <aE> on the face <aF>.<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void BuildPCurveForEdgeOnFace(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
Standard_EXPORT static Standard_Boolean EdgeTangent (const TopoDS_Edge& anE, const Standard_Real aT, gp_Vec& Tau);
Standard_EXPORT static Standard_Boolean EdgeTangent(const TopoDS_Edge& anE,
const Standard_Real aT,
gp_Vec& Tau);
//! Compute surface parameters <U,V> of the face <aF>
//! for the point from the edge <aE> at parameter <aT>.<br>
@@ -62,24 +60,23 @@ public:
//! projection and can
//! raise exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Standard_Real aT,
Standard_Real& U,
Standard_Real& V,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void PointOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Standard_Real aT,
Standard_Real& U,
Standard_Real& V,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! If the P-Curve does not exist, build it using Make2D().<br>
//! [aToler] - reached tolerance
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void CurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! If the P-Curve does not exist, build it using Make2D().<br>
@@ -87,102 +84,108 @@ public:
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void CurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Returns TRUE if the edge <aE> has P-Curve <aC>
//! on surface <aF> .
//! [aFirst, aLast] - range of the P-Curve
//! [aToler] - reached tolerance
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
Standard_EXPORT static Standard_Boolean HasCurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler);
//! Returns TRUE if the edge <aE> has P-Curve <aC>
//! on surface <aF> .
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF);
Standard_EXPORT static Standard_Boolean HasCurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF);
//! Adjust P-Curve <theC2D> (3D-curve <theC3D>) on surface of the face <theF>.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
const Handle(Geom_Curve)& theC3D,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void AdjustPCurveOnFace(const TopoDS_Face& theF,
const Handle(Geom_Curve)& theC3D,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .<br>
//! [aT1, aT2] - range to adjust<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
const Standard_Real theFirst,
const Standard_Real theLast,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void AdjustPCurveOnFace(const TopoDS_Face& theF,
const Standard_Real theFirst,
const Standard_Real theLast,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
//! [aT1, aT2] - range to adjust
Standard_EXPORT static void AdjustPCurveOnSurf (const BRepAdaptor_Surface& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
Standard_EXPORT static void AdjustPCurveOnSurf(const BRepAdaptor_Surface& aF,
const Standard_Real aT1,
const Standard_Real aT2,
const Handle(Geom2d_Curve)& aC2D,
Handle(Geom2d_Curve)& aC2DA);
//! Compute intermediate value in between [aFirst, aLast] .
Standard_EXPORT static Standard_Real IntermediatePoint (const Standard_Real aFirst, const Standard_Real aLast);
Standard_EXPORT static Standard_Real IntermediatePoint(const Standard_Real aFirst,
const Standard_Real aLast);
//! Compute intermediate value of parameter for the edge <anE>.
Standard_EXPORT static Standard_Real IntermediatePoint (const TopoDS_Edge& anE);
Standard_EXPORT static Standard_Real IntermediatePoint(const TopoDS_Edge& anE);
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! [aFirst, aLast] - range of the P-Curve<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void Make2D(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void MakePCurveOnFace(const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
//! [aT1, aT2] - range to build<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
const Standard_Real aT1,
const Standard_Real aT2,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void MakePCurveOnFace(const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
const Standard_Real aT1,
const Standard_Real aT2,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Attach P-Curve from the edge <aEold> on surface <aF>
//! to the edge <aEnew>
//! Returns 0 in case of success
Standard_EXPORT static Standard_Integer AttachExistingPCurve (const TopoDS_Edge& aEold, const TopoDS_Edge& aEnew, const TopoDS_Face& aF, const Handle(IntTools_Context)& aCtx);
Standard_EXPORT static Standard_Integer AttachExistingPCurve(const TopoDS_Edge& aEold,
const TopoDS_Edge& aEnew,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& aCtx);
//! Checks if CurveOnSurface of theE on theF matches with isoline of theF surface.
//! Sets corresponding values for isTheUIso and isTheVIso variables.
@@ -199,25 +202,6 @@ public:
Standard_Boolean& isTheUIso,
Standard_Boolean& isTheVIso);
protected:
private:
};
#endif // _BOPTools_AlgoTools2D_HeaderFile