From 5dcab953581b09ba056a4fda47055fada43c87a3 Mon Sep 17 00:00:00 2001 From: Remco Burema <41987080+rburema@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:10:04 +0100 Subject: [PATCH] Code review: change name to 'vertex_distance_ratio'. To be better in line with the other variables. Done as part of CURA-11521 Co-authored-by: Saumya Jain <70144862+saumyaj3@users.noreply.github.com> --- plugins/SimulationView/SimulationPass.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py index d9aef98385..b723403797 100644 --- a/plugins/SimulationView/SimulationPass.py +++ b/plugins/SimulationView/SimulationPass.py @@ -146,7 +146,7 @@ class SimulationPass(RenderPass): end = 0 vertex_before_head = not_a_vector vertex_after_head = not_a_vector - last_to_next_ratio = 0.0 + vertex_distance_ratio = 0.0 towards_next_vertex = 0 element_counts = layer_data.getElementCounts() for layer in sorted(element_counts.keys()): @@ -165,7 +165,7 @@ class SimulationPass(RenderPass): pos_a = Vector(polygon.data[index][0], polygon.data[index][1], polygon.data[index][2]) vertex_before_head = pos_a - last_to_next_ratio = ratio + vertex_distance_ratio = ratio if ratio <= 0.0001 or index + 1 == len(polygon.data): # in case there multiple polygons and polygon changes, the first point has the same value as the last point in the previous polygon head_position = pos_a + node.getWorldPosition() @@ -221,7 +221,7 @@ class SimulationPass(RenderPass): if vertex_after_head != not_a_vector and vertex_after_head != not_a_vector: self._layer_shader.setUniformValue("u_last_vertex", vertex_before_head) self._layer_shader.setUniformValue("u_next_vertex", vertex_after_head) - self._layer_shader.setUniformValue("u_last_line_ratio", last_to_next_ratio) + self._layer_shader.setUniformValue("u_last_line_ratio", vertex_distance_ratio) last_line_start = current_layer_end last_line_end = current_layer_end + towards_next_vertex last_line_batch = RenderBatch(self._layer_shader, type = RenderBatch.RenderType.Solid, mode=RenderBatch.RenderMode.Lines, range = (last_line_start, last_line_end))