mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0028601: ShapeFix_Shape increases tolerance of sub-shapes of a valid shape
- Avoid increase of edge/vertex tolerance if the distance between 3D curve and p-curve is within old tolerance.
This commit is contained in:
parent
ec96437207
commit
0af424c23c
@ -210,6 +210,7 @@ Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape,
|
|||||||
Standard_Real tol0 = BRep_Tool::Tolerance(edge);
|
Standard_Real tol0 = BRep_Tool::Tolerance(edge);
|
||||||
tol = tol0;
|
tol = tol0;
|
||||||
Standard_Real tol2 = tol*tol;
|
Standard_Real tol2 = tol*tol;
|
||||||
|
Standard_Boolean isChanged = Standard_False;
|
||||||
const Standard_Integer NCONTROL = 23;
|
const Standard_Integer NCONTROL = 23;
|
||||||
for ( Standard_Integer i = 0; i < NCONTROL; i++ )
|
for ( Standard_Integer i = 0; i < NCONTROL; i++ )
|
||||||
{
|
{
|
||||||
@ -217,17 +218,23 @@ Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape,
|
|||||||
gp_Pnt pnt = crv->Value ( par );
|
gp_Pnt pnt = crv->Value ( par );
|
||||||
gp_Pnt prj = ACS.Value( par );
|
gp_Pnt prj = ACS.Value( par );
|
||||||
Standard_Real dist = pnt.SquareDistance(prj);
|
Standard_Real dist = pnt.SquareDistance(prj);
|
||||||
if ( tol2 < dist )
|
if ( tol2 < dist )
|
||||||
tol2 = dist;
|
|
||||||
}
|
|
||||||
tol = 1.00005 * sqrt(tol2); // coeff: see trj3_pm1-ct-203.stp #19681, edge 10
|
|
||||||
if ( tol >= tol0 )
|
|
||||||
{
|
|
||||||
B.UpdateEdge ( edge, tol );
|
|
||||||
for ( TopoDS_Iterator itV(edge); itV.More(); itV.Next() )
|
|
||||||
{
|
{
|
||||||
TopoDS_Shape S = itV.Value();
|
tol2 = dist;
|
||||||
B.UpdateVertex ( TopoDS::Vertex ( S ), tol );
|
isChanged = Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isChanged )
|
||||||
|
{
|
||||||
|
tol = 1.00005 * sqrt(tol2); // coeff: see trj3_pm1-ct-203.stp #19681, edge 10
|
||||||
|
if ( tol >= tol0 )
|
||||||
|
{
|
||||||
|
B.UpdateEdge ( edge, tol );
|
||||||
|
for ( TopoDS_Iterator itV(edge); itV.More(); itV.Next() )
|
||||||
|
{
|
||||||
|
TopoDS_Shape S = itV.Value();
|
||||||
|
B.UpdateVertex ( TopoDS::Vertex ( S ), tol );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
puts "TODO OCC12345 ALL: Error : Tolerance invalid. Function FixShape works WRONGLY"
|
|
||||||
|
|
||||||
puts "========================"
|
puts "========================"
|
||||||
puts " OCC329 "
|
puts " OCC329 "
|
||||||
puts "========================"
|
puts "========================"
|
||||||
|
21
tests/bugs/modalg_6/bug28601
Normal file
21
tests/bugs/modalg_6/bug28601
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28601"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
###################################################################
|
||||||
|
# ShapeFix_Shape increases tolerance of sub-shapes of a valid shape
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
box b 10 10 10
|
||||||
|
set tol_before [checkmaxtol b]
|
||||||
|
fixshape b1 b
|
||||||
|
set tol_after [checkmaxtol b1]
|
||||||
|
|
||||||
|
puts "MAX tolerance shape before fixshape : $tol_before"
|
||||||
|
puts "MAX tolerance shape after fixshape : $tol_after"
|
||||||
|
|
||||||
|
if { ${tol_after} > ${tol_before} } {
|
||||||
|
puts "Error: Export /Import cause increasing tolerances of shape"
|
||||||
|
} else {
|
||||||
|
puts "Export /Import does not cause increasing tolerances of shape"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user