From c1073912adfd95ee0ffca1ea8a74d957c95035cd Mon Sep 17 00:00:00 2001 From: Michael Dawson-Haggerty Date: Wed, 7 Aug 2024 14:26:18 -0400 Subject: [PATCH] iterables don't have __len__ --- trimesh/boolean.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trimesh/boolean.py b/trimesh/boolean.py index 786e93bc0..05896097a 100644 --- a/trimesh/boolean.py +++ b/trimesh/boolean.py @@ -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 @@ -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. @@ -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. @@ -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. @@ -108,7 +108,7 @@ def intersection( def boolean_manifold( - meshes: Iterable, + meshes: Sequence, operation: str, check_volume: bool = True, **kwargs, @@ -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.