mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 03:39:13 +08:00
Fixed merge conflict: Added ModelInstance ID to the SLAPrintObject Instance
This commit is contained in:
parent
fedc78dc91
commit
3858fecf0c
@ -96,11 +96,11 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model,
|
|||||||
for (ModelObject *model_object : m_model.objects) {
|
for (ModelObject *model_object : m_model.objects) {
|
||||||
auto po = new SLAPrintObject(this, model_object);
|
auto po = new SLAPrintObject(this, model_object);
|
||||||
m_objects.emplace_back(po);
|
m_objects.emplace_back(po);
|
||||||
for(ModelInstance *oinst : model_object->instances) {
|
for (ModelInstance *oinst : model_object->instances) {
|
||||||
Point tr = Point::new_scale(oinst->get_offset()(X),
|
Point tr = Point::new_scale(oinst->get_offset()(X),
|
||||||
oinst->get_offset()(Y));
|
oinst->get_offset()(Y));
|
||||||
auto rotZ = float(oinst->get_rotation()(Z));
|
auto rotZ = float(oinst->get_rotation()(Z));
|
||||||
po->m_instances.emplace_back(tr, rotZ);
|
po->m_instances.emplace_back(oinst->id(), tr, rotZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,14 @@ public:
|
|||||||
const Transform3d& trafo() const { return m_trafo; }
|
const Transform3d& trafo() const { return m_trafo; }
|
||||||
|
|
||||||
struct Instance {
|
struct Instance {
|
||||||
ModelID instance_id;
|
Instance(ModelID instance_id, const Point &shift, float rotation) : instance_id(instance_id), shift(shift), rotation(rotation) {}
|
||||||
// Slic3r::Point objects in scaled G-code coordinates
|
// ID of the corresponding ModelInstance.
|
||||||
|
ModelID instance_id;
|
||||||
|
// Slic3r::Point objects in scaled G-code coordinates
|
||||||
Point shift;
|
Point shift;
|
||||||
// Rotation along the Z axis, in radians.
|
// Rotation along the Z axis, in radians.
|
||||||
float rotation;
|
float rotation;
|
||||||
};
|
};
|
||||||
const std::vector<Instance>& instances() const { return m_instances; }
|
const std::vector<Instance>& instances() const { return m_instances; }
|
||||||
|
|
||||||
// Get a support mesh centered around origin in XY, and with zero rotation around Z applied.
|
// Get a support mesh centered around origin in XY, and with zero rotation around Z applied.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user