Mesh: fixes issue #10075: 3MF files exported from FreeCAD don't work in PrusaSlicer

Add an option to force to always write a mesh as model type even if it's not a solid
This commit is contained in:
wmayer
2023-08-30 16:55:21 +02:00
committed by wwmayer
parent a9503e38e4
commit 7bbc93e218
7 changed files with 78 additions and 21 deletions

View File

@@ -211,6 +211,7 @@ private:
auto fTolerance( hGrp->GetFloat("MaxDeviationExport", 0.1f) );
int exportAmfCompressed( hGrp->GetBool("ExportAmfCompressed", true) );
bool export3mfModel( hGrp->GetBool("Export3mfModel", true) );
static const std::array<const char *, 5> kwList{"objectList", "filename", "tolerance",
"exportAmfCompressed", nullptr};
@@ -261,6 +262,7 @@ private:
else if (exportFormat == MeshIO::ThreeMF) {
Extension3MFFactory::initialize();
exporter = std::make_unique<Exporter3MF>(outputFileName, Extension3MFFactory::createExtensions());
dynamic_cast<Exporter3MF*>(exporter.get())->setForceModel(export3mfModel);
}
else if (exportFormat != MeshIO::Undefined) {
exporter = std::make_unique<MergeExporter>(outputFileName, exportFormat);