#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
return iRet;
}
//
- aBB.SameRange(aE1, Standard_False);
- aBB.SameParameter(aE1, Standard_False);
- //
- aBB.UpdateEdge(aE1, aC2DT, aF, aTol);
- BRepLib::SameParameter(aE1);
- BRepLib::SameRange(aE1);
+ // create a temporary edge to make same parameter pcurve
+ TopoDS_Edge aE1T;
+ aBB.MakeEdge(aE1T, aCE1, aTol);
+ aBB.Range(aE1T, aT11, aT12);
+ aBB.SameRange(aE1T, Standard_False);
+ aBB.SameParameter(aE1T, Standard_False);
+ //
+ aBB.UpdateEdge(aE1T, aC2DT, aF, aTol);
+ try {
+ BRepLib::SameParameter(aE1T);
+ BRepLib::SameRange(aE1T);
+ }
+ catch (Standard_Failure)
+ {
+ iRet = 6;
+ return iRet;
+ }
//
bIsClosed = IsClosed(aE2, aF);
if (bIsClosed) {
- iRet = UpdateClosedPCurve(aE2, aE1, aF, aCtx);
+ iRet = UpdateClosedPCurve(aE2, aE1T, aF, aCtx);
if(iRet) {
iRet = 5;
+ return iRet;
}
}
- //
+ // transfer pcurve(s) from the temporary edge to the new edge
+ aBB.Transfert(aE1T, aE1);
+ // update tolerance of vertices
+ Standard_Real aNewTol = BRep_Tool::Tolerance(aE1T);
+ TopoDS_Iterator it(aE1);
+ for (; it.More(); it.Next())
+ aBB.UpdateVertex(TopoDS::Vertex(it.Value()), aNewTol);
return iRet;
}
//=======================================================================
--- /dev/null
+puts "========"
+puts "OCC28221"
+puts "========"
+puts ""
+#################################################
+# General Fuse operation error
+#################################################
+
+restore [locate_data_file bug28221_shape.brep] a
+
+explode a
+bclearobjects
+bcleartools
+baddobjects a_1
+baddtools a_2
+bfillds
+bbuild result
+
+checkshape result
+checknbshapes result -solid 10
+checkprops result -v 0.201442 -s 6.13063
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file