mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Merge pull request #858 from jdegenstein/ocp781_minimal_changes
Minimal changes to support OCP >= 7.8 in gumy/build123d@ocp781
This commit is contained in:
commit
65f37ab441
2 changed files with 6 additions and 18 deletions
|
|
@ -35,7 +35,7 @@ classifiers = [
|
|||
]
|
||||
|
||||
dependencies = [
|
||||
"cadquery-ocp >= 7.7.0",
|
||||
"cadquery-ocp >= 7.8.1",
|
||||
"typing_extensions >= 4.6.0, <5",
|
||||
"numpy >= 2, <3",
|
||||
"svgpathtools >= 1.5.1, <2",
|
||||
|
|
|
|||
|
|
@ -167,7 +167,6 @@ if TYPE_CHECKING: # pragma: no cover
|
|||
from .composite import Compound # pylint: disable=R0801
|
||||
from build123d.build_part import BuildPart # pylint: disable=R0801
|
||||
|
||||
HASH_CODE_MAX = 2147483647
|
||||
Shapes = Literal["Vertex", "Edge", "Wire", "Face", "Shell", "Solid", "Compound"]
|
||||
TrimmingTool = Union[Plane, "Shell", "Face"]
|
||||
TOPODS = TypeVar("TOPODS", bound=TopoDS_Shape)
|
||||
|
|
@ -805,8 +804,10 @@ class Shape(NodeMixin, Generic[TOPODS]):
|
|||
return NotImplemented
|
||||
|
||||
def __hash__(self) -> int:
|
||||
"""Return has code"""
|
||||
return self.hash_code()
|
||||
"""Return hash code"""
|
||||
if self.wrapped is None:
|
||||
return 0
|
||||
return hash(self.wrapped)
|
||||
|
||||
def __rmul__(self, other):
|
||||
"""right multiply for positioning operator *"""
|
||||
|
|
@ -1181,19 +1182,6 @@ class Shape(NodeMixin, Generic[TOPODS]):
|
|||
self.__class__.cast(s) for s in get_top_level_topods_shapes(self.wrapped)
|
||||
)
|
||||
|
||||
def hash_code(self) -> int:
|
||||
"""Returns a hashed value denoting this shape. It is computed from the
|
||||
TShape and the Location. The Orientation is not used.
|
||||
|
||||
Args:
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
if self.wrapped is None:
|
||||
return 0
|
||||
return self.wrapped.HashCode(HASH_CODE_MAX)
|
||||
|
||||
def intersect(
|
||||
self, *to_intersect: Shape | Axis | Plane
|
||||
) -> None | Self | ShapeList[Self]:
|
||||
|
|
@ -2852,7 +2840,7 @@ def _topods_entities(shape: TopoDS_Shape, topo_type: Shapes) -> list[TopoDS_Shap
|
|||
|
||||
while explorer.More():
|
||||
item = explorer.Current()
|
||||
out[item.HashCode(HASH_CODE_MAX)] = (
|
||||
out[hash(item)] = (
|
||||
item # needed to avoid pseudo-duplicate entities
|
||||
)
|
||||
explorer.Next()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue