mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 19:49:03 +08:00
Fix the issue with point skipping in svg export
This commit is contained in:
parent
dea3c2cea3
commit
be78bdf5ff
@ -84,15 +84,16 @@ void append_svg(std::string &buf, const Polygon &poly)
|
|||||||
buf += decimal_from(c.x(), intbuf);
|
buf += decimal_from(c.x(), intbuf);
|
||||||
buf += " "sv;
|
buf += " "sv;
|
||||||
buf += decimal_from(c.y(), intbuf);
|
buf += decimal_from(c.y(), intbuf);
|
||||||
buf += " m"sv;
|
buf += " l "sv;
|
||||||
|
|
||||||
for (auto &p : poly) {
|
for (const Point &p : poly) {
|
||||||
auto d = p - c;
|
Point d = p - c;
|
||||||
if (d.squaredNorm() == 0) continue;
|
if (d.x() == 0 && d.y() == 0)
|
||||||
|
continue;
|
||||||
buf += " "sv;
|
buf += " "sv;
|
||||||
buf += decimal_from(p.x() - c.x(), intbuf);
|
buf += decimal_from(p.x() - c.x(), intbuf);
|
||||||
buf += " "sv;
|
buf += " "sv;
|
||||||
buf += decimal_from(p.y() - c.y(), intbuf);
|
buf += decimal_from(d.y(), intbuf);
|
||||||
c = p;
|
c = p;
|
||||||
}
|
}
|
||||||
buf += " z\""sv; // mark path as closed
|
buf += " z\""sv; // mark path as closed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user