assimp / assimp/assimp

Support 3MF triangle paint_color attribute? (for multimaterial 3D printing slicers compatibility)

Open
#5,629 4 comments 0 reactions 0 assignees View on GitHub
3MF Feature-Request
Dominant language
C++
Stars
13.2k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
21

Description

**Is your feature request related to a problem? Please describe.**

Hi! I'm trying to integrate assimp to OpenSCAD, a CAD tool with a large 3D-printing hobbyist user base, to benefit from its large set of color-aware 3D file formats (see https://github.com/openscad/openscad/pull/5180#issuecomment-2179356486 ).

A core motivation is to be able to write models that can be printed by multimaterial printers (e.g. Prusa + MMU or BambuLab + AMS). The two main slicers in that space ([PrusaSlicer](https://www.prusa3d.com/en/page/prusaslicer_424/) and its fork [BambuStudio](https://bambulab.com/en/download/studio)) use `3MF` with custom attributes.

In particular, when it comes to writing which [material to "paint"](https://help.prusa3d.com/article/multi-material-painting_262620) a triangle with, they use a rather convoluted serialization scheme and the attribute `paint_color` or `slic3rpe:mmu_segmentation` ([more details here](https://github.com/openscad/openscad/issues/5065#issuecomment-2179417639)) to describe how the face is painted.

**Describe the solution you'd like**

So, it would be amazing if assimp were able to write a `.3mf` that can be recognized as native by PrusaSlicer & BambuStudio.

Not sure how that fits into the assimp ethos, but if it's too specific a use case, I was wondering if you'd consider at leaast allowing custom key-value attributes for faces (and maybe custom metadata), so we can generate a model slicers will accept / read face painting info from.

It may be overkill to support the serialization scheme, but at least allowing passing along the serialized values would be great.

image

**Describe alternatives you've considered**

Alternatively I might just write to a blob, read the zip and surgically edit the model XML to add the attributes, leaving some `matIdx` breadcrumbs to know what to edit.

Orrr fork assimp and alter [D3MFExporter::writeFaces](https://github.com/assimp/assimp/blob/77f7706a97f478c059a88a4384ec49779d7321e9/code/AssetLib/3MF/D3MFExporter.cpp#L337) somehow.

Thanks for the amazing work on assimp & for reading this!

Contributor guide

Open the contributing guide

Research direction

Start with D3MFExporter::writeFaces in code/AssetLib/3MF/D3MFExporter.cpp and review how the exporter currently serializes 3MF face data. Compare that behavior with the referenced PrusaSlicer and BambuStudio paint_color or slic3rpe:mmu_segmentation requirements; done means the written .3mf is recognized natively by those slicers or the requested face attributes can be passed through.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.