mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
merge tm_sla_supports_backend with master
This commit is contained in:
commit
17f15f7617
14 changed files with 100 additions and 33 deletions
|
@ -1,7 +1,7 @@
|
|||
#ifndef MTUTILS_HPP
|
||||
#define MTUTILS_HPP
|
||||
|
||||
#include <atomic> // for std::atomic_flag
|
||||
#include <atomic> // for std::atomic_flag and memory orders
|
||||
#include <mutex> // for std::lock_guard
|
||||
#include <functional> // for std::function
|
||||
#include <utility> // for std::forward
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
// invalidate the value of the object. The object will be refreshed at the
|
||||
// next retrieval (Setter will be called). The data that is used in
|
||||
// the setter function should be guarded as well if it is modified so the
|
||||
// the setter function should be guarded as well during modification so the
|
||||
// modification has to take place in fn.
|
||||
inline void invalidate(std::function<void()> fn) {
|
||||
std::lock_guard<SpinMutex> lck(m_lck); fn(); m_valid = false;
|
||||
|
|
|
@ -1051,9 +1051,6 @@ void ModelObject::split(ModelObjectPtrs* new_objects)
|
|||
ModelVolume* volume = this->volumes.front();
|
||||
TriangleMeshPtrs meshptrs = volume->mesh.split();
|
||||
for (TriangleMesh *mesh : meshptrs) {
|
||||
// Snap the mesh to Z=0.
|
||||
float z0 = FLT_MAX;
|
||||
|
||||
mesh->repair();
|
||||
|
||||
// XXX: this seems to be the only real usage of m_model, maybe refactor this so that it's not needed?
|
||||
|
@ -1063,7 +1060,20 @@ void ModelObject::split(ModelObjectPtrs* new_objects)
|
|||
new_object->instances.reserve(this->instances.size());
|
||||
for (const ModelInstance *model_instance : this->instances)
|
||||
new_object->add_instance(*model_instance);
|
||||
#if ENABLE_MODELVOLUME_TRANSFORM
|
||||
ModelVolume* new_vol = new_object->add_volume(*volume, std::move(*mesh));
|
||||
new_vol->center_geometry();
|
||||
|
||||
for (ModelInstance* model_instance : new_object->instances)
|
||||
{
|
||||
Vec3d shift = model_instance->get_transformation().get_matrix(true) * new_vol->get_offset();
|
||||
model_instance->set_offset(model_instance->get_offset() + shift);
|
||||
}
|
||||
|
||||
new_vol->set_offset(Vec3d::Zero());
|
||||
#else
|
||||
new_object->add_volume(*volume, std::move(*mesh));
|
||||
#endif // ENABLE_MODELVOLUME_TRANSFORM
|
||||
new_objects->emplace_back(new_object);
|
||||
delete mesh;
|
||||
}
|
||||
|
|
|
@ -20,9 +20,6 @@ public:
|
|||
inline double radius() const { return radius_; }
|
||||
inline const Point& center() const { return center_; }
|
||||
inline operator bool() { return !std::isnan(radius_); }
|
||||
// inline operator lnCircle() {
|
||||
// return lnCircle({center_(0), center_(1)}, radius_);
|
||||
// }
|
||||
};
|
||||
|
||||
enum class BedShapeType {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue