Standard_Real tol0 = BRep_Tool::Tolerance(edge);
tol = tol0;
Standard_Real tol2 = tol*tol;
+ Standard_Boolean isChanged = Standard_False;
const Standard_Integer NCONTROL = 23;
for ( Standard_Integer i = 0; i < NCONTROL; i++ )
{
gp_Pnt pnt = crv->Value ( par );
gp_Pnt prj = ACS.Value( par );
Standard_Real dist = pnt.SquareDistance(prj);
- if ( tol2 < dist )
+ if ( tol2 < dist )
+ {
tol2 = dist;
+ isChanged = Standard_True;
+ }
}
- tol = 1.00005 * sqrt(tol2); // coeff: see trj3_pm1-ct-203.stp #19681, edge 10
- if ( tol >= tol0 )
+ if ( isChanged )
{
- B.UpdateEdge ( edge, tol );
- for ( TopoDS_Iterator itV(edge); itV.More(); itV.Next() )
+ tol = 1.00005 * sqrt(tol2); // coeff: see trj3_pm1-ct-203.stp #19681, edge 10
+ if ( tol >= tol0 )
{
- TopoDS_Shape S = itV.Value();
- B.UpdateVertex ( TopoDS::Vertex ( S ), tol );
+ B.UpdateEdge ( edge, tol );
+ for ( TopoDS_Iterator itV(edge); itV.More(); itV.Next() )
+ {
+ TopoDS_Shape S = itV.Value();
+ B.UpdateVertex ( TopoDS::Vertex ( S ), tol );
+ }
}
}
}
--- /dev/null
+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"
+}
\ No newline at end of file