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_bb = get_extents(exp);
|
||||
isl.hash = 0;
|
||||
for (const Point& pt : isl.expoly.contour) {
|
||||
isl.hash ^= pt.x();
|
||||
isl.hash ^= pt.y();
|
||||
}
|
||||
isl.expoly_bb = get_extents(isl.expoly);
|
||||
|
||||
Point centroid_scaled = isl.expoly.contour.centroid();
|
||||
Vec3d centroid_world = m_result->trafo * Vec3d(unscale(centroid_scaled).x(), unscale(centroid_scaled).y(), 0.);
|
||||
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
|
||||
|
@ -141,7 +141,7 @@ private:
|
||||
ExPolygon expoly;
|
||||
BoundingBox expoly_bb;
|
||||
bool disabled = false;
|
||||
coord_t hash;
|
||||
size_t hash;
|
||||
};
|
||||
struct ClipResult {
|
||||
std::vector<CutIsland> cut_islands;
|
||||
|
Loading…
Reference in New Issue
Block a user