mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-27 10:41:15 -06:00
Merge remote-tracking branch 'origin/dev_native' into tm_sla_supports_backend
# Conflicts: # src/libslic3r/SLAPrint.hpp
This commit is contained in:
commit
9a93b1d3e9
19 changed files with 441 additions and 167 deletions
|
|
@ -1244,16 +1244,26 @@ size_t ModelVolume::split(unsigned int max_extruders)
|
|||
std::string name = this->name;
|
||||
|
||||
Model::reset_auto_extruder_id();
|
||||
#if ENABLE_MODELVOLUME_TRANSFORM
|
||||
Vec3d offset = this->get_offset();
|
||||
#endif // ENABLE_MODELVOLUME_TRANSFORM
|
||||
|
||||
for (TriangleMesh *mesh : meshptrs) {
|
||||
mesh->repair();
|
||||
if (idx == 0)
|
||||
{
|
||||
this->mesh = std::move(*mesh);
|
||||
this->calculate_convex_hull();
|
||||
}
|
||||
else
|
||||
this->object->volumes.insert(this->object->volumes.begin() + (++ ivolume), new ModelVolume(object, *this, std::move(*mesh)));
|
||||
char str_idx[64];
|
||||
sprintf(str_idx, "_%d", idx + 1);
|
||||
this->object->volumes[ivolume]->name = name + str_idx;
|
||||
this->object->volumes.insert(this->object->volumes.begin() + (++ivolume), new ModelVolume(object, *this, std::move(*mesh)));
|
||||
|
||||
#if ENABLE_MODELVOLUME_TRANSFORM
|
||||
this->object->volumes[ivolume]->set_offset(Vec3d::Zero());
|
||||
this->object->volumes[ivolume]->center_geometry();
|
||||
this->object->volumes[ivolume]->translate(offset);
|
||||
#endif // ENABLE_MODELVOLUME_TRANSFORM
|
||||
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));
|
||||
delete mesh;
|
||||
++ idx;
|
||||
|
|
|
|||
|
|
@ -371,4 +371,14 @@ SLAPrintObject::SLAPrintObject(SLAPrint *print, ModelObject *model_object):
|
|||
|
||||
SLAPrintObject::~SLAPrintObject() {}
|
||||
|
||||
TriangleMesh SLAPrintObject::support_mesh() const
|
||||
{
|
||||
return make_cube(10., 10., 10.);
|
||||
}
|
||||
|
||||
TriangleMesh SLAPrintObject::pad_mesh() const
|
||||
{
|
||||
return make_cube(10., 10., 10.);
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
|
|
|||
|
|
@ -37,7 +37,23 @@ private: // Prevents erroneous use by other classes.
|
|||
public:
|
||||
const ModelObject* model_object() const { return m_model_object; }
|
||||
ModelObject* model_object() { return m_model_object; }
|
||||
const Transform3d& trafo() const { return m_trafo; }
|
||||
|
||||
struct Instance {
|
||||
ModelID instance_id;
|
||||
// Slic3r::Point objects in scaled G-code coordinates
|
||||
Point shift;
|
||||
// Rotation along the Z axis, in radians.
|
||||
float rotation;
|
||||
};
|
||||
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.
|
||||
// Support mesh is only valid if this->is_step_done(slaposSupportTree) is true.
|
||||
TriangleMesh support_mesh() const;
|
||||
// Get a pad mesh centered around origin in XY, and with zero rotation around Z applied.
|
||||
// Support mesh is only valid if this->is_step_done(slaposPad) is true.
|
||||
TriangleMesh pad_mesh() const;
|
||||
|
||||
// I refuse to grantee copying (Tamas)
|
||||
SLAPrintObject(const SLAPrintObject&) = delete;
|
||||
|
|
@ -55,14 +71,6 @@ protected:
|
|||
{ this->m_config.apply_only(other, keys, ignore_nonexistent); }
|
||||
void set_trafo(const Transform3d& trafo) { m_trafo = trafo; }
|
||||
|
||||
struct Instance {
|
||||
// Slic3r::Point objects in scaled G-code coordinates
|
||||
Point shift;
|
||||
// Rotation along the Z axis, in radians.
|
||||
float rotation;
|
||||
Instance(const Point& tr, float rotZ): shift(tr), rotation(rotZ) {}
|
||||
};
|
||||
|
||||
bool set_instances(const std::vector<Instance> &instances);
|
||||
// Invalidates the step, and its depending steps in SLAPrintObject and SLAPrint.
|
||||
bool invalidate_step(SLAPrintObjectStep step);
|
||||
|
|
@ -152,6 +160,7 @@ public:
|
|||
if(m_printer) m_printer->save<Fmt>(fname);
|
||||
std::cout << "Would export the SLA raster" << std::endl;
|
||||
}
|
||||
const PrintObjects& objects() const { return m_objects; }
|
||||
|
||||
private:
|
||||
using SLAPrinter = FilePrinter<FilePrinterFormat::SLA_PNGZIP>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue