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

Volume not working for STLs with holes/floating parts #1

Open
ToofastTurnip opened this issue Sep 20, 2022 · 3 comments
Open

Volume not working for STLs with holes/floating parts #1

ToofastTurnip opened this issue Sep 20, 2022 · 3 comments

Comments

@ToofastTurnip
Copy link

Like the title says, I was trying to use stl-parser to measure the volume of an stl file that was generated from a milling simulation (meaning we're talking about a part with rough edges and many imperfections, not a perfect file for 3d printing) and I'm getting Volume: 0.000cm^3 for the volume measurement.

@squancy
Copy link
Owner

squancy commented Sep 20, 2022

Could you send me the STL file that you are trying to use as an input to the parser? It may be corrupted or does not determine a closed form.

As it is written in the description:

The volume is calculated as the sum of the signed volumes of the tetrahedrons from a given point in space, thus it returns a correct value for STL files with arbitrary complexity. There may be certain edge cases when a few triangles overlap or the STL does determine a closed form in space. In this case an incorrect result may be returned since there is no error checking on triangles.

Also, note that the volume calculation is dependent on the order of the vertices listed in the file (right-hand rule) and no error checking is done when it's not the case. When an STL is given as a parameter such that the order of the vertices does not follow the specification an incorrect volume (and perhaps price) may be returned without any warning.

@ToofastTurnip
Copy link
Author

Sure, but github doesn't allow me to attach an STL file to an issue. Can I send it to the email listed on your github? [email protected]

@squancy
Copy link
Owner

squancy commented Sep 22, 2022 via email

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

No branches or pull requests

2 participants