Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the slicing algorythm loops are in some edge case not correctly detected #2224

Closed
hit-the-luke opened this issue May 10, 2024 · 0 comments · Fixed by #2220
Closed

In the slicing algorythm loops are in some edge case not correctly detected #2224

hit-the-luke opened this issue May 10, 2024 · 0 comments · Fixed by #2220

Comments

@hit-the-luke
Copy link

Hi,

I had a real part where for a single slice the hole was not correctly detected. This is a simplifyed example:

`import numpy as np
import trimesh
import sys

vertices = np.array([[19.402250931139097, -14.88787016674277, 64.0], [20.03318396099334, -14.02738654377374, 64.0], [19.402250931139097, -14.88787016674277, 0.0], [20.03318396099334, -14.02738654377374, 0.0], [21, -16.5, 32]])
faces = np.array([[1, 3, 0], [0, 3, 2], [1, 0, 4], [0, 2, 4], [3,1,4], [2, 3, 4]])
z_layer_centers = (np.array([3, 3.0283334255218506]))

print('sys.version', sys.version)
print('sys.version_info', sys.version_info)
print('trimesh.version', trimesh.version)

mesh = trimesh.Trimesh(vertices=vertices, faces=faces)
res = mesh.section_multiplane(np.array([0, 0, 0]), np.array([0, 0, 1]), z_layer_centers)
print('the number of entities should for all paths be 1, as the 3d Body is a rather simple Pyramid')
for thing in res:
print(len(thing.entities))
res[1].show()`

I get this this Output:

sys.version 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
sys.version_info sys.version_info(major=3, minor=11, micro=6, releaselevel='final', serial=0)
trimesh.version 4.3.2
the number of entities should for all paths be 1, as the 3d Body is a rather simple Pyramid
1
3

To me it looks like a rounding error so two points are not recognized as the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant