mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0029544: Regression vs 7.2.0: ShapeUpgrade_UnifySameDomain fails to merge linear edges
When measuring the deviation of the end of the added edge from the resulting edge take the point on the curve, not from the vertex. Test cases for the issue.
This commit is contained in:
parent
410dd2c903
commit
06084bb8ec
@ -849,7 +849,9 @@ static Standard_Boolean IsMergingPossible(const TopoDS_Edge& edge1, const TopoDS
|
||||
|
||||
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;
|
||||
@ -876,8 +878,13 @@ static Standard_Boolean GetLineEdgePoints(const TopoDS_Edge& theInpEdge, gp_Pnt&
|
||||
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;
|
||||
|
@ -24,7 +24,7 @@ unifysamedom result r
|
||||
|
||||
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
|
||||
|
15
tests/bugs/modalg_7/bug29544_1
Normal file
15
tests/bugs/modalg_7/bug29544_1
Normal file
@ -0,0 +1,15 @@
|
||||
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
|
||||
|
27
tests/bugs/modalg_7/bug29544_2
Normal file
27
tests/bugs/modalg_7/bug29544_2
Normal file
@ -0,0 +1,27 @@
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user