WIP: Command line slicing for SLA.
Removed some layer height editing bindings from Perl.
This commit is contained in:
parent
5e077c5edf
commit
e0cf7ecd22
2 changed files with 26 additions and 17 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include "libslic3r/Geometry.hpp"
|
#include "libslic3r/Geometry.hpp"
|
||||||
#include "libslic3r/Model.hpp"
|
#include "libslic3r/Model.hpp"
|
||||||
#include "libslic3r/Print.hpp"
|
#include "libslic3r/Print.hpp"
|
||||||
|
#include "libslic3r/SLAPrint.hpp"
|
||||||
#include "libslic3r/TriangleMesh.hpp"
|
#include "libslic3r/TriangleMesh.hpp"
|
||||||
#include "libslic3r/Format/3mf.hpp"
|
#include "libslic3r/Format/3mf.hpp"
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
|
@ -105,7 +106,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
// load config files supplied via --load
|
// load config files supplied via --load
|
||||||
for (const std::string &file : cli_config.load.values) {
|
for (const std::string &file : cli_config.load.values) {
|
||||||
if (!boost::filesystem::exists(file)) {
|
if (! boost::filesystem::exists(file)) {
|
||||||
boost::nowide::cout << "No such file: " << file << std::endl;
|
boost::nowide::cout << "No such file: " << file << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -206,22 +207,35 @@ int main(int argc, char **argv)
|
||||||
// lower.mesh().write_binary((outfile + "_lower.stl").c_str());
|
// lower.mesh().write_binary((outfile + "_lower.stl").c_str());
|
||||||
}
|
}
|
||||||
} else if (cli_config.slice) {
|
} else if (cli_config.slice) {
|
||||||
|
PrinterTechnology printer_technology = print_config.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology", true)->value;
|
||||||
std::string outfile = cli_config.output.value;
|
std::string outfile = cli_config.output.value;
|
||||||
Print print;
|
Print fff_print;
|
||||||
|
SLAPrint sla_print;
|
||||||
|
PrintBase *print = (printer_technology == ptFFF) ? static_cast<PrintBase*>(&fff_print) : static_cast<PrintBase*>(&sla_print);
|
||||||
if (! cli_config.dont_arrange) {
|
if (! cli_config.dont_arrange) {
|
||||||
model.arrange_objects(print.config().min_object_distance());
|
//FIXME make the min_object_distance configurable.
|
||||||
|
model.arrange_objects(fff_print.config().min_object_distance());
|
||||||
model.center_instances_around_point(cli_config.print_center);
|
model.center_instances_around_point(cli_config.print_center);
|
||||||
}
|
}
|
||||||
if (outfile.empty())
|
if (outfile.empty()) {
|
||||||
outfile = model.propose_export_file_name() + ".gcode";
|
outfile = model.propose_export_file_name();
|
||||||
for (auto* mo : model.objects)
|
outfile += (printer_technology == ptFFF) ? ".gcode" : ".zip";
|
||||||
print.auto_assign_extruders(mo);
|
}
|
||||||
|
if (printer_technology == ptFFF) {
|
||||||
|
for (auto* mo : model.objects)
|
||||||
|
fff_print.auto_assign_extruders(mo);
|
||||||
|
}
|
||||||
print_config.normalize();
|
print_config.normalize();
|
||||||
print.apply(model, print_config);
|
print->apply(model, print_config);
|
||||||
std::string err = print.validate();
|
std::string err = print->validate();
|
||||||
if (err.empty())
|
if (err.empty()) {
|
||||||
print.export_gcode(outfile, nullptr);
|
if (printer_technology == ptFFF) {
|
||||||
else
|
fff_print.export_gcode(outfile, nullptr);
|
||||||
|
} else {
|
||||||
|
assert(printer_technology == ptSLA);
|
||||||
|
//FIXME add the output here
|
||||||
|
}
|
||||||
|
} else
|
||||||
std::cerr << err << "\n";
|
std::cerr << err << "\n";
|
||||||
} else {
|
} else {
|
||||||
boost::nowide::cerr << "error: command not supported" << std::endl;
|
boost::nowide::cerr << "error: command not supported" << std::endl;
|
||||||
|
|
|
@ -211,11 +211,6 @@ ModelMaterial::attributes()
|
||||||
void set_layer_height_ranges(t_layer_height_ranges ranges)
|
void set_layer_height_ranges(t_layer_height_ranges ranges)
|
||||||
%code%{ THIS->layer_height_ranges = ranges; %};
|
%code%{ THIS->layer_height_ranges = ranges; %};
|
||||||
|
|
||||||
std::vector<double> layer_height_profile()
|
|
||||||
%code%{ RETVAL = THIS->layer_height_profile_valid ? THIS->layer_height_profile : std::vector<double>(); %};
|
|
||||||
void set_layer_height_profile(std::vector<double> profile)
|
|
||||||
%code%{ THIS->layer_height_profile = profile; THIS->layer_height_profile_valid = true; %};
|
|
||||||
|
|
||||||
Ref<Vec3d> origin_translation()
|
Ref<Vec3d> origin_translation()
|
||||||
%code%{ RETVAL = &THIS->origin_translation; %};
|
%code%{ RETVAL = &THIS->origin_translation; %};
|
||||||
void set_origin_translation(Vec3d* point)
|
void set_origin_translation(Vec3d* point)
|
||||||
|
|
Loading…
Reference in a new issue