mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027035: General fuse algorithm loses face
The main reason of the bug is incorrect check, if the edge is seam-edge or not. In the fix it is determined with new methods in GeomLib class. The bug is fixed. Creation of test case for this fix Small correction in the code
This commit is contained in:
@@ -891,3 +891,39 @@ Standard_Real MaxToleranceEdge (const TopoDS_Face& aF)
|
||||
}
|
||||
return aTolMax;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsEdgeIsoline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools2D::IsEdgeIsoline( const TopoDS_Edge& theE,
|
||||
const TopoDS_Face& theF,
|
||||
Standard_Boolean& isTheUIso,
|
||||
Standard_Boolean& isTheVIso)
|
||||
{
|
||||
isTheUIso = isTheVIso = Standard_False;
|
||||
|
||||
gp_Vec2d aT;
|
||||
gp_Pnt2d aP;
|
||||
Standard_Real aFirst = 0.0, aLast = 0.0;
|
||||
const Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnSurface(theE, theF, aFirst, aLast);
|
||||
|
||||
aPC->D1(0.5*(aFirst+aLast), aP, aT);
|
||||
|
||||
const Standard_Real aSqMagn = aT.SquareMagnitude();
|
||||
if(aSqMagn <= gp::Resolution())
|
||||
return;
|
||||
|
||||
//Normalyze aT
|
||||
aT /= sqrt(aSqMagn);
|
||||
|
||||
//sin(da) ~ da, when da->0.
|
||||
const Standard_Real aTol = Precision::Angular();
|
||||
const gp_Vec2d aRefVDir(0.0, 1.0), aRefUDir(1.0, 0.0);
|
||||
|
||||
const Standard_Real aDPv = aT.CrossMagnitude(aRefVDir),
|
||||
aDPu = aT.CrossMagnitude(aRefUDir);
|
||||
|
||||
isTheUIso = (aDPv <= aTol);
|
||||
isTheVIso = (aDPu <= aTol);
|
||||
}
|
@@ -152,7 +152,20 @@ public:
|
||||
//! 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);
|
||||
|
||||
|
||||
//! Checks if CurveOnSurface of theE on theF matches with isoline of theF surface.
|
||||
//! Sets corresponding values for isTheUIso and isTheVIso variables.
|
||||
//! ATTENTION!!!
|
||||
//! This method is based on comparation between direction of
|
||||
//! surface (which theF is based on) iso-lines and the direction
|
||||
//! of the edge p-curve (on theF) in middle-point of the p-curve.
|
||||
//! This method should be used carefully
|
||||
//! (e.g. BRep_Tool::IsClosed(...) together) in order to
|
||||
//! avoid false classification some p-curves as isoline (e.g. circle
|
||||
//! on a plane).
|
||||
Standard_EXPORT static void IsEdgeIsoline(const TopoDS_Edge& theE,
|
||||
const TopoDS_Face& theF,
|
||||
Standard_Boolean& isTheUIso,
|
||||
Standard_Boolean& isTheVIso);
|
||||
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user