Cut: fixed an issue when the view rotates to the other side of the plane
This commit is contained in:
parent
7b576d3312
commit
2aa55ef950
@ -392,12 +392,11 @@ void MeshClipper::recalculate_triangles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
isl.expoly = std::move(exp);
|
isl.expoly = std::move(exp);
|
||||||
isl.expoly_bb = get_extents(exp);
|
isl.expoly_bb = get_extents(isl.expoly);
|
||||||
isl.hash = 0;
|
|
||||||
for (const Point& pt : isl.expoly.contour) {
|
Point centroid_scaled = isl.expoly.contour.centroid();
|
||||||
isl.hash ^= pt.x();
|
Vec3d centroid_world = m_result->trafo * Vec3d(unscale(centroid_scaled).x(), unscale(centroid_scaled).y(), 0.);
|
||||||
isl.hash ^= pt.y();
|
isl.hash = isl.expoly.contour.size() + size_t(std::abs(100.*centroid_world.x())) + size_t(std::abs(100.*centroid_world.y())) + size_t(std::abs(100.*centroid_world.z()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now sort the islands so they are in defined order. This is a hack needed by cut gizmo, which sometimes
|
// Now sort the islands so they are in defined order. This is a hack needed by cut gizmo, which sometimes
|
||||||
|
@ -141,7 +141,7 @@ private:
|
|||||||
ExPolygon expoly;
|
ExPolygon expoly;
|
||||||
BoundingBox expoly_bb;
|
BoundingBox expoly_bb;
|
||||||
bool disabled = false;
|
bool disabled = false;
|
||||||
coord_t hash;
|
size_t hash;
|
||||||
};
|
};
|
||||||
struct ClipResult {
|
struct ClipResult {
|
||||||
std::vector<CutIsland> cut_islands;
|
std::vector<CutIsland> cut_islands;
|
||||||
|
Loading…
Reference in New Issue
Block a user