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] diff --git a/pygem/cad/cad_deformation.py b/pygem/cad/cad_deformation.py index 3b3c5559..6448b96c 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_Compound, + 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)