C++ CadCam program development with CodeBlocks instead of QT
21 May 2021 02:26 #209722
by Joco
Replied by Joco on topic C++ CadCam program development with CodeBlocks instead of QT
Thanks. Tried building the sample c++ example and getting wired errors on not finding the standard lib. Which has to be there as its a fundamental to the compile/dev env for gcc.
Can't find this include:
#include_next <stdlib.h>
Found this: stackoverflow.com/questions/56318759/how...tdlib-h-from-cstdlib
Just not sure where to put the correction. Or if I should even need to do said correction.
Can't find this include:
#include_next <stdlib.h>
Found this: stackoverflow.com/questions/56318759/how...tdlib-h-from-cstdlib
Just not sure where to put the correction. Or if I should even need to do said correction.
Please Log in or Create an account to join the conversation.
21 May 2021 03:39 #209724
by Joco
Replied by Joco on topic C++ CadCam program development with CodeBlocks instead of QT
On a hunch I edited the make file directly. Feels very hacky as shouldn't need to do this. But it got past this problem. Only to hit the next.
Ceetainly not "plug and play".
/home/james/develop/linux-opencascade-cplus/opencascade.cpp:409: error: ‘class QWheelEvent’ has no member named ‘position’
409 | m_view->StartZoomAtPoint(event->position().x(),event->position().y());
| ^~~~~~~~
Ceetainly not "plug and play".
Please Log in or Create an account to join the conversation.
21 May 2021 05:41 - 21 May 2021 05:42 #209730
by Joco
Replied by Joco on topic C++ CadCam program development with CodeBlocks instead of QT
Ok looks like solved it and got the demo working. Key things ...
1. needed to edit the graphics.pro file to make the includepath look like:
/usr/include/ has been removed. This solved the compile issue with the standard lib reference.
Figured out that there is a difference in methods between QT 5.12 and 5.15. The source was presumably coded to 5.15 but the default version on Mint 20 is 5.12. Had to change this section at the bottom of opencascade.cpp to look like:"position" changed to "pos"
Now to actually looking at the code.
1. needed to edit the graphics.pro file to make the includepath look like:
INCLUDEPATH += /usr/local/include/kdl/ \
/usr/local/include/opencascade/ \
/usr/include/eigen3/ \
/usr/local/lib/
/usr/include/ has been removed. This solved the compile issue with the standard lib reference.
Figured out that there is a difference in methods between QT 5.12 and 5.15. The source was presumably coded to 5.15 but the default version on Mint 20 is 5.12. Had to change this section at the bottom of opencascade.cpp to look like:
void Opencascade::wheelEvent(QWheelEvent *event)
{
m_view->StartZoomAtPoint(event->pos().x(),event->pos().y());
m_view->ZoomAtPoint(0, 0, event->angleDelta().y(), 0);
}
Now to actually looking at the code.
Last edit: 21 May 2021 05:42 by Joco.
The following user(s) said Thank You: tommylight, Grotius
Please Log in or Create an account to join the conversation.
21 May 2021 14:50 #209760
by Grotius
Replied by Grotius on topic C++ CadCam program development with CodeBlocks instead of QT
Hi,
Ok nice you got it running.
The opencascade class is a class that look quite complicated. But after a while you get familiar with it.
The opencascade code is very stable and mature. Some c++ source code parts are almost 20 years old now.
I have not searched if there excists already a dxf importer for opencascade. But i think using the dxfrw lib would be a nice
thing to start with. I have not searched but it should be perfect if there is already a example how to use the dxfrw lib.
I did some work on the robot project today. Made little progress. Difficult part. Combining scurve with euler angles.
Ok nice you got it running.
The opencascade class is a class that look quite complicated. But after a while you get familiar with it.
The opencascade code is very stable and mature. Some c++ source code parts are almost 20 years old now.
I have not searched if there excists already a dxf importer for opencascade. But i think using the dxfrw lib would be a nice
thing to start with. I have not searched but it should be perfect if there is already a example how to use the dxfrw lib.
I did some work on the robot project today. Made little progress. Difficult part. Combining scurve with euler angles.
Please Log in or Create an account to join the conversation.
22 May 2021 05:31 #209822
by Joco
Replied by Joco on topic C++ CadCam program development with CodeBlocks instead of QT
Opencascade is a beast. But I am startiong to feel like its a sledge hammer to crack a pine nut. At lease for the problem I 'm interested i solving.
I'm probably just struggling to find examples of its usage in a 2D space that I can make sense of.
I'm probably just struggling to find examples of its usage in a 2D space that I can make sense of.
Please Log in or Create an account to join the conversation.
22 May 2021 07:18 - 22 May 2021 07:26 #209823
by Grotius
Replied by Grotius on topic C++ CadCam program development with CodeBlocks instead of QT
HI,
Attached a example how to draw a line, circle and arc and text. drawing in 2d space is setting the screen fixed to top view.
How to set the top view is applied in the attached example.
But I am startiong to feel like its a sledge hammer to crack a pine nut.
I understand your feeling. But further on in the process, when you want to add lead-in etc. You have to use selection model to point
where the lead in must start when in editing mode. This is when the real advantage of the opencascade cad begin's.
In this link you can see how to apply gcode in a 3d matrix using primitives like circle, arc and lines.
Attached a example how to draw a line, circle and arc and text. drawing in 2d space is setting the screen fixed to top view.
How to set the top view is applied in the attached example.
But I am startiong to feel like its a sledge hammer to crack a pine nut.
I understand your feeling. But further on in the process, when you want to add lead-in etc. You have to use selection model to point
where the lead in must start when in editing mode. This is when the real advantage of the opencascade cad begin's.
In this link you can see how to apply gcode in a 3d matrix using primitives like circle, arc and lines.
Last edit: 22 May 2021 07:26 by Grotius.
Please Log in or Create an account to join the conversation.
23 May 2021 15:15 #209913
by Grotius
Replied by Grotius on topic C++ CadCam program development with CodeBlocks instead of QT
Hi Joco,
Did you made some progress? If you have problems with setting up the opencascade i can make a template for you.
Did you made some progress? If you have problems with setting up the opencascade i can make a template for you.
Please Log in or Create an account to join the conversation.
23 May 2021 19:07 #209941
by Joco
Replied by Joco on topic C++ CadCam program development with CodeBlocks instead of QT
At the moment I’m in the process of overcoming two decades of ignoring c++ coupled with a bout of bronchitis. Its slow going.
Starting simple by trying to understand the dxf lib and how to build for it. I had expected it to build a dxf graph in memory. It doesnt seem to. It looks more like it is behaving like a sax parser.
Also learning a build system. Using qmake as it seems the simplest.
At this point opencascade is a loooong way off.
Starting simple by trying to understand the dxf lib and how to build for it. I had expected it to build a dxf graph in memory. It doesnt seem to. It looks more like it is behaving like a sax parser.
Also learning a build system. Using qmake as it seems the simplest.
At this point opencascade is a loooong way off.
Please Log in or Create an account to join the conversation.
23 May 2021 19:38 #209946
by Grotius
Replied by Grotius on topic C++ CadCam program development with CodeBlocks instead of QT
Hi Joco,
coupled with a bout of bronchitis.
Your health is the most important thing.
I hope you will recover soon. Summer is coming.
Wich dxf lib are you looking at? The one i suggested?
If you give me the link i can help you a little bit to find out how to use it.
Also learning a build system. Using qmake as it seems the simplest.
cmake is i think the eayest off all. Just "mkdir build" and "cd build" and "cmake .."
But it depends on the lib and what the readme of the lib tells you.
Ok don't worry. Soon we gonna rock and roll.
coupled with a bout of bronchitis.
Your health is the most important thing.
I hope you will recover soon. Summer is coming.
Wich dxf lib are you looking at? The one i suggested?
If you give me the link i can help you a little bit to find out how to use it.
Also learning a build system. Using qmake as it seems the simplest.
cmake is i think the eayest off all. Just "mkdir build" and "cd build" and "cmake .."
But it depends on the lib and what the readme of the lib tells you.
Ok don't worry. Soon we gonna rock and roll.
Please Log in or Create an account to join the conversation.
23 May 2021 20:55 #209950
by Joco
Replied by Joco on topic C++ CadCam program development with CodeBlocks instead of QT
I hope you will recover soon. Summer is coming.
Not down in NZ. WInter is coming.
Wich dxf lib are you looking at? The one i suggested?
If you give me the link i can help you a little bit to find out how to use it.
Yup the one you suggested.
github.com/codelibs/libdxfrw
However I ended up having to download a tar file from sourcefourge to be able to compile it. The git repo seems to be missing some file(s) that configire the build system.
I got the 6.3 tar ball:
sourceforge.net/projects/libdxfrw/files/
cmake is i think the eayest off all. Just "mkdir build" and "cd build" and "cmake .."
But it depends on the lib and what the readme of the lib tells you.
This was for me to use as a build tool for a blank/new project. qmake is nice in that the "spec" file is mostly just name/value style. I had a look at cmake and just from the tutorial it immediately came aross as more complex and more program language like. I'm sure its powerful and all that but it just put me off from the get go. If it is simpler, they certainly don't convey that from their getting start tuorial. So I came away from reading that with the sense of, "I have enough arcane stuff with C++ without adding to it with this thing".
Cheers - James.
Not down in NZ. WInter is coming.
Wich dxf lib are you looking at? The one i suggested?
If you give me the link i can help you a little bit to find out how to use it.
Yup the one you suggested.
github.com/codelibs/libdxfrw
However I ended up having to download a tar file from sourcefourge to be able to compile it. The git repo seems to be missing some file(s) that configire the build system.
I got the 6.3 tar ball:
sourceforge.net/projects/libdxfrw/files/
cmake is i think the eayest off all. Just "mkdir build" and "cd build" and "cmake .."
But it depends on the lib and what the readme of the lib tells you.
This was for me to use as a build tool for a blank/new project. qmake is nice in that the "spec" file is mostly just name/value style. I had a look at cmake and just from the tutorial it immediately came aross as more complex and more program language like. I'm sure its powerful and all that but it just put me off from the get go. If it is simpler, they certainly don't convey that from their getting start tuorial. So I came away from reading that with the sense of, "I have enough arcane stuff with C++ without adding to it with this thing".
Cheers - James.
Please Log in or Create an account to join the conversation.
Moderators: Skullworks
Time to create page: 0.102 seconds