mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0029780: [REGRESSION] Shape Healing - Operator FixShape failed with exception
Method ShapeFix_Wire::FixNotchedEdges() is corrected to handle the case of closed notched edges: on such edges split parameter may fall to wrong end of the curve due to projection.
This commit is contained in:
parent
cbaac5de6d
commit
258a844b63
@ -490,7 +490,7 @@ static unsigned int __stdcall CpuFunc (void * /*param*/)
|
|||||||
aTimer.Stop();
|
aTimer.Stop();
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
std::cout << "ERROR: CPU limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
std::cout << "Info: CPU limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -504,7 +504,7 @@ static unsigned int __stdcall CpuFunc (void * /*param*/)
|
|||||||
aTimer.Stop();
|
aTimer.Stop();
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
std::cout << "ERROR: Elapsed limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
std::cout << "Info: Elapsed limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3225,12 +3225,21 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges()
|
|||||||
Handle(Geom2d_Curve) c2d;
|
Handle(Geom2d_Curve) c2d;
|
||||||
Standard_Real a, b;
|
Standard_Real a, b;
|
||||||
sae.PCurve ( splitE, face, c2d, a, b, Standard_True );
|
sae.PCurve ( splitE, face, c2d, a, b, Standard_True );
|
||||||
Standard_Real ppar = (isRemoveFirst ? b : a);
|
|
||||||
ShapeBuild_Edge sbe;
|
ShapeBuild_Edge sbe;
|
||||||
TopAbs_Orientation orient = splitE.Orientation();
|
TopAbs_Orientation orient = splitE.Orientation();
|
||||||
if ( Abs(param - ppar) > ::Precision::PConfusion() ) {
|
|
||||||
//pdn perform splitting of the edge and adding to wire
|
|
||||||
|
|
||||||
|
// check whether the whole edges should be removed - this is the case
|
||||||
|
// when split point coincides with the end of the edge;
|
||||||
|
// for closed edges split point may fall at the other end (see issue #0029780)
|
||||||
|
if (Abs(param - (isRemoveFirst ? b : a)) <= ::Precision::PConfusion() ||
|
||||||
|
(sae.IsClosed3d(splitE) && Abs(param - (isRemoveFirst ? a : b)) <= ::Precision::PConfusion()))
|
||||||
|
{
|
||||||
|
FixDummySeam(n1);
|
||||||
|
// The seam edge is removed from the list. So, need to step back to avoid missing of edge processing
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
else // perform splitting of the edge and adding to wire
|
||||||
|
{
|
||||||
//pdn check if it is necessary
|
//pdn check if it is necessary
|
||||||
if( Abs((isRemoveFirst ? a : b)-param) < ::Precision::PConfusion() ) {
|
if( Abs((isRemoveFirst ? a : b)-param) < ::Precision::PConfusion() ) {
|
||||||
continue;
|
continue;
|
||||||
@ -3286,12 +3295,6 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges()
|
|||||||
FixDummySeam(isRemoveLast ? NbEdges() : toRemove);
|
FixDummySeam(isRemoveLast ? NbEdges() : toRemove);
|
||||||
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
|
myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
FixDummySeam(n1);
|
|
||||||
// The seam edge is removed from the list. So, need to step back to avoid missing of edge processing
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
|
|
||||||
i--;
|
i--;
|
||||||
if(!Context().IsNull()) //skl 07.03.2002 for OCC180
|
if(!Context().IsNull()) //skl 07.03.2002 for OCC180
|
||||||
|
10
tests/bugs/step/bug29780
Normal file
10
tests/bugs/step/bug29780
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
puts "========================"
|
||||||
|
puts "0029780 "
|
||||||
|
puts "========================"
|
||||||
|
|
||||||
|
|
||||||
|
stepread [locate_data_file bug29780.stp] a *
|
||||||
|
|
||||||
|
checkshape a_1
|
||||||
|
checknbshapes a_1 -shell 1 -face 244
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user