mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 21:18:58 +08:00
Merge branch 'master' of https://github.com/Prusa-Development/PrusaSlicerPrivate
This commit is contained in:
commit
809e22092d
@ -615,7 +615,7 @@ public:
|
||||
static double nil_value() { return std::numeric_limits<double>::quiet_NaN(); }
|
||||
// A scalar is nil, or all values of a vector are nil.
|
||||
bool is_nil() const override { for (auto v : this->values) if (! std::isnan(v)) return false; return true; }
|
||||
bool is_nil(size_t idx) const override { return std::isnan(this->values[idx]); }
|
||||
bool is_nil(size_t idx) const override { return std::isnan(this->values[idx < values.size() ? idx : 0]); }
|
||||
|
||||
std::string serialize() const override
|
||||
{
|
||||
@ -1092,7 +1092,7 @@ public:
|
||||
static FloatOrPercent nil_value() { return { std::numeric_limits<double>::quiet_NaN(), false }; }
|
||||
// A scalar is nil, or all values of a vector are nil.
|
||||
bool is_nil() const override { for (auto v : this->values) if (! std::isnan(v.value)) return false; return true; }
|
||||
bool is_nil(size_t idx) const override { return std::isnan(this->values[idx].value); }
|
||||
bool is_nil(size_t idx) const override { return std::isnan(this->values[idx < values.size() ? idx : 0].value); }
|
||||
|
||||
std::string serialize() const override
|
||||
{
|
||||
@ -1404,7 +1404,7 @@ public:
|
||||
static unsigned char nil_value() { return std::numeric_limits<unsigned char>::max(); }
|
||||
// A scalar is nil, or all values of a vector are nil.
|
||||
bool is_nil() const override { for (auto v : this->values) if (v != nil_value()) return false; return true; }
|
||||
bool is_nil(size_t idx) const override { return this->values[idx] == nil_value(); }
|
||||
bool is_nil(size_t idx) const override { return this->values[idx < values.size() ? idx : 0] == nil_value(); }
|
||||
|
||||
bool& get_at(size_t i) {
|
||||
assert(! this->values.empty());
|
||||
|
@ -68,13 +68,14 @@ indexed_triangle_set create_pad(const SupportableMesh &sm,
|
||||
const indexed_triangle_set &support_mesh,
|
||||
const JobController &ctl)
|
||||
{
|
||||
constexpr float PadSamplingLH = 0.1f;
|
||||
|
||||
ExPolygons model_contours; // This will store the base plate of the pad.
|
||||
double pad_h = sm.pad_cfg.full_height();
|
||||
|
||||
float zstart = ground_level(sm);
|
||||
float zend = zstart + float(pad_h + EPSILON);
|
||||
auto heights = grid(zstart, zend, 0.1f);
|
||||
double pad_h = sm.pad_cfg.full_height();
|
||||
auto gndlvl = float(ground_level(sm));
|
||||
float zstart = gndlvl - bool(sm.pad_cfg.embed_object) * sm.pad_cfg.wall_thickness_mm;
|
||||
float zend = zstart + float(pad_h + PadSamplingLH + EPSILON);
|
||||
auto heights = grid(zstart, zend, PadSamplingLH);
|
||||
|
||||
if (!sm.cfg.enabled || sm.pad_cfg.embed_object) {
|
||||
// No support (thus no elevation) or zero elevation mode
|
||||
@ -91,7 +92,7 @@ indexed_triangle_set create_pad(const SupportableMesh &sm,
|
||||
indexed_triangle_set out;
|
||||
create_pad(sup_contours, model_contours, out, sm.pad_cfg);
|
||||
|
||||
Vec3f offs{.0f, .0f, zstart};
|
||||
Vec3f offs{.0f, .0f, gndlvl};
|
||||
for (auto &p : out.vertices) p += offs;
|
||||
|
||||
its_merge_vertices(out);
|
||||
|
Loading…
x
Reference in New Issue
Block a user