mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0024924: ShapeFix_SplitTool doesn't verify the new range after cutting an edge
Validate the new cut range before setting it to edge
This commit is contained in:
parent
16a1f26537
commit
c471a1ba18
@ -32,6 +32,7 @@
|
|||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Wire.hxx>
|
#include <TopoDS_Wire.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <ShapeAnalysis_Curve.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -238,8 +239,29 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge &edge,
|
|||||||
if( Abs(Abs(a-b)-aRange) < Precision::PConfusion() ) return Standard_False;
|
if( Abs(Abs(a-b)-aRange) < Precision::PConfusion() ) return Standard_False;
|
||||||
if( aRange<10.*Precision::PConfusion() ) return Standard_False;
|
if( aRange<10.*Precision::PConfusion() ) return Standard_False;
|
||||||
|
|
||||||
|
Handle(Geom_Curve) c = BRep_Tool::Curve(edge, a, b);
|
||||||
|
ShapeAnalysis_Curve sac;
|
||||||
|
a = Min(pend,cut);
|
||||||
|
b = Max(pend,cut);
|
||||||
|
Standard_Real na = a, nb = b;
|
||||||
|
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
B.Range( edge, Min(pend,cut), Max(pend,cut) );
|
if (!BRep_Tool::Degenerated(edge) && !c.IsNull() && sac.ValidateRange(c, na, nb, Precision::PConfusion()) && (na != a || nb != b) )
|
||||||
|
{
|
||||||
|
B.Range( edge, na, nb, Standard_True );
|
||||||
|
ShapeAnalysis_Edge sae;
|
||||||
|
if(sae.HasPCurve(edge,face))
|
||||||
|
{
|
||||||
|
B.SameRange(edge,Standard_False);
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapeFix_Edge sfe;
|
||||||
|
sfe.FixSameParameter(edge);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
B.Range( edge, a, b, Standard_False );
|
||||||
|
}
|
||||||
|
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user