+ aHatcher.RemHatching(aIx);
+ return iErr;
+}
+diff --git a/src/BRepFill/BRepFill_Pipe.cxx b/src/BRepFill/BRepFill_Pipe.cxx
+index 7eda5c1..63e3824 100755
+--- a/src/BRepFill/BRepFill_Pipe.cxx
++++ b/src/BRepFill/BRepFill_Pipe.cxx
+@@ -823,13 +823,7 @@ TopoDS_Shape BRepFill_Pipe::ShareFaces
+ anExp.Init(myFaces->Value(ii, jj), TopAbs_EDGE);
+
+ for (; anExp.More(); anExp.Next()) {
+- if (aMapBndEdgeIndex.IsBound(anExp.Current())) {
+- // This is not boundary edge. Remove it.
+- aMapBndEdgeIndex.UnBind(anExp.Current());
+- } else {
+- // Add boundary edge.
+- aMapBndEdgeIndex.Bind(anExp.Current(), ii);
+- }
++ aMapBndEdgeIndex.Bind(anExp.Current(), ii);
+ }
+ }
+
+diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx
+index f9ceeca..d1fbf4b 100755
+--- a/src/BRepFill/BRepFill_Sweep.cxx
++++ b/src/BRepFill/BRepFill_Sweep.cxx
+@@ -2042,143 +2042,141 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
+ Standard_Boolean exuv, singu, singv;
+ Handle(Geom_Surface) S;
+
+- if (! vclose) {
+- // (2.0) return preexisting Edges and vertices
+- TopoDS_Edge E;
+- if (! FirstShape.IsNull() && (IFirst==1)) {
+- mySec->Init(FirstShape);
+- for (isec=1; isec<=NbLaw; isec++) {
+- E = mySec->CurrentEdge();
+- VEdge(isec, 1) = E;
+- if (E.Orientation() == TopAbs_REVERSED)
+- Vertex(isec+1, 1) = TopExp::FirstVertex(E);
+- else
+- Vertex(isec+1, 1) = TopExp::LastVertex(E);
+- UpdateVertex(IFirst-1, isec+1,
+- TabErr(isec, 1), Vi(1), Vertex(isec+1, 1));
+- }
+- if (VEdge(1, 1).Orientation() == TopAbs_REVERSED)
+- Vertex(1, 1) = TopExp::LastVertex(TopoDS::Edge(VEdge(1, 1)));
+- else
+- Vertex(1, 1) = TopExp::FirstVertex(TopoDS::Edge(VEdge(1, 1)));
+- UpdateVertex(IFirst-1, 1,
+- TabErr(1, 1), Vi(1), Vertex(1, 1));
+- }
+- else { // Otherwise construct vertices
+- Standard_Real u, v, aux;
+- Standard_Boolean ureverse;
+- for (isec=1; isec<=NbLaw+1; isec++) {
+- // Return data
+- if (isec >NbLaw) {
+- S = TabS(NbLaw, 1);
+- ureverse = UReverse(NbLaw, 1);
+- exuv = ExchUV(NbLaw, 1);
+- }
+- else {
+- S = TabS(isec, 1);
+- ureverse = UReverse(isec, 1);
+- exuv = ExchUV(isec, 1);
+- }
+- S->Bounds(UFirst, ULast, VFirst, VLast);
+-
+- // Choice of parameters
+- if (ureverse) {
+- if (exuv) {
+- aux = VFirst; VFirst = VLast; VLast = aux;
+- }
+- else {
+- aux = UFirst; UFirst = ULast; ULast = aux;
+- }
+- }
+- if (isec!= NbLaw+1) {
+- u = UFirst;
+- v = VFirst;
+- }
+- else {
+- if (exuv) {
+- u = UFirst;
+- v = VLast;
+- }
+- else {
+- u = ULast;
+- v = VFirst;
+- }
+- }
+-
+- // construction of vertices
+- B.MakeVertex(TopoDS::Vertex(Vertex(isec, 1)),
+- S->Value(u,v),
+- mySec->VertexTol(isec-1,Vi(1)));
++ // (2.0) return preexisting Edges and vertices
++ TopoDS_Edge E;
++ if (! FirstShape.IsNull() && (IFirst==1)) {
++ mySec->Init(FirstShape);
++ for (isec=1; isec<=NbLaw; isec++) {
++ E = mySec->CurrentEdge();
++ VEdge(isec, 1) = E;
++ if (E.Orientation() == TopAbs_REVERSED)
++ Vertex(isec+1, 1) = TopExp::FirstVertex(E);
++ else
++ Vertex(isec+1, 1) = TopExp::LastVertex(E);
++ UpdateVertex(IFirst-1, isec+1,
++ TabErr(isec, 1), Vi(1), Vertex(isec+1, 1));
++ }
++ if (VEdge(1, 1).Orientation() == TopAbs_REVERSED)
++ Vertex(1, 1) = TopExp::LastVertex(TopoDS::Edge(VEdge(1, 1)));
++ else
++ Vertex(1, 1) = TopExp::FirstVertex(TopoDS::Edge(VEdge(1, 1)));
++ UpdateVertex(IFirst-1, 1,
++ TabErr(1, 1), Vi(1), Vertex(1, 1));
++ }
++ else { // Otherwise construct vertices
++ Standard_Real u, v, aux;
++ Standard_Boolean ureverse;
++ for (isec=1; isec<=NbLaw+1; isec++) {
++ // Return data
++ if (isec >NbLaw) {
++ S = TabS(NbLaw, 1);
++ ureverse = UReverse(NbLaw, 1);
++ exuv = ExchUV(NbLaw, 1);
+ }
+- }
++ else {
++ S = TabS(isec, 1);
++ ureverse = UReverse(isec, 1);
++ exuv = ExchUV(isec, 1);
++ }
++ S->Bounds(UFirst, ULast, VFirst, VLast);
+
+- if (! LastShape.IsNull() && (ILast==myLoc->NbLaw()+1) ) {
+- mySec->Init(LastShape);
+- for (isec=1; isec<=NbLaw; isec++) {
+- E = mySec->CurrentEdge();
+- VEdge(isec, NbPath+1) = E;
+- if (E.Orientation() == TopAbs_REVERSED)
+- Vertex(isec+1, NbPath+1) = TopExp::FirstVertex(E);
+- else
+- Vertex(isec+1, NbPath+1) = TopExp::LastVertex(E);
+- UpdateVertex(ILast-1, isec+1, TabErr(isec, NbPath),
+- Vi(NbPath+1), Vertex(isec+1, NbPath+1));
++ // Choice of parameters
++ if (ureverse) {
++ if (exuv) {
++ aux = VFirst; VFirst = VLast; VLast = aux;
++ }
++ else {
++ aux = UFirst; UFirst = ULast; ULast = aux;
++ }
++ }
++ if (isec!= NbLaw+1) {
++ u = UFirst;
++ v = VFirst;
++ }
++ else {
++ if (exuv) {
++ u = UFirst;
++ v = VLast;
++ }
++ else {
++ u = ULast;
++ v = VFirst;
++ }
+ }
+- if (VEdge(1, NbPath+1).Orientation() == TopAbs_REVERSED)
+- Vertex(1, NbPath+1) =
+- TopExp::LastVertex(TopoDS::Edge(VEdge(1, NbPath+1)));
+- else
+- Vertex(1, NbPath+1) =
+- TopExp::FirstVertex(TopoDS::Edge(VEdge(1, NbPath+1)));
+- UpdateVertex(ILast-1, 1,
+- TabErr(1, NbPath), Vi(NbPath+1), Vertex(1, NbPath+1 ));
+- }
+- else {
+- Standard_Real u, v, aux;
+- Standard_Boolean ureverse;
+- for (isec=1; isec<=NbLaw+1; isec++) {
+- // Return data
+- if (isec >NbLaw) {
+- S = TabS(NbLaw, NbPath);
+- ureverse = UReverse(NbLaw, NbPath);
+- exuv = ExchUV(NbLaw, NbPath);
+- }
+- else {
+- S = TabS(isec, NbPath);
+- ureverse = UReverse(isec, NbPath);
+- exuv = ExchUV(isec, NbPath);
+- }
+- S->Bounds(UFirst, ULast, VFirst, VLast);
+
+- // Choice of parametres
+- if (ureverse) {
+- if (exuv) {
+- aux = VFirst; VFirst = VLast; VLast = aux;
+- }
+- else {
+- aux = UFirst; UFirst = ULast; ULast = aux;
+- }
+- }
+- if (isec == NbLaw+1) {
+- u = ULast;
+- v = VLast;
+- }
+- else {
+- if (exuv) {
+- u = ULast;
+- v = VFirst;
+- }
+- else {
+- u = UFirst;
+- v = VLast;
+- }
+- }
++ // construction of vertices
++ B.MakeVertex(TopoDS::Vertex(Vertex(isec, 1)),
++ S->Value(u,v),
++ mySec->VertexTol(isec-1,Vi(1)));
++ }
++ }
+
+- // construction of vertex
+- B.MakeVertex(TopoDS::Vertex(Vertex(isec, NbPath+1)),
+- S->Value(u,v),
+- mySec->VertexTol(isec-1, Vi(NbPath+1)));
++ if (! LastShape.IsNull() && (ILast==myLoc->NbLaw()+1) ) {
++ mySec->Init(LastShape);
++ for (isec=1; isec<=NbLaw; isec++) {
++ E = mySec->CurrentEdge();
++ VEdge(isec, NbPath+1) = E;
++ if (E.Orientation() == TopAbs_REVERSED)
++ Vertex(isec+1, NbPath+1) = TopExp::FirstVertex(E);
++ else
++ Vertex(isec+1, NbPath+1) = TopExp::LastVertex(E);
++ UpdateVertex(ILast-1, isec+1, TabErr(isec, NbPath),
++ Vi(NbPath+1), Vertex(isec+1, NbPath+1));
++ }
++ if (VEdge(1, NbPath+1).Orientation() == TopAbs_REVERSED)
++ Vertex(1, NbPath+1) =
++ TopExp::LastVertex(TopoDS::Edge(VEdge(1, NbPath+1)));
++ else
++ Vertex(1, NbPath+1) =
++ TopExp::FirstVertex(TopoDS::Edge(VEdge(1, NbPath+1)));
++ UpdateVertex(ILast-1, 1,
++ TabErr(1, NbPath), Vi(NbPath+1), Vertex(1, NbPath+1 ));
++ }
++ else {
++ Standard_Real u, v, aux;
++ Standard_Boolean ureverse;
++ for (isec=1; isec<=NbLaw+1; isec++) {
++ // Return data
++ if (isec >NbLaw) {
++ S = TabS(NbLaw, NbPath);
++ ureverse = UReverse(NbLaw, NbPath);
++ exuv = ExchUV(NbLaw, NbPath);
+ }
++ else {
++ S = TabS(isec, NbPath);
++ ureverse = UReverse(isec, NbPath);
++ exuv = ExchUV(isec, NbPath);
++ }
++ S->Bounds(UFirst, ULast, VFirst, VLast);
++
++ // Choice of parametres
++ if (ureverse) {
++ if (exuv) {
++ aux = VFirst; VFirst = VLast; VLast = aux;
++ }
++ else {
++ aux = UFirst; UFirst = ULast; ULast = aux;
++ }
++ }
++ if (isec == NbLaw+1) {
++ u = ULast;
++ v = VLast;
++ }
++ else {
++ if (exuv) {
++ u = ULast;
++ v = VFirst;
++ }
++ else {
++ u = UFirst;
++ v = VLast;
++ }
++ }
++
++ // construction of vertex
++ B.MakeVertex(TopoDS::Vertex(Vertex(isec, NbPath+1)),
++ S->Value(u,v),
++ mySec->VertexTol(isec-1, Vi(NbPath+1)));
+ }
+ }
+
diff --git a/src/Draft/Draft_Modification.cxx b/src/Draft/Draft_Modification.cxx
index e72fe8d..6033694 100755
--- a/src/Draft/Draft_Modification.cxx
+set square 6.51574
+
+set 2dviewer 1
+diff --git a/tests/bugs/modalg/bug23903 b/tests/bugs/modalg/bug23903
+new file mode 100644
+index 0000000..f5c3f76
+--- /dev/null
++++ b/tests/bugs/modalg/bug23903
+@@ -0,0 +1,21 @@
++puts "========"
++puts "OCC23903"
++puts "========"
++########################################################
++# Invalid result of pipe operation on closed path
++########################################################
++
++restore [locate_data_file bug23903_base.brep] sh
++restore [locate_data_file bug23903_path.brep] w
++pipe result w sh
++set info [explode result f]
++set checklen [llength $info]
++
++if { $checklen != 3 } {
++ puts "Error : The shape doesn't contain 3 faces"
++} else {
++ puts "OK : The shape contains 3 faces"
++}
++
++set 2dviewer 0
++
diff --git a/tests/draft/angle/E5 b/tests/draft/angle/E5
old mode 100644
new mode 100755
#old file ofs9
restore [locate_data_file CHE_bb9.rle] s
-diff -Naur --exclude=CVS OCCT-6.5.4_SRC.orig/src/Draw/Draw_Window.cxx OCCT-6.5.4_SRC.patch/src/Draw/Draw_Window.cxx
---- OCCT-6.5.4_SRC.orig/src/Draw/Draw_Window.cxx 2012-11-15 18:00:13.000000000 +0400
-+++ OCCT-6.5.4_SRC.patch/src/Draw/Draw_Window.cxx 2013-02-22 18:57:28.000000000 +0400
-@@ -84,7 +84,11 @@
+diff --git a/src/Draw/Draw_Window.cxx b/src/Draw/Draw_Window.cxx
+index 03a6a78..b4e27df 100755
+--- a/src/Draw/Draw_Window.cxx
++++ b/src/Draw/Draw_Window.cxx
+@@ -84,7 +84,11 @@ defaultPrompt:
errChannel = Tcl_GetStdChannel(TCL_STDERR);
if (code != TCL_OK) {
if (errChannel) {
Tcl_Write(errChannel, "\n", 1);
}
Tcl_AddErrorInfo(Interp,
-@@ -1055,7 +1059,11 @@
+@@ -1055,7 +1059,11 @@ Standard_Boolean Init_Appli()
mainWindow =
Tk_MainWindow(interp) ;
if (mainWindow == NULL) {
exit(1);
}
Tk_Name(mainWindow) =
-@@ -2061,7 +2069,11 @@
+@@ -2061,7 +2069,11 @@ static DWORD WINAPI tkLoop(VOID)
Standard_Integer res = Tk_Init (interp);
if (res != TCL_OK)
{
}
}
catch (Standard_Failure)
-@@ -2072,7 +2084,11 @@
+@@ -2072,7 +2084,11 @@ static DWORD WINAPI tkLoop(VOID)
mainWindow = Tk_MainWindow (interp);
if (mainWindow == NULL)
{