Skip to content

Commit bfd1522

Browse files
committed
fix: issue 285 and some deprecation from pythonocc
1 parent 95c7bdf commit bfd1522

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pygem/cad/cad_deformation.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
BRepBuilderAPI_MakeWire,
1515
BRepBuilderAPI_MakeEdge,
1616
BRepBuilderAPI_NurbsConvert)
17-
from OCC.Core.BRep import BRep_Tool, BRep_Tool_Curve
17+
from OCC.Core.BRep import BRep_Tool
1818
from OCC.Core.Geom import Geom_BSplineCurve, Geom_BSplineSurface
1919
from OCC.Core.GeomConvert import (geomconvert_SurfaceToBSplineSurface,
20-
geomconvert_CurveToBSplineCurve,
20+
geomconvert,
2121
GeomConvert_CompCurveToBSplineCurve)
2222
from OCC.Core.gp import gp_Pnt
23-
from OCC.Core.BRepTools import breptools_OuterWire
23+
from OCC.Core.BRepTools import breptools
2424
from OCC.Core.IFSelect import IFSelect_RetDone
2525
from OCC.Core.Interface import Interface_Static_SetCVal
2626
from OCC.Core.STEPControl import (STEPControl_Writer, STEPControl_Reader,
2727
STEPControl_AsIs)
2828
from OCC.Core.IGESControl import (IGESControl_Writer, IGESControl_Reader,
29-
IGESControl_Controller_Init)
29+
IGESControl_Controller)
3030

3131

3232
class CADDeformation():
@@ -138,7 +138,7 @@ def write_shape(filename, shape):
138138
"""
139139
def write_iges(filename, shape):
140140
""" IGES writer """
141-
IGESControl_Controller_Init()
141+
IGESControl_Controller.Init()
142142
writer = IGESControl_Writer()
143143
writer.AddShape(shape)
144144
writer.Write(filename)
@@ -181,7 +181,7 @@ def _bspline_surface_from_face(self, face):
181181
# GeomSurface obtained from Nurbs face
182182
surface = BRep_Tool.Surface(nurbs_face)
183183
# surface is now further converted to a bspline surface
184-
bspline_surface = geomconvert_SurfaceToBSplineSurface(surface)
184+
bspline_surface = geomconvert.SurfaceToBSplineSurface(surface)
185185
return bspline_surface
186186

187187
def _bspline_curve_from_wire(self, wire):
@@ -216,10 +216,10 @@ def _bspline_curve_from_wire(self, wire):
216216
nurbs_edge = nurbs_converter.Shape()
217217

218218
# here we extract the underlying curve from the Nurbs edge
219-
nurbs_curve = BRep_Tool_Curve(nurbs_edge)[0]
219+
nurbs_curve = BRep_Tool.Curve(nurbs_edge)[0]
220220

221221
# we convert the Nurbs curve to Bspline curve
222-
bspline_curve = geomconvert_CurveToBSplineCurve(nurbs_curve)
222+
bspline_curve = geomconvert.CurveToBSplineCurve(nurbs_curve)
223223

224224
# we can now add the Bspline curve to the composite wire curve
225225
composite_curve_builder.Add(bspline_curve, self.tolerance)
@@ -448,7 +448,7 @@ def __call__(self, obj, dst=None):
448448
# using the outer wire, and then we can trim it
449449
# with the wires corresponding to all the holes.
450450
# the wire order is important, in the trimming process
451-
if wire == breptools_OuterWire(face):
451+
if wire == breptools.OuterWire(face):
452452
outer_wires.append(modified_wire)
453453
else:
454454
inner_wires.append(modified_wire)

0 commit comments

Comments
 (0)