mikedh / trimesh

Python library for loading and using triangular meshes.
https://trimesh.org
MIT License
3k stars 581 forks source link

Boolean intersection of a mesh with itself returns incorrect results when vertices are sufficiently large #2310

Open laurence-kobold opened 1 week ago

laurence-kobold commented 1 week ago

The following code prints one, as expected:

box = trimesh.creation.box(extents=[1,1,1])
box.apply_translation([1e4,1e4,1e4])
print(trimesh.boolean.intersection([box, box]).volume)

The following code prints zero, when it should also print one:

box = trimesh.creation.box(extents=[1,1,1])
box.apply_translation([1e5,1e5,1e5])
print(trimesh.boolean.intersection([box, box]).volume)

I used the manifold engine for the intersection operations

pca006132 commented 3 days ago

This is something manifold fixed upstream. We should wait until upstream publish a new release, hopefully soon.

laurence-kobold commented 3 days ago

@pca006132 thanks, do you have a link to the issue or PR for manifold?

pca006132 commented 3 days ago

@laurence-kobold https://github.com/elalish/manifold/pull/895