Closed manuel-koch closed 1 month ago
@mikedh Not sure if changes related to "difference" are ok, I stumbled over this too in my migration changes for v3.12 to v4.4.9.
Here the underlying boolean.difference()
will actually complain that only two instances can be "diff'ed", using more than two instances will raise an exception.
But maybe this is only a problem for the used manifold
engine.
Though Trimesh.difference()
still contains the type hint
other : trimesh.Trimesh, or list of trimesh.Trimesh objects
Meshes to difference
while in fact just a single "other" will actually work.
Good catch, I added a fix and test for multiple differences in https://github.com/mikedh/trimesh/commit/2d7185ef2ad7e138a671a8e2dd275b8676de6886
Upgraded trimesh from v3.12 to v4.4.9 in my setup.
Definition of
trimesh.base.Trimesh.union()
is using this arguments, where only a single "other" Trimesh can be combined ( this seems to be an interface change compare to v3.12 where multiple "other" instances were supported ):But docstring states that one or more Trimesh instances can be passed to it.
When I try to pass multiple "other" Trimesh instances to this
Trimesh.union()
( like it was working with v3.12 ), I now get an error like the following in the downstream call totrimesh.boolean.union()
, where themeshes
argument is now a list within a list, e.g.which triggers an error in the list comprehension inside
trimesh.boolean.union()
My question is: Where is the error ?
In the implementation of
trimesh.base.Trimesh.union()
( it should support multiple instances ) ?Or in the docstring ( it falsely states that multiple instances are supported, despite the single-instance-type-hint ) ? But downstream method
trimesh.boolean.union()
does support multiple instances.