- Posts: 22011
- Thank you received: 7491
QT C++ code samples
- tommylight
- Offline
- Moderator
-
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
- Posts: 2419
- Thank you received: 2349
I started a brand new QT project today, the DxfDecoder project needs to be more structured to become Sheetcam and Fusion competitive in the future.
Project setup, to be expanded :
Terminal output of a dxf file array : ( Parallel Multidimensional Array's are the core of good luck !!)
I did a trick. I made one array's for Integers values and one array for Double values. The 2 array's are working parallel.
So it's more efficient coded. Every day we learn about mistakes !
Very nice! Thank you.
Thanks Tommy !!
It looks promising so far to me. In the beginning of the new QT project i will write some code special for contour recognizing.
This is the most difficult part, and hope to pass that part soon.
Constructing a formula (algoritme) for autonesting i must investegate.
Mayby OpenGL has already classes that can look if object's are in collision, if not i try to write some abracadabra code for this.
For now it's all about sorting the array that is loaded in memory. (look for matching color codes, sort lines and arc's to objects's etc)
Manipulating array's is just like sorting text files. I was started that way in C about year ago, but i have to use the pc memory (loaded array) to do user defined trick's and output G41.1 and G41.2 on request.
The sorting class with a tolerance input. If user has a bad cad drawing, it even can make a closed contour !!
It looks like a abs formula, but now written for dummies like me. :lol:
@Phill,
I had have a global look at your plasmac manual. I think you could publish this document.
Thanks for your work!! Remember you could use or integrate the Thermal Dynamics cutting charts open source, i have approval for this.
@Rodw,
Thanks for your plasma document. My cap off for your work !! Where do you keep the time for this?
Nice to see Linuxcnc is growing exponential related to plasma.
I can't believe i am writing a C++ coded cam program. Why do i do this ??
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
-
- Posts: 22011
- Thank you received: 7491
That is a question for future generations !Grotius wrote: . Why do i do this ??
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
- Posts: 12170
- Thank you received: 4153
Thanks for the feedback, we'll get it published now. Phill is looking after that for me and I paid my graphic artist to do a couple of graphics so its all original content with no copyright issues.Grotius wrote:
@Rodw,
Thanks for your plasma document. My cap off for your work !! Where do you keep the time for this?
Nice to see Linuxcnc is growing exponential related to plasma.
Grotius wrote: I can't believe i am writing a C++ coded cam program. Why do i do this ??
Because you love it!
I have not had the time to follow your project but if you are sorting arrays, google "bubble sort" as its the most efficient (eg fastest) but if you stop using arrays and used dynamically allocated memory and linked lists, sorting becomes even quicker becasue you are just changing the linked list pointers (*previous and *next) rather than copying data from one array element to another.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
- Posts: 2419
- Thank you received: 2349
I saw indeed pictures i never have seen before... Nice work!! I can share some cost's with you.
linked lists
www.tutorialspoint.com/cplusplus-program...t-singly-linked-list
for QT : doc.qt.io/qt-5/qlinkedlist.html
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
- Posts: 12170
- Thank you received: 4153
Grotius wrote: I paid my graphic artist to do a couple of graphics so its all original content with no copyright issues.
I saw indeed pictures i never have seen before... Nice work!! I can share some cost's with you.
linked lists
www.tutorialspoint.com/cplusplus-program...t-singly-linked-list
for QT : doc.qt.io/qt-5/qlinkedlist.html
Now you are talking. Its a fairly advanced stuff as you need to uses structures and pointers so there is some prerequisite knowledge.. But if you don't use them, you are not really a C programmer. (well not an efficient one anyway!) This also looks good.
www.geeksforgeeks.org/linked-list-set-1-introduction/
Some times, it is useful to mainatin a double linked list so each element knows where the one before it is as well as the next one in front. This actually allows you to move an element in the list to any other location in the list very easilly. I'm a bit rusty on this stuff so you will be on your own!
I'm fine with the costs, my small contribution to the Open source movement
Please Log in or Create an account to join the conversation.