if (theLineDirectionOk && t2 == GeomAbs_Line)
{
- gp_Vec aCurV(theFirstPoint, BRep_Tool::Pnt(TopExp::LastVertex(edge2, Standard_True)));
+ 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;
if (aCur->DynamicType() != STANDARD_TYPE(Geom_Line))
return Standard_False;
- theFirstPoint = BRep_Tool::Pnt(TopExp::FirstVertex(theInpEdge, Standard_True));
- gp_Pnt aLP = BRep_Tool::Pnt(TopExp::LastVertex(theInpEdge, Standard_True));
+ if (theInpEdge.Orientation() == TopAbs_REVERSED) {
+ Standard_Real tmp = f;
+ f = l;
+ l = tmp;
+ }
+ theFirstPoint = aCur->Value(f);
+ gp_Pnt aLP = aCur->Value(l);
theDirectionVec = aLP.XYZ().Subtracted(theFirstPoint.XYZ());
theDirectionVec.Normalize();
return Standard_True;
checkshape result
-checknbshapes result -vertex 16 -edge 22 -wire 8 -face 8 -solid 1
+checknbshapes result -vertex 12 -edge 18 -wire 8 -face 8 -solid 1
checkprops result -s 223704 -v 3.27888e+006
checkview -display result -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "========"
+puts "OCC29544"
+puts "========"
+puts ""
+#################################################
+# Regression vs 7.2.0: ShapeUpgrade_UnifySameDomain fails to merge linear edges
+#################################################
+
+restore [locate_data_file bug29544_edges.brep] ce
+unifysamedom result ce
+
+checkshape result
+checkprops result -equal ce
+checknbshapes result -vertex 4 -edge 2
+
--- /dev/null
+puts "========"
+puts "OCC29544"
+puts "========"
+puts ""
+#################################################
+# Regression vs 7.2.0: ShapeUpgrade_UnifySameDomain fails to merge linear edges
+#################################################
+
+# create edge
+line l 0 0 0 1 0 0
+mkedge e l 0 10
+
+# split edge by the vertex
+vertex v 5 2.e-7 0
+bclearobjects
+bcleartools
+baddobjects e
+baddtools v
+bfillds
+bsplit sp
+
+# unify the splits of the edge
+unifysamedom result sp
+
+checkshape result
+checkprops result -l 10
+checknbshapes result -vertex 2 -edge 1