From 781f64311fd4dc67ee1c1d3ba8f427140e36c8ef Mon Sep 17 00:00:00 2001 From: kshitij-maths Date: Wed, 3 Dec 2025 17:46:49 +0100 Subject: [PATCH 1/4] fix: adpat pythonocc api changes --- pygem/cad/cad_deformation.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pygem/cad/cad_deformation.py b/pygem/cad/cad_deformation.py index 3b3c5559..d76621e0 100644 --- a/pygem/cad/cad_deformation.py +++ b/pygem/cad/cad_deformation.py @@ -4,8 +4,8 @@ import os import numpy as np from itertools import product -from OCC.Core.TopoDS import (TopoDS_Shape, topods_Wire, TopoDS_Compound, - topods_Face, topods_Edge, TopoDS_Face, TopoDS_Wire) +from OCC.Core.TopoDS import (TopoDS_Shape, TopoDS_Wire, TopoDS_Compound, + TopoDS_Face, TopoDS_Edge, TopoDS_Face, TopoDS_Wire) from OCC.Core.BRep import BRep_Builder from OCC.Core.TopExp import TopExp_Explorer from OCC.Core.TopAbs import (TopAbs_EDGE, TopAbs_FACE, TopAbs_WIRE) @@ -87,7 +87,7 @@ def __init__(self, @staticmethod def read_shape(filename): """ - Static method to load the `topoDS_Shape` from a file. + Static method to load the `TopoDS_Shape` from a file. Supported extensions are: ".iges", ".step". :param str filename: the name of the file containing the geometry. @@ -126,7 +126,7 @@ def read_shape(filename): @staticmethod def write_shape(filename, shape): """ - Static method to save a `topoDS_Shape` object to a file. + Static method to save a `TopoDS_Shape` object to a file. Supported extensions are: ".iges", ".step". :param str filename: the name of the file where the shape will be saved. @@ -177,7 +177,7 @@ def _bspline_surface_from_face(self, face): if not isinstance(face, TopoDS_Face): raise TypeError("face must be a TopoDS_Face") # TopoDS_Face converted to Nurbs - nurbs_face = topods_Face(BRepBuilderAPI_NurbsConvert(face).Shape()) + nurbs_face = BRepBuilderAPI_NurbsConvert(face).Shape() # GeomSurface obtained from Nurbs face surface = BRep_Tool.Surface(nurbs_face) # surface is now further converted to a bspline surface @@ -203,7 +203,7 @@ def _bspline_curve_from_wire(self, wire): edge_explorer = TopExp_Explorer(wire, TopAbs_EDGE) while edge_explorer.More(): # getting the edge from the iterator - edge = topods_Edge(edge_explorer.Current()) + edge = edge_explorer.Current() # edge can be joined only if it is not degenerated (zero length) if BRep_Tool.Degenerated(edge): @@ -213,7 +213,7 @@ def _bspline_curve_from_wire(self, wire): # the edge must be converted to Nurbs edge nurbs_converter = BRepBuilderAPI_NurbsConvert(edge) nurbs_converter.Perform(edge) - nurbs_edge = topods_Edge(nurbs_converter.Shape()) + nurbs_edge = nurbs_converter.Shape() # here we extract the underlying curve from the Nurbs edge nurbs_curve = BRep_Tool_Curve(nurbs_edge)[0] @@ -381,7 +381,7 @@ def __call__(self, obj, dst=None): # performing some conversions to get the right # format (BSplineSurface) # TopoDS_Face obtained from iterator - face = topods_Face(faces_explorer.Current()) + face = faces_explorer.Current() # performing some conversions to get the right # format (BSplineSurface) bspline_surface = self._bspline_surface_from_face(face) @@ -411,7 +411,7 @@ def __call__(self, obj, dst=None): wire_explorer = TopExp_Explorer(face, TopAbs_WIRE) while wire_explorer.More(): # wire obtained from the iterator - wire = topods_Wire(wire_explorer.Current()) + wire = wire_explorer.Current() # getting a bpline curve joining all the edges of the wire composite_curve = self._bspline_curve_from_wire(wire) From 95f6a69b136c6795e337c0d7ecb3fe68aff4c22d Mon Sep 17 00:00:00 2001 From: kshitij-maths Date: Wed, 3 Dec 2025 17:49:00 +0100 Subject: [PATCH 2/4] changed: pythonocc-core=7.4.0 to pythonocc-core --- .github/workflows/testing_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing_pr.yml b/.github/workflows/testing_pr.yml index 244cf49f..80f5196b 100644 --- a/.github/workflows/testing_pr.yml +++ b/.github/workflows/testing_pr.yml @@ -28,7 +28,7 @@ jobs: - name: Installing packages shell: bash -el {0} run: | - conda install --yes -c conda-forge pythonocc-core=7.4.0 + conda install --yes -c conda-forge pythonocc-core python -m pip install --upgrade pip python -m pip install .[test] From ba0b979f472bd6de214aad3aac33c142cd49eb6c Mon Sep 17 00:00:00 2001 From: kshitij-maths Date: Wed, 3 Dec 2025 21:45:43 +0100 Subject: [PATCH 3/4] removed unused imports --- pygem/cad/cad_deformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygem/cad/cad_deformation.py b/pygem/cad/cad_deformation.py index d76621e0..b995aefc 100644 --- a/pygem/cad/cad_deformation.py +++ b/pygem/cad/cad_deformation.py @@ -5,7 +5,7 @@ import numpy as np from itertools import product from OCC.Core.TopoDS import (TopoDS_Shape, TopoDS_Wire, TopoDS_Compound, - TopoDS_Face, TopoDS_Edge, TopoDS_Face, TopoDS_Wire) + TopoDS_Face, TopoDS_Wire) from OCC.Core.BRep import BRep_Builder from OCC.Core.TopExp import TopExp_Explorer from OCC.Core.TopAbs import (TopAbs_EDGE, TopAbs_FACE, TopAbs_WIRE) From 363cfb049dcc15ff9c078fc0726837b5456accec Mon Sep 17 00:00:00 2001 From: kshitij-maths Date: Wed, 3 Dec 2025 21:54:52 +0100 Subject: [PATCH 4/4] removed duplicate import TopoDS_Wire --- pygem/cad/cad_deformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygem/cad/cad_deformation.py b/pygem/cad/cad_deformation.py index b995aefc..6448b96c 100644 --- a/pygem/cad/cad_deformation.py +++ b/pygem/cad/cad_deformation.py @@ -4,7 +4,7 @@ import os import numpy as np from itertools import product -from OCC.Core.TopoDS import (TopoDS_Shape, TopoDS_Wire, TopoDS_Compound, +from OCC.Core.TopoDS import (TopoDS_Shape, TopoDS_Compound, TopoDS_Face, TopoDS_Wire) from OCC.Core.BRep import BRep_Builder from OCC.Core.TopExp import TopExp_Explorer