Adds rotate on stl import (#3116)

* Adds rotate on stl import

* Fixed comma placement

* update location of rotate variables

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Alex Khalilieh 2023-12-14 16:59:35 -08:00 committed by GitHub
parent dc840ea451
commit 41f0e4d1ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 5 deletions

View file

@ -11557,6 +11557,12 @@ msgstr ""
msgid "Note: Repetier version at least 0.90.0 is required."
msgstr ""
msgid "Preferred orientation"
msgstr ""
msgid "Automatically orient stls on the Z-axis upon initial import"
msgstr ""
#, possible-boost-format
msgid ""
"HTTP status: %1%\n"

View file

@ -878,7 +878,7 @@ static std::vector<std::string> s_Preset_printer_options {
"cooling_tube_retraction",
"cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "purge_in_prime_tower", "enable_filament_ramming",
"z_offset",
"disable_m73",
"disable_m73", "preferred_orientation"
};
static std::vector<std::string> s_Preset_sla_print_options {

View file

@ -468,6 +468,15 @@ void PrintConfigDef::init_common_params()
def->mode = comSimple;
def->set_default_value(new ConfigOptionFloat(100.0));
def = this->add("preferred_orientation", coFloat);
def->label = L("Preferred orientation");
def->tooltip = L("Automatically orient stls on the Z-axis upon initial import");
def->sidetext = L("°");
def->max = 360;
def->min = -360;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.0));
// Options used by physical printers
def = this->add("preset_names", coStrings);

View file

@ -1173,7 +1173,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBools, activate_chamber_temp_control))
((ConfigOptionInts , chamber_temperature))
((ConfigOptionBool, is_infill_first))
((ConfigOptionFloat, preferred_orientation))
)

View file

@ -2524,7 +2524,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
, config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({
"printable_area", "bed_exclude_area", "bed_custom_texture", "bed_custom_model", "print_sequence",
"extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "skirt_loops", "skirt_speed", "skirt_distance",
"brim_width", "brim_object_gap", "brim_type", "nozzle_diameter", "single_extruder_multi_material",
"brim_width", "brim_object_gap", "brim_type", "nozzle_diameter", "single_extruder_multi_material", "preferred_orientation",
"enable_prime_tower", "wipe_tower_x", "wipe_tower_y", "prime_tower_width", "prime_tower_brim_width", "prime_volume",
"extruder_colour", "filament_colour", "material_colour", "printable_height", "printer_model", "printer_technology",
// These values are necessary to construct SlicingParameters by the Canvas3D variable layer height editor.
@ -3825,8 +3825,12 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
if (type_any_amf && is_xxx) imperial_units = true;
for (auto obj : model.objects)
if (obj->name.empty()) obj->name = fs::path(obj->input_file).filename().string();
for (auto obj : model.objects) {
if (obj->name.empty()) {
obj->name = fs::path(obj->input_file).filename().string();
}
obj->rotate(Geometry::deg2rad(config->opt_float("preferred_orientation")), Axis::Z);
}
if (plate_data.size() > 0) {
partplate_list.load_from_3mf_structure(plate_data);

View file

@ -3389,6 +3389,7 @@ void TabPrinter::build_fff()
optgroup->append_single_option_line("nozzle_volume");
optgroup->append_single_option_line("best_object_pos");
optgroup->append_single_option_line("z_offset");
optgroup->append_single_option_line("preferred_orientation");
// ConfigOptionDef def;
// def.type = coInt,