FIX: improve speed of calculating lay plane
The code references PrusaSlicer Change-Id: Ie39d8ce0dc6d98ef1fc062828b4818825923169f (cherry picked from commit d17e7d90f885109e14c0b48f92a6366ba0af44c6)
This commit is contained in:
parent
5d36231752
commit
059ea09353
|
@ -151,9 +151,9 @@ void GLGizmoFlatten::update_planes()
|
||||||
std::vector<bool> facet_visited(num_of_facets, false);
|
std::vector<bool> facet_visited(num_of_facets, false);
|
||||||
int facet_queue_cnt = 0;
|
int facet_queue_cnt = 0;
|
||||||
const stl_normal* normal_ptr = nullptr;
|
const stl_normal* normal_ptr = nullptr;
|
||||||
|
int facet_idx = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
// Find next unvisited triangle:
|
// Find next unvisited triangle:
|
||||||
int facet_idx = 0;
|
|
||||||
for (; facet_idx < num_of_facets; ++ facet_idx)
|
for (; facet_idx < num_of_facets; ++ facet_idx)
|
||||||
if (!facet_visited[facet_idx]) {
|
if (!facet_visited[facet_idx]) {
|
||||||
facet_queue[facet_queue_cnt ++] = facet_idx;
|
facet_queue[facet_queue_cnt ++] = facet_idx;
|
||||||
|
@ -250,7 +250,8 @@ void GLGizmoFlatten::update_planes()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (discard) {
|
if (discard) {
|
||||||
m_planes.erase(m_planes.begin() + (polygon_id--));
|
m_planes[polygon_id--] = std::move(m_planes.back());
|
||||||
|
m_planes.pop_back();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue