-
Notifications
You must be signed in to change notification settings - Fork 54
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
Is there a way to calculate the enclosed volume of a mesh? #124
Comments
From what I can understand, the bounding volume (aka "size") is determined by the 2 most outer diagonal corners of the mesh and a square volume is calculated. |
Yes, the size is the rectangular bounding volume, so it will be an overestimate in most cases |
So here is the pseudo-code for how the volume of enclosed meshes can be found using Swift. But RealityKit does not give access to the array of vertices and indices. Is this possible with Euclid? Just wanted your opinion before I start delving into how to gain access to this info.
|
Yes, Euclid trivially gives you this info - each Mesh has an array of polygons, and each polygon has an array of vertices. If you need triangles instead, there is a mesh.triangulate() method |
Great. I'm going to try to figure this out. I can submit a pull request once I'm done if you would like this feature. |
That would be very much appreciated - thank you! |
No description provided.
The text was updated successfully, but these errors were encountered: