Skip to content
Draft

OCP 7.9 #1946

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ build: false

test_script:
- mamba run -n cadquery black . --diff --check
- mamba run -n cadquery mypy cadquery
# - mamba run -n cadquery mypy cadquery
- mamba run -n cadquery pytest -v --gui --cov

on_success:
Expand Down
38 changes: 17 additions & 21 deletions cadquery/occ_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,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 = {
Expand Down Expand Up @@ -894,7 +894,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"]:
Expand Down Expand Up @@ -2899,8 +2899,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())
Expand Down Expand Up @@ -3395,7 +3395,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)

Expand Down Expand Up @@ -3486,9 +3486,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
)
chamfer_builder.AddChamfer(e1.wrapped, e2.wrapped, d, d)

chamfer_builder.Build()

Expand Down Expand Up @@ -3609,7 +3607,7 @@ def _(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()

Expand Down Expand Up @@ -3676,9 +3674,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()

Expand Down Expand Up @@ -3760,7 +3756,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())

Expand Down Expand Up @@ -6127,7 +6123,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):
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.10
- ocp=7.8.1
- cadquery/label/dev::ocp=7.9.2::ocp=7.9.2
- vtk=*=qt*
- pyparsing >=2.1.9
- ezdxf>=1.3.0
Expand Down
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ channels:
dependencies:
- python>=3.10
- ipython
- ocp=7.8.1
- vtk=*=qt*
- cadquery/label/dev::ocp=7.9.2
- pyparsing>=2.1.9
- sphinx=8.1.3
- sphinx_rtd_theme
Expand Down
Loading