Skip to content

Commit

Permalink
use vtkmodules import instead of vtk (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrellenns authored Nov 8, 2021
1 parent 90d11ea commit 3581904
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 5 additions & 1 deletion cadquery/occ_impl/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
from OCP.TopLoc import TopLoc_Location
from OCP.Quantity import Quantity_ColorRGBA

from vtk import vtkActor, vtkPolyDataMapper as vtkMapper, vtkRenderer
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper as vtkMapper,
vtkRenderer,
)

from .geom import Location
from .shapes import Shape, Compound
Expand Down
3 changes: 2 additions & 1 deletion cadquery/occ_impl/exporters/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from tempfile import TemporaryDirectory
from shutil import make_archive

from vtk import vtkJSONSceneExporter, vtkRenderer, vtkRenderWindow, vtkVRMLExporter
from vtkmodules.vtkIOExport import vtkJSONSceneExporter, vtkVRMLExporter
from vtkmodules.vtkRenderingCore import vtkRenderer, vtkRenderWindow

from OCP.XSControl import XSControl_WorkSession
from OCP.STEPCAFControl import STEPCAFControl_Writer
Expand Down
2 changes: 1 addition & 1 deletion cadquery/occ_impl/exporters/vtk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from vtk import vtkXMLPolyDataWriter
from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter
from ..shapes import Shape


Expand Down
7 changes: 2 additions & 5 deletions cadquery/occ_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@

from io import BytesIO

from vtk import (
vtkPolyData,
vtkTriangleFilter,
vtkPolyDataNormals,
)
from vtkmodules.vtkCommonDataModel import vtkPolyData
from vtkmodules.vtkFiltersCore import vtkTriangleFilter, vtkPolyDataNormals

from .geom import Vector, BoundBox, Plane, Location, Matrix

Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ignore_missing_imports = True
[mypy-nlopt.*]
ignore_missing_imports = True

[mypy-vtk.*]
[mypy-vtkmodules.*]
ignore_missing_imports = True

[mypy-docutils.*]
Expand Down

0 comments on commit 3581904

Please sign in to comment.