Notifications
Clear all

Merge two 3MFs into Single 3MF?  

  RSS
Henry
(@henry-2)
Estimable Member
Merge two 3MFs into Single 3MF?

I'm looking for a command line (Linux preferred) software package that can combine two 3MFs into a single 3MF file. I have an OpenSCAD script for generating some multibody parts for MMU printing. To the best of my knowledge, these parts have to be exported as separate entities and then an external tool may be used to combine them into a single entity. I know how to do it manually in PrusaSlicer, but I'd like to be able to do it in a script.

I've tried exporting both simultaneously from OpenScad, but OpenScad combines the part into a single body which isn't appropriate for MMU printing.

If there doesn't currently exist a tool for this, I might be able to spin something up in Python since 3MFs are XML based. I'm not sure that I want to dive into that right now though.

Posted : 16/10/2022 1:36 pm
Diem
 Diem
(@diem)
Illustrious Member

.3mf is just a rebadged .zip archive.

Rename file.3mf to file.zip and open it with your usual archiver, modify contents to taste then reinstate the filetype.

Cheerio,

Posted : 16/10/2022 4:25 pm
Henry
(@henry-2)
Estimable Member
Topic starter answered:
RE: Merge two 3MFs into Single 3MF?

[quote]modify contents to taste then reinstate the filetype.[/quote]

This is the part I'm trying to figure out. I've done the following things so far:

  • In the model directory, there's a .model file in xml format. I tried copy/pasting the <object id="1" ...> ... </object> part from one model to the other and changing the id from 1 to 2.
  • I tried changing the file name from "3dmodel.model" to "test_3dmodel.model" and then loading the 3mf file into PrusaSlicer. No objects appeared on the build plate.
  • I tried the file name change above and also updated the .rels file to refer to "test_3dmodel.model" and still couldn't load anything in PrusaSlicer.
  • I tried merging the two source files into a single 3mf file using PrusaSlicer. I haven't dug much into the resulting file, but there's probably enough information there to figure out a decent way of doing it.

I am hoping that either someone comes along and says, "python module 3dprintfileformatter" will merge things for you, or points me to a tool I can install that will do it.

Posted : 16/10/2022 4:57 pm
towlerg
(@towlerg)
Noble Member
RE: Merge two 3MFs into Single 3MF?

I realize this is not what you are looking for but generally it helps to state in the simplest turns what you are  trying to achieve.

By all means list the tings you've tried.

Posted : 16/10/2022 5:25 pm
Diem
 Diem
(@diem)
Illustrious Member

Base reference:

https://github.com/3MFConsortium/spec_core/blob/master/3MF%20Core%20Specification.md

Cheerio

 

Posted : 16/10/2022 6:26 pm
Henry
(@henry-2)
Estimable Member
Topic starter answered:
RE: Merge two 3MFs into Single 3MF?

Thanks! I've very quickly skimmed the sections and it looks like something I need to slowly digest.

Posted : 20/10/2022 12:42 am
Share: