mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-27 04:42:33 +00:00
Merge some BS1.7 changes:
internal_solid_infill_pattern
This commit is contained in:
@@ -15,9 +15,13 @@
|
||||
#define DIR_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
//Translation
|
||||
#include "I18N.hpp"
|
||||
#define _L(s) Slic3r::I18N::translate(s)
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
bool load_obj(const char *path, TriangleMesh *meshptr)
|
||||
bool load_obj(const char *path, TriangleMesh *meshptr, std::string &message)
|
||||
{
|
||||
if (meshptr == nullptr)
|
||||
return false;
|
||||
@@ -26,6 +30,7 @@ bool load_obj(const char *path, TriangleMesh *meshptr)
|
||||
ObjParser::ObjData data;
|
||||
if (! ObjParser::objparse(path, data)) {
|
||||
BOOST_LOG_TRIVIAL(error) << "load_obj: failed to parse " << path;
|
||||
message = _L("load_obj: failed to parse");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,10 +45,12 @@ bool load_obj(const char *path, TriangleMesh *meshptr)
|
||||
if (num_face_vertices > 4) {
|
||||
// Non-triangular and non-quad faces are not supported as of now.
|
||||
BOOST_LOG_TRIVIAL(error) << "load_obj: failed to parse " << path << ". The file contains polygons with more than 4 vertices.";
|
||||
message = _L("The file contains polygons with more than 4 vertices.");
|
||||
return false;
|
||||
} else if (num_face_vertices < 3) {
|
||||
// Non-triangular and non-quad faces are not supported as of now.
|
||||
BOOST_LOG_TRIVIAL(error) << "load_obj: failed to parse " << path << ". The file contains polygons with less than 2 vertices.";
|
||||
message = _L("The file contains polygons with less than 2 vertices.");
|
||||
return false;
|
||||
}
|
||||
if (num_face_vertices == 4)
|
||||
@@ -75,6 +82,7 @@ bool load_obj(const char *path, TriangleMesh *meshptr)
|
||||
assert(cnt < 4);
|
||||
if (vertex.coordIdx < 0 || vertex.coordIdx >= int(its.vertices.size())) {
|
||||
BOOST_LOG_TRIVIAL(error) << "load_obj: failed to parse " << path << ". The file contains invalid vertex index.";
|
||||
message = _L("The file contains invalid vertex index.");
|
||||
return false;
|
||||
}
|
||||
indices[cnt ++] = vertex.coordIdx;
|
||||
@@ -91,6 +99,7 @@ bool load_obj(const char *path, TriangleMesh *meshptr)
|
||||
*meshptr = TriangleMesh(std::move(its));
|
||||
if (meshptr->empty()) {
|
||||
BOOST_LOG_TRIVIAL(error) << "load_obj: This OBJ file couldn't be read because it's empty. " << path;
|
||||
message = _L("This OBJ file couldn't be read because it's empty.");
|
||||
return false;
|
||||
}
|
||||
if (meshptr->volume() < 0)
|
||||
@@ -98,11 +107,11 @@ bool load_obj(const char *path, TriangleMesh *meshptr)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool load_obj(const char *path, Model *model, const char *object_name_in)
|
||||
bool load_obj(const char *path, Model *model, std::string &message, const char *object_name_in)
|
||||
{
|
||||
TriangleMesh mesh;
|
||||
|
||||
bool ret = load_obj(path, &mesh);
|
||||
bool ret = load_obj(path, &mesh, message);
|
||||
|
||||
if (ret) {
|
||||
std::string object_name;
|
||||
|
||||
@@ -8,8 +8,8 @@ class Model;
|
||||
class ModelObject;
|
||||
|
||||
// Load an OBJ file into a provided model.
|
||||
extern bool load_obj(const char *path, TriangleMesh *mesh);
|
||||
extern bool load_obj(const char *path, Model *model, const char *object_name = nullptr);
|
||||
extern bool load_obj(const char *path, TriangleMesh *mesh, std::string &message);
|
||||
extern bool load_obj(const char *path, Model *model, std::string &message, const char *object_name = nullptr);
|
||||
|
||||
extern bool store_obj(const char *path, TriangleMesh *mesh);
|
||||
extern bool store_obj(const char *path, ModelObject *model);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "TopExp_Explorer.hxx"
|
||||
#include "BRep_Tool.hxx"
|
||||
|
||||
const double STEP_TRANS_CHORD_ERROR = 0.0025;
|
||||
const double STEP_TRANS_CHORD_ERROR = 0.003;
|
||||
const double STEP_TRANS_ANGLE_RES = 0.5;
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,9 @@ struct ThumbnailData;
|
||||
#define EMBEDDED_FILAMENT_FILE_FORMAT "Metadata/filament_settings_%1%.config"
|
||||
#define EMBEDDED_PRINTER_FILE_FORMAT "Metadata/machine_settings_%1%.config"
|
||||
|
||||
#define BBL_DESIGNER_MODEL_TITLE_TAG "Title"
|
||||
#define BBL_DESIGNER_PROFILE_ID_TAG "DesignProfileId"
|
||||
#define BBL_DESIGNER_PROFILE_TITLE_TAG "ProfileTitle"
|
||||
#define BBL_DESIGNER_MODEL_ID_TAG "DesignModelId"
|
||||
|
||||
|
||||
@@ -76,10 +78,12 @@ struct PlateData
|
||||
std::string gcode_weight;
|
||||
std::string plate_name;
|
||||
std::vector<FilamentInfo> slice_filaments_info;
|
||||
std::vector<size_t> skipped_objects;
|
||||
DynamicPrintConfig config;
|
||||
bool is_support_used {false};
|
||||
bool is_sliced_valid = false;
|
||||
bool toolpath_outside {false};
|
||||
bool is_label_object_enabled {false};
|
||||
|
||||
std::vector<GCodeProcessorResult::SliceWarning> warnings;
|
||||
|
||||
@@ -108,6 +112,7 @@ enum class SaveStrategy
|
||||
WithSliceInfo = 1 << 8,
|
||||
SkipAuxiliary = 1 << 9,
|
||||
UseLoadedId = 1 << 10,
|
||||
ShareMesh = 1 << 11,
|
||||
|
||||
SplitModel = 0x1000 | ProductionExt,
|
||||
Encrypted = SecureContentExt | SplitModel,
|
||||
@@ -221,6 +226,10 @@ extern bool load_bbs_3mf(const char* path, DynamicPrintConfig* config, ConfigSub
|
||||
|
||||
extern std::string bbs_3mf_get_thumbnail(const char * path);
|
||||
|
||||
extern bool load_gcode_3mf_from_stream(std::istream & data, DynamicPrintConfig* config, Model* model, PlateDataPtrs* plate_data_list,
|
||||
Semver* file_version);
|
||||
|
||||
|
||||
//BBS: add plate data list related logic
|
||||
// add backup logic
|
||||
// Save the given model and the config data contained in the given Print into a 3mf file.
|
||||
|
||||
Reference in New Issue
Block a user