Describe the bug
The generate_mesh() function in fullcontrol/visualize/plotly.py fails when colors_now is None. The code attempts to modify colors_now without first checking if it is set, causing a runtime error on the line colors_now[:] = np.array(colors_now, dtype=object)[good_points].
The error is triggered when generate_stl() in lab/fullcontrol/geometry_model/steps2geometry.py calls generate_mesh(), since it does not specify colors_now.
To Reproduce
Steps to reproduce the behavior:
Call the generate_mesh() function with colors_now=None or simply omit the colors_now argument.
Observe the error thrown when generate_mesh() tries to modify colors_now.
Expected behavior
The generate_mesh() function should handle the case where the optional argument colors_now takes it default value None gracefully and proceed without modification to colors_now if it is not provided. Adding an if colors_now is not None: check before modifying colors_now resolves this issue.
Screenshots
N/A
Desktop (please complete the following information):
OS: Windows 11 Home
Python Version: 3.12
Fullcontrol Version: 0.1.1
Lab Version: 8.3
Smartphone (please complete the following information):
N/A
Additional context
Bug occurs in fullcontrol/visualize/plotly.py within generate_mesh()
Suggested solution:
if colors_now is not None:
colors_now[:] = np.array(colors_now, dtype=object)[good_points]
Describe the bug The
generate_mesh()
function in fullcontrol/visualize/plotly.py fails whencolors_now
isNone
. The code attempts to modifycolors_now
without first checking if it is set, causing a runtime error on the linecolors_now[:] = np.array(colors_now, dtype=object)[good_points]
.The error is triggered when
generate_stl()
in lab/fullcontrol/geometry_model/steps2geometry.py callsgenerate_mesh()
, since it does not specifycolors_now
.To Reproduce Steps to reproduce the behavior:
generate_mesh()
function withcolors_now=None
or simply omit thecolors_now
argument.generate_mesh()
tries to modifycolors_now
.Expected behavior The
generate_mesh()
function should handle the case where the optional argumentcolors_now
takes it default valueNone
gracefully and proceed without modification tocolors_now
if it is not provided. Adding anif colors_now is not None:
check before modifyingcolors_now
resolves this issue.Screenshots N/A
Desktop (please complete the following information):
Smartphone (please complete the following information): N/A
Additional context Bug occurs in fullcontrol/visualize/plotly.py within generate_mesh()
Suggested solution:
Or force the user to provide
colors_now