mikedh / trimesh

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

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

Open laurence-kobold opened 3 weeks ago

laurence-kobold commented 3 weeks 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 2 weeks ago

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

laurence-kobold commented 2 weeks ago

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

pca006132 commented 2 weeks ago

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

pca006132 commented 3 days ago

there is a new release now, I guess trimesh can update its dependency