PRUSA 2.7.0

This commit is contained in:
sunsets
2023-12-27 18:02:35 +08:00
parent b33112327f
commit 0a3c63dcb1
488 changed files with 92371 additions and 29443 deletions

View File

@@ -91,7 +91,7 @@ void fill_distances(const Polygon &poly, std::vector<double> &distances)
double dist = 0.;
auto lrange = line_range(poly);
for (const Line &l : lrange) {
for (const Line l : lrange) {
dist += l.length();
distances.emplace_back(dist);
}

View File

@@ -14,7 +14,9 @@ struct GravityKernel {
std::optional<Vec2crd> item_sink;
Vec2d active_sink;
GravityKernel(Vec2crd gravity_center) : sink{gravity_center} {}
GravityKernel(Vec2crd gravity_center) :
sink{gravity_center}, active_sink{unscaled(gravity_center)} {}
GravityKernel() = default;
template<class ArrItem>

View File

@@ -24,6 +24,7 @@ bool find_initial_position(Itm &itm,
{
if (all_items_range(packing_context).empty()) {
auto rotations = allowed_rotations(itm);
set_rotation(itm, 0.);
auto chull = envelope_convex_hull(itm);
for (double rot : rotations) {

View File

@@ -129,7 +129,7 @@ Polygon ifp_convex_convex(const Polygon &fixed, const Polygon &movable)
// the zero area polygon formed by the edge. The union of all these sub-nfps
// will contain a hole that is the actual ifp.
auto lrange = line_range(fixed);
for (const Line &l : lrange) { // Older mac compilers generate warnging if line_range is called in-place
for (const Line l : lrange) { // Older mac compilers generate warnging if line_range is called in-place
Polygon fixed = {l.a, l.b};
subnfps.emplace_back(nfp_convex_convex_legacy(fixed, movable));
}