prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.6k stars 1.91k forks source link

3mf file parse error #11999

Open trivalik opened 7 months ago

trivalik commented 7 months ago

Description of the bug

Import a 3mf file created from freecad 0.21.1 fails with:

Error (Invalid 3MF format) while parsing '3D/3dmodel.model' at line 2115

The line 2115 is the item tag:

 <build>
  <item objectid="1" transform="1 0 0 0 1 0 0 0 1 0 0 0" />
 </build>

Cura read this part without problems. I am not sure wether the bad position in a corner counts here.

Part: FanDuctStd22-FanDuctStd.zip

Project file & How to reproduce

File -> Import -> first entry for 3mf and select FanDuctStd22-FanDuctStd.3mf.

Checklist of files included above

Version of PrusaSlicer

2.7.1 from dff602be63fb11bd6f566a4b54bb9423cc324d00

Operating system

Windows 10

Printer model

anet A6

Jony01 commented 7 months ago

Issue is made by using object type=surface, which is curently NOT supported. The setting of transformation for uknown object caused an error during import. I agree that message is missleading and will be fixed in future.

To fix your 3mf: Set object type to value model (in "FanDuctStd22-FanDuctStd.3mf\3D\3dmodel.model" on line 5) FanDuctStd22-FanDuctStd.zip

smirgol commented 1 month ago

I'm having a similar issue with this model: https://www.printables.com/model/932644-ariane-6/files

Opening it in Prusa Slicer 2.8.0 I get the following error:

[2024-07-10 11:17:53.625931] [0x000073bde11c6c80] [error]   Found component with invalid object id
[2024-07-10 11:17:53.625944] [0x000073bde11c6c80] [error]   Error (Invalid 3MF format) while parsing '3D/3dmodel.model' at line 34
[2024-07-10 11:17:53.625951] [0x000073bde11c6c80] [error]   Archive does not contain a valid model

The suggested fix doesn't work for me, as the object type already is model. Looking at the file header, it looks like it was exported from the bambu slicer, if that helps. :-/

Jony01 commented 1 month ago

smirgol FYI: 3mf use model with type="other", which is NOT allowed by 3mf consortium to be inside of build.

CITE:

items MUST NOT reference objects of type "other", either directly or recursively.

[link]

As you mentioned by error: it is found in '3D/3dmodel.model' at line 34, where is reference to path="/3D/Objects/object_1.model" objectid="8" in file '/3D/Objects/object_1.model' at line 1342495 is <object id="8" p:UUID="0001000e-81cb-4c03-9d28-80fed5dfa1dc" type="other">

Shame on the Application that creates invalid 3mf.

Jony01 commented 1 month ago

Fixed: https://www.printables.com/model/938988-fixed-3mf