Skip to content

Commit

Permalink
Try OCP 7.8.1 (#1589)
Browse files Browse the repository at this point in the history
* Try OCP 7.8.1

* Update meta.yaml

* Fix hash

* Update vis.py

* Update vis.py

* Update appveyor.yml

* Run only tests/test_exporters.py

* Fix pytest invocation

* typo fix

* Reenable all tests

* Reenable mypy

* Skip mypy again

* Use released ocp

* Reenable mypy

* mypy fixes/workarounds for vtk

* Update setup.py fro 7.8.1
  • Loading branch information
adam-urbanczyk authored Jan 18, 2025
1 parent b8370dd commit d1e4cb6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions cadquery/occ_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@
Real = Union[float, int]

TOLERANCE = 1e-6
HASH_CODE_MAX = 2147483647 # max 32bit signed int, required by OCC.Core.HashCode

shape_LUT = {
ta.TopAbs_VERTEX: "Vertex",
Expand Down Expand Up @@ -596,7 +595,7 @@ def hashCode(self) -> int:
Returns a hashed value denoting this shape. It is computed from the
TShape and the Location. The Orientation is not used.
"""
return self.wrapped.HashCode(HASH_CODE_MAX)
return hash(self.wrapped)

def isNull(self) -> bool:
"""
Expand Down
8 changes: 4 additions & 4 deletions cadquery/vis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from . import Shape, Workplane, Assembly, Sketch, Compound, Color, Vector, Location
from .occ_impl.assembly import _loc2vtk, toVTK

from typing import Union, Any, List, Tuple
from typing import Union, Any, List, Tuple, Iterable, cast

from typish import instance_of

Expand Down Expand Up @@ -121,7 +121,7 @@ def _to_vtk_pts(
return rv


def _to_vtk_axs(locs: List[Location], scale: float = 0.1) -> vtkActor:
def _to_vtk_axs(locs: List[Location], scale: float = 0.1) -> vtkAssembly:
"""
Convert Locations to vtkActor.
"""
Expand Down Expand Up @@ -175,7 +175,7 @@ def show(
win.AddRenderer(renderer)

# get renderer and actor
for act in renderer.GetActors():
for act in cast(Iterable[vtkActor], renderer.GetActors()):

propt = act.GetProperty()

Expand Down Expand Up @@ -241,7 +241,7 @@ def show(
inter.Initialize()

w, h = win.GetScreenSize()
win.SetSize((w // 2, h // 2))
win.SetSize(w // 2, h // 2)
win.SetPosition(-10, 0)

# show and return
Expand Down
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirements:
- setuptools
run:
- python >=3.9
- ocp 7.7.2
- cadquery/label/dev::ocp=7.8.1
- vtk=*=qt*
- pyparsing >=2.1.9
- ezdxf>=1.3.0
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
dependencies:
- python>=3.9,<=3.12
- ipython
- ocp=7.7.2
- ocp=7.8.1
- vtk=*=qt*
- pyparsing>=2.1.9
- sphinx=8.1.3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Only include the installation dependencies if we are not running on RTD or AppVeyor or in a conda env
if not is_rtd and not is_appveyor and not is_azure and not is_conda:
reqs = [
"cadquery-ocp>=7.7.0,<7.8",
"cadquery-ocp>=7.8.1,<7.9",
"ezdxf>=1.3.0",
"multimethod>=1.11,<2.0",
"nlopt>=2.9.0,<3.0",
Expand Down

0 comments on commit d1e4cb6

Please sign in to comment.