mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-02 17:58:22 -05:00
Merge upstream/main and refine exclusion-volume configuration UI
This commit is contained in:
commit
2c0ce5c38b
4547 files changed
+2646026
-2483438
No files matched your search
+59
-9
@@ -1,4 +1,21 @@
|
||||
#include "Model.hpp"
|
||||
#include "calib.hpp"
|
||||
#include "Format/STEP.hpp"
|
||||
#include "TriangleMesh.hpp"
|
||||
#include "Semver.hpp"
|
||||
#include "Format/OBJ.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "Format/STL.hpp"
|
||||
#include "Format/objparser.hpp"
|
||||
#include "CustomGCode.hpp"
|
||||
#include "PrintConfig.hpp"
|
||||
#include "ObjectID.hpp"
|
||||
#include "BoundingBox.hpp"
|
||||
#include "Point.hpp"
|
||||
#include "Utils.hpp"
|
||||
#include "Polygon.hpp"
|
||||
#include "SLA/SupportPoint.hpp"
|
||||
#include "TextureDisplacement.hpp"
|
||||
#include "libslic3r.h"
|
||||
#include "AABBTreeIndirect.hpp"
|
||||
#include "BuildVolume.hpp"
|
||||
@@ -6,7 +23,6 @@
|
||||
#include "Format/AssimpImport.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
#include "Exception.hpp"
|
||||
#include "Model.hpp"
|
||||
#include "ModelArrange.hpp"
|
||||
#include "Arrange.hpp"
|
||||
#include "Geometry.hpp"
|
||||
@@ -26,7 +42,17 @@
|
||||
#include "libslic3r/Geometry/ConvexHull.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <exception>
|
||||
#include <cmath>
|
||||
#include <array>
|
||||
#include <float.h>
|
||||
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
@@ -39,6 +65,21 @@
|
||||
#include <Eigen/Dense>
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <set>
|
||||
#include <optional>
|
||||
#include <iostream>
|
||||
#include <ios>
|
||||
#include <ostream>
|
||||
#include <initializer_list>
|
||||
#include "GCodeWriter.hpp"
|
||||
|
||||
// BBS: for segment
|
||||
@@ -47,6 +88,7 @@
|
||||
|
||||
// Transtltion
|
||||
#include "I18N.hpp"
|
||||
#include "ExPolygon.hpp"
|
||||
|
||||
// ModelIO support
|
||||
#ifdef __APPLE__
|
||||
@@ -283,8 +325,7 @@ Model Model::read_from_file(const std::string&
|
||||
Import3mfProgressFn proFn,
|
||||
ImportstlProgressFn stlFn,
|
||||
BBLProject * project,
|
||||
int plate_id,
|
||||
ObjImportColorFn objFn)
|
||||
int plate_id)
|
||||
{
|
||||
Model model;
|
||||
|
||||
@@ -1234,7 +1275,6 @@ ModelObject& ModelObject::assign_copy(const ModelObject &rhs)
|
||||
this->volumes.emplace_back(new ModelVolume(*model_volume));
|
||||
this->volumes.back()->set_model_object(this);
|
||||
}
|
||||
|
||||
this->clear_instances();
|
||||
this->instances.reserve(rhs.instances.size());
|
||||
for (const ModelInstance *model_instance : rhs.instances) {
|
||||
@@ -1273,7 +1313,6 @@ ModelObject& ModelObject::assign_copy(ModelObject &&rhs)
|
||||
rhs.volumes.clear();
|
||||
for (ModelVolume *model_volume : this->volumes)
|
||||
model_volume->set_model_object(this);
|
||||
|
||||
this->clear_instances();
|
||||
this->instances = std::move(rhs.instances);
|
||||
rhs.instances.clear();
|
||||
@@ -1397,9 +1436,7 @@ ModelVolume* ModelObject::add_volume_with_shared_mesh(const ModelVolume &other,
|
||||
void ModelObject::delete_volume(size_t idx)
|
||||
{
|
||||
ModelVolumePtrs::iterator i = this->volumes.begin() + idx;
|
||||
ModelVolume* volume_to_delete = *i;
|
||||
|
||||
delete volume_to_delete;
|
||||
delete *i;
|
||||
this->volumes.erase(i);
|
||||
|
||||
if (this->volumes.size() == 1)
|
||||
@@ -1492,6 +1529,7 @@ void ModelObject::sort_volumes(bool full_sort)
|
||||
return vl_type < vr_type;
|
||||
});
|
||||
}
|
||||
|
||||
ModelInstance* ModelObject::add_instance()
|
||||
{
|
||||
ModelInstance* i = new ModelInstance(this);
|
||||
@@ -1662,6 +1700,9 @@ indexed_triangle_set ModelObject::raw_indexed_triangle_set() const
|
||||
size_t j = out.indices.size();
|
||||
append(out.vertices, v->mesh().its.vertices);
|
||||
append(out.indices, v->mesh().its.indices);
|
||||
// Orca: Point the volume's triangles at its own vertices, which follow those of the volumes before it.
|
||||
for (size_t k = j; k < out.indices.size(); ++ k)
|
||||
out.indices[k] += stl_triangle_vertex_indices::Constant(int(i));
|
||||
const Transform3d& m = v->get_matrix();
|
||||
for (; i < out.vertices.size(); ++ i)
|
||||
out.vertices[i] = (m * out.vertices[i].cast<double>()).cast<float>().eval();
|
||||
@@ -2091,6 +2132,11 @@ void ModelVolume::reset_extra_facets()
|
||||
this->seam_facets.reset();
|
||||
this->mmu_segmentation_facets.reset();
|
||||
this->fuzzy_skin_facets.reset();
|
||||
// Texture-displacement paint data has no remap-across-topology-change support yet (see
|
||||
// build_texture_displacement()'s documented limitation), so it must be dropped here rather
|
||||
// than left referring to a mesh that no longer matches it.
|
||||
for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
|
||||
this->texture_displacement_facet(i).reset();
|
||||
}
|
||||
|
||||
std::optional<TriangleSelector::SavedPainting> ModelVolume::save_painting() const
|
||||
@@ -2993,6 +3039,11 @@ void ModelVolume::assign_new_unique_ids_recursive()
|
||||
seam_facets.set_new_unique_id();
|
||||
mmu_segmentation_facets.set_new_unique_id();
|
||||
fuzzy_skin_facets.set_new_unique_id();
|
||||
// As set_new_unique_id() already does: the undo/redo stack stores FacetsAnnotation contents keyed
|
||||
// by ObjectID, so a clone left sharing these ids with its source can be handed the source's mask
|
||||
// on an undo - after which a paint mask and the mesh it was recorded against no longer match.
|
||||
for (int i = 0; i < int(TEXTURE_DISPLACEMENT_MAX_LAYERS); ++i)
|
||||
texture_displacement_facet(i).set_new_unique_id();
|
||||
}
|
||||
|
||||
void ModelVolume::rotate(double angle, Axis axis)
|
||||
@@ -4155,7 +4206,6 @@ bool model_volume_list_changed(const ModelObject &model_object_old, const ModelO
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
template< typename TypeFilterFn, typename CompareFn>
|
||||
bool model_property_changed(const ModelObject &model_object_old, const ModelObject &model_object_new, TypeFilterFn type_filter, CompareFn compare)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user