Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions fullcontrol/visualize/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ def random_blue():

def z_gradient(point: Point, bounding_box: BoundingBox):
z_range = max(bounding_box.rangez, 0.00000001)
# round to the same number of decimal places used for xyz ('precision_xyz') to avoid numerical rounding errors causing negative or very large (not allowbale) values in plot_data
# round to the same number of decimal places used for xyz ('precision_xyz') to avoid numerical rounding errors causing negative or very large (not allowable) values in plot_data
z_min = round(bounding_box.minz, 3)
return [0, round((point.z-z_min)/z_range, precision_color), 1]
# handle case where point.z is None (first point after extruder toggle)
z_val = point.z if point.z is not None else z_min
return [0, round((z_val-z_min)/z_range, precision_color), 1]

def print_sequence(point_count_now: int, point_count_total: int):
return [round(0.8*max(1-(2*point_count_now/point_count_total), 0), precision_color), round(max((2*point_count_now/point_count_total)-1, 0), precision_color), 1]
Expand Down