- Posts: 319
- Thank you received: 0
qtvismach, a axis toolpath
2 years 7 months ago #295430
by MarkoPolo
qtvismach, a axis toolpath was created by MarkoPolo
I did simulations of my xyza machine and I have a problem with the tool trace in the A axis. I would like the entire tool path to rotate around the A axis, which would result in drawing a milled solid.
Does anyone have a qtvismach file with a similar configuration as an example that would help me configure it properly?
The second problem is the transparency of the solid.
e.g. "solid = Color([1, 0.6, 0.6, 0.5],[solid])" I think the third parameter 0.5 should be the color opacity or transparency value, but it doesn't work.
Is it possible to make semi-transparent objects in qtvismach?
Marek
Does anyone have a qtvismach file with a similar configuration as an example that would help me configure it properly?
The second problem is the transparency of the solid.
e.g. "solid = Color([1, 0.6, 0.6, 0.5],[solid])" I think the third parameter 0.5 should be the color opacity or transparency value, but it doesn't work.
Is it possible to make semi-transparent objects in qtvismach?
Marek
Attachment not found
Please Log in to join the conversation.
2 years 7 months ago #295441
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
I needed to modify primitives.py Color class for transparency:
Code:
class Color(Collection):
def __init__(self, color, parts):
self.color = color
Collection.__init__(self, parts)
def apply(self):
GL.glPushAttrib(GL.GL_LIGHTING_BIT)
GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE, self.color)
if self.color[3] < 1:
GL.glEnable(GL.GL_BLEND)
GL.glBlendColor(0, 0, 0, self.color[3]) # rgba
def unapply(self):
GL.glPopAttrib()
GL.glDisable(GL.GL_BLEND)
The the alpha setting is honoured.
Does mill turn not help with the A axis?
Please Log in to join the conversation.
2 years 7 months ago #295442
by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath
If you mean the tool path to be drawn wrapped around a zylinder, this is currently not possible. All the logger, that is used to draw the toolpath history, does is collect collect coordinate values. It has no concept of a rotational center at all.I would like the entire tool path to rotate around the A axis, which would result in drawing a milled solid.
Does anyone have a qtvismach file with a similar configuration as an example that would help me configure it properly?
Please Log in to join the conversation.
2 years 7 months ago #295464
by MarkoPolo
Replied by MarkoPolo on topic qtvismach, a axis toolpath
I modified the primitives.py file, but it didn't change anything, there is no transparency. I tested on various configurations. Is there anything else that needs to be modified?
As for the tool trace, the lathe configuration does not change anything either.
In this video you can see that the tool path rotates around the C axis, so I think it can be done.
As for the tool trace, the lathe configuration does not change anything either.
In this video you can see that the tool path rotates around the C axis, so I think it can be done.
Please Log in to join the conversation.
2 years 7 months ago #295469
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
well aside from setting the color opacity of the part like you showed, but the opacity is 1.0 most clear - 0 solid.
that does seem back wards so you could change the code a bit to do the opposite.:
You can see the A axis spindle is see through.
that does seem back wards so you could change the code a bit to do the opposite.:
Code:
if self.color[3] < 1:
GL.glEnable(GL.GL_BLEND)
GL.glBlendColor(0, 0, 0, 1 - self.color[3]) # rgba
You can see the A axis spindle is see through.
Attachment not found
Please Log in to join the conversation.
2 years 7 months ago #295477
by MarkoPolo
Replied by MarkoPolo on topic qtvismach, a axis toolpath
Well, it actually works for you.
I check on two virtual machines and one real machine, but it doesn't work on either of them.
This is not a fourth value problem, because I have different values entered in different objects.
In the /usr/bin/millturngui simulation I also changed the fourth value, with no effect.
I don't know what the problem could be
edition
Yes, /usr/bin/millturngui is in TK, but qtvcp vismach_millturn doesn't work either
I check on two virtual machines and one real machine, but it doesn't work on either of them.
This is not a fourth value problem, because I have different values entered in different objects.
In the /usr/bin/millturngui simulation I also changed the fourth value, with no effect.
I don't know what the problem could be
edition
Yes, /usr/bin/millturngui is in TK, but qtvcp vismach_millturn doesn't work either
Please Log in to join the conversation.
2 years 7 months ago #295486
by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
Could be an opengui issue - all linuxcnc's opengl code uses ancient code libraries.
try this - it sets everything half alpha:
If it doesn't work then I would guess openGl problem.
Tk doesn't support alpha color either (it's why the qt version didn't)
try this - it sets everything half alpha:
Code:
def apply(self):
GL.glPushAttrib(GL.GL_LIGHTING_BIT)
GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE, self.color)
GL.glEnable(GL.GL_BLEND)
GL.glBlendColor(0, 0, 0, .5) # rgba
Tk doesn't support alpha color either (it's why the qt version didn't)
Please Log in to join the conversation.
2 years 7 months ago #295494
by Aciera
What you want is quite standard, you just need to attach 'work' to your rotary table.
This is an example from '/src/hal/user_comps/vismach/xyzac-trt-gui.py'
Examples can be found in all the vismach models with work side rotation (eg xyzac-trt-gui.py, xyzbc-trt-gui-py, xyzab-tdr-gui-py)
Replied by Aciera on topic qtvismach, a axis toolpath
Yes, I thought you wanted a straight line to wrap around a cylinder (ie a synchronized AX move to be shown as a helix).In this video you can see that the tool path rotates around the C axis, so I think it can be done.
What you want is quite standard, you just need to attach 'work' to your rotary table.
This is an example from '/src/hal/user_comps/vismach/xyzac-trt-gui.py'
Code:
work = Capture()
ctable = Collection([
work,
CylinderZ(-18, 50, 0, 50),
# cross
Color([1,1,1,0], [CylinderX(-50,1,50,1)]),
Color([1,1,1,0], [CylinderY(-50,1,50,1)]),
# lump on one side
Color([1,1,1,0], [Box(42, -4, -20, 51, 4, 5)])
])
ctable = HalRotate([ctable],c,"rotate-c",1,0,0,1)
Examples can be found in all the vismach models with work side rotation (eg xyzac-trt-gui.py, xyzbc-trt-gui-py, xyzab-tdr-gui-py)
Please Log in to join the conversation.
2 years 7 months ago #295495
by MarkoPolo
Replied by MarkoPolo on topic qtvismach, a axis toolpath
it doesn't work with this code either. I've also tried entering a static value there before, but why does it work for you?
I tried on different systems, without success.
edition
I just noticed the reply.
Thanks Aciera for the code, I will try to use it.
I'll let you know if it works
I tried on different systems, without success.
edition
I just noticed the reply.
Thanks Aciera for the code, I will try to use it.
I'll let you know if it works
Please Log in to join the conversation.
2 years 7 months ago #295497
by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath
As for open glTransparency:
As cmorley said, the alpha channel is broken and you have to use 'BLEND' and affiliated functions. I find it terribly confusing and I usually end having it where I did not want it.
To check if it works on your system you could just start the 'axis' simulation config and home the machine, Then look at the tool cone (which should be transparent):
I know it's not in vismach or qt but it's all opengl in the background:
As cmorley said, the alpha channel is broken and you have to use 'BLEND' and affiliated functions. I find it terribly confusing and I usually end having it where I did not want it.
To check if it works on your system you could just start the 'axis' simulation config and home the machine, Then look at the tool cone (which should be transparent):
Attachment not found
I know it's not in vismach or qt but it's all opengl in the background:
Please Log in to join the conversation.
Time to create page: 0.070 seconds
