Skip to content

Commit

Permalink
Improve line rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcparkyn committed Oct 10, 2023
1 parent fa7e84d commit a4eee52
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions python/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from app.monitor_ble import StopCommand, StylusReading, monitor_ble

CANVAS_SIZE = (1080, 1080) # (width, height)
TRAIL_POINTS = 1000
TRAIL_POINTS = 6000
USE_3D_LINE = (
False # If true, uses a lower quality GL line renderer that supports 3D lines
)
Expand Down Expand Up @@ -110,19 +110,16 @@ def __init__(self):
# agg looks much better than gl, but only works with 2D data.
if USE_3D_LINE:
self.trail_line = visuals.Line(
pos=self.line_data_pos,
color="black",
width=1,
parent=self.view_top.scene,
method="gl",
)
else:
self.trail_line = visuals.Line(
pos=self.line_data_pos[:, 0:2],
color="black",
width=2,
width=3,
parent=self.view_top.scene,
method="agg",
antialias=False
)

axis = scene.visuals.XYZAxis(parent=self.view_top.scene)
Expand Down Expand Up @@ -160,6 +157,8 @@ def on_key_press(self, e: vispy.app.canvas.KeyEvent):
else:
recording_enabled.value = False
print("Recording disabled")
elif e.key == "C":
self.line_data_pressure *= 0


class MainWindow(QtWidgets.QMainWindow):
Expand Down

0 comments on commit a4eee52

Please sign in to comment.