if (theLineDirectionOk && t2 == GeomAbs_Line)
{
+ // Check that the accumulated deflection does not exceed the linear tolerance
Standard_Real aLast = (edge2.Orientation() == TopAbs_FORWARD) ?
ade2.LastParameter() : ade2.FirstParameter();
gp_Vec aCurV(theFirstPoint, ade2.Value(aLast));
Standard_Real aDD = theDirectionVec.CrossSquareMagnitude(aCurV);
if (aDD > theLinTol*theLinTol)
return Standard_False;
+
+ // Check that the accumulated angle does not exceed the angular tolerance.
+ // For symmetry, check the angle between vectors of:
+ // - first edge and resulting curve, and
+ // - the last edge and resulting curve.
+ if (theDirectionVec.Angle(aCurV) > theAngTol || Diff2.Angle(aCurV) > theAngTol)
+ return Standard_False;
}
return Standard_True;
--- /dev/null
+puts "========"
+puts "OCC29845:UnifySameDomain does not account the accumulated angle when unifying edges"
+puts "========"
+puts ""
+
+brestore [locate_data_file bug29845_wire.brep] w
+
+# set the linear deflection very high, so the unification
+# will be controlled by the angular deflection only.
+# with the angular deflection of 5 degrees the resulting
+# wire should preserve all the features of the original wire
+
+unifysamedom result w -t 10000 -a 5
+checkshape result
+checknbshapes result -vertex 77 -edge 77
+checkprops result -l 2805.11
+
+smallview +X+Z
+don result
+fit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png