- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
How would you design a real time application for cnc control in c / c++ ???
24 Jan 2022 17:32 #232986
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Just for info.
For opencascade i have a new example for linux users : github.com/grotius-cnc/occt-samples-qopenglwidget
For opencascade i have a new example for linux users : github.com/grotius-cnc/occt-samples-qopenglwidget
- made linux compatible.
- It has widget overlay.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
24 Jan 2022 18:45 #232996
by bkt
Replied by bkt on topic How would you design a real time application for cnc control in c / c++ ???
not my project but thanks
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
26 Jan 2022 21:57 #233236
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
I coded some more and finally came up with this template desgin.
github.com/grotius-cnc/occt-samples-qopenglwidget
The nice thing is, it tracks your current mouse position onto the objects.
It is based on graphical gui design. Has qt widget overlay, and has some additional menu options.
I coded some more and finally came up with this template desgin.
github.com/grotius-cnc/occt-samples-qopenglwidget
The nice thing is, it tracks your current mouse position onto the objects.
It is based on graphical gui design. Has qt widget overlay, and has some additional menu options.
Please Log in or Create an account to join the conversation.
03 Feb 2022 01:08 #233848
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
The past 8 day's i did a OpenCascade Hacking Course.
The result is zuperrr satisfying.
The problem was as follows.
With Opencascade you can draw nice things, like 3d models, gcode, cad data etc.
This is all done trough the opencascade c++ api.
In some scenario's you want to do a direct OpenGL function call from Opencascade and render this to the screen.
Haha..
Problem... You guess.
An exotic direct opengl call could be this project : github.com/grotius-cnc/qt_3d_mouse_ray-tracing
It is used for ray-tracing. But you can forward the lcnc gremlin gui in this way. Lots of scenario's need
direct opengl commands.
You can not draw a opengl core coded line, point etc with Opencascade.
But after some investegation and source code modifiation
i could draw a line's in opengl trough the opencascade interface.
Source code :
Now i will make a permanent hook into the source of opencascade. The opencascade lib is now compiled as qt project.
The new Opencascade.deb archive will have this opengl core code hook.
The past 8 day's i did a OpenCascade Hacking Course.
The result is zuperrr satisfying.
The problem was as follows.
With Opencascade you can draw nice things, like 3d models, gcode, cad data etc.
This is all done trough the opencascade c++ api.
In some scenario's you want to do a direct OpenGL function call from Opencascade and render this to the screen.
Haha..
Problem... You guess.
An exotic direct opengl call could be this project : github.com/grotius-cnc/qt_3d_mouse_ray-tracing
It is used for ray-tracing. But you can forward the lcnc gremlin gui in this way. Lots of scenario's need
direct opengl commands.
You can not draw a opengl core coded line, point etc with Opencascade.
But after some investegation and source code modifiation
i could draw a line's in opengl trough the opencascade interface.
Source code :
Now i will make a permanent hook into the source of opencascade. The opencascade lib is now compiled as qt project.
The new Opencascade.deb archive will have this opengl core code hook.
Attachments:
The following user(s) said Thank You: tommylight, bkt
Please Log in or Create an account to join the conversation.
05 Feb 2022 00:40 #234003
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Attachments:
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
05 Feb 2022 17:49 - 05 Feb 2022 17:51 #234034
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
Ok this works. It can now export some different filetypes.
It looks like a gcode ripper : www.scorchworks.com/Gcoderipper/gcoderipper.html#split
I had to dive into the cad arc angles a little bit. In opencascade the angles differs a bit from the autocad angles.
Now that's solved. For example. Autocad radians 0 = east position. Opencascade works a little different.
export stefile solid (.step) to dxf (.dxf)
export gcodefile (ngc) to dxf (.dxf)
exporting a dxf to ngc will have no value. It has to be organized, and a dxf is far from organized.
Ok this works. It can now export some different filetypes.
It looks like a gcode ripper : www.scorchworks.com/Gcoderipper/gcoderipper.html#split
I had to dive into the cad arc angles a little bit. In opencascade the angles differs a bit from the autocad angles.
Now that's solved. For example. Autocad radians 0 = east position. Opencascade works a little different.
export stefile solid (.step) to dxf (.dxf)
export gcodefile (ngc) to dxf (.dxf)
exporting a dxf to ngc will have no value. It has to be organized, and a dxf is far from organized.
Attachments:
Last edit: 05 Feb 2022 17:51 by Grotius.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
07 Feb 2022 16:16 #234257
by udoS
Replied by udoS on topic How would you design a real time application for cnc control in c / c++ ???
@Grotius
Hi Grotius
how could this new knowledge help to create a realy good and fast realtime path.
Any new insight on that topic.
About your sample:
in Line 351 and 368
//myView->SetWindow (aWindow, (Aspect_RenderingContext) glXGetCurrentContext());
I do not find " glXGetCurrentContext() "
Debian 10
QtCreator5.0.2
occ 7.6
Vulkan Instance Version: 1.1.97
Best Regards
Hi Grotius
how could this new knowledge help to create a realy good and fast realtime path.
Any new insight on that topic.
About your sample:
in Line 351 and 368
//myView->SetWindow (aWindow, (Aspect_RenderingContext) glXGetCurrentContext());
I do not find " glXGetCurrentContext() "
Debian 10
QtCreator5.0.2
occ 7.6
Vulkan Instance Version: 1.1.97
Best Regards
Please Log in or Create an account to join the conversation.
20 Feb 2022 18:43 #235407
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
The "glXGetCurrentContext()" comes from the glx.h file wich is included by installing :
$ sudo apt-get install libgl1-mesa-dev
how could this new knowledge help to create a realy good and fast realtime path.
I tested program's over 1000.000 lines a few weeks ago. This is usable to preview toolpaths.
This will explain how to setup this type of shapes.
Currently building a sketcher app.
The "glXGetCurrentContext()" comes from the glx.h file wich is included by installing :
$ sudo apt-get install libgl1-mesa-dev
how could this new knowledge help to create a realy good and fast realtime path.
I tested program's over 1000.000 lines a few weeks ago. This is usable to preview toolpaths.
This will explain how to setup this type of shapes.
Currently building a sketcher app.
Attachments:
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
23 Feb 2022 06:02 #235582
by udoS
Replied by udoS on topic How would you design a real time application for cnc control in c / c++ ???
@Grotius
That looks really good.
Grotius, have you ever tried to separate the cnc from the HAL.
How do the HAL and the cnc interact at startup. ?
That looks really good.
Grotius, have you ever tried to separate the cnc from the HAL.
How do the HAL and the cnc interact at startup. ?
Please Log in or Create an account to join the conversation.
01 Mar 2022 21:57 #236132
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi Udo,
Grotius, have you ever tried to separate the cnc from the HAL.
I don't get this question. But you don't need hal to create a cnc program like lcnc.
Hal is just a connection to talk to real hardware.
You could make a program without hal and just sent data to some port of your pc. Only problem is
if you need 1ms to update, you end up writing a kernel module. Hal is a kernel module.
How do the HAL and the cnc interact at startup. ?
In hal-core latest examples this is tricky to understand.
It all start's in hal.
1.halmodule.c load's some dynamic memory in a *ptr.
(this is a array of data, like numbers, text etc, c-code compatible)
2.Then the *ptr is passed to the c++ side in userland.
(the *ptr is readed by the qt-app. The qt-app also stores data back into the pointer).
3.The app has done it's thing and the *ptr is given back to the halmodule.c to be ready to read out.
(there is a flag that tells the halmodule, when to read out, because the thread's are different).
Grotius, have you ever tried to separate the cnc from the HAL.
I don't get this question. But you don't need hal to create a cnc program like lcnc.
Hal is just a connection to talk to real hardware.
You could make a program without hal and just sent data to some port of your pc. Only problem is
if you need 1ms to update, you end up writing a kernel module. Hal is a kernel module.
How do the HAL and the cnc interact at startup. ?
In hal-core latest examples this is tricky to understand.
It all start's in hal.
1.halmodule.c load's some dynamic memory in a *ptr.
(this is a array of data, like numbers, text etc, c-code compatible)
2.Then the *ptr is passed to the c++ side in userland.
(the *ptr is readed by the qt-app. The qt-app also stores data back into the pointer).
3.The app has done it's thing and the *ptr is given back to the halmodule.c to be ready to read out.
(there is a flag that tells the halmodule, when to read out, because the thread's are different).
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
Time to create page: 0.193 seconds