- Posts: 7368
- Thank you received: 2181
qtvismach, a axis toolpath
- cmorley
- Offline
- Moderator
-
Less
More
1 year 10 months ago #317127
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
A little more difficult, as vismach doesn't know anything about the type of move, only that it has moved. I'll experiment a bit.
It sure seems useful if vismach and the normal plotter could be combined.
It sure seems useful if vismach and the normal plotter could be combined.
Please Log in or Create an account to join the conversation.
- MarkoPolo
- Online
- Elite Member
-
Less
More
- Posts: 319
- Thank you received: 90
1 year 10 months ago #317133
by MarkoPolo
Replied by MarkoPolo on topic qtvismach, a axis toolpath
I tried in qt_vismach.py in the same way as in the screenshot, but then the color of the entire generated path changes depending on the type of movement.
Maybe draw separate paths for each color, then it will be easier to turn off the selected path?
Maybe draw separate paths for each color, then it will be easier to turn off the selected path?
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
1 year 10 months ago #317168
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
I think we would have to add the motion color into the plot point.
(qt_mismach.py line 287 ish)
(qt_mismach.py line 287 ish)
Code:
# wx, wy, wz are the values to use for backplot
# so we save them in a buffer
if len(self.plotdata) == self.plotlen:
del self.plotdata[:self.plotlen // 10]
point = [wx, wy, wz]
if not self.plotdata or point != self.plotdata[-1]:
self.plotdata.append(point)
Please Log in or Create an account to join the conversation.
- MarkoPolo
- Online
- Elite Member
-
Less
More
- Posts: 319
- Thank you received: 90
1 year 10 months ago #317646
by MarkoPolo
Replied by MarkoPolo on topic qtvismach, a axis toolpath
I have tried various ways to use this code, but so far no results..
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
1 year 10 months ago #317648
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
I should have explained more.
point = [wx, wy, wz]
if not self.plotdata or point != self.plotdata[-1]:
self.plotdata.append(point)
This adds a plot point. We would need to change it to also add color.
point = [wx, wy, wz,color]
or maybe better:
self.plotdata.append([point, color])
then later in the file:
#GL.glColor3f(1.0, 0.5, 0.5)
GL.glBegin(GL.GL_LINE_STRIP)
for p,c in self.plotdata:
GL.glColor3f(*c)
GL.glVertex3f(*p)
GL.glEnd()
a few other initialization and clearing details to follow up. but that might work.
point = [wx, wy, wz]
if not self.plotdata or point != self.plotdata[-1]:
self.plotdata.append(point)
This adds a plot point. We would need to change it to also add color.
point = [wx, wy, wz,color]
or maybe better:
self.plotdata.append([point, color])
then later in the file:
#GL.glColor3f(1.0, 0.5, 0.5)
GL.glBegin(GL.GL_LINE_STRIP)
for p,c in self.plotdata:
GL.glColor3f(*c)
GL.glVertex3f(*p)
GL.glEnd()
a few other initialization and clearing details to follow up. but that might work.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
1 year 10 months ago #317656
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
Ok I pushed some work on this.
vismach_mill_xyz should show case it.
in your vismach script you need to add:
on top:
and in the Window class:
vismach_mill_xyz should show case it.
in your vismach script you need to add:
on top:
Code:
from qtvcp.core import Status
STATUS = Status()
and in the Window class:
Code:
STATUS.connect('motion-type-changed', lambda w, data: v.choosePlotColor(data))
# uncomment to change feed color and to see all colors
#v.setColorsAttribute('FEED',(0,1,0))
#print(v.colors)
The following user(s) said Thank You: tommylight, MarkoPolo
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.356 seconds