mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fixed rotation of SLA instances in case a rotation in X or Y was applied
to the instances.
This commit is contained in:
parent
9bc93134f9
commit
ca6a5af1dc
4 changed files with 47 additions and 34 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "SLA/SLABasePool.hpp"
|
||||
#include "SLA/SLAAutoSupports.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
#include "Geometry.hpp"
|
||||
#include "MTUtils.hpp"
|
||||
|
||||
#include <unordered_set>
|
||||
|
@ -103,13 +104,18 @@ static Transform3d sla_trafo(const ModelObject &model_object)
|
|||
static std::vector<SLAPrintObject::Instance> sla_instances(const ModelObject &model_object)
|
||||
{
|
||||
std::vector<SLAPrintObject::Instance> instances;
|
||||
for (ModelInstance *model_instance : model_object.instances)
|
||||
if (model_instance->is_printable()) {
|
||||
instances.emplace_back(
|
||||
model_instance->id(),
|
||||
Point::new_scale(model_instance->get_offset(X), model_instance->get_offset(Y)),
|
||||
float(model_instance->get_rotation(Z)));
|
||||
}
|
||||
assert(! model_object.instances.empty());
|
||||
if (! model_object.instances.empty()) {
|
||||
Vec3d rotation0 = model_object.instances.front()->get_rotation();
|
||||
rotation0(2) = 0.;
|
||||
for (ModelInstance *model_instance : model_object.instances)
|
||||
if (model_instance->is_printable()) {
|
||||
instances.emplace_back(
|
||||
model_instance->id(),
|
||||
Point::new_scale(model_instance->get_offset(X), model_instance->get_offset(Y)),
|
||||
float(Geometry::rotation_diff_z(rotation0, model_instance->get_rotation())));
|
||||
}
|
||||
}
|
||||
return instances;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue