-
Notifications
You must be signed in to change notification settings - Fork 9
Feature/add stl support #13
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
Feature/add stl support #13
Conversation
I was hesitant to submit as I see this will conflict with #9 once it's merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR! I am ready to merge it after my comments are addressed.
src/model.c
Outdated
|
||
// Read facet definitions, 50 bytes each, facet normal, 3 vertices, and a 2 byte spacer | ||
char buffer[50]; | ||
while(fread(buffer, sizeof(char), 50, fp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make sure that this call to fread
returns 50?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the previous
fread(facetCount, sizeof(int), 1, fp);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we successfully read some facet data but at some point fread fails to read the 50 bytes, should we output the error but display what we have processed, or just output the error and return null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just display an error, indicating the premature end of the file. Since it is unlikely that fread fails.
WARNING to WARN for consistent output Use type rather then expression sizeof as it will never change Output error if fread fails to read the facet count check fread reads all 50 bytes of facet data before processing Add note assuming little-endian hardware
Add warning that color is not supported if --color argument passed to stl import
Correct winding order
95640b5
to
bf605ac
Compare
Add support for binary and ASCII STL files