diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 540729da2..49f2ab667 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -357,14 +357,14 @@ inverse_shape_LUT = {v: k for k, v in shape_LUT.items()} downcast_LUT = { - ta.TopAbs_VERTEX: TopoDS.Vertex_s, - ta.TopAbs_EDGE: TopoDS.Edge_s, - ta.TopAbs_WIRE: TopoDS.Wire_s, - ta.TopAbs_FACE: TopoDS.Face_s, - ta.TopAbs_SHELL: TopoDS.Shell_s, - ta.TopAbs_SOLID: TopoDS.Solid_s, - ta.TopAbs_COMPSOLID: TopoDS.CompSolid_s, - ta.TopAbs_COMPOUND: TopoDS.Compound_s, + ta.TopAbs_VERTEX: TopoDS.Vertex, + ta.TopAbs_EDGE: TopoDS.Edge, + ta.TopAbs_WIRE: TopoDS.Wire, + ta.TopAbs_FACE: TopoDS.Face, + ta.TopAbs_SHELL: TopoDS.Shell, + ta.TopAbs_SOLID: TopoDS.Solid, + ta.TopAbs_COMPSOLID: TopoDS.CompSolid, + ta.TopAbs_COMPOUND: TopoDS.Compound, } geom_LUT = { @@ -895,7 +895,7 @@ def Edges(self) -> List["Edge"]: return [ Edge(i) for i in self._entities("Edge") - if not BRep_Tool.Degenerated_s(TopoDS.Edge_s(i)) + if not BRep_Tool.Degenerated_s(TopoDS.Edge(i)) ] def Compounds(self) -> List["Compound"]: @@ -2902,8 +2902,8 @@ def stitch(self, other: "Wire") -> "Wire": """Attempt to stitch wires""" wire_builder = BRepBuilderAPI_MakeWire() - wire_builder.Add(TopoDS.Wire_s(self.wrapped)) - wire_builder.Add(TopoDS.Wire_s(other.wrapped)) + wire_builder.Add(TopoDS.Wire(self.wrapped)) + wire_builder.Add(TopoDS.Wire(other.wrapped)) wire_builder.Build() return self.__class__(wire_builder.Wire()) @@ -3398,7 +3398,7 @@ def makeFromWires(cls, outerWire: Wire, innerWires: List[Wire] = []) -> "Face": # fix outer wire sf_s = ShapeFix_Shape(outerWire.wrapped) sf_s.Perform() - wo = TopoDS.Wire_s(sf_s.Shape()) + wo = TopoDS.Wire(sf_s.Shape()) face_builder = BRepBuilderAPI_MakeFace(wo, True) @@ -3490,7 +3490,7 @@ def chamfer2D(self, d: float, vertices: Iterable[Vertex]) -> "Face": e1, e2 = edges chamfer_builder.AddChamfer( - TopoDS.Edge_s(e1.wrapped), TopoDS.Edge_s(e2.wrapped), d, d + tcast(TopoDS_Edge, e1.wrapped), tcast(TopoDS_Edge, e2.wrapped), d, d ) chamfer_builder.Build() @@ -3612,7 +3612,7 @@ def trim(self, outer: Wire, *inner: Wire) -> Self: bldr = BRepBuilderAPI_MakeFace(self._geomAdaptor(), outer.wrapped) for w in inner: - bldr.Add(TopoDS.Wire_s(w.wrapped)) + bldr.Add(TopoDS.Wire(w.wrapped)) return self.__class__(bldr.Face()).fix() @@ -3679,9 +3679,7 @@ def addHole(self, *inner: Wire | Edge) -> Self: bldr = BRepBuilderAPI_MakeFace(self.wrapped) for w in inner: - bldr.Add( - TopoDS.Wire_s(w.wrapped if isinstance(w, Wire) else wire(w).wrapped) - ) + bldr.Add(TopoDS.Wire(w.wrapped if isinstance(w, Wire) else wire(w).wrapped)) return self.__class__(bldr.Face()).fix() @@ -3763,7 +3761,7 @@ def chamfer( for e in nativeEdges: face = edge_face_map.FindFromKey(e).First() chamfer_builder.Add( - d1, d2, e, TopoDS.Face_s(face) + d1, d2, e, TopoDS.Face(face) ) # NB: edge_face_map return a generic TopoDS_Shape return self.__class__(chamfer_builder.Shape()) @@ -6107,7 +6105,7 @@ def cap( for e in _get_edges(s): f = _get_one(e.ancestors(ctx, "Face"), "Face") - builder.Add(e.wrapped, f.wrapped, GeomAbs_G2, True) + builder.Add(e.wrapped, f.wrapped, GeomAbs_Shape.GeomAbs_G1, True) for c in constraints: if isinstance(c, Shape): diff --git a/conda/meta.yaml b/conda/meta.yaml index 68761b45c..561dc7061 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -16,8 +16,7 @@ requirements: - setuptools run: - python >=3.10 - - ocp=7.8.1 - - vtk=*=qt* + - ocp=7.9.3.1 - pyparsing >=3.0.0 - ezdxf>=1.3.0 - ipython diff --git a/environment.yml b/environment.yml index 590179b13..927b056bc 100644 --- a/environment.yml +++ b/environment.yml @@ -4,8 +4,8 @@ channels: dependencies: - python>=3.10 - ipython - - ocp=7.8.1 - - vtk=*=qt* +# - cadquery/label/dev::ocp=x.x.x for dev + - ocp=7.9.3.1 - pyparsing>=3.0.0 - sphinx=9.1.0 # - sphinx_rtd_theme=3.1.0 diff --git a/setup.py b/setup.py index 2bcbf98fd..17667cf42 100644 --- a/setup.py +++ b/setup.py @@ -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.8.1,<7.9", + "cadquery-ocp>=7.9.3.1,<8.0", "ezdxf>=1.3.0", "multimethod>=1.11,<2.0", "nlopt>=2.9.0,<3.0",