qtvismach, a axis toolpath

More
09 Mar 2024 18:10 #295529 by MarkoPolo
Thanks a lot Aciera, this code example and xyzac-trt-gui.py simulation file helped me a lot.
Now it works the way I wanted.
 

I would also like to achieve transparency.
After basing the axis, the cone is filled with color, without transparency.
Where would I use "BLEND"?
Attachments:

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

More
10 Mar 2024 02:35 #295553 by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
blend is the code that I added to primitives.py

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

More
10 Mar 2024 16:47 #295584 by MarkoPolo
I made a small modification to the code and now it works properly.
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)
        GL.glEnable(GL.GL_BLEND)
        GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)

    def unapply(self):
        GL.glPopAttrib()
        GL.glDisable(GL.GL_BLEND)
 

I was hoping that the toolpath would be visible inside the solid, but this is not the case...


 
Attachments:

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

More
10 Mar 2024 16:53 #295585 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath
Interesting, the tool seems to be cut off too.

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

More
10 Mar 2024 17:04 - 10 Mar 2024 17:07 #295588 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath
May have something to do with 'depth testing' as seen in this image where some of the background scene is not visible through the red tinted glass:

 

The above image comes from this article which may be useful:
drennonowereve.blogspot.com/2022/03/how-...color-in-opengl.html

[edit]
Just noticed the spelling in the article is a tad strange.
Attachments:
Last edit: 10 Mar 2024 17:07 by Aciera.

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

More
10 Mar 2024 17:53 #295594 by MarkoPolo
I just used this article today.

I positioned the two pieces for the test behind the workpiece and only the actual head and countertop are visible.
I don't know much about opengl, I guess it can be configured somehow...
 
Attachments:

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

More
12 Mar 2024 03:33 #295712 by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
Maybe the order of the parts can do it.
I see you can see the base and chuck through the material but not the column or other chuck.

probably there is a opengl command to directly set Zdepth but like you i know just enough to get it to mostly work :)
The following user(s) said Thank You: tommylight

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

More
12 Mar 2024 22:58 #295793 by MarkoPolo
I will leave the topic of transparency for later, I have an idea how to solve it differently.
Please tell me how to easily read the x and y movement values from the "setup/properties" tab? I need these values to automatically generate the dimensions of the workpiece in the A-axis holder.

The second problem is the disappearing tool path in qtvismach. The same thing happens as in the preview window in qtdragon. A longer toolpath history is needed, or it doesn't disappear at all.
 
Attachments:

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

More
13 Mar 2024 01:01 #295797 by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
You can get them from STATUS, as long as the preview window is in the same python context.
Meaning you would need to have the vismach window embedded in, or loaded from, qtdragon.
The normal qtvcp embedding should work, getting a separate window is custom work.

then:
STATUS.connect('graphics-gcode-properties', lambda w, d: self.update_gcode_properties(d))
would give you the raw information in the function update_gcode_properties().
You can see how it was done in qtdragon_handler.py, but something like this:
def update_gcode_properties(self,props):
        print(props.get('x'))
        print(props.get('y'))
        print(props.get('z'))
 
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.147 seconds
Powered by Kunena Forum