Skip to content
Snippets Groups Projects
Commit 39aab8eb authored by Daniel Schramm's avatar Daniel Schramm
Browse files

PrioritySphere visitor clears list of priorities when a facet is processed repeatedly

parent ad15fe88
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,8 @@ public class PrioritySphere extends MeshVisitor {
public void visitMeshFacet(MeshFacet facet) {
final List<MeshPoint> vertices = facet.getVertices();
final List<Double> prioritiesList = new ArrayList<>(vertices.size());
for (int i = 0; i < vertices.size(); i++) {
final double distance = sphereCenterPosition.distance(vertices.get(i).getPosition());
final double priority;
......@@ -76,10 +78,11 @@ public class PrioritySphere extends MeshVisitor {
priority = 1 - distance / sphereRadius;
}
synchronized(this) {
priorities.computeIfAbsent(facet, meshFacet -> new ArrayList<>())
.add(priority);
}
prioritiesList.add(priority);
}
synchronized(this) {
priorities.put(facet, prioritiesList);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment