qtvismach, a axis toolpath

  • MarkoPolo
  • Away
  • Elite Member
  • Elite Member
More
07 Mar 2024 21:44 #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

 
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Mar 2024 07:27 #295441 by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
I needed to modify primitives.py Color class for transparency:
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 or Create an account to join the conversation.

More
08 Mar 2024 08:31 - 08 Mar 2024 08:32 #295442 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath

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?

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.
Last edit: 08 Mar 2024 08:32 by Aciera.

Please Log in or Create an account to join the conversation.

  • MarkoPolo
  • Away
  • Elite Member
  • Elite Member
More
08 Mar 2024 17:30 #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.
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Mar 2024 19:24 #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.:
        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.
 
Attachments:

Please Log in or Create an account to join the conversation.

  • MarkoPolo
  • Away
  • Elite Member
  • Elite Member
More
08 Mar 2024 21:14 - 08 Mar 2024 21:29 #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
Last edit: 08 Mar 2024 21:29 by MarkoPolo.

Please Log in or Create an account to join the conversation.

More
09 Mar 2024 02:41 #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:
    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
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)
The following user(s) said Thank You: MarkoPolo

Please Log in or Create an account to join the conversation.

More
09 Mar 2024 08:55 #295494 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath

In this video you can see that the tool path rotates around the C axis, so I think it can be done.

Yes, I thought you wanted a straight line to wrap around a cylinder (ie a synchronized AX move to be shown as a helix).
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'
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 or Create an account to join the conversation.

  • MarkoPolo
  • Away
  • Elite Member
  • Elite Member
More
09 Mar 2024 08:58 - 09 Mar 2024 09:02 #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
Last edit: 09 Mar 2024 09:02 by MarkoPolo.

Please Log in or Create an account to join the conversation.

More
09 Mar 2024 09:30 #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:

 
Attachments:
The following user(s) said Thank You: MarkoPolo

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.165 seconds
Powered by Kunena Forum