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

OBJ file format for export #1739

Merged
merged 3 commits into from
Apr 3, 2023
Merged

OBJ file format for export #1739

merged 3 commits into from
Apr 3, 2023

Conversation

cchexcode
Copy link
Contributor

@cchexcode cchexcode commented Mar 31, 2023

I tested a few things using Forjot to create some shapes.
In order to export / import these I needed the OBJ format. That's what I added as export function here and thought you might be interested in having this native inside of the application.

The export uses a crate I built a few months / years ago (wavefront_rs). OBJ format is implemented. MTL format will follow.

@cchexcode cchexcode requested a review from hannobraun as a code owner March 31, 2023 23:25
@hannobraun
Copy link
Owner

Thank you for this pull request, @replicadse! I'm in a bit of a hurry right now, but I'll be able to take a closer look on Monday.

CI is failing though. Looks like the new error variant introduced an error in fj-app.

@cchexcode
Copy link
Contributor Author

Cool - yeah I saw that this morning. Fixing that error today.

@cchexcode
Copy link
Contributor Author

@hannobraun got the pipeline fixed now - lmk if you have questions

@hannobraun
Copy link
Owner

Nice! I'll review it tomorrow.

Copy link
Owner

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this pull request, @replicadse! Looks great!

One observation, if I export the test model as .obj and open the exported file in PrusaSlicer, it warns about open edges:
Screenshot from 2023-04-03 15-39-11

I'm not sure what that's about. I confirmed that it does not do that for 3MF or STL. For all I know it could be a bug in PrusaSlicer, or your library, or the code you submitted here (although I see nothing suspicious).

In any case, I'm going to merge this, as some .obj support is better than none 😄

If there indeed is a problem, we can address it later.

@hannobraun hannobraun merged commit 5605dd9 into hannobraun:main Apr 3, 2023
@cchexcode
Copy link
Contributor Author

Thanks @hannobraun I will check it out. I also plan to make some qol updates to the wavefront library incl materials support etc.
Will make a PR accordingly and check the edges stuff. Also, I think there's probably a more optimal solution to the export than giving every triangle it's own three points (index list / vertex list?).
Thanks!

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 this pull request may close these issues.

2 participants