From 927581caa51cb412aa4f823a1950ed93ac06cc9e Mon Sep 17 00:00:00 2001 From: AU Date: Sat, 30 Nov 2024 15:37:20 +0100 Subject: [PATCH 1/2] Add explicit overloads to loft --- cadquery/occ_impl/shapes.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index dc1ae574f..cb29c64e2 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -5561,6 +5561,36 @@ def _make_builder(): return _compound_or_shape(results) +@overload +def loft( + s: Sequence[Shape], + cap: bool = False, + ruled: bool = False, + continuity: Literal["C1", "C2", "C3"] = "C2", + parametrization: Literal["uniform", "chordal", "centripetal"] = "uniform", + degree: int = 3, + compat: bool = True, + smoothing: bool = False, + weights: Tuple[float, float, float] = (1, 1, 1), +) -> Shape: + ... + + +@overload +def loft( + *s: Shape, + cap: bool = False, + ruled: bool = False, + continuity: Literal["C1", "C2", "C3"] = "C2", + parametrization: Literal["uniform", "chordal", "centripetal"] = "uniform", + degree: int = 3, + compat: bool = True, + smoothing: bool = False, + weights: Tuple[float, float, float] = (1, 1, 1), +) -> Shape: + ... + + @multimethod def loft( s: Sequence[Shape], From 45638c007287f1bfd4fa9a45309338c0ade1cc17 Mon Sep 17 00:00:00 2001 From: AU Date: Sat, 30 Nov 2024 16:13:34 +0100 Subject: [PATCH 2/2] Partially fix mypy --- cadquery/occ_impl/shapes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index cb29c64e2..8c0a637bf 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -5684,7 +5684,7 @@ def _make_builder(cap): @loft.register -def loft( +def _( *s: Shape, cap: bool = False, ruled: bool = False,