Skip to content
Snippets Groups Projects
Commit a8f273ec authored by Jan Schnathmeier's avatar Jan Schnathmeier
Browse files

Readability and (maybe) speed improvement in smoothing code

parent e5606a43
Branches
No related tags found
No related merge requests found
......@@ -617,18 +617,19 @@ void IsotropicRemesher::SmoothVertexVWD(Embedding *embedding,
// Find neighbors, limited by sector border
for (auto boheh : base_mesh->voh_range(bvhcurr)) {
if (!embedding->IsSectorBorder(base_mesh->to_vertex_handle(boheh), mih_list)) {
double newlength = base_mesh->property(*distances, bvhcurr).at(it)
+ base_mesh->calc_edge_length(boheh);
if (base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh)).size() < it+1) {
base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh)).push_back(
base_mesh->property(*distances, bvhcurr).at(it)
+ base_mesh->calc_edge_length(boheh));
base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh))
.push_back(newlength);
assert(base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh)).size()
== it+1);
minheap.push(std::make_pair(base_mesh->to_vertex_handle(boheh),
base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh))));
} else if (base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh)).at(it) >
base_mesh->property(*distances, bvhcurr).at(it) + base_mesh->calc_edge_length(boheh)) {
} else if (base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh)).at(it)
> newlength) {
base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh)).at(it)
= base_mesh->property(*distances, bvhcurr).at(it) + base_mesh->calc_edge_length(boheh);
= newlength;
minheap.push(std::make_pair(base_mesh->to_vertex_handle(boheh),
base_mesh->property(*distances, base_mesh->to_vertex_handle(boheh))));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment