Skip to content

Commit

Permalink
iterables don't have __len__
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Aug 7, 2024
1 parent 2331217 commit c107391
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions trimesh/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np

from . import exceptions, interfaces
from .typed import Callable, Iterable, Optional
from .typed import Callable, Optional, Sequence

try:
from manifold3d import Manifold, Mesh
Expand All @@ -18,7 +18,7 @@


def difference(
meshes: Iterable, engine: Optional[str] = None, check_volume: bool = True, **kwargs
meshes: Sequence, engine: Optional[str] = None, check_volume: bool = True, **kwargs
):
"""
Compute the boolean difference between a mesh an n other meshes.
Expand Down Expand Up @@ -48,7 +48,7 @@ def difference(


def union(
meshes: Iterable, engine: Optional[str] = None, check_volume: bool = True, **kwargs
meshes: Sequence, engine: Optional[str] = None, check_volume: bool = True, **kwargs
):
"""
Compute the boolean union between a mesh an n other meshes.
Expand Down Expand Up @@ -79,7 +79,7 @@ def union(


def intersection(
meshes: Iterable, engine: Optional[str] = None, check_volume: bool = True, **kwargs
meshes: Sequence, engine: Optional[str] = None, check_volume: bool = True, **kwargs
):
"""
Compute the boolean intersection between a mesh and other meshes.
Expand Down Expand Up @@ -108,7 +108,7 @@ def intersection(


def boolean_manifold(
meshes: Iterable,
meshes: Sequence,
operation: str,
check_volume: bool = True,
**kwargs,
Expand Down Expand Up @@ -165,10 +165,10 @@ def boolean_manifold(
return out_mesh


def reduce_cascade(operation: Callable, items: Iterable):
def reduce_cascade(operation: Callable, items: Sequence):
"""
Call an operation function in a cascaded pairwise way against a
flat iterable of items.
flat list of items.
This should produce the same result as `functools.reduce`
if `operation` is commutable like addition or multiplication.
Expand Down

0 comments on commit c107391

Please sign in to comment.