mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 18:42:24 +00:00
Fix overflow in distance_to(Line*). It was affecting Douglas-Peucker causing massive loss of geometry. Includes regression test and a couple wkt() implementations
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
#include "Line.hpp"
|
||||
#include "Polyline.hpp"
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
std::string
|
||||
Line::wkt() const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "LINESTRING(" << this->a.x << " " << this->a.y << ","
|
||||
<< this->b.x << " " << this->b.y << ")";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
Line::operator Polyline() const
|
||||
{
|
||||
Polyline pl;
|
||||
|
||||
Reference in New Issue
Block a user