ChristophSchranz / Tweaker-3

A performant auto-rotate software for objects in 3D Printing, whose parameter are trained by an evolutionary algorithm.
GNU General Public License v3.0
91 stars 25 forks source link

3mf with multiple objects #18

Open AlbertMN opened 2 years ago

AlbertMN commented 2 years ago

Hey there - first of all, thanks so much for this awesome project @ChristophSchranz!

I've noticed that Tweaker accepts 3mf files, but that it doesn't quite know how to handle multiple objects within one 3mf file, so it just selects one and smart-rotates that one.

Would it be possible for it to rotate and return multiple objects?

Here's an example file; Multi-instance-control-box.zip

ChristophSchranz commented 2 years ago

Hi @AlbertMN,

Yes that's possible.

I expect the 3MF handler in ThreeMF.py returns the objects in a list, but in Filehandler.py only the first 3MF object is passed. https://github.com/ChristophSchranz/Tweaker-3/blob/25331d6c775cfcdfcd24c4ec28f93120f23295a8/FileHandler.py#L60-L63 The routine what happens with each object can be set in the file Tweaker.py.

I hope this answer helps you!

AlbertMN commented 2 years ago

Hi @AlbertMN,

Yes that's possible.

I expect the 3MF handler in ThreeMF.py returns the objects in a list, but in Filehandler.py only the first 3MF object is passed. https://github.com/ChristophSchranz/Tweaker-3/blob/25331d6c775cfcdfcd24c4ec28f93120f23295a8/FileHandler.py#L60-L63 The routine what happens with each object can be set in the file Tweaker.py.

I hope this answer helps you!

Awesome, thank you! Want me to test it out and do a PR, or are you on it?

ChristophSchranz commented 2 years ago

Yes @AlbertMN that would be great! But don't change the behavior of the object-loop in Tweaker.py for now.