Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual vtk903 + occt76 migration #51

Closed
wants to merge 7 commits into from

Conversation

Tobias-Fischer
Copy link
Contributor

@Tobias-Fischer Tobias-Fischer commented Nov 15, 2021

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

For some reason the bot fails to create the PR - let's try manually.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@Tobias-Fischer
Copy link
Contributor Author

@conda-forge-admin, please rerender

@Tobias-Fischer
Copy link
Contributor Author

It might be that the bot fails because the source isn't properly specified in the recipe - Is there a reason for this hack?

@Tobias-Fischer
Copy link
Contributor Author

@Tobias-Fischer
Copy link
Contributor Author

@conda-forge-admin, please rerender

@Tobias-Fischer Tobias-Fischer changed the title Manual vtk903 migration Manual vtk903 + occt76 migration Nov 17, 2021
@looooo
Copy link
Contributor

looooo commented Nov 17, 2021

@trelau any plans to support occt7.6?

@trelau
Copy link

trelau commented Nov 17, 2021

@trelau any plans to support occt7.6?

yes. right now (i think) i'm close to getting pyOCCT going on OSX, so i'd like to finish that. Then circle back and start updating things (SMESH and pyOCCT) to OCCT 7.6.

@basnijholt
Copy link

@trelau, any idea what I could do to make it work?

Why do you target such an old version of nglib?

I have opened #54 but run into the exact same problem as @Tobias-Fischer.

@trelau
Copy link

trelau commented Dec 10, 2021

Why do you target such an old version of nglib?

I try to use the same version of Netgen that Salome SMESH is targeting. It looks like they are starting to prepare to move to Netgen 6+, but until officially do I expect to continue to support the same version. In the past I did had Netgen 6.2 working, but it required significant rework every time there was a new release of Salome, so I figured if Netgen 5.3 was good enough for them it's good enough for me (and so far I think that's been true).

@basnijholt
Copy link

That's clear :-)

Just FYI, in order to support OCCT 7.6, Netgen had the following commit and patch (08993ae5) (≈5 years later than the current version.:

commit 08993ae5e2b687e6c21d045b0a9a3f7e8722f17d
Author: Joachim Schoeberl <joachim.schoeberl@tuwien.ac.at>
Date:   Tue Aug 31 00:37:41 2021 +0200

    fixes for OCCT 7.6.0-dev

diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp
index ef5e969a..0e86714a 100644
--- a/libsrc/occ/occgenmesh.cpp
+++ b/libsrc/occ/occgenmesh.cpp
@@ -1236,9 +1236,13 @@ namespace netgen

                 for (int k = 1; k <=3; k++)
                   {
-                    int n = triangulation->Triangles()(j)(k);
-                    p[k-1] = triangulation->Nodes()(n).Transformed(loc);
-                    par[k-1] = triangulation->UVNodes()(n);
+                    // int n = triangulation->Triangles()(j)(k);^M
+                    // p[k-1] = triangulation->Nodes()(n).Transformed(loc);^M
+                    // par[k-1] = triangulation->UVNodes()(n);^M
+                    // fix for OCC7.6.0-dev^M
+                    int n = triangulation->Triangle(j)(k);^M
+                    p[k-1] = triangulation->Node(n).Transformed(loc);^M
+                    par[k-1] = triangulation->UVNode(n);^M
                   }

                 //double maxside = 0;
diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp
index ddcd75f2..f589400d 100644
--- a/libsrc/occ/python_occ_shapes.cpp
+++ b/libsrc/occ/python_occ_shapes.cpp
@@ -104,14 +104,14 @@ void ExtractEdgeData( const TopoDS_Edge & edge, int index, std::vector<double> *

     int nbnodes = poly -> NbNodes();
     for (int j = 1; j < nbnodes; j++)
-    {
-        auto p0 = occ2ng((T -> Nodes())(poly->Nodes()(j)).Transformed(loc));
-        auto p1 = occ2ng((T -> Nodes())(poly->Nodes()(j+1)).Transformed(loc));
+      {
+        auto p0 = occ2ng((T -> Node(poly->Node(j))).Transformed(loc));
+        auto p1 = occ2ng((T -> Node(poly->Node(j+1))).Transformed(loc));
         for(auto k : Range(3))
-        {
+          {
             p[0].push_back(p0[k]);
             p[1].push_back(p1[k]);
-        }
+          }
         p[0].push_back(index);
         p[1].push_back(index);
         box.Add(p0);
@@ -138,15 +138,15 @@ void ExtractFaceData( const TopoDS_Face & face, int index, std::vector<double> *
     int ntriangles = triangulation -> NbTriangles();
     for (int j = 1; j <= ntriangles; j++)
     {
-        Poly_Triangle triangle = (triangulation -> Triangles())(j);
+      Poly_Triangle triangle = triangulation -> Triangle(j);
         std::array<Point<3>,3> pts;
         std::array<Vec<3>,3> normals;
         for (int k = 0; k < 3; k++)
-            pts[k] = occ2ng( (triangulation -> Nodes())(triangle(k+1)).Transformed(loc) );
+          pts[k] = occ2ng( (triangulation -> Node(triangle(k+1))).Transformed(loc) );

         for (int k = 0; k < 3; k++)
         {
-            auto uv = (triangulation -> UVNodes())(triangle(k+1));
+          auto uv = triangulation -> UVNode(triangle(k+1));
             prop.SetParameters (uv.X(), uv.Y());
             if (!prop.IsNormalDefined())
                 throw Exception("No normal defined on face");
@@ -1011,11 +1011,10 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
            Array< std::array<Point<3>,3> > triangles;
            for (int j = 1; j <= ntriangles; j++)
              {
-               Poly_Triangle triangle = (triangulation -> Triangles())(j);
+               Poly_Triangle triangle = triangulation -> Triangle(j);
                std::array<Point<3>,3> pts;
                for (int k = 0; k < 3; k++)
-                 pts[k] = occ2ng( (triangulation -> Nodes())(triangle(k+1)).Transformed(loc) );
-
+                 pts[k] = occ2ng( (triangulation -> Node(triangle(k+1))).Transformed(loc) );
                triangles.Append ( pts );
              }

diff --git a/libsrc/occ/vsocc.cpp b/libsrc/occ/vsocc.cpp
index 4d806006..da741dd9 100644
--- a/libsrc/occ/vsocc.cpp
+++ b/libsrc/occ/vsocc.cpp
@@ -463,8 +463,9 @@ namespace netgen
          glBegin (GL_LINE_STRIP);
          for (int j = 1; j <= nbnodes; j++)
          {
-            gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
-            glVertex3f (p.X(), p.Y(), p.Z());
+           // gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
+           gp_Pnt p = (T -> Node(aEdgePoly->Nodes()(j))).Transformed(aEdgeLoc);
+           glVertex3f (p.X(), p.Y(), p.Z());
          }
          glEnd ();
       }
@@ -509,10 +510,11 @@ namespace netgen
          int nbnodes = aEdgePoly -> NbNodes();
          glBegin (GL_LINE_STRIP);
          for (int j = 1; j <= nbnodes; j++)
-         {
-            gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
-            glVertex3f (p.X(), p.Y(), p.Z());
-         }
+           {
+             // gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
+             gp_Pnt p = (T -> Node(aEdgePoly->Node(j))).Transformed(aEdgeLoc);
+             glVertex3f (p.X(), p.Y(), p.Z());
+           }
          glEnd ();
       }

@@ -582,18 +584,18 @@ namespace netgen
          gp_Vec n;

          glBegin (GL_TRIANGLES);
-
          int ntriangles = triangulation -> NbTriangles();
          for (int j = 1; j <= ntriangles; j++)
          {
-            Poly_Triangle triangle = (triangulation -> Triangles())(j);
+           Poly_Triangle triangle = (triangulation -> Triangle(j));
             gp_Pnt p[3];
             for (int k = 1; k <= 3; k++)
-            p[k-1] = (triangulation -> Nodes())(triangle(k)).Transformed(loc);
+              p[k-1] = (triangulation -> Node(triangle(k))).Transformed(loc);

             for (int k = 1; k <= 3; k++)
             {
-               uv = (triangulation -> UVNodes())(triangle(k));
+              // uv = (triangulation -> UVNodes())(triangle(k));
+              uv = triangulation -> UVNode(triangle(k));
                prop.SetParameters (uv.X(), uv.Y());

                //            surf->D0 (uv.X(), uv.Y(), pnt);

@basnijholt
Copy link

basnijholt commented Dec 10, 2021

Also, unfortunately, FreeCAD can't get updates anymore because all the latest builds use VTK 9.1.0 and OCCT 7.6. Therefore I have to conda-forge/vtk-feedstock#227.

See the conflicts on https://conda-forge.org/status/#other_migrations:
image

@looooo
Copy link
Contributor

looooo commented Apr 30, 2022

vtk9.1 in #55, occt7.6 patch in trelau/SMESH#54

@looooo looooo closed this Apr 30, 2022
@Tobias-Fischer Tobias-Fischer deleted the patch-1 branch April 30, 2022 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants