Skip to content

CURA-12544 saving and loading painted files in cura#57

Merged
wawanbreton merged 7 commits intomainfrom
CURA-12544_saving-and-loading-painted-files-in-Cura
Jul 30, 2025
Merged

CURA-12544 saving and loading painted files in cura#57
wawanbreton merged 7 commits intomainfrom
CURA-12544_saving-and-loading-painted-files-in-Cura

Conversation

@wawanbreton
Copy link
Contributor

@wawanbreton wawanbreton commented Jun 3, 2025

Save and load painted models textures in 3MF files

CURA-12544

Documentation is not 100% to match the current level of documentation, and because some methods are reeeeeally sefl-explanatory IMHO. If you think some more methods/classes deserve it, just ask.

@github-actions
Copy link

github-actions bot commented Jun 3, 2025

Test Results

3 tests  ±0   3 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 8db6981. ± Comparison against base commit c9fecec.

♻️ This comment has been updated with latest results.

@wawanbreton wawanbreton marked this pull request as ready for review June 3, 2025 14:49

using namespace Savitar;

UVCoordinatesIndices::UVCoordinatesIndices(int group_index, int vertex_1_index, int vertex_2_index, int vertex_3_index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group is used to have multiple textrues for the same model, then the logic is texture group 0 is for seam painting, texture group 1 is for overhang painting for instance or am I understanding this wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right that the group is used for multiples texture on the same model, however we are not going to use it. We will do a single UV-mapping per model, with a single texture. Then every pixel will encode the information about seam/support/material/... This is an interesting idea that we didn't consider though, but since every face is linked to a single texture, we cannot really do it. I'll give it a though with Remco.

Comment on lines +47 to +49
[[nodiscard]] int getId() const;

void setId(std::string id);
void setId(int id);
Copy link
Contributor

@casperlamboo casperlamboo Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason this change is needed? We just added savitar to neoprep and since javascript doens't have true integer numeric types. This change would be a bit non-idiomatic to implement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ! Since we now have to handle:

  • An ID for the object
  • An ID for the coordinates group
  • An ID for the texture path
    And all of them should be unique, libSavitar calculates proper IDs for everyone, so I need to store them as integers so that I can find a proper value for the next time I need an ID. If this really is an issue, I can find an other way, but I would prefer not to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings could also solve the that specific issue right? If we use integers, can we then somehow make sure the ID never excedes $2^{53} – 1$ as this is the max safe integer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDs are using incremented integers starting from 0, so we should be safe 😄

@wawanbreton wawanbreton merged commit 0569c87 into main Jul 30, 2025
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants