Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit overloads to loft #1717

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
32 changes: 31 additions & 1 deletion cadquery/occ_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -5654,7 +5684,7 @@ def _make_builder(cap):


@loft.register
def loft(
def _(
*s: Shape,
cap: bool = False,
ruled: bool = False,
Expand Down