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

3MF import from FreeCAD fails #8401

Closed
2 tasks done
JohnOCFII opened this issue Jun 13, 2022 · 2 comments
Closed
2 tasks done

3MF import from FreeCAD fails #8401

JohnOCFII opened this issue Jun 13, 2022 · 2 comments

Comments

@JohnOCFII
Copy link

Description of the bug

FreeCAD has recently added 3MF export in version 0.20. When attempting to open a 3MF file exported from FreeCAD in PrusaSlicer 2.4.2, the import appears to fail silently. There are no error messages, and no object shows on the build area (or anywhere in space when zoomed out).

It is quite possible the 3MF file isn't in the format that PrusaSlicer is looking for (Fusion 360 also has issues with it) but Fusion 360 does at least display an error. Oddly, Blender 3.2 (with a community add-in) can open the file successfully.

I've opened a thread in the FreeCAD forum: https://forum.freecadweb.org/viewtopic.php?p=601749#p601749

but also wanted to open a ticket here, as a) someone familiar with the 3MF import might readily spot an error, and b) if the file IS in error, PrusaSlicer would ideally display an error message.

Project file & How to reproduce

I've attached a zip file with the following:

  • Narrow Hose Adapter-3MF-Test.3mf - the import file that fails
  • Narrow Hose Adapter-AMF-Test.amf - an AMF import that succeeds but places model at 0,0 not centered on bed
  • Narrow Hose Adapter-STL-Test.stl - an STL import that works as expected
  • Narrow Hose Adapter-PS-Exported-3MF.3mf - a 3MF file saved AFTER importing as STL and saving as 3MF from PrusaSlicer
  • TestProjectSaved.3mf - a 3MF file saved from PrusaSlicer after attempting to import the 3MF (and seeing no indication of success or failure)
  • Narrow Hose Adapter.FCStd - the FreeCAD design file in case you wish to load FreeCAD and test exporting it yourself

Test by attempting to import the Narrow Hose Adapter-3MF-Test.3mf file. Others are added as additional supporting info.
ImportTests.zip

Screen Shot 2022-06-13 at 4 08 09 PM

Checklist of files included above

  • Project file
  • Screenshot

Version of PrusaSlicer

Version 2.4.2+arm64

Operating system

macOS 12.4 Monterey

Printer model

Prusa MK3S+ MMU2S Single Mode

@rtyr
Copy link
Collaborator

rtyr commented Jun 14, 2022

Provided 3MF file (generated from non-stable FreeCAD version) has an incorrect format, please report the issue to FreeCAD developers.

This is the content of the 3MF file, the slash shouldn't be there.
3mf

We will add some error message for such cases. Closing.

@JohnOCFII
Copy link
Author

Thanks for the analysis and adding an error message. This issue was opened with FreeCAD yesterday, and they've now submitted the fix regarding the leading \ as indicated above.

lukasmatena added a commit that referenced this issue Feb 9, 2024
The crash was introduced in 040a846, which completely threw away handling of the return value
of the importer.load_model_from_file function and replaced it with weaker condition. The purpose
of that change was to solve #8401 (missing error message when loading different invalid 3MF).

This commit reverts that change (and reintroduces #8401). Handling of 3MF loading errors
should be inside the importer.load_model_from_file function, where the check should be
added later.
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