C++ CadCam program development with CodeBlocks instead of QT

More
21 May 2021 02:26 #209722 by Joco
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.

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

More
21 May 2021 03:39 #209724 by Joco
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.
/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.

More
21 May 2021 05:41 - 21 May 2021 05:42 #209730 by Joco
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:
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);
}
"position" changed to "pos"

Now to actually looking at the code. B)
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.

More
21 May 2021 14:50 #209760 by Grotius
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.

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

More
22 May 2021 05:31 #209822 by Joco
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.

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

More
22 May 2021 07:18 - 22 May 2021 07:26 #209823 by Grotius
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.
Attachments:
Last edit: 22 May 2021 07:26 by Grotius.

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

More
23 May 2021 15:15 #209913 by Grotius
Hi Joco,

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.

More
23 May 2021 19:07 #209941 by Joco
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.

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

More
23 May 2021 19:38 #209946 by Grotius
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.

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

More
23 May 2021 20:55 #209950 by Joco
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". :P

Cheers - James.

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

Moderators: Skullworks
Time to create page: 0.124 seconds
Powered by Kunena Forum