From adbdf194e0154bc783f9eb45fbd7afe7f7cbdc7a Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 6 Feb 2024 21:41:15 +0100 Subject: [PATCH 1/4] fix Powell-Sabin split --- libsrc/meshing/hprefinement.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/hprefinement.cpp b/libsrc/meshing/hprefinement.cpp index 0446f25b..384eaab3 100644 --- a/libsrc/meshing/hprefinement.cpp +++ b/libsrc/meshing/hprefinement.cpp @@ -699,6 +699,8 @@ namespace netgen { INDEX_2 i2(el.pnums[hprs->splitedges[j][0]-1], el.pnums[hprs->splitedges[j][1]-1]); + if (fac1 == 0.5) i2.Sort(); + if (!newpts.Used (i2)) { Point<3> np; @@ -787,7 +789,8 @@ namespace netgen { INDEX_2 i2(el.pnums[hprs->splitedges[j][0]-1], el.pnums[hprs->splitedges[j][1]-1]); - + if (fac1 == 0.5) i2.Sort(); + int npi = newpts.Get(i2); newpnums[hprs->splitedges[j][2]-1] = npi; @@ -1990,8 +1993,11 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE & edges, INDEX_2_HAS } case HP_SEGM: { - hpel.type = ClassifySegm(hpel, edges, edgepoint_dom, cornerpoint, edgepoint, - faces, face_edges, surf_edges, facepoint); + if (split == SPLIT_HP) + hpel.type = ClassifySegm(hpel, edges, edgepoint_dom, cornerpoint, edgepoint, + faces, face_edges, surf_edges, facepoint); + else if (split == SPLIT_POWELL) + hpel.type = HP_SEGM_SINGCORNERL; dd = 1; break; } From 282c3e5c0a5b6759df3f2b0b9a76b852ded581ae Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 7 Feb 2024 15:05:03 +0100 Subject: [PATCH 2/4] fix glued point in sphere (was removed by compress) --- libsrc/meshing/meshclass.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 70eff530..e735bac9 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -4043,6 +4043,9 @@ namespace netgen pused[seg[j]] = true; } + for(auto& pe : pointelements) + pused[pe.pnum] = true; + for (int i = 0; i < openelements.Size(); i++) { const Element2d & el = openelements[i]; @@ -4129,6 +4132,9 @@ namespace netgen seg[j] = op2np[seg[j]]; } + for(auto& pe : pointelements) + pe.pnum = op2np[pe.pnum]; + for (int i = 1; i <= openelements.Size(); i++) { Element2d & el = openelements.Elem(i); From 0fab0ec1eb4d69f6bf61f6c60b0ee9e8c76740b9 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Thu, 8 Feb 2024 14:57:56 +0100 Subject: [PATCH 3/4] dont reverse wire in offset This works with this change: ``` MoveTo(0,0).LineTo(1,1).Finish().Offset(0.2).Face() ``` --- libsrc/occ/python_occ_shapes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 6908fe5f..05785370 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -641,7 +641,7 @@ public: BRepOffsetAPI_MakeOffset builder(makeFace.Face()); builder.Perform(d); auto shape = builder.Shape(); - wires.push_back (TopoDS::Wire(shape.Reversed())); + wires.push_back (TopoDS::Wire(shape)); return shared_from_this(); } From 000424f001d0d19d58ee41cc0edf5dedd29f6905 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Thu, 8 Feb 2024 15:08:49 +0100 Subject: [PATCH 4/4] offset should always be called no a finished line --- libsrc/occ/python_occ_shapes.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 05785370..9c50261c 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -631,6 +631,7 @@ public: auto Offset(double d) { + Finish(); TopoDS_Wire wire = wires.back(); wires.pop_back();