qtvismach, a axis toolpath

More
1 month 5 days ago #349861 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath

If anyone uses Vismach and would like to test this out, please let me know.


I'd be _very_ interested indeed. Do you have a repo?

Please Log in to join the conversation.

More
1 month 5 days ago #349873 by MarkoPolo
I don't have a repository, but I can send the files.
Actually, it's just two modified files: `primitives.py` and `qt_vismach.py`.

Please Log in to join the conversation.

More
1 month 5 days ago #349888 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath
You want to attach those two files here? Or you could also open an issue on my github repo and attach them there:
github.com/Sigma1912/LinuxCNC_Demo_Configs/issues

Please Log in to join the conversation.

More
1 month 5 days ago #349889 by MarkoPolo
A new class for 3D stock has been added to `primitives.py`. It is suitable for XYZ machines but will not work with a rotary axis.
The sampling frequency is independent of the Vismach refresh rate (currently set to 50ms).
It automatically retrieves tool geometry from Vismach.

The toolpath handling in `qt_vismach.py` has been heavily optimized. It can now manage a much longer toolpath history without placing an excessive load on the CPU—effectively handling unlimited paths for typical use cases.
A small menu for selecting certain settings has also been added, with room for further options. It places almost no load on the CPU when the machine is idle.

I also created a test machine to verify the new stock functionality; although creating the solid is nearly identical to the existing methods, just one extra line of code is required. This machine does not define specific dimensions or positioning; it exists solely for testing the stock.

Please Log in to join the conversation.

More
1 month 4 days ago #349893 by Aciera
Replied by Aciera on topic qtvismach, a axis toolpath
Nice, thanks for sharing.

Please Log in to join the conversation.

More
1 month 3 days ago #349943 by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
Looks fantastic in pics! haven't trued it yet.

Please Log in to join the conversation.

More
3 weeks 5 days ago #350104 by cmorley
Replied by cmorley on topic qtvismach, a axis toolpath
I tried this out. Excellent job.
I did not if I move the origin the material stock does not move, even if I rebuild the material. Does this happen for you?

Please Log in to join the conversation.

More
3 weeks 5 days ago #350110 by MarkoPolo
Material movement won't work in `machine_test`; it is just a simple configuration for testing purposes. In my configuration, I write the following code in the custom qtdragon handler file:

if (hal.component_exists("vismach")) == False:
    c = hal.component("vismach")
    c.newpin("mat_X_min", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_Y_min", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_Z_min", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_X", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_Y", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_Z", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_X_max", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_Y_max", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("mat_Z_max", hal.HAL_FLOAT, hal.HAL_IN)
    c.newpin("hide-chuck", hal.HAL_BIT, hal.HAL_IN)
    c.newpin("hide-konik", hal.HAL_BIT, hal.HAL_IN)
    c.newpin("os3", hal.HAL_BIT, hal.HAL_IN)
    c.ready()


STATUS.connect('graphics-gcode-properties',lambda w, d: update_gcode_properties(d))
def update_gcode_properties(props):
    if props != None:
        print ("update update_gcode")

        s = linuxcnc.stat()
        s.poll()

        print("MatPoz        :", s.g5x_offset[2])   

        property_names = {
                'x': "X bounds:",'x_zero_rxy':'X @ Zero Rotation:',
                'y': "Y bounds:",'y_zero_rxy':'Y @ Zero Rotation:',
                'z': "Z bounds:",'z_zero_rxy':'Z @ Zero Rotation:',
                'a': "A bounds:", 'b': "B bounds:",
            }
        #print (props)
        X_poz_min = float((props.get('x_zero_rxy').split())[0])
        Y_poz_min = float((props.get('y_zero_rxy').split())[0])
        Z_poz_min = float((props.get('z_zero_rxy').split())[0])
        X_poz = float((props.get('x_zero_rxy').split())[4])
        Y_poz = float((props.get('y_zero_rxy').split())[4])
        Z_poz = float((props.get('z_zero_rxy').split())[4])
        X_poz_max = float((props.get('x_zero_rxy').split())[2])
        Y_poz_max = float((props.get('y_zero_rxy').split())[2])
#        Z_poz_max = float((props.get('z_zero_rxy').split())[2])
        Z_poz_max = (s.g5x_offset[2])

        # G20 -> G21
        if props.get('gcode_units') == 'in':
            X_poz_min *= 25.4
            X_poz *= 25.4
            X_poz_max *= 25.4

            Y_poz_min *= 25.4
            Y_poz *= 25.4
            Y_poz_max *= 25.4

            Z_poz_min *= 25.4
            Z_poz *= 25.4

        print ("mat_X_min =", X_poz_min,"    mat_X_max =", X_poz_max,"    mat_X =", X_poz)
        print ("mat_Y_min =", Y_poz_min,"    mat_Y_max =", Y_poz_max,"    mat_Y =", Y_poz)
        print ("mat_Z_min =", Z_poz_min,"    mat_Z_max =", Z_poz_max,"    mat_Z =", Z_poz)
        hal.set_p("vismach.mat_X_min", X_poz_min)
        hal.set_p("vismach.mat_X", X_poz)
        hal.set_p("vismach.mat_X_max", X_poz_max)
        hal.set_p("vismach.mat_Y_min", Y_poz_min)
        hal.set_p("vismach.mat_Y", Y_poz)
        hal.set_p("vismach.mat_Y_max", Y_poz_max)
        hal.set_p("vismach.mat_Z_min", Z_poz_min)
        hal.set_p("vismach.mat_Z", Z_poz )
        hal.set_p("vismach.mat_Z_max", Z_poz_max)

So, it writes the dimension positions to the HAL pins, and then, in the handler file, it reads the material dimensions from those pins (just like in that commented-out section that constructs the material).

This function is located in the qtdragon handler file because it isn't called within the vismach file itself when launching vismach in a standalone window; however, this approach allows for launching a second (or subsequent) vismach window without issues (e.g., to test with different parameters).

I'm constantly making tweaks—like saving the machined material to an STL file.
If you have any interesting ideas, let me know.
 

Please Log in to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum