Fixed .prusa i/o and split to objects
This commit is contained in:
parent
ce099e91c7
commit
1eb01df0c8
6 changed files with 22 additions and 59 deletions
|
@ -1456,9 +1456,7 @@ namespace Slic3r {
|
||||||
|
|
||||||
// splits volume out of imported geometry
|
// splits volume out of imported geometry
|
||||||
unsigned int triangles_count = volume_data.last_triangle_id - volume_data.first_triangle_id + 1;
|
unsigned int triangles_count = volume_data.last_triangle_id - volume_data.first_triangle_id + 1;
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
ModelVolume* volume = object.add_volume(TriangleMesh());
|
ModelVolume* volume = object.add_volume(TriangleMesh());
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
stl_file& stl = volume->mesh.stl;
|
stl_file& stl = volume->mesh.stl;
|
||||||
stl.stats.type = inmemory;
|
stl.stats.type = inmemory;
|
||||||
stl.stats.number_of_facets = (uint32_t)triangles_count;
|
stl.stats.number_of_facets = (uint32_t)triangles_count;
|
||||||
|
@ -1479,9 +1477,7 @@ namespace Slic3r {
|
||||||
|
|
||||||
stl_get_size(&stl);
|
stl_get_size(&stl);
|
||||||
volume->mesh.repair();
|
volume->mesh.repair();
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
volume->center_geometry();
|
volume->center_geometry();
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
volume->calculate_convex_hull();
|
volume->calculate_convex_hull();
|
||||||
|
|
||||||
// apply volume's name and config data
|
// apply volume's name and config data
|
||||||
|
|
|
@ -279,9 +279,7 @@ void AMFParserContext::startElement(const char *name, const char **atts)
|
||||||
node_type_new = NODE_TYPE_VERTICES;
|
node_type_new = NODE_TYPE_VERTICES;
|
||||||
else if (strcmp(name, "volume") == 0) {
|
else if (strcmp(name, "volume") == 0) {
|
||||||
assert(! m_volume);
|
assert(! m_volume);
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
m_volume = m_object->add_volume(TriangleMesh());
|
m_volume = m_object->add_volume(TriangleMesh());
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
node_type_new = NODE_TYPE_VOLUME;
|
node_type_new = NODE_TYPE_VOLUME;
|
||||||
}
|
}
|
||||||
} else if (m_path[2] == NODE_TYPE_INSTANCE) {
|
} else if (m_path[2] == NODE_TYPE_INSTANCE) {
|
||||||
|
|
|
@ -282,9 +282,7 @@ static void extract_model_from_archive(
|
||||||
group_to_model_object[group_id] = model_object;
|
group_to_model_object[group_id] = model_object;
|
||||||
} else {
|
} else {
|
||||||
// This is not the 1st mesh of a group. Add it to the ModelObject.
|
// This is not the 1st mesh of a group. Add it to the ModelObject.
|
||||||
//#################################################################################################################################################################################
|
|
||||||
volume = model_object->add_volume(std::move(mesh));
|
volume = model_object->add_volume(std::move(mesh));
|
||||||
//#################################################################################################################################################################################
|
|
||||||
volume->name = name;
|
volume->name = name;
|
||||||
}
|
}
|
||||||
// Set the extruder to the volume.
|
// Set the extruder to the volume.
|
||||||
|
|
|
@ -164,9 +164,7 @@ ModelObject* Model::add_object(const char *name, const char *path, const Triangl
|
||||||
this->objects.push_back(new_object);
|
this->objects.push_back(new_object);
|
||||||
new_object->name = name;
|
new_object->name = name;
|
||||||
new_object->input_file = path;
|
new_object->input_file = path;
|
||||||
//#################################################################################################################################################################################
|
|
||||||
ModelVolume *new_volume = new_object->add_volume(mesh);
|
ModelVolume *new_volume = new_object->add_volume(mesh);
|
||||||
//#################################################################################################################################################################################
|
|
||||||
new_volume->name = name;
|
new_volume->name = name;
|
||||||
new_object->invalidate_bounding_box();
|
new_object->invalidate_bounding_box();
|
||||||
return new_object;
|
return new_object;
|
||||||
|
@ -178,9 +176,7 @@ ModelObject* Model::add_object(const char *name, const char *path, TriangleMesh
|
||||||
this->objects.push_back(new_object);
|
this->objects.push_back(new_object);
|
||||||
new_object->name = name;
|
new_object->name = name;
|
||||||
new_object->input_file = path;
|
new_object->input_file = path;
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
ModelVolume *new_volume = new_object->add_volume(std::move(mesh));
|
ModelVolume *new_volume = new_object->add_volume(std::move(mesh));
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
new_volume->name = name;
|
new_volume->name = name;
|
||||||
new_object->invalidate_bounding_box();
|
new_object->invalidate_bounding_box();
|
||||||
return new_object;
|
return new_object;
|
||||||
|
@ -485,39 +481,10 @@ void Model::convert_multipart_object(unsigned int max_extruders)
|
||||||
|
|
||||||
reset_auto_extruder_id();
|
reset_auto_extruder_id();
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
//#if ENABLE_VOLUMES_CENTERING_FIXES
|
|
||||||
// for (const ModelObject* o : this->objects)
|
|
||||||
// {
|
|
||||||
// const ModelInstance* i = o->instances.front();
|
|
||||||
// const Geometry::Transformation& t = i->get_transformation();
|
|
||||||
// for (const ModelVolume* v : o->volumes)
|
|
||||||
// {
|
|
||||||
////$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
// ModelVolume* new_v = object->add_volume(*v);
|
|
||||||
////$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
// if (new_v != nullptr)
|
|
||||||
// {
|
|
||||||
// new_v->name = o->name;
|
|
||||||
// new_v->set_transformation(t * new_v->get_transformation());
|
|
||||||
// new_v->config.set_deserialize("extruder", get_auto_extruder_id_as_string(max_extruders));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// for (const ModelInstance* i : this->objects.front()->instances)
|
|
||||||
// {
|
|
||||||
// ModelInstance* inst = object->add_instance(*i);
|
|
||||||
// inst->set_transformation(Geometry::Transformation());
|
|
||||||
// }
|
|
||||||
//#else
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
for (const ModelObject* o : this->objects)
|
for (const ModelObject* o : this->objects)
|
||||||
for (const ModelVolume* v : o->volumes)
|
for (const ModelVolume* v : o->volumes)
|
||||||
{
|
{
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
ModelVolume* new_v = object->add_volume(*v);
|
ModelVolume* new_v = object->add_volume(*v);
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
if (new_v != nullptr)
|
if (new_v != nullptr)
|
||||||
{
|
{
|
||||||
new_v->name = o->name;
|
new_v->name = o->name;
|
||||||
|
@ -527,9 +494,6 @@ void Model::convert_multipart_object(unsigned int max_extruders)
|
||||||
|
|
||||||
for (const ModelInstance* i : this->objects.front()->instances)
|
for (const ModelInstance* i : this->objects.front()->instances)
|
||||||
object->add_instance(*i);
|
object->add_instance(*i);
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
//#endif // ENABLE_VOLUMES_CENTERING_FIXES
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
this->clear_objects();
|
this->clear_objects();
|
||||||
this->objects.push_back(object);
|
this->objects.push_back(object);
|
||||||
|
@ -1147,10 +1111,8 @@ ModelObjectPtrs ModelObject::cut(size_t instance, coordf_t z, bool keep_upper, b
|
||||||
|
|
||||||
volume->set_transformation(Geometry::Transformation(instance_matrix * volume_matrix));
|
volume->set_transformation(Geometry::Transformation(instance_matrix * volume_matrix));
|
||||||
|
|
||||||
//#################################################################################################################################################################################
|
|
||||||
if (keep_upper) { upper->add_volume(*volume); }
|
if (keep_upper) { upper->add_volume(*volume); }
|
||||||
if (keep_lower) { lower->add_volume(*volume); }
|
if (keep_lower) { lower->add_volume(*volume); }
|
||||||
//#################################################################################################################################################################################
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TriangleMesh upper_mesh, lower_mesh;
|
TriangleMesh upper_mesh, lower_mesh;
|
||||||
|
@ -1177,17 +1139,13 @@ ModelObjectPtrs ModelObject::cut(size_t instance, coordf_t z, bool keep_upper, b
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keep_upper && upper_mesh.facets_count() > 0) {
|
if (keep_upper && upper_mesh.facets_count() > 0) {
|
||||||
//#################################################################################################################################################################################
|
|
||||||
ModelVolume* vol = upper->add_volume(upper_mesh);
|
ModelVolume* vol = upper->add_volume(upper_mesh);
|
||||||
//#################################################################################################################################################################################
|
|
||||||
vol->name = volume->name;
|
vol->name = volume->name;
|
||||||
vol->config = volume->config;
|
vol->config = volume->config;
|
||||||
vol->set_material(volume->material_id(), *volume->material());
|
vol->set_material(volume->material_id(), *volume->material());
|
||||||
}
|
}
|
||||||
if (keep_lower && lower_mesh.facets_count() > 0) {
|
if (keep_lower && lower_mesh.facets_count() > 0) {
|
||||||
//#################################################################################################################################################################################
|
|
||||||
ModelVolume* vol = lower->add_volume(lower_mesh);
|
ModelVolume* vol = lower->add_volume(lower_mesh);
|
||||||
//#################################################################################################################################################################################
|
|
||||||
vol->name = volume->name;
|
vol->name = volume->name;
|
||||||
vol->config = volume->config;
|
vol->config = volume->config;
|
||||||
vol->set_material(volume->material_id(), *volume->material());
|
vol->set_material(volume->material_id(), *volume->material());
|
||||||
|
@ -1266,10 +1224,14 @@ void ModelObject::split(ModelObjectPtrs* new_objects)
|
||||||
new_object->instances.reserve(this->instances.size());
|
new_object->instances.reserve(this->instances.size());
|
||||||
for (const ModelInstance *model_instance : this->instances)
|
for (const ModelInstance *model_instance : this->instances)
|
||||||
new_object->add_instance(*model_instance);
|
new_object->add_instance(*model_instance);
|
||||||
//#################################################################################################################################################################################
|
|
||||||
ModelVolume* new_vol = new_object->add_volume(*volume, std::move(*mesh));
|
ModelVolume* new_vol = new_object->add_volume(*volume, std::move(*mesh));
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
#if !ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
new_vol->center_geometry();
|
new_vol->center_geometry();
|
||||||
//#################################################################################################################################################################################
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
#endif // !ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
for (ModelInstance* model_instance : new_object->instances)
|
for (ModelInstance* model_instance : new_object->instances)
|
||||||
{
|
{
|
||||||
|
@ -1530,9 +1492,7 @@ size_t ModelVolume::split(unsigned int max_extruders)
|
||||||
this->object->volumes.insert(this->object->volumes.begin() + (++ivolume), new ModelVolume(object, *this, std::move(*mesh)));
|
this->object->volumes.insert(this->object->volumes.begin() + (++ivolume), new ModelVolume(object, *this, std::move(*mesh)));
|
||||||
|
|
||||||
this->object->volumes[ivolume]->set_offset(Vec3d::Zero());
|
this->object->volumes[ivolume]->set_offset(Vec3d::Zero());
|
||||||
//#################################################################################################################################################################################
|
|
||||||
this->object->volumes[ivolume]->center_geometry();
|
this->object->volumes[ivolume]->center_geometry();
|
||||||
//#################################################################################################################################################################################
|
|
||||||
this->object->volumes[ivolume]->translate(offset);
|
this->object->volumes[ivolume]->translate(offset);
|
||||||
this->object->volumes[ivolume]->name = name + "_" + std::to_string(idx + 1);
|
this->object->volumes[ivolume]->name = name + "_" + std::to_string(idx + 1);
|
||||||
this->object->volumes[ivolume]->config.set_deserialize("extruder", Model::get_auto_extruder_id_as_string(max_extruders));
|
this->object->volumes[ivolume]->config.set_deserialize("extruder", Model::get_auto_extruder_id_as_string(max_extruders));
|
||||||
|
|
|
@ -853,9 +853,7 @@ void ObjectList::load_part( ModelObject* model_object,
|
||||||
#endif // !ENABLE_VOLUMES_CENTERING_FIXES
|
#endif // !ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
volume->translate(delta);
|
volume->translate(delta);
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
auto new_volume = model_object->add_volume(*volume);
|
auto new_volume = model_object->add_volume(*volume);
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
new_volume->set_type(static_cast<ModelVolume::Type>(type));
|
new_volume->set_type(static_cast<ModelVolume::Type>(type));
|
||||||
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
||||||
|
|
||||||
|
@ -900,9 +898,7 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const int
|
||||||
}
|
}
|
||||||
mesh.repair();
|
mesh.repair();
|
||||||
|
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
auto new_volume = (*m_objects)[obj_idx]->add_volume(mesh);
|
auto new_volume = (*m_objects)[obj_idx]->add_volume(mesh);
|
||||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
||||||
new_volume->set_type(static_cast<ModelVolume::Type>(type));
|
new_volume->set_type(static_cast<ModelVolume::Type>(type));
|
||||||
|
|
||||||
#if !ENABLE_GENERIC_SUBPARTS_PLACEMENT
|
#if !ENABLE_GENERIC_SUBPARTS_PLACEMENT
|
||||||
|
|
|
@ -970,6 +970,11 @@ struct Plater::priv
|
||||||
static const std::regex pattern_3mf;
|
static const std::regex pattern_3mf;
|
||||||
static const std::regex pattern_zip_amf;
|
static const std::regex pattern_zip_amf;
|
||||||
static const std::regex pattern_any_amf;
|
static const std::regex pattern_any_amf;
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
#if ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
static const std::regex pattern_prusa;
|
||||||
|
#endif // ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
priv(Plater *q, MainFrame *main_frame);
|
priv(Plater *q, MainFrame *main_frame);
|
||||||
|
|
||||||
|
@ -1079,6 +1084,11 @@ const std::regex Plater::priv::pattern_bundle(".*[.](amf|amf[.]xml|zip[.]amf|3mf
|
||||||
const std::regex Plater::priv::pattern_3mf(".*3mf", std::regex::icase);
|
const std::regex Plater::priv::pattern_3mf(".*3mf", std::regex::icase);
|
||||||
const std::regex Plater::priv::pattern_zip_amf(".*[.]zip[.]amf", std::regex::icase);
|
const std::regex Plater::priv::pattern_zip_amf(".*[.]zip[.]amf", std::regex::icase);
|
||||||
const std::regex Plater::priv::pattern_any_amf(".*[.](amf|amf[.]xml|zip[.]amf)", std::regex::icase);
|
const std::regex Plater::priv::pattern_any_amf(".*[.](amf|amf[.]xml|zip[.]amf)", std::regex::icase);
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
#if ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
const std::regex Plater::priv::pattern_prusa(".*prusa", std::regex::icase);
|
||||||
|
#endif // ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
: q(q)
|
: q(q)
|
||||||
|
@ -1319,6 +1329,11 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
const bool type_3mf = std::regex_match(path.string(), pattern_3mf);
|
const bool type_3mf = std::regex_match(path.string(), pattern_3mf);
|
||||||
const bool type_zip_amf = !type_3mf && std::regex_match(path.string(), pattern_zip_amf);
|
const bool type_zip_amf = !type_3mf && std::regex_match(path.string(), pattern_zip_amf);
|
||||||
const bool type_any_amf = !type_3mf && std::regex_match(path.string(), pattern_any_amf);
|
const bool type_any_amf = !type_3mf && std::regex_match(path.string(), pattern_any_amf);
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
#if ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
const bool type_prusa = std::regex_match(path.string(), pattern_prusa);
|
||||||
|
#endif // ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
Slic3r::Model model;
|
Slic3r::Model model;
|
||||||
try {
|
try {
|
||||||
|
@ -1365,7 +1380,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
|
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
#if ENABLE_VOLUMES_CENTERING_FIXES
|
#if ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
if (!type_3mf && !type_any_amf) {
|
if (!type_3mf && !type_any_amf && !type_prusa) {
|
||||||
#endif // ENABLE_VOLUMES_CENTERING_FIXES
|
#endif // ENABLE_VOLUMES_CENTERING_FIXES
|
||||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
if (model.looks_like_multipart_object()) {
|
if (model.looks_like_multipart_object()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue