Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/libslic3r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ set(SLIC3R_SOURCES
Format/SL1_SVG.cpp
Format/AnycubicSLA.hpp
Format/AnycubicSLA.cpp
Format/GOO.hpp
Format/GOO.cpp
Format/STEP.hpp
Format/STEP.cpp
Format/SVG.hpp
Expand Down
434 changes: 434 additions & 0 deletions src/libslic3r/Format/GOO.cpp

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions src/libslic3r/Format/GOO.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
///|/ Copyright (c) 2024 Felix Reißmann @felix-rm
///|/
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/

#pragma once

#include "SLAArchiveWriter.hpp"
#include "SLAArchiveReader.hpp"

#include "libslic3r/PrintConfig.hpp"

namespace Slic3r {

class GOOWriter : public SLAArchiveWriter
{
SLAPrinterConfig m_cfg{};

protected:
SLAPrinterConfig &cfg() { return m_cfg; }
const SLAPrinterConfig &cfg() const { return m_cfg; }

std::unique_ptr<sla::RasterBase> create_raster() const override;
sla::RasterEncoder get_encoder() const override;

public:
GOOWriter() = default;
explicit GOOWriter(const SLAPrinterConfig &cfg) : m_cfg(cfg) {}
explicit GOOWriter(SLAPrinterConfig &&cfg) : m_cfg(std::move(cfg)) {}

void export_print(
const std::string filename,
const SLAPrint &print,
const ThumbnailsList &thumbnails,
const std::string &project_name = ""
) override;
};

class GOOReader : public SLAArchiveReader
{
using progress_callback_t = std::function<bool(int)>;

SLAImportQuality m_quality = SLAImportQuality::Balanced;
progress_callback_t m_progress_callback;
std::string m_filename;

protected:
std::string &filename() { return m_filename; }
const std::string &filename() const { return m_filename; }

progress_callback_t &progress_callback() { return m_progress_callback; }
const progress_callback_t &progress_callback() const { return m_progress_callback; }

public:
GOOReader() = default;
GOOReader(
const std::string &filename, //
SLAImportQuality quality,
progress_callback_t progress_callback
)
: m_quality(quality), m_progress_callback(progress_callback), m_filename(filename) {}

// If the profile is missing from the archive (older PS versions did not have
// it), profile_out's initial value will be used as fallback. profile_out will be empty on
// function return if the archive did not contain any profile.
ConfigSubstitutions read(std::vector<ExPolygons> &slices, DynamicPrintConfig &profile_out)
override;

ConfigSubstitutions read(DynamicPrintConfig &profile) override { return {}; }
};

} // namespace Slic3r
18 changes: 18 additions & 0 deletions src/libslic3r/Format/SLAArchiveFormatRegistry.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
///|/ Copyright (c) Prusa Research 2023 Tomáš Mészáros @tamasmeszaros, Pavel Mikuš @Godrak
///|/ Copyright (c) 2024 Felix Reißmann @felix-rm
///|/
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/
Expand All @@ -10,6 +11,7 @@
#include "SL1_SVG.hpp"
#include "AnycubicSLA.hpp"
#include "I18N.hpp"
#include "GOO.hpp"

#include "SLAArchiveFormatRegistry.hpp"

Expand Down Expand Up @@ -75,6 +77,22 @@ class Registry {
anycubic_sla_format_versioned("pmx2", "Photon Mono X2", ANYCUBIC_SLA_VERSION_515),
anycubic_sla_format_versioned("pm3r", "Photon M3 Premium", ANYCUBIC_SLA_VERSION_515),
*/
{
"GOO", // id
L("Goo"), // description
"goo", // main extension
{}, // extension aliases

// Writer factory
[] (const auto &cfg) {
return std::make_unique<GOOWriter>(cfg);
},

// Reader factory
[] (const std::string &fname, SLAImportQuality quality, const ProgrFn &progr) {
return std::make_unique<GOOReader>(fname, quality, progr);
}
},
};
}

Expand Down
26 changes: 26 additions & 0 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
///|/ Copyright (c) Prusa Research 2017 - 2023 Oleksandra Iushchenko @YuSanka, Lukáš Matěna @lukasmatena, Tomáš Mészáros @tamasmeszaros, Lukáš Hejl @hejllukas, Vojtěch Bubník @bubnikv, Pavel Mikuš @Godrak, David Kocík @kocikdav, Enrico Turri @enricoturri1966, Vojtěch Král @vojtechkral
///|/ Copyright (c) 2024 Felix Reißmann @felix-rm
///|/ Copyright (c) 2021 Martin Budden
///|/ Copyright (c) 2021 Ilya @xorza
///|/ Copyright (c) 2019 John Drake @foxox
Expand Down Expand Up @@ -597,6 +598,30 @@ static std::vector<std::string> s_Preset_sla_material_options {
"material_density",
"exposure_time",
"initial_exposure_time",
"exposure_pwm",
"initial_exposure_pwm",
"sla_initial_primary_lift_distance",
"sla_initial_secondary_lift_distance",
"sla_initial_primary_lift_speed",
"sla_initial_secondary_lift_speed",
"sla_initial_primary_retract_distance",
"sla_initial_secondary_retract_distance",
"sla_initial_primary_retract_speed",
"sla_initial_secondary_retract_speed",
"sla_initial_wait_before_lift",
"sla_initial_wait_after_lift",
"sla_initial_wait_after_retract",
"sla_primary_lift_distance",
"sla_secondary_lift_distance",
"sla_primary_lift_speed",
"sla_secondary_lift_speed",
"sla_primary_retract_distance",
"sla_secondary_retract_distance",
"sla_primary_retract_speed",
"sla_secondary_retract_speed",
"sla_wait_before_lift",
"sla_wait_after_lift",
"sla_wait_after_retract",
"material_correction",
"material_correction_x",
"material_correction_y",
Expand Down Expand Up @@ -642,6 +667,7 @@ static std::vector<std::string> s_Preset_sla_printer_options {
"elefant_foot_compensation",
"elefant_foot_min_width",
"gamma_correction",
"time_estimate_correction",
"min_exposure_time", "max_exposure_time",
"min_initial_exposure_time", "max_initial_exposure_time", "sla_archive_format", "sla_output_precision",
//FIXME the print host keys are left here just for conversion from the Printer preset to Physical Printer preset.
Expand Down
Loading