mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 10:11:10 -06:00
Drain holes are now saved in ModelObject
Internal changes in GLGizmoHollow.cpp
This commit is contained in:
parent
9836533cb3
commit
645f13a0ae
6 changed files with 289 additions and 349 deletions
|
|
@ -606,6 +606,7 @@ ModelObject& ModelObject::assign_copy(const ModelObject &rhs)
|
|||
assert(this->config.id() == rhs.config.id());
|
||||
this->sla_support_points = rhs.sla_support_points;
|
||||
this->sla_points_status = rhs.sla_points_status;
|
||||
this->sla_drain_holes = rhs.sla_drain_holes;
|
||||
this->layer_config_ranges = rhs.layer_config_ranges; // #ys_FIXME_experiment
|
||||
this->layer_height_profile = rhs.layer_height_profile;
|
||||
this->printable = rhs.printable;
|
||||
|
|
@ -646,6 +647,7 @@ ModelObject& ModelObject::assign_copy(ModelObject &&rhs)
|
|||
assert(this->config.id() == rhs.config.id());
|
||||
this->sla_support_points = std::move(rhs.sla_support_points);
|
||||
this->sla_points_status = std::move(rhs.sla_points_status);
|
||||
this->sla_drain_holes = std::move(rhs.sla_drain_holes);
|
||||
this->layer_config_ranges = std::move(rhs.layer_config_ranges); // #ys_FIXME_experiment
|
||||
this->layer_height_profile = std::move(rhs.layer_height_profile);
|
||||
this->origin_translation = std::move(rhs.origin_translation);
|
||||
|
|
@ -1099,6 +1101,7 @@ ModelObjectPtrs ModelObject::cut(size_t instance, coordf_t z, bool keep_upper, b
|
|||
if (keep_upper) {
|
||||
upper->set_model(nullptr);
|
||||
upper->sla_support_points.clear();
|
||||
lower->sla_drain_holes.clear();
|
||||
upper->sla_points_status = sla::PointsStatus::NoPoints;
|
||||
upper->clear_volumes();
|
||||
upper->input_file = "";
|
||||
|
|
@ -1107,6 +1110,7 @@ ModelObjectPtrs ModelObject::cut(size_t instance, coordf_t z, bool keep_upper, b
|
|||
if (keep_lower) {
|
||||
lower->set_model(nullptr);
|
||||
lower->sla_support_points.clear();
|
||||
lower->sla_drain_holes.clear();
|
||||
lower->sla_points_status = sla::PointsStatus::NoPoints;
|
||||
lower->clear_volumes();
|
||||
lower->input_file = "";
|
||||
|
|
|
|||
|
|
@ -203,6 +203,9 @@ public:
|
|||
// the SLA gizmo and the backend).
|
||||
sla::PointsStatus sla_points_status = sla::PointsStatus::NoPoints;
|
||||
|
||||
// Holes to be drilled into the object so resin can flow out
|
||||
std::vector<sla::DrainHole> sla_drain_holes;
|
||||
|
||||
/* This vector accumulates the total translation applied to the object by the
|
||||
center_around_origin() method. Callers might want to apply the same translation
|
||||
to new volumes before adding them to this object in order to preserve alignment
|
||||
|
|
@ -372,7 +375,7 @@ private:
|
|||
template<class Archive> void serialize(Archive &ar) {
|
||||
ar(cereal::base_class<ObjectBase>(this));
|
||||
Internal::StaticSerializationWrapper<ModelConfig> config_wrapper(config);
|
||||
ar(name, input_file, instances, volumes, config_wrapper, layer_config_ranges, layer_height_profile, sla_support_points, sla_points_status, printable, origin_translation,
|
||||
ar(name, input_file, instances, volumes, config_wrapper, layer_config_ranges, layer_height_profile, sla_support_points, sla_points_status, sla_drain_holes, printable, origin_translation,
|
||||
m_bounding_box, m_bounding_box_valid, m_raw_bounding_box, m_raw_bounding_box_valid, m_raw_mesh_bounding_box, m_raw_mesh_bounding_box_valid);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -80,6 +80,39 @@ struct SupportPoint
|
|||
|
||||
using SupportPoints = std::vector<SupportPoint>;
|
||||
|
||||
struct DrainHole
|
||||
{
|
||||
Vec3f m_pos;
|
||||
Vec3f m_normal;
|
||||
float m_radius;
|
||||
float m_height;
|
||||
|
||||
DrainHole()
|
||||
: m_pos(Vec3f::Zero()), m_normal(Vec3f::UnitZ()), m_radius(5.f),
|
||||
m_height(10.f)
|
||||
{}
|
||||
|
||||
DrainHole(Vec3f position, Vec3f normal, float radius, float height)
|
||||
: m_pos(position)
|
||||
, m_normal(normal)
|
||||
, m_radius(radius)
|
||||
, m_height(height)
|
||||
{}
|
||||
|
||||
bool operator==(const DrainHole &sp) const
|
||||
{
|
||||
return (m_pos == sp.m_pos) && (m_normal == sp.m_normal)
|
||||
&& is_approx(m_radius, sp.m_radius) && is_approx(m_height, sp.m_height);
|
||||
}
|
||||
|
||||
bool operator!=(const DrainHole &sp) const { return !(sp == (*this)); }
|
||||
|
||||
template<class Archive> void serialize(Archive &ar)
|
||||
{
|
||||
ar(m_pos, m_normal, m_radius, m_height);
|
||||
}
|
||||
};
|
||||
|
||||
struct Contour3D;
|
||||
|
||||
/// An index-triangle structure for libIGL functions. Also serves as an
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue