mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 10:25:56 +08:00
ArcWelder: Optimization of least squares fitting.
This commit is contained in:
parent
dc048031bc
commit
5b3dcc80f6
@ -34,6 +34,7 @@
|
|||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <boost/log/trivial.hpp>
|
#include <boost/log/trivial.hpp>
|
||||||
|
#include <boost/container/small_vector.hpp>
|
||||||
|
|
||||||
namespace Slic3r { namespace Geometry { namespace ArcWelder {
|
namespace Slic3r { namespace Geometry { namespace ArcWelder {
|
||||||
|
|
||||||
@ -309,7 +310,7 @@ static std::optional<Circle> try_create_circle(const Points::const_iterator begi
|
|||||||
if (circle) {
|
if (circle) {
|
||||||
// Fit the arc between the end points by least squares.
|
// Fit the arc between the end points by least squares.
|
||||||
// Optimize over all points along the path and the centers of the segments.
|
// Optimize over all points along the path and the centers of the segments.
|
||||||
std::vector<Vec2d> fpts;
|
boost::container::small_vector<Vec2d, 16> fpts;
|
||||||
Vec2d first_point = begin->cast<double>();
|
Vec2d first_point = begin->cast<double>();
|
||||||
Vec2d last_point = std::prev(end)->cast<double>();
|
Vec2d last_point = std::prev(end)->cast<double>();
|
||||||
Vec2d prev_point = first_point;
|
Vec2d prev_point = first_point;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user